summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/HPMchar.c3
-rw-r--r--src/char/Makefile.in27
-rw-r--r--src/char/char.c1726
-rw-r--r--src/char/char.h63
-rw-r--r--src/char/geoip.c9
-rw-r--r--src/char/geoip.h2
-rw-r--r--src/char/int_auction.c58
-rw-r--r--src/char/int_auction.h8
-rw-r--r--src/char/int_elemental.c95
-rw-r--r--src/char/int_elemental.h2
-rw-r--r--src/char/int_guild.c120
-rw-r--r--src/char/int_guild.h10
-rw-r--r--src/char/int_homun.c137
-rw-r--r--src/char/int_homun.h2
-rw-r--r--src/char/int_mail.c49
-rw-r--r--src/char/int_mail.h2
-rw-r--r--src/char/int_mercenary.c83
-rw-r--r--src/char/int_mercenary.h2
-rw-r--r--src/char/int_party.c73
-rw-r--r--src/char/int_party.h8
-rw-r--r--src/char/int_pet.c83
-rw-r--r--src/char/int_pet.h4
-rw-r--r--src/char/int_quest.c13
-rw-r--r--src/char/int_quest.h2
-rw-r--r--src/char/int_storage.c372
-rw-r--r--src/char/int_storage.h9
-rw-r--r--src/char/inter.c256
-rw-r--r--src/char/inter.h22
-rw-r--r--src/char/loginif.c3
-rw-r--r--src/char/loginif.h2
-rw-r--r--src/char/mapif.c76
-rw-r--r--src/char/mapif.h69
-rw-r--r--src/char/pincode.c79
-rw-r--r--src/char/pincode.h6
-rw-r--r--src/common/HPM.c232
-rw-r--r--src/common/HPM.h18
-rw-r--r--src/common/HPMDataCheck.h70
-rw-r--r--src/common/HPMSymbols.inc.h281
-rw-r--r--src/common/HPMi.h43
-rw-r--r--src/common/Makefile.in34
-rw-r--r--src/common/atomic.h2
-rw-r--r--src/common/cbasetypes.h86
-rw-r--r--src/common/conf.c381
-rw-r--r--src/common/conf.h156
-rw-r--r--src/common/console.c87
-rw-r--r--src/common/console.h24
-rw-r--r--src/common/core.c143
-rw-r--r--src/common/core.h2
-rw-r--r--src/common/db.c724
-rw-r--r--src/common/db.h392
-rw-r--r--src/common/des.c162
-rw-r--r--src/common/des.h45
-rw-r--r--src/common/ers.c24
-rw-r--r--src/common/ers.h2
-rw-r--r--src/common/grfio.c515
-rw-r--r--src/common/grfio.h108
-rw-r--r--src/common/mapindex.c37
-rw-r--r--src/common/mapindex.h8
-rw-r--r--src/common/md5calc.c178
-rw-r--r--src/common/md5calc.h44
-rw-r--r--src/common/memmgr.c85
-rw-r--r--src/common/memmgr.h8
-rw-r--r--src/common/mmo.h165
-rw-r--r--src/common/mutex.c170
-rw-r--r--src/common/mutex.h168
-rw-r--r--src/common/nullpo.c2
-rw-r--r--src/common/nullpo.h2
-rw-r--r--src/common/random.c62
-rw-r--r--src/common/random.h84
-rw-r--r--src/common/showmsg.c28
-rw-r--r--src/common/showmsg.h13
-rw-r--r--src/common/socket.c653
-rw-r--r--src/common/socket.h47
-rw-r--r--src/common/spinlock.h89
-rw-r--r--src/common/sql.c272
-rw-r--r--src/common/sql.h80
-rw-r--r--src/common/strlib.c20
-rw-r--r--src/common/strlib.h8
-rw-r--r--src/common/sysinfo.c133
-rw-r--r--src/common/sysinfo.h1
-rw-r--r--src/common/thread.c250
-rw-r--r--src/common/thread.h232
-rw-r--r--src/common/timer.c80
-rw-r--r--src/common/timer.h2
-rw-r--r--src/common/utils.c31
-rw-r--r--src/common/utils.h5
-rw-r--r--src/common/winapi.h2
-rw-r--r--src/config/classes/general.h2
-rw-r--r--src/config/const.h2
-rw-r--r--src/config/core.h13
-rw-r--r--src/config/renewal.h2
-rw-r--r--src/config/secure.h2
-rw-r--r--src/login/HPMlogin.c5
-rw-r--r--src/login/Makefile.in31
-rw-r--r--src/login/account.h16
-rw-r--r--src/login/account_sql.c362
-rw-r--r--src/login/ipban.h9
-rw-r--r--src/login/ipban_sql.c285
-rw-r--r--src/login/lclif.c570
-rw-r--r--src/login/lclif.h150
-rw-r--r--src/login/lclif.p.h332
-rw-r--r--src/login/login.c1000
-rw-r--r--src/login/login.h42
-rw-r--r--src/login/loginlog.h4
-rw-r--r--src/login/loginlog_sql.c202
-rw-r--r--src/map/HPMmap.c4
-rw-r--r--src/map/Makefile.in27
-rw-r--r--src/map/atcommand.c675
-rw-r--r--src/map/atcommand.h23
-rw-r--r--src/map/battle.c581
-rw-r--r--src/map/battle.h33
-rw-r--r--src/map/battleground.c54
-rw-r--r--src/map/battleground.h12
-rw-r--r--src/map/buyingstore.c10
-rw-r--r--src/map/buyingstore.h2
-rw-r--r--src/map/channel.c110
-rw-r--r--src/map/channel.h11
-rw-r--r--src/map/chat.c40
-rw-r--r--src/map/chat.h15
-rw-r--r--src/map/chrif.c71
-rw-r--r--src/map/chrif.h10
-rw-r--r--src/map/clif.c2649
-rw-r--r--src/map/clif.h127
-rw-r--r--src/map/date.c2
-rw-r--r--src/map/date.h2
-rw-r--r--src/map/duel.c18
-rw-r--r--src/map/duel.h2
-rw-r--r--src/map/elemental.c44
-rw-r--r--src/map/elemental.h6
-rw-r--r--src/map/guild.c123
-rw-r--r--src/map/guild.h42
-rw-r--r--src/map/homunculus.c130
-rw-r--r--src/map/homunculus.h10
-rw-r--r--src/map/instance.c15
-rw-r--r--src/map/instance.h2
-rw-r--r--src/map/intif.c325
-rw-r--r--src/map/intif.h20
-rw-r--r--src/map/irc-bot.c232
-rw-r--r--src/map/irc-bot.h133
-rw-r--r--src/map/itemdb.c610
-rw-r--r--src/map/itemdb.h154
-rw-r--r--src/map/log.c384
-rw-r--r--src/map/log.h62
-rw-r--r--src/map/mail.c2
-rw-r--r--src/map/mail.h2
-rw-r--r--src/map/map.c1150
-rw-r--r--src/map/map.h384
-rw-r--r--src/map/mapreg.h8
-rw-r--r--src/map/mapreg_sql.c44
-rw-r--r--src/map/mercenary.c42
-rw-r--r--src/map/mercenary.h4
-rw-r--r--src/map/mob.c394
-rw-r--r--src/map/mob.h22
-rw-r--r--src/map/npc.c628
-rw-r--r--src/map/npc.h52
-rw-r--r--src/map/npc_chat.c41
-rw-r--r--src/map/packets.h3695
-rw-r--r--src/map/packets_struct.h922
-rw-r--r--src/map/party.c210
-rw-r--r--src/map/party.h18
-rw-r--r--src/map/path.c17
-rw-r--r--src/map/path.h2
-rw-r--r--src/map/pc.c1559
-rw-r--r--src/map/pc.h112
-rw-r--r--src/map/pc_groups.c43
-rw-r--r--src/map/pc_groups.h20
-rw-r--r--src/map/pet.c50
-rw-r--r--src/map/pet.h6
-rw-r--r--src/map/quest.c34
-rw-r--r--src/map/quest.h7
-rw-r--r--src/map/script.c6006
-rw-r--r--src/map/script.h217
-rw-r--r--src/map/searchstore.c69
-rw-r--r--src/map/searchstore.h2
-rw-r--r--src/map/skill.c2879
-rw-r--r--src/map/skill.h140
-rw-r--r--src/map/status.c1927
-rw-r--r--src/map/status.h225
-rw-r--r--src/map/storage.c283
-rw-r--r--src/map/storage.h8
-rw-r--r--src/map/trade.c38
-rw-r--r--src/map/trade.h2
-rw-r--r--src/map/unit.c181
-rw-r--r--src/map/unit.h9
-rw-r--r--src/map/vending.c66
-rw-r--r--src/map/vending.h7
-rw-r--r--src/plugins/HPMHooking.c15
-rw-r--r--src/plugins/HPMHooking.h65
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc7333
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc386
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc169
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc12754
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.sources.inc74
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc404
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc143
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc6324
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.sources.inc44
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc663
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc289
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc50243
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.sources.inc125
-rw-r--r--src/plugins/Makefile.in5
-rw-r--r--src/plugins/constdb2doc.c7
-rw-r--r--src/plugins/db2sql.c228
-rw-r--r--src/plugins/dbghelpplug.c30
-rw-r--r--src/plugins/generate-translations.c277
-rw-r--r--src/plugins/sample.c33
-rw-r--r--src/test/Makefile.in8
-rw-r--r--src/test/test_libconfig.c155
-rw-r--r--src/test/test_spinlock.c31
-rw-r--r--src/tool/Makefile.in8
-rw-r--r--src/tool/mapcache.c17
212 files changed, 75916 insertions, 45205 deletions
diff --git a/src/char/HPMchar.c b/src/char/HPMchar.c
index c34866e53..e0f81c61f 100644
--- a/src/char/HPMchar.c
+++ b/src/char/HPMchar.c
@@ -47,10 +47,13 @@
#include "common/db.h"
#include "common/des.h"
#include "common/ers.h"
+#include "common/md5calc.h"
#include "common/memmgr.h"
+#include "common/mutex.h"
#include "common/mapindex.h"
#include "common/mmo.h"
#include "common/nullpo.h"
+#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h"
#include "common/spinlock.h"
diff --git a/src/char/Makefile.in b/src/char/Makefile.in
index 8d9094f18..7806ce2bb 100644
--- a/src/char/Makefile.in
+++ b/src/char/Makefile.in
@@ -1,7 +1,7 @@
# This file is part of Hercules.
# http://herc.ws - http://github.com/HerculesWS/Hercules
#
-# Copyright (C) 2012-2015 Hercules Dev Team
+# Copyright (C) 2012-2016 Hercules Dev Team
# Copyright (C) Athena Dev Teams
#
# Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
-COMMON_H = $(wildcard $(COMMON_D)/*.h)
+COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) ../plugins/HPMHooking.h
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
COMMON_INCLUDE = -I..
@@ -47,10 +47,11 @@ CHAR_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(CHAR_C)))
CHAR_H = char.h HPMchar.h loginif.h mapif.h geoip.h inter.h int_auction.h int_elemental.h int_guild.h \
int_homun.h int_mail.h int_mercenary.h int_party.h int_pet.h \
int_quest.h int_storage.h pincode.h
+CHAR_PH =
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC)
+ CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC)
else
CHAR_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -89,7 +90,7 @@ help:
Makefile: Makefile.in
@$(MAKE) -C ../.. src/char/Makefile
-$(SYSINFO_INC): $(CHAR_C) $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
+$(SYSINFO_INC): $(CHAR_C) $(CHAR_PH) $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
@echo " MAKE $@"
@$(MAKE) -C ../.. sysinfo
@@ -109,14 +110,8 @@ char-server: ../../char-server@EXEEXT@
../../char-server@EXEEXT@: $(CHAR_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
-
-# char object files
-
-obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
- @echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @STATIC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \
+ $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# missing object files
$(COMMON_D)/obj_all/common.a:
@@ -134,3 +129,11 @@ $(MT19937AR_OBJ):
$(LIBCONFIG_OBJ):
@echo " MAKE $@"
@$(MAKE) -C $(LIBCONFIG_D)
+
+.SECONDEXPANSION:
+
+# char object files
+
+obj_sql/%.o: %.c $$(filter %.p.h, $(CHAR_PH)) $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
+ @echo " CC $<"
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
diff --git a/src/char/char.c b/src/char/char.c
index d05d13d4b..069ccc481 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -42,6 +42,7 @@
#include "common/HPM.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/console.h"
#include "common/core.h"
#include "common/db.h"
@@ -61,8 +62,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
-#ifndef WIN32
-# include <unistd.h>
+#include <sys/stat.h> // stat()
+
+#if MAX_MAP_SERVERS > 1
+# ifdef _MSC_VER
+# pragma message("WARNING: your settings allow more than one map server to connect, this is deprecated dangerous feature USE IT AT YOUR OWN RISK")
+# else
+# warning your settings allow more than one map server to connect, this is deprecated dangerous feature USE IT AT YOUR OWN RISK
+# endif
#endif
// private declarations
@@ -105,9 +112,6 @@ char char_reg_num_db[32] = "char_reg_num_db";
struct char_interface char_s;
struct char_interface *chr;
-// show loading/saving messages
-int save_log = 1;
-
char db_path[1024] = "db";
char wisp_server_name[NAME_LENGTH] = "Server";
@@ -118,7 +122,7 @@ char char_ip_str[128];
char bind_ip_str[128];
uint32 bind_ip = INADDR_ANY;
int char_maintenance_min_group_id = 0;
-bool char_new = true;
+bool enable_char_creation = true; ///< Whether to allow character creation.
bool name_ignoring_case = false; // Allow or not identical name for characters but with a different case by [Yor]
int char_name_option = 0; // Option to know which letters/symbols are authorized in the name of a character (0: all, 1: only those in char_name_letters, 2: all EXCEPT those in char_name_letters) by [Yor]
@@ -126,19 +130,24 @@ char unknown_char_name[NAME_LENGTH] = "Unknown"; // Name to use when the request
#define TRIM_CHARS "\255\xA0\032\t\x0A\x0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) in a character name. by [Yor]
-int char_del_level = 0; //From which level u can delete character [Lupus]
+int char_del_level = 0; ///< From which level you can delete character [Lupus]
int char_del_delay = 86400;
-
-int log_char = 1; // logging char or not [devil]
-int log_inter = 1; // logging inter or not [devil]
-
-int char_aegis_delete = 0; // Verify if char is in guild/party or char and reacts as Aegis does (doesn't allow deletion), see chr->delete2_req for more information
+bool char_aegis_delete = false; ///< Verify if char is in guild/party or char and reacts as Aegis does (disallow deletion), @see chr->delete2_req.
int max_connect_user = -1;
int gm_allow_group = -1;
int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
int start_zeny = 0;
-int start_items[MAX_START_ITEMS*3];
+
+/// Start items for new characters
+struct start_item_s {
+ int id;
+ int amount;
+ int loc;
+ bool stackable;
+};
+VECTOR_DECL(struct start_item_s) start_items;
+
int guild_exp_rate = 100;
//Custom limits for the fame lists. [Skotlex]
@@ -165,7 +174,7 @@ unsigned short skillid2idx[MAX_SKILL_ID];
//-----------------------------------------------------
#define AUTH_TIMEOUT 30000
-static DBMap* auth_db; // int account_id -> struct char_auth_node*
+static struct DBMap *auth_db; // int account_id -> struct char_auth_node*
//-----------------------------------------------------
// Online User Database
@@ -174,7 +183,7 @@ static DBMap* auth_db; // int account_id -> struct char_auth_node*
/**
* @see DBCreateData
*/
-static DBData char_create_online_char_data(DBKey key, va_list args)
+static struct DBData char_create_online_char_data(union DBKey key, va_list args)
{
struct online_char_data* character;
CREATE(character, struct online_char_data, 1);
@@ -278,8 +287,10 @@ void char_set_char_offline(int char_id, int account_id)
}
else
{
- struct mmo_charstatus* cp = (struct mmo_charstatus*)idb_get(chr->char_db_,char_id);
+ struct mmo_charstatus* cp = (struct mmo_charstatus*) idb_get(chr->char_db_,char_id);
+
inter_guild->CharOffline(char_id, cp?cp->guild_id:-1);
+
if (cp)
idb_remove(chr->char_db_,char_id);
@@ -316,7 +327,7 @@ void char_set_char_offline(int char_id, int account_id)
/**
* @see DBApply
*/
-static int char_db_setoffline(DBKey key, DBData *data, va_list ap)
+static int char_db_setoffline(union DBKey key, struct DBData *data, va_list ap)
{
struct online_char_data* character = (struct online_char_data*)DB->data2ptr(data);
int server_id = va_arg(ap, int);
@@ -336,7 +347,7 @@ static int char_db_setoffline(DBKey key, DBData *data, va_list ap)
/**
* @see DBApply
*/
-static int char_db_kickoffline(DBKey key, DBData *data, va_list ap)
+static int char_db_kickoffline(union DBKey key, struct DBData *data, va_list ap)
{
struct online_char_data* character = (struct online_char_data*)DB->data2ptr(data);
int server_id = va_arg(ap, int);
@@ -391,7 +402,7 @@ void char_set_all_offline_sql(void)
/**
* @see DBCreateData
*/
-static DBData char_create_charstatus(DBKey key, va_list args)
+static struct DBData char_create_charstatus(union DBKey key, va_list args)
{
struct mmo_charstatus *cp;
cp = (struct mmo_charstatus *) aCalloc(1,sizeof(struct mmo_charstatus));
@@ -419,7 +430,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
//map inventory data
if( memcmp(p->inventory, cp->inventory, sizeof(p->inventory)) ) {
- if (!chr->inventory_to_sql(p->inventory, MAX_INVENTORY, p->char_id))
+ if (!chr->memitemdata_to_sql(p->inventory, MAX_INVENTORY, p->char_id, TABLE_INVENTORY))
strcat(save_status, " inventory");
else
errors++;
@@ -433,14 +444,6 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
errors++;
}
- //map storage data
- if( memcmp(p->storage.items, cp->storage.items, sizeof(p->storage.items)) ) {
- if (!chr->memitemdata_to_sql(p->storage.items, MAX_STORAGE, p->account_id, TABLE_STORAGE))
- strcat(save_status, " storage");
- else
- errors++;
- }
-
if (
(p->base_exp != cp->base_exp) || (p->base_level != cp->base_level) ||
(p->job_level != cp->job_level) || (p->job_exp != cp->job_exp) ||
@@ -473,7 +476,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
"`base_exp`='%u', `job_exp`='%u', `zeny`='%d',"
"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d',"
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d',"
- "`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',`elemental_id`='%d',"
+ "`option`='%u',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',`homun_id`='%d',`elemental_id`='%d',"
"`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
"`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d',"
"`delete_date`='%lu',`robe`='%d',`slotchange`='%d', `char_opt`='%u', `font`='%u', `uniqueitem_counter` ='%u',"
@@ -510,7 +513,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
if (
(p->hair != cp->hair) || (p->hair_color != cp->hair_color) ||
(p->clothes_color != cp->clothes_color) || (p->body != cp->body) ||
- (p->class_ != cp->class_) ||
+ (p->class != cp->class) ||
(p->partner_id != cp->partner_id) || (p->father != cp->father) ||
(p->mother != cp->mother) || (p->child != cp->child) ||
(p->karma != cp->karma) || (p->manner != cp->manner) ||
@@ -522,7 +525,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
"`partner_id`='%d', `father`='%d', `mother`='%d', `child`='%d',"
"`karma`='%d', `manner`='%d', `fame`='%d'"
" WHERE `account_id`='%d' AND `char_id` = '%d'",
- char_db, p->class_,
+ char_db, p->class,
p->hair, p->hair_color, p->clothes_color, p->body,
p->partner_id, p->father, p->mother, p->child,
p->karma, p->manner, p->fame,
@@ -685,60 +688,73 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
#endif
StrBuf->Destroy(&buf);
- if (save_status[0]!='\0' && save_log)
+ if (chr->show_save_log && save_status[0] != '\0')
ShowInfo("Saved char %d - %s:%s.\n", char_id, p->name, save_status);
if (!errors)
memcpy(cp, p, sizeof(struct mmo_charstatus));
return 0;
}
-/// Saves an array of 'item' entries into the specified table.
+/**
+ * Saves an array of 'item' entries into the specified table.
+ *
+ * @param items The items array.
+ * @param max The array size.
+ * @param id The character/account/guild ID (depending on tableswitch).
+ * @param tableswitch The type of table (@see enum inventory_table_type).
+ * @return Error code.
+ * @retval 0 in case of success.
+ */
int char_memitemdata_to_sql(const struct item items[], int max, int id, int tableswitch)
{
StringBuf buf;
- SqlStmt* stmt;
- int i;
- int j;
- const char* tablename;
- const char* selectoption;
- struct item item; // temp storage variable
- bool* flag; // bit array for inventory matching
+ struct SqlStmt *stmt = NULL;
+ int i, j;
+ const char *tablename = NULL;
+ const char *selectoption = NULL;
+ bool has_favorite = false;
+ struct item item = { 0 }; // temp storage variable
+ bool *flag = NULL; // bit array for inventory matching
bool found;
int errors = 0;
+ nullpo_ret(items);
+
switch (tableswitch) {
- case TABLE_INVENTORY: tablename = inventory_db; selectoption = "char_id"; break;
+ case TABLE_INVENTORY: tablename = inventory_db; selectoption = "char_id"; has_favorite = true; break;
case TABLE_CART: tablename = cart_db; selectoption = "char_id"; break;
case TABLE_STORAGE: tablename = storage_db; selectoption = "account_id"; break;
case TABLE_GUILD_STORAGE: tablename = guild_storage_db; selectoption = "guild_id"; break;
default:
ShowError("Invalid table name!\n");
- return 1;
+ Assert_retr(1, tableswitch);
}
-
// The following code compares inventory with current database values
// and performs modification/deletion/insertion only on relevant rows.
// This approach is more complicated than a trivial delete&insert, but
// it significantly reduces cpu load on the database server.
StrBuf->Init(&buf);
- StrBuf->AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`");
- for( j = 0; j < MAX_SLOTS; ++j )
+ StrBuf->AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`");
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ", `card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
+
+ if (has_favorite)
+ StrBuf->AppendStr(&buf, ", `favorite`");
StrBuf->Printf(&buf, " FROM `%s` WHERE `%s`='%d'", tablename, selectoption, id);
stmt = SQL->StmtMalloc(inter->sql_handle);
- if( SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
- || SQL_ERROR == SQL->StmtExecute(stmt) )
- {
+ if (SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
+ || SQL_ERROR == SQL->StmtExecute(stmt)) {
SqlStmt_ShowDebug(stmt);
SQL->StmtFree(stmt);
StrBuf->Destroy(&buf);
return 1;
}
- memset(&item, 0, sizeof(item));
SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &item.id, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 1, SQLDT_SHORT, &item.nameid, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 2, SQLDT_SHORT, &item.amount, 0, NULL, NULL);
@@ -748,30 +764,39 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
SQL->StmtBindColumn(stmt, 6, SQLDT_CHAR, &item.attribute, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &item.expire_time, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 8, SQLDT_UCHAR, &item.bound, 0, NULL, NULL);
- for( j = 0; j < MAX_SLOTS; ++j )
- SQL->StmtBindColumn(stmt, 9+j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 9, SQLDT_UINT64, &item.unique_id, 0, NULL, NULL);
+ for (j = 0; j < MAX_SLOTS; ++j)
+ SQL->StmtBindColumn(stmt, 10 + j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j) {
+ SQL->StmtBindColumn(stmt, 10 + MAX_SLOTS + j * 2, SQLDT_INT16, &item.option[j].index, 0, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 11 + MAX_SLOTS + j * 2, SQLDT_INT16, &item.option[j].value, 0, NULL, NULL);
+ }
+ if (has_favorite)
+ SQL->StmtBindColumn(stmt, 10 + MAX_SLOTS + MAX_ITEM_OPTIONS * 2, SQLDT_UCHAR, &item.favorite, 0, NULL, NULL);
// bit array indicating which inventory items have already been matched
- flag = (bool*) aCalloc(max, sizeof(bool));
+ flag = aCalloc(max, sizeof(bool));
- while( SQL_SUCCESS == SQL->StmtNextRow(stmt) )
- {
+ while (SQL_SUCCESS == SQL->StmtNextRow(stmt)) {
found = false;
// search for the presence of the item in the char's inventory
- for( i = 0; i < max; ++i )
- {
+ for (i = 0; i < max; ++i) {
// skip empty and already matched entries
- if( items[i].nameid == 0 || flag[i] )
+ if (items[i].nameid == 0 || flag[i])
continue;
- if( items[i].nameid == item.nameid
+ if (items[i].nameid == item.nameid
+ && items[i].unique_id == item.unique_id
&& items[i].card[0] == item.card[0]
&& items[i].card[2] == item.card[2]
&& items[i].card[3] == item.card[3]
) {
- //They are the same item.
- ARR_FIND( 0, MAX_SLOTS, j, items[i].card[j] != item.card[j] );
- if( j == MAX_SLOTS
+ int k = 0;
+ // They are the same item.
+ ARR_FIND(0, MAX_SLOTS, j, items[i].card[j] != item.card[j]);
+ ARR_FIND(0, MAX_ITEM_OPTIONS, k, items[i].option[k].index != item.option[k].index || items[i].option[k].value != item.option[k].value);
+
+ if (j == MAX_SLOTS && k == MAX_ITEM_OPTIONS
&& items[i].amount == item.amount
&& items[i].equip == item.equip
&& items[i].identify == item.identify
@@ -779,19 +804,23 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
&& items[i].attribute == item.attribute
&& items[i].expire_time == item.expire_time
&& items[i].bound == item.bound
+ && (!has_favorite || items[i].favorite == item.favorite)
) {
; //Do nothing.
} else {
// update all fields.
StrBuf->Clear(&buf);
- StrBuf->Printf(&buf, "UPDATE `%s` SET `amount`='%d', `equip`='%d', `identify`='%d', `refine`='%d',`attribute`='%d', `expire_time`='%u', `bound`='%d'",
+ StrBuf->Printf(&buf, "UPDATE `%s` SET `amount`='%d', `equip`='%u', `identify`='%d', `refine`='%d',`attribute`='%d', `expire_time`='%u', `bound`='%d'",
tablename, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].bound);
- for( j = 0; j < MAX_SLOTS; ++j )
- StrBuf->Printf(&buf, ", `card%d`=%d", j, items[i].card[j]);
+ for (j = 0; j < MAX_SLOTS; ++j)
+ StrBuf->Printf(&buf, ", `card%d`='%d'", j, items[i].card[j]);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`='%d', `opt_val%d`='%d'", j, items[i].option[j].index, j, items[i].option[j].value);
+ if (has_favorite)
+ StrBuf->Printf(&buf, ", `favorite`='%d'", items[i].favorite);
StrBuf->Printf(&buf, " WHERE `id`='%d' LIMIT 1", item.id);
- if( SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) )
- {
+ if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) {
Sql_ShowDebug(inter->sql_handle);
errors++;
}
@@ -801,10 +830,9 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
break; //skip to next item in the db.
}
}
- if( !found )
- {// Item not present in inventory, remove it.
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE from `%s` where `id`='%d' LIMIT 1", tablename, item.id) )
- {
+ if (!found) {
+ // Item not present in inventory, remove it.
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE from `%s` where `id`='%d' LIMIT 1", tablename, item.id)) {
Sql_ShowDebug(inter->sql_handle);
errors++;
}
@@ -814,173 +842,38 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, int tabl
StrBuf->Clear(&buf);
StrBuf->Printf(&buf, "INSERT INTO `%s`(`%s`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`", tablename, selectoption);
- for( j = 0; j < MAX_SLOTS; ++j )
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ", `card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
+ if (has_favorite)
+ StrBuf->AppendStr(&buf, ", `favorite`");
StrBuf->AppendStr(&buf, ") VALUES ");
found = false;
// insert non-matched items into the db as new items
- for( i = 0; i < max; ++i )
- {
+ for (i = 0; i < max; ++i) {
// skip empty and already matched entries
- if( items[i].nameid == 0 || flag[i] )
+ if (items[i].nameid == 0 || flag[i])
continue;
- if( found )
+ if (found)
StrBuf->AppendStr(&buf, ",");
else
found = true;
- StrBuf->Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%d', '%"PRIu64"'",
+ StrBuf->Printf(&buf, "('%d', '%d', '%d', '%u', '%d', '%d', '%d', '%u', '%d', '%"PRIu64"'",
id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].bound, items[i].unique_id);
- for( j = 0; j < MAX_SLOTS; ++j )
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ", '%d'", items[i].card[j]);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", '%d', '%d'", items[i].option[j].index, items[i].option[j].value);
+ if (has_favorite)
+ StrBuf->Printf(&buf, ", '%d'", items[i].favorite);
StrBuf->AppendStr(&buf, ")");
}
- if( found && SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) )
- {
- Sql_ShowDebug(inter->sql_handle);
- errors++;
- }
-
- StrBuf->Destroy(&buf);
- aFree(flag);
-
- return errors;
-}
-/* pretty much a copy of chr->memitemdata_to_sql except it handles inventory_db exclusively,
- * - this is required because inventory db is the only one with the 'favorite' column. */
-int char_inventory_to_sql(const struct item items[], int max, int id) {
- StringBuf buf;
- SqlStmt* stmt;
- int i;
- int j;
- struct item item; // temp storage variable
- bool* flag; // bit array for inventory matching
- bool found;
- int errors = 0;
-
- nullpo_ret(items);
-
- // The following code compares inventory with current database values
- // and performs modification/deletion/insertion only on relevant rows.
- // This approach is more complicated than a trivial delete&insert, but
- // it significantly reduces cpu load on the database server.
-
- StrBuf->Init(&buf);
- StrBuf->AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `bound`");
- for( j = 0; j < MAX_SLOTS; ++j )
- StrBuf->Printf(&buf, ", `card%d`", j);
- StrBuf->Printf(&buf, " FROM `%s` WHERE `char_id`='%d'", inventory_db, id);
-
- stmt = SQL->StmtMalloc(inter->sql_handle);
- if( SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
- || SQL_ERROR == SQL->StmtExecute(stmt) )
- {
- SqlStmt_ShowDebug(stmt);
- SQL->StmtFree(stmt);
- StrBuf->Destroy(&buf);
- return 1;
- }
-
- memset(&item, 0, sizeof(item));
- SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &item.id, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 1, SQLDT_SHORT, &item.nameid, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 2, SQLDT_SHORT, &item.amount, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 3, SQLDT_UINT, &item.equip, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 4, SQLDT_CHAR, &item.identify, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 5, SQLDT_CHAR, &item.refine, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 6, SQLDT_CHAR, &item.attribute, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &item.expire_time, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 8, SQLDT_CHAR, &item.favorite, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 9, SQLDT_UCHAR, &item.bound, 0, NULL, NULL);
- for( j = 0; j < MAX_SLOTS; ++j )
- SQL->StmtBindColumn(stmt, 10+j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
-
- // bit array indicating which inventory items have already been matched
- flag = (bool*) aCalloc(max, sizeof(bool));
-
- while( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) {
- found = false;
- // search for the presence of the item in the char's inventory
- for( i = 0; i < max; ++i ) {
- // skip empty and already matched entries
- if( items[i].nameid == 0 || flag[i] )
- continue;
-
- if( items[i].nameid == item.nameid
- && items[i].card[0] == item.card[0]
- && items[i].card[2] == item.card[2]
- && items[i].card[3] == item.card[3]
- ) {
- //They are the same item.
- ARR_FIND( 0, MAX_SLOTS, j, items[i].card[j] != item.card[j] );
- if( j == MAX_SLOTS
- && items[i].amount == item.amount
- && items[i].equip == item.equip
- && items[i].identify == item.identify
- && items[i].refine == item.refine
- && items[i].attribute == item.attribute
- && items[i].expire_time == item.expire_time
- && items[i].favorite == item.favorite
- && items[i].bound == item.bound
- ) {
- ; //Do nothing.
- } else {
- // update all fields.
- StrBuf->Clear(&buf);
- StrBuf->Printf(&buf, "UPDATE `%s` SET `amount`='%d', `equip`='%d', `identify`='%d', `refine`='%d',`attribute`='%d', `expire_time`='%u', `favorite`='%d', `bound`='%d'",
- inventory_db, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].favorite, items[i].bound);
- for( j = 0; j < MAX_SLOTS; ++j )
- StrBuf->Printf(&buf, ", `card%d`=%d", j, items[i].card[j]);
- StrBuf->Printf(&buf, " WHERE `id`='%d' LIMIT 1", item.id);
-
- if( SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) ) {
- Sql_ShowDebug(inter->sql_handle);
- errors++;
- }
- }
-
- found = flag[i] = true; //Item dealt with,
- break; //skip to next item in the db.
- }
- }
- if( !found ) {// Item not present in inventory, remove it.
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE from `%s` where `id`='%d' LIMIT 1", inventory_db, item.id) ) {
- Sql_ShowDebug(inter->sql_handle);
- errors++;
- }
- }
- }
- SQL->StmtFree(stmt);
-
- StrBuf->Clear(&buf);
- StrBuf->Printf(&buf, "INSERT INTO `%s` (`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `bound`, `unique_id`", inventory_db);
- for( j = 0; j < MAX_SLOTS; ++j )
- StrBuf->Printf(&buf, ", `card%d`", j);
- StrBuf->AppendStr(&buf, ") VALUES ");
-
- found = false;
- // insert non-matched items into the db as new items
- for( i = 0; i < max; ++i ) {
- // skip empty and already matched entries
- if( items[i].nameid == 0 || flag[i] )
- continue;
-
- if( found )
- StrBuf->AppendStr(&buf, ",");
- else
- found = true;
-
- StrBuf->Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u', '%d', '%d', '%"PRIu64"'",
- id, items[i].nameid, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].favorite, items[i].bound, items[i].unique_id);
- for( j = 0; j < MAX_SLOTS; ++j )
- StrBuf->Printf(&buf, ", '%d'", items[i].card[j]);
- StrBuf->AppendStr(&buf, ")");
- }
-
- if( found && SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)) ) {
+ if (found && SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) {
Sql_ShowDebug(inter->sql_handle);
errors++;
}
@@ -1044,7 +937,7 @@ int char_mmo_gender(const struct char_session_data *sd, const struct mmo_charsta
// Loads the basic character rooster for the given account. Returns total buffer used.
int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
{
- SqlStmt* stmt;
+ struct SqlStmt *stmt;
struct mmo_charstatus p;
int j = 0, i;
char last_map[MAP_NAME_LENGTH_EXT];
@@ -1078,9 +971,9 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_UCHAR, &p.slot, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_STRING, &p.name, sizeof(p.name), NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_SHORT, &p.class_, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_UINT, &p.base_level, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_UINT, &p.job_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_SHORT, &p.class, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT, &p.base_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p.job_level, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT, &p.base_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &p.job_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_INT, &p.zeny, 0, NULL, NULL)
@@ -1094,8 +987,8 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 16, SQLDT_INT, &p.hp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 17, SQLDT_INT, &p.max_sp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 18, SQLDT_INT, &p.sp, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 19, SQLDT_UINT, &p.status_point, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 20, SQLDT_UINT, &p.skill_point, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 19, SQLDT_INT, &p.status_point, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 20, SQLDT_INT, &p.skill_point, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 21, SQLDT_UINT, &p.option, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 22, SQLDT_UCHAR, &p.karma, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 23, SQLDT_SHORT, &p.manner, 0, NULL, NULL)
@@ -1144,7 +1037,7 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
char t_msg[128] = "";
struct mmo_charstatus* cp;
StringBuf buf;
- SqlStmt* stmt;
+ struct SqlStmt *stmt;
char last_map[MAP_NAME_LENGTH_EXT];
char save_map[MAP_NAME_LENGTH_EXT];
char point_map[MAP_NAME_LENGTH_EXT];
@@ -1164,7 +1057,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
memset(p, 0, sizeof(struct mmo_charstatus));
- if (save_log) ShowInfo("Char load request (%d)\n", char_id);
+ if (chr->show_save_log)
+ ShowInfo("Char load request (%d)\n", char_id);
stmt = SQL->StmtMalloc(inter->sql_handle);
if( stmt == NULL )
@@ -1188,9 +1082,9 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &p->account_id, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UCHAR, &p->slot, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_STRING, &p->name, sizeof(p->name), NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_SHORT, &p->class_, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_UINT, &p->base_level, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT, &p->job_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_SHORT, &p->class, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p->base_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_INT, &p->job_level, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &p->base_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_UINT, &p->job_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 9, SQLDT_INT, &p->zeny, 0, NULL, NULL)
@@ -1204,8 +1098,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 17, SQLDT_INT, &p->hp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 18, SQLDT_INT, &p->max_sp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 19, SQLDT_INT, &p->sp, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 20, SQLDT_UINT, &p->status_point, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 21, SQLDT_UINT, &p->skill_point, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 20, SQLDT_INT, &p->status_point, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 21, SQLDT_INT, &p->skill_point, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 22, SQLDT_UINT, &p->option, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 23, SQLDT_UCHAR, &p->karma, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 24, SQLDT_SHORT, &p->manner, 0, NULL, NULL)
@@ -1304,8 +1198,10 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
//`inventory` (`id`,`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, `expire_time`, `favorite`, `bound`, `unique_id`)
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `favorite`, `bound`, `unique_id`");
- for( i = 0; i < MAX_SLOTS; ++i )
+ for (i = 0; i < MAX_SLOTS; ++i)
StrBuf->Printf(&buf, ", `card%d`", i);
+ for (i = 0; i < MAX_ITEM_OPTIONS; ++i)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", i, i);
StrBuf->Printf(&buf, " FROM `%s` WHERE `char_id`=? LIMIT %d", inventory_db, MAX_INVENTORY);
memset(&tmp_item, 0, sizeof(tmp_item));
@@ -1325,8 +1221,14 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 10, SQLDT_UINT64, &tmp_item.unique_id, 0, NULL, NULL)
)
SqlStmt_ShowDebug(stmt);
- for( i = 0; i < MAX_SLOTS; ++i )
- if( SQL_ERROR == SQL->StmtBindColumn(stmt, 11+i, SQLDT_SHORT, &tmp_item.card[i], 0, NULL, NULL) )
+ /* Card Slots */
+ for (i = 0; i < MAX_SLOTS; ++i)
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt, 11 + i, SQLDT_SHORT, &tmp_item.card[i], 0, NULL, NULL))
+ SqlStmt_ShowDebug(stmt);
+ /* Item Options */
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++)
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt, 11 + MAX_SLOTS + i * 2, SQLDT_INT16, &tmp_item.option[i].index, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 12 + MAX_SLOTS + i * 2, SQLDT_INT16, &tmp_item.option[i].value, 0, NULL, NULL))
SqlStmt_ShowDebug(stmt);
for( i = 0; i < MAX_INVENTORY && SQL_SUCCESS == SQL->StmtNextRow(stmt); ++i )
@@ -1338,8 +1240,10 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
//`cart_inventory` (`id`,`char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3`, expire_time`, `bound`, `unique_id`)
StrBuf->Clear(&buf);
StrBuf->AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`");
- for( j = 0; j < MAX_SLOTS; ++j )
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ", `card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
StrBuf->Printf(&buf, " FROM `%s` WHERE `char_id`=? LIMIT %d", cart_db, MAX_CART);
memset(&tmp_item, 0, sizeof(tmp_item));
@@ -1359,18 +1263,21 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
) {
SqlStmt_ShowDebug(stmt);
}
- for( i = 0; i < MAX_SLOTS; ++i )
- if( SQL_ERROR == SQL->StmtBindColumn(stmt, 10+i, SQLDT_SHORT, &tmp_item.card[i], 0, NULL, NULL) )
+ /* Card Slots */
+ for (i = 0; i < MAX_SLOTS; ++i)
+ if( SQL_ERROR == SQL->StmtBindColumn(stmt, 10 + i, SQLDT_SHORT, &tmp_item.card[i], 0, NULL, NULL) )
+ SqlStmt_ShowDebug(stmt);
+ /* Item Options */
+ for (i = 0; i < MAX_ITEM_OPTIONS; ++i)
+ if (SQL_ERROR == SQL->StmtBindColumn(stmt, 10 + MAX_SLOTS + i * 2, SQLDT_INT16, &tmp_item.option[i].index, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 11 + MAX_SLOTS + i * 2, SQLDT_INT16, &tmp_item.option[i].value, 0, NULL, NULL))
SqlStmt_ShowDebug(stmt);
for( i = 0; i < MAX_CART && SQL_SUCCESS == SQL->StmtNextRow(stmt); ++i )
memcpy(&p->cart[i], &tmp_item, sizeof(tmp_item));
+
strcat(t_msg, " cart");
- //read storage
- inter_storage->fromsql(p->account_id, &p->storage);
- strcat(t_msg, " storage");
-
//read skill
//`skill` (`char_id`, `id`, `lv`)
memset(&tmp_skill, 0, sizeof(tmp_skill));
@@ -1457,7 +1364,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
if( SQL_SUCCESS == SQL->StmtNextRow(stmt) )
strcat(t_msg, " accdata");
- if (save_log) ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfully!
+ if (chr->show_save_log)
+ ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfully!
SQL->StmtFree(stmt);
StrBuf->Destroy(&buf);
@@ -1584,12 +1492,11 @@ int char_rename_char_sql(struct char_session_data *sd, int char_id)
memset(sd->new_name,0,sizeof(sd->new_name));
// log change
- if( log_char )
- {
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
- "VALUES (NOW(), '%s', '%d', '%d', '%d', '%s', '0', '0', '0', '0', '0', '0', '0', '0')",
- charlog_db, "change char name", sd->account_id, char_dat.char_id, char_dat.slot, esc_name) )
+ if (chr->enable_logs) {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
+ "VALUES (NOW(), '%s', '%d', '%d', '%d', '%s', '0', '0', '0', '0', '0', '0', '0', '0')",
+ charlog_db, "change char name", sd->account_id, char_dat.char_id, char_dat.slot, esc_name))
Sql_ShowDebug(inter->sql_handle);
}
@@ -1660,10 +1567,11 @@ int char_check_char_name(char * name, char * esc_name)
* -5: 'Symbols in Character Names are forbidden'
* char_id: Success
**/
-int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style) {
+int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, int16 starting_class, uint8 sex)
+{
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
- int char_id, flag, k, l;
+ int char_id, flag, i;
nullpo_retr(-2, sd);
nullpo_retr(-2, name_);
@@ -1672,9 +1580,17 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i
SQL->EscapeStringLen(inter->sql_handle, esc_name, name, strnlen(name, NAME_LENGTH));
flag = chr->check_char_name(name,esc_name);
- if( flag < 0 )
+ if (flag < 0)
return flag;
+ switch (starting_class) {
+ case JOB_SUMMONER:
+ case JOB_NOVICE:
+ break;
+ default:
+ return -2; // Char Creation Denied
+ }
+
//check other inputs
#if PACKETVER >= 20120307
if(slot < 0 || slot >= sd->char_slots)
@@ -1694,24 +1610,24 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i
if( sd->found_char[slot] != -1 )
return -2; /* character account limit exceeded */
+
#if PACKETVER >= 20120307
- //Insert the new char entry to the database
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `status_point`,`str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
- "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES ("
- "'%d', '%d', '%s', '%d', '%d','%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
- char_db, sd->account_id , slot, esc_name, start_zeny, 48, str, agi, vit, int_, dex, luk,
+ // Insert the new char entry to the database
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `status_point`,`str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
+ "`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`, `sex`) VALUES ("
+ "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d', '%c')",
+ char_db, sd->account_id , slot, esc_name, starting_class, start_zeny, 48, str, agi, vit, int_, dex, luk,
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
- mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) )
- {
- Sql_ShowDebug(inter->sql_handle);
- return -2; //No, stop the procedure!
+ mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y, sex)) {
+ Sql_ShowDebug(inter->sql_handle);
+ return -2; //No, stop the procedure!
}
#else
//Insert the new char entry to the database
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`account_id`, `char_num`, `name`, `class`, `zeny`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `max_hp`, `hp`,"
"`max_sp`, `sp`, `hair`, `hair_color`, `last_map`, `last_x`, `last_y`, `save_map`, `save_x`, `save_y`) VALUES ("
- "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
- char_db, sd->account_id , slot, esc_name, start_zeny, str, agi, vit, int_, dex, luk,
+ "'%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d','%d', '%d','%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d')",
+ char_db, sd->account_id , slot, esc_name, starting_class, start_zeny, str, agi, vit, int_, dex, luk,
(40 * (100 + vit)/100) , (40 * (100 + vit)/100 ), (11 * (100 + int_)/100), (11 * (100 + int_)/100), hair_style, hair_color,
mapindex_id2name(start_point.map), start_point.x, start_point.y, mapindex_id2name(start_point.map), start_point.x, start_point.y) )
{
@@ -1726,38 +1642,35 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i
return -2;
// Validation success, log result
- if (log_char) {
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
- "VALUES (NOW(), '%s', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- charlog_db, "make new char", sd->account_id, char_id, slot, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color) )
+ if (chr->enable_logs) {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s` (`time`, `char_msg`, `account_id`, `char_id`, `char_num`, `class`, `name`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hair`, `hair_color`)"
+ "VALUES (NOW(), '%s', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ charlog_db, "make new char", sd->account_id, char_id, slot, starting_class, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color))
Sql_ShowDebug(inter->sql_handle);
}
//Give the char the default items
- for (k = 0; k < ARRAYLENGTH(start_items) && start_items[k] != 0; k += 3) {
- // FIXME: How to define if an item is stackable without having to lookup itemdb? [panikon]
- if( start_items[k+2] == 1 )
- {
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')",
- inventory_db, char_id, start_items[k], start_items[k + 1], 1) )
- Sql_ShowDebug(inter->sql_handle);
- }
- else if( start_items[k+2] == 0 )
- {
+ for (i = 0; i < VECTOR_LENGTH(start_items); i++) {
+ struct start_item_s *item = &VECTOR_INDEX(start_items, i);
+ if (item->stackable) {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')",
+ inventory_db, char_id, item->id, item->amount, 1))
+ Sql_ShowDebug(inter->sql_handle);
+ } else {
// Non-stackable items should have their own entries (issue: 7279)
- for( l = 0; l < start_items[k+1]; l++ )
- {
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')",
- inventory_db, char_id, start_items[k], 1, 1)
- )
+ int l, loc = item->loc;
+ for (l = 0; l < item->amount; l++) {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `equip`, `identify`) VALUES ('%d', '%d', '%d', '%d', '%d')",
+ inventory_db, char_id, item->id, 1, loc, 1))
Sql_ShowDebug(inter->sql_handle);
}
}
}
- ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s\n", sd->account_id, char_id, slot, name);
+ ShowInfo("Created char: account: %d, char: %d, slot: %d, name: %s, sex: %c\n", sd->account_id, char_id, slot, name, sex);
return char_id;
}
@@ -1924,13 +1837,13 @@ int char_delete_char_sql(int char_id)
#endif
/* delete character */
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `char_id`='%d'", char_db, char_id) )
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `char_id`='%d'", char_db, char_id)) {
Sql_ShowDebug(inter->sql_handle);
- else if( log_char ) {
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `char_msg`, `name`)"
- " VALUES (NOW(), '%d', '%d', '%d', 'Deleted character', '%s')",
- charlog_db, account_id, char_id, 0, esc_name) )
+ } else if (chr->enable_logs) {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `char_msg`, `name`)"
+ " VALUES (NOW(), '%d', '%d', '%d', 'Deleted character', '%s')",
+ charlog_db, account_id, char_id, 0, esc_name))
Sql_ShowDebug(inter->sql_handle);
}
@@ -2000,7 +1913,7 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) {
WBUFW(buf,46) = min(p->sp, INT16_MAX);
WBUFW(buf,48) = min(p->max_sp, INT16_MAX);
WBUFW(buf,50) = DEFAULT_WALK_SPEED; // p->speed;
- WBUFW(buf,52) = p->class_;
+ WBUFW(buf,52) = p->class;
WBUFW(buf,54) = p->hair;
#if PACKETVER >= 20141022
WBUFW(buf,56) = p->body;
@@ -2010,7 +1923,7 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) {
//When the weapon is sent and your option is riding, the client crashes on login!?
// FIXME[Haru]: is OPTION_HANBOK intended to be part of this list? And if it is, should the list also include other OPTION_ costumes?
- WBUFW(buf,56) = p->option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_HANBOK) ? 0 : p->weapon;
+ WBUFW(buf,56) = (p->option&(OPTION_RIDING|OPTION_DRAGON|OPTION_WUG|OPTION_WUGRIDER|OPTION_MADOGEAR|OPTION_HANBOK)) ? 0 : p->weapon;
WBUFW(buf,58) = p->base_level;
WBUFW(buf,60) = min(p->skill_point, INT16_MAX);
@@ -2033,7 +1946,7 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) {
offset += 2;
#endif
#if (PACKETVER >= 20100720 && PACKETVER <= 20100727) || PACKETVER >= 20100803
- mapindex->getmapname_ext(mapindex_id2name(p->last_point.map), (char*)WBUFP(buf,108));
+ mapindex->getmapname_ext(mapindex_id2name(p->last_point.map), WBUFP(buf,108));
offset += MAP_NAME_LENGTH_EXT;
#endif
#if PACKETVER >= 20100803
@@ -2063,11 +1976,15 @@ int char_mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) {
}
/* Made Possible by Yommy~! <3 */
-void char_mmo_char_send099d(int fd, struct char_session_data *sd) {
+void char_mmo_char_send099d(int fd, struct char_session_data *sd)
+{
+// support added for client between 20121010 and 20130320
+#if PACKETVER > 20120418
WFIFOHEAD(fd,4 + (MAX_CHARS*MAX_CHAR_BUF));
WFIFOW(fd,0) = 0x99d;
WFIFOW(fd,2) = chr->mmo_chars_fromsql(sd, WFIFOP(fd,4)) + 4;
WFIFOSET(fd,WFIFOW(fd,2));
+#endif
}
/* Sends character ban list */
@@ -2087,7 +2004,7 @@ void char_mmo_char_send_ban_list(int fd, struct char_session_data *sd) {
for(i = 0, c = 0; i < MAX_CHARS; i++) {
if( sd->unban_time[i] ) {
- timestamp2string((char*)WFIFOP(fd,8 + (28*c)), 20, sd->unban_time[i], "%Y-%m-%d %H:%M:%S");
+ timestamp2string(WFIFOP(fd,8 + (28*c)), 20, sd->unban_time[i], "%Y-%m-%d %H:%M:%S");
if( sd->unban_time[i] > now )
WFIFOL(fd, 4 + (24*c)) = sd->found_char[i];
@@ -2135,7 +2052,7 @@ int char_mmo_char_send_characters(int fd, struct char_session_data* sd)
#if PACKETVER >= 20100413
offset += 3;
#endif
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id);
j = 24 + offset; // offset
@@ -2301,7 +2218,7 @@ int char_parse_fromlogin_connection_state(int fd)
ShowError("Can not connect to login-server.\n");
ShowError("The server communication passwords (default s1/p1) are probably invalid.\n");
ShowError("Also, please make sure your login db has the correct communication username/passwords and the gender of the account is S.\n");
- ShowError("The communication passwords are set in /conf/map-server.conf and /conf/char-server.conf\n");
+ ShowError("The communication passwords are set in /conf/map-server.conf and /conf/char/char-server.conf\n");
sockt->eof(fd);
return 1;
} else {
@@ -2380,8 +2297,8 @@ void char_parse_fromlogin_account_data(int fd)
sd->char_slots = MAX_CHARS;/* cap to maximum */
} else if ( sd->char_slots <= 0 )/* no value aka 0 in sql */
sd->char_slots = MAX_CHARS;/* cap to maximum */
- safestrncpy(sd->birthdate, (const char*)RFIFOP(fd,52), sizeof(sd->birthdate));
- safestrncpy(sd->pincode, (const char*)RFIFOP(fd,63), sizeof(sd->pincode));
+ safestrncpy(sd->birthdate, RFIFOP(fd,52), sizeof(sd->birthdate));
+ safestrncpy(sd->pincode, RFIFOP(fd,63), sizeof(sd->pincode));
sd->pincode_change = RFIFOL(fd,68);
// continued from chr->auth_ok...
if( (max_connect_user == 0 && sd->group_id != gm_allow_group) ||
@@ -2432,33 +2349,33 @@ void char_changesex(int account_id, int sex)
* @param sex The new sex (SEX_MALE or SEX_FEMALE).
* @param acc The character's account ID.
* @param char_id The character ID.
- * @param class_ The character's current job class.
+ * @param class The character's current job class.
* @param guild_id The character's guild ID.
*/
-void char_change_sex_sub(int sex, int acc, int char_id, int class_, int guild_id)
+void char_change_sex_sub(int sex, int acc, int char_id, int class, int guild_id)
{
// job modification
- if (class_ == JOB_BARD || class_ == JOB_DANCER)
- class_ = (sex == SEX_MALE ? JOB_BARD : JOB_DANCER);
- else if (class_ == JOB_CLOWN || class_ == JOB_GYPSY)
- class_ = (sex == SEX_MALE ? JOB_CLOWN : JOB_GYPSY);
- else if (class_ == JOB_BABY_BARD || class_ == JOB_BABY_DANCER)
- class_ = (sex == SEX_MALE ? JOB_BABY_BARD : JOB_BABY_DANCER);
- else if (class_ == JOB_MINSTREL || class_ == JOB_WANDERER)
- class_ = (sex == SEX_MALE ? JOB_MINSTREL : JOB_WANDERER);
- else if (class_ == JOB_MINSTREL_T || class_ == JOB_WANDERER_T)
- class_ = (sex == SEX_MALE ? JOB_MINSTREL_T : JOB_WANDERER_T);
- else if (class_ == JOB_BABY_MINSTREL || class_ == JOB_BABY_WANDERER)
- class_ = (sex == SEX_MALE ? JOB_BABY_MINSTREL : JOB_BABY_WANDERER);
- else if (class_ == JOB_KAGEROU || class_ == JOB_OBORO)
- class_ = (sex == SEX_MALE ? JOB_KAGEROU : JOB_OBORO);
+ if (class == JOB_BARD || class == JOB_DANCER)
+ class = (sex == SEX_MALE ? JOB_BARD : JOB_DANCER);
+ else if (class == JOB_CLOWN || class == JOB_GYPSY)
+ class = (sex == SEX_MALE ? JOB_CLOWN : JOB_GYPSY);
+ else if (class == JOB_BABY_BARD || class == JOB_BABY_DANCER)
+ class = (sex == SEX_MALE ? JOB_BABY_BARD : JOB_BABY_DANCER);
+ else if (class == JOB_MINSTREL || class == JOB_WANDERER)
+ class = (sex == SEX_MALE ? JOB_MINSTREL : JOB_WANDERER);
+ else if (class == JOB_MINSTREL_T || class == JOB_WANDERER_T)
+ class = (sex == SEX_MALE ? JOB_MINSTREL_T : JOB_WANDERER_T);
+ else if (class == JOB_BABY_MINSTREL || class == JOB_BABY_WANDERER)
+ class = (sex == SEX_MALE ? JOB_BABY_MINSTREL : JOB_BABY_WANDERER);
+ else if (class == JOB_KAGEROU || class == JOB_OBORO)
+ class = (sex == SEX_MALE ? JOB_KAGEROU : JOB_OBORO);
if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `equip`='0' WHERE `char_id`='%d'", inventory_db, char_id))
Sql_ShowDebug(inter->sql_handle);
if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `class`='%d', `weapon`='0', `shield`='0', "
"`head_top`='0', `head_mid`='0', `head_bottom`='0' WHERE `char_id`='%d'",
- char_db, class_, char_id))
+ char_db, class, char_id))
Sql_ShowDebug(inter->sql_handle);
if (guild_id) // If there is a guild, update the guild_member data [Skotlex]
inter_guild->sex_changed(guild_id, acc, char_id, sex);
@@ -2466,10 +2383,10 @@ void char_change_sex_sub(int sex, int acc, int char_id, int class_, int guild_id
int char_parse_fromlogin_changesex_reply(int fd)
{
- int char_id = 0, class_ = 0, guild_id = 0;
+ int char_id = 0, class = 0, guild_id = 0;
int i;
struct char_auth_node *node;
- SqlStmt *stmt;
+ struct SqlStmt *stmt;
int acc = RFIFOL(fd,2);
int sex = RFIFOB(fd,6);
@@ -2495,11 +2412,11 @@ int char_parse_fromlogin_changesex_reply(int fd)
SQL->StmtFree(stmt);
}
SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &char_id, 0, NULL, NULL);
- SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &class_, 0, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 1, SQLDT_INT, &class, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 2, SQLDT_INT, &guild_id, 0, NULL, NULL);
for (i = 0; i < MAX_CHARS && SQL_SUCCESS == SQL->StmtNextRow(stmt); ++i) {
- char_change_sex_sub(sex, acc, char_id, class_, guild_id);
+ char_change_sex_sub(sex, acc, char_id, class, guild_id);
}
SQL->StmtFree(stmt);
@@ -2608,9 +2525,8 @@ void char_parse_fromlogin_accinfo2_failed(int fd)
void char_parse_fromlogin_accinfo2_ok(int fd)
{
mapif->parse_accinfo2(true, RFIFOL(fd,167), RFIFOL(fd,171), RFIFOL(fd,175), RFIFOL(fd,179),
- (char*)RFIFOP(fd,2), (char*)RFIFOP(fd,26), (char*)RFIFOP(fd,59),
- (char*)RFIFOP(fd,99), (char*)RFIFOP(fd,119), (char*)RFIFOP(fd,151),
- (char*)RFIFOP(fd,156), RFIFOL(fd,115), RFIFOL(fd,143), RFIFOL(fd,147));
+ RFIFOP(fd,2), RFIFOP(fd,26), RFIFOP(fd,59), RFIFOP(fd,99), RFIFOP(fd,119),
+ RFIFOP(fd,151), RFIFOP(fd,156), RFIFOL(fd,115), RFIFOL(fd,143), RFIFOL(fd,147));
RFIFOSKIP(fd,183);
}
@@ -2788,7 +2704,7 @@ void char_global_accreg_to_login_add (const char *key, unsigned int index, intpt
WFIFOB(chr->login_fd, nlen) = (unsigned char)len;/* won't be higher; the column size is 32 */
nlen += 1;
- safestrncpy((char*)WFIFOP(chr->login_fd,nlen), key, len);
+ safestrncpy(WFIFOP(chr->login_fd,nlen), key, len);
nlen += len;
WFIFOL(chr->login_fd, nlen) = index;
@@ -2805,7 +2721,7 @@ void char_global_accreg_to_login_add (const char *key, unsigned int index, intpt
WFIFOB(chr->login_fd, nlen) = (unsigned char)len;/* won't be higher; the column size is 254 */
nlen += 1;
- safestrncpy((char*)WFIFOP(chr->login_fd,nlen), sval, len);
+ safestrncpy(WFIFOP(chr->login_fd,nlen), sval, len);
nlen += len;
}
} else {
@@ -3096,7 +3012,7 @@ void char_parse_frommap_map_names(int fd, int id)
VECTOR_PUSH(chr->server[id].maps, RFIFOW(fd,i));
}
- ShowStatus("Map-Server %d connected: %d maps, from IP %d.%d.%d.%d port %d.\n",
+ ShowStatus("Map-Server %d connected: %d maps, from IP %u.%u.%u.%u port %d.\n",
id, (int)VECTOR_LENGTH(chr->server[id].maps), CONVIP(chr->server[id].ip), chr->server[id].port);
ShowStatus("Map-server %d loading complete.\n", id);
@@ -3292,7 +3208,7 @@ void char_parse_frommap_char_select_req(int fd)
}
}
-void char_change_map_server_ack(int fd, uint8 *data, bool ok)
+void char_change_map_server_ack(int fd, const uint8 *data, bool ok)
{
WFIFOHEAD(fd,30);
WFIFOW(fd,0) = 0x2b06;
@@ -3371,7 +3287,7 @@ void char_char_name_ack(int fd, int char_id)
WFIFOHEAD(fd,30);
WFIFOW(fd,0) = 0x2b09;
WFIFOL(fd,2) = char_id;
- chr->loadName(char_id, (char*)WFIFOP(fd,6));
+ chr->loadName(char_id, WFIFOP(fd,6));
WFIFOSET(fd,30);
}
@@ -3406,7 +3322,7 @@ void char_ban(int account_id, int char_id, time_t *unban_time, short year, short
{
time_t timestamp;
struct tm *tmtime;
- SqlStmt* stmt = SQL->StmtMalloc(inter->sql_handle);
+ struct SqlStmt *stmt = SQL->StmtMalloc(inter->sql_handle);
nullpo_retv(unban_time);
@@ -3427,8 +3343,8 @@ void char_ban(int account_id, int char_id, time_t *unban_time, short year, short
if( SQL_SUCCESS != SQL->StmtPrepare(stmt,
"UPDATE `%s` SET `unban_time` = ? WHERE `char_id` = ? LIMIT 1",
char_db)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_LONG, (void*)&timestamp, sizeof(timestamp))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_INT, (void*)&char_id, sizeof(char_id))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_LONG, &timestamp, sizeof(timestamp))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_INT, &char_id, sizeof(char_id))
|| SQL_SUCCESS != SQL->StmtExecute(stmt)
) {
SqlStmt_ShowDebug(stmt);
@@ -3460,7 +3376,7 @@ void char_ask_name_ack(int fd, int acc, const char* name, int type, int result)
WFIFOHEAD(fd,34);
WFIFOW(fd, 0) = 0x2b0f;
WFIFOL(fd, 2) = acc;
- safestrncpy((char*)WFIFOP(fd,6), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,6), name, NAME_LENGTH);
WFIFOW(fd,30) = type;
WFIFOW(fd,32) = result;
WFIFOSET(fd,34);
@@ -3478,7 +3394,7 @@ void char_ask_name_ack(int fd, int acc, const char* name, int type, int result)
*/
int char_changecharsex(int char_id, int sex)
{
- int class_ = 0, guild_id = 0, account_id = 0;
+ int class = 0, guild_id = 0, account_id = 0;
char *data;
// get character data
@@ -3491,7 +3407,7 @@ int char_changecharsex(int char_id, int sex)
return 1;
}
SQL->GetData(inter->sql_handle, 0, &data, NULL); account_id = atoi(data);
- SQL->GetData(inter->sql_handle, 1, &data, NULL); class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 1, &data, NULL); class = atoi(data);
SQL->GetData(inter->sql_handle, 2, &data, NULL); guild_id = atoi(data);
SQL->FreeResult(inter->sql_handle);
@@ -3499,7 +3415,7 @@ int char_changecharsex(int char_id, int sex)
Sql_ShowDebug(inter->sql_handle);
return 1;
}
- char_change_sex_sub(sex, account_id, char_id, class_, guild_id);
+ char_change_sex_sub(sex, account_id, char_id, class, guild_id);
// disconnect player if online on char-server
chr->disconnect_player(account_id);
@@ -3515,7 +3431,7 @@ void char_parse_frommap_change_account(int fd)
char esc_name[NAME_LENGTH*2+1];
int acc = RFIFOL(fd,2); // account_id of who ask (-1 if server itself made this request)
- const char* name = (char*)RFIFOP(fd,6); // name of the target character
+ const char *name = RFIFOP(fd,6); // name of the target character
int type = RFIFOW(fd,30); // type of operation: 1-block, 2-ban, 3-unblock, 4-unban, 5 changesex, 6 charban, 7 charunban
short year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
int sex = SEX_MALE;
@@ -3658,7 +3574,7 @@ void char_parse_frommap_ragsrvinfo(int fd)
SQL->EscapeString(inter->sql_handle, esc_server_name, chr->server_name);
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` SET `index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d'",
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` SET `index`='%d',`name`='%s',`exp`='%u',`jexp`='%u',`drop`='%u'",
ragsrvinfo_db, fd, esc_server_name, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)) )
{
Sql_ShowDebug(inter->sql_handle);
@@ -3834,7 +3750,7 @@ void char_parse_frommap_auth_request(int fd, int id)
void char_parse_frommap_update_ip(int fd, int id)
{
chr->server[id].ip = ntohl(RFIFOL(fd, 2));
- ShowInfo("Updated IP address of map-server #%d to %d.%d.%d.%d.\n", id, CONVIP(chr->server[id].ip));
+ ShowInfo("Updated IP address of map-server #%d to %u.%u.%u.%u.\n", id, CONVIP(chr->server[id].ip));
RFIFOSKIP(fd,6);
}
@@ -3858,17 +3774,13 @@ void char_parse_frommap_request_stats_report(int fd)
WFIFOHEAD(sfd, RFIFOW(fd,2) );
- memcpy((char*)WFIFOP(sfd,0), (char*)RFIFOP(fd, 0), RFIFOW(fd,2));
+ memcpy(WFIFOP(sfd,0), RFIFOP(fd, 0), RFIFOW(fd,2));
WFIFOSET(sfd, RFIFOW(fd,2) );
do {
sockt->flush(sfd);
-#ifdef WIN32
- Sleep(1);
-#else
- sleep(1);
-#endif
+ HSleep(1);
} while( !sockt->session[sfd]->flag.eof && sockt->session[sfd]->wdata_size );
sockt->close(sfd);
@@ -3887,9 +3799,11 @@ void char_parse_frommap_scdata_update(int fd)
int val4 = RFIFOL(fd, 24);
short type = RFIFOW(fd, 10);
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`account_id`,`char_id`,`type`,`tick`,`val1`,`val2`,`val3`,`val4`) VALUES ('%d','%d','%d',-1,'%d','%d','%d','%d')",
- scdata_db, account_id, char_id, type, val1, val2, val3, val4) )
- {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s`"
+ " (`account_id`,`char_id`,`type`,`tick`,`val1`,`val2`,`val3`,`val4`)"
+ " VALUES ('%d','%d','%d','%d','%d','%d','%d','%d')",
+ scdata_db, account_id, char_id, type, INFINITE_DURATION, val1, val2, val3, val4)
+ ) {
Sql_ShowDebug(inter->sql_handle);
}
RFIFOSKIP(fd, 28);
@@ -3930,8 +3844,11 @@ int char_parse_frommap(int fd)
int packet_id = RFIFOW(fd,0);
if (VECTOR_LENGTH(HPM->packets[hpParse_FromMap]) > 0) {
int result = HPM->parse_packets(fd,packet_id,hpParse_FromMap);
- if (result == 1)
+ if (result == 1) {
+ if (sockt->session[fd] == NULL)
+ return 0;
continue;
+ }
if (result == 2)
return 0;
}
@@ -4345,7 +4262,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
{// CH: <0829>.W <char id>.L <birth date:YYMMDD>.6B
char birthdate[8+1];
int char_id, i;
- unsigned int base_level;
+ int base_level;
char* data;
time_t delete_date;
@@ -4379,7 +4296,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
return;
}
- SQL->GetData(inter->sql_handle, 0, &data, NULL); base_level = (unsigned int)strtoul(data, NULL, 10);
+ SQL->GetData(inter->sql_handle, 0, &data, NULL); base_level = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); delete_date = strtoul(data, NULL, 10);
if( !delete_date || delete_date>time(NULL) )
@@ -4394,8 +4311,8 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
return;
}
- if( ( char_del_level > 0 && base_level >= (unsigned int)char_del_level ) || ( char_del_level < 0 && base_level <= (unsigned int)(-char_del_level) ) )
- {// character level config restriction
+ if ((char_del_level > 0 && base_level >= char_del_level) || (char_del_level < 0 && base_level <= -char_del_level)) {
+ // character level config restriction
chr->delete2_accept_ack(fd, char_id, 2); // 2: Due to system settings can not be deleted
return;
}
@@ -4457,7 +4374,7 @@ void char_parse_char_connect(int fd, struct char_session_data* sd, uint32 ipl)
RFIFOSKIP(fd,17);
- ShowInfo("request connect - account_id:%d/login_id1:%d/login_id2:%d\n", account_id, login_id1, login_id2);
+ ShowInfo("request connect - account_id:%d/login_id1:%u/login_id2:%u\n", account_id, login_id1, login_id2);
if (sd) {
//Received again auth packet for already authenticated account?? Discard it.
@@ -4515,14 +4432,21 @@ void char_parse_char_connect(int fd, struct char_session_data* sd, uint32 ipl)
void char_send_map_info(int fd, int i, uint32 subnet_map_ip, struct mmo_charstatus *cd)
{
+#if PACKETVER < 20170329
+ const int cmd = 0x71;
+ const int len = 28;
+#else
+ const int cmd = 0xac5;
+ const int len = 156;
+#endif
nullpo_retv(cd);
- WFIFOHEAD(fd,28);
- WFIFOW(fd,0) = 0x71;
- WFIFOL(fd,2) = cd->char_id;
- mapindex->getmapname_ext(mapindex_id2name(cd->last_point.map), (char*)WFIFOP(fd,6));
- WFIFOL(fd,22) = htonl((subnet_map_ip) ? subnet_map_ip : chr->server[i].ip);
- WFIFOW(fd,26) = sockt->ntows(htons(chr->server[i].port)); // [!] LE byte order here [!]
- WFIFOSET(fd,28);
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = cmd;
+ WFIFOL(fd, 2) = cd->char_id;
+ mapindex->getmapname_ext(mapindex_id2name(cd->last_point.map), WFIFOP(fd, 6));
+ WFIFOL(fd, 22) = htonl((subnet_map_ip) ? subnet_map_ip : chr->server[i].ip);
+ WFIFOW(fd, 26) = sockt->ntows(htons(chr->server[i].port)); // [!] LE byte order here [!]
+ WFIFOSET(fd, len);
}
void char_send_wait_char_server(int fd)
@@ -4530,7 +4454,7 @@ void char_send_wait_char_server(int fd)
WFIFOHEAD(fd, 24);
WFIFOW(fd, 0) = 0x840;
WFIFOW(fd, 2) = 24;
- safestrncpy((char*)WFIFOP(fd,4), "0", 20);/* we can't send empty (otherwise the list will pop up) */
+ safestrncpy(WFIFOP(fd,4), "0", 20);/* we can't send empty (otherwise the list will pop up) */
WFIFOSET(fd, 24);
}
@@ -4636,13 +4560,13 @@ void char_parse_char_select(int fd, struct char_session_data* sd, uint32 ipl)
if( cd->sex == 99 )
cd->sex = sd->sex;
- if (log_char) {
+ if (chr->enable_logs) {
char esc_name[NAME_LENGTH*2+1];
// FIXME: Why are we re-escaping the name if it was already escaped in rename/make_new_char? [Panikon]
SQL->EscapeStringLen(inter->sql_handle, esc_name, char_dat.name, strnlen(char_dat.name, NAME_LENGTH));
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `name`) VALUES (NOW(), '%d', '%d', '%d', '%s')",
- charlog_db, sd->account_id, cd->char_id, slot, esc_name) )
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `name`) VALUES (NOW(), '%d', '%d', '%d', '%s')",
+ charlog_db, sd->account_id, cd->char_id, slot, esc_name))
Sql_ShowDebug(inter->sql_handle);
}
ShowInfo("Selected char: (Account %d: %d - %s)\n", sd->account_id, slot, char_dat.name);
@@ -4735,15 +4659,31 @@ void char_parse_char_create_new_char(int fd, struct char_session_data* sd) __att
void char_parse_char_create_new_char(int fd, struct char_session_data* sd)
{
int result;
- if( !char_new ) {
+ if (!enable_char_creation) {
//turn character creation on/off [Kevin]
result = -2;
} else {
- #if PACKETVER >= 20120307
- result = chr->make_new_char_sql(sd, (char*)RFIFOP(fd,2), 1, 1, 1, 1, 1, 1, RFIFOB(fd,26),RFIFOW(fd,27),RFIFOW(fd,29));
- #else
- result = chr->make_new_char_sql(sd, (char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOB(fd,27),RFIFOB(fd,28),RFIFOB(fd,29),RFIFOB(fd,30),RFIFOB(fd,31),RFIFOB(fd,32),RFIFOW(fd,33),RFIFOW(fd,35));
- #endif
+#if PACKETVER >= 20151001
+ uint8 sex = RFIFOB(fd, 35);
+
+ switch (sex) {
+ case SEX_FEMALE:
+ sex = 'F';
+ break;
+ case SEX_MALE:
+ sex = 'M';
+ break;
+ default:
+ chr->creation_failed(fd, -2); // Char Creation Denied
+ RFIFOSKIP(fd, 36);
+ return;
+ }
+ result = chr->make_new_char_sql(sd, RFIFOP(fd, 2), 1, 1, 1, 1, 1, 1, RFIFOB(fd, 26), RFIFOW(fd, 27), RFIFOW(fd, 29), RFIFOW(fd, 31), sex);
+#elif PACKETVER >= 20120307
+ result = chr->make_new_char_sql(sd, RFIFOP(fd, 2), 1, 1, 1, 1, 1, 1, RFIFOB(fd, 26), RFIFOW(fd, 27), RFIFOW(fd, 29), JOB_NOVICE, 'U');
+#else
+ result = chr->make_new_char_sql(sd, RFIFOP(fd, 2), RFIFOB(fd, 26), RFIFOB(fd, 27), RFIFOB(fd, 28), RFIFOB(fd, 29), RFIFOB(fd, 30), RFIFOB(fd, 31), RFIFOB(fd, 32), RFIFOW(fd, 33), RFIFOW(fd, 35), JOB_NOVICE, 'U');
+#endif
}
//'Charname already exists' (-1), 'Char creation denied' (-2) and 'You are underaged' (-3)
@@ -4758,11 +4698,13 @@ void char_parse_char_create_new_char(int fd, struct char_session_data* sd)
// add new entry to the chars list
sd->found_char[char_dat.slot] = result; // the char_id of the new char
}
- #if PACKETVER >= 20120307
- RFIFOSKIP(fd,31);
- #else
- RFIFOSKIP(fd,37);
- #endif
+#if PACKETVER >= 20151001
+ RFIFOSKIP(fd, 36);
+#elif PACKETVER >= 20120307
+ RFIFOSKIP(fd, 31);
+#else
+ RFIFOSKIP(fd, 37);
+#endif
}
// flag:
@@ -4856,7 +4798,7 @@ void char_parse_char_rename_char(int fd, struct char_session_data* sd)
int i, cid =RFIFOL(fd,2);
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
- safestrncpy(name, (char *)RFIFOP(fd,6), NAME_LENGTH);
+ safestrncpy(name, RFIFOP(fd,6), NAME_LENGTH);
RFIFOSKIP(fd,30);
ARR_FIND( 0, MAX_CHARS, i, sd->found_char[i] == cid );
@@ -4881,7 +4823,7 @@ void char_parse_char_rename_char2(int fd, struct char_session_data* sd)
int i, aid = RFIFOL(fd,2), cid =RFIFOL(fd,6);
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];
- safestrncpy(name, (char *)RFIFOP(fd,10), NAME_LENGTH);
+ safestrncpy(name, RFIFOP(fd,10), NAME_LENGTH);
RFIFOSKIP(fd,34);
if( aid != sd->account_id )
@@ -4978,11 +4920,10 @@ void char_login_map_server_ack(int fd, uint8 flag)
void char_parse_char_login_map_server(int fd, uint32 ipl)
{
- char* l_user = (char*)RFIFOP(fd,2);
- char* l_pass = (char*)RFIFOP(fd,26);
+ char l_user[24], l_pass[24];
int i;
- l_user[23] = '\0';
- l_pass[23] = '\0';
+ safestrncpy(l_user, RFIFOP(fd,2), 24);
+ safestrncpy(l_pass, RFIFOP(fd,26), 24);
ARR_FIND( 0, ARRAYLENGTH(chr->server), i, chr->server[i].fd <= 0 );
if (core->runflag != CHARSERVER_ST_RUNNING ||
@@ -5141,17 +5082,22 @@ int char_parse_char(int fd)
break;
// create new char
- #if PACKETVER >= 20120307
+#if PACKETVER >= 20151001
+ // S 0a39 <name>.24B <slot>.B <hair color>.W <hair style>.W <starting job class ID>.W <Unknown>.(W or 2 B's)??? <sex>.B
+ case 0xa39:
+ {
+ FIFOSD_CHECK(36);
+#elif PACKETVER >= 20120307
// S 0970 <name>.24B <slot>.B <hair color>.W <hair style>.W
case 0x970:
{
FIFOSD_CHECK(31);
- #else
+#else
// S 0067 <name>.24B <str>.B <agi>.B <vit>.B <int>.B <dex>.B <luk>.B <slot>.B <hair color>.W <hair style>.W
case 0x67:
{
FIFOSD_CHECK(37);
- #endif
+#endif
chr->parse_char_create_new_char(fd, sd);
}
@@ -5293,7 +5239,7 @@ int char_parse_char(int fd)
return 0;
}
-int mapif_sendall(unsigned char *buf, unsigned int len)
+int mapif_sendall(const unsigned char *buf, unsigned int len)
{
int i, c;
@@ -5381,7 +5327,7 @@ int char_broadcast_user_count(int tid, int64 tick, int id, intptr_t data) {
* Load this character's account id into the 'online accounts' packet
* @see DBApply
*/
-static int char_send_accounts_tologin_sub(DBKey key, DBData *data, va_list ap)
+static int char_send_accounts_tologin_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct online_char_data* character = DB->data2ptr(data);
int* i = va_arg(ap, int*);
@@ -5450,7 +5396,7 @@ static int char_waiting_disconnect(int tid, int64 tick, int id, intptr_t data) {
/**
* @see DBApply
*/
-static int char_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap)
+static int char_online_data_cleanup_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct online_char_data *character= DB->data2ptr(data);
nullpo_ret(character);
@@ -5469,304 +5415,683 @@ static int char_online_data_cleanup(int tid, int64 tick, int id, intptr_t data)
return 0;
}
-void char_sql_config_read(const char* cfgName)
+/**
+ * Reads the 'inter_configuration' config file and initializes required variables.
+ *
+ * @param filename Path to configuration file
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_sql_config_read(const char *filename, bool imported)
{
- char line[1024], w1[1024], w2[1024];
- FILE* fp;
+ struct config_t config;
+ const struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
- if ((fp = fopen(cfgName, "r")) == NULL) {
- ShowError("File not found: %s\n", cfgName);
- return;
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->load_file
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration/database_names")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("sql_config_read: inter_configuration/database_names was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "char_db", char_db, sizeof(char_db));
+ libconfig->setting_lookup_mutable_string(setting, "interlog_db", interlog_db, sizeof(interlog_db));
+ libconfig->setting_lookup_mutable_string(setting, "ragsrvinfo_db", ragsrvinfo_db, sizeof(ragsrvinfo_db));
+
+ if (!chr->sql_config_read_registry(filename, &config, imported))
+ retval = false;
+ if (!chr->sql_config_read_pc(filename, &config, imported))
+ retval = false;
+ if (!chr->sql_config_read_guild(filename, &config, imported))
+ retval = false;
+
+ ShowInfo("Done reading %s.\n", filename);
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, chr->SQL_CONF_NAME) == 0) {
+ ShowWarning("sql_config_read: Loop detected in %s! Skipping 'import'...\n", filename);
+ } else {
+ if (!chr->sql_config_read(import, true))
+ retval = false;
+ }
}
- while(fgets(line, sizeof(line), fp))
- {
- if(line[0] == '/' && line[1] == '/')
- continue;
+ if (!HPM->parse_conf(&config, filename, HPCT_CHAR_INTER, imported))
+ retval = false;
- if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2)
- continue;
+ libconfig->destroy(&config);
+ return retval;
+}
- if(!strcmpi(w1,"char_db"))
- safestrncpy(char_db, w2, sizeof(char_db));
- else if(!strcmpi(w1,"scdata_db"))
- safestrncpy(scdata_db, w2, sizeof(scdata_db));
- else if(!strcmpi(w1,"cart_db"))
- safestrncpy(cart_db, w2, sizeof(cart_db));
- else if(!strcmpi(w1,"inventory_db"))
- safestrncpy(inventory_db, w2, sizeof(inventory_db));
- else if(!strcmpi(w1,"charlog_db"))
- safestrncpy(charlog_db, w2, sizeof(charlog_db));
- else if(!strcmpi(w1,"storage_db"))
- safestrncpy(storage_db, w2, sizeof(storage_db));
- else if(!strcmpi(w1,"skill_db"))
- safestrncpy(skill_db, w2, sizeof(skill_db));
- else if(!strcmpi(w1,"interlog_db"))
- safestrncpy(interlog_db, w2, sizeof(interlog_db));
- else if(!strcmpi(w1,"memo_db"))
- safestrncpy(memo_db, w2, sizeof(memo_db));
- else if(!strcmpi(w1,"guild_db"))
- safestrncpy(guild_db, w2, sizeof(guild_db));
- else if(!strcmpi(w1,"guild_alliance_db"))
- safestrncpy(guild_alliance_db, w2, sizeof(guild_alliance_db));
- else if(!strcmpi(w1,"guild_castle_db"))
- safestrncpy(guild_castle_db, w2, sizeof(guild_castle_db));
- else if(!strcmpi(w1,"guild_expulsion_db"))
- safestrncpy(guild_expulsion_db, w2, sizeof(guild_expulsion_db));
- else if(!strcmpi(w1,"guild_member_db"))
- safestrncpy(guild_member_db, w2, sizeof(guild_member_db));
- else if(!strcmpi(w1,"guild_skill_db"))
- safestrncpy(guild_skill_db, w2, sizeof(guild_skill_db));
- else if(!strcmpi(w1,"guild_position_db"))
- safestrncpy(guild_position_db, w2, sizeof(guild_position_db));
- else if(!strcmpi(w1,"guild_storage_db"))
- safestrncpy(guild_storage_db, w2, sizeof(guild_storage_db));
- else if(!strcmpi(w1,"party_db"))
- safestrncpy(party_db, w2, sizeof(party_db));
- else if(!strcmpi(w1,"pet_db"))
- safestrncpy(pet_db, w2, sizeof(pet_db));
- else if(!strcmpi(w1,"mail_db"))
- safestrncpy(mail_db, w2, sizeof(mail_db));
- else if(!strcmpi(w1,"auction_db"))
- safestrncpy(auction_db, w2, sizeof(auction_db));
- else if(!strcmpi(w1,"friend_db"))
- safestrncpy(friend_db, w2, sizeof(friend_db));
- else if(!strcmpi(w1,"hotkey_db"))
- safestrncpy(hotkey_db, w2, sizeof(hotkey_db));
- else if(!strcmpi(w1,"quest_db"))
- safestrncpy(quest_db,w2,sizeof(quest_db));
- else if(!strcmpi(w1,"homunculus_db"))
- safestrncpy(homunculus_db,w2,sizeof(homunculus_db));
- else if(!strcmpi(w1,"skill_homunculus_db"))
- safestrncpy(skill_homunculus_db,w2,sizeof(skill_homunculus_db));
- else if(!strcmpi(w1,"mercenary_db"))
- safestrncpy(mercenary_db,w2,sizeof(mercenary_db));
- else if(!strcmpi(w1,"mercenary_owner_db"))
- safestrncpy(mercenary_owner_db,w2,sizeof(mercenary_owner_db));
- else if(!strcmpi(w1,"ragsrvinfo_db"))
- safestrncpy(ragsrvinfo_db,w2,sizeof(ragsrvinfo_db));
- else if(!strcmpi(w1,"elemental_db"))
- safestrncpy(elemental_db,w2,sizeof(elemental_db));
- else if(!strcmpi(w1,"account_data_db"))
- safestrncpy(account_data_db,w2,sizeof(account_data_db));
- else if(!strcmpi(w1,"char_reg_num_db"))
- safestrncpy(char_reg_num_db, w2, sizeof(char_reg_num_db));
- else if(!strcmpi(w1,"char_reg_str_db"))
- safestrncpy(char_reg_str_db, w2, sizeof(char_reg_str_db));
- else if(!strcmpi(w1,"acc_reg_str_db"))
- safestrncpy(acc_reg_str_db, w2, sizeof(acc_reg_str_db));
- else if(!strcmpi(w1,"acc_reg_num_db"))
- safestrncpy(acc_reg_num_db, w2, sizeof(acc_reg_num_db));
- //support the import command, just like any other config
- else if(!strcmpi(w1,"import"))
- chr->sql_config_read(w2);
- else
- HPM->parseConf(w1, w2, HPCT_CHAR_INTER);
+/**
+ * Reads the 'inter_configuration/database_names/registry' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_sql_config_read_registry(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/database_names/registry")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("sql_config_read: inter_configuration/database_names/registry was not found in %s!\n", filename);
+ return false;
}
- fclose(fp);
- ShowInfo("Done reading %s.\n", cfgName);
+ // Not all registries are read by char-server
+ libconfig->setting_lookup_mutable_string(setting, "char_reg_num_db", char_reg_num_db, sizeof(char_reg_num_db));
+ libconfig->setting_lookup_mutable_string(setting, "char_reg_str_db", char_reg_str_db, sizeof(char_reg_str_db));
+ libconfig->setting_lookup_mutable_string(setting, "acc_reg_str_db", acc_reg_str_db, sizeof(acc_reg_str_db));
+ libconfig->setting_lookup_mutable_string(setting, "acc_reg_num_db", acc_reg_num_db, sizeof(acc_reg_num_db));
+
+ return true;
}
-void char_config_dispatch(char *w1, char *w2) {
- bool (*dispatch_to[]) (char *w1, char *w2) = {
- /* as many as it needs */
- pincode->config_read
- };
- int i, len = ARRAYLENGTH(dispatch_to);
- for(i = 0; i < len; i++) {
- if( (*dispatch_to[i])(w1,w2) )
- break;/* we found who this belongs to, can stop */
+/**
+ * Reads the 'inter_configuration/database_names/pc' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_sql_config_read_pc(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/database_names/pc")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("sql_config_read: inter_configuration/database_names/pc was not found in %s!\n", filename);
+ return false;
}
- if (i == len)
- HPM->parseConf(w1, w2, HPCT_CHAR);
+ libconfig->setting_lookup_mutable_string(setting, "hotkey_db", hotkey_db, sizeof(hotkey_db));
+ libconfig->setting_lookup_mutable_string(setting, "scdata_db", scdata_db, sizeof(scdata_db));
+ libconfig->setting_lookup_mutable_string(setting, "inventory_db", inventory_db, sizeof(inventory_db));
+ libconfig->setting_lookup_mutable_string(setting, "cart_db", cart_db, sizeof(cart_db));
+ libconfig->setting_lookup_mutable_string(setting, "charlog_db", charlog_db, sizeof(charlog_db));
+ libconfig->setting_lookup_mutable_string(setting, "storage_db", storage_db, sizeof(storage_db));
+ libconfig->setting_lookup_mutable_string(setting, "skill_db", skill_db, sizeof(skill_db));
+ libconfig->setting_lookup_mutable_string(setting, "memo_db", memo_db, sizeof(memo_db));
+ libconfig->setting_lookup_mutable_string(setting, "party_db", party_db, sizeof(party_db));
+ libconfig->setting_lookup_mutable_string(setting, "pet_db", pet_db, sizeof(pet_db));
+ libconfig->setting_lookup_mutable_string(setting, "friend_db", friend_db, sizeof(friend_db));
+ libconfig->setting_lookup_mutable_string(setting, "mail_db", mail_db, sizeof(mail_db));
+ libconfig->setting_lookup_mutable_string(setting, "auction_db", auction_db, sizeof(auction_db));
+ libconfig->setting_lookup_mutable_string(setting, "quest_db", quest_db, sizeof(quest_db));
+ libconfig->setting_lookup_mutable_string(setting, "homunculus_db", homunculus_db, sizeof(homunculus_db));
+ libconfig->setting_lookup_mutable_string(setting, "skill_homunculus_db", skill_homunculus_db, sizeof(skill_homunculus_db));
+ libconfig->setting_lookup_mutable_string(setting, "mercenary_db", mercenary_db, sizeof(mercenary_db));
+ libconfig->setting_lookup_mutable_string(setting, "mercenary_owner_db", mercenary_owner_db, sizeof(mercenary_owner_db));
+ libconfig->setting_lookup_mutable_string(setting, "elemental_db", elemental_db, sizeof(elemental_db));
+ libconfig->setting_lookup_mutable_string(setting, "account_data_db", account_data_db, sizeof(account_data_db));
+
+ return true;
}
-int char_config_read(const char* cfgName)
+/**
+ * Reads the 'inter_configuration/database_names/guild' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_sql_config_read_guild(const char *filename, const struct config_t *config, bool imported)
{
- char line[1024], w1[1024], w2[1024];
- FILE* fp = fopen(cfgName, "r");
+ const struct config_setting_t *setting = NULL;
- if (fp == NULL) {
- ShowError("Configuration file not found: %s.\n", cfgName);
- return 1;
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/database_names/guild")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("sql_config_read: inter_configuration/database_names/guild was not found in %s!\n", filename);
+ return false;
}
- while(fgets(line, sizeof(line), fp)) {
- if (line[0] == '/' && line[1] == '/')
+ libconfig->setting_lookup_mutable_string(setting, "main_db", guild_db, sizeof(guild_db));
+ libconfig->setting_lookup_mutable_string(setting, "alliance_db", guild_alliance_db, sizeof(guild_alliance_db));
+ libconfig->setting_lookup_mutable_string(setting, "castle_db", guild_castle_db, sizeof(guild_castle_db));
+ libconfig->setting_lookup_mutable_string(setting, "expulsion_db", guild_expulsion_db, sizeof(guild_expulsion_db));
+ libconfig->setting_lookup_mutable_string(setting, "member_db", guild_member_db, sizeof(guild_member_db));
+ libconfig->setting_lookup_mutable_string(setting, "skill_db", guild_skill_db, sizeof(guild_skill_db));
+ libconfig->setting_lookup_mutable_string(setting, "position_db", guild_position_db, sizeof(guild_position_db));
+ libconfig->setting_lookup_mutable_string(setting, "storage_db", guild_storage_db, sizeof(guild_storage_db));
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration' config file and initializes required variables.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->load_file
+
+ if (!chr->config_read_top(filename, &config, imported))
+ retval = false;
+ if (!chr->config_read_inter(filename, &config, imported))
+ retval = false;
+ if (!chr->config_read_permission(filename, &config, imported))
+ retval = false;
+ if (!chr->config_read_player(filename, &config, imported))
+ retval = false;
+ if (!chr->config_read_console(filename, &config, imported))
+ retval = false;
+ if (!chr->config_read_database(filename, &config, imported))
+ retval = false;
+ if (!inter->config_read_connection(filename, &config, imported))
+ retval = false;
+ if (!pincode->config_read(filename, &config, imported))
+ retval = false;
+
+ if (!HPM->parse_conf(&config, filename, HPCT_CHAR, imported))
+ retval = false;
+
+ ShowInfo("Done reading %s.\n", filename);
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, chr->CHAR_CONF_NAME) == 0) {
+ ShowWarning("char_config_read: Loop detected in %s! Skipping 'import'...\n", filename);
+ } else {
+ if (!chr->config_read(import, true))
+ retval = false;
+ }
+ }
+
+ libconfig->destroy(&config);
+ return retval;
+}
+
+/**
+ * Reads the 'char_configuration' top level config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_top(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration was not found in %s!\n", filename);
+ return false;
+ }
+
+ // char_configuration/server_name
+ if (libconfig->setting_lookup_mutable_string(setting, "server_name", chr->server_name, sizeof(chr->server_name)) == CONFIG_TRUE) {
+ ShowInfo("server name %s\n", chr->server_name);
+ } else if (!imported) {
+ ShowWarning("char_config_read: server_name was not set! Defaulting to 'Hercules'.\n");
+ safestrncpy(chr->server_name, "Hercules", sizeof(chr->server_name));
+ }
+ // char_configuration/wisp_server_name
+ if (libconfig->setting_lookup_mutable_string(setting, "wisp_server_name", wisp_server_name, sizeof(wisp_server_name)) == CONFIG_TRUE) {
+ // wisp_server_name should _always_ be equal or bigger than 4 characters!
+ if (strlen(wisp_server_name) < 4) { // TODO: This length should be a #define (i.e. MIN_NAME_LENGTH)
+ ShowWarning("char_config_read: char_configuration/wisp_server_name is too small! Defaulting to: Server.\n");
+ safestrncpy(chr->server_name, "Server", sizeof(chr->server_name));
+ }
+ }
+ // char_configuration/guild_exp_rate
+ libconfig->setting_lookup_int(setting, "guild_exp_rate", &guild_exp_rate);
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/inter' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_inter(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+ const char *str = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/inter")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/inter was not found in %s!\n", filename);
+ return false;
+ }
+
+ // Login information
+ libconfig->setting_lookup_mutable_string(setting, "userid", chr->userid, sizeof(chr->userid));
+ libconfig->setting_lookup_mutable_string(setting, "passwd", chr->passwd, sizeof(chr->passwd));
+
+ // Login-server and character-server information
+ if (libconfig->setting_lookup_string(setting, "login_ip", &str) == CONFIG_TRUE)
+ chr->config_set_ip("Login server", str, &login_ip, login_ip_str);
+
+ if (libconfig->setting_lookup_string(setting, "char_ip", &str) == CONFIG_TRUE)
+ chr->config_set_ip("Character server", str, &chr->ip, char_ip_str);
+
+ if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE)
+ chr->config_set_ip("Character server binding", str, &bind_ip, bind_ip_str);
+
+ libconfig->setting_lookup_uint16(setting, "login_port", &login_port);
+ libconfig->setting_lookup_uint16(setting, "char_port", &chr->port);
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/database' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_database(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/database")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/database was not found in %s!\n", filename);
+ return false;
+ }
+ if (libconfig->setting_lookup_int(setting, "autosave_time", &autosave_interval) == CONFIG_TRUE) {
+ autosave_interval *= 1000;
+ if (autosave_interval <= 0)
+ autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "db_path", db_path, sizeof(db_path));
+ libconfig->setting_lookup_bool_real(setting, "log_char", &chr->enable_logs);
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/console' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_console(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/console")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/console was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_bool_real(setting, "stdout_with_ansisequence", &showmsg->stdout_with_ansisequence);
+ libconfig->setting_lookup_bool_real(setting, "save_log", &chr->show_save_log);
+ if (libconfig->setting_lookup_int(setting, "console_silent", &showmsg->silent) == CONFIG_TRUE) {
+ if (showmsg->silent) // only bother if its actually enabled
+ ShowInfo("Console Silent Setting: %d\n", showmsg->silent);
+ }
+ libconfig->setting_lookup_mutable_string(setting, "timestamp_format", showmsg->timestamp_format, sizeof(showmsg->timestamp_format));
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/player' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_player(const char *filename, const struct config_t *config, bool imported)
+{
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if (!chr->config_read_player_new(filename, config, imported))
+ retval = false;
+ if (!chr->config_read_player_name(filename, config, imported))
+ retval = false;
+ if (!chr->config_read_player_deletion(filename, config, imported))
+ retval = false;
+ if (!chr->config_read_player_fame(filename, config, imported))
+ retval = false;
+
+ return retval;
+}
+
+/**
+ * Reads the 'char_configuration/player/fame' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_player_fame(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/player/fame")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/player/fame was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_int(setting, "alchemist", &fame_list_size_chemist);
+ if (fame_list_size_chemist > MAX_FAME_LIST) {
+ ShowWarning("Max fame list size is %d (fame_list_alchemist)\n", MAX_FAME_LIST);
+ fame_list_size_chemist = MAX_FAME_LIST;
+ }
+
+ libconfig->setting_lookup_int(setting, "blacksmith", &fame_list_size_smith);
+ if (fame_list_size_smith > MAX_FAME_LIST) {
+ ShowWarning("Max fame list size is %d (fame_list_blacksmith)\n", MAX_FAME_LIST);
+ fame_list_size_smith = MAX_FAME_LIST;
+ }
+
+ libconfig->setting_lookup_int(setting, "taekwon", &fame_list_size_taekwon);
+ if (fame_list_size_taekwon > MAX_FAME_LIST) {
+ ShowWarning("Max fame list size is %d (fame_list_taekwon)\n", MAX_FAME_LIST);
+ fame_list_size_taekwon = MAX_FAME_LIST;
+ }
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/player/deletion' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_player_deletion(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/player/deletion")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/player/deletion was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_int(setting, "level", &char_del_level);
+ libconfig->setting_lookup_int(setting, "delay", &char_del_delay);
+ libconfig->setting_lookup_bool_real(setting, "use_aegis_delete", &char_aegis_delete);
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/player/name' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_player_name(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/player/name")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/player/name was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "unknown_char_name", unknown_char_name, sizeof(unknown_char_name));
+ libconfig->setting_lookup_mutable_string(setting, "name_letters", char_name_letters, sizeof(char_name_letters));
+ libconfig->setting_lookup_int(setting, "name_option", &char_name_option);
+ libconfig->setting_lookup_bool_real(setting, "name_ignoring_case", &name_ignoring_case);
+
+ return true;
+}
+
+/**
+ * Defines start_items based on '(...)/player/new/start_item'.
+ *
+ * @param setting The already retrieved start_item setting.
+ */
+void char_config_set_start_item(const struct config_setting_t *setting)
+{
+ int i, count;
+
+ nullpo_retv(setting);
+
+ VECTOR_CLEAR(start_items);
+
+ count = libconfig->setting_length(setting);
+ if (!count)
+ return;
+
+ VECTOR_ENSURE(start_items, count, 1);
+
+ for (i = 0; i < count; i++) {
+ const struct config_setting_t *t = libconfig->setting_get_elem(setting, i);
+ struct start_item_s start_item = { 0 };
+
+ if (t == NULL)
continue;
- if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2)
+ if (libconfig->setting_lookup_int(t, "id", &start_item.id) != CONFIG_TRUE) {
+ ShowWarning("char_config_read: entry (%d) is missing id! Ignoring...\n", i);
continue;
+ }
+ if (libconfig->setting_lookup_int(t, "amount", &start_item.amount) != CONFIG_TRUE) {
+ ShowWarning("char_config_read: entry (%d) is missing amount! Defaulting to 1...\n", i);
+ start_item.amount = 1;
+ }
+ if (libconfig->setting_lookup_bool_real(t, "stackable", &start_item.stackable) != CONFIG_TRUE) {
+ // Without knowing if the item is stackable or not we can't add it!
+ ShowWarning("char_config_read: entry (%d) is missing stackable! Ignoring...\n", i);
+ continue;
+ }
+ if (libconfig->setting_lookup_int(t, "loc", &start_item.loc) != CONFIG_TRUE)
+ start_item.loc = 0;
+ VECTOR_PUSH(start_items, start_item);
+ }
+}
- remove_control_chars(w1);
- remove_control_chars(w2);
- if(strcmpi(w1,"timestamp_format") == 0) {
- safestrncpy(showmsg->timestamp_format, w2, sizeof(showmsg->timestamp_format));
- } else if(strcmpi(w1,"console_silent")==0){
- showmsg->silent = atoi(w2);
- if (showmsg->silent) /* only bother if its actually enabled */
- ShowInfo("Console Silent Setting: %d\n", atoi(w2));
- } else if(strcmpi(w1,"stdout_with_ansisequence")==0){
- showmsg->stdout_with_ansisequence = config_switch(w2) ? true : false;
- } else if (strcmpi(w1, "userid") == 0) {
- safestrncpy(chr->userid, w2, sizeof(chr->userid));
- } else if (strcmpi(w1, "passwd") == 0) {
- safestrncpy(chr->passwd, w2, sizeof(chr->passwd));
- } else if (strcmpi(w1, "server_name") == 0) {
- safestrncpy(chr->server_name, w2, sizeof(chr->server_name));
- } else if (strcmpi(w1, "wisp_server_name") == 0) {
- if (strlen(w2) >= 4) {
- safestrncpy(wisp_server_name, w2, sizeof(wisp_server_name));
- }
- } else if (strcmpi(w1, "login_ip") == 0) {
- login_ip = sockt->host2ip(w2);
- if (login_ip) {
- char ip_str[16];
- safestrncpy(login_ip_str, w2, sizeof(login_ip_str));
- ShowStatus("Login server IP address : %s -> %s\n", w2, sockt->ip2str(login_ip, ip_str));
- }
- } else if (strcmpi(w1, "login_port") == 0) {
- login_port = atoi(w2);
- } else if (strcmpi(w1, "char_ip") == 0) {
- chr->ip = sockt->host2ip(w2);
- if (chr->ip) {
- char ip_str[16];
- safestrncpy(char_ip_str, w2, sizeof(char_ip_str));
- ShowStatus("Character server IP address : %s -> %s\n", w2, sockt->ip2str(chr->ip, ip_str));
- }
- } else if (strcmpi(w1, "bind_ip") == 0) {
- bind_ip = sockt->host2ip(w2);
- if (bind_ip) {
- char ip_str[16];
- safestrncpy(bind_ip_str, w2, sizeof(bind_ip_str));
- ShowStatus("Character server binding IP address : %s -> %s\n", w2, sockt->ip2str(bind_ip, ip_str));
- }
- } else if (strcmpi(w1, "char_port") == 0) {
- chr->port = atoi(w2);
- } else if (strcmpi(w1, "char_server_type") == 0) {
- chr->server_type = atoi(w2);
- } else if (strcmpi(w1, "char_new") == 0) {
- char_new = (bool)atoi(w2);
- } else if (strcmpi(w1, "char_new_display") == 0) {
- chr->new_display = atoi(w2);
- } else if (strcmpi(w1, "max_connect_user") == 0) {
- max_connect_user = atoi(w2);
- if (max_connect_user < -1)
- max_connect_user = -1; // unlimited online players
- } else if(strcmpi(w1, "gm_allow_group") == 0) {
- gm_allow_group = atoi(w2);
- } else if (strcmpi(w1, "autosave_time") == 0) {
- autosave_interval = atoi(w2) * 1000;
- if (autosave_interval <= 0)
- autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
- } else if (strcmpi(w1, "save_log") == 0) {
- save_log = config_switch(w2);
+/**
+ * Reads the 'char_configuration/player/new' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_player_new(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL, *setting2 = NULL;
+#ifdef RENEWAL
+ const char *start_point_setting = "start_point_re";
+#else
+ const char *start_point_setting = "start_point_pre";
+#endif
+ int64 i64 = 0;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/player/new")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/player/new was not found in %s!\n", filename);
+ return false;
+ }
+
+ if (libconfig->setting_lookup_int64(setting, "zeny", &i64) == CONFIG_TRUE) {
+ if (i64 > MAX_ZENY) {
+ ShowWarning("char_config_read: player/new/zeny is too big! Capping to MAX_ZENY.\n");
+ start_zeny = MAX_ZENY;
+ } else {
+ start_zeny = (int)i64;
}
- #ifdef RENEWAL
- else if (strcmpi(w1, "start_point_re") == 0) {
- char map[MAP_NAME_LENGTH_EXT];
- int x, y;
- if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3)
- continue;
- start_point.map = mapindex->name2id(map);
- if (!start_point.map)
- ShowError("Specified start_point_re '%s' not found in map-index cache.\n", map);
- start_point.x = x;
- start_point.y = y;
- }
- #else
- else if (strcmpi(w1, "start_point_pre") == 0) {
- char map[MAP_NAME_LENGTH_EXT];
- int x, y;
- if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3)
- continue;
- start_point.map = mapindex->name2id(map);
- if (!start_point.map)
- ShowError("Specified start_point_pre '%s' not found in map-index cache.\n", map);
- start_point.x = x;
- start_point.y = y;
- }
- #endif
- else if (strcmpi(w1, "start_items") == 0) {
- int i;
- char *split;
+ }
- i = 0;
- split = strtok(w2, ",");
- while (split != NULL && i < MAX_START_ITEMS * 3) {
- char *split2 = split;
- split = strtok(NULL, ",");
- start_items[i] = atoi(split2);
+ if ((setting2 = libconfig->setting_get_member(setting, "start_items")))
+ chr->config_set_start_item(setting2);
- if (start_items[i] < 0)
- start_items[i] = 0;
+ // start_point / start_point_pre
+ if ((setting2 = libconfig->setting_get_member(setting, start_point_setting))) {
+ const char *str = NULL;
+ if (libconfig->setting_lookup_string(setting2, "map", &str) == CONFIG_TRUE) {
+ start_point.map = mapindex->name2id(str);
+ if (start_point.map == 0)
+ ShowError("char_config_read_player_new: Specified start_point %s not found in map-index cache.\n", str);
+ libconfig->setting_lookup_int16(setting2, "x", &start_point.x);
+ libconfig->setting_lookup_int16(setting2, "y", &start_point.y);
+ }
+ }
- ++i;
- }
+ return true;
+}
- // Format is: id1,quantity1,stackable1,idN,quantityN,stackableN
- if( i%3 )
- {
- ShowWarning("chr->config_read: There are not enough parameters in start_items, ignoring last item...\n");
- if( i%3 == 1 )
- start_items[i-1] = 0;
- else
- start_items[i-2] = 0;
- }
- } else if (strcmpi(w1, "start_zeny") == 0) {
- start_zeny = atoi(w2);
- if (start_zeny < 0)
- start_zeny = 0;
- } else if(strcmpi(w1,"log_char")==0) {
- log_char = atoi(w2); //log char or not [devil]
- } else if (strcmpi(w1, "unknown_char_name") == 0) {
- safestrncpy(unknown_char_name, w2, sizeof(unknown_char_name));
- unknown_char_name[NAME_LENGTH-1] = '\0';
- } else if (strcmpi(w1, "name_ignoring_case") == 0) {
- name_ignoring_case = (bool)config_switch(w2);
- } else if (strcmpi(w1, "char_name_option") == 0) {
- char_name_option = atoi(w2);
- } else if (strcmpi(w1, "char_name_letters") == 0) {
- safestrncpy(char_name_letters, w2, sizeof(char_name_letters));
- } else if (strcmpi(w1, "char_del_level") == 0) { //disable/enable char deletion by its level condition [Lupus]
- char_del_level = atoi(w2);
- } else if (strcmpi(w1, "char_del_delay") == 0) {
- char_del_delay = atoi(w2);
- } else if (strcmpi(w1, "char_aegis_delete") == 0) {
- char_aegis_delete = atoi(w2);
- } else if(strcmpi(w1,"db_path")==0) {
- safestrncpy(db_path, w2, sizeof(db_path));
- } else if (strcmpi(w1, "fame_list_alchemist") == 0) {
- fame_list_size_chemist = atoi(w2);
- if (fame_list_size_chemist > MAX_FAME_LIST) {
- ShowWarning("Max fame list size is %d (fame_list_alchemist)\n", MAX_FAME_LIST);
- fame_list_size_chemist = MAX_FAME_LIST;
- }
- } else if (strcmpi(w1, "fame_list_blacksmith") == 0) {
- fame_list_size_smith = atoi(w2);
- if (fame_list_size_smith > MAX_FAME_LIST) {
- ShowWarning("Max fame list size is %d (fame_list_blacksmith)\n", MAX_FAME_LIST);
- fame_list_size_smith = MAX_FAME_LIST;
- }
- } else if (strcmpi(w1, "fame_list_taekwon") == 0) {
- fame_list_size_taekwon = atoi(w2);
- if (fame_list_size_taekwon > MAX_FAME_LIST) {
- ShowWarning("Max fame list size is %d (fame_list_taekwon)\n", MAX_FAME_LIST);
- fame_list_size_taekwon = MAX_FAME_LIST;
- }
- } else if (strcmpi(w1, "guild_exp_rate") == 0) {
- guild_exp_rate = atoi(w2);
- } else if (strcmpi(w1, "char_maintenance_min_group_id") == 0) {
- char_maintenance_min_group_id = atoi(w2);
- } else if (strcmpi(w1, "import") == 0) {
- chr->config_read(w2);
- } else
- chr->config_dispatch(w1,w2);
+/**
+ * Reads the 'char_configuration/permission' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool char_config_read_permission(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/permission")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/permission was not found in %s!\n", filename);
+ return false;
}
- fclose(fp);
- ShowInfo("Done reading %s.\n", cfgName);
- return 0;
+ libconfig->setting_lookup_bool_real(setting, "enable_char_creation", &enable_char_creation);
+ if (libconfig->setting_lookup_int16(setting, "display_new", &chr->new_display) != CONFIG_TRUE) {
+ // While normally true/false makes sense, we may accept any int16 here (it's passed as is to the client)
+ int i32 = 0;
+ if (libconfig->setting_lookup_bool(setting, "display_new", &i32) == CONFIG_TRUE)
+ chr->new_display = i32 == 0 ? 0 : 1;
+ }
+ libconfig->setting_lookup_int(setting, "max_connect_user", &max_connect_user);
+ libconfig->setting_lookup_int(setting, "gm_allow_group", &gm_allow_group);
+ libconfig->setting_lookup_int(setting, "maintenance_min_group_id", &char_maintenance_min_group_id);
+ if (libconfig->setting_lookup_int(setting, "server_type", &chr->server_type) == CONFIG_TRUE) {
+ if (chr->server_type < CST_NORMAL || chr->server_type >= CST_MAX) {
+ ShowWarning("char_config_read: Invalid permission/server_type %d, defaulting to CST_NORMAL.\n", chr->server_type);
+ chr->server_type = CST_NORMAL;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Loads an IP into 'out_ip' and shows status.
+ *
+ * @param type[in] String containing the type of IP being set (for logging purposes).
+ * @param value[in] New ip value to parse.
+ * @param out_ip[in] Pointer to numeric value that will be changed.
+ * @param out_ip_str[in,out] Pointer to str value that will be changed (expected to be already initialized, to display previous value, if any).
+ *
+ * @retval false in case of error.
+ */
+bool char_config_set_ip(const char *type, const char *value, uint32 *out_ip, char *out_ip_str)
+{
+ uint32 ip = 0;
+
+ nullpo_retr(false, type);
+ nullpo_retr(false, value);
+ nullpo_retr(false, out_ip);
+ nullpo_retr(false, out_ip_str);
+
+ if ((ip = sockt->host2ip(value)) == 0)
+ return false;
+ *out_ip = ip;
+
+ ShowStatus("%s IP address : %s -> %s\n", type, out_ip_str[0] != '\0' ? out_ip_str : "0.0.0.0", sockt->ip2str(ip, NULL));
+ safestrncpy(out_ip_str, value, sizeof *out_ip_str);
+ return true;
}
int do_final(void) {
@@ -5806,6 +6131,8 @@ int do_final(void) {
for (i = 0; i < MAX_MAP_SERVERS; i++)
VECTOR_CLEAR(chr->server[i].maps);
+ VECTOR_CLEAR(start_items);
+
aFree(chr->CHAR_CONF_NAME);
aFree(chr->NET_CONF_NAME);
aFree(chr->SQL_CONF_NAME);
@@ -5882,11 +6209,25 @@ static CMDLINEARG(netconfig)
chr->NET_CONF_NAME = aStrdup(params);
return true;
}
+
+/**
+ * --run-once handler
+ *
+ * Causes the server to run its loop once, and shutdown. Useful for testing.
+ * @see cmdline->exec
+ */
+static CMDLINEARG(runonce)
+{
+ core->runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* Initializes the command line arguments handlers.
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(char-config, charconfig, "Alternative char-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(inter-config, interconfig, "Alternative inter-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative network configuration.", CMDLINE_OPT_PARAM);
@@ -5898,10 +6239,12 @@ int do_init(int argc, char **argv) {
char_load_defaults();
- chr->CHAR_CONF_NAME = aStrdup("conf/char-server.conf");
+ chr->CHAR_CONF_NAME = aStrdup("conf/char/char-server.conf");
chr->NET_CONF_NAME = aStrdup("conf/network.conf");
- chr->SQL_CONF_NAME = aStrdup("conf/inter-server.conf");
- chr->INTER_CONF_NAME = aStrdup("conf/inter-server.conf");
+ chr->SQL_CONF_NAME = aStrdup("conf/common/inter-server.conf");
+ chr->INTER_CONF_NAME = aStrdup("conf/common/inter-server.conf");
+
+ VECTOR_INIT(start_items);
for (i = 0; i < MAX_MAP_SERVERS; i++)
VECTOR_INIT(chr->server[i].maps);
@@ -5920,16 +6263,41 @@ int do_init(int argc, char **argv) {
start_point.map = mapindex->name2id("new_1-1");
#endif
+ safestrncpy(chr->userid, "s1", sizeof(chr->userid));
+ safestrncpy(chr->passwd, "p1", sizeof(chr->passwd));
+
cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL);
- chr->config_read(chr->CHAR_CONF_NAME);
+ chr->config_read(chr->CHAR_CONF_NAME, false);
sockt->net_config_read(chr->NET_CONF_NAME);
- chr->sql_config_read(chr->SQL_CONF_NAME);
+ chr->sql_config_read(chr->SQL_CONF_NAME, false);
+ {
+ // TODO: Remove this when no longer needed.
+#define CHECK_OLD_LOCAL_CONF(oldname, newname) do { \
+ if (stat((oldname), &fileinfo) == 0 && fileinfo.st_size > 0) { \
+ ShowWarning("An old configuration file \"%s\" was found.\n", (oldname)); \
+ ShowWarning("If it contains settings you wish to keep, please merge them into \"%s\".\n", (newname)); \
+ ShowWarning("Otherwise, just delete it.\n"); \
+ ShowInfo("Resuming in 10 seconds...\n"); \
+ HSleep(10); \
+ } \
+} while (0)
+ struct stat fileinfo;
+
+ CHECK_OLD_LOCAL_CONF("conf/import/char_conf.txt", "conf/import/char-server.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/inter_conf.txt", "conf/import/inter-server.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/packet_conf.txt", "conf/import/socket.conf");
+
+#undef CHECK_OLD_LOCAL_CONF
+ }
+
+#ifndef BUILDBOT
if (strcmp(chr->userid, "s1")==0 && strcmp(chr->passwd, "p1")==0) {
ShowWarning("Using the default user/password s1/p1 is NOT RECOMMENDED.\n");
ShowNotice("Please edit your 'login' table to create a proper inter-server user/password (gender 'S')\n");
- ShowNotice("And then change the user/password to use in conf/char-server.conf (or conf/import/char_conf.txt)\n");
+ ShowNotice("And then change the user/password to use in conf/char/char-server.conf (or conf/import/char-server.conf)\n");
}
+#endif
inter->init_sql(chr->INTER_CONF_NAME); // inter server configuration
@@ -6052,6 +6420,9 @@ void char_defaults(void)
chr->server_type = 0;
chr->new_display = 0;
+ chr->show_save_log = true;
+ chr->enable_logs = true;
+
chr->waiting_disconnect = char_waiting_disconnect;
chr->delete_char_sql = char_delete_char_sql;
chr->create_online_char_data = char_create_online_char_data;
@@ -6068,7 +6439,6 @@ void char_defaults(void)
chr->create_charstatus = char_create_charstatus;
chr->mmo_char_tosql = char_mmo_char_tosql;
chr->memitemdata_to_sql = char_memitemdata_to_sql;
- chr->inventory_to_sql = char_inventory_to_sql;
chr->mmo_gender = char_mmo_gender;
chr->mmo_chars_fromsql = char_mmo_chars_fromsql;
chr->mmo_char_fromsql = char_mmo_char_fromsql;
@@ -6209,6 +6579,20 @@ void char_defaults(void)
chr->online_data_cleanup_sub = char_online_data_cleanup_sub;
chr->online_data_cleanup = char_online_data_cleanup;
chr->sql_config_read = char_sql_config_read;
- chr->config_dispatch = char_config_dispatch;
+ chr->sql_config_read_registry = char_sql_config_read_registry;
+ chr->sql_config_read_pc = char_sql_config_read_pc;
+ chr->sql_config_read_guild = char_sql_config_read_guild;
chr->config_read = char_config_read;
+ chr->config_read_database = char_config_read_database;
+ chr->config_read_console = char_config_read_console;
+ chr->config_read_player_fame = char_config_read_player_fame;
+ chr->config_read_player_deletion = char_config_read_player_deletion;
+ chr->config_read_player_name = char_config_read_player_name;
+ chr->config_set_start_item = char_config_set_start_item;
+ chr->config_read_player_new = char_config_read_player_new;
+ chr->config_read_player = char_config_read_player;
+ chr->config_read_permission = char_config_read_permission;
+ chr->config_set_ip = char_config_set_ip;
+ chr->config_read_inter = char_config_read_inter;
+ chr->config_read_top = char_config_read_top;
}
diff --git a/src/char/char.h b/src/char/char.h
index ff46e4353..499b633f7 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -26,6 +26,10 @@
#include "common/db.h"
#include "common/mmo.h"
+/* Forward Declarations */
+struct config_setting_t; // common/conf.h
+struct config_t; // common/conf.h
+
enum E_CHARSERVER_ST {
CHARSERVER_ST_RUNNING = CORE_ST_LAST,
CHARSERVER_ST_SHUTDOWN,
@@ -68,11 +72,15 @@ struct mmo_map_server {
VECTOR_DECL(uint16) maps;
};
-#define MAX_MAP_SERVERS 2
+/**
+ * deprecated feature, multi map been a dangerous in-complete feature for so long and going to be removed.
+ * USE IT AT YOUR OWN RISK!
+ */
+#define MAX_MAP_SERVERS 1
#define DEFAULT_AUTOSAVE_INTERVAL (300*1000)
-enum {
+enum inventory_table_type {
TABLE_INVENTORY,
TABLE_CART,
TABLE_STORAGE,
@@ -98,38 +106,40 @@ struct char_interface {
struct mmo_map_server server[MAX_MAP_SERVERS];
int login_fd;
int char_fd;
- DBMap* online_char_db; // int account_id -> struct online_char_data*
- DBMap* char_db_;
+ struct DBMap *online_char_db; // int account_id -> struct online_char_data*
+ struct DBMap *char_db_;
char userid[NAME_LENGTH];
char passwd[NAME_LENGTH];
char server_name[20];
uint32 ip;
uint16 port;
int server_type;
- int new_display;
+ int16 new_display; ///< Display 'New' in the server list.
char *CHAR_CONF_NAME;
char *NET_CONF_NAME; ///< Network config filename
char *SQL_CONF_NAME;
char *INTER_CONF_NAME;
+ bool show_save_log; ///< Show loading/saving messages.
+ bool enable_logs; ///< Whether to log char server operations.
+
int (*waiting_disconnect) (int tid, int64 tick, int id, intptr_t data);
int (*delete_char_sql) (int char_id);
- DBData (*create_online_char_data) (DBKey key, va_list args);
+ struct DBData (*create_online_char_data) (union DBKey key, va_list args);
void (*set_account_online) (int account_id);
void (*set_account_offline) (int account_id);
void (*set_char_charselect) (int account_id);
void (*set_char_online) (int map_id, int char_id, int account_id);
void (*set_char_offline) (int char_id, int account_id);
- int (*db_setoffline) (DBKey key, DBData *data, va_list ap);
- int (*db_kickoffline) (DBKey key, DBData *data, va_list ap);
+ int (*db_setoffline) (union DBKey key, struct DBData *data, va_list ap);
+ int (*db_kickoffline) (union DBKey key, struct DBData *data, va_list ap);
void (*set_login_all_offline) (void);
void (*set_all_offline) (int id);
void (*set_all_offline_sql) (void);
- DBData (*create_charstatus) (DBKey key, va_list args);
+ struct DBData (*create_charstatus) (union DBKey key, va_list args);
int (*mmo_char_tosql) (int char_id, struct mmo_charstatus* p);
int (*memitemdata_to_sql) (const struct item items[], int max, int id, int tableswitch);
- int (*inventory_to_sql) (const struct item items[], int max, int id);
int (*mmo_gender) (const struct char_session_data *sd, const struct mmo_charstatus *p, char sex);
int (*mmo_chars_fromsql) (struct char_session_data* sd, uint8* buf);
int (*mmo_char_fromsql) (int char_id, struct mmo_charstatus* p, bool load_everything);
@@ -137,7 +147,7 @@ struct char_interface {
bool (*char_slotchange) (struct char_session_data *sd, int fd, unsigned short from, unsigned short to);
int (*rename_char_sql) (struct char_session_data *sd, int char_id);
int (*check_char_name) (char * name, char * esc_name);
- int (*make_new_char_sql) (struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style);
+ int (*make_new_char_sql) (struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex);
int (*divorce_char_sql) (int partner_id1, int partner_id2);
int (*count_users) (void);
int (*mmo_char_tobuf) (uint8* buffer, struct mmo_charstatus* p);
@@ -189,7 +199,7 @@ struct char_interface {
void (*parse_frommap_save_character) (int fd, int id);
void (*select_ack) (int fd, int account_id, uint8 flag);
void (*parse_frommap_char_select_req) (int fd);
- void (*change_map_server_ack) (int fd, uint8 *data, bool ok);
+ void (*change_map_server_ack) (int fd, const uint8 *data, bool ok);
void (*parse_frommap_change_map_server) (int fd);
void (*parse_frommap_remove_friend) (int fd);
void (*char_name_ack) (int fd, int char_id);
@@ -264,14 +274,29 @@ struct char_interface {
int (*parse_char_unknown_packet) (int fd, uint32 ipl);
int (*parse_char) (int fd);
int (*broadcast_user_count) (int tid, int64 tick, int id, intptr_t data);
- int (*send_accounts_tologin_sub) (DBKey key, DBData *data, va_list ap);
+ int (*send_accounts_tologin_sub) (union DBKey key, struct DBData *data, va_list ap);
int (*send_accounts_tologin) (int tid, int64 tick, int id, intptr_t data);
int (*check_connect_login_server) (int tid, int64 tick, int id, intptr_t data);
- int (*online_data_cleanup_sub) (DBKey key, DBData *data, va_list ap);
+ int (*online_data_cleanup_sub) (union DBKey key, struct DBData *data, va_list ap);
int (*online_data_cleanup) (int tid, int64 tick, int id, intptr_t data);
- void (*sql_config_read) (const char* cfgName);
- void (*config_dispatch) (char *w1, char *w2);
- int (*config_read) (const char* cfgName);
+
+ bool (*sql_config_read) (const char *filename, bool imported);
+ bool (*sql_config_read_registry) (const char *filename, const struct config_t *config, bool imported);
+ bool (*sql_config_read_pc) (const char *filename, const struct config_t *config, bool imported);
+ bool (*sql_config_read_guild) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read) (const char *filename, bool imported);
+ bool (*config_read_database) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_console) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_player_fame) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_player_deletion) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_player_name) (const char *filename, const struct config_t *config, bool imported);
+ void (*config_set_start_item) (const struct config_setting_t *setting);
+ bool (*config_read_player_new) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_player) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_permission) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_set_ip) (const char *type, const char *value, uint32 *out_ip, char *out_ip_str);
+ bool (*config_read_inter) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_top) (const char *filename, const struct config_t *config, bool imported);
};
#ifdef HERCULES_CORE
@@ -279,7 +304,6 @@ extern int char_name_option;
extern char char_name_letters[];
extern bool char_gm_read;
extern int autosave_interval;
-extern int save_log;
extern char db_path[];
extern char char_db[256];
extern char scdata_db[256];
@@ -315,7 +339,6 @@ extern char char_reg_str_db[32];
extern char char_reg_num_db[32];
extern int guild_exp_rate;
-extern int log_inter;
void char_load_defaults(void);
void char_defaults(void);
diff --git a/src/char/geoip.c b/src/char/geoip.c
index 36b908561..0b84d2b09 100644
--- a/src/char/geoip.c
+++ b/src/char/geoip.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -101,7 +101,7 @@ const char* geoip_getcountry(uint32 ipnum)
}
offset = x;
}
- ShowError("geoip_getcountry(): Error traversing database for ipnum %d\n", ipnum);
+ ShowError("geoip_getcountry(): Error traversing database for ipnum %u\n", ipnum);
ShowWarning("geoip_getcountry(): Possible database corruption!\n");
return geoip_countryname[0];
@@ -132,9 +132,8 @@ void geoip_final(bool shutdown)
**/
void geoip_init(void)
{
- int i, fno;
+ int fno;
char db_type = 1;
- unsigned char delim[3];
struct stat bufa;
FILE *db;
@@ -165,6 +164,8 @@ void geoip_init(void)
if (fseek(db, -3l, SEEK_END) != 0) {
db_type = 0;
} else {
+ int i;
+ unsigned char delim[3];
for (i = 0; i < GEOIP_STRUCTURE_INFO_MAX_SIZE; i++) {
if (fread(delim, sizeof(delim[0]), 3, db) != 3) {
db_type = 0;
diff --git a/src/char/geoip.h b/src/char/geoip.h
index 61ebb535f..c5d71f5e1 100644
--- a/src/char/geoip.h
+++ b/src/char/geoip.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/int_auction.c b/src/char/int_auction.c
index b402e7f98..2dd65f213 100644
--- a/src/char/int_auction.c
+++ b/src/char/int_auction.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -47,7 +47,7 @@ static int inter_auction_count(int char_id, bool buy)
{
int i = 0;
struct auction_data *auction;
- DBIterator *iter = db_iterator(inter_auction->db);
+ struct DBIterator *iter = db_iterator(inter_auction->db);
for( auction = dbi_first(iter); dbi_exists(iter); auction = dbi_next(iter) )
{
@@ -63,7 +63,7 @@ void inter_auction_save(struct auction_data *auction)
{
int j;
StringBuf buf;
- SqlStmt* stmt;
+ struct SqlStmt *stmt;
if( !auction )
return;
@@ -71,9 +71,11 @@ void inter_auction_save(struct auction_data *auction)
StrBuf->Init(&buf);
StrBuf->Printf(&buf, "UPDATE `%s` SET `seller_id` = '%d', `seller_name` = ?, `buyer_id` = '%d', `buyer_name` = ?, `price` = '%d', `buynow` = '%d', `hours` = '%d', `timestamp` = '%lu', `nameid` = '%d', `item_name` = ?, `type` = '%d', `refine` = '%d', `attribute` = '%d'",
auction_db, auction->seller_id, auction->buyer_id, auction->price, auction->buynow, auction->hours, (unsigned long)auction->timestamp, auction->item.nameid, auction->type, auction->item.refine, auction->item.attribute);
- for( j = 0; j < MAX_SLOTS; j++ )
+ for (j = 0; j < MAX_SLOTS; j++)
StrBuf->Printf(&buf, ", `card%d` = '%d'", j, auction->item.card[j]);
- StrBuf->Printf(&buf, " WHERE `auction_id` = '%d'", auction->auction_id);
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++)
+ StrBuf->Printf(&buf, ", `opt_idx%d` = '%d', `opt_val%d` = '%d'", j, auction->item.option[j].index, j, auction->item.option[j].value);
+ StrBuf->Printf(&buf, " WHERE `auction_id` = '%u'", auction->auction_id);
stmt = SQL->StmtMalloc(inter->sql_handle);
if( SQL_SUCCESS != SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
@@ -93,35 +95,37 @@ unsigned int inter_auction_create(struct auction_data *auction)
{
int j;
StringBuf buf;
- SqlStmt* stmt;
+ struct SqlStmt *stmt;
- if( !auction )
- return false;
+ nullpo_ret(auction);
auction->timestamp = time(NULL) + (auction->hours * 3600);
StrBuf->Init(&buf);
StrBuf->Printf(&buf, "INSERT INTO `%s` (`seller_id`,`seller_name`,`buyer_id`,`buyer_name`,`price`,`buynow`,`hours`,`timestamp`,`nameid`,`item_name`,`type`,`refine`,`attribute`,`unique_id`", auction_db);
- for( j = 0; j < MAX_SLOTS; j++ )
+ for (j = 0; j < MAX_SLOTS; j++)
StrBuf->Printf(&buf, ",`card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
StrBuf->Printf(&buf, ") VALUES ('%d',?,'%d',?,'%d','%d','%d','%lu','%d',?,'%d','%d','%d','%"PRIu64"'",
auction->seller_id, auction->buyer_id, auction->price, auction->buynow, auction->hours, (unsigned long)auction->timestamp, auction->item.nameid, auction->type, auction->item.refine, auction->item.attribute, auction->item.unique_id);
- for( j = 0; j < MAX_SLOTS; j++ )
+ for (j = 0; j < MAX_SLOTS; j++)
StrBuf->Printf(&buf, ",'%d'", auction->item.card[j]);
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++)
+ StrBuf->Printf(&buf, ",'%d','%d'", auction->item.option[j].index, auction->item.option[j].value);
+
StrBuf->AppendStr(&buf, ")");
stmt = SQL->StmtMalloc(inter->sql_handle);
- if( SQL_SUCCESS != SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
+ if (SQL_SUCCESS != SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, auction->seller_name, strnlen(auction->seller_name, NAME_LENGTH))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, auction->buyer_name, strnlen(auction->buyer_name, NAME_LENGTH))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_STRING, auction->item_name, strnlen(auction->item_name, ITEM_NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtExecute(stmt) )
+ || SQL_SUCCESS != SQL->StmtExecute(stmt))
{
SqlStmt_ShowDebug(stmt);
auction->auction_id = 0;
- }
- else
- {
+ } else {
struct auction_data *auction_;
int64 tick = (int64)auction->hours * 3600000;
@@ -183,7 +187,7 @@ void inter_auction_delete(struct auction_data *auction)
auction_id = auction->auction_id;
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `auction_id` = '%d'", auction_db, auction_id) )
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `auction_id` = '%u'", auction_db, auction_id) )
Sql_ShowDebug(inter->sql_handle);
if( auction->auction_end_timer != INVALID_TIMER )
@@ -204,8 +208,10 @@ void inter_auctions_fromsql(void)
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, "SELECT `auction_id`,`seller_id`,`seller_name`,`buyer_id`,`buyer_name`,"
"`price`,`buynow`,`hours`,`timestamp`,`nameid`,`item_name`,`type`,`refine`,`attribute`,`unique_id`");
- for( i = 0; i < MAX_SLOTS; i++ )
+ for (i = 0; i < MAX_SLOTS; i++)
StrBuf->Printf(&buf, ",`card%d`", i);
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", i, i);
StrBuf->Printf(&buf, " FROM `%s` ORDER BY `auction_id` DESC", auction_db);
if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
@@ -238,14 +244,20 @@ void inter_auctions_fromsql(void)
item->identify = 1;
item->amount = 1;
item->expire_time = 0;
-
- for( i = 0; i < MAX_SLOTS; i++ )
- {
+ /* Card Slots */
+ for (i = 0; i < MAX_SLOTS; i++) {
SQL->GetData(inter->sql_handle, 15 + i, &data, NULL);
item->card[i] = atoi(data);
}
+ /* Item Options */
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++) {
+ SQL->GetData(inter->sql_handle, 15 + MAX_SLOTS + i * 2, &data, NULL);
+ item->option[i].index = atoi(data);
+ SQL->GetData(inter->sql_handle, 16 + MAX_SLOTS + i * 2, &data, NULL);
+ item->option[i].value = atoi(data);
+ }
- if( auction->timestamp > now )
+ if (auction->timestamp > now)
endtick = ((int64)(auction->timestamp - now) * 1000) + tick;
else
endtick = tick + 10000; // 10 seconds to process ended auctions
@@ -280,7 +292,7 @@ void mapif_parse_auction_requestlist(int fd)
int price = RFIFOL(fd,10);
short type = RFIFOW(fd,8), page = max(1,RFIFOW(fd,14));
unsigned char buf[5 * sizeof(struct auction_data)];
- DBIterator *iter = db_iterator(inter_auction->db);
+ struct DBIterator *iter = db_iterator(inter_auction->db);
struct auction_data *auction;
short i = 0, j = 0, pages = 1;
@@ -462,7 +474,7 @@ void mapif_parse_auction_bid(int fd)
}
auction->buyer_id = char_id;
- safestrncpy(auction->buyer_name, (char*)RFIFOP(fd,16), NAME_LENGTH);
+ safestrncpy(auction->buyer_name, RFIFOP(fd,16), NAME_LENGTH);
auction->price = bid;
if( bid >= auction->buynow )
diff --git a/src/char/int_auction.h b/src/char/int_auction.h
index 29b068dfd..9f0ccbd09 100644
--- a/src/char/int_auction.h
+++ b/src/char/int_auction.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,14 +22,16 @@
#define CHAR_INT_AUCTION_H
#include "common/hercules.h"
-#include "common/db.h"
#include "common/mmo.h"
+/* Forward Declarations */
+struct DBMap; // common/db.h
+
/**
* inter_auction_interface interface
**/
struct inter_auction_interface {
- DBMap* db; // int auction_id -> struct auction_data*
+ struct DBMap *db; // int auction_id -> struct auction_data*
int (*count) (int char_id, bool buy);
void (*save) (struct auction_data *auction);
unsigned int (*create) (struct auction_data *auction);
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index b781654db..aed25febd 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -40,32 +40,54 @@
struct inter_elemental_interface inter_elemental_s;
struct inter_elemental_interface *inter_elemental;
-bool mapif_elemental_save(struct s_elemental* ele) {
- bool flag = true;
-
+/**
+ * Creates a new elemental with the given data.
+ *
+ * @remark
+ * The elemental ID is expected to be 0, and will be filled with the newly
+ * assigned ID.
+ *
+ * @param[in,out] ele The new elemental's data.
+ * @retval false in case of errors.
+ */
+bool mapif_elemental_create(struct s_elemental *ele)
+{
nullpo_retr(false, ele);
- if( ele->elemental_id == 0 ) { // Create new DB entry
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
+ Assert_retr(false, ele->elemental_id == 0);
+
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
"INSERT INTO `%s` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`atk1`,`atk2`,`matk`,`aspd`,`def`,`mdef`,`flee`,`hit`,`life_time`)"
- "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%u')",
- elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2, ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time) )
- {
- Sql_ShowDebug(inter->sql_handle);
- flag = false;
- }
- else
- ele->elemental_id = (int)SQL->LastInsertId(inter->sql_handle);
- } else if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%d', `sp` = '%d',"
- "`max_hp` = '%d', `max_sp` = '%d', `atk1` = '%d', `atk2` = '%d', `matk` = '%d', `aspd` = '%d', `def` = '%d',"
- "`mdef` = '%d', `flee` = '%d', `hit` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'",
- elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2,
- ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time, ele->elemental_id) )
- { // Update DB entry
+ "VALUES ('%d','%d','%u','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
+ elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk,
+ ele->atk2, ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time)) {
Sql_ShowDebug(inter->sql_handle);
- flag = false;
+ return false;
}
- return flag;
+ ele->elemental_id = (int)SQL->LastInsertId(inter->sql_handle);
+ return true;
+}
+
+/**
+ * Saves an existing elemental.
+ *
+ * @param ele The elemental's data.
+ * @retval false in case of errors.
+ */
+bool mapif_elemental_save(const struct s_elemental *ele)
+{
+ nullpo_retr(false, ele);
+ Assert_retr(false, ele->elemental_id > 0);
+
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `mode` = '%u', `hp` = '%d', `sp` = '%d',"
+ "`max_hp` = '%d', `max_sp` = '%d', `atk1` = '%d', `atk2` = '%d', `matk` = '%d', `aspd` = '%d', `def` = '%d',"
+ "`mdef` = '%d', `flee` = '%d', `hit` = '%d', `life_time` = '%d' WHERE `ele_id` = '%d'",
+ elemental_db, ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->atk, ele->atk2,
+ ele->matk, ele->amotion, ele->def, ele->mdef, ele->flee, ele->hit, ele->life_time, ele->elemental_id)) {
+ Sql_ShowDebug(inter->sql_handle);
+ return false;
+ }
+ return true;
}
bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
@@ -106,7 +128,7 @@ bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
SQL->GetData(inter->sql_handle, 13, &data, NULL); ele->hit = atoi(data);
SQL->GetData(inter->sql_handle, 14, &data, NULL); ele->life_time = atoi(data);
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Elemental loaded (%d - %d).\n", ele->elemental_id, ele->char_id);
return true;
@@ -133,9 +155,15 @@ void mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag) {
WFIFOSET(fd,size);
}
-void mapif_parse_elemental_create(int fd, struct s_elemental* ele) {
- bool result = mapif->elemental_save(ele);
- mapif->elemental_send(fd, ele, result);
+void mapif_parse_elemental_create(int fd, const struct s_elemental *ele)
+{
+ struct s_elemental ele_;
+ bool result;
+
+ memcpy(&ele_, ele, sizeof(ele_));
+
+ result = mapif->elemental_create(&ele_);
+ mapif->elemental_send(fd, &ele_, result);
}
void mapif_parse_elemental_load(int fd, int ele_id, int char_id) {
@@ -163,7 +191,8 @@ void mapif_elemental_saved(int fd, unsigned char flag) {
WFIFOSET(fd,3);
}
-void mapif_parse_elemental_save(int fd, struct s_elemental* ele) {
+void mapif_parse_elemental_save(int fd, const struct s_elemental *ele)
+{
bool result = mapif->elemental_save(ele);
mapif->elemental_saved(fd, result);
}
@@ -182,11 +211,11 @@ void inter_elemental_sql_final(void) {
int inter_elemental_parse_frommap(int fd) {
unsigned short cmd = RFIFOW(fd,0);
- switch( cmd ) {
- case 0x307c: mapif->parse_elemental_create(fd, (struct s_elemental*)RFIFOP(fd,4)); break;
- case 0x307d: mapif->parse_elemental_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
- case 0x307e: mapif->parse_elemental_delete(fd, (int)RFIFOL(fd,2)); break;
- case 0x307f: mapif->parse_elemental_save(fd, (struct s_elemental*)RFIFOP(fd,4)); break;
+ switch (cmd) {
+ case 0x307c: mapif->parse_elemental_create(fd, RFIFOP(fd,4)); break;
+ case 0x307d: mapif->parse_elemental_load(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
+ case 0x307e: mapif->parse_elemental_delete(fd, RFIFOL(fd,2)); break;
+ case 0x307f: mapif->parse_elemental_save(fd, RFIFOP(fd,4)); break;
default:
return 0;
}
diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h
index 9cdd63e7f..8a046b0f8 100644
--- a/src/char/int_elemental.h
+++ b/src/char/int_elemental.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 60efeac94..b4b4bdde4 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -33,6 +33,7 @@
#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/socket.h"
+#include "common/sql.h"
#include "common/strlib.h"
#include "common/timer.h"
@@ -58,8 +59,8 @@ static const char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9
int inter_guild_save_timer(int tid, int64 tick, int id, intptr_t data) {
static int last_id = 0; //To know in which guild we were.
int state = 0; //0: Have not reached last guild. 1: Reached last guild, ready for save. 2: Some guild saved, don't do further saving.
- DBIterator *iter = db_iterator(inter_guild->guild_db);
- DBKey key;
+ struct DBIterator *iter = db_iterator(inter_guild->guild_db);
+ union DBKey key;
struct guild* g;
if( last_id == 0 ) //Save the first guild in the list.
@@ -82,9 +83,9 @@ int inter_guild_save_timer(int tid, int64 tick, int id, intptr_t data) {
state++;
}
- if( g->save_flag == GS_REMOVE )
- {// Nothing to save, guild is ready for removal.
- if (save_log)
+ if (g->save_flag == GS_REMOVE) {
+ // Nothing to save, guild is ready for removal.
+ if (chr->show_save_log)
ShowInfo("Guild Unloaded (%d - %s)\n", g->guild_id, g->name);
db_remove(inter_guild->guild_db, key);
}
@@ -145,22 +146,17 @@ int inter_guild_tosql(struct guild *g,int flag)
*t_info = '\0';
// Insert a new guild the guild
- if (flag&GS_BASIC && g->guild_id == -1)
- {
+ if (flag&GS_BASIC && g->guild_id == -1) {
strcat(t_info, " guild_create");
// Create a new guild
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
- "(`name`,`master`,`guild_lv`,`max_member`,`average_lv`,`char_id`) "
- "VALUES ('%s', '%s', '%d', '%d', '%d', '%d')",
- guild_db, esc_name, esc_master, g->guild_lv, g->max_member, g->average_lv, g->member[0].char_id) )
- {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
+ "(`name`,`master`,`guild_lv`,`max_member`,`average_lv`,`char_id`) "
+ "VALUES ('%s', '%s', '%d', '%d', '%d', '%d')",
+ guild_db, esc_name, esc_master, g->guild_lv, g->max_member, g->average_lv, g->member[0].char_id)) {
Sql_ShowDebug(inter->sql_handle);
- if (g->guild_id == -1)
- return 0; //Failed to create guild!
- }
- else
- {
+ return 0; //Failed to create guild!
+ } else {
g->guild_id = (int)SQL->LastInsertId(inter->sql_handle);
new_guild = 1;
}
@@ -255,7 +251,7 @@ int inter_guild_tosql(struct guild *g,int flag)
"VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%"PRIu64"','%d','%d','%d','%s')",
guild_member_db, g->guild_id, m->account_id, m->char_id,
m->hair, m->hair_color, m->gender,
- m->class_, m->lv, m->exp, m->exp_payper, m->online, m->position, esc_name) )
+ m->class, m->lv, m->exp, m->exp_payper, m->online, m->position, esc_name) )
Sql_ShowDebug(inter->sql_handle);
if (m->modified&GS_MEMBER_NEW || new_guild == 1)
{
@@ -341,8 +337,8 @@ int inter_guild_tosql(struct guild *g,int flag)
}
}
- if (save_log)
- ShowInfo("Saved guild (%d - %s):%s\n",g->guild_id,g->name,t_info);
+ if (chr->show_save_log)
+ ShowInfo("Saved guild (%d - %s):%s\n", g->guild_id, g->name, t_info);
return 1;
}
@@ -437,7 +433,7 @@ struct guild * inter_guild_fromsql(int guild_id)
SQL->GetData(inter->sql_handle, 2, &data, NULL); m->hair = atoi(data);
SQL->GetData(inter->sql_handle, 3, &data, NULL); m->hair_color = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); m->gender = atoi(data);
- SQL->GetData(inter->sql_handle, 5, &data, NULL); m->class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 5, &data, NULL); m->class = atoi(data);
SQL->GetData(inter->sql_handle, 6, &data, NULL); m->lv = atoi(data);
SQL->GetData(inter->sql_handle, 7, &data, NULL); m->exp = strtoull(data, NULL, 10);
SQL->GetData(inter->sql_handle, 8, &data, NULL); m->exp_payper = (unsigned int)atoi(data);
@@ -529,7 +525,7 @@ struct guild * inter_guild_fromsql(int guild_id)
idb_put(inter_guild->guild_db, guild_id, g); //Add to cache
g->save_flag |= GS_REMOVE; //But set it to be removed, in case it is not needed for long.
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Guild loaded (%d - %s)\n", guild_id, g->name);
return g;
@@ -552,7 +548,7 @@ int inter_guild_castle_tosql(struct guild_castle *gc)
if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
Sql_ShowDebug(inter->sql_handle);
- else if(save_log)
+ else if (chr->show_save_log)
ShowInfo("Saved guild castle (%d)\n", gc->castle_id);
StrBuf->Destroy(&buf);
@@ -604,7 +600,7 @@ struct guild_castle* inter_guild_castle_fromsql(int castle_id)
idb_put(inter_guild->castle_db, castle_id, gc);
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Loaded guild castle (%d - guild %d)\n", castle_id, gc->guild_id);
return gc;
@@ -748,7 +744,7 @@ int inter_guild_sql_init(void)
/**
* @see DBApply
*/
-int inter_guild_db_final(DBKey key, DBData *data, va_list ap)
+int inter_guild_db_final(union DBKey key, struct DBData *data, va_list ap)
{
struct guild *g = DB->data2ptr(data);
nullpo_ret(g);
@@ -767,7 +763,7 @@ void inter_guild_sql_final(void)
}
// Get guild_id by its name. Returns 0 if not found, -1 on error.
-int inter_guild_search_guildname(char *str)
+int inter_guild_search_guildname(const char *str)
{
int guild_id;
char esc_name[NAME_LENGTH*2+1];
@@ -988,7 +984,7 @@ int mapif_guild_memberinfoshort(struct guild *g, int idx)
WBUFL(buf,10)=g->member[idx].char_id;
WBUFB(buf,14)=(unsigned char)g->member[idx].online;
WBUFW(buf,15)=g->member[idx].lv;
- WBUFW(buf,17)=g->member[idx].class_;
+ WBUFW(buf,17)=g->member[idx].class;
mapif->sendall(buf,19);
return 0;
}
@@ -1006,7 +1002,7 @@ int mapif_guild_broken(int guild_id, int flag)
}
// Send guild message
-int mapif_guild_message(int guild_id, int account_id, char *mes, int len, int sfd)
+int mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd)
{
unsigned char buf[512];
nullpo_ret(mes);
@@ -1139,7 +1135,7 @@ int mapif_guild_master_changed(struct guild *g, int aid, int cid)
return 0;
}
-int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids)
+int mapif_guild_castle_dataload(int fd, int sz, const int *castle_ids)
{
struct guild_castle *gc = NULL;
int num = (sz - 4) / sizeof(int);
@@ -1163,7 +1159,7 @@ int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids)
// Guild creation request
-int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member *master)
+int mapif_parse_CreateGuild(int fd, int account_id, const char *name, const struct guild_member *master)
{
struct guild *g;
int i=0;
@@ -1237,9 +1233,9 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member
mapif->guild_created(fd,account_id,g);
mapif->guild_info(fd,g);
- if(log_inter)
+ if (inter->enable_logs)
inter->log("guild %s (id=%d) created by master %s (id=%d)\n",
- name, g->guild_id, master->name, master->account_id );
+ name, g->guild_id, master->name, master->account_id);
return 0;
}
@@ -1259,7 +1255,7 @@ int mapif_parse_GuildInfo(int fd, int guild_id)
}
// Add member to guild
-int mapif_parse_GuildAddMember(int fd, int guild_id, struct guild_member *m)
+int mapif_parse_GuildAddMember(int fd, int guild_id, const struct guild_member *m)
{
struct guild * g;
int i;
@@ -1353,7 +1349,7 @@ int mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char_id, in
}
// Change member info
-int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int class_)
+int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class)
{
// Could speed up by manipulating only guild_member
struct guild * g;
@@ -1369,7 +1365,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id,
{
g->member[i].online = online;
g->member[i].lv = lv;
- g->member[i].class_ = class_;
+ g->member[i].class = class;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfoshort(g,i);
}
@@ -1446,8 +1442,8 @@ int mapif_parse_BreakGuild(int fd, int guild_id)
mapif->guild_broken(guild_id,0);
- if(log_inter)
- inter->log("guild %s (id=%d) broken\n",g->name,guild_id);
+ if (inter->enable_logs)
+ inter->log("guild %s (id=%d) broken\n", g->name, guild_id);
//Remove the guild from memory. [Skotlex]
idb_remove(inter_guild->guild_db, guild_id);
@@ -1455,7 +1451,7 @@ int mapif_parse_BreakGuild(int fd, int guild_id)
}
// Forward Guild message to others map servers
-int mapif_parse_GuildMessage(int fd, int guild_id, int account_id, char *mes, int len)
+int mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len)
{
return mapif->guild_message(guild_id,account_id,mes,len, fd);
}
@@ -1547,17 +1543,17 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
switch(type)
{
case GMI_POSITION:
- {
- g->member[i].position=*((short *)data);
+ {
+ g->member[i].position = *(const short *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
g->save_flag |= GS_MEMBER;
break;
- }
+ }
case GMI_EXP:
{
uint64 old_exp = g->member[i].exp;
- g->member[i].exp=*((uint64 *)data);
+ g->member[i].exp = *(const uint64 *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
if (g->member[i].exp > old_exp) {
uint64 exp = g->member[i].exp - old_exp;
@@ -1582,7 +1578,7 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
}
case GMI_HAIR:
{
- g->member[i].hair=*((short *)data);
+ g->member[i].hair = *(const short *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
g->save_flag |= GS_MEMBER; //Save new data.
@@ -1590,7 +1586,7 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
}
case GMI_HAIR_COLOR:
{
- g->member[i].hair_color=*((short *)data);
+ g->member[i].hair_color = *(const short *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
g->save_flag |= GS_MEMBER; //Save new data.
@@ -1598,7 +1594,7 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
}
case GMI_GENDER:
{
- g->member[i].gender=*((short *)data);
+ g->member[i].gender = *(const short *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
g->save_flag |= GS_MEMBER; //Save new data.
@@ -1606,7 +1602,7 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
}
case GMI_CLASS:
{
- g->member[i].class_=*((short *)data);
+ g->member[i].class = *(const int16 *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
g->save_flag |= GS_MEMBER; //Save new data.
@@ -1614,7 +1610,7 @@ int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int
}
case GMI_LEVEL:
{
- g->member[i].lv=*((short *)data);
+ g->member[i].lv = *(const short *)data;
g->member[i].modified = GS_MEMBER_MODIFIED;
mapif->guild_memberinfochanged(guild_id,account_id,char_id,type,data,len);
g->save_flag |= GS_MEMBER; //Save new data.
@@ -1670,7 +1666,7 @@ int inter_guild_charname_changed(int guild_id, int account_id, int char_id, char
}
// Change a position desc
-int mapif_parse_GuildPosition(int fd, int guild_id, int idx, struct guild_position *p)
+int mapif_parse_GuildPosition(int fd, int guild_id, int idx, const struct guild_position *p)
{
// Could make some improvement in speed, because only change guild_position
struct guild * g;
@@ -1809,7 +1805,7 @@ int mapif_parse_GuildEmblem(int fd, int len, int guild_id, int dummy, const char
return mapif->guild_emblem(g);
}
-int mapif_parse_GuildCastleDataLoad(int fd, int len, int *castle_ids)
+int mapif_parse_GuildCastleDataLoad(int fd, int len, const int *castle_ids)
{
return mapif->guild_castle_dataload(fd, len, castle_ids);
}
@@ -1825,7 +1821,7 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value)
switch (index) {
case 1:
- if (log_inter && gc->guild_id != value) {
+ if (inter->enable_logs && gc->guild_id != value) {
int gid = (value) ? value : gc->guild_id;
struct guild *g = idb_get(inter_guild->guild_db, gid);
inter->log("guild %s (id=%d) %s castle id=%d\n",
@@ -1902,22 +1898,22 @@ int inter_guild_parse_frommap(int fd)
{
RFIFOHEAD(fd);
switch(RFIFOW(fd,0)) {
- case 0x3030: mapif->parse_CreateGuild(fd,RFIFOL(fd,4),(char*)RFIFOP(fd,8),(struct guild_member *)RFIFOP(fd,32)); break;
+ case 0x3030: mapif->parse_CreateGuild(fd, RFIFOL(fd,4), RFIFOP(fd,8), RFIFOP(fd,32)); break;
case 0x3031: mapif->parse_GuildInfo(fd,RFIFOL(fd,2)); break;
- case 0x3032: mapif->parse_GuildAddMember(fd,RFIFOL(fd,4),(struct guild_member *)RFIFOP(fd,8)); break;
- case 0x3033: mapif->parse_GuildMasterChange(fd,RFIFOL(fd,4),(const char*)RFIFOP(fd,8),RFIFOW(fd,2)-8); break;
- case 0x3034: mapif->parse_GuildLeave(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(const char*)RFIFOP(fd,15)); break;
+ case 0x3032: mapif->parse_GuildAddMember(fd, RFIFOL(fd,4), RFIFOP(fd,8)); break;
+ case 0x3033: mapif->parse_GuildMasterChange(fd, RFIFOL(fd,4), RFIFOP(fd,8), RFIFOW(fd,2)-8); break;
+ case 0x3034: mapif->parse_GuildLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOP(fd,15)); break;
case 0x3035: mapif->parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17)); break;
case 0x3036: mapif->parse_BreakGuild(fd,RFIFOL(fd,2)); break;
- case 0x3037: mapif->parse_GuildMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),(char*)RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
- case 0x3039: mapif->parse_GuildBasicInfoChange(fd,RFIFOL(fd,4),RFIFOW(fd,8),(const int16 *)RFIFOP(fd,10),RFIFOW(fd,2)-10); break;
- case 0x303A: mapif->parse_GuildMemberInfoChange(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOL(fd,12),RFIFOW(fd,16),(const char*)RFIFOP(fd,18),RFIFOW(fd,2)-18); break;
- case 0x303B: mapif->parse_GuildPosition(fd,RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12)); break;
+ case 0x3037: mapif->parse_GuildMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
+ case 0x3039: mapif->parse_GuildBasicInfoChange(fd, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOP(fd,10), RFIFOW(fd,2)-10); break;
+ case 0x303A: mapif->parse_GuildMemberInfoChange(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOL(fd,12), RFIFOW(fd,16), RFIFOP(fd,18), RFIFOW(fd,2)-18); break;
+ case 0x303B: mapif->parse_GuildPosition(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); break;
case 0x303C: mapif->parse_GuildSkillUp(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14)); break;
case 0x303D: mapif->parse_GuildAlliance(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18)); break;
- case 0x303E: mapif->parse_GuildNotice(fd,RFIFOL(fd,2),(const char*)RFIFOP(fd,6),(const char*)RFIFOP(fd,66)); break;
- case 0x303F: mapif->parse_GuildEmblem(fd,RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),(const char*)RFIFOP(fd,12)); break;
- case 0x3040: mapif->parse_GuildCastleDataLoad(fd,RFIFOW(fd,2),(int *)RFIFOP(fd,4)); break;
+ case 0x303E: mapif->parse_GuildNotice(fd, RFIFOL(fd,2), RFIFOP(fd,6), RFIFOP(fd,66)); break;
+ case 0x303F: mapif->parse_GuildEmblem(fd, RFIFOW(fd,2)-12, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); break;
+ case 0x3040: mapif->parse_GuildCastleDataLoad(fd, RFIFOW(fd,2), RFIFOP(fd,4)); break;
case 0x3041: mapif->parse_GuildCastleDataSave(fd,RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5)); break;
default:
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 1076b3394..93bf6c699 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -44,8 +44,8 @@ enum {
* inter_guild interface
**/
struct inter_guild_interface {
- DBMap* guild_db; // int guild_id -> struct guild*
- DBMap* castle_db;
+ struct DBMap *guild_db; // int guild_id -> struct guild*
+ struct DBMap *castle_db;
unsigned int exp[MAX_GUILDLEVEL];
int (*save_timer) (int tid, int64 tick, int id, intptr_t data);
@@ -58,9 +58,9 @@ struct inter_guild_interface {
int (*CharOnline) (int char_id, int guild_id);
int (*CharOffline) (int char_id, int guild_id);
int (*sql_init) (void);
- int (*db_final) (DBKey key, DBData *data, va_list ap);
+ int (*db_final) (union DBKey key, struct DBData *data, va_list ap);
void (*sql_final) (void);
- int (*search_guildname) (char *str);
+ int (*search_guildname) (const char *str);
bool (*check_empty) (struct guild *g);
unsigned int (*nextexp) (int level);
int (*checkskill) (struct guild *g, int id);
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index f60394ee7..04f4c8f21 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -49,7 +49,7 @@ void inter_homunculus_sql_final(void)
return;
}
-void mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh, unsigned char flag)
+void mapif_homunculus_created(int fd, int account_id, const struct s_homunculus *sh, unsigned char flag)
{
nullpo_retv(sh);
WFIFOHEAD(fd, sizeof(struct s_homunculus)+9);
@@ -97,7 +97,7 @@ void mapif_homunculus_saved(int fd, int account_id, bool flag)
WFIFOSET(fd, 7);
}
-void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, char* name)
+void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, const char *name)
{
nullpo_retv(name);
WFIFOHEAD(fd, NAME_LENGTH+12);
@@ -105,68 +105,83 @@ void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char
WFIFOL(fd, 2) = account_id;
WFIFOL(fd, 6) = char_id;
WFIFOB(fd,10) = flag;
- safestrncpy((char*)WFIFOP(fd,11), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,11), name, NAME_LENGTH);
WFIFOSET(fd, NAME_LENGTH+12);
}
-bool mapif_homunculus_save(struct s_homunculus* hd)
+/**
+ * Creates a new homunculus with the given data.
+ *
+ * @remark
+ * The homunculus ID is expected to be 0, and will be filled with the newly
+ * assigned ID.
+ *
+ * @param[in,out] hd The new homunculus' data.
+ * @retval false in case of errors.
+ */
+bool mapif_homunculus_create(struct s_homunculus *hd)
{
- bool flag = true;
char esc_name[NAME_LENGTH*2+1];
- nullpo_ret(hd);
+ nullpo_retr(false, hd);
+ Assert_retr(false, hd->hom_id == 0);
+
SQL->EscapeStringLen(inter->sql_handle, esc_name, hd->name, strnlen(hd->name, NAME_LENGTH));
- if( hd->hom_id == 0 )
- {// new homunculus
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
"(`char_id`, `class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`, `rename_flag`, `vaporize`) "
"VALUES ('%d', '%d', '%d', '%s', '%d', '%u', '%u', '%d', '%d', %d, '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
homunculus_db, hd->char_id, hd->class_, hd->prev_class, esc_name, hd->level, hd->exp, hd->intimacy, hd->hunger, hd->str, hd->agi, hd->vit, hd->int_, hd->dex, hd->luk,
- hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize) )
- {
- Sql_ShowDebug(inter->sql_handle);
- flag = false;
- }
- else
- {
- hd->hom_id = (int)SQL->LastInsertId(inter->sql_handle);
- }
+ hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize)) {
+ Sql_ShowDebug(inter->sql_handle);
+ return false;
}
- else
- {
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `char_id`='%d', `class`='%d',`prev_class`='%d',`name`='%s',`level`='%d',`exp`='%u',`intimacy`='%u',`hunger`='%d', `str`='%d', `agi`='%d', `vit`='%d', `int`='%d', `dex`='%d', `luk`='%d', `hp`='%d',`max_hp`='%d',`sp`='%d',`max_sp`='%d',`skill_point`='%d', `rename_flag`='%d', `vaporize`='%d' WHERE `homun_id`='%d'",
+ hd->hom_id = (int)SQL->LastInsertId(inter->sql_handle);
+ return true;
+}
+
+/**
+ * Saves an existing homunculus.
+ *
+ * @param hd The homunculus' data.
+ * @retval false in case of errors.
+ */
+bool mapif_homunculus_save(const struct s_homunculus *hd)
+{
+ bool flag = true;
+ char esc_name[NAME_LENGTH*2+1];
+
+ nullpo_retr(false, hd);
+ Assert_retr(false, hd->hom_id > 0);
+
+ SQL->EscapeStringLen(inter->sql_handle, esc_name, hd->name, strnlen(hd->name, NAME_LENGTH));
+
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `char_id`='%d', `class`='%d',`prev_class`='%d',`name`='%s',`level`='%d',`exp`='%u',`intimacy`='%u',`hunger`='%d', `str`='%d', `agi`='%d', `vit`='%d', `int`='%d', `dex`='%d', `luk`='%d', `hp`='%d',`max_hp`='%d',`sp`='%d',`max_sp`='%d',`skill_point`='%d', `rename_flag`='%d', `vaporize`='%d' WHERE `homun_id`='%d'",
homunculus_db, hd->char_id, hd->class_, hd->prev_class, esc_name, hd->level, hd->exp, hd->intimacy, hd->hunger, hd->str, hd->agi, hd->vit, hd->int_, hd->dex, hd->luk,
- hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->hom_id) )
- {
- Sql_ShowDebug(inter->sql_handle);
+ hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->hom_id)) {
+ Sql_ShowDebug(inter->sql_handle);
+ flag = false;
+ } else {
+ int i;
+ struct SqlStmt *stmt = SQL->StmtMalloc(inter->sql_handle);
+
+ if (SQL_ERROR == SQL->StmtPrepare(stmt, "REPLACE INTO `%s` (`homun_id`, `id`, `lv`) VALUES (%d, ?, ?)", skill_homunculus_db, hd->hom_id)) {
+ SqlStmt_ShowDebug(stmt);
flag = false;
- }
- else
- {
- SqlStmt* stmt;
- int i;
-
- stmt = SQL->StmtMalloc(inter->sql_handle);
- if( SQL_ERROR == SQL->StmtPrepare(stmt, "REPLACE INTO `%s` (`homun_id`, `id`, `lv`) VALUES (%d, ?, ?)", skill_homunculus_db, hd->hom_id) )
- SqlStmt_ShowDebug(stmt);
- for( i = 0; i < MAX_HOMUNSKILL; ++i )
- {
- if( hd->hskill[i].id > 0 && hd->hskill[i].lv != 0 )
- {
+ } else {
+ for (i = 0; i < MAX_HOMUNSKILL; ++i) {
+ if (hd->hskill[i].id > 0 && hd->hskill[i].lv != 0) {
SQL->StmtBindParam(stmt, 0, SQLDT_USHORT, &hd->hskill[i].id, 0);
SQL->StmtBindParam(stmt, 1, SQLDT_USHORT, &hd->hskill[i].lv, 0);
- if( SQL_ERROR == SQL->StmtExecute(stmt) )
- {
+ if (SQL_ERROR == SQL->StmtExecute(stmt)) {
SqlStmt_ShowDebug(stmt);
- SQL->StmtFree(stmt);
flag = false;
break;
}
}
}
- SQL->StmtFree(stmt);
}
+ SQL->StmtFree(stmt);
}
return flag;
@@ -181,7 +196,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
nullpo_ret(hd);
memset(hd, 0, sizeof(*hd));
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `homun_id`,`char_id`,`class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`,`rename_flag`, `vaporize` FROM `%s` WHERE `homun_id`='%u'", homunculus_db, homun_id) )
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `homun_id`,`char_id`,`class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`,`rename_flag`, `vaporize` FROM `%s` WHERE `homun_id`='%d'", homunculus_db, homun_id) )
{
Sql_ShowDebug(inter->sql_handle);
return false;
@@ -247,7 +262,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
}
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Homunculus loaded (%d - %s).\n", hd->hom_id, hd->name);
return true;
@@ -255,8 +270,8 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
bool mapif_homunculus_delete(int homun_id)
{
- if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `homun_id` = '%u'", homunculus_db, homun_id)
- || SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `homun_id` = '%u'", skill_homunculus_db, homun_id)
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `homun_id` = '%d'", homunculus_db, homun_id)
+ || SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `homun_id` = '%d'", skill_homunculus_db, homun_id)
) {
Sql_ShowDebug(inter->sql_handle);
return false;
@@ -264,7 +279,7 @@ bool mapif_homunculus_delete(int homun_id)
return true;
}
-bool mapif_homunculus_rename(char *name)
+bool mapif_homunculus_rename(const char *name)
{
int i;
@@ -287,10 +302,15 @@ bool mapif_homunculus_rename(char *name)
}
-void mapif_parse_homunculus_create(int fd, int len, int account_id, struct s_homunculus* phd)
+void mapif_parse_homunculus_create(int fd, int len, int account_id, const struct s_homunculus *phd)
{
- bool result = mapif->homunculus_save(phd);
- mapif->homunculus_created(fd, account_id, phd, result);
+ struct s_homunculus shd;
+ bool result;
+
+ memcpy(&shd, phd, sizeof(shd));
+
+ result = mapif->homunculus_create(&shd);
+ mapif->homunculus_created(fd, account_id, &shd, result);
}
void mapif_parse_homunculus_delete(int fd, int homun_id)
@@ -306,13 +326,13 @@ void mapif_parse_homunculus_load(int fd, int account_id, int homun_id)
mapif->homunculus_loaded(fd, account_id, ( result ? &hd : NULL ));
}
-void mapif_parse_homunculus_save(int fd, int len, int account_id, struct s_homunculus* phd)
+void mapif_parse_homunculus_save(int fd, int len, int account_id, const struct s_homunculus *phd)
{
bool result = mapif->homunculus_save(phd);
mapif->homunculus_saved(fd, account_id, result);
}
-void mapif_parse_homunculus_rename(int fd, int account_id, int char_id, char* name)
+void mapif_parse_homunculus_rename(int fd, int account_id, int char_id, const char *name)
{
bool result = mapif->homunculus_rename(name);
mapif->homunculus_renamed(fd, account_id, char_id, result, name);
@@ -325,13 +345,12 @@ int inter_homunculus_parse_frommap(int fd)
{
unsigned short cmd = RFIFOW(fd,0);
- switch( cmd )
- {
- case 0x3090: mapif->parse_homunculus_create(fd, (int)RFIFOW(fd,2), (int)RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,8)); break;
- case 0x3091: mapif->parse_homunculus_load (fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
- case 0x3092: mapif->parse_homunculus_save (fd, (int)RFIFOW(fd,2), (int)RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,8)); break;
- case 0x3093: mapif->parse_homunculus_delete(fd, (int)RFIFOL(fd,2)); break;
- case 0x3094: mapif->parse_homunculus_rename(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6), (char*)RFIFOP(fd,10)); break;
+ switch (cmd) {
+ case 0x3090: mapif->parse_homunculus_create(fd, RFIFOW(fd,2), RFIFOL(fd,4), RFIFOP(fd,8)); break;
+ case 0x3091: mapif->parse_homunculus_load (fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
+ case 0x3092: mapif->parse_homunculus_save (fd, RFIFOW(fd,2), RFIFOL(fd,4), RFIFOP(fd,8)); break;
+ case 0x3093: mapif->parse_homunculus_delete(fd, RFIFOL(fd,2)); break;
+ case 0x3094: mapif->parse_homunculus_rename(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10)); break;
default:
return 0;
}
diff --git a/src/char/int_homun.h b/src/char/int_homun.h
index e070cccb6..7ea7331f2 100644
--- a/src/char/int_homun.h
+++ b/src/char/int_homun.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/int_mail.c b/src/char/int_mail.c
index c15dc5180..1d00b0fdf 100644
--- a/src/char/int_mail.c
+++ b/src/char/int_mail.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -57,6 +57,8 @@ static int inter_mail_fromsql(int char_id, struct mail_data* md)
"`zeny`,`amount`,`nameid`,`refine`,`attribute`,`identify`,`unique_id`");
for (i = 0; i < MAX_SLOTS; i++)
StrBuf->Printf(&buf, ",`card%d`", i);
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", i, i);
// I keep the `status` < 3 just in case someone forget to apply the sqlfix
StrBuf->Printf(&buf, " FROM `%s` WHERE `dest_id`='%d' AND `status` < 3 ORDER BY `id` LIMIT %d",
@@ -90,12 +92,18 @@ static int inter_mail_fromsql(int char_id, struct mail_data* md)
SQL->GetData(inter->sql_handle,15, &data, NULL); item->unique_id = strtoull(data, NULL, 10);
item->expire_time = 0;
item->bound = 0;
-
- for (j = 0; j < MAX_SLOTS; j++)
- {
+ /* Card Slots */
+ for (j = 0; j < MAX_SLOTS; j++) {
SQL->GetData(inter->sql_handle, 16 + j, &data, NULL);
item->card[j] = atoi(data);
}
+ /* Item Options */
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++) {
+ SQL->GetData(inter->sql_handle, 16 + MAX_SLOTS + j * 2, &data, NULL);
+ item->option[j].index = atoi(data);
+ SQL->GetData(inter->sql_handle, 17 + MAX_SLOTS + j * 2, &data, NULL);
+ item->option[j].value = atoi(data);
+ }
}
md->full = ( SQL->NumRows(inter->sql_handle) > MAIL_MAX_INBOX );
@@ -129,7 +137,7 @@ static int inter_mail_fromsql(int char_id, struct mail_data* md)
int inter_mail_savemessage(struct mail_message* msg)
{
StringBuf buf;
- SqlStmt* stmt;
+ struct SqlStmt *stmt;
int j;
nullpo_ret(msg);
@@ -138,25 +146,30 @@ int inter_mail_savemessage(struct mail_message* msg)
StrBuf->Printf(&buf, "INSERT INTO `%s` (`send_name`, `send_id`, `dest_name`, `dest_id`, `title`, `message`, `time`, `status`, `zeny`, `amount`, `nameid`, `refine`, `attribute`, `identify`, `unique_id`", mail_db);
for (j = 0; j < MAX_SLOTS; j++)
StrBuf->Printf(&buf, ", `card%d`", j);
- StrBuf->Printf(&buf, ") VALUES (?, '%d', ?, '%d', ?, ?, '%lu', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%"PRIu64"'",
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
+ StrBuf->Printf(&buf, ") VALUES (?, '%d', ?, '%d', ?, ?, '%lu', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%"PRIu64"'",
msg->send_id, msg->dest_id, (unsigned long)msg->timestamp, msg->status, msg->zeny, msg->item.amount, msg->item.nameid, msg->item.refine, msg->item.attribute, msg->item.identify, msg->item.unique_id);
for (j = 0; j < MAX_SLOTS; j++)
StrBuf->Printf(&buf, ", '%d'", msg->item.card[j]);
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++)
+ StrBuf->Printf(&buf, ", '%d', '%d'", msg->item.option[j].index, msg->item.option[j].value);
StrBuf->AppendStr(&buf, ")");
// prepare and execute query
stmt = SQL->StmtMalloc(inter->sql_handle);
- if( SQL_SUCCESS != SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
+ if (SQL_SUCCESS != SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, msg->send_name, strnlen(msg->send_name, NAME_LENGTH))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, msg->dest_name, strnlen(msg->dest_name, NAME_LENGTH))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_STRING, msg->title, strnlen(msg->title, MAIL_TITLE_LENGTH))
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 3, SQLDT_STRING, msg->body, strnlen(msg->body, MAIL_BODY_LENGTH))
- || SQL_SUCCESS != SQL->StmtExecute(stmt) )
+ || SQL_SUCCESS != SQL->StmtExecute(stmt))
{
SqlStmt_ShowDebug(stmt);
msg->id = 0;
- } else
+ } else {
msg->id = (int)SQL->StmtLastInsertId(stmt);
+ }
SQL->StmtFree(stmt);
StrBuf->Destroy(&buf);
@@ -176,8 +189,10 @@ static bool inter_mail_loadmessage(int mail_id, struct mail_message* msg)
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, "SELECT `id`,`send_name`,`send_id`,`dest_name`,`dest_id`,`title`,`message`,`time`,`status`,"
"`zeny`,`amount`,`nameid`,`refine`,`attribute`,`identify`,`unique_id`");
- for( j = 0; j < MAX_SLOTS; j++ )
+ for (j = 0; j < MAX_SLOTS; j++)
StrBuf->Printf(&buf, ",`card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++)
+ StrBuf->Printf(&buf, ",`opt_idx%d`,`opt_val%d`", j, j);
StrBuf->Printf(&buf, " FROM `%s` WHERE `id` = '%d'", mail_db, mail_id);
if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))
@@ -207,12 +222,18 @@ static bool inter_mail_loadmessage(int mail_id, struct mail_message* msg)
SQL->GetData(inter->sql_handle,15, &data, NULL); msg->item.unique_id = strtoull(data, NULL, 10);
msg->item.expire_time = 0;
msg->item.bound = 0;
-
- for( j = 0; j < MAX_SLOTS; j++ )
- {
+ /* Card Slots */
+ for (j = 0; j < MAX_SLOTS; j++) {
SQL->GetData(inter->sql_handle,16 + j, &data, NULL);
msg->item.card[j] = atoi(data);
}
+ /* Item Options */
+ for (j = 0 ; j < MAX_ITEM_OPTIONS; j++) {
+ SQL->GetData(inter->sql_handle, 16 + MAX_SLOTS + j * 2, &data, NULL);
+ msg->item.option[j].index = atoi(data);
+ SQL->GetData(inter->sql_handle, 17 + MAX_SLOTS + j * 2, &data, NULL);
+ msg->item.option[j].value = atoi(data);
+ }
}
StrBuf->Destroy(&buf);
@@ -269,6 +290,8 @@ static bool inter_mail_DeleteAttach(int mail_id)
StrBuf->Printf(&buf, "UPDATE `%s` SET `zeny` = '0', `nameid` = '0', `amount` = '0', `refine` = '0', `attribute` = '0', `identify` = '0'", mail_db);
for (i = 0; i < MAX_SLOTS; i++)
StrBuf->Printf(&buf, ", `card%d` = '0'", i);
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++)
+ StrBuf->Printf(&buf, ", `opt_idx%d` = '0', `opt_val%d` = '0'", i, i);
StrBuf->Printf(&buf, " WHERE `id` = '%d'", mail_id);
if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf))) {
diff --git a/src/char/int_mail.h b/src/char/int_mail.h
index 346adeea7..cb72db504 100644
--- a/src/char/int_mail.h
+++ b/src/char/int_mail.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c
index 2ed45305c..f96e45a50 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -94,32 +94,51 @@ bool inter_mercenary_owner_delete(int char_id)
return true;
}
-bool mapif_mercenary_save(struct s_mercenary* merc)
+/**
+ * Creates a new mercenary with the given data.
+ *
+ * @remark
+ * The mercenary ID is expected to be 0, and will be filled with the newly
+ * assigned ID.
+ *
+ * @param[in,out] merc The new mercenary's data.
+ * @retval false in case of errors.
+ */
+bool mapif_mercenary_create(struct s_mercenary *merc)
{
- bool flag = true;
+ nullpo_retr(false, merc);
+ Assert_retr(false, merc->mercenary_id == 0);
- nullpo_ret(merc);
- if( merc->mercenary_id == 0 )
- { // Create new DB entry
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
"INSERT INTO `%s` (`char_id`,`class`,`hp`,`sp`,`kill_counter`,`life_time`) VALUES ('%d','%d','%d','%d','%u','%u')",
- mercenary_db, merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time) )
- {
- Sql_ShowDebug(inter->sql_handle);
- flag = false;
- }
- else
- merc->mercenary_id = (int)SQL->LastInsertId(inter->sql_handle);
+ mercenary_db, merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time)) {
+ Sql_ShowDebug(inter->sql_handle);
+ return false;
}
- else if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `hp` = '%d', `sp` = '%d', `kill_counter` = '%u', `life_time` = '%u' WHERE `mer_id` = '%d'",
- mercenary_db, merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time, merc->mercenary_id) )
- { // Update DB entry
+ merc->mercenary_id = (int)SQL->LastInsertId(inter->sql_handle);
+
+ return true;
+}
+
+/**
+ * Saves an existing mercenary.
+ *
+ * @param merc The mercenary's data.
+ * @retval false in case of errors.
+ */
+bool mapif_mercenary_save(const struct s_mercenary *merc)
+{
+ nullpo_retr(false, merc);
+ Assert_retr(false, merc->mercenary_id > 0);
+
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `hp` = '%d', `sp` = '%d', `kill_counter` = '%u', `life_time` = '%u' WHERE `mer_id` = '%d'",
+ mercenary_db, merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time, merc->mercenary_id)) {
Sql_ShowDebug(inter->sql_handle);
- flag = false;
+ return false;
}
- return flag;
+ return true;
}
bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc)
@@ -149,7 +168,7 @@ bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc)
SQL->GetData(inter->sql_handle, 3, &data, NULL); merc->kill_count = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); merc->life_time = atoi(data);
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Mercenary loaded (%d - %d).\n", merc->mercenary_id, merc->char_id);
return true;
@@ -179,10 +198,15 @@ void mapif_mercenary_send(int fd, struct s_mercenary *merc, unsigned char flag)
WFIFOSET(fd,size);
}
-void mapif_parse_mercenary_create(int fd, struct s_mercenary* merc)
+void mapif_parse_mercenary_create(int fd, const struct s_mercenary *merc)
{
- bool result = mapif->mercenary_save(merc);
- mapif->mercenary_send(fd, merc, result);
+ struct s_mercenary merc_;
+ bool result;
+
+ memcpy(&merc_, merc, sizeof(merc_));
+
+ result = mapif->mercenary_create(&merc_);
+ mapif->mercenary_send(fd, &merc_, result);
}
void mapif_parse_mercenary_load(int fd, int merc_id, int char_id)
@@ -236,12 +260,11 @@ int inter_mercenary_parse_frommap(int fd)
{
unsigned short cmd = RFIFOW(fd,0);
- switch( cmd )
- {
- case 0x3070: mapif->parse_mercenary_create(fd, (struct s_mercenary*)RFIFOP(fd,4)); break;
- case 0x3071: mapif->parse_mercenary_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
- case 0x3072: mapif->parse_mercenary_delete(fd, (int)RFIFOL(fd,2)); break;
- case 0x3073: mapif->parse_mercenary_save(fd, (struct s_mercenary*)RFIFOP(fd,4)); break;
+ switch (cmd) {
+ case 0x3070: mapif->parse_mercenary_create(fd, RFIFOP(fd,4)); break;
+ case 0x3071: mapif->parse_mercenary_load(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
+ case 0x3072: mapif->parse_mercenary_delete(fd, RFIFOL(fd,2)); break;
+ case 0x3073: mapif->parse_mercenary_save(fd, RFIFOP(fd,4)); break;
default:
return 0;
}
diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h
index 17cc97fda..3b1623438 100644
--- a/src/char/int_mercenary.h
+++ b/src/char/int_mercenary.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 71034a17b..4b6800699 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -89,7 +89,7 @@ static void inter_party_calc_state(struct party_data *p)
// FIXME[Haru]: What if the occupied positions aren't the first three? It can happen if some party members leave. This is the reason why family sharing some times stops working until you recreate your party
if( p->size == 2 && ( chr->char_child(p->party.member[0].char_id,p->party.member[1].char_id) || chr->char_child(p->party.member[1].char_id,p->party.member[0].char_id) ) ) {
//Child should be able to share with either of their parents [RoM]
- if(p->party.member[0].class_&JOBL_BABY) //first slot is the child?
+ if (p->party.member[0].class >= JOB_BABY && p->party.member[0].class <= JOB_SUPER_BABY) //first slot is the child?
p->family = p->party.member[0].char_id;
else
p->family = p->party.member[1].char_id;
@@ -190,7 +190,7 @@ int inter_party_tosql(struct party *p, int flag, int index)
Sql_ShowDebug(inter->sql_handle);
}
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Party Saved (%d - %s)\n", party_id, p->name);
return 1;
}
@@ -252,12 +252,12 @@ struct party_data *inter_party_fromsql(int party_id)
SQL->GetData(inter->sql_handle, 3, &data, NULL); m->lv = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); m->map = mapindex->name2id(data);
SQL->GetData(inter->sql_handle, 5, &data, NULL); m->online = (atoi(data) ? 1 : 0);
- SQL->GetData(inter->sql_handle, 6, &data, NULL); m->class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 6, &data, NULL); m->class = atoi(data);
m->leader = (m->account_id == leader_id && m->char_id == leader_char ? 1 : 0);
}
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Party loaded (%d - %s).\n", party_id, p->party.name);
//Add party to memory.
CREATE(p, struct party_data, 1);
@@ -461,7 +461,7 @@ int mapif_party_broken(int party_id, int flag)
}
//Remarks in the party
-int mapif_party_message(int party_id, int account_id, char *mes, int len, int sfd)
+int mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd)
{
unsigned char buf[512];
nullpo_ret(mes);
@@ -479,13 +479,13 @@ int mapif_party_message(int party_id, int account_id, char *mes, int len, int sf
// Create Party
-int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct party_member *leader)
+int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader)
{
struct party_data *p;
int i;
nullpo_ret(name);
nullpo_ret(leader);
- if( (p=inter_party->search_partyname(name))!=NULL){
+ if (!*name || (p = inter_party->search_partyname(name)) != NULL) {
mapif->party_created(fd,leader->account_id,leader->char_id,NULL);
return 0;
}
@@ -493,9 +493,12 @@ int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct part
if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorized
for (i = 0; i < NAME_LENGTH && name[i]; i++)
if (strchr(char_name_letters, name[i]) == NULL) {
- if( name[i] == '"' ) { /* client-special-char */
- normalize_name(name,"\"");
- mapif->parse_CreateParty(fd,name,item,item2,leader);
+ if (name[i] == '"') { /* client-special-char */
+ char *newname = aStrndup(name, NAME_LENGTH-1);
+ normalize_name(newname,"\"");
+ trim(newname);
+ mapif->parse_CreateParty(fd, newname, item, item2, leader);
+ aFree(newname);
return 0;
}
mapif->party_created(fd,leader->account_id,leader->char_id,NULL);
@@ -511,7 +514,7 @@ int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct part
p = (struct party_data*)aCalloc(1, sizeof(struct party_data));
- memcpy(p->party.name,name,NAME_LENGTH);
+ safestrncpy(p->party.name, name, NAME_LENGTH);
p->party.exp=0;
p->party.item=(item?1:0)|(item2?2:0);
@@ -547,7 +550,7 @@ void mapif_parse_PartyInfo(int fd, int party_id, int char_id)
}
// Add a player to party request
-int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member)
+int mapif_parse_PartyAddMember(int fd, int party_id, const struct party_member *member)
{
struct party_data *p;
int i;
@@ -630,31 +633,21 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
return 0; //Member not found?
mapif->party_withdraw(party_id, account_id, char_id);
-
- if (p->party.member[i].leader){
- p->party.member[i].account_id = 0;
- for (j = 0; j < MAX_PARTY; j++) {
- if (!p->party.member[j].account_id)
- continue;
- mapif->party_withdraw(party_id, p->party.member[j].account_id, p->party.member[j].char_id);
- p->party.member[j].account_id = 0;
- }
- //Party gets deleted on the check_empty call below.
- } else {
- inter_party->tosql(&p->party,PS_DELMEMBER,i);
- j = p->party.member[i].lv;
- if(p->party.member[i].online) p->party.count--;
- memset(&p->party.member[i], 0, sizeof(struct party_member));
- p->size--;
- if (j == p->min_lv || j == p->max_lv || p->family)
- {
- if(p->family) p->family = 0; //Family state broken.
- inter_party->check_lv(p);
- }
+
+ j = p->party.member[i].lv;
+ if (p->party.member[i].online > 0)
+ p->party.count--;
+ memset(&p->party.member[i], 0, sizeof(struct party_member));
+ p->size--;
+ if (j == p->min_lv || j == p->max_lv || p->family) {
+ if(p->family) p->family = 0; //Family state broken.
+ inter_party->check_lv(p);
}
- if (inter_party->check_empty(p) == 0)
+ if (inter_party->check_empty(p) == 0) {
+ inter_party->tosql(&p->party, PS_DELMEMBER, i);
mapif->party_info(-1, &p->party, 0);
+ }
return 0;
}
// When member goes to other map or levels up.
@@ -724,12 +717,12 @@ int mapif_parse_BreakParty(int fd, int party_id)
if(!p)
return 0;
inter_party->tosql(&p->party,PS_BREAK,0);
- mapif->party_broken(fd,party_id);
+ mapif->party_broken(party_id, 1);
return 0;
}
//Party sending the message
-int mapif_parse_PartyMessage(int fd, int party_id, int account_id, char *mes, int len)
+int mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len)
{
return mapif->party_message(party_id,account_id,mes,len, fd);
}
@@ -767,14 +760,14 @@ int inter_party_parse_frommap(int fd)
{
RFIFOHEAD(fd);
switch(RFIFOW(fd,0)) {
- case 0x3020: mapif->parse_CreateParty(fd, (char*)RFIFOP(fd,4), RFIFOB(fd,28), RFIFOB(fd,29), (struct party_member*)RFIFOP(fd,30)); break;
+ case 0x3020: mapif->parse_CreateParty(fd, RFIFOP(fd,4), RFIFOB(fd,28), RFIFOB(fd,29), RFIFOP(fd,30)); break;
case 0x3021: mapif->parse_PartyInfo(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
- case 0x3022: mapif->parse_PartyAddMember(fd, RFIFOL(fd,4), (struct party_member*)RFIFOP(fd,8)); break;
+ case 0x3022: mapif->parse_PartyAddMember(fd, RFIFOL(fd,4), RFIFOP(fd,8)); break;
case 0x3023: mapif->parse_PartyChangeOption(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOW(fd,10), RFIFOW(fd,12)); break;
case 0x3024: mapif->parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
case 0x3025: mapif->parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOW(fd,14), RFIFOB(fd,16), RFIFOW(fd,17)); break;
case 0x3026: mapif->parse_BreakParty(fd, RFIFOL(fd,2)); break;
- case 0x3027: mapif->parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), (char*)RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
+ case 0x3027: mapif->parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
case 0x3029: mapif->parse_PartyLeaderChange(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
default:
return 0;
diff --git a/src/char/int_party.h b/src/char/int_party.h
index e6ad75bb8..77363dd45 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,9 +22,11 @@
#define CHAR_INT_PARTY_H
#include "common/hercules.h"
-#include "common/db.h"
#include "common/mmo.h"
+/* Forward Declarations */
+struct DBMap; // common/db.h
+
//Party Flags on what to save/delete.
enum {
PS_CREATE = 0x01, //Create a new party entry (index holds leader's info)
@@ -47,7 +49,7 @@ struct party_data {
**/
struct inter_party_interface {
struct party_data *pt;
- DBMap* db; // int party_id -> struct party_data*
+ struct DBMap *db; // int party_id -> struct party_data*
int (*check_lv) (struct party_data *p);
void (*calc_state) (struct party_data *p);
int (*tosql) (struct party *p, int flag, int index);
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 6baf832bc..489b10e3e 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -40,44 +40,55 @@
struct inter_pet_interface inter_pet_s;
struct inter_pet_interface *inter_pet;
-//---------------------------------------------------------
-int inter_pet_tosql(int pet_id, struct s_pet* p)
+/**
+ * Saves a pet to the SQL database.
+ *
+ * @remark
+ * In case of newly created pet, the pet ID is not updated to reflect the
+ * newly assigned ID. The caller must do so.
+ *
+ * @param p The pet data to save.
+ * @return The ID of the saved pet.
+ * @retval 0 in case of errors.
+ */
+int inter_pet_tosql(const struct s_pet *p)
{
//`pet` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`)
char esc_name[NAME_LENGTH*2+1];// escaped pet name
+ int pet_id = 0, hungry = 0, intimate = 0;
nullpo_ret(p);
+
SQL->EscapeStringLen(inter->sql_handle, esc_name, p->name, strnlen(p->name, NAME_LENGTH));
- p->hungry = cap_value(p->hungry, 0, 100);
- p->intimate = cap_value(p->intimate, 0, 1000);
-
- if( pet_id == -1 )
- {// New pet.
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
- "(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`) "
- "VALUES ('%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
- p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate) )
- {
+ hungry = cap_value(p->hungry, 0, 100);
+ intimate = cap_value(p->intimate, 0, 1000);
+
+ if (p->pet_id == 0) {
+ // New pet.
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` "
+ "(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`) "
+ "VALUES ('%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
+ p->equip, intimate, hungry, p->rename_flag, p->incubate)) {
Sql_ShowDebug(inter->sql_handle);
return 0;
}
- p->pet_id = (int)SQL->LastInsertId(inter->sql_handle);
- }
- else
- {// Update pet.
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%d',`equip`='%d',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d' WHERE `pet_id`='%d'",
- pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
- p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate, p->pet_id) )
- {
+ pet_id = (int)SQL->LastInsertId(inter->sql_handle);
+ } else {
+ // Update pet.
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%d',`equip`='%d',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d' WHERE `pet_id`='%d'",
+ pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
+ p->equip, intimate, hungry, p->rename_flag, p->incubate, p->pet_id)) {
Sql_ShowDebug(inter->sql_handle);
return 0;
}
+ pet_id = p->pet_id;
}
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Pet saved %d - %s.\n", pet_id, p->name);
- return 1;
+
+ return pet_id;
}
int inter_pet_fromsql(int pet_id, struct s_pet* p)
@@ -119,7 +130,7 @@ int inter_pet_fromsql(int pet_id, struct s_pet* p)
p->hungry = cap_value(p->hungry, 0, 100);
p->intimate = cap_value(p->intimate, 0, 1000);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Pet loaded (%d - %s).\n", pet_id, p->name);
}
return 0;
@@ -211,7 +222,7 @@ int mapif_delete_pet_ack(int fd, int flag)
}
int mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id,
- short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name)
+ short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name)
{
nullpo_ret(pet_name);
memset(inter_pet->pt, 0, sizeof(struct s_pet));
@@ -240,8 +251,8 @@ int mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short
else if(inter_pet->pt->intimate > 1000)
inter_pet->pt->intimate = 1000;
- inter_pet->pt->pet_id = -1; //Signal NEW pet.
- if (inter_pet->tosql(inter_pet->pt->pet_id,inter_pet->pt))
+ inter_pet->pt->pet_id = 0; //Signal NEW pet.
+ if ((inter_pet->pt->pet_id = inter_pet->tosql(inter_pet->pt)) != 0)
mapif->pet_created(fd, account_id, inter_pet->pt);
else //Failed...
mapif->pet_created(fd, account_id, NULL);
@@ -271,7 +282,7 @@ int mapif_load_pet(int fd, int account_id, int char_id, int pet_id)
return 0;
}
-int mapif_save_pet(int fd, int account_id, struct s_pet *data)
+int mapif_save_pet(int fd, int account_id, const struct s_pet *data)
{
//here process pet save request.
int len;
@@ -283,15 +294,7 @@ int mapif_save_pet(int fd, int account_id, struct s_pet *data)
return 0;
}
- if (data->hungry < 0)
- data->hungry = 0;
- else if (data->hungry > 100)
- data->hungry = 100;
- if (data->intimate < 0)
- data->intimate = 0;
- else if (data->intimate > 1000)
- data->intimate = 1000;
- inter_pet->tosql(data->pet_id,data);
+ inter_pet->tosql(data);
mapif->save_pet_ack(fd, account_id, 0);
return 0;
@@ -308,7 +311,7 @@ int mapif_parse_CreatePet(int fd)
{
RFIFOHEAD(fd);
mapif->create_pet(fd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOW(fd, 10), RFIFOW(fd, 12), RFIFOW(fd, 14), RFIFOW(fd, 16), RFIFOW(fd, 18),
- RFIFOW(fd, 20), RFIFOB(fd, 22), RFIFOB(fd, 23), (char*)RFIFOP(fd, 24));
+ RFIFOW(fd, 20), RFIFOB(fd, 22), RFIFOB(fd, 23), RFIFOP(fd, 24));
return 0;
}
@@ -322,7 +325,7 @@ int mapif_parse_LoadPet(int fd)
int mapif_parse_SavePet(int fd)
{
RFIFOHEAD(fd);
- mapif->save_pet(fd, RFIFOL(fd, 4), (struct s_pet *) RFIFOP(fd, 8));
+ mapif->save_pet(fd, RFIFOL(fd, 4), RFIFOP(fd, 8));
return 0;
}
diff --git a/src/char/int_pet.h b/src/char/int_pet.h
index 07a273eac..13291e226 100644
--- a/src/char/int_pet.h
+++ b/src/char/int_pet.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -30,7 +30,7 @@ struct s_pet;
**/
struct inter_pet_interface {
struct s_pet *pt;
- int (*tosql) (int pet_id, struct s_pet* p);
+ int (*tosql) (const struct s_pet *p);
int (*fromsql) (int pet_id, struct s_pet* p);
int (*sql_init) (void);
void (*sql_final) (void);
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index 946603b0a..bd49cb7d4 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -52,7 +52,7 @@ struct quest *mapif_quests_fromsql(int char_id, int *count)
{
struct quest *questlog = NULL;
struct quest tmp_quest;
- SqlStmt *stmt;
+ struct SqlStmt *stmt;
StringBuf buf;
int i;
int sqlerror = SQL_SUCCESS;
@@ -154,7 +154,7 @@ bool mapif_quest_add(int char_id, struct quest qd)
for (i = 0; i < MAX_QUEST_OBJECTIVES; i++) {
StrBuf->Printf(&buf, ", `count%d`", i+1);
}
- StrBuf->Printf(&buf, ") VALUES ('%d', '%d', '%d', '%d'", qd.quest_id, char_id, qd.state, qd.time);
+ StrBuf->Printf(&buf, ") VALUES ('%d', '%d', '%u', '%u'", qd.quest_id, char_id, qd.state, qd.time);
for (i = 0; i < MAX_QUEST_OBJECTIVES; i++) {
StrBuf->Printf(&buf, ", '%d'", qd.count[i]);
}
@@ -182,7 +182,7 @@ bool mapif_quest_update(int char_id, struct quest qd)
int i;
StrBuf->Init(&buf);
- StrBuf->Printf(&buf, "UPDATE `%s` SET `state`='%d'", quest_db, qd.state);
+ StrBuf->Printf(&buf, "UPDATE `%s` SET `state`='%u', `time`='%u'", quest_db, qd.state, qd.time);
for (i = 0; i < MAX_QUEST_OBJECTIVES; i++) {
StrBuf->Printf(&buf, ", `count%d`='%d'", i+1, qd.count[i]);
}
@@ -218,11 +218,12 @@ int mapif_parse_quest_save(int fd)
{
int i, j, k, old_n, new_n = (RFIFOW(fd,2)-8)/sizeof(struct quest);
int char_id = RFIFOL(fd,4);
- struct quest *old_qd = NULL, *new_qd = NULL;
+ struct quest *old_qd = NULL;
+ const struct quest *new_qd = NULL;
bool success = true;
if (new_n > 0)
- new_qd = (struct quest*)RFIFOP(fd,8);
+ new_qd = RFIFOP(fd,8);
old_qd = mapif->quests_fromsql(char_id, &old_n);
diff --git a/src/char/int_quest.h b/src/char/int_quest.h
index 8d5cd5807..737213fff 100644
--- a/src/char/int_quest.h
+++ b/src/char/int_quest.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 086ef2044..65301127f 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -37,36 +37,154 @@
#include <stdio.h>
#include <stdlib.h>
-#define STORAGE_MEMINC 16
-
struct inter_storage_interface inter_storage_s;
struct inter_storage_interface *inter_storage;
/// Save storage data to sql
-int inter_storage_tosql(int account_id, struct storage_data* p)
+int inter_storage_tosql(int account_id, const struct storage_data *p)
{
+ int i = 0, j = 0;
+ bool matched_p[MAX_STORAGE] = { false };
+ int delete[MAX_STORAGE] = { 0 };
+ int total_deletes = 0, total_updates = 0, total_inserts = 0;
+ int total_changes = 0;
+ struct storage_data cp = { 0 };
+ StringBuf buf;
+
nullpo_ret(p);
- chr->memitemdata_to_sql(p->items, MAX_STORAGE, account_id, TABLE_STORAGE);
- return 0;
+
+ VECTOR_INIT(cp.item);
+ inter_storage->fromsql(account_id, &cp);
+
+ StrBuf->Init(&buf);
+
+ if (VECTOR_LENGTH(cp.item) > 0) {
+ /**
+ * Compare and update items, if any.
+ */
+ for (i = 0; i < VECTOR_LENGTH(cp.item); i++) {
+ struct item *cp_it = &VECTOR_INDEX(cp.item, i);
+ struct item *p_it = NULL;
+
+ ARR_FIND(0, VECTOR_LENGTH(p->item), j,
+ matched_p[j] != true
+ && (p_it = &VECTOR_INDEX(p->item, j)) != NULL
+ && cp_it->nameid == p_it->nameid
+ && cp_it->unique_id == p_it->unique_id
+ && memcmp(p_it->card, cp_it->card, sizeof(short) * MAX_SLOTS) == 0
+ && memcmp(p_it->option, cp_it->option, 5 * MAX_ITEM_OPTIONS) == 0);
+
+ if (j < VECTOR_LENGTH(p->item)) {
+ int k = 0;
+ if (memcmp(cp_it, p_it, sizeof(struct item)) != 0) {
+ if (total_updates == 0) {
+ StrBuf->Printf(&buf, "REPLACE INTO `%s` (`id`, `account_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`", storage_db);
+ for (k = 0; k < MAX_SLOTS; k++)
+ StrBuf->Printf(&buf, ", `card%d`", k);
+ for (k = 0; k < MAX_ITEM_OPTIONS; k++)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", k, k);
+ StrBuf->AppendStr(&buf, ", `expire_time`, `bound`, `unique_id`) VALUES");
+ }
+
+ StrBuf->Printf(&buf, "%s('%d', '%d', '%d', '%d', '%u', '%d', '%d', '%d'",
+ total_updates > 0 ? ", " : "", cp_it->id, account_id, p_it->nameid, p_it->amount, p_it->equip, p_it->identify, p_it->refine, p_it->attribute);
+ for (k = 0; k < MAX_SLOTS; k++)
+ StrBuf->Printf(&buf, ", '%d'", p_it->card[k]);
+ for (k = 0; k < MAX_ITEM_OPTIONS; ++k)
+ StrBuf->Printf(&buf, ", '%d', '%d'", p_it->option[k].index, p_it->option[k].value);
+ StrBuf->Printf(&buf, ", '%u', '%d', '%"PRIu64"')", p_it->expire_time, p_it->bound, p_it->unique_id);
+
+ total_updates++;
+ }
+ matched_p[j] = true;
+ } else { // Does not exist, so set for deletion.
+ delete[total_deletes++] = cp_it->id;
+ }
+ }
+
+ if (total_updates > 0 && SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
+ Sql_ShowDebug(inter->sql_handle);
+
+ /**
+ * Handle deletions, if any.
+ */
+ if (total_deletes > 0) {
+ StrBuf->Clear(&buf);
+ StrBuf->Printf(&buf, "DELETE FROM `%s` WHERE `id` IN (", storage_db);
+ for (i = 0; i < total_deletes; i++) {
+ StrBuf->Printf(&buf, "%s'%d'", i == 0 ? "" : ", ", delete[i]);
+ }
+ StrBuf->AppendStr(&buf, ");");
+
+ if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
+ Sql_ShowDebug(inter->sql_handle);
+ }
+ }
+
+ /**
+ * Check for new items.
+ */
+ for (i = 0; i < VECTOR_LENGTH(p->item); i++) {
+ struct item *p_it = &VECTOR_INDEX(p->item, i);
+
+ if (matched_p[i])
+ continue; // Item is not a new entry, so lets continue.
+
+ // Store the remaining items.
+ if (total_inserts == 0) {
+ StrBuf->Clear(&buf);
+ StrBuf->Printf(&buf, "INSERT INTO `%s` (`account_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`", storage_db);
+ for (j = 0; j < MAX_SLOTS; ++j)
+ StrBuf->Printf(&buf, ", `card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
+ StrBuf->AppendStr(&buf, ") VALUES ");
+ }
+
+ StrBuf->Printf(&buf, "%s('%d', '%d', '%d', '%u', '%d', '%d', '%d', '%u', '%d', '%"PRIu64"'",
+ total_inserts > 0 ? ", " : "", account_id, p_it->nameid, p_it->amount, p_it->equip, p_it->identify, p_it->refine,
+ p_it->attribute, p_it->expire_time, p_it->bound, p_it->unique_id);
+ for (j = 0; j < MAX_SLOTS; ++j)
+ StrBuf->Printf(&buf, ", '%d'", p_it->card[j]);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", '%d', '%d'", p_it->option[j].index, p_it->option[j].value);
+ StrBuf->AppendStr(&buf, ")");
+
+ total_inserts++;
+ }
+
+ if (total_inserts > 0 && SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
+ Sql_ShowDebug(inter->sql_handle);
+
+ StrBuf->Destroy(&buf);
+ VECTOR_CLEAR(cp.item);
+
+ total_changes = total_inserts + total_updates + total_deletes;
+ ShowInfo("storage save complete - id: %d (total: %d)\n", account_id, total_changes);
+ return total_changes;
}
/// Load storage data to mem
-int inter_storage_fromsql(int account_id, struct storage_data* p)
+int inter_storage_fromsql(int account_id, struct storage_data *p)
{
StringBuf buf;
char* data;
int i;
int j;
+ int num_rows = 0;
nullpo_ret(p);
- memset(p, 0, sizeof(struct storage_data)); //clean up memory
- p->storage_amount = 0;
+
+ if (VECTOR_LENGTH(p->item) > 0)
+ VECTOR_CLEAR(p->item);
// storage {`account_id`/`id`/`nameid`/`amount`/`equip`/`identify`/`refine`/`attribute`/`card0`/`card1`/`card2`/`card3`}
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, "SELECT `id`,`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`expire_time`,`bound`,`unique_id`");
- for( j = 0; j < MAX_SLOTS; ++j )
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ",`card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ",`opt_idx%d`,`opt_val%d`", j, j);
StrBuf->Printf(&buf, " FROM `%s` WHERE `account_id`='%d' ORDER BY `nameid`", storage_db, account_id);
if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
@@ -74,32 +192,50 @@ int inter_storage_fromsql(int account_id, struct storage_data* p)
StrBuf->Destroy(&buf);
- for (i = 0; i < MAX_STORAGE && SQL_SUCCESS == SQL->NextRow(inter->sql_handle); ++i) {
- struct item *item = &p->items[i];
- SQL->GetData(inter->sql_handle, 0, &data, NULL); item->id = atoi(data);
- SQL->GetData(inter->sql_handle, 1, &data, NULL); item->nameid = atoi(data);
- SQL->GetData(inter->sql_handle, 2, &data, NULL); item->amount = atoi(data);
- SQL->GetData(inter->sql_handle, 3, &data, NULL); item->equip = atoi(data);
- SQL->GetData(inter->sql_handle, 4, &data, NULL); item->identify = atoi(data);
- SQL->GetData(inter->sql_handle, 5, &data, NULL); item->refine = atoi(data);
- SQL->GetData(inter->sql_handle, 6, &data, NULL); item->attribute = atoi(data);
- SQL->GetData(inter->sql_handle, 7, &data, NULL); item->expire_time = (unsigned int)atoi(data);
- SQL->GetData(inter->sql_handle, 8, &data, NULL); item->bound = atoi(data);
- SQL->GetData(inter->sql_handle, 9, &data, NULL); item->unique_id = strtoull(data, NULL, 10);
- for( j = 0; j < MAX_SLOTS; ++j )
- {
- SQL->GetData(inter->sql_handle, 10+j, &data, NULL); item->card[j] = atoi(data);
+ if ((num_rows = (int)SQL->NumRows(inter->sql_handle)) != 0) {
+
+ VECTOR_ENSURE(p->item, num_rows > MAX_STORAGE ? MAX_STORAGE : num_rows, 1);
+
+ for (i = 0; i < MAX_STORAGE && SQL_SUCCESS == SQL->NextRow(inter->sql_handle); ++i) {
+ struct item item = { 0 };
+ SQL->GetData(inter->sql_handle, 0, &data, NULL); item.id = atoi(data);
+ SQL->GetData(inter->sql_handle, 1, &data, NULL); item.nameid = atoi(data);
+ SQL->GetData(inter->sql_handle, 2, &data, NULL); item.amount = atoi(data);
+ SQL->GetData(inter->sql_handle, 3, &data, NULL); item.equip = atoi(data);
+ SQL->GetData(inter->sql_handle, 4, &data, NULL); item.identify = atoi(data);
+ SQL->GetData(inter->sql_handle, 5, &data, NULL); item.refine = atoi(data);
+ SQL->GetData(inter->sql_handle, 6, &data, NULL); item.attribute = atoi(data);
+ SQL->GetData(inter->sql_handle, 7, &data, NULL); item.expire_time = (unsigned int)atoi(data);
+ SQL->GetData(inter->sql_handle, 8, &data, NULL); item.bound = atoi(data);
+ SQL->GetData(inter->sql_handle, 9, &data, NULL); item.unique_id = strtoull(data, NULL, 10);
+
+ /* Card Slots */
+ for (j = 0; j < MAX_SLOTS; ++j) {
+ SQL->GetData(inter->sql_handle, 10 + j, &data, NULL);
+ item.card[j] = atoi(data);
+ }
+
+ /* Item Options */
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j) {
+ SQL->GetData(inter->sql_handle, 10 + MAX_SLOTS + j * 2, &data, NULL);
+ item.option[j].index = atoi(data);
+ SQL->GetData(inter->sql_handle, 11 + MAX_SLOTS + j * 2, &data, NULL);
+ item.option[j].value = atoi(data);
+ }
+
+ VECTOR_PUSH(p->item, item);
}
}
- p->storage_amount = i;
+
SQL->FreeResult(inter->sql_handle);
- ShowInfo("storage load complete from DB - id: %d (total: %d)\n", account_id, p->storage_amount);
- return 1;
+ ShowInfo("storage load complete from DB - id: %d (total: %d)\n", account_id, VECTOR_LENGTH(p->item));
+
+ return VECTOR_LENGTH(p->item);
}
/// Save guild_storage data to sql
-int inter_storage_guild_storage_tosql(int guild_id, struct guild_storage* p)
+int inter_storage_guild_storage_tosql(int guild_id, const struct guild_storage *p)
{
nullpo_ret(p);
chr->memitemdata_to_sql(p->items, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE);
@@ -123,8 +259,10 @@ int inter_storage_guild_storage_fromsql(int guild_id, struct guild_storage* p)
// storage {`guild_id`/`id`/`nameid`/`amount`/`equip`/`identify`/`refine`/`attribute`/`card0`/`card1`/`card2`/`card3`}
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, "SELECT `id`,`nameid`,`amount`,`equip`,`identify`,`refine`,`attribute`,`bound`,`unique_id`");
- for( j = 0; j < MAX_SLOTS; ++j )
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ",`card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
StrBuf->Printf(&buf, " FROM `%s` WHERE `guild_id`='%d' ORDER BY `nameid`", guild_storage_db, guild_id);
if( SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
@@ -144,9 +282,17 @@ int inter_storage_guild_storage_fromsql(int guild_id, struct guild_storage* p)
SQL->GetData(inter->sql_handle, 7, &data, NULL); item->bound = atoi(data);
SQL->GetData(inter->sql_handle, 8, &data, NULL); item->unique_id = strtoull(data, NULL, 10);
item->expire_time = 0;
-
- for( j = 0; j < MAX_SLOTS; ++j ) {
- SQL->GetData(inter->sql_handle, 9+j, &data, NULL); item->card[j] = atoi(data);
+ /* Card Slots */
+ for (j = 0; j < MAX_SLOTS; ++j) {
+ SQL->GetData(inter->sql_handle, 9 + j, &data, NULL);
+ item->card[j] = atoi(data);
+ }
+ /* Item Options */
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j) {
+ SQL->GetData(inter->sql_handle, 9 + MAX_SLOTS + j * 2, &data, NULL);
+ item->option[j].index = atoi(data);
+ SQL->GetData(inter->sql_handle, 10 + MAX_SLOTS + j * 2, &data, NULL);
+ item->option[j].value = atoi(data);
}
}
p->storage_amount = i;
@@ -197,7 +343,7 @@ int mapif_load_guild_storage(int fd, int account_id, int guild_id, char flag)
WFIFOL(fd,4) = account_id;
WFIFOL(fd,8) = guild_id;
WFIFOB(fd,12) = flag; //1 open storage, 0 don't open
- inter_storage->guild_storage_fromsql(guild_id, (struct guild_storage*)WFIFOP(fd,13));
+ inter_storage->guild_storage_fromsql(guild_id, WFIFOP(fd,13));
WFIFOSET(fd, WFIFOW(fd,2));
return 0;
}
@@ -222,13 +368,125 @@ int mapif_save_guild_storage_ack(int fd, int account_id, int guild_id, int fail)
return 0;
}
+//=========================================================
+// Account Storage
//---------------------------------------------------------
-// packet from map server
+/**
+ * Parses account storage load request from map server.
+ * @packet 0x3010 [in] <account_id>.L
+ * @param fd [in] file/socket descriptor
+ * @return 1 on success, 0 on failure.
+ */
+int mapif_parse_AccountStorageLoad(int fd)
+{
+ int account_id = RFIFOL(fd, 2);
+
+ Assert_ret(fd > 0);
+ Assert_ret(account_id > 0);
+
+ mapif->account_storage_load(fd, account_id);
+
+ return 1;
+}
+
+/**
+ * Loads the account storage and send to the map server.
+ * @packet 0x3805 [out] <account_id>.L <struct item[]>.P
+ * @param fd [in] file/socket descriptor.
+ * @param account_id [in] account id of the session.
+ * @return 1 on success, 0 on failure.
+ */
+int mapif_account_storage_load(int fd, int account_id)
+{
+ struct storage_data stor = { 0 };
+ int count = 0, i = 0, len = 0;
+
+ Assert_ret(account_id > 0);
+
+ VECTOR_INIT(stor.item);
+ count = inter_storage->fromsql(account_id, &stor);
+
+ len = 8 + count * sizeof(struct item);
+
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = 0x3805;
+ WFIFOW(fd, 2) = (uint16) len;
+ WFIFOL(fd, 4) = account_id;
+ for (i = 0; i < count; i++)
+ memcpy(WFIFOP(fd, 8 + i * sizeof(struct item)), &VECTOR_INDEX(stor.item, i), sizeof(struct item));
+ WFIFOSET(fd, len);
+
+ VECTOR_CLEAR(stor.item);
+
+ return 1;
+}
+
+/**
+ * Parses an account storage save request from the map server.
+ * @packet 0x3011 [in] <packet_len>.W <account_id>.L <struct item[]>.P
+ * @param fd [in] file/socket descriptor.
+ * @return 1 on success, 0 on failure.
+ */
+int mapif_parse_AccountStorageSave(int fd)
+{
+ int payload_size = RFIFOW(fd, 2) - 8, account_id = RFIFOL(fd, 4);
+ int i = 0, count = 0;
+ struct storage_data p_stor = { 0 };
+
+ Assert_ret(fd > 0);
+ Assert_ret(account_id > 0);
+
+ count = payload_size/sizeof(struct item);
+
+ VECTOR_INIT(p_stor.item);
+
+ if (count > 0) {
+ VECTOR_ENSURE(p_stor.item, count, 1);
+ for (i = 0; i < count; i++) {
+ const struct item *it = RFIFOP(fd, 8 + i * sizeof(struct item));
+
+ VECTOR_PUSH(p_stor.item, *it);
+ }
+
+ p_stor.aggregate = count;
+ }
+
+ inter_storage->tosql(account_id, &p_stor);
+
+ VECTOR_CLEAR(p_stor.item);
+
+ mapif->sAccountStorageSaveAck(fd, account_id, true);
+
+ return 1;
+}
+
+/**
+ * Sends an acknowledgement for the save
+ * status of the account storage.
+ * @packet 0x3808 [out] <account_id>.L <save_flag>.B
+ * @param fd [in] File/Socket Descriptor.
+ * @param account_id [in] Account ID of the storage in question.
+ * @param flag [in] Save flag, true for success and false for failure.
+ */
+void mapif_send_AccountStorageSaveAck(int fd, int account_id, bool flag)
+{
+ WFIFOHEAD(fd, 7);
+ WFIFOW(fd, 0) = 0x3808;
+ WFIFOL(fd, 2) = account_id;
+ WFIFOB(fd, 6) = flag ? 1 : 0;
+ WFIFOSET(fd, 7);
+}
+
+//=========================================================
+// Guild Storage
+//---------------------------------------------------------
int mapif_parse_LoadGuildStorage(int fd)
{
RFIFOHEAD(fd);
+
mapif->load_guild_storage(fd,RFIFOL(fd,2),RFIFOL(fd,6),1);
+
return 0;
}
@@ -249,13 +507,14 @@ int mapif_parse_SaveGuildStorage(int fd)
} else if(SQL->NumRows(inter->sql_handle) > 0) {
// guild exists
SQL->FreeResult(inter->sql_handle);
- inter_storage->guild_storage_tosql(guild_id, (struct guild_storage*)RFIFOP(fd,12));
+ inter_storage->guild_storage_tosql(guild_id, RFIFOP(fd,12));
mapif->save_guild_storage_ack(fd, RFIFOL(fd,4), guild_id, 0);
return 0;
}
SQL->FreeResult(inter->sql_handle);
}
mapif->save_guild_storage_ack(fd, RFIFOL(fd,4), guild_id, 1);
+
return 0;
}
@@ -279,7 +538,7 @@ int mapif_parse_ItemBoundRetrieve_sub(int fd)
{
#ifdef GP_BOUND_ITEMS
StringBuf buf;
- SqlStmt* stmt;
+ struct SqlStmt *stmt;
struct item item;
int j, i=0, s=0, bound_qt=0;
struct item items[MAX_INVENTORY];
@@ -290,8 +549,10 @@ int mapif_parse_ItemBoundRetrieve_sub(int fd)
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, "SELECT `id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `expire_time`, `bound`, `unique_id`");
- for( j = 0; j < MAX_SLOTS; ++j )
+ for (j = 0; j < MAX_SLOTS; ++j)
StrBuf->Printf(&buf, ", `card%d`", j);
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", j, j);
StrBuf->Printf(&buf, " FROM `%s` WHERE `char_id`='%d' AND `bound` = '%d'",inventory_db,char_id,IBT_GUILD);
stmt = SQL->StmtMalloc(inter->sql_handle);
@@ -315,17 +576,22 @@ int mapif_parse_ItemBoundRetrieve_sub(int fd)
SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &item.expire_time, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 8, SQLDT_UCHAR, &item.bound, 0, NULL, NULL);
SQL->StmtBindColumn(stmt, 9, SQLDT_UINT64, &item.unique_id, 0, NULL, NULL);
- for( j = 0; j < MAX_SLOTS; ++j )
- SQL->StmtBindColumn(stmt, 10+j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
-
- while( SQL_SUCCESS == SQL->StmtNextRow(stmt)) {
+ /* Card Slots */
+ for (j = 0; j < MAX_SLOTS; ++j)
+ SQL->StmtBindColumn(stmt, 10 + j, SQLDT_SHORT, &item.card[j], 0, NULL, NULL);
+ /* Item Options */
+ for (j = 0; j < MAX_ITEM_OPTIONS; ++j) {
+ SQL->StmtBindColumn(stmt, 10 + MAX_SLOTS + j * 2, SQLDT_INT16, &item.option[j].index, 0, NULL, NULL);
+ SQL->StmtBindColumn(stmt, 11 + MAX_SLOTS + j * 2, SQLDT_INT16, &item.option[j].value, 0, NULL, NULL);
+ }
+ while (SQL_SUCCESS == SQL->StmtNextRow(stmt)) {
Assert_retb(i < MAX_INVENTORY);
memcpy(&items[i],&item,sizeof(struct item));
i++;
}
SQL->FreeResult(inter->sql_handle);
- if(!i) { //No items found - No need to continue
+ if (i == 0) { //No items found - No need to continue
StrBuf->Destroy(&buf);
SQL->StmtFree(stmt);
return 0;
@@ -410,24 +676,28 @@ int mapif_parse_ItemBoundRetrieve_sub(int fd)
StrBuf->Printf(&buf,"INSERT INTO `%s` (`guild_id`,`nameid`,`amount`,`equip`,`identify`,`refine`,"
"`attribute`,`expire_time`,`bound`,`unique_id`",
guild_storage_db);
- for( s = 0; s < MAX_SLOTS; ++s )
+ for (s = 0; s < MAX_SLOTS; ++s)
StrBuf->Printf(&buf, ", `card%d`", s);
+ for (s = 0; s < MAX_ITEM_OPTIONS; ++s)
+ StrBuf->Printf(&buf, ", `opt_idx%d`, `opt_val%d`", s, s);
StrBuf->AppendStr(&buf," ) VALUES ");
- for( j = 0; j < i; ++j ) {
- if( j )
+ for (j = 0; j < i; ++j) {
+ if (j != 0)
StrBuf->AppendStr(&buf, ",");
- StrBuf->Printf(&buf, "('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%"PRIu64"'",
+ StrBuf->Printf(&buf, "('%d', '%d', '%d', '%u', '%d', '%d', '%d', '%u', '%d', '%"PRIu64"'",
guild_id, items[j].nameid, items[j].amount, items[j].equip, items[j].identify, items[j].refine,
items[j].attribute, items[j].expire_time, items[j].bound, items[j].unique_id);
- for( s = 0; s < MAX_SLOTS; ++s )
+ for (s = 0; s < MAX_SLOTS; ++s)
StrBuf->Printf(&buf, ", '%d'", items[j].card[s]);
+ for (s = 0; s < MAX_ITEM_OPTIONS; ++s)
+ StrBuf->Printf(&buf, ", '%d', '%d'", items[j].option[s].index, items[j].option[s].value);
StrBuf->AppendStr(&buf, ")");
}
- if( SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
- || SQL_ERROR == SQL->StmtExecute(stmt) )
+ if (SQL_ERROR == SQL->StmtPrepareStr(stmt, StrBuf->Value(&buf))
+ || SQL_ERROR == SQL->StmtExecute(stmt))
{
Sql_ShowDebug(inter->sql_handle);
SQL->StmtFree(stmt);
@@ -458,6 +728,8 @@ int inter_storage_parse_frommap(int fd)
{
RFIFOHEAD(fd);
switch(RFIFOW(fd,0)){
+ case 0x3010: mapif->pAccountStorageLoad(fd); break;
+ case 0x3011: mapif->pAccountStorageSave(fd); break;
case 0x3018: mapif->parse_LoadGuildStorage(fd); break;
case 0x3019: mapif->parse_SaveGuildStorage(fd); break;
#ifdef GP_BOUND_ITEMS
diff --git a/src/char/int_storage.h b/src/char/int_storage.h
index 9bf5b5fd5..46bb6910f 100644
--- a/src/char/int_storage.h
+++ b/src/char/int_storage.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#ifndef CHAR_INT_STORAGE_H
#define CHAR_INT_STORAGE_H
+#include "common/db.h"
#include "common/hercules.h"
struct storage_data;
@@ -30,9 +31,9 @@ struct guild_storage;
* inter_storage interface
**/
struct inter_storage_interface {
- int (*tosql) (int account_id, struct storage_data* p);
- int (*fromsql) (int account_id, struct storage_data* p);
- int (*guild_storage_tosql) (int guild_id, struct guild_storage* p);
+ int (*tosql) (int account_id, const struct storage_data *p);
+ int (*fromsql) (int account_id, struct storage_data *p);
+ int (*guild_storage_tosql) (int guild_id, const struct guild_storage *p);
int (*guild_storage_fromsql) (int guild_id, struct guild_storage* p);
int (*sql_init) (void);
void (*sql_final) (void);
diff --git a/src/char/inter.c b/src/char/inter.c
index 87ecb4e6a..cfbc0fd4d 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -36,12 +36,14 @@
#include "char/int_storage.h"
#include "char/mapif.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/db.h"
#include "common/memmgr.h"
#include "common/mmo.h"
#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/socket.h"
+#include "common/sql.h"
#include "common/strlib.h"
#include "common/timer.h"
@@ -61,12 +63,12 @@ char char_server_pw[100] = "ragnarok";
char char_server_db[32] = "ragnarok";
char default_codepage[32] = ""; //Feature by irmin.
-unsigned int party_share_level = 10;
+int party_share_level = 10;
// recv. packet list
int inter_recv_packet_length[] = {
-1,-1, 7,-1, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000-
- 6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010-
+ 6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010- Account Storage [Smokexyz]
-1,10,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party
-1, 6,-1,-1, 55,19, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030-
-1, 9, 0, 0, 0, 0, 0, 0, 7, 6,10,10, 10,-1, 0, 0, // 3040-
@@ -82,7 +84,7 @@ struct WisData {
int64 tick;
unsigned char src[24], dst[24], msg[512];
};
-static DBMap* wis_db = NULL; // int wis_id -> struct WisData*
+static struct DBMap *wis_db = NULL; // int wis_id -> struct WisData*
static int wis_dellist[WISDELLIST_MAX], wis_delnum;
#define MAX_JOB_NAMES 150
@@ -166,9 +168,9 @@ void inter_do_final_msg(void)
aFree(msg_table[i]);
}
/* from pc.c due to @accinfo. any ideas to replace this crap are more than welcome. */
-const char* inter_job_name(int class_)
+const char* inter_job_name(int class)
{
- switch (class_) {
+ switch (class) {
case JOB_NOVICE: // 550
case JOB_SWORDMAN: // 551
case JOB_MAGE: // 552
@@ -176,7 +178,7 @@ const char* inter_job_name(int class_)
case JOB_ACOLYTE: // 554
case JOB_MERCHANT: // 555
case JOB_THIEF: // 556
- return inter->msg_txt(550 - JOB_NOVICE+class_);
+ return inter->msg_txt(550 - JOB_NOVICE + class);
case JOB_KNIGHT: // 557
case JOB_PRIEST: // 558
@@ -184,7 +186,7 @@ const char* inter_job_name(int class_)
case JOB_BLACKSMITH: // 560
case JOB_HUNTER: // 561
case JOB_ASSASSIN: // 562
- return inter->msg_txt(557 - JOB_KNIGHT+class_);
+ return inter->msg_txt(557 - JOB_KNIGHT + class);
case JOB_KNIGHT2:
return inter->msg_txt(557);
@@ -196,7 +198,7 @@ const char* inter_job_name(int class_)
case JOB_ALCHEMIST: // 567
case JOB_BARD: // 568
case JOB_DANCER: // 569
- return inter->msg_txt(563 - JOB_CRUSADER+class_);
+ return inter->msg_txt(563 - JOB_CRUSADER + class);
case JOB_CRUSADER2:
return inter->msg_txt(563);
@@ -206,7 +208,7 @@ const char* inter_job_name(int class_)
case JOB_GUNSLINGER: // 572
case JOB_NINJA: // 573
case JOB_XMAS: // 574
- return inter->msg_txt(570 - JOB_WEDDING+class_);
+ return inter->msg_txt(570 - JOB_WEDDING + class);
case JOB_SUMMER:
return inter->msg_txt(621);
@@ -218,7 +220,7 @@ const char* inter_job_name(int class_)
case JOB_ACOLYTE_HIGH: // 579
case JOB_MERCHANT_HIGH: // 580
case JOB_THIEF_HIGH: // 581
- return inter->msg_txt(575 - JOB_NOVICE_HIGH+class_);
+ return inter->msg_txt(575 - JOB_NOVICE_HIGH + class);
case JOB_LORD_KNIGHT: // 582
case JOB_HIGH_PRIEST: // 583
@@ -226,7 +228,7 @@ const char* inter_job_name(int class_)
case JOB_WHITESMITH: // 585
case JOB_SNIPER: // 586
case JOB_ASSASSIN_CROSS: // 587
- return inter->msg_txt(582 - JOB_LORD_KNIGHT+class_);
+ return inter->msg_txt(582 - JOB_LORD_KNIGHT + class);
case JOB_LORD_KNIGHT2:
return inter->msg_txt(582);
@@ -238,7 +240,7 @@ const char* inter_job_name(int class_)
case JOB_CREATOR: // 592
case JOB_CLOWN: // 593
case JOB_GYPSY: // 594
- return inter->msg_txt(588 - JOB_PALADIN + class_);
+ return inter->msg_txt(588 - JOB_PALADIN + class);
case JOB_PALADIN2:
return inter->msg_txt(588);
@@ -250,7 +252,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_ACOLYTE: // 599
case JOB_BABY_MERCHANT: // 600
case JOB_BABY_THIEF: // 601
- return inter->msg_txt(595 - JOB_BABY + class_);
+ return inter->msg_txt(595 - JOB_BABY + class);
case JOB_BABY_KNIGHT: // 602
case JOB_BABY_PRIEST: // 603
@@ -258,7 +260,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_BLACKSMITH: // 605
case JOB_BABY_HUNTER: // 606
case JOB_BABY_ASSASSIN: // 607
- return inter->msg_txt(602 - JOB_BABY_KNIGHT + class_);
+ return inter->msg_txt(602 - JOB_BABY_KNIGHT + class);
case JOB_BABY_KNIGHT2:
return inter->msg_txt(602);
@@ -270,7 +272,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_ALCHEMIST: // 612
case JOB_BABY_BARD: // 613
case JOB_BABY_DANCER: // 614
- return inter->msg_txt(608 - JOB_BABY_CRUSADER + class_);
+ return inter->msg_txt(608 - JOB_BABY_CRUSADER + class);
case JOB_BABY_CRUSADER2:
return inter->msg_txt(608);
@@ -289,7 +291,7 @@ const char* inter_job_name(int class_)
case JOB_GANGSI: // 622
case JOB_DEATH_KNIGHT: // 623
case JOB_DARK_COLLECTOR: // 624
- return inter->msg_txt(622 - JOB_GANGSI+class_);
+ return inter->msg_txt(622 - JOB_GANGSI + class);
case JOB_RUNE_KNIGHT: // 625
case JOB_WARLOCK: // 626
@@ -297,7 +299,7 @@ const char* inter_job_name(int class_)
case JOB_ARCH_BISHOP: // 628
case JOB_MECHANIC: // 629
case JOB_GUILLOTINE_CROSS: // 630
- return inter->msg_txt(625 - JOB_RUNE_KNIGHT+class_);
+ return inter->msg_txt(625 - JOB_RUNE_KNIGHT + class);
case JOB_RUNE_KNIGHT_T: // 656
case JOB_WARLOCK_T: // 657
@@ -305,7 +307,7 @@ const char* inter_job_name(int class_)
case JOB_ARCH_BISHOP_T: // 659
case JOB_MECHANIC_T: // 660
case JOB_GUILLOTINE_CROSS_T: // 661
- return inter->msg_txt(656 - JOB_RUNE_KNIGHT_T+class_);
+ return inter->msg_txt(656 - JOB_RUNE_KNIGHT_T + class);
case JOB_ROYAL_GUARD: // 631
case JOB_SORCERER: // 632
@@ -314,7 +316,7 @@ const char* inter_job_name(int class_)
case JOB_SURA: // 635
case JOB_GENETIC: // 636
case JOB_SHADOW_CHASER: // 637
- return inter->msg_txt(631 - JOB_ROYAL_GUARD+class_);
+ return inter->msg_txt(631 - JOB_ROYAL_GUARD + class);
case JOB_ROYAL_GUARD_T: // 662
case JOB_SORCERER_T: // 663
@@ -323,7 +325,7 @@ const char* inter_job_name(int class_)
case JOB_SURA_T: // 666
case JOB_GENETIC_T: // 667
case JOB_SHADOW_CHASER_T: // 668
- return inter->msg_txt(662 - JOB_ROYAL_GUARD_T+class_);
+ return inter->msg_txt(662 - JOB_ROYAL_GUARD_T + class);
case JOB_RUNE_KNIGHT2:
return inter->msg_txt(625);
@@ -362,7 +364,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_SURA: // 648
case JOB_BABY_GENETIC: // 649
case JOB_BABY_CHASER: // 650
- return inter->msg_txt(638 - JOB_BABY_RUNE+class_);
+ return inter->msg_txt(638 - JOB_BABY_RUNE + class);
case JOB_BABY_RUNE2:
return inter->msg_txt(638);
@@ -378,15 +380,18 @@ const char* inter_job_name(int class_)
case JOB_SUPER_NOVICE_E: // 651
case JOB_SUPER_BABY_E: // 652
- return inter->msg_txt(651 - JOB_SUPER_NOVICE_E+class_);
+ return inter->msg_txt(651 - JOB_SUPER_NOVICE_E + class);
case JOB_KAGEROU: // 653
case JOB_OBORO: // 654
- return inter->msg_txt(653 - JOB_KAGEROU+class_);
+ return inter->msg_txt(653 - JOB_KAGEROU + class);
case JOB_REBELLION:
return inter->msg_txt(655);
+ case JOB_SUMMONER:
+ return inter->msg_txt(669);
+
default:
return inter->msg_txt(620); // "Unknown Job"
}
@@ -413,7 +418,7 @@ void inter_vmsg_to_fd(int fd, int u_fd, int aid, char* msg, va_list ap)
WFIFOW(fd,2) = 12 + (unsigned short)len;
WFIFOL(fd,4) = u_fd;
WFIFOL(fd,8) = aid;
- safestrncpy((char*)WFIFOP(fd,12), msg_out, len);
+ safestrncpy(WFIFOP(fd,12), msg_out, len);
WFIFOSET(fd,12 + len);
@@ -446,7 +451,7 @@ void mapif_parse_accinfo(int fd)
int account_id;
char *data;
- safestrncpy(query, (char*) RFIFOP(fd,14), NAME_LENGTH);
+ safestrncpy(query, RFIFOP(fd,14), NAME_LENGTH);
SQL->EscapeString(inter->sql_handle, query_esq, query);
@@ -472,18 +477,18 @@ void mapif_parse_accinfo(int fd)
} else {// more than one, listing... [Dekamaster/Nightroad]
inter->msg_to_fd(fd, u_fd, aid, "Your query returned the following %d results, please be more specific...",(int)SQL->NumRows(inter->sql_handle));
while ( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) {
- int class_;
- short base_level, job_level, online;
+ int class;
+ int base_level, job_level, online;
char name[NAME_LENGTH];
SQL->GetData(inter->sql_handle, 0, &data, NULL); account_id = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); safestrncpy(name, data, sizeof(name));
- SQL->GetData(inter->sql_handle, 2, &data, NULL); class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 2, &data, NULL); class = atoi(data);
SQL->GetData(inter->sql_handle, 3, &data, NULL); base_level = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); job_level = atoi(data);
SQL->GetData(inter->sql_handle, 5, &data, NULL); online = atoi(data);
- inter->msg_to_fd(fd, u_fd, aid, "[AID: %d] %s | %s | Level: %d/%d | %s", account_id, name, inter->job_name(class_), base_level, job_level, online?"Online":"Offline");
+ inter->msg_to_fd(fd, u_fd, aid, "[AID: %d] %s | %s | Level: %d/%d | %s", account_id, name, inter->job_name(class), base_level, job_level, online?"Online":"Offline");
}
SQL->FreeResult(inter->sql_handle);
return;
@@ -544,19 +549,19 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc
} else {
while ( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) {
char *data;
- int char_id, class_;
- short char_num, base_level, job_level, online;
+ int char_id, class;
+ int char_num, base_level, job_level, online;
char name[NAME_LENGTH];
SQL->GetData(inter->sql_handle, 0, &data, NULL); char_id = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); safestrncpy(name, data, sizeof(name));
SQL->GetData(inter->sql_handle, 2, &data, NULL); char_num = atoi(data);
- SQL->GetData(inter->sql_handle, 3, &data, NULL); class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 3, &data, NULL); class = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); base_level = atoi(data);
SQL->GetData(inter->sql_handle, 5, &data, NULL); job_level = atoi(data);
SQL->GetData(inter->sql_handle, 6, &data, NULL); online = atoi(data);
- inter->msg_to_fd(map_fd, u_fd, u_aid, "[Slot/CID: %d/%d] %s | %s | Level: %d/%d | %s", char_num, char_id, name, inter->job_name(class_), base_level, job_level, online?"On":"Off");
+ inter->msg_to_fd(map_fd, u_fd, u_aid, "[Slot/CID: %d/%d] %s | %s | Level: %d/%d | %s", char_num, char_id, name, inter->job_name(class), base_level, job_level, online?"On":"Off");
}
}
SQL->FreeResult(inter->sql_handle);
@@ -571,6 +576,7 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc
**/
void inter_savereg(int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string)
{
+ char val_esq[1000];
nullpo_retv(key);
/* to login server we go! */
if( key[0] == '#' && key[1] == '#' ) {/* global account reg */
@@ -582,7 +588,8 @@ void inter_savereg(int account_id, int char_id, const char *key, unsigned int in
} else if ( key[0] == '#' ) {/* local account reg */
if( is_string ) {
if( val ) {
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%s')", acc_reg_str_db, account_id, key, index, (char*)val) )
+ SQL->EscapeString(inter->sql_handle, val_esq, (char*)val);
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%s')", acc_reg_str_db, account_id, key, index, val_esq) )
Sql_ShowDebug(inter->sql_handle);
} else {
if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `account_id` = '%d' AND `key` = '%s' AND `index` = '%u' LIMIT 1", acc_reg_str_db, account_id, key, index) )
@@ -600,7 +607,8 @@ void inter_savereg(int account_id, int char_id, const char *key, unsigned int in
} else { /* char reg */
if( is_string ) {
if( val ) {
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`char_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%s')", char_reg_str_db, char_id, key, index, (char*)val) )
+ SQL->EscapeString(inter->sql_handle, val_esq, (char*)val);
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`char_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%s')", char_reg_str_db, char_id, key, index, val_esq) )
Sql_ShowDebug(inter->sql_handle);
} else {
if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `char_id` = '%d' AND `key` = '%s' AND `index` = '%u' LIMIT 1", char_reg_str_db, char_id, key, index) )
@@ -665,7 +673,7 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type)
WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 32 */
plen += 1;
- safestrncpy((char*)WFIFOP(fd,plen), data, len);
+ safestrncpy(WFIFOP(fd,plen), data, len);
plen += len;
SQL->GetData(inter->sql_handle, 1, &data, NULL);
@@ -679,7 +687,7 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type)
WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 254 */
plen += 1;
- safestrncpy((char*)WFIFOP(fd,plen), data, len);
+ safestrncpy(WFIFOP(fd,plen), data, len);
plen += len;
WFIFOW(fd, 14) += 1;
@@ -746,7 +754,7 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type)
WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 32 */
plen += 1;
- safestrncpy((char*)WFIFOP(fd,plen), data, len);
+ safestrncpy(WFIFOP(fd,plen), data, len);
plen += len;
SQL->GetData(inter->sql_handle, 1, &data, NULL);
@@ -787,50 +795,114 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type)
return 1;
}
-/*==========================================
- * read config file
- *------------------------------------------*/
-static int inter_config_read(const char* cfgName)
+/**
+ * Reads the 'inter_configuration/log' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool inter_config_read_log(const char *filename, const struct config_t *config, bool imported)
{
- char line[1024], w1[1024], w2[1024];
- FILE* fp;
+ const struct config_setting_t *setting = NULL;
- nullpo_retr(1, cfgName);
- fp = fopen(cfgName, "r");
- if(fp == NULL) {
- ShowError("File not found: %s\n", cfgName);
- return 1;
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/log")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("sql_config_read: inter_configuration/log was not found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- int i = sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2);
- if(i != 2)
- continue;
+ libconfig->setting_lookup_bool_real(setting, "log_inter", &inter->enable_logs);
+
+ return true;
+}
+
+/**
+ * Reads the 'char_configuration/sql_connection' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool inter_config_read_connection(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
- if(!strcmpi(w1,"char_server_ip")) {
- safestrncpy(char_server_ip, w2, sizeof(char_server_ip));
- } else if(!strcmpi(w1,"char_server_port")) {
- char_server_port = atoi(w2);
- } else if(!strcmpi(w1,"char_server_id")) {
- safestrncpy(char_server_id, w2, sizeof(char_server_id));
- } else if(!strcmpi(w1,"char_server_pw")) {
- safestrncpy(char_server_pw, w2, sizeof(char_server_pw));
- } else if(!strcmpi(w1,"char_server_db")) {
- safestrncpy(char_server_db, w2, sizeof(char_server_db));
- } else if(!strcmpi(w1,"default_codepage")) {
- safestrncpy(default_codepage, w2, sizeof(default_codepage));
- } else if(!strcmpi(w1,"party_share_level"))
- party_share_level = atoi(w2);
- else if(!strcmpi(w1,"log_inter"))
- log_inter = atoi(w2);
- else if(!strcmpi(w1,"import"))
- inter->config_read(w2);
+ if ((setting = libconfig->lookup(config, "char_configuration/sql_connection")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/sql_connection was not found in %s!\n", filename);
+ ShowWarning("inter_config_read_connection: Defaulting sql_connection...\n");
+ return false;
}
- fclose(fp);
- ShowInfo ("Done reading %s.\n", cfgName);
+ libconfig->setting_lookup_int(setting, "db_port", &char_server_port);
+ libconfig->setting_lookup_mutable_string(setting, "db_hostname", char_server_ip, sizeof(char_server_ip));
+ libconfig->setting_lookup_mutable_string(setting, "db_username", char_server_id, sizeof(char_server_id));
+ libconfig->setting_lookup_mutable_string(setting, "db_password", char_server_pw, sizeof(char_server_pw));
+ libconfig->setting_lookup_mutable_string(setting, "db_database", char_server_db, sizeof(char_server_db));
+ libconfig->setting_lookup_mutable_string(setting, "default_codepage", default_codepage, sizeof(default_codepage));
- return 0;
+ return true;
+}
+
+/**
+ * Reads the 'inter_configuration' config file and initializes required variables.
+ *
+ * @param filename Path to configuration file
+ * @param imported Whether the current config is from an imported file.
+ *
+ * @retval false in case of error.
+ */
+bool inter_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ const struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("inter_config_read: inter_configuration was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_int(setting, "party_share_level", &party_share_level);
+
+ if (!inter->config_read_log(filename, &config, imported))
+ retval = false;
+
+ ShowInfo("Done reading %s.\n", filename);
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, chr->INTER_CONF_NAME) == 0) {
+ ShowWarning("inter_config_read: Loop detected in %s! Skipping 'import'...\n", filename);
+ } else {
+ if (!inter->config_read(import, true))
+ retval = false;
+ }
+ }
+
+ libconfig->destroy(&config);
+ return retval;
}
/**
@@ -875,9 +947,7 @@ int inter_log(char* fmt, ...)
// initialize
int inter_init_sql(const char *file)
{
- //int i;
-
- inter->config_read(file);
+ inter->config_read(file, false);
//DB connection initialized
inter->sql_handle = SQL->Malloc();
@@ -939,7 +1009,7 @@ int inter_mapif_init(int fd)
//--------------------------------------------------------
// broadcast sending
-int mapif_broadcast(unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd)
+int mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd)
{
unsigned char *buf = (unsigned char*)aMalloc((len)*sizeof(unsigned char));
@@ -967,8 +1037,8 @@ int mapif_wis_message(struct WisData *wd)
//if (wd->len > 2047-56) wd->len = 2047-56; //Force it to fit to avoid crashes. [Skotlex]
if (wd->len < 0)
wd->len = 0;
- if (wd->len >= sizeof(wd->msg) - 1)
- wd->len = sizeof(wd->msg) - 1;
+ if (wd->len >= (int)sizeof(wd->msg) - 1)
+ wd->len = (int)sizeof(wd->msg) - 1;
WBUFW(buf, 0) = 0x3801;
WBUFW(buf, 2) = 56 +wd->len;
@@ -981,7 +1051,7 @@ int mapif_wis_message(struct WisData *wd)
return 0;
}
-void mapif_wis_response(int fd, unsigned char *src, int flag)
+void mapif_wis_response(int fd, const unsigned char *src, int flag)
{
unsigned char buf[27];
nullpo_retv(src);
@@ -1037,7 +1107,7 @@ int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason)
* Existence check of WISP data
* @see DBApply
*/
-int inter_check_ttl_wisdata_sub(DBKey key, DBData *data, va_list ap)
+int inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap)
{
int64 tick;
struct WisData *wd = DB->data2ptr(data);
@@ -1084,7 +1154,6 @@ int mapif_parse_broadcast(int fd)
int mapif_parse_WisRequest(int fd)
{
struct WisData* wd;
- static int wisid = 0;
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1];// escaped name
char* data;
@@ -1101,7 +1170,7 @@ int mapif_parse_WisRequest(int fd)
return 0;
}
- safestrncpy(name, (char*)RFIFOP(fd,28), NAME_LENGTH); //Received name may be too large and not contain \0! [Skotlex]
+ safestrncpy(name, RFIFOP(fd,28), NAME_LENGTH); //Received name may be too large and not contain \0! [Skotlex]
SQL->EscapeStringLen(inter->sql_handle, esc_name, name, strnlen(name, NAME_LENGTH));
if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `name` FROM `%s` WHERE `name`='%s'", char_db, esc_name) )
@@ -1119,12 +1188,12 @@ int mapif_parse_WisRequest(int fd)
memset(name, 0, NAME_LENGTH);
memcpy(name, data, min(len, NAME_LENGTH));
// if source is destination, don't ask other servers.
- if( strncmp((const char*)RFIFOP(fd,4), name, NAME_LENGTH) == 0 )
- {
+ if (strncmp(RFIFOP(fd,4), name, NAME_LENGTH) == 0) {
mapif->wis_response(fd, RFIFOP(fd, 4), 1);
}
else
{
+ static int wisid = 0;
CREATE(wd, struct WisData, 1);
// Whether the failure of previous wisp/page transmission (timeout)
@@ -1172,7 +1241,7 @@ int mapif_parse_WisToGM(int fd)
{
unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
- memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2));
+ memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); // Message contains the NUL terminator (see intif_wis_message_to_gm())
WBUFW(buf, 0) = 0x3803;
mapif->sendall(buf, RFIFOW(fd,2));
@@ -1195,7 +1264,7 @@ int mapif_parse_Registry(int fd)
for(i = 0; i < count; i++) {
unsigned int index;
int len = RFIFOB(fd, cursor);
- safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
+ safestrncpy(key, RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
cursor += len + 1;
index = RFIFOL(fd, cursor);
@@ -1213,7 +1282,7 @@ int mapif_parse_Registry(int fd)
/* str */
case 2:
len = RFIFOB(fd, cursor);
- safestrncpy(sval, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len));
+ safestrncpy(sval, RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len));
cursor += len + 1;
inter->savereg(account_id,char_id,key,index,(intptr_t)sval,true);
break;
@@ -1261,13 +1330,13 @@ void mapif_namechange_ack(int fd, int account_id, int char_id, int type, int fla
int mapif_parse_NameChangeRequest(int fd)
{
int account_id, char_id, type;
- char* name;
+ const char *name;
int i;
account_id = RFIFOL(fd,2);
char_id = RFIFOL(fd,6);
type = RFIFOB(fd,10);
- name = (char*)RFIFOP(fd,11);
+ name = RFIFOP(fd,11);
// Check Authorized letters/symbols in the name
if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorized
@@ -1361,6 +1430,7 @@ void inter_defaults(void)
{
inter = &inter_s;
+ inter->enable_logs = true;
inter->sql_handle = NULL;
inter->msg_txt = inter_msg_txt;
@@ -1381,4 +1451,6 @@ void inter_defaults(void)
inter->check_length = inter_check_length;
inter->parse_frommap = inter_parse_frommap;
inter->final = inter_final;
+ inter->config_read_log = inter_config_read_log;
+ inter->config_read_connection = inter_config_read_connection;
}
diff --git a/src/char/inter.h b/src/char/inter.h
index 49eca1256..796f89a96 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,37 +23,43 @@
#include "common/hercules.h"
#include "common/db.h"
-#include "common/sql.h"
#include <stdarg.h>
+/* Forward Declarations */
+struct Sql; // common/sql.h
+struct config_t; // common/conf.h
+
/**
* inter interface
**/
struct inter_interface {
- Sql* sql_handle;
+ bool enable_logs; ///< Whether to log inter-server operations.
+ struct Sql *sql_handle;
const char* (*msg_txt) (int msg_number);
bool (*msg_config_read) (const char *cfg_name, bool allow_override);
void (*do_final_msg) (void);
- const char* (*job_name) (int class_);
+ const char* (*job_name) (int class);
void (*vmsg_to_fd) (int fd, int u_fd, int aid, char* msg, va_list ap);
- void (*msg_to_fd) (int fd, int u_fd, int aid, char *msg, ...);
+ void (*msg_to_fd) (int fd, int u_fd, int aid, char *msg, ...) __attribute__((format(printf, 4, 5)));
void (*savereg) (int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string);
int (*accreg_fromsql) (int account_id,int char_id, int fd, int type);
- int (*config_read) (const char* cfgName);
int (*vlog) (char* fmt, va_list ap);
int (*log) (char* fmt, ...);
int (*init_sql) (const char *file);
int (*mapif_init) (int fd);
- int (*check_ttl_wisdata_sub) (DBKey key, DBData *data, va_list ap);
+ int (*check_ttl_wisdata_sub) (union DBKey key, struct DBData *data, va_list ap);
int (*check_ttl_wisdata) (void);
int (*check_length) (int fd, int length);
int (*parse_frommap) (int fd);
void (*final) (void);
+ bool (*config_read) (const char *filename, bool imported);
+ bool (*config_read_log) (const char *filename, const struct config_t *config, bool imported);
+ bool (*config_read_connection) (const char *filename, const struct config_t *config, bool imported);
};
#ifdef HERCULES_CORE
-extern unsigned int party_share_level;
+extern int party_share_level; ///< Share range for parties.
void inter_defaults(void);
#endif // HERCULES_CORE
diff --git a/src/char/loginif.c b/src/char/loginif.c
index c577ad791..b0e18eb1f 100644
--- a/src/char/loginif.c
+++ b/src/char/loginif.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -39,6 +39,7 @@ struct loginif_interface loginif_s;
struct loginif_interface *loginif;
/// Resets all the data.
+void loginif_reset(void) __attribute__ ((noreturn));
void loginif_reset(void)
{
int id;
diff --git a/src/char/loginif.h b/src/char/loginif.h
index d1bfe5c3c..daafdf4ac 100644
--- a/src/char/loginif.h
+++ b/src/char/loginif.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/char/mapif.c b/src/char/mapif.c
index 5ba687a77..5fff96ba8 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -42,7 +42,7 @@ void mapif_server_reset(int id);
void mapif_on_disconnect(int id);
void mapif_on_parse_accinfo(int account_id, int u_fd, int u_aid, int u_group, int map_fd);
void mapif_char_ban(int char_id, time_t timestamp);
-int mapif_sendall(unsigned char *buf, unsigned int len);
+int mapif_sendall(const unsigned char *buf, unsigned int len);
int mapif_sendallwos(int sfd, unsigned char *buf, unsigned int len);
int mapif_send(int fd, unsigned char *buf, unsigned int len);
void mapif_send_users_count(int users);
@@ -57,16 +57,17 @@ void mapif_auction_close(int fd, int char_id, unsigned char result);
void mapif_parse_auction_close(int fd);
void mapif_auction_bid(int fd, int char_id, int bid, unsigned char result);
void mapif_parse_auction_bid(int fd);
-bool mapif_elemental_save(struct s_elemental* ele);
+bool mapif_elemental_create(struct s_elemental *ele);
+bool mapif_elemental_save(const struct s_elemental *ele);
bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele);
bool mapif_elemental_delete(int ele_id);
void mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag);
-void mapif_parse_elemental_create(int fd, struct s_elemental* ele);
+void mapif_parse_elemental_create(int fd, const struct s_elemental *ele);
void mapif_parse_elemental_load(int fd, int ele_id, int char_id);
void mapif_elemental_deleted(int fd, unsigned char flag);
void mapif_parse_elemental_delete(int fd, int ele_id);
void mapif_elemental_saved(int fd, unsigned char flag);
-void mapif_parse_elemental_save(int fd, struct s_elemental* ele);
+void mapif_parse_elemental_save(int fd, const struct s_elemental *ele);
int mapif_guild_created(int fd, int account_id, struct guild *g);
int mapif_guild_noinfo(int fd, int guild_id);
int mapif_guild_info(int fd, struct guild *g);
@@ -74,7 +75,7 @@ int mapif_guild_memberadded(int fd, int guild_id, int account_id, int char_id, i
int mapif_guild_withdraw(int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
int mapif_guild_memberinfoshort(struct guild *g, int idx);
int mapif_guild_broken(int guild_id, int flag);
-int mapif_guild_message(int guild_id,int account_id,char *mes,int len, int sfd);
+int mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd);
int mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int len);
int mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id, int type, const void *data, int len);
int mapif_guild_skillupack(int guild_id, uint16 skill_id, int account_id);
@@ -83,39 +84,40 @@ int mapif_guild_position(struct guild *g, int idx);
int mapif_guild_notice(struct guild *g);
int mapif_guild_emblem(struct guild *g);
int mapif_guild_master_changed(struct guild *g, int aid, int cid);
-int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids);
-int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member *master);
+int mapif_guild_castle_dataload(int fd, int sz, const int *castle_ids);
+int mapif_parse_CreateGuild(int fd, int account_id, const char *name, const struct guild_member *master);
int mapif_parse_GuildInfo(int fd, int guild_id);
-int mapif_parse_GuildAddMember(int fd, int guild_id, struct guild_member *m);
+int mapif_parse_GuildAddMember(int fd, int guild_id, const struct guild_member *m);
int mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char_id, int flag, const char *mes);
-int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int class_);
+int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
int mapif_parse_BreakGuild(int fd, int guild_id);
-int mapif_parse_GuildMessage(int fd, int guild_id, int account_id, char *mes, int len);
+int mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len);
int mapif_parse_GuildBasicInfoChange(int fd, int guild_id, int type, const void *data, int len);
int mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len);
-int mapif_parse_GuildPosition(int fd, int guild_id, int idx, struct guild_position *p);
+int mapif_parse_GuildPosition(int fd, int guild_id, int idx, const struct guild_position *p);
int mapif_parse_GuildSkillUp(int fd, int guild_id, uint16 skill_id, int account_id, int max);
int mapif_parse_GuildDeleteAlliance(struct guild *g, int guild_id, int account_id1, int account_id2, int flag);
int mapif_parse_GuildAlliance(int fd, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
int mapif_parse_GuildNotice(int fd, int guild_id, const char *mes1, const char *mes2);
int mapif_parse_GuildEmblem(int fd, int len, int guild_id, int dummy, const char *data);
-int mapif_parse_GuildCastleDataLoad(int fd, int len, int *castle_ids);
+int mapif_parse_GuildCastleDataLoad(int fd, int len, const int *castle_ids);
int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value);
int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int len);
-void mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh, unsigned char flag);
+void mapif_homunculus_created(int fd, int account_id, const struct s_homunculus *sh, unsigned char flag);
void mapif_homunculus_deleted(int fd, int flag);
void mapif_homunculus_loaded(int fd, int account_id, struct s_homunculus *hd);
void mapif_homunculus_saved(int fd, int account_id, bool flag);
-void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, char* name);
-bool mapif_homunculus_save(struct s_homunculus* hd);
+void mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, const char *name);
+bool mapif_homunculus_create(struct s_homunculus *hd);
+bool mapif_homunculus_save(const struct s_homunculus *hd);
bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd);
bool mapif_homunculus_delete(int homun_id);
-bool mapif_homunculus_rename(char *name);
-void mapif_parse_homunculus_create(int fd, int len, int account_id, struct s_homunculus* phd);
+bool mapif_homunculus_rename(const char *name);
+void mapif_parse_homunculus_create(int fd, int len, int account_id, const struct s_homunculus *phd);
void mapif_parse_homunculus_delete(int fd, int homun_id);
void mapif_parse_homunculus_load(int fd, int account_id, int homun_id);
-void mapif_parse_homunculus_save(int fd, int len, int account_id, struct s_homunculus* phd);
-void mapif_parse_homunculus_rename(int fd, int account_id, int char_id, char* name);
+void mapif_parse_homunculus_save(int fd, int len, int account_id, const struct s_homunculus *phd);
+void mapif_parse_homunculus_rename(int fd, int account_id, int char_id, const char *name);
void mapif_mail_sendinbox(int fd, int char_id, unsigned char flag, struct mail_data *md);
void mapif_parse_mail_requestinbox(int fd);
void mapif_parse_mail_read(int fd);
@@ -129,16 +131,17 @@ void mapif_mail_return(int fd, int char_id, int mail_id, int new_mail);
void mapif_parse_mail_return(int fd);
void mapif_mail_send(int fd, struct mail_message* msg);
void mapif_parse_mail_send(int fd);
-bool mapif_mercenary_save(struct s_mercenary* merc);
+bool mapif_mercenary_create(struct s_mercenary *merc);
+bool mapif_mercenary_save(const struct s_mercenary *merc);
bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc);
bool mapif_mercenary_delete(int merc_id);
void mapif_mercenary_send(int fd, struct s_mercenary *merc, unsigned char flag);
-void mapif_parse_mercenary_create(int fd, struct s_mercenary* merc);
+void mapif_parse_mercenary_create(int fd, const struct s_mercenary *merc);
void mapif_parse_mercenary_load(int fd, int merc_id, int char_id);
void mapif_mercenary_deleted(int fd, unsigned char flag);
void mapif_parse_mercenary_delete(int fd, int merc_id);
void mapif_mercenary_saved(int fd, unsigned char flag);
-void mapif_parse_mercenary_save(int fd, struct s_mercenary* merc);
+void mapif_parse_mercenary_save(int fd, const struct s_mercenary *merc);
int mapif_party_created(int fd, int account_id, int char_id, struct party *p);
void mapif_party_noinfo(int fd, int party_id, int char_id);
void mapif_party_info(int fd, struct party* p, int char_id);
@@ -147,15 +150,15 @@ int mapif_party_optionchanged(int fd, struct party *p, int account_id, int flag)
int mapif_party_withdraw(int party_id,int account_id, int char_id);
int mapif_party_membermoved(struct party *p, int idx);
int mapif_party_broken(int party_id, int flag);
-int mapif_party_message(int party_id, int account_id, char *mes, int len, int sfd);
-int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct party_member *leader);
+int mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd);
+int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader);
void mapif_parse_PartyInfo(int fd, int party_id, int char_id);
-int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member);
+int mapif_parse_PartyAddMember(int fd, int party_id, const struct party_member *member);
int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item);
int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id);
int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv);
int mapif_parse_BreakParty(int fd, int party_id);
-int mapif_parse_PartyMessage(int fd, int party_id, int account_id, char *mes, int len);
+int mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len);
int mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id);
int mapif_pet_created(int fd, int account_id, struct s_pet *p);
int mapif_pet_info(int fd, int account_id, struct s_pet *p);
@@ -163,9 +166,9 @@ int mapif_pet_noinfo(int fd, int account_id);
int mapif_save_pet_ack(int fd, int account_id, int flag);
int mapif_delete_pet_ack(int fd, int flag);
int mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id,
- short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name);
+ short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name);
int mapif_load_pet(int fd, int account_id, int char_id, int pet_id);
-int mapif_save_pet(int fd, int account_id, struct s_pet *data);
+int mapif_save_pet(int fd, int account_id, const struct s_pet *data);
int mapif_delete_pet(int fd, int pet_id);
int mapif_parse_CreatePet(int fd);
int mapif_parse_LoadPet(int fd);
@@ -183,15 +186,19 @@ int mapif_load_guild_storage(int fd,int account_id,int guild_id, char flag);
int mapif_save_guild_storage_ack(int fd, int account_id, int guild_id, int fail);
int mapif_parse_LoadGuildStorage(int fd);
int mapif_parse_SaveGuildStorage(int fd);
+int mapif_account_storage_load(int fd, int account_id);
+int mapif_parse_AccountStorageLoad(int fd);
+int mapif_parse_AccountStorageSave(int fd);
+void mapif_send_AccountStorageSaveAck(int fd, int account_id, bool save);
int mapif_itembound_ack(int fd, int aid, int guild_id);
int mapif_parse_ItemBoundRetrieve_sub(int fd);
void mapif_parse_ItemBoundRetrieve(int fd);
void mapif_parse_accinfo(int fd);
void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass,
const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state);
-int mapif_broadcast(unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd);
+int mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd);
int mapif_wis_message(struct WisData *wd);
-void mapif_wis_response(int fd, unsigned char *src, int flag);
+void mapif_wis_response(int fd, const unsigned char *src, int flag);
int mapif_wis_end(struct WisData *wd, int flag);
int mapif_account_reg_reply(int fd,int account_id,int char_id, int type);
int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason);
@@ -232,6 +239,7 @@ void mapif_defaults(void) {
mapif->parse_auction_close = mapif_parse_auction_close;
mapif->auction_bid = mapif_auction_bid;
mapif->parse_auction_bid = mapif_parse_auction_bid;
+ mapif->elemental_create = mapif_elemental_create;
mapif->elemental_save = mapif_elemental_save;
mapif->elemental_load = mapif_elemental_load;
mapif->elemental_delete = mapif_elemental_delete;
@@ -282,6 +290,7 @@ void mapif_defaults(void) {
mapif->homunculus_loaded = mapif_homunculus_loaded;
mapif->homunculus_saved = mapif_homunculus_saved;
mapif->homunculus_renamed = mapif_homunculus_renamed;
+ mapif->homunculus_create = mapif_homunculus_create;
mapif->homunculus_save = mapif_homunculus_save;
mapif->homunculus_load = mapif_homunculus_load;
mapif->homunculus_delete = mapif_homunculus_delete;
@@ -304,6 +313,7 @@ void mapif_defaults(void) {
mapif->parse_mail_return = mapif_parse_mail_return;
mapif->mail_send = mapif_mail_send;
mapif->parse_mail_send = mapif_parse_mail_send;
+ mapif->mercenary_create = mapif_mercenary_create;
mapif->mercenary_save = mapif_mercenary_save;
mapif->mercenary_load = mapif_mercenary_load;
mapif->mercenary_delete = mapif_mercenary_delete;
@@ -357,6 +367,10 @@ void mapif_defaults(void) {
mapif->save_guild_storage_ack = mapif_save_guild_storage_ack;
mapif->parse_LoadGuildStorage = mapif_parse_LoadGuildStorage;
mapif->parse_SaveGuildStorage = mapif_parse_SaveGuildStorage;
+ mapif->pAccountStorageLoad = mapif_parse_AccountStorageLoad;
+ mapif->pAccountStorageSave = mapif_parse_AccountStorageSave;
+ mapif->sAccountStorageSaveAck = mapif_send_AccountStorageSaveAck;
+ mapif->account_storage_load = mapif_account_storage_load;
mapif->itembound_ack = mapif_itembound_ack;
mapif->parse_ItemBoundRetrieve_sub = mapif_parse_ItemBoundRetrieve_sub;
mapif->parse_ItemBoundRetrieve = mapif_parse_ItemBoundRetrieve;
diff --git a/src/char/mapif.h b/src/char/mapif.h
index eb5d30b2c..07fbed6c6 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 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
@@ -36,7 +36,7 @@ struct mapif_interface {
void (*on_disconnect) (int id);
void (*on_parse_accinfo) (int account_id, int u_fd, int u_aid, int u_group, int map_fd);
void (*char_ban) (int char_id, time_t timestamp);
- int (*sendall) (unsigned char *buf, unsigned int len);
+ int (*sendall) (const unsigned char *buf, unsigned int len);
int (*sendallwos) (int sfd, unsigned char *buf, unsigned int len);
int (*send) (int fd, unsigned char *buf, unsigned int len);
void (*send_users_count) (int users);
@@ -51,16 +51,17 @@ struct mapif_interface {
void (*parse_auction_close) (int fd);
void (*auction_bid) (int fd, int char_id, int bid, unsigned char result);
void (*parse_auction_bid) (int fd);
- bool (*elemental_save) (struct s_elemental* ele);
+ bool (*elemental_create) (struct s_elemental *ele);
+ bool (*elemental_save) (const struct s_elemental *ele);
bool (*elemental_load) (int ele_id, int char_id, struct s_elemental *ele);
bool (*elemental_delete) (int ele_id);
void (*elemental_send) (int fd, struct s_elemental *ele, unsigned char flag);
- void (*parse_elemental_create) (int fd, struct s_elemental* ele);
+ void (*parse_elemental_create) (int fd, const struct s_elemental *ele);
void (*parse_elemental_load) (int fd, int ele_id, int char_id);
void (*elemental_deleted) (int fd, unsigned char flag);
void (*parse_elemental_delete) (int fd, int ele_id);
void (*elemental_saved) (int fd, unsigned char flag);
- void (*parse_elemental_save) (int fd, struct s_elemental* ele);
+ void (*parse_elemental_save) (int fd, const struct s_elemental *ele);
int (*guild_created) (int fd, int account_id, struct guild *g);
int (*guild_noinfo) (int fd, int guild_id);
int (*guild_info) (int fd, struct guild *g);
@@ -68,7 +69,7 @@ struct mapif_interface {
int (*guild_withdraw) (int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
int (*guild_memberinfoshort) (struct guild *g, int idx);
int (*guild_broken) (int guild_id, int flag);
- int (*guild_message) (int guild_id,int account_id,char *mes,int len, int sfd);
+ int (*guild_message) (int guild_id, int account_id, const char *mes, int len, int sfd);
int (*guild_basicinfochanged) (int guild_id, int type, const void *data, int len);
int (*guild_memberinfochanged) (int guild_id, int account_id, int char_id, int type, const void *data, int len);
int (*guild_skillupack) (int guild_id, uint16 skill_id, int account_id);
@@ -77,39 +78,40 @@ struct mapif_interface {
int (*guild_notice) (struct guild *g);
int (*guild_emblem) (struct guild *g);
int (*guild_master_changed) (struct guild *g, int aid, int cid);
- int (*guild_castle_dataload) (int fd, int sz, int *castle_ids);
- int (*parse_CreateGuild) (int fd,int account_id,char *name,struct guild_member *master);
+ int (*guild_castle_dataload) (int fd, int sz, const int *castle_ids);
+ int (*parse_CreateGuild) (int fd, int account_id, const char *name, const struct guild_member *master);
int (*parse_GuildInfo) (int fd, int guild_id);
- int (*parse_GuildAddMember) (int fd, int guild_id, struct guild_member *m);
+ int (*parse_GuildAddMember) (int fd, int guild_id, const struct guild_member *m);
int (*parse_GuildLeave) (int fd, int guild_id, int account_id, int char_id, int flag, const char *mes);
- int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int class_);
+ int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
int (*parse_BreakGuild) (int fd, int guild_id);
- int (*parse_GuildMessage) (int fd, int guild_id, int account_id, char *mes, int len);
+ int (*parse_GuildMessage) (int fd, int guild_id, int account_id, const char *mes, int len);
int (*parse_GuildBasicInfoChange) (int fd, int guild_id, int type, const void *data, int len);
int (*parse_GuildMemberInfoChange) (int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len);
- int (*parse_GuildPosition) (int fd, int guild_id, int idx, struct guild_position *p);
+ int (*parse_GuildPosition) (int fd, int guild_id, int idx, const struct guild_position *p);
int (*parse_GuildSkillUp) (int fd, int guild_id, uint16 skill_id, int account_id, int max);
int (*parse_GuildDeleteAlliance) (struct guild *g, int guild_id, int account_id1, int account_id2, int flag);
int (*parse_GuildAlliance) (int fd, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
int (*parse_GuildNotice) (int fd, int guild_id, const char *mes1, const char *mes2);
int (*parse_GuildEmblem) (int fd, int len, int guild_id, int dummy, const char *data);
- int (*parse_GuildCastleDataLoad) (int fd, int len, int *castle_ids);
+ int (*parse_GuildCastleDataLoad) (int fd, int len, const int *castle_ids);
int (*parse_GuildCastleDataSave) (int fd, int castle_id, int index, int value);
int (*parse_GuildMasterChange) (int fd, int guild_id, const char* name, int len);
- void (*homunculus_created) (int fd, int account_id, struct s_homunculus *sh, unsigned char flag);
+ void (*homunculus_created) (int fd, int account_id, const struct s_homunculus *sh, unsigned char flag);
void (*homunculus_deleted) (int fd, int flag);
void (*homunculus_loaded) (int fd, int account_id, struct s_homunculus *hd);
void (*homunculus_saved) (int fd, int account_id, bool flag);
- void (*homunculus_renamed) (int fd, int account_id, int char_id, unsigned char flag, char* name);
- bool (*homunculus_save) (struct s_homunculus* hd);
+ void (*homunculus_renamed) (int fd, int account_id, int char_id, unsigned char flag, const char *name);
+ bool (*homunculus_create) (struct s_homunculus *hd);
+ bool (*homunculus_save) (const struct s_homunculus *hd);
bool (*homunculus_load) (int homun_id, struct s_homunculus* hd);
bool (*homunculus_delete) (int homun_id);
- bool (*homunculus_rename) (char *name);
- void (*parse_homunculus_create) (int fd, int len, int account_id, struct s_homunculus* phd);
+ bool (*homunculus_rename) (const char *name);
+ void (*parse_homunculus_create) (int fd, int len, int account_id, const struct s_homunculus *phd);
void (*parse_homunculus_delete) (int fd, int homun_id);
void (*parse_homunculus_load) (int fd, int account_id, int homun_id);
- void (*parse_homunculus_save) (int fd, int len, int account_id, struct s_homunculus* phd);
- void (*parse_homunculus_rename) (int fd, int account_id, int char_id, char* name);
+ void (*parse_homunculus_save) (int fd, int len, int account_id, const struct s_homunculus *phd);
+ void (*parse_homunculus_rename) (int fd, int account_id, int char_id, const char *name);
void (*mail_sendinbox) (int fd, int char_id, unsigned char flag, struct mail_data *md);
void (*parse_mail_requestinbox) (int fd);
void (*parse_mail_read) (int fd);
@@ -123,16 +125,17 @@ struct mapif_interface {
void (*parse_mail_return) (int fd);
void (*mail_send) (int fd, struct mail_message* msg);
void (*parse_mail_send) (int fd);
- bool (*mercenary_save) (struct s_mercenary* merc);
+ bool (*mercenary_create) (struct s_mercenary *merc);
+ bool (*mercenary_save) (const struct s_mercenary *merc);
bool (*mercenary_load) (int merc_id, int char_id, struct s_mercenary *merc);
bool (*mercenary_delete) (int merc_id);
void (*mercenary_send) (int fd, struct s_mercenary *merc, unsigned char flag);
- void (*parse_mercenary_create) (int fd, struct s_mercenary* merc);
+ void (*parse_mercenary_create) (int fd, const struct s_mercenary *merc);
void (*parse_mercenary_load) (int fd, int merc_id, int char_id);
void (*mercenary_deleted) (int fd, unsigned char flag);
void (*parse_mercenary_delete) (int fd, int merc_id);
void (*mercenary_saved) (int fd, unsigned char flag);
- void (*parse_mercenary_save) (int fd, struct s_mercenary* merc);
+ void (*parse_mercenary_save) (int fd, const struct s_mercenary *merc);
int (*party_created) (int fd, int account_id, int char_id, struct party *p);
void (*party_noinfo) (int fd, int party_id, int char_id);
void (*party_info) (int fd, struct party* p, int char_id);
@@ -141,15 +144,15 @@ struct mapif_interface {
int (*party_withdraw) (int party_id,int account_id, int char_id);
int (*party_membermoved) (struct party *p, int idx);
int (*party_broken) (int party_id, int flag);
- int (*party_message) (int party_id, int account_id, char *mes, int len, int sfd);
- int (*parse_CreateParty) (int fd, char *name, int item, int item2, struct party_member *leader);
+ int (*party_message) (int party_id, int account_id, const char *mes, int len, int sfd);
+ int (*parse_CreateParty) (int fd, const char *name, int item, int item2, const struct party_member *leader);
void (*parse_PartyInfo) (int fd, int party_id, int char_id);
- int (*parse_PartyAddMember) (int fd, int party_id, struct party_member *member);
+ int (*parse_PartyAddMember) (int fd, int party_id, const struct party_member *member);
int (*parse_PartyChangeOption) (int fd,int party_id,int account_id,int exp,int item);
int (*parse_PartyLeave) (int fd, int party_id, int account_id, int char_id);
int (*parse_PartyChangeMap) (int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv);
int (*parse_BreakParty) (int fd, int party_id);
- int (*parse_PartyMessage) (int fd, int party_id, int account_id, char *mes, int len);
+ int (*parse_PartyMessage) (int fd, int party_id, int account_id, const char *mes, int len);
int (*parse_PartyLeaderChange) (int fd, int party_id, int account_id, int char_id);
int (*pet_created) (int fd, int account_id, struct s_pet *p);
int (*pet_info) (int fd, int account_id, struct s_pet *p);
@@ -157,9 +160,9 @@ struct mapif_interface {
int (*save_pet_ack) (int fd, int account_id, int flag);
int (*delete_pet_ack) (int fd, int flag);
int (*create_pet) (int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id,
- short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name);
+ short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name);
int (*load_pet) (int fd, int account_id, int char_id, int pet_id);
- int (*save_pet) (int fd, int account_id, struct s_pet *data);
+ int (*save_pet) (int fd, int account_id, const struct s_pet *data);
int (*delete_pet) (int fd, int pet_id);
int (*parse_CreatePet) (int fd);
int (*parse_LoadPet) (int fd);
@@ -177,15 +180,19 @@ struct mapif_interface {
int (*save_guild_storage_ack) (int fd, int account_id, int guild_id, int fail);
int (*parse_LoadGuildStorage) (int fd);
int (*parse_SaveGuildStorage) (int fd);
+ int (*account_storage_load) (int fd, int account_id);
+ int (*pAccountStorageLoad) (int fd);
+ int (*pAccountStorageSave) (int fd);
+ void (*sAccountStorageSaveAck) (int fd, int account_id, bool save);
int (*itembound_ack) (int fd, int aid, int guild_id);
int (*parse_ItemBoundRetrieve_sub) (int fd);
void (*parse_ItemBoundRetrieve) (int fd);
void (*parse_accinfo) (int fd);
void (*parse_accinfo2) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass,
const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state);
- int (*broadcast) (unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd);
+ int (*broadcast) (const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd);
int (*wis_message) (struct WisData *wd);
- void (*wis_response) (int fd, unsigned char *src, int flag);
+ void (*wis_response) (int fd, const unsigned char *src, int flag);
int (*wis_end) (struct WisData *wd, int flag);
int (*account_reg_reply) (int fd,int account_id,int char_id, int type);
int (*disconnectplayer) (int fd, int account_id, int char_id, int reason);
diff --git a/src/char/pincode.c b/src/char/pincode.c
index af79d6f11..fc1a4c037 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -24,6 +24,7 @@
#include "char/char.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/db.h"
#include "common/mmo.h"
#include "common/nullpo.h"
@@ -32,6 +33,7 @@
#include "common/socket.h"
#include "common/strlib.h"
+#include <stdio.h>
#include <stdlib.h>
struct pincode_interface pincode_s;
@@ -66,7 +68,7 @@ void pincode_check(int fd, struct char_session_data* sd) {
char pin[5] = "\0\0\0\0";
nullpo_retv(sd);
- safestrncpy(pin, (char*)RFIFOP(fd, 6), sizeof(pin));
+ safestrncpy(pin, RFIFOP(fd, 6), sizeof(pin));
pincode->decrypt(sd->pincode_seed, pin);
if( pincode->compare( fd, sd, pin ) ){
struct online_char_data* character;
@@ -95,12 +97,12 @@ void pincode_change(int fd, struct char_session_data* sd) {
char oldpin[5] = "\0\0\0\0", newpin[5] = "\0\0\0\0";
nullpo_retv(sd);
- safestrncpy(oldpin, (char*)RFIFOP(fd,6), sizeof(oldpin));
+ safestrncpy(oldpin, RFIFOP(fd,6), sizeof(oldpin));
pincode->decrypt(sd->pincode_seed,oldpin);
if( !pincode->compare( fd, sd, oldpin ) )
return;
- safestrncpy(newpin, (char*)RFIFOP(fd,10), sizeof(newpin));
+ safestrncpy(newpin, RFIFOP(fd,10), sizeof(newpin));
pincode->decrypt(sd->pincode_seed,newpin);
pincode->update( sd->account_id, newpin );
safestrncpy(sd->pincode, newpin, sizeof(sd->pincode));
@@ -111,7 +113,7 @@ void pincode_setnew(int fd, struct char_session_data* sd) {
char newpin[5] = "\0\0\0\0";
nullpo_retv(sd);
- safestrncpy(newpin, (char*)RFIFOP(fd,6), sizeof(newpin));
+ safestrncpy(newpin, RFIFOP(fd,6), sizeof(newpin));
pincode->decrypt(sd->pincode_seed,newpin);
pincode->update( sd->account_id, newpin );
safestrncpy(sd->pincode, newpin, sizeof(sd->pincode));
@@ -143,7 +145,7 @@ void pincode_notifyLoginPinUpdate(int account_id, char* pin) {
WFIFOHEAD(chr->login_fd,11);
WFIFOW(chr->login_fd,0) = 0x2738;
WFIFOL(chr->login_fd,2) = account_id;
- safestrncpy( (char*)WFIFOP(chr->login_fd,6), pin, 5 );
+ safestrncpy(WFIFOP(chr->login_fd,6), pin, 5);
WFIFOSET(chr->login_fd,11);
}
@@ -177,33 +179,52 @@ void pincode_decrypt(unsigned int userSeed, char* pin) {
sprintf(pin, "%d%d%d%d", pin[0], pin[1], pin[2], pin[3]);
}
-bool pincode_config_read(char *w1, char *w2) {
+/**
+ * Reads the 'char_configuration/pincode' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool pincode_config_read(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "char_configuration/pincode")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("char_config_read: char_configuration/pincode was not found in %s!\n", filename);
+ return false;
+ }
- nullpo_ret(w1);
- nullpo_ret(w2);
- while ( true ) {
- if ( strcmpi(w1, "pincode_enabled") == 0 ) {
- pincode->enabled = atoi(w2);
+ if (libconfig->setting_lookup_bool(setting, "enabled", &pincode->enabled) == CONFIG_TRUE) {
#if PACKETVER < 20110309
- if( pincode->enabled ) {
- ShowWarning("pincode_enabled requires PACKETVER 20110309 or higher. disabling...\n");
- pincode->enabled = 0;
- }
+ if (pincode->enabled) {
+ ShowWarning("pincode_enabled requires PACKETVER 20110309 or higher. disabling...\n");
+ pincode->enabled = 0;
+ }
#endif
- } else if ( strcmpi(w1, "pincode_changetime") == 0 ) {
- pincode->changetime = atoi(w2)*60;
- } else if ( strcmpi(w1, "pincode_maxtry") == 0 ) {
- pincode->maxtry = atoi(w2);
- if( pincode->maxtry > 3 ) {
- ShowWarning("pincode_maxtry is too high (%d); maximum allowed: 3! capping to 3...\n", pincode->maxtry);
- pincode->maxtry = 3;
- }
- } else if ( strcmpi(w1, "pincode_charselect") == 0 ) {
- pincode->charselect = atoi(w2);
- } else {
- return false;
+ }
+
+ if (libconfig->setting_lookup_int(setting, "change_time", &pincode->changetime) == CONFIG_TRUE)
+ pincode->changetime *= 60;
+
+ if (libconfig->setting_lookup_int(setting, "max_tries", &pincode->maxtry) == CONFIG_TRUE) {
+ if (pincode->maxtry > 3) {
+ ShowWarning("pincode_maxtry is too high (%d); Maximum allowed: 3! Capping to 3...\n",pincode->maxtry);
+ pincode->maxtry = 3;
+ }
+ }
+
+ if (libconfig->setting_lookup_int(setting, "request", &pincode->charselect) == CONFIG_TRUE) {
+ if (pincode->charselect != 1 && pincode->charselect != 0) {
+ ShowWarning("Invalid pincode/request! Defaulting to 0\n");
+ pincode->charselect = 0;
}
- break;
}
return true;
diff --git a/src/char/pincode.h b/src/char/pincode.h
index fb0c1a9c4..cffaa3054 100644
--- a/src/char/pincode.h
+++ b/src/char/pincode.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,9 @@
#include "common/hercules.h"
+/* Forward Declarations */
struct char_session_data;
+struct config_t; // common/conf.h
enum PincodeResponseCode {
PINCODE_OK = 0,
@@ -55,7 +57,7 @@ struct pincode_interface {
void (*change) (int fd, struct char_session_data* sd);
int (*compare) (int fd, struct char_session_data* sd, char* pin);
void (*check) (int fd, struct char_session_data* sd);
- bool (*config_read) (char *w1, char *w2);
+ bool (*config_read) (const char *filename, const struct config_t *config, bool imported);
};
#ifdef HERCULES_CORE
diff --git a/src/common/HPM.c b/src/common/HPM.c
index d9c3262d7..c84b447e8 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.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-2016 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
@@ -38,6 +38,7 @@
#include "common/timer.h"
#include "common/utils.h"
#include "common/nullpo.h"
+#include "plugins/HPMHooking.h"
#include <stdio.h>
#include <stdlib.h>
@@ -51,11 +52,12 @@ struct malloc_interface iMalloc_HPM;
struct malloc_interface *HPMiMalloc;
struct HPM_interface HPM_s;
struct HPM_interface *HPM;
+struct HPMHooking_core_interface HPMHooking_core_s;
/**
* (char*) data name -> (unsigned int) HPMDataCheck[] index
**/
-DBMap *datacheck_db;
+struct DBMap *datacheck_db;
int datacheck_version;
const struct s_HPMDataCheck *datacheck_data;
@@ -101,6 +103,7 @@ void hplugin_export_symbol(void *value, const char *name)
void *hplugin_import_symbol(char *name, unsigned int pID)
{
int i;
+ nullpo_retr(NULL, name);
ARR_FIND(0, VECTOR_LENGTH(HPM->symbols), i, strcmp(VECTOR_INDEX(HPM->symbols, i)->name, name) == 0);
if (i != VECTOR_LENGTH(HPM->symbols))
@@ -131,6 +134,7 @@ bool hplugin_iscompatible(char* version) {
bool hplugin_exists(const char *filename)
{
int i;
+ nullpo_retr(false, filename);
for (i = 0; i < VECTOR_LENGTH(HPM->plugins); i++) {
if (strcmpi(VECTOR_INDEX(HPM->plugins, i)->filename,filename) == 0)
return true;
@@ -214,11 +218,11 @@ bool hplugin_data_store_validate(enum HPluginDataTypes type, struct hplugin_data
break;
default:
if (HPM->data_store_validate_sub == NULL) {
- ShowError("HPM:validateHPData failed, type %d needs sub-handler!\n",type);
+ ShowError("HPM:validateHPData failed, type %u needs sub-handler!\n", type);
return false;
}
if (!HPM->data_store_validate_sub(type, storeptr, initialize)) {
- ShowError("HPM:HPM:validateHPData failed, unknown type %d!\n",type);
+ ShowError("HPM:HPM:validateHPData failed, unknown type %u!\n", type);
return false;
}
break;
@@ -228,7 +232,7 @@ bool hplugin_data_store_validate(enum HPluginDataTypes type, struct hplugin_data
store = *storeptr;
}
if (store->type != type) {
- ShowError("HPM:HPM:validateHPData failed, store type mismatch %d != %d.\n",store->type, type);
+ ShowError("HPM:HPM:validateHPData failed, store type mismatch %u != %u.\n", store->type, type);
return false;
}
return true;
@@ -253,10 +257,11 @@ void hplugins_addToHPData(enum HPluginDataTypes type, uint32 pluginID, struct hp
if (!HPM->data_store_validate(type, storeptr, true)) {
/* woo it failed! */
- ShowError("HPM:addToHPData:%s: failed, type %d (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid);
+ ShowError("HPM:addToHPData:%s: failed, type %u (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid);
return;
}
store = *storeptr;
+ nullpo_retv(store);
/* duplicate check */
ARR_FIND(0, VECTOR_LENGTH(store->entries), i, VECTOR_INDEX(store->entries, i)->pluginID == pluginID && VECTOR_INDEX(store->entries, i)->classid == classid);
@@ -294,7 +299,7 @@ void *hplugins_getFromHPData(enum HPluginDataTypes type, uint32 pluginID, struct
if (!HPM->data_store_validate(type, &store, false)) {
/* woo it failed! */
- ShowError("HPM:getFromHPData:%s: failed, type %d (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid);
+ ShowError("HPM:getFromHPData:%s: failed, type %u (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid);
return NULL;
}
if (!store)
@@ -322,7 +327,7 @@ void hplugins_removeFromHPData(enum HPluginDataTypes type, uint32 pluginID, stru
if (!HPM->data_store_validate(type, &store, false)) {
/* woo it failed! */
- ShowError("HPM:removeFromHPData:%s: failed, type %d (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid);
+ ShowError("HPM:removeFromHPData:%s: failed, type %u (%u|%u)\n", HPM->pid2name(pluginID), type, pluginID, classid);
return;
}
if (!store)
@@ -341,13 +346,13 @@ void hplugins_removeFromHPData(enum HPluginDataTypes type, uint32 pluginID, stru
/* TODO: add ability for tracking using pID for the upcoming runtime load/unload support. */
bool HPM_AddHook(enum HPluginHookType type, const char *target, void *hook, unsigned int pID)
{
- if (!HPM->hooking) {
+ if (!HPM->hooking->enabled) {
ShowError("HPM:AddHook Fail! '%s' tried to hook to '%s' but HPMHooking is disabled!\n",HPM->pid2name(pID),target);
return false;
}
/* search if target is a known hook point within 'common' */
/* if not check if a sub-hooking list is available (from the server) and run it by */
- if (HPM->addhook_sub && HPM->addhook_sub(type,target,hook,pID))
+ if (HPM->hooking->addhook_sub != NULL && HPM->hooking->addhook_sub(type,target,hook,pID))
return true;
ShowError("HPM:AddHook: unknown Hooking Point '%s'!\n",target);
@@ -358,12 +363,12 @@ bool HPM_AddHook(enum HPluginHookType type, const char *target, void *hook, unsi
void HPM_HookStop(const char *func, unsigned int pID)
{
/* track? */
- HPM->force_return = true;
+ HPM->hooking->force_return = true;
}
-bool HPM_HookStopped (void)
+bool HPM_HookStopped(void)
{
- return HPM->force_return;
+ return HPM->hooking->force_return;
}
/**
@@ -387,12 +392,12 @@ bool hpm_add_arg(unsigned int pluginID, char *name, bool has_param, CmdlineExecF
ARR_FIND(0, VECTOR_LENGTH(cmdline->args_data), i, strcmp(VECTOR_INDEX(cmdline->args_data, i).name, name) == 0);
- if (i != VECTOR_LENGTH(cmdline->args_data)) {
- ShowError("HPM:add_arg:%s duplicate! (from %s)\n",name,HPM->pid2name(pluginID));
- return false;
- }
+ if (i != VECTOR_LENGTH(cmdline->args_data)) {
+ ShowError("HPM:add_arg:%s duplicate! (from %s)\n",name,HPM->pid2name(pluginID));
+ return false;
+ }
- return cmdline->arg_add(pluginID, name, '\0', func, help, has_param ? CMDLINE_OPT_PARAM : CMDLINE_OPT_NORMAL);
+ return cmdline->arg_add(pluginID, name, '\0', func, help, has_param ? CMDLINE_OPT_PARAM : CMDLINE_OPT_NORMAL);
}
/**
@@ -405,7 +410,7 @@ bool hpm_add_arg(unsigned int pluginID, char *name, bool has_param, CmdlineExecF
* @retval true if the listener was added successfully.
* @retval false in case of error.
*/
-bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key))
+bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key), bool required)
{
struct HPConfListenStorage *conf;
int i;
@@ -440,11 +445,13 @@ bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *na
safestrncpy(conf->key, name, HPM_ADDCONF_LENGTH);
conf->parse_func = parse_func;
conf->return_func = return_func;
+ conf->required = required;
return true;
}
-struct hplugin *hplugin_load(const char* filename) {
+struct hplugin *hplugin_load(const char* filename)
+{
struct hplugin *plugin;
struct hplugin_info *info;
struct HPMi_interface **HPMi;
@@ -560,6 +567,7 @@ struct hplugin *hplugin_load(const char* filename) {
/* id */
plugin->hpi->pid = plugin->idx;
/* core */
+ plugin->hpi->memmgr = HPMiMalloc;
#ifdef CONSOLE_INPUT
plugin->hpi->addCPCommand = console->input->addCommand;
#endif // CONSOLE_INPUT
@@ -567,16 +575,20 @@ struct hplugin *hplugin_load(const char* filename) {
plugin->hpi->addToHPData = hplugins_addToHPData;
plugin->hpi->getFromHPData = hplugins_getFromHPData;
plugin->hpi->removeFromHPData = hplugins_removeFromHPData;
- plugin->hpi->AddHook = HPM_AddHook;
- plugin->hpi->HookStop = HPM_HookStop;
- plugin->hpi->HookStopped = HPM_HookStopped;
plugin->hpi->addArg = hpm_add_arg;
plugin->hpi->addConf = hplugins_addconf;
+ if ((plugin->hpi->hooking = plugin_import(plugin->dll, "HPMHooking_s", struct HPMHooking_interface *)) != NULL) {
+ plugin->hpi->hooking->AddHook = HPM_AddHook;
+ plugin->hpi->hooking->HookStop = HPM_HookStop;
+ plugin->hpi->hooking->HookStopped = HPM_HookStopped;
+ }
/* server specific */
if( HPM->load_sub )
HPM->load_sub(plugin);
- ShowStatus("HPM: Loaded plugin '"CL_WHITE"%s"CL_RESET"' (%s).\n", plugin->info->name, plugin->info->version);
+ ShowStatus("HPM: Loaded plugin '"CL_WHITE"%s"CL_RESET"' (%s)%s.\n",
+ plugin->info->name, plugin->info->version,
+ plugin->hpi->hooking != NULL ? " built with HPMHooking support" : "");
return plugin;
}
@@ -589,6 +601,7 @@ struct hplugin *hplugin_load(const char* filename) {
void hplugin_unload(struct hplugin* plugin)
{
int i;
+ nullpo_retv(plugin);
if (plugin->filename)
aFree(plugin->filename);
if (plugin->dll)
@@ -615,9 +628,10 @@ CMDLINEARG(loadplugin)
/**
* Reads the plugin configuration and loads the plugins as necessary.
*/
-void hplugins_config_read(void) {
- config_t plugins_conf;
- config_setting_t *plist = NULL;
+void hplugins_config_read(void)
+{
+ struct config_t plugins_conf;
+ struct config_setting_t *plist = NULL;
const char *config_filename = "conf/plugins.conf"; // FIXME hardcoded name
FILE *fp;
int i;
@@ -628,12 +642,12 @@ void hplugins_config_read(void) {
fclose(fp);
}
- if (libconfig->read_file(&plugins_conf, config_filename))
+ if (!libconfig->load_file(&plugins_conf, config_filename))
return;
plist = libconfig->lookup(&plugins_conf, "plugins_list");
for (i = 0; i < VECTOR_LENGTH(HPM->cmdline_load_plugins); i++) {
- config_setting_t *entry = libconfig->setting_add(plist, NULL, CONFIG_TYPE_STRING);
+ struct config_setting_t *entry = libconfig->setting_add(plist, NULL, CONFIG_TYPE_STRING);
config_setting_set_string(entry, VECTOR_INDEX(HPM->cmdline_load_plugins, i));
}
@@ -660,12 +674,13 @@ void hplugins_config_read(void) {
bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
if ((func = plugin_import(plugin->dll, "Hooked",const char * (*)(bool *))) != NULL
&& (addhook_sub = plugin_import(plugin->dll, "HPM_Plugin_AddHook",bool (*)(enum HPluginHookType, const char *, void *, unsigned int))) != NULL) {
- const char *failed = func(&HPM->force_return);
+ const char *failed = func(&HPM->hooking->force_return);
if (failed) {
ShowError("HPM: failed to retrieve '%s' for '"CL_WHITE"%s"CL_RESET"'!\n", failed, plugin_name);
} else {
- HPM->hooking = true;
- HPM->addhook_sub = addhook_sub;
+ HPM->hooking->enabled = true;
+ HPM->hooking->addhook_sub = addhook_sub;
+ HPM->hooking->Hooked = func; // The purpose of this is type-checking 'func' at compile time.
}
}
}
@@ -780,6 +795,7 @@ const char *HPM_file2ptr(const char *file)
{
int i;
+ nullpo_retr(NULL, file);
ARR_FIND(0, HPM->filenames.count, i, HPM->filenames.data[i].addr == file);
if (i != HPM->filenames.count) {
return HPM->filenames.data[i].name;
@@ -793,19 +809,29 @@ const char *HPM_file2ptr(const char *file)
return HPM->filenames.data[i].name;
}
-void* HPM_mmalloc(size_t size, const char *file, int line, const char *func) {
+
+void* HPM_mmalloc(size_t size, const char *file, int line, const char *func)
+{
return iMalloc->malloc(size,HPM_file2ptr(file),line,func);
}
-void* HPM_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
+
+void* HPM_calloc(size_t num, size_t size, const char *file, int line, const char *func)
+{
return iMalloc->calloc(num,size,HPM_file2ptr(file),line,func);
}
-void* HPM_realloc(void *p, size_t size, const char *file, int line, const char *func) {
+
+void* HPM_realloc(void *p, size_t size, const char *file, int line, const char *func)
+{
return iMalloc->realloc(p,size,HPM_file2ptr(file),line,func);
}
-void* HPM_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
+
+void* HPM_reallocz(void *p, size_t size, const char *file, int line, const char *func)
+{
return iMalloc->reallocz(p,size,HPM_file2ptr(file),line,func);
}
-char* HPM_astrdup(const char *p, const char *file, int line, const char *func) {
+
+char* HPM_astrdup(const char *p, const char *file, int line, const char *func)
+{
return iMalloc->astrdup(p,HPM_file2ptr(file),line,func);
}
@@ -818,7 +844,7 @@ char* HPM_astrdup(const char *p, const char *file, int line, const char *func) {
* @retval true if a registered plugin was found to handle the entry.
* @retval false if no registered plugins could be found.
*/
-bool hplugins_parse_conf(const char *w1, const char *w2, enum HPluginConfType point)
+bool hplugins_parse_conf_entry(const char *w1, const char *w2, enum HPluginConfType point)
{
int i;
ARR_FIND(0, VECTOR_LENGTH(HPM->config_listeners[point]), i, strcmpi(w1, VECTOR_INDEX(HPM->config_listeners[point], i).key) == 0);
@@ -841,6 +867,7 @@ bool hplugins_get_battle_conf(const char *w1, int *value)
{
int i;
+ nullpo_retr(false, w1);
nullpo_retr(false, value);
ARR_FIND(0, VECTOR_LENGTH(HPM->config_listeners[HPCT_BATTLE]), i, strcmpi(w1, VECTOR_INDEX(HPM->config_listeners[HPCT_BATTLE], i).key) == 0);
@@ -852,6 +879,106 @@ bool hplugins_get_battle_conf(const char *w1, int *value)
}
/**
+ * Parses configuration entries registered by plugins.
+ *
+ * @param config The configuration file to parse.
+ * @param filename Path to configuration file.
+ * @param point The type of configuration file.
+ * @param imported Whether the current config is imported from another file.
+ * @retval false in case of error.
+ */
+bool hplugins_parse_conf(const struct config_t *config, const char *filename, enum HPluginConfType point, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+ int i, val, type;
+ char buf[1024];
+ bool retval = true;
+
+ nullpo_retr(false, config);
+
+ for (i = 0; i < VECTOR_LENGTH(HPM->config_listeners[point]); i++) {
+ const struct HPConfListenStorage *entry = &VECTOR_INDEX(HPM->config_listeners[point], i);
+ const char *config_name = entry->key;
+ const char *str = NULL;
+ if ((setting = libconfig->lookup(config, config_name)) == NULL) {
+ if (!imported && entry->required) {
+ ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename);
+ retval = false;
+ }
+ continue;
+ }
+
+ switch ((type = config_setting_type(setting))) {
+ case CONFIG_TYPE_INT:
+ val = libconfig->setting_get_int(setting);
+ sprintf(buf, "%d", val); // FIXME: Remove this when support to int's as value is added
+ str = buf;
+ break;
+ case CONFIG_TYPE_BOOL:
+ val = libconfig->setting_get_bool(setting);
+ sprintf(buf, "%d", val); // FIXME: Remove this when support to int's as value is added
+ str = buf;
+ break;
+ case CONFIG_TYPE_STRING:
+ str = libconfig->setting_get_string(setting);
+ break;
+ default: // Unsupported type
+ ShowWarning("Setting %s has unsupported type %d, ignoring...\n", config_name, type);
+ retval = false;
+ continue;
+ }
+ entry->parse_func(config_name, str);
+ }
+ return retval;
+}
+
+/**
+ * parses battle config entries registered by plugins.
+ *
+ * @param config the configuration file to parse.
+ * @param filename path to configuration file.
+ * @param imported whether the current config is imported from another file.
+ * @retval false in case of error.
+ */
+bool hplugins_parse_battle_conf(const struct config_t *config, const char *filename, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+ int i, val, type;
+ char str[1024];
+ bool retval = true;
+
+ nullpo_retr(false, config);
+
+ for (i = 0; i < VECTOR_LENGTH(HPM->config_listeners[HPCT_BATTLE]); i++) {
+ const struct HPConfListenStorage *entry = &VECTOR_INDEX(HPM->config_listeners[HPCT_BATTLE], i);
+ const char *config_name = entry->key;
+ if ((setting = libconfig->lookup(config, config_name)) == NULL) {
+ if (!imported && entry->required) {
+ ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename);
+ retval = false;
+ }
+ continue;
+ }
+
+ switch ((type = config_setting_type(setting))) {
+ case CONFIG_TYPE_INT:
+ val = libconfig->setting_get_int(setting);
+ break;
+ case CONFIG_TYPE_BOOL:
+ val = libconfig->setting_get_bool(setting);
+ break;
+ default: // Unsupported type
+ ShowWarning("Setting %s has unsupported type %d, ignoring...\n", config_name, type);
+ retval = false;
+ continue;
+ }
+ sprintf(str, "%d", val); // FIXME: Remove this when support to int's as value is added
+ entry->parse_func(config_name, str);
+ }
+ return retval;
+}
+
+/**
* Helper to destroy an interface's hplugin_data store and release any owned memory.
*
* The pointer will be cleared.
@@ -904,9 +1031,11 @@ void hplugin_data_store_create(struct hplugin_data_store **storeptr, enum HPlugi
/**
* Called by HPM->DataCheck on a plugins incoming data, ensures data structs in use are matching!
**/
-bool HPM_DataCheck(struct s_HPMDataCheck *src, unsigned int size, int version, char *name) {
+bool HPM_DataCheck(struct s_HPMDataCheck *src, unsigned int size, int version, char *name)
+{
unsigned int i, j;
+ nullpo_retr(false, src);
if (version != datacheck_version) {
ShowError("HPMDataCheck:%s: DataCheck API version mismatch %d != %d\n", name, datacheck_version, version);
return false;
@@ -931,7 +1060,8 @@ bool HPM_DataCheck(struct s_HPMDataCheck *src, unsigned int size, int version, c
return true;
}
-void HPM_datacheck_init(const struct s_HPMDataCheck *src, unsigned int length, int version) {
+void HPM_datacheck_init(const struct s_HPMDataCheck *src, unsigned int length, int version)
+{
unsigned int i;
datacheck_version = version;
@@ -947,11 +1077,13 @@ void HPM_datacheck_init(const struct s_HPMDataCheck *src, unsigned int length, i
}
}
-void HPM_datacheck_final(void) {
+void HPM_datacheck_final(void)
+{
db_destroy(datacheck_db);
}
-void hpm_init(void) {
+void hpm_init(void)
+{
int i;
datacheck_db = NULL;
datacheck_data = NULL;
@@ -962,8 +1094,8 @@ void hpm_init(void) {
HPM->off = false;
- memcpy(&iMalloc_HPM, iMalloc, sizeof(struct malloc_interface));
HPMiMalloc = &iMalloc_HPM;
+ *HPMiMalloc = *iMalloc;
HPMiMalloc->malloc = HPM_mmalloc;
HPMiMalloc->calloc = HPM_calloc;
HPMiMalloc->realloc = HPM_realloc;
@@ -1043,14 +1175,14 @@ void hpm_final(void)
return;
}
+
void hpm_defaults(void)
{
HPM = &HPM_s;
+ HPM->hooking = &HPMHooking_core_s;
memset(&HPM->filenames, 0, sizeof(HPM->filenames));
VECTOR_INIT(HPM->cmdline_load_plugins);
- HPM->force_return = false;
- HPM->hooking = false;
/* */
HPM->init = hpm_init;
HPM->final = hpm_final;
@@ -1067,8 +1199,9 @@ void hpm_defaults(void)
HPM->pid2name = hplugins_id2name;
HPM->parse_packets = hplugins_parse_packets;
HPM->load_sub = NULL;
- HPM->addhook_sub = NULL;
- HPM->parseConf = hplugins_parse_conf;
+ HPM->parse_conf_entry = hplugins_parse_conf_entry;
+ HPM->parse_conf = hplugins_parse_conf;
+ HPM->parse_battle_conf = hplugins_parse_battle_conf;
HPM->getBattleConf = hplugins_get_battle_conf;
HPM->DataCheck = HPM_DataCheck;
HPM->datacheck_init = HPM_datacheck_init;
@@ -1078,4 +1211,9 @@ void hpm_defaults(void)
HPM->data_store_create = hplugin_data_store_create;
HPM->data_store_validate = hplugin_data_store_validate;
HPM->data_store_validate_sub = NULL;
+
+ HPM->hooking->enabled = false;
+ HPM->hooking->force_return = false;
+ HPM->hooking->addhook_sub = NULL;
+ HPM->hooking->Hooked = NULL;
}
diff --git a/src/common/HPM.h b/src/common/HPM.h
index 109549aad..e55397022 100644
--- a/src/common/HPM.h
+++ b/src/common/HPM.h
@@ -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-2016 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
@@ -65,6 +65,10 @@
#endif // WIN32
+/* Forward Declarations */
+struct HPMHooking_core_interface;
+struct config_t;
+
struct hplugin {
DLL dll;
unsigned int idx;
@@ -119,6 +123,7 @@ struct HPConfListenStorage {
char key[HPM_ADDCONF_LENGTH];
void (*parse_func) (const char *key, const char *val);
int (*return_func) (const char *key);
+ bool required;
};
/* Hercules Plugin Manager Interface */
@@ -126,9 +131,6 @@ struct HPM_interface {
/* vars */
unsigned int version[2];
bool off;
- bool hooking;
- /* hooking */
- bool force_return;
/* data */
VECTOR_DECL(struct hplugin *) plugins;
VECTOR_DECL(struct hpm_symbol *) symbols;
@@ -156,12 +158,13 @@ struct HPM_interface {
void *(*import_symbol) (char *name, unsigned int pID);
void (*share) (void *value, const char *name);
void (*config_read) (void);
+ bool (*parse_battle_conf) (const struct config_t *config, const char *filename, bool imported);
char *(*pid2name) (unsigned int pid);
unsigned char (*parse_packets) (int fd, int packet_id, enum HPluginPacketHookingPoints point);
void (*load_sub) (struct hplugin *plugin);
- bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
/* for custom config parsing */
- bool (*parseConf) (const char *w1, const char *w2, enum HPluginConfType point);
+ bool (*parse_conf) (const struct config_t *config, const char *filename, enum HPluginConfType point, bool imported);
+ bool (*parse_conf_entry) (const char *w1, const char *w2, enum HPluginConfType point);
bool (*getBattleConf) (const char* w1, int *value);
/* validates plugin data */
bool (*DataCheck) (struct s_HPMDataCheck *src, unsigned int size, int version, char *name);
@@ -173,6 +176,9 @@ struct HPM_interface {
bool (*data_store_validate) (enum HPluginDataTypes type, struct hplugin_data_store **storeptr, bool initialize);
/* for server-specific HPData e.g. map_session_data */
bool (*data_store_validate_sub) (enum HPluginDataTypes type, struct hplugin_data_store **storeptr, bool initialize);
+
+ /* hooking */
+ struct HPMHooking_core_interface *hooking;
};
CMDLINEARG(loadplugin);
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 666d306db..2a1c092b7 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2014-2016 Hercules Dev Team
+ * Copyright (C) 2014-2017 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
@@ -23,6 +23,8 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
#ifndef HPM_DATA_CHECK_H
#define HPM_DATA_CHECK_H
@@ -148,7 +150,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#define COMMON_DB_H
#endif // COMMON_DB_H
#ifdef COMMON_DES_H
- { "BIT64", sizeof(struct BIT64), SERVER_TYPE_ALL },
+ { "des_bit64", sizeof(struct des_bit64), SERVER_TYPE_ALL },
+ { "des_interface", sizeof(struct des_interface), SERVER_TYPE_ALL },
#else
#define COMMON_DES_H
#endif // COMMON_DES_H
@@ -157,6 +160,11 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#else
#define COMMON_ERS_H
#endif // COMMON_ERS_H
+ #ifdef COMMON_GRFIO_H
+ { "grfio_interface", sizeof(struct grfio_interface), SERVER_TYPE_MAP },
+ #else
+ #define COMMON_GRFIO_H
+ #endif // COMMON_GRFIO_H
#ifdef COMMON_HPMI_H
{ "HPMi_interface", sizeof(struct HPMi_interface), SERVER_TYPE_ALL },
{ "hplugin_info", sizeof(struct hplugin_info), SERVER_TYPE_ALL },
@@ -169,6 +177,11 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#else
#define COMMON_MAPINDEX_H
#endif // COMMON_MAPINDEX_H
+ #ifdef COMMON_MD5CALC_H
+ { "md5_interface", sizeof(struct md5_interface), SERVER_TYPE_ALL },
+ #else
+ #define COMMON_MD5CALC_H
+ #endif // COMMON_MD5CALC_H
#ifdef COMMON_MEMMGR_H
{ "malloc_interface", sizeof(struct malloc_interface), SERVER_TYPE_ALL },
#else
@@ -208,11 +221,21 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#else
#define COMMON_MMO_H
#endif // COMMON_MMO_H
+ #ifdef COMMON_MUTEX_H
+ { "mutex_interface", sizeof(struct mutex_interface), SERVER_TYPE_ALL },
+ #else
+ #define COMMON_MUTEX_H
+ #endif // COMMON_MUTEX_H
#ifdef COMMON_NULLPO_H
{ "nullpo_interface", sizeof(struct nullpo_interface), SERVER_TYPE_ALL },
#else
#define COMMON_NULLPO_H
#endif // COMMON_NULLPO_H
+ #ifdef COMMON_RANDOM_H
+ { "rnd_interface", sizeof(struct rnd_interface), SERVER_TYPE_ALL },
+ #else
+ #define COMMON_RANDOM_H
+ #endif // COMMON_RANDOM_H
#ifdef COMMON_SHOWMSG_H
{ "showmsg_interface", sizeof(struct showmsg_interface), SERVER_TYPE_ALL },
#else
@@ -228,7 +251,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#define COMMON_SOCKET_H
#endif // COMMON_SOCKET_H
#ifdef COMMON_SPINLOCK_H
- { "SPIN_LOCK", sizeof(struct SPIN_LOCK), SERVER_TYPE_ALL },
+ { "spin_lock", sizeof(struct spin_lock), SERVER_TYPE_ALL },
#else
#define COMMON_SPINLOCK_H
#endif // COMMON_SPINLOCK_H
@@ -251,6 +274,11 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#else
#define COMMON_SYSINFO_H
#endif // COMMON_SYSINFO_H
+ #ifdef COMMON_THREAD_H
+ { "thread_interface", sizeof(struct thread_interface), SERVER_TYPE_ALL },
+ #else
+ #define COMMON_THREAD_H
+ #endif // COMMON_THREAD_H
#ifdef COMMON_TIMER_H
{ "TimerData", sizeof(struct TimerData), SERVER_TYPE_ALL },
{ "timer_interface", sizeof(struct timer_interface), SERVER_TYPE_ALL },
@@ -270,6 +298,32 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#else
#define LOGIN_ACCOUNT_H
#endif // LOGIN_ACCOUNT_H
+ #ifdef LOGIN_LCLIF_H
+ { "lclif_interface", sizeof(struct lclif_interface), SERVER_TYPE_LOGIN },
+ { "login_packet_db", sizeof(struct login_packet_db), SERVER_TYPE_LOGIN },
+ #else
+ #define LOGIN_LCLIF_H
+ #endif // LOGIN_LCLIF_H
+ #ifdef LOGIN_LCLIF_P_H
+ { "lclif_interface_dbs", sizeof(struct lclif_interface_dbs), SERVER_TYPE_LOGIN },
+ { "lclif_interface_private", sizeof(struct lclif_interface_private), SERVER_TYPE_LOGIN },
+ { "packet_AC_ACCEPT_LOGIN", sizeof(struct packet_AC_ACCEPT_LOGIN), SERVER_TYPE_LOGIN },
+ { "packet_AC_REFUSE_LOGIN", sizeof(struct packet_AC_REFUSE_LOGIN), SERVER_TYPE_LOGIN },
+ { "packet_AC_REFUSE_LOGIN_R2", sizeof(struct packet_AC_REFUSE_LOGIN_R2), SERVER_TYPE_LOGIN },
+ { "packet_CA_CHARSERVERCONNECT", sizeof(struct packet_CA_CHARSERVERCONNECT), SERVER_TYPE_LOGIN },
+ { "packet_CA_CONNECT_INFO_CHANGED", sizeof(struct packet_CA_CONNECT_INFO_CHANGED), SERVER_TYPE_LOGIN },
+ { "packet_CA_EXE_HASHCHECK", sizeof(struct packet_CA_EXE_HASHCHECK), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN", sizeof(struct packet_CA_LOGIN), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN2", sizeof(struct packet_CA_LOGIN2), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN3", sizeof(struct packet_CA_LOGIN3), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN4", sizeof(struct packet_CA_LOGIN4), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN_HAN", sizeof(struct packet_CA_LOGIN_HAN), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN_PCBANG", sizeof(struct packet_CA_LOGIN_PCBANG), SERVER_TYPE_LOGIN },
+ { "packet_CA_SSO_LOGIN_REQ", sizeof(struct packet_CA_SSO_LOGIN_REQ), SERVER_TYPE_LOGIN },
+ { "packet_SC_NOTIFY_BAN", sizeof(struct packet_SC_NOTIFY_BAN), SERVER_TYPE_LOGIN },
+ #else
+ #define LOGIN_LCLIF_P_H
+ #endif // LOGIN_LCLIF_P_H
#ifdef LOGIN_LOGIN_H
{ "Login_Config", sizeof(struct Login_Config), SERVER_TYPE_LOGIN },
{ "client_hash_node", sizeof(struct client_hash_node), SERVER_TYPE_LOGIN },
@@ -388,6 +442,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#ifdef MAP_IRC_BOT_H
{ "irc_bot_interface", sizeof(struct irc_bot_interface), SERVER_TYPE_MAP },
{ "irc_func", sizeof(struct irc_func), SERVER_TYPE_MAP },
+ { "message_flood", sizeof(struct message_flood), SERVER_TYPE_MAP },
#else
#define MAP_IRC_BOT_H
#endif // MAP_IRC_BOT_H
@@ -397,11 +452,14 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "item_combo", sizeof(struct item_combo), SERVER_TYPE_MAP },
{ "item_data", sizeof(struct item_data), SERVER_TYPE_MAP },
{ "item_group", sizeof(struct item_group), SERVER_TYPE_MAP },
+ { "item_option", sizeof(struct item_option), SERVER_TYPE_MAP },
{ "item_package", sizeof(struct item_package), SERVER_TYPE_MAP },
{ "item_package_must_entry", sizeof(struct item_package_must_entry), SERVER_TYPE_MAP },
{ "item_package_rand_entry", sizeof(struct item_package_rand_entry), SERVER_TYPE_MAP },
{ "item_package_rand_group", sizeof(struct item_package_rand_group), SERVER_TYPE_MAP },
{ "itemdb_interface", sizeof(struct itemdb_interface), SERVER_TYPE_MAP },
+ { "itemlist", sizeof(struct itemlist), SERVER_TYPE_MAP },
+ { "itemlist_entry", sizeof(struct itemlist_entry), SERVER_TYPE_MAP },
#else
#define MAP_ITEMDB_H
#endif // MAP_ITEMDB_H
@@ -485,8 +543,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#ifdef MAP_PACKETS_STRUCT_H
{ "EQUIPITEM_INFO", sizeof(struct EQUIPITEM_INFO), SERVER_TYPE_MAP },
{ "EQUIPSLOTINFO", sizeof(struct EQUIPSLOTINFO), SERVER_TYPE_MAP },
+ { "ItemOptions", sizeof(struct ItemOptions), SERVER_TYPE_MAP },
{ "NORMALITEM_INFO", sizeof(struct NORMALITEM_INFO), SERVER_TYPE_MAP },
- { "RndOptions", sizeof(struct RndOptions), SERVER_TYPE_MAP },
{ "packet_additem", sizeof(struct packet_additem), SERVER_TYPE_MAP },
{ "packet_authok", sizeof(struct packet_authok), SERVER_TYPE_MAP },
{ "packet_banking_check", sizeof(struct packet_banking_check), SERVER_TYPE_MAP },
@@ -504,6 +562,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_bgqueue_revoke_req", sizeof(struct packet_bgqueue_revoke_req), SERVER_TYPE_MAP },
{ "packet_bgqueue_update_info", sizeof(struct packet_bgqueue_update_info), SERVER_TYPE_MAP },
{ "packet_cart_additem_ack", sizeof(struct packet_cart_additem_ack), SERVER_TYPE_MAP },
+ { "packet_chat_message", sizeof(struct packet_chat_message), SERVER_TYPE_MAP },
{ "packet_damage", sizeof(struct packet_damage), SERVER_TYPE_MAP },
{ "packet_dropflooritem", sizeof(struct packet_dropflooritem), SERVER_TYPE_MAP },
{ "packet_equip_item", sizeof(struct packet_equip_item), SERVER_TYPE_MAP },
@@ -546,6 +605,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_unequipitem_ack", sizeof(struct packet_unequipitem_ack), SERVER_TYPE_MAP },
{ "packet_unit_walking", sizeof(struct packet_unit_walking), SERVER_TYPE_MAP },
{ "packet_viewequip_ack", sizeof(struct packet_viewequip_ack), SERVER_TYPE_MAP },
+ { "packet_whisper_message", sizeof(struct packet_whisper_message), SERVER_TYPE_MAP },
{ "packet_wis_end", sizeof(struct packet_wis_end), SERVER_TYPE_MAP },
#else
#define MAP_PACKETS_STRUCT_H
@@ -617,6 +677,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "casecheck_data", sizeof(struct casecheck_data), SERVER_TYPE_MAP },
{ "reg_db", sizeof(struct reg_db), SERVER_TYPE_MAP },
{ "script_array", sizeof(struct script_array), SERVER_TYPE_MAP },
+ { "script_buf", sizeof(struct script_buf), SERVER_TYPE_MAP },
{ "script_code", sizeof(struct script_code), SERVER_TYPE_MAP },
{ "script_data", sizeof(struct script_data), SERVER_TYPE_MAP },
{ "script_function", sizeof(struct script_function), SERVER_TYPE_MAP },
@@ -631,6 +692,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "script_syntax_data", sizeof(struct script_syntax_data), SERVER_TYPE_MAP },
{ "str_data_struct", sizeof(struct str_data_struct), SERVER_TYPE_MAP },
{ "string_translation", sizeof(struct string_translation), SERVER_TYPE_MAP },
+ { "string_translation_entry", sizeof(struct string_translation_entry), SERVER_TYPE_MAP },
#else
#define MAP_SCRIPT_H
#endif // MAP_SCRIPT_H
diff --git a/src/common/HPMSymbols.inc.h b/src/common/HPMSymbols.inc.h
index b06c43bf8..30ec45405 100644
--- a/src/common/HPMSymbols.inc.h
+++ b/src/common/HPMSymbols.inc.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2015-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,6 +23,8 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
#if !defined(HERCULES_CORE)
#ifdef COMMON_UTILS_H /* HCache */
struct HCache_interface *HCache;
@@ -66,6 +68,9 @@ struct core_interface *core;
#ifdef COMMON_DB_H /* DB */
struct db_interface *DB;
#endif // COMMON_DB_H
+#ifdef COMMON_DES_H /* des */
+struct des_interface *des;
+#endif // COMMON_DES_H
#ifdef MAP_DUEL_H /* duel */
struct duel_interface *duel;
#endif // MAP_DUEL_H
@@ -75,6 +80,9 @@ struct elemental_interface *elemental;
#ifdef CHAR_GEOIP_H /* geoip */
struct geoip_interface *geoip;
#endif // CHAR_GEOIP_H
+#ifdef COMMON_GRFIO_H /* grfio */
+struct grfio_interface *grfio;
+#endif // COMMON_GRFIO_H
#ifdef MAP_GUILD_H /* guild */
struct guild_interface *guild;
#endif // MAP_GUILD_H
@@ -129,6 +137,9 @@ struct irc_bot_interface *ircbot;
#ifdef MAP_ITEMDB_H /* itemdb */
struct itemdb_interface *itemdb;
#endif // MAP_ITEMDB_H
+#ifdef LOGIN_LCLIF_H /* lclif */
+struct lclif_interface *lclif;
+#endif // LOGIN_LCLIF_H
#ifdef COMMON_CONF_H /* libconfig */
struct libconfig_interface *libconfig;
#endif // COMMON_CONF_H
@@ -144,9 +155,6 @@ struct loginif_interface *loginif;
#ifdef MAP_MAIL_H /* mail */
struct mail_interface *mail;
#endif // MAP_MAIL_H
-#ifdef COMMON_MEMMGR_H /* iMalloc */
-struct malloc_interface *iMalloc;
-#endif // COMMON_MEMMGR_H
#ifdef MAP_MAP_H /* map */
struct map_interface *map;
#endif // MAP_MAP_H
@@ -162,12 +170,18 @@ struct mapit_interface *mapit;
#ifdef MAP_MAPREG_H /* mapreg */
struct mapreg_interface *mapreg;
#endif // MAP_MAPREG_H
+#ifdef COMMON_MD5CALC_H /* md5 */
+struct md5_interface *md5;
+#endif // COMMON_MD5CALC_H
#ifdef MAP_MERCENARY_H /* mercenary */
struct mercenary_interface *mercenary;
#endif // MAP_MERCENARY_H
#ifdef MAP_MOB_H /* mob */
struct mob_interface *mob;
#endif // MAP_MOB_H
+#ifdef COMMON_MUTEX_H /* mutex */
+struct mutex_interface *mutex;
+#endif // COMMON_MUTEX_H
#ifdef MAP_NPC_H /* npc_chat */
struct npc_chat_interface *npc_chat;
#endif // MAP_NPC_H
@@ -201,6 +215,9 @@ struct pincode_interface *pincode;
#ifdef MAP_QUEST_H /* quest */
struct quest_interface *quest;
#endif // MAP_QUEST_H
+#ifdef COMMON_RANDOM_H /* rnd */
+struct rnd_interface *rnd;
+#endif // COMMON_RANDOM_H
#ifdef MAP_SCRIPT_H /* script */
struct script_interface *script;
#endif // MAP_SCRIPT_H
@@ -237,6 +254,9 @@ struct sv_interface *sv;
#ifdef COMMON_SYSINFO_H /* sysinfo */
struct sysinfo_interface *sysinfo;
#endif // COMMON_SYSINFO_H
+#ifdef COMMON_THREAD_H /* thread */
+struct thread_interface *thread;
+#endif // COMMON_THREAD_H
#ifdef COMMON_TIMER_H /* timer */
struct timer_interface *timer;
#endif // COMMON_TIMER_H
@@ -254,229 +274,328 @@ struct vending_interface *vending;
HPExport const char *HPM_shared_symbols(int server_type)
{
#ifdef COMMON_UTILS_H /* HCache */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("HCache", HCache)) return "HCache";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("HCache", HCache))
+ return "HCache";
#endif // COMMON_UTILS_H
#ifdef MAP_ATCOMMAND_H /* atcommand */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("atcommand", atcommand)) return "atcommand";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("atcommand", atcommand))
+ return "atcommand";
#endif // MAP_ATCOMMAND_H
#ifdef MAP_BATTLE_H /* battle */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("battle", battle)) return "battle";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("battle", battle))
+ return "battle";
#endif // MAP_BATTLE_H
#ifdef MAP_BATTLEGROUND_H /* bg */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("battlegrounds", bg)) return "battlegrounds";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("battlegrounds", bg))
+ return "battlegrounds";
#endif // MAP_BATTLEGROUND_H
#ifdef MAP_BUYINGSTORE_H /* buyingstore */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("buyingstore", buyingstore)) return "buyingstore";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("buyingstore", buyingstore))
+ return "buyingstore";
#endif // MAP_BUYINGSTORE_H
#ifdef MAP_CHANNEL_H /* channel */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("channel", channel)) return "channel";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("channel", channel))
+ return "channel";
#endif // MAP_CHANNEL_H
#ifdef CHAR_CHAR_H /* chr */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("chr", chr)) return "chr";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("chr", chr))
+ return "chr";
#endif // CHAR_CHAR_H
#ifdef MAP_CHAT_H /* chat */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("chat", chat)) return "chat";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("chat", chat))
+ return "chat";
#endif // MAP_CHAT_H
#ifdef MAP_CHRIF_H /* chrif */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("chrif", chrif)) return "chrif";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("chrif", chrif))
+ return "chrif";
#endif // MAP_CHRIF_H
#ifdef MAP_CLIF_H /* clif */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("clif", clif)) return "clif";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("clif", clif))
+ return "clif";
#endif // MAP_CLIF_H
#ifdef COMMON_CORE_H /* cmdline */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("cmdline", cmdline)) return "cmdline";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("cmdline", cmdline))
+ return "cmdline";
#endif // COMMON_CORE_H
#ifdef COMMON_CONSOLE_H /* console */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("console", console)) return "console";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("console", console))
+ return "console";
#endif // COMMON_CONSOLE_H
#ifdef COMMON_CORE_H /* core */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("core", core)) return "core";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("core", core))
+ return "core";
#endif // COMMON_CORE_H
#ifdef COMMON_DB_H /* DB */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("DB", DB)) return "DB";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("DB", DB))
+ return "DB";
#endif // COMMON_DB_H
+#ifdef COMMON_DES_H /* des */
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("des", des))
+ return "des";
+#endif // COMMON_DES_H
#ifdef MAP_DUEL_H /* duel */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("duel", duel)) return "duel";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("duel", duel))
+ return "duel";
#endif // MAP_DUEL_H
#ifdef MAP_ELEMENTAL_H /* elemental */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("elemental", elemental)) return "elemental";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("elemental", elemental))
+ return "elemental";
#endif // MAP_ELEMENTAL_H
#ifdef CHAR_GEOIP_H /* geoip */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("geoip", geoip)) return "geoip";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("geoip", geoip))
+ return "geoip";
#endif // CHAR_GEOIP_H
+#ifdef COMMON_GRFIO_H /* grfio */
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("grfio", grfio))
+ return "grfio";
+#endif // COMMON_GRFIO_H
#ifdef MAP_GUILD_H /* guild */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("guild", guild)) return "guild";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("guild", guild))
+ return "guild";
#endif // MAP_GUILD_H
#ifdef MAP_STORAGE_H /* gstorage */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("gstorage", gstorage)) return "gstorage";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("gstorage", gstorage))
+ return "gstorage";
#endif // MAP_STORAGE_H
#ifdef MAP_HOMUNCULUS_H /* homun */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("homun", homun)) return "homun";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("homun", homun))
+ return "homun";
#endif // MAP_HOMUNCULUS_H
#ifdef MAP_INSTANCE_H /* instance */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("instance", instance)) return "instance";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("instance", instance))
+ return "instance";
#endif // MAP_INSTANCE_H
#ifdef CHAR_INT_AUCTION_H /* inter_auction */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_auction", inter_auction)) return "inter_auction";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_auction", inter_auction))
+ return "inter_auction";
#endif // CHAR_INT_AUCTION_H
#ifdef CHAR_INT_ELEMENTAL_H /* inter_elemental */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_elemental", inter_elemental)) return "inter_elemental";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_elemental", inter_elemental))
+ return "inter_elemental";
#endif // CHAR_INT_ELEMENTAL_H
#ifdef CHAR_INT_GUILD_H /* inter_guild */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_guild", inter_guild)) return "inter_guild";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_guild", inter_guild))
+ return "inter_guild";
#endif // CHAR_INT_GUILD_H
#ifdef CHAR_INT_HOMUN_H /* inter_homunculus */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_homunculus", inter_homunculus)) return "inter_homunculus";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_homunculus", inter_homunculus))
+ return "inter_homunculus";
#endif // CHAR_INT_HOMUN_H
#ifdef CHAR_INTER_H /* inter */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter", inter)) return "inter";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter", inter))
+ return "inter";
#endif // CHAR_INTER_H
#ifdef CHAR_INT_MAIL_H /* inter_mail */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_mail", inter_mail)) return "inter_mail";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_mail", inter_mail))
+ return "inter_mail";
#endif // CHAR_INT_MAIL_H
#ifdef CHAR_INT_MERCENARY_H /* inter_mercenary */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_mercenary", inter_mercenary)) return "inter_mercenary";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_mercenary", inter_mercenary))
+ return "inter_mercenary";
#endif // CHAR_INT_MERCENARY_H
#ifdef CHAR_INT_PARTY_H /* inter_party */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_party", inter_party)) return "inter_party";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_party", inter_party))
+ return "inter_party";
#endif // CHAR_INT_PARTY_H
#ifdef CHAR_INT_PET_H /* inter_pet */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_pet", inter_pet)) return "inter_pet";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_pet", inter_pet))
+ return "inter_pet";
#endif // CHAR_INT_PET_H
#ifdef CHAR_INT_QUEST_H /* inter_quest */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_quest", inter_quest)) return "inter_quest";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_quest", inter_quest))
+ return "inter_quest";
#endif // CHAR_INT_QUEST_H
#ifdef CHAR_INT_STORAGE_H /* inter_storage */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("inter_storage", inter_storage)) return "inter_storage";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("inter_storage", inter_storage))
+ return "inter_storage";
#endif // CHAR_INT_STORAGE_H
#ifdef MAP_INTIF_H /* intif */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("intif", intif)) return "intif";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("intif", intif))
+ return "intif";
#endif // MAP_INTIF_H
#ifdef MAP_IRC_BOT_H /* ircbot */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("ircbot", ircbot)) return "ircbot";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("ircbot", ircbot))
+ return "ircbot";
#endif // MAP_IRC_BOT_H
#ifdef MAP_ITEMDB_H /* itemdb */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("itemdb", itemdb)) return "itemdb";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("itemdb", itemdb))
+ return "itemdb";
#endif // MAP_ITEMDB_H
+#ifdef LOGIN_LCLIF_H /* lclif */
+ if ((server_type&(SERVER_TYPE_LOGIN)) != 0 && !HPM_SYMBOL("lclif", lclif))
+ return "lclif";
+#endif // LOGIN_LCLIF_H
#ifdef COMMON_CONF_H /* libconfig */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("libconfig", libconfig)) return "libconfig";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("libconfig", libconfig))
+ return "libconfig";
#endif // COMMON_CONF_H
#ifdef MAP_LOG_H /* logs */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("logs", logs)) return "logs";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("logs", logs))
+ return "logs";
#endif // MAP_LOG_H
#ifdef LOGIN_LOGIN_H /* login */
-if ((server_type&(SERVER_TYPE_LOGIN)) && !HPM_SYMBOL("login", login)) return "login";
+ if ((server_type&(SERVER_TYPE_LOGIN)) != 0 && !HPM_SYMBOL("login", login))
+ return "login";
#endif // LOGIN_LOGIN_H
#ifdef CHAR_LOGINIF_H /* loginif */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("loginif", loginif)) return "loginif";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("loginif", loginif))
+ return "loginif";
#endif // CHAR_LOGINIF_H
#ifdef MAP_MAIL_H /* mail */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("mail", mail)) return "mail";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("mail", mail))
+ return "mail";
#endif // MAP_MAIL_H
-#ifdef COMMON_MEMMGR_H /* iMalloc */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("iMalloc", iMalloc)) return "iMalloc";
-#endif // COMMON_MEMMGR_H
#ifdef MAP_MAP_H /* map */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("map", map)) return "map";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("map", map))
+ return "map";
#endif // MAP_MAP_H
#ifdef CHAR_MAPIF_H /* mapif */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("mapif", mapif)) return "mapif";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("mapif", mapif))
+ return "mapif";
#endif // CHAR_MAPIF_H
#ifdef COMMON_MAPINDEX_H /* mapindex */
-if ((server_type&(SERVER_TYPE_MAP|SERVER_TYPE_CHAR)) && !HPM_SYMBOL("mapindex", mapindex)) return "mapindex";
+ if ((server_type&(SERVER_TYPE_MAP|SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("mapindex", mapindex))
+ return "mapindex";
#endif // COMMON_MAPINDEX_H
#ifdef MAP_MAP_H /* mapit */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("mapit", mapit)) return "mapit";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("mapit", mapit))
+ return "mapit";
#endif // MAP_MAP_H
#ifdef MAP_MAPREG_H /* mapreg */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("mapreg", mapreg)) return "mapreg";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("mapreg", mapreg))
+ return "mapreg";
#endif // MAP_MAPREG_H
+#ifdef COMMON_MD5CALC_H /* md5 */
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("md5", md5))
+ return "md5";
+#endif // COMMON_MD5CALC_H
#ifdef MAP_MERCENARY_H /* mercenary */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("mercenary", mercenary)) return "mercenary";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("mercenary", mercenary))
+ return "mercenary";
#endif // MAP_MERCENARY_H
#ifdef MAP_MOB_H /* mob */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("mob", mob)) return "mob";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("mob", mob))
+ return "mob";
#endif // MAP_MOB_H
+#ifdef COMMON_MUTEX_H /* mutex */
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("mutex", mutex))
+ return "mutex";
+#endif // COMMON_MUTEX_H
#ifdef MAP_NPC_H /* npc_chat */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("npc_chat", npc_chat)) return "npc_chat";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("npc_chat", npc_chat))
+ return "npc_chat";
#endif // MAP_NPC_H
#ifdef MAP_NPC_H /* npc */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("npc", npc)) return "npc";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("npc", npc))
+ return "npc";
#endif // MAP_NPC_H
#ifdef COMMON_NULLPO_H /* nullpo */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("nullpo", nullpo)) return "nullpo";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("nullpo", nullpo))
+ return "nullpo";
#endif // COMMON_NULLPO_H
#ifdef MAP_PARTY_H /* party */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("party", party)) return "party";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("party", party))
+ return "party";
#endif // MAP_PARTY_H
#ifdef MAP_PATH_H /* path */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("path", path)) return "path";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("path", path))
+ return "path";
#endif // MAP_PATH_H
#ifdef MAP_PC_GROUPS_H /* pcg */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("pc_groups", pcg)) return "pc_groups";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("pc_groups", pcg))
+ return "pc_groups";
#endif // MAP_PC_GROUPS_H
#ifdef MAP_PC_H /* pc */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("pc", pc)) return "pc";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("pc", pc))
+ return "pc";
#endif // MAP_PC_H
#ifdef MAP_NPC_H /* libpcre */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("libpcre", libpcre)) return "libpcre";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("libpcre", libpcre))
+ return "libpcre";
#endif // MAP_NPC_H
#ifdef MAP_PET_H /* pet */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("pet", pet)) return "pet";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("pet", pet))
+ return "pet";
#endif // MAP_PET_H
#ifdef CHAR_PINCODE_H /* pincode */
-if ((server_type&(SERVER_TYPE_CHAR)) && !HPM_SYMBOL("pincode", pincode)) return "pincode";
+ if ((server_type&(SERVER_TYPE_CHAR)) != 0 && !HPM_SYMBOL("pincode", pincode))
+ return "pincode";
#endif // CHAR_PINCODE_H
#ifdef MAP_QUEST_H /* quest */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("quest", quest)) return "quest";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("quest", quest))
+ return "quest";
#endif // MAP_QUEST_H
+#ifdef COMMON_RANDOM_H /* rnd */
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("rnd", rnd))
+ return "rnd";
+#endif // COMMON_RANDOM_H
#ifdef MAP_SCRIPT_H /* script */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("script", script)) return "script";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("script", script))
+ return "script";
#endif // MAP_SCRIPT_H
#ifdef MAP_SEARCHSTORE_H /* searchstore */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("searchstore", searchstore)) return "searchstore";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("searchstore", searchstore))
+ return "searchstore";
#endif // MAP_SEARCHSTORE_H
#ifdef COMMON_SHOWMSG_H /* showmsg */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("showmsg", showmsg)) return "showmsg";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("showmsg", showmsg))
+ return "showmsg";
#endif // COMMON_SHOWMSG_H
#ifdef MAP_SKILL_H /* skill */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("skill", skill)) return "skill";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("skill", skill))
+ return "skill";
#endif // MAP_SKILL_H
#ifdef COMMON_SOCKET_H /* sockt */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("sockt", sockt)) return "sockt";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("sockt", sockt))
+ return "sockt";
#endif // COMMON_SOCKET_H
#ifdef COMMON_SQL_H /* SQL */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("SQL", SQL)) return "SQL";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("SQL", SQL))
+ return "SQL";
#endif // COMMON_SQL_H
#ifdef MAP_STATUS_H /* status */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("status", status)) return "status";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("status", status))
+ return "status";
#endif // MAP_STATUS_H
#ifdef MAP_STORAGE_H /* storage */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("storage", storage)) return "storage";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("storage", storage))
+ return "storage";
#endif // MAP_STORAGE_H
#ifdef COMMON_STRLIB_H /* StrBuf */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("StrBuf", StrBuf)) return "StrBuf";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("StrBuf", StrBuf))
+ return "StrBuf";
#endif // COMMON_STRLIB_H
#ifdef COMMON_STRLIB_H /* strlib */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("strlib", strlib)) return "strlib";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("strlib", strlib))
+ return "strlib";
#endif // COMMON_STRLIB_H
#ifdef COMMON_STRLIB_H /* sv */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("sv", sv)) return "sv";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("sv", sv))
+ return "sv";
#endif // COMMON_STRLIB_H
#ifdef COMMON_SYSINFO_H /* sysinfo */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("sysinfo", sysinfo)) return "sysinfo";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("sysinfo", sysinfo))
+ return "sysinfo";
#endif // COMMON_SYSINFO_H
+#ifdef COMMON_THREAD_H /* thread */
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("thread", thread))
+ return "thread";
+#endif // COMMON_THREAD_H
#ifdef COMMON_TIMER_H /* timer */
-if ((server_type&(SERVER_TYPE_ALL)) && !HPM_SYMBOL("timer", timer)) return "timer";
+ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("timer", timer))
+ return "timer";
#endif // COMMON_TIMER_H
#ifdef MAP_TRADE_H /* trade */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("trade", trade)) return "trade";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("trade", trade))
+ return "trade";
#endif // MAP_TRADE_H
#ifdef MAP_UNIT_H /* unit */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("unit", unit)) return "unit";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("unit", unit))
+ return "unit";
#endif // MAP_UNIT_H
#ifdef MAP_VENDING_H /* vending */
-if ((server_type&(SERVER_TYPE_MAP)) && !HPM_SYMBOL("vending", vending)) return "vending";
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("vending", vending))
+ return "vending";
#endif // MAP_VENDING_H
return NULL;
}
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index cf3e16277..143c325c1 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -24,15 +24,16 @@
#include "common/console.h"
#include "common/core.h"
#include "common/showmsg.h"
-#include "common/sql.h"
+struct HPMHooking_interface;
+struct Sql; // common/sql.h
struct script_state;
struct AtCommandInfo;
struct socket_data;
struct map_session_data;
struct hplugin_data_store;
-#define HPM_VERSION "1.1"
+#define HPM_VERSION "1.2"
#define HPM_ADDCONF_LENGTH 40
struct hplugin_info {
@@ -71,11 +72,6 @@ enum HPluginPacketHookingPoints {
hpPHP_MAX,
};
-enum HPluginHookType {
- HOOK_TYPE_PRE,
- HOOK_TYPE_POST,
-};
-
/**
* Data types for plugin custom data.
*/
@@ -107,13 +103,6 @@ enum HPluginConfType {
HPCT_MAX,
};
-#define addHookPre(tname,hook) (HPMi->AddHook(HOOK_TYPE_PRE,(tname),(hook),HPMi->pid))
-#define addHookPost(tname,hook) (HPMi->AddHook(HOOK_TYPE_POST,(tname),(hook),HPMi->pid))
-/* need better names ;/ */
-/* will not run the original function after pre-hook processing is complete (other hooks will run) */
-#define hookStop() (HPMi->HookStop(__func__,HPMi->pid))
-#define hookStopped() (HPMi->HookStopped())
-
#define addArg(name, param,func,help) (HPMi->addArg(HPMi->pid,(name),(param),(cmdline_arg_ ## func),(help)))
/* HPData handy redirects */
/* session[] */
@@ -199,19 +188,19 @@ enum HPluginConfType {
/* HPMi->addPacket */
#define addPacket(cmd,len,receive,point) HPMi->addPacket(cmd,len,receive,point,HPMi->pid)
/* HPMi->addBattleConf */
-#define addBattleConf(bcname,funcname,returnfunc) HPMi->addConf(HPMi->pid,HPCT_BATTLE,bcname,funcname,returnfunc)
+#define addBattleConf(bcname, funcname, returnfunc, required) HPMi->addConf(HPMi->pid, HPCT_BATTLE, bcname, funcname, returnfunc, required)
/* HPMi->addLogin */
-#define addLoginConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_LOGIN,bcname,funcname,NULL)
+#define addLoginConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_LOGIN, bcname, funcname, NULL, false)
/* HPMi->addChar */
-#define addCharConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_CHAR,bcname,funcname,NULL)
+#define addCharConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_CHAR, bcname, funcname, NULL, false)
/* HPMi->addCharInter */
-#define addCharInterConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_CHAR_INTER,bcname,funcname,NULL)
+#define addCharInterConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_CHAR_INTER, bcname, funcname, NULL, false)
/* HPMi->addMapInter */
-#define addMapInterConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_MAP_INTER,bcname,funcname,NULL)
+#define addMapInterConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_MAP_INTER, bcname, funcname, NULL, false)
/* HPMi->addLog */
-#define addLogConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_LOG,bcname,funcname,NULL)
+#define addLogConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_LOG, bcname, funcname, NULL, false)
/* HPMi->addScript */
-#define addScriptConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_SCRIPT,bcname,funcname,NULL)
+#define addScriptConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_SCRIPT, bcname, funcname, NULL, false)
/* HPMi->addPCGPermission */
#define addGroupPermission(pcgname,maskptr) HPMi->addPCGPermission(HPMi->pid,pcgname,&maskptr)
@@ -231,18 +220,18 @@ struct HPMi_interface {
void (*removeFromHPData) (enum HPluginDataTypes type, uint32 pluginID, struct hplugin_data_store *store, uint32 classid);
/* packet */
bool (*addPacket) (unsigned short cmd, unsigned short length, void (*receive)(int fd), unsigned int point, unsigned int pluginID);
- /* Hooking */
- bool (*AddHook) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
- void (*HookStop) (const char *func, unsigned int pID);
- bool (*HookStopped) (void);
/* program --arg/-a */
bool (*addArg) (unsigned int pluginID, char *name, bool has_param, CmdlineExecFunc func, const char *help);
/* battle-config recv param */
- bool (*addConf) (unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key));
+ bool (*addConf) (unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key), bool required);
/* pc group permission */
void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask);
- Sql *sql_handle;
+ struct Sql *sql_handle;
+
+ /* Hooking */
+ struct HPMHooking_interface *hooking;
+ struct malloc_interface *memmgr;
};
#ifdef HERCULES_CORE
#define HPM_SYMBOL(n, s) (HPM->share((s), (n)), true)
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 9d4b2d044..6e7ffa088 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -1,7 +1,7 @@
# This file is part of Hercules.
# http://herc.ws - http://github.com/HerculesWS/Hercules
#
-# Copyright (C) 2012-2015 Hercules Dev Team
+# Copyright (C) 2012-2016 Hercules Dev Team
# Copyright (C) Athena Dev Teams
#
# Hercules is free software: you can redistribute it and/or modify
@@ -50,7 +50,9 @@ COMMON_C += console.c core.c memmgr.c socket.c
COMMON_H = atomic.h cbasetypes.h conf.h console.h core.h db.h des.h ers.h \
grfio.h hercules.h HPM.h HPMi.h memmgr.h mapindex.h md5calc.h \
mmo.h mutex.h nullpo.h random.h showmsg.h socket.h spinlock.h \
- sql.h strlib.h sysinfo.h thread.h timer.h utils.h winapi.h
+ sql.h strlib.h sysinfo.h thread.h timer.h utils.h winapi.h \
+ ../plugins/HPMHooking.h
+COMMON_PH =
COMMON_SQL_OBJ = obj_sql/sql.o
COMMON_SQL_H = sql.h
@@ -95,7 +97,7 @@ help:
Makefile: Makefile.in
@$(MAKE) -C ../.. src/common/Makefile
-$(SYSINFO_INC): $(COMMON_C) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
+$(SYSINFO_INC): $(COMMON_C) $(COMMON_PH) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
@echo " MAKE $@"
@$(MAKE) -C ../.. sysinfo
@@ -131,25 +133,27 @@ common_mini: $(COMMON_MINI_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common
common_sql: $(COMMON_SQL_OBJ) obj_sql/common_sql.a Makefile
-obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) $(SYSINFO_INC) | obj_all
+# missing object files
+$(MT19937AR_OBJ):
+ @echo " MAKE $@"
+ @$(MAKE) -C $(MT19937AR_D)
+
+$(LIBCONFIG_OBJ):
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)
+
+.SECONDEXPANSION:
+
+obj_all/sysinfo.o: sysinfo.c $(filter sysinfo.p.h, $(COMMON_PH)) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) $(SYSINFO_INC) | obj_all
obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
@$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
+obj_all/mini%.o: %.c $$(filter %.p.h, $(COMMON_PH)) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
@$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql
+obj_sql/%.o: %.c $$(filter %.p.h, $(COMMON_PH)) $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql
@echo " CC $<"
@$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-
-# missing object files
-$(MT19937AR_OBJ):
- @echo " MAKE $@"
- @$(MAKE) -C $(MT19937AR_D)
-
-$(LIBCONFIG_OBJ):
- @echo " MAKE $@"
- @$(MAKE) -C $(LIBCONFIG_D)
diff --git a/src/common/atomic.h b/src/common/atomic.h
index 82d579bf4..b370052a9 100644
--- a/src/common/atomic.h
+++ b/src/common/atomic.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) rAthena Project (www.rathena.org)
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 61d0646eb..2c36c23bc 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 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
@@ -94,7 +94,7 @@
// debug function name
#ifndef __NETBSD__
-#if __STDC_VERSION__ < 199901L
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __func__ __FUNCTION__
# else
@@ -109,6 +109,14 @@
# define __attribute__(x)
#endif
+/// Feature/extension checking macros
+#ifndef __has_extension /* Available in clang and gcc >= 3 */
+#define __has_extension(x) 0
+#endif
+#ifndef __has_feature /* Available in clang and gcc >= 5 */
+#define __has_feature(x) __has_extension(x)
+#endif
+
//////////////////////////////////////////////////////////////////////////
// portable printf/scanf format macros and integer definitions
// NOTE: Visual C++ uses <inttypes.h> and <stdint.h> provided in /3rdparty
@@ -118,16 +126,6 @@
#include <limits.h>
#include <time.h>
-// temporary fix for bugreport:4961 (unintended conversion from signed to unsigned)
-// (-20 >= UCHAR_MAX) returns true
-// (-20 >= USHRT_MAX) returns true
-#if defined(__FreeBSD__) && defined(__x86_64)
-#undef UCHAR_MAX
-#define UCHAR_MAX ((unsigned char)0xff)
-#undef USHRT_MAX
-#define USHRT_MAX ((unsigned short)0xffff)
-#endif
-
// ILP64 isn't supported, so always 32 bits?
#ifndef UINT_MAX
#define UINT_MAX 0xffffffff
@@ -262,16 +260,13 @@ typedef uintptr_t uintptr;
#if defined(__BORLANDC__) || _MSC_VER < 1900
#define snprintf _snprintf
#endif
-#if defined(_MSC_VER) && _MSC_VER < 1400
-#define vsnprintf _vsnprintf
-#endif
#else
#define strcmpi strcasecmp
#define stricmp strcasecmp
#define strncmpi strncasecmp
#define strnicmp strncasecmp
#endif
-#if defined(_MSC_VER) && _MSC_VER > 1200
+#if defined(_MSC_VER)
#define strtoull _strtoui64
#define strtoll _strtoi64
#endif
@@ -295,6 +290,28 @@ typedef uintptr_t uintptr;
#define analyzer_noreturn
#endif
+// gcc version (if any) - borrowed from Mana Plus
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#else
+#define GCC_VERSION 0
+#endif
+
+// Pragma macro only enabled on gcc >= 4.6 or clang - borrowed from Mana Plus
+#if defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
+#define PRAGMA_GCC46(str) _Pragma(#str)
+#else // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
+#define PRAGMA_GCC46(str)
+#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600)
+
+// fallthrough attribute only enabled on gcc >= 7.0
+#if defined(__GNUC__) && (GCC_VERSION >= 70000)
+#define FALLTHROUGH __attribute__ ((fallthrough));
+#else // ! defined(__GNUC__) && (GCC_VERSION >= 70000)
+#define FALLTHROUGH
+#endif // ! defined(__GNUC__) && (GCC_VERSION >= 70000)
// boolean types for C
#if !defined(_MSC_VER) || _MSC_VER >= 1800
@@ -327,24 +344,6 @@ typedef char bool;
//#define swap(a,b) if (a != b) ((a ^= b), (b ^= a), (a ^= b))
// but is vulnerable to 'if (foo) swap(bar, baz); else quux();', causing the else to nest incorrectly.
#define swap(a,b) do { if ((a) != (b)) { (a) ^= (b); (b) ^= (a); (a) ^= (b); } } while(0)
-#if 0 //to be activated soon, more tests needed on how VS works with the macro above
-#ifdef WIN32
-#undef swap
-#define swap(a,b)__asm { \
- __asm mov eax, dword ptr [a] \
- __asm cmp eax, dword ptr [b] \
- __asm je _ret \
- __asm xor eax, dword ptr [b] \
- __asm mov dword ptr [a], eax \
- __asm xor eax, dword ptr [b] \
- __asm mov dword ptr [b], eax \
- __asm xor eax, dword ptr [a] \
- __asm mov dword ptr [a], eax \
- __asm _ret: \
-}
-#endif
-#endif
-
#define swap_ptr(a,b) do { if ((a) != (b)) (a) = (void*)((intptr_t)(a) ^ (intptr_t)(b)); (b) = (void*)((intptr_t)(a) ^ (intptr_t)(b)); (a) = (void*)((intptr_t)(a) ^ (intptr_t)(b)); } while(0)
#ifndef max
@@ -450,4 +449,23 @@ typedef char bool;
/** Support macros for marking structs as unavailable */
#define UNAVAILABLE_STRUCT int8 HERC__unavailable_struct
+/** Static assertion (only on compilers that support it) */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+// C11 version
+#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg)
+#elif __has_feature(c_static_assert)
+// Clang support (as per http://clang.llvm.org/docs/LanguageExtensions.html)
+#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg)
+#elif defined(__GNUC__) && GCC_VERSION >= 40700
+// GCC >= 4.7 is known to support it
+#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg)
+#elif defined(_MSC_VER)
+// MSVC doesn't support it, but it accepts the C++ style version
+#define STATIC_ASSERT(ex, msg) static_assert(ex, msg)
+#else
+// Otherise just ignore it until it's supported
+#define STATIC_ASSERT(ex, msg)
+#endif
+
+
#endif /* COMMON_CBASETYPES_H */
diff --git a/src/common/conf.c b/src/common/conf.c
index 3e8c08963..96b9bff9f 100644
--- a/src/common/conf.c
+++ b/src/common/conf.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,6 +23,8 @@
#include "conf.h"
#include "common/showmsg.h" // ShowError
+#include "common/strlib.h" // safestrncpy
+#include "common/utils.h" // exists
#include <libconfig/libconfig.h>
@@ -30,26 +32,43 @@
struct libconfig_interface libconfig_s;
struct libconfig_interface *libconfig;
-int conf_read_file(config_t *config, const char *config_filename) {
+/**
+ * Initializes 'config' and loads a configuration file.
+ *
+ * Shows error and destroys 'config' in case of failure.
+ * It is the caller's care to destroy 'config' in case of success.
+ *
+ * @param config The config file to initialize.
+ * @param config_filename The file to read.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_load_file(struct config_t *config, const char *config_filename)
+{
libconfig->init(config);
- if (!libconfig->read_file_src(config, config_filename)) {
+ if (!exists(config_filename)) {
+ ShowError("Unable to load '%s' - File not found\n", config_filename);
+ return CONFIG_FALSE;
+ }
+ if (libconfig->read_file_src(config, config_filename) != CONFIG_TRUE) {
ShowError("%s:%d - %s\n", config_error_file(config),
config_error_line(config), config_error_text(config));
libconfig->destroy(config);
- return 1;
+ return CONFIG_FALSE;
}
- return 0;
+ return CONFIG_TRUE;
}
//
// Functions to copy settings from libconfig/contrib
//
-void config_setting_copy_simple(config_setting_t *parent, const config_setting_t *src) {
+void config_setting_copy_simple(struct config_setting_t *parent, const struct config_setting_t *src)
+{
if (config_setting_is_aggregate(src)) {
libconfig->setting_copy_aggregate(parent, src);
- }
- else {
- config_setting_t *set;
+ } else {
+ struct config_setting_t *set;
if( libconfig->setting_get_member(parent, config_setting_name(src)) != NULL )
return;
@@ -73,8 +92,9 @@ void config_setting_copy_simple(config_setting_t *parent, const config_setting_t
}
}
-void config_setting_copy_elem(config_setting_t *parent, const config_setting_t *src) {
- config_setting_t *set = NULL;
+void config_setting_copy_elem(struct config_setting_t *parent, const struct config_setting_t *src)
+{
+ struct config_setting_t *set = NULL;
if (config_setting_is_aggregate(src))
libconfig->setting_copy_aggregate(parent, src);
@@ -93,8 +113,9 @@ void config_setting_copy_elem(config_setting_t *parent, const config_setting_t *
}
}
-void config_setting_copy_aggregate(config_setting_t *parent, const config_setting_t *src) {
- config_setting_t *newAgg;
+void config_setting_copy_aggregate(struct config_setting_t *parent, const struct config_setting_t *src)
+{
+ struct config_setting_t *newAgg;
int i, n;
if( libconfig->setting_get_member(parent, config_setting_name(src)) != NULL )
@@ -116,7 +137,8 @@ void config_setting_copy_aggregate(config_setting_t *parent, const config_settin
}
}
-int config_setting_copy(config_setting_t *parent, const config_setting_t *src) {
+int config_setting_copy(struct config_setting_t *parent, const struct config_setting_t *src)
+{
if (!config_setting_is_group(parent) && !config_setting_is_list(parent))
return CONFIG_FALSE;
@@ -128,14 +150,311 @@ int config_setting_copy(config_setting_t *parent, const config_setting_t *src) {
return CONFIG_TRUE;
}
+/**
+ * Converts the value of a setting that is type CONFIG_TYPE_BOOL to bool.
+ *
+ * @param setting The setting to read.
+ *
+ * @return The converted value.
+ * @retval false in case of failure.
+ */
+bool config_setting_get_bool_real(const struct config_setting_t *setting)
+{
+ if (setting == NULL || setting->type != CONFIG_TYPE_BOOL)
+ return false;
+
+ return setting->value.ival ? true : false;
+}
+
+/**
+ * Same as config_setting_lookup_bool, but uses bool instead of int.
+ *
+ * @param[in] setting The setting to read.
+ * @param[in] name The setting name to lookup.
+ * @param[out] value The output value.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_setting_lookup_bool_real(const struct config_setting_t *setting, const char *name, bool *value)
+{
+ struct config_setting_t *member = config_setting_get_member(setting, name);
+
+ if (!member)
+ return CONFIG_FALSE;
+
+ if (config_setting_type(member) != CONFIG_TYPE_BOOL)
+ return CONFIG_FALSE;
+
+ *value = config_setting_get_bool_real(member);
+
+ return CONFIG_TRUE;
+}
+
+/**
+ * Converts and returns a configuration that is CONFIG_TYPE_INT to unsigned int (uint32).
+ *
+ * @param setting The setting to read.
+ *
+ * @return The converted value.
+ * @retval 0 in case of failure.
+ */
+uint32 config_setting_get_uint32(const struct config_setting_t *setting)
+{
+ if (setting == NULL || setting->type != CONFIG_TYPE_INT)
+ return 0;
+
+ if (setting->value.ival < 0)
+ return 0;
+
+ return (uint32)setting->value.ival;
+}
+
+/**
+ * Looks up a configuration entry of type CONFIG_TYPE_INT and reads it as uint32.
+ *
+ * @param[in] setting The setting to read.
+ * @param[in] name The setting name to lookup.
+ * @param[out] value The output value.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_setting_lookup_uint32(const struct config_setting_t *setting, const char *name, uint32 *value)
+{
+ struct config_setting_t *member = config_setting_get_member(setting, name);
+
+ if (!member)
+ return CONFIG_FALSE;
+
+ if (config_setting_type(member) != CONFIG_TYPE_INT)
+ return CONFIG_FALSE;
+
+ *value = config_setting_get_uint32(member);
+
+ return CONFIG_TRUE;
+}
+
+/**
+ * Converts and returns a configuration that is CONFIG_TYPE_INT to uint16
+ *
+ * @param setting The setting to read.
+ *
+ * @return The converted value.
+ * @retval 0 in case of failure.
+ */
+uint16 config_setting_get_uint16(const struct config_setting_t *setting)
+{
+ if (setting == NULL || setting->type != CONFIG_TYPE_INT)
+ return 0;
+
+ if (setting->value.ival > UINT16_MAX)
+ return UINT16_MAX;
+ if (setting->value.ival < UINT16_MIN)
+ return UINT16_MIN;
+
+ return (uint16)setting->value.ival;
+}
+
+/**
+ * Looks up a configuration entry of type CONFIG_TYPE_INT and reads it as uint16.
+ *
+ * @param[in] setting The setting to read.
+ * @param[in] name The setting name to lookup.
+ * @param[out] value The output value.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_setting_lookup_uint16(const struct config_setting_t *setting, const char *name, uint16 *value)
+{
+ struct config_setting_t *member = config_setting_get_member(setting, name);
+
+ if (!member)
+ return CONFIG_FALSE;
+
+ if (config_setting_type(member) != CONFIG_TYPE_INT)
+ return CONFIG_FALSE;
+
+ *value = config_setting_get_uint16(member);
+
+ return CONFIG_TRUE;
+}
+
+/**
+ * Converts and returns a configuration that is CONFIG_TYPE_INT to int16
+ *
+ * @param setting The setting to read.
+ *
+ * @return The converted value.
+ * @retval 0 in case of failure.
+ */
+int16 config_setting_get_int16(const struct config_setting_t *setting)
+{
+ if (setting == NULL || setting->type != CONFIG_TYPE_INT)
+ return 0;
+
+ if (setting->value.ival > INT16_MAX)
+ return INT16_MAX;
+ if (setting->value.ival < INT16_MIN)
+ return INT16_MIN;
+
+ return (int16)setting->value.ival;
+}
+
+/**
+ * Looks up a configuration entry of type CONFIG_TYPE_INT and reads it as int16.
+ *
+ * @param[in] setting The setting to read.
+ * @param[in] name The setting name to lookup.
+ * @param[out] value The output value.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_setting_lookup_int16(const struct config_setting_t *setting, const char *name, int16 *value)
+{
+ struct config_setting_t *member = config_setting_get_member(setting, name);
+
+ if (!member)
+ return CONFIG_FALSE;
+
+ if (config_setting_type(member) != CONFIG_TYPE_INT)
+ return CONFIG_FALSE;
+
+ *value = config_setting_get_int16(member);
+
+ return CONFIG_TRUE;
+}
+
+/**
+ * Looks up a configuration entry of type CONFIG_TYPE_STRING inside a struct config_setting_t and copies it into a (non-const) char buffer.
+ *
+ * @param[in] setting The setting to read.
+ * @param[in] name The setting name to lookup.
+ * @param[out] out The output buffer.
+ * @param[in] out_size The size of the output buffer.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_setting_lookup_mutable_string(const struct config_setting_t *setting, const char *name, char *out, size_t out_size)
+{
+ const char *str = NULL;
+
+ if (libconfig->setting_lookup_string(setting, name, &str) == CONFIG_TRUE) {
+ safestrncpy(out, str, out_size);
+ return CONFIG_TRUE;
+ }
+
+ return CONFIG_FALSE;
+}
+
+/**
+ * Looks up a configuration entry of type CONFIG_TYPE_STRING inside a struct config_t and copies it into a (non-const) char buffer.
+ *
+ * @param[in] config The configuration to read.
+ * @param[in] name The setting name to lookup.
+ * @param[out] out The output buffer.
+ * @param[in] out_size The size of the output buffer.
+ *
+ * @retval CONFIG_TRUE in case of success.
+ * @retval CONFIG_FALSE in case of failure.
+ */
+int config_lookup_mutable_string(const struct config_t *config, const char *name, char *out, size_t out_size)
+{
+ const char *str = NULL;
+
+ if (libconfig->lookup_string(config, name, &str) == CONFIG_TRUE) {
+ safestrncpy(out, str, out_size);
+ return CONFIG_TRUE;
+ }
+
+ return CONFIG_FALSE;
+}
+
+/**
+ * Wrapper for config_setting_get_int64() using defined-size variables
+ *
+ * @see config_setting_get_int64_real()
+ */
+int64 config_setting_get_int64_real(const struct config_setting_t *setting)
+{
+ return (int64)config_setting_get_int64(setting);
+}
+
+/**
+ * Wrapper for config_setting_lookup_int64() using defined-size variables
+ *
+ * @see config_setting_lookup_int64()
+ */
+int config_setting_lookup_int64_real(const struct config_setting_t *setting, const char *name, int64 *value)
+{
+ long long int lli = 0;
+
+ if (config_setting_lookup_int64(setting, name, &lli) != CONFIG_TRUE)
+ return CONFIG_FALSE;
+
+ *value = (int64)lli;
+
+ return CONFIG_TRUE;
+}
+
+/**
+ * Wrapper for config_setting_set_int64() using defined-size variables
+ *
+ * @see config_setting_set_int64()
+ */
+int config_setting_set_int64_real(struct config_setting_t *setting, int64 value)
+{
+ return config_setting_set_int64(setting, (long long int)value);
+}
+
+/**
+ * Wrapper for config_setting_get_int64_elem() using defined-size variables
+ *
+ * @see config_setting_get_int64_elem()
+ */
+int64 config_setting_get_int64_elem_real(const struct config_setting_t *setting, int idx)
+{
+ return (int64)config_setting_get_int64_elem(setting, idx);
+}
+
+/**
+ * Wrapper for config_setting_set_int64_elem() using defined-size variables
+ *
+ * @see config_setting_set_int64_elem()
+ */
+struct config_setting_t *config_setting_set_int64_elem_real(struct config_setting_t *setting, int idx, int64 value)
+{
+ return config_setting_set_int64_elem(setting, idx, (long long int)value);
+}
+
+/**
+ * Wrapper for config_lookup_int64() using defined-size variables
+ *
+ * @see config_lookup_int64()
+ */
+int config_lookup_int64_real(const struct config_t *config, const char *filepath, int64 *value)
+{
+ long long int lli = 0;
+
+ if (config_lookup_int64(config, filepath, &lli) != CONFIG_TRUE)
+ return CONFIG_FALSE;
+
+ *value = (int64)lli;
+
+ return CONFIG_TRUE;
+}
+
void libconfig_defaults(void) {
libconfig = &libconfig_s;
libconfig->read = config_read;
libconfig->write = config_write;
/* */
- libconfig->set_auto_convert = config_set_auto_convert;
- libconfig->get_auto_convert = config_get_auto_convert;
+ libconfig->set_options = config_set_options;
+ libconfig->get_options = config_get_options;
/* */
libconfig->read_string = config_read_string;
libconfig->read_file_src = config_read_file;
@@ -148,19 +467,20 @@ void libconfig_defaults(void) {
libconfig->destroy = config_destroy;
/* */
libconfig->setting_get_int = config_setting_get_int;
- libconfig->setting_get_int64 = config_setting_get_int64;
+ libconfig->setting_get_int64 = config_setting_get_int64_real;
libconfig->setting_get_float = config_setting_get_float;
libconfig->setting_get_bool = config_setting_get_bool;
libconfig->setting_get_string = config_setting_get_string;
/* */
+ libconfig->setting_lookup = config_setting_lookup;
libconfig->setting_lookup_int = config_setting_lookup_int;
- libconfig->setting_lookup_int64 = config_setting_lookup_int64;
+ libconfig->setting_lookup_int64 = config_setting_lookup_int64_real;
libconfig->setting_lookup_float = config_setting_lookup_float;
libconfig->setting_lookup_bool = config_setting_lookup_bool;
libconfig->setting_lookup_string = config_setting_lookup_string;
/* */
libconfig->setting_set_int = config_setting_set_int;
- libconfig->setting_set_int64 = config_setting_set_int64;
+ libconfig->setting_set_int64 = config_setting_set_int64_real;
libconfig->setting_set_float = config_setting_set_float;
libconfig->setting_set_bool = config_setting_set_bool;
libconfig->setting_set_string = config_setting_set_string;
@@ -169,13 +489,13 @@ void libconfig_defaults(void) {
libconfig->setting_get_format = config_setting_get_format;
/* */
libconfig->setting_get_int_elem = config_setting_get_int_elem;
- libconfig->setting_get_int64_elem = config_setting_get_int64_elem;
+ libconfig->setting_get_int64_elem = config_setting_get_int64_elem_real;
libconfig->setting_get_float_elem = config_setting_get_float_elem;
libconfig->setting_get_bool_elem = config_setting_get_bool_elem;
libconfig->setting_get_string_elem = config_setting_get_string_elem;
/* */
libconfig->setting_set_int_elem = config_setting_set_int_elem;
- libconfig->setting_set_int64_elem = config_setting_set_int64_elem;
+ libconfig->setting_set_int64_elem = config_setting_set_int64_elem_real;
libconfig->setting_set_float_elem = config_setting_set_float_elem;
libconfig->setting_set_bool_elem = config_setting_set_bool_elem;
libconfig->setting_set_string_elem = config_setting_set_string_elem;
@@ -193,17 +513,30 @@ void libconfig_defaults(void) {
libconfig->setting_set_hook = config_setting_set_hook;
/* */
libconfig->lookup = config_lookup;
- libconfig->lookup_from = config_lookup_from;
/* */
libconfig->lookup_int = config_lookup_int;
- libconfig->lookup_int64 = config_lookup_int64;
+ libconfig->lookup_int64 = config_lookup_int64_real;
libconfig->lookup_float = config_lookup_float;
libconfig->lookup_bool = config_lookup_bool;
libconfig->lookup_string = config_lookup_string;
/* those are custom and are from src/common/conf.c */
- libconfig->read_file = conf_read_file;
+ libconfig->load_file = config_load_file;
libconfig->setting_copy_simple = config_setting_copy_simple;
libconfig->setting_copy_elem = config_setting_copy_elem;
libconfig->setting_copy_aggregate = config_setting_copy_aggregate;
libconfig->setting_copy = config_setting_copy;
+
+ /* Functions to get different types */
+ libconfig->setting_get_bool_real = config_setting_get_bool_real;
+ libconfig->setting_get_uint32 = config_setting_get_uint32;
+ libconfig->setting_get_uint16 = config_setting_get_uint16;
+ libconfig->setting_get_int16 = config_setting_get_int16;
+
+ /* Functions to lookup different types */
+ libconfig->setting_lookup_int16 = config_setting_lookup_int16;
+ libconfig->setting_lookup_bool_real = config_setting_lookup_bool_real;
+ libconfig->setting_lookup_uint32 = config_setting_lookup_uint32;
+ libconfig->setting_lookup_uint16 = config_setting_lookup_uint16;
+ libconfig->setting_lookup_mutable_string = config_setting_lookup_mutable_string;
+ libconfig->lookup_mutable_string = config_lookup_mutable_string;
}
diff --git a/src/common/conf.h b/src/common/conf.h
index 19b13c51a..bd6acc4be 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -29,82 +29,94 @@
* The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent
**/
struct libconfig_interface {
- int (*read) (config_t *config, FILE *stream);
- void (*write) (const config_t *config, FILE *stream);
+ int (*read) (struct config_t *config, FILE *stream);
+ void (*write) (const struct config_t *config, FILE *stream);
/* */
- void (*set_auto_convert) (config_t *config, int flag); // TODO: Replace with config_set_options
- int (*get_auto_convert) (const config_t *config); // TODO: Replace with config_get_options
+ void (*set_options) (struct config_t *config, int options);
+ int (*get_options) (const struct config_t *config);
/* */
- int (*read_string) (config_t *config, const char *str);
- int (*read_file_src) (config_t *config, const char *filename);
- int (*write_file) (config_t *config, const char *filename);
-
- void (*set_destructor) (config_t *config, void (*destructor)(void *));
- void (*set_include_dir) (config_t *config, const char *include_dir);
-
- void (*init) (config_t *config);
- void (*destroy) (config_t *config);
-
- int (*setting_get_int) (const config_setting_t *setting);
- long long (*setting_get_int64) (const config_setting_t *setting);
- double (*setting_get_float) (const config_setting_t *setting);
-
- int (*setting_get_bool) (const config_setting_t *setting);
-
- const char * (*setting_get_string) (const config_setting_t *setting);
-
- int (*setting_lookup_int) (const config_setting_t *setting, const char *name, int *value);
- int (*setting_lookup_int64) (const config_setting_t *setting, const char *name, long long *value);
- int (*setting_lookup_float) (const config_setting_t *setting, const char *name, double *value);
- int (*setting_lookup_bool) (const config_setting_t *setting, const char *name, int *value);
- int (*setting_lookup_string) (const config_setting_t *setting, const char *name, const char **value);
- int (*setting_set_int) (config_setting_t *setting ,int value);
- int (*setting_set_int64) (config_setting_t *setting, long long value);
- int (*setting_set_float) (config_setting_t *setting, double value);
- int (*setting_set_bool) (config_setting_t *setting, int value);
- int (*setting_set_string) (config_setting_t *setting, const char *value);
-
- int (*setting_set_format) (config_setting_t *setting, short format);
- short (*setting_get_format) (const config_setting_t *setting);
-
- int (*setting_get_int_elem) (const config_setting_t *setting, int idx);
- long long (*setting_get_int64_elem) (const config_setting_t *setting, int idx);
- double (*setting_get_float_elem) (const config_setting_t *setting, int idx);
- int (*setting_get_bool_elem) (const config_setting_t *setting, int idx);
- const char * (*setting_get_string_elem) (const config_setting_t *setting, int idx);
- config_setting_t * (*setting_set_int_elem) (config_setting_t *setting, int idx, int value);
- config_setting_t * (*setting_set_int64_elem) (config_setting_t *setting, int idx, long long value);
- config_setting_t * (*setting_set_float_elem) (config_setting_t *setting, int idx, double value);
- config_setting_t * (*setting_set_bool_elem) (config_setting_t *setting, int idx, int value);
- config_setting_t * (*setting_set_string_elem) (config_setting_t *setting, int idx, const char *value);
-
- int (*setting_index) (const config_setting_t *setting);
- int (*setting_length) (const config_setting_t *setting);
-
- config_setting_t * (*setting_get_elem) (const config_setting_t *setting, unsigned int idx);
- config_setting_t * (*setting_get_member) (const config_setting_t *setting, const char *name);
-
- config_setting_t * (*setting_add) (config_setting_t *parent, const char *name, int type);
- int (*setting_remove) (config_setting_t *parent, const char *name);
-
- int (*setting_remove_elem) (config_setting_t *parent, unsigned int idx);
- void (*setting_set_hook) (config_setting_t *setting, void *hook);
-
- config_setting_t * (*lookup) (const config_t *config, const char *filepath);
- config_setting_t * (*lookup_from) (config_setting_t *setting, const char *filepath);
- int (*lookup_int) (const config_t *config, const char *filepath, int *value);
- int (*lookup_int64) (const config_t *config, const char *filepath, long long *value);
- int (*lookup_float) (const config_t *config, const char *filepath, double *value);
- int (*lookup_bool) (const config_t *config, const char *filepath, int *value);
- int (*lookup_string) (const config_t *config, const char *filepath, const char **value);
+ int (*read_string) (struct config_t *config, const char *str);
+ int (*read_file_src) (struct config_t *config, const char *filename);
+ int (*write_file) (struct config_t *config, const char *filename);
+
+ void (*set_destructor) (struct config_t *config, void (*destructor)(void *));
+ void (*set_include_dir) (struct config_t *config, const char *include_dir);
+
+ void (*init) (struct config_t *config);
+ void (*destroy) (struct config_t *config);
+
+ int (*setting_get_int) (const struct config_setting_t *setting);
+ int64 (*setting_get_int64) (const struct config_setting_t *setting);
+ double (*setting_get_float) (const struct config_setting_t *setting);
+
+ int (*setting_get_bool) (const struct config_setting_t *setting);
+
+ const char * (*setting_get_string) (const struct config_setting_t *setting);
+
+ struct config_setting_t * (*setting_lookup) (struct config_setting_t *setting, const char *name);
+ int (*setting_lookup_int) (const struct config_setting_t *setting, const char *name, int *value);
+ int (*setting_lookup_int64) (const struct config_setting_t *setting, const char *name, int64 *value);
+ int (*setting_lookup_float) (const struct config_setting_t *setting, const char *name, double *value);
+ int (*setting_lookup_bool) (const struct config_setting_t *setting, const char *name, int *value);
+ int (*setting_lookup_string) (const struct config_setting_t *setting, const char *name, const char **value);
+ int (*setting_set_int) (struct config_setting_t *setting, int value);
+ int (*setting_set_int64) (struct config_setting_t *setting, int64 value);
+ int (*setting_set_float) (struct config_setting_t *setting, double value);
+ int (*setting_set_bool) (struct config_setting_t *setting, int value);
+ int (*setting_set_string) (struct config_setting_t *setting, const char *value);
+
+ int (*setting_set_format) (struct config_setting_t *setting, short format);
+ short (*setting_get_format) (const struct config_setting_t *setting);
+
+ int (*setting_get_int_elem) (const struct config_setting_t *setting, int idx);
+ int64 (*setting_get_int64_elem) (const struct config_setting_t *setting, int idx);
+ double (*setting_get_float_elem) (const struct config_setting_t *setting, int idx);
+ int (*setting_get_bool_elem) (const struct config_setting_t *setting, int idx);
+ const char * (*setting_get_string_elem) (const struct config_setting_t *setting, int idx);
+ struct config_setting_t * (*setting_set_int_elem) (struct config_setting_t *setting, int idx, int value);
+ struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, int64 value);
+ struct config_setting_t * (*setting_set_float_elem) (struct config_setting_t *setting, int idx, double value);
+ struct config_setting_t * (*setting_set_bool_elem) (struct config_setting_t *setting, int idx, int value);
+ struct config_setting_t * (*setting_set_string_elem) (struct config_setting_t *setting, int idx, const char *value);
+
+ int (*setting_index) (const struct config_setting_t *setting);
+ int (*setting_length) (const struct config_setting_t *setting);
+
+ struct config_setting_t * (*setting_get_elem) (const struct config_setting_t *setting, unsigned int idx);
+ struct config_setting_t * (*setting_get_member) (const struct config_setting_t *setting, const char *name);
+
+ struct config_setting_t * (*setting_add) (struct config_setting_t *parent, const char *name, int type);
+ int (*setting_remove) (struct config_setting_t *parent, const char *name);
+
+ int (*setting_remove_elem) (struct config_setting_t *parent, unsigned int idx);
+ void (*setting_set_hook) (struct config_setting_t *setting, void *hook);
+
+ struct config_setting_t * (*lookup) (const struct config_t *config, const char *filepath);
+ int (*lookup_int) (const struct config_t *config, const char *filepath, int *value);
+ int (*lookup_int64) (const struct config_t *config, const char *filepath, int64 *value);
+ int (*lookup_float) (const struct config_t *config, const char *filepath, double *value);
+ int (*lookup_bool) (const struct config_t *config, const char *filepath, int *value);
+ int (*lookup_string) (const struct config_t *config, const char *filepath, const char **value);
/* those are custom and are from src/common/conf.c */
/* Functions to copy settings from libconfig/contrib */
- int (*read_file) (config_t *config, const char *config_filename);
- void (*setting_copy_simple) (config_setting_t *parent, const config_setting_t *src);
- void (*setting_copy_elem) (config_setting_t *parent, const config_setting_t *src);
- void (*setting_copy_aggregate) (config_setting_t *parent, const config_setting_t *src);
- int (*setting_copy) (config_setting_t *parent, const config_setting_t *src);
+ int (*load_file) (struct config_t *config, const char *config_filename);
+ void (*setting_copy_simple) (struct config_setting_t *parent, const struct config_setting_t *src);
+ void (*setting_copy_elem) (struct config_setting_t *parent, const struct config_setting_t *src);
+ void (*setting_copy_aggregate) (struct config_setting_t *parent, const struct config_setting_t *src);
+ int (*setting_copy) (struct config_setting_t *parent, const struct config_setting_t *src);
+ /* Functions to get other types */
+ bool (*setting_get_bool_real) (const struct config_setting_t *setting);
+ uint32 (*setting_get_uint32) (const struct config_setting_t *setting);
+ uint16 (*setting_get_uint16) (const struct config_setting_t *setting);
+ int16 (*setting_get_int16) (const struct config_setting_t *setting);
+
+ int (*setting_lookup_bool_real) (const struct config_setting_t *setting, const char *name, bool *value);
+ int (*setting_lookup_uint32) (const struct config_setting_t *setting, const char *name, uint32 *value);
+ int (*setting_lookup_uint16) (const struct config_setting_t *setting, const char *name, uint16 *value);
+ int (*setting_lookup_int16) (const struct config_setting_t *setting, const char *name, int16 *value);
+ int (*setting_lookup_mutable_string) (const struct config_setting_t *setting, const char *name, char *out, size_t out_size);
+ int (*lookup_mutable_string) (const struct config_t *config, const char *name, char *out, size_t out_size);
};
#ifdef HERCULES_CORE
diff --git a/src/common/console.c b/src/common/console.c
index f0702d0da..0f79b9494 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -57,6 +57,7 @@ struct console_interface console_s;
struct console_interface *console;
#ifdef CONSOLE_INPUT
struct console_input_interface console_input_s;
+struct spin_lock console_ptlock_s;
struct {
char queue[CONSOLE_PARSE_SIZE][MAX_CONSOLE_INPUT];
@@ -67,7 +68,8 @@ struct {
/*======================================
* CORE : Display title
*--------------------------------------*/
-void display_title(void) {
+void display_title(void)
+{
const char *vcstype = sysinfo->vcstype();
ShowMessage("\n");
@@ -90,6 +92,7 @@ void display_title(void) {
ShowInfo("CPU: '"CL_WHITE"%s [%d]"CL_RESET"'\n", sysinfo->cpu(), sysinfo->cpucores());
ShowInfo("Compiled with %s\n", sysinfo->compiler());
ShowInfo("Compile Flags: %s\n", sysinfo->cflags());
+ ShowInfo("Timer Function Type: %s\n", sysinfo->time());
}
/**
@@ -97,7 +100,7 @@ void display_title(void) {
*/
void display_gplnotice(void)
{
- ShowInfo("Hercules, Copyright (C) 2012-2015, Hercules Dev Team and others.\n");
+ ShowInfo("Hercules, Copyright (C) 2012-2016, Hercules Dev Team and others.\n");
ShowInfo("Licensed under the GNU General Public License, version 3 or later.\n");
}
@@ -128,21 +131,24 @@ int console_parse_key_pressed(void)
/**
* Stops server
**/
-CPCMD_C(exit,server) {
+CPCMD_C(exit, server)
+{
core->runflag = 0;
}
/**
* Displays ERS-related statistics (Entry Reusage System)
**/
-CPCMD_C(ers_report,server) {
+CPCMD_C(ers_report, server)
+{
ers_report();
}
/**
* Displays memory usage
**/
-CPCMD_C(mem_report,server) {
+CPCMD_C(mem_report, server)
+{
#ifdef USE_MEMMGR
memmgr_report(line?atoi(line):0);
#endif
@@ -169,7 +175,8 @@ CPCMD(help)
* [Ind/Hercules]
* Displays current malloc usage
*/
-CPCMD_C(malloc_usage,server) {
+CPCMD_C(malloc_usage, server)
+{
unsigned int val = (unsigned int)iMalloc->usage();
ShowInfo("malloc_usage: %.2f MB\n",(double)(val)/1024);
}
@@ -178,7 +185,8 @@ CPCMD_C(malloc_usage,server) {
* Skips an sql update
* Usage: sql update skip UPDATE-FILE.sql
**/
-CPCMD_C(skip,update) {
+CPCMD_C(skip, update)
+{
if( !line ) {
ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n");
return;
@@ -309,6 +317,7 @@ void console_parse_create(char *name, CParseFunc func)
char sublist[CP_CMD_LENGTH * 5];
struct CParseEntry *cmd;
+ nullpo_retv(name);
safestrncpy(sublist, name, CP_CMD_LENGTH * 5);
tok = strtok(sublist,":");
@@ -362,6 +371,7 @@ void console_parse_list_subs(struct CParseEntry *cmd, unsigned char depth)
{
int i;
char msg[CP_CMD_LENGTH * 2];
+ nullpo_retv(cmd);
Assert_retv(cmd->type == CPET_CATEGORY);
for (i = 0; i < VECTOR_LENGTH(cmd->u.children); i++) {
struct CParseEntry *child = VECTOR_INDEX(cmd->u.children, i);
@@ -389,6 +399,7 @@ void console_parse_sub(char *line)
char sublist[CP_CMD_LENGTH * 5];
int i;
+ nullpo_retv(line);
memcpy(bline, line, 200);
tok = strtok(line, " ");
@@ -442,9 +453,12 @@ void console_parse_sub(char *line)
}
ShowError("Is only a category, type '"CL_WHITE"%s help"CL_RESET"' to list its subcommands\n",sublist);
}
-void console_parse(char* line) {
+
+void console_parse(char *line)
+{
int c, i = 0, len = MAX_CONSOLE_INPUT - 1;/* we leave room for the \0 :P */
+ nullpo_retv(line);
while( (c = fgetc(stdin)) != EOF ) {
if( --len == 0 )
break;
@@ -456,65 +470,73 @@ void console_parse(char* line) {
line[i++] = '\0';
}
-void *cThread_main(void *x) {
+
+void *cThread_main(void *x)
+{
while( console->input->ptstate ) {/* loopx */
if( console->input->key_pressed() ) {
char input[MAX_CONSOLE_INPUT];
console->input->parse(input);
if( input[0] != '\0' ) {/* did we get something? */
- EnterSpinLock(&console->input->ptlock);
+ EnterSpinLock(console->input->ptlock);
if( cinput.count == CONSOLE_PARSE_SIZE ) {
- LeaveSpinLock(&console->input->ptlock);
+ LeaveSpinLock(console->input->ptlock);
continue;/* drop */
}
safestrncpy(cinput.queue[cinput.count++],input,MAX_CONSOLE_INPUT);
- LeaveSpinLock(&console->input->ptlock);
+ LeaveSpinLock(console->input->ptlock);
}
}
- ramutex_lock( console->input->ptmutex );
- racond_wait( console->input->ptcond, console->input->ptmutex, -1 );
- ramutex_unlock( console->input->ptmutex );
+ mutex->lock(console->input->ptmutex);
+ mutex->cond_wait(console->input->ptcond, console->input->ptmutex, -1);
+ mutex->unlock(console->input->ptmutex);
}
return NULL;
}
-int console_parse_timer(int tid, int64 tick, int id, intptr_t data) {
+
+int console_parse_timer(int tid, int64 tick, int id, intptr_t data)
+{
int i;
- EnterSpinLock(&console->input->ptlock);
+ EnterSpinLock(console->input->ptlock);
for(i = 0; i < cinput.count; i++) {
console->input->parse_sub(cinput.queue[i]);
}
cinput.count = 0;
- LeaveSpinLock(&console->input->ptlock);
- racond_signal(console->input->ptcond);
+ LeaveSpinLock(console->input->ptlock);
+ mutex->cond_signal(console->input->ptcond);
return 0;
}
-void console_parse_final(void) {
+
+void console_parse_final(void)
+{
if( console->input->ptstate ) {
InterlockedDecrement(&console->input->ptstate);
- racond_signal(console->input->ptcond);
+ mutex->cond_signal(console->input->ptcond);
/* wait for thread to close */
- rathread_wait(console->input->pthread, NULL);
+ thread->wait(console->input->pthread, NULL);
- racond_destroy(console->input->ptcond);
- ramutex_destroy(console->input->ptmutex);
+ mutex->cond_destroy(console->input->ptcond);
+ mutex->destroy(console->input->ptmutex);
}
}
-void console_parse_init(void) {
+
+void console_parse_init(void)
+{
cinput.count = 0;
console->input->ptstate = 1;
- InitializeSpinLock(&console->input->ptlock);
+ InitializeSpinLock(console->input->ptlock);
- console->input->ptmutex = ramutex_create();
- console->input->ptcond = racond_create();
+ console->input->ptmutex = mutex->create();
+ console->input->ptcond = mutex->cond_create();
- if( (console->input->pthread = rathread_create(console->input->pthread_main, NULL)) == NULL ){
+ if( (console->input->pthread = thread->create(console->input->pthread_main, NULL)) == NULL ){
ShowFatalError("console_parse_init: failed to spawn console_parse thread.\n");
exit(EXIT_FAILURE);
}
@@ -522,7 +544,9 @@ void console_parse_init(void) {
timer->add_func_list(console->input->parse_timer, "console_parse_timer");
timer->add_interval(timer->gettick() + 1000, console->input->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */
}
-void console_setSQL(Sql *SQL_handle) {
+
+void console_setSQL(struct Sql *SQL_handle)
+{
console->input->SQL = SQL_handle;
}
#endif /* CONSOLE_INPUT */
@@ -561,6 +585,7 @@ void console_defaults(void)
console->display_gplnotice = display_gplnotice;
#ifdef CONSOLE_INPUT
console->input = &console_input_s;
+ console->input->ptlock = &console_ptlock_s;
console->input->parse_init = console_parse_init;
console->input->parse_final = console_parse_final;
console->input->parse_timer = console_parse_timer;
diff --git a/src/common/console.h b/src/common/console.h
index 43f48b865..dd3a9cf2e 100644
--- a/src/common/console.h
+++ b/src/common/console.h
@@ -22,10 +22,14 @@
#include "common/hercules.h"
#include "common/db.h"
-#include "common/mutex.h"
#include "common/spinlock.h"
-#include "common/sql.h"
-#include "common/thread.h"
+
+/* Forward Declarations */
+struct Sql; // common/sql.h
+struct cond_data;
+struct mutex_data;
+struct spin_lock;
+struct thread_handle;
/**
* Queue Max
@@ -69,16 +73,16 @@ struct CParseEntry {
struct console_input_interface {
#ifdef CONSOLE_INPUT
/* vars */
- SPIN_LOCK ptlock;/* parse thread lock */
- rAthread *pthread;/* parse thread */
- volatile int32 ptstate;/* parse thread state */
- ramutex *ptmutex;/* parse thread mutex */
- racond *ptcond;/* parse thread cond */
+ struct spin_lock *ptlock; ///< parse thread lock.
+ struct thread_handle *pthread; ///< parse thread.
+ volatile int32 ptstate; ///< parse thread state.
+ struct mutex_data *ptmutex; ///< parse thread mutex.
+ struct cond_data *ptcond; ///< parse thread conditional variable.
/* */
VECTOR_DECL(struct CParseEntry *) command_list;
VECTOR_DECL(struct CParseEntry *) commands;
/* */
- Sql *SQL;
+ struct Sql *SQL;
/* */
void (*parse_init) (void);
void (*parse_final) (void);
@@ -90,7 +94,7 @@ struct console_input_interface {
void (*load_defaults) (void);
void (*parse_list_subs) (struct CParseEntry *cmd, unsigned char depth);
void (*addCommand) (char *name, CParseFunc func);
- void (*setSQL) (Sql *SQL_handle);
+ void (*setSQL) (struct Sql *SQL_handle);
#else // not CONSOLE_INPUT
UNAVAILABLE_STRUCT;
#endif
diff --git a/src/common/core.c b/src/common/core.c
index 201d4f5e8..9a131d042 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -26,23 +26,27 @@
#include "common/cbasetypes.h"
#include "common/console.h"
#include "common/db.h"
+#include "common/des.h"
+#include "common/grfio.h"
#include "common/memmgr.h"
#include "common/mmo.h"
-#include "common/random.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
#include "common/sysinfo.h"
-#include "common/nullpo.h"
+#include "common/timer.h"
+#include "common/utils.h"
#ifndef MINICORE
# include "common/HPM.h"
# include "common/conf.h"
# include "common/ers.h"
+# include "common/md5calc.h"
+# include "common/mutex.h"
+# include "common/random.h"
# include "common/socket.h"
# include "common/sql.h"
# include "common/thread.h"
-# include "common/timer.h"
-# include "common/utils.h"
#endif
#ifndef _WIN32
@@ -54,6 +58,28 @@
#include <stdio.h>
#include <stdlib.h>
+/*
+ * Uncomment the line below if you want to silence the root warning on startup
+ * (not recommended, as it opens the machine to security risks. You should
+ * never ever run software as root unless it requires the extra privileges
+ * (which Hercules does not.)
+ * More info:
+ * http://www.tldp.org/HOWTO/Security-HOWTO/local-security.html
+ * http://www.gentoo.org/doc/en/security/security-handbook.xml?style=printable&part=1&chap=1#doc_chap4
+ * http://wiki.centos.org/TipsAndTricks/BecomingRoot
+ * http://fedoraproject.org/wiki/Configuring_Sudo
+ * https://help.ubuntu.com/community/RootSudo
+ * http://www.freebsdwiki.net/index.php/Root
+ *
+ * If your service provider forces (or encourages) you to run server software
+ * as root, please complain to them before and after uncommenting this line,
+ * since it is a very bad idea.
+ * Please note that NO SUPPORT will be given if you uncomment the following line.
+ */
+//#define I_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT
+// And don't complain to us if the XYZ plugin you installed wiped your hard disk, or worse.
+// Note: This feature is deprecated, and should not be used.
+
/// Called when a terminate signal is received.
void (*shutdown_callback)(void) = NULL;
@@ -74,7 +100,8 @@ struct core_interface *core = &core_s;
#ifndef POSIX
#define compat_signal(signo, func) signal((signo), (func))
#else
-sigfunc *compat_signal(int signo, sigfunc *func) {
+sigfunc *compat_signal(int signo, sigfunc *func)
+{
struct sigaction sact, oact;
sact.sa_handler = func;
@@ -95,7 +122,8 @@ sigfunc *compat_signal(int signo, sigfunc *func) {
* CORE : Console events for Windows
*--------------------------------------*/
#ifdef _WIN32
-static BOOL WINAPI console_handler(DWORD c_event) {
+static BOOL WINAPI console_handler(DWORD c_event)
+{
switch(c_event) {
case CTRL_CLOSE_EVENT:
case CTRL_LOGOFF_EVENT:
@@ -111,7 +139,8 @@ static BOOL WINAPI console_handler(DWORD c_event) {
return TRUE;
}
-static void cevents_init(void) {
+static void cevents_init(void)
+{
if (SetConsoleCtrlHandler(console_handler,TRUE)==FALSE)
ShowWarning ("Unable to install the console handler!\n");
}
@@ -120,7 +149,8 @@ static void cevents_init(void) {
/*======================================
* CORE : Signal Sub Function
*--------------------------------------*/
-static void sig_proc(int sn) {
+static void sig_proc(int sn)
+{
static int is_called = 0;
switch (sn) {
@@ -153,7 +183,8 @@ static void sig_proc(int sn) {
}
}
-void signals_init (void) {
+void signals_init (void)
+{
compat_signal(SIGTERM, sig_proc);
compat_signal(SIGINT, sig_proc);
#ifndef _DEBUG // need unhandled exceptions to debug on Windows
@@ -172,14 +203,55 @@ void signals_init (void) {
/**
* Warns the user if executed as superuser (root)
+ *
+ * @retval false if the check didn't pass and the program should be terminated.
*/
-void usercheck(void) {
+bool usercheck(void)
+{
+#ifndef _WIN32
if (sysinfo->is_superuser()) {
- ShowWarning("You are running Hercules with root privileges, it is not necessary.\n");
+ if (!isatty(fileno(stdin))) {
+#ifdef BUILDBOT
+ return true;
+#else // BUILDBOT
+ ShowFatalError("You are running Hercules with root privileges, it is not necessary, nor recommended. "
+ "Aborting.\n");
+ return false; // Don't allow noninteractive execution regardless.
+#endif // BUILDBOT
+ }
+ ShowError("You are running Hercules with root privileges, it is not necessary, nor recommended.\n");
+#ifdef I_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT
+#ifndef BUILDBOT
+#warning This Hercules build is not eligible to obtain support by the developers.
+#warning The setting I_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT is deprecated and should not be used.
+#endif // BUILDBOT
+#else // not I_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT
+ ShowNotice("Execution will be paused for 60 seconds. Press Ctrl-C if you wish to quit.\n");
+ ShowNotice("If you want to get rid of this message, please open %s and uncomment, near the top, the line saying:\n"
+ "\t\"//#define I_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT\"\n", __FILE__);
+ ShowNotice("Note: In a near future, this courtesy notice will go away. "
+ "Please update your infrastructure not to require root privileges before then.\n");
+ ShowWarning("It's recommended that you " CL_WHITE "press CTRL-C now!" CL_RESET "\n");
+ {
+ int i;
+ for (i = 0; i < 60; i++) {
+ ShowMessage("\a *");
+ HSleep(1);
+ }
+ }
+ ShowMessage("\n");
+ ShowNotice("Resuming operations with root privileges. "
+ CL_RED "If anything breaks, you get to keep the pieces, "
+ "and the Hercules developers won't be able to help you."
+ CL_RESET "\n");
+#endif // I_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT
}
+#endif // not _WIN32
+ return true;
}
-void core_defaults(void) {
+void core_defaults(void)
+{
nullpo_defaults();
#ifndef MINICORE
hpm_defaults();
@@ -191,24 +263,34 @@ void core_defaults(void) {
malloc_defaults();
showmsg_defaults();
cmdline_defaults();
+ des_defaults();
+ grfio_defaults(); // Note: grfio is lazily loaded. grfio->init() and grfio->final() are not automatically called.
#ifndef MINICORE
+ mutex_defaults();
libconfig_defaults();
sql_defaults();
timer_defaults();
db_defaults();
socket_defaults();
+ rnd_defaults();
+ md5_defaults();
+ thread_defaults();
#endif
}
+
/**
* Returns the source (core or plugin name) for the given command-line argument
*/
-const char *cmdline_arg_source(struct CmdlineArgData *arg) {
+const char *cmdline_arg_source(struct CmdlineArgData *arg)
+{
#ifdef MINICORE
return "core";
#else // !MINICORE
+ nullpo_retr(NULL, arg);
return HPM->pid2name(arg->pluginID);
#endif // MINICORE
}
+
/**
* Defines a command line argument.
*
@@ -220,9 +302,11 @@ const char *cmdline_arg_source(struct CmdlineArgData *arg) {
* @param options options associated to the command-line argument. @see enum cmdline_options.
* @return the success status.
*/
-bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) {
+bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options)
+{
struct CmdlineArgData *data = NULL;
+ nullpo_retr(false, name);
VECTOR_ENSURE(cmdline->args_data, 1, 1);
VECTOR_PUSHZEROED(cmdline->args_data);
data = &VECTOR_LAST(cmdline->args_data);
@@ -230,11 +314,15 @@ bool cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, Cm
data->name = aStrdup(name);
data->shortname = shortname;
data->func = func;
- data->help = aStrdup(help);
+ if (help)
+ data->help = aStrdup(help);
+ else
+ data->help = NULL;
data->options = options;
return true;
}
+
/**
* Help screen to be displayed by '--help'.
*/
@@ -258,6 +346,7 @@ static CMDLINEARG(help)
}
return false;
}
+
/**
* Info screen to be displayed by '--version'.
*/
@@ -268,6 +357,7 @@ static CMDLINEARG(version)
ShowInfo("Open "CL_WHITE"readme.txt"CL_RESET" for more information.\n");
return false;
}
+
/**
* Checks if there is a value available for the current argument
*
@@ -285,6 +375,7 @@ bool cmdline_arg_next_value(const char *name, int current_arg, int argc)
return true;
}
+
/**
* Executes the command line arguments handlers.
*
@@ -306,11 +397,15 @@ bool cmdline_arg_next_value(const char *name, int current_arg, int argc)
int cmdline_exec(int argc, char **argv, unsigned int options)
{
int count = 0, i;
+
+ nullpo_ret(argv);
for (i = 1; i < argc; i++) {
int j;
struct CmdlineArgData *data = NULL;
const char *arg = argv[i];
if (arg[0] != '-') { // All arguments must begin with '-'
+ if ((options&(CMDLINE_OPT_SILENT|CMDLINE_OPT_PREINIT)) != 0)
+ continue;
ShowError("Invalid option '%s'.\n", argv[i]);
exit(EXIT_FAILURE);
}
@@ -348,6 +443,7 @@ int cmdline_exec(int argc, char **argv, unsigned int options)
}
return count;
}
+
/**
* Defines the global command-line arguments.
*/
@@ -391,10 +487,12 @@ void cmdline_defaults(void)
cmdline->arg_next_value = cmdline_arg_next_value;
cmdline->arg_source = cmdline_arg_source;
}
+
/*======================================
* CORE : MAINROUTINE
*--------------------------------------*/
-int main (int argc, char **argv) {
+int main (int argc, char **argv)
+{
int retval = EXIT_SUCCESS;
{// initialize program arguments
char *p1 = SERVER_NAME = argv[0];
@@ -423,7 +521,8 @@ int main (int argc, char **argv) {
if (!(showmsg->silent&0x1))
console->display_title();
- usercheck();
+ if (!usercheck())
+ return EXIT_FAILURE;
#ifdef MINICORE // minimalist Core
do_init(argc,argv);
@@ -432,7 +531,7 @@ int main (int argc, char **argv) {
set_server_type();
Sql_Init();
- rathread_init();
+ thread->init();
DB->init();
signals_init();
@@ -443,8 +542,7 @@ int main (int argc, char **argv) {
timer->init();
/* timer first */
- rnd_init();
- srand((unsigned int)timer->gettick());
+ rnd->init();
console->init();
@@ -469,8 +567,9 @@ int main (int argc, char **argv) {
timer->final();
sockt->final();
DB->final();
- rathread_final();
+ thread->final();
ers_final();
+ rnd->final();
#endif
cmdline->final();
//sysinfo->final(); Called by iMalloc->final()
diff --git a/src/common/core.h b/src/common/core.h
index 4aaa6cfac..a8726fcef 100644
--- a/src/common/core.h
+++ b/src/common/core.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/common/db.c b/src/common/db.c
index ca9a70f7c..91592fdac 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,7 +21,7 @@
/*****************************************************************************\
* This file is separated in five sections:
- * (1) Private typedefs, enums, structures, defines and global variables
+ * (1) Private enums, structures, defines and global variables
* (2) Private functions
* (3) Protected functions used internally
* (4) Protected functions used in the interface of the database
@@ -93,6 +93,7 @@
#include "common/ers.h"
#include "common/memmgr.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
@@ -102,17 +103,17 @@
struct db_interface DB_s;
struct db_interface *DB;
-/*****************************************************************************\
- * (1) Private typedefs, enums, structures, defines and global variables of *
- * the database system. *
- * DB_ENABLE_STATS - Define to enable database statistics. *
- * HASH_SIZE - Define with the size of the hashtable. *
- * DBNColor - Enumeration of colors of the nodes. *
- * DBNode - Structure of a node in RED-BLACK trees. *
- * struct db_free - Structure that holds a deleted node to be freed. *
- * DBMap_impl - Structure of the database. *
- * stats - Statistics about the database system. *
-\*****************************************************************************/
+/*****************************************************************************
+ * (1) Private enums, structures, defines and global variables of the *
+ * database system. *
+ * DB_ENABLE_STATS - Define to enable database statistics. *
+ * HASH_SIZE - Define with the size of the hashtable. *
+ * enum DBNodeColor - Enumeration of colors of the nodes. *
+ * struct DBNode - Structure of a node in RED-BLACK trees. *
+ * struct db_free - Structure that holds a deleted node to be freed. *
+ * struct DBMap_impl - Structure of the database. *
+ * stats - Statistics about the database system. *
+ *****************************************************************************/
/**
* If defined statistics about database nodes, database creating/destruction
@@ -129,19 +130,19 @@ struct db_interface *DB;
/**
* Size of the hashtable in the database.
* @private
- * @see DBMap_impl#ht
+ * @see struct DBMap_impl#ht
*/
#define HASH_SIZE (256+27)
/**
* The color of individual nodes.
* @private
- * @see struct dbn
+ * @see struct DBNode
*/
-typedef enum node_color {
+enum DBNodeColor {
RED,
- BLACK
-} node_color;
+ BLACK,
+};
/**
* A node in a RED-BLACK tree of the database.
@@ -153,31 +154,31 @@ typedef enum node_color {
* @param deleted If the node is deleted
* @param color Color of the node
* @private
- * @see DBMap_impl#ht
+ * @see struct DBMap_impl#ht
*/
-typedef struct dbn {
+struct DBNode {
// Tree structure
- struct dbn *parent;
- struct dbn *left;
- struct dbn *right;
+ struct DBNode *parent;
+ struct DBNode *left;
+ struct DBNode *right;
// Node data
- DBKey key;
- DBData data;
+ union DBKey key;
+ struct DBData data;
// Other
- node_color color;
+ enum DBNodeColor color;
unsigned deleted : 1;
-} DBNode;
+};
/**
* Structure that holds a deleted node.
* @param node Deleted node
* @param root Address to the root of the tree
* @private
- * @see DBMap_impl#free_list
+ * @see struct DBMap_impl#free_list
*/
struct db_free {
- DBNode *node;
- DBNode **root;
+ struct DBNode *node;
+ struct DBNode **root;
};
/**
@@ -200,9 +201,9 @@ struct db_free {
* @param maxlen Maximum length of strings in DB_STRING and DB_ISTRING databases
* @param global_lock Global lock of the database
* @private
- * @see #db_alloc(const char*,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc()
*/
-typedef struct DBMap_impl {
+struct DBMap_impl {
// Database interface
struct DBMap vtable;
// File and line of allocation
@@ -218,14 +219,14 @@ typedef struct DBMap_impl {
DBComparator cmp;
DBHasher hash;
DBReleaser release;
- DBNode *ht[HASH_SIZE];
- DBNode *cache;
- DBType type;
- DBOptions options;
+ struct DBNode *ht[HASH_SIZE];
+ struct DBNode *cache;
+ enum DBType type;
+ enum DBOptions options;
uint32 item_count;
unsigned short maxlen;
unsigned global_lock : 1;
-} DBMap_impl;
+};
/**
* Complete iterator structure.
@@ -234,17 +235,17 @@ typedef struct DBMap_impl {
* @param ht_index Current index of the hashtable
* @param node Current node
* @private
- * @see #DBIterator
- * @see #DBMap_impl
- * @see #DBNode
+ * @see struct DBIterator
+ * @see struct DBMap_impl
+ * @see struct DBNode
*/
-typedef struct DBIterator_impl {
+struct DBIterator_impl {
// Iterator interface
struct DBIterator vtable;
- DBMap_impl* db;
+ struct DBMap_impl *db;
int ht_index;
- DBNode *node;
-} DBIterator_impl;
+ struct DBNode *node;
+};
#if defined(DB_ENABLE_STATS)
/**
@@ -382,12 +383,12 @@ struct eri *db_alloc_ers;
* @param node Node to be rotated
* @param root Pointer to the root of the tree
* @private
- * @see #db_rebalance(DBNode *,DBNode **)
- * @see #db_rebalance_erase(DBNode *,DBNode **)
+ * @see #db_rebalance()
+ * @see #db_rebalance_erase()
*/
-static void db_rotate_left(DBNode *node, DBNode **root)
+static void db_rotate_left(struct DBNode *node, struct DBNode **root)
{
- DBNode *y = node->right;
+ struct DBNode *y = node->right;
DB_COUNTSTAT(db_rotate_left);
// put the left of y at the right of node
@@ -413,12 +414,12 @@ static void db_rotate_left(DBNode *node, DBNode **root)
* @param node Node to be rotated
* @param root Pointer to the root of the tree
* @private
- * @see #db_rebalance(DBNode *,DBNode **)
- * @see #db_rebalance_erase(DBNode *,DBNode **)
+ * @see #db_rebalance()
+ * @see #db_rebalance_erase()
*/
-static void db_rotate_right(DBNode *node, DBNode **root)
+static void db_rotate_right(struct DBNode *node, struct DBNode **root)
{
- DBNode *y = node->left;
+ struct DBNode *y = node->left;
DB_COUNTSTAT(db_rotate_right);
// put the right of y at the left of node
@@ -445,13 +446,13 @@ static void db_rotate_right(DBNode *node, DBNode **root)
* @param node Node to be rebalanced
* @param root Pointer to the root of the tree
* @private
- * @see #db_rotate_left(DBNode *,DBNode **)
- * @see #db_rotate_right(DBNode *,DBNode **)
- * @see #db_obj_put(DBMap*,DBKey,DBData)
+ * @see #db_rotate_left()
+ * @see #db_rotate_right()
+ * @see #db_obj_put()
*/
-static void db_rebalance(DBNode *node, DBNode **root)
+static void db_rebalance(struct DBNode *node, struct DBNode **root)
{
- DBNode *y;
+ struct DBNode *y;
DB_COUNTSTAT(db_rebalance);
// Restore the RED-BLACK properties
@@ -507,15 +508,15 @@ static void db_rebalance(DBNode *node, DBNode **root)
* @param node Node to be erased from the tree
* @param root Root of the tree
* @private
- * @see #db_rotate_left(DBNode *,DBNode **)
- * @see #db_rotate_right(DBNode *,DBNode **)
- * @see #db_free_unlock(DBMap_impl*)
+ * @see #db_rotate_left()
+ * @see #db_rotate_right()
+ * @see #db_free_unlock()
*/
-static void db_rebalance_erase(DBNode *node, DBNode **root)
+static void db_rebalance_erase(struct DBNode *node, struct DBNode **root)
{
- DBNode *y = node;
- DBNode *x = NULL;
- DBNode *x_parent = NULL;
+ struct DBNode *y = node;
+ struct DBNode *x = NULL;
+ struct DBNode *x_parent = NULL;
DB_COUNTSTAT(db_rebalance_erase);
// Select where to change the tree
@@ -561,7 +562,7 @@ static void db_rebalance_erase(DBNode *node, DBNode **root)
y->parent = node->parent;
// switch colors
{
- node_color tmp = y->color;
+ enum DBNodeColor tmp = y->color;
y->color = node->color;
node->color = tmp;
}
@@ -583,7 +584,7 @@ static void db_rebalance_erase(DBNode *node, DBNode **root)
// Restore the RED-BLACK properties
if (y->color != RED) {
while (x != *root && (x == NULL || x->color == BLACK)) {
- DBNode *w;
+ struct DBNode *w;
if (x == x_parent->left) {
w = x_parent->right;
if (w->color == RED) {
@@ -648,11 +649,11 @@ static void db_rebalance_erase(DBNode *node, DBNode **root)
* @param key Key being tested
* @return not 0 if considered NULL, 0 otherwise
* @private
- * @see #db_obj_get(DBMap*,DBKey)
- * @see #db_obj_put(DBMap*,DBKey,DBData)
- * @see #db_obj_remove(DBMap*,DBKey)
+ * @see #db_obj_get()
+ * @see #db_obj_put()
+ * @see #db_obj_remove()
*/
-static int db_is_key_null(DBType type, DBKey key)
+static int db_is_key_null(enum DBType type, union DBKey key)
{
DB_COUNTSTAT(db_is_key_null);
switch (type) {
@@ -671,26 +672,26 @@ static int db_is_key_null(DBType type, DBKey key)
* @param key Key to be duplicated
* @param Duplicated key
* @private
- * @see #db_free_add(DBMap_impl*,DBNode *,DBNode **)
- * @see #db_free_remove(DBMap_impl*,DBNode *)
- * @see #db_obj_put(DBMap*,DBKey,void *)
- * @see #db_dup_key_free(DBMap_impl*,DBKey)
+ * @see #db_free_add()
+ * @see #db_free_remove()
+ * @see #db_obj_put()
+ * @see #db_dup_key_free()
*/
-static DBKey db_dup_key(DBMap_impl* db, DBKey key)
+static union DBKey db_dup_key(struct DBMap_impl *db, union DBKey key)
{
- char *str;
- size_t len;
-
DB_COUNTSTAT(db_dup_key);
switch (db->type) {
case DB_STRING:
case DB_ISTRING:
- len = strnlen(key.str, db->maxlen);
- str = (char*)aMalloc(len + 1);
+ {
+ size_t len = strnlen(key.str, db->maxlen);
+ char *str = aMalloc(len + 1);
+
memcpy(str, key.str, len);
str[len] = '\0';
- key.str = str;
+ key.mutstr = str;
return key;
+ }
default:
return key;
@@ -702,15 +703,15 @@ static DBKey db_dup_key(DBMap_impl* db, DBKey key)
* @param db Database the key is being used in
* @param key Key to be freed
* @private
- * @see #db_dup_key(DBMap_impl*,DBKey)
+ * @see #db_dup_key()
*/
-static void db_dup_key_free(DBMap_impl* db, DBKey key)
+static void db_dup_key_free(struct DBMap_impl *db, union DBKey key)
{
DB_COUNTSTAT(db_dup_key_free);
switch (db->type) {
case DB_STRING:
case DB_ISTRING:
- aFree((char*)key.str);
+ aFree(key.mutstr);
return;
default:
@@ -727,15 +728,15 @@ static void db_dup_key_free(DBMap_impl* db, DBKey key)
* @param node Target node
* @private
* @see #struct db_free
- * @see DBMap_impl#free_list
- * @see DBMap_impl#free_count
- * @see DBMap_impl#free_max
- * @see #db_obj_remove(DBMap*,DBKey)
- * @see #db_free_remove(DBMap_impl*,DBNode *)
+ * @see struct DBMap_impl#free_list
+ * @see struct DBMap_impl#free_count
+ * @see struct DBMap_impl#free_max
+ * @see #db_obj_remove()
+ * @see #db_free_remove()
*/
-static void db_free_add(DBMap_impl* db, DBNode *node, DBNode **root)
+static void db_free_add(struct DBMap_impl *db, struct DBNode *node, struct DBNode **root)
{
- DBKey old_key;
+ union DBKey old_key;
DB_COUNTSTAT(db_free_add);
if (db->free_lock == (unsigned int)~0) {
@@ -777,12 +778,12 @@ static void db_free_add(DBMap_impl* db, DBNode *node, DBNode **root)
* @param node Node being removed from free_list
* @private
* @see #struct db_free
- * @see DBMap_impl#free_list
- * @see DBMap_impl#free_count
- * @see #db_obj_put(DBMap*,DBKey,DBData)
- * @see #db_free_add(DBMap_impl*,DBNode**,DBNode*)
+ * @see struct DBMap_impl#free_list
+ * @see struct DBMap_impl#free_count
+ * @see #db_obj_put()
+ * @see #db_free_add()
*/
-static void db_free_remove(DBMap_impl* db, DBNode *node)
+static void db_free_remove(struct DBMap_impl *db, struct DBNode *node)
{
unsigned int i;
@@ -808,10 +809,10 @@ static void db_free_remove(DBMap_impl* db, DBNode *node)
* Increment the free_lock of the database.
* @param db Target database
* @private
- * @see DBMap_impl#free_lock
- * @see #db_unlock(DBMap_impl*)
+ * @see struct DBMap_impl#free_lock
+ * @see #db_unlock()
*/
-static void db_free_lock(DBMap_impl* db)
+static void db_free_lock(struct DBMap_impl *db)
{
DB_COUNTSTAT(db_free_lock);
if (db->free_lock == (unsigned int)~0) {
@@ -830,11 +831,11 @@ static void db_free_lock(DBMap_impl* db)
* NOTE: Frees the duplicated keys of the nodes
* @param db Target database
* @private
- * @see DBMap_impl#free_lock
- * @see #db_free_dbn(DBNode*)
- * @see #db_lock(DBMap_impl*)
+ * @see struct DBMap_impl#free_lock
+ * @see #db_free_dbn()
+ * @see #db_lock()
*/
-static void db_free_unlock(DBMap_impl* db)
+static void db_free_unlock(struct DBMap_impl *db)
{
unsigned int i;
@@ -889,11 +890,11 @@ static void db_free_unlock(DBMap_impl* db)
* @param key2 Key being compared to
* @param maxlen Maximum length of the key to hash
* @return 0 if equal, negative if lower and positive if higher
- * @see DBType#DB_INT
+ * @see enum DBType#DB_INT
* @see #DBComparator
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-static int db_int_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
+static int db_int_cmp(union DBKey key1, union DBKey key2, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_int_cmp);
@@ -911,11 +912,11 @@ static int db_int_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
* @param key2 Key being compared to
* @param maxlen Maximum length of the key to hash
* @return 0 if equal, negative if lower and positive if higher
- * @see DBType#DB_UINT
+ * @see enum DBType#DB_UINT
* @see #DBComparator
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-static int db_uint_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
+static int db_uint_cmp(union DBKey key1, union DBKey key2, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_uint_cmp);
@@ -932,11 +933,11 @@ static int db_uint_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
* @param key2 Key being compared to
* @param maxlen Maximum length of the key to hash
* @return 0 if equal, negative if lower and positive if higher
- * @see DBType#DB_STRING
+ * @see enum DBType#DB_STRING
* @see #DBComparator
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-static int db_string_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
+static int db_string_cmp(union DBKey key1, union DBKey key2, unsigned short maxlen)
{
DB_COUNTSTAT(db_string_cmp);
return strncmp((const char *)key1.str, (const char *)key2.str, maxlen);
@@ -950,11 +951,11 @@ static int db_string_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
* @param key2 Key being compared to
* @param maxlen Maximum length of the key to hash
* @return 0 if equal, negative if lower and positive if higher
- * @see DBType#DB_ISTRING
+ * @see enum DBType#DB_ISTRING
* @see #DBComparator
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-static int db_istring_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
+static int db_istring_cmp(union DBKey key1, union DBKey key2, unsigned short maxlen)
{
DB_COUNTSTAT(db_istring_cmp);
return strncasecmp((const char *)key1.str, (const char *)key2.str, maxlen);
@@ -969,11 +970,11 @@ static int db_istring_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
* @param key2 Key being compared to
* @param maxlen Maximum length of the key to hash
* @return 0 if equal, negative if lower and positive if higher
- * @see DBType#DB_INT64
+ * @see enum DBType#DB_INT64
* @see #DBComparator
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-static int db_int64_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
+static int db_int64_cmp(union DBKey key1, union DBKey key2, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_int64_cmp);
@@ -991,11 +992,11 @@ static int db_int64_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
* @param key2 Key being compared to
* @param maxlen Maximum length of the key to hash
* @return 0 if equal, negative if lower and positive if higher
- * @see DBType#DB_UINT64
+ * @see enum DBType#DB_UINT64
* @see #DBComparator
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-static int db_uint64_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
+static int db_uint64_cmp(union DBKey key1, union DBKey key2, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_uint64_cmp);
@@ -1012,11 +1013,11 @@ static int db_uint64_cmp(DBKey key1, DBKey key2, unsigned short maxlen)
* @param key Key to be hashed
* @param maxlen Maximum length of the key to hash
* @return hash of the key
- * @see DBType#DB_INT
+ * @see enum DBType#DB_INT
* @see #DBHasher
- * @see #db_default_hash(DBType)
+ * @see #db_default_hash()
*/
-static uint64 db_int_hash(DBKey key, unsigned short maxlen)
+static uint64 db_int_hash(union DBKey key, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_int_hash);
@@ -1030,11 +1031,11 @@ static uint64 db_int_hash(DBKey key, unsigned short maxlen)
* @param key Key to be hashed
* @param maxlen Maximum length of the key to hash
* @return hash of the key
- * @see DBType#DB_UINT
+ * @see enum DBType#DB_UINT
* @see #DBHasher
- * @see #db_default_hash(DBType)
+ * @see #db_default_hash()
*/
-static uint64 db_uint_hash(DBKey key, unsigned short maxlen)
+static uint64 db_uint_hash(union DBKey key, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_uint_hash);
@@ -1046,11 +1047,11 @@ static uint64 db_uint_hash(DBKey key, unsigned short maxlen)
* @param key Key to be hashed
* @param maxlen Maximum length of the key to hash
* @return hash of the key
- * @see DBType#DB_STRING
+ * @see enum DBType#DB_STRING
* @see #DBHasher
- * @see #db_default_hash(DBType)
+ * @see #db_default_hash()
*/
-static uint64 db_string_hash(DBKey key, unsigned short maxlen)
+static uint64 db_string_hash(union DBKey key, unsigned short maxlen)
{
const char *k = key.str;
unsigned int hash = 0;
@@ -1073,10 +1074,10 @@ static uint64 db_string_hash(DBKey key, unsigned short maxlen)
* @param key Key to be hashed
* @param maxlen Maximum length of the key to hash
* @return hash of the key
- * @see DBType#DB_ISTRING
- * @see #db_default_hash(DBType)
+ * @see enum DBType#DB_ISTRING
+ * @see #db_default_hash()
*/
-static uint64 db_istring_hash(DBKey key, unsigned short maxlen)
+static uint64 db_istring_hash(union DBKey key, unsigned short maxlen)
{
const char *k = key.str;
unsigned int hash = 0;
@@ -1101,11 +1102,11 @@ static uint64 db_istring_hash(DBKey key, unsigned short maxlen)
* @param key Key to be hashed
* @param maxlen Maximum length of the key to hash
* @return hash of the key
- * @see DBType#DB_INT64
+ * @see enum DBType#DB_INT64
* @see #DBHasher
- * @see #db_default_hash(DBType)
+ * @see #db_default_hash()
*/
-static uint64 db_int64_hash(DBKey key, unsigned short maxlen)
+static uint64 db_int64_hash(union DBKey key, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_int64_hash);
@@ -1119,11 +1120,11 @@ static uint64 db_int64_hash(DBKey key, unsigned short maxlen)
* @param key Key to be hashed
* @param maxlen Maximum length of the key to hash
* @return hash of the key
- * @see DBType#DB_UINT64
+ * @see enum DBType#DB_UINT64
* @see #DBHasher
- * @see #db_default_hash(DBType)
+ * @see #db_default_hash()
*/
-static uint64 db_uint64_hash(DBKey key, unsigned short maxlen)
+static uint64 db_uint64_hash(union DBKey key, unsigned short maxlen)
{
(void)maxlen;//not used
DB_COUNTSTAT(db_uint64_hash);
@@ -1137,9 +1138,9 @@ static uint64 db_uint64_hash(DBKey key, unsigned short maxlen)
* @param which What is being requested to be released
* @protected
* @see #DBReleaser
- * @see #db_default_releaser(DBType,DBOptions)
+ * @see #db_default_releaser()
*/
-static void db_release_nothing(DBKey key, DBData data, DBRelease which)
+static void db_release_nothing(union DBKey key, struct DBData data, enum DBReleaseOption which)
{
(void)key;(void)data;(void)which;//not used
DB_COUNTSTAT(db_release_nothing);
@@ -1152,13 +1153,14 @@ static void db_release_nothing(DBKey key, DBData data, DBRelease which)
* @param which What is being requested to be released
* @protected
* @see #DBReleaser
- * @see #db_default_release(DBType,DBOptions)
+ * @see #db_default_release()
*/
-static void db_release_key(DBKey key, DBData data, DBRelease which)
+static void db_release_key(union DBKey key, struct DBData data, enum DBReleaseOption which)
{
(void)data;//not used
DB_COUNTSTAT(db_release_key);
- if (which&DB_RELEASE_KEY) aFree((char*)key.str); // needs to be a pointer
+ if (which&DB_RELEASE_KEY)
+ aFree(key.mutstr); // FIXME: Ensure this is the right db type.
}
/**
@@ -1167,12 +1169,12 @@ static void db_release_key(DBKey key, DBData data, DBRelease which)
* @param data Data of the database entry
* @param which What is being requested to be released
* @protected
- * @see #DBData
- * @see #DBRelease
+ * @see struct DBData
+ * @see enum DBReleaseOption
* @see #DBReleaser
- * @see #db_default_release(DBType,DBOptions)
+ * @see #db_default_release()
*/
-static void db_release_data(DBKey key, DBData data, DBRelease which)
+static void db_release_data(union DBKey key, struct DBData data, enum DBReleaseOption which)
{
(void)key;//not used
DB_COUNTSTAT(db_release_data);
@@ -1188,16 +1190,17 @@ static void db_release_data(DBKey key, DBData data, DBRelease which)
* @param data Data of the database entry
* @param which What is being requested to be released
* @protected
- * @see #DBKey
- * @see #DBData
- * @see #DBRelease
+ * @see union DBKey
+ * @see struct DBData
+ * @see enum DBReleaseOption
* @see #DBReleaser
- * @see #db_default_release(DBType,DBOptions)
+ * @see #db_default_release()
*/
-static void db_release_both(DBKey key, DBData data, DBRelease which)
+static void db_release_both(union DBKey key, struct DBData data, enum DBReleaseOption which)
{
DB_COUNTSTAT(db_release_both);
- if (which&DB_RELEASE_KEY) aFree((char*)key.str); // needs to be a pointer
+ if (which&DB_RELEASE_KEY)
+ aFree(key.mutstr); // FIXME: Ensure this is the right db type.
if (which&DB_RELEASE_DATA && data.type == DB_DATA_PTR) {
aFree(data.u.ptr);
data.u.ptr = NULL;
@@ -1245,11 +1248,11 @@ static void db_release_both(DBKey key, DBData data, DBRelease which)
* @param out_key Key of the entry
* @return Data of the entry
* @protected
- * @see DBIterator#first
+ * @see struct DBIterator#first()
*/
-DBData* dbit_obj_first(DBIterator* self, DBKey* out_key)
+struct DBData *dbit_obj_first(struct DBIterator *self, union DBKey *out_key)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
DB_COUNTSTAT(dbit_first);
// position before the first entry
@@ -1267,11 +1270,11 @@ DBData* dbit_obj_first(DBIterator* self, DBKey* out_key)
* @param out_key Key of the entry
* @return Data of the entry
* @protected
- * @see DBIterator#last
+ * @see struct DBIterator#last()
*/
-DBData* dbit_obj_last(DBIterator* self, DBKey* out_key)
+struct DBData *dbit_obj_last(struct DBIterator *self, union DBKey *out_key)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
DB_COUNTSTAT(dbit_last);
// position after the last entry
@@ -1289,14 +1292,14 @@ DBData* dbit_obj_last(DBIterator* self, DBKey* out_key)
* @param out_key Key of the entry
* @return Data of the entry
* @protected
- * @see DBIterator#next
+ * @see struct DBIterator#next()
*/
-DBData* dbit_obj_next(DBIterator* self, DBKey* out_key)
+struct DBData *dbit_obj_next(struct DBIterator *self, union DBKey *out_key)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
- DBNode *node;
- DBNode *parent;
- struct dbn fake;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
+ struct DBNode *node;
+ struct DBNode *parent;
+ struct DBNode fake;
DB_COUNTSTAT(dbit_next);
if( it->ht_index < 0 )
@@ -1348,7 +1351,7 @@ DBData* dbit_obj_next(DBIterator* self, DBKey* out_key)
{// found next entry
it->node = node;
if( out_key )
- memcpy(out_key, &node->key, sizeof(DBKey));
+ memcpy(out_key, &node->key, sizeof(union DBKey));
return &node->data;
}
}
@@ -1365,14 +1368,14 @@ DBData* dbit_obj_next(DBIterator* self, DBKey* out_key)
* @param out_key Key of the entry
* @return Data of the entry
* @protected
- * @see DBIterator#prev
+ * @see struct DBIterator#prev()
*/
-DBData* dbit_obj_prev(DBIterator* self, DBKey* out_key)
+struct DBData *dbit_obj_prev(struct DBIterator *self, union DBKey *out_key)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
- DBNode *node;
- DBNode *parent;
- struct dbn fake;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
+ struct DBNode *node;
+ struct DBNode *parent;
+ struct DBNode fake;
DB_COUNTSTAT(dbit_prev);
if( it->ht_index >= HASH_SIZE )
@@ -1424,7 +1427,7 @@ DBData* dbit_obj_prev(DBIterator* self, DBKey* out_key)
{// found previous entry
it->node = node;
if( out_key )
- memcpy(out_key, &node->key, sizeof(DBKey));
+ memcpy(out_key, &node->key, sizeof(union DBKey));
return &node->data;
}
}
@@ -1440,11 +1443,11 @@ DBData* dbit_obj_prev(DBIterator* self, DBKey* out_key)
* @param self Iterator
* @return true if the entry exists
* @protected
- * @see DBIterator#exists
+ * @see struct DBIterator#exists()
*/
-bool dbit_obj_exists(DBIterator* self)
+bool dbit_obj_exists(struct DBIterator *self)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
DB_COUNTSTAT(dbit_exists);
return (it->node && !it->node->deleted);
@@ -1452,32 +1455,34 @@ bool dbit_obj_exists(DBIterator* self)
/**
* Removes the current entry from the database.
- * NOTE: {@link DBIterator#exists} will return false until another entry
- * is fetched
+ *
+ * NOTE: struct DBIterator#exists() will return false until another entry is
+ * fetched.
+ *
* Puts data of the removed entry in out_data, if out_data is not NULL (unless data has been released)
* @param self Iterator
* @param out_data Data of the removed entry.
* @return 1 if entry was removed, 0 otherwise
* @protected
- * @see DBMap#remove
- * @see DBIterator#remove
+ * @see struct DBMap#remove()
+ * @see struct DBIterator#remove()
*/
-int dbit_obj_remove(DBIterator* self, DBData *out_data)
+int dbit_obj_remove(struct DBIterator *self, struct DBData *out_data)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
- DBNode *node;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
+ struct DBNode *node;
int retval = 0;
DB_COUNTSTAT(dbit_remove);
node = it->node;
if( node && !node->deleted )
{
- DBMap_impl* db = it->db;
+ struct DBMap_impl *db = it->db;
if( db->cache == node )
db->cache = NULL;
db->release(node->key, node->data, DB_RELEASE_DATA);
if( out_data )
- memcpy(out_data, &node->data, sizeof(DBData));
+ memcpy(out_data, &node->data, sizeof(struct DBData));
retval = 1;
db_free_add(db, node, &db->ht[it->ht_index]);
}
@@ -1489,9 +1494,9 @@ int dbit_obj_remove(DBIterator* self, DBData *out_data)
* @param self Iterator
* @protected
*/
-void dbit_obj_destroy(DBIterator* self)
+void dbit_obj_destroy(struct DBIterator *self)
{
- DBIterator_impl* it = (DBIterator_impl*)self;
+ struct DBIterator_impl *it = (struct DBIterator_impl *)self;
DB_COUNTSTAT(dbit_destroy);
// unlock the database
@@ -1509,10 +1514,10 @@ void dbit_obj_destroy(DBIterator* self)
* @return New iterator
* @protected
*/
-static DBIterator* db_obj_iterator(DBMap* self)
+static struct DBIterator *db_obj_iterator(struct DBMap *self)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBIterator_impl* it;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ struct DBIterator_impl *it;
DB_COUNTSTAT(db_iterator);
it = ers_alloc(db_iterator_ers, struct DBIterator_impl);
@@ -1539,12 +1544,12 @@ static DBIterator* db_obj_iterator(DBMap* self)
* @param key Key that identifies the entry
* @return true is the entry exists
* @protected
- * @see DBMap#exists
+ * @see struct DBMap#exists()
*/
-static bool db_obj_exists(DBMap* self, DBKey key)
+static bool db_obj_exists(struct DBMap *self, union DBKey key)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBNode *node;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ struct DBNode *node;
bool found = false;
DB_COUNTSTAT(db_exists);
@@ -1589,13 +1594,13 @@ static bool db_obj_exists(DBMap* self, DBKey key)
* @param key Key that identifies the entry
* @return Data of the entry or NULL if not found
* @protected
- * @see DBMap#get
+ * @see struct DBMap#get()
*/
-static DBData* db_obj_get(DBMap* self, DBKey key)
+static struct DBData *db_obj_get(struct DBMap *self, union DBKey key)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBNode *node;
- DBData *data = NULL;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ struct DBNode *node;
+ struct DBData *data = NULL;
DB_COUNTSTAT(db_get);
if (db == NULL) return NULL; // nullpo candidate
@@ -1648,14 +1653,14 @@ static DBData* db_obj_get(DBMap* self, DBKey key)
* @param ... Extra arguments for match
* @return The number of entries that matched
* @protected
- * @see DBMap#vgetall
+ * @see struct DBMap#vgetall()
*/
-static unsigned int db_obj_vgetall(DBMap* self, DBData **buf, unsigned int max, DBMatcher match, va_list args)
+static unsigned int db_obj_vgetall(struct DBMap *self, struct DBData **buf, unsigned int max, DBMatcher match, va_list args)
{
- DBMap_impl* db = (DBMap_impl*)self;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
unsigned int i;
- DBNode *node;
- DBNode *parent;
+ struct DBNode *node;
+ struct DBNode *parent;
unsigned int ret = 0;
DB_COUNTSTAT(db_vgetall);
@@ -1705,7 +1710,8 @@ static unsigned int db_obj_vgetall(DBMap* self, DBData **buf, unsigned int max,
}
/**
- * Just calls {@link DBMap#vgetall}.
+ * Just calls struct DBMap#vgetall().
+ *
* Get the data of the entries matched by <code>match</code>.
* It puts a maximum of <code>max</code> entries into <code>buf</code>.
* If <code>buf</code> is NULL, it only counts the matches.
@@ -1719,10 +1725,10 @@ static unsigned int db_obj_vgetall(DBMap* self, DBData **buf, unsigned int max,
* @param ... Extra arguments for match
* @return The number of entries that matched
* @protected
- * @see DBMap#vgetall
- * @see DBMap#getall
+ * @see struct DBMap#vgetall()
+ * @see struct DBMap#getall()
*/
-static unsigned int db_obj_getall(DBMap* self, DBData **buf, unsigned int max, DBMatcher match, ...)
+static unsigned int db_obj_getall(struct DBMap *self, struct DBData **buf, unsigned int max, DBMatcher match, ...)
{
va_list args;
unsigned int ret;
@@ -1746,16 +1752,16 @@ static unsigned int db_obj_getall(DBMap* self, DBData **buf, unsigned int max, D
* @param args Extra arguments for create
* @return Data of the entry
* @protected
- * @see DBMap#vensure
+ * @see struct DBMap#vensure()
*/
-static DBData* db_obj_vensure(DBMap* self, DBKey key, DBCreateData create, va_list args)
+static struct DBData *db_obj_vensure(struct DBMap *self, union DBKey key, DBCreateData create, va_list args)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBNode *node;
- DBNode *parent = NULL;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ struct DBNode *node;
+ struct DBNode *parent = NULL;
unsigned int hash;
int c = 0;
- DBData *data = NULL;
+ struct DBData *data = NULL;
DB_COUNTSTAT(db_vensure);
if (db == NULL) return NULL; // nullpo candidate
@@ -1795,7 +1801,7 @@ static DBData* db_obj_vensure(DBMap* self, DBKey key, DBCreateData create, va_li
return NULL;
}
DB_COUNTSTAT(db_node_alloc);
- node = ers_alloc(db->nodes, struct dbn);
+ node = ers_alloc(db->nodes, struct DBNode);
node->left = NULL;
node->right = NULL;
node->deleted = 0;
@@ -1835,7 +1841,8 @@ static DBData* db_obj_vensure(DBMap* self, DBKey key, DBCreateData create, va_li
}
/**
- * Just calls {@link DBMap#vensure}.
+ * Just calls struct DBMap#vensure().
+ *
* Get the data of the entry identified by the key.
* If the entry does not exist, an entry is added with the data returned by
* <code>create</code>.
@@ -1845,13 +1852,13 @@ static DBData* db_obj_vensure(DBMap* self, DBKey key, DBCreateData create, va_li
* @param ... Extra arguments for create
* @return Data of the entry
* @protected
- * @see DBMap#vensure
- * @see DBMap#ensure
+ * @see struct DBMap#vensure()
+ * @see struct DBMap#ensure()
*/
-static DBData* db_obj_ensure(DBMap* self, DBKey key, DBCreateData create, ...)
+static struct DBData *db_obj_ensure(struct DBMap *self, union DBKey key, DBCreateData create, ...)
{
va_list args;
- DBData *ret = NULL;
+ struct DBData *ret = NULL;
DB_COUNTSTAT(db_ensure);
if (self == NULL) return NULL; // nullpo candidate
@@ -1873,15 +1880,15 @@ static DBData* db_obj_ensure(DBMap* self, DBKey key, DBCreateData create, ...)
* @return 1 if if the entry already exists, 0 otherwise
* @protected
* @see #db_malloc_dbn(void)
- * @see DBMap#put
+ * @see struct DBMap#put()
* FIXME: If this method fails shouldn't it return another value?
* Other functions rely on this to know if they were able to put something [Panikon]
*/
-static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data)
+static int db_obj_put(struct DBMap *self, union DBKey key, struct DBData data, struct DBData *out_data)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBNode *node;
- DBNode *parent = NULL;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ struct DBNode *node;
+ struct DBNode *parent = NULL;
int c = 0, retval = 0;
unsigned int hash;
@@ -1934,7 +1941,7 @@ static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data)
// allocate a new node if necessary
if (node == NULL) {
DB_COUNTSTAT(db_node_alloc);
- node = ers_alloc(db->nodes, struct dbn);
+ node = ers_alloc(db->nodes, struct DBNode);
node->left = NULL;
node->right = NULL;
node->deleted = 0;
@@ -1973,19 +1980,19 @@ static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data)
/**
* Remove an entry from the database.
* Puts the previous data in out_data, if out_data is not NULL. (unless data has been released)
- * NOTE: The key (of the database) is released in {@link #db_free_add(DBMap_impl*,DBNode*,DBNode **)}.
+ * NOTE: The key (of the database) is released in #db_free_add().
* @param self Interface of the database
* @param key Key that identifies the entry
* @param out_data Previous data if the entry exists
* @return 1 if if the entry already exists, 0 otherwise
* @protected
- * @see #db_free_add(DBMap_impl*,DBNode*,DBNode **)
- * @see DBMap#remove
+ * @see #db_free_add()
+ * @see struct DBMap#remove()
*/
-static int db_obj_remove(DBMap* self, DBKey key, DBData *out_data)
+static int db_obj_remove(struct DBMap *self, union DBKey key, struct DBData *out_data)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBNode *node;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ struct DBNode *node;
unsigned int hash;
int retval = 0;
@@ -2035,15 +2042,15 @@ static int db_obj_remove(DBMap* self, DBKey key, DBData *out_data)
* @param args Extra arguments for func
* @return Sum of the values returned by func
* @protected
- * @see DBMap#vforeach
+ * @see struct DBMap#vforeach()
*/
-static int db_obj_vforeach(DBMap* self, DBApply func, va_list args)
+static int db_obj_vforeach(struct DBMap *self, DBApply func, va_list args)
{
- DBMap_impl* db = (DBMap_impl*)self;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
unsigned int i;
int sum = 0;
- DBNode *node;
- DBNode *parent;
+ struct DBNode *node;
+ struct DBNode *parent;
DB_COUNTSTAT(db_vforeach);
if (db == NULL) return 0; // nullpo candidate
@@ -2086,7 +2093,8 @@ static int db_obj_vforeach(DBMap* self, DBApply func, va_list args)
}
/**
- * Just calls {@link DBMap#vforeach}.
+ * Just calls struct DBMap#vforeach().
+ *
* Apply <code>func</code> to every entry in the database.
* Returns the sum of values returned by func.
* @param self Interface of the database
@@ -2094,10 +2102,10 @@ static int db_obj_vforeach(DBMap* self, DBApply func, va_list args)
* @param ... Extra arguments for func
* @return Sum of the values returned by func
* @protected
- * @see DBMap#vforeach
- * @see DBMap#foreach
+ * @see struct DBMap#vforeach()
+ * @see struct DBMap#foreach()
*/
-static int db_obj_foreach(DBMap* self, DBApply func, ...)
+static int db_obj_foreach(struct DBMap *self, DBApply func, ...)
{
va_list args;
int ret;
@@ -2121,15 +2129,15 @@ static int db_obj_foreach(DBMap* self, DBApply func, ...)
* @param args Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#vclear
+ * @see struct DBMap#vclear()
*/
-static int db_obj_vclear(DBMap* self, DBApply func, va_list args)
+static int db_obj_vclear(struct DBMap *self, DBApply func, va_list args)
{
- DBMap_impl* db = (DBMap_impl*)self;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
int sum = 0;
unsigned int i;
- DBNode *node;
- DBNode *parent;
+ struct DBNode *node;
+ struct DBNode *parent;
DB_COUNTSTAT(db_vclear);
if (db == NULL) return 0; // nullpo candidate
@@ -2182,7 +2190,8 @@ static int db_obj_vclear(DBMap* self, DBApply func, va_list args)
}
/**
- * Just calls {@link DBMap#vclear}.
+ * Just calls struct DBMap#vclear().
+ *
* Removes all entries from the database.
* Before deleting an entry, func is applied to it.
* Releases the key and the data.
@@ -2194,10 +2203,10 @@ static int db_obj_vclear(DBMap* self, DBApply func, va_list args)
* @param ... Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#vclear
- * @see DBMap#clear
+ * @see struct DBMap#vclear()
+ * @see struct DBMap#clear()
*/
-static int db_obj_clear(DBMap* self, DBApply func, ...)
+static int db_obj_clear(struct DBMap *self, DBApply func, ...)
{
va_list args;
int ret;
@@ -2222,11 +2231,11 @@ static int db_obj_clear(DBMap* self, DBApply func, ...)
* @param args Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#vdestroy
+ * @see struct DBMap#vdestroy()
*/
-static int db_obj_vdestroy(DBMap* self, DBApply func, va_list args)
+static int db_obj_vdestroy(struct DBMap *self, DBApply func, va_list args)
{
- DBMap_impl* db = (DBMap_impl*)self;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
int sum;
DB_COUNTSTAT(db_vdestroy);
@@ -2265,7 +2274,7 @@ static int db_obj_vdestroy(DBMap* self, DBApply func, va_list args)
}
/**
- * Just calls {@link DBMap#db_vdestroy}.
+ * Just calls struct DBMap#db_vdestroy().
* Finalize the database, feeing all the memory it uses.
* Before deleting an entry, func is applied to it.
* Releases the key and the data.
@@ -2277,10 +2286,10 @@ static int db_obj_vdestroy(DBMap* self, DBApply func, va_list args)
* @param ... Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#vdestroy
- * @see DBMap#destroy
+ * @see struct DBMap#vdestroy()
+ * @see struct DBMap#destroy()
*/
-static int db_obj_destroy(DBMap* self, DBApply func, ...)
+static int db_obj_destroy(struct DBMap *self, DBApply func, ...)
{
va_list args;
int ret;
@@ -2299,12 +2308,12 @@ static int db_obj_destroy(DBMap* self, DBApply func, ...)
* @param self Interface of the database
* @return Size of the database
* @protected
- * @see DBMap_impl#item_count
- * @see DBMap#size
+ * @see struct DBMap_impl#item_count
+ * @see struct DBMap#size()
*/
-static unsigned int db_obj_size(DBMap* self)
+static unsigned int db_obj_size(struct DBMap *self)
{
- DBMap_impl* db = (DBMap_impl*)self;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
unsigned int item_count;
DB_COUNTSTAT(db_size);
@@ -2322,16 +2331,17 @@ static unsigned int db_obj_size(DBMap* self)
* @param self Interface of the database
* @return Type of the database
* @protected
- * @see DBMap_impl#type
- * @see DBMap#type
+ * @see struct DBMap_impl#type
+ * @see struct DBMap#type()
*/
-static DBType db_obj_type(DBMap* self)
+static enum DBType db_obj_type(struct DBMap *self)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBType type;
+ struct DBMap_impl *db = (struct DBMap_impl *)self;
+ enum DBType type;
DB_COUNTSTAT(db_type);
- if (db == NULL) return (DBType)-1; // nullpo candidate - TODO what should this return?
+ if (db == NULL)
+ return (enum DBType)-1; // nullpo candidate - TODO what should this return?
db_free_lock(db);
type = db->type;
@@ -2345,13 +2355,13 @@ static DBType db_obj_type(DBMap* self)
* @param self Interface of the database
* @return Options of the database
* @protected
- * @see DBMap_impl#options
- * @see DBMap#options
+ * @see struct DBMap_impl#options
+ * @see struct DBMap#options()
*/
-static DBOptions db_obj_options(DBMap* self)
+static enum DBOptions db_obj_options(struct DBMap *self)
{
- DBMap_impl* db = (DBMap_impl*)self;
- DBOptions options;
+ struct DBMap_impl* db = (struct DBMap_impl *)self;
+ enum DBOptions options;
DB_COUNTSTAT(db_options);
if (db == NULL) return DB_OPT_BASE; // nullpo candidate - TODO what should this return?
@@ -2371,17 +2381,17 @@ static DBOptions db_obj_options(DBMap* self)
* db_default_release - Get the default releaser for a type of database with the specified options.
* db_custom_release - Get a releaser that behaves a certain way.
* db_alloc - Allocate a new database.
- * db_i2key - Manual cast from 'int' to 'DBKey'.
- * db_ui2key - Manual cast from 'unsigned int' to 'DBKey'.
- * db_str2key - Manual cast from 'unsigned char *' to 'DBKey'.
- * db_i642key - Manual cast from 'int64' to 'DBKey'.
- * db_ui642key - Manual cast from 'uin64' to 'DBKey'.
- * db_i2data - Manual cast from 'int' to 'DBData'.
- * db_ui2data - Manual cast from 'unsigned int' to 'DBData'.
- * db_ptr2data - Manual cast from 'void*' to 'DBData'.
- * db_data2i - Gets 'int' value from 'DBData'.
- * db_data2ui - Gets 'unsigned int' value from 'DBData'.
- * db_data2ptr - Gets 'void*' value from 'DBData'.
+ * db_i2key - Manual cast from `int` to `union DBKey`.
+ * db_ui2key - Manual cast from `unsigned int` to `union DBKey`.
+ * db_str2key - Manual cast from `unsigned char *` to `union DBKey`.
+ * db_i642key - Manual cast from `int64` to `union DBKey`.
+ * db_ui642key - Manual cast from `uin64` to `union DBKey`.
+ * db_i2data - Manual cast from `int` to `struct DBData`.
+ * db_ui2data - Manual cast from `unsigned int` to `struct DBData`.
+ * db_ptr2data - Manual cast from `void*` to `struct DBData`.
+ * db_data2i - Gets `int` value from `struct DBData`.
+ * db_data2ui - Gets `unsigned int` value from `struct DBData`.
+ * db_data2ptr - Gets `void*` value from `struct DBData`.
* db_init - Initializes the database system.
* db_final - Finalizes the database system.
\*****************************************************************************/
@@ -2394,10 +2404,10 @@ static DBOptions db_obj_options(DBMap* self)
* @param options Original options of the database
* @return Fixed options of the database
* @private
- * @see #db_default_release(DBType,DBOptions)
- * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
+ * @see #db_default_release()
+ * @see #db_alloc()
*/
-DBOptions db_fix_options(DBType type, DBOptions options)
+enum DBOptions db_fix_options(enum DBType type, enum DBOptions options)
{
DB_COUNTSTAT(db_fix_options);
switch (type) {
@@ -2405,10 +2415,11 @@ DBOptions db_fix_options(DBType type, DBOptions options)
case DB_UINT:
case DB_INT64:
case DB_UINT64: // Numeric database, do nothing with the keys
- return (DBOptions)(options&~(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY));
+ return (enum DBOptions)(options&~(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY));
default:
ShowError("db_fix_options: Unknown database type %u with options %x\n", type, options);
+ FALLTHROUGH
case DB_STRING:
case DB_ISTRING: // String databases, no fix required
return options;
@@ -2420,14 +2431,14 @@ DBOptions db_fix_options(DBType type, DBOptions options)
* @param type Type of database
* @return Comparator for the type of database or NULL if unknown database
* @public
- * @see #db_int_cmp(DBKey,DBKey,unsigned short)
- * @see #db_uint_cmp(DBKey,DBKey,unsigned short)
- * @see #db_string_cmp(DBKey,DBKey,unsigned short)
- * @see #db_istring_cmp(DBKey,DBKey,unsigned short)
- * @see #db_int64_cmp(DBKey,DBKey,unsigned short)
- * @see #db_uint64_cmp(DBKey,DBKey,unsigned short)
+ * @see #db_int_cmp()
+ * @see #db_uint_cmp()
+ * @see #db_string_cmp()
+ * @see #db_istring_cmp()
+ * @see #db_int64_cmp()
+ * @see #db_uint64_cmp()
*/
-DBComparator db_default_cmp(DBType type)
+DBComparator db_default_cmp(enum DBType type)
{
DB_COUNTSTAT(db_default_cmp);
switch (type) {
@@ -2448,14 +2459,14 @@ DBComparator db_default_cmp(DBType type)
* @param type Type of database
* @return Hasher of the type of database or NULL if unknown database
* @public
- * @see #db_int_hash(DBKey,unsigned short)
- * @see #db_uint_hash(DBKey,unsigned short)
- * @see #db_string_hash(DBKey,unsigned short)
- * @see #db_istring_hash(DBKey,unsigned short)
- * @see #db_int64_hash(DBKey,unsigned short)
- * @see #db_uint64_hash(DBKey,unsigned short)
+ * @see #db_int_hash()
+ * @see #db_uint_hash()
+ * @see #db_string_hash()
+ * @see #db_istring_hash()
+ * @see #db_int64_hash()
+ * @see #db_uint64_hash()
*/
-DBHasher db_default_hash(DBType type)
+DBHasher db_default_hash(enum DBType type)
{
DB_COUNTSTAT(db_default_hash);
switch (type) {
@@ -2474,19 +2485,21 @@ DBHasher db_default_hash(DBType type)
/**
* Returns the default releaser for the specified type of database with the
* specified options.
- * NOTE: the options are fixed with {@link #db_fix_options(DBType,DBOptions)}
- * before choosing the releaser.
+ *
+ * NOTE: the options are fixed with #db_fix_options() before choosing the
+ * releaser.
+ *
* @param type Type of database
* @param options Options of the database
* @return Default releaser for the type of database with the specified options
* @public
- * @see #db_release_nothing(DBKey,DBData,DBRelease)
- * @see #db_release_key(DBKey,DBData,DBRelease)
- * @see #db_release_data(DBKey,DBData,DBRelease)
- * @see #db_release_both(DBKey,DBData,DBRelease)
- * @see #db_custom_release(DBRelease)
+ * @see #db_release_nothing()
+ * @see #db_release_key()
+ * @see #db_release_data()
+ * @see #db_release_both()
+ * @see #db_custom_release()
*/
-DBReleaser db_default_release(DBType type, DBOptions options)
+DBReleaser db_default_release(enum DBType type, enum DBOptions options)
{
DB_COUNTSTAT(db_default_release);
options = DB->fix_options(type, options);
@@ -2505,13 +2518,13 @@ DBReleaser db_default_release(DBType type, DBOptions options)
* @param which Options that specified what the releaser releases
* @return Releaser for the specified release options
* @public
- * @see #db_release_nothing(DBKey,DBData,DBRelease)
- * @see #db_release_key(DBKey,DBData,DBRelease)
- * @see #db_release_data(DBKey,DBData,DBRelease)
- * @see #db_release_both(DBKey,DBData,DBRelease)
- * @see #db_default_release(DBType,DBOptions)
+ * @see #db_release_nothing()
+ * @see #db_release_key()
+ * @see #db_release_data()
+ * @see #db_release_both()
+ * @see #db_default_release()
*/
-DBReleaser db_custom_release(DBRelease which)
+DBReleaser db_custom_release(enum DBReleaseOption which)
{
DB_COUNTSTAT(db_custom_release);
switch (which) {
@@ -2527,8 +2540,10 @@ DBReleaser db_custom_release(DBRelease which)
/**
* Allocate a new database of the specified type.
- * NOTE: the options are fixed by {@link #db_fix_options(DBType,DBOptions)}
- * before creating the database.
+ *
+ * NOTE: the options are fixed by #db_fix_options() before creating the
+ * database.
+ *
* @param file File where the database is being allocated
* @param line Line of the file where the database is being allocated
* @param type Type of database
@@ -2537,11 +2552,12 @@ DBReleaser db_custom_release(DBRelease which)
* databases. If 0, the maximum number of maxlen is used (64K).
* @return The interface of the database
* @public
- * @see #DBMap_impl
- * @see #db_fix_options(DBType,DBOptions)
+ * @see struct DBMap_impl
+ * @see #db_fix_options()
*/
-DBMap* db_alloc(const char *file, const char *func, int line, DBType type, DBOptions options, unsigned short maxlen) {
- DBMap_impl* db;
+struct DBMap *db_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen)
+{
+ struct DBMap_impl *db;
unsigned int i;
char ers_name[50];
@@ -2588,7 +2604,7 @@ DBMap* db_alloc(const char *file, const char *func, int line, DBType type, DBOpt
db->free_lock = 0;
/* Other */
snprintf(ers_name, 50, "db_alloc:nodes:%s:%s:%d",func,file,line);
- db->nodes = ers_new(sizeof(struct dbn),ers_name,ERS_OPT_WAIT|ERS_OPT_FREE_NAME|ERS_OPT_CLEAN);
+ db->nodes = ers_new(sizeof(struct DBNode),ers_name,ERS_OPT_WAIT|ERS_OPT_FREE_NAME|ERS_OPT_CLEAN);
db->cmp = DB->default_cmp(type);
db->hash = DB->default_hash(type);
db->release = DB->default_release(type, options);
@@ -2613,9 +2629,9 @@ DBMap* db_alloc(const char *file, const char *func, int line, DBType type, DBOpt
* @return The key as a DBKey union
* @public
*/
-DBKey db_i2key(int key)
+union DBKey db_i2key(int key)
{
- DBKey ret;
+ union DBKey ret;
DB_COUNTSTAT(db_i2key);
ret.i = key;
@@ -2628,9 +2644,9 @@ DBKey db_i2key(int key)
* @return The key as a DBKey union
* @public
*/
-DBKey db_ui2key(unsigned int key)
+union DBKey db_ui2key(unsigned int key)
{
- DBKey ret;
+ union DBKey ret;
DB_COUNTSTAT(db_ui2key);
ret.ui = key;
@@ -2643,9 +2659,9 @@ DBKey db_ui2key(unsigned int key)
* @return The key as a DBKey union
* @public
*/
-DBKey db_str2key(const char *key)
+union DBKey db_str2key(const char *key)
{
- DBKey ret;
+ union DBKey ret;
DB_COUNTSTAT(db_str2key);
ret.str = key;
@@ -2658,9 +2674,9 @@ DBKey db_str2key(const char *key)
* @return The key as a DBKey union
* @public
*/
-DBKey db_i642key(int64 key)
+union DBKey db_i642key(int64 key)
{
- DBKey ret;
+ union DBKey ret;
DB_COUNTSTAT(db_i642key);
ret.i64 = key;
@@ -2673,9 +2689,9 @@ DBKey db_i642key(int64 key)
* @return The key as a DBKey union
* @public
*/
-DBKey db_ui642key(uint64 key)
+union DBKey db_ui642key(uint64 key)
{
- DBKey ret;
+ union DBKey ret;
DB_COUNTSTAT(db_ui642key);
ret.ui64 = key;
@@ -2688,9 +2704,9 @@ DBKey db_ui642key(uint64 key)
* @return The data as a DBData struct
* @public
*/
-DBData db_i2data(int data)
+struct DBData db_i2data(int data)
{
- DBData ret;
+ struct DBData ret;
DB_COUNTSTAT(db_i2data);
ret.type = DB_DATA_INT;
@@ -2704,9 +2720,9 @@ DBData db_i2data(int data)
* @return The data as a DBData struct
* @public
*/
-DBData db_ui2data(unsigned int data)
+struct DBData db_ui2data(unsigned int data)
{
- DBData ret;
+ struct DBData ret;
DB_COUNTSTAT(db_ui2data);
ret.type = DB_DATA_UINT;
@@ -2720,9 +2736,9 @@ DBData db_ui2data(unsigned int data)
* @return The data as a DBData struct
* @public
*/
-DBData db_ptr2data(void *data)
+struct DBData db_ptr2data(void *data)
{
- DBData ret;
+ struct DBData ret;
DB_COUNTSTAT(db_ptr2data);
ret.type = DB_DATA_PTR;
@@ -2737,7 +2753,7 @@ DBData db_ptr2data(void *data)
* @return Integer value of the data.
* @public
*/
-int db_data2i(DBData *data)
+int db_data2i(struct DBData *data)
{
DB_COUNTSTAT(db_data2i);
if (data && DB_DATA_INT == data->type)
@@ -2752,7 +2768,7 @@ int db_data2i(DBData *data)
* @return Unsigned int value of the data.
* @public
*/
-unsigned int db_data2ui(DBData *data)
+unsigned int db_data2ui(struct DBData *data)
{
DB_COUNTSTAT(db_data2ui);
if (data && DB_DATA_UINT == data->type)
@@ -2767,7 +2783,7 @@ unsigned int db_data2ui(DBData *data)
* @return Void* value of the data.
* @public
*/
-void* db_data2ptr(DBData *data)
+void *db_data2ptr(struct DBData *data)
{
DB_COUNTSTAT(db_data2ptr);
if (data && DB_DATA_PTR == data->type)
@@ -2780,7 +2796,8 @@ void* db_data2ptr(DBData *data)
* @public
* @see #db_final(void)
*/
-void db_init(void) {
+void db_init(void)
+{
db_iterator_ers = ers_new(sizeof(struct DBIterator_impl),"db.c::db_iterator_ers",ERS_OPT_CLEAN|ERS_OPT_FLEX_CHUNK);
db_alloc_ers = ers_new(sizeof(struct DBMap_impl),"db.c::db_alloc_ers",ERS_OPT_CLEAN|ERS_OPT_FLEX_CHUNK);
ers_chunk_size(db_alloc_ers, 50);
@@ -2892,7 +2909,7 @@ void db_final(void)
}
// Link DB System - jAthena
-void linkdb_insert( struct linkdb_node** head, void *key, void* data)
+void linkdb_insert(struct linkdb_node **head, void *key, void *data)
{
struct linkdb_node *node;
if( head == NULL ) return ;
@@ -2913,7 +2930,8 @@ void linkdb_insert( struct linkdb_node** head, void *key, void* data)
node->data = data;
}
-void linkdb_vforeach( struct linkdb_node** head, LinkDBFunc func, va_list ap) {
+void linkdb_vforeach(struct linkdb_node **head, LinkDBFunc func, va_list ap)
+{
struct linkdb_node *node;
if( head == NULL ) return;
node = *head;
@@ -2926,14 +2944,15 @@ void linkdb_vforeach( struct linkdb_node** head, LinkDBFunc func, va_list ap) {
}
}
-void linkdb_foreach( struct linkdb_node** head, LinkDBFunc func, ...) {
+void linkdb_foreach(struct linkdb_node **head, LinkDBFunc func, ...)
+{
va_list ap;
va_start(ap, func);
linkdb_vforeach(head, func, ap);
va_end(ap);
}
-void* linkdb_search( struct linkdb_node** head, void *key)
+void* linkdb_search(struct linkdb_node **head, void *key)
{
int n = 0;
struct linkdb_node *node;
@@ -2958,7 +2977,7 @@ void* linkdb_search( struct linkdb_node** head, void *key)
return NULL;
}
-void* linkdb_erase( struct linkdb_node** head, void *key)
+void* linkdb_erase(struct linkdb_node **head, void *key)
{
struct linkdb_node *node;
if( head == NULL ) return NULL;
@@ -2980,7 +2999,7 @@ void* linkdb_erase( struct linkdb_node** head, void *key)
return NULL;
}
-void linkdb_replace( struct linkdb_node** head, void *key, void *data )
+void linkdb_replace(struct linkdb_node **head, void *key, void *data)
{
int n = 0;
struct linkdb_node *node;
@@ -3007,7 +3026,7 @@ void linkdb_replace( struct linkdb_node** head, void *key, void *data )
linkdb_insert( head, key, data );
}
-void linkdb_final( struct linkdb_node** head )
+void linkdb_final(struct linkdb_node **head)
{
struct linkdb_node *node, *node2;
if( head == NULL ) return ;
@@ -3019,7 +3038,9 @@ void linkdb_final( struct linkdb_node** head )
}
*head = NULL;
}
-void db_defaults(void) {
+
+void db_defaults(void)
+{
DB = &DB_s;
DB->alloc = db_alloc;
DB->custom_release = db_custom_release;
@@ -3040,5 +3061,4 @@ void db_defaults(void) {
DB->ui2key = db_ui2key;
DB->i642key = db_i642key;
DB->ui642key = db_ui642key;
-
}
diff --git a/src/common/db.h b/src/common/db.h
index b73970947..2918e5acb 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -43,8 +43,7 @@
* 2007/11/09 - Added an iterator to the database. *
* 2.1 (Athena build #???#) - Portability fix *
* - Fixed the portability of casting to union and added the functions *
- * {@link DBMap#ensure(DBMap,DBKey,DBCreateData,...)} and *
- * {@link DBMap#clear(DBMap,DBApply,...)}. *
+ * struct DBMap#ensure() and struct DBMap#clear(). *
* 2.0 (Athena build 4859) - Transition version *
* - Almost everything recoded with a strategy similar to objects, *
* database structure is maintained. *
@@ -64,41 +63,42 @@
#include <stdarg.h>
-/*****************************************************************************\
+/*****************************************************************************
* (1) Section with public typedefs, enums, unions, structures and defines. *
- * DBRelease - Enumeration of release options. *
- * DBType - Enumeration of database types. *
- * DBOptions - Bitfield enumeration of database options. *
- * DBKey - Union of used key types. *
- * DBDataType - Enumeration of data types. *
- * DBData - Struct for used data types. *
- * DBApply - Format of functions applied to the databases. *
- * DBMatcher - Format of matchers used in DBMap::getall. *
- * DBComparator - Format of the comparators used by the databases. *
- * DBHasher - Format of the hashers used by the databases. *
- * DBReleaser - Format of the releasers used by the databases. *
- * DBIterator - Database iterator. *
- * DBMap - Database interface. *
-\*****************************************************************************/
+ * enum DBReleaseOption - Enumeration of release options. *
+ * enum DBType - Enumeration of database types. *
+ * enum DBOptions - Bitfield enumeration of database options. *
+ * union DBKey - Union of used key types. *
+ * enum DBDataType - Enumeration of data types. *
+ * struct DBData - Struct for used data types. *
+ * DBApply - Format of functions applied to the databases. *
+ * DBMatcher - Format of matchers used in struct DBMap#getall(). *
+ * DBComparator - Format of the comparators used by the databases. *
+ * DBHasher - Format of the hashers used by the databases. *
+ * DBReleaser - Format of the releasers used by the databases. *
+ * struct DBIterator - Database iterator. *
+ * struct DBMap - Database interface. *
+ *****************************************************************************/
/**
* Bitfield with what should be released by the releaser function (if the
* function supports it).
* @public
* @see #DBReleaser
- * @see #db_custom_release(DBRelease)
+ * @see #db_custom_release()
*/
-typedef enum DBRelease {
+enum DBReleaseOption {
DB_RELEASE_NOTHING = 0x0,
DB_RELEASE_KEY = 0x1,
DB_RELEASE_DATA = 0x2,
DB_RELEASE_BOTH = DB_RELEASE_KEY|DB_RELEASE_DATA,
-} DBRelease;
+};
/**
* Supported types of database.
- * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the
- * types of databases.
+ *
+ * See #db_fix_options() for restrictions of the types of databases.
+ *
* @param DB_INT Uses int's for keys
* @param DB_UINT Uses unsigned int's for keys
* @param DB_STRING Uses strings for keys.
@@ -106,27 +106,28 @@ typedef enum DBRelease {
* @param DB_INT64 Uses int64's for keys
* @param DB_UINT64 Uses uint64's for keys
* @public
- * @see #DBOptions
- * @see #DBKey
- * @see #db_fix_options(DBType,DBOptions)
- * @see #db_default_cmp(DBType)
- * @see #db_default_hash(DBType)
- * @see #db_default_release(DBType,DBOptions)
- * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
- */
-typedef enum DBType {
+ * @see enum DBOptions
+ * @see union DBKey
+ * @see #db_fix_options()
+ * @see #db_default_cmp()
+ * @see #db_default_hash()
+ * @see #db_default_release()
+ * @see #db_alloc()
+ */
+enum DBType {
DB_INT,
DB_UINT,
DB_STRING,
DB_ISTRING,
DB_INT64,
DB_UINT64,
-} DBType;
+};
/**
* Bitfield of options that define the behavior of the database.
- * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the
- * types of databases.
+ *
+ * See #db_fix_options() for restrictions of the types of databases.
+ *
* @param DB_OPT_BASE Base options: does not duplicate keys, releases nothing
* and does not allow NULL keys or NULL data.
* @param DB_OPT_DUP_KEY Duplicates the keys internally. If DB_OPT_RELEASE_KEY
@@ -134,17 +135,17 @@ typedef enum DBType {
* @param DB_OPT_RELEASE_KEY Releases the key.
* @param DB_OPT_RELEASE_DATA Releases the data whenever an entry is removed
* from the database.
- * WARNING: for functions that return the data (like DBMap::remove),
+ * WARNING: for functions that return the data (like struct DBMap#remove()),
* a dangling pointer will be returned.
* @param DB_OPT_RELEASE_BOTH Releases both key and data.
* @param DB_OPT_ALLOW_NULL_KEY Allow NULL keys in the database.
* @param DB_OPT_ALLOW_NULL_DATA Allow NULL data in the database.
* @public
- * @see #db_fix_options(DBType,DBOptions)
- * @see #db_default_release(DBType,DBOptions)
- * @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
+ * @see #db_fix_options()
+ * @see #db_default_release()
+ * @see #db_alloc()
*/
-typedef enum DBOptions {
+enum DBOptions {
DB_OPT_BASE = 0x00,
DB_OPT_DUP_KEY = 0x01,
DB_OPT_RELEASE_KEY = 0x02,
@@ -152,7 +153,7 @@ typedef enum DBOptions {
DB_OPT_RELEASE_BOTH = DB_OPT_RELEASE_KEY|DB_OPT_RELEASE_DATA,
DB_OPT_ALLOW_NULL_KEY = 0x08,
DB_OPT_ALLOW_NULL_DATA = 0x10,
-} DBOptions;
+};
/**
* Union of key types used by the database.
@@ -160,18 +161,19 @@ typedef enum DBOptions {
* @param ui Type of key for DB_UINT databases
* @param str Type of key for DB_STRING and DB_ISTRING databases
* @public
- * @see #DBType
- * @see DBMap#get
- * @see DBMap#put
- * @see DBMap#remove
+ * @see enum DBType
+ * @see struct DBMap#get()
+ * @see struct DBMap#put()
+ * @see struct DBMap#remove()
*/
-typedef union DBKey {
+union DBKey {
int i;
unsigned int ui;
const char *str;
+ char *mutstr;
int64 i64;
uint64 ui64;
-} DBKey;
+};
/**
* Supported types of database data.
@@ -179,13 +181,13 @@ typedef union DBKey {
* @param DB_DATA_UINT Uses unsigned ints for data.
* @param DB_DATA_PTR Uses void pointers for data.
* @public
- * @see #DBData
+ * @see struct DBData
*/
-typedef enum DBDataType {
+enum DBDataType {
DB_DATA_INT,
DB_DATA_UINT,
DB_DATA_PTR,
-} DBDataType;
+};
/**
* Struct for data types used by the database.
@@ -196,14 +198,14 @@ typedef enum DBDataType {
* @param u.ptr Data of void* type
* @public
*/
-typedef struct DBData {
- DBDataType type;
+struct DBData {
+ enum DBDataType type;
union {
int i;
unsigned int ui;
void *ptr;
} u;
-} DBData;
+};
/**
* Format of functions that create the data for the key when the entry doesn't
@@ -212,10 +214,10 @@ typedef struct DBData {
* @param args Extra arguments of the function
* @return Data identified by the key to be put in the database
* @public
- * @see DBMap#vensure
- * @see DBMap#ensure
+ * @see struct DBMap#vensure()
+ * @see struct DBMap#ensure()
*/
-typedef DBData (*DBCreateData)(DBKey key, va_list args);
+typedef struct DBData (*DBCreateData)(union DBKey key, va_list args);
/**
* Format of functions to be applied to an unspecified quantity of entries of
@@ -227,12 +229,12 @@ typedef DBData (*DBCreateData)(DBKey key, va_list args);
* @param args Extra arguments of the function
* @return Value to be added up by the function that is applying this
* @public
- * @see DBMap#vforeach
- * @see DBMap#foreach
- * @see DBMap#vdestroy
- * @see DBMap#destroy
+ * @see struct DBMap#vforeach()
+ * @see struct DBMap#foreach()
+ * @see struct DBMap#vdestroy()
+ * @see struct DBMap#destroy()
*/
-typedef int (*DBApply)(DBKey key, DBData *data, va_list args);
+typedef int (*DBApply)(union DBKey key, struct DBData *data, va_list args);
/**
* Format of functions that match database entries.
@@ -243,9 +245,9 @@ typedef int (*DBApply)(DBKey key, DBData *data, va_list args);
* @param args Extra arguments of the function
* @return 0 if a match, another number otherwise
* @public
- * @see DBMap#getall
+ * @see struct DBMap#getall()
*/
-typedef int (*DBMatcher)(DBKey key, DBData data, va_list args);
+typedef int (*DBMatcher)(union DBKey key, struct DBData data, va_list args);
/**
* Format of the comparators used internally by the database system.
@@ -257,9 +259,9 @@ typedef int (*DBMatcher)(DBKey key, DBData data, va_list args);
* databases.
* @return 0 if equal, negative if lower and positive if higher
* @public
- * @see #db_default_cmp(DBType)
+ * @see #db_default_cmp()
*/
-typedef int (*DBComparator)(DBKey key1, DBKey key2, unsigned short maxlen);
+typedef int (*DBComparator)(union DBKey key1, union DBKey key2, unsigned short maxlen);
/**
* Format of the hashers used internally by the database system.
@@ -269,9 +271,9 @@ typedef int (*DBComparator)(DBKey key1, DBKey key2, unsigned short maxlen);
* databases.
* @return Hash of the key
* @public
- * @see #db_default_hash(DBType)
+ * @see #db_default_hash()
*/
-typedef uint64 (*DBHasher)(DBKey key, unsigned short maxlen);
+typedef uint64 (*DBHasher)(union DBKey key, unsigned short maxlen);
/**
* Format of the releaser used by the database system.
@@ -281,27 +283,25 @@ typedef uint64 (*DBHasher)(DBKey key, unsigned short maxlen);
* @param data Data of the database entry
* @param which What is being requested to be released
* @public
- * @see #DBRelease
- * @see #db_default_releaser(DBType,DBOptions)
- * @see #db_custom_release(DBRelease)
+ * @see enum DBReleaseOption
+ * @see #db_default_releaser()
+ * @see #db_custom_release()
*/
-typedef void (*DBReleaser)(DBKey key, DBData data, DBRelease which);
-
-typedef struct DBIterator DBIterator;
-typedef struct DBMap DBMap;
+typedef void (*DBReleaser)(union DBKey key, struct DBData data, enum DBReleaseOption which);
/**
* Database iterator.
+ *
* Supports forward iteration, backward iteration and removing entries from the database.
* The iterator is initially positioned before the first entry of the database.
+ *
* While the iterator exists the database is locked internally, so invoke
- * {@link DBIterator#destroy} as soon as possible.
+ * struct DBIterator#destroy() as soon as possible.
+ *
* @public
- * @see #DBMap
+ * @see struct DBMap
*/
-struct DBIterator
-{
-
+struct DBIterator {
/**
* Fetches the first entry in the database.
* Returns the data of the entry.
@@ -311,7 +311,7 @@ struct DBIterator
* @return Data of the entry
* @protected
*/
- DBData* (*first)(DBIterator* self, DBKey* out_key);
+ struct DBData *(*first)(struct DBIterator *self, union DBKey *out_key);
/**
* Fetches the last entry in the database.
@@ -322,7 +322,7 @@ struct DBIterator
* @return Data of the entry
* @protected
*/
- DBData* (*last)(DBIterator* self, DBKey* out_key);
+ struct DBData *(*last)(struct DBIterator *self, union DBKey *out_key);
/**
* Fetches the next entry in the database.
@@ -333,7 +333,7 @@ struct DBIterator
* @return Data of the entry
* @protected
*/
- DBData* (*next)(DBIterator* self, DBKey* out_key);
+ struct DBData *(*next)(struct DBIterator *self, union DBKey *out_key);
/**
* Fetches the previous entry in the database.
@@ -344,7 +344,7 @@ struct DBIterator
* @return Data of the entry
* @protected
*/
- DBData* (*prev)(DBIterator* self, DBKey* out_key);
+ struct DBData *(*prev)(struct DBIterator *self, union DBKey *out_key);
/**
* Returns true if the fetched entry exists.
@@ -354,27 +354,29 @@ struct DBIterator
* @return true is the entry exists
* @protected
*/
- bool (*exists)(DBIterator* self);
+ bool (*exists)(struct DBIterator *self);
/**
* Removes the current entry from the database.
- * NOTE: {@link DBIterator#exists} will return false until another entry
- * is fetched
+ *
+ * NOTE: struct DBIterator#exists() will return false until another
+ * entry is fetched.
+ *
* Puts data of the removed entry in out_data, if out_data is not NULL.
* @param self Iterator
* @param out_data Data of the removed entry.
* @return 1 if entry was removed, 0 otherwise
* @protected
- * @see DBMap#remove
+ * @see struct DBMap#remove()
*/
- int (*remove)(DBIterator* self, DBData *out_data);
+ int (*remove)(struct DBIterator *self, struct DBData *out_data);
/**
* Destroys this iterator and unlocks the database.
* @param self Iterator
* @protected
*/
- void (*destroy)(DBIterator* self);
+ void (*destroy)(struct DBIterator *self);
};
@@ -382,7 +384,7 @@ struct DBIterator
* Public interface of a database. Only contains functions.
* All the functions take the interface as the first argument.
* @public
- * @see #db_alloc(const char*,int,DBType,DBOptions,unsigned short)
+ * @see #db_alloc()
*/
struct DBMap {
@@ -395,7 +397,7 @@ struct DBMap {
* @return New iterator
* @protected
*/
- DBIterator* (*iterator)(DBMap* self);
+ struct DBIterator *(*iterator)(struct DBMap *self);
/**
* Returns true if the entry exists.
@@ -404,7 +406,7 @@ struct DBMap {
* @return true is the entry exists
* @protected
*/
- bool (*exists)(DBMap* self, DBKey key);
+ bool (*exists)(struct DBMap *self, union DBKey key);
/**
* Get the data of the entry identified by the key.
@@ -413,10 +415,11 @@ struct DBMap {
* @return Data of the entry or NULL if not found
* @protected
*/
- DBData* (*get)(DBMap* self, DBKey key);
+ struct DBData *(*get)(struct DBMap *self, union DBKey key);
/**
- * Just calls {@link DBMap#vgetall}.
+ * Just calls struct DBMap#vgetall().
+ *
* Get the data of the entries matched by <code>match</code>.
* It puts a maximum of <code>max</code> entries into <code>buf</code>.
* If <code>buf</code> is NULL, it only counts the matches.
@@ -430,9 +433,9 @@ struct DBMap {
* @param ... Extra arguments for match
* @return The number of entries that matched
* @protected
- * @see DBMap#vgetall(DBMap*,void **,unsigned int,DBMatcher,va_list)
+ * @see struct DBMap#vgetall()
*/
- unsigned int (*getall)(DBMap* self, DBData** buf, unsigned int max, DBMatcher match, ...);
+ unsigned int (*getall)(struct DBMap *self, struct DBData **buf, unsigned int max, DBMatcher match, ...);
/**
* Get the data of the entries matched by <code>match</code>.
@@ -448,24 +451,25 @@ struct DBMap {
* @param ... Extra arguments for match
* @return The number of entries that matched
* @protected
- * @see DBMap#getall(DBMap*,void **,unsigned int,DBMatcher,...)
+ * @see struct DBMap#getall()
*/
- unsigned int (*vgetall)(DBMap* self, DBData** buf, unsigned int max, DBMatcher match, va_list args);
+ unsigned int (*vgetall)(struct DBMap *self, struct DBData **buf, unsigned int max, DBMatcher match, va_list args);
/**
- * Just calls {@link DBMap#vensure}.
- * Get the data of the entry identified by the key.
- * If the entry does not exist, an entry is added with the data returned by
- * <code>create</code>.
+ * Just calls struct DBMap#vensure().
+ *
+ * Get the data of the entry identified by the key. If the entry does
+ * not exist, an entry is added with the data returned by `create`.
+ *
* @param self Database
* @param key Key that identifies the entry
* @param create Function used to create the data if the entry doesn't exist
* @param ... Extra arguments for create
* @return Data of the entry
* @protected
- * @see DBMap#vensure(DBMap*,DBKey,DBCreateData,va_list)
+ * @see struct DBMap#vensure()
*/
- DBData* (*ensure)(DBMap* self, DBKey key, DBCreateData create, ...);
+ struct DBData *(*ensure)(struct DBMap *self, union DBKey key, DBCreateData create, ...);
/**
* Get the data of the entry identified by the key.
@@ -477,9 +481,9 @@ struct DBMap {
* @param args Extra arguments for create
* @return Data of the entry
* @protected
- * @see DBMap#ensure(DBMap*,DBKey,DBCreateData,...)
+ * @see struct DBMap#ensure()
*/
- DBData* (*vensure)(DBMap* self, DBKey key, DBCreateData create, va_list args);
+ struct DBData *(*vensure)(struct DBMap *self, union DBKey key, DBCreateData create, va_list args);
/**
* Put the data identified by the key in the database.
@@ -492,7 +496,7 @@ struct DBMap {
* @return 1 if if the entry already exists, 0 otherwise
* @protected
*/
- int (*put)(DBMap* self, DBKey key, DBData data, DBData *out_data);
+ int (*put)(struct DBMap *self, union DBKey key, struct DBData data, struct DBData *out_data);
/**
* Remove an entry from the database.
@@ -504,10 +508,11 @@ struct DBMap {
* @return 1 if if the entry already exists, 0 otherwise
* @protected
*/
- int (*remove)(DBMap* self, DBKey key, DBData *out_data);
+ int (*remove)(struct DBMap *self, union DBKey key, struct DBData *out_data);
/**
- * Just calls {@link DBMap#vforeach}.
+ * Just calls struct DBMap#vforeach().
+ *
* Apply <code>func</code> to every entry in the database.
* Returns the sum of values returned by func.
* @param self Database
@@ -515,9 +520,9 @@ struct DBMap {
* @param ... Extra arguments for func
* @return Sum of the values returned by func
* @protected
- * @see DBMap#vforeach(DBMap*,DBApply,va_list)
+ * @see struct DBMap#vforeach()
*/
- int (*foreach)(DBMap* self, DBApply func, ...);
+ int (*foreach)(struct DBMap *self, DBApply func, ...);
/**
* Apply <code>func</code> to every entry in the database.
@@ -527,12 +532,13 @@ struct DBMap {
* @param args Extra arguments for func
* @return Sum of the values returned by func
* @protected
- * @see DBMap#foreach(DBMap*,DBApply,...)
+ * @see struct DBMap#foreach()
*/
- int (*vforeach)(DBMap* self, DBApply func, va_list args);
+ int (*vforeach)(struct DBMap *self, DBApply func, va_list args);
/**
- * Just calls {@link DBMap#vclear}.
+ * Just calls struct DBMap#vclear().
+ *
* Removes all entries from the database.
* Before deleting an entry, func is applied to it.
* Releases the key and the data.
@@ -542,9 +548,9 @@ struct DBMap {
* @param ... Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#vclear(DBMap*,DBApply,va_list)
+ * @see struct DBMap#vclear()
*/
- int (*clear)(DBMap* self, DBApply func, ...);
+ int (*clear)(struct DBMap *self, DBApply func, ...);
/**
* Removes all entries from the database.
@@ -556,12 +562,12 @@ struct DBMap {
* @param args Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#clear(DBMap*,DBApply,...)
+ * @see struct DBMap#clear()
*/
- int (*vclear)(DBMap* self, DBApply func, va_list args);
+ int (*vclear)(struct DBMap *self, DBApply func, va_list args);
/**
- * Just calls {@link DBMap#vdestroy}.
+ * Just calls DBMap#vdestroy().
* Finalize the database, feeing all the memory it uses.
* Before deleting an entry, func is applied to it.
* Releases the key and the data.
@@ -573,9 +579,9 @@ struct DBMap {
* @param ... Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#vdestroy(DBMap*,DBApply,va_list)
+ * @see struct DBMap#vdestroy()
*/
- int (*destroy)(DBMap* self, DBApply func, ...);
+ int (*destroy)(struct DBMap *self, DBApply func, ...);
/**
* Finalize the database, feeing all the memory it uses.
@@ -588,9 +594,9 @@ struct DBMap {
* @param args Extra arguments for func
* @return Sum of values returned by func
* @protected
- * @see DBMap#destroy(DBMap*,DBApply,...)
+ * @see struct DBMap#destroy()
*/
- int (*vdestroy)(DBMap* self, DBApply func, va_list args);
+ int (*vdestroy)(struct DBMap *self, DBApply func, va_list args);
/**
* Return the size of the database (number of items in the database).
@@ -598,7 +604,7 @@ struct DBMap {
* @return Size of the database
* @protected
*/
- unsigned int (*size)(DBMap* self);
+ unsigned int (*size)(struct DBMap *self);
/**
* Return the type of the database.
@@ -606,7 +612,7 @@ struct DBMap {
* @return Type of the database
* @protected
*/
- DBType (*type)(DBMap* self);
+ enum DBType (*type)(struct DBMap *self);
/**
* Return the options of the database.
@@ -614,7 +620,7 @@ struct DBMap {
* @return Options of the database
* @protected
*/
- DBOptions (*options)(DBMap* self);
+ enum DBOptions (*options)(struct DBMap *self);
};
@@ -712,7 +718,7 @@ struct DBMap {
#define dbi_exists(dbi) ( (dbi)->exists(dbi) )
#define dbi_destroy(dbi) ( (dbi)->destroy(dbi) )
-/*****************************************************************************\
+/*****************************************************************************
* (2) Section with public functions. *
* db_fix_options - Fix the options for a type of database. *
* db_default_cmp - Get the default comparator for a type of database. *
@@ -721,20 +727,20 @@ struct DBMap {
* with the fixed options. *
* db_custom_release - Get the releaser that behaves as specified. *
* db_alloc - Allocate a new database. *
- * db_i2key - Manual cast from 'int' to 'DBKey'. *
- * db_ui2key - Manual cast from 'unsigned int' to 'DBKey'. *
- * db_str2key - Manual cast from 'unsigned char *' to 'DBKey'. *
- * db_i642key - Manual cast from 'int64' to 'DBKey'. *
- * db_ui642key - Manual cast from 'uint64' to 'DBKey'. *
- * db_i2data - Manual cast from 'int' to 'DBData'. *
- * db_ui2data - Manual cast from 'unsigned int' to 'DBData'. *
- * db_ptr2data - Manual cast from 'void*' to 'DBData'. *
- * db_data2i - Gets 'int' value from 'DBData'. *
- * db_data2ui - Gets 'unsigned int' value from 'DBData'. *
- * db_data2ptr - Gets 'void*' value from 'DBData'. *
+ * db_i2key - Manual cast from `int` to `union DBKey`. *
+ * db_ui2key - Manual cast from `unsigned int` to `union DBKey`. *
+ * db_str2key - Manual cast from `unsigned char *` to `union DBKey`.*
+ * db_i642key - Manual cast from `int64` to `union DBKey`. *
+ * db_ui642key - Manual cast from `uint64` to `union DBKey`. *
+ * db_i2data - Manual cast from `int` to `struct DBData`. *
+ * db_ui2data - Manual cast from `unsigned int` to `struct DBData`. *
+ * db_ptr2data - Manual cast from `void*` to `struct DBData`. *
+ * db_data2i - Gets `int` value from `struct DBData`. *
+ * db_data2ui - Gets `unsigned int` value from `struct DBData`. *
+ * db_data2ptr - Gets `void*` value from `struct DBData`. *
* db_init - Initializes the database system. *
* db_final - Finalizes the database system. *
-\*****************************************************************************/
+ *****************************************************************************/
struct db_interface {
/**
@@ -745,66 +751,71 @@ struct db_interface {
* @param options Original options of the database
* @return Fixed options of the database
* @private
- * @see #DBType
- * @see #DBOptions
- * @see #db_default_release(DBType,DBOptions)
+ * @see enum DBType
+ * @see enum DBOptions
+ * @see #db_default_release()
*/
-DBOptions (*fix_options) (DBType type, DBOptions options);
+enum DBOptions (*fix_options) (enum DBType type, enum DBOptions options);
/**
* Returns the default comparator for the type of database.
* @param type Type of database
* @return Comparator for the type of database or NULL if unknown database
* @public
- * @see #DBType
+ * @see enum DBType
* @see #DBComparator
*/
-DBComparator (*default_cmp) (DBType type);
+DBComparator (*default_cmp) (enum DBType type);
/**
* Returns the default hasher for the specified type of database.
* @param type Type of database
* @return Hasher of the type of database or NULL if unknown database
* @public
- * @see #DBType
+ * @see enum DBType
* @see #DBHasher
*/
-DBHasher (*default_hash) (DBType type);
+DBHasher (*default_hash) (enum DBType type);
/**
* Returns the default releaser for the specified type of database with the
* specified options.
- * NOTE: the options are fixed by {@link #db_fix_options(DBType,DBOptions)}
- * before choosing the releaser
+ *
+ * NOTE: the options are fixed by #db_fix_options() before choosing the
+ * releaser.
+ *
* @param type Type of database
* @param options Options of the database
* @return Default releaser for the type of database with the fixed options
* @public
- * @see #DBType
- * @see #DBOptions
+ * @see enum DBType
+ * @see enum DBOptions
* @see #DBReleaser
- * @see #db_fix_options(DBType,DBOptions)
- * @see #db_custom_release(DBRelease)
+ * @see #db_fix_options()
+ * @see #db_custom_release()
*/
-DBReleaser (*default_release) (DBType type, DBOptions options);
+DBReleaser (*default_release) (enum DBType type, enum DBOptions options);
/**
* Returns the releaser that behaves as <code>which</code> specifies.
* @param which Defines what the releaser releases
* @return Releaser for the specified release options
* @public
- * @see #DBRelease
+ * @see enum DBReleaseOption
* @see #DBReleaser
- * @see #db_default_release(DBType,DBOptions)
+ * @see #db_default_release()
*/
-DBReleaser (*custom_release) (DBRelease which);
+DBReleaser (*custom_release) (enum DBReleaseOption which);
/**
* Allocate a new database of the specified type.
+ *
* It uses the default comparator, hasher and releaser of the specified
* database type and fixed options.
- * NOTE: the options are fixed by {@link #db_fix_options(DBType,DBOptions)}
- * before creating the database.
+ *
+ * NOTE: the options are fixed by #db_fix_options() before creating the
+ * database.
+ *
* @param file File where the database is being allocated
* @param line Line of the file where the database is being allocated
* @param type Type of database
@@ -813,14 +824,14 @@ DBReleaser (*custom_release) (DBRelease which);
* databases. If 0, the maximum number of maxlen is used (64K).
* @return The interface of the database
* @public
- * @see #DBType
- * @see #DBMap
- * @see #db_default_cmp(DBType)
- * @see #db_default_hash(DBType)
- * @see #db_default_release(DBType,DBOptions)
- * @see #db_fix_options(DBType,DBOptions)
+ * @see enum DBType
+ * @see struct DBMap
+ * @see #db_default_cmp()
+ * @see #db_default_hash()
+ * @see #db_default_release()
+ * @see #db_fix_options()
*/
-DBMap* (*alloc) (const char *file, const char *func, int line, DBType type, DBOptions options, unsigned short maxlen);
+struct DBMap *(*alloc) (const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen);
/**
* Manual cast from 'int' to the union DBKey.
@@ -828,7 +839,7 @@ DBMap* (*alloc) (const char *file, const char *func, int line, DBType type, DBOp
* @return The key as a DBKey union
* @public
*/
-DBKey (*i2key) (int key);
+union DBKey (*i2key) (int key);
/**
* Manual cast from 'unsigned int' to the union DBKey.
@@ -836,7 +847,7 @@ DBKey (*i2key) (int key);
* @return The key as a DBKey union
* @public
*/
-DBKey (*ui2key) (unsigned int key);
+union DBKey (*ui2key) (unsigned int key);
/**
* Manual cast from 'unsigned char *' to the union DBKey.
@@ -844,7 +855,7 @@ DBKey (*ui2key) (unsigned int key);
* @return The key as a DBKey union
* @public
*/
-DBKey (*str2key) (const char *key);
+union DBKey (*str2key) (const char *key);
/**
* Manual cast from 'int64' to the union DBKey.
@@ -852,7 +863,7 @@ DBKey (*str2key) (const char *key);
* @return The key as a DBKey union
* @public
*/
-DBKey (*i642key) (int64 key);
+union DBKey (*i642key) (int64 key);
/**
* Manual cast from 'uint64' to the union DBKey.
@@ -860,7 +871,7 @@ DBKey (*i642key) (int64 key);
* @return The key as a DBKey union
* @public
*/
-DBKey (*ui642key) (uint64 key);
+union DBKey (*ui642key) (uint64 key);
/**
* Manual cast from 'int' to the struct DBData.
@@ -868,7 +879,7 @@ DBKey (*ui642key) (uint64 key);
* @return The data as a DBData struct
* @public
*/
-DBData (*i2data) (int data);
+struct DBData (*i2data) (int data);
/**
* Manual cast from 'unsigned int' to the struct DBData.
@@ -876,7 +887,7 @@ DBData (*i2data) (int data);
* @return The data as a DBData struct
* @public
*/
-DBData (*ui2data) (unsigned int data);
+struct DBData (*ui2data) (unsigned int data);
/**
* Manual cast from 'void *' to the struct DBData.
@@ -884,7 +895,7 @@ DBData (*ui2data) (unsigned int data);
* @return The data as a DBData struct
* @public
*/
-DBData (*ptr2data) (void *data);
+struct DBData (*ptr2data) (void *data);
/**
* Gets int type data from struct DBData.
@@ -893,7 +904,7 @@ DBData (*ptr2data) (void *data);
* @return Integer value of the data.
* @public
*/
-int (*data2i) (DBData *data);
+int (*data2i) (struct DBData *data);
/**
* Gets unsigned int type data from struct DBData.
@@ -902,7 +913,7 @@ int (*data2i) (DBData *data);
* @return Unsigned int value of the data.
* @public
*/
-unsigned int (*data2ui) (DBData *data);
+unsigned int (*data2ui) (struct DBData *data);
/**
* Gets void* type data from struct DBData.
@@ -911,7 +922,7 @@ unsigned int (*data2ui) (DBData *data);
* @return Void* value of the data.
* @public
*/
-void* (*data2ptr) (DBData *data);
+void* (*data2ptr) (struct DBData *data);
/**
* Initialize the database system.
@@ -1103,7 +1114,11 @@ HPShared struct db_interface *DB;
* @param _vec Vector.
*/
#define VECTOR_INIT(_vec) \
- memset(&(_vec), 0, sizeof(_vec))
+ do { \
+ VECTOR_DATA(_vec) = NULL; \
+ VECTOR_CAPACITY(_vec) = 0; \
+ VECTOR_LENGTH(_vec) = 0; \
+ } while(false)
/**
* Returns the internal array of values.
@@ -1209,12 +1224,11 @@ HPShared struct db_interface *DB;
*/
#define VECTOR_ENSURE(_vec, _n, _step) \
do { \
- int _empty_ = VECTOR_CAPACITY(_vec)-VECTOR_LENGTH(_vec); \
- if ((_n) > _empty_) { \
- while ((_n) > _empty_) \
- _empty_ += (_step); \
- VECTOR_RESIZE(_vec, _empty_+VECTOR_LENGTH(_vec)); \
- } \
+ int _newcapacity_ = VECTOR_CAPACITY(_vec); \
+ while ((_n) + VECTOR_LENGTH(_vec) > _newcapacity_) \
+ _newcapacity_ += (_step); \
+ if (_newcapacity_ > VECTOR_CAPACITY(_vec)) \
+ VECTOR_RESIZE(_vec, _newcapacity_); \
} while(false)
/**
@@ -1384,6 +1398,16 @@ HPShared struct db_interface *DB;
} while(false)
/**
+ * Removes all values from the vector.
+ *
+ * Does not free the allocated data.
+ */
+#define VECTOR_TRUNCATE(_vec) \
+ do { \
+ VECTOR_LENGTH(_vec) = 0; \
+ } while (false)
+
+/**
* Clears the vector, freeing allocated data.
*
* @param _vec Vector.
diff --git a/src/common/des.c b/src/common/des.c
index ce64309f3..73297ab70 100644
--- a/src/common/des.c
+++ b/src/common/des.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,24 +23,25 @@
#include "des.h"
#include "common/cbasetypes.h"
+#include "common/nullpo.h"
-/// DES (Data Encryption Standard) algorithm, modified version.
-/// @see http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5099.
-/// @see http://en.wikipedia.org/wiki/Data_Encryption_Standard
-/// @see http://en.wikipedia.org/wiki/DES_supplementary_material
+/** @file
+ * Implementation of the des interface.
+ */
+struct des_interface des_s;
+struct des_interface *des;
/// Bitmask for accessing individual bits of a byte.
static const uint8_t mask[8] = {
0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01
};
-
-/// Initial permutation (IP).
-static void IP(BIT64* src)
+/**
+ * Initial permutation (IP).
+ */
+static void des_IP(struct des_bit64 *src)
{
- BIT64 tmp = {{0}};
-
static const uint8_t ip_table[64] = {
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
@@ -51,24 +52,24 @@ static void IP(BIT64* src)
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
};
+ struct des_bit64 tmp = {{0}};
+ int i;
- size_t i;
- for( i = 0; i < ARRAYLENGTH(ip_table); ++i )
- {
+ nullpo_retv(src);
+ for(i = 0; i < ARRAYLENGTH(ip_table); ++i) {
uint8_t j = ip_table[i] - 1;
- if( src->b[(j >> 3) & 7] & mask[j & 7] )
- tmp .b[(i >> 3) & 7] |= mask[i & 7];
+ if (src->b[(j >> 3) & 7] & mask[j & 7])
+ tmp.b[(i >> 3) & 7] |= mask[i & 7];
}
*src = tmp;
}
-
-/// Final permutation (IP^-1).
-static void FP(BIT64* src)
+/**
+ * Final permutation (IP^-1).
+ */
+static void des_FP(struct des_bit64 *src)
{
- BIT64 tmp = {{0}};
-
static const uint8_t fp_table[64] = {
40, 8, 48, 16, 56, 24, 64, 32,
39, 7, 47, 15, 55, 23, 63, 31,
@@ -79,24 +80,27 @@ static void FP(BIT64* src)
34, 2, 42, 10, 50, 18, 58, 26,
33, 1, 41, 9, 49, 17, 57, 25,
};
+ struct des_bit64 tmp = {{0}};
+ int i;
- size_t i;
- for( i = 0; i < ARRAYLENGTH(fp_table); ++i )
- {
+ nullpo_retv(src);
+ for (i = 0; i < ARRAYLENGTH(fp_table); ++i) {
uint8_t j = fp_table[i] - 1;
- if( src->b[(j >> 3) & 7] & mask[j & 7] )
- tmp .b[(i >> 3) & 7] |= mask[i & 7];
+ if (src->b[(j >> 3) & 7] & mask[j & 7])
+ tmp.b[(i >> 3) & 7] |= mask[i & 7];
}
*src = tmp;
}
-
-/// Expansion (E).
-/// Expands upper four 8-bits (32b) into eight 6-bits (48b).
-static void E(BIT64* src)
+/**
+ * Expansion (E).
+ *
+ * Expands upper four 8-bits (32b) into eight 6-bits (48b).
+ */
+static void des_E(struct des_bit64 *src)
{
- BIT64 tmp = {{0}};
+ struct des_bit64 tmp = {{0}};
#if 0
// original
@@ -110,15 +114,15 @@ static void E(BIT64* src)
24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1,
};
+ int i;
- size_t i;
- for( i = 0; i < ARRAYLENGTH(expand_table); ++i )
- {
+ for (i = 0; i < ARRAYLENGTH(expand_table); ++i) {
uint8_t j = expand_table[i] - 1;
- if( src->b[j / 8 + 4] & mask[j % 8] )
- tmp .b[i / 6 + 0] |= mask[i % 6];
+ if (src->b[j / 8 + 4] & mask[j % 8])
+ tmp.b[i / 6 + 0] |= mask[i % 6];
}
#endif
+ nullpo_retv(src);
// optimized
tmp.b[0] = ((src->b[7]<<5) | (src->b[4]>>3)) & 0x3f; // ..0 vutsr
tmp.b[1] = ((src->b[4]<<1) | (src->b[5]>>7)) & 0x3f; // ..srqpo n
@@ -132,12 +136,11 @@ static void E(BIT64* src)
*src = tmp;
}
-
-/// Transposition (P-BOX).
-static void TP(BIT64* src)
+/**
+ * Transposition (P-BOX).
+ */
+static void des_TP(struct des_bit64 *src)
{
- BIT64 tmp = {{0}};
-
static const uint8_t tp_table[32] = {
16, 7, 20, 21,
29, 12, 28, 17,
@@ -148,25 +151,28 @@ static void TP(BIT64* src)
19, 13, 30, 6,
22, 11, 4, 25,
};
+ struct des_bit64 tmp = {{0}};
+ int i;
- size_t i;
- for( i = 0; i < ARRAYLENGTH(tp_table); ++i )
- {
+ nullpo_retv(src);
+ for (i = 0; i < ARRAYLENGTH(tp_table); ++i) {
uint8_t j = tp_table[i] - 1;
- if( src->b[(j >> 3) + 0] & mask[j & 7] )
- tmp .b[(i >> 3) + 4] |= mask[i & 7];
+ if (src->b[(j >> 3) + 0] & mask[j & 7])
+ tmp.b[(i >> 3) + 4] |= mask[i & 7];
}
*src = tmp;
}
-/// Substitution boxes (S-boxes).
-/// NOTE: This implementation was optimized to process two nibbles in one step (twice as fast).
-static void SBOX(BIT64* src)
+/**
+ * Substitution boxes (S-boxes).
+ *
+ * This implementation was optimized to process two nibbles in one step (twice
+ * as fast).
+ */
+static void des_SBOX(struct des_bit64 *src)
{
- BIT64 tmp = {{0}};
-
static const uint8_t s_table[4][64] = {
{
0xef, 0x03, 0x41, 0xfd, 0xd8, 0x74, 0x1e, 0x47, 0x26, 0xef, 0xfb, 0x22, 0xb3, 0xd8, 0x84, 0x1e,
@@ -190,10 +196,11 @@ static void SBOX(BIT64* src)
0xa0, 0x9f, 0xf6, 0x5c, 0x6a, 0x09, 0x8d, 0xf0, 0x0f, 0xe3, 0x53, 0x25, 0x95, 0x36, 0x28, 0xcb,
}
};
+ struct des_bit64 tmp = {{0}};
+ int i;
- size_t i;
- for( i = 0; i < ARRAYLENGTH(s_table); ++i )
- {
+ nullpo_retv(src);
+ for (i = 0; i < ARRAYLENGTH(s_table); ++i) {
tmp.b[i] = (s_table[i][src->b[i*2+0]] & 0xf0)
| (s_table[i][src->b[i*2+1]] & 0x0f);
}
@@ -201,36 +208,49 @@ static void SBOX(BIT64* src)
*src = tmp;
}
-
-/// DES round function.
-/// XORs src[0..3] with TP(SBOX(E(src[4..7]))).
-static void RoundFunction(BIT64* src)
+/**
+ * DES round function.
+ *
+ * XORs src[0..3] with TP(SBOX(E(src[4..7]))).
+ */
+static void des_RoundFunction(struct des_bit64 *src)
{
- BIT64 tmp = *src;
- E(&tmp);
- SBOX(&tmp);
- TP(&tmp);
+ struct des_bit64 tmp = *src;
+ des_E(&tmp);
+ des_SBOX(&tmp);
+ des_TP(&tmp);
+ nullpo_retv(src);
src->b[0] ^= tmp.b[4];
src->b[1] ^= tmp.b[5];
src->b[2] ^= tmp.b[6];
src->b[3] ^= tmp.b[7];
}
-
-void des_decrypt_block(BIT64* block)
+/// @copydoc des_interface::decrypt_block()
+void des_decrypt_block(struct des_bit64 *block)
{
- IP(block);
- RoundFunction(block);
- FP(block);
+ des_IP(block);
+ des_RoundFunction(block);
+ des_FP(block);
}
-
-void des_decrypt(unsigned char* data, size_t size)
+/// @copydoc des_interface::decrypt()
+void des_decrypt(unsigned char *data, size_t size)
{
- BIT64* p = (BIT64*)data;
+ struct des_bit64 *p = (struct des_bit64 *)data;
size_t i;
- for( i = 0; i*8 < size; i += 8 )
- des_decrypt_block(p);
+ for (i = 0; i*8 < size; i += 8)
+ des->decrypt_block(p);
+}
+
+/**
+ * Interface base initialization.
+ */
+void des_defaults(void)
+{
+ des = &des_s;
+ des->decrypt = des_decrypt;
+ des->decrypt_block = des_decrypt_block;
}
diff --git a/src/common/des.h b/src/common/des.h
index d62b5cc49..9924a044b 100644
--- a/src/common/des.h
+++ b/src/common/des.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,14 +21,49 @@
#ifndef COMMON_DES_H
#define COMMON_DES_H
-#include "common/cbasetypes.h"
+#include "common/hercules.h"
+
+/**
+ * @file
+ *
+ * DES (Data Encryption Standard) algorithm, modified version.
+ *
+ * @see http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5099
+ * @see http://en.wikipedia.org/wiki/Data_Encryption_Standard
+ * @see http://en.wikipedia.org/wiki/DES_supplementary_material
+ */
+
+/* Struct definitions */
/// One 64-bit block.
-typedef struct BIT64 { uint8_t b[8]; } BIT64;
+struct des_bit64 {
+ uint8_t b[8];
+};
+
+/* Interface */
+
+/// The des interface.
+struct des_interface {
+ /**
+ * Decrypts a block.
+ *
+ * @param[in,out] block The block to decrypt (in-place).
+ */
+ void (*decrypt_block) (struct des_bit64 *block);
+
+ /**
+ * Decrypts a buffer.
+ *
+ * @param [in,out] data The buffer to decrypt (in-place).
+ * @param [in] size The size of the data.
+ */
+ void (*decrypt) (unsigned char *data, size_t size);
+};
#ifdef HERCULES_CORE
-void des_decrypt_block(BIT64* block);
-void des_decrypt(unsigned char* data, size_t size);
+void des_defaults(void);
#endif // HERCULES_CORE
+HPShared struct des_interface *des; ///< Pointer to the des interface implementation.
+
#endif // COMMON_DES_H
diff --git a/src/common/ers.c b/src/common/ers.c
index 85e1fb759..f2256cf30 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -149,7 +149,8 @@ static struct ers_instance_t *InstanceList = NULL;
/**
* @param Options the options from the instance seeking a cache, we use it to give it a cache with matching configuration
**/
-static ers_cache_t *ers_find_cache(unsigned int size, enum ERSOptions Options) {
+static ers_cache_t *ers_find_cache(unsigned int size, enum ERSOptions Options)
+{
ers_cache_t *cache;
for (cache = CacheList; cache; cache = cache->Next)
@@ -187,6 +188,7 @@ static void ers_free_cache(ers_cache_t *cache, bool remove)
{
unsigned int i;
+ nullpo_retv(cache);
for (i = 0; i < cache->Used; i++)
aFree(cache->Blocks[i]);
@@ -288,7 +290,7 @@ static void ers_obj_destroy(ERS *self)
if (instance->Count > 0)
if (!(instance->Options & ERS_OPT_CLEAR))
- ShowWarning("Memory leak detected at ERS '%s', %d objects not freed.\n", instance->Name, instance->Count);
+ ShowWarning("Memory leak detected at ERS '%s', %u objects not freed.\n", instance->Name, instance->Count);
if (--instance->Cache->ReferenceCount <= 0)
ers_free_cache(instance->Cache, true);
@@ -307,22 +309,24 @@ static void ers_obj_destroy(ERS *self)
aFree(instance);
}
-void ers_cache_size(ERS *self, unsigned int new_size) {
+void ers_cache_size(ERS *self, unsigned int new_size)
+{
struct ers_instance_t *instance = (struct ers_instance_t *)self;
nullpo_retv(instance);
if( !(instance->Cache->Options&ERS_OPT_FLEX_CHUNK) ) {
- ShowWarning("ers_cache_size: '%s' has adjusted its chunk size to '%d', however ERS_OPT_FLEX_CHUNK is missing!\n",instance->Name,new_size);
+ ShowWarning("ers_cache_size: '%s' has adjusted its chunk size to '%u', however ERS_OPT_FLEX_CHUNK is missing!\n", instance->Name, new_size);
}
instance->Cache->ChunkSize = new_size;
}
-
ERS *ers_new(uint32 size, char *name, enum ERSOptions options)
{
struct ers_instance_t *instance;
+
+ nullpo_retr(NULL, name);
CREATE(instance,struct ers_instance_t, 1);
size += sizeof(struct ers_list);
@@ -359,7 +363,8 @@ ERS *ers_new(uint32 size, char *name, enum ERSOptions options)
return &instance->VTable;
}
-void ers_report(void) {
+void ers_report(void)
+{
ers_cache_t *cache;
unsigned int cache_c = 0, blocks_u = 0, blocks_a = 0, memory_b = 0, memory_t = 0;
#ifdef DEBUG
@@ -382,7 +387,7 @@ void ers_report(void) {
for (cache = CacheList; cache; cache = cache->Next) {
cache_c++;
ShowMessage(CL_BOLD"[ERS Cache of size '"CL_NORMAL""CL_WHITE"%u"CL_NORMAL""CL_BOLD"' report]\n"CL_NORMAL, cache->ObjectSize);
- ShowMessage("\tinstances : %u\n", cache->ReferenceCount);
+ ShowMessage("\tinstances : %d\n", cache->ReferenceCount);
ShowMessage("\tblocks in use : %u/%u\n", cache->UsedObjs, cache->UsedObjs+cache->Free);
ShowMessage("\tblocks unused : %u\n", cache->Free);
ShowMessage("\tmemory in use : %.2f MB\n", cache->UsedObjs == 0 ? 0. : (double)((cache->UsedObjs * cache->ObjectSize)/1024)/1024);
@@ -403,7 +408,8 @@ void ers_report(void) {
/**
* Call on shutdown to clear remaining entries
**/
-void ers_final(void) {
+void ers_final(void)
+{
struct ers_instance_t *instance = InstanceList, *next;
while( instance ) {
diff --git a/src/common/ers.h b/src/common/ers.h
index 1689345dc..5f9516ad6 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 678875c91..fba3dda86 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -35,10 +35,12 @@
#include <sys/stat.h>
#include <zlib.h>
-//----------------------------
-// file entry table struct
-//----------------------------
-typedef struct FILELIST {
+/** @file
+ * Implementation of the GRF I/O interface.
+ */
+
+/// File entry table struct.
+struct grf_filelist {
int srclen; ///< compressed size
int srclen_aligned;
int declen; ///< original size
@@ -48,11 +50,13 @@ typedef struct FILELIST {
char fn[128-4*5]; ///< file name
char *fnd; ///< if the file was cloned, contains name of original file
int8 gentry; ///< read grf file select
-} FILELIST;
+};
-#define FILELIST_TYPE_FILE 0x01 // entry is a file
-#define FILELIST_TYPE_ENCRYPT_MIXED 0x02 // encryption mode 0 (header DES + periodic DES/shuffle)
-#define FILELIST_TYPE_ENCRYPT_HEADER 0x04 // encryption mode 1 (header DES only)
+enum grf_filelist_type {
+ FILELIST_TYPE_FILE = 0x01, ///< entry is a file
+ FILELIST_TYPE_ENCRYPT_MIXED = 0x02, ///< encryption mode 0 (header DES + periodic DES/shuffle)
+ FILELIST_TYPE_ENCRYPT_HEADER = 0x04, ///< encryption mode 1 (header DES only)
+};
//gentry ... > 0 : data read from a grf file (gentry_table[gentry-1])
//gentry ... 0 : data read from a local file (data directory)
@@ -64,7 +68,7 @@ typedef struct FILELIST {
//#define GRFIO_LOCAL
// stores info about every loaded file
-FILELIST* filelist = NULL;
+struct grf_filelist *filelist = NULL;
int filelist_entrys = 0;
int filelist_maxentry = 0;
@@ -76,24 +80,32 @@ int gentry_maxentry = 0;
// the path to the data directory
char data_dir[1024] = "";
+struct grfio_interface grfio_s;
+struct grfio_interface *grfio;
+
// little endian char array to uint conversion
-static unsigned int getlong(unsigned char* p)
+static unsigned int getlong(unsigned char *p)
{
+ nullpo_ret(p);
return (p[0] << 0 | p[1] << 8 | p[2] << 16 | p[3] << 24);
}
-static void NibbleSwap(unsigned char* src, int len)
+static void NibbleSwap(unsigned char *src, int len)
{
- while( len > 0 )
- {
+ nullpo_retv(src);
+ while (len > 0) {
*src = (*src >> 4) | (*src << 4);
++src;
--len;
}
}
-/// Substitutes some specific values for others, leaves rest intact. Obfuscation.
-/// NOTE: Operation is symmetric (calling it twice gives back the original input).
+/**
+ * (De)-obfuscates data.
+ *
+ * Substitutes some specific values for others, leaves rest intact.
+ * NOTE: Operation is symmetric (calling it twice gives back the original input).
+ */
static uint8_t grf_substitution(uint8_t in)
{
uint8_t out;
@@ -121,10 +133,11 @@ static uint8_t grf_substitution(uint8_t in)
}
#if 0 /* this is not used anywhere, is it ok to delete? */
-static void grf_shuffle_enc(BIT64* src)
+static void grf_shuffle_enc(struct des_bit64 *src)
{
- BIT64 out;
+ struct des_bit64 out;
+ nullpo_retv(src);
out.b[0] = src->b[3];
out.b[1] = src->b[4];
out.b[2] = src->b[5];
@@ -138,10 +151,11 @@ static void grf_shuffle_enc(BIT64* src)
}
#endif // 0
-static void grf_shuffle_dec(BIT64* src)
+static void grf_shuffle_dec(struct des_bit64 *src)
{
- BIT64 out;
+ struct des_bit64 out;
+ nullpo_retv(src);
out.b[0] = src->b[3];
out.b[1] = src->b[4];
out.b[2] = src->b[6];
@@ -154,29 +168,44 @@ static void grf_shuffle_dec(BIT64* src)
*src = out;
}
-static void grf_decode_header(unsigned char* buf, size_t len)
+/**
+ * Decodes header-encrypted grf data.
+ *
+ * @param[in,out] buf Data to decode (in-place).
+ * @param[in] len Length of the data.
+ */
+static void grf_decode_header(unsigned char *buf, size_t len)
{
- BIT64* p = (BIT64*)buf;
- size_t nblocks = len / sizeof(BIT64);
+ struct des_bit64 *p = (struct des_bit64 *)buf;
+ size_t nblocks = len / sizeof(struct des_bit64);
size_t i;
+ nullpo_retv(buf);
// first 20 blocks are all des-encrypted
- for( i = 0; i < 20 && i < nblocks; ++i )
- des_decrypt_block(&p[i]);
+ for (i = 0; i < 20 && i < nblocks; ++i)
+ des->decrypt_block(&p[i]);
// the rest is plaintext, done.
}
-static void grf_decode_full(unsigned char* buf, size_t len, int cycle)
+/**
+ * Decodes fully encrypted grf data
+ *
+ * @param[in,out] buf Data to decode (in-place).
+ * @param[in] len Length of the data.
+ * @param[in] cycle The current decoding cycle.
+ */
+static void grf_decode_full(unsigned char *buf, size_t len, int cycle)
{
- BIT64* p = (BIT64*)buf;
- size_t nblocks = len / sizeof(BIT64);
+ struct des_bit64 *p = (struct des_bit64 *)buf;
+ size_t nblocks = len / sizeof(struct des_bit64);
int dcycle, scycle;
size_t i, j;
+ nullpo_retv(buf);
// first 20 blocks are all des-encrypted
- for( i = 0; i < 20 && i < nblocks; ++i )
- des_decrypt_block(&p[i]);
+ for (i = 0; i < 20 && i < nblocks; ++i)
+ des->decrypt_block(&p[i]);
// after that only one of every 'dcycle' blocks is des-encrypted
dcycle = cycle;
@@ -186,17 +215,16 @@ static void grf_decode_full(unsigned char* buf, size_t len, int cycle)
// so decrypt/de-shuffle periodically
j = (size_t)-1; // 0, adjusted to fit the ++j step
- for( i = 20; i < nblocks; ++i )
- {
- if( i % dcycle == 0 )
- {// decrypt block
- des_decrypt_block(&p[i]);
+ for (i = 20; i < nblocks; ++i) {
+ if (i % dcycle == 0) {
+ // decrypt block
+ des->decrypt_block(&p[i]);
continue;
}
++j;
- if( j % scycle == 0 && j != 0 )
- {// de-shuffle block
+ if (j % scycle == 0 && j != 0) {
+ // de-shuffle block
grf_shuffle_dec(&p[i]);
continue;
}
@@ -205,22 +233,25 @@ static void grf_decode_full(unsigned char* buf, size_t len, int cycle)
}
}
-/// Decodes grf data.
-/// @param buf data to decode (in-place)
-/// @param len length of the data
-/// @param entry_type flags associated with the data
-/// @param entry_len true (unaligned) length of the data
-static void grf_decode(unsigned char* buf, size_t len, char entry_type, int entry_len)
+/**
+ * Decodes grf data.
+ *
+ * @param[in,out] buf Data to decode (in-place).
+ * @param[in] len Length of the data
+ * @param[in] entry_type Flags associated with the data.
+ * @param[in] entry_len True (unaligned) length of the data.
+ */
+static void grf_decode(unsigned char *buf, size_t len, char entry_type, int entry_len)
{
- if( entry_type & FILELIST_TYPE_ENCRYPT_MIXED )
- {// fully encrypted
+ if (entry_type & FILELIST_TYPE_ENCRYPT_MIXED) {
+ // fully encrypted
int digits;
int cycle;
int i;
// compute number of digits of the entry length
digits = 1;
- for( i = 10; i <= entry_len; i *= 10 )
+ for (i = 10; i <= entry_len; i *= 10)
++digits;
// choose size of gap between two encrypted blocks
@@ -232,51 +263,47 @@ static void grf_decode(unsigned char* buf, size_t len, char entry_type, int entr
: digits + 15;
grf_decode_full(buf, len, cycle);
- }
- else
- if( entry_type & FILELIST_TYPE_ENCRYPT_HEADER )
- {// header encrypted
+ } else if (entry_type & FILELIST_TYPE_ENCRYPT_HEADER) {
+ // header encrypted
grf_decode_header(buf, len);
}
- else
- {// plaintext
- ;
- }
+ /* else plaintext */
}
-/******************************************************
- *** Zlib Subroutines ***
- ******************************************************/
+/* Zlib Subroutines */
-/// zlib crc32
-unsigned long grfio_crc32(const unsigned char* buf, unsigned int len)
+/// @copydoc grfio_interface::crc32()
+unsigned long grfio_crc32(const unsigned char *buf, unsigned int len)
{
return crc32(crc32(0L, Z_NULL, 0), buf, len);
}
-/// zlib uncompress
-int decode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen)
+/// @copydoc grfio_interface::decode_zip
+int grfio_decode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len)
{
- return uncompress((Bytef*)dest, destLen, (const Bytef*)source, sourceLen);
+ return uncompress(dest, dest_len, source, source_len);
}
-/// zlib compress
-int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen) {
- if( *destLen == 0 ) /* [Ind/Hercules] */
- *destLen = compressBound(sourceLen);
- if( dest == NULL ) { /* [Ind/Hercules] */
- CREATE(dest, unsigned char, *destLen);
+/// @copydoc grfio_interface::encode_zip
+int grfio_encode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len)
+{
+ if (*dest_len == 0) /* [Ind/Hercules] */
+ *dest_len = compressBound(source_len);
+ if (dest == NULL) {
+ /* [Ind/Hercules] */
+ CREATE(dest, unsigned char, *dest_len);
}
- return compress((Bytef*)dest, destLen, (const Bytef*)source, sourceLen);
+ return compress(dest, dest_len, source, source_len);
}
-/***********************************************************
- *** File List Subroutines ***
- ***********************************************************/
-// file list hash table
+/* File List Subroutines */
+
+/// File list hash table
int filelist_hash[256];
-// initializes the table that holds the first elements of all hash chains
+/**
+ * Initializes the table that holds the first elements of all hash chains
+ */
static void hashinit(void)
{
int i;
@@ -284,26 +311,38 @@ static void hashinit(void)
filelist_hash[i] = -1;
}
-// hashes a filename string into a number from {0..255}
-static int filehash(const char* fname)
+/**
+ * Hashes a filename string into a number from {0..255}
+ *
+ * @param fname The filename to hash.
+ * @return The hash.
+ */
+static int grf_filehash(const char *fname)
{
- unsigned int hash = 0;
- while(*fname) {
+ uint32 hash = 0;
+ nullpo_ret(fname);
+ while (*fname != '\0') {
hash = (hash<<1) + (hash>>7)*9 + TOLOWER(*fname);
fname++;
}
return hash & 255;
}
-// finds a FILELIST entry with the specified file name
-static FILELIST* filelist_find(const char* fname)
+/**
+ * Finds a grf_filelist entry with the specified file name
+ *
+ * @param fname The file to find.
+ * @return The file entry.
+ * @retval NULL if the file wasn't found.
+ */
+static struct grf_filelist *grfio_filelist_find(const char *fname)
{
int hash, index;
- if (!filelist)
+ if (filelist == NULL)
return NULL;
- hash = filelist_hash[filehash(fname)];
+ hash = filelist_hash[grf_filehash(fname)];
for (index = hash; index != -1; index = filelist[index].next)
if(!strcmpi(filelist[index].fn, fname))
break;
@@ -311,16 +350,23 @@ static FILELIST* filelist_find(const char* fname)
return (index >= 0) ? &filelist[index] : NULL;
}
-// returns the original file name
-char* grfio_find_file(const char* fname)
+/// @copydoc grfio_interface::find_file()
+const char *grfio_find_file(const char *fname)
{
- FILELIST *flist = filelist_find(fname);
- if (!flist) return NULL;
+ struct grf_filelist *flist = grfio_filelist_find(fname);
+ if (flist == NULL)
+ return NULL;
return (!flist->fnd ? flist->fn : flist->fnd);
}
-// adds a FILELIST entry into the list of loaded files
-static FILELIST* filelist_add(FILELIST* entry) {
+/**
+ * Adds a grf_filelist entry into the list of loaded files.
+ *
+ * @param entry The entry to add.
+ * @return A pointer to the added entry.
+ */
+static struct grf_filelist *grfio_filelist_add(struct grf_filelist *entry)
+{
int hash;
nullpo_ret(entry);
#ifdef __clang_analyzer__
@@ -331,16 +377,16 @@ static FILELIST* filelist_add(FILELIST* entry) {
#define FILELIST_ADDS 1024 // number increment of file lists `
if (filelist_entrys >= filelist_maxentry) {
- filelist = (FILELIST *)aRealloc(filelist, (filelist_maxentry + FILELIST_ADDS) * sizeof(FILELIST));
- memset(filelist + filelist_maxentry, '\0', FILELIST_ADDS * sizeof(FILELIST));
+ filelist = aRealloc(filelist, (filelist_maxentry + FILELIST_ADDS) * sizeof(struct grf_filelist));
+ memset(filelist + filelist_maxentry, '\0', FILELIST_ADDS * sizeof(struct grf_filelist));
filelist_maxentry += FILELIST_ADDS;
}
#undef FILELIST_ADDS
- memcpy(&filelist[filelist_entrys], entry, sizeof(FILELIST));
+ memcpy(&filelist[filelist_entrys], entry, sizeof(struct grf_filelist));
- hash = filehash(entry->fn);
+ hash = grf_filehash(entry->fn);
filelist[filelist_entrys].next = filelist_hash[hash];
filelist_hash[hash] = filelist_entrys;
@@ -349,73 +395,82 @@ static FILELIST* filelist_add(FILELIST* entry) {
return &filelist[filelist_entrys - 1];
}
-// adds a new FILELIST entry or overwrites an existing one
-static FILELIST* filelist_modify(FILELIST* entry)
+/**
+ * Adds a new grf_filelist entry or overwrites an existing one.
+ *
+ * @param entry The entry to add.
+ * @return A pointer to the added entry.
+ */
+static struct grf_filelist *grfio_filelist_modify(struct grf_filelist *entry)
{
- FILELIST* fentry = filelist_find(entry->fn);
+ struct grf_filelist *fentry;
+ nullpo_retr(NULL, entry);
+ fentry = grfio_filelist_find(entry->fn);
if (fentry != NULL) {
int tmp = fentry->next;
- memcpy(fentry, entry, sizeof(FILELIST));
+ memcpy(fentry, entry, sizeof(struct grf_filelist));
fentry->next = tmp;
} else {
- fentry = filelist_add(entry);
+ fentry = grfio_filelist_add(entry);
}
return fentry;
}
-// shrinks the file list array if too long
-static void filelist_compact(void)
+/// Shrinks the file list array if too long.
+static void grfio_filelist_compact(void)
{
if (filelist == NULL)
return;
if (filelist_entrys < filelist_maxentry) {
- filelist = (FILELIST *)aRealloc(filelist, filelist_entrys * sizeof(FILELIST));
+ filelist = aRealloc(filelist, filelist_entrys * sizeof(struct grf_filelist));
filelist_maxentry = filelist_entrys;
}
}
-/***********************************************************
- *** Grfio Subroutines ***
- ***********************************************************/
+/* GRF I/O Subroutines */
-/// Combines are resource path with the data folder location to create local resource path.
-static void grfio_localpath_create(char* buffer, size_t size, const char* filename)
+/**
+ * Combines a resource path with the data folder location to create local
+ * resource path.
+ *
+ * @param[out] buffer The output buffer.
+ * @param[in] size The size of the output buffer.
+ * @param[in] filename Resource path.
+ */
+static void grfio_localpath_create(char *buffer, size_t size, const char *filename)
{
- unsigned int i;
+ int i;
size_t len;
+ nullpo_retv(buffer);
len = strlen(data_dir);
- if( data_dir[0] == '\0' || data_dir[len-1] == '/' || data_dir[len-1] == '\\' )
- {
+ if (data_dir[0] == '\0' || data_dir[len-1] == '/' || data_dir[len-1] == '\\')
safesnprintf(buffer, size, "%s%s", data_dir, filename);
- }
else
- {
safesnprintf(buffer, size, "%s/%s", data_dir, filename);
- }
// normalize path
- for( i = 0; buffer[i] != '\0'; ++i )
- if( buffer[i] == '\\' )
+ for (i = 0; buffer[i] != '\0'; ++i)
+ if (buffer[i] == '\\')
buffer[i] = '/';
}
-/// Reads a file into a newly allocated buffer (from grf or data directory).
+/// @copydoc grfio_interface::reads()
void *grfio_reads(const char *fname, int *size)
{
- FILELIST* entry = filelist_find(fname);
+ struct grf_filelist *entry = grfio_filelist_find(fname);
if (entry == NULL || entry->gentry <= 0) {
// LocalFileCheck
char lfname[256];
FILE *in;
- unsigned char *buf = NULL;
grfio_localpath_create(lfname, sizeof(lfname), (entry && entry->fnd) ? entry->fnd : fname);
in = fopen(lfname, "rb");
if (in != NULL) {
int declen;
+ unsigned char *buf = NULL;
fseek(in,0,SEEK_END);
declen = (int)ftell(in);
if (declen == -1) {
@@ -424,7 +479,7 @@ void *grfio_reads(const char *fname, int *size)
return NULL;
}
fseek(in,0,SEEK_SET);
- buf = (unsigned char *)aMalloc(declen+1); // +1 for resnametable zero-termination
+ buf = aMalloc(declen+1); // +1 for resnametable zero-termination
buf[declen] = '\0';
if (fread(buf, 1, declen, in) != (size_t)declen) {
ShowError("An error occurred in fread grfio_reads, fname=%s \n",fname);
@@ -454,7 +509,7 @@ void *grfio_reads(const char *fname, int *size)
if (in != NULL) {
int fsize = entry->srclen_aligned;
- unsigned char *buf = (unsigned char *)aMalloc(fsize);
+ unsigned char *buf = aMalloc(fsize);
unsigned char *buf2 = NULL;
if (fseek(in, entry->srcpos, SEEK_SET) != 0
|| fread(buf, 1, fsize, in) != (size_t)fsize) {
@@ -465,14 +520,14 @@ void *grfio_reads(const char *fname, int *size)
}
fclose(in);
- buf2 = (unsigned char *)aMalloc(entry->declen+1); // +1 for resnametable zero-termination
+ buf2 = aMalloc(entry->declen+1); // +1 for resnametable zero-termination
buf2[entry->declen] = '\0';
if (entry->type & FILELIST_TYPE_FILE) {
// file
uLongf len;
grf_decode(buf, fsize, entry->type, entry->srclen);
len = entry->declen;
- decode_zip(buf2, &len, buf, entry->srclen);
+ grfio->decode_zip(buf2, &len, buf, entry->srclen);
if (len != (uLong)entry->declen) {
ShowError("decode_zip size mismatch err: %d != %d\n", (int)len, entry->declen);
aFree(buf);
@@ -498,49 +553,69 @@ void *grfio_reads(const char *fname, int *size)
return NULL;
}
-/// Decodes encrypted filename from a version 01xx grf index.
-static char* decode_filename(unsigned char* buf, int len)
+/**
+ * Decodes encrypted filename from a version 01xx grf index.
+ *
+ * @param[in,out] buf The encrypted filename (decrypted in-place).
+ * @param[in] len The filename length.
+ * @return A pointer to the decrypted filename.
+ */
+static char *grfio_decode_filename(unsigned char *buf, int len)
{
- int lop;
- for(lop=0;lop<len;lop+=8) {
- NibbleSwap(&buf[lop],8);
- des_decrypt(&buf[lop],8);
+ int i;
+ nullpo_retr(NULL, buf);
+ for (i = 0; i < len; i += 8) {
+ NibbleSwap(&buf[i],8);
+ des->decrypt(&buf[i],8);
}
return (char*)buf;
}
-/// Compares file extension against known large file types.
-/// @return true if the file should undergo full mode 0 decryption, and true otherwise.
-static bool isFullEncrypt(const char* fname)
+/**
+ * Compares file extension against known large file types.
+ *
+ * @param fname The file name.
+ * @return true if the file should undergo full mode 0 decryption, and true otherwise.
+ */
+static bool grfio_is_full_encrypt(const char *fname)
{
- const char* ext = strrchr(fname, '.');
- if( ext != NULL ) {
- static const char extensions[4][5] = { ".gnd", ".gat", ".act", ".str" };
- size_t i;
- for( i = 0; i < ARRAYLENGTH(extensions); ++i )
- if( strcmpi(ext, extensions[i]) == 0 )
+ const char *ext;
+ nullpo_retr(false, fname);
+ ext = strrchr(fname, '.');
+ if (ext != NULL) {
+ static const char *extensions[] = { ".gnd", ".gat", ".act", ".str" };
+ int i;
+ for (i = 0; i < ARRAYLENGTH(extensions); ++i)
+ if (strcmpi(ext, extensions[i]) == 0)
return false;
}
return true;
}
-/// Loads all entries in the specified grf file into the filelist.
-/// @param gentry index of the grf file name in the gentry_table
+/**
+ * Loads all entries in the specified grf file into the filelist.
+ *
+ * @param grfname Name of the grf file.
+ * @param gentry Index of the grf file name in the gentry_table.
+ * @return Error code.
+ * @retval 0 in case of success.
+ */
static int grfio_entryread(const char *grfname, int gentry)
{
long grf_size;
unsigned char grf_header[0x2e] = { 0 };
int entry,entrys,ofs,grf_version;
unsigned char *grf_filelist;
+ FILE *fp;
- FILE *fp = fopen(grfname, "rb");
- if( fp == NULL ) {
- ShowWarning("GRF data file not found: '%s'\n",grfname);
+ nullpo_retr(1, grfname);
+ fp = fopen(grfname, "rb");
+ if (fp == NULL) {
+ ShowWarning("GRF data file not found: '%s'\n", grfname);
return 1; // 1:not found error
- } else {
- ShowInfo("GRF data file found: '%s'\n",grfname);
}
+ ShowInfo("GRF data file found: '%s'\n", grfname);
fseek(fp,0,SEEK_END);
grf_size = ftell(fp);
@@ -551,7 +626,7 @@ static int grfio_entryread(const char *grfname, int gentry)
fclose(fp);
return 2; // 2:file format error
}
- if (strcmp((const char*)grf_header,"Master of Magic") != 0 || fseek(fp,getlong(grf_header+0x1e),SEEK_CUR) != 0) {
+ if (strcmp((const char*)grf_header, "Master of Magic") != 0 || fseek(fp, getlong(grf_header+0x1e), SEEK_CUR) != 0) {
fclose(fp);
ShowError("GRF %s read error\n", grfname);
return 2; // 2:file format error
@@ -561,9 +636,8 @@ static int grfio_entryread(const char *grfname, int gentry)
if (grf_version == 0x01) {
// ****** Grf version 01xx ******
- long list_size;
- list_size = grf_size - ftell(fp);
- grf_filelist = (unsigned char *)aMalloc(list_size);
+ long list_size = grf_size - ftell(fp);
+ grf_filelist = aMalloc(list_size);
if (fread(grf_filelist,1,list_size,fp) != (size_t)list_size) {
ShowError("Couldn't read all grf_filelist element of %s \n", grfname);
aFree(grf_filelist);
@@ -576,11 +650,11 @@ static int grfio_entryread(const char *grfname, int gentry)
// Get an entry
for (entry = 0, ofs = 0; entry < entrys; ++entry) {
- FILELIST aentry;
+ struct grf_filelist aentry = { 0 };
int ofs2 = ofs+getlong(grf_filelist+ofs)+4;
unsigned char type = grf_filelist[ofs2+12];
if (type&FILELIST_TYPE_FILE) {
- char *fname = decode_filename(grf_filelist+ofs+6, grf_filelist[ofs]-6);
+ char *fname = grfio_decode_filename(grf_filelist+ofs+6, grf_filelist[ofs]-6);
int srclen = getlong(grf_filelist+ofs2+0) - getlong(grf_filelist+ofs2+8) - 715;
if (strlen(fname) > sizeof(aentry.fn) - 1) {
@@ -589,7 +663,7 @@ static int grfio_entryread(const char *grfname, int gentry)
return 5; // 5: file name too long
}
- type |= isFullEncrypt(fname) ? FILELIST_TYPE_ENCRYPT_MIXED : FILELIST_TYPE_ENCRYPT_HEADER;
+ type |= grfio_is_full_encrypt(fname) ? FILELIST_TYPE_ENCRYPT_MIXED : FILELIST_TYPE_ENCRYPT_HEADER;
aentry.srclen = srclen;
aentry.srclen_aligned = getlong(grf_filelist+ofs2+4)-37579;
@@ -603,7 +677,7 @@ static int grfio_entryread(const char *grfname, int gentry)
#else
aentry.gentry = (char)(gentry+1); // With no first time LocalFileCheck
#endif
- filelist_modify(&aentry);
+ grfio_filelist_modify(&aentry);
}
ofs = ofs2 + 17;
@@ -630,7 +704,7 @@ static int grfio_entryread(const char *grfname, int gentry)
return 4;
}
- rBuf = (unsigned char *)aMalloc(rSize); // Get a Read Size
+ rBuf = aMalloc(rSize); // Get a Read Size
if (fread(rBuf,1,rSize,fp) != rSize) {
ShowError("An error occurred in fread \n");
fclose(fp);
@@ -638,8 +712,8 @@ static int grfio_entryread(const char *grfname, int gentry)
return 4;
}
fclose(fp);
- grf_filelist = (unsigned char *)aMalloc(eSize); // Get a Extend Size
- decode_zip(grf_filelist, &eSize, rBuf, rSize); // Decode function
+ grf_filelist = aMalloc(eSize); // Get a Extend Size
+ grfio->decode_zip(grf_filelist, &eSize, rBuf, rSize); // Decode function
aFree(rBuf);
entrys = getlong(grf_header+0x26) - 7;
@@ -647,7 +721,7 @@ static int grfio_entryread(const char *grfname, int gentry)
// Get an entry
for (entry = 0, ofs = 0; entry < entrys; ++entry) {
- FILELIST aentry;
+ struct grf_filelist aentry;
char *fname = (char*)(grf_filelist+ofs);
int ofs2 = ofs + (int)strlen(fname)+1;
int type = grf_filelist[ofs2+12];
@@ -672,84 +746,90 @@ static int grfio_entryread(const char *grfname, int gentry)
#else
aentry.gentry = (char)(gentry+1); // With no first time LocalFileCheck
#endif
- filelist_modify(&aentry);
+ grfio_filelist_modify(&aentry);
}
ofs = ofs2 + 17;
}
aFree(grf_filelist);
- } else {// ****** Grf Other version ******
+ } else {
+ // ****** Grf Other version ******
fclose(fp);
ShowError("GRF version %04x not supported\n",getlong(grf_header+0x2a));
return 4;
}
- filelist_compact(); // Unnecessary area release of filelist
+ grfio_filelist_compact(); // Unnecessary area release of filelist
return 0; // 0:no error
}
-static bool grfio_parse_restable_row(const char* row)
+/**
+ * Parses a Resource file table row.
+ *
+ * @param row The row data.
+ * @return success state.
+ * @retval true in case of success.
+ */
+static bool grfio_parse_restable_row(const char *row)
{
char w1[256], w2[256];
char src[256], dst[256];
char local[256];
- FILELIST* entry;
+ struct grf_filelist *entry = NULL;
+ nullpo_retr(false, row);
if (sscanf(row, "%255[^#\r\n]#%255[^#\r\n]#", w1, w2) != 2)
return false;
- if( strstr(w2, ".gat") == NULL && strstr(w2, ".rsw") == NULL )
+ if (strstr(w2, ".gat") == NULL && strstr(w2, ".rsw") == NULL)
return false; // we only need the maps' GAT and RSW files
sprintf(src, "data\\%s", w1);
sprintf(dst, "data\\%s", w2);
- entry = filelist_find(dst);
- if( entry != NULL )
- {// alias for GRF resource
- FILELIST fentry;
- memcpy(&fentry, entry, sizeof(FILELIST));
+ entry = grfio_filelist_find(dst);
+ if (entry != NULL) {
+ // alias for GRF resource
+ struct grf_filelist fentry = *entry;
safestrncpy(fentry.fn, src, sizeof(fentry.fn));
fentry.fnd = aStrdup(dst);
- filelist_modify(&fentry);
+ grfio_filelist_modify(&fentry);
return true;
}
grfio_localpath_create(local, sizeof(local), dst);
- if( exists(local) )
- {// alias for local resource
- FILELIST fentry;
- memset(&fentry, 0, sizeof(fentry));
+ if (exists(local)) {
+ // alias for local resource
+ struct grf_filelist fentry = { 0 };
safestrncpy(fentry.fn, src, sizeof(fentry.fn));
fentry.fnd = aStrdup(dst);
- filelist_modify(&fentry);
+ grfio_filelist_modify(&fentry);
return true;
}
return false;
}
-/// Grfio Resource file check.
+/**
+ * Grfio Resource file check.
+ */
static void grfio_resourcecheck(void)
{
char restable[256];
- char *buf;
- int size;
- FILE* fp;
- int i = 0;
+ char *buf = NULL;
+ FILE *fp = NULL;
+ int size = 0, i = 0;
// read resnametable from data directory and return if successful
grfio_localpath_create(restable, sizeof(restable), "data\\resnametable.txt");
fp = fopen(restable, "rb");
- if( fp != NULL )
- {
+ if (fp != NULL) {
char line[256];
- while( fgets(line, sizeof(line), fp) )
- {
- if( grfio_parse_restable_row(line) )
+ while (fgets(line, sizeof(line), fp)) {
+ if (grfio_parse_restable_row(line))
++i;
}
@@ -759,20 +839,19 @@ static void grfio_resourcecheck(void)
}
// read resnametable from loaded GRF's, only if it cannot be loaded from the data directory
- buf = (char *)grfio_reads("data\\resnametable.txt", &size);
- if( buf != NULL )
- {
- char *ptr;
+ buf = grfio->reads("data\\resnametable.txt", &size);
+ if (buf != NULL) {
+ char *ptr = NULL;
buf[size] = '\0';
ptr = buf;
- while( ptr - buf < size )
- {
- if( grfio_parse_restable_row(ptr) )
+ while (ptr - buf < size) {
+ if (grfio_parse_restable_row(ptr))
++i;
ptr = strchr(ptr, '\n');
- if( ptr == NULL ) break;
+ if (ptr == NULL)
+ break;
ptr++;
}
@@ -782,13 +861,20 @@ static void grfio_resourcecheck(void)
}
}
-/// Reads a grf file and adds it to the list.
-static int grfio_add(const char* fname)
+/**
+ * Reads a grf file and adds it to the list.
+ *
+ * @param fname The file name to read.
+ * @return Error code.
+ * @retval 0 in case of success.
+ */
+static int grfio_add(const char *fname)
{
+ nullpo_retr(1, fname);
if (gentry_entrys >= gentry_maxentry) {
#define GENTRY_ADDS 4 // The number increment of gentry_table entries
gentry_maxentry += GENTRY_ADDS;
- gentry_table = (char**)aRealloc(gentry_table, gentry_maxentry * sizeof(char*));
+ gentry_table = aRealloc(gentry_table, gentry_maxentry * sizeof(char*));
memset(gentry_table + (gentry_maxentry - GENTRY_ADDS), 0, sizeof(char*) * GENTRY_ADDS);
#undef GENTRY_ADDS
}
@@ -798,7 +884,7 @@ static int grfio_add(const char* fname)
return grfio_entryread(fname, gentry_entrys - 1);
}
-/// Finalizes grfio.
+/// @copydoc grfio_interface::final()
void grfio_final(void)
{
if (filelist != NULL) {
@@ -824,36 +910,34 @@ void grfio_final(void)
gentry_entrys = gentry_maxentry = 0;
}
-/// Initializes grfio.
-void grfio_init(const char* fname)
+/// @copydoc grfio_interface::init()
+void grfio_init(const char *fname)
{
- FILE* data_conf;
+ FILE *data_conf;
int grf_num = 0;
+ nullpo_retv(fname);
hashinit(); // hash table initialization
data_conf = fopen(fname, "r");
- if( data_conf != NULL )
- {
+ if (data_conf != NULL) {
char line[1024];
- while( fgets(line, sizeof(line), data_conf) )
- {
+ while (fgets(line, sizeof(line), data_conf)) {
char w1[1024], w2[1024];
- if( line[0] == '/' && line[1] == '/' )
+ if (line[0] == '/' && line[1] == '/')
continue; // skip comments
if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2)
continue; // skip unrecognized lines
// Entry table reading
- if( strcmp(w1, "grf") == 0 ) // GRF file
- {
- if( grfio_add(w2) == 0 )
+ if (strcmp(w1, "grf") == 0) {
+ // GRF file
+ if (grfio_add(w2) == 0)
++grf_num;
- }
- else if( strcmp(w1,"data_dir") == 0 ) // Data directory
- {
+ } else if (strcmp(w1,"data_dir") == 0) {
+ // Data directory
safestrncpy(data_dir, w2, sizeof(data_dir));
}
}
@@ -862,12 +946,25 @@ void grfio_init(const char* fname)
ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n", fname);
}
- if( grf_num == 0 )
+ if (grf_num == 0)
ShowInfo("No GRF loaded, using default data directory\n");
// Unnecessary area release of filelist
- filelist_compact();
+ grfio_filelist_compact();
// Resource check
grfio_resourcecheck();
}
+
+/// Interface base initialization.
+void grfio_defaults(void)
+{
+ grfio = &grfio_s;
+ grfio->init = grfio_init;
+ grfio->final = grfio_final;
+ grfio->reads = grfio_reads;
+ grfio->find_file = grfio_find_file;
+ grfio->crc32 = grfio_crc32;
+ grfio->decode_zip = grfio_decode_zip;
+ grfio->encode_zip = grfio_encode_zip;
+}
diff --git a/src/common/grfio.h b/src/common/grfio.h
index 36ed8fb39..857bc507e 100644
--- a/src/common/grfio.h
+++ b/src/common/grfio.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,16 +21,104 @@
#ifndef COMMON_GRFIO_H
#define COMMON_GRFIO_H
+#include "common/hercules.h"
+
+/** @file
+ * GRF I/O library.
+ */
+
+/// The GRF I/O interface.
+struct grfio_interface {
+ /**
+ * Interface initialization.
+ *
+ * @param fname Name of the configuration file.
+ */
+ void (*init) (const char *fname);
+
+ /// Interface finalization.
+ void (*final) (void);
+
+ /**
+ * Reads a file into a newly allocated buffer (from grf or data directory).
+ *
+ * @param[in] fname Name of the file to read.
+ * @param[out] size Buffer to return the size of the read file (optional).
+ * @return The file data.
+ * @retval NULL in case of error.
+ */
+ void *(*reads) (const char *fname, int *size);
+
+ /**
+ * Finds a file in the grf or data directory
+ *
+ * @param fname The file to find.
+ * @return The original file name.
+ * @retval NULL if the file wasn't found.
+ */
+ const char *(*find_file) (const char *fname);
+
+ /**
+ * Calculates a CRC32 hash.
+ *
+ * @param buf The data to hash.
+ * @param len Data length.
+ *
+ * @return The CRC32 hash.
+ */
+ unsigned long (*crc32) (const unsigned char *buf, unsigned int len);
+
+ /**
+ * Decompresses ZIP data.
+ *
+ * Decompresses the source buffer into the destination buffer.
+ * source_len is the byte length of the source buffer. Upon entry,
+ * dest_len is the total size of the destination buffer, which must be
+ * large enough to hold the entire uncompressed data. (The size of the
+ * uncompressed data must have been saved previously by the compressor
+ * and transmitted to the decompressor by some mechanism outside the
+ * scope of this compression library.) Upon exit, dest_len is the
+ * actual size of the uncompressed buffer.
+ *
+ * @param[in,out] dest The destination (uncompressed) buffer.
+ * @param[in,out] dest_len Max length of the destination buffer, returns length of the decompressed data.
+ * @param[in] source The source (compressed) buffer.
+ * @param[in] source_len Source data length.
+ * @return error code.
+ * @retval Z_OK in case of success.
+ */
+ int (*decode_zip) (void *dest, unsigned long *dest_len, const void *source, unsigned long source_len);
+
+ /**
+ * Compresses data to ZIP format.
+ *
+ * Compresses the source buffer into the destination buffer.
+ * source_len is the byte length of the source buffer. Upon entry,
+ * dest_len is the total size of the destination buffer, which must be
+ * at least the value returned by compressBound(source_len). Upon
+ * exit, dest_len is the actual size of the compressed buffer.
+ *
+ * @param[in,out] dest The destination (compressed) buffer (if NULL, a new buffer will be created).
+ * @param[in,out] dest_len Max length of the destination buffer (if 0, it will be calculated).
+ * @param[in] source The source (uncompressed) buffer.
+ * @param[in] source_len Source data length.
+ */
+ int (*encode_zip) (void *dest, unsigned long *dest_len, const void *source, unsigned long source_len);
+};
+
+/**
+ * Reads a file into a newly allocated buffer (from grf or data directory)
+ *
+ * @param fn The filename to read.
+ *
+ * @see grfio_interface::reads()
+ * @related grfio_interface
+ */
+#define grfio_read(fn) grfio->reads((fn), NULL)
+
#ifdef HERCULES_CORE
-void grfio_init(const char* fname);
-void grfio_final(void);
-void* grfio_reads(const char* fname, int* size);
-char* grfio_find_file(const char* fname);
-#define grfio_read(fn) grfio_reads((fn), NULL)
-
-unsigned long grfio_crc32(const unsigned char *buf, unsigned int len);
-int decode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen);
-int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen);
+void grfio_defaults(void);
#endif // HERCULES_CORE
+HPShared struct grfio_interface *grfio; ///< Pointer to the grfio interface.
#endif /* COMMON_GRFIO_H */
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index 5b0f6169b..e16eb4216 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,6 +25,7 @@
#include "common/cbasetypes.h"
#include "common/db.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
@@ -37,11 +38,14 @@ struct mapindex_interface *mapindex;
/// Retrieves the map name from 'string' (removing .gat extension if present).
/// Result gets placed either into 'buf' or in a static local buffer.
-const char* mapindex_getmapname(const char* string, char* output) {
+const char* mapindex_getmapname(const char* string, char* output)
+{
static char buf[MAP_NAME_LENGTH];
char* dest = (output != NULL) ? output : buf;
- size_t len = strnlen(string, MAP_NAME_LENGTH_EXT);
+ size_t len;
+ nullpo_retr(buf, string);
+ len = strnlen(string, MAP_NAME_LENGTH_EXT);
if (len == MAP_NAME_LENGTH_EXT) {
ShowWarning("(mapindex_normalize_name) Map name '%*s' is too long!\n", 2*MAP_NAME_LENGTH_EXT, string);
len--;
@@ -58,12 +62,15 @@ const char* mapindex_getmapname(const char* string, char* output) {
/// Retrieves the map name from 'string' (adding .gat extension if not already present).
/// Result gets placed either into 'buf' or in a static local buffer.
-const char* mapindex_getmapname_ext(const char* string, char* output) {
+const char* mapindex_getmapname_ext(const char* string, char* output)
+{
static char buf[MAP_NAME_LENGTH_EXT];
char* dest = (output != NULL) ? output : buf;
size_t len;
+ nullpo_retr(buf, string);
+
safestrncpy(buf,string, sizeof(buf));
sscanf(string, "%*[^#]%*[#]%15s", buf);
@@ -87,7 +94,8 @@ const char* mapindex_getmapname_ext(const char* string, char* output) {
/// Adds a map to the specified index
/// Returns 1 if successful, 0 otherwise
-int mapindex_addmap(int index, const char* name) {
+int mapindex_addmap(int index, const char* name)
+{
char map_name[MAP_NAME_LENGTH];
if (index == -1){
@@ -128,7 +136,8 @@ int mapindex_addmap(int index, const char* name) {
return index;
}
-unsigned short mapindex_name2id(const char* name) {
+unsigned short mapindex_name2id(const char* name)
+{
int i;
char map_name[MAP_NAME_LENGTH];
@@ -141,7 +150,8 @@ unsigned short mapindex_name2id(const char* name) {
return 0;
}
-const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func) {
+const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func)
+{
if (id >= MAX_MAPINDEX || !mapindex_exists(id)) {
ShowDebug("mapindex_id2name: Requested name for non-existant map index [%d] in cache. %s:%s:%d\n", id,file,func,line);
return mapindex->list[0].name; // dummy empty string so that the callee doesn't crash
@@ -149,7 +159,8 @@ const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const ch
return mapindex->list[id].name;
}
-int mapindex_init(void) {
+int mapindex_init(void)
+{
FILE *fp;
char line[1024];
int last_index = -1;
@@ -196,16 +207,20 @@ bool mapindex_check_default(void)
return true;
}
-void mapindex_removemap(int index){
+void mapindex_removemap(int index)
+{
+ Assert_retv(index < MAX_MAPINDEX);
strdb_remove(mapindex->db, mapindex->list[index].name);
mapindex->list[index].name[0] = '\0';
}
-void mapindex_final(void) {
+void mapindex_final(void)
+{
db_destroy(mapindex->db);
}
-void mapindex_defaults(void) {
+void mapindex_defaults(void)
+{
mapindex = &mapindex_s;
/* TODO: place it in inter-server.conf? */
diff --git a/src/common/mapindex.h b/src/common/mapindex.h
index 3fb170c1f..91f59aeaf 100644
--- a/src/common/mapindex.h
+++ b/src/common/mapindex.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,9 +22,11 @@
#define COMMON_MAPINDEX_H
#include "common/hercules.h"
-#include "common/db.h"
#include "common/mmo.h"
+/* Forward Declarations */
+struct DBMap; // common/db.h
+
#define MAX_MAPINDEX 2000
/* wohoo, someone look at all those |: map_default could (or *should*) be a char-server.conf */
@@ -82,7 +84,7 @@
struct mapindex_interface {
char config_file[80];
/* mapname (str) -> index (int) */
- DBMap *db;
+ struct DBMap *db;
/* number of entries in the index table */
int num;
/* default map name */
diff --git a/src/common/md5calc.c b/src/common/md5calc.c
index 44f912992..d2fc32371 100644
--- a/src/common/md5calc.c
+++ b/src/common/md5calc.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -20,27 +20,27 @@
*/
#define HERCULES_CORE
-/***********************************************************
- * md5 calculation algorithm
- *
- * The source code referred to the following URL.
- * http://www.geocities.co.jp/SiliconValley-Oakland/8878/lab17/lab17.html
- *
- ***********************************************************/
-
#include "md5calc.h"
#include "common/cbasetypes.h"
+#include "common/nullpo.h"
#include "common/random.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-// Global variable
+/** @file
+ * Implementation of the md5 interface.
+ */
+
+struct md5_interface md5_s;
+struct md5_interface *md5;
+
+/// Global variable
static unsigned int *pX;
-// String Table
+/// String Table
static const unsigned int T[] = {
0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, //0
0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, //4
@@ -60,99 +60,102 @@ static const unsigned int T[] = {
0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 //60
};
-// ROTATE_LEFT The left is made to rotate x [ n-bit ]. This is diverted as it is from RFC.
+/// The left is made to rotate x [ n-bit ]. This is diverted as it is from RFC.
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
// The function used for other calculation
-static unsigned int F(unsigned int X, unsigned int Y, unsigned int Z)
+static unsigned int md5_F(unsigned int X, unsigned int Y, unsigned int Z)
{
return (X & Y) | (~X & Z);
}
-static unsigned int G(unsigned int X, unsigned int Y, unsigned int Z)
+
+static unsigned int md5_G(unsigned int X, unsigned int Y, unsigned int Z)
{
return (X & Z) | (Y & ~Z);
}
-static unsigned int H(unsigned int X, unsigned int Y, unsigned int Z)
+
+static unsigned int md5_H(unsigned int X, unsigned int Y, unsigned int Z)
{
return X ^ Y ^ Z;
}
-static unsigned int I(unsigned int X, unsigned int Y, unsigned int Z)
+
+static unsigned int md5_I(unsigned int X, unsigned int Y, unsigned int Z)
{
return Y ^ (X | ~Z);
}
-static unsigned int Round(unsigned int a, unsigned int b, unsigned int FGHI,
+static unsigned int md5_Round(unsigned int a, unsigned int b, unsigned int FGHI,
unsigned int k, unsigned int s, unsigned int i)
{
return b + ROTATE_LEFT(a + FGHI + pX[k] + T[i], s);
}
-static void Round1(unsigned int *a, unsigned int b, unsigned int c,
+static void md5_Round1(unsigned int *a, unsigned int b, unsigned int c,
unsigned int d,unsigned int k, unsigned int s, unsigned int i)
{
- *a = Round(*a, b, F(b,c,d), k, s, i);
+ *a = md5_Round(*a, b, md5_F(b,c,d), k, s, i);
}
-static void Round2(unsigned int *a, unsigned int b, unsigned int c,
+static void md5_Round2(unsigned int *a, unsigned int b, unsigned int c,
unsigned int d,unsigned int k, unsigned int s, unsigned int i)
{
- *a = Round(*a, b, G(b,c,d), k, s, i);
+ *a = md5_Round(*a, b, md5_G(b,c,d), k, s, i);
}
-static void Round3(unsigned int *a, unsigned int b, unsigned int c,
+static void md5_Round3(unsigned int *a, unsigned int b, unsigned int c,
unsigned int d,unsigned int k, unsigned int s, unsigned int i)
{
- *a = Round(*a, b, H(b,c,d), k, s, i);
+ *a = md5_Round(*a, b, md5_H(b,c,d), k, s, i);
}
-static void Round4(unsigned int *a, unsigned int b, unsigned int c,
+static void md5_Round4(unsigned int *a, unsigned int b, unsigned int c,
unsigned int d,unsigned int k, unsigned int s, unsigned int i)
{
- *a = Round(*a, b, I(b,c,d), k, s, i);
+ *a = md5_Round(*a, b, md5_I(b,c,d), k, s, i);
}
-static void MD5_Round_Calculate(const unsigned char *block,
+static void md5_Round_Calculate(const unsigned char *block,
unsigned int *A2, unsigned int *B2, unsigned int *C2, unsigned int *D2)
{
//create X It is since it is required.
unsigned int X[16]; //512bit 64byte
- int j,k;
+ int j, k;
//Save A as AA, B as BB, C as CC, and and D as DD (saving of A, B, C, and D)
- unsigned int A=*A2, B=*B2, C=*C2, D=*D2;
- unsigned int AA = A,BB = B,CC = C,DD = D;
+ unsigned int A = *A2, B = *B2, C = *C2, D = *D2;
+ unsigned int AA = A, BB = B, CC = C, DD = D;
//It is a large region variable reluctantly because of calculation of a round. . . for Round1...4
pX = X;
//Copy block(padding_message) i into X
- for (j=0,k=0; j<64; j+=4,k++)
- X[k] = ( (unsigned int )block[j] ) // 8byte*4 -> 32byte conversion
- | ( ((unsigned int )block[j+1]) << 8 ) // A function called Decode as used in the field of RFC
- | ( ((unsigned int )block[j+2]) << 16 )
- | ( ((unsigned int )block[j+3]) << 24 );
-
+ for (j = 0, k = 0; j < 64; j += 4, k++) {
+ X[k] = ((unsigned int)block[j]) // 8byte*4 -> 32byte conversion
+ | (((unsigned int)block[j+1]) << 8) // A function called Decode as used in the field of RFC
+ | (((unsigned int)block[j+2]) << 16)
+ | (((unsigned int)block[j+3]) << 24);
+ }
//Round 1
- Round1(&A,B,C,D, 0, 7, 0); Round1(&D,A,B,C, 1, 12, 1); Round1(&C,D,A,B, 2, 17, 2); Round1(&B,C,D,A, 3, 22, 3);
- Round1(&A,B,C,D, 4, 7, 4); Round1(&D,A,B,C, 5, 12, 5); Round1(&C,D,A,B, 6, 17, 6); Round1(&B,C,D,A, 7, 22, 7);
- Round1(&A,B,C,D, 8, 7, 8); Round1(&D,A,B,C, 9, 12, 9); Round1(&C,D,A,B, 10, 17, 10); Round1(&B,C,D,A, 11, 22, 11);
- Round1(&A,B,C,D, 12, 7, 12); Round1(&D,A,B,C, 13, 12, 13); Round1(&C,D,A,B, 14, 17, 14); Round1(&B,C,D,A, 15, 22, 15);
+ md5_Round1(&A,B,C,D, 0, 7, 0); md5_Round1(&D,A,B,C, 1, 12, 1); md5_Round1(&C,D,A,B, 2, 17, 2); md5_Round1(&B,C,D,A, 3, 22, 3);
+ md5_Round1(&A,B,C,D, 4, 7, 4); md5_Round1(&D,A,B,C, 5, 12, 5); md5_Round1(&C,D,A,B, 6, 17, 6); md5_Round1(&B,C,D,A, 7, 22, 7);
+ md5_Round1(&A,B,C,D, 8, 7, 8); md5_Round1(&D,A,B,C, 9, 12, 9); md5_Round1(&C,D,A,B, 10, 17, 10); md5_Round1(&B,C,D,A, 11, 22, 11);
+ md5_Round1(&A,B,C,D, 12, 7, 12); md5_Round1(&D,A,B,C, 13, 12, 13); md5_Round1(&C,D,A,B, 14, 17, 14); md5_Round1(&B,C,D,A, 15, 22, 15);
//Round 2
- Round2(&A,B,C,D, 1, 5, 16); Round2(&D,A,B,C, 6, 9, 17); Round2(&C,D,A,B, 11, 14, 18); Round2(&B,C,D,A, 0, 20, 19);
- Round2(&A,B,C,D, 5, 5, 20); Round2(&D,A,B,C, 10, 9, 21); Round2(&C,D,A,B, 15, 14, 22); Round2(&B,C,D,A, 4, 20, 23);
- Round2(&A,B,C,D, 9, 5, 24); Round2(&D,A,B,C, 14, 9, 25); Round2(&C,D,A,B, 3, 14, 26); Round2(&B,C,D,A, 8, 20, 27);
- Round2(&A,B,C,D, 13, 5, 28); Round2(&D,A,B,C, 2, 9, 29); Round2(&C,D,A,B, 7, 14, 30); Round2(&B,C,D,A, 12, 20, 31);
+ md5_Round2(&A,B,C,D, 1, 5, 16); md5_Round2(&D,A,B,C, 6, 9, 17); md5_Round2(&C,D,A,B, 11, 14, 18); md5_Round2(&B,C,D,A, 0, 20, 19);
+ md5_Round2(&A,B,C,D, 5, 5, 20); md5_Round2(&D,A,B,C, 10, 9, 21); md5_Round2(&C,D,A,B, 15, 14, 22); md5_Round2(&B,C,D,A, 4, 20, 23);
+ md5_Round2(&A,B,C,D, 9, 5, 24); md5_Round2(&D,A,B,C, 14, 9, 25); md5_Round2(&C,D,A,B, 3, 14, 26); md5_Round2(&B,C,D,A, 8, 20, 27);
+ md5_Round2(&A,B,C,D, 13, 5, 28); md5_Round2(&D,A,B,C, 2, 9, 29); md5_Round2(&C,D,A,B, 7, 14, 30); md5_Round2(&B,C,D,A, 12, 20, 31);
//Round 3
- Round3(&A,B,C,D, 5, 4, 32); Round3(&D,A,B,C, 8, 11, 33); Round3(&C,D,A,B, 11, 16, 34); Round3(&B,C,D,A, 14, 23, 35);
- Round3(&A,B,C,D, 1, 4, 36); Round3(&D,A,B,C, 4, 11, 37); Round3(&C,D,A,B, 7, 16, 38); Round3(&B,C,D,A, 10, 23, 39);
- Round3(&A,B,C,D, 13, 4, 40); Round3(&D,A,B,C, 0, 11, 41); Round3(&C,D,A,B, 3, 16, 42); Round3(&B,C,D,A, 6, 23, 43);
- Round3(&A,B,C,D, 9, 4, 44); Round3(&D,A,B,C, 12, 11, 45); Round3(&C,D,A,B, 15, 16, 46); Round3(&B,C,D,A, 2, 23, 47);
+ md5_Round3(&A,B,C,D, 5, 4, 32); md5_Round3(&D,A,B,C, 8, 11, 33); md5_Round3(&C,D,A,B, 11, 16, 34); md5_Round3(&B,C,D,A, 14, 23, 35);
+ md5_Round3(&A,B,C,D, 1, 4, 36); md5_Round3(&D,A,B,C, 4, 11, 37); md5_Round3(&C,D,A,B, 7, 16, 38); md5_Round3(&B,C,D,A, 10, 23, 39);
+ md5_Round3(&A,B,C,D, 13, 4, 40); md5_Round3(&D,A,B,C, 0, 11, 41); md5_Round3(&C,D,A,B, 3, 16, 42); md5_Round3(&B,C,D,A, 6, 23, 43);
+ md5_Round3(&A,B,C,D, 9, 4, 44); md5_Round3(&D,A,B,C, 12, 11, 45); md5_Round3(&C,D,A,B, 15, 16, 46); md5_Round3(&B,C,D,A, 2, 23, 47);
//Round 4
- Round4(&A,B,C,D, 0, 6, 48); Round4(&D,A,B,C, 7, 10, 49); Round4(&C,D,A,B, 14, 15, 50); Round4(&B,C,D,A, 5, 21, 51);
- Round4(&A,B,C,D, 12, 6, 52); Round4(&D,A,B,C, 3, 10, 53); Round4(&C,D,A,B, 10, 15, 54); Round4(&B,C,D,A, 1, 21, 55);
- Round4(&A,B,C,D, 8, 6, 56); Round4(&D,A,B,C, 15, 10, 57); Round4(&C,D,A,B, 6, 15, 58); Round4(&B,C,D,A, 13, 21, 59);
- Round4(&A,B,C,D, 4, 6, 60); Round4(&D,A,B,C, 11, 10, 61); Round4(&C,D,A,B, 2, 15, 62); Round4(&B,C,D,A, 9, 21, 63);
+ md5_Round4(&A,B,C,D, 0, 6, 48); md5_Round4(&D,A,B,C, 7, 10, 49); md5_Round4(&C,D,A,B, 14, 15, 50); md5_Round4(&B,C,D,A, 5, 21, 51);
+ md5_Round4(&A,B,C,D, 12, 6, 52); md5_Round4(&D,A,B,C, 3, 10, 53); md5_Round4(&C,D,A,B, 10, 15, 54); md5_Round4(&B,C,D,A, 1, 21, 55);
+ md5_Round4(&A,B,C,D, 8, 6, 56); md5_Round4(&D,A,B,C, 15, 10, 57); md5_Round4(&C,D,A,B, 6, 15, 58); md5_Round4(&B,C,D,A, 13, 21, 59);
+ md5_Round4(&A,B,C,D, 4, 6, 60); md5_Round4(&D,A,B,C, 11, 10, 61); md5_Round4(&C,D,A,B, 2, 15, 62); md5_Round4(&B,C,D,A, 9, 21, 63);
// Then perform the following additions. (let's add)
*A2 = A + AA;
@@ -164,16 +167,16 @@ static void MD5_Round_Calculate(const unsigned char *block,
memset(pX, 0, sizeof(X));
}
-static void MD5_String2binary(const char * string, unsigned char * output)
+/// @copydoc md5_interface::binary()
+static void md5_buf2binary(const uint8 *buf, const int buf_size, uint8 *output)
{
//var
/*8bit*/
unsigned char padding_message[64]; //Extended message 512bit 64byte
- unsigned char *pstring; //The position of string in the present scanning notes is held.
+ const uint8 *pbuf; // The position of string in the present scanning notes is held.
/*32bit*/
- unsigned int string_byte_len, //The byte chief of string is held.
- string_bit_len, //The bit length of string is held.
+ unsigned int buf_bit_len, //The bit length of string is held.
copy_len, //The number of bytes which is used by 1-3 and which remained
msg_digest[4]; //Message digest 128bit 4byte
unsigned int *A = &msg_digest[0], //The message digest in accordance with RFC (reference)
@@ -191,59 +194,53 @@ static void MD5_String2binary(const char * string, unsigned char * output)
//Step 1.Append Padding Bits (extension of a mark bit)
//1-1
- string_byte_len = (unsigned int)strlen(string); //The byte chief of a character sequence is acquired.
- pstring = (unsigned char *)string; //The position of the present character sequence is set.
+ pbuf = buf; // The position of the present character sequence is set.
//1-2 Repeat calculation until length becomes less than 64 bytes.
- for (i=string_byte_len; 64<=i; i-=64,pstring+=64)
- MD5_Round_Calculate(pstring, A,B,C,D);
+ for (i=buf_size; 64<=i; i-=64,pbuf+=64)
+ md5_Round_Calculate(pbuf, A,B,C,D);
//1-3
- copy_len = string_byte_len % 64; //The number of bytes which remained is computed.
- strncpy((char *)padding_message, (char *)pstring, copy_len); //A message is copied to an extended bit sequence.
+ copy_len = buf_size % 64; //The number of bytes which remained is computed.
+ strncpy((char *)padding_message, (const char *)pbuf, copy_len); // A message is copied to an extended bit sequence.
memset(padding_message+copy_len, 0, 64 - copy_len); //It buries by 0 until it becomes extended bit length.
padding_message[copy_len] |= 0x80; //The next of a message is 1.
//1-4
//If 56 bytes or more (less than 64 bytes) of remainder becomes, it will calculate by extending to 64 bytes.
if (56 <= copy_len) {
- MD5_Round_Calculate(padding_message, A,B,C,D);
+ md5_Round_Calculate(padding_message, A,B,C,D);
memset(padding_message, 0, 56); //56 bytes is newly fill uped with 0.
}
//Step 2.Append Length (the information on length is added)
- string_bit_len = string_byte_len * 8; //From the byte chief to bit length (32 bytes of low rank)
- memcpy(&padding_message[56], &string_bit_len, 4); //32 bytes of low rank is set.
+ buf_bit_len = buf_size * 8; //From the byte chief to bit length (32 bytes of low rank)
+ memcpy(&padding_message[56], &buf_bit_len, 4); //32 bytes of low rank is set.
//When bit length cannot be expressed in 32 bytes of low rank, it is a beam raising to a higher rank.
- if (UINT_MAX / 8 < string_byte_len) {
- unsigned int high = (string_byte_len - UINT_MAX / 8) * 8;
+ if (UINT_MAX / 8 < (unsigned int)buf_size) {
+ unsigned int high = (buf_size - UINT_MAX / 8) * 8;
memcpy(&padding_message[60], &high, 4);
- } else
+ } else {
memset(&padding_message[60], 0, 4); //In this case, it is good for a higher rank at 0.
+ }
//Step 4.Process Message in 16-Word Blocks (calculation of MD5)
- MD5_Round_Calculate(padding_message, A,B,C,D);
+ md5_Round_Calculate(padding_message, A,B,C,D);
//Step 5.Output (output)
memcpy(output,msg_digest,16);
}
-//-------------------------------------------------------------------
-// The function for the exteriors
-
-/** output is the coded binary in the character sequence which wants to code string. */
-void MD5_Binary(const char * string, unsigned char * output)
+/// @copydoc md5_interface::string()
+void md5_string(const char *string, char *output)
{
- MD5_String2binary(string,output);
-}
+ uint8 digest[16];
-/** output is the coded character sequence in the character sequence which wants to code string. */
-void MD5_String(const char *string, char *output)
-{
- unsigned char digest[16];
+ nullpo_retv(string);
+ nullpo_retv(output);
- MD5_String2binary(string,digest);
+ md5->binary((const uint8 *)string, (int)strlen(string), digest);
snprintf(output, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
digest[ 0], digest[ 1], digest[ 2], digest[ 3],
digest[ 4], digest[ 5], digest[ 6], digest[ 7],
@@ -251,11 +248,24 @@ void MD5_String(const char *string, char *output)
digest[12], digest[13], digest[14], digest[15]);
}
-/** output is a sequence of non-zero characters to be used as password salt. */
-void MD5_Salt(unsigned int len, char * output)
+/// @copydoc md5_interface::salt();
+void md5_salt(int len, char *output)
{
- unsigned int i;
- for( i = 0; i < len; ++i )
+ int i;
+ Assert_retv(len > 0);
+
+ for (i = 0; i < len; ++i)
output[i] = (char)(1 + rnd() % 255);
}
+
+/**
+ * Interface base initialization.
+ */
+void md5_defaults(void)
+{
+ md5 = &md5_s;
+ md5->binary = md5_buf2binary;
+ md5->string = md5_string;
+ md5->salt = md5_salt;
+}
diff --git a/src/common/md5calc.h b/src/common/md5calc.h
index 0294c3ca1..f55ebe312 100644
--- a/src/common/md5calc.h
+++ b/src/common/md5calc.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,10 +21,46 @@
#ifndef COMMON_MD5CALC_H
#define COMMON_MD5CALC_H
+#include "common/hercules.h"
+
+/** @file
+ * md5 calculation algorithm.
+ *
+ * The source code referred to the following URL.
+ * http://www.geocities.co.jp/SiliconValley-Oakland/8878/lab17/lab17.html
+ */
+
+/// The md5 interface
+struct md5_interface {
+ /**
+ * Hashes a string, returning the hash in string format.
+ *
+ * @param[in] string The source string (NUL terminated).
+ * @param[out] output Output buffer (at least 33 bytes available).
+ */
+ void (*string) (const char *string, char *output);
+
+ /**
+ * Hashes a string, returning the buffer in binary format.
+ *
+ * @param[in] string The source string.
+ * @param[out] output Output buffer (at least 16 bytes available).
+ */
+ void (*binary) (const uint8 *buf, const int buf_size, uint8 *output);
+
+ /**
+ * Generates a random salt.
+ *
+ * @param[in] len The desired salt length.
+ * @param[out] output The output buffer (at least len bytes available).
+ */
+ void (*salt) (int len, char *output);
+};
+
#ifdef HERCULES_CORE
-void MD5_String(const char * string, char * output);
-void MD5_Binary(const char * string, unsigned char * output);
-void MD5_Salt(unsigned int len, char * output);
+void md5_defaults(void);
#endif // HERCULES_CORE
+HPShared struct md5_interface *md5; ///< Pointer to the md5 interface.
+
#endif /* COMMON_MD5CALC_H */
diff --git a/src/common/memmgr.c b/src/common/memmgr.c
index 93c23ff18..b80b4d4e9 100644
--- a/src/common/memmgr.c
+++ b/src/common/memmgr.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -97,10 +97,10 @@ struct malloc_interface *iMalloc;
#ifndef USE_MEMMGR
-#ifdef __APPLE__
+#if defined __APPLE__
#include <malloc/malloc.h>
#define BUFFER_SIZE(ptr) malloc_size(ptr)
-#elif __FreeBSD__
+#elif defined __FreeBSD__
#include <malloc_np.h>
#define BUFFER_SIZE(ptr) malloc_usable_size(ptr)
#elif defined __linux__ || defined __linux || defined CYGWIN
@@ -149,25 +149,25 @@ void* aRealloc_(void *p, size_t size, const char *file, int line, const char *fu
void* aReallocz_(void *p, size_t size, const char *file, int line, const char *func)
{
- void *ret;
+ unsigned char *ret = NULL;
// ShowMessage("%s:%d: in func %s: aReallocz %p %ld\n",file,line,func,p,size);
#ifdef USE_MEMMGR
ret = REALLOC(p, size, file, line, func);
#else
- size_t newSize;
- if (p) {
+ if (p != NULL) {
+ size_t newSize;
size_t oldSize = BUFFER_SIZE(p);
ret = REALLOC(p, size, file, line, func);
newSize = BUFFER_SIZE(ret);
- if (ret && newSize > oldSize)
+ if (ret != NULL && newSize > oldSize)
memset(ret + oldSize, 0, newSize - oldSize);
} else {
ret = REALLOC(p, size, file, line, func);
- if (ret)
+ if (ret != NULL)
memset(ret, 0, BUFFER_SIZE(ret));
}
#endif
- if (ret == NULL){
+ if (ret == NULL) {
ShowFatalError("%s:%d: in func %s: aRealloc error out of memory!\n",file,line,func);
exit(EXIT_FAILURE);
}
@@ -184,6 +184,36 @@ char* aStrdup_(const char *p, const char *file, int line, const char *func)
}
return ret;
}
+
+/**
+ * Copies a string to a newly allocated buffer, setting a maximum length.
+ *
+ * The string is always NULL-terminated. If the string is longer than `size`,
+ * then `size` bytes are copied, not including the appended NULL terminator.
+ *
+ * @warning
+ * If malloc is out of memory, throws a fatal error and aborts the program.
+ *
+ * @param p the source string to copy.
+ * @param size The maximum string length to copy.
+ * @param file @see ALC_MARK.
+ * @param line @see ALC_MARK.
+ * @param func @see ALC_MARK.
+ * @return the copied string.
+ */
+char *aStrndup_(const char *p, size_t size, const char *file, int line, const char *func)
+{
+ size_t len = strnlen(p, size);
+ char *ret = MALLOC(len + 1, file, line, func);
+ if (ret == NULL) {
+ ShowFatalError("%s:%d: in func %s: aStrndup error out of memory!\n", file, line, func);
+ exit(EXIT_FAILURE);
+ }
+ memcpy(ret, p, len);
+ ret[len] = '\0';
+ return ret;
+}
+
void aFree_(void *p, const char *file, int line, const char *func)
{
// ShowMessage("%s:%d: in func %s: aFree %p\n",file,line,func,p);
@@ -305,7 +335,7 @@ void *mmalloc_(size_t size, const char *file, int line, const char *func) {
struct unit_head *head;
if (((long) size) < 0) {
- ShowError("mmalloc_: %"PRIdS"\n", size);
+ ShowError("mmalloc_: %"PRIuS"\n", size);
return NULL;
}
@@ -478,6 +508,37 @@ char *mstrdup_(const char *p, const char *file, int line, const char *func) {
}
}
+/**
+ * Copies a string to a newly allocated buffer, setting a maximum length.
+ *
+ * The string is always NULL-terminated. If the string is longer than `size`,
+ * then `size` bytes are copied, not including the appended NULL terminator.
+ *
+ * @warning
+ * If malloc is out of memory, throws a fatal error and aborts the program.
+ *
+ * @param p the source string to copy.
+ * @param size The maximum string length to copy.
+ * @param file @see ALC_MARK.
+ * @param line @see ALC_MARK.
+ * @param func @see ALC_MARK.
+ * @return the copied string.
+ * @retval NULL if the source string is NULL or in case of error.
+ */
+char *mstrndup_(const char *p, size_t size, const char *file, int line, const char *func)
+{
+ if (p == NULL) {
+ return NULL;
+ } else {
+ size_t len = strnlen(p, size);
+ char *string = iMalloc->malloc(len + 1, file, line, func);
+ memcpy(string, p, len);
+ string[len] = '\0';
+ return string;
+ }
+}
+
+
void mfree_(void *ptr, const char *file, int line, const char *func) {
struct unit_head *head;
@@ -820,7 +881,7 @@ void memmgr_report (int extra) {
}
for( j = 0; j < 100; j++ ) {
if( data[j].size != 0 ) {
- ShowMessage("[malloc] : "CL_WHITE"%s"CL_RESET":"CL_WHITE"%d"CL_RESET" %d instances => %.2f MB\n",data[j].file,data[j].line,data[j].count,(double)((data[j].size)/1024)/1024);
+ ShowMessage("[malloc] : "CL_WHITE"%s"CL_RESET":"CL_WHITE"%d"CL_RESET" %u instances => %.2f MB\n",data[j].file,data[j].line,data[j].count,(double)((data[j].size)/1024)/1024);
}
}
ShowMessage("[malloc] : reporting %u instances | %.2f MB\n",count,(double)((size)/1024)/1024);
@@ -947,6 +1008,7 @@ void malloc_defaults(void) {
iMalloc->realloc = mrealloc_;
iMalloc->reallocz = mreallocz_;
iMalloc->astrdup = mstrdup_;
+ iMalloc->astrndup = mstrndup_;
iMalloc->free = mfree_;
#else
iMalloc->malloc = aMalloc_;
@@ -954,6 +1016,7 @@ void malloc_defaults(void) {
iMalloc->realloc = aRealloc_;
iMalloc->reallocz = aReallocz_;/* not using memory manager huhum o.o perhaps we could still do something about */
iMalloc->astrdup = aStrdup_;
+ iMalloc->astrndup = aStrndup_;
iMalloc->free = aFree_;
#endif
iMalloc->post_shutdown = NULL;
diff --git a/src/common/memmgr.h b/src/common/memmgr.h
index 5975f55c4..6381c5bfa 100644
--- a/src/common/memmgr.h
+++ b/src/common/memmgr.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -52,6 +52,7 @@
# define aRealloc(p,n) (iMalloc->realloc((p),(n),ALC_MARK))
# define aReallocz(p,n) (iMalloc->reallocz((p),(n),ALC_MARK))
# define aStrdup(p) (iMalloc->astrdup((p),ALC_MARK))
+# define aStrndup(p,n) (iMalloc->astrndup((p),(n),ALC_MARK))
# define aFree(p) (iMalloc->free((p),ALC_MARK))
/////////////// Buffer Creation /////////////////
@@ -85,6 +86,7 @@ struct malloc_interface {
void* (*realloc)(void *p, size_t size, const char *file, int line, const char *func);
void* (*reallocz)(void *p, size_t size, const char *file, int line, const char *func);
char* (*astrdup)(const char *p, const char *file, int line, const char *func);
+ char *(*astrndup)(const char *p, size_t size, const char *file, int line, const char *func);
void (*free)(void *p, const char *file, int line, const char *func);
/* */
void (*memory_check)(void);
@@ -99,8 +101,10 @@ struct malloc_interface {
void malloc_defaults(void);
void memmgr_report(int extra);
-#endif // HERCULES_CORE
HPShared struct malloc_interface *iMalloc;
+#else
+#define iMalloc HPMi->memmgr
+#endif // HERCULES_CORE
#endif /* COMMON_MEMMGR_H */
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 981c1b30b..276e0eb08 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,6 +23,7 @@
#include "config/core.h"
#include "common/cbasetypes.h"
+#include "common/db.h" // VECTORS
// server->client protocol version
// 0 - pre-?
@@ -114,40 +115,85 @@
#define MAX_INVENTORY 100
//Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well.
-#define MAX_CHARS 9
+#if PACKETVER >= 20100413
+#ifndef MAX_CHARS
+ #define MAX_CHARS 12
+#endif
+#else
+#ifndef MAX_CHARS
+ #define MAX_CHARS 9
+#endif
+#endif
//Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex]
//Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size.
#define MAX_SLOTS 4
//Max amount of a single stacked item
#define MAX_AMOUNT 30000
-#define MAX_ZENY 1000000000
+#define MAX_ZENY INT_MAX
//Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default )
#define MAX_BANK_ZENY INT_MAX
+#ifndef MAX_LEVEL
#define MAX_LEVEL 175
+#endif
#define MAX_FAME 1000000000
#define MAX_CART 100
-#define MAX_SKILL 1478
+#ifndef MAX_SKILL
+#define MAX_SKILL 1510
+#endif
+#ifndef MAX_SKILL_ID
#define MAX_SKILL_ID 10015 // [Ind/Hercules] max used skill ID
+#endif
+#ifndef MAX_SKILL_TREE
// Update this max as necessary. 86 is the value needed for Expanded Super Novice.
#define MAX_SKILL_TREE 86
+#endif
+#ifndef DEFAULT_WALK_SPEED
#define DEFAULT_WALK_SPEED 150
+#endif
+#ifndef MIN_WALK_SPEED
#define MIN_WALK_SPEED 20 /* below 20 clips animation */
+#endif
+#ifndef MAX_WALK_SPEED
#define MAX_WALK_SPEED 1000
+#endif
+#ifndef MAX_STORAGE
#define MAX_STORAGE 600
+#endif
+#ifndef MAX_GUILD_STORAGE
#define MAX_GUILD_STORAGE 600
+#endif
+#ifndef MAX_PARTY
#define MAX_PARTY 12
+#endif
+#ifndef BASE_GUILD_SIZE
#define BASE_GUILD_SIZE 16 // Base guild members (without GD_EXTENSION)
+#endif
+#ifndef MAX_GUILD
#define MAX_GUILD (BASE_GUILD_SIZE+10*6) // Increased max guild members +6 per 1 extension levels [Lupus]
+#endif
+#ifndef MAX_GUILDPOSITION
#define MAX_GUILDPOSITION 20 // Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
+#endif
+#ifndef MAX_GUILDEXPULSION
#define MAX_GUILDEXPULSION 32
+#endif
+#ifndef MAX_GUILDALLIANCE
#define MAX_GUILDALLIANCE 16
+#endif
+#ifndef MAX_GUILDSKILL
#define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan]
+#endif
+#ifndef MAX_GUILDLEVEL
#define MAX_GUILDLEVEL 50
+#endif
+#ifndef MAX_GUARDIANS
#define MAX_GUARDIANS 8 // Local max per castle. [Skotlex]
+#endif
+#ifndef MAX_QUEST_OBJECTIVES
#define MAX_QUEST_OBJECTIVES 3 // Max quest objectives for a quest
-#define MAX_START_ITEMS 32 // Max number of items allowed to be given to a char whenever it's created. [mkbu95]
+#endif
// for produce
#define MIN_ATTRIBUTE 0
@@ -170,7 +216,9 @@
#define MAP_NAME_LENGTH (11 + 1)
#define MAP_NAME_LENGTH_EXT (MAP_NAME_LENGTH + 4)
+#ifndef MAX_FRIENDS
#define MAX_FRIENDS 40
+#endif
#define MAX_MEMOPOINTS 3
// Size of the fame list arrays.
@@ -186,8 +234,12 @@
#define MAX_GUILDMES2 120
// Base Homun skill.
+#ifndef HM_SKILLBASE
#define HM_SKILLBASE 8001
+#endif
+#ifndef MAX_HOMUNSKILL
#define MAX_HOMUNSKILL 43
+#endif
// Mail System
#define MAIL_MAX_INBOX 30
@@ -195,31 +247,44 @@
#define MAIL_BODY_LENGTH 200
// Mercenary System
+#ifndef MC_SKILLBASE
#define MC_SKILLBASE 8201
+#endif
+#ifndef MAX_MERCSKILL
#define MAX_MERCSKILL 40
+#endif
// Elemental System
+#ifndef MAX_ELEMENTALSKILL
#define MAX_ELEMENTALSKILL 42
+#endif
+#ifndef EL_SKILLBASE
#define EL_SKILLBASE 8401
+#endif
+#ifndef MAX_ELESKILLTREE
#define MAX_ELESKILLTREE 3
+#endif
+
+// Maximum item options [Smokexyz]
+#ifndef MAX_ITEM_OPTIONS
+#define MAX_ITEM_OPTIONS 5
+#endif
+STATIC_ASSERT(MAX_ITEM_OPTIONS <= 5, "This value is limited by the client and database layout and should only be increased if you know the consequences.");
// The following system marks a different job ID system used by the map server,
// which makes a lot more sense than the normal one. [Skotlex]
// These marks the "level" of the job.
-#define JOBL_2_1 0x100 //256
-#define JOBL_2_2 0x200 //512
-#define JOBL_2 0x300
-#define JOBL_UPPER 0x1000 //4096
-#define JOBL_BABY 0x2000 //8192
-#define JOBL_THIRD 0x4000 //16384
-
-//Packet DB
-#define MIN_PACKET_DB 0x0064 //what's the point of minimum packet id ? [hemagx]
-#define MAX_PACKET_DB 0x0F00
-#define MAX_PACKET_POS 20
+#define JOBL_2_1 0x0100
+#define JOBL_2_2 0x0200
+#define JOBL_2 0x0300 // JOBL_2_1 | JOBL_2_2
+#define JOBL_UPPER 0x1000
+#define JOBL_BABY 0x2000
+#define JOBL_THIRD 0x4000
#define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable
+#define INFINITE_DURATION (-1) // Infinite duration for status changes
+
struct hplugin_data_store;
enum item_types {
@@ -236,7 +301,9 @@ enum item_types {
IT_AMMO, //10
IT_DELAYCONSUME,//11
IT_CASH = 18,
+#ifndef IT_MAX
IT_MAX
+#endif
};
#define INDEX_NOT_FOUND (-1) ///< Used as invalid/failure value in various functions that return an index
@@ -256,6 +323,11 @@ struct quest {
enum quest_state state; ///< Current quest state
};
+enum attribute_flag {
+ ATTR_NONE = 0,
+ ATTR_BROKEN = 1,
+};
+
struct item {
int id;
short nameid;
@@ -269,6 +341,12 @@ struct item {
char favorite;
unsigned char bound;
uint64 unique_id;
+
+ struct {
+ int16 index;
+ int16 value;
+ uint8 param;
+ } option[MAX_ITEM_OPTIONS];
};
//Equip position constants
@@ -300,7 +378,7 @@ enum equip_pos {
struct point {
unsigned short map;
- short x,y;
+ int16 x, y;
};
enum e_skill_flag
@@ -328,7 +406,9 @@ enum e_item_bound_type {
IBT_GUILD = 0x2,
IBT_PARTY = 0x3,
IBT_CHARACTER = 0x4,
+#ifndef IBT_MAX
IBT_MAX = 0x4,
+#endif
};
enum {
@@ -357,6 +437,7 @@ enum {
OPTION_DRAGON5 = 0x04000000,
OPTION_HANBOK = 0x08000000,
OPTION_OKTOBERFEST = 0x10000000,
+ OPTION_SUMMER2 = 0x20000000,
#ifndef NEW_CARTS
OPTION_CART1 = 0x00000008,
OPTION_CART2 = 0x00000080,
@@ -368,7 +449,7 @@ enum {
#endif
// compound constants
OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5,
- OPTION_COSTUME = OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK|OPTION_OKTOBERFEST,
+ OPTION_COSTUME = OPTION_WEDDING | OPTION_XMAS | OPTION_SUMMER | OPTION_HANBOK | OPTION_OKTOBERFEST | OPTION_SUMMER2,
};
struct s_skill {
@@ -392,16 +473,18 @@ struct script_reg_str {
char *value;
};
-// For saving status changes across sessions. [Skotlex]
+/// For saving status changes across sessions. [Skotlex]
struct status_change_data {
- unsigned short type; //SC_type
- int val1, val2, val3, val4;
- unsigned int tick; //Remaining duration.
+ unsigned short type; ///< Status change type (@see enum sc_type)
+ int val1, val2, val3, val4; ///< Parameters (meaning depends on type).
+ int tick; ///< Remaining duration.
};
struct storage_data {
- int storage_amount;
- struct item items[MAX_STORAGE];
+ bool save; ///< save flag.
+ bool received; ///< received flag.
+ int aggregate; ///< total item count.
+ VECTOR_DECL(struct item) item; ///< item vector.
};
struct guild_storage {
@@ -473,7 +556,7 @@ struct s_elemental {
int elemental_id;
int char_id;
short class_;
- int mode;
+ uint32 mode;
int hp, sp, max_hp, max_sp, matk, atk, atk2;
short hit, flee, amotion, def, mdef;
int life_time;
@@ -507,8 +590,8 @@ struct mmo_charstatus {
int zeny;
int bank_vault;
- short class_;
- unsigned int status_point,skill_point;
+ int16 class;
+ int status_point, skill_point;
int hp,max_hp,sp,max_sp;
unsigned int option;
short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute.
@@ -528,7 +611,7 @@ struct mmo_charstatus {
short robe;
char name[NAME_LENGTH];
- unsigned int base_level,job_level;
+ int base_level, job_level;
short str,agi,vit,int_,dex,luk;
unsigned char slot,sex;
@@ -537,7 +620,6 @@ struct mmo_charstatus {
struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
struct item inventory[MAX_INVENTORY],cart[MAX_CART];
- struct storage_data storage;
struct s_skill skill[MAX_SKILL];
struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
@@ -611,7 +693,7 @@ struct party_member {
int account_id;
int char_id;
char name[NAME_LENGTH];
- unsigned short class_;
+ int16 class;
unsigned short map;
unsigned short lv;
unsigned leader : 1,
@@ -630,7 +712,9 @@ struct party {
struct map_session_data;
struct guild_member {
int account_id, char_id;
- short hair,hair_color,gender,class_,lv;
+ short hair,hair_color,gender;
+ int16 class;
+ short lv;
uint64 exp;
int exp_payper;
short online,position;
@@ -718,6 +802,7 @@ struct fame_list {
};
enum fame_list_type {
+ RANKTYPE_UNKNOWN = -1,
RANKTYPE_BLACKSMITH = 0,
RANKTYPE_ALCHEMIST = 1,
RANKTYPE_TAEKWON = 2,
@@ -775,7 +860,9 @@ enum {
GD_RESTORE=10012,
GD_EMERGENCYCALL=10013,
GD_DEVELOPMENT=10014,
+#ifndef GD_MAX
GD_MAX,
+#endif
};
//These mark the ID of the jobs, as expected by the client. [Skotlex]
@@ -932,7 +1019,11 @@ enum {
JOB_OBORO,
JOB_REBELLION = 4215,
+ JOB_SUMMONER = 4218,
+
+#ifndef JOB_MAX
JOB_MAX,
+#endif
};
//Total number of classes (for data storage)
@@ -969,7 +1060,9 @@ enum weapon_type {
W_GRENADE, //21
W_HUUMA, //22
W_2HSTAFF, //23
- MAX_WEAPON_TYPE,
+#ifndef MAX_SINGLE_WEAPON_TYPE
+ MAX_SINGLE_WEAPON_TYPE,
+#endif
// dual-wield constants
W_DOUBLE_DD, ///< 2 daggers
W_DOUBLE_SS, ///< 2 swords
@@ -977,6 +1070,9 @@ enum weapon_type {
W_DOUBLE_DS, ///< dagger + sword
W_DOUBLE_DA, ///< dagger + axe
W_DOUBLE_SA, ///< sword + axe
+#ifndef MAX_WEAPON_TYPE
+ MAX_WEAPON_TYPE,
+#endif
};
enum ammo_type {
@@ -997,6 +1093,7 @@ enum e_char_server_type {
CST_OVER18 = 2,
CST_PAYING = 3,
CST_F2P = 4,
+ CST_MAX,
};
enum e_pc_reg_loading {
@@ -1045,4 +1142,8 @@ enum hz_char_ask_name_answer {
#error MAX_ZENY is too big
#endif
+#if MAX_SLOTS < 4
+#error MAX_SLOTS it too small
+#endif
+
#endif /* COMMON_MMO_H */
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 0f02b153f..464a54161 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) rAthena Project (www.rathena.org)
*
* Hercules is free software: you can redistribute it and/or modify
@@ -24,6 +24,7 @@
#include "common/cbasetypes.h" // for WIN32
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/timer.h"
@@ -34,7 +35,14 @@
#include <sys/time.h>
#endif
-struct ramutex{
+/** @file
+ * Implementation of the mutex interface.
+ */
+
+struct mutex_interface mutex_s;
+struct mutex_interface *mutex;
+
+struct mutex_data {
#ifdef WIN32
CRITICAL_SECTION hMutex;
#else
@@ -42,32 +50,26 @@ struct ramutex{
#endif
};
-struct racond{
+struct cond_data {
#ifdef WIN32
HANDLE events[2];
ra_align(8) volatile LONG nWaiters;
CRITICAL_SECTION waiters_lock;
-
#define EVENT_COND_SIGNAL 0
#define EVENT_COND_BROADCAST 1
-
#else
pthread_cond_t hCond;
#endif
};
-////////////////////
-// Mutex
-//
-// Implementation:
-//
+/* Mutex */
-ramutex *ramutex_create(void) {
- struct ramutex *m;
-
- m = (struct ramutex*)aMalloc( sizeof(struct ramutex) );
+/// @copydoc mutex_interface::create()
+struct mutex_data *mutex_create(void)
+{
+ struct mutex_data *m = aMalloc(sizeof(struct mutex_data));
if (m == NULL) {
- ShowFatalError("ramutex_create: OOM while allocating %"PRIuS" bytes.\n", sizeof(struct ramutex));
+ ShowFatalError("ramutex_create: OOM while allocating %"PRIuS" bytes.\n", sizeof(struct mutex_data));
return NULL;
}
@@ -78,10 +80,12 @@ ramutex *ramutex_create(void) {
#endif
return m;
-}//end: ramutex_create()
-
-void ramutex_destroy(ramutex *m) {
+}
+/// @copydoc mutex_interface::destroy()
+void mutex_destroy(struct mutex_data *m)
+{
+ nullpo_retv(m);
#ifdef WIN32
DeleteCriticalSection(&m->hMutex);
#else
@@ -89,53 +93,52 @@ void ramutex_destroy(ramutex *m) {
#endif
aFree(m);
+}
-}//end: ramutex_destroy()
-
-void ramutex_lock(ramutex *m) {
-
+/// @copydoc mutex_interface::lock()
+void mutex_lock(struct mutex_data *m)
+{
+ nullpo_retv(m);
#ifdef WIN32
EnterCriticalSection(&m->hMutex);
#else
pthread_mutex_lock(&m->hMutex);
#endif
-}//end: ramutex_lock
+}
-bool ramutex_trylock(ramutex *m) {
+/// @copydoc mutex_interface::trylock()
+bool mutex_trylock(struct mutex_data *m)
+{
+ nullpo_retr(false, m);
#ifdef WIN32
- if(TryEnterCriticalSection(&m->hMutex) != FALSE)
+ if (TryEnterCriticalSection(&m->hMutex) != FALSE)
return true;
-
- return false;
#else
- if(pthread_mutex_trylock(&m->hMutex) == 0)
+ if (pthread_mutex_trylock(&m->hMutex) == 0)
return true;
-
- return false;
#endif
-}//end: ramutex_trylock()
+ return false;
+}
-void ramutex_unlock(ramutex *m) {
+/// @copydoc mutex_interface::unlock()
+void mutex_unlock(struct mutex_data *m)
+{
+ nullpo_retv(m);
#ifdef WIN32
LeaveCriticalSection(&m->hMutex);
#else
pthread_mutex_unlock(&m->hMutex);
#endif
+}
-}//end: ramutex_unlock()
-
-///////////////
-// Condition Variables
-//
-// Implementation:
-//
+/* Conditional variable */
-racond *racond_create(void) {
- struct racond *c;
-
- c = (struct racond*)aMalloc( sizeof(struct racond) );
+/// @copydoc mutex_interface::cond_create()
+struct cond_data *cond_create(void)
+{
+ struct cond_data *c = aMalloc(sizeof(struct cond_data));
if (c == NULL) {
- ShowFatalError("racond_create: OOM while allocating %"PRIuS" bytes\n", sizeof(struct racond));
+ ShowFatalError("racond_create: OOM while allocating %"PRIuS" bytes\n", sizeof(struct cond_data));
return NULL;
}
@@ -149,31 +152,37 @@ racond *racond_create(void) {
#endif
return c;
-}//end: racond_create()
+}
-void racond_destroy(racond *c) {
+/// @copydoc mutex_interface::cond_destroy()
+void cond_destroy(struct cond_data *c)
+{
+ nullpo_retv(c);
#ifdef WIN32
- CloseHandle( c->events[ EVENT_COND_SIGNAL ] );
- CloseHandle( c->events[ EVENT_COND_BROADCAST ] );
- DeleteCriticalSection( &c->waiters_lock );
+ CloseHandle(c->events[EVENT_COND_SIGNAL]);
+ CloseHandle(c->events[EVENT_COND_BROADCAST]);
+ DeleteCriticalSection(&c->waiters_lock);
#else
pthread_cond_destroy(&c->hCond);
#endif
aFree(c);
-}//end: racond_destroy()
+}
-void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) {
+/// @copydoc mutex_interface::cond_wait()
+void cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks)
+{
#ifdef WIN32
register DWORD ms;
int result;
bool is_last = false;
+ nullpo_retv(c);
EnterCriticalSection(&c->waiters_lock);
c->nWaiters++;
LeaveCriticalSection(&c->waiters_lock);
- if(timeout_ticks < 0)
+ if (timeout_ticks < 0)
ms = INFINITE;
else
ms = (timeout_ticks > MAXDWORD) ? (MAXDWORD - 1) : (DWORD)timeout_ticks;
@@ -181,27 +190,28 @@ void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) {
// we can release the mutex (m) here, cause win's
// manual reset events maintain state when used with
// SetEvent()
- ramutex_unlock(m);
+ mutex->unlock(m);
result = WaitForMultipleObjects(2, c->events, FALSE, ms);
EnterCriticalSection(&c->waiters_lock);
c->nWaiters--;
- if( (result == WAIT_OBJECT_0 + EVENT_COND_BROADCAST) && (c->nWaiters == 0) )
+ if ((result == WAIT_OBJECT_0 + EVENT_COND_BROADCAST) && (c->nWaiters == 0))
is_last = true; // Broadcast called!
LeaveCriticalSection(&c->waiters_lock);
// we are the last waiter that has to be notified, or to stop waiting
// so we have to do a manual reset
- if(is_last == true)
+ if (is_last == true)
ResetEvent( c->events[EVENT_COND_BROADCAST] );
- ramutex_lock(m);
+ mutex->lock(m);
#else
- if(timeout_ticks < 0){
- pthread_cond_wait( &c->hCond, &m->hMutex );
- }else{
+ nullpo_retv(m);
+ if (timeout_ticks < 0) {
+ pthread_cond_wait(&c->hCond, &m->hMutex);
+ } else {
struct timespec wtime;
int64 exact_timeout = timer->gettick() + timeout_ticks;
@@ -210,14 +220,16 @@ void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) {
pthread_cond_timedwait( &c->hCond, &m->hMutex, &wtime);
}
-
#endif
-}//end: racond_wait()
+}
-void racond_signal(racond *c) {
+/// @copydoc mutex_interface::cond_signal()
+void cond_signal(struct cond_data *c)
+{
#ifdef WIN32
# if 0
bool has_waiters = false;
+ nullpo_retv(c);
EnterCriticalSection(&c->waiters_lock);
if(c->nWaiters > 0)
has_waiters = true;
@@ -225,16 +237,20 @@ void racond_signal(racond *c) {
if(has_waiters == true)
# endif // 0
- SetEvent( c->events[ EVENT_COND_SIGNAL ] );
+ SetEvent(c->events[EVENT_COND_SIGNAL]);
#else
+ nullpo_retv(c);
pthread_cond_signal(&c->hCond);
#endif
-}//end: racond_signal()
+}
-void racond_broadcast(racond *c) {
+/// @copydoc mutex_interface::cond_broadcast()
+void cond_broadcast(struct cond_data *c)
+{
#ifdef WIN32
# if 0
bool has_waiters = false;
+ nullpo_retv(c);
EnterCriticalSection(&c->waiters_lock);
if(c->nWaiters > 0)
has_waiters = true;
@@ -242,8 +258,28 @@ void racond_broadcast(racond *c) {
if(has_waiters == true)
# endif // 0
- SetEvent( c->events[ EVENT_COND_BROADCAST ] );
+ SetEvent(c->events[EVENT_COND_BROADCAST]);
#else
+ nullpo_retv(c);
pthread_cond_broadcast(&c->hCond);
#endif
-}//end: racond_broadcast()
+}
+
+/**
+ * Interface base initialization.
+ */
+void mutex_defaults(void)
+{
+ mutex = &mutex_s;
+ mutex->create = mutex_create;
+ mutex->destroy = mutex_destroy;
+ mutex->lock = mutex_lock;
+ mutex->trylock = mutex_trylock;
+ mutex->unlock = mutex_unlock;
+
+ mutex->cond_create = cond_create;
+ mutex->cond_destroy = cond_destroy;
+ mutex->cond_wait = cond_wait;
+ mutex->cond_signal = cond_signal;
+ mutex->cond_broadcast = cond_broadcast;
+}
diff --git a/src/common/mutex.h b/src/common/mutex.h
index e49791493..0569fb0da 100644
--- a/src/common/mutex.h
+++ b/src/common/mutex.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) rAthena Project (www.rathena.org)
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,91 +21,111 @@
#ifndef COMMON_MUTEX_H
#define COMMON_MUTEX_H
-#include "common/cbasetypes.h"
+#include "common/hercules.h"
-typedef struct ramutex ramutex; // Mutex
-typedef struct racond racond; // Condition Var
-
-#ifdef HERCULES_CORE
-/**
- * Creates a Mutex
- *
- * @return not NULL
+/** @file
+ * Mutex and conditional variables implementation for Hercules.
*/
-ramutex *ramutex_create(void);
-/**
- * Destroys a Mutex
- *
- * @param m - the mutex to destroy
- */
-void ramutex_destroy(ramutex *m);
+/* Opaque types */
-/**
- * Gets a lock
- *
- * @param m - the mutex to lock
- */
-void ramutex_lock(ramutex *m);
+struct mutex_data; ///< Mutex
+struct cond_data; ///< Conditional variable
-/**
- * Trys to get the Lock
- *
- * @param m - the mutex try to lock
- *
- * @return boolean (true = got the lock)
- */
-bool ramutex_trylock(ramutex *m);
+/* Interface */
-/**
- * Unlocks a mutex
- *
- * @param m - the mutex to unlock
- */
-void ramutex_unlock(ramutex *m);
+/// The mutex interface.
+struct mutex_interface {
+ /**
+ * Creates a mutex.
+ *
+ * @return The created mutex.
+ */
+ struct mutex_data *(*create) (void);
+ /**
+ * Destroys a mutex.
+ *
+ * @param m the mutex to destroy.
+ */
+ void (*destroy) (struct mutex_data *m);
-/**
- * Creates a Condition variable
- *
- * @return not NULL
- */
-racond *racond_create(void);
+ /**
+ * Gets a lock.
+ *
+ * This function blocks until the lock can be acquired.
+ *
+ * @param m The mutex to lock.
+ */
+ void (*lock) (struct mutex_data *m);
-/**
- * Destroy a Condition variable
- *
- * @param c - the condition variable to destroy
- */
-void racond_destroy(racond *c);
+ /**
+ * Tries to get a lock.
+ *
+ * This function returns immediately.
+ *
+ * @param m The mutex to try to lock.
+ * @return success status.
+ * @retval true if the lock was acquired.
+ * @retval false if the mutex couldn't be locked.
+ */
+ bool (*trylock) (struct mutex_data *m);
-/**
- * Waits Until state is signaled
- *
- * @param c - the condition var to wait for signaled state
- * @param m - the mutex used for synchronization
- * @param timeout_ticks - timeout in ticks ( -1 = INFINITE )
- */
-void racond_wait(racond *c, ramutex *m, sysint timeout_ticks);
+ /**
+ * Unlocks a mutex.
+ *
+ * @param m The mutex to unlock.
+ */
+ void (*unlock) (struct mutex_data *m);
-/**
- * Sets the given condition var to signaled state
- *
- * @param c - condition var to set in signaled state.
- *
- * @note:
- * Only one waiter gets notified.
- */
-void racond_signal(racond *c);
+ /**
+ * Creates a conditional variable.
+ *
+ * @return the created conditional variable.
+ */
+ struct cond_data *(*cond_create) (void);
-/**
- * Sets notifies all waiting threads thats signaled.
- * @param c - condition var to set in signaled state
- *
- * @note:
- * All Waiters getting notified.
- */
-void racond_broadcast(racond *c);
+ /**
+ * Destroys a conditional variable.
+ *
+ * @param c the conditional variable to destroy.
+ */
+ void (*cond_destroy) (struct cond_data *c);
+
+ /**
+ * Waits Until state is signaled.
+ *
+ * @param c The condition var to wait for signaled state.
+ * @param m The mutex used for synchronization.
+ * @param timeout_ticks Timeout in ticks (-1 = INFINITE)
+ */
+ void (*cond_wait) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks);
+
+ /**
+ * Sets the given condition var to signaled state.
+ *
+ * @remark
+ * Only one waiter gets notified.
+ *
+ * @param c Condition var to set in signaled state.
+ */
+ void (*cond_signal) (struct cond_data *c);
+
+ /**
+ * Sets notifies all waiting threads thats signaled.
+ *
+ * @remark
+ * All Waiters getting notified.
+ *
+ * @param c Condition var to set in signaled state.
+ */
+ void (*cond_broadcast) (struct cond_data *c);
+};
+
+#ifdef HERCULES_CORE
+void mutex_defaults(void);
#endif // HERCULES_CORE
+HPShared struct mutex_interface *mutex; ///< Pointer to the mutex interface.
+
#endif /* COMMON_MUTEX_H */
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index 5b1be14ea..6525793bf 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/common/nullpo.h b/src/common/nullpo.h
index 098e669f3..28d058dc0 100644
--- a/src/common/nullpo.h
+++ b/src/common/nullpo.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/common/random.c b/src/common/random.c
index ba70a5c1d..b3a13e054 100644
--- a/src/common/random.c
+++ b/src/common/random.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -27,6 +27,7 @@
#include "common/timer.h" // gettick
#include <mt19937ar/mt19937ar.h> // init_genrand, genrand_int32, genrand_res53
+#include <stdlib.h>
#if defined(WIN32)
# include "common/winapi.h"
@@ -35,8 +36,14 @@
# include <unistd.h>
#endif
+/** @file
+ * Implementation of the random number generator interface.
+ */
+
+struct rnd_interface rnd_s;
+struct rnd_interface *rnd;
-/// Initializes the random number generator with an appropriate seed.
+/// @copydoc rnd_interface::init()
void rnd_init(void)
{
unsigned long seed = (unsigned long)timer->gettick();
@@ -53,53 +60,64 @@ void rnd_init(void)
#endif // HAVE_GETTID
#endif
init_genrand(seed);
+
+ // Also initialize the stdlib rng, just in case it's used somewhere.
+ srand((unsigned int)seed);
}
+/// @copydoc rnd_interface::final()
+void rnd_final(void)
+{
+}
-/// Initializes the random number generator.
+/// @copydoc rnd_interface::seed()
void rnd_seed(uint32 seed)
{
init_genrand(seed);
}
-
-/// Generates a random number in the interval [0, SINT32_MAX]
-int32 rnd(void)
+/// @copydoc rnd_interface::random()
+int32 rnd_random(void)
{
return (int32)genrand_int31();
}
-
-/// Generates a random number in the interval [0, dice_faces)
-/// NOTE: interval is open ended, so dice_faces is excluded (unless it's 0)
+/// @copydoc rnd_interface::roll()
uint32 rnd_roll(uint32 dice_faces)
{
- return (uint32)(rnd_uniform()*dice_faces);
+ return (uint32)(rnd->uniform()*dice_faces);
}
-
-/// Generates a random number in the interval [min, max]
-/// Returns min if range is invalid.
+/// @copydoc rnd_interface::value()
int32 rnd_value(int32 min, int32 max)
{
- if( min >= max )
+ if (min >= max)
return min;
- return min + (int32)(rnd_uniform()*(max-min+1));
+ return min + (int32)(rnd->uniform()*(max-min+1));
}
-
-/// Generates a random number in the interval [0.0, 1.0)
-/// NOTE: interval is open ended, so 1.0 is excluded
+/// @copydoc rnd_interface::uniform()
double rnd_uniform(void)
{
return ((uint32)genrand_int32())*(1.0/4294967296.0);// divided by 2^32
}
-
-/// Generates a random number in the interval [0.0, 1.0) with 53-bit resolution
-/// NOTE: interval is open ended, so 1.0 is excluded
-/// NOTE: 53 bits is the maximum precision of a double
+/// @copydoc rnd_interface::uniform53()
double rnd_uniform53(void)
{
return genrand_res53();
}
+
+/// Interface base initialization.
+void rnd_defaults(void)
+{
+ rnd = &rnd_s;
+ rnd->init = rnd_init;
+ rnd->final = rnd_final;
+ rnd->seed = rnd_seed;
+ rnd->random = rnd_random;
+ rnd->roll = rnd_roll;
+ rnd->value = rnd_value;
+ rnd->uniform = rnd_uniform;
+ rnd->uniform53 = rnd_uniform53;
+}
diff --git a/src/common/random.h b/src/common/random.h
index 0b5abbcdc..1b249ef19 100644
--- a/src/common/random.h
+++ b/src/common/random.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,17 +21,81 @@
#ifndef COMMON_RANDOM_H
#define COMMON_RANDOM_H
-#include "common/cbasetypes.h"
+#include "common/hercules.h"
+
+/** @file
+ * The random number generator interface.
+ */
+
+/// Random interface.
+struct rnd_interface {
+ /**
+ * Interface initialization.
+ *
+ * During initialization, the RNG is seeded with a random seed.
+ */
+ void (*init) (void);
+
+ /// Interface finalization.
+ void (*final) (void);
+
+ /**
+ * Re-seeds the random number generator.
+ *
+ * @param seed The new seed.
+ */
+ void (*seed) (uint32 seed);
+
+ /**
+ * Generates a random number in the interval [0, SINT32_MAX].
+ */
+ int32 (*random) (void);
+
+ /**
+ * Generates a random number in the interval [0, dice_faces).
+ *
+ * @remark
+ * interval is open ended, so dice_faces is excluded (unless it's 0)
+ */
+ uint32 (*roll) (uint32 dice_faces);
+
+ /**
+ * Generates a random number in the interval [min, max].
+ *
+ * @retval min if range is invalid.
+ */
+ int32 (*value) (int32 min, int32 max);
+
+ /**
+ * Generates a random number in the interval [0.0, 1.0)
+ *
+ * @remark
+ * interval is open ended, so 1.0 is excluded
+ */
+ double (*uniform) (void);
+
+ /**
+ * Generates a random number in the interval [0.0, 1.0) with 53-bit resolution.
+ *
+ * 53 bits is the maximum precision of a double.
+ *
+ * @remark
+ * interval is open ended, so 1.0 is excluded
+ */
+ double (*uniform53) (void);
+};
+
+/**
+ * Utlity macro to call the frequently used rnd_interface#random().
+ *
+ * @related rnd_interface.
+ */
+#define rnd() rnd->random()
#ifdef HERCULES_CORE
-void rnd_init(void);
-void rnd_seed(uint32);
-
-int32 rnd(void);// [0, SINT32_MAX]
-uint32 rnd_roll(uint32 dice_faces);// [0, dice_faces)
-int32 rnd_value(int32 min, int32 max);// [min, max]
-double rnd_uniform(void);// [0.0, 1.0)
-double rnd_uniform53(void);// [0.0, 1.0)
+void rnd_defaults(void);
#endif // HERCULES_CORE
+HPShared struct rnd_interface *rnd; ///< Pointer to the random interface.
+
#endif /* COMMON_RANDOM_H */
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 956222a7d..23679e762 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,11 +23,10 @@
#include "showmsg.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/core.h" //[Ind] - For SERVER_TYPE
#include "common/strlib.h" // StringBuf
-#include <libconfig/libconfig.h>
-
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h> // atexit
@@ -245,13 +244,13 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
continue;
} else if (*q == ';') {
// delimiter
- if (numpoint < sizeof(numbers)/sizeof(*numbers)) {
+ if (numpoint < ARRAYLENGTH(numbers)) {
// go to next array position
numpoint++;
} else {
// array is full, so we 'forget' the first value
- memmove(numbers,numbers+1,sizeof(numbers)/sizeof(*numbers)-1);
- numbers[sizeof(numbers)/sizeof(*numbers)-1]=0;
+ memmove(numbers, numbers+1, ARRAYLENGTH(numbers)-1);
+ numbers[ARRAYLENGTH(numbers)-1]=0;
}
++q;
// and next number
@@ -606,9 +605,6 @@ int vShowMessage_(enum msg_type flag, const char *string, va_list ap)
{
va_list apcopy;
char prefix[100];
-#if defined(DEBUGLOGMAP) || defined(DEBUGLOGCHAR) || defined(DEBUGLOGLOGIN)
- FILE *fp;
-#endif
if (!string || *string == '\0') {
ShowError("Empty string passed to vShowMessage_().\n");
@@ -703,8 +699,8 @@ int vShowMessage_(enum msg_type flag, const char *string, va_list ap)
}
#if defined(DEBUGLOGMAP) || defined(DEBUGLOGCHAR) || defined(DEBUGLOGLOGIN)
- if(strlen(DEBUGLOGPATH) > 0) {
- fp=fopen(DEBUGLOGPATH,"a");
+ if (strlen(DEBUGLOGPATH) > 0) {
+ FILE *fp = fopen(DEBUGLOGPATH,"a");
if (fp == NULL) {
FPRINTF(STDERR, CL_RED"[ERROR]"CL_RESET": Could not open '"CL_WHITE"%s"CL_RESET"', access denied.\n", DEBUGLOGPATH);
FFLUSH(STDERR);
@@ -799,16 +795,20 @@ void showmsg_showWarning(const char *string, ...)
vShowMessage_(MSG_WARNING, string, ap);
va_end(ap);
}
-void showmsg_showConfigWarning(config_setting_t *config, const char *string, ...) __attribute__((format(printf, 2, 3)));
-void showmsg_showConfigWarning(config_setting_t *config, const char *string, ...)
+void showmsg_showConfigWarning(struct config_setting_t *config, const char *string, ...) __attribute__((format(printf, 2, 3)));
+void showmsg_showConfigWarning(struct config_setting_t *config, const char *string, ...)
{
StringBuf buf;
va_list ap;
StrBuf->Init(&buf);
StrBuf->AppendStr(&buf, string);
- StrBuf->Printf(&buf, " (%s:%d)\n", config_setting_source_file(config), config_setting_source_line(config));
+ StrBuf->Printf(&buf, " (%s:%u)\n", config_setting_source_file(config), config_setting_source_line(config));
va_start(ap, string);
+#ifdef BUILDBOT
+ vShowMessage_(MSG_ERROR, StrBuf->Value(&buf), ap);
+#else // BUILDBOT
vShowMessage_(MSG_WARNING, StrBuf->Value(&buf), ap);
+#endif // BUILDBOT
va_end(ap);
StrBuf->Destroy(&buf);
}
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index ed8776fb0..eee6b467b 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,10 +23,11 @@
#include "common/hercules.h"
-#include <libconfig/libconfig.h>
-
#include <stdarg.h>
+/* Forward Declarations */
+struct config_setting_t;
+
// for help with the console colors look here:
// http://www.edoceo.com/liberum/?doc=printf-with-color
// some code explanation (used here):
@@ -118,7 +119,7 @@ struct showmsg_interface {
void (*showDebug) (const char *, ...) __attribute__((format(printf, 1, 2)));
void (*showError) (const char *, ...) __attribute__((format(printf, 1, 2)));
void (*showFatalError) (const char *, ...) __attribute__((format(printf, 1, 2)));
- void (*showConfigWarning) (config_setting_t *config, const char *string, ...) __attribute__((format(printf, 2, 3)));
+ void (*showConfigWarning) (struct config_setting_t *config, const char *string, ...) __attribute__((format(printf, 2, 3)));
};
/* the purpose of these macros is simply to not make calling them be an annoyance */
@@ -129,7 +130,11 @@ struct showmsg_interface {
#define ShowSQL(fmt, ...) (showmsg->showSQL((fmt), ##__VA_ARGS__))
#define ShowInfo(fmt, ...) (showmsg->showInfo((fmt), ##__VA_ARGS__))
#define ShowNotice(fmt, ...) (showmsg->showNotice((fmt), ##__VA_ARGS__))
+#ifdef BUILDBOT
+#define ShowWarning(fmt, ...) (showmsg->showError((fmt), ##__VA_ARGS__))
+#else // BUILDBOT
#define ShowWarning(fmt, ...) (showmsg->showWarning((fmt), ##__VA_ARGS__))
+#endif // BUILDBOT
#define ShowDebug(fmt, ...) (showmsg->showDebug((fmt), ##__VA_ARGS__))
#define ShowError(fmt, ...) (showmsg->showError((fmt), ##__VA_ARGS__))
#define ShowFatalError(fmt, ...) (showmsg->showFatalError((fmt), ##__VA_ARGS__))
diff --git a/src/common/socket.c b/src/common/socket.c
index 740c07bdc..d4b8bb43f 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,6 +25,7 @@
#include "common/HPM.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/db.h"
#include "common/memmgr.h"
#include "common/mmo.h"
@@ -37,35 +38,39 @@
#include <stdlib.h>
#include <sys/types.h>
+#ifdef SOCKET_EPOLL
+#include <sys/epoll.h>
+#endif // SOCKET_EPOLL
+
#ifdef WIN32
# include "common/winapi.h"
-#else
+#else // WIN32
# include <arpa/inet.h>
# include <errno.h>
# include <net/if.h>
# include <netdb.h>
#if defined __linux__ || defined __linux
# include <linux/tcp.h>
-#else
+#else // defined __linux__ || defined __linux
# include <netinet/in.h>
# include <netinet/tcp.h>
-#endif
+#endif // defined __linux__ || defined __linux
# include <sys/ioctl.h>
# include <sys/socket.h>
# include <sys/time.h>
# include <unistd.h>
-# ifndef SIOCGIFCONF
-# include <sys/sockio.h> // SIOCGIFCONF on Solaris, maybe others? [Shinomori]
-# endif
-# ifndef FIONBIO
-# include <sys/filio.h> // FIONBIO on Solaris [FlavioJS]
-# endif
+#ifndef SIOCGIFCONF
+# include <sys/sockio.h> // SIOCGIFCONF on Solaris, maybe others? [Shinomori]
+#endif // SIOCGIFCONF
+#ifndef FIONBIO
+# include <sys/filio.h> // FIONBIO on Solaris [FlavioJS]
+#endif // FIONBIO
-# ifdef HAVE_SETRLIMIT
-# include <sys/resource.h>
-# endif
-#endif
+#ifdef HAVE_SETRLIMIT
+# include <sys/resource.h>
+#endif // HAVE_SETRLIMIT
+#endif // WIN32
/**
* Socket Interface Source
@@ -75,13 +80,15 @@ struct socket_interface *sockt;
struct socket_data **session;
+const char *SOCKET_CONF_FILENAME = "conf/common/socket.conf";
+
#ifdef SEND_SHORTLIST
// Add a fd to the shortlist so that it'll be recognized as a fd that needs
// sending done on it.
void send_shortlist_add_fd(int fd);
// Do pending network sends (and eof handling) from the shortlist.
void send_shortlist_do_sends(void);
-#endif
+#endif // SEND_SHORTLIST
/////////////////////////////////////////////////////////////////////
#if defined(WIN32)
@@ -211,7 +218,7 @@ char* sErr(int code)
#define sFD_ZERO FD_ZERO
/////////////////////////////////////////////////////////////////////
-#else
+#else // defined(WIN32)
/////////////////////////////////////////////////////////////////////
// nix portability layer
@@ -243,29 +250,40 @@ char* sErr(int code)
#define sFD_ZERO FD_ZERO
/////////////////////////////////////////////////////////////////////
-#endif
+#endif // defined(WIN32)
/////////////////////////////////////////////////////////////////////
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
-#endif
+#endif // MSG_NOSIGNAL
+#ifndef SOCKET_EPOLL
+// Select based Event Dispatcher:
fd_set readfds;
+#else // SOCKET_EPOLL
+// Epoll based Event Dispatcher:
+static int epoll_maxevents = (FD_SETSIZE / 2);
+static int epfd = SOCKET_ERROR;
+static struct epoll_event epevent;
+static struct epoll_event *epevents = NULL;
+
+#endif // SOCKET_EPOLL
+
// Maximum packet size in bytes, which the client is able to handle.
// Larger packets cause a buffer overflow and stack corruption.
#if PACKETVER >= 20131223
static size_t socket_max_client_packet = 0xFFFF;
-#else
+#else // PACKETVER >= 20131223
static size_t socket_max_client_packet = 0x6000;
-#endif
+#endif // PACKETVER >= 20131223
#ifdef SHOW_SERVER_STATS
// Data I/O statistics
static size_t socket_data_i = 0, socket_data_ci = 0, socket_data_qi = 0;
static size_t socket_data_o = 0, socket_data_co = 0, socket_data_qo = 0;
static time_t socket_data_last_tick = 0;
-#endif
+#endif // SHOW_SERVER_STATS
// initial recv buffer size (this will also be the max. size)
// biggest known packet: S 0153 <len>.w <emblem data>.?B -> 24x24 256 color .bmp (0153 + len.w + 1618/1654/1756 bytes)
@@ -281,14 +299,14 @@ static time_t socket_data_last_tick = 0;
int send_shortlist_array[FD_SETSIZE];// we only support FD_SETSIZE sockets, limit the array to that
int send_shortlist_count = 0;// how many fd's are in the shortlist
uint32 send_shortlist_set[(FD_SETSIZE+31)/32];// to know if specific fd's are already in the shortlist
-#endif
+#endif // SEND_SHORTLIST
static int create_session(int fd, RecvFunc func_recv, SendFunc func_send, ParseFunc func_parse);
#ifndef MINICORE
int ip_rules = 1;
static int connect_check(uint32 ip);
-#endif
+#endif // MINICORE
const char* error_msg(void)
{
@@ -379,13 +397,13 @@ void setsocketopts(int fd, struct hSockOpt *opt)
ShowWarning("setsocketopts: Unable to set SO_LINGER mode for connection #%d!\n", fd);
#ifdef TCP_THIN_LINEAR_TIMEOUTS
- if (sSetsockopt(fd, IPPROTO_TCP, TCP_THIN_LINEAR_TIMEOUTS, (char *)&yes, sizeof(yes)))
- ShowWarning("setsocketopts: Unable to set TCP_THIN_LINEAR_TIMEOUTS mode for connection #%d!\n", fd);
-#endif
+ if (sSetsockopt(fd, IPPROTO_TCP, TCP_THIN_LINEAR_TIMEOUTS, (char *)&yes, sizeof(yes)))
+ ShowWarning("setsocketopts: Unable to set TCP_THIN_LINEAR_TIMEOUTS mode for connection #%d!\n", fd);
+#endif // TCP_THIN_LINEAR_TIMEOUTS
#ifdef TCP_THIN_DUPACK
- if (sSetsockopt(fd, IPPROTO_TCP, TCP_THIN_DUPACK, (char *)&yes, sizeof(yes)))
- ShowWarning("setsocketopts: Unable to set TCP_THIN_DUPACK mode for connection #%d!\n", fd);
-#endif
+ if (sSetsockopt(fd, IPPROTO_TCP, TCP_THIN_DUPACK, (char *)&yes, sizeof(yes)))
+ ShowWarning("setsocketopts: Unable to set TCP_THIN_DUPACK mode for connection #%d!\n", fd);
+#endif // TCP_THIN_DUPACK
}
/*======================================
@@ -397,7 +415,7 @@ void set_eof(int fd)
#ifdef SEND_SHORTLIST
// Add this socket to the shortlist for eof handling.
send_shortlist_add_fd(fd);
-#endif
+#endif // SEND_SHORTLIST
sockt->session[fd]->flag.eof = 1;
}
}
@@ -435,7 +453,7 @@ int recv_to_fifo(int fd)
{
socket_data_ci += len;
}
-#endif
+#endif // SHOW_SERVER_STATS
return 0;
}
@@ -452,12 +470,12 @@ int send_from_fifo(int fd)
len = sSend(fd, (const char *) sockt->session[fd]->wdata, (int)sockt->session[fd]->wdata_size, MSG_NOSIGNAL);
if( len == SOCKET_ERROR )
- {//An exception has occurred
+ { //An exception has occurred
if( sErrno != S_EWOULDBLOCK ) {
//ShowDebug("send_from_fifo: %s, ending connection #%d\n", error_msg(), fd);
#ifdef SHOW_SERVER_STATS
socket_data_qo -= sockt->session[fd]->wdata_size;
-#endif
+#endif // SHOW_SERVER_STATS
sockt->session[fd]->wdata_size = 0; //Clear the send queue as we can't send anymore. [Skotlex]
sockt->eof(fd);
}
@@ -479,7 +497,7 @@ int send_from_fifo(int fd)
{
socket_data_co += len;
}
-#endif
+#endif // SHOW_SERVER_STATS
}
return 0;
@@ -502,7 +520,8 @@ void flush_fifos(void)
/*======================================
* CORE : Connection functions
*--------------------------------------*/
-int connect_client(int listen_fd) {
+int connect_client(int listen_fd)
+{
int fd;
struct sockaddr_in client_address;
socklen_t len;
@@ -533,11 +552,27 @@ int connect_client(int listen_fd) {
sockt->close(fd);
return -1;
}
-#endif
+#endif // MINICORE
- if( sockt->fd_max <= fd ) sockt->fd_max = fd + 1;
+#ifndef SOCKET_EPOLL
+ // Select Based Event Dispatcher
sFD_SET(fd,&readfds);
+#else // SOCKET_EPOLL
+ // Epoll based Event Dispatcher
+ epevent.data.fd = fd;
+ epevent.events = EPOLLIN;
+
+ if(epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &epevent) == SOCKET_ERROR){
+ ShowError("connect_client: New Socket #%d failed to add to epoll event dispatcher: %s\n", fd, error_msg());
+ sClose(fd);
+ return -1;
+ }
+
+#endif // SOCKET_EPOLL
+
+ if( sockt->fd_max <= fd ) sockt->fd_max = fd + 1;
+
create_session(fd, recv_to_fifo, send_from_fifo, default_func_parse);
sockt->session[fd]->client_addr = ntohl(client_address.sin_addr.s_addr);
@@ -585,8 +620,26 @@ int make_listen_bind(uint32 ip, uint16 port)
exit(EXIT_FAILURE);
}
+
+#ifndef SOCKET_EPOLL
+ // Select Based Event Dispatcher
+ sFD_SET(fd,&readfds);
+
+#else // SOCKET_EPOLL
+ // Epoll based Event Dispatcher
+ epevent.data.fd = fd;
+ epevent.events = EPOLLIN;
+
+ if(epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &epevent) == SOCKET_ERROR){
+ ShowError("make_listen_bind: failed to add listener socket #%d to epoll event dispatcher: %s\n", fd, error_msg());
+ sClose(fd);
+ exit(EXIT_FAILURE);
+ }
+
+#endif // SOCKET_EPOLL
+
if(sockt->fd_max <= fd) sockt->fd_max = fd + 1;
- sFD_SET(fd, &readfds);
+
create_session(fd, connect_client, null_send, null_parse);
sockt->session[fd]->client_addr = 0; // just listens
@@ -595,7 +648,8 @@ int make_listen_bind(uint32 ip, uint16 port)
return fd;
}
-int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
+int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt)
+{
struct sockaddr_in remote_address = { 0 };
int fd;
int result;
@@ -624,7 +678,7 @@ int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
remote_address.sin_port = htons(port);
if( !( opt && opt->silent ) )
- ShowStatus("Connecting to %d.%d.%d.%d:%i\n", CONVIP(ip), port);
+ ShowStatus("Connecting to %u.%u.%u.%u:%i\n", CONVIP(ip), port);
result = sConnect(fd, (struct sockaddr *)(&remote_address), sizeof(struct sockaddr_in));
if( result == SOCKET_ERROR ) {
@@ -636,9 +690,26 @@ int make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
//Now the socket can be made non-blocking. [Skotlex]
sockt->set_nonblocking(fd, 1);
- if (sockt->fd_max <= fd) sockt->fd_max = fd + 1;
+
+#ifndef SOCKET_EPOLL
+ // Select Based Event Dispatcher
sFD_SET(fd,&readfds);
+#else // SOCKET_EPOLL
+ // Epoll based Event Dispatcher
+ epevent.data.fd = fd;
+ epevent.events = EPOLLIN;
+
+ if(epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &epevent) == SOCKET_ERROR){
+ ShowError("make_connection: failed to add socket #%d to epoll event dispatcher: %s\n", fd, error_msg());
+ sClose(fd);
+ return -1;
+ }
+
+#endif // SOCKET_EPOLL
+
+ if(sockt->fd_max <= fd) sockt->fd_max = fd + 1;
+
create_session(fd, recv_to_fifo, send_from_fifo, default_func_parse);
sockt->session[fd]->client_addr = ntohl(remote_address.sin_addr.s_addr);
@@ -667,7 +738,7 @@ static void delete_session(int fd)
#ifdef SHOW_SERVER_STATS
socket_data_qi -= sockt->session[fd]->rdata_size - sockt->session[fd]->rdata_pos;
socket_data_qo -= sockt->session[fd]->wdata_size;
-#endif
+#endif // SHOW_SERVER_STATS
aFree(sockt->session[fd]->rdata);
aFree(sockt->session[fd]->wdata);
if( sockt->session[fd]->session_data )
@@ -740,7 +811,7 @@ int rfifoskip(int fd, size_t len)
s->rdata_pos = s->rdata_pos + len;
#ifdef SHOW_SERVER_STATS
socket_data_qi -= len;
-#endif
+#endif // SHOW_SERVER_STATS
return 0;
}
@@ -748,16 +819,19 @@ int rfifoskip(int fd, size_t len)
int wfifoset(int fd, size_t len)
{
size_t newreserve;
- struct socket_data* s = sockt->session[fd];
+ struct socket_data* s;
- if (!sockt->session_is_valid(fd) || s->wdata == NULL)
+ if (!sockt->session_is_valid(fd))
+ return 0;
+ s = sockt->session[fd];
+ if (s == NULL || s->wdata == NULL)
return 0;
// we have written len bytes to the buffer already before calling WFIFOSET
if (s->wdata_size+len > s->max_wdata) {
// actually there was a buffer overflow already
uint32 ip = s->client_addr;
- ShowFatalError("WFIFOSET: Write Buffer Overflow. Connection %d (%d.%d.%d.%d) has written %u bytes on a %u/%u bytes buffer.\n", fd, CONVIP(ip), (unsigned int)len, (unsigned int)s->wdata_size, (unsigned int)s->max_wdata);
+ ShowFatalError("WFIFOSET: Write Buffer Overflow. Connection %d (%u.%u.%u.%u) has written %u bytes on a %u/%u bytes buffer.\n", fd, CONVIP(ip), (unsigned int)len, (unsigned int)s->wdata_size, (unsigned int)s->max_wdata);
ShowDebug("Likely command that caused it: 0x%x\n", (*(uint16*)(s->wdata + s->wdata_size)));
// no other chance, make a better fifo model
exit(EXIT_FAILURE);
@@ -767,7 +841,7 @@ int wfifoset(int fd, size_t len)
{
// dynamic packets allow up to UINT16_MAX bytes (<packet_id>.W <packet_len>.W ...)
// all known fixed-size packets are within this limit, so use the same limit
- ShowFatalError("WFIFOSET: Packet 0x%x is too big. (len=%u, max=%u)\n", (*(uint16*)(s->wdata + s->wdata_size)), (unsigned int)len, 0xFFFF);
+ ShowFatalError("WFIFOSET: Packet 0x%x is too big. (len=%u, max=%u)\n", (*(uint16*)(s->wdata + s->wdata_size)), (unsigned int)len, 0xFFFFU);
exit(EXIT_FAILURE);
}
else if( len == 0 )
@@ -791,7 +865,7 @@ int wfifoset(int fd, size_t len)
s->wdata_size += len;
#ifdef SHOW_SERVER_STATS
socket_data_qo += len;
-#endif
+#endif // SHOW_SERVER_STATS
//If the interserver has 200% of its normal size full, flush the data.
if( s->flag.server && s->wdata_size >= 2*FIFOSIZE_SERVERLINK )
sockt->flush(fd);
@@ -805,31 +879,35 @@ int wfifoset(int fd, size_t len)
#ifdef SEND_SHORTLIST
send_shortlist_add_fd(fd);
-#endif
+#endif // SEND_SHORTLIST
return 0;
}
int do_sockets(int next)
{
+#ifndef SOCKET_EPOLL
fd_set rfd;
struct timeval timeout;
+#endif // SOCKET_EPOLL
int ret,i;
// PRESEND Timers are executed before do_sendrecv and can send packets and/or set sessions to eof.
// Send remaining data and process client-side disconnects here.
#ifdef SEND_SHORTLIST
send_shortlist_do_sends();
-#else
- for (i = 1; i < sockt->fd_max; i++)
- {
- if(!sockt->session[fd]
+#else // SEND_SHORTLIST
+ for (i = 1; i < sockt->fd_max; i++) {
+ if (sockt->session[i] == NULL)
continue;
- if(sockt->session[fd]>wdata_size)
- sockt->session[fd]>func_send(i);
+ if (sockt->session[i]->wdata_size > 0)
+ sockt->session[i]->func_send(i);
}
-#endif
+#endif // SEND_SHORTLIST
+
+#ifndef SOCKET_EPOLL
+ // Select based Event Dispatcher:
// can timeout until the next tick
timeout.tv_sec = next/1000;
@@ -847,6 +925,20 @@ int do_sockets(int next)
}
return 0; // interrupted by a signal, just loop and try again
}
+#else // SOCKET_EPOLL
+ // Epoll based Event Dispatcher
+
+ ret = epoll_wait(epfd, epevents, epoll_maxevents, next);
+ if(ret == SOCKET_ERROR)
+ {
+ if( sErrno != S_EINTR )
+ {
+ ShowFatalError("do_sockets: epoll_wait() failed, %s!\n", error_msg());
+ exit(EXIT_FAILURE);
+ }
+ return 0; // interrupted by a signal, just loop and try again
+ }
+#endif // SOCKET_EPOLL
sockt->last_tick = time(NULL);
@@ -858,7 +950,33 @@ int do_sockets(int next)
if( sockt->session[fd] )
sockt->session[fd]->func_recv(fd);
}
-#else
+#elif defined(SOCKET_EPOLL)
+ // epoll based selection
+
+ for( i = 0; i < ret; i++ )
+ {
+ struct epoll_event *it = &epevents[i];
+ struct socket_data *sock = sockt->session[ it->data.fd ];
+
+ if(!sock)
+ continue;
+
+ if ((it->events & EPOLLERR) ||
+ (it->events & EPOLLHUP) ||
+ (!(it->events & EPOLLIN)))
+ {
+ // Got Error on this connection
+ sockt->eof( it->data.fd );
+
+ } else if (it->events & EPOLLIN) {
+ // data wainting
+ sock->func_recv( it->data.fd );
+
+ }
+
+ }
+
+#else // defined(SOCKET_EPOLL)
// otherwise assume that the fd_set is a bit-array and enumerate it in a standard way
for( i = 1; ret && i < sockt->fd_max; ++i )
{
@@ -868,12 +986,12 @@ int do_sockets(int next)
--ret;
}
}
-#endif
+#endif // defined(SOCKET_EPOLL)
// POSTSEND Send remaining data and handle eof sessions.
#ifdef SEND_SHORTLIST
send_shortlist_do_sends();
-#else
+#else // SEND_SHORTLIST
for (i = 1; i < sockt->fd_max; i++)
{
if(!sockt->session[i])
@@ -887,7 +1005,7 @@ int do_sockets(int next)
sockt->session[i]->func_parse(i); //This should close the session immediately.
}
}
-#endif
+#endif // SEND_SHORTLIST
// parse input data on each socket
for(i = 1; i < sockt->fd_max; i++)
@@ -905,10 +1023,6 @@ int do_sockets(int next)
}
}
-#ifdef __clang_analyzer__
- // Let Clang's static analyzer know this never happens (it thinks it might because of a NULL check in session_is_valid)
- if (!sockt->session[i]) continue;
-#endif // __clang_analyzer__
sockt->session[i]->func_parse(i);
if(!sockt->session[i])
@@ -930,14 +1044,14 @@ int do_sockets(int next)
sprintf(buf, "In: %.03f kB/s (%.03f kB/s, Q: %.03f kB) | Out: %.03f kB/s (%.03f kB/s, Q: %.03f kB) | RAM: %.03f MB", socket_data_i/1024., socket_data_ci/1024., socket_data_qi/1024., socket_data_o/1024., socket_data_co/1024., socket_data_qo/1024., iMalloc->usage()/1024.);
#ifdef _WIN32
SetConsoleTitle(buf);
-#else
+#else // _WIN32
ShowMessage("\033[s\033[1;1H\033[2K%s\033[u", buf);
-#endif
+#endif // _WIN32
socket_data_last_tick = sockt->last_tick;
socket_data_i = socket_data_ci = 0;
socket_data_o = socket_data_co = 0;
}
-#endif
+#endif // SHOW_SERVER_STATS
return 0;
}
@@ -947,17 +1061,19 @@ int do_sockets(int next)
//////////////////////////////
// IP rules and DDoS protection
-typedef struct connect_history {
+struct connect_history {
uint32 ip;
int64 tick;
int count;
unsigned ddos : 1;
-} ConnectHistory;
+};
-typedef struct access_control {
+struct access_control {
uint32 ip;
uint32 mask;
-} AccessControl;
+};
+
+VECTOR_STRUCT_DECL(access_control_list, struct access_control);
enum aco {
ACO_DENY_ALLOW,
@@ -965,16 +1081,14 @@ enum aco {
ACO_MUTUAL_FAILURE
};
-static AccessControl* access_allow = NULL;
-static AccessControl* access_deny = NULL;
+static struct access_control_list access_allow;
+static struct access_control_list access_deny;
static int access_order = ACO_DENY_ALLOW;
-static int access_allownum = 0;
-static int access_denynum = 0;
static int access_debug = 0;
static int ddos_count = 10;
static int ddos_interval = 3*1000;
static int ddos_autoreset = 10*60*1000;
-DBMap *connect_history = NULL;
+struct DBMap *connect_history = NULL;
static int connect_check_(uint32 ip);
@@ -984,7 +1098,7 @@ static int connect_check(uint32 ip)
{
int result = connect_check_(ip);
if( access_debug ) {
- ShowInfo("connect_check: Connection from %d.%d.%d.%d %s\n", CONVIP(ip),result ? "allowed." : "denied!");
+ ShowInfo("connect_check: Connection from %u.%u.%u.%u %s\n", CONVIP(ip),result ? "allowed." : "denied!");
}
return result;
}
@@ -994,33 +1108,35 @@ static int connect_check(uint32 ip)
/// 1 or 2 : Connection Accepted
static int connect_check_(uint32 ip)
{
- ConnectHistory* hist = NULL;
+ struct connect_history *hist = NULL;
int i;
int is_allowip = 0;
int is_denyip = 0;
int connect_ok = 0;
// Search the allow list
- for( i=0; i < access_allownum; ++i ){
- if (SUBNET_MATCH(ip, access_allow[i].ip, access_allow[i].mask)) {
- if( access_debug ){
- ShowInfo("connect_check: Found match from allow list:%d.%d.%d.%d IP:%d.%d.%d.%d Mask:%d.%d.%d.%d\n",
+ for (i = 0; i < VECTOR_LENGTH(access_allow); ++i) {
+ struct access_control *entry = &VECTOR_INDEX(access_allow, i);
+ if (SUBNET_MATCH(ip, entry->ip, entry->mask)) {
+ if (access_debug) {
+ ShowInfo("connect_check: Found match from allow list:%u.%u.%u.%u IP:%u.%u.%u.%u Mask:%u.%u.%u.%u\n",
CONVIP(ip),
- CONVIP(access_allow[i].ip),
- CONVIP(access_allow[i].mask));
+ CONVIP(entry->ip),
+ CONVIP(entry->mask));
}
is_allowip = 1;
break;
}
}
// Search the deny list
- for( i=0; i < access_denynum; ++i ){
- if (SUBNET_MATCH(ip, access_deny[i].ip, access_deny[i].mask)) {
- if( access_debug ){
- ShowInfo("connect_check: Found match from deny list:%d.%d.%d.%d IP:%d.%d.%d.%d Mask:%d.%d.%d.%d\n",
+ for (i = 0; i < VECTOR_LENGTH(access_deny); ++i) {
+ struct access_control *entry = &VECTOR_INDEX(access_deny, i);
+ if (SUBNET_MATCH(ip, entry->ip, entry->mask)) {
+ if (access_debug) {
+ ShowInfo("connect_check: Found match from deny list:%u.%u.%u.%u IP:%u.%u.%u.%u Mask:%u.%u.%u.%u\n",
CONVIP(ip),
- CONVIP(access_deny[i].ip),
- CONVIP(access_deny[i].mask));
+ CONVIP(entry->ip),
+ CONVIP(entry->mask));
}
is_denyip = 1;
break;
@@ -1064,7 +1180,7 @@ static int connect_check_(uint32 ip)
hist->tick = timer->gettick();
if( ++hist->count >= ddos_count ) {// DDoS attack detected
hist->ddos = 1;
- ShowWarning("connect_check: DDoS Attack detected from %d.%d.%d.%d!\n", CONVIP(ip));
+ ShowWarning("connect_check: DDoS Attack detected from %u.%u.%u.%u!\n", CONVIP(ip));
return (connect_ok == 2 ? 1 : 0);
}
return connect_ok;
@@ -1075,7 +1191,7 @@ static int connect_check_(uint32 ip)
}
}
// IP not found, add to history
- CREATE(hist, ConnectHistory, 1);
+ CREATE(hist, struct connect_history, 1);
hist->ip = ip;
hist->tick = timer->gettick();
uidb_put(connect_history, ip, hist);
@@ -1084,11 +1200,12 @@ static int connect_check_(uint32 ip)
/// Timer function.
/// Deletes old connection history records.
-static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) {
+static int connect_check_clear(int tid, int64 tick, int id, intptr_t data)
+{
int clear = 0;
int list = 0;
- ConnectHistory *hist = NULL;
- DBIterator *iter;
+ struct connect_history *hist = NULL;
+ struct DBIterator *iter;
if( !db_size(connect_history) )
return 0;
@@ -1115,11 +1232,14 @@ static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) {
/// Parses the ip address and mask and puts it into acc.
/// Returns 1 is successful, 0 otherwise.
-int access_ipmask(const char* str, AccessControl* acc)
+int access_ipmask(const char *str, struct access_control *acc)
{
uint32 ip;
uint32 mask;
+ nullpo_ret(str);
+ nullpo_ret(acc);
+
if( strcmp(str,"all") == 0 ) {
ip = 0;
mask = 0;
@@ -1152,80 +1272,216 @@ int access_ipmask(const char* str, AccessControl* acc)
}
}
if( access_debug ){
- ShowInfo("access_ipmask: Loaded IP:%d.%d.%d.%d mask:%d.%d.%d.%d\n", CONVIP(ip), CONVIP(mask));
+ ShowInfo("access_ipmask: Loaded IP:%u.%u.%u.%u mask:%u.%u.%u.%u\n", CONVIP(ip), CONVIP(mask));
}
acc->ip = ip;
acc->mask = mask;
return 1;
}
+
+/**
+ * Adds an entry to the access list.
+ *
+ * @param setting The setting to read from.
+ * @param list_name The list name (used in error messages).
+ * @param access_list The access list to edit.
+ *
+ * @retval false in case of failure
+ */
+bool access_list_add(struct config_setting_t *setting, const char *list_name, struct access_control_list *access_list)
+{
+ const char *temp = NULL;
+ int i, setting_length;
+
+ nullpo_retr(false, setting);
+ nullpo_retr(false, list_name);
+ nullpo_retr(false, access_list);
+
+ if ((setting_length = libconfig->setting_length(setting)) <= 0)
+ return false;
+
+ VECTOR_ENSURE(*access_list, setting_length, 1);
+ for (i = 0; i < setting_length; i++) {
+ struct access_control acc;
+ if ((temp = libconfig->setting_get_string_elem(setting, i)) == NULL) {
+ continue;
+ }
+
+ if (!access_ipmask(temp, &acc)) {
+ ShowError("access_list_add: Invalid ip or ip range %s '%d'!\n", list_name, i);
+ continue;
+ }
+ VECTOR_PUSH(*access_list, acc);
+ }
+
+ return true;
+}
+
//////////////////////////////
-#endif
+#endif // MINICORE
//////////////////////////////
-int socket_config_read(const char* cfgName)
+/**
+ * Reads 'socket_configuration/ip_rules' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool socket_config_read_iprules(const char *filename, struct config_t *config, bool imported)
{
- char line[1024],w1[1024],w2[1024];
- FILE *fp;
+#ifndef MINICORE
+ struct config_setting_t *setting = NULL;
+ const char *temp = NULL;
- fp = fopen(cfgName, "r");
- if(fp == NULL) {
- ShowError("File not found: %s\n", cfgName);
- return 1;
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "socket_configuration/ip_rules")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("socket_config_read: socket_configuration/ip_rules was not found in %s!\n", filename);
+ return false;
}
+ libconfig->setting_lookup_bool(setting, "enable", &ip_rules);
- while (fgets(line, sizeof(line), fp)) {
- if(line[0] == '/' && line[1] == '/')
- continue;
- if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2)
- continue;
+ if (!ip_rules)
+ return true;
- if (!strcmpi(w1, "stall_time")) {
- sockt->stall_time = atoi(w2);
- if( sockt->stall_time < 3 )
- sockt->stall_time = 3;/* a minimum is required to refrain it from killing itself */
+ if (libconfig->setting_lookup_string(setting, "order", &temp) == CONFIG_TRUE) {
+ if (strcmpi(temp, "deny,allow" ) == 0) {
+ access_order = ACO_DENY_ALLOW;
+ } else if (strcmpi(temp, "allow, deny") == 0) {
+ access_order = ACO_ALLOW_DENY;
+ } else if (strcmpi(temp, "mutual-failure") == 0) {
+ access_order = ACO_MUTUAL_FAILURE;
+ } else {
+ ShowWarning("socket_config_read: invalid value '%s' for socket_configuration/ip_rules/order.\n", temp);
}
+ }
+
+ if ((setting = libconfig->lookup(config, "socket_configuration/ip_rules/allow_list")) == NULL) {
+ if (!imported)
+ ShowError("socket_config_read: socket_configuration/ip_rules/allow_list was not found in %s!\n", filename);
+ } else {
+ access_list_add(setting, "allow_list", &access_allow);
+ }
+
+ if ((setting = libconfig->lookup(config, "socket_configuration/ip_rules/deny_list")) == NULL) {
+ if (!imported)
+ ShowError("socket_config_read: socket_configuration/ip_rules/deny_list was not found in %s!\n", filename);
+ } else {
+ access_list_add(setting, "deny_list", &access_deny);
+ }
+#endif // ! MINICORE
+
+ return true;
+}
+
+/**
+ * Reads 'socket_configuration/ddos' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool socket_config_read_ddos(const char *filename, struct config_t *config, bool imported)
+{
#ifndef MINICORE
- else if (!strcmpi(w1, "enable_ip_rules")) {
- ip_rules = config_switch(w2);
- } else if (!strcmpi(w1, "order")) {
- if (!strcmpi(w2, "deny,allow"))
- access_order = ACO_DENY_ALLOW;
- else if (!strcmpi(w2, "allow,deny"))
- access_order = ACO_ALLOW_DENY;
- else if (!strcmpi(w2, "mutual-failure"))
- access_order = ACO_MUTUAL_FAILURE;
- } else if (!strcmpi(w1, "allow")) {
- RECREATE(access_allow, AccessControl, access_allownum+1);
- if (access_ipmask(w2, &access_allow[access_allownum]))
- ++access_allownum;
- else
- ShowError("socket_config_read: Invalid ip or ip range '%s'!\n", line);
- } else if (!strcmpi(w1, "deny")) {
- RECREATE(access_deny, AccessControl, access_denynum+1);
- if (access_ipmask(w2, &access_deny[access_denynum]))
- ++access_denynum;
- else
- ShowError("socket_config_read: Invalid ip or ip range '%s'!\n", line);
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "socket_configuration/ddos")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("socket_config_read: socket_configuration/ddos was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_int(setting, "interval", &ddos_interval);
+ libconfig->setting_lookup_int(setting, "count", &ddos_count);
+ libconfig->setting_lookup_int(setting, "autoreset", &ddos_autoreset);
+
+#endif // ! MINICORE
+ return true;
+}
+
+/**
+ * Reads 'socket_configuration' and initializes required variables.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool socket_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ struct config_setting_t *setting = NULL;
+ const char *import;
+ int i32 = 0;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "socket_configuration")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("socket_config_read: socket_configuration was not found in %s!\n", filename);
+ return false;
+ }
+
+ if (libconfig->setting_lookup_int(setting, "stall_time", &i32) == CONFIG_TRUE) {
+ if (i32 < 3)
+ i32 = 3; /* a minimum is required in order to refrain from killing itself */
+ sockt->stall_time = i32;
+ }
+
+#ifdef SOCKET_EPOLL
+ if (libconfig->setting_lookup_int(setting, "epoll_maxevents", &i32) == CONFIG_TRUE) {
+ if (i32 < 16)
+ i32 = 16; // minimum that seems to be useful
+ epoll_maxevents = i32;
+ }
+#endif // SOCKET_EPOLL
+
+#ifndef MINICORE
+ {
+ uint32 ui32 = 0;
+ libconfig->setting_lookup_bool(setting, "debug", &access_debug);
+ if (libconfig->setting_lookup_uint32(setting, "socket_max_client_packet", &ui32) == CONFIG_TRUE) {
+ socket_max_client_packet = ui32;
}
- else if (!strcmpi(w1,"ddos_interval"))
- ddos_interval = atoi(w2);
- else if (!strcmpi(w1,"ddos_count"))
- ddos_count = atoi(w2);
- else if (!strcmpi(w1,"ddos_autoreset"))
- ddos_autoreset = atoi(w2);
- else if (!strcmpi(w1,"debug"))
- access_debug = config_switch(w2);
- else if (!strcmpi(w1,"socket_max_client_packet"))
- socket_max_client_packet = strtoul(w2, NULL, 0);
-#endif
- else if (!strcmpi(w1, "import"))
- socket_config_read(w2);
- else
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
- }
-
- fclose(fp);
- return 0;
+ }
+
+ if (!socket_config_read_iprules(filename, &config, imported))
+ retval = false;
+ if (!socket_config_read_ddos(filename, &config, imported))
+ retval = false;
+#endif // MINICORE
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, SOCKET_CONF_FILENAME) == 0) {
+ ShowWarning("socket_config_read: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!socket_config_read(import, true))
+ retval = false;
+ }
+ }
+
+ libconfig->destroy(&config);
+ return retval;
}
void socket_final(void)
@@ -1234,11 +1490,9 @@ void socket_final(void)
#ifndef MINICORE
if( connect_history )
db_destroy(connect_history);
- if( access_allow )
- aFree(access_allow);
- if( access_deny )
- aFree(access_deny);
-#endif
+ VECTOR_CLEAR(access_allow);
+ VECTOR_CLEAR(access_deny);
+#endif // MINICORE
for( i = 1; i < sockt->fd_max; i++ )
if(sockt->session[i])
@@ -1254,6 +1508,18 @@ void socket_final(void)
VECTOR_CLEAR(sockt->lan_subnets);
VECTOR_CLEAR(sockt->allowed_ips);
VECTOR_CLEAR(sockt->trusted_ips);
+
+#ifdef SOCKET_EPOLL
+ if(epfd != SOCKET_ERROR){
+ close(epfd);
+ epfd = SOCKET_ERROR;
+ }
+ if(epevents != NULL){
+ aFree(epevents);
+ epevents = NULL;
+ }
+#endif // SOCKET_EPOLL
+
}
/// Closes a socket.
@@ -1263,7 +1529,17 @@ void socket_close(int fd)
return;// invalid
sockt->flush(fd); // Try to send what's left (although it might not succeed since it's a nonblocking socket)
+
+#ifndef SOCKET_EPOLL
+ // Select based Event Dispatcher
sFD_CLR(fd, &readfds);// this needs to be done before closing the socket
+#else // SOCKET_EPOLL
+ // Epoll based Event Dispatcher
+ epevent.data.fd = fd;
+ epevent.events = EPOLLIN;
+ epoll_ctl(epfd, EPOLL_CTL_DEL, fd, &epevent); // removing the socket from epoll when it's being closed is not required but recommended
+#endif // SOCKET_EPOLL
+
sShutdown(fd, SHUT_RDWR); // Disallow further reads/writes
sClose(fd); // We don't really care if these closing functions return an error, we are just shutting down and not reusing this socket.
if (sockt->session[fd]) delete_session(fd);
@@ -1354,7 +1630,6 @@ int socket_getips(uint32* ips, int max)
void socket_init(void)
{
- char *SOCKET_CONF_FILENAME = "conf/packet.conf";
uint64 rlim_cur = FD_SETSIZE;
#ifdef WIN32
@@ -1400,20 +1675,44 @@ void socket_init(void)
}
}
}
-#endif
+#endif // defined(HAVE_SETRLIMIT) && !defined(CYGWIN)
+
+#ifndef MINICORE
+ VECTOR_INIT(access_allow);
+ VECTOR_INIT(access_deny);
+#endif // ! MINICORE
// Get initial local ips
sockt->naddr_ = sockt->getips(sockt->addr_,16);
+ socket_config_read(SOCKET_CONF_FILENAME, false);
+
+#ifndef SOCKET_EPOLL
+ // Select based Event Dispatcher:
sFD_ZERO(&readfds);
+ ShowInfo("Server uses '" CL_WHITE "select" CL_RESET "' as event dispatcher\n");
+
+#else // SOCKET_EPOLL
+ // Epoll based Event Dispatcher:
+ epfd = epoll_create(FD_SETSIZE); // 2.6.8 or newer ignores the expected socket amount argument
+ if(epfd == SOCKET_ERROR){
+ ShowError("Failed to Create Epoll Event Dispatcher: %s\n", error_msg());
+ exit(EXIT_FAILURE);
+ }
+
+ memset(&epevent, 0x00, sizeof(struct epoll_event));
+ epevents = aCalloc(epoll_maxevents, sizeof(struct epoll_event));
+
+ ShowInfo("Server uses '" CL_WHITE "epoll" CL_RESET "' with up to " CL_WHITE "%d" CL_RESET " events per cycle as event dispatcher\n", epoll_maxevents);
+
+#endif // SOCKET_EPOLL
+
#if defined(SEND_SHORTLIST)
memset(send_shortlist_set, 0, sizeof(send_shortlist_set));
-#endif
+#endif // defined(SEND_SHORTLIST)
CREATE(sockt->session, struct socket_data *, FD_SETSIZE);
- socket_config_read(SOCKET_CONF_FILENAME);
-
// initialize last send-receive tick
sockt->last_tick = time(NULL);
@@ -1426,9 +1725,9 @@ void socket_init(void)
connect_history = uidb_alloc(DB_OPT_RELEASE_DATA);
timer->add_func_list(connect_check_clear, "connect_check_clear");
timer->add_interval(timer->gettick()+1000, connect_check_clear, 0, 0, 5*60*1000);
-#endif
+#endif // MINICORE
- ShowInfo("Server supports up to '"CL_WHITE"%"PRId64""CL_RESET"' concurrent connections.\n", rlim_cur);
+ ShowInfo("Server supports up to '"CL_WHITE"%"PRIu64""CL_RESET"' concurrent connections.\n", rlim_cur);
}
bool session_is_valid(int fd)
@@ -1442,9 +1741,11 @@ bool session_is_active(int fd)
}
// Resolves hostname into a numeric ip.
-uint32 host2ip(const char* hostname)
+uint32 host2ip(const char *hostname)
{
- struct hostent* h = gethostbyname(hostname);
+ struct hostent* h;
+ nullpo_ret(hostname);
+ h = gethostbyname(hostname);
return (h != NULL) ? ntohl(*(uint32*)h->h_addr) : 0;
}
@@ -1477,7 +1778,8 @@ uint16 ntows(uint16 netshort)
}
/* [Ind/Hercules] - socket_datasync */
-void socket_datasync(int fd, bool send) {
+void socket_datasync(int fd, bool send)
+{
struct {
unsigned int length;/* short is not enough for some */
} data_list[] = {
@@ -1616,7 +1918,7 @@ void send_shortlist_do_sends(void)
}
}
}
-#endif
+#endif // SEND_SHORTLIST
/**
* Checks whether the given IP comes from LAN or WAN.
@@ -1686,7 +1988,7 @@ bool socket_trusted_ip_check(uint32 ip)
* @param[in] groupname Current group name, for output/logging reasons.
* @return The amount of entries read, zero in case of errors.
*/
-int socket_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname)
+int socket_net_config_read_sub(struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname)
{
int i, len;
char ipbuf[64], maskbuf[64];
@@ -1722,11 +2024,11 @@ int socket_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *list
*/
void socket_net_config_read(const char *filename)
{
- config_t network_config;
+ struct config_t network_config;
int i;
nullpo_retv(filename);
- if (libconfig->read_file(&network_config, filename)) {
+ if (!libconfig->load_file(&network_config, filename)) {
ShowError("LAN Support configuration file is not found: '%s'. This server won't be able to accept connections from any servers.\n", filename);
return;
}
@@ -1751,15 +2053,18 @@ void socket_net_config_read(const char *filename)
ShowError("No allowed server IP ranges configured. This server won't be able to accept connections from any char servers.\n");
}
ARR_FIND(0, VECTOR_LENGTH(sockt->allowed_ips), i, SUBNET_MATCH(0, VECTOR_INDEX(sockt->allowed_ips, i).ip, VECTOR_INDEX(sockt->allowed_ips, i).mask));
+#ifndef BUILDBOT
if (i != VECTOR_LENGTH(sockt->allowed_ips)) {
ShowWarning("Using a wildcard IP range in the allowed server IPs is NOT RECOMMENDED.\n");
ShowNotice("Please edit your '%s' allowed list to fit your network configuration.\n", filename);
}
+#endif // BUILDBOT
libconfig->destroy(&network_config);
return;
}
-void socket_defaults(void) {
+void socket_defaults(void)
+{
sockt = &sockt_s;
sockt->fd_max = 0;
diff --git a/src/common/socket.h b/src/common/socket.h
index 8936c7772..e3a309f20 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,7 +22,6 @@
#define COMMON_SOCKET_H
#include "common/hercules.h"
-#include "common/conf.h"
#include "common/db.h"
#ifdef WIN32
@@ -34,7 +33,9 @@
# include <sys/types.h>
#endif
+/* Forward Declarations */
struct hplugin_data_store;
+struct config_setting_t;
#define FIFOSIZE_SERVERLINK 256*1024
@@ -46,16 +47,16 @@ struct hplugin_data_store;
sockt->realloc_writefifo((fd), (size)); \
} while(0)
-#define RFIFOP(fd,pos) (sockt->session[fd]->rdata + sockt->session[fd]->rdata_pos + (pos))
-#define WFIFOP(fd,pos) (sockt->session[fd]->wdata + sockt->session[fd]->wdata_size + (pos))
+#define RFIFOP(fd,pos) ((const void *)(sockt->session[fd]->rdata + sockt->session[fd]->rdata_pos + (pos)))
+#define WFIFOP(fd,pos) ((void *)(sockt->session[fd]->wdata + sockt->session[fd]->wdata_size + (pos)))
-#define RFIFOB(fd,pos) (*(uint8*)RFIFOP((fd),(pos)))
+#define RFIFOB(fd,pos) (*(const uint8*)RFIFOP((fd),(pos)))
#define WFIFOB(fd,pos) (*(uint8*)WFIFOP((fd),(pos)))
-#define RFIFOW(fd,pos) (*(uint16*)RFIFOP((fd),(pos)))
+#define RFIFOW(fd,pos) (*(const uint16*)RFIFOP((fd),(pos)))
#define WFIFOW(fd,pos) (*(uint16*)WFIFOP((fd),(pos)))
-#define RFIFOL(fd,pos) (*(uint32*)RFIFOP((fd),(pos)))
+#define RFIFOL(fd,pos) (*(const uint32*)RFIFOP((fd),(pos)))
#define WFIFOL(fd,pos) (*(uint32*)WFIFOP((fd),(pos)))
-#define RFIFOQ(fd,pos) (*(uint64*)RFIFOP((fd),(pos)))
+#define RFIFOQ(fd,pos) (*(const uint64*)RFIFOP((fd),(pos)))
#define WFIFOQ(fd,pos) (*(uint64*)WFIFOP((fd),(pos)))
#define RFIFOSPACE(fd) (sockt->session[fd]->max_rdata - sockt->session[fd]->rdata_size)
#define WFIFOSPACE(fd) (sockt->session[fd]->max_wdata - sockt->session[fd]->wdata_size)
@@ -76,21 +77,31 @@ struct hplugin_data_store;
#define RFIFOSKIP(fd, len) (sockt->rfifoskip(fd, len))
/* [Ind/Hercules] */
-#define RFIFO2PTR(fd) (void*)(sockt->session[fd]->rdata + sockt->session[fd]->rdata_pos)
+#define RFIFO2PTR(fd) ((const void *)(sockt->session[fd]->rdata + sockt->session[fd]->rdata_pos))
#define RP2PTR(fd) RFIFO2PTR(fd)
/* [Hemagx/Hercules] */
-#define WFIFO2PTR(fd) (void*)(sockt->session[fd]->wdata + sockt->session[fd]->wdata_pos)
+#define WFIFO2PTR(fd) ((void *)(sockt->session[fd]->wdata + sockt->session[fd]->wdata_size))
#define WP2PTR(fd) WFIFO2PTR(fd)
// buffer I/O macros
-#define RBUFP(p,pos) (((uint8*)(p)) + (pos))
-#define RBUFB(p,pos) (*(uint8*)RBUFP((p),(pos)))
-#define RBUFW(p,pos) (*(uint16*)RBUFP((p),(pos)))
-#define RBUFL(p,pos) (*(uint32*)RBUFP((p),(pos)))
-#define RBUFQ(p,pos) (*(uint64*)RBUFP((p),(pos)))
-
-#define WBUFP(p,pos) (((uint8*)(p)) + (pos))
+static inline const void *RBUFP_(const void *p, int pos) __attribute__((const, unused));
+static inline const void *RBUFP_(const void *p, int pos)
+{
+ return ((const uint8 *)p) + pos;
+}
+#define RBUFP(p,pos) RBUFP_(p, (int)(pos))
+#define RBUFB(p,pos) (*(const uint8 *)RBUFP((p),(pos)))
+#define RBUFW(p,pos) (*(const uint16 *)RBUFP((p),(pos)))
+#define RBUFL(p,pos) (*(const uint32 *)RBUFP((p),(pos)))
+#define RBUFQ(p,pos) (*(const uint64 *)RBUFP((p),(pos)))
+
+static inline void *WBUFP_(void *p, int pos) __attribute__((const, unused));
+static inline void *WBUFP_(void *p, int pos)
+{
+ return ((uint8 *)p) + pos;
+}
+#define WBUFP(p,pos) WBUFP_(p, (int)(pos))
#define WBUFB(p,pos) (*(uint8*)WBUFP((p),(pos)))
#define WBUFW(p,pos) (*(uint16*)WBUFP((p),(pos)))
#define WBUFL(p,pos) (*(uint32*)WBUFP((p),(pos)))
@@ -214,7 +225,7 @@ struct socket_interface {
uint32 (*lan_subnet_check) (uint32 ip, struct s_subnet *info);
bool (*allowed_ip_check) (uint32 ip);
bool (*trusted_ip_check) (uint32 ip);
- int (*net_config_read_sub) (config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ int (*net_config_read_sub) (struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
void (*net_config_read) (const char *filename);
};
diff --git a/src/common/spinlock.h b/src/common/spinlock.h
index 4d9c4c668..c04416285 100644
--- a/src/common/spinlock.h
+++ b/src/common/spinlock.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) rAthena Project (www.rathena.org)
*
* Hercules is free software: you can redistribute it and/or modify
@@ -37,74 +37,75 @@
#endif
#ifdef WIN32
-
-typedef struct __declspec( align(64) ) SPIN_LOCK{
+struct __declspec(align(64)) spin_lock {
volatile LONG lock;
volatile LONG nest;
volatile LONG sync_lock;
-} SPIN_LOCK;
+};
#else
-typedef struct SPIN_LOCK{
- volatile int32 lock;
- volatile int32 nest; // nesting level.
-
- volatile int32 sync_lock;
-} __attribute__((aligned(64))) SPIN_LOCK;
+struct spin_lock {
+ volatile int32 lock;
+ volatile int32 nest; // nesting level.
+ volatile int32 sync_lock;
+} __attribute__((aligned(64)));
#endif
-
#ifdef HERCULES_CORE
-static forceinline void InitializeSpinLock(SPIN_LOCK *lck){
- lck->lock = 0;
- lck->nest = 0;
- lck->sync_lock = 0;
+static forceinline void InitializeSpinLock(struct spin_lock *lck)
+{
+ lck->lock = 0;
+ lck->nest = 0;
+ lck->sync_lock = 0;
}
-static forceinline void FinalizeSpinLock(SPIN_LOCK *lck){
+static forceinline void FinalizeSpinLock(struct spin_lock *lck)
+{
return;
}
-#define getsynclock(l) do { if(InterlockedCompareExchange((l), 1, 0) == 0) break; rathread_yield(); } while(/*always*/1)
+#define getsynclock(l) do { if(InterlockedCompareExchange((l), 1, 0) == 0) break; thread->yield(); } while(/*always*/1)
#define dropsynclock(l) do { InterlockedExchange((l), 0); } while(0)
-static forceinline void EnterSpinLock(SPIN_LOCK *lck){
- int tid = rathread_get_tid();
+static forceinline void EnterSpinLock(struct spin_lock *lck)
+{
+ int tid = thread->get_tid();
- // Get Sync Lock && Check if the requester thread already owns the lock.
- // if it owns, increase nesting level
- getsynclock(&lck->sync_lock);
- if(InterlockedCompareExchange(&lck->lock, tid, tid) == tid){
- InterlockedIncrement(&lck->nest);
- dropsynclock(&lck->sync_lock);
- return; // Got Lock
- }
- // drop sync lock
+ // Get Sync Lock && Check if the requester thread already owns the lock.
+ // if it owns, increase nesting level
+ getsynclock(&lck->sync_lock);
+ if (InterlockedCompareExchange(&lck->lock, tid, tid) == tid) {
+ InterlockedIncrement(&lck->nest);
dropsynclock(&lck->sync_lock);
-
- // Spin until we've got it !
- while(1){
- if(InterlockedCompareExchange(&lck->lock, tid, 0) == 0){
- InterlockedIncrement(&lck->nest);
- return; // Got Lock
- }
- rathread_yield(); // Force ctxswitch to another thread.
+ return; // Got Lock
+ }
+ // drop sync lock
+ dropsynclock(&lck->sync_lock);
+
+ // Spin until we've got it !
+ while (true) {
+ if (InterlockedCompareExchange(&lck->lock, tid, 0) == 0) {
+ InterlockedIncrement(&lck->nest);
+ return; // Got Lock
}
+ thread->yield(); // Force ctxswitch to another thread.
+ }
}
-static forceinline void LeaveSpinLock(SPIN_LOCK *lck){
- int tid = rathread_get_tid();
+static forceinline void LeaveSpinLock(struct spin_lock *lck)
+{
+ int tid = thread->get_tid();
- getsynclock(&lck->sync_lock);
+ getsynclock(&lck->sync_lock);
- if(InterlockedCompareExchange(&lck->lock, tid, tid) == tid){ // this thread owns the lock.
- if(InterlockedDecrement(&lck->nest) == 0)
- InterlockedExchange(&lck->lock, 0); // Unlock!
- }
+ if (InterlockedCompareExchange(&lck->lock, tid, tid) == tid) { // this thread owns the lock.
+ if (InterlockedDecrement(&lck->nest) == 0)
+ InterlockedExchange(&lck->lock, 0); // Unlock!
+ }
- dropsynclock(&lck->sync_lock);
+ dropsynclock(&lck->sync_lock);
}
#endif // HERCULES_CORE
diff --git a/src/common/sql.c b/src/common/sql.c
index f6280c436..c80edbce4 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,9 @@
#include "sql.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/strlib.h"
#include "common/timer.h"
@@ -32,12 +34,13 @@
# include "common/winapi.h" // Needed before mysql.h
#endif
#include <mysql.h>
+#include <stdio.h>
#include <stdlib.h> // strtoul
void hercules_mysql_error_handler(unsigned int ecode);
-int mysql_reconnect_type;
-unsigned int mysql_reconnect_count;
+int mysql_reconnect_type = 2;
+int mysql_reconnect_count = 1;
struct sql_interface sql_s;
struct sql_interface *SQL;
@@ -78,11 +81,11 @@ struct SqlStmt {
///////////////////////////////////////////////////////////////////////////////
/// Allocates and initializes a new Sql handle.
-Sql* Sql_Malloc(void)
+struct Sql *Sql_Malloc(void)
{
- Sql* self;
+ struct Sql *self;
- CREATE(self, Sql, 1);
+ CREATE(self, struct Sql, 1);
mysql_init(&self->handle);
StrBuf->Init(&self->buf);
self->lengths = NULL;
@@ -92,10 +95,10 @@ Sql* Sql_Malloc(void)
return self;
}
-static int Sql_P_Keepalive(Sql* self);
+static int Sql_P_Keepalive(struct Sql *self);
/// Establishes a connection.
-int Sql_Connect(Sql* self, const char* user, const char* passwd, const char* host, uint16 port, const char* db)
+int Sql_Connect(struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db)
{
if( self == NULL )
return SQL_ERROR;
@@ -118,7 +121,7 @@ int Sql_Connect(Sql* self, const char* user, const char* passwd, const char* hos
}
/// Retrieves the timeout of the connection.
-int Sql_GetTimeout(Sql* self, uint32* out_timeout)
+int Sql_GetTimeout(struct Sql *self, uint32 *out_timeout)
{
if( self && out_timeout && SQL_SUCCESS == SQL->Query(self, "SHOW VARIABLES LIKE 'wait_timeout'") ) {
char* data;
@@ -135,12 +138,13 @@ int Sql_GetTimeout(Sql* self, uint32* out_timeout)
}
/// Retrieves the name of the columns of a table into out_buf, with the separator after each name.
-int Sql_GetColumnNames(Sql* self, const char* table, char* out_buf, size_t buf_len, char sep)
+int Sql_GetColumnNames(struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep)
{
char* data;
size_t len;
size_t off = 0;
+ nullpo_retr(SQL_ERROR, out_buf);
if( self == NULL || SQL_ERROR == SQL->Query(self, "EXPLAIN `%s`", table) )
return SQL_ERROR;
@@ -163,7 +167,7 @@ int Sql_GetColumnNames(Sql* self, const char* table, char* out_buf, size_t buf_l
}
/// Changes the encoding of the connection.
-int Sql_SetEncoding(Sql* self, const char* encoding)
+int Sql_SetEncoding(struct Sql *self, const char *encoding)
{
if( self && mysql_set_character_set(&self->handle, encoding) == 0 )
return SQL_SUCCESS;
@@ -171,7 +175,7 @@ int Sql_SetEncoding(Sql* self, const char* encoding)
}
/// Pings the connection.
-int Sql_Ping(Sql* self)
+int Sql_Ping(struct Sql *self)
{
if( self && mysql_ping(&self->handle) == 0 )
return SQL_SUCCESS;
@@ -183,7 +187,7 @@ int Sql_Ping(Sql* self)
/// @private
static int Sql_P_KeepaliveTimer(int tid, int64 tick, int id, intptr_t data)
{
- Sql* self = (Sql*)data;
+ struct Sql *self = (struct Sql *)data;
ShowInfo("Pinging SQL server to keep connection alive...\n");
Sql_Ping(self);
return 0;
@@ -193,7 +197,7 @@ static int Sql_P_KeepaliveTimer(int tid, int64 tick, int id, intptr_t data)
///
/// @return the keepalive timer id, or INVALID_TIMER
/// @private
-static int Sql_P_Keepalive(Sql* self)
+static int Sql_P_Keepalive(struct Sql *self)
{
uint32 timeout, ping_interval;
@@ -213,26 +217,27 @@ static int Sql_P_Keepalive(Sql* self)
}
/// Escapes a string.
-size_t Sql_EscapeString(Sql* self, char *out_to, const char *from)
+size_t Sql_EscapeString(struct Sql *self, char *out_to, const char *from)
{
- if( self )
+ if (self != NULL)
return (size_t)mysql_real_escape_string(&self->handle, out_to, from, (unsigned long)strlen(from));
else
return (size_t)mysql_escape_string(out_to, from, (unsigned long)strlen(from));
}
/// Escapes a string.
-size_t Sql_EscapeStringLen(Sql* self, char *out_to, const char *from, size_t from_len)
+size_t Sql_EscapeStringLen(struct Sql *self, char *out_to, const char *from, size_t from_len)
{
- if( self )
+ if (self != NULL)
return (size_t)mysql_real_escape_string(&self->handle, out_to, from, (unsigned long)from_len);
else
return (size_t)mysql_escape_string(out_to, from, (unsigned long)from_len);
}
/// Executes a query.
-int Sql_Query(Sql *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
-int Sql_Query(Sql *self, const char *query, ...) {
+int Sql_Query(struct Sql *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
+int Sql_Query(struct Sql *self, const char *query, ...)
+{
int res;
va_list args;
@@ -244,7 +249,7 @@ int Sql_Query(Sql *self, const char *query, ...) {
}
/// Executes a query.
-int Sql_QueryV(Sql* self, const char* query, va_list args)
+int Sql_QueryV(struct Sql *self, const char *query, va_list args)
{
if( self == NULL )
return SQL_ERROR;
@@ -269,7 +274,7 @@ int Sql_QueryV(Sql* self, const char* query, va_list args)
}
/// Executes a query.
-int Sql_QueryStr(Sql* self, const char* query)
+int Sql_QueryStr(struct Sql *self, const char *query)
{
if( self == NULL )
return SQL_ERROR;
@@ -294,33 +299,34 @@ int Sql_QueryStr(Sql* self, const char* query)
}
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE query.
-uint64 Sql_LastInsertId(Sql* self)
+uint64 Sql_LastInsertId(struct Sql *self)
{
- if( self )
+ if (self != NULL)
return (uint64)mysql_insert_id(&self->handle);
else
return 0;
}
/// Returns the number of columns in each row of the result.
-uint32 Sql_NumColumns(Sql* self)
+uint32 Sql_NumColumns(struct Sql *self)
{
- if( self && self->result )
+ if (self != NULL && self->result != NULL)
return (uint32)mysql_num_fields(self->result);
return 0;
}
/// Returns the number of rows in the result.
-uint64 Sql_NumRows(Sql* self)
+uint64 Sql_NumRows(struct Sql *self)
{
- if( self && self->result )
+ if (self != NULL && self->result != NULL)
return (uint64)mysql_num_rows(self->result);
return 0;
}
/// Fetches the next row.
-int Sql_NextRow(Sql* self) {
- if( self && self->result ) {
+int Sql_NextRow(struct Sql *self)
+{
+ if (self != NULL && self->result != NULL) {
self->row = mysql_fetch_row(self->result);
if( self->row ) {
self->lengths = mysql_fetch_lengths(self->result);
@@ -334,7 +340,7 @@ int Sql_NextRow(Sql* self) {
}
/// Gets the data of a column.
-int Sql_GetData(Sql* self, size_t col, char** out_buf, size_t* out_len)
+int Sql_GetData(struct Sql *self, size_t col, char **out_buf, size_t *out_len)
{
if( self && self->row ) {
if( col < SQL->NumColumns(self) ) {
@@ -350,7 +356,8 @@ int Sql_GetData(Sql* self, size_t col, char** out_buf, size_t* out_len)
}
/// Frees the result of the query.
-void Sql_FreeResult(Sql* self) {
+void Sql_FreeResult(struct Sql *self)
+{
if( self && self->result ) {
mysql_free_result(self->result);
self->result = NULL;
@@ -360,7 +367,7 @@ void Sql_FreeResult(Sql* self) {
}
/// Shows debug information (last query).
-void Sql_ShowDebug_(Sql* self, const char* debug_file, const unsigned long debug_line)
+void Sql_ShowDebug_(struct Sql *self, const char *debug_file, const unsigned long debug_line)
{
if( self == NULL )
ShowDebug("at %s:%lu - self is NULL\n", debug_file, debug_line);
@@ -371,7 +378,8 @@ void Sql_ShowDebug_(Sql* self, const char* debug_file, const unsigned long debug
}
/// Frees a Sql handle returned by Sql_Malloc.
-void Sql_Free(Sql* self) {
+void Sql_Free(struct Sql *self)
+{
if( self )
{
SQL->FreeResult(self);
@@ -408,6 +416,7 @@ static enum enum_field_types Sql_P_SizeToMysqlIntType(int sz)
/// @private
static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type, void* buffer, size_t buffer_len, unsigned long* out_length, int8* out_is_null)
{
+ nullpo_retr(SQL_ERROR, bind);
memset(bind, 0, sizeof(MYSQL_BIND));
switch( buffer_type )
{
@@ -416,39 +425,48 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
break;
// fixed size
case SQLDT_UINT8: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT8: bind->buffer_type = MYSQL_TYPE_TINY;
buffer_len = 1;
break;
case SQLDT_UINT16: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT16: bind->buffer_type = MYSQL_TYPE_SHORT;
buffer_len = 2;
break;
case SQLDT_UINT32: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT32: bind->buffer_type = MYSQL_TYPE_LONG;
buffer_len = 4;
break;
case SQLDT_UINT64: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT64: bind->buffer_type = MYSQL_TYPE_LONGLONG;
buffer_len = 8;
break;
// platform dependent size
case SQLDT_UCHAR: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_CHAR: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(char));
buffer_len = sizeof(char);
break;
case SQLDT_USHORT: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_SHORT: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(short));
buffer_len = sizeof(short);
break;
case SQLDT_UINT: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_INT: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int));
buffer_len = sizeof(int);
break;
case SQLDT_ULONG: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_LONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(long));
buffer_len = sizeof(long);
break;
case SQLDT_ULONGLONG: bind->is_unsigned = 1;
+ FALLTHROUGH
case SQLDT_LONGLONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int64));
buffer_len = sizeof(int64);
break;
@@ -466,7 +484,7 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
case SQLDT_BLOB: bind->buffer_type = MYSQL_TYPE_BLOB;
break;
default:
- ShowDebug("Sql_P_BindSqlDataType: unsupported buffer type (%d)\n", buffer_type);
+ ShowDebug("Sql_P_BindSqlDataType: unsupported buffer type (%u)\n", buffer_type);
return SQL_ERROR;
}
bind->buffer = buffer;
@@ -479,7 +497,8 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
/// Prints debug information about a field (type and length).
///
/// @private
-static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_types type, int is_unsigned, unsigned long length, const char* length_postfix) {
+static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_types type, int is_unsigned, unsigned long length, const char* length_postfix)
+{
const char *sign = (is_unsigned ? "UNSIGNED " : "");
const char *type_string = NULL;
switch (type) {
@@ -514,12 +533,13 @@ static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_ty
/// Reports debug information about a truncated column.
///
/// @private
-static void SqlStmt_P_ShowDebugTruncatedColumn(SqlStmt* self, size_t i)
+static void SqlStmt_P_ShowDebugTruncatedColumn(struct SqlStmt *self, size_t i)
{
MYSQL_RES* meta;
MYSQL_FIELD* field;
MYSQL_BIND* column;
+ nullpo_retv(self);
meta = mysql_stmt_result_metadata(self->stmt);
field = mysql_fetch_field_direct(meta, (unsigned int)i);
ShowSQL("DB error - data of field '%s' was truncated.\n", field->name);
@@ -534,8 +554,9 @@ static void SqlStmt_P_ShowDebugTruncatedColumn(SqlStmt* self, size_t i)
}
/// Allocates and initializes a new SqlStmt handle.
-SqlStmt* SqlStmt_Malloc(Sql* sql) {
- SqlStmt* self;
+struct SqlStmt *SqlStmt_Malloc(struct Sql *sql)
+{
+ struct SqlStmt *self;
MYSQL_STMT* stmt;
if( sql == NULL )
@@ -546,7 +567,7 @@ SqlStmt* SqlStmt_Malloc(Sql* sql) {
ShowSQL("DB error - %s\n", mysql_error(&sql->handle));
return NULL;
}
- CREATE(self, SqlStmt, 1);
+ CREATE(self, struct SqlStmt, 1);
StrBuf->Init(&self->buf);
self->stmt = stmt;
self->params = NULL;
@@ -561,8 +582,9 @@ SqlStmt* SqlStmt_Malloc(Sql* sql) {
}
/// Prepares the statement.
-int SqlStmt_Prepare(SqlStmt *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
-int SqlStmt_Prepare(SqlStmt *self, const char *query, ...) {
+int SqlStmt_Prepare(struct SqlStmt *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
+int SqlStmt_Prepare(struct SqlStmt *self, const char *query, ...)
+{
int res;
va_list args;
@@ -574,7 +596,7 @@ int SqlStmt_Prepare(SqlStmt *self, const char *query, ...) {
}
/// Prepares the statement.
-int SqlStmt_PrepareV(SqlStmt* self, const char* query, va_list args)
+int SqlStmt_PrepareV(struct SqlStmt *self, const char *query, va_list args)
{
if( self == NULL )
return SQL_ERROR;
@@ -594,7 +616,7 @@ int SqlStmt_PrepareV(SqlStmt* self, const char* query, va_list args)
}
/// Prepares the statement.
-int SqlStmt_PrepareStr(SqlStmt* self, const char* query)
+int SqlStmt_PrepareStr(struct SqlStmt *self, const char *query)
{
if( self == NULL )
return SQL_ERROR;
@@ -614,7 +636,7 @@ int SqlStmt_PrepareStr(SqlStmt* self, const char* query)
}
/// Returns the number of parameters in the prepared statement.
-size_t SqlStmt_NumParams(SqlStmt* self)
+size_t SqlStmt_NumParams(struct SqlStmt *self)
{
if( self )
return (size_t)mysql_stmt_param_count(self->stmt);
@@ -623,7 +645,7 @@ size_t SqlStmt_NumParams(SqlStmt* self)
}
/// Binds a parameter to a buffer.
-int SqlStmt_BindParam(SqlStmt* self, size_t idx, enum SqlDataType buffer_type, void* buffer, size_t buffer_len)
+int SqlStmt_BindParam(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len)
{
if( self == NULL )
return SQL_ERROR;
@@ -644,14 +666,23 @@ int SqlStmt_BindParam(SqlStmt* self, size_t idx, enum SqlDataType buffer_type, v
self->params[i].buffer_type = MYSQL_TYPE_NULL;
self->bind_params = true;
}
- if( idx < self->max_params )
- return Sql_P_BindSqlDataType(self->params+idx, buffer_type, buffer, buffer_len, NULL, NULL);
- else
- return SQL_SUCCESS;// out of range - ignore
+ if (idx >= self->max_params)
+ return SQL_SUCCESS; // out of range - ignore
+
+PRAGMA_GCC46(GCC diagnostic push)
+PRAGMA_GCC46(GCC diagnostic ignored "-Wcast-qual")
+ /*
+ * MySQL uses the same struct with a non-const buffer for both
+ * parameters (input) and columns (output).
+ * As such, we get to close our eyes and pretend we didn't see we're
+ * dropping a const qualifier here.
+ */
+ return Sql_P_BindSqlDataType(self->params+idx, buffer_type, (void *)buffer, buffer_len, NULL, NULL);
+PRAGMA_GCC46(GCC diagnostic pop)
}
/// Executes the prepared statement.
-int SqlStmt_Execute(SqlStmt* self)
+int SqlStmt_Execute(struct SqlStmt *self)
{
if( self == NULL )
return SQL_ERROR;
@@ -676,7 +707,7 @@ int SqlStmt_Execute(SqlStmt* self)
}
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE statement.
-uint64 SqlStmt_LastInsertId(SqlStmt* self)
+uint64 SqlStmt_LastInsertId(struct SqlStmt *self)
{
if( self )
return (uint64)mysql_stmt_insert_id(self->stmt);
@@ -685,7 +716,7 @@ uint64 SqlStmt_LastInsertId(SqlStmt* self)
}
/// Returns the number of columns in each row of the result.
-size_t SqlStmt_NumColumns(SqlStmt* self)
+size_t SqlStmt_NumColumns(struct SqlStmt *self)
{
if( self )
return (size_t)mysql_stmt_field_count(self->stmt);
@@ -694,7 +725,8 @@ size_t SqlStmt_NumColumns(SqlStmt* self)
}
/// Binds the result of a column to a buffer.
-int SqlStmt_BindColumn(SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
+int SqlStmt_BindColumn(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null)
+{
if (self == NULL)
return SQL_ERROR;
@@ -735,16 +767,16 @@ int SqlStmt_BindColumn(SqlStmt *self, size_t idx, enum SqlDataType buffer_type,
}
/// Returns the number of rows in the result.
-uint64 SqlStmt_NumRows(SqlStmt* self)
+uint64 SqlStmt_NumRows(struct SqlStmt *self)
{
- if( self )
+ if (self != NULL)
return (uint64)mysql_stmt_num_rows(self->stmt);
else
return 0;
}
/// Fetches the next row.
-int SqlStmt_NextRow(SqlStmt* self)
+int SqlStmt_NextRow(struct SqlStmt *self)
{
int err;
size_t i;
@@ -762,8 +794,6 @@ int SqlStmt_NextRow(SqlStmt* self)
// check for errors
if (err == MYSQL_NO_DATA)
return SQL_NO_DATA;
-#if defined(MYSQL_DATA_TRUNCATED)
- // MySQL 5.0/5.1 defines and returns MYSQL_DATA_TRUNCATED [FlavioJS]
if (err == MYSQL_DATA_TRUNCATED) {
my_bool truncated;
@@ -788,7 +818,6 @@ int SqlStmt_NextRow(SqlStmt* self)
ShowSQL("DB error - data truncated (unknown source)\n");
return SQL_ERROR;
}
-#endif
if (err) {
ShowSQL("DB error - %s\n", mysql_stmt_error(self->stmt));
hercules_mysql_error_handler(mysql_stmt_errno(self->stmt));
@@ -800,18 +829,6 @@ int SqlStmt_NextRow(SqlStmt* self)
for (i = 0; i < cols; ++i) {
unsigned long length = self->column_lengths[i].length;
MYSQL_BIND *column = &self->columns[i];
-#if !defined(MYSQL_DATA_TRUNCATED)
- // MySQL 4.1/(below?) returns success even if data is truncated, so we test truncation manually [FlavioJS]
- if (column->buffer_length < length) {
- // report truncated column
- if (column->buffer_type == MYSQL_TYPE_STRING || column->buffer_type == MYSQL_TYPE_BLOB) {
- // string/enum/blob column
- SqlStmt_P_ShowDebugTruncatedColumn(self, i);
- return SQL_ERROR;
- }
- // FIXME numeric types and null [FlavioJS]
- }
-#endif
if (self->column_lengths[i].out_length)
*self->column_lengths[i].out_length = (uint32)length;
if (column->buffer_type == MYSQL_TYPE_STRING) {
@@ -827,14 +844,14 @@ int SqlStmt_NextRow(SqlStmt* self)
}
/// Frees the result of the statement execution.
-void SqlStmt_FreeResult(SqlStmt* self)
+void SqlStmt_FreeResult(struct SqlStmt *self)
{
if( self )
mysql_stmt_free_result(self->stmt);
}
/// Shows debug information (with statement).
-void SqlStmt_ShowDebug_(SqlStmt* self, const char* debug_file, const unsigned long debug_line)
+void SqlStmt_ShowDebug_(struct SqlStmt *self, const char *debug_file, const unsigned long debug_line)
{
if( self == NULL )
ShowDebug("at %s:%lu - self is NULL\n", debug_file, debug_line);
@@ -845,7 +862,7 @@ void SqlStmt_ShowDebug_(SqlStmt* self, const char* debug_file, const unsigned lo
}
/// Frees a SqlStmt returned by SqlStmt_Malloc.
-void SqlStmt_Free(SqlStmt* self)
+void SqlStmt_Free(struct SqlStmt *self)
{
if( self )
{
@@ -862,12 +879,14 @@ void SqlStmt_Free(SqlStmt* self)
aFree(self);
}
}
+
/* receives mysql error codes during runtime (not on first-time-connects) */
-void hercules_mysql_error_handler(unsigned int ecode) {
- static unsigned int retry = 1;
+void hercules_mysql_error_handler(unsigned int ecode)
+{
switch( ecode ) {
case 2003:/* Can't connect to MySQL (this error only happens here when failing to reconnect) */
if( mysql_reconnect_type == 1 ) {
+ static int retry = 1;
if( ++retry > mysql_reconnect_count ) {
ShowFatalError("MySQL has been unreachable for too long, %d reconnects were attempted. Shutting Down\n", retry);
exit(EXIT_FAILURE);
@@ -876,49 +895,62 @@ void hercules_mysql_error_handler(unsigned int ecode) {
break;
}
}
-void Sql_inter_server_read(const char* cfgName, bool first) {
- char line[1024], w1[1024], w2[1024];
- FILE* fp;
-
- fp = fopen(cfgName, "r");
- if(fp == NULL) {
- if( first ) {
- ShowFatalError("File not found: %s\n", cfgName);
- exit(EXIT_FAILURE);
- } else
- ShowError("File not found: %s\n", cfgName);
- return;
+
+/**
+ * Parses mysql_reconnect from inter_configuration.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool Sql_inter_server_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ const struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration/mysql_reconnect")) == NULL) {
+ config_destroy(&config);
+ if (imported)
+ return true;
+ ShowError("Sql_inter_server_read: inter_configuration/mysql_reconnect was not found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- int i = sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2);
- if (i != 2)
- continue;
+ if (libconfig->setting_lookup_int(setting, "type", &mysql_reconnect_type) == CONFIG_TRUE) {
+ if (mysql_reconnect_type != 1 && mysql_reconnect_type != 2) {
+ ShowError("%s::inter_configuration/mysql_reconnect/type is set to %d which is not valid, defaulting to 1...\n", filename, mysql_reconnect_type);
+ mysql_reconnect_type = 1;
+ }
+ }
+ if (libconfig->setting_lookup_int(setting, "count", &mysql_reconnect_count) == CONFIG_TRUE) {
+ if (mysql_reconnect_count < 1)
+ mysql_reconnect_count = 1;
+ }
- if(!strcmpi(w1,"mysql_reconnect_type")) {
- mysql_reconnect_type = atoi(w2);
- switch( mysql_reconnect_type ) {
- case 1:
- case 2:
- break;
- default:
- ShowError("%s::mysql_reconnect_type is set to %d which is not valid, defaulting to 1...\n", cfgName, mysql_reconnect_type);
- mysql_reconnect_type = 1;
- break;
- }
- } else if(!strcmpi(w1,"mysql_reconnect_count")) {
- mysql_reconnect_count = atoi(w2);
- if( mysql_reconnect_count < 1 )
- mysql_reconnect_count = 1;
- } else if(!strcmpi(w1,"import"))
- Sql_inter_server_read(w2,false);
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, "conf/common/inter-server.conf") == 0) { // FIXME: Hardcoded path
+ ShowWarning("Sql_inter_server_read: Loop detected in %s! Skipping 'import'...\n", filename);
+ } else {
+ if (!Sql_inter_server_read(import, true))
+ retval = false;
+ }
}
- fclose(fp);
- return;
+ libconfig->destroy(&config);
+ return retval;
}
-void Sql_HerculesUpdateCheck(Sql* self) {
+void Sql_HerculesUpdateCheck(struct Sql *self)
+{
char line[22];// "yyyy-mm-dd--hh-mm" (17) + ".sql" (4) + 1
FILE* ifp;/* index fp */
unsigned int performed = 0;
@@ -971,7 +1003,7 @@ void Sql_HerculesUpdateCheck(Sql* self) {
fclose(ifp);
if( performed ) {
- ShowSQL("- detected %d new "CL_WHITE"SQL updates"CL_RESET"\n",performed);
+ ShowSQL("- detected %u new "CL_WHITE"SQL updates"CL_RESET"\n",performed);
ShowMessage("%s",StrBuf->Value(&buf));
ShowSQL("To manually skip, type: 'sql update skip <file name>'\n");
}
@@ -979,7 +1011,8 @@ void Sql_HerculesUpdateCheck(Sql* self) {
StrBuf->Destroy(&buf);
}
-void Sql_HerculesUpdateSkip(Sql* self,const char *filename) {
+void Sql_HerculesUpdateSkip(struct Sql *self, const char *filename)
+{
char path[41];// "sql-files/upgrades/" (19) + "yyyy-mm-dd--hh-mm" (17) + ".sql" (4) + 1
char timestamp[11];// "1360186680" (10) + 1
FILE* ifp;/* index fp */
@@ -1015,10 +1048,13 @@ void Sql_HerculesUpdateSkip(Sql* self,const char *filename) {
return;
}
-void Sql_Init(void) {
- Sql_inter_server_read("conf/inter-server.conf",true);
+void Sql_Init(void)
+{
+ Sql_inter_server_read("conf/common/inter-server.conf", false); // FIXME: Hardcoded path
}
-void sql_defaults(void) {
+
+void sql_defaults(void)
+{
SQL = &sql_s;
SQL->Connect = Sql_Connect;
diff --git a/src/common/sql.h b/src/common/sql.h
index e949a8280..4d9a12cc1 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -71,90 +71,86 @@ enum SqlDataType {
SQLDT_LASTID
};
-struct Sql;// Sql handle (private access)
-struct SqlStmt;// Sql statement (private access)
-
-typedef enum SqlDataType SqlDataType;
-typedef struct Sql Sql;
-typedef struct SqlStmt SqlStmt;
+struct Sql; ///< Sql handle (private access)
+struct SqlStmt; ///< Sql statement (private access)
struct sql_interface {
/// Establishes a connection.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*Connect) (Sql* self, const char* user, const char* passwd, const char* host, uint16 port, const char* db);
+ int (*Connect) (struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db);
/// Retrieves the timeout of the connection.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*GetTimeout) (Sql* self, uint32* out_timeout);
+ int (*GetTimeout) (struct Sql *self, uint32 *out_timeout);
/// Retrieves the name of the columns of a table into out_buf, with the separator after each name.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*GetColumnNames) (Sql* self, const char* table, char* out_buf, size_t buf_len, char sep);
+ int (*GetColumnNames) (struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep);
/// Changes the encoding of the connection.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*SetEncoding) (Sql* self, const char* encoding);
+ int (*SetEncoding) (struct Sql *self, const char *encoding);
/// Pings the connection.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*Ping) (Sql* self);
+ int (*Ping) (struct Sql *self);
/// Escapes a string.
/// The output buffer must be at least strlen(from)*2+1 in size.
///
/// @return The size of the escaped string
- size_t (*EscapeString) (Sql* self, char* out_to, const char* from);
+ size_t (*EscapeString) (struct Sql *self, char *out_to, const char *from);
/// Escapes a string.
/// The output buffer must be at least from_len*2+1 in size.
///
/// @return The size of the escaped string
- size_t (*EscapeStringLen) (Sql* self, char* out_to, const char* from, size_t from_len);
+ size_t (*EscapeStringLen) (struct Sql *self, char *out_to, const char *from, size_t from_len);
/// Executes a query.
/// Any previous result is freed.
/// The query is constructed as if it was sprintf.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*Query) (Sql *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
+ int (*Query) (struct Sql *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
/// Executes a query.
/// Any previous result is freed.
/// The query is constructed as if it was svprintf.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*QueryV) (Sql* self, const char* query, va_list args);
+ int (*QueryV) (struct Sql *self, const char *query, va_list args);
/// Executes a query.
/// Any previous result is freed.
/// The query is used directly.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*QueryStr) (Sql* self, const char* query);
+ int (*QueryStr) (struct Sql *self, const char *query);
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE query.
///
/// @return Value of the auto-increment column
- uint64 (*LastInsertId) (Sql* self);
+ uint64 (*LastInsertId) (struct Sql *self);
/// Returns the number of columns in each row of the result.
///
/// @return Number of columns
- uint32 (*NumColumns) (Sql* self);
+ uint32 (*NumColumns) (struct Sql *self);
/// Returns the number of rows in the result.
///
/// @return Number of rows
- uint64 (*NumRows) (Sql* self);
+ uint64 (*NumRows) (struct Sql *self);
/// Fetches the next row.
/// The data of the previous row is no longer valid.
///
/// @return SQL_SUCCESS, SQL_ERROR or SQL_NO_DATA
- int (*NextRow) (Sql* self);
+ int (*NextRow) (struct Sql *self);
/// Gets the data of a column.
/// The data remains valid until the next row is fetched or the result is freed.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*GetData) (Sql* self, size_t col, char** out_buf, size_t* out_len);
+ int (*GetData) (struct Sql *self, size_t col, char **out_buf, size_t *out_len);
/// Frees the result of the query.
- void (*FreeResult) (Sql* self);
+ void (*FreeResult) (struct Sql *self);
/// Shows debug information (last query).
- void (*ShowDebug_) (Sql* self, const char* debug_file, const unsigned long debug_line);
+ void (*ShowDebug_) (struct Sql *self, const char *debug_file, const unsigned long debug_line);
/// Frees a Sql handle returned by Sql_Malloc.
- void (*Free) (Sql* self);
+ void (*Free) (struct Sql *self);
/// Allocates and initializes a new Sql handle.
struct Sql *(*Malloc) (void);
@@ -180,56 +176,56 @@ struct sql_interface {
/// Queries in Sql and SqlStmt are independent and don't affect each other.
///
/// @return SqlStmt handle or NULL if an error occurred
- struct SqlStmt* (*StmtMalloc)(Sql* sql);
+ struct SqlStmt* (*StmtMalloc)(struct Sql *sql);
/// Prepares the statement.
/// Any previous result is freed and all parameter bindings are removed.
/// The query is constructed as if it was sprintf.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*StmtPrepare) (SqlStmt *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
+ int (*StmtPrepare) (struct SqlStmt *self, const char *query, ...) __attribute__((format(printf, 2, 3)));
/// Prepares the statement.
/// Any previous result is freed and all parameter bindings are removed.
/// The query is constructed as if it was svprintf.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*StmtPrepareV)(SqlStmt* self, const char* query, va_list args);
+ int (*StmtPrepareV)(struct SqlStmt *self, const char *query, va_list args);
/// Prepares the statement.
/// Any previous result is freed and all parameter bindings are removed.
/// The query is used directly.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*StmtPrepareStr)(SqlStmt* self, const char* query);
+ int (*StmtPrepareStr)(struct SqlStmt *self, const char *query);
/// Returns the number of parameters in the prepared statement.
///
/// @return Number or parameters
- size_t (*StmtNumParams)(SqlStmt* self);
+ size_t (*StmtNumParams)(struct SqlStmt *self);
/// Binds a parameter to a buffer.
/// The buffer data will be used when the statement is executed.
/// All parameters should have bindings.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*StmtBindParam)(SqlStmt* self, size_t idx, SqlDataType buffer_type, void* buffer, size_t buffer_len);
+ int (*StmtBindParam)(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len);
/// Executes the prepared statement.
/// Any previous result is freed and all column bindings are removed.
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*StmtExecute)(SqlStmt* self);
+ int (*StmtExecute)(struct SqlStmt *self);
/// Returns the number of the AUTO_INCREMENT column of the last INSERT/UPDATE statement.
///
/// @return Value of the auto-increment column
- uint64 (*StmtLastInsertId)(SqlStmt* self);
+ uint64 (*StmtLastInsertId)(struct SqlStmt *self);
/// Returns the number of columns in each row of the result.
///
/// @return Number of columns
- size_t (*StmtNumColumns)(SqlStmt* self);
+ size_t (*StmtNumColumns)(struct SqlStmt *self);
/// Binds the result of a column to a buffer.
/// The buffer will be filled with data when the next row is fetched.
@@ -237,26 +233,26 @@ struct sql_interface {
/// and the null-terminator (an extra byte).
///
/// @return SQL_SUCCESS or SQL_ERROR
- int (*StmtBindColumn)(SqlStmt* self, size_t idx, SqlDataType buffer_type, void* buffer, size_t buffer_len, uint32* out_length, int8* out_is_null);
+ int (*StmtBindColumn)(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null);
/// Returns the number of rows in the result.
///
/// @return Number of rows
- uint64 (*StmtNumRows)(SqlStmt* self);
+ uint64 (*StmtNumRows)(struct SqlStmt *self);
/// Fetches the next row.
/// All column bindings will be filled with data.
///
/// @return SQL_SUCCESS, SQL_ERROR or SQL_NO_DATA
- int (*StmtNextRow)(SqlStmt* self);
+ int (*StmtNextRow)(struct SqlStmt *self);
/// Frees the result of the statement execution.
- void (*StmtFreeResult)(SqlStmt* self);
+ void (*StmtFreeResult)(struct SqlStmt *self);
/// Frees a SqlStmt returned by SqlStmt_Malloc.
- void (*StmtFree)(SqlStmt* self);
+ void (*StmtFree)(struct SqlStmt *self);
- void (*StmtShowDebug_)(SqlStmt* self, const char* debug_file, const unsigned long debug_line);
+ void (*StmtShowDebug_)(struct SqlStmt *self, const char *debug_file, const unsigned long debug_line);
};
@@ -265,8 +261,8 @@ void sql_defaults(void);
void Sql_Init(void);
-void Sql_HerculesUpdateCheck(Sql* self);
-void Sql_HerculesUpdateSkip(Sql* self,const char *filename);
+void Sql_HerculesUpdateCheck(struct Sql *self);
+void Sql_HerculesUpdateSkip(struct Sql *self, const char *filename);
#endif // HERCULES_CORE
HPShared struct sql_interface *SQL;
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 997b01ffa..df8093456 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -271,10 +271,9 @@ char* strlib_strtok_r(char *s1, const char *s2, char **lasts)
size_t strlib_strnlen(const char *string, size_t maxlen)
{
-// TODO: The _MSC_VER check can probably be removed (we no longer support VS
-// versions <= 2003, do we?), but this implementation might be still necessary
-// for NetBSD 5.x and possibly some Solaris versions.
-#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN)
+// TODO: Verify whether this implementation is still necessary for NetBSD 5.x
+// and possibly some Solaris versions.
+#if !(defined(WIN32) && defined(_MSC_VER)) && !defined(HAVE_STRNLEN)
/* Find the length of STRING, but scan at most MAXLEN characters.
* If no '\0' terminator is found in that many characters, return MAXLEN.
*/
@@ -345,6 +344,7 @@ int strlib_config_switch(const char *str) {
}
/// strncpy that always null-terminates the string
+/// @remark this function will read at most `n` - 1 bytes from `src` (from 0 to `n` - 2)
char *strlib_safestrncpy(char *dst, const char *src, size_t n)
{
if( n > 0 )
@@ -424,13 +424,12 @@ int strlib_strline(const char *str, size_t pos)
/// @param output Output string
/// @param input Binary input buffer
/// @param count Number of bytes to convert
-bool strlib_bin2hex(char *output, unsigned char *input, size_t count)
+bool strlib_bin2hex(char *output, const unsigned char *input, size_t count)
{
char toHex[] = "0123456789abcdef";
size_t i;
- for( i = 0; i < count; ++i )
- {
+ for (i = 0; i < count; ++i) {
*output++ = toHex[(*input & 0xF0) >> 4];
*output++ = toHex[(*input & 0x0F) >> 0];
++input;
@@ -630,6 +629,8 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i
svstate.opt = opt;
svstate.delim = delim;
svstate.done = false;
+ svstate.start = 0;
+ svstate.end = 0;
// parse
count = 0;
@@ -773,6 +774,7 @@ size_t sv_escape_c(char* out_dest, const char* src, size_t len, const char* esca
case '\v': out_dest[j++] = 'v'; break;
case '\f': out_dest[j++] = 'f'; break;
case '\?': out_dest[j++] = '?'; break;
+ case '\"': out_dest[j++] = '"'; break;
default:// to octal
out_dest[j++] = '0'+((char)(((unsigned char)src[i]&0700)>>6));
out_dest[j++] = '0'+((char)(((unsigned char)src[i]&0070)>>3));
@@ -1114,7 +1116,7 @@ void strlib_defaults(void) {
strlib->normalize_name_ = strlib_normalize_name;
strlib->stristr_ = strlib_stristr;
-#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN)
+#if !(defined(WIN32) && defined(_MSC_VER)) && !defined(HAVE_STRNLEN)
strlib->strnlen_ = strlib_strnlen;
#else
strlib->strnlen_ = NULL;
diff --git a/src/common/strlib.h b/src/common/strlib.h
index c523f5d86..fa7d577eb 100644
--- a/src/common/strlib.h
+++ b/src/common/strlib.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -33,7 +33,7 @@
#define normalize_name(str,delims) (strlib->normalize_name_((str),(delims)))
#define stristr(haystack,needle) (strlib->stristr_((haystack),(needle)))
-#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN)
+#if !(defined(WIN32) && defined(_MSC_VER)) && !defined(HAVE_STRNLEN)
#define strnlen(string,maxlen) (strlib->strnlen_((string),(maxlen)))
#endif
@@ -98,7 +98,7 @@ struct strlib_interface {
char *(*normalize_name_) (char* str,const char* delims);
const char *(*stristr_) (const char *haystack, const char *needle);
- /* only used when '!(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) && !defined(HAVE_STRNLEN)', needs to be defined at all times however */
+ /* only used when '!(defined(WIN32) && defined(_MSC_VER)) && !defined(HAVE_STRNLEN)', needs to be defined at all times however */
size_t (*strnlen_) (const char* string, size_t maxlen);
/* only used when 'WIN32' */
@@ -125,7 +125,7 @@ struct strlib_interface {
/// Produces the hexadecimal representation of the given input.
/// The output buffer must be at least count*2+1 in size.
/// Returns true on success, false on failure.
- bool (*bin2hex_) (char* output, unsigned char* input, size_t count);
+ bool (*bin2hex_) (char *output, const unsigned char *input, size_t count);
};
struct stringbuf_interface {
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 7cc4cd16a..3c7e25a0c 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -31,6 +31,7 @@
#include "common/cbasetypes.h"
#include "common/core.h"
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/strlib.h"
#include <stdio.h> // fopen
@@ -38,6 +39,7 @@
#ifdef WIN32
# include <windows.h>
#else
+# include <sys/time.h> // time constants
# include <unistd.h>
#endif
@@ -236,11 +238,13 @@ enum windows_ver_suite {
* @retval true if a revision was correctly detected.
* @retval false if no revision was detected. out is set to NULL in this case.
*/
-bool sysinfo_svn_get_revision(char **out) {
+bool sysinfo_svn_get_revision(char **out)
+{
// Only include SVN support if detected it, or we're on MSVC
#if !defined(SYSINFO_VCSTYPE) || SYSINFO_VCSTYPE == VCSTYPE_SVN || SYSINFO_VCSTYPE == VCSTYPE_UNKNOWN
FILE *fp;
+ nullpo_ret(out);
// subversion 1.7 uses a sqlite3 database
// FIXME this is hackish at best...
// - ignores database file structure
@@ -290,40 +294,8 @@ bool sysinfo_svn_get_revision(char **out) {
if (*out != NULL)
return true;
}
-
- // subversion 1.6 and older?
- if ((fp = fopen(".svn/entries", "r")) != NULL) {
- char line[1024];
- int rev;
- // Check the version
- if (fgets(line, sizeof(line), fp)) {
- if (!ISDIGIT(line[0])) {
- // XML File format
- while (fgets(line,sizeof(line),fp))
- if (strstr(line,"revision=")) break;
- if (sscanf(line," %*[^\"]\"%d%*[^\n]", &rev) == 1) {
- if (*out != NULL)
- aFree(*out);
- *out = aCalloc(1, 8);
- snprintf(*out, 8, "%d", rev);
- }
- } else {
- // Bin File format
- if (fgets(line, sizeof(line), fp) == NULL) { printf("Can't get bin name\n"); } // Get the name
- if (fgets(line, sizeof(line), fp) == NULL) { printf("Can't get entries kind\n"); } // Get the entries kind
- if (fgets(line, sizeof(line), fp)) { // Get the rev numver
- if (*out != NULL)
- aFree(*out);
- *out = aCalloc(1, 8);
- snprintf(*out, 8, "%d", atoi(line));
- }
- }
- }
- fclose(fp);
-
- if (*out != NULL)
- return true;
- }
+#else
+ nullpo_ret(out);
#endif
if (*out != NULL)
aFree(*out);
@@ -338,11 +310,13 @@ bool sysinfo_svn_get_revision(char **out) {
* @retval true if a revision was correctly detected.
* @retval false if no revision was detected. out is set to NULL in this case.
*/
-bool sysinfo_git_get_revision(char **out) {
+bool sysinfo_git_get_revision(char **out)
+{
// Only include Git support if we detected it, or we're on MSVC
#if !defined(SYSINFO_VCSTYPE) || SYSINFO_VCSTYPE == VCSTYPE_GIT || SYSINFO_VCSTYPE == VCSTYPE_UNKNOWN
char ref[128], filepath[128], line[128];
+ nullpo_ret(out);
strcpy(ref, "HEAD");
while (*ref) {
@@ -367,6 +341,7 @@ bool sysinfo_git_get_revision(char **out) {
if (*out != NULL)
return true;
#else
+ nullpo_ret(out);
if (*out != NULL)
aFree(*out);
*out = NULL;
@@ -384,7 +359,8 @@ typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
*
* Once retrieved, the version string is stored into sysinfo->p->osversion.
*/
-void sysinfo_osversion_retrieve(void) {
+void sysinfo_osversion_retrieve(void)
+{
OSVERSIONINFOEX osvi;
StringBuf buf;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
@@ -635,7 +611,8 @@ typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
* System info is not stored anywhere after retrieval
* @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx
**/
-void sysinfo_systeminfo_retrieve( LPSYSTEM_INFO info ) {
+void sysinfo_systeminfo_retrieve(LPSYSTEM_INFO info)
+{
PGNSI pGNSI;
// Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
@@ -652,7 +629,8 @@ void sysinfo_systeminfo_retrieve( LPSYSTEM_INFO info ) {
* Returns number of bytes in a memory page
* Only needed when compiling with MSVC
**/
-long sysinfo_getpagesize( void ) {
+long sysinfo_getpagesize(void)
+{
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -666,7 +644,8 @@ long sysinfo_getpagesize( void ) {
* Once retrieved, the name is stored into sysinfo->p->cpu and the
* number of cores in sysinfo->p->cpucores.
*/
-void sysinfo_cpu_retrieve(void) {
+void sysinfo_cpu_retrieve(void)
+{
StringBuf buf;
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -702,7 +681,8 @@ void sysinfo_cpu_retrieve(void) {
*
* Once retrieved, the name is stored into sysinfo->p->arch.
*/
-void sysinfo_arch_retrieve(void) {
+void sysinfo_arch_retrieve(void)
+{
SYSTEM_INFO si;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
@@ -730,7 +710,8 @@ void sysinfo_arch_retrieve(void) {
*
* Once retrieved, the value is stored in sysinfo->p->vcsrevision_src.
*/
-void sysinfo_vcsrevision_src_retrieve(void) {
+void sysinfo_vcsrevision_src_retrieve(void)
+{
if (sysinfo->p->vcsrevision_src != NULL) {
aFree(sysinfo->p->vcsrevision_src);
sysinfo->p->vcsrevision_src = NULL;
@@ -754,7 +735,8 @@ void sysinfo_vcsrevision_src_retrieve(void) {
*
* Once retrieved, the value is stored in sysinfo->p->vcstype_name.
*/
-void sysinfo_vcstype_name_retrieve(void) {
+void sysinfo_vcstype_name_retrieve(void)
+{
if (sysinfo->p->vcstype_name != NULL) {
aFree(sysinfo->p->vcstype_name);
sysinfo->p->vcstype_name = NULL;
@@ -783,7 +765,8 @@ void sysinfo_vcstype_name_retrieve(void) {
*
* Output example: "Linux", "Darwin", "Windows", etc.
*/
-const char *sysinfo_platform(void) {
+const char *sysinfo_platform(void)
+{
return sysinfo->p->platform;
}
@@ -801,7 +784,8 @@ const char *sysinfo_platform(void) {
* Output example: "Windows 2008 Small Business Server", "OS X 10.8 Mountain Lion",
* "Gentoo Base System Release 2.2", "Debian GNU/Linux 6.0.6 (squeeze)", etc.
*/
-const char *sysinfo_osversion(void) {
+const char *sysinfo_osversion(void)
+{
return sysinfo->p->osversion;
}
@@ -820,7 +804,8 @@ const char *sysinfo_osversion(void) {
* "Intel(R) Xeon(R) CPU E5-1650 0 @ 3.20GHz", "Intel Core i7",
* "x86 CPU, Family 6, Model 54, Stepping 1", etc.
*/
-const char *sysinfo_cpu(void) {
+const char *sysinfo_cpu(void)
+{
return sysinfo->p->cpu;
}
@@ -833,7 +818,8 @@ const char *sysinfo_cpu(void) {
*
* @return the number of CPU cores.
*/
-int sysinfo_cpucores(void) {
+int sysinfo_cpucores(void)
+{
return sysinfo->p->cpucores;
}
@@ -850,7 +836,8 @@ int sysinfo_cpucores(void) {
*
* Output example: "x86", "x86_64", "IA-64", "ARM", etc.
*/
-const char *sysinfo_arch(void) {
+const char *sysinfo_arch(void)
+{
return sysinfo->p->arch;
}
@@ -860,7 +847,8 @@ const char *sysinfo_arch(void) {
* @retval true if this is a 64 bit build.
* @retval false if this isn't a 64 bit build (i.e. it is a 32 bit build).
*/
-bool sysinfo_is64bit(void) {
+bool sysinfo_is64bit(void)
+{
#ifdef _LP64
return true;
#else
@@ -878,7 +866,8 @@ bool sysinfo_is64bit(void) {
* Output example: "Microsoft Visual C++ 2012 (v170050727)",
* "Clang v5.0.0", "MinGW32 v3.20", "GCC v4.7.3", etc.
*/
-const char *sysinfo_compiler(void) {
+const char *sysinfo_compiler(void)
+{
return sysinfo->p->compiler;
}
@@ -893,7 +882,8 @@ const char *sysinfo_compiler(void) {
*
* Output example: "-ggdb -O2 -flto -pipe -ffast-math ..."
*/
-const char *sysinfo_cflags(void) {
+const char *sysinfo_cflags(void)
+{
return sysinfo->p->cflags;
}
@@ -908,7 +898,8 @@ const char *sysinfo_cflags(void) {
*
* @see VCSTYPE_NONE, VCSTYPE_GIT, VCSTYPE_SVN, VCSTYPE_UNKNOWN
*/
-int sysinfo_vcstypeid(void) {
+int sysinfo_vcstypeid(void)
+{
return sysinfo->p->vcstype;
}
@@ -925,7 +916,8 @@ int sysinfo_vcstypeid(void) {
*
* Output example: "Git", "SVN", "Exported"
*/
-const char *sysinfo_vcstype(void) {
+const char *sysinfo_vcstype(void)
+{
return sysinfo->p->vcstype_name;
}
@@ -943,7 +935,8 @@ const char *sysinfo_vcstype(void) {
*
* Output example: Git: "9128feccf3bddda94a7f8a170305565416815b40", SVN: "17546"
*/
-const char *sysinfo_vcsrevision_src(void) {
+const char *sysinfo_vcsrevision_src(void)
+{
return sysinfo->p->vcsrevision_src;
}
@@ -959,7 +952,8 @@ const char *sysinfo_vcsrevision_src(void) {
*
* Output example: Git: "9128feccf3bddda94a7f8a170305565416815b40", SVN: "17546"
*/
-const char *sysinfo_vcsrevision_scripts(void) {
+const char *sysinfo_vcsrevision_scripts(void)
+{
return sysinfo->p->vcsrevision_scripts;
}
@@ -967,7 +961,8 @@ const char *sysinfo_vcsrevision_scripts(void) {
* Reloads the run-time (scripts) VCS revision information. To be used during
* script reloads to refresh the cached version.
*/
-void sysinfo_vcsrevision_reload(void) {
+void sysinfo_vcsrevision_reload(void)
+{
if (sysinfo->p->vcsrevision_scripts != NULL) {
aFree(sysinfo->p->vcsrevision_scripts);
sysinfo->p->vcsrevision_scripts = NULL;
@@ -989,7 +984,8 @@ void sysinfo_vcsrevision_reload(void) {
* @retval false if the current process is running as regular user, or
* in any case under Windows.
*/
-bool sysinfo_is_superuser(void) {
+bool sysinfo_is_superuser(void)
+{
#ifndef _WIN32
if (geteuid() == 0)
return true;
@@ -1000,7 +996,8 @@ bool sysinfo_is_superuser(void) {
/**
* Interface runtime initialization.
*/
-void sysinfo_init(void) {
+void sysinfo_init(void)
+{
sysinfo->p->compiler = SYSINFO_COMPILER;
#ifdef WIN32
sysinfo->p->platform = "Windows";
@@ -1026,7 +1023,8 @@ void sysinfo_init(void) {
/**
* Interface shutdown cleanup.
*/
-void sysinfo_final(void) {
+void sysinfo_final(void)
+{
#ifdef WIN32
// Only need to be free'd in win32, they're #defined elsewhere
if (sysinfo->p->osversion)
@@ -1052,10 +1050,24 @@ void sysinfo_final(void) {
sysinfo->p->vcstype_name = NULL;
}
+static const char *sysinfo_time(void)
+{
+#if defined(WIN32)
+ return "ticks count";
+#elif defined(ENABLE_RDTSC)
+ return "rdtsc";
+#elif defined(HAVE_MONOTONIC_CLOCK)
+ return "monotonic clock";
+#else
+ return "time of day";
+#endif
+}
+
/**
* Interface default values initialization.
*/
-void sysinfo_defaults(void) {
+void sysinfo_defaults(void)
+{
sysinfo = &sysinfo_s;
memset(&sysinfo_p, '\0', sizeof(sysinfo_p));
sysinfo->p = &sysinfo_p;
@@ -1072,6 +1084,7 @@ void sysinfo_defaults(void) {
sysinfo->is64bit = sysinfo_is64bit;
sysinfo->compiler = sysinfo_compiler;
sysinfo->cflags = sysinfo_cflags;
+ sysinfo->time = sysinfo_time;
sysinfo->vcstype = sysinfo_vcstype;
sysinfo->vcstypeid = sysinfo_vcstypeid;
sysinfo->vcsrevision_src = sysinfo_vcsrevision_src;
diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h
index 904be832f..2a391bfa4 100644
--- a/src/common/sysinfo.h
+++ b/src/common/sysinfo.h
@@ -52,6 +52,7 @@ struct sysinfo_interface {
bool (*is64bit) (void);
const char *(*compiler) (void);
const char *(*cflags) (void);
+ const char *(*time) (void);
const char *(*vcstype) (void);
int (*vcstypeid) (void);
const char *(*vcsrevision_src) (void);
diff --git a/src/common/thread.c b/src/common/thread.c
index 6012791e2..aaafab943 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) rAthena Project (www.rathena.org)
*
* Hercules is free software: you can redistribute it and/or modify
@@ -20,10 +20,6 @@
*/
#define HERCULES_CORE
-// Basic Threading abstraction (for pthread / win32 based systems)
-//
-// Author: Florian Wilkemeyer <fw@f-ws.de>
-
#include "thread.h"
#include "common/cbasetypes.h"
@@ -48,13 +44,22 @@
#define HAS_TLS
#endif
-#define RA_THREADS_MAX 64
+/** @file
+ * Thread interface implementation.
+ * @author Florian Wilkemeyer <fw@f-ws.de>
+ */
+
+struct thread_interface thread_s;
+struct thread_interface *thread;
-struct rAthread {
+/// The maximum amount of threads.
+#define THREADS_MAX 64
+
+struct thread_handle {
unsigned int myID;
- RATHREAD_PRIO prio;
- rAthreadProc proc;
+ enum thread_priority prio;
+ threadFunc proc;
void *param;
#ifdef WIN32
@@ -68,16 +73,17 @@ struct rAthread {
__thread int g_rathread_ID = -1;
#endif
-///
-/// Subystem Code
-///
-static struct rAthread l_threads[RA_THREADS_MAX];
+// Subystem Code
+
+static struct thread_handle l_threads[THREADS_MAX];
-void rathread_init(void) {
- register unsigned int i;
- memset(&l_threads, 0x00, RA_THREADS_MAX * sizeof(struct rAthread) );
+/// @copydoc thread_interface::init()
+void thread_init(void)
+{
+ register int i;
+ memset(&l_threads, 0x00, THREADS_MAX * sizeof(struct thread_handle));
- for(i = 0; i < RA_THREADS_MAX; i++){
+ for (i = 0; i < THREADS_MAX; i++) {
l_threads[i].myID = i;
}
@@ -85,46 +91,53 @@ void rathread_init(void) {
#ifdef HAS_TLS
g_rathread_ID = 0;
#endif
- l_threads[0].prio = RAT_PRIO_NORMAL;
- l_threads[0].proc = (rAthreadProc)0xDEADCAFE;
+ l_threads[0].prio = THREADPRIO_NORMAL;
+ l_threads[0].proc = (threadFunc)0xDEADCAFE;
-}//end: rathread_init()
+}
-void rathread_final(void) {
- register unsigned int i;
+/// @copydoc thread_interface::final()
+void thread_final(void)
+{
+ register int i;
// Unterminated Threads Left?
- // Shouldn't happen ..
- // Kill 'em all!
- //
- for(i = 1; i < RA_THREADS_MAX; i++){
- if(l_threads[i].proc != NULL){
- ShowWarning("rAthread_final: unterminated Thread (tid %u entryPoint %p) - forcing to terminate (kill)\n", i, l_threads[i].proc);
- rathread_destroy(&l_threads[i]);
+ // Shouldn't happen ... Kill 'em all!
+ for (i = 1; i < THREADS_MAX; i++) {
+ if (l_threads[i].proc != NULL){
+ ShowWarning("thread_final: unterminated Thread (tid %d entry_point %p) - forcing to terminate (kill)\n", i, l_threads[i].proc);
+ thread->destroy(&l_threads[i]);
}
}
+}
-}//end: rathread_final()
-
-// gets called whenever a thread terminated ..
-static void rat_thread_terminated(rAthread *handle) {
+/**
+ * Gets called whenever a thread terminated.
+ *
+ * @param handle The terminated thread's handle.
+ */
+static void thread_terminated(struct thread_handle *handle)
+{
// Preserve handle->myID and handle->hThread, set everything else to its default value
handle->param = NULL;
handle->proc = NULL;
- handle->prio = RAT_PRIO_NORMAL;
-}//end: rat_thread_terminated()
+ handle->prio = THREADPRIO_NORMAL;
+}
#ifdef WIN32
-DWORD WINAPI raThreadMainRedirector(LPVOID p){
+DWORD WINAPI thread_main_redirector(LPVOID p)
+{
#else
-static void *raThreadMainRedirector( void *p ){
+static void *thread_main_redirector(void *p)
+{
sigset_t set; // on Posix Thread platforms
#endif
void *ret;
+ struct thread_handle *self = p;
// Update myID @ TLS to right id.
#ifdef HAS_TLS
- g_rathread_ID = ((rAthread*)p)->myID;
+ g_rathread_ID = self->myID;
#endif
#ifndef WIN32
@@ -138,66 +151,68 @@ static void *raThreadMainRedirector( void *p ){
(void)sigaddset(&set, SIGPIPE);
pthread_sigmask(SIG_BLOCK, &set, NULL);
-
#endif
- ret = ((rAthread*)p)->proc( ((rAthread*)p)->param ) ;
+ ret = self->proc(self->param);
#ifdef WIN32
- CloseHandle( ((rAthread*)p)->hThread );
+ CloseHandle(self->hThread);
#endif
- rat_thread_terminated( (rAthread*)p );
+ thread_terminated(self);
#ifdef WIN32
return (DWORD)ret;
#else
return ret;
#endif
-}//end: raThreadMainRedirector()
+}
+
+// API Level
-///
-/// API Level
-///
-rAthread *rathread_create(rAthreadProc entryPoint, void *param) {
- return rathread_createEx( entryPoint, param, (1<<23) /*8MB*/, RAT_PRIO_NORMAL );
-}//end: rathread_create()
+/// @copydoc thread_interface::create()
+struct thread_handle *thread_create(threadFunc entry_point, void *param)
+{
+ return thread->create_opt(entry_point, param, (1<<23) /*8MB*/, THREADPRIO_NORMAL);
+}
-rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio) {
+/// @copydoc thread_interface::create_opt()
+struct thread_handle *thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio)
+{
#ifndef WIN32
pthread_attr_t attr;
#endif
size_t tmp;
- unsigned int i;
- rAthread *handle = NULL;
+ int i;
+ struct thread_handle *handle = NULL;
// given stacksize aligned to systems pagesize?
- tmp = szStack % sysinfo->getpagesize();
- if(tmp != 0)
- szStack += tmp;
+ tmp = stack_size % sysinfo->getpagesize();
+ if (tmp != 0)
+ stack_size += tmp;
// Get a free Thread Slot.
- for(i = 0; i < RA_THREADS_MAX; i++){
+ for (i = 0; i < THREADS_MAX; i++) {
if(l_threads[i].proc == NULL){
handle = &l_threads[i];
break;
}
}
- if(handle == NULL){
- ShowError("rAthread: cannot create new thread (entryPoint: %p) - no free thread slot found!", entryPoint);
+ if (handle == NULL) {
+ ShowError("thread_create_opt: cannot create new thread (entry_point: %p) - no free thread slot found!", entry_point);
return NULL;
}
- handle->proc = entryPoint;
+ handle->proc = entry_point;
handle->param = param;
#ifdef WIN32
- handle->hThread = CreateThread(NULL, szStack, raThreadMainRedirector, (void*)handle, 0, NULL);
+ handle->hThread = CreateThread(NULL, stack_size, thread_main_redirector, handle, 0, NULL);
#else
pthread_attr_init(&attr);
- pthread_attr_setstacksize(&attr, szStack);
+ pthread_attr_setstacksize(&attr, stack_size);
- if(pthread_create(&handle->hThread, &attr, raThreadMainRedirector, (void*)handle) != 0){
+ if (pthread_create(&handle->hThread, &attr, thread_main_redirector, handle) != 0) {
handle->proc = NULL;
handle->param = NULL;
return NULL;
@@ -205,99 +220,122 @@ rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack
pthread_attr_destroy(&attr);
#endif
- rathread_prio_set( handle, prio );
+ thread->prio_set(handle, prio);
return handle;
-}//end: rathread_createEx
+}
-void rathread_destroy(rAthread *handle) {
+/// @copydoc thread_interface::destroy()
+void thread_destroy(struct thread_handle *handle)
+{
#ifdef WIN32
- if( TerminateThread(handle->hThread, 0) != FALSE){
+ if (TerminateThread(handle->hThread, 0) != FALSE) {
CloseHandle(handle->hThread);
- rat_thread_terminated(handle);
+ thread_terminated(handle);
}
#else
- if( pthread_cancel( handle->hThread ) == 0){
+ if (pthread_cancel(handle->hThread) == 0) {
// We have to join it, otherwise pthread wont re-cycle its internal resources assoc. with this thread.
- pthread_join( handle->hThread, NULL );
+ pthread_join(handle->hThread, NULL);
// Tell our manager to release resources ;)
- rat_thread_terminated(handle);
+ thread_terminated(handle);
}
#endif
-}//end: rathread_destroy()
+}
-rAthread *rathread_self(void) {
+struct thread_handle *thread_self(void)
+{
#ifdef HAS_TLS
- rAthread *handle = &l_threads[g_rathread_ID];
+ struct thread_handle *handle = &l_threads[g_rathread_ID];
- if(handle->proc != NULL) // entry point set, so its used!
+ if (handle->proc != NULL) // entry point set, so its used!
return handle;
#else
// .. so no tls means we have to search the thread by its api-handle ..
int i;
- #ifdef WIN32
- HANDLE hSelf;
- hSelf = GetCurrent = GetCurrentThread();
- #else
- pthread_t hSelf;
- hSelf = pthread_self();
- #endif
+#ifdef WIN32
+ HANDLE hSelf;
+ hSelf = GetCurrent = GetCurrentThread();
+#else
+ pthread_t hSelf;
+ hSelf = pthread_self();
+#endif
- for(i = 0; i < RA_THREADS_MAX; i++){
- if(l_threads[i].hThread == hSelf && l_threads[i].proc != NULL)
+ for (i = 0; i < THREADS_MAX; i++) {
+ if (l_threads[i].hThread == hSelf && l_threads[i].proc != NULL)
return &l_threads[i];
}
#endif
return NULL;
-}//end: rathread_self()
+}
-int rathread_get_tid(void) {
-
-#ifdef HAS_TLS
+/// @copydoc thread_interface::get_tid()
+int thread_get_tid(void)
+{
+#if defined(HAS_TLS)
return g_rathread_ID;
+#elif defined(WIN32)
+ return (int)GetCurrentThreadId();
#else
- // TODO
- #ifdef WIN32
- return (int)GetCurrentThreadId();
- #else
- return (intptr_t)pthread_self();
- #endif
+ return (int)pthread_self();
#endif
+}
-}//end: rathread_get_tid()
-
-bool rathread_wait(rAthread *handle, void **out_exitCode) {
+/// @copydoc thread_interface::wait()
+bool thread_wait(struct thread_handle *handle, void **out_exit_code)
+{
// Hint:
// no thread data cleanup routine call here!
// its managed by the callProxy itself..
- //
#ifdef WIN32
WaitForSingleObject(handle->hThread, INFINITE);
return true;
#else
- if(pthread_join(handle->hThread, out_exitCode) == 0)
+ if (pthread_join(handle->hThread, out_exit_code) == 0)
return true;
return false;
#endif
-}//end: rathread_wait()
+}
-void rathread_prio_set(rAthread *handle, RATHREAD_PRIO prio) {
- handle->prio = RAT_PRIO_NORMAL;
+/// @copydoc thread_interface::prio_set()
+void thread_prio_set(struct thread_handle *handle, enum thread_priority prio)
+{
+ handle->prio = THREADPRIO_NORMAL;
//@TODO
-}//end: rathread_prio_set()
+}
-RATHREAD_PRIO rathread_prio_get(rAthread *handle) {
+/// @copydoc thread_interface::prio_get()
+enum thread_priority thread_prio_get(struct thread_handle *handle)
+{
return handle->prio;
-}//end: rathread_prio_get()
+}
-void rathread_yield(void) {
+/// @copydoc thread_interface::yield()
+void thread_yield(void) {
#ifdef WIN32
SwitchToThread();
#else
sched_yield();
#endif
-}//end: rathread_yield()
+}
+
+/// Interface base initialization.
+void thread_defaults(void)
+{
+ thread = &thread_s;
+ thread->init = thread_init;
+ thread->final = thread_final;
+ thread->create = thread_create;
+ thread->create_opt = thread_create_opt;
+ thread->destroy = thread_destroy;
+ thread->self = thread_self;
+ thread->get_tid = thread_get_tid;
+ thread->wait = thread_wait;
+ thread->prio_set = thread_prio_set;
+ thread->prio_get = thread_prio_get;
+ thread->yield = thread_yield;
+}
diff --git a/src/common/thread.h b/src/common/thread.h
index 261735306..c668afbb4 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) rAthena Project (www.rathena.org)
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,114 +21,136 @@
#ifndef COMMON_THREAD_H
#define COMMON_THREAD_H
-#include "common/cbasetypes.h"
+#include "common/hercules.h"
-typedef struct rAthread rAthread;
-typedef void* (*rAthreadProc)(void*);
-
-typedef enum RATHREAD_PRIO {
- RAT_PRIO_LOW = 0,
- RAT_PRIO_NORMAL,
- RAT_PRIO_HIGH
-} RATHREAD_PRIO;
-
-
-#ifdef HERCULES_CORE
-/**
- * Creates a new Thread
- *
- * @param entyPoint - entryProc,
- * @param param - general purpose parameter, would be given as parameter to the thread's entry point.
- *
- * @return not NULL if success
+/** @file
+ * Basic Threading abstraction (for pthread / win32 based systems).
*/
-rAthread *rathread_create(rAthreadProc entryPoint, void *param);
+/* Opaque Types */
+struct thread_handle; ///< Thread handle.
+typedef void *(*threadFunc)(void *); ///< Thread entry point function.
+
+/* Enums */
+
+/// Thread priority
+enum thread_priority {
+ THREADPRIO_LOW = 0,
+ THREADPRIO_NORMAL,
+ THREADPRIO_HIGH
+};
+
+/// The thread interface
+struct thread_interface {
+ /// Interface initialization.
+ void (*init) (void);
+
+ /// Interface finalization.
+ void (*final) (void);
+
+ /**
+ * Creates a new Thread.
+ *
+ * @param enty_point Thread's entry point.
+ * @param param General purpose parameter, would be given as
+ * parameter to the thread's entry point.
+ *
+ * @return The created thread object.
+ * @retval NULL in vase of failure.
+ */
+ struct thread_handle *(*create) (threadFunc entry_point, void *param);
+
+ /**
+ * Creates a new Thread (with more creation options).
+ *
+ * @param enty_point Thread's entry point.
+ * @param param General purpose parameter, would be given as
+ * parameter to the thread's entry point.
+ * @param stack_size Stack Size in bytes.
+ * @param prio Priority of the Thread in the OS scheduler.
+ *
+ * @return The created thread object.
+ * @retval NULL in case of failure.
+ */
+ struct thread_handle *(*create_opt) (threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio);
+
+ /**
+ * Destroys the given Thread immediately.
+ *
+ * @remark
+ * The Handle gets invalid after call! don't use it afterwards.
+ *
+ * @param handle The thread to destroy.
+ */
+ void (*destroy) (struct thread_handle *handle);
+
+ /**
+ * Returns the thread handle of the thread calling this function.
+ *
+ * @remark
+ * This won't work in the program's main thread.
+ *
+ * @warning
+ * The underlying implementation might not perform very well, cache
+ * the value received!
+ *
+ * @return the thread handle.
+ * @retval NULL in case of failure.
+ */
+ struct thread_handle *(*self) (void);
+
+ /**
+ * Returns own thread id (TID).
+ *
+ * @remark
+ * This is an unique identifier for the calling thread, and depends
+ * on platform/ compiler, and may not be the systems Thread ID!
+ *
+ * @return the thread ID.
+ * @retval -1 in case of failure.
+ */
+ int (*get_tid) (void);
+
+ /**
+ * Waits for the given thread to terminate.
+ *
+ * @param[in] handle The thread to wait (join) for.
+ * @param[out] out_exit_code Pointer to return the exit code of the
+ * given thread after termination (optional).
+ *
+ * @retval true if the given thread has been terminated.
+ */
+ bool (*wait) (struct thread_handle *handle, void **out_exit_code);
+
+ /**
+ * Sets the given priority in the OS scheduler.
+ *
+ * @param handle The thread to set the priority for.
+ * @param prio The priority to set (@see enum thread_priority).
+ */
+ void (*prio_set) (struct thread_handle *handle, enum thread_priority prio);
+
+ /**
+ * Gets the current priority of the given thread.
+ *
+ * @param handle The thread to get the priority for.
+ */
+ enum thread_priority (*prio_get) (struct thread_handle *handle);
+
+ /**
+ * Tells the OS scheduler to yield the execution of the calling thread.
+ *
+ * @remark
+ * This will not "pause" the thread, it just allows the OS to spend
+ * the remaining time of the slice to another thread.
+ */
+ void (*yield) (void);
+};
-/**
- * Creates a new Thread (with more creation options)
- *
- * @param entyPoint - entryProc,
- * @param param - general purpose parameter, would be given as parameter to the thread's entry point
- * @param szStack - stack Size in bytes
- * @param prio - Priority of the Thread @ OS Scheduler..
- *
- * @return not NULL if success
- */
-rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio);
-
-
-/**
- * Destroys the given Thread immediately
- *
- * @note The Handle gets invalid after call! don't use it afterwards.
- *
- * @param handle - thread to destroy.
- */
-void rathread_destroy(rAthread *handle);
-
-
-/**
- * Returns the thread handle of the thread calling this function
- *
- * @note this wont work @ programs main thread
- * @note the underlying implementation might not perform very well, cache the value received!
- *
- * @return not NULL if success
- */
-rAthread *rathread_self(void);
-
-
-/**
- * Returns own thread id (TID)
- *
- * @note this is an unique identifier for the calling thread, and
- * depends on platform/ compiler, and may not be the systems Thread ID!
- *
- * @return -1 when fails, otherwise >= 0
- */
-int rathread_get_tid(void);
-
-
-/**
- * Waits for the given thread to terminate
- *
- * @param handle - thread to wait (join) for
- * @param out_Exitcode - [OPTIONAL] - if given => Exitcode (value) of the given thread - if it's terminated
- *
- * @return true - if the given thread has been terminated.
- */
-bool rathread_wait(rAthread *handle, void **out_exitCode);
-
-
-/**
- * Sets the given PRIORITY @ OS Task Scheduler
- *
- * @param handle - thread to set prio for
- * @param rio - the priority (RAT_PRIO_LOW ... )
- */
-void rathread_prio_set(rAthread *handle, RATHREAD_PRIO prio);
-
-
-/**
- * Gets the current Prio of the given thread
- *
- * @param handle - the thread to get the prio for.
- */
-RATHREAD_PRIO rathread_prio_get(rAthread *handle);
-
-
-/**
- * Tells the OS scheduler to yield the execution of the calling thread
- *
- * @note: this will not "pause" the thread,
- * it just allows the OS to spend the remaining time
- * of the slice to another thread.
- */
-void rathread_yield(void);
-
-void rathread_init(void);
-void rathread_final(void);
+#ifdef HERCULES_CORE
+void thread_defaults(void);
#endif // HERCULES_CORE
+HPShared struct thread_interface *thread; ///< Pointer to the thread interface.
+
#endif /* COMMON_THREAD_H */
diff --git a/src/common/timer.c b/src/common/timer.c
index 7f71157ae..4f2b86a32 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,6 +25,7 @@
#include "common/cbasetypes.h"
#include "common/db.h"
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/utils.h"
@@ -50,7 +51,7 @@ struct timer_interface *timer;
// timers (array)
static struct TimerData* timer_data = NULL;
static int timer_data_max = 0;
-static int timer_data_num = 0;
+static int timer_data_num = 1;
// free timers (array)
static int* free_timer_list = NULL;
@@ -87,6 +88,8 @@ struct timer_func_list {
int timer_add_func_list(TimerFunc func, char* name) {
struct timer_func_list* tfl;
+ nullpo_ret(func);
+ nullpo_ret(name);
if (name) {
for( tfl=tfl_root; tfl != NULL; tfl=tfl->next )
{// check suspicious cases
@@ -255,10 +258,6 @@ int64 timer_gettick(void) {
/// Adds a timer to the timer_heap
static void push_timer_heap(int tid) {
BHEAP_ENSURE(timer_heap, 1, 256);
-#ifdef __clang_analyzer__ // Clang's static analyzer warns that BHEAP_ENSURE might set BHEAP_DATA(timer_heap) to NULL.
-#include "assert.h"
- assert(BHEAP_DATA(timer_heap) != NULL);
-#endif // __clang_analyzer__
BHEAP_PUSH(timer_heap, tid, DIFFTICK_MINTOPCMP, swap);
}
@@ -303,7 +302,19 @@ static int acquire_timer(void) {
int timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int tid;
+ nullpo_retr(INVALID_TIMER, func);
+
tid = acquire_timer();
+ if (timer_data[tid].type != 0 && timer_data[tid].type != TIMER_REMOVE_HEAP)
+ {
+ ShowError("timer_add error: wrong tid type: %d, [%d]%p(%s) -> %p(%s)\n", timer_data[tid].type, tid, func, search_timer_func_list(func), timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(INVALID_TIMER, 0);
+ }
+ if (timer_data[tid].func != NULL)
+ {
+ ShowError("timer_add error: func non NULL: [%d]%p(%s) -> %p(%s)\n", tid, func, search_timer_func_list(func), timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(INVALID_TIMER, 0);
+ }
timer_data[tid].tick = tick;
timer_data[tid].func = func;
timer_data[tid].id = id;
@@ -317,9 +328,11 @@ int timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
/// Starts a new timer that automatically restarts itself (infinite loop until manually removed).
/// Returns the timer's id, or INVALID_TIMER if it fails.
-int timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int interval) {
+int timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int interval)
+{
int tid;
+ nullpo_retr(INVALID_TIMER, func);
if (interval < 1) {
ShowError("timer_add_interval: invalid interval (tick=%"PRId64" %p[%s] id=%d data=%"PRIdPTR" diff_tick=%"PRId64")\n",
tick, func, search_timer_func_list(func), id, data, DIFF_TICK(tick, timer->gettick()));
@@ -327,6 +340,18 @@ int timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int in
}
tid = acquire_timer();
+ if (timer_data[tid].type != 0 && timer_data[tid].type != TIMER_REMOVE_HEAP)
+ {
+ ShowError("timer_add_interval: wrong tid type: %d, [%d]%p(%s) -> %p(%s)\n", timer_data[tid].type, tid, func, search_timer_func_list(func), timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(INVALID_TIMER, 0);
+ return INVALID_TIMER;
+ }
+ if (timer_data[tid].func != NULL)
+ {
+ ShowError("timer_add_interval: func non NULL: [%d]%p(%s) -> %p(%s)\n", tid, func, search_timer_func_list(func), timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(INVALID_TIMER, 0);
+ return INVALID_TIMER;
+ }
timer_data[tid].tick = tick;
timer_data[tid].func = func;
timer_data[tid].id = id;
@@ -340,22 +365,35 @@ int timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int in
/// Retrieves internal timer data
const struct TimerData* timer_get(int tid) {
+ Assert_retr(NULL, tid > 0);
return ( tid >= 0 && tid < timer_data_num ) ? &timer_data[tid] : NULL;
}
/// Marks a timer specified by 'id' for immediate deletion once it expires.
/// Param 'func' is used for debug/verification purposes.
/// Returns 0 on success, < 0 on failure.
-int timer_do_delete(int tid, TimerFunc func) {
- if( tid < 0 || tid >= timer_data_num ) {
- ShowError("timer_do_delete error : no such timer %d (%p(%s))\n", tid, func, search_timer_func_list(func));
+int timer_do_delete(int tid, TimerFunc func)
+{
+ nullpo_ret(func);
+
+ if (tid < 1 || tid >= timer_data_num) {
+ ShowError("timer_do_delete error : no such timer [%d](%p(%s))\n", tid, func, search_timer_func_list(func));
+ Assert_retr(-1, 0);
return -1;
}
if( timer_data[tid].func != func ) {
- ShowError("timer_do_delete error : function mismatch %p(%s) != %p(%s)\n", timer_data[tid].func, search_timer_func_list(timer_data[tid].func), func, search_timer_func_list(func));
+ ShowError("timer_do_delete error : function mismatch [%d]%p(%s) != %p(%s)\n", tid, timer_data[tid].func, search_timer_func_list(timer_data[tid].func), func, search_timer_func_list(func));
+ Assert_retr(-2, 0);
return -2;
}
+ if (timer_data[tid].type == 0 || timer_data[tid].type == TIMER_REMOVE_HEAP)
+ {
+ ShowError("timer_do_delete: timer already deleted: %d, [%d]%p(%s) -> %p(%s)\n", timer_data[tid].type, tid, func, search_timer_func_list(func), func, search_timer_func_list(func));
+ Assert_retr(-3, 0);
+ return -3;
+ }
+
timer_data[tid].func = NULL;
timer_data[tid].type = TIMER_ONCE_AUTODEL;
@@ -365,6 +403,11 @@ int timer_do_delete(int tid, TimerFunc func) {
/// Adjusts a timer's expiration time.
/// Returns the new tick value, or -1 if it fails.
int64 timer_addtick(int tid, int64 tick) {
+ if (tid < 1 || tid >= timer_data_num) {
+ ShowError("timer_addtick error : no such timer [%d]\n", tid);
+ Assert_retr(-1, 0);
+ return -1;
+ }
return timer->settick(tid, timer_data[tid].tick+tick);
}
@@ -383,7 +426,19 @@ int64 timer_settick(int tid, int64 tick)
// search timer position
ARR_FIND(0, BHEAP_LENGTH(timer_heap), i, BHEAP_DATA(timer_heap)[i] == tid);
if (i == BHEAP_LENGTH(timer_heap)) {
- ShowError("timer_settick: no such timer %d (%p(%s))\n", tid, timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ ShowError("timer_settick: no such timer [%d](%p(%s))\n", tid, timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(-1, 0);
+ return -1;
+ }
+
+ if (timer_data[tid].type == 0 || timer_data[tid].type == TIMER_REMOVE_HEAP) {
+ ShowError("timer_settick error: set tick for deleted timer %d, [%d](%p(%s))\n", timer_data[tid].type, tid, timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(-1, 0);
+ return -1;
+ }
+ if (timer_data[tid].func == NULL) {
+ ShowError("timer_settick error: set tick for timer with wrong func [%d](%p(%s))\n", tid, timer_data[tid].func, search_timer_func_list(timer_data[tid].func));
+ Assert_retr(-1, 0);
return -1;
}
@@ -438,6 +493,7 @@ int do_timer(int64 tick)
default:
case TIMER_ONCE_AUTODEL:
timer_data[tid].type = 0;
+ timer_data[tid].func = NULL;
if (free_timer_list_pos >= free_timer_list_max) {
free_timer_list_max += 256;
RECREATE(free_timer_list,int,free_timer_list_max);
diff --git a/src/common/timer.h b/src/common/timer.h
index 2161f5e31..88c891dff 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/common/utils.c b/src/common/utils.c
index 73df3aae1..bcfc153e3 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -54,6 +54,9 @@ void WriteDump(FILE* fp, const void* buffer, size_t length)
size_t i;
char hex[48+1], ascii[16+1];
+ nullpo_retv(fp);
+ nullpo_retv(buffer);
+
fprintf(fp, "--- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF\n");
ascii[16] = 0;
@@ -78,10 +81,12 @@ void WriteDump(FILE* fp, const void* buffer, size_t length)
}
/// Dumps given buffer on the console.
-void ShowDump(const void *buffer, size_t length) {
+void ShowDump(const void *buffer, size_t length)
+{
size_t i;
char hex[48+1], ascii[16+1];
+ nullpo_retv(buffer);
ShowDebug("--- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F 0123456789ABCDEF\n");
ascii[16] = 0;
@@ -108,6 +113,7 @@ static char* checkpath(char *path, const char *srcpath)
{
// just make sure the char*path is not const
char *p = path;
+
if (NULL == path || NULL == srcpath)
return path;
while(*srcpath) {
@@ -400,7 +406,9 @@ int apply_percentrate(int value, int rate, int maxrate)
//-----------------------------------------------------
const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format)
{
- size_t len = strftime(str, size, format, localtime(&timestamp));
+ size_t len;
+ nullpo_retr(NULL, str);
+ len = strftime(str, size, format, localtime(&timestamp));
memset(str + len, '\0', size - len);
return str;
}
@@ -413,6 +421,7 @@ bool HCache_check(const char *file)
char s_path[255], dT[1];
time_t rtime;
+ nullpo_retr(false, file);
if (!(first = fopen(file,"rb")))
return false;
@@ -456,10 +465,14 @@ bool HCache_check(const char *file)
return true;
}
-FILE *HCache_open(const char *file, const char *opt) {
+FILE *HCache_open(const char *file, const char *opt)
+{
FILE *first;
char s_path[255];
+ nullpo_retr(NULL, file);
+ nullpo_retr(NULL, opt);
+
if( file[0] == '.' && file[1] == '/' )
file += 2;
else if( file[0] == '.' )
@@ -498,15 +511,19 @@ void HCache_init(void)
}
/* transit to fread, shields vs warn_unused_result */
-size_t hread(void * ptr, size_t size, size_t count, FILE * stream) {
+size_t hread(void *ptr, size_t size, size_t count, FILE *stream)
+{
return fread(ptr, size, count, stream);
}
+
/* transit to fwrite, shields vs warn_unused_result */
-size_t hwrite(const void * ptr, size_t size, size_t count, FILE * stream) {
+size_t hwrite(const void *ptr, size_t size, size_t count, FILE *stream)
+{
return fwrite(ptr, size, count, stream);
}
-void HCache_defaults(void) {
+void HCache_defaults(void)
+{
HCache = &HCache_s;
HCache->init = HCache_init;
diff --git a/src/common/utils.h b/src/common/utils.h
index 3f181ef12..9d3c323ef 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -24,6 +24,9 @@
#include "common/hercules.h"
#include <stdio.h> // FILE*
+#ifndef WIN32
+# include <unistd.h> // sleep()
+#endif
/* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */
#define HCACHE_KEY 'k'
diff --git a/src/common/winapi.h b/src/common/winapi.h
index 724f052a0..b410e00cd 100644
--- a/src/common/winapi.h
+++ b/src/common/winapi.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/config/classes/general.h b/src/config/classes/general.h
index f1fa63179..330e6437e 100644
--- a/src/config/classes/general.h
+++ b/src/config/classes/general.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/config/const.h b/src/config/const.h
index 655f0f949..5c6b451db 100644
--- a/src/config/const.h
+++ b/src/config/const.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/config/core.h b/src/config/core.h
index 09954e0cb..bdc7f3eee 100644
--- a/src/config/core.h
+++ b/src/config/core.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -40,6 +40,17 @@
/// your map-server using more resources while this is active, comment the line
#define SCRIPT_CALLFUNC_CHECK
+/**
+ * Strip linebreaks from `mes` dialogs.
+ *
+ * Leave this line commented out to keep the hard line-breaks (`\r`) in the
+ * displayed `mes` dialogs (as in official servers).
+ * Uncomment it to strip the line-breaks and replace them with spaces, letting
+ * the client automatically wrap text in dialogs, depending on font size and
+ * dialog window size (may work better for clients using a non-standard font).
+ */
+//#define SCRIPT_MES_STRIP_LINEBREAK
+
/// Comment to disable Hercules' console_parse
/// CONSOLE_INPUT allows you to type commands into the server's console,
/// Disabling it saves one thread.
diff --git a/src/config/renewal.h b/src/config/renewal.h
index 67d216226..2b5a043d4 100644
--- a/src/config/renewal.h
+++ b/src/config/renewal.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/config/secure.h b/src/config/secure.h
index 3f1342b22..3d111be69 100644
--- a/src/config/secure.h
+++ b/src/config/secure.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/login/HPMlogin.c b/src/login/HPMlogin.c
index f12996915..b35ac13cb 100644
--- a/src/login/HPMlogin.c
+++ b/src/login/HPMlogin.c
@@ -25,6 +25,8 @@
#include "common/cbasetypes.h"
#include "login/account.h"
+#include "login/lclif.h"
+#include "login/lclif.p.h"
#include "login/login.h"
#include "common/HPMi.h"
#include "common/conf.h"
@@ -33,9 +35,12 @@
#include "common/db.h"
#include "common/des.h"
#include "common/ers.h"
+#include "common/md5calc.h"
#include "common/memmgr.h"
+#include "common/mutex.h"
#include "common/mmo.h"
#include "common/nullpo.h"
+#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h"
#include "common/spinlock.h"
diff --git a/src/login/Makefile.in b/src/login/Makefile.in
index 6560e6497..69cc6a897 100644
--- a/src/login/Makefile.in
+++ b/src/login/Makefile.in
@@ -1,7 +1,7 @@
# This file is part of Hercules.
# http://herc.ws - http://github.com/HerculesWS/Hercules
#
-# Copyright (C) 2012-2015 Hercules Dev Team
+# Copyright (C) 2012-2016 Hercules Dev Team
# Copyright (C) Athena Dev Teams
#
# Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
-COMMON_H = $(wildcard $(COMMON_D)/*.h)
+COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) ../plugins/HPMHooking.h
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
COMMON_INCLUDE = -I..
@@ -40,13 +40,14 @@ MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-LOGIN_C = account_sql.c HPMlogin.c ipban_sql.c login.c loginlog_sql.c
+LOGIN_C = account_sql.c HPMlogin.c ipban_sql.c lclif.c login.c loginlog_sql.c
LOGIN_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(LOGIN_C)))
-LOGIN_H = login.h account.h HPMlogin.h ipban.h loginlog.h
+LOGIN_H = login.h account.h HPMlogin.h ipban.h lclif.h loginlog.h
+LOGIN_PH = lclif.p.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ $(SYSINFO_INC))
+ LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC)
else
LOGIN_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -85,7 +86,7 @@ help:
Makefile: Makefile.in
@$(MAKE) -C ../.. src/login/Makefile
-$(SYSINFO_INC): $(LOGIN_C) $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
+$(SYSINFO_INC): $(LOGIN_C) $(LOGIN_PH) $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
@echo " MAKE $@"
@$(MAKE) -C ../.. sysinfo
@@ -105,14 +106,8 @@ login-server: ../../login-server@EXEEXT@
../../login-server@EXEEXT@: $(LOGIN_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
-
-# login object files
-
-obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
- @echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @STATIC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \
+ $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# missing object files
$(COMMON_D)/obj_all/common.a:
@@ -130,3 +125,11 @@ $(MT19937AR_OBJ):
$(LIBCONFIG_OBJ):
@echo " MAKE $@"
@$(MAKE) -C $(LIBCONFIG_D)
+
+.SECONDEXPANSION:
+
+# login object files
+
+obj_sql/%.o: %.c $$(filter %.p.h, $(LOGIN_PH)) $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
+ @echo " CC $<"
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
diff --git a/src/login/account.h b/src/login/account.h
index 151a2863d..9bb07fda3 100644
--- a/src/login/account.h
+++ b/src/login/account.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,12 @@
#include "common/cbasetypes.h"
#include "common/mmo.h" // ACCOUNT_REG2_NUM
-#include "common/sql.h" // Sql
+
+/* Forward declarations */
+struct Sql; // common/sql.h
+
+/* Forward Declarations */
+struct config_t; // common/conf.h
typedef struct AccountDB AccountDB;
typedef struct AccountDBIterator AccountDBIterator;
@@ -105,10 +110,9 @@ struct AccountDB
/// Sets a property in this database.
///
/// @param self Database
- /// @param key Property name
- /// @param value Property value
+ /// @param config Configuration node
/// @return true if successful
- bool (*set_property)(AccountDB* self, const char* key, const char* value);
+ bool (*set_property)(AccountDB* self, struct config_t *config, bool imported);
/// Creates a new account in this database.
/// If acc->account_id is not -1, the provided value will be used.
@@ -158,7 +162,7 @@ struct AccountDB
};
#ifdef HERCULES_CORE
-Sql *account_db_sql_up(AccountDB* self);
+struct Sql *account_db_sql_up(AccountDB* self);
void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id);
void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id);
diff --git a/src/login/account_sql.c b/src/login/account_sql.c
index 1de0fb5e9..70d4f3dfb 100644
--- a/src/login/account_sql.c
+++ b/src/login/account_sql.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -24,6 +24,7 @@
#include "account.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/console.h"
#include "common/memmgr.h"
#include "common/mmo.h"
@@ -43,16 +44,9 @@ typedef struct AccountDB_SQL
{
AccountDB vtable; // public interface
- Sql* accounts; // SQL accounts storage
+ struct Sql *accounts; // SQL accounts storage
- // global sql settings
- char global_db_hostname[32];
- uint16 global_db_port;
- char global_db_username[32];
- char global_db_password[100];
- char global_db_database[32];
- char global_codepage[32];
- // local sql settings
+ // Sql settings
char db_hostname[32];
uint16 db_port;
char db_username[32];
@@ -81,7 +75,7 @@ typedef struct AccountDBIterator_SQL
static bool account_db_sql_init(AccountDB* self);
static void account_db_sql_destroy(AccountDB* self);
static bool account_db_sql_get_property(AccountDB* self, const char* key, char* buf, size_t buflen);
-static bool account_db_sql_set_property(AccountDB* self, const char* option, const char* value);
+static bool account_db_sql_set_property(AccountDB* self, struct config_t *config, bool imported);
static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc);
static bool account_db_sql_remove(AccountDB* self, const int account_id);
static bool account_db_sql_save(AccountDB* self, const struct mmo_account* acc);
@@ -113,19 +107,12 @@ AccountDB* account_db_sql(void)
// initialize to default values
db->accounts = NULL;
- // global sql settings
- safestrncpy(db->global_db_hostname, "127.0.0.1", sizeof(db->global_db_hostname));
- db->global_db_port = 3306;
- safestrncpy(db->global_db_username, "ragnarok", sizeof(db->global_db_username));
- safestrncpy(db->global_db_password, "ragnarok", sizeof(db->global_db_password));
- safestrncpy(db->global_db_database, "ragnarok", sizeof(db->global_db_database));
- safestrncpy(db->global_codepage, "", sizeof(db->global_codepage));
- // local sql settings
- safestrncpy(db->db_hostname, "", sizeof(db->db_hostname));
+ // Sql settings
+ safestrncpy(db->db_hostname, "127.0.0.1", sizeof(db->db_hostname));
db->db_port = 3306;
- safestrncpy(db->db_username, "", sizeof(db->db_username));
- safestrncpy(db->db_password, "", sizeof(db->db_password));
- safestrncpy(db->db_database, "", sizeof(db->db_database));
+ safestrncpy(db->db_username, "ragnarok", sizeof(db->db_username));
+ safestrncpy(db->db_password, "ragnarok", sizeof(db->db_password));
+ safestrncpy(db->db_database, "ragnarok", sizeof(db->db_database));
safestrncpy(db->codepage, "", sizeof(db->codepage));
// other settings
db->case_sensitive = false;
@@ -144,46 +131,22 @@ AccountDB* account_db_sql(void)
static bool account_db_sql_init(AccountDB* self)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- Sql* sql_handle;
- const char* username;
- const char* password;
- const char* hostname;
- uint16 port;
- const char* database;
- const char* codepage;
+ struct Sql *sql_handle = NULL;
nullpo_ret(db);
+
db->accounts = SQL->Malloc();
sql_handle = db->accounts;
- if( db->db_hostname[0] != '\0' )
- {// local settings
- username = db->db_username;
- password = db->db_password;
- hostname = db->db_hostname;
- port = db->db_port;
- database = db->db_database;
- codepage = db->codepage;
- }
- else
- {// global settings
- username = db->global_db_username;
- password = db->global_db_password;
- hostname = db->global_db_hostname;
- port = db->global_db_port;
- database = db->global_db_database;
- codepage = db->global_codepage;
- }
-
- if( SQL_ERROR == SQL->Connect(sql_handle, username, password, hostname, port, database) )
- {
+ if (SQL_ERROR == SQL->Connect(sql_handle, db->db_username, db->db_password,
+ db->db_hostname, db->db_port, db->db_database)) {
Sql_ShowDebug(sql_handle);
SQL->Free(db->accounts);
db->accounts = NULL;
return false;
}
- if( codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, codepage) )
+ if (db->codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, db->codepage))
Sql_ShowDebug(sql_handle);
Sql_HerculesUpdateCheck(db->accounts);
@@ -207,6 +170,15 @@ static void account_db_sql_destroy(AccountDB* self)
/// Gets a property from this database.
static bool account_db_sql_get_property(AccountDB* self, const char* key, char* buf, size_t buflen)
{
+ /* TODO:
+ * This functionality is not being used as of now, it was removed in
+ * commit 5479f9631f8579d03fbfd14d8a49c7976226a156, it is meant to get
+ * engine properties when more than one engine is available. I'll
+ * re-add it as soon as I can, following the new standards. If anyone
+ * is interested in this functionality you can contact me in our boards
+ * and I'll try to add it sooner (Pan) [Panikon]
+ */
+#if 0
AccountDB_SQL* db = (AccountDB_SQL*)self;
const char* signature;
@@ -230,32 +202,6 @@ static bool account_db_sql_get_property(AccountDB* self, const char* key, char*
return true;
}
- signature = "sql.";
- if( strncmpi(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "db_hostname") == 0 )
- safesnprintf(buf, buflen, "%s", db->global_db_hostname);
- else
- if( strcmpi(key, "db_port") == 0 )
- safesnprintf(buf, buflen, "%d", db->global_db_port);
- else
- if( strcmpi(key, "db_username") == 0 )
- safesnprintf(buf, buflen, "%s", db->global_db_username);
- else
- if( strcmpi(key, "db_password") == 0 )
- safesnprintf(buf, buflen, "%s", db->global_db_password);
- else
- if( strcmpi(key, "db_database") == 0 )
- safesnprintf(buf, buflen, "%s", db->global_db_database);
- else
- if( strcmpi(key, "codepage") == 0 )
- safesnprintf(buf, buflen, "%s", db->global_codepage);
- else
- return false;// not found
- return true;
- }
-
signature = "account.sql.";
if( strncmpi(key, signature, strlen(signature)) == 0 )
{
@@ -295,82 +241,91 @@ static bool account_db_sql_get_property(AccountDB* self, const char* key, char*
}
return false;// not found
+#endif // 0
+ return false;
}
-/// if the option is supported, adjusts the internal state
-static bool account_db_sql_set_property(AccountDB* self, const char* key, const char* value)
+/**
+ * Reads the 'inter_configuration' config file and initializes required variables.
+ *
+ * @param db Self.
+ * @param filename Path to configuration file
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool account_db_read_inter(AccountDB_SQL *db, const char *filename, bool imported)
+{
+ struct config_t config;
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, db);
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->load_file
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration/database_names")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("account_db_sql_set_property: inter_configuration/database_names was not found!\n");
+ return false;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "account_db", db->account_db, sizeof(db->account_db));
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration/database_names/registry")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("account_db_sql_set_property: inter_configuration/database_names/registry was not found!\n");
+ return false;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "global_acc_reg_str_db", db->global_acc_reg_str_db, sizeof(db->global_acc_reg_str_db));
+ libconfig->setting_lookup_mutable_string(setting, "global_acc_reg_num_db", db->global_acc_reg_num_db, sizeof(db->global_acc_reg_num_db));
+
+ // TODO: Proper import mechanism for this file
+
+ libconfig->destroy(&config);
+ return true;
+}
+
+/**
+ * Loads the sql configuration.
+ *
+ * @param self Self.
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+static bool account_db_sql_set_property(AccountDB* self, struct config_t *config, bool imported)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- const char* signature;
+ struct config_setting_t *setting = NULL;
nullpo_ret(db);
- nullpo_ret(key);
- nullpo_ret(value);
- signature = "sql.";
- if( strncmp(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "db_hostname") == 0 )
- safestrncpy(db->global_db_hostname, value, sizeof(db->global_db_hostname));
- else
- if( strcmpi(key, "db_port") == 0 )
- db->global_db_port = (uint16)strtoul(value, NULL, 10);
- else
- if( strcmpi(key, "db_username") == 0 )
- safestrncpy(db->global_db_username, value, sizeof(db->global_db_username));
- else
- if( strcmpi(key, "db_password") == 0 )
- safestrncpy(db->global_db_password, value, sizeof(db->global_db_password));
- else
- if( strcmpi(key, "db_database") == 0 )
- safestrncpy(db->global_db_database, value, sizeof(db->global_db_database));
- else
- if( strcmpi(key, "codepage") == 0 )
- safestrncpy(db->global_codepage, value, sizeof(db->global_codepage));
- else
- return false;// not found
- return true;
- }
+ nullpo_ret(config);
- signature = "account.sql.";
- if( strncmp(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "db_hostname") == 0 )
- safestrncpy(db->db_hostname, value, sizeof(db->db_hostname));
- else
- if( strcmpi(key, "db_port") == 0 )
- db->db_port = (uint16)strtoul(value, NULL, 10);
- else
- if( strcmpi(key, "db_username") == 0 )
- safestrncpy(db->db_username, value, sizeof(db->db_username));
- else
- if( strcmpi(key, "db_password") == 0 )
- safestrncpy(db->db_password, value, sizeof(db->db_password));
- else
- if( strcmpi(key, "db_database") == 0 )
- safestrncpy(db->db_database, value, sizeof(db->db_database));
- else
- if( strcmpi(key, "codepage") == 0 )
- safestrncpy(db->codepage, value, sizeof(db->codepage));
- else
- if( strcmpi(key, "case_sensitive") == 0 )
- db->case_sensitive = (bool)config_switch(value);
- else
- if( strcmpi(key, "account_db") == 0 )
- safestrncpy(db->account_db, value, sizeof(db->account_db));
- else
- if( strcmpi(key, "global_acc_reg_str_db") == 0 )
- safestrncpy(db->global_acc_reg_str_db, value, sizeof(db->global_acc_reg_str_db));
- else
- if( strcmpi(key, "global_acc_reg_num_db") == 0 )
- safestrncpy(db->global_acc_reg_num_db, value, sizeof(db->global_acc_reg_num_db));
- else
- return false;// not found
- return true;
+ if ((setting = libconfig->lookup(config, "login_configuration/account/sql_connection")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("account_db_sql_set_property: login_configuration/account/sql_connection was not found!\n");
+ ShowWarning("account_db_sql_set_property: Defaulting sql_connection...\n");
+ return false;
}
- return false;// not found
+ libconfig->setting_lookup_mutable_string(setting, "db_hostname", db->db_hostname, sizeof(db->db_hostname));
+ libconfig->setting_lookup_mutable_string(setting, "db_username", db->db_username, sizeof(db->db_username));
+ libconfig->setting_lookup_mutable_string(setting, "db_password", db->db_password, sizeof(db->db_password));
+ libconfig->setting_lookup_mutable_string(setting, "db_database", db->db_database, sizeof(db->db_database));
+ libconfig->setting_lookup_mutable_string(setting, "codepage", db->codepage, sizeof(db->codepage)); // FIXME: Why do we need both codepage and default_codepage?
+ libconfig->setting_lookup_uint16(setting, "db_port", &db->db_port);
+ libconfig->setting_lookup_bool_real(setting, "case_sensitive", &db->case_sensitive);
+
+ account_db_read_inter(db, "conf/common/inter-server.conf", imported);
+
+ return true;
}
/// create a new account entry
@@ -379,7 +334,7 @@ static bool account_db_sql_set_property(AccountDB* self, const char* key, const
static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- Sql* sql_handle;
+ struct Sql *sql_handle;
// decide on the account id to assign
int account_id;
@@ -433,7 +388,7 @@ static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc)
static bool account_db_sql_remove(AccountDB* self, const int account_id)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- Sql* sql_handle;
+ struct Sql *sql_handle;
bool result = false;
nullpo_ret(db);
@@ -470,7 +425,7 @@ static bool account_db_sql_load_num(AccountDB* self, struct mmo_account* acc, co
static bool account_db_sql_load_str(AccountDB* self, struct mmo_account* acc, const char* userid)
{
AccountDB_SQL* db = (AccountDB_SQL*)self;
- Sql* sql_handle;
+ struct Sql *sql_handle;
char esc_userid[2*NAME_LENGTH+1];
int account_id;
char* data;
@@ -540,7 +495,7 @@ static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account
{
AccountDBIterator_SQL* iter = (AccountDBIterator_SQL*)self;
AccountDB_SQL* db;
- Sql* sql_handle;
+ struct Sql *sql_handle;
char* data;
nullpo_ret(iter);
@@ -575,7 +530,7 @@ static bool account_db_sql_iter_next(AccountDBIterator* self, struct mmo_account
static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id)
{
- Sql* sql_handle;
+ struct Sql *sql_handle;
char* data;
nullpo_ret(db);
@@ -606,9 +561,9 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
SQL->GetData(sql_handle, 7, &data, NULL); acc->unban_time = atol(data);
SQL->GetData(sql_handle, 8, &data, NULL); acc->expiration_time = atol(data);
SQL->GetData(sql_handle, 9, &data, NULL); acc->logincount = (unsigned int)strtoul(data, NULL, 10);
- SQL->GetData(sql_handle, 10, &data, NULL); safestrncpy(acc->lastlogin, data, sizeof(acc->lastlogin));
+ SQL->GetData(sql_handle, 10, &data, NULL); safestrncpy(acc->lastlogin, data != NULL ? data : "(never)", sizeof(acc->lastlogin));
SQL->GetData(sql_handle, 11, &data, NULL); safestrncpy(acc->last_ip, data, sizeof(acc->last_ip));
- SQL->GetData(sql_handle, 12, &data, NULL); safestrncpy(acc->birthdate, data, sizeof(acc->birthdate));
+ SQL->GetData(sql_handle, 12, &data, NULL); safestrncpy(acc->birthdate, data != NULL ? data : "0000-00-00", sizeof(acc->birthdate));
SQL->GetData(sql_handle, 13, &data, NULL); acc->char_slots = (uint8)atoi(data);
SQL->GetData(sql_handle, 14, &data, NULL); safestrncpy(acc->pincode, data, sizeof(acc->pincode));
SQL->GetData(sql_handle, 15, &data, NULL); acc->pincode_change = (unsigned int)atol(data);
@@ -620,8 +575,8 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new)
{
- Sql* sql_handle;
- SqlStmt* stmt;
+ struct Sql *sql_handle;
+ struct SqlStmt *stmt;
bool result = false;
nullpo_ret(db);
@@ -644,22 +599,28 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
if( SQL_SUCCESS != SQL->StmtPrepare(stmt,
"INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
db->account_db)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_INT, (void*)&acc->account_id, sizeof(acc->account_id))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 3, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 4, SQLDT_STRING, (void*)&acc->email, strlen(acc->email))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 5, SQLDT_INT, (void*)&acc->group_id, sizeof(acc->group_id))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 6, SQLDT_UINT, (void*)&acc->state, sizeof(acc->state))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 7, SQLDT_LONG, (void*)&acc->unban_time, sizeof(acc->unban_time))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 8, SQLDT_INT, (void*)&acc->expiration_time, sizeof(acc->expiration_time))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 9, SQLDT_UINT, (void*)&acc->logincount, sizeof(acc->logincount))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 10, SQLDT_STRING, (void*)&acc->lastlogin, strlen(acc->lastlogin))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 11, SQLDT_STRING, (void*)&acc->last_ip, strlen(acc->last_ip))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 12, SQLDT_STRING, (void*)&acc->birthdate, strlen(acc->birthdate))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 15, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_INT, &acc->account_id, sizeof(acc->account_id))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, acc->userid, strlen(acc->userid))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_STRING, acc->pass, strlen(acc->pass))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 3, SQLDT_ENUM, &acc->sex, sizeof(acc->sex))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 4, SQLDT_STRING, &acc->email, strlen(acc->email))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 5, SQLDT_INT, &acc->group_id, sizeof(acc->group_id))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 6, SQLDT_UINT, &acc->state, sizeof(acc->state))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 7, SQLDT_LONG, &acc->unban_time, sizeof(acc->unban_time))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 8, SQLDT_INT, &acc->expiration_time, sizeof(acc->expiration_time))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 9, SQLDT_UINT, &acc->logincount, sizeof(acc->logincount))
+ || SQL_SUCCESS != (acc->lastlogin[0] < '1' || acc->lastlogin[0] > '9' ?
+ SQL->StmtBindParam(stmt, 10, SQLDT_NULL, NULL, 0) :
+ SQL->StmtBindParam(stmt, 10, SQLDT_STRING, &acc->lastlogin, strlen(acc->lastlogin))
+ )
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 11, SQLDT_STRING, &acc->last_ip, strlen(acc->last_ip))
+ || SQL_SUCCESS != (acc->birthdate[0] == '0' ?
+ SQL->StmtBindParam(stmt, 12, SQLDT_NULL, NULL, 0) :
+ SQL->StmtBindParam(stmt, 12, SQLDT_STRING, &acc->birthdate, strlen(acc->birthdate))
+ )
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_UCHAR, &acc->char_slots, sizeof(acc->char_slots))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_STRING, &acc->pincode, strlen(acc->pincode))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 15, SQLDT_LONG, &acc->pincode_change, sizeof(acc->pincode_change))
|| SQL_SUCCESS != SQL->StmtExecute(stmt)
) {
SqlStmt_ShowDebug(stmt);
@@ -667,21 +628,27 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
}
} else {// update account table
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?,`pincode_change`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 3, SQLDT_STRING, (void*)acc->email, strlen(acc->email))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 4, SQLDT_INT, (void*)&acc->group_id, sizeof(acc->group_id))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 5, SQLDT_UINT, (void*)&acc->state, sizeof(acc->state))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 6, SQLDT_LONG, (void*)&acc->unban_time, sizeof(acc->unban_time))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 7, SQLDT_LONG, (void*)&acc->expiration_time, sizeof(acc->expiration_time))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 8, SQLDT_UINT, (void*)&acc->logincount, sizeof(acc->logincount))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 9, SQLDT_STRING, (void*)&acc->lastlogin, strlen(acc->lastlogin))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 10, SQLDT_STRING, (void*)&acc->last_ip, strlen(acc->last_ip))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 11, SQLDT_STRING, (void*)&acc->birthdate, strlen(acc->birthdate))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 12, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, acc->userid, strlen(acc->userid))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, acc->pass, strlen(acc->pass))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_ENUM, &acc->sex, sizeof(acc->sex))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 3, SQLDT_STRING, acc->email, strlen(acc->email))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 4, SQLDT_INT, &acc->group_id, sizeof(acc->group_id))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 5, SQLDT_UINT, &acc->state, sizeof(acc->state))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 6, SQLDT_LONG, &acc->unban_time, sizeof(acc->unban_time))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 7, SQLDT_LONG, &acc->expiration_time, sizeof(acc->expiration_time))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 8, SQLDT_UINT, &acc->logincount, sizeof(acc->logincount))
+ || SQL_SUCCESS != (acc->lastlogin[0] < '1' || acc->lastlogin[0] > '9' ?
+ SQL->StmtBindParam(stmt, 9, SQLDT_NULL, NULL, 0) :
+ SQL->StmtBindParam(stmt, 9, SQLDT_STRING, &acc->lastlogin, strlen(acc->lastlogin))
+ )
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 10, SQLDT_STRING, &acc->last_ip, strlen(acc->last_ip))
+ || SQL_SUCCESS != (acc->birthdate[0] == '0' ?
+ SQL->StmtBindParam(stmt, 11, SQLDT_NULL, NULL, 0) :
+ SQL->StmtBindParam(stmt, 11, SQLDT_STRING, &acc->birthdate, strlen(acc->birthdate))
+ )
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 12, SQLDT_UCHAR, &acc->char_slots, sizeof(acc->char_slots))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_STRING, &acc->pincode, strlen(acc->pincode))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_LONG, &acc->pincode_change, sizeof(acc->pincode_change))
|| SQL_SUCCESS != SQL->StmtExecute(stmt)
) {
SqlStmt_ShowDebug(stmt);
@@ -701,12 +668,14 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
return result;
}
-Sql* account_db_sql_up(AccountDB* self) {
+struct Sql *account_db_sql_up(AccountDB* self)
+{
AccountDB_SQL* db = (AccountDB_SQL*)self;
return db ? db->accounts : NULL;
}
-void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
- Sql* sql_handle;
+void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id)
+{
+ struct Sql *sql_handle;
AccountDB_SQL* db = (AccountDB_SQL*)self;
int count = RFIFOW(fd, 12);
@@ -719,7 +688,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
for (i = 0; i < count; i++) {
unsigned int index;
int len = RFIFOB(fd, cursor);
- safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
+ safestrncpy(key, RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
cursor += len + 1;
index = RFIFOL(fd, cursor);
@@ -728,7 +697,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
switch (RFIFOB(fd, cursor++)) {
/* int */
case 0:
- if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%d')", db->global_acc_reg_num_db, account_id, key, index, RFIFOL(fd, cursor)) )
+ if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%u')", db->global_acc_reg_num_db, account_id, key, index, RFIFOL(fd, cursor)) )
Sql_ShowDebug(sql_handle);
cursor += 4;
break;
@@ -739,7 +708,7 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
/* str */
case 2:
len = RFIFOB(fd, cursor);
- safestrncpy(sval, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len));
+ safestrncpy(sval, RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len));
cursor += len + 1;
if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`key`,`index`,`value`) VALUES ('%d','%s','%u','%s')", db->global_acc_reg_str_db, account_id, key, index, sval) )
Sql_ShowDebug(sql_handle);
@@ -756,8 +725,9 @@ void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
}
}
-void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
- Sql* sql_handle;
+void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id)
+{
+ struct Sql *sql_handle;
AccountDB_SQL* db = (AccountDB_SQL*)self;
char* data;
int plen = 0;
@@ -791,7 +761,7 @@ void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 32 */
plen += 1;
- safestrncpy((char*)WFIFOP(fd,plen), data, len);
+ safestrncpy(WFIFOP(fd,plen), data, len);
plen += len;
SQL->GetData(sql_handle, 1, &data, NULL);
@@ -805,7 +775,7 @@ void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 254 */
plen += 1;
- safestrncpy((char*)WFIFOP(fd,plen), data, len);
+ safestrncpy(WFIFOP(fd,plen), data, len);
plen += len;
WFIFOW(fd, 14) += 1;
@@ -859,7 +829,7 @@ void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id) {
WFIFOB(fd, plen) = (unsigned char)len;/* won't be higher; the column size is 32 */
plen += 1;
- safestrncpy((char*)WFIFOP(fd,plen), data, len);
+ safestrncpy(WFIFOP(fd,plen), data, len);
plen += len;
SQL->GetData(sql_handle, 1, &data, NULL);
diff --git a/src/login/ipban.h b/src/login/ipban.h
index 85cf3873c..104e3a8a3 100644
--- a/src/login/ipban.h
+++ b/src/login/ipban.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,6 +23,9 @@
#include "common/cbasetypes.h"
+/* Forward Declarations */
+struct config_t; // common/conf.h
+
#ifdef HERCULES_CORE
// TODO: Interface
// initialize
@@ -37,8 +40,8 @@ bool ipban_check(uint32 ip);
// increases failure count for the specified IP
void ipban_log(uint32 ip);
-// parses configuration option
-bool ipban_config_read(const char *key, const char* value);
+// parses configuration options
+bool ipban_config_read(const char *filename, struct config_t *config, bool imported);
#endif // HERCULES_CORE
#endif /* LOGIN_IPBAN_H */
diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c
index 9d059ccd2..d74e6c4fa 100644
--- a/src/login/ipban_sql.c
+++ b/src/login/ipban_sql.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,31 +25,26 @@
#include "login/login.h"
#include "login/loginlog.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/nullpo.h"
+#include "common/showmsg.h"
#include "common/sql.h"
#include "common/strlib.h"
#include "common/timer.h"
#include <stdlib.h>
-// global sql settings
-static char global_db_hostname[32] = "127.0.0.1";
-static uint16 global_db_port = 3306;
-static char global_db_username[32] = "ragnarok";
-static char global_db_password[100] = "ragnarok";
-static char global_db_database[32] = "ragnarok";
-static char global_codepage[32] = "";
-// local sql settings
-static char ipban_db_hostname[32] = "";
-static uint16 ipban_db_port = 0;
-static char ipban_db_username[32] = "";
-static char ipban_db_password[100] = "";
-static char ipban_db_database[32] = "";
+// Sql settings
+static char ipban_db_hostname[32] = "127.0.0.1";
+static uint16 ipban_db_port = 3306;
+static char ipban_db_username[32] = "ragnarok";
+static char ipban_db_password[100] = "ragnarok";
+static char ipban_db_database[32] = "ragnarok";
static char ipban_codepage[32] = "";
static char ipban_table[32] = "ipbanlist";
// globals
-static Sql* sql_handle = NULL;
+static struct Sql *sql_handle = NULL;
static int cleanup_timer_id = INVALID_TIMER;
static bool ipban_inited = false;
@@ -59,54 +54,30 @@ int ipban_cleanup(int tid, int64 tick, int id, intptr_t data);
// initialize
void ipban_init(void)
{
- const char* username;
- const char* password;
- const char* hostname;
- uint16 port;
- const char* database;
- const char* codepage;
-
ipban_inited = true;
if (!login->config->ipban)
return;// ipban disabled
- if( ipban_db_hostname[0] != '\0' )
- {// local settings
- username = ipban_db_username;
- password = ipban_db_password;
- hostname = ipban_db_hostname;
- port = ipban_db_port;
- database = ipban_db_database;
- codepage = ipban_codepage;
- }
- else
- {// global settings
- username = global_db_username;
- password = global_db_password;
- hostname = global_db_hostname;
- port = global_db_port;
- database = global_db_database;
- codepage = global_codepage;
- }
-
// establish connections
sql_handle = SQL->Malloc();
- if( SQL_ERROR == SQL->Connect(sql_handle, username, password, hostname, port, database) )
- {
+ if (SQL_ERROR == SQL->Connect(sql_handle, ipban_db_username, ipban_db_password,
+ ipban_db_hostname, ipban_db_port, ipban_db_database)) {
Sql_ShowDebug(sql_handle);
SQL->Free(sql_handle);
exit(EXIT_FAILURE);
}
- if( codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, codepage) )
+ if (ipban_codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, ipban_codepage))
Sql_ShowDebug(sql_handle);
- if (login->config->ipban_cleanup_interval > 0)
- { // set up periodic cleanup of connection history and active bans
+ if (login->config->ipban_cleanup_interval > 0) {
+ // set up periodic cleanup of connection history and active bans
timer->add_func_list(ipban_cleanup, "ipban_cleanup");
cleanup_timer_id = timer->add_interval(timer->gettick()+10, ipban_cleanup, 0, 0, login->config->ipban_cleanup_interval*1000);
- } else // make sure it gets cleaned up on login-server start regardless of interval-based cleanups
+ } else {
+ // make sure it gets cleaned up on login-server start regardless of interval-based cleanups
ipban_cleanup(0,0,0,0);
+ }
}
// finalize
@@ -126,95 +97,153 @@ void ipban_final(void)
sql_handle = NULL;
}
-// load configuration options
-bool ipban_config_read(const char* key, const char* value)
+/**
+ * Reads 'inter_configuration' and initializes required variables/Sets global
+ * configuration.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+
+ */
+bool ipban_config_read_inter(const char *filename, bool imported)
{
- const char* signature;
+ struct config_t config;
+ struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
- nullpo_ret(key);
- nullpo_ret(value);
- if( ipban_inited )
- return false;// settings can only be changed before init
+ nullpo_retr(false, filename);
- signature = "sql.";
- if( strncmpi(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "db_hostname") == 0 )
- safestrncpy(global_db_hostname, value, sizeof(global_db_hostname));
- else
- if( strcmpi(key, "db_port") == 0 )
- global_db_port = (uint16)strtoul(value, NULL, 10);
- else
- if( strcmpi(key, "db_username") == 0 )
- safestrncpy(global_db_username, value, sizeof(global_db_username));
- else
- if( strcmpi(key, "db_password") == 0 )
- safestrncpy(global_db_password, value, sizeof(global_db_password));
- else
- if( strcmpi(key, "db_database") == 0 )
- safestrncpy(global_db_database, value, sizeof(global_db_database));
- else
- if( strcmpi(key, "codepage") == 0 )
- safestrncpy(global_codepage, value, sizeof(global_codepage));
- else
- return false;// not found
- return true;
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->read_file
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration/database_names")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("ipban_config_read: inter_configuration/database_names was not found!\n");
+ return false;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "ipban_table", ipban_table, sizeof(ipban_table));
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, "conf/common/inter-server.conf") == 0) {
+ ShowWarning("ipban_config_read_inter: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!ipban_config_read_inter(import, true))
+ retval = false;
+ }
}
- signature = "ipban.sql.";
- if( strncmpi(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "db_hostname") == 0 )
- safestrncpy(ipban_db_hostname, value, sizeof(ipban_db_hostname));
- else
- if( strcmpi(key, "db_port") == 0 )
- ipban_db_port = (uint16)strtoul(value, NULL, 10);
- else
- if( strcmpi(key, "db_username") == 0 )
- safestrncpy(ipban_db_username, value, sizeof(ipban_db_username));
- else
- if( strcmpi(key, "db_password") == 0 )
- safestrncpy(ipban_db_password, value, sizeof(ipban_db_password));
- else
- if( strcmpi(key, "db_database") == 0 )
- safestrncpy(ipban_db_database, value, sizeof(ipban_db_database));
- else
- if( strcmpi(key, "codepage") == 0 )
- safestrncpy(ipban_codepage, value, sizeof(ipban_codepage));
- else
- if( strcmpi(key, "ipban_table") == 0 )
- safestrncpy(ipban_table, value, sizeof(ipban_table));
- else
- return false;// not found
- return true;
+ libconfig->destroy(&config);
+ return retval;
+}
+
+/**
+ * Reads login_configuration/account/ipban/sql_connection and loads configuration options.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool ipban_config_read_connection(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/account/ipban/sql_connection")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("account_db_sql_set_property: login_configuration/account/ipban/sql_connection was not found in %s!\n", filename);
+ return false;
}
- signature = "ipban.";
- if( strncmpi(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "enable") == 0 )
- login->config->ipban = (bool)config_switch(value);
- else
- if( strcmpi(key, "dynamic_pass_failure_ban") == 0 )
- login->config->dynamic_pass_failure_ban = (bool)config_switch(value);
- else
- if( strcmpi(key, "dynamic_pass_failure_ban_interval") == 0 )
- login->config->dynamic_pass_failure_ban_interval = atoi(value);
- else
- if( strcmpi(key, "dynamic_pass_failure_ban_limit") == 0 )
- login->config->dynamic_pass_failure_ban_limit = atoi(value);
- else
- if( strcmpi(key, "dynamic_pass_failure_ban_duration") == 0 )
- login->config->dynamic_pass_failure_ban_duration = atoi(value);
- else
- return false;// not found
- return true;
+ libconfig->setting_lookup_mutable_string(setting, "db_hostname", ipban_db_hostname, sizeof(ipban_db_hostname));
+ libconfig->setting_lookup_mutable_string(setting, "db_database", ipban_db_database, sizeof(ipban_db_database));
+
+ libconfig->setting_lookup_mutable_string(setting, "db_username", ipban_db_username, sizeof(ipban_db_username));
+ libconfig->setting_lookup_mutable_string(setting, "db_password", ipban_db_password, sizeof(ipban_db_password));
+ libconfig->setting_lookup_mutable_string(setting, "codepage", ipban_codepage, sizeof(ipban_codepage));
+ libconfig->setting_lookup_uint16(setting, "db_port", &ipban_db_port);
+
+ return true;
+}
+
+/**
+ * Reads login_configuration/account/ipban/dynamic_pass_failure and loads configuration options.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool ipban_config_read_dynamic(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/account/ipban/dynamic_pass_failure")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("account_db_sql_set_property: login_configuration/account/ipban/dynamic_pass_failure was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->dynamic_pass_failure_ban);
+ libconfig->setting_lookup_uint32(setting, "ban_interval", &login->config->dynamic_pass_failure_ban_interval);
+ libconfig->setting_lookup_uint32(setting, "ban_limit", &login->config->dynamic_pass_failure_ban_limit);
+ libconfig->setting_lookup_uint32(setting, "ban_duration", &login->config->dynamic_pass_failure_ban_duration);
+
+ return true;
+}
+
+/**
+ * Reads login_configuration.account.ipban and loads configuration options.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool ipban_config_read(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if (ipban_inited)
+ return false; // settings can only be changed before init
+
+ if ((setting = libconfig->lookup(config, "login_configuration/account/ipban")) == NULL) {
+ if (!imported)
+ ShowError("login_config_read: login_configuration/log was not found in %s!\n", filename);
+ return false;
}
- return false;// not found
+ libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->ipban);
+ libconfig->setting_lookup_uint32(setting, "cleanup_interval", &login->config->ipban_cleanup_interval);
+
+ if (!ipban_config_read_inter("conf/common/inter-server.conf", imported))
+ retval = false;
+ if (!ipban_config_read_connection(filename, config, imported))
+ retval = false;
+ if (!ipban_config_read_dynamic(filename, config, imported))
+ retval = false;
+
+ return retval;
}
// check ip against active bans list
@@ -259,7 +288,7 @@ void ipban_log(uint32 ip)
if (failures >= login->config->dynamic_pass_failure_ban_limit)
{
uint8* p = (uint8*)&ip;
- if (SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s`(`list`,`btime`,`rtime`,`reason`) VALUES ('%u.%u.%u.*', NOW() , NOW() + INTERVAL %d MINUTE ,'Password error ban')",
+ if (SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s`(`list`,`btime`,`rtime`,`reason`) VALUES ('%u.%u.%u.*', NOW() , NOW() + INTERVAL %u MINUTE ,'Password error ban')",
ipban_table, p[3], p[2], p[1], login->config->dynamic_pass_failure_ban_duration))
{
Sql_ShowDebug(sql_handle);
diff --git a/src/login/lclif.c b/src/login/lclif.c
new file mode 100644
index 000000000..f32538610
--- /dev/null
+++ b/src/login/lclif.c
@@ -0,0 +1,570 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2016 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#define HERCULES_CORE
+
+#include "lclif.p.h"
+
+#include "login/ipban.h"
+#include "login/login.h"
+#include "login/loginlog.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/md5calc.h"
+#include "common/memmgr.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
+/** @file
+ * Implementation of the login client interface.
+ */
+
+struct lclif_interface lclif_s;
+struct lclif_interface_private lclif_p;
+struct lclif_interface_dbs lclif_dbs;
+struct lclif_interface *lclif;
+
+/// @copydoc lclif_interface::connection_error()
+void lclif_connection_error(int fd, uint8 error)
+{
+ struct packet_SC_NOTIFY_BAN *packet = NULL;
+ WFIFOHEAD(fd, sizeof(*packet));
+ packet = WP2PTR(fd);
+ packet->packet_id = PACKET_ID_SC_NOTIFY_BAN;
+ packet->error_code = error;
+ WFIFOSET(fd, sizeof(*packet));
+}
+
+/// @copydoc lclif_interface_private::parse_CA_CONNECT_INFO_CHANGED()
+enum parsefunc_rcode lclif_parse_CA_CONNECT_INFO_CHANGED(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_CONNECT_INFO_CHANGED(int fd, struct login_session_data *sd)
+{
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_EXE_HASHCHECK()
+enum parsefunc_rcode lclif_parse_CA_EXE_HASHCHECK(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_EXE_HASHCHECK(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_EXE_HASHCHECK *packet = RP2PTR(fd);
+ sd->has_client_hash = 1;
+ memcpy(sd->client_hash, packet->hash_value, 16);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_LOGIN()
+enum parsefunc_rcode lclif_parse_CA_LOGIN(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_LOGIN(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_LOGIN *packet = RP2PTR(fd);
+
+ sd->version = packet->version;
+ sd->clienttype = packet->clienttype;
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ safestrncpy(sd->passwd, packet->password, PASSWD_LEN);
+
+ if (login->config->use_md5_passwds)
+ md5->string(sd->passwd, sd->passwd);
+ sd->passwdenc = PWENC_NONE;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_LOGIN2()
+enum parsefunc_rcode lclif_parse_CA_LOGIN2(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_LOGIN2(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_LOGIN2 *packet = RP2PTR(fd);
+
+ sd->version = packet->version;
+ sd->clienttype = packet->clienttype;
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ bin2hex(sd->passwd, packet->password_md5, 16);
+ sd->passwdenc = PASSWORDENC;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_LOGIN3()
+enum parsefunc_rcode lclif_parse_CA_LOGIN3(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_LOGIN3(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_LOGIN3 *packet = RP2PTR(fd);
+
+ sd->version = packet->version;
+ sd->clienttype = packet->clienttype;
+ /* unused */
+ /* sd->clientinfo = packet->clientinfo; */
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ bin2hex(sd->passwd, packet->password_md5, 16);
+ sd->passwdenc = PASSWORDENC;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_LOGIN4()
+enum parsefunc_rcode lclif_parse_CA_LOGIN4(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_LOGIN4(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_LOGIN4 *packet = RP2PTR(fd);
+
+ sd->version = packet->version;
+ sd->clienttype = packet->clienttype;
+ /* unused */
+ /* safestrncpy(sd->mac_address, packet->mac_address, sizeof(sd->mac_address)); */
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ bin2hex(sd->passwd, packet->password_md5, 16);
+ sd->passwdenc = PASSWORDENC;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_LOGIN_PCBANG()
+enum parsefunc_rcode lclif_parse_CA_LOGIN_PCBANG(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_LOGIN_PCBANG(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_LOGIN_PCBANG *packet = RP2PTR(fd);
+
+ sd->version = packet->version;
+ sd->clienttype = packet->clienttype;
+ /* unused */
+ /* safestrncpy(sd->ip, packet->ip, sizeof(sd->ip)); */
+ /* safestrncpy(sd->mac_address, packet->mac_address, sizeof(sd->mac_address)); */
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ safestrncpy(sd->passwd, packet->password, PASSWD_LEN);
+
+ if (login->config->use_md5_passwds)
+ md5->string(sd->passwd, sd->passwd);
+ sd->passwdenc = PWENC_NONE;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_LOGIN_HAN()
+enum parsefunc_rcode lclif_parse_CA_LOGIN_HAN(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_LOGIN_HAN(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_LOGIN_HAN *packet = RP2PTR(fd);
+
+ sd->version = packet->version;
+ sd->clienttype = packet->clienttype;
+ /* unused */
+ /* safestrncpy(sd->ip, packet->ip, sizeof(sd->ip)); */
+ /* safestrncpy(sd->mac_address, packet->mac_address, sizeof(sd->mac_address)); */
+ /* sd->ishan = packet->is_han_game_user; */
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ safestrncpy(sd->passwd, packet->password, PASSWD_LEN);
+
+ if (login->config->use_md5_passwds)
+ md5->string(sd->passwd, sd->passwd);
+ sd->passwdenc = PWENC_NONE;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_SSO_LOGIN_REQ()
+enum parsefunc_rcode lclif_parse_CA_SSO_LOGIN_REQ(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_SSO_LOGIN_REQ(int fd, struct login_session_data *sd)
+{
+ const struct packet_CA_SSO_LOGIN_REQ *packet = RP2PTR(fd);
+ int tokenlen = (int)RFIFOREST(fd) - (int)sizeof(*packet);
+
+ if (tokenlen > PASSWD_LEN || tokenlen < 1) {
+ ShowError("packet_CA_SSO_LOGIN_REQ: Token length is not between allowed password length, kicking player ('%s')", packet->id);
+ sockt->eof(fd);
+ return PACKET_VALID;
+ }
+
+ sd->clienttype = packet->clienttype;
+ sd->version = packet->version;
+ safestrncpy(sd->userid, packet->id, NAME_LENGTH);
+ safestrncpy(sd->passwd, packet->t1, min(tokenlen + 1, PASSWD_LEN)); // Variable-length field, don't copy more than necessary
+
+ if (login->config->use_md5_passwds)
+ md5->string(sd->passwd, sd->passwd);
+ sd->passwdenc = PWENC_NONE;
+
+ login->client_login(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_REQ_HASH()
+enum parsefunc_rcode lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *sd)
+{
+ memset(sd->md5key, '\0', sizeof(sd->md5key));
+ sd->md5keylen = (uint16)(12 + rnd() % 4);
+ md5->salt(sd->md5keylen, sd->md5key);
+
+ lclif->coding_key(fd, sd);
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface_private::parse_CA_CHARSERVERCONNECT()
+enum parsefunc_rcode lclif_parse_CA_CHARSERVERCONNECT(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+enum parsefunc_rcode lclif_parse_CA_CHARSERVERCONNECT(int fd, struct login_session_data *sd)
+{
+ char ip[16];
+ uint32 ipl = sockt->session[fd]->client_addr;
+ sockt->ip2str(ipl, ip);
+
+ login->parse_request_connection(fd, sd, ip, ipl);
+
+ return PACKET_STOPPARSE;
+}
+
+/// @copydoc lclif_interface::server_list()
+bool lclif_send_server_list(struct login_session_data *sd)
+{
+ int server_num = 0, i, n, length;
+ uint32 ip;
+ struct packet_AC_ACCEPT_LOGIN *packet = NULL;
+
+ for (i = 0; i < ARRAYLENGTH(server); ++i) {
+ if (sockt->session_is_active(server[i].fd))
+ server_num++;
+ }
+ if (server_num == 0)
+ return false;
+
+ length = sizeof(*packet) + sizeof(packet->server_list[0]) * server_num;
+ ip = sockt->session[sd->fd]->client_addr;
+
+ // Allocate the packet
+ WFIFOHEAD(sd->fd, length);
+ packet = WP2PTR(sd->fd);
+
+#if PACKETVER < 20170315
+ packet->packet_id = PACKET_ID_AC_ACCEPT_LOGIN;
+#else
+ packet->packet_id = PACKET_ID_AC_ACCEPT_LOGIN2;
+#endif
+ packet->packet_len = length;
+ packet->auth_code = sd->login_id1;
+ packet->aid = sd->account_id;
+ packet->user_level = sd->login_id2;
+ packet->last_login_ip = 0; // Not used anymore
+ memset(packet->last_login_time, '\0', sizeof(packet->last_login_time)); // Not used anymore
+ packet->sex = sex_str2num(sd->sex);
+ for (i = 0, n = 0; i < ARRAYLENGTH(server); ++i) {
+ uint32 subnet_char_ip;
+
+ if (!sockt->session_is_valid(server[i].fd))
+ continue;
+
+ subnet_char_ip = login->lan_subnet_check(ip);
+ packet->server_list[n].ip = htonl((subnet_char_ip) ? subnet_char_ip : server[i].ip);
+ packet->server_list[n].port = sockt->ntows(htons(server[i].port)); // [!] LE byte order here [!]
+ safestrncpy(packet->server_list[n].name, server[i].name, 20);
+ packet->server_list[n].usercount = server[i].users;
+
+ if (server[i].type == CST_PAYING && sd->expiration_time > time(NULL))
+ packet->server_list[n].property = CST_NORMAL;
+ else
+ packet->server_list[n].property = server[i].type;
+
+ packet->server_list[n].state = server[i].new_;
+ ++n;
+ }
+ WFIFOSET(sd->fd, length);
+
+ return true;
+}
+
+/// @copydoc lclif_interface::auth_failed()
+void lclif_send_auth_failed(int fd, time_t ban, uint32 error)
+{
+#if PACKETVER >= 20120000 /* not sure when this started */
+ struct packet_AC_REFUSE_LOGIN_R2 *packet = NULL;
+ int packet_id = PACKET_ID_AC_REFUSE_LOGIN_R2;
+#else
+ struct packet_AC_REFUSE_LOGIN *packet = NULL;
+ int packet_id = PACKET_ID_AC_REFUSE_LOGIN;
+#endif
+ WFIFOHEAD(fd, sizeof(*packet));
+ packet = WP2PTR(fd);
+ packet->packet_id = packet_id;
+ packet->error_code = error;
+ if (error == 6)
+ timestamp2string(packet->block_date, sizeof(packet->block_date), ban, login->config->date_format);
+ else
+ memset(packet->block_date, '\0', sizeof(packet->block_date));
+ WFIFOSET(fd, sizeof(*packet));
+}
+
+/// @copydoc lclif_interface::login_error()
+void lclif_send_login_error(int fd, uint8 error)
+{
+ struct packet_AC_REFUSE_LOGIN *packet = NULL;
+ WFIFOHEAD(fd, sizeof(*packet));
+ packet = WP2PTR(fd);
+ packet->packet_id = PACKET_ID_AC_REFUSE_LOGIN;
+ packet->error_code = error;
+ memset(packet->block_date, '\0', sizeof(packet->block_date));
+ WFIFOSET(fd, sizeof(*packet));
+}
+
+/// @copydoc lclif_interface::coding_key()
+void lclif_send_coding_key(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+void lclif_send_coding_key(int fd, struct login_session_data *sd)
+{
+ struct packet_AC_ACK_HASH *packet = NULL;
+ int16 size = sizeof(*packet) + sd->md5keylen;
+
+ WFIFOHEAD(fd, size);
+ packet = WP2PTR(fd);
+ packet->packet_id = PACKET_ID_AC_ACK_HASH;
+ packet->packet_len = size;
+ memcpy(packet->secret, sd->md5key, sd->md5keylen);
+ WFIFOSET(fd, size);
+}
+
+/// @copydoc lclif_interface::parse()
+int lclif_parse(int fd)
+{
+ struct login_session_data *sd = NULL;
+ int i;
+ char ip[16];
+ uint32 ipl = sockt->session[fd]->client_addr;
+ sockt->ip2str(ipl, ip);
+
+ if (sockt->session[fd]->flag.eof) {
+ ShowInfo("Closed connection from '"CL_WHITE"%s"CL_RESET"'.\n", ip);
+ sockt->close(fd);
+ return 0;
+ }
+
+ if ((sd = sockt->session[fd]->session_data) == NULL) {
+ // Perform ip-ban check
+ if (login->config->ipban && !sockt->trusted_ip_check(ipl) && ipban_check(ipl)) {
+ ShowStatus("Connection refused: IP isn't authorized (deny/allow, ip: %s).\n", ip);
+ login_log(ipl, "unknown", -3, "ip banned");
+ lclif->login_error(fd, 3); // 3 = Rejected from Server
+ sockt->eof(fd);
+ return 0;
+ }
+
+ // create a session for this new connection
+ CREATE(sockt->session[fd]->session_data, struct login_session_data, 1);
+ sd = sockt->session[fd]->session_data;
+ sd->fd = fd;
+ }
+
+ for (i = 0; i < MAX_PROCESSED_PACKETS; ++i) {
+ enum parsefunc_rcode result;
+ int16 packet_id = RFIFOW(fd, 0);
+ int packet_len = (int)RFIFOREST(fd);
+
+ if (packet_len < 2)
+ return 0;
+
+ result = lclif->p->parse_sub(fd, sd);
+
+ switch (result) {
+ case PACKET_SKIP:
+ continue;
+ case PACKET_INCOMPLETE:
+ case PACKET_STOPPARSE:
+ return 0;
+ case PACKET_UNKNOWN:
+ ShowWarning("lclif_parse: Received unsupported packet (packet 0x%04x, %d bytes received), disconnecting session #%d.\n", (unsigned int)packet_id, packet_len, fd);
+#ifdef DUMP_INVALID_PACKET
+ ShowDump(RFIFOP(fd, 0), RFIFOREST(fd));
+#endif
+ sockt->eof(fd);
+ return 0;
+ case PACKET_INVALIDLENGTH:
+ ShowWarning("lclif_parse: Received packet 0x%04x specifies invalid packet_len (%d), disconnecting session #%d.\n", (unsigned int)packet_id, packet_len, fd);
+#ifdef DUMP_INVALID_PACKET
+ ShowDump(RFIFOP(fd, 0), RFIFOREST(fd));
+#endif
+ sockt->eof(fd);
+ return 0;
+ }
+ }
+ return 0;
+}
+
+/// @copydoc lclif_interface_private::parse_sub()
+enum parsefunc_rcode lclif_parse_sub(int fd, struct login_session_data *sd)
+{
+ int packet_len = (int)RFIFOREST(fd);
+ int16 packet_id = RFIFOW(fd, 0);
+ const struct login_packet_db *lpd;
+
+ if (VECTOR_LENGTH(HPM->packets[hpParse_Login]) > 0) {
+ int result = HPM->parse_packets(fd, packet_id, hpParse_Login);
+ if (result == 1)
+ return PACKET_VALID;
+ if (result == 2)
+ return PACKET_INCOMPLETE; // Packet not completed yet
+ }
+
+ lpd = lclif->packet(packet_id);
+
+ if (lpd == NULL)
+ return PACKET_UNKNOWN;
+
+ if (lpd->len == 0)
+ return PACKET_UNKNOWN;
+
+ if (lpd->len > 0 && lpd->pFunc == NULL)
+ return PACKET_UNKNOWN; //This Packet is defined for length purpose ? should never be sent from client ?
+
+ if (lpd->len == -1) {
+ uint16 packet_var_len = 0; //Max Variable Packet length is signed int16 size
+
+ if (packet_len < 4)
+ return PACKET_INCOMPLETE; //Packet incomplete
+
+ packet_var_len = RFIFOW(fd, 2);
+
+ if (packet_var_len < 4 || packet_var_len > SINT16_MAX)
+ return PACKET_INVALIDLENGTH; //Something is wrong, close connection.
+
+ if (RFIFOREST(fd) < packet_var_len)
+ return PACKET_INCOMPLETE; //Packet incomplete again.
+
+ return lclif->parse_packet(lpd, fd, sd);
+ } else if (lpd->len <= packet_len) {
+ return lclif->parse_packet(lpd, fd, sd);
+ }
+
+ return PACKET_VALID;
+}
+
+/// @copydoc lclif_interface::packet()
+const struct login_packet_db *lclif_packet(int16 packet_id)
+{
+ if (packet_id == PACKET_ID_CA_CHARSERVERCONNECT)
+ return &lclif->p->dbs->packet_db[0];
+
+ if (packet_id > MAX_PACKET_DB || packet_id < MIN_PACKET_DB)
+ return NULL;
+
+ return &lclif->p->dbs->packet_db[packet_id];
+}
+
+/// @copydoc lclif_interface::parse_packet()
+enum parsefunc_rcode lclif_parse_packet(const struct login_packet_db *lpd, int fd, struct login_session_data *sd)
+{
+ int result;
+ result = (*lpd->pFunc)(fd, sd);
+ RFIFOSKIP(fd, (lpd->len == -1) ? RFIFOW(fd, 2) : lpd->len);
+ return result;
+}
+
+/// @copydoc lclif_interface_private::packetdb_loaddb()
+void packetdb_loaddb(void)
+{
+ int i;
+ struct packet {
+ int16 packet_id;
+ int16 packet_len;
+ LoginParseFunc **pFunc;
+ } packet[] = {
+#define packet_def(name) { PACKET_ID_ ## name, sizeof(struct packet_ ## name), &lclif->p->parse_ ## name }
+#define packet_def2(name, len) { PACKET_ID_ ## name, (len), &lclif->p->parse_ ## name }
+ packet_def(CA_CONNECT_INFO_CHANGED),
+ packet_def(CA_EXE_HASHCHECK),
+ packet_def(CA_LOGIN),
+ packet_def(CA_LOGIN2),
+ packet_def(CA_LOGIN3),
+ packet_def(CA_LOGIN4),
+ packet_def(CA_LOGIN_PCBANG),
+ packet_def(CA_LOGIN_HAN),
+ packet_def2(CA_SSO_LOGIN_REQ, -1),
+ packet_def(CA_REQ_HASH),
+#undef packet_def
+#undef packet_def2
+ };
+ int length = ARRAYLENGTH(packet);
+
+ memset(lclif->p->dbs->packet_db, '\0', sizeof(lclif->p->dbs->packet_db));
+
+ for (i = 0; i < length; ++i) {
+ int16 packet_id = packet[i].packet_id;
+ Assert_retb(packet_id >= MIN_PACKET_DB && packet_id < MAX_PACKET_DB);
+ lclif->p->dbs->packet_db[packet_id].len = packet[i].packet_len;
+ lclif->p->dbs->packet_db[packet_id].pFunc = packet[i].pFunc;
+ }
+
+ //Explict case, we will save character login packet in position 0 which is unused and not valid by normal
+ lclif->p->dbs->packet_db[0].len = sizeof(struct packet_CA_CHARSERVERCONNECT);
+ lclif->p->dbs->packet_db[0].pFunc = &lclif->p->parse_CA_CHARSERVERCONNECT;
+}
+
+/// @copydoc lclif_interface::init()
+void lclif_init(void)
+{
+ lclif->p->packetdb_loaddb();
+}
+
+/// @copydoc lclif_interface::final()
+void lclif_final(void)
+{
+}
+
+/// Interface base initialization.
+void lclif_defaults(void)
+{
+ lclif = &lclif_s;
+ lclif->p = &lclif_p;
+ lclif->p->dbs = &lclif_dbs;
+
+ lclif->init = lclif_init;
+ lclif->final = lclif_final;
+
+ lclif->connection_error = lclif_connection_error;
+ lclif->server_list = lclif_send_server_list;
+ lclif->auth_failed = lclif_send_auth_failed;
+ lclif->login_error = lclif_send_login_error;
+ lclif->coding_key = lclif_send_coding_key;
+
+ lclif->packet = lclif_packet;
+ lclif->parse_packet = lclif_parse_packet;
+ lclif->parse = lclif_parse;
+
+ lclif->p->packetdb_loaddb = packetdb_loaddb;
+ lclif->p->parse_sub = lclif_parse_sub;
+
+ lclif->p->parse_CA_CONNECT_INFO_CHANGED = lclif_parse_CA_CONNECT_INFO_CHANGED;
+ lclif->p->parse_CA_EXE_HASHCHECK = lclif_parse_CA_EXE_HASHCHECK;
+ lclif->p->parse_CA_LOGIN = lclif_parse_CA_LOGIN;
+ lclif->p->parse_CA_LOGIN2 = lclif_parse_CA_LOGIN2;
+ lclif->p->parse_CA_LOGIN3 = lclif_parse_CA_LOGIN3;
+ lclif->p->parse_CA_LOGIN4 = lclif_parse_CA_LOGIN4;
+ lclif->p->parse_CA_LOGIN_PCBANG = lclif_parse_CA_LOGIN_PCBANG;
+ lclif->p->parse_CA_LOGIN_HAN = lclif_parse_CA_LOGIN_HAN;
+ lclif->p->parse_CA_SSO_LOGIN_REQ = lclif_parse_CA_SSO_LOGIN_REQ;
+ lclif->p->parse_CA_REQ_HASH = lclif_parse_CA_REQ_HASH;
+ lclif->p->parse_CA_CHARSERVERCONNECT = lclif_parse_CA_CHARSERVERCONNECT;
+}
diff --git a/src/login/lclif.h b/src/login/lclif.h
new file mode 100644
index 000000000..d1e4317a2
--- /dev/null
+++ b/src/login/lclif.h
@@ -0,0 +1,150 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2016 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef LOGIN_LCLIF_H
+#define LOGIN_LCLIF_H
+
+#include "common/hercules.h"
+
+/** @file
+ * Login Client Interface.
+ **/
+
+/* Forward Declarations */
+struct login_session_data;
+struct lclif_interface_private;
+
+/* Enums */
+/// Parse function return code
+enum parsefunc_rcode {
+ PACKET_VALID = 1,
+ PACKET_INCOMPLETE = 0,
+ PACKET_UNKNOWN = -1,
+ PACKET_INVALIDLENGTH = -2,
+ PACKET_STOPPARSE = -3,
+ PACKET_SKIP = -4, //internal parser will skip this packet and go parser another, meant for plugins. [hemagx]
+};
+
+/* Function Typedefs */
+typedef enum parsefunc_rcode (LoginParseFunc)(int fd, struct login_session_data *sd);
+
+/* Structs */
+
+/// Login packet DB entry
+struct login_packet_db {
+ int16 len; ///< Packet length
+ LoginParseFunc **pFunc; ///< Packet parsing function
+};
+
+/// The login clif (client interface) interface.
+struct lclif_interface {
+ struct lclif_interface_private *p; ///< Private interface
+
+ /// Interface initialization.
+ void (*init)(void);
+
+ /// Interface finalization.
+ void (*final)(void);
+
+ /**
+ * Reports a connection error to the client.
+ *
+ * @param fd Client connection file descriptor.
+ * @param error Error code.
+ * @see #PACKET_SC_NOTIFY_BAN.
+ */
+ void (*connection_error)(int fd, uint8 error);
+
+ /**
+ * Sends the character server list to the client.
+ *
+ * @param sd The client to send to.
+ * @return Success status.
+ * @retval false in case of failure (no server available).
+ * @see #PACKET_AC_ACCEPT_LOGIN.
+ */
+ bool (*server_list)(struct login_session_data *sd);
+
+ /**
+ * Reports an authentication failure to the client.
+ *
+ * @param fd The client connection file descriptor.
+ * @param ban The ban duration (if error == 6).
+ * @param error The authentication error code.
+ * @see #PACKET_ID_AC_REFUSE_LOGIN.
+ * @see #PACKET_ID_AC_REFUSE_LOGIN_R2.
+ */
+ void (*auth_failed)(int fd, time_t ban, uint32 error);
+
+ /**
+ * Reports a login error to the client.
+ *
+ * @param fd Client connection file descriptor.
+ * @param error Error code.
+ * @see #PACKET_AC_REFUSE_LOGIN.
+ */
+ void (*login_error)(int fd, uint8 error);
+
+ /**
+ * Sends an authentication challenge to the client.
+ *
+ * @param fd Client connection file descriptor.
+ * @param sd The client to send to.
+ * @see #PACKET_AC_ACK_HASH.
+ */
+ void (*coding_key)(int fd, struct login_session_data *sd);
+
+ /**
+ * Retrieves a packet's data from the packet db.
+ *
+ * @param packet_id The packet id.
+ * @return The packet data.
+ * @retval NULL if the packet doesn't exist.
+ */
+ const struct login_packet_db *(*packet)(int16 packet_id);
+
+ /**
+ * Parses a packet.
+ *
+ * @param lpd Packet database entry.
+ * @param fd Client connection file descriptor.
+ * @param sd Session data.
+ * @return Parse result error code.
+ */
+ enum parsefunc_rcode (*parse_packet)(const struct login_packet_db *lpd, int fd, struct login_session_data *sd);
+
+ /**
+ * Packet parser loop function.
+ *
+ * Parses packets received from a client.
+ *
+ * @param fd Client connection file descriptor.
+ * @return error code.
+ * @retval 0 in case of success.
+ */
+ int (*parse)(int fd);
+};
+
+#ifdef HERCULES_CORE
+void lclif_defaults(void);
+#endif
+
+HPShared struct lclif_interface *lclif;
+
+#endif // LOGIN_LCLIF_H
diff --git a/src/login/lclif.p.h b/src/login/lclif.p.h
new file mode 100644
index 000000000..d28f1c587
--- /dev/null
+++ b/src/login/lclif.p.h
@@ -0,0 +1,332 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2016 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef LOGIN_LCLIF_P_H
+#define LOGIN_LCLIF_P_H
+
+/** @file
+ * Private header for the login client interface.
+ */
+
+#include "login/lclif.h"
+
+#include "common/hercules.h"
+#include "common/mmo.h"
+
+/* Definitions and macros */
+/// Maximum amount of packets processed at once from the same client
+#define MAX_PROCESSED_PACKETS (3)
+
+// Packet DB
+#define MIN_PACKET_DB 0x0064
+#define MAX_PACKET_DB 0x08ff
+
+/* Enums */
+
+/// Packet IDs
+enum login_packet_id {
+ // CA (Client to Login)
+ PACKET_ID_CA_LOGIN = 0x0064,
+ PACKET_ID_CA_LOGIN2 = 0x01dd,
+ PACKET_ID_CA_LOGIN3 = 0x01fa,
+ PACKET_ID_CA_CONNECT_INFO_CHANGED = 0x0200,
+ PACKET_ID_CA_EXE_HASHCHECK = 0x0204,
+ PACKET_ID_CA_LOGIN_PCBANG = 0x0277,
+ PACKET_ID_CA_LOGIN4 = 0x027c,
+ PACKET_ID_CA_LOGIN_HAN = 0x02b0,
+ PACKET_ID_CA_SSO_LOGIN_REQ = 0x0825,
+ PACKET_ID_CA_REQ_HASH = 0x01db,
+ PACKET_ID_CA_CHARSERVERCONNECT = 0x2710, // Custom Hercules Packet
+ //PACKET_ID_CA_SSO_LOGIN_REQa = 0x825a, /* unused */
+
+ // AC (Login to Client)
+
+ PACKET_ID_AC_ACCEPT_LOGIN = 0x0069,
+ PACKET_ID_AC_ACCEPT_LOGIN2 = 0x0ac4,
+ PACKET_ID_AC_REFUSE_LOGIN = 0x006a,
+ PACKET_ID_SC_NOTIFY_BAN = 0x0081,
+ PACKET_ID_AC_ACK_HASH = 0x01dc,
+ PACKET_ID_AC_REFUSE_LOGIN_R2 = 0x083e,
+};
+
+/* Packets Structs */
+#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
+#pragma pack(push, 1)
+#endif // not NetBSD < 6 / Solaris
+
+/**
+ * Packet structure for CA_LOGIN.
+ */
+struct packet_CA_LOGIN {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_LOGIN)
+ uint32 version; ///< Client Version
+ char id[24]; ///< Username
+ char password[24]; ///< Password
+ uint8 clienttype; ///< Client Type
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_LOGIN2.
+ */
+struct packet_CA_LOGIN2 {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_LOGIN2)
+ uint32 version; ///< Client Version
+ char id[24]; ///< Username
+ uint8 password_md5[16]; ///< Password hash
+ uint8 clienttype; ///< Client Type
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_LOGIN3.
+ */
+struct packet_CA_LOGIN3 {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_LOGIN3)
+ uint32 version; ///< Client Version
+ char id[24]; ///< Username
+ uint8 password_md5[16]; ///< Password hash
+ uint8 clienttype; ///< Client Type
+ uint8 clientinfo; ///< Index of the connection in the clientinfo file (+10 if the command-line contains "pc")
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_LOGIN4.
+ */
+struct packet_CA_LOGIN4 {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_LOGIN4)
+ uint32 version; ///< Client Version
+ char id[24]; ///< Username
+ uint8 password_md5[16]; ///< Password hash
+ uint8 clienttype; ///< Client Type
+ char mac_address[13]; ///< MAC Address
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_LOGIN_PCBANG.
+ */
+struct packet_CA_LOGIN_PCBANG {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_LOGIN_PCBANG)
+ uint32 version; ///< Client Version
+ char id[24]; ///< Username
+ char password[24]; ///< Password
+ uint8 clienttype; ///< Client Type
+ char ip[16]; ///< IP Address
+ char mac_address[13]; ///< MAC Address
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_LOGIN_HAN.
+ */
+struct packet_CA_LOGIN_HAN {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_LOGIN_HAN)
+ uint32 version; ///< Client Version
+ char id[24]; ///< Username
+ char password[24]; ///< Password
+ uint8 clienttype; ///< Client Type
+ char ip[16]; ///< IP Address
+ char mac_address[13]; ///< MAC Address
+ uint8 is_han_game_user; ///< 'isGravityID'
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_SSO_LOGIN_REQ.
+ *
+ * Variable-length packet.
+ */
+struct packet_CA_SSO_LOGIN_REQ {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_SSO_LOGIN_REQ)
+ int16 packet_len; ///< Length (variable length)
+ uint32 version; ///< Clientver
+ uint8 clienttype; ///< Clienttype
+ char id[24]; ///< Username
+ char password[27]; ///< Password
+ int8 mac_address[17]; ///< MAC Address
+ char ip[15]; ///< IP Address
+ char t1[]; ///< SSO Login Token (variable length)
+} __attribute__((packed));
+
+#if 0 // Unused
+struct packet_CA_SSO_LOGIN_REQa {
+ int16 packet_id;
+ int16 packet_len;
+ uint32 version;
+ uint8 clienttype;
+ char id[24];
+ int8 mac_address[17];
+ char ip[15];
+ char t1[];
+} __attribute__((packed));
+#endif // unused
+
+/**
+ * Packet structure for CA_CONNECT_INFO_CHANGED.
+ *
+ * New alive packet. Used to verify if client is always alive.
+ */
+struct packet_CA_CONNECT_INFO_CHANGED {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_CONNECT_INFO_CHANGED)
+ char id[24]; ///< account.userid
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_EXE_HASHCHECK.
+ *
+ * (kRO 2004-05-31aSakexe langtype 0 and 6)
+ */
+struct packet_CA_EXE_HASHCHECK {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_EXE_HASHCHECK)
+ uint8 hash_value[16]; ///< Client MD5 hash
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_REQ_HASH.
+ */
+struct packet_CA_REQ_HASH {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_REQ_HASH)
+} __attribute__((packed));
+
+/**
+ * Packet structure for CA_CHARSERVERCONNECT.
+ *
+ * This packet is used internally, to signal a char-server connection.
+ */
+struct packet_CA_CHARSERVERCONNECT {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_CHARSERVERCONNECT)
+ char userid[24]; ///< Username
+ char password[24]; ///< Password
+ int32 unknown;
+ int32 ip; ///< Charserver IP
+ int16 port; ///< Charserver port
+ char name[20]; ///< Charserver name
+ int16 unknown2;
+ int16 type; ///< Charserver type
+ int16 new; ///< Whether charserver is to be marked as new
+} __attribute__((packed));
+
+/**
+ * Packet structure for SC_NOTIFY_BAN.
+ */
+struct packet_SC_NOTIFY_BAN {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_SC_NOTIFY_BAN)
+ uint8 error_code; ///< Error code
+} __attribute__((packed));
+
+/**
+ * Packet structure for AC_REFUSE_LOGIN.
+ */
+struct packet_AC_REFUSE_LOGIN {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_AC_REFUSE_LOGIN)
+ uint8 error_code; ///< Error code
+ char block_date[20]; ///< Ban expiration date
+} __attribute__((packed));
+
+/**
+ * Packet structure for AC_REFUSE_LOGIN_R2.
+ */
+struct packet_AC_REFUSE_LOGIN_R2 {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_AC_REFUSE_LOGIN_R2)
+ uint32 error_code; ///< Error code
+ char block_date[20]; ///< Ban expiration date
+} __attribute__((packed));
+
+/**
+ * Packet structure for AC_ACCEPT_LOGIN.
+ *
+ * Variable-length packet.
+ */
+struct packet_AC_ACCEPT_LOGIN {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_AC_ACCEPT_LOGIN)
+ int16 packet_len; ///< Packet length (variable length)
+ int32 auth_code; ///< Authentication code
+ uint32 aid; ///< Account ID
+ uint32 user_level; ///< User level
+ uint32 last_login_ip; ///< Last login IP
+ char last_login_time[26]; ///< Last login timestamp
+ uint8 sex; ///< Account sex
+#if PACKETVER >= 20170315
+ char unknown1[17];
+#endif
+ struct {
+ uint32 ip; ///< Server IP address
+ int16 port; ///< Server port
+ char name[20]; ///< Server name
+ uint16 usercount; ///< Online users
+ uint16 state; ///< Server state
+ uint16 property; ///< Server property
+#if PACKETVER >= 20170315
+ char unknown2[128];
+#endif
+ } server_list[]; ///< List of charservers
+} __attribute__((packed));
+
+/**
+ * Packet structure for AC_ACK_HASH.
+ *
+ * Variable-length packet
+ */
+struct packet_AC_ACK_HASH {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_AC_ACK_HASH)
+ int16 packet_len; ///< Packet length (variable length)
+ uint8 secret[]; ///< Challenge string
+} __attribute__((packed));
+
+#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
+#pragma pack(pop)
+#endif // not NetBSD < 6 / Solaris
+
+/**
+ * Login Client Interface additional data
+ */
+struct lclif_interface_dbs {
+ struct login_packet_db packet_db[MAX_PACKET_DB + 1]; ///< Packet database.
+};
+
+/**
+ * Login Client Interface Private Interface
+ */
+struct lclif_interface_private {
+ struct lclif_interface_dbs *dbs;
+
+ /**
+ * Populates the packet database.
+ */
+ void (*packetdb_loaddb)(void);
+
+ /**
+ * Attempts to validate and parse a received packet.
+ *
+ * @param fd Client connection file descriptor.
+ * @param sd Session data.
+ * @return Parse result error code.
+ */
+ enum parsefunc_rcode (*parse_sub)(int fd, struct login_session_data *sd);
+
+ LoginParseFunc *parse_CA_CONNECT_INFO_CHANGED; ///< Packet handler for #packet_CA_CONNECT_INFO_CHANGED.
+ LoginParseFunc *parse_CA_EXE_HASHCHECK; ///< Packet handler for #packet_CA_EXE_HASHCHECK.
+ LoginParseFunc *parse_CA_LOGIN; ///< Packet handler for #packet_CA_LOGIN.
+ LoginParseFunc *parse_CA_LOGIN2; ///< Packet handler for #packet_CA_LOGIN2.
+ LoginParseFunc *parse_CA_LOGIN3; ///< Packet handler for #packet_CA_LOGIN3.
+ LoginParseFunc *parse_CA_LOGIN4; ///< Packet handler for #packet_CA_LOGIN4.
+ LoginParseFunc *parse_CA_LOGIN_PCBANG; ///< Packet handler for #packet_CA_LOGIN_PCBANG.
+ LoginParseFunc *parse_CA_LOGIN_HAN; ///< Packet handler for #packet_CA_LOGIN_HAN.
+ LoginParseFunc *parse_CA_SSO_LOGIN_REQ; ///< Packet handler for #packet_CA_SSO_LOGIN_REQ.
+ LoginParseFunc *parse_CA_REQ_HASH; ///< Packet handler for #packet_CA_REQ_HASH.
+ LoginParseFunc *parse_CA_CHARSERVERCONNECT; ///< Packet handler for #packet_CA_CHARSERVERCONNECT.
+};
+
+#endif // LOGIN_LCLIF_P_H
diff --git a/src/login/login.c b/src/login/login.c
index d4768df86..ae584206f 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#include "login/account.h"
#include "login/ipban.h"
#include "login/loginlog.h"
+#include "login/lclif.h"
#include "common/HPM.h"
#include "common/cbasetypes.h"
#include "common/conf.h"
@@ -43,6 +44,11 @@
#include <stdio.h>
#include <stdlib.h>
+#include <sys/stat.h> // stat()
+
+/** @file
+ * Implementation of the login interface.
+ */
struct login_interface login_s;
struct login_interface *login;
@@ -64,7 +70,7 @@ AccountDB* accounts = NULL;
/**
* @see DBCreateData
*/
-static DBData login_create_online_user(DBKey key, va_list args)
+static struct DBData login_create_online_user(union DBKey key, va_list args)
{
struct online_login_data* p;
CREATE(p, struct online_login_data, 1);
@@ -113,7 +119,7 @@ static int login_waiting_disconnect_timer(int tid, int64 tick, int id, intptr_t
/**
* @see DBApply
*/
-static int login_online_db_setoffline(DBKey key, DBData *data, va_list ap)
+static int login_online_db_setoffline(union DBKey key, struct DBData *data, va_list ap)
{
struct online_login_data* p = DB->data2ptr(data);
int server_id = va_arg(ap, int);
@@ -135,7 +141,7 @@ static int login_online_db_setoffline(DBKey key, DBData *data, va_list ap)
/**
* @see DBApply
*/
-static int login_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap)
+static int login_online_data_cleanup_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct online_login_data *character= DB->data2ptr(data);
nullpo_ret(character);
@@ -235,7 +241,7 @@ bool login_check_encrypted(const char* str1, const char* str2, const char* passw
nullpo_ret(str2);
nullpo_ret(passwd);
safesnprintf(tmpstr, sizeof(tmpstr), "%s%s", str1, str2);
- MD5_String(tmpstr, md5str);
+ md5->string(tmpstr, md5str);
return (0==strcmp(passwd, md5str));
}
@@ -353,7 +359,7 @@ void login_fromchar_parse_request_change_email(int fd, int id, const char *const
char email[40];
int account_id = RFIFOL(fd,2);
- safestrncpy(email, (char*)RFIFOP(fd,6), 40); remove_control_chars(email);
+ safestrncpy(email, RFIFOP(fd,6), 40); remove_control_chars(email);
RFIFOSKIP(fd,46);
if( e_mail_check(email) == 0 )
@@ -392,22 +398,22 @@ void login_fromchar_account(int fd, int account_id, struct mmo_account *acc)
if (pincode[0] == '\0')
memset(pincode,'\0',sizeof(pincode));
- safestrncpy((char*)WFIFOP(fd,6), email, 40);
+ safestrncpy(WFIFOP(fd,6), email, 40);
WFIFOL(fd,46) = (uint32)expiration_time;
WFIFOB(fd,50) = (unsigned char)group_id;
WFIFOB(fd,51) = char_slots;
- safestrncpy((char*)WFIFOP(fd,52), birthdate, 10+1);
- safestrncpy((char*)WFIFOP(fd,63), pincode, 4+1 );
+ safestrncpy(WFIFOP(fd,52), birthdate, 10+1);
+ safestrncpy(WFIFOP(fd,63), pincode, 4+1 );
WFIFOL(fd,68) = acc->pincode_change;
}
else
{
- safestrncpy((char*)WFIFOP(fd,6), "", 40);
+ safestrncpy(WFIFOP(fd,6), "", 40);
WFIFOL(fd,46) = 0;
WFIFOB(fd,50) = 0;
WFIFOB(fd,51) = 0;
- safestrncpy((char*)WFIFOP(fd,52), "", 10+1);
- safestrncpy((char*)WFIFOP(fd,63), "\0\0\0\0", 4+1 );
+ safestrncpy(WFIFOP(fd,52), "", 10+1);
+ safestrncpy(WFIFOP(fd,63), "\0\0\0\0", 4+1 );
WFIFOL(fd,68) = 0;
}
WFIFOSET(fd,72);
@@ -450,8 +456,8 @@ void login_fromchar_parse_change_email(int fd, int id, const char *const ip)
char new_email[40];
int account_id = RFIFOL(fd,2);
- safestrncpy(actual_email, (char*)RFIFOP(fd,6), 40);
- safestrncpy(new_email, (char*)RFIFOP(fd,46), 40);
+ safestrncpy(actual_email, RFIFOP(fd,6), 40);
+ safestrncpy(new_email, RFIFOP(fd,46), 40);
RFIFOSKIP(fd, 86);
if( e_mail_check(actual_email) == 0 )
@@ -495,12 +501,12 @@ void login_fromchar_parse_account_update(int fd, int id, const char *const ip)
RFIFOSKIP(fd,10);
if( !accounts->load_num(accounts, &acc, account_id) )
- ShowNotice("Char-server '%s': Error of Status change (account: %d not found, suggested status %d, ip: %s).\n", server[id].name, account_id, state, ip);
+ ShowNotice("Char-server '%s': Error of Status change (account: %d not found, suggested status %u, ip: %s).\n", server[id].name, account_id, state, ip);
else
if( acc.state == state )
- ShowNotice("Char-server '%s': Error of Status change - actual status is already the good status (account: %d, status %d, ip: %s).\n", server[id].name, account_id, state, ip);
+ ShowNotice("Char-server '%s': Error of Status change - actual status is already the good status (account: %d, status %u, ip: %s).\n", server[id].name, account_id, state, ip);
else {
- ShowNotice("Char-server '%s': Status change (account: %d, new status %d, ip: %s).\n", server[id].name, account_id, state, ip);
+ ShowNotice("Char-server '%s': Status change (account: %d, new status %u, ip: %s).\n", server[id].name, account_id, state, ip);
acc.state = state;
// Save
@@ -528,12 +534,12 @@ void login_fromchar_parse_ban(int fd, int id, const char *const ip)
struct mmo_account acc;
int account_id = RFIFOL(fd,2);
- int year = (short)RFIFOW(fd,6);
- int month = (short)RFIFOW(fd,8);
- int mday = (short)RFIFOW(fd,10);
- int hour = (short)RFIFOW(fd,12);
- int min = (short)RFIFOW(fd,14);
- int sec = (short)RFIFOW(fd,16);
+ int year = RFIFOW(fd,6);
+ int month = RFIFOW(fd,8);
+ int mday = RFIFOW(fd,10);
+ int hour = RFIFOW(fd,12);
+ int min = RFIFOW(fd,14);
+ int sec = RFIFOW(fd,16);
RFIFOSKIP(fd,18);
if (!accounts->load_num(accounts, &acc, account_id)) {
@@ -684,7 +690,7 @@ void login_fromchar_parse_request_account_reg2(int fd)
void login_fromchar_parse_update_wan_ip(int fd, int id)
{
server[id].ip = ntohl(RFIFOL(fd,2));
- ShowInfo("Updated IP of Server #%d to %d.%d.%d.%d.\n",id, CONVIP(server[id].ip));
+ ShowInfo("Updated IP of Server #%d to %u.%u.%u.%u.\n",id, CONVIP(server[id].ip));
RFIFOSKIP(fd,6);
}
@@ -700,7 +706,7 @@ void login_fromchar_parse_change_pincode(int fd)
struct mmo_account acc;
if (accounts->load_num(accounts, &acc, RFIFOL(fd,2))) {
- safestrncpy(acc.pincode, (char*)RFIFOP(fd,6), sizeof(acc.pincode));
+ safestrncpy(acc.pincode, RFIFOP(fd,6), sizeof(acc.pincode));
acc.pincode_change = ((unsigned int)time(NULL));
accounts->save(accounts, &acc);
}
@@ -733,22 +739,22 @@ void login_fromchar_accinfo(int fd, int account_id, int u_fd, int u_aid, int u_g
{
WFIFOHEAD(fd,183);
WFIFOW(fd,0) = 0x2737;
- safestrncpy((char*)WFIFOP(fd,2), acc->userid, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2), acc->userid, NAME_LENGTH);
if (u_group >= acc->group_id)
- safestrncpy((char*)WFIFOP(fd,26), acc->pass, 33);
+ safestrncpy(WFIFOP(fd,26), acc->pass, 33);
else
memset(WFIFOP(fd,26), '\0', 33);
- safestrncpy((char*)WFIFOP(fd,59), acc->email, 40);
- safestrncpy((char*)WFIFOP(fd,99), acc->last_ip, 16);
+ safestrncpy(WFIFOP(fd,59), acc->email, 40);
+ safestrncpy(WFIFOP(fd,99), acc->last_ip, 16);
WFIFOL(fd,115) = acc->group_id;
- safestrncpy((char*)WFIFOP(fd,119), acc->lastlogin, 24);
+ safestrncpy(WFIFOP(fd,119), acc->lastlogin, 24);
WFIFOL(fd,143) = acc->logincount;
WFIFOL(fd,147) = acc->state;
if (u_group >= acc->group_id)
- safestrncpy((char*)WFIFOP(fd,151), acc->pincode, 5);
+ safestrncpy(WFIFOP(fd,151), acc->pincode, 5);
else
memset(WFIFOP(fd,151), '\0', 5);
- safestrncpy((char*)WFIFOP(fd,156), acc->birthdate, 11);
+ safestrncpy(WFIFOP(fd,156), acc->birthdate, 11);
WFIFOL(fd,167) = map_fd;
WFIFOL(fd,171) = u_fd;
WFIFOL(fd,175) = u_aid;
@@ -813,8 +819,11 @@ int login_parse_fromchar(int fd)
if (VECTOR_LENGTH(HPM->packets[hpParse_FromChar]) > 0) {
int result = HPM->parse_packets(fd,command,hpParse_FromChar);
- if (result == 1)
+ if (result == 1) {
+ if (sockt->session[fd] == NULL)
+ return 0;
continue;
+ }
if (result == 2)
return 0;
}
@@ -1020,7 +1029,7 @@ int login_mmo_auth_new(const char* userid, const char* pass, const char sex, con
acc.sex = sex;
safestrncpy(acc.email, "a@a.com", sizeof(acc.email));
acc.expiration_time = (login->config->start_limited_time != -1) ? time(NULL) + login->config->start_limited_time : 0;
- safestrncpy(acc.lastlogin, "0000-00-00 00:00:00", sizeof(acc.lastlogin));
+ safestrncpy(acc.lastlogin, "(never)", sizeof(acc.lastlogin));
safestrncpy(acc.last_ip, last_ip, sizeof(acc.last_ip));
safestrncpy(acc.birthdate, "0000-00-00", sizeof(acc.birthdate));
safestrncpy(acc.pincode, "\0", sizeof(acc.pincode));
@@ -1057,13 +1066,14 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) {
if (login->config->use_dnsbl) {
char r_ip[16];
char ip_dnsbl[256];
- char* dnsbl_serv;
uint8* sin_addr = (uint8*)&sockt->session[sd->fd]->client_addr;
+ int i;
sprintf(r_ip, "%u.%u.%u.%u", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]);
- for (dnsbl_serv = strtok(login->config->dnsbl_servs,","); dnsbl_serv != NULL; dnsbl_serv = strtok(NULL,",")) {
- sprintf(ip_dnsbl, "%s.%s", r_ip, trim(dnsbl_serv));
+ for (i = 0; i < VECTOR_LENGTH(login->config->dnsbl_servers); i++) {
+ char *dnsbl_server = VECTOR_INDEX(login->config->dnsbl_servers, i);
+ sprintf(ip_dnsbl, "%s.%s", r_ip, trim(dnsbl_server));
if (sockt->host2ip(ip_dnsbl)) {
ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n", r_ip);
return 3;
@@ -1119,7 +1129,7 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) {
}
if( acc.state != 0 ) {
- ShowNotice("Connection refused (account: %s, pass: %s, state: %d, ip: %s)\n", sd->userid, sd->passwd, acc.state, ip);
+ ShowNotice("Connection refused (account: %s, pass: %s, state: %u, ip: %s)\n", sd->userid, sd->passwd, acc.state, ip);
return acc.state - 1;
}
@@ -1181,14 +1191,6 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) {
return -1; // account OK
}
-void login_connection_problem(int fd, uint8 status)
-{
- WFIFOHEAD(fd,3);
- WFIFOW(fd,0) = 0x81;
- WFIFOB(fd,2) = status;
- WFIFOSET(fd,3);
-}
-
void login_kick(struct login_session_data* sd)
{
uint8 buf[6];
@@ -1202,9 +1204,7 @@ void login_auth_ok(struct login_session_data* sd)
{
int fd = 0;
uint32 ip;
- uint8 server_num, n;
struct login_auth_node* node;
- int i;
nullpo_retv(sd);
fd = sd->fd;
@@ -1212,29 +1212,17 @@ void login_auth_ok(struct login_session_data* sd)
if( core->runflag != LOGINSERVER_ST_RUNNING )
{
// players can only login while running
- login->connection_problem(fd, 1); // 01 = server closed
+ lclif->connection_error(fd, 1); // 01 = server closed
return;
}
if (login->config->group_id_to_connect >= 0 && sd->group_id != login->config->group_id_to_connect) {
ShowStatus("Connection refused: the required group id for connection is %d (account: %s, group: %d).\n", login->config->group_id_to_connect, sd->userid, sd->group_id);
- login->connection_problem(fd, 1); // 01 = server closed
+ lclif->connection_error(fd, 1); // 01 = server closed
return;
} else if (login->config->min_group_id_to_connect >= 0 && login->config->group_id_to_connect == -1 && sd->group_id < login->config->min_group_id_to_connect) {
ShowStatus("Connection refused: the minimum group id required for connection is %d (account: %s, group: %d).\n", login->config->min_group_id_to_connect, sd->userid, sd->group_id);
- login->connection_problem(fd, 1); // 01 = server closed
- return;
- }
-
- server_num = 0;
- for( i = 0; i < ARRAYLENGTH(server); ++i )
- if (sockt->session_is_active(server[i].fd))
- server_num++;
-
- if( server_num == 0 )
- {// if no char-server, don't send void list of servers, just disconnect the player with proper message
- ShowStatus("Connection refused: there is no char-server online (account: %s).\n", sd->userid);
- login->connection_problem(fd, 1); // 01 = server closed
+ lclif->connection_error(fd, 1); // 01 = server closed
return;
}
@@ -1249,7 +1237,7 @@ void login_auth_ok(struct login_session_data* sd)
if( data->waiting_disconnect == INVALID_TIMER )
data->waiting_disconnect = timer->add(timer->gettick()+AUTH_TIMEOUT, login->waiting_disconnect_timer, sd->account_id, 0);
- login->connection_problem(fd, 8); // 08 = Server still recognizes your last login
+ lclif->connection_error(fd, 8); // 08 = Server still recognizes your last login
return;
}
else
@@ -1263,42 +1251,16 @@ void login_auth_ok(struct login_session_data* sd)
}
}
+ if (!lclif->server_list(sd)) {
+ // if no char-server, don't send void list of servers, just disconnect the player with proper message
+ ShowStatus("Connection refused: there is no char-server online (account: %s).\n", sd->userid);
+ lclif->connection_error(fd, 1); // 01 = server closed
+ return;
+ }
+
login_log(ip, sd->userid, 100, "login ok");
ShowStatus("Connection of the account '%s' accepted.\n", sd->userid);
- WFIFOHEAD(fd,47+32*server_num);
- WFIFOW(fd,0) = 0x69;
- WFIFOW(fd,2) = 47+32*server_num;
- WFIFOL(fd,4) = sd->login_id1;
- WFIFOL(fd,8) = sd->account_id;
- WFIFOL(fd,12) = sd->login_id2;
- WFIFOL(fd,16) = 0; // in old version, that was for ip (not more used)
- //memcpy(WFIFOP(fd,20), sd->lastlogin, 24); // in old version, that was for name (not more used)
- memset(WFIFOP(fd,20), 0, 24);
- WFIFOW(fd,44) = 0; // unknown
- WFIFOB(fd,46) = sex_str2num(sd->sex);
- for (i = 0, n = 0; i < ARRAYLENGTH(server); ++i) {
- uint32 subnet_char_ip;
-
- if (!sockt->session_is_valid(server[i].fd))
- continue;
-
- subnet_char_ip = login->lan_subnet_check(ip);
- WFIFOL(fd,47+n*32) = htonl((subnet_char_ip) ? subnet_char_ip : server[i].ip);
- WFIFOW(fd,47+n*32+4) = sockt->ntows(htons(server[i].port)); // [!] LE byte order here [!]
- memcpy(WFIFOP(fd,47+n*32+6), server[i].name, 20);
- WFIFOW(fd,47+n*32+26) = server[i].users;
-
- if( server[i].type == CST_PAYING && sd->expiration_time > time(NULL) )
- WFIFOW(fd,47+n*32+28) = CST_NORMAL;
- else
- WFIFOW(fd,47+n*32+28) = server[i].type;
-
- WFIFOW(fd,47+n*32+30) = server[i].new_;
- n++;
- }
- WFIFOSET(fd,47+32*server_num);
-
// create temporary auth entry
CREATE(node, struct login_auth_node, 1);
node->account_id = sd->account_id;
@@ -1323,10 +1285,11 @@ void login_auth_ok(struct login_session_data* sd)
}
}
-void login_auth_failed(struct login_session_data* sd, int result)
+void login_auth_failed(struct login_session_data *sd, int result)
{
int fd;
uint32 ip;
+ time_t ban_time = 0;
nullpo_retv(sd);
fd = sd->fd;
@@ -1365,121 +1328,23 @@ void login_auth_failed(struct login_session_data* sd, int result)
if (result == 1 && login->config->dynamic_pass_failure_ban && !sockt->trusted_ip_check(ip))
ipban_log(ip); // log failed password attempt
-#if PACKETVER >= 20120000 /* not sure when this started */
- WFIFOHEAD(fd,26);
- WFIFOW(fd,0) = 0x83e;
- WFIFOL(fd,2) = result;
- if( result != 6 )
- memset(WFIFOP(fd,6), '\0', 20);
- else { // 6 = Your are Prohibited to log in until %s
- struct mmo_account acc;
- time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0;
- timestamp2string((char*)WFIFOP(fd,6), 20, unban_time, login->config->date_format);
- }
- WFIFOSET(fd,26);
-#else
- WFIFOHEAD(fd,23);
- WFIFOW(fd,0) = 0x6a;
- WFIFOB(fd,2) = (uint8)result;
- if( result != 6 )
- memset(WFIFOP(fd,3), '\0', 20);
- else { // 6 = Your are Prohibited to log in until %s
- struct mmo_account acc;
- time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0;
- timestamp2string((char*)WFIFOP(fd,3), 20, unban_time, login->config->date_format);
- }
- WFIFOSET(fd,23);
-#endif
-}
-
-void login_login_error(int fd, uint8 status)
-{
- WFIFOHEAD(fd,23);
- WFIFOW(fd,0) = 0x6a;
- WFIFOB(fd,2) = status;
- WFIFOSET(fd,23);
-}
-
-void login_parse_ping(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
-void login_parse_ping(int fd, struct login_session_data* sd)
-{
- RFIFOSKIP(fd,26);
-}
-
-void login_parse_client_md5(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
-void login_parse_client_md5(int fd, struct login_session_data* sd)
-{
- sd->has_client_hash = 1;
- memcpy(sd->client_hash, RFIFOP(fd, 2), 16);
-
- RFIFOSKIP(fd,18);
+ if (result == 6) {
+ struct mmo_account acc = { 0 };
+ if (accounts->load_str(accounts, &acc, sd->userid))
+ ban_time = acc.unban_time;
+ }
+ lclif->auth_failed(fd, ban_time, result);
}
-bool login_parse_client_login(int fd, struct login_session_data* sd, const char *const ip) __attribute__((nonnull (2)));
-bool login_parse_client_login(int fd, struct login_session_data* sd, const char *const ip)
+bool login_client_login(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+bool login_client_login(int fd, struct login_session_data *sd)
{
- uint32 version;
- char username[NAME_LENGTH];
- char password[PASSWD_LEN];
- unsigned char passhash[16];
- uint8 clienttype;
int result;
- uint16 command = RFIFOW(fd,0);
- bool israwpass = (command==0x0064 || command==0x0277 || command==0x02b0 || command == 0x0825);
-
- // Shinryo: For the time being, just use token as password.
- if(command == 0x0825)
- {
- char *accname = (char *)RFIFOP(fd, 9);
- char *token = (char *)RFIFOP(fd, 0x5C);
- size_t uAccLen = strlen(accname);
- size_t uTokenLen = RFIFOREST(fd) - 0x5C;
-
- version = RFIFOL(fd,4);
-
- if(uAccLen <= 0 || uTokenLen <= 0) {
- login->auth_failed(sd, 3);
- return true;
- }
-
- safestrncpy(username, accname, NAME_LENGTH);
- safestrncpy(password, token, min(uTokenLen+1, PASSWD_LEN)); // Variable-length field, don't copy more than necessary
- clienttype = RFIFOB(fd, 8);
- }
- else
- {
- version = RFIFOL(fd,2);
- safestrncpy(username, (const char*)RFIFOP(fd,6), NAME_LENGTH);
- if( israwpass )
- {
- safestrncpy(password, (const char*)RFIFOP(fd,30), NAME_LENGTH);
- clienttype = RFIFOB(fd,54);
- }
- else
- {
- memcpy(passhash, RFIFOP(fd,30), 16);
- clienttype = RFIFOB(fd,46);
- }
- }
- RFIFOSKIP(fd,RFIFOREST(fd)); // assume no other packet was sent
+ char ip[16];
+ uint32 ipl = sockt->session[fd]->client_addr;
+ sockt->ip2str(ipl, ip);
- sd->clienttype = clienttype;
- sd->version = version;
- safestrncpy(sd->userid, username, NAME_LENGTH);
- if( israwpass )
- {
- ShowStatus("Request for connection of %s (ip: %s).\n", sd->userid, ip);
- safestrncpy(sd->passwd, password, PASSWD_LEN);
- if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
- sd->passwdenc = PWENC_NONE;
- }
- else
- {
- ShowStatus("Request for connection (passwdenc mode) of %s (ip: %s).\n", sd->userid, ip);
- bin2hex(sd->passwd, passhash, 16); // raw binary data here!
- sd->passwdenc = PASSWORDENC;
- }
+ ShowStatus("Request for connection %sof %s (ip: %s).\n", sd->passwdenc == PASSWORDENC ? " (passwdenc mode)" : "", sd->userid, ip);
if (sd->passwdenc != PWENC_NONE && login->config->use_md5_passwds) {
login->auth_failed(sd, 3); // send "rejected from server"
@@ -1487,32 +1352,12 @@ bool login_parse_client_login(int fd, struct login_session_data* sd, const char
}
result = login->mmo_auth(sd, false);
-
if( result == -1 )
login->auth_ok(sd);
else
login->auth_failed(sd, result);
- return false;
-}
-
-void login_send_coding_key(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
-void login_send_coding_key(int fd, struct login_session_data* sd)
-{
- WFIFOHEAD(fd,4 + sd->md5keylen);
- WFIFOW(fd,0) = 0x01dc;
- WFIFOW(fd,2) = 4 + sd->md5keylen;
- memcpy(WFIFOP(fd,4), sd->md5key, sd->md5keylen);
- WFIFOSET(fd,WFIFOW(fd,2));
-}
-
-void login_parse_request_coding_key(int fd, struct login_session_data* sd) __attribute__((nonnull (2)));
-void login_parse_request_coding_key(int fd, struct login_session_data* sd)
-{
- memset(sd->md5key, '\0', sizeof(sd->md5key));
- sd->md5keylen = (uint16)(12 + rnd() % 4);
- MD5_Salt(sd->md5keylen, sd->md5key);
- login->send_coding_key(fd, sd);
+ return false;
}
void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status) __attribute__((nonnull (2)));
@@ -1524,6 +1369,7 @@ void login_char_server_connection_status(int fd, struct login_session_data* sd,
WFIFOSET(fd,3);
}
+// CA_CHARSERVERCONNECT
void login_parse_request_connection(int fd, struct login_session_data* sd, const char *const ip, uint32 ipl) __attribute__((nonnull (2, 3)));
void login_parse_request_connection(int fd, struct login_session_data* sd, const char *const ip, uint32 ipl)
{
@@ -1535,18 +1381,17 @@ void login_parse_request_connection(int fd, struct login_session_data* sd, const
uint16 new_;
int result;
- safestrncpy(sd->userid, (char*)RFIFOP(fd,2), NAME_LENGTH);
- safestrncpy(sd->passwd, (char*)RFIFOP(fd,26), NAME_LENGTH);
+ safestrncpy(sd->userid, RFIFOP(fd,2), NAME_LENGTH);
+ safestrncpy(sd->passwd, RFIFOP(fd,26), NAME_LENGTH);
if (login->config->use_md5_passwds)
- MD5_String(sd->passwd, sd->passwd);
+ md5->string(sd->passwd, sd->passwd);
sd->passwdenc = PWENC_NONE;
sd->version = login->config->client_version_to_connect; // hack to skip version check
server_ip = ntohl(RFIFOL(fd,54));
server_port = ntohs(RFIFOW(fd,58));
- safestrncpy(server_name, (char*)RFIFOP(fd,60), 20);
+ safestrncpy(server_name, RFIFOP(fd,60), 20);
type = RFIFOW(fd,82);
new_ = RFIFOW(fd,84);
- RFIFOSKIP(fd,86);
ShowInfo("Connection request of the char-server '%s' @ %u.%u.%u.%u:%u (account: '%s', pass: '%s', ip: '%s')\n", server_name, CONVIP(server_ip), server_port, sd->userid, sd->passwd, ip);
sprintf(message, "charserver - %s@%u.%u.%u.%u:%u", server_name, CONVIP(server_ip), server_port);
@@ -1584,121 +1429,6 @@ void login_parse_request_connection(int fd, struct login_session_data* sd, const
}
}
-//----------------------------------------------------------------------------------------
-// Default packet parsing (normal players or char-server connection requests)
-//----------------------------------------------------------------------------------------
-int login_parse_login(int fd)
-{
- struct login_session_data* sd = (struct login_session_data*)sockt->session[fd]->session_data;
-
- char ip[16];
- uint32 ipl = sockt->session[fd]->client_addr;
- sockt->ip2str(ipl, ip);
-
- if( sockt->session[fd]->flag.eof )
- {
- ShowInfo("Closed connection from '"CL_WHITE"%s"CL_RESET"'.\n", ip);
- sockt->close(fd);
- return 0;
- }
-
- if( sd == NULL )
- {
- // Perform ip-ban check
- if (login->config->ipban && !sockt->trusted_ip_check(ipl) && ipban_check(ipl)) {
- ShowStatus("Connection refused: IP isn't authorized (deny/allow, ip: %s).\n", ip);
- login_log(ipl, "unknown", -3, "ip banned");
- login->login_error(fd, 3); // 3 = Rejected from Server
- sockt->eof(fd);
- return 0;
- }
-
- // create a session for this new connection
- CREATE(sockt->session[fd]->session_data, struct login_session_data, 1);
- sd = (struct login_session_data*)sockt->session[fd]->session_data;
- sd->fd = fd;
- }
-
- while (RFIFOREST(fd) >= 2) {
- uint16 command = RFIFOW(fd,0);
-
- if (VECTOR_LENGTH(HPM->packets[hpParse_Login]) > 0) {
- int result = HPM->parse_packets(fd,command,hpParse_Login);
- if (result == 1)
- continue;
- if (result == 2)
- return 0;
- }
-
- switch (command) {
-
- case 0x0200: // New alive packet: structure: 0x200 <account.userid>.24B. used to verify if client is always alive.
- if (RFIFOREST(fd) < 26)
- return 0;
- login->parse_ping(fd, sd);
- break;
-
- // client md5 hash (binary)
- case 0x0204: // S 0204 <md5 hash>.16B (kRO 2004-05-31aSakexe langtype 0 and 6)
- if (RFIFOREST(fd) < 18)
- return 0;
-
- login->parse_client_md5(fd, sd);
- break;
-
- // request client login (raw password)
- case 0x0064: // S 0064 <version>.L <username>.24B <password>.24B <clienttype>.B
- case 0x0277: // S 0277 <version>.L <username>.24B <password>.24B <clienttype>.B <ip address>.16B <adapter address>.13B
- case 0x02b0: // S 02b0 <version>.L <username>.24B <password>.24B <clienttype>.B <ip address>.16B <adapter address>.13B <g_isGravityID>.B
- // request client login (md5-hashed password)
- case 0x01dd: // S 01dd <version>.L <username>.24B <password hash>.16B <clienttype>.B
- case 0x01fa: // S 01fa <version>.L <username>.24B <password hash>.16B <clienttype>.B <?>.B(index of the connection in the clientinfo file (+10 if the command-line contains "pc"))
- case 0x027c: // S 027c <version>.L <username>.24B <password hash>.16B <clienttype>.B <?>.13B(junk)
- case 0x0825: // S 0825 <packetsize>.W <version>.L <clienttype>.B <userid>.24B <password>.27B <mac>.17B <ip>.15B <token>.(packetsize - 0x5C)B
- {
- size_t packet_len = RFIFOREST(fd);
-
- if( (command == 0x0064 && packet_len < 55)
- || (command == 0x0277 && packet_len < 84)
- || (command == 0x02b0 && packet_len < 85)
- || (command == 0x01dd && packet_len < 47)
- || (command == 0x01fa && packet_len < 48)
- || (command == 0x027c && packet_len < 60)
- || (command == 0x0825 && (packet_len < 4 || packet_len < RFIFOW(fd, 2))) )
- return 0;
- }
- {
- if (login->parse_client_login(fd, sd, ip))
- return 0;
- }
- break;
-
- case 0x01db: // Sending request of the coding key
- RFIFOSKIP(fd,2);
- {
- login->parse_request_coding_key(fd, sd);
- }
- break;
-
- case 0x2710: // Connection request of a char-server
- if (RFIFOREST(fd) < 86)
- return 0;
- {
- login->parse_request_connection(fd, sd, ip, ipl);
- }
- return 0; // processing will continue elsewhere
-
- default:
- ShowNotice("Abnormal end of connection (ip: %s): Unknown packet 0x%x\n", ip, command);
- sockt->eof(fd);
- return 0;
- }
- }
-
- return 0;
-}
-
-
void login_config_set_defaults(void)
{
login->config->login_ip = INADDR_ANY;
@@ -1723,150 +1453,432 @@ void login_config_set_defaults(void)
login->config->dynamic_pass_failure_ban_limit = 7;
login->config->dynamic_pass_failure_ban_duration = 5;
login->config->use_dnsbl = false;
- safestrncpy(login->config->dnsbl_servs, "", sizeof(login->config->dnsbl_servs));
+ VECTOR_INIT(login->config->dnsbl_servers);
login->config->client_hash_check = 0;
login->config->client_hash_nodes = NULL;
}
-//-----------------------------------
-// Reading main configuration file
-//-----------------------------------
-int login_config_read(const char *cfgName)
+/**
+ * Reads 'login_configuration/inter' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_inter(const char *filename, struct config_t *config, bool imported)
{
- char line[1024], w1[1024], w2[1024];
- FILE* fp;
- nullpo_retr(1, cfgName);
- fp = fopen(cfgName, "r");
- if (fp == NULL) {
- ShowError("Configuration file (%s) not found.\n", cfgName);
- return 1;
+ struct config_setting_t *setting = NULL;
+ const char *str = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/inter")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/inter was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_uint16(setting, "login_port", &login->config->login_port);
+
+ if (libconfig->setting_lookup_uint32(setting, "ip_sync_interval", &login->config->ip_sync_interval) == CONFIG_TRUE)
+ login->config->ip_sync_interval *= 1000*60; // In minutes
+
+ if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE) {
+ char old_ip_str[16];
+ sockt->ip2str(login->config->login_ip, old_ip_str);
+
+ if ((login->config->login_ip = sockt->host2ip(str)) != 0)
+ ShowStatus("Login server binding IP address : %s -> %s\n", old_ip_str, str);
+ }
+
+ return true;
+}
+
+/**
+ * Reads 'login_configuration.console' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_console(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/console")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/console was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_bool_real(setting, "stdout_with_ansisequence", &showmsg->stdout_with_ansisequence);
+ if (libconfig->setting_lookup_int(setting, "console_silent", &showmsg->silent) == CONFIG_TRUE) {
+ if (showmsg->silent) // only bother if its actually enabled
+ ShowInfo("Console Silent Setting: %d\n", showmsg->silent);
+ }
+ libconfig->setting_lookup_mutable_string(setting, "timestamp_format", showmsg->timestamp_format, sizeof(showmsg->timestamp_format));
+
+ return true;
+}
+
+/**
+ * Reads 'login_configuration.log' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_log(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/log")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/log was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_bool_real(setting, "log_login", &login->config->log_login);
+ libconfig->setting_lookup_mutable_string(setting, "date_format", login->config->date_format, sizeof(login->config->date_format));
+ return true;
+}
+
+/**
+ * Reads 'login_configuration.account' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_account(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+ AccountDB *db = account_engine[0].db;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/account")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/account was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_bool_real(setting, "new_account", &login->config->new_account_flag);
+ libconfig->setting_lookup_bool_real(setting, "new_acc_length_limit", &login->config->new_acc_length_limit);
+
+ libconfig->setting_lookup_int(setting, "allowed_regs", &login->config->allowed_regs);
+ libconfig->setting_lookup_int(setting, "time_allowed", &login->config->time_allowed);
+ libconfig->setting_lookup_int(setting, "start_limited_time", &login->config->start_limited_time);
+ libconfig->setting_lookup_bool_real(setting, "use_MD5_passwords", &login->config->use_md5_passwds);
+
+ if (!db->set_property(db, config, imported))
+ retval = false;
+ if (!ipban_config_read(filename, config, imported))
+ retval = false;
+
+ return retval;
+}
+
+/**
+ * Frees login->config->client_hash_nodes
+ **/
+void clear_client_hash_nodes(void)
+{
+ struct client_hash_node *node = login->config->client_hash_nodes;
+
+ while (node != NULL) {
+ struct client_hash_node *next = node->next;
+ aFree(node);
+ node = next;
}
- while(fgets(line, sizeof(line), fp)) {
- if (line[0] == '/' && line[1] == '/')
- continue;
- if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) < 2)
+ login->config->client_hash_nodes = NULL;
+}
+
+/**
+ * Reads information from login_configuration.permission.hash.md5_hashes.
+ *
+ * @param setting The setting to read from.
+ */
+void login_config_set_md5hash(struct config_setting_t *setting)
+{
+ int i;
+ int count = libconfig->setting_length(setting);
+
+ clear_client_hash_nodes();
+
+ // There's no need to parse if it's disabled or if there's no list
+ if (count <= 0 || !login->config->client_hash_check)
+ return;
+
+ for (i = 0; i < count; i++) {
+ int j;
+ int group_id = 0;
+ char md5hash[33];
+ struct client_hash_node *nnode = NULL;
+ struct config_setting_t *item = libconfig->setting_get_elem(setting, i);
+
+ if (item == NULL)
continue;
- if(!strcmpi(w1,"timestamp_format"))
- safestrncpy(showmsg->timestamp_format, w2, 20);
- else if(!strcmpi(w1,"stdout_with_ansisequence"))
- showmsg->stdout_with_ansisequence = config_switch(w2) ? true : false;
- else if(!strcmpi(w1,"console_silent")) {
- showmsg->silent = atoi(w2);
- if (showmsg->silent) /* only bother if we actually have this enabled */
- ShowInfo("Console Silent Setting: %d\n", atoi(w2));
- }
- else if( !strcmpi(w1, "bind_ip") ) {
- login->config->login_ip = sockt->host2ip(w2);
- if (login->config->login_ip) {
- char ip_str[16];
- ShowStatus("Login server binding IP address : %s -> %s\n", w2, sockt->ip2str(login->config->login_ip, ip_str));
- }
+ if (libconfig->setting_lookup_int(item, "group_id", &group_id) != CONFIG_TRUE) {
+ ShowWarning("login_config_set_md5hash: entry (%d) is missing group_id! Ignoring...\n", i);
+ continue;
}
- else if( !strcmpi(w1, "login_port") ) {
- login->config->login_port = (uint16)atoi(w2);
+
+ if (libconfig->setting_lookup_mutable_string(item, "hash", md5hash, sizeof(md5hash)) != CONFIG_TRUE) {
+ ShowWarning("login_config_set_md5hash: entry (%d) is missing hash! Ignoring...\n", i);
+ continue;
}
- else if(!strcmpi(w1, "log_login"))
- login->config->log_login = (bool)config_switch(w2);
-
- else if(!strcmpi(w1, "new_account"))
- login->config->new_account_flag = (bool)config_switch(w2);
- else if(!strcmpi(w1, "new_acc_length_limit"))
- login->config->new_acc_length_limit = (bool)config_switch(w2);
- else if(!strcmpi(w1, "start_limited_time"))
- login->config->start_limited_time = atoi(w2);
- else if(!strcmpi(w1, "check_client_version"))
- login->config->check_client_version = (bool)config_switch(w2);
- else if(!strcmpi(w1, "client_version_to_connect"))
- login->config->client_version_to_connect = (unsigned int)strtoul(w2, NULL, 10);
- else if(!strcmpi(w1, "use_MD5_passwords"))
- login->config->use_md5_passwds = (bool)config_switch(w2);
- else if(!strcmpi(w1, "group_id_to_connect"))
- login->config->group_id_to_connect = atoi(w2);
- else if(!strcmpi(w1, "min_group_id_to_connect"))
- login->config->min_group_id_to_connect = atoi(w2);
- else if(!strcmpi(w1, "date_format"))
- safestrncpy(login->config->date_format, w2, sizeof(login->config->date_format));
- else if(!strcmpi(w1, "allowed_regs")) //account flood protection system
- login->config->allowed_regs = atoi(w2);
- else if(!strcmpi(w1, "time_allowed"))
- login->config->time_allowed = atoi(w2);
- else if(!strcmpi(w1, "use_dnsbl"))
- login->config->use_dnsbl = (bool)config_switch(w2);
- else if(!strcmpi(w1, "dnsbl_servers"))
- safestrncpy(login->config->dnsbl_servs, w2, sizeof(login->config->dnsbl_servs));
- else if(!strcmpi(w1, "ipban_cleanup_interval"))
- login->config->ipban_cleanup_interval = (unsigned int)atoi(w2);
- else if(!strcmpi(w1, "ip_sync_interval"))
- login->config->ip_sync_interval = (unsigned int)1000*60*atoi(w2); //w2 comes in minutes.
- else if(!strcmpi(w1, "client_hash_check"))
- login->config->client_hash_check = config_switch(w2);
- else if(!strcmpi(w1, "client_hash")) {
- int group = 0;
- char md5[33];
- memset(md5, '\0', 33);
-
- if (sscanf(w2, "%d, %32s", &group, md5) == 2) {
- struct client_hash_node *nnode;
- CREATE(nnode, struct client_hash_node, 1);
-
- if (strcmpi(md5, "disabled") == 0) {
- nnode->hash[0] = '\0';
- } else {
- int i;
- for (i = 0; i < 32; i += 2) {
- char buf[3];
- unsigned int byte;
-
- memcpy(buf, &md5[i], 2);
- buf[2] = 0;
-
- sscanf(buf, "%x", &byte);
- nnode->hash[i / 2] = (uint8)(byte & 0xFF);
- }
- }
-
- nnode->group_id = group;
- nnode->next = login->config->client_hash_nodes;
-
- login->config->client_hash_nodes = nnode;
+
+ CREATE(nnode, struct client_hash_node, 1);
+ if (strcmpi(md5hash, "disabled") == 0) {
+ nnode->hash[0] = '\0';
+ } else {
+ for (j = 0; j < 32; j += 2) {
+ char buf[3];
+ unsigned int byte;
+
+ memcpy(buf, &md5hash[j], 2);
+ buf[2] = 0;
+
+ sscanf(buf, "%x", &byte);
+ nnode->hash[j / 2] = (uint8)(byte & 0xFF);
}
}
- else if(!strcmpi(w1, "import"))
- login_config_read(w2);
- else
- {
- AccountDB* db = account_engine[0].db;
- if (db)
- db->set_property(db, w1, w2);
- ipban_config_read(w1, w2);
- loginlog_config_read(w1, w2);
- HPM->parseConf(w1, w2, HPCT_LOGIN);
+ nnode->group_id = group_id;
+ nnode->next = login->config->client_hash_nodes; // login->config->client_hash_nodes is initialized before calling this function
+ login->config->client_hash_nodes = nnode;
+ }
+
+ return;
+}
+
+/**
+ * Reads 'login_configuration/permission/hash' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_permission_hash(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/permission/hash")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/permission/hash was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->client_hash_check);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/permission/hash/MD5_hashes")) != NULL)
+ login_config_set_md5hash(setting);
+
+ return true;
+}
+
+/**
+ * Clears login->config->dnsbl_servers, freeing any allocated memory.
+ */
+void clear_dnsbl_servers(void)
+{
+ while (VECTOR_LENGTH(login->config->dnsbl_servers) > 0) {
+ aFree(&VECTOR_POP(login->config->dnsbl_servers));
+ }
+ VECTOR_CLEAR(login->config->dnsbl_servers);
+}
+
+/**
+ * Reads information from login_config/permission/DNS_blacklist/dnsbl_servers.
+ *
+ * @param setting The configuration setting to read from.
+ */
+void login_config_set_dnsbl_servers(struct config_setting_t *setting)
+{
+ int i;
+ int count = libconfig->setting_length(setting);
+
+ clear_dnsbl_servers();
+
+ // There's no need to parse if it's disabled
+ if (count <= 0 || !login->config->use_dnsbl)
+ return;
+
+ VECTOR_ENSURE(login->config->dnsbl_servers, count, 1);
+
+ for (i = 0; i < count; i++) {
+ const char *string = libconfig->setting_get_string_elem(setting, i);
+
+ if (string == NULL || string[0] == '\0')
+ continue;
+
+ VECTOR_PUSH(login->config->dnsbl_servers, aStrdup(string));
+ }
+}
+
+/**
+ * Reads 'login_configuration/permission/DNS_blacklist' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_permission_blacklist(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/permission/DNS_blacklist")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/permission/DNS_blacklist was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->use_dnsbl);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/permission/DNS_blacklist/dnsbl_servers")) != NULL)
+ login_config_set_dnsbl_servers(setting);
+
+ return true;
+}
+
+/**
+ * Reads 'login_configuration.permission' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool login_config_read_permission(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "login_configuration/permission")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("login_config_read: login_configuration/permission was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_int(setting, "group_id_to_connect", &login->config->group_id_to_connect);
+ libconfig->setting_lookup_int(setting, "min_group_id_to_connect", &login->config->min_group_id_to_connect);
+ libconfig->setting_lookup_bool_real(setting, "check_client_version", &login->config->check_client_version);
+ libconfig->setting_lookup_uint32(setting, "client_version_to_connect", &login->config->client_version_to_connect);
+
+ if (!login_config_read_permission_hash(filename, config, imported))
+ retval = false;
+ if (!login_config_read_permission_blacklist(filename, config, imported))
+ retval = false;
+
+ return retval;
+}
+
+/**
+ * Reads the 'login-config' configuration file and initializes required variables.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ **/
+bool login_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->load_file
+
+ if (!login_config_read_inter(filename, &config, imported))
+ retval = false;
+ if (!login_config_read_console(filename, &config, imported))
+ retval = false;
+ if (!login_config_read_log(filename, &config, imported))
+ retval = false;
+ if (!login_config_read_account(filename, &config, imported))
+ retval = false;
+ if (!login_config_read_permission(filename, &config, imported))
+ retval = false;
+
+ if (!loginlog_config_read("conf/common/inter-server.conf", imported)) // Only inter-server
+ retval = false;
+
+ if (!HPM->parse_conf(&config, filename, HPCT_LOGIN, imported))
+ retval = false;
+
+ ShowInfo("Finished reading %s.\n", filename);
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, login->LOGIN_CONF_NAME) == 0) {
+ ShowWarning("login_config_read: Loop detected in %s! Skipping 'import'...\n", filename);
+ } else {
+ if (!login->config_read(import, true))
+ retval = false;
}
}
- fclose(fp);
- ShowInfo("Finished reading %s.\n", cfgName);
- return 0;
+
+ config_destroy(&config);
+ return retval;
}
//--------------------------------------
// Function called at exit of the server
//--------------------------------------
-int do_final(void) {
+int do_final(void)
+{
int i;
- struct client_hash_node *hn = login->config->client_hash_nodes;
ShowStatus("Terminating...\n");
HPM->event(HPET_FINAL);
- while (hn) {
- struct client_hash_node *tmp = hn;
- hn = hn->next;
- aFree(tmp);
- }
+ clear_client_hash_nodes();
+ clear_dnsbl_servers();
login_log(0, "login server", 100, "login server shutdown");
@@ -1893,6 +1905,8 @@ int do_final(void) {
login->fd = -1;
}
+ lclif->final();
+
HPM_login_do_final();
aFree(login->LOGIN_CONF_NAME);
@@ -1945,6 +1959,19 @@ static CMDLINEARG(loginconfig)
login->LOGIN_CONF_NAME = aStrdup(params);
return true;
}
+
+/**
+ * --run-once handler
+ *
+ * Causes the server to run its loop once, and shutdown. Useful for testing.
+ * @see cmdline->exec
+ */
+static CMDLINEARG(runonce)
+{
+ core->runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* --net-config handler
*
@@ -1962,6 +1989,7 @@ static CMDLINEARG(netconfig)
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(login-config, loginconfig, "Alternative login-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative subnet configuration.", CMDLINE_OPT_PARAM);
}
@@ -1982,20 +2010,43 @@ int do_init(int argc, char** argv)
}
login_defaults();
+ lclif_defaults();
// read login-server configuration
login->config_set_defaults();
- login->LOGIN_CONF_NAME = aStrdup("conf/login-server.conf");
+ login->LOGIN_CONF_NAME = aStrdup("conf/login/login-server.conf");
login->NET_CONF_NAME = aStrdup("conf/network.conf");
+ {
+ // TODO: Remove this when no longer needed.
+#define CHECK_OLD_LOCAL_CONF(oldname, newname) do { \
+ if (stat((oldname), &fileinfo) == 0 && fileinfo.st_size > 0) { \
+ ShowWarning("An old configuration file \"%s\" was found.\n", (oldname)); \
+ ShowWarning("If it contains settings you wish to keep, please merge them into \"%s\".\n", (newname)); \
+ ShowWarning("Otherwise, just delete it.\n"); \
+ ShowInfo("Resuming in 10 seconds...\n"); \
+ HSleep(10); \
+ } \
+} while (0)
+ struct stat fileinfo;
+
+ CHECK_OLD_LOCAL_CONF("conf/import/login_conf.txt", "conf/import/login-server.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/inter_conf.txt", "conf/import/inter-server.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/packet_conf.txt", "conf/import/socket.conf");
+
+#undef CHECK_OLD_LOCAL_CONF
+ }
+
+ lclif->init();
+
HPM_login_do_init();
cmdline->exec(argc, argv, CMDLINE_OPT_PREINIT);
HPM->config_read();
HPM->event(HPET_PRE_INIT);
cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL);
- login_config_read(login->LOGIN_CONF_NAME);
+ login->config_read(login->LOGIN_CONF_NAME, false);
sockt->net_config_read(login->NET_CONF_NAME);
for( i = 0; i < ARRAYLENGTH(server); ++i )
@@ -2015,8 +2066,8 @@ int do_init(int argc, char** argv)
// Interserver auth init
login->auth_db = idb_alloc(DB_OPT_RELEASE_DATA);
- // set default parser as login_parse_login function
- sockt->set_defaultparse(login->parse_login);
+ // set default parser as lclif->parse function
+ sockt->set_defaultparse(lclif->parse);
// every 10 minutes cleanup online account db.
timer->add_func_list(login->online_data_cleanup, "login->online_data_cleanup");
@@ -2108,19 +2159,12 @@ void login_defaults(void) {
login->fromchar_parse_accinfo = login_fromchar_parse_accinfo;
login->parse_fromchar = login_parse_fromchar;
- login->parse_login = login_parse_login;
- login->parse_ping = login_parse_ping;
- login->parse_client_md5 = login_parse_client_md5;
- login->parse_client_login = login_parse_client_login;
- login->parse_request_coding_key = login_parse_request_coding_key;
+ login->client_login = login_client_login;
login->parse_request_connection = login_parse_request_connection;
login->auth_ok = login_auth_ok;
login->auth_failed = login_auth_failed;
login->char_server_connection_status = login_char_server_connection_status;
- login->connection_problem = login_connection_problem;
login->kick = login_kick;
- login->login_error = login_login_error;
- login->send_coding_key = login_send_coding_key;
login->config_set_defaults = login_config_set_defaults;
login->config_read = login_config_read;
diff --git a/src/login/login.h b/src/login/login.h
index f79f75cb3..5632e6529 100644
--- a/src/login/login.h
+++ b/src/login/login.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -26,6 +26,10 @@
#include "common/db.h"
#include "common/mmo.h" // NAME_LENGTH,SEX_*
+/** @file
+ * Login interface.
+ */
+
struct mmo_account;
struct AccountDB;
@@ -93,8 +97,8 @@ struct Login_Config {
uint32 login_ip; ///< the address to bind to
uint16 login_port; ///< the port to bind to
- unsigned int ipban_cleanup_interval; ///< interval (in seconds) to clean up expired IP bans
- unsigned int ip_sync_interval; ///< interval (in minutes) to execute a DNS/IP update (for dynamic IPs)
+ uint32 ipban_cleanup_interval; ///< interval (in seconds) to clean up expired IP bans
+ uint32 ip_sync_interval; ///< interval (in minutes) to execute a DNS/IP update (for dynamic IPs)
bool log_login; ///< whether to log login server actions or not
char date_format[32]; ///< date format used in messages
bool new_account_flag,new_acc_length_limit; ///< auto-registration via _M/_F ? / if yes minimum length is 4?
@@ -109,13 +113,14 @@ struct Login_Config {
bool ipban; ///< perform IP blocking (via contents of `ipbanlist`) ?
bool dynamic_pass_failure_ban; ///< automatic IP blocking due to failed login attemps ?
- unsigned int dynamic_pass_failure_ban_interval; ///< how far to scan the loginlog for password failures
- unsigned int dynamic_pass_failure_ban_limit; ///< number of failures needed to trigger the ipban
- unsigned int dynamic_pass_failure_ban_duration; ///< duration of the ipban
+ uint32 dynamic_pass_failure_ban_interval; ///< how far to scan the loginlog for password failures
+ uint32 dynamic_pass_failure_ban_limit; ///< number of failures needed to trigger the ipban
+ uint32 dynamic_pass_failure_ban_duration; ///< duration of the ipban
bool use_dnsbl; ///< dns blacklist blocking ?
- char dnsbl_servs[1024]; ///< comma-separated list of dnsbl servers
+ VECTOR_DECL(char *) dnsbl_servers; ///< dnsbl servers
- int client_hash_check; ///< flags for checking client md5
+ bool client_hash_check; ///< flags for checking client md5
+ // TODO: VECTOR candidate
struct client_hash_node *client_hash_nodes; ///< linked list containg md5 hash for each gm group
};
@@ -149,8 +154,8 @@ struct online_login_data {
* Login.c Interface
**/
struct login_interface {
- DBMap* auth_db;
- DBMap* online_db;
+ struct DBMap *auth_db;
+ struct DBMap *online_db;
int fd;
struct Login_Config *config;
struct AccountDB* accounts;
@@ -158,11 +163,11 @@ struct login_interface {
int (*mmo_auth) (struct login_session_data* sd, bool isServer);
int (*mmo_auth_new) (const char* userid, const char* pass, const char sex, const char* last_ip);
int (*waiting_disconnect_timer) (int tid, int64 tick, int id, intptr_t data);
- DBData (*create_online_user) (DBKey key, va_list args);
+ struct DBData (*create_online_user) (union DBKey key, va_list args);
struct online_login_data* (*add_online_user) (int char_server, int account_id);
void (*remove_online_user) (int account_id);
- int (*online_db_setoffline) (DBKey key, DBData *data, va_list ap);
- int (*online_data_cleanup_sub) (DBKey key, DBData *data, va_list ap);
+ int (*online_db_setoffline) (union DBKey key, struct DBData *data, va_list ap);
+ int (*online_data_cleanup_sub) (union DBKey key, struct DBData *data, va_list ap);
int (*online_data_cleanup) (int tid, int64 tick, int id, intptr_t data);
int (*sync_ip_addresses) (int tid, int64 tick, int id, intptr_t data);
bool (*check_encrypted) (const char* str1, const char* str2, const char* passwd);
@@ -196,21 +201,14 @@ struct login_interface {
bool (*fromchar_parse_wrong_pincode) (int fd);
void (*fromchar_parse_accinfo) (int fd);
int (*parse_fromchar) (int fd);
- void (*connection_problem) (int fd, uint8 status);
void (*kick) (struct login_session_data* sd);
void (*auth_ok) (struct login_session_data* sd);
void (*auth_failed) (struct login_session_data* sd, int result);
- void (*login_error) (int fd, uint8 status);
- void (*parse_ping) (int fd, struct login_session_data* sd);
- void (*parse_client_md5) (int fd, struct login_session_data* sd);
- bool (*parse_client_login) (int fd, struct login_session_data* sd, const char *ip);
- void (*send_coding_key) (int fd, struct login_session_data* sd);
- void (*parse_request_coding_key) (int fd, struct login_session_data* sd);
+ bool (*client_login) (int fd, struct login_session_data *sd);
void (*char_server_connection_status) (int fd, struct login_session_data* sd, uint8 status);
void (*parse_request_connection) (int fd, struct login_session_data* sd, const char *ip, uint32 ipl);
- int (*parse_login) (int fd);
void (*config_set_defaults) (void);
- int (*config_read) (const char *cfgName);
+ bool (*config_read) (const char *filename, bool included);
char *LOGIN_CONF_NAME;
char *NET_CONF_NAME; ///< Network configuration filename
};
diff --git a/src/login/loginlog.h b/src/login/loginlog.h
index efb0873bd..589bc4fa1 100644
--- a/src/login/loginlog.h
+++ b/src/login/loginlog.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -29,7 +29,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes);
void login_log(uint32 ip, const char* username, int rcode, const char* message);
bool loginlog_init(void);
bool loginlog_final(void);
-bool loginlog_config_read(const char* w1, const char* w2);
+bool loginlog_config_read(const char *filename, bool imported);
#endif // HERCULES_CORE
#endif /* LOGIN_LOGINLOG_H */
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c
index f26d9890f..7dff14990 100644
--- a/src/login/loginlog_sql.c
+++ b/src/login/loginlog_sql.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,31 +23,26 @@
#include "loginlog.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/mmo.h"
#include "common/nullpo.h"
+#include "common/showmsg.h"
#include "common/socket.h"
#include "common/sql.h"
#include "common/strlib.h"
#include <stdlib.h> // exit
-// global sql settings (in ipban_sql.c)
-static char global_db_hostname[32] = "127.0.0.1";
-static uint16 global_db_port = 3306;
-static char global_db_username[32] = "ragnarok";
-static char global_db_password[100] = "ragnarok";
-static char global_db_database[32] = "ragnarok";
-static char global_codepage[32] = "";
-// local sql settings
-static char log_db_hostname[32] = "";
-static uint16 log_db_port = 0;
-static char log_db_username[32] = "";
-static char log_db_password[100] = "";
-static char log_db_database[32] = "";
+// Sql settings
+static char log_db_hostname[32] = "127.0.0.1";
+static uint16 log_db_port = 3306;
+static char log_db_username[32] = "ragnarok";
+static char log_db_password[100] = "ragnarok";
+static char log_db_database[32] = "ragnarok";
static char log_codepage[32] = "";
static char log_login_db[256] = "loginlog";
-static Sql* sql_handle = NULL;
+static struct Sql *sql_handle = NULL;
static bool enabled = false;
@@ -59,7 +54,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes)
if( !enabled )
return 0;
- if( SQL_ERROR == SQL->Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE",
+ if( SQL_ERROR == SQL->Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %u MINUTE",
log_login_db, sockt->ip2str(ip,NULL), minutes) )// how many times failed account? in one ip.
Sql_ShowDebug(sql_handle);
@@ -102,42 +97,16 @@ void login_log(uint32 ip, const char* username, int rcode, const char* message)
bool loginlog_init(void)
{
- const char* username;
- const char* password;
- const char* hostname;
- uint16 port;
- const char* database;
- const char* codepage;
-
- if( log_db_hostname[0] != '\0' )
- {// local settings
- username = log_db_username;
- password = log_db_password;
- hostname = log_db_hostname;
- port = log_db_port;
- database = log_db_database;
- codepage = log_codepage;
- }
- else
- {// global settings
- username = global_db_username;
- password = global_db_password;
- hostname = global_db_hostname;
- port = global_db_port;
- database = global_db_database;
- codepage = global_codepage;
- }
-
sql_handle = SQL->Malloc();
- if( SQL_ERROR == SQL->Connect(sql_handle, username, password, hostname, port, database) )
- {
+ if (SQL_ERROR == SQL->Connect(sql_handle, log_db_username, log_db_password,
+ log_db_hostname, log_db_port, log_db_database)) {
Sql_ShowDebug(sql_handle);
SQL->Free(sql_handle);
exit(EXIT_FAILURE);
}
- if( codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, codepage) )
+ if (log_codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, log_codepage))
Sql_ShowDebug(sql_handle);
enabled = true;
@@ -152,60 +121,105 @@ bool loginlog_final(void)
return true;
}
-bool loginlog_config_read(const char* key, const char* value)
+/**
+ * Reads 'inter_configuration/database_names' and initializes required
+ * variables/Sets global configuration.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool loginlog_config_read_names(const char *filename, struct config_t *config, bool imported)
{
- const char* signature;
+ struct config_setting_t *setting = NULL;
- nullpo_ret(key);
- nullpo_ret(value);
- signature = "sql.";
- if( strncmpi(key, signature, strlen(signature)) == 0 )
- {
- key += strlen(signature);
- if( strcmpi(key, "db_hostname") == 0 )
- safestrncpy(global_db_hostname, value, sizeof(global_db_hostname));
- else
- if( strcmpi(key, "db_port") == 0 )
- global_db_port = (uint16)strtoul(value, NULL, 10);
- else
- if( strcmpi(key, "db_username") == 0 )
- safestrncpy(global_db_username, value, sizeof(global_db_username));
- else
- if( strcmpi(key, "db_password") == 0 )
- safestrncpy(global_db_password, value, sizeof(global_db_password));
- else
- if( strcmpi(key, "db_database") == 0 )
- safestrncpy(global_db_database, value, sizeof(global_db_database));
- else
- if( strcmpi(key, "codepage") == 0 )
- safestrncpy(global_codepage, value, sizeof(global_codepage));
- else
- return false;// not found
- return true;
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/database_names")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("loginlog_config_read: inter_configuration/database_names was not found in %s!\n", filename);
+ return false;
}
- if( strcmpi(key, "log_db_ip") == 0 )
- safestrncpy(log_db_hostname, value, sizeof(log_db_hostname));
- else
- if( strcmpi(key, "log_db_port") == 0 )
- log_db_port = (uint16)strtoul(value, NULL, 10);
- else
- if( strcmpi(key, "log_db_id") == 0 )
- safestrncpy(log_db_username, value, sizeof(log_db_username));
- else
- if( strcmpi(key, "log_db_pw") == 0 )
- safestrncpy(log_db_password, value, sizeof(log_db_password));
- else
- if( strcmpi(key, "log_db_db") == 0 )
- safestrncpy(log_db_database, value, sizeof(log_db_database));
- else
- if( strcmpi(key, "log_codepage") == 0 )
- safestrncpy(log_codepage, value, sizeof(log_codepage));
- else
- if( strcmpi(key, "log_login_db") == 0 )
- safestrncpy(log_login_db, value, sizeof(log_login_db));
- else
+ libconfig->setting_lookup_mutable_string(setting, "login_db", log_login_db, sizeof(log_login_db));
+
+ return true;
+}
+
+/**
+ * Reads 'inter_configuration.log' and initializes required variables/Sets
+ * global configuration.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool loginlog_config_read_log(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/log/sql_connection")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("loginlog_config_read: inter_configuration/log/sql_connection was not found in %s!\n", filename);
return false;
+ }
+
+ libconfig->setting_lookup_mutable_string(setting, "db_hostname", log_db_hostname, sizeof(log_db_hostname));
+ libconfig->setting_lookup_mutable_string(setting, "db_database", log_db_database, sizeof(log_db_database));
+ libconfig->setting_lookup_mutable_string(setting, "db_username", log_db_username, sizeof(log_db_username));
+ libconfig->setting_lookup_mutable_string(setting, "db_password", log_db_password, sizeof(log_db_password));
+
+ libconfig->setting_lookup_uint16(setting, "db_port", &log_db_port);
+ libconfig->setting_lookup_mutable_string(setting, "codepage", log_codepage, sizeof(log_codepage));
return true;
}
+
+/**
+ * Reads 'inter_configuration' and initializes required variables/Sets global
+ * configuration.
+ *
+ * @param filename Path to configuration file.
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ **/
+bool loginlog_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->load_file
+
+ if (!loginlog_config_read_names(filename, &config, imported))
+ retval = false;
+ if (!loginlog_config_read_log(filename, &config, imported))
+ retval = false;
+
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, "conf/common/inter-server.conf") == 0) {
+ ShowWarning("inter_config_read: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!loginlog_config_read(import, true))
+ retval = false;
+ }
+ }
+
+ libconfig->destroy(&config);
+ return retval;
+}
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index 289375323..84544976a 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -31,10 +31,14 @@
#include "common/db.h"
#include "common/des.h"
#include "common/ers.h"
+#include "common/grfio.h"
+#include "common/md5calc.h"
#include "common/memmgr.h"
+#include "common/mutex.h"
#include "common/mapindex.h"
#include "common/mmo.h"
#include "common/nullpo.h"
+#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h"
#include "common/spinlock.h"
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index b5a3d4461..c01826bfb 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -1,7 +1,7 @@
# This file is part of Hercules.
# http://herc.ws - http://github.com/HerculesWS/Hercules
#
-# Copyright (C) 2012-2015 Hercules Dev Team
+# Copyright (C) 2012-2016 Hercules Dev Team
# Copyright (C) Athena Dev Teams
#
# Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
-COMMON_H = $(wildcard $(COMMON_D)/*.h)
+COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h)) ../plugins/HPMHooking.h
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
COMMON_INCLUDE = -I..
@@ -53,10 +53,11 @@ MAP_H = atcommand.h battle.h battleground.h buyingstore.h channel.h chat.h \
mercenary.h mob.h npc.h packets.h packets_struct.h party.h path.h \
pc.h pc_groups.h pet.h quest.h script.h searchstore.h skill.h \
status.h storage.h trade.h unit.h vending.h
+MAP_PH =
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ $(SYSINFO_INC))
+ MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC)
else
MAP_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -95,7 +96,7 @@ help:
Makefile: Makefile.in
@$(MAKE) -C ../.. src/map/Makefile
-$(SYSINFO_INC): $(MAP_C) $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
+$(SYSINFO_INC): $(MAP_C) $(MAP_PH) $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
@echo " MAKE $@"
@$(MAKE) -C ../.. sysinfo
@@ -115,14 +116,8 @@ map-server: ../../map-server@EXEEXT@
../../map-server@EXEEXT@: $(MAP_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
-
-# map object files
-
-obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
- @echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \
+ $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# missing object files
$(COMMON_D)/obj_all/common.a:
@@ -140,3 +135,11 @@ $(MT19937AR_OBJ):
$(LIBCONFIG_OBJ):
@echo " MAKE $@"
@$(MAKE) -C $(LIBCONFIG_D)
+
+.SECONDEXPANSION:
+
+# map object files
+
+obj_sql/%.o: %.c $$(filter %.p.h, $(MAP_PH)) $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
+ @echo " CC $<"
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index bc539837d..19a7e360b 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -132,7 +132,6 @@ bool msg_config_read(const char *cfg_name, bool allow_override) {
int msg_number;
char line[1024], w1[1024], w2[1024];
FILE *fp;
- static int called = 1;
nullpo_retr(false, cfg_name);
if ((fp = fopen(cfg_name, "r")) == NULL) {
@@ -170,21 +169,6 @@ bool msg_config_read(const char *cfg_name, bool allow_override) {
}
fclose(fp);
- if( ++called == 1 ) { //Original
- if( script->lang_export_fp ) {
- int i;
- for(i = 0; i < MAX_MSG;i++) {
- if( atcommand->msg_table[0][i] != NULL ) {
- fprintf(script->lang_export_fp, "msgctxt \"messages.conf\"\n"
- "msgid \"%s\"\n"
- "msgstr \"\"\n",
- atcommand->msg_table[0][i]
- );
- }
- }
- }
- }
-
return true;
}
@@ -223,8 +207,8 @@ ACMD(send)
// read message type as hex number (without the 0x)
if (!*message
- || !((sscanf(message, "len %x", &type)==1 && (len=1, true))
- || sscanf(message, "%x", &type)==1)
+ || !((sscanf(message, "len %x", (unsigned int*)&type)==1 && (len=1, true))
+ || sscanf(message, "%x", (unsigned int*)&type)==1)
) {
clif->message(fd, msg_fd(fd,900)); // Usage:
clif->message(fd, msg_fd(fd,901)); // @send len <packet hex number>
@@ -252,7 +236,7 @@ ACMD(send)
} while(0) //define SKIP_VALUE
#define GET_VALUE(p,num) do { \
- if(sscanf((p), "x%lx", &(num)) < 1 && sscanf((p), "%ld ", &(num)) < 1){\
+ if(sscanf((p), "x%lx", (long unsigned int*)&(num)) < 1 && sscanf((p), "%ld ", &(num)) < 1){\
PARSE_ERROR("Invalid number in:",(p));\
return false;\
}\
@@ -266,22 +250,22 @@ ACMD(send)
clif->message(fd, atcmd_output);
return false;
}
-
+
if (len) {
// show packet length
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,904), type, clif->packet(type)->len); // Packet 0x%x length: %d
clif->message(fd, atcmd_output);
return true;
}
-
+
len = clif->packet(type)->len;
-
+
if (len == -1) {
// dynamic packet
len = SHRT_MAX-4; // maximum length
off = 4;
}
-
+
WFIFOHEAD(sd->fd, len);
WFIFOW(sd->fd,0)=TOW(type);
@@ -482,11 +466,11 @@ ACMD(mapmove) {
x = y = 0; //Invalid cell, use random spot.
}
if (map->list[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif->message(fd, msg_fd(fd,247));
+ clif->message(fd, msg_fd(fd,247)); // You are not authorized to warp to this map.
return false;
}
if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
- clif->message(fd, msg_fd(fd,248));
+ clif->message(fd, msg_fd(fd,248)); // You are not authorized to warp from your current map.
return false;
}
if (pc->setpos(sd, map_index, x, y, CLR_TELEPORT) != 0) {
@@ -547,7 +531,7 @@ ACMD(jumpto) {
return false;
}
- if((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
+ if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -655,7 +639,7 @@ ACMD(who) {
if (pc_get_group_id(pl_sd) > 0) // Player title, if exists
StrBuf->Printf(&buf, msg_fd(fd,344), pcg->get_name(pl_sd->group)); // "(%s) "
StrBuf->Printf(&buf, msg_fd(fd,347), pl_sd->status.base_level, pl_sd->status.job_level,
- pc->job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s"
+ pc->job_name(pl_sd->status.class)); // "| Lv:%d/%d | Job: %s"
break;
}
case 3: {
@@ -764,7 +748,7 @@ ACMD(whogm)
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,915), // BLvl: %d | Job: %s (Lvl: %d)
pl_sd->status.base_level,
- pc->job_name(pl_sd->status.class_), pl_sd->status.job_level);
+ pc->job_name(pl_sd->status.class), pl_sd->status.job_level);
clif->message(fd, atcmd_output);
p = party->search(pl_sd->status.party_id);
@@ -870,7 +854,7 @@ ACMD(storage)
return false;
if (storage->open(sd) == 1) { //Already open.
- clif->message(fd, msg_fd(fd,250));
+ clif->message(fd, msg_fd(fd,250)); // You have already opened your storage. Close it first.
return false;
}
@@ -885,7 +869,7 @@ ACMD(storage)
ACMD(guildstorage)
{
if (!sd->status.guild_id) {
- clif->message(fd, msg_fd(fd,252));
+ clif->message(fd, msg_fd(fd,252)); // You are not in a guild.
return false;
}
@@ -893,12 +877,12 @@ ACMD(guildstorage)
return false;
if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) {
- clif->message(fd, msg_fd(fd,250));
+ clif->message(fd, msg_fd(fd,250)); // You have already opened your storage. Close it first.
return false;
}
if (sd->state.storage_flag == STORAGE_FLAG_GUILD) {
- clif->message(fd, msg_fd(fd,251));
+ clif->message(fd, msg_fd(fd,251)); // You have already opened your guild storage. Close it first.
return false;
}
@@ -953,7 +937,7 @@ ACMD(hide) {
if (sd->disguise != -1 )
status->set_viewdata(&sd->bl, sd->disguise);
else
- status->set_viewdata(&sd->bl, sd->status.class_);
+ status->set_viewdata(&sd->bl, sd->status.class);
clif->message(fd, msg_fd(fd,10)); // Invisible: Off
// increment the number of pvp players on the map
@@ -967,7 +951,7 @@ ACMD(hide) {
map->foreachinmovearea(clif->insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl);
} else {
sd->sc.option |= OPTION_INVISIBLE;
- sd->vd.class_ = INVISIBLE_CLASS;
+ sd->vd.class = INVISIBLE_CLASS;
clif->message(fd, msg_fd(fd,11)); // Invisible: On
// decrement the number of pvp players on the map
@@ -1091,9 +1075,9 @@ ACMD(kami)
sscanf(message, "%199[^\n]", atcmd_output);
if (stristr(info->command, "l") != NULL)
- clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP);
+ clif->broadcast(&sd->bl, atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP);
else
- intif->broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(info->command + 4) == 'b' || *(info->command + 4) == 'B') ? BC_BLUE : BC_YELLOW);
+ intif->broadcast(atcmd_output, (int)strlen(atcmd_output) + 1, (*(info->command + 4) == 'b' || *(info->command + 4) == 'B') ? BC_BLUE : BC_YELLOW);
} else {
if(!*message || (sscanf(message, "%10u %199[^\n]", &color, atcmd_output) < 2)) {
clif->message(fd, msg_fd(fd,981)); // Please enter color and message (usage: @kamic <color> <message>).
@@ -1104,7 +1088,7 @@ ACMD(kami)
clif->message(fd, msg_fd(fd,982)); // Invalid color.
return false;
}
- intif->broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
+ intif->broadcast2(atcmd_output, (int)strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0);
}
return true;
}
@@ -1384,13 +1368,13 @@ ACMD(baselevelup)
clif->message(fd, msg_fd(fd,47)); // Base level can't go any higher.
return false;
} // End Addition
- if ((unsigned int)level > pc->maxbaselv(sd) || (unsigned int)level > pc->maxbaselv(sd) - sd->status.base_level) // fix positive overflow
+ if (level > pc->maxbaselv(sd) || level > pc->maxbaselv(sd) - sd->status.base_level) // fix positive overflow
level = pc->maxbaselv(sd) - sd->status.base_level;
for (i = 0; i < level; i++)
status_point += pc->gets_status_point(sd->status.base_level + i);
sd->status.status_point += status_point;
- sd->status.base_level += (unsigned int)level;
+ sd->status.base_level += level;
status_calc_pc(sd, SCO_FORCE);
status_percent_heal(&sd->bl, 100, 100);
clif->misceffect(&sd->bl, 0);
@@ -1401,7 +1385,7 @@ ACMD(baselevelup)
return false;
}
level*=-1;
- if ((unsigned int)level >= sd->status.base_level)
+ if (level >= sd->status.base_level)
level = sd->status.base_level-1;
for (i = 0; i > -level; i--)
status_point += pc->gets_status_point(sd->status.base_level + i - 1);
@@ -1411,9 +1395,10 @@ ACMD(baselevelup)
sd->status.status_point = 0;
else
sd->status.status_point -= status_point;
- sd->status.base_level -= (unsigned int)level;
+ sd->status.base_level -= level;
clif->message(fd, msg_fd(fd,22)); // Base level lowered.
status_calc_pc(sd, SCO_FORCE);
+ level *= -1;
}
sd->status.base_exp = 0;
clif->updatestatus(sd, SP_STATUSPOINT);
@@ -1423,6 +1408,10 @@ ACMD(baselevelup)
pc->baselevelchanged(sd);
if(sd->status.party_id)
party->send_levelup(sd);
+
+ if (level > 0 && battle_config.atcommand_levelup_events)
+ npc->script_event(sd, NPCE_BASELVUP); // Trigger OnPCBaseLvUpEvent
+
return true;
}
@@ -1442,9 +1431,9 @@ ACMD(joblevelup)
clif->message(fd, msg_fd(fd,23)); // Job level can't go any higher.
return false;
}
- if ((unsigned int)level > pc->maxjoblv(sd) || (unsigned int)level > pc->maxjoblv(sd) - sd->status.job_level) // fix positive overflow
+ if (level > pc->maxjoblv(sd) || level > pc->maxjoblv(sd) - sd->status.job_level) // fix positive overflow
level = pc->maxjoblv(sd) - sd->status.job_level;
- sd->status.job_level += (unsigned int)level;
+ sd->status.job_level += level;
sd->status.skill_point += level;
clif->misceffect(&sd->bl, 1);
clif->message(fd, msg_fd(fd,24)); // Job level raised.
@@ -1454,9 +1443,9 @@ ACMD(joblevelup)
return false;
}
level *=-1;
- if ((unsigned int)level >= sd->status.job_level) // fix negative overflow
+ if (level >= sd->status.job_level) // fix negative overflow
level = sd->status.job_level-1;
- sd->status.job_level -= (unsigned int)level;
+ sd->status.job_level -= level;
if (sd->status.skill_point < level)
pc->resetskill(sd, PCRESETSKILL_NONE); //Reset skills since we need to subtract more points.
if (sd->status.skill_point < level)
@@ -1464,6 +1453,7 @@ ACMD(joblevelup)
else
sd->status.skill_point -= level;
clif->message(fd, msg_fd(fd,25)); // Job level lowered.
+ level *= -1;
}
sd->status.job_exp = 0;
clif->updatestatus(sd, SP_JOBLEVEL);
@@ -1472,6 +1462,9 @@ ACMD(joblevelup)
clif->updatestatus(sd, SP_SKILLPOINT);
status_calc_pc(sd, SCO_FORCE);
+ if (level > 0 && battle_config.atcommand_levelup_events)
+ npc->script_event(sd, NPCE_JOBLVUP); // Trigger OnPCJobLvUpEvent
+
return true;
}
@@ -1511,7 +1504,7 @@ ACMD(help) {
clif->message(fd, atcmd_output);
{ // Display aliases
- DBIterator* iter;
+ struct DBIterator *iter;
AtCommandInfo *command_info;
AliasInfo *alias_info = NULL;
StringBuf buf;
@@ -1721,7 +1714,21 @@ ACMD(bodystyle)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!*message || sscanf(message, "%d", &body_style) < 1) {
+ if ((sd->job & MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS
+ && (sd->job & MAPID_THIRDMASK) != MAPID_GENETIC
+ && (sd->job & MAPID_THIRDMASK) != MAPID_MECHANIC
+ && (sd->job & MAPID_THIRDMASK) != MAPID_ROYAL_GUARD
+ && (sd->job & MAPID_THIRDMASK) != MAPID_ARCH_BISHOP
+ && (sd->job & MAPID_THIRDMASK) != MAPID_RANGER
+ && (sd->job & MAPID_THIRDMASK) != MAPID_WARLOCK
+ && (sd->job & MAPID_THIRDMASK) != MAPID_SHADOW_CHASER
+ && (sd->job & MAPID_THIRDMASK) != MAPID_MINSTRELWANDERER
+ ) {
+ clif->message(fd, msg_fd(fd, 35)); // This job has no alternate body styles.
+ return false;
+ }
+
+ if (*message == '\0' || sscanf(message, "%d", &body_style) < 1) {
sprintf(atcmd_output, "Please, enter a body style (usage: @bodystyle <body ID: %d-%d>).", MIN_BODY_STYLE, MAX_BODY_STYLE);
clif->message(fd, atcmd_output);
return false;
@@ -1729,9 +1736,9 @@ ACMD(bodystyle)
if (body_style >= MIN_BODY_STYLE && body_style <= MAX_BODY_STYLE) {
pc->changelook(sd, LOOK_BODY2, body_style);
- clif->message(fd, msg_txt(36)); // Appearence changed.
+ clif->message(fd, msg_fd(fd, 36)); // Appearence changed.
} else {
- clif->message(fd, msg_txt(37)); // An invalid number was specified.
+ clif->message(fd, msg_fd(fd, 37)); // An invalid number was specified.
return false;
}
@@ -2272,11 +2279,11 @@ ACMD(gat) {
for (y = 2; y >= -2; y--) {
safesnprintf(atcmd_output, sizeof(atcmd_output), "%s (x= %d, y= %d) %02X %02X %02X %02X %02X",
map->list[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y,
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
- map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE),
+ (unsigned int)map->getcell(sd->bl.m, &sd->bl, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE));
clif->message(fd, atcmd_output);
}
@@ -2312,30 +2319,18 @@ ACMD(displaystatus)
ACMD(statuspoint)
{
int point;
- unsigned int new_status_point;
+ int new_status_point;
if (!*message || (point = atoi(message)) == 0) {
clif->message(fd, msg_fd(fd,1010)); // Please enter a number (usage: @stpoint <number of points>).
return false;
}
- if(point < 0)
- {
- if(sd->status.status_point < (unsigned int)(-point))
- {
- new_status_point = 0;
- }
- else
- {
- new_status_point = sd->status.status_point + point;
- }
- }
- else if(UINT_MAX - sd->status.status_point < (unsigned int)point)
- {
- new_status_point = UINT_MAX;
- }
- else
- {
+ if (point < 0 && sd->status.status_point + point < 0) {
+ new_status_point = 0;
+ } else if (point > 0 && (int64)sd->status.status_point + point > INT_MAX) {
+ new_status_point = INT_MAX;
+ } else {
new_status_point = sd->status.status_point + point;
}
@@ -2360,30 +2355,18 @@ ACMD(statuspoint)
ACMD(skillpoint)
{
int point;
- unsigned int new_skill_point;
+ int new_skill_point;
if (!*message || (point = atoi(message)) == 0) {
clif->message(fd, msg_fd(fd,1011)); // Please enter a number (usage: @skpoint <number of points>).
return false;
}
- if(point < 0)
- {
- if(sd->status.skill_point < (unsigned int)(-point))
- {
- new_skill_point = 0;
- }
- else
- {
- new_skill_point = sd->status.skill_point + point;
- }
- }
- else if(UINT_MAX - sd->status.skill_point < (unsigned int)point)
- {
- new_skill_point = UINT_MAX;
- }
- else
- {
+ if (point < 0 && sd->status.skill_point + point < 0) {
+ new_skill_point = 0;
+ } else if (point > 0 && (int64)sd->status.skill_point + point > INT_MAX) {
+ new_skill_point = INT_MAX;
+ } else {
new_skill_point = sd->status.skill_point + point;
}
@@ -2747,7 +2730,7 @@ ACMD(recall) {
return false;
}
- if((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
+ if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -3072,7 +3055,7 @@ ACMD(kick)
return false;
}
- if((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
+ if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -3613,16 +3596,16 @@ ACMD(reloadskilldb)
* @reloadatcommand - reloads conf/atcommand.conf conf/groups.conf
*------------------------------------------*/
ACMD(reloadatcommand) {
- config_t run_test;
+ struct config_t run_test;
- if (libconfig->read_file(&run_test, "conf/groups.conf")) {
+ if (!libconfig->load_file(&run_test, "conf/groups.conf")) {
clif->message(fd, msg_fd(fd,1036)); // Error reading groups.conf, reload failed.
return false;
}
libconfig->destroy(&run_test);
- if (libconfig->read_file(&run_test, map->ATCOMMAND_CONF_FILENAME)) {
+ if (!libconfig->load_file(&run_test, map->ATCOMMAND_CONF_FILENAME)) {
clif->message(fd, msg_fd(fd,1037)); // Error reading atcommand.conf, reload failed.
return false;
}
@@ -3642,7 +3625,9 @@ ACMD(reloadbattleconf)
struct Battle_Config prev_config;
memcpy(&prev_config, &battle_config, sizeof(prev_config));
- battle->config_read(map->BATTLE_CONF_FILENAME);
+ battle->config_read(map->BATTLE_CONF_FILENAME, false);
+ if (prev_config.feature_roulette == 0 && battle_config.feature_roulette == 1 && !clif->parse_roulette_db())
+ battle_config.feature_roulette = 0;
if( prev_config.item_rate_mvp != battle_config.item_rate_mvp
|| prev_config.item_rate_common != battle_config.item_rate_common
@@ -3746,7 +3731,7 @@ ACMD(reloadscript) {
* 1 = Show users in that map and their location
* 2 = Shows NPCs in that map
* 3 = Shows the chats in that map
- TODO# add the missing mapflags e.g. adjust_skill_damage to display
+ * TODO# add the missing mapflags e.g. adjust_skill_damage to display
*------------------------------------------*/
ACMD(mapinfo)
{
@@ -3791,7 +3776,7 @@ ACMD(mapinfo)
if( pl_sd->mapindex == m_index ) {
if( pl_sd->state.vending )
vend_num++;
- else if ((cd = map->id2cd(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd)
+ else if ((cd = map->id2cd(pl_sd->chat_id)) != NULL && cd->usersd[0] == pl_sd)
chat_num++;
}
}
@@ -3970,7 +3955,7 @@ ACMD(mapinfo)
clif->message(fd, msg_fd(fd,1113)); // ----- Chats in Map -----
iter = mapit_getallusers();
for (pl_sd = BL_UCCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); pl_sd = BL_UCCAST(BL_PC, mapit->next(iter))) {
- if ((cd = map->id2cd(pl_sd->chatID)) != NULL && pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd) {
+ if ((cd = map->id2cd(pl_sd->chat_id)) != NULL && pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd) {
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1114), // Chat: %s | Player: %s | Location: %d %d
cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y);
clif->message(fd, atcmd_output);
@@ -4004,7 +3989,7 @@ ACMD(mount_peco)
return false;
}
- if ((sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) {
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) {
if (!pc->checkskill(sd,RK_DRAGONTRAINING)) {
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,213), skill->get_desc(RK_DRAGONTRAINING)); // You need %s to mount!
clif->message(fd, atcmd_output);
@@ -4019,7 +4004,7 @@ ACMD(mount_peco)
}
return true;
}
- if ((sd->class_&MAPID_THIRDMASK) == MAPID_RANGER) {
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_RANGER) {
if (!pc->checkskill(sd,RA_WUGRIDER)) {
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,213), skill->get_desc(RA_WUGRIDER)); // You need %s to mount!
clif->message(fd, atcmd_output);
@@ -4034,7 +4019,7 @@ ACMD(mount_peco)
}
return true;
}
- if ((sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC) {
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC) {
if (!pc_ismadogear(sd)) {
clif->message(sd->fd,msg_fd(fd,1123)); // You have mounted your Mado Gear.
pc->setmadogear(sd, true);
@@ -4044,7 +4029,7 @@ ACMD(mount_peco)
}
return true;
}
- if (sd->class_&MAPID_SWORDMAN && sd->class_&JOBL_2) {
+ if ((sd->job & MAPID_BASEMASK) == MAPID_SWORDMAN && (sd->job & JOBL_2) != 0) {
if (!pc_isridingpeco(sd)) { // if actually no peco
if (!pc->checkskill(sd, KN_RIDING)) {
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,213), skill->get_desc(KN_RIDING)); // You need %s to mount!
@@ -4151,8 +4136,9 @@ ACMD(repairall)
count = 0;
for (i = 0; i < MAX_INVENTORY; i++) {
- if (sd->status.inventory[i].nameid && sd->status.inventory[i].attribute == 1) {
- sd->status.inventory[i].attribute = 0;
+ if (sd->status.inventory[i].nameid && (sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
+ sd->status.inventory[i].attribute |= ATTR_BROKEN;
+ sd->status.inventory[i].attribute ^= ATTR_BROKEN;
clif->produce_effect(sd, 0, sd->status.inventory[i].nameid);
count++;
}
@@ -4909,7 +4895,7 @@ ACMD(broadcast)
}
safesnprintf(atcmd_output, sizeof(atcmd_output), "%s: %s", sd->status.name, message);
- intif->broadcast(atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT);
+ intif->broadcast(atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT);
return true;
}
@@ -4928,7 +4914,7 @@ ACMD(localbroadcast)
safesnprintf(atcmd_output, sizeof(atcmd_output), "%s: %s", sd->status.name, message);
- clif->broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP);
+ clif->broadcast(&sd->bl, atcmd_output, (int)strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP);
return true;
}
@@ -5123,8 +5109,7 @@ ACMD(follow) {
return true;
}
- if ((pl_sd = map->nick2sd((char *)message)) == NULL)
- {
+ if ((pl_sd = map->nick2sd(message)) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -5174,6 +5159,11 @@ ACMD(storeall)
}
}
+ if (sd->storage.received == false) {
+ clif->message(fd, msg_fd(fd, 27)); // "Storage has not been loaded yet"
+ return false;
+ }
+
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
if(sd->status.inventory[i].equip != 0)
@@ -5189,17 +5179,25 @@ ACMD(storeall)
ACMD(clearstorage)
{
- int i, j;
+ int i;
if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) {
clif->message(fd, msg_fd(fd,250));
return false;
}
- j = sd->status.storage.storage_amount;
- for (i = 0; i < j; ++i) {
- storage->delitem(sd, i, sd->status.storage.items[i].amount);
+ if (sd->storage.received == false) {
+ clif->message(fd, msg_fd(fd, 27)); // "Storage has not been loaded yet"
+ return false;
+ }
+
+ for (i = 0; i < VECTOR_LENGTH(sd->storage.item); ++i) {
+ if (VECTOR_INDEX(sd->storage.item, i).nameid == 0)
+ continue; // we skip the already deleted items.
+
+ storage->delitem(sd, i, VECTOR_INDEX(sd->storage.item, i).amount);
}
+
storage->close(sd);
clif->message(fd, msg_fd(fd,1394)); // Your storage was cleaned.
@@ -5262,7 +5260,7 @@ ACMD(clearcart)
for( i = 0; i < MAX_CART; i++ )
if(sd->status.cart[i].nameid > 0)
- pc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER);
+ pc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_COMMAND);
clif->clearcart(fd);
clif->updatestatus(sd,SP_CARTINFO);
@@ -5277,12 +5275,13 @@ ACMD(clearcart)
*------------------------------------------*/
#define MAX_SKILLID_PARTIAL_RESULTS 5
#define MAX_SKILLID_PARTIAL_RESULTS_LEN 74 /* "skill " (6) + "%d:" (up to 5) + "%s" (up to 30) + " (%s)" (up to 33) */
-ACMD(skillid) {
+ACMD(skillid)
+{
int i, found = 0;
size_t skillen;
- DBIterator* iter;
- DBKey key;
- DBData *data;
+ struct DBIterator *iter;
+ union DBKey key;
+ struct DBData *data;
char partials[MAX_SKILLID_PARTIAL_RESULTS][MAX_SKILLID_PARTIAL_RESULTS_LEN];
if (!*message) {
@@ -5601,7 +5600,7 @@ ACMD(changegm) {
return false;
}
- if ((pl_sd=map->nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
+ if ((pl_sd=map->nick2sd(message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) {
clif->message(fd, msg_fd(fd,1184)); // Target character must be online and be a guild member.
return false;
}
@@ -5621,7 +5620,7 @@ ACMD(changeleader) {
return false;
}
- if (party->changeleader(sd, map->nick2sd((char *) message)))
+ if (party->changeleader(sd, map->nick2sd(message)))
return true;
return false;
}
@@ -6380,7 +6379,7 @@ ACMD(trade) {
return false;
}
- if ( (pl_sd = map->nick2sd((char *)message)) == NULL ) {
+ if ((pl_sd = map->nick2sd(message)) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -6423,8 +6422,7 @@ ACMD(unmute) {
return false;
}
- if ((pl_sd = map->nick2sd((char *)message)) == NULL)
- {
+ if ((pl_sd = map->nick2sd(message)) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -6639,9 +6637,9 @@ ACMD(mobinfo)
// stats
if (monster->mexp)
- safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1240), monster->name, monster->jname, monster->sprite, monster->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1240), monster->name, monster->jname, monster->sprite, monster->vd.class); // MVP Monster: '%s'/'%s'/'%s' (%d)
else
- safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1241), monster->name, monster->jname, monster->sprite, monster->vd.class_); // Monster: '%s'/'%s'/'%s' (%d)
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1241), monster->name, monster->jname, monster->sprite, monster->vd.class); // Monster: '%s'/'%s'/'%s' (%d)
clif->message(fd, atcmd_output);
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,1242), monster->lv, monster->status.max_hp, base_exp, job_exp, MOB_HIT(monster), MOB_FLEE(monster)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d
@@ -6778,7 +6776,7 @@ ACMD(showmobs)
clif->message(fd, atcmd_output);
it = mapit_geteachmob();
- for (md = BL_UCCAST(BL_MOB, mapit->first(it)); mapit->next(it); md = BL_UCCAST(BL_MOB, mapit->next(it))) {
+ for (md = BL_UCCAST(BL_MOB, mapit->first(it)); mapit->exists(it); md = BL_UCCAST(BL_MOB, mapit->next(it))) {
if( md->bl.m != sd->bl.m )
continue;
if( mob_id != -1 && md->class_ != mob_id )
@@ -7665,9 +7663,10 @@ ACMD(showdelay)
* @reject - reject invitation
* @leave - leave duel
*------------------------------------------*/
-ACMD(invite) {
+ACMD(invite)
+{
unsigned int did = sd->duel_group;
- struct map_session_data *target_sd = map->nick2sd((char *)message);
+ struct map_session_data *target_sd = map->nick2sd(message);
if (did == 0)
{
@@ -7739,8 +7738,7 @@ ACMD(duel) {
}
duel->create(sd, maxpl);
} else {
- struct map_session_data *target_sd;
- target_sd = map->nick2sd((char *)message);
+ struct map_session_data *target_sd = map->nick2sd(message);
if (target_sd != NULL) {
unsigned int newduel;
if ((newduel = duel->create(sd, 2)) != -1) {
@@ -7835,7 +7833,7 @@ ACMD(cash)
// If this option is set, the message is already sent by pc function
if( !battle_config.cashshop_show_points ){
sprintf(output, msg_fd(fd,505), ret, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
clif->message(fd, output);
}
} else
@@ -7843,7 +7841,7 @@ ACMD(cash)
} else {
if( (ret=pc->paycash(sd, -value, 0)) >= 0){
sprintf(output, msg_fd(fd,410), ret, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
clif->message(fd, output);
} else
clif->message(fd, msg_fd(fd,41)); // Unable to decrease the number/value.
@@ -7854,7 +7852,7 @@ ACMD(cash)
// If this option is set, the message is already sent by pc function
if( !battle_config.cashshop_show_points ){
sprintf(output, msg_fd(fd,506), ret, sd->kafraPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
clif->message(fd, output);
}
} else
@@ -7862,7 +7860,7 @@ ACMD(cash)
} else {
if( (ret=pc->paycash(sd, -value, -value)) >= 0){
sprintf(output, msg_fd(fd,411), ret, sd->kafraPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
clif->message(fd, output);
} else
clif->message(fd, msg_fd(fd,41)); // Unable to decrease the number/value.
@@ -7882,7 +7880,7 @@ ACMD(clone) {
return false;
}
- if ((pl_sd=map->nick2sd((char *)message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
+ if ((pl_sd=map->nick2sd(message)) == NULL && (pl_sd=map->charid2sd(atoi(message))) == NULL) {
clif->message(fd, msg_fd(fd,3)); // Character not found.
return false;
}
@@ -7919,7 +7917,7 @@ ACMD(clone) {
y = sd->bl.y;
}
- if ((x = mob->clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) {
+ if ((x = mob->clone_spawn(pl_sd, sd->bl.m, x, y, "", master, MD_NONE, flag?1:0, 0)) > 0) {
clif->message(fd, msg_fd(fd,128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned.
return true;
}
@@ -7957,7 +7955,7 @@ ACMD(request)
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,278), message); // (@request): %s
intif->wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
- clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output));
+ clif_disp_onlyself(sd, atcmd_output);
clif->message(sd->fd,msg_fd(fd,279)); // @request sent.
return true;
}
@@ -8056,8 +8054,8 @@ ACMD(itemlist)
if( strcmpi(info->command, "storagelist") == 0 ) {
location = "storage";
- items = sd->status.storage.items;
- size = MAX_STORAGE;
+ items = VECTOR_DATA(sd->storage.item);
+ size = VECTOR_LENGTH(sd->storage.item);
} else if( strcmpi(info->command, "cartlist") == 0 ) {
location = "cart";
items = sd->status.cart;
@@ -8078,7 +8076,7 @@ ACMD(itemlist)
const struct item* it = &items[i];
struct item_data* itd;
- if( it->nameid == 0 || (itd = itemdb->exists(it->nameid)) == NULL )
+ if (it->nameid == 0 || (itd = itemdb->exists(it->nameid)) == NULL)
continue;
counter += it->amount;
@@ -8239,7 +8237,7 @@ ACMD(stats)
output_table[14].value = sd->change_level_2nd;
output_table[15].value = sd->change_level_3rd;
- sprintf(job_jobname, "Job - %s %s", pc->job_name(sd->status.class_), "(level %d)");
+ sprintf(job_jobname, "Job - %s %s", pc->job_name(sd->status.class), "(level %d)");
sprintf(output, msg_fd(fd,53), sd->status.name); // '%s' stats:
clif->message(fd, output);
@@ -8352,7 +8350,7 @@ void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommand
char line_buff[CHATBOX_SIZE];
char* cur = line_buff;
AtCommandInfo* cmd;
- DBIterator *iter = db_iterator(atcommand->db);
+ struct DBIterator *iter = db_iterator(atcommand->db);
int count = 0;
memset(line_buff,' ',CHATBOX_SIZE);
@@ -8395,6 +8393,38 @@ void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommand
dbi_destroy(iter);
clif->message(fd,line_buff);
+ if (atcommand->binding_count > 0) {
+ int i, count_bind = 0;
+ int gm_lvl = pc_get_group_level(sd);
+
+ for (i = 0; i < atcommand->binding_count; i++) {
+ if (gm_lvl >= ((type == COMMAND_ATCOMMAND) ? atcommand->binding[i]->group_lv : atcommand->binding[i]->group_lv_char)
+ || (type == COMMAND_ATCOMMAND && atcommand->binding[i]->at_groups[pcg->get_idx(sd->group)] > 0)
+ || (type == COMMAND_CHARCOMMAND && atcommand->binding[i]->char_groups[pcg->get_idx(sd->group)] > 0)) {
+ size_t slen = strlen(atcommand->binding[i]->command);
+ if (count_bind == 0) {
+ cur = line_buff;
+ memset(line_buff, ' ', CHATBOX_SIZE);
+ line_buff[CHATBOX_SIZE - 1] = 0;
+ clif->message(fd, "------------------");
+ clif->message(fd, "Custom commands:");
+ }
+ if (slen + cur - line_buff >= CHATBOX_SIZE) {
+ clif->message(fd, line_buff);
+ cur = line_buff;
+ memset(line_buff, ' ', CHATBOX_SIZE);
+ line_buff[CHATBOX_SIZE - 1] = 0;
+ }
+ memcpy(cur, atcommand->binding[i]->command, slen);
+ cur += slen + (10 - slen % 10);
+ count_bind++;
+ }
+ }
+ if (count_bind > 0)
+ clif->message(fd, line_buff); // Last Line
+ count += count_bind;
+ }
+
safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd,274), count); // "%d commands found."
clif->message(fd, atcmd_output);
@@ -8419,22 +8449,24 @@ ACMD(charcommands)
return true;
}
-/* for new mounts */
+/* For new mounts */
ACMD(cashmount)
{
if (pc_hasmount(sd)) {
- clif->message(fd, msg_fd(fd,1476)); // You are already mounting something else
+ clif->message(fd, msg_fd(fd, 1476)); // You are already mounting something else
return false;
}
- clif->message(sd->fd,msg_fd(fd,1362)); // NOTICE: If you crash with mount your LUA is outdated.
+ clif->message(sd->fd, msg_fd(fd, 1362)); // NOTICE: If you crash with mount your LUA is outdated.
+
if (!sd->sc.data[SC_ALL_RIDING]) {
- clif->message(sd->fd,msg_fd(fd,1363)); // You have mounted.
- sc_start(NULL,&sd->bl,SC_ALL_RIDING,100,25,-1);
+ clif->message(sd->fd, msg_fd(fd, 1363)); // You have mounted.
+ sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION);
} else {
- clif->message(sd->fd,msg_fd(fd,1364)); // You have released your mount.
+ clif->message(sd->fd, msg_fd(fd, 1364)); // You have released your mount.
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
}
+
return true;
}
@@ -8498,30 +8530,34 @@ ACMD(set)
CREATE(data, struct script_data,1);
- if( is_str ) {// string variable
- switch( reg[0] ) {
+ if (is_str) {
+ // string variable
+ const char *str = NULL;
+ switch (reg[0]) {
case '@':
- data->u.str = pc->readregstr(sd, script->add_str(reg));
+ str = pc->readregstr(sd, script->add_str(reg));
break;
case '$':
- data->u.str = mapreg->readregstr(script->add_str(reg));
+ str = mapreg->readregstr(script->add_str(reg));
break;
case '#':
- if( reg[1] == '#' )
- data->u.str = pc_readaccountreg2str(sd, script->add_str(reg));// global
+ if (reg[1] == '#')
+ str = pc_readaccountreg2str(sd, script->add_str(reg));// global
else
- data->u.str = pc_readaccountregstr(sd, script->add_str(reg));// local
+ str = pc_readaccountregstr(sd, script->add_str(reg));// local
break;
default:
- data->u.str = pc_readglobalreg_str(sd, script->add_str(reg));
+ str = pc_readglobalreg_str(sd, script->add_str(reg));
break;
}
- if( data->u.str == NULL || data->u.str[0] == '\0' ) {// empty string
+ if (str == NULL || str[0] == '\0') {
+ // empty string
data->type = C_CONSTSTR;
data->u.str = "";
- } else {// duplicate string
+ } else {
+ // duplicate string
data->type = C_STR;
- data->u.str = aStrdup(data->u.str);
+ data->u.mutstr = aStrdup(str);
}
} else {// integer variable
data->type = C_INT;
@@ -8549,7 +8585,7 @@ ACMD(set)
safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1373),reg,data->u.num); // %s value is now :%d
break;
case C_STR:
- safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1374),reg,data->u.str); // %s value is now :%s
+ safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1374),reg,data->u.mutstr); // %s value is now :%s
break;
case C_CONSTSTR:
safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1375),reg); // %s is empty
@@ -8822,7 +8858,7 @@ ACMD(channel) {
clif->messagecolor_self(fd, channel->config->colors[k], atcmd_output);
}
} else {
- DBIterator *iter = db_iterator(channel->db);
+ struct DBIterator *iter = db_iterator(channel->db);
bool show_all = pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN) ? true : false;
clif->message(fd, msg_fd(fd,1410)); // -- Public Channels
if (channel->config->local) {
@@ -9052,9 +9088,9 @@ ACMD(channel) {
clif->message(fd, atcmd_output);
} else if (strcmpi(subcmd,"banlist") == 0) {
// sub1 = channel name; sub2 = unused; sub3 = unused
- DBIterator *iter = NULL;
- DBKey key;
- DBData *data;
+ struct DBIterator *iter = NULL;
+ union DBKey key;
+ struct DBData *data;
bool isA = pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)?true:false;
if (sub1[0] != '#') {
clif->message(fd, msg_fd(fd,1405));// Channel name must start with a '#'
@@ -9243,7 +9279,12 @@ ACMD(searchstore){
searchstore->open(sd, 99, val);
return true;
}
-ACMD(costume){
+
+/*==========================================
+* @costume
+*------------------------------------------*/
+ACMD(costume)
+{
const char* names[] = {
"Wedding",
"Xmas",
@@ -9252,6 +9293,9 @@ ACMD(costume){
#if PACKETVER >= 20131218
"Oktoberfest",
#endif
+#if PACKETVER >= 20141022
+ "Summer2",
+#endif
};
const int name2id[] = {
SC_WEDDING,
@@ -9261,52 +9305,60 @@ ACMD(costume){
#if PACKETVER >= 20131218
SC_OKTOBERFEST,
#endif
+#if PACKETVER >= 20141022
+ SC_DRESS_UP,
+#endif
};
unsigned short k = 0, len = ARRAYLENGTH(names);
if (!*message) {
- for( k = 0; k < len; k++ ) {
- if( sd->sc.data[name2id[k]] ) {
- safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1473),names[k]);//Costume '%s' removed.
- clif->message(sd->fd,atcmd_output);
- status_change_end(&sd->bl,name2id[k],INVALID_TIMER);
+ for (k = 0; k < len; k++) {
+ if (sd->sc.data[name2id[k]]) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1473), names[k]); // Costume '%s' removed.
+ clif->message(sd->fd, atcmd_output);
+ status_change_end(&sd->bl, name2id[k], INVALID_TIMER);
return true;
}
}
- clif->message(sd->fd,msg_fd(fd,1472));
- for( k = 0; k < len; k++ ) {
- safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1471),names[k]);//-- %s
- clif->message(sd->fd,atcmd_output);
+
+ clif->message(sd->fd, msg_fd(fd, 1472)); // - Available Costumes
+
+ for (k = 0; k < len; k++) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1471), names[k]); //-- %s
+ clif->message(sd->fd, atcmd_output);
}
return false;
}
- for( k = 0; k < len; k++ ) {
- if( sd->sc.data[name2id[k]] ) {
- safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1470),names[k]);// You're already with a '%s' costume, type '@costume' to remove it.
- clif->message(sd->fd,atcmd_output);
+ for (k = 0; k < len; k++) {
+ if (sd->sc.data[name2id[k]]) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1470), names[k]); // You're already with a '%s' costume, type '@costume' to remove it.
+ clif->message(sd->fd, atcmd_output);
return false;
}
}
- for( k = 0; k < len; k++ ) {
- if( strcmpi(message,names[k]) == 0 )
+ for (k = 0; k < len; k++) {
+ if (strcmpi(message,names[k]) == 0)
break;
}
- if( k == len ) {
- safesnprintf(atcmd_output, sizeof(atcmd_output),msg_fd(fd,1469),message);// '%s' is not a known costume
- clif->message(sd->fd,atcmd_output);
+
+ if (k == len) {
+ safesnprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, 1469), message); // '%s' is not a known costume
+ clif->message(sd->fd, atcmd_output);
return false;
}
- sc_start(NULL,&sd->bl, name2id[k], 100, 0, -1);
+ sc_start(NULL, &sd->bl, name2id[k], 100, 0, INFINITE_DURATION);
return true;
}
+
/* for debugging purposes (so users can easily provide us with debug info) */
/* should be trashed as soon as its no longer necessary */
-ACMD(skdebug) {
- safesnprintf(atcmd_output, sizeof(atcmd_output),"second: %u; third: %u", sd->sktree.second, sd->sktree.third);
+ACMD(skdebug)
+{
+ safesnprintf(atcmd_output, sizeof(atcmd_output),"second: %d; third: %d", sd->sktree.second, sd->sktree.third);
clif->message(fd,atcmd_output);
safesnprintf(atcmd_output, sizeof(atcmd_output),"pc_calc_skilltree_normalize_job: %d",pc->calc_skilltree_normalize_job(sd));
clif->message(fd,atcmd_output);
@@ -9729,8 +9781,7 @@ const char* atcommand_checkalias(const char *aliasname) {
/// AtCommand suggestion
void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool is_atcmd_cmd) {
- DBIterator* atcommand_iter;
- DBIterator* alias_iter;
+ struct DBIterator *atcommand_iter, *alias_iter;
AtCommandInfo* command_info = NULL;
AliasInfo* alias_info = NULL;
AtCommandType type = is_atcmd_cmd ? COMMAND_ATCOMMAND : COMMAND_CHARCOMMAND;
@@ -9800,143 +9851,126 @@ void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bo
}
/**
- * Executes an at-command
+ * Executes an at-command.
+ *
* @param fd fd associated to the invoking character
* @param sd sd associated to the invoking character
* @param message atcommand arguments
* @param player_invoked true if the command was invoked by a player, false if invoked by the server (bypassing any restrictions)
+ *
+ * @retval true if the message was recognized as atcommand.
+ * @retval false if the message should be considered a non-command message.
*/
-bool atcommand_exec(const int fd, struct map_session_data *sd, const char *message, bool player_invoked) {
- char charname[NAME_LENGTH], params[100];
- char charname2[NAME_LENGTH];
- char command[100];
+bool atcommand_exec(const int fd, struct map_session_data *sd, const char *message, bool player_invoked)
+{
+ char params[100], command[100];
char output[CHAT_SIZE_MAX];
- //Reconstructed message
+ // Reconstructed message
char atcmd_msg[CHAT_SIZE_MAX];
struct map_session_data *ssd = NULL; //sd for target
- AtCommandInfo * info;
+ AtCommandInfo *info;
+
+ bool is_atcommand = true; // false if it's a charcommand
nullpo_retr(false, sd);
- //Shouldn't happen
- if ( !message || !*message )
+ // Shouldn't happen
+ if (message == NULL || *message == '\0')
return false;
- //Block NOCHAT but do not display it as a normal message
+ // Block NOCHAT but do not display it as a normal message
if (pc_ismuted(&sd->sc, MANNER_NOCOMMAND))
return true;
// skip 10/11-langtype's codepage indicator, if detected
- if ( message[0] == '|' && strlen(message) >= 4 && (message[3] == atcommand->at_symbol || message[3] == atcommand->char_symbol) )
+ if (message[0] == '|' && strlen(message) >= 4 && (message[3] == atcommand->at_symbol || message[3] == atcommand->char_symbol))
message += 3;
- //Should display as a normal message
- if ( *message != atcommand->at_symbol && *message != atcommand->char_symbol )
+ // Should display as a normal message
+ if (*message != atcommand->at_symbol && *message != atcommand->char_symbol)
return false;
if (player_invoked) {
- //Commands are disabled on maps flagged as 'nocommand'
- if ( map->list[sd->bl.m].nocommand && pc_get_group_level(sd) < map->list[sd->bl.m].nocommand ) {
+ // Commands are disabled on maps flagged as 'nocommand'
+ if (map->list[sd->bl.m].nocommand && pc_get_group_level(sd) < map->list[sd->bl.m].nocommand) {
clif->message(fd, msg_fd(fd,143));
return false;
}
}
- if (*message == atcommand->char_symbol) {
- do {
- char params2[100];
- int x, y, z;
-
- //Checks to see if #command has a name or a name + parameters.
- x = sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", command, charname, params);
- y = sscanf(message, "%99s %23s %99[^\n]", command, charname2, params2);
+ if (*message == atcommand->char_symbol)
+ is_atcommand = false;
- //z always has the value of the scan that was successful
- z = ( x > 1 ) ? x : y;
-
- //#command + name means the sufficient target was used and anything else after
- //can be looked at by the actual command function since most scan to see if the
- //right parameters are used.
- if ( x > 2 ) {
- sprintf(atcmd_msg, "%s %s", command, params);
- break;
- }
- else if ( y > 2 ) {
- sprintf(atcmd_msg, "%s %s", command, params2);
- break;
- }
- //Regardless of what style the #command is used, if it's correct, it will always have
- //this value if there is no parameter. Send it as just the #command
- else if ( z == 2 ) {
- sprintf(atcmd_msg, "%s", command);
- break;
- }
+ if (is_atcommand) { // #command
+ sprintf(atcmd_msg, "%s", message);
+ ssd = sd;
+ } else { // @command
+ char charname[NAME_LENGTH];
+ int n;
+
+ // Checks to see if #command has a name or a name + parameters.
+ if ((n = sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", command, charname, params)) < 2
+ && (n = sscanf(message, "%99s %23s %99[^\n]", command, charname, params)) < 2
+ ) {
+ if (pc_get_group_level(sd) == 0) {
+ if (n < 1)
+ return false; // no command found. Display as normal message
- if( !pc_get_group_level(sd) ) {
- if( x >= 1 || y >= 1 ) { /* we have command */
- info = atcommand->get_info_byname(atcommand->check_alias(command + 1));
- if( !info || info->char_groups[pcg->get_idx(sd->group)] == 0 ) /* if we can't use or doesn't exist: don't even display the command failed message */
- return false;
- } else
- return false;/* display as normal message */
+ info = atcommand->get_info_byname(atcommand->check_alias(command + 1));
+ if (info == NULL || info->char_groups[pcg->get_idx(sd->group)] == 0) {
+ /* if we can't use or doesn't exist: don't even display the command failed message */
+ return false;
+ }
}
sprintf(output, msg_fd(fd,1388), atcommand->char_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>).
clif->message(fd, output);
return true;
- } while(0);
- }
- else /*if (*message == atcommand->at_symbol)*/ {
- //atcmd_msg is constructed above differently for charcommands
- //it's copied from message if not a charcommand so it can
- //pass through the rest of the code compatible with both symbols
- sprintf(atcmd_msg, "%s", message);
+ }
+
+ ssd = map->nick2sd(charname);
+ if (ssd == NULL) {
+ sprintf(output, msg_fd(fd,1389), command); // %s failed. Player not found.
+ clif->message(fd, output);
+ return true;
+ }
+
+ if (n > 2)
+ sprintf(atcmd_msg, "%s %s", command, params);
+ else
+ sprintf(atcmd_msg, "%s", command);
}
pc->update_idle_time(sd, BCIDLE_ATCOMMAND);
//Clearing these to be used once more.
- memset(command, '\0', sizeof(command));
- memset(params, '\0', sizeof(params));
+ memset(command, '\0', sizeof command);
+ memset(params, '\0', sizeof params);
//check to see if any params exist within this command
- if( sscanf(atcmd_msg, "%99s %99[^\n]", command, params) < 2 )
+ if (sscanf(atcmd_msg, "%99s %99[^\n]", command, params) < 2)
params[0] = '\0';
// @commands (script based)
- if(player_invoked && atcommand->binding_count > 0) {
- struct atcmd_binding_data * binding;
-
+ if (player_invoked && atcommand->binding_count > 0) {
// Get atcommand binding
- binding = atcommand->get_bind_byname(command);
+ struct atcmd_binding_data *binding = atcommand->get_bind_byname(command);
// Check if the binding isn't NULL and there is a NPC event, level of usage met, et cetera
- if( binding != NULL
- && binding->npc_event[0]
+ if (binding != NULL && binding->npc_event[0] != '\0'
&& (
- (*atcmd_msg == atcommand->at_symbol && pc_get_group_level(sd) >= binding->group_lv)
- || (*atcmd_msg == atcommand->char_symbol && pc_get_group_level(sd) >= binding->group_lv_char)
+ (is_atcommand && pc_get_group_level(sd) >= binding->group_lv)
+ || (!is_atcommand && pc_get_group_level(sd) >= binding->group_lv_char)
+ || (is_atcommand && binding->at_groups[pcg->get_idx(sd->group)] > 0)
+ || (!is_atcommand && binding->char_groups[pcg->get_idx(sd->group)] > 0)
)
) {
- // Check if self or character invoking; if self == character invoked, then self invoke.
- bool invokeFlag = ((*atcmd_msg == atcommand->at_symbol) ? 1 : 0);
-
- // Check if the command initiated is a character command
- if (*message == atcommand->char_symbol
- && (ssd = map->nick2sd(charname)) == NULL
- && (ssd = map->nick2sd(charname2)) == NULL
- ) {
- sprintf(output, msg_fd(fd,1389), command); // %s failed. Player not found.
- clif->message(fd, output);
- return true;
- }
-
- if( binding->log ) /* log only if this command should be logged [Ind/Hercules] */
+ if (binding->log) /* log only if this command should be logged [Ind/Hercules] */
logs->atcommand(sd, atcmd_msg);
- npc->do_atcmd_event((invokeFlag ? sd : ssd), command, params, binding->npc_event);
+ npc->do_atcmd_event(ssd, command, params, binding->npc_event);
return true;
}
}
@@ -9944,51 +9978,40 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa
//Grab the command information and check for the proper GM level required to use it or if the command exists
info = atcommand->get_info_byname(atcommand->check_alias(command + 1));
if (info == NULL) {
- if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission
- sprintf(output, msg_fd(fd,153), command); // "%s is Unknown Command."
- clif->message(fd, output);
- atcommand->get_suggestions(sd, command + 1, *message == atcommand->at_symbol);
- return true;
- } else
+ if (pc_get_group_level(sd) == 0) // TODO: remove or replace with proper permission
return false;
+
+ sprintf(output, msg_fd(fd,153), command); // "%s is Unknown Command."
+ clif->message(fd, output);
+ atcommand->get_suggestions(sd, command + 1, is_atcommand);
+ return true;
}
if (player_invoked) {
int i;
- if ((*command == atcommand->at_symbol && info->at_groups[pcg->get_idx(sd->group)] == 0) ||
- (*command == atcommand->char_symbol && info->char_groups[pcg->get_idx(sd->group)] == 0) ) {
+ if ((is_atcommand && info->at_groups[pcg->get_idx(sd->group)] == 0)
+ || (!is_atcommand && info->char_groups[pcg->get_idx(sd->group)] == 0))
return false;
- }
- if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) {
+
+ if (pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD)) {
clif->message(fd, msg_fd(fd,1393)); // You can't use commands while dead
return true;
}
- for(i = 0; i < map->list[sd->bl.m].zone->disabled_commands_count; i++) {
- if( info->func == map->list[sd->bl.m].zone->disabled_commands[i]->cmd ) {
+ for (i = 0; i < map->list[sd->bl.m].zone->disabled_commands_count; i++) {
+ if (info->func == map->list[sd->bl.m].zone->disabled_commands[i]->cmd) {
if (pc_get_group_level(sd) < map->list[sd->bl.m].zone->disabled_commands[i]->group_lv) {
clif->messagecolor_self(sd->fd, COLOR_RED, "This command is disabled in this area");
return true;
- } else {
- break;/* already found the matching command, no need to keep checking -- just go on */
}
+ break; /* already found the matching command, no need to keep checking -- just go on */
}
}
}
- // Check if target is valid only if confirmed that player can use command.
- if (*message == atcommand->char_symbol
- && (ssd = map->nick2sd(charname)) == NULL
- && (ssd = map->nick2sd(charname2)) == NULL
- ) {
- sprintf(output, msg_fd(fd,1389), command); // %s failed. Player not found.
- clif->message(fd, output);
- return true;
- }
-
//Attempt to use the command
- if ( (info->func(fd, (*atcmd_msg == atcommand->at_symbol) ? sd : ssd, command, params,info) != true) ) {
+ if ((info->func(fd, ssd, command, params,info) != true)) {
#ifdef AUTOTRADE_PERSISTENCY
- if( info->func == atcommand_autotrade ) /** autotrade deletes caster, so we got nothing more to do here **/
+ if (info->func == atcommand_autotrade) /* autotrade deletes caster, so we got nothing more to do here */
return true;
#endif
sprintf(output,msg_fd(fd,154), command); // %s failed.
@@ -9996,8 +10019,8 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa
return true;
}
- if( info->log ) /* log only if this command should be logged [Ind/Hercules] */
- logs->atcommand(sd, *atcmd_msg == atcommand->at_symbol ? atcmd_msg : message);
+ if (info->log) /* log only if this command should be logged [Ind/Hercules] */
+ logs->atcommand(sd, is_atcommand ? atcmd_msg : message);
return true;
}
@@ -10006,13 +10029,13 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa
*
*------------------------------------------*/
void atcommand_config_read(const char* config_filename) {
- config_t atcommand_config;
- config_setting_t *aliases = NULL, *help = NULL, *nolog = NULL;
+ struct config_t atcommand_config;
+ struct config_setting_t *aliases = NULL, *help = NULL, *nolog = NULL;
const char *symbol = NULL;
int num_aliases = 0;
nullpo_retv(config_filename);
- if (libconfig->read_file(&atcommand_config, config_filename))
+ if (!libconfig->load_file(&atcommand_config, config_filename))
return;
// Command symbols
@@ -10041,7 +10064,7 @@ void atcommand_config_read(const char* config_filename) {
int count = libconfig->setting_length(aliases);
for (i = 0; i < count; ++i) {
- config_setting_t *command;
+ struct config_setting_t *command;
const char *commandname = NULL;
int j = 0, alias_count = 0;
AtCommandInfo *commandinfo = NULL;
@@ -10079,7 +10102,7 @@ void atcommand_config_read(const char* config_filename) {
int count = libconfig->setting_length(nolog);
for (i = 0; i < count; ++i) {
- config_setting_t *command;
+ struct config_setting_t *command;
const char *commandname = NULL;
AtCommandInfo *commandinfo = NULL;
@@ -10101,7 +10124,7 @@ void atcommand_config_read(const char* config_filename) {
int i;
for (i = 0; i < count; ++i) {
- config_setting_t *command;
+ struct config_setting_t *command;
const char *commandname;
AtCommandInfo *commandinfo = NULL;
@@ -10144,9 +10167,9 @@ static inline int atcommand_command_type2idx(AtCommandType type)
* Loads permissions for groups to use commands.
*
*/
-void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **commands_, size_t sz)
+void atcommand_db_load_groups(GroupSettings **groups, struct config_setting_t **commands_, size_t sz)
{
- DBIterator *iter = db_iterator(atcommand->db);
+ struct DBIterator *iter = db_iterator(atcommand->db);
AtCommandInfo *atcmd;
nullpo_retv(groups);
@@ -10157,7 +10180,7 @@ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **command
CREATE(atcmd->char_groups, char, sz);
for (i = 0; i < sz; i++) {
GroupSettings *group = groups[i];
- config_setting_t *commands = commands_[i];
+ struct config_setting_t *commands = commands_[i];
int result = 0;
int idx = -1;
@@ -10178,7 +10201,7 @@ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **command
}
if (commands != NULL) {
- config_setting_t *cmd = NULL;
+ struct config_setting_t *cmd = NULL;
// <commandname> : <bool> (only atcommand)
if (config_setting_lookup_bool(commands, atcmd->command, &result) && result) {
@@ -10205,31 +10228,34 @@ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **command
}
bool atcommand_can_use(struct map_session_data *sd, const char *command) {
- AtCommandInfo *info = atcommand->get_info_byname(atcommand->check_alias(command + 1));
+ AtCommandInfo *acmd_d;
+ struct atcmd_binding_data *bcmd_d;
nullpo_retr(false, sd);
- nullpo_retr(false, command);
- if (info == NULL)
- return false;
- if ((*command == atcommand->at_symbol && info->at_groups[pcg->get_idx(sd->group)] != 0) ||
- (*command == atcommand->char_symbol && info->char_groups[pcg->get_idx(sd->group)] != 0) ) {
- return true;
+ if ((acmd_d = atcommand->get_info_byname(atcommand->check_alias(command + 1))) != NULL) {
+ return ((*command == atcommand->at_symbol && acmd_d->at_groups[pcg->get_idx(sd->group)] > 0) ||
+ (*command == atcommand->char_symbol && acmd_d->char_groups[pcg->get_idx(sd->group)] > 0));
+ } else if ((bcmd_d = atcommand->get_bind_byname(atcommand->check_alias(command + 1))) != NULL) {
+ return ((*command == atcommand->at_symbol && bcmd_d->at_groups[pcg->get_idx(sd->group)] > 0) ||
+ (*command == atcommand->char_symbol && bcmd_d->char_groups[pcg->get_idx(sd->group)] > 0));
}
return false;
}
+
bool atcommand_can_use2(struct map_session_data *sd, const char *command, AtCommandType type) {
- AtCommandInfo *info = atcommand->get_info_byname(atcommand->check_alias(command));
+ AtCommandInfo *acmd_d;
+ struct atcmd_binding_data *bcmd_d;
nullpo_retr(false, sd);
- nullpo_retr(false, command);
- if (info == NULL)
- return false;
- if ((type == COMMAND_ATCOMMAND && info->at_groups[pcg->get_idx(sd->group)] != 0) ||
- (type == COMMAND_CHARCOMMAND && info->char_groups[pcg->get_idx(sd->group)] != 0) ) {
- return true;
+ if ((acmd_d = atcommand->get_info_byname(atcommand->check_alias(command))) != NULL) {
+ return ((type == COMMAND_ATCOMMAND && acmd_d->at_groups[pcg->get_idx(sd->group)] > 0) ||
+ (type == COMMAND_CHARCOMMAND && acmd_d->char_groups[pcg->get_idx(sd->group)] > 0));
+ } else if ((bcmd_d = atcommand->get_bind_byname(atcommand->check_alias(command))) != NULL) {
+ return ((type == COMMAND_ATCOMMAND && bcmd_d->at_groups[pcg->get_idx(sd->group)] > 0) ||
+ (type == COMMAND_CHARCOMMAND && bcmd_d->char_groups[pcg->get_idx(sd->group)] > 0));
}
return false;
@@ -10248,7 +10274,8 @@ bool atcommand_hp_add(char *name, AtCommandFunc func) {
/**
* @see DBApply
*/
-int atcommand_db_clear_sub(DBKey key, DBData *data, va_list args) {
+int atcommand_db_clear_sub(union DBKey key, struct DBData *data, va_list args)
+{
AtCommandInfo *cmd = DB->data2ptr(data);
aFree(cmd->at_groups);
aFree(cmd->char_groups);
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 5c4acdf01..efcf6dd31 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,6 @@
#include "map/pc_groups.h"
#include "common/hercules.h"
-#include "common/conf.h"
#include "common/db.h"
#include <stdarg.h>
@@ -34,6 +33,7 @@
struct map_session_data;
struct AtCommandInfo;
struct block_list;
+struct config_setting_t;
/**
* Defines
@@ -79,8 +79,10 @@ struct AtCommandInfo {
struct atcmd_binding_data {
char command[ATCOMMAND_LENGTH];
char npc_event[ATCOMMAND_LENGTH];
- int group_lv;
- int group_lv_char;
+ int group_lv; // DEPRECATED
+ int group_lv_char; // DEPRECATED
+ char *at_groups; // quick @commands "can-use" lookup
+ char *char_groups; // quick @charcommands "can-use" lookup
bool log;
};
@@ -94,8 +96,8 @@ struct atcommand_interface {
struct atcmd_binding_data** binding;
int binding_count;
/* other vars */
- DBMap* db; //name -> AtCommandInfo
- DBMap* alias_db; //alias -> AtCommandInfo
+ struct DBMap *db; //name -> AtCommandInfo
+ struct DBMap *alias_db; //alias -> AtCommandInfo
/**
* msg_table[lang_id][msg_id]
* Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
@@ -110,7 +112,7 @@ struct atcommand_interface {
bool (*create) (char *name, AtCommandFunc func);
bool (*can_use) (struct map_session_data *sd, const char *command);
bool (*can_use2) (struct map_session_data *sd, const char *command, AtCommandType type);
- void (*load_groups) (GroupSettings **groups, config_setting_t **commands_, size_t sz);
+ void (*load_groups) (GroupSettings **groups, struct config_setting_t **commands_, size_t sz);
AtCommandInfo* (*exists) (const char* name);
bool (*msg_read) (const char *cfg_name, bool allow_override);
void (*final_msg) (void);
@@ -135,7 +137,7 @@ struct atcommand_interface {
/* */
void (*commands_sub) (struct map_session_data* sd, const int fd, AtCommandType type);
void (*cmd_db_clear) (void);
- int (*cmd_db_clear_sub) (DBKey key, DBData *data, va_list args);
+ int (*cmd_db_clear_sub) (union DBKey key, struct DBData *data, va_list args);
void (*doload) (void);
void (*base_commands) (void);
bool (*add) (char *name, AtCommandFunc func, bool replace);
@@ -152,7 +154,8 @@ void atcommand_defaults(void);
HPShared struct atcommand_interface *atcommand;
/* stay here */
-#define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info) __attribute__((nonnull (2, 3, 4, 5))); \
- static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
+#define ACMD(x) \
+ static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info) __attribute__((nonnull (2, 3, 4, 5))); \
+ static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
#endif /* MAP_ATCOMMAND_H */
diff --git a/src/map/battle.c b/src/map/battle.c
index 44adef051..57a74bba4 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -41,6 +41,7 @@
#include "map/status.h"
#include "common/HPM.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/ers.h"
#include "common/memmgr.h"
#include "common/nullpo.h"
@@ -692,6 +693,7 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in
#ifdef RENEWAL
if((skill_lv = pc->checkskill(sd,AM_AXEMASTERY)) > 0)
damage += (skill_lv * 3);
+ FALLTHROUGH
#endif
case W_DAGGER:
if((skill_lv = pc->checkskill(sd,SM_SWORD)) > 0)
@@ -736,6 +738,7 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in
if((skill_lv = pc->checkskill(sd,TK_RUN)) > 0)
damage += (skill_lv * 10);
// No break, fall through to Knuckles
+ FALLTHROUGH
case W_KNUCKLE:
if((skill_lv = pc->checkskill(sd,MO_IRONHAND)) > 0)
damage += (skill_lv * 3);
@@ -889,7 +892,7 @@ int64 battle_calc_masteryfix(struct block_list *src, struct block_list *target,
damage += damage * ratio / 100;
}
- if( sd->status.class_ == JOB_ARCH_BISHOP_T || sd->status.class_ == JOB_ARCH_BISHOP ){
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_ARCH_BISHOP) {
if((skill2_lv = pc->checkskill(sd,AB_EUCHARISTICA)) > 0 &&
(tstatus->race == RC_DEMON || tstatus->def_ele == ELE_DARK) )
damage += damage * skill2_lv / 100;
@@ -1663,8 +1666,29 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
break;
#endif
/**
- * Arch Bishop
- **/
+ * Summoner
+ **/
+ case SU_BITE:
+ skillratio += 100;
+ break;
+ case SU_SCRATCH:
+ skillratio += -50 + 50 * skill_lv;
+ break;
+ case SU_SCAROFTAROU:
+ skillratio += -100 + 100 * skill_lv;
+ break;
+ case SU_PICKYPECK:
+ case SU_PICKYPECK_DOUBLE_ATK:
+ skillratio += 100 + 100 * skill_lv;
+ if ((status_get_max_hp(target) / 100) <= 50)
+ skillratio *= 2;
+ break;
+ case SU_LUNATICCARROTBEAT:
+ skillratio += 100 + 100 * skill_lv;
+ break;
+ /**
+ * Arch Bishop
+ **/
case AB_JUDEX:
skillratio = 300 + 20 * skill_lv;
RE_LVL_DMOD(100);
@@ -1883,6 +1907,12 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
pc->del_charm(sd, sd->charm_count, sd->charm_type);
}
break;
+ case SU_SV_STEMSPEAR:
+ skillratio += 600;
+ break;
+ case SU_CN_METEOR:
+ skillratio += 100 + 100 * skill_lv;
+ break;
default:
battle->calc_skillratio_magic_unknown(&attack_type, src, target, &skill_id, &skill_lv, &skillratio, &flag);
break;
@@ -2431,7 +2461,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
RE_LVL_DMOD(100);
break;
case LG_OVERBRAND_PLUSATK:
- skillratio = 200 * skill_lv + rnd_value( 10, 100);
+ skillratio = 200 * skill_lv + rnd->value(10, 100);
RE_LVL_DMOD(100);
break;
case LG_RAYOFGENESIS:
@@ -2717,15 +2747,16 @@ void battle_calc_skillratio_weapon_unknown(int *attack_type, struct block_list *
* After this we apply bg/gvg reduction
*------------------------------------------*/
int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv) {
- struct map_session_data *sd = NULL;
- struct status_change *sc, *tsc;
+ struct map_session_data *s_sd, *t_sd;
+ struct status_change *s_sc, *sc;
struct status_change_entry *sce;
int div_, flag;
nullpo_ret(bl);
nullpo_ret(d);
- sd = BL_CAST(BL_PC, bl);
+ s_sd = BL_CAST(BL_PC, src);
+ t_sd = BL_CAST(BL_PC, bl);
div_ = d->div_;
flag = d->flag;
@@ -2735,22 +2766,22 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
return 0;
if( battle_config.ksprotection && mob->ksprotected(src, bl) )
return 0;
- if (sd != NULL) {
+ if (t_sd != NULL) {
//Special no damage states
- if(flag&BF_WEAPON && sd->special_state.no_weapon_damage)
- damage -= damage * sd->special_state.no_weapon_damage / 100;
+ if(flag&BF_WEAPON && t_sd->special_state.no_weapon_damage)
+ damage -= damage * t_sd->special_state.no_weapon_damage / 100;
- if(flag&BF_MAGIC && sd->special_state.no_magic_damage)
- damage -= damage * sd->special_state.no_magic_damage / 100;
+ if(flag&BF_MAGIC && t_sd->special_state.no_magic_damage)
+ damage -= damage * t_sd->special_state.no_magic_damage / 100;
- if(flag&BF_MISC && sd->special_state.no_misc_damage)
- damage -= damage * sd->special_state.no_misc_damage / 100;
+ if(flag&BF_MISC && t_sd->special_state.no_misc_damage)
+ damage -= damage * t_sd->special_state.no_misc_damage / 100;
if(!damage) return 0;
}
+ s_sc = status->get_sc(src);
sc = status->get_sc(bl);
- tsc = status->get_sc(src);
if( sc && sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
return 1;
@@ -2838,7 +2869,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
}
if( sc->data[SC__MAELSTROM] && (flag&BF_MAGIC) && skill_id && (skill->get_inf(skill_id)&INF_GROUND_SKILL) ) {
// {(Maelstrom Skill LevelxAbsorbed Skill Level)+(Caster's Job/5)}/2
- int sp = (sc->data[SC__MAELSTROM]->val1 * skill_lv + (sd ? sd->status.job_level / 5 : 0)) / 2;
+ int sp = (sc->data[SC__MAELSTROM]->val1 * skill_lv + (t_sd ? t_sd->status.job_level / 5 : 0)) / 2;
status->heal(bl, 0, sp, 3);
d->dmg_lv = ATK_BLOCK;
return 0;
@@ -2916,7 +2947,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if(sc->data[SC_DODGE_READY] && ( !sc->opt1 || sc->opt1 == OPT1_BURNING ) &&
(flag&BF_LONG || sc->data[SC_STRUP])
&& rnd()%100 < 20) {
- if (sd && pc_issit(sd)) pc->setstand(sd); //Stand it to dodge.
+ if (t_sd && pc_issit(t_sd)) pc->setstand(t_sd); //Stand it to dodge.
clif->skill_nodamage(bl,bl,TK_DODGE,1,1);
if (!sc->data[SC_COMBOATTACK])
sc_start4(src, bl, SC_COMBOATTACK, 100, TK_JUMPKICK, src->id, 1, 0, 2000);
@@ -2987,13 +3018,12 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
#endif
if( damage ) {
- struct map_session_data *tsd = BL_CAST(BL_PC, src);
if( sc->data[SC_DEEP_SLEEP] ) {
damage += damage / 2; // 1.5 times more damage while in Deep Sleep.
status_change_end(bl,SC_DEEP_SLEEP,INVALID_TIMER);
}
- if( tsd && sd && sc->data[SC_COLD] && flag&BF_WEAPON ){
- switch(tsd->status.weapon){
+ if( s_sd && t_sd && sc->data[SC_COLD] && flag&BF_WEAPON ){
+ switch(s_sd->status.weapon){
case W_MACE:
case W_2HMACE:
case W_1HAXE:
@@ -3002,8 +3032,9 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
break;
case W_MUSICAL:
case W_WHIP:
- if(!sd->state.arrow_atk)
+ if(!t_sd->state.arrow_atk)
break;
+ FALLTHROUGH
case W_BOW:
case W_REVOLVER:
case W_RIFLE:
@@ -3064,6 +3095,9 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
damage -= 50 * damage / 100;//50% reduction to physical ranged attacks
}
+ if (sc->data[SC_SU_STOOP])
+ damage -= damage * 90 / 100;
+
// Compressed code, fixed by map.h [Epoque]
if (src->type == BL_MOB) {
const struct mob_data *md = BL_UCCAST(BL_MOB, src);
@@ -3131,8 +3165,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( (sce = sc->data[SC_STONEHARDSKIN]) && flag&(BF_SHORT|BF_WEAPON) && damage > 0 ) {
sce->val2 -= (int)cap_value(damage,INT_MIN,INT_MAX);
if( src->type == BL_PC ) {
- struct map_session_data *ssd = BL_CAST(BL_PC, src);
- if (ssd && ssd->status.weapon != W_BOW)
+ if (s_sd && s_sd->status.weapon != W_BOW)
skill->break_equip(src, EQP_WEAPON, 3000, BCT_SELF);
} else
skill->break_equip(src, EQP_WEAPON, 3000, BCT_SELF);
@@ -3173,6 +3206,19 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
status_change_end(bl, SC_KYRIE, INVALID_TIMER);
}
+ if ((sce = sc->data[SC_TUNAPARTY]) != NULL && damage > 0) {
+ clif->specialeffect(bl, 336, AREA);
+ sce->val2 -= (int)cap_value(damage, INT_MIN, INT_MAX);
+ if (sce->val2 >= 0) {
+ damage = 0;
+ } else {
+ damage = -sce->val2;
+ }
+ if (sce->val2 <= 0) {
+ status_change_end(bl, SC_TUNAPARTY, INVALID_TIMER);
+ }
+ }
+
if( sc->data[SC_MEIKYOUSISUI] && rnd()%100 < 40 ) // custom value
damage = 0;
@@ -3209,31 +3255,31 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( sc->data[SC__DEADLYINFECT] && flag&BF_SHORT && damage > 0 && rnd()%100 < 30 + 10 * sc->data[SC__DEADLYINFECT]->val1 && !is_boss(src) )
status->change_spread(bl, src); // Deadly infect attacked side
- if (sd && damage > 0 && (sce = sc->data[SC_GENTLETOUCH_ENERGYGAIN]) != NULL) {
+ if (t_sd && damage > 0 && (sce = sc->data[SC_GENTLETOUCH_ENERGYGAIN]) != NULL) {
if ( rnd() % 100 < sce->val2 )
- pc->addspiritball(sd, skill->get_time(MO_CALLSPIRITS, 1), pc->getmaxspiritball(sd, 0));
+ pc->addspiritball(t_sd, skill->get_time(MO_CALLSPIRITS, 1), pc->getmaxspiritball(t_sd, 0));
}
}
//SC effects from caster side.
- if (tsc && tsc->count) {
- if( tsc->data[SC_INVINCIBLE] && !tsc->data[SC_INVINCIBLEOFF] )
+ if (s_sc && s_sc->count) {
+ if( s_sc->data[SC_INVINCIBLE] && !s_sc->data[SC_INVINCIBLEOFF] )
damage += damage * 75 / 100;
// [Epoque]
if (bl->type == BL_MOB) {
const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
int i;
- if (((sce=tsc->data[SC_MANU_ATK]) != NULL && (flag&BF_WEAPON))
- || ((sce=tsc->data[SC_MANU_MATK]) != NULL && (flag&BF_MAGIC))) {
+ if (((sce=s_sc->data[SC_MANU_ATK]) != NULL && (flag&BF_WEAPON))
+ || ((sce=s_sc->data[SC_MANU_MATK]) != NULL && (flag&BF_MAGIC))) {
for (i = 0; i < ARRAYLENGTH(mob->manuk); i++)
if (md->class_ == mob->manuk[i]) {
damage += damage * sce->val1 / 100;
break;
}
}
- if (((sce=tsc->data[SC_SPL_ATK]) != NULL && (flag&BF_WEAPON))
- || ((sce=tsc->data[SC_SPL_MATK]) != NULL && (flag&BF_MAGIC))) {
+ if (((sce=s_sc->data[SC_SPL_ATK]) != NULL && (flag&BF_WEAPON))
+ || ((sce=s_sc->data[SC_SPL_MATK]) != NULL && (flag&BF_MAGIC))) {
for (i = 0; i < ARRAYLENGTH(mob->splendide); i++)
if (md->class_ == mob->splendide[i]) {
damage += damage * sce->val1 / 100;
@@ -3241,54 +3287,31 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
}
}
}
- if( tsc->data[SC_POISONINGWEAPON] ) {
+ if( s_sc->data[SC_POISONINGWEAPON] ) {
struct status_data *tstatus = status->get_status_data(bl);
- if ( !(flag&BF_SKILL) && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < tsc->data[SC_POISONINGWEAPON]->val3 ) {
+ if ( !(flag&BF_SKILL) && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < s_sc->data[SC_POISONINGWEAPON]->val3 ) {
short rate = 100;
- if ( tsc->data[SC_POISONINGWEAPON]->val1 == 9 ) // Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech]
+ if ( s_sc->data[SC_POISONINGWEAPON]->val1 == 9 ) // Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech]
rate = 100 - tstatus->int_ * 4 / 5;
- sc_start(src,bl,tsc->data[SC_POISONINGWEAPON]->val2,rate,tsc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON,1) - (tstatus->vit + tstatus->luk) / 2 * 1000);
+ sc_start(src,bl,s_sc->data[SC_POISONINGWEAPON]->val2,rate,s_sc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON,1) - (tstatus->vit + tstatus->luk) / 2 * 1000);
}
}
- if( tsc->data[SC__DEADLYINFECT] && flag&BF_SHORT && damage > 0 && rnd()%100 < 30 + 10 * tsc->data[SC__DEADLYINFECT]->val1 && !is_boss(src) )
+ if( s_sc->data[SC__DEADLYINFECT] && flag&BF_SHORT && damage > 0 && rnd()%100 < 30 + 10 * s_sc->data[SC__DEADLYINFECT]->val1 && !is_boss(src) )
status->change_spread(src, bl);
- if (tsc->data[SC_SHIELDSPELL_REF] && tsc->data[SC_SHIELDSPELL_REF]->val1 == 1 && damage > 0)
+ if (s_sc->data[SC_SHIELDSPELL_REF] && s_sc->data[SC_SHIELDSPELL_REF]->val1 == 1 && damage > 0)
skill->break_equip(bl,EQP_ARMOR,10000,BCT_ENEMY );
- if (tsc->data[SC_STYLE_CHANGE] && rnd()%2) {
+ if (s_sc->data[SC_STYLE_CHANGE] && rnd()%2) {
struct homun_data *hd = BL_CAST(BL_HOM,bl);
if (hd) homun->addspiritball(hd, 10);
}
- if (src->type == BL_PC && damage > 0 && (sce = tsc->data[SC_GENTLETOUCH_ENERGYGAIN]) != NULL) {
- struct map_session_data *tsd = BL_UCAST(BL_PC, src);
- if (tsd != NULL && rnd() % 100 < sce->val2)
- pc->addspiritball(tsd, skill->get_time(MO_CALLSPIRITS, 1), pc->getmaxspiritball(tsd, 0));
+ if (src->type == BL_PC && damage > 0 && (sce = s_sc->data[SC_GENTLETOUCH_ENERGYGAIN]) != NULL) {
+ if (s_sd != NULL && rnd() % 100 < sce->val2)
+ pc->addspiritball(s_sd, skill->get_time(MO_CALLSPIRITS, 1), pc->getmaxspiritball(s_sd, 0));
}
}
/* no data claims these settings affect anything other than players */
- if( damage && sd && bl->type == BL_PC ) {
- switch( skill_id ) {
- //case PA_PRESSURE: /* pressure also belongs to this list but it doesn't reach this area -- so don't worry about it */
- case HW_GRAVITATION:
- case NJ_ZENYNAGE:
- case KO_MUCHANAGE:
- break;
- default:
- if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
- if (flag&BF_WEAPON)
- damage = damage * map->list[bl->m].weapon_damage_rate / 100;
- if (flag&BF_MAGIC)
- damage = damage * map->list[bl->m].magic_damage_rate / 100;
- if (flag&BF_MISC)
- damage = damage * map->list[bl->m].misc_damage_rate / 100;
- } else { //Normal attacks get reductions based on range.
- if (flag & BF_SHORT)
- damage = damage * map->list[bl->m].short_damage_rate / 100;
- if (flag & BF_LONG)
- damage = damage * map->list[bl->m].long_damage_rate / 100;
- }
- if(!damage) damage = 1;
- break;
- }
+ if (damage && t_sd && bl->type == BL_PC) {
+ damage = battle->calc_pc_damage(src, bl, d, damage, skill_id, skill_lv);
}
if(battle_config.skill_min_damage && damage > 0 && damage < div_)
@@ -3307,14 +3330,13 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if (skill_id)
mob->skill_event(md, src, timer->gettick(), MSC_SKILLUSED|(skill_id<<16));
}
- if (sd && pc_ismadogear(sd) && rnd()%100 < 50) {
+ if (t_sd && pc_ismadogear(t_sd) && rnd()%100 < 50) {
int element = -1;
if (!skill_id || (element = skill->get_ele(skill_id, skill_lv)) == -1) {
// Take weapon's element
struct status_data *sstatus = NULL;
- struct map_session_data *ssd = BL_CAST(BL_PC, src);
- if (src->type == BL_PC && ssd->bonus.arrow_ele != 0) {
- element = ssd->bonus.arrow_ele;
+ if (s_sd != NULL && s_sd->bonus.arrow_ele != 0) {
+ element = s_sd->bonus.arrow_ele;
} else if ((sstatus = status->get_status_data(src)) != NULL) {
element = sstatus->rhw.ele;
}
@@ -3326,14 +3348,45 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
element = rnd()%ELE_MAX;
}
if (element == ELE_FIRE)
- pc->overheat(sd, 1);
+ pc->overheat(t_sd, 1);
else if (element == ELE_WATER)
- pc->overheat(sd, -1);
+ pc->overheat(t_sd, -1);
}
return damage;
}
+int64 battle_calc_pc_damage(struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv)
+{
+ int flag = d->flag;
+
+ switch (skill_id) {
+ //case PA_PRESSURE: /* pressure also belongs to this list but it doesn't reach this area -- so don't worry about it */
+ case HW_GRAVITATION:
+ case NJ_ZENYNAGE:
+ case KO_MUCHANAGE:
+ break;
+ default:
+ if (flag & BF_SKILL) { //Skills get a different reduction than non-skills. [Skotlex]
+ if (flag & BF_WEAPON)
+ damage = damage * map->list[bl->m].weapon_damage_rate / 100;
+ if (flag & BF_MAGIC)
+ damage = damage * map->list[bl->m].magic_damage_rate / 100;
+ if (flag & BF_MISC)
+ damage = damage * map->list[bl->m].misc_damage_rate / 100;
+ } else { //Normal attacks get reductions based on range.
+ if (flag & BF_SHORT)
+ damage = damage * map->list[bl->m].short_damage_rate / 100;
+ if (flag & BF_LONG)
+ damage = damage * map->list[bl->m].long_damage_rate / 100;
+ }
+ if (!damage)
+ damage = 1;
+ break;
+ }
+ return damage;
+}
+
/*==========================================
* Calculates BG related damage adjustments.
*------------------------------------------*/
@@ -3515,8 +3568,6 @@ int battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id) {
struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int mflag) {
int nk;
short s_ele = 0;
- unsigned int skillratio = 100; //Skill dmg modifiers.
-
struct map_session_data *sd = NULL;
struct status_change *sc;
struct Damage ad;
@@ -3668,7 +3719,14 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
//Damage calculation from iRO wiki. [Jobbie]
ad.damage = status->get_lv(src) * 10 + sstatus->int_;
break;
+ /**
+ * Summoner
+ */
+ case SU_SV_ROOTTWIST_ATK:
+ ad.damage = 100;
+ break;
default: {
+ unsigned int skillratio = 100; //Skill dmg modifiers.
MATK_ADD( status->get_matk(src, 2) );
#ifdef RENEWAL
ad.damage = battle->calc_cardfix(BF_MAGIC, src, target, nk, s_ele, 0, ad.damage, 0, ad.flag);
@@ -3702,10 +3760,11 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
//Constant/misc additions from skills
if (skill_id == WZ_FIREPILLAR)
MATK_ADD(100+50*skill_lv);
- if( sd && ( sd->status.class_ == JOB_ARCH_BISHOP_T || sd->status.class_ == JOB_ARCH_BISHOP ) &&
- (i=pc->checkskill(sd,AB_EUCHARISTICA)) > 0 &&
- (tstatus->race == RC_DEMON || tstatus->def_ele == ELE_DARK) )
- MATK_ADDRATE(i);
+ if (sd != NULL && (sd->job & MAPID_THIRDMASK) == MAPID_ARCH_BISHOP) {
+ int eucharistica_level = pc->checkskill(sd,AB_EUCHARISTICA);
+ if (eucharistica_level > 0 && (tstatus->race == RC_DEMON || tstatus->def_ele == ELE_DARK))
+ MATK_ADDRATE(eucharistica_level);
+ }
}
}
#ifndef HMAP_ZONE_DAMAGE_CAP_TYPE
@@ -4250,7 +4309,9 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
switch( skill_id ) {
case RA_FIRINGTRAP:
case RA_ICEBOUNDTRAP:
- if( md.damage == 1 ) break;
+ if (md.damage == 1)
+ break;
+ FALLTHROUGH
case RA_CLUSTERBOMB:
{
struct Damage wd;
@@ -4279,7 +4340,6 @@ void battle_calc_misc_attack_unknown(struct block_list *src, struct block_list *
// FIXME: wflag is undocumented
struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int wflag)
{
- unsigned int skillratio = 100; //Skill dmg modifiers.
short temp=0;
short s_ele, s_ele_;
int i, nk;
@@ -4551,16 +4611,19 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.div_ = 5;
break;
}
+ FALLTHROUGH
case 4:
if( chance < 7){// 6 % chance to attack 4 times.
wd.div_ = 4;
break;
}
+ FALLTHROUGH
case 3:
if( chance < 10){// 9 % chance to attack 3 times.
wd.div_ = 3;
break;
}
+ FALLTHROUGH
case 2:
case 1:
if( chance < 13){// 12 % chance to attack 2 times.
@@ -4614,6 +4677,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if(!(sc && sc->data[SC_AUTOCOUNTER]))
break;
status_change_end(src, SC_AUTOCOUNTER, INVALID_TIMER);
+ FALLTHROUGH
case KN_AUTOCOUNTER:
if(battle_config.auto_counter_type &&
(battle_config.auto_counter_type&src->type))
@@ -4778,17 +4842,16 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
} //End hit/miss calculation
if (flag.hit && !flag.infdef) { //No need to do the math for plants
+ unsigned int skillratio = 100; //Skill dmg modifiers.
//Hitting attack
//Assuming that 99% of the cases we will not need to check for the flag.rh... we don't.
//ATK_RATE scales the damage. 100 = no change. 50 is halved, 200 is doubled, etc
#define ATK_RATE( a ) do { int64 temp__ = (a); wd.damage= wd.damage*temp__/100 ; if(flag.lh) wd.damage2= wd.damage2*temp__/100; } while(0)
-#define ATK_RATE2( a , b ) do { wd.damage= wd.damage*(a)/100 ; if(flag.lh) wd.damage2= wd.damage2*(b)/100; } while(0)
#define ATK_RATER(a) ( wd.damage = wd.damage*(a)/100 )
#define ATK_RATEL(a) ( wd.damage2 = wd.damage2*(a)/100 )
//Adds dmg%. 100 = +100% (double) damage. 10 = +10% damage
#define ATK_ADDRATE( a ) do { int64 temp__ = (a); wd.damage+= wd.damage*temp__/100; if(flag.lh) wd.damage2+= wd.damage2*temp__/100; } while(0)
-#define ATK_ADDRATE2( a , b ) do { wd.damage+= wd.damage*(a)/100 ; if(flag.lh) wd.damage2+= wd.damage2*(b)/100; } while(0)
//Adds an absolute value to damage. 100 = +100 damage
#define ATK_ADD( a ) do { int64 temp__ = (a); wd.damage += temp__; if (flag.lh) wd.damage2 += temp__; } while(0)
#define ATK_ADD2( a , b ) do { wd.damage += (a); if (flag.lh) wd.damage2 += (b); } while(0)
@@ -5070,7 +5133,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.damage = battle->calc_masteryfix(src, target, skill_id, skill_lv, wd.damage, wd.div_, 0, flag.weapon);
wd.damage = battle->calc_cardfix2(src, target, wd.damage, s_ele, nk, wd.flag);
}
- /* Fall through */
+ FALLTHROUGH
#endif
default:
ATK_RATE(battle->calc_skillratio(BF_WEAPON, src, target, skill_id, skill_lv, skillratio, wflag));
@@ -5186,8 +5249,16 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if (hd != NULL)
ATK_ADD(hd->homunculus.spiritball * 3);
}
+ if ((wd.flag&(BF_LONG|BF_MAGIC)) == BF_LONG) {
+ if (sd != NULL && pc->checkskill(sd, SU_POWEROFLIFE) > 0) {
+ if (pc->checkskill(sd, SU_SCAROFTAROU) == 5 && pc->checkskill(sd, SU_PICKYPECK) == 5 && pc->checkskill(sd, SU_ARCLOUSEDASH) == 5 && pc->checkskill(sd, SU_LUNATICCARROTBEAT) == 5) {
+ ATK_ADDRATE(20);
+ }
+ }
+ }
}
+
switch (skill_id) {
case AS_SONICBLOW:
if (sc && sc->data[SC_SOULLINK] &&
@@ -5250,6 +5321,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( sc && sc->data[SC_MTF_RANGEATK] )
ATK_ADDRATE(sc->data[SC_MTF_RANGEATK]->val1);// temporary it should be 'bonus.long_attack_atk_rate'
#endif
+ if (sc != NULL && sc->data[SC_ARCLOUSEDASH] != NULL && sc->data[SC_ARCLOUSEDASH]->val4 != 0) {
+ ATK_ADDRATE(sc->data[SC_ARCLOUSEDASH]->val4);
+ }
if( (i=pc->checkskill(sd,AB_EUCHARISTICA)) > 0 &&
(tstatus->race == RC_DEMON || tstatus->def_ele == ELE_DARK) )
ATK_ADDRATE(-i);
@@ -5492,13 +5566,13 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
//Dual-wield
if (wd.damage) {
temp = pc->checkskill(sd,AS_RIGHT) * 10;
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO )
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO)
temp = pc->checkskill(sd,KO_RIGHT) * 10 + 20;
ATK_RATER( 50 + temp );
}
if (wd.damage2) {
temp = pc->checkskill(sd,AS_LEFT) * 10;
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO )
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO)
temp = pc->checkskill(sd,KO_LEFT) * 10 + 20;
ATK_RATEL( 30 + temp );
}
@@ -5995,26 +6069,64 @@ int battle_damage_area(struct block_list *bl, va_list ap) {
if (bl->type == BL_MOB && BL_UCCAST(BL_MOB, bl)->class_ == MOBID_EMPELIUM)
return 0;
if( bl != src && battle->check_target(src,bl,BCT_ENEMY) > 0 ) {
- struct map_session_data *sd = NULL;
nullpo_ret(src);
map->freeblock_lock();
- sd = BL_CAST(BL_PC, src);
if (src->type == BL_PC)
- battle->drain(sd, bl, damage, damage, status_get_race(bl), is_boss(bl));
+ battle->drain(BL_UCAST(BL_PC, src), bl, damage, damage, status_get_race(bl), is_boss(bl));
if( amotion )
battle->delay_damage(tick, amotion,src,bl,0,CR_REFLECTSHIELD,0,damage,ATK_DEF,0,true);
else
status_fix_damage(src,bl,damage,0);
clif->damage(bl,bl,amotion,dmotion,damage,1,BDT_ENDURE,0);
- if (src->type != BL_PC || !sd->state.autocast)
+ if (src->type != BL_PC || !BL_UCCAST(BL_PC, src)->state.autocast)
skill->additional_effect(src, bl, CR_REFLECTSHIELD, 1, BF_WEAPON|BF_SHORT|BF_NORMAL,ATK_DEF,tick);
map->freeblock_unlock();
}
return 0;
}
+
+bool battle_check_arrows(struct map_session_data *sd)
+{
+ int index = sd->equip_index[EQI_AMMO];
+ if (index < 0) {
+ if (sd->weapontype1 > W_KATAR && sd->weapontype1 < W_HUUMA)
+ clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
+ else
+ clif->arrow_fail(sd, 0);
+ return false;
+ }
+ //Ammo check by Ishizu-chan
+ if (sd->inventory_data[index]) {
+ switch (sd->status.weapon) {
+ case W_BOW:
+ if (sd->inventory_data[index]->look != A_ARROW) {
+ clif->arrow_fail(sd, 0);
+ return false;
+ }
+ break;
+ case W_REVOLVER:
+ case W_RIFLE:
+ case W_GATLING:
+ case W_SHOTGUN:
+ if (sd->inventory_data[index]->look != A_BULLET) {
+ clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
+ return false;
+ }
+ break;
+ case W_GRENADE:
+ if (sd->inventory_data[index]->look != A_GRENADE) {
+ clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
+ return false;
+ }
+ break;
+ }
+ }
+ return true;
+}
+
/*==========================================
* Do a basic physical attack (call trough unit_attack_timer)
*------------------------------------------*/
@@ -6052,39 +6164,8 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
sd->state.arrow_atk = (sd->status.weapon == W_BOW || (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE));
if (sd->state.arrow_atk)
{
- int index = sd->equip_index[EQI_AMMO];
- if (index<0) {
- if ( sd->weapontype1 > W_KATAR && sd->weapontype1 < W_HUUMA )
- clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
- else
- clif->arrow_fail(sd, 0);
+ if (battle->check_arrows(sd) == false)
return ATK_NONE;
- }
- //Ammo check by Ishizu-chan
- if (sd->inventory_data[index])
- switch (sd->status.weapon) {
- case W_BOW:
- if (sd->inventory_data[index]->look != A_ARROW) {
- clif->arrow_fail(sd,0);
- return ATK_NONE;
- }
- break;
- case W_REVOLVER:
- case W_RIFLE:
- case W_GATLING:
- case W_SHOTGUN:
- if (sd->inventory_data[index]->look != A_BULLET) {
- clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
- return ATK_NONE;
- }
- break;
- case W_GRENADE:
- if (sd->inventory_data[index]->look != A_GRENADE) {
- clif->skill_fail(sd, 0, USESKILL_FAIL_NEED_MORE_BULLET, 0);
- return ATK_NONE;
- }
- break;
- }
}
}
if (sc && sc->count) {
@@ -6266,17 +6347,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
sp = skill->get_sp(skill_id,skill_lv) * 2 / 3;
if (status->charge(src, 0, sp)) {
- switch (skill->get_casttype(skill_id)) {
- case CAST_GROUND:
- skill->castend_pos2(src, target->x, target->y, skill_id, skill_lv, tick, flag);
- break;
- case CAST_NODAMAGE:
- skill->castend_nodamage_id(src, target, skill_id, skill_lv, tick, flag);
- break;
- case CAST_DAMAGE:
- skill->castend_damage_id(src, target, skill_id, skill_lv, tick, flag);
- break;
- }
+ skill->castend_type(skill->get_casttype(skill_id), src, target, skill_id, skill_lv, tick, flag);
}
}
if (sd) {
@@ -6322,19 +6393,8 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
sd->state.autocast = 1;
skill->consume_requirement(sd,r_skill,r_lv,3);
- switch( type ) {
- case CAST_GROUND:
- skill->castend_pos2(src, target->x, target->y, r_skill, r_lv, tick, flag);
- break;
- case CAST_NODAMAGE:
- skill->castend_nodamage_id(src, target, r_skill, r_lv, tick, flag);
- break;
- case CAST_DAMAGE:
- skill->castend_damage_id(src, target, r_skill, r_lv, tick, flag);
- break;
- }
+ skill->castend_type(type, src, target, r_skill, r_lv, tick, flag);
sd->state.autocast = 0;
-
sd->ud.canact_tick = tick + skill->delay_fix(src, r_skill, r_lv);
clif->status_change(src, SI_POSTDELAY, 1, skill->delay_fix(src, r_skill, r_lv), 0, 0, 1);
}
@@ -6373,11 +6433,9 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
return wd.dmg_lv;
}
#undef ATK_RATE
-#undef ATK_RATE2
#undef ATK_RATER
#undef ATK_RATEL
#undef ATK_ADDRATE
-#undef ATK_ADDRATE2
#undef ATK_ADD
#undef ATK_ADD2
#undef GET_NORMAL_ATTACK
@@ -6556,6 +6614,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
case RK_DRAGONBREATH_WATER:
if( !map->list[m].flag.pvp && !map->list[m].flag.gvg )
break;
+ FALLTHROUGH
case 0://you can hit them without skills
case MA_REMOVETRAP:
case HT_REMOVETRAP:
@@ -6755,14 +6814,23 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if( flag&(BCT_PARTY|BCT_ENEMY) ) {
int s_party = status->get_party_id(s_bl);
int s_guild = status->get_guild_id(s_bl);
+ int t_guild = status->get_guild_id(t_bl);
- if( s_party && s_party == status->get_party_id(t_bl)
- && !(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty)
- && !(map_flag_gvg(m) && map->list[m].flag.gvg_noparty && !( s_guild && s_guild == status->get_guild_id(t_bl) ))
- && (!map->list[m].flag.battleground || sbg_id == tbg_id) )
- state |= BCT_PARTY;
- else
+ if (s_party != 0 && s_party == status->get_party_id(t_bl)) {
+ if (map_flag_gvg(m) && map->list[m].flag.gvg_noparty) {
+ if (s_guild != 0 && t_guild != 0 && (s_guild == t_guild || guild->isallied(s_guild, t_guild)))
+ state |= BCT_PARTY;
+ else
+ state |= flag&BCT_ENEMY ? BCT_ENEMY : BCT_PARTY;
+ } else if (!(map->list[m].flag.pvp && map->list[m].flag.pvp_noparty)
+ && (!map->list[m].flag.battleground || sbg_id == tbg_id)) {
+ state |= BCT_PARTY;
+ } else {
+ state |= BCT_ENEMY;
+ }
+ } else {
state |= BCT_ENEMY;
+ }
}
if( flag&(BCT_GUILD|BCT_ENEMY) ) {
int s_guild = status->get_guild_id(s_bl);
@@ -6783,11 +6851,11 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
const struct map_session_data *s_sd = BL_UCCAST(BL_PC, s_bl);
const struct map_session_data *t_sd = BL_UCCAST(BL_PC, t_bl);
if (
- (s_sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
- (t_sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
- (int)s_sd->status.base_level < battle_config.pk_min_level ||
- (int)t_sd->status.base_level < battle_config.pk_min_level ||
- (battle_config.pk_level_range && abs((int)s_sd->status.base_level - (int)t_sd->status.base_level) > battle_config.pk_level_range)
+ (s_sd->job & MAPID_UPPERMASK) == MAPID_NOVICE ||
+ (t_sd->job & MAPID_UPPERMASK) == MAPID_NOVICE ||
+ s_sd->status.base_level < battle_config.pk_min_level ||
+ t_sd->status.base_level < battle_config.pk_min_level ||
+ (battle_config.pk_level_range && abs(s_sd->status.base_level - t_sd->status.base_level) > battle_config.pk_level_range)
)
state &= ~BCT_ENEMY;
}
@@ -6966,14 +7034,15 @@ static const struct battle_data {
{ "max_heal_lv", &battle_config.max_heal_lv, 11, 1, INT_MAX, },
{ "max_heal", &battle_config.max_heal, 9999, 0, INT_MAX, },
{ "combo_delay_rate", &battle_config.combo_delay_rate, 100, 0, INT_MAX, },
- { "item_check", &battle_config.item_check, 0, 0, 1, },
+ { "item_check", &battle_config.item_check, 0, 0, 0xF, },
{ "item_use_interval", &battle_config.item_use_interval, 100, 0, INT_MAX, },
- { "cashfood_use_interval", &battle_config.cashfood_use_interval, 60000, 0, INT_MAX, },
{ "wedding_modifydisplay", &battle_config.wedding_modifydisplay, 0, 0, 1, },
{ "wedding_ignorepalette", &battle_config.wedding_ignorepalette, 0, 0, 1, },
{ "xmas_ignorepalette", &battle_config.xmas_ignorepalette, 0, 0, 1, },
{ "summer_ignorepalette", &battle_config.summer_ignorepalette, 0, 0, 1, },
{ "hanbok_ignorepalette", &battle_config.hanbok_ignorepalette, 0, 0, 1, },
+ { "oktoberfest_ignorepalette", &battle_config.oktoberfest_ignorepalette, 0, 0, 1, },
+ { "summer2_ignorepalette", &battle_config.summer2_ignorepalette, 0, 0, 1, },
{ "natural_healhp_interval", &battle_config.natural_healhp_interval, 6000, NATURAL_HEAL_INTERVAL, INT_MAX, },
{ "natural_healsp_interval", &battle_config.natural_healsp_interval, 8000, NATURAL_HEAL_INTERVAL, INT_MAX, },
{ "natural_heal_skill_interval", &battle_config.natural_heal_skill_interval, 10000, NATURAL_HEAL_INTERVAL, INT_MAX, },
@@ -7029,7 +7098,7 @@ static const struct battle_data {
{ "show_steal_in_same_party", &battle_config.show_steal_in_same_party, 0, 0, 1, },
{ "party_hp_mode", &battle_config.party_hp_mode, 0, 0, 1, },
{ "show_party_share_picker", &battle_config.party_show_share_picker, 1, 0, 1, },
- { "show_picker.item_type", &battle_config.show_picker_item_type, 112, 0, INT_MAX, },
+ { "show_picker_item_type", &battle_config.show_picker_item_type, 112, 0, INT_MAX, },
{ "party_update_interval", &battle_config.party_update_interval, 1000, 100, INT_MAX, },
{ "party_item_share_type", &battle_config.party_share_type, 0, 0, 1|2|3, },
{ "attack_attr_none", &battle_config.attack_attr_none, ~BL_PC, BL_NUL, BL_ALL, },
@@ -7108,6 +7177,7 @@ static const struct battle_data {
{ "castrate_dex_scale", &battle_config.castrate_dex_scale, 150, 1, INT_MAX, },
{ "vcast_stat_scale", &battle_config.vcast_stat_scale, 530, 1, INT_MAX, },
{ "area_size", &battle_config.area_size, 14, 0, INT_MAX, },
+ { "chat_area_size", &battle_config.chat_area_size, 9, 0, INT_MAX, },
{ "zeny_from_mobs", &battle_config.zeny_from_mobs, 0, 0, 1, },
{ "mobs_level_up", &battle_config.mobs_level_up, 0, 0, 1, },
{ "mobs_level_up_exp_rate", &battle_config.mobs_level_up_exp_rate, 1, 1, INT_MAX, },
@@ -7141,7 +7211,6 @@ static const struct battle_data {
{ "mob_npc_event_type", &battle_config.mob_npc_event_type, 1, 0, 1, },
{ "character_size", &battle_config.character_size, 1|2, 0, 1|2, },
{ "retaliate_to_master", &battle_config.retaliate_to_master, 1, 0, 1, },
- { "rare_drop_announce", &battle_config.rare_drop_announce, 0, 0, 10000, },
{ "duel_allow_pvp", &battle_config.duel_allow_pvp, 0, 0, 1, },
{ "duel_allow_gvg", &battle_config.duel_allow_gvg, 0, 0, 1, },
{ "duel_allow_teleport", &battle_config.duel_allow_teleport, 0, 0, 1, },
@@ -7188,14 +7257,14 @@ static const struct battle_data {
{ "display_status_timers", &battle_config.display_status_timers, 1, 0, 1, },
{ "skill_add_heal_rate", &battle_config.skill_add_heal_rate, 7, 0, INT_MAX, },
{ "eq_single_target_reflectable", &battle_config.eq_single_target_reflectable, 1, 0, 1, },
- { "invincible.nodamage", &battle_config.invincible_nodamage, 0, 0, 1, },
+ { "invincible_nodamage", &battle_config.invincible_nodamage, 0, 0, 1, },
{ "mob_slave_keep_target", &battle_config.mob_slave_keep_target, 0, 0, 1, },
{ "autospell_check_range", &battle_config.autospell_check_range, 0, 0, 1, },
{ "knockback_left", &battle_config.knockback_left, 1, 0, 1, },
{ "client_reshuffle_dice", &battle_config.client_reshuffle_dice, 0, 0, 1, },
{ "client_sort_storage", &battle_config.client_sort_storage, 0, 0, 1, },
- { "feature.buying_store", &battle_config.feature_buying_store, 1, 0, 1, },
- { "feature.search_stores", &battle_config.feature_search_stores, 1, 0, 1, },
+ { "features/buying_store", &battle_config.feature_buying_store, 1, 0, 1, },
+ { "features/search_stores", &battle_config.feature_search_stores, 1, 0, 1, },
{ "searchstore_querydelay", &battle_config.searchstore_querydelay, 10, 0, INT_MAX, },
{ "searchstore_maxresults", &battle_config.searchstore_maxresults, 30, 1, INT_MAX, },
{ "display_party_name", &battle_config.display_party_name, 0, 0, 1, },
@@ -7215,7 +7284,7 @@ static const struct battle_data {
{ "atcommand_max_stat_bypass", &battle_config.atcommand_max_stat_bypass, 0, 0, 100, },
{ "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 300 },
{ "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1 },
- { "feature.atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 },
+ { "features/atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 },
{ "min_npc_vendchat_distance", &battle_config.min_npc_vendchat_distance, 3, 0, 100 },
{ "vendchat_near_hiddennpc", &battle_config.vendchat_near_hiddennpc, 0, 0, 1 },
{ "atcommand_mobinfo_type", &battle_config.atcommand_mobinfo_type, 0, 0, 1 },
@@ -7236,8 +7305,8 @@ static const struct battle_data {
{ "client_accept_chatdori", &battle_config.client_accept_chatdori, 0, 0, INT_MAX, },
{ "snovice_call_type", &battle_config.snovice_call_type, 0, 0, 1, },
{ "guild_notice_changemap", &battle_config.guild_notice_changemap, 2, 0, 2, },
- { "feature.banking", &battle_config.feature_banking, 1, 0, 1, },
- { "feature.auction", &battle_config.feature_auction, 0, 0, 2, },
+ { "features/banking", &battle_config.feature_banking, 1, 0, 1, },
+ { "features/auction", &battle_config.feature_auction, 0, 0, 2, },
{ "idletime_criteria", &battle_config.idletime_criteria, 0x25, 1, INT_MAX, },
{ "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, },
{ "case_sensitive_aegisnames", &battle_config.case_sensitive_aegisnames, 1, 0, 1, },
@@ -7249,7 +7318,7 @@ static const struct battle_data {
{ "monster_chase_refresh", &battle_config.mob_chase_refresh, 1, 0, 30, },
{ "mob_icewall_walk_block", &battle_config.mob_icewall_walk_block, 75, 0, 255, },
{ "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, },
- { "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, },
+ { "features/roulette", &battle_config.feature_roulette, 1, 0, 1, },
{ "show_monster_hp_bar", &battle_config.show_monster_hp_bar, 1, 0, 1, },
{ "fix_warp_hit_delay_abuse", &battle_config.fix_warp_hit_delay_abuse, 0, 0, 1, },
{ "costume_refine_def", &battle_config.costume_refine_def, 1, 0, 1, },
@@ -7258,6 +7327,14 @@ static const struct battle_data {
{ "min_body_style", &battle_config.min_body_style, 0, 0, SHRT_MAX, },
{ "max_body_style", &battle_config.max_body_style, 4, 0, SHRT_MAX, },
{ "save_body_style", &battle_config.save_body_style, 0, 0, 1, },
+ { "player_warp_keep_direction", &battle_config.player_warp_keep_direction, 0, 0, 1, },
+ { "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, },
+ { "bow_unequip_arrow", &battle_config.bow_unequip_arrow, 1, 0, 1, },
+ { "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, },
+ { "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, },
+ { "monster_eye_range_bonus", &battle_config.mob_eye_range_bonus, 0, 0, 10, },
+ { "prevent_logout_trigger", &battle_config.prevent_logout_trigger, 0xE, 0, 0xF, },
+ { "boarding_halter_speed", &battle_config.boarding_halter_speed, 25, 0, 100, },
};
#ifndef STATS_OPT_OUT
/**
@@ -7383,19 +7460,19 @@ void Hercules_report(char* date, char *time_c) {
WBUFW(buf,2) = 262 + ( bd_size * ( BFLAG_LENGTH + 4 ) );
WBUFW(buf,4) = 0x9f;
- safestrncpy((char*)WBUFP(buf,6), date, 12);
- safestrncpy((char*)WBUFP(buf,18), time_c, 9);
- safestrncpy((char*)WBUFP(buf,27), timestring, 24);
+ safestrncpy(WBUFP(buf,6), date, 12);
+ safestrncpy(WBUFP(buf,18), time_c, 9);
+ safestrncpy(WBUFP(buf,27), timestring, 24);
- safestrncpy((char*)WBUFP(buf,51), sysinfo->platform(), 16);
- safestrncpy((char*)WBUFP(buf,67), sysinfo->osversion(), 50);
- safestrncpy((char*)WBUFP(buf,117), sysinfo->cpu(), 32);
+ safestrncpy(WBUFP(buf,51), sysinfo->platform(), 16);
+ safestrncpy(WBUFP(buf,67), sysinfo->osversion(), 50);
+ safestrncpy(WBUFP(buf,117), sysinfo->cpu(), 32);
WBUFL(buf,149) = sysinfo->cpucores();
- safestrncpy((char*)WBUFP(buf,153), sysinfo->arch(), 8);
+ safestrncpy(WBUFP(buf,153), sysinfo->arch(), 8);
WBUFB(buf,161) = sysinfo->vcstypeid();
WBUFB(buf,162) = sysinfo->is64bit();
- safestrncpy((char*)WBUFP(buf,163), sysinfo->vcsrevision_src(), 41);
- safestrncpy((char*)WBUFP(buf,204), sysinfo->vcsrevision_scripts(), 41);
+ safestrncpy(WBUFP(buf,163), sysinfo->vcsrevision_src(), 41);
+ safestrncpy(WBUFP(buf,204), sysinfo->vcsrevision_scripts(), 41);
WBUFB(buf,245) = (sysinfo->is_superuser()? 1 : 0);
WBUFL(buf,246) = map->getusers();
@@ -7404,7 +7481,7 @@ void Hercules_report(char* date, char *time_c) {
WBUFL(buf,258) = bd_size;
for( i = 0; i < bd_size; i++ ) {
- safestrncpy((char*)WBUFP(buf,262 + ( i * ( BFLAG_LENGTH + 4 ) ) ), battle_data[i].str, BFLAG_LENGTH);
+ safestrncpy(WBUFP(buf,262 + ( i * ( BFLAG_LENGTH + 4 ) ) ), battle_data[i].str, BFLAG_LENGTH);
WBUFL(buf,262 + BFLAG_LENGTH + ( i * ( BFLAG_LENGTH + 4 ) ) ) = *battle_data[i].val;
}
@@ -7422,28 +7499,36 @@ static int Hercules_report_timer(int tid, int64 tick, int id, intptr_t data) {
}
#endif
-int battle_set_value(const char* w1, const char* w2)
+bool battle_set_value_sub(int index, int value)
+{
+ Assert_retr(false, index >= 0);
+ if (value < battle_data[index].min || value > battle_data[index].max) {
+ ShowWarning("Value for setting '%s': %d is invalid (min:%d max:%d)! Defaulting to %d...\n",
+ battle_data[index].str, value, battle_data[index].min, battle_data[index].max, battle_data[index].defval);
+ value = battle_data[index].defval;
+ }
+ *battle_data[index].val = value;
+ return true;
+}
+
+bool battle_set_value(const char *param, const char *value)
{
- int val = config_switch(w2);
+ int val;
int i;
- nullpo_retr(1, w1);
- nullpo_retr(1, w2);
- ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(w1, battle_data[i].str) == 0);
- if (i == ARRAYLENGTH(battle_data)) {
- if( HPM->parseConf(w1,w2,HPCT_BATTLE) ) /* if plugin-owned, succeed */
- return 1;
- return 0; // not found
- }
+ nullpo_retr(false, param);
+ nullpo_retr(false, value);
- if (val < battle_data[i].min || val > battle_data[i].max)
- {
- ShowWarning("Value for setting '%s': %s is invalid (min:%i max:%i)! Defaulting to %i...\n", w1, w2, battle_data[i].min, battle_data[i].max, battle_data[i].defval);
- val = battle_data[i].defval;
+ val = config_switch(value);
+
+ ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(param, battle_data[i].str) == 0);
+ if (i == ARRAYLENGTH(battle_data)) {
+ if (HPM->parse_conf_entry(param, value, HPCT_BATTLE)) /* if plugin-owned, succeed */
+ return true;
+ return false; // not found
}
- *battle_data[i].val = val;
- return 1;
+ return battle->config_set_value_sub(i, val);
}
bool battle_get_value(const char *w1, int *value)
@@ -7494,88 +7579,125 @@ void battle_adjust_conf(void) {
#if PACKETVER < 20100427
if( battle_config.feature_buying_store ) {
- ShowWarning("conf/battle/feature.conf buying_store is enabled but it requires PACKETVER 2010-04-27 or newer, disabling...\n");
+ ShowWarning("conf/map/battle/feature.conf buying_store is enabled but it requires PACKETVER 2010-04-27 or newer, disabling...\n");
battle_config.feature_buying_store = 0;
}
#endif
#if PACKETVER < 20100803
if( battle_config.feature_search_stores ) {
- ShowWarning("conf/battle/feature.conf search_stores is enabled but it requires PACKETVER 2010-08-03 or newer, disabling...\n");
+ ShowWarning("conf/map/battle/feature.conf search_stores is enabled but it requires PACKETVER 2010-08-03 or newer, disabling...\n");
battle_config.feature_search_stores = 0;
}
#endif
#if PACKETVER < 20130724
if( battle_config.feature_banking ) {
- ShowWarning("conf/battle/feature.conf banking is enabled but it requires PACKETVER 2013-07-24 or newer, disabling...\n");
+ ShowWarning("conf/map/battle/feature.conf banking is enabled but it requires PACKETVER 2013-07-24 or newer, disabling...\n");
battle_config.feature_banking = 0;
}
#endif
#if PACKETVER < 20141022
if( battle_config.feature_roulette ) {
- ShowWarning("conf/battle/feature.conf roulette is enabled but it requires PACKETVER 2014-10-22 or newer, disabling...\n");
+ ShowWarning("conf/map/battle/feature.conf roulette is enabled but it requires PACKETVER 2014-10-22 or newer, disabling...\n");
battle_config.feature_roulette = 0;
}
#endif
#if PACKETVER > 20120000 && PACKETVER < 20130515 /* exact date (when it started) not known */
if( battle_config.feature_auction == 1 ) {
- ShowWarning("conf/battle/feature.conf:feature.auction is enabled but it is not stable on PACKETVER "EXPAND_AND_QUOTE(PACKETVER)", disabling...\n");
- ShowWarning("conf/battle/feature.conf:feature.auction change value to '2' to silence this warning and maintain it enabled\n");
+ ShowWarning("conf/map/battle/feature.conf:features/auction is enabled but it is not stable on PACKETVER "EXPAND_AND_QUOTE(PACKETVER)", disabling...\n");
+ ShowWarning("conf/map/battle/feature.conf:features/auction change value to '2' to silence this warning and maintain it enabled\n");
battle_config.feature_auction = 0;
}
#endif
+#if PACKETVER < 20131223
+ if (battle_config.mvp_exp_reward_message) {
+ ShowWarning("conf/map/battle/client.conf MVP EXP reward message is enabled but it requires PACKETVER 2013-12-23 or newer, disabling...\n");
+ battle_config.mvp_exp_reward_message = 0;
+ }
+#endif
+
#ifndef CELL_NOSTACK
if (battle_config.custom_cell_stack_limit != 1)
ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n");
#endif
}
-int battle_config_read(const char* cfgName)
+/**
+ * Dynamically reads battle configuration and initializes required variables.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ * @retval false in case of error.
+ */
+bool battle_config_read(const char *filename, bool imported)
{
- FILE* fp;
- static int count = 0;
+ struct config_t config;
+ const struct config_setting_t *setting = NULL;
+ int i;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
- nullpo_ret(cfgName);
+ if (!libconfig->load_file(&config, filename))
+ return false; // Error message is already shown by libconfig->load_file()
- if (count == 0)
+ if (!imported)
battle->config_set_defaults();
- count++;
+ for (i = 0; i < ARRAYLENGTH(battle_data); i++) {
+ int type, val;
+ char config_name[256];
+ safesnprintf(config_name, sizeof config_name, "battle_configuration/%s", battle_data[i].str);
- fp = fopen(cfgName,"r");
- if (fp == NULL)
- ShowError("File not found: %s\n", cfgName);
- else
- {
- char line[1024], w1[1024], w2[1024];
- while(fgets(line, sizeof(line), fp))
- {
- if (line[0] == '/' && line[1] == '/')
- continue;
- if (sscanf(line, "%1023[^:]:%1023s", w1, w2) != 2)
- continue;
- if (strcmpi(w1, "import") == 0)
- battle->config_read(w2);
- else
- if (battle->config_set_value(w1, w2) == 0)
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
+ if ((setting = libconfig->lookup(&config, config_name)) == NULL) {
+ if (!imported) {
+ ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename);
+ retval = false;
+ }
+ continue;
}
- fclose(fp);
+ switch ((type = config_setting_type(setting))) {
+ case CONFIG_TYPE_INT:
+ val = libconfig->setting_get_int(setting);
+ break;
+ case CONFIG_TYPE_BOOL:
+ val = libconfig->setting_get_bool(setting);
+ break;
+ default: // Unsupported type
+ ShowWarning("Setting %s has unsupported type %d, ignoring...\n", config_name, type);
+ retval = false;
+ continue;
+ }
+
+ if (!battle->config_set_value_sub(i, val))
+ retval = false;
}
- count--;
+ if (!HPM->parse_battle_conf(&config, filename, imported))
+ retval = false;
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, map->BATTLE_CONF_FILENAME) == 0) {
+ ShowWarning("battle_config_read: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!battle->config_read(import, true))
+ retval = false;
+ }
+ }
- if (count == 0) {
+ libconfig->destroy(&config);
+ if (!imported) {
battle->config_adjust();
clif->bc_ready();
}
-
- return 0;
+ return retval;
}
void do_init_battle(bool minimal) {
@@ -7610,9 +7732,11 @@ void battle_defaults(void) {
battle->calc_attack = battle_calc_attack;
battle->calc_damage = battle_calc_damage;
+ battle->calc_pc_damage = battle_calc_pc_damage;
battle->calc_gvg_damage = battle_calc_gvg_damage;
battle->calc_bg_damage = battle_calc_bg_damage;
battle->weapon_attack = battle_weapon_attack;
+ battle->check_arrows = battle_check_arrows;
battle->calc_weapon_attack = battle_calc_weapon_attack;
battle->delay_damage = battle_delay_damage;
battle->drain = battle_drain;
@@ -7652,6 +7776,7 @@ void battle_defaults(void) {
battle->calc_drain = battle_calc_drain;
battle->config_read = battle_config_read;
battle->config_set_defaults = battle_set_defaults;
+ battle->config_set_value_sub = battle_set_value_sub;
battle->config_set_value = battle_set_value;
battle->config_get_value = battle_get_value;
battle->config_adjust = battle_adjust_conf;
diff --git a/src/map/battle.h b/src/map/battle.h
index 49abdc730..a73c6dc44 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -240,12 +240,13 @@ struct Battle_Config {
int combo_delay_rate;
int item_check;
int item_use_interval; //[Skotlex]
- int cashfood_use_interval;
int wedding_modifydisplay;
int wedding_ignorepalette; //[Skotlex]
int xmas_ignorepalette; // [Valaris]
int summer_ignorepalette; // [Zephyrus]
int hanbok_ignorepalette;
+ int oktoberfest_ignorepalette;
+ int summer2_ignorepalette;
int natural_healhp_interval;
int natural_healsp_interval;
int natural_heal_skill_interval;
@@ -362,6 +363,7 @@ struct Battle_Config {
int castrate_dex_scale; // added by [MouseJstr]
int area_size; // added by [MouseJstr]
+ int chat_area_size; // added by [gumi]
int max_def, over_def_bonus; //added by [Skotlex]
@@ -406,7 +408,6 @@ struct Battle_Config {
int mob_npc_event_type; //Determines on who the npc_event is executed. [Skotlex]
int character_size; // if riders have size=2, and baby class riders size=1 [Lupus]
- int rare_drop_announce; // chance <= to show rare drops global announces
int retaliate_to_master; //Whether when a mob is attacked by another mob, it will retaliate versus the mob or the mob's master. [Skotlex]
@@ -539,6 +540,21 @@ struct Battle_Config {
// BodyStyle
int min_body_style, max_body_style;
int save_body_style;
+
+ // Warp Face Direction
+ int player_warp_keep_direction;
+
+ int atcommand_levelup_events; // Enable atcommands trigger level up events for NPCs
+
+ int bow_unequip_arrow;
+
+ int max_summoner_parameter; // Summoner Max Stats
+ int mvp_exp_reward_message;
+
+ int mob_eye_range_bonus; //Vulture's Eye and Snake's Eye range bonus
+
+ int prevent_logout_trigger;
+ int boarding_halter_speed;
};
/* criteria for battle_config.idletime_critera */
@@ -587,12 +603,16 @@ struct battle_interface {
struct Damage (*calc_attack) (int attack_type, struct block_list *bl, struct block_list *target, uint16 skill_id, uint16 skill_lv, int count);
/* generic final damage calculation */
int64 (*calc_damage) (struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv);
+ /* pc special damage calculation */
+ int64 (*calc_pc_damage) (struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv);
/* gvg final damage calculation */
int64 (*calc_gvg_damage) (struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag);
/* battlegrounds final damage calculation */
int64 (*calc_bg_damage) (struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag);
/* normal weapon attack */
enum damage_lv (*weapon_attack) (struct block_list *bl, struct block_list *target, int64 tick, int flag);
+ /* check is equipped ammo and this ammo allowed */
+ bool (*check_arrows) (struct map_session_data *sd);
/* calculate weapon attack */
struct Damage (*calc_weapon_attack) (struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int wflag);
/* delays damage or skills by a timer */
@@ -654,10 +674,11 @@ struct battle_interface {
int (*adjust_skill_damage) (int m, unsigned short skill_id);
int64 (*add_mastery) (struct map_session_data *sd,struct block_list *target,int64 dmg,int type);
int (*calc_drain) (int64 damage, int rate, int per);
- /* - battle_config */
- int (*config_read) (const char *cfgName);
+ /* battle_config */
+ bool (*config_read) (const char *filename, bool imported);
void (*config_set_defaults) (void);
- int (*config_set_value) (const char *w1, const char *w2);
+ bool (*config_set_value_sub) (int index, int value);
+ bool (*config_set_value) (const char *param, const char *value);
bool (*config_get_value) (const char *w1, int *value);
void (*config_adjust) (void);
/* ----------------------------------------- */
diff --git a/src/map/battleground.c b/src/map/battleground.c
index e3fedbf34..cd7178951 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -171,7 +171,7 @@ int bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type flag) {
sprintf(output, "Server : %s has been afk-kicked from the battlefield...", sd->status.name);
break;
}
- clif->bg_message(bgd, 0, "Server", output, strlen(output) + 1);
+ clif->bg_message(bgd, 0, "Server", output);
}
if( bgd->logout_event[0] && flag )
@@ -265,21 +265,23 @@ int bg_team_get_id(struct block_list *bl) {
return 0;
}
-bool bg_send_message(struct map_session_data *sd, const char *mes, int len) {
+bool bg_send_message(struct map_session_data *sd, const char *mes)
+{
struct battleground_data *bgd;
nullpo_ret(sd);
nullpo_ret(mes);
if( sd->bg_id == 0 || (bgd = bg->team_search(sd->bg_id)) == NULL )
return false; // Couldn't send message
- clif->bg_message(bgd, sd->bl.id, sd->status.name, mes, len);
+ clif->bg_message(bgd, sd->bl.id, sd->status.name, mes);
return true;
}
/**
* @see DBApply
*/
-int bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
+int bg_send_xy_timer_sub(union DBKey key, struct DBData *data, va_list ap)
+{
struct battleground_data *bgd = DB->data2ptr(data);
struct map_session_data *sd;
int i;
@@ -330,18 +332,18 @@ enum bg_queue_types bg_str2teamtype (const char *str) {
}
void bg_config_read(void) {
- config_t bg_conf;
- config_setting_t *data = NULL;
+ struct config_t bg_conf;
+ struct config_setting_t *data = NULL;
const char *config_filename = "conf/battlegrounds.conf"; // FIXME hardcoded name
- if (libconfig->read_file(&bg_conf, config_filename))
+ if (!libconfig->load_file(&bg_conf, config_filename))
return;
data = libconfig->lookup(&bg_conf, "battlegrounds");
if (data != NULL) {
- config_setting_t *settings = libconfig->setting_get_elem(data, 0);
- config_setting_t *arenas;
+ struct config_setting_t *settings = libconfig->setting_get_elem(data, 0);
+ struct config_setting_t *arenas;
const char *delay_var;
int offline = 0;
@@ -361,8 +363,8 @@ void bg_config_read(void) {
int arena_count = libconfig->setting_length(arenas);
CREATE( bg->arena, struct bg_arena *, arena_count );
for(i = 0; i < arena_count; i++) {
- config_setting_t *arena = libconfig->setting_get_elem(arenas, i);
- config_setting_t *reward;
+ struct config_setting_t *arena = libconfig->setting_get_elem(arenas, i);
+ struct config_setting_t *reward;
const char *aName, *aEvent, *aDelayVar, *aTeamTypes;
int minLevel = 0, maxLevel = 0;
int prizeWin, prizeLoss, prizeDraw;
@@ -495,7 +497,8 @@ void bg_config_read(void) {
}
libconfig->destroy(&bg_conf);
}
-struct bg_arena *bg_name2arena (char *name) {
+struct bg_arena *bg_name2arena(const char *name)
+{
int i;
nullpo_retr(NULL, name);
for(i = 0; i < bg->arenas; i++) {
@@ -819,7 +822,7 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
if ( sd->status.base_level > arena->max_level || sd->status.base_level < arena->min_level )
return BGQA_FAIL_LEVEL_INCORRECT;
- if ( !(sd->class_&JOBL_2) ) /* TODO: maybe make this a per-arena setting, so users may make custom arenas like baby-only,whatever. */
+ if ((sd->job & JOBL_2) == 0) /* TODO: maybe make this a per-arena setting, so users may make custom arenas like baby-only,whatever. */
return BGQA_FAIL_CLASS_INVALID;
tsec = (unsigned int)time(NULL);
@@ -827,9 +830,9 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
if ( ( tick = pc_readglobalreg(sd, script->add_str(bg->gdelay_var)) ) && tsec < tick ) {
char response[100];
if( (tick-tsec) > 60 )
- sprintf(response, "You are a deserter! Wait %d minute(s) before you can apply again",(tick-tsec)/60);
+ sprintf(response, "You are a deserter! Wait %u minute(s) before you can apply again", (tick - tsec) / 60);
else
- sprintf(response, "You are a deserter! Wait %d seconds before you can apply again",(tick-tsec));
+ sprintf(response, "You are a deserter! Wait %u seconds before you can apply again", (tick - tsec));
clif->messagecolor_self(sd->fd, COLOR_RED, response);
return BGQA_FAIL_DESERTER;
}
@@ -837,9 +840,9 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
if ( ( tick = pc_readglobalreg(sd, script->add_str(arena->delay_var)) ) && tsec < tick ) {
char response[100];
if( (tick-tsec) > 60 )
- sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %d minute(s)",(tick-tsec)/60);
+ sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u minute(s)", (tick - tsec) / 60);
else
- sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %d seconds",(tick-tsec));
+ sprintf(response, "You can't reapply to this arena so fast. Apply to the different arena or wait %u seconds", (tick - tsec));
clif->messagecolor_self(sd->fd, COLOR_RED, response);
return BGQA_FAIL_COOLDOWN;
}
@@ -859,11 +862,11 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
count++;
}
if ( count < arena->min_team_players ) {
- char response[117];
+ char response[121];
if( count != sd->guild->connect_member && sd->guild->connect_member >= arena->min_team_players )
- sprintf(response, "Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d",arena->min_team_players);
+ sprintf(response, "Can't apply: not enough members in your team/guild that have not entered the queue in individual mode, minimum is %d", arena->min_team_players);
else
- sprintf(response, "Can't apply: not enough members in your team/guild, minimum is %d",arena->min_team_players);
+ sprintf(response, "Can't apply: not enough members in your team/guild, minimum is %d", arena->min_team_players);
clif->messagecolor_self(sd->fd, COLOR_RED, response);
return BGQA_FAIL_TEAM_COUNT;
}
@@ -891,9 +894,9 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
return BGQA_NOT_PARTY_GUILD_LEADER;
if( count < arena->min_team_players ) {
- char response[117];
+ char response[121];
if( count != p->party.count && p->party.count >= arena->min_team_players )
- sprintf(response, "Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d",arena->min_team_players);
+ sprintf(response, "Can't apply: not enough members in your team/party that have not entered the queue in individual mode, minimum is %d", arena->min_team_players);
else
sprintf(response, "Can't apply: not enough members in your team/party, minimum is %d",arena->min_team_players);
clif->messagecolor_self(sd->fd, COLOR_RED, response);
@@ -906,7 +909,7 @@ enum BATTLEGROUNDS_QUEUE_ACK bg_canqueue(struct map_session_data *sd, struct bg_
case BGQT_INDIVIDUAL:/* already did */
break;
default:
- ShowDebug("bg_canqueue: unknown/unsupported type %d\n",type);
+ ShowDebug("bg_canqueue: unknown/unsupported type %u\n", type);
return BGQA_DUPLICATE_REQUEST;
}
return BGQA_SUCCESS;
@@ -924,7 +927,8 @@ void do_init_battleground(bool minimal) {
/**
* @see DBApply
*/
-int bg_team_db_final(DBKey key, DBData *data, va_list ap) {
+int bg_team_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct battleground_data* bgd = DB->data2ptr(data);
HPM->data_store_destroy(&bgd->hdata);
diff --git a/src/map/battleground.h b/src/map/battleground.h
index 639d91635..6bd0f2c99 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -102,13 +102,13 @@ struct battleground_interface {
struct bg_arena **arena;
unsigned char arenas;
/* */
- DBMap *team_db; // int bg_id -> struct battleground_data*
+ struct DBMap *team_db; // int bg_id -> struct battleground_data*
unsigned int team_counter; // Next bg_id
/* */
void (*init) (bool minimal);
void (*final) (void);
/* */
- struct bg_arena *(*name2arena) (char *name);
+ struct bg_arena *(*name2arena) (const char *name);
void (*queue_add) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
enum BATTLEGROUNDS_QUEUE_ACK (*can_queue) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
int (*id2pos) (int queue_id, int account_id);
@@ -130,11 +130,11 @@ struct battleground_interface {
bool (*member_respawn) (struct map_session_data *sd);
int (*create) (unsigned short map_index, short rx, short ry, const char *ev, const char *dev);
int (*team_get_id) (struct block_list *bl);
- bool (*send_message) (struct map_session_data *sd, const char *mes, int len);
- int (*send_xy_timer_sub) (DBKey key, DBData *data, va_list ap);
+ bool (*send_message) (struct map_session_data *sd, const char *mes);
+ int (*send_xy_timer_sub) (union DBKey key, struct DBData *data, va_list ap);
int (*send_xy_timer) (int tid, int64 tick, int id, intptr_t data);
int (*afk_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*team_db_final) (DBKey key, DBData *data, va_list ap);
+ int (*team_db_final) (union DBKey key, struct DBData *data, va_list ap);
/* */
enum bg_queue_types (*str2teamtype) (const char *str);
/* */
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 3828a3c14..70e08a4b4 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -100,7 +100,7 @@ void buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
if( !pc_can_give_items(sd) )
{// custom: GM is not allowed to buy (give zeny)
sd->buyingstore.slots = 0;
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
clif->buyingstore_open_failed(sd, BUYINGSTORE_CREATE, 0);
return;
}
@@ -222,7 +222,7 @@ void buyingstore_open(struct map_session_data* sd, int account_id)
if( !pc_can_give_items(sd) )
{// custom: GM is not allowed to sell
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
return;
}
@@ -261,7 +261,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
if( !pc_can_give_items(sd) )
{// custom: GM is not allowed to sell
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, 0);
return;
}
@@ -383,7 +383,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
// notify clients
clif->buyingstore_delete_item(sd, index, amount, pl_sd->buyingstore.items[listidx].price);
- clif->buyingstore_update_item(pl_sd, nameid, amount);
+ clif->buyingstore_update_item(pl_sd, nameid, amount, sd->status.char_id, zeny);
}
if( map->save_settings&128 ) {
diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h
index 1e277b7fa..b3756c39e 100644
--- a/src/map/buyingstore.h
+++ b/src/map/buyingstore.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/channel.c b/src/map/channel.c
index d778b355d..9ec415883 100644
--- a/src/map/channel.c
+++ b/src/map/channel.c
@@ -26,6 +26,7 @@
#include "map/instance.h"
#include "map/irc-bot.h"
#include "map/map.h"
+#include "map/npc.h"
#include "map/pc.h"
#include "common/cbasetypes.h"
#include "common/conf.h"
@@ -127,9 +128,8 @@ void channel_delete(struct channel_data *chan)
nullpo_retv(chan);
if (db_size(chan->users) && !channel->config->closing) {
- DBIterator *iter;
struct map_session_data *sd;
- iter = db_iterator(chan->users);
+ struct DBIterator *iter = db_iterator(chan->users);
for (sd = dbi_first(iter); dbi_exists(iter); sd = dbi_next(iter)) {
channel->leave_sub(chan, sd);
}
@@ -279,12 +279,21 @@ void channel_send(struct channel_data *chan, struct map_session_data *sd, const
clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1455));
return;
} else if (sd) {
+ int i;
+
safesnprintf(message, 150, "[ #%s ] %s : %s", chan->name, sd->status.name, msg);
clif->channel_msg(chan,sd,message);
if (chan->type == HCS_TYPE_IRC)
ircbot->relay(sd->status.name,msg);
if (chan->msg_delay != 0)
sd->hchsysch_tick = timer->gettick();
+
+ for (i = 0; i < MAX_EVENTQUEUE; i++) {
+ if (chan->handlers[i][0] != '\0') {
+ pc->setregstr(sd, script->add_str("@channelmes$"), msg);
+ npc->event(sd, chan->handlers[i], 0);
+ }
+ }
} else {
safesnprintf(message, 150, "[ #%s ] %s", chan->name, msg);
clif->channel_msg2(chan, message);
@@ -589,19 +598,19 @@ void channel_quit_guild(struct map_session_data *sd)
void read_channels_config(void)
{
- config_t channels_conf;
- config_setting_t *chsys = NULL;
+ struct config_t channels_conf;
+ struct config_setting_t *chsys = NULL;
const char *config_filename = "conf/channels.conf"; // FIXME hardcoded name
- if (libconfig->read_file(&channels_conf, config_filename))
+ if (!libconfig->load_file(&channels_conf, config_filename))
return;
chsys = libconfig->lookup(&channels_conf, "chsys");
if (chsys != NULL) {
- config_setting_t *settings = libconfig->setting_get_elem(chsys, 0);
- config_setting_t *channels;
- config_setting_t *colors;
+ struct config_setting_t *settings = libconfig->setting_get_elem(chsys, 0);
+ struct config_setting_t *channels;
+ struct config_setting_t *colors;
int i,k;
const char *local_name, *ally_name,
*local_color, *ally_color,
@@ -610,7 +619,10 @@ void read_channels_config(void)
local_autojoin = 0, ally_autojoin = 0,
allow_user_channel_creation = 0,
irc_enabled = 0,
- irc_autojoin = 0;
+ irc_autojoin = 0,
+ irc_flood_protection_rate = 0,
+ irc_flood_protection_burst = 0,
+ irc_flood_protection_enabled = 0;
if( !libconfig->setting_lookup_string(settings, "map_local_channel_name", &local_name) )
local_name = "map";
@@ -641,58 +653,52 @@ void read_channels_config(void)
const char *irc_server, *irc_channel,
*irc_nick, *irc_nick_pw;
int irc_use_ghost = 0;
- if( libconfig->setting_lookup_string(settings, "irc_channel_network", &irc_server) ) {
- if( !strstr(irc_server,":") ) {
+ if (!libconfig->setting_lookup_string(settings, "irc_channel_network", &irc_server)) {
+ channel->config->irc = false;
+ ShowWarning("channels.conf : irc channel enabled but irc_channel_network wasn't found, disabling irc channel...\n");
+ } else {
+ char *server = aStrdup(irc_server);
+ char *port = strchr(server, ':');
+ if (port == NULL) {
+ channel->config->irc = false;
+ ShowWarning("channels.conf: network port wasn't found in 'irc_channel_network', disabling irc channel...\n");
+ } else if ((size_t)(port-server) > sizeof channel->config->irc_server - 1) {
channel->config->irc = false;
- ShowWarning("channels.conf : network port wasn't found in 'irc_channel_network', disabling irc channel...\n");
+ ShowWarning("channels.conf: server name is too long in 'irc_channel_network', disabling irc channel...\n");
} else {
- unsigned char d = 0, dlen = strlen(irc_server);
- char server[40];
- if (dlen > 39)
- dlen = 39;
- memset(server, '\0', sizeof(server));
-
- for(d = 0; d < dlen; d++) {
- if(irc_server[d] == ':') {
- memcpy(server, irc_server, d);
- safestrncpy(channel->config->irc_server, server, 40);
- memcpy(server, &irc_server[d+1], dlen - d - 1);
- channel->config->irc_server_port = atoi(server);
- break;
- }
- }
+ *port = '\0';
+ port++;
+ safestrncpy(channel->config->irc_server, server, sizeof channel->config->irc_server);
+ channel->config->irc_server_port = atoi(port);
}
- } else {
- channel->config->irc = false;
- ShowWarning("channels.conf : irc channel enabled but irc_channel_network wasn't found, disabling irc channel...\n");
+ aFree(server);
}
- if( libconfig->setting_lookup_string(settings, "irc_channel_channel", &irc_channel) )
+ if (libconfig->setting_lookup_string(settings, "irc_channel_channel", &irc_channel)) {
safestrncpy(channel->config->irc_channel, irc_channel, 50);
- else {
+ } else {
channel->config->irc = false;
ShowWarning("channels.conf : irc channel enabled but irc_channel_channel wasn't found, disabling irc channel...\n");
}
- if( libconfig->setting_lookup_string(settings, "irc_channel_nick", &irc_nick) ) {
- if( strcmpi(irc_nick,"Hercules_chSysBot") == 0 ) {
+ if (libconfig->setting_lookup_string(settings, "irc_channel_nick", &irc_nick)) {
+ if (strcmpi(irc_nick,"Hercules_chSysBot") == 0) {
sprintf(channel->config->irc_nick, "Hercules_chSysBot%d",rnd()%777);
- } else
+ } else {
safestrncpy(channel->config->irc_nick, irc_nick, 40);
+ }
} else {
channel->config->irc = false;
ShowWarning("channels.conf : irc channel enabled but irc_channel_nick wasn't found, disabling irc channel...\n");
}
- if( libconfig->setting_lookup_string(settings, "irc_channel_nick_pw", &irc_nick_pw) ) {
+ if (libconfig->setting_lookup_string(settings, "irc_channel_nick_pw", &irc_nick_pw)) {
safestrncpy(channel->config->irc_nick_pw, irc_nick_pw, 30);
config_setting_lookup_bool(settings, "irc_channel_use_ghost", &irc_use_ghost);
channel->config->irc_use_ghost = irc_use_ghost;
}
-
}
libconfig->setting_lookup_bool(settings, "map_local_channel_autojoin", &local_autojoin);
libconfig->setting_lookup_bool(settings, "ally_channel_autojoin", &ally_autojoin);
libconfig->setting_lookup_bool(settings, "irc_channel_autojoin", &irc_autojoin);
-
if (local_autojoin)
channel->config->local_autojoin = true;
if (ally_autojoin)
@@ -700,6 +706,26 @@ void read_channels_config(void)
if (irc_autojoin)
channel->config->irc_autojoin = true;
+ libconfig->setting_lookup_bool(settings, "irc_flood_protection_enabled", &irc_flood_protection_enabled);
+
+ if (irc_flood_protection_enabled) {
+ ircbot->flood_protection_enabled = true;
+
+ libconfig->setting_lookup_int(settings, "irc_flood_protection_rate", &irc_flood_protection_rate);
+ libconfig->setting_lookup_int(settings, "irc_flood_protection_burst", &irc_flood_protection_burst);
+
+ if (irc_flood_protection_rate > 0)
+ ircbot->flood_protection_rate = irc_flood_protection_rate;
+ else
+ ircbot->flood_protection_rate = 1000;
+ if (irc_flood_protection_burst > 0)
+ ircbot->flood_protection_burst = irc_flood_protection_burst;
+ else
+ ircbot->flood_protection_burst = 3;
+ } else {
+ ircbot->flood_protection_enabled = false;
+ }
+
libconfig->setting_lookup_bool(settings, "allow_user_channel_creation", &allow_user_channel_creation);
if( allow_user_channel_creation )
@@ -710,7 +736,7 @@ void read_channels_config(void)
CREATE(channel->config->colors, unsigned int, color_count);
CREATE(channel->config->colors_name, char *, color_count);
for(i = 0; i < color_count; i++) {
- config_setting_t *color = libconfig->setting_get_elem(colors, i);
+ struct config_setting_t *color = libconfig->setting_get_elem(colors, i);
CREATE(channel->config->colors_name[i], char, HCS_NAME_LENGTH);
@@ -771,7 +797,7 @@ void read_channels_config(void)
int channel_count = libconfig->setting_length(channels);
for(i = 0; i < channel_count; i++) {
- config_setting_t *chan = libconfig->setting_get_elem(channels, i);
+ struct config_setting_t *chan = libconfig->setting_get_elem(channels, i);
const char *name = config_setting_name(chan);
const char *color = libconfig->setting_get_string_elem(channels,i);
@@ -792,7 +818,7 @@ void read_channels_config(void)
}
}
- ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' channels in '"CL_WHITE"%s"CL_RESET"'.\n", db_size(channel->db), config_filename);
+ ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' channels in '"CL_WHITE"%s"CL_RESET"'.\n", db_size(channel->db), config_filename);
}
libconfig->destroy(&channels_conf);
}
@@ -814,7 +840,7 @@ int do_init_channel(bool minimal)
void do_final_channel(void)
{
- DBIterator *iter = db_iterator(channel->db);
+ struct DBIterator *iter = db_iterator(channel->db);
struct channel_data *chan;
unsigned char i;
diff --git a/src/map/channel.h b/src/map/channel.h
index ac1c8f0cb..4ac3c6037 100644
--- a/src/map/channel.h
+++ b/src/map/channel.h
@@ -21,12 +21,14 @@
#define MAP_CHANNEL_H
#include "common/hercules.h"
-#include "common/db.h"
#include "common/mmo.h"
+#include "map/map.h" // EVENT_NAME_LENGTH, MAX_EVENTQUEUE
+
/**
* Declarations
**/
+struct DBMap; // common/db.h
struct map_session_data;
struct guild;
@@ -83,8 +85,9 @@ struct channel_data {
char name[HCS_NAME_LENGTH];
char password[HCS_NAME_LENGTH];
unsigned char color;
- DBMap *users;
- DBMap *banned;
+ struct DBMap *users;
+ struct DBMap *banned;
+ char handlers[MAX_EVENTQUEUE][EVENT_NAME_LENGTH];
unsigned int options;
unsigned int owner;
enum channel_types type;
@@ -94,7 +97,7 @@ struct channel_data {
struct channel_interface {
/* vars */
- DBMap *db;
+ struct DBMap *db;
struct Channel_Config *config;
int (*init) (bool minimal);
diff --git a/src/map/chat.c b/src/map/chat.c
index d60b9bece..763d98f7a 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -44,7 +44,7 @@ struct chat_interface *chat;
/// Initializes a chatroom object (common functionality for both pc and npc chatrooms).
/// Returns a chatroom object on success, or NULL on failure.
-struct chat_data* chat_createchat(struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl)
+struct chat_data* chat_createchat(struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int min_level, int max_level)
{
struct chat_data* cd;
nullpo_retr(NULL, bl);
@@ -62,8 +62,8 @@ struct chat_data* chat_createchat(struct block_list* bl, const char* title, cons
cd->limit = min(limit, ARRAYLENGTH(cd->usersd));
cd->trigger = trigger;
cd->zeny = zeny;
- cd->minLvl = minLvl;
- cd->maxLvl = maxLvl;
+ cd->min_level = min_level;
+ cd->max_level = max_level;
memset(cd->usersd, 0, sizeof(cd->usersd));
cd->owner = bl;
safestrncpy(cd->npc_event, ev, sizeof(cd->npc_event));
@@ -97,7 +97,7 @@ bool chat_createpcchat(struct map_session_data* sd, const char* title, const cha
nullpo_ret(title);
nullpo_ret(pass);
- if( sd->chatID )
+ if (sd->chat_id != 0)
return false; //Prevent people abusing the chat system by creating multiple chats, as pointed out by End of Exam. [Skotlex]
if( sd->state.vending || sd->state.buyingstore )
@@ -106,8 +106,8 @@ bool chat_createpcchat(struct map_session_data* sd, const char* title, const cha
}
if( map->list[sd->bl.m].flag.nochat ) {
- clif->message(sd->fd, msg_sd(sd,281));
- return false; //Can't create chatrooms on this map.
+ clif->message(sd->fd, msg_sd(sd,281)); // You can't create chat rooms in this map
+ return false;
}
if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOCHAT) ) {
@@ -142,8 +142,10 @@ bool chat_joinchat(struct map_session_data* sd, int chatid, const char* pass) {
nullpo_ret(pass);
cd = map->id2cd(chatid);
- if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit )
- {
+ if (cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m
+ || sd->state.vending || sd->state.buyingstore || sd->chat_id != 0
+ || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit
+ ) {
clif->joinchatfail(sd,0); // room full
return false;
}
@@ -154,8 +156,8 @@ bool chat_joinchat(struct map_session_data* sd, int chatid, const char* pass) {
return false;
}
- if( sd->status.base_level < cd->minLvl || sd->status.base_level > cd->maxLvl ) {
- if(sd->status.base_level < cd->minLvl)
+ if (sd->status.base_level < cd->min_level || sd->status.base_level > cd->max_level) {
+ if(sd->status.base_level < cd->min_level)
clif->joinchatfail(sd,5); // too low level
else
clif->joinchatfail(sd,6); // too high level
@@ -204,8 +206,8 @@ int chat_leavechat(struct map_session_data* sd, bool kicked) {
nullpo_retr(0, sd);
- cd = map->id2cd(sd->chatID);
- if( cd == NULL ) {
+ cd = map->id2cd(sd->chat_id);
+ if (cd == NULL) {
pc_setchatid(sd, 0);
return 0;
}
@@ -279,7 +281,7 @@ bool chat_changechatowner(struct map_session_data* sd, const char* nextownername
nullpo_ret(sd);
nullpo_ret(nextownername);
- cd = map->id2cd(sd->chatID);
+ cd = map->id2cd(sd->chat_id);
if (cd == NULL || &sd->bl != cd->owner)
return false;
@@ -324,7 +326,7 @@ bool chat_changechatstatus(struct map_session_data* sd, const char* title, const
nullpo_ret(title);
nullpo_ret(pass);
- cd = map->id2cd(sd->chatID);
+ cd = map->id2cd(sd->chat_id);
if (cd == NULL || &sd->bl != cd->owner)
return false;
@@ -352,7 +354,7 @@ bool chat_kickchat(struct map_session_data* sd, const char* kickusername) {
nullpo_ret(sd);
nullpo_ret(kickusername);
- cd = map->id2cd(sd->chatID);
+ cd = map->id2cd(sd->chat_id);
if (cd == NULL || &sd->bl != cd->owner)
return false;
@@ -373,7 +375,7 @@ bool chat_kickchat(struct map_session_data* sd, const char* kickusername) {
/*==========================================
* Creates a chat room for the npc
*------------------------------------------*/
-bool chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl)
+bool chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int min_level, int max_level)
{
struct chat_data* cd;
nullpo_ret(nd);
@@ -383,12 +385,12 @@ bool chat_createnpcchat(struct npc_data* nd, const char* title, int limit, bool
return false;
}
- if( zeny > MAX_ZENY || maxLvl > MAX_LEVEL ) {
+ if (zeny > MAX_ZENY || max_level > MAX_LEVEL) {
ShowError("chat_createnpcchat: npc '%s' has a required lvl or amount of zeny over the max limit!\n", nd->exname);
return false;
}
- cd = chat->create(&nd->bl, title, "", limit, pub, trigger, ev, zeny, minLvl, maxLvl);
+ cd = chat->create(&nd->bl, title, "", limit, pub, trigger, ev, zeny, min_level, max_level);
if( cd ) {
nd->chat_id = cd->bl.id;
diff --git a/src/map/chat.h b/src/map/chat.h
index 603d8441f..bcdf674f7 100644
--- a/src/map/chat.h
+++ b/src/map/chat.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,8 +23,9 @@
#include "map/map.h" // struct block_list, CHATROOM_TITLE_SIZE
#include "common/hercules.h"
-#include "common/db.h"
+/* Forward Declarations */
+struct DBMap; // common/db.h
struct chat_data;
struct map_session_data;
struct npc_data;
@@ -40,13 +41,13 @@ struct chat_data {
uint8 limit; ///< join limit
uint8 trigger; ///< number of users needed to trigger event
uint32 zeny; ///< required zeny to join
- uint32 minLvl; ///< minimum base level to join
- uint32 maxLvl; ///< maximum base level allowed to join
+ int min_level; ///< minimum base level to join
+ int max_level; ///< maximum base level allowed to join
struct map_session_data* usersd[MAX_CHAT_USERS];
struct block_list* owner;
char npc_event[EVENT_NAME_LENGTH];
/* isn't this a waste? there is a enormous overhead, wouldn't something like skill_blockpc_start be better here? [Ind] */
- DBMap* kick_list; ///< DBMap of users who were kicked from this chat
+ struct DBMap *kick_list; ///< DBMap of users who were kicked from this chat
};
/*=====================================
@@ -62,13 +63,13 @@ struct chat_interface {
bool (*change_owner) (struct map_session_data* sd, const char* nextownername);
bool (*change_status) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
bool (*kick) (struct map_session_data* sd, const char* kickusername);
- bool (*create_npc_chat) (struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
+ bool (*create_npc_chat) (struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int min_level, int max_level);
bool (*delete_npc_chat) (struct npc_data* nd);
bool (*enable_event) (struct chat_data* cd);
bool (*disable_event) (struct chat_data* cd);
bool (*npc_kick_all) (struct chat_data* cd);
bool (*trigger_event) (struct chat_data *cd);
- struct chat_data* (*create) (struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
+ struct chat_data* (*create) (struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int min_level, int max_level);
};
#ifdef HERCULES_CORE
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 258d550d4..39aa046d7 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -110,7 +110,9 @@ struct chrif_interface *chrif;
#define chrif_check(a) do { if(!chrif->isconnected()) return a; } while(0)
/// Resets all the data.
-void chrif_reset(void) {
+void chrif_reset(void) __attribute__ ((noreturn));
+void chrif_reset(void)
+{
// TODO kick everyone out and reset everything [FlavioJS]
exit(EXIT_FAILURE);
}
@@ -234,11 +236,13 @@ void chrif_setpasswd(char *pwd) {
// security check, prints warning if using default password
void chrif_checkdefaultlogin(void) {
+#ifndef BUILDBOT
if (strcmp(chrif->userid, "s1")==0 && strcmp(chrif->passwd, "p1")==0) {
ShowWarning("Using the default user/password s1/p1 is NOT RECOMMENDED.\n");
ShowNotice("Please edit your 'login' table to create a proper inter-server user/password (gender 'S')\n");
ShowNotice("and then edit your user/password in conf/map-server.conf (or conf/import/map_conf.txt)\n");
}
+#endif
}
// sets char-server's ip address
@@ -320,6 +324,9 @@ bool chrif_save(struct map_session_data *sd, int flag) {
if( sd->save_quest )
intif->quest_save(sd);
+ if (sd->storage.received == true && sd->storage.save == true)
+ intif->send_account_storage(sd);
+
return true;
}
@@ -362,7 +369,7 @@ void chrif_recvmap(int fd) {
}
if (battle_config.etc_log)
- ShowStatus("Received maps from %d.%d.%d.%d:%d (%d maps)\n", CONVIP(ip), port, j);
+ ShowStatus("Received maps from %u.%u.%u.%u:%u (%d maps)\n", CONVIP(ip), port, j);
chrif->other_mapserver_count++;
}
@@ -379,7 +386,7 @@ void chrif_removemap(int fd) {
chrif->other_mapserver_count--;
if(battle_config.etc_log)
- ShowStatus("remove map of server %d.%d.%d.%d:%d (%d maps)\n", CONVIP(ip), port, j);
+ ShowStatus("remove map of server %u.%u.%u.%u:%u (%d maps)\n", CONVIP(ip), port, j);
}
// received after a character has been "final saved" on the char-server
@@ -469,7 +476,8 @@ void chrif_connectack(int fd) {
/**
* @see DBApply
*/
-int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
+int chrif_reconnect(union DBKey key, struct DBData *data, va_list ap)
+{
struct auth_node *node = DB->data2ptr(data);
nullpo_ret(node);
@@ -592,7 +600,7 @@ void chrif_authok(int fd) {
int account_id, group_id, char_id;
uint32 login_id1,login_id2;
time_t expiration_time;
- struct mmo_charstatus* charstatus;
+ const struct mmo_charstatus *charstatus;
struct auth_node *node;
bool changing_mapservers;
struct map_session_data *sd = NULL;
@@ -609,7 +617,7 @@ void chrif_authok(int fd) {
expiration_time = (time_t)(int32)RFIFOL(fd,16);
group_id = RFIFOL(fd,20);
changing_mapservers = (RFIFOB(fd,24));
- charstatus = (struct mmo_charstatus*)RFIFOP(fd,25);
+ charstatus = RFIFOP(fd,25);
char_id = charstatus->char_id;
//Check if we don't already have player data in our server
@@ -679,7 +687,8 @@ void chrif_authfail(int fd) {/* HELLO WORLD. ip in RFIFOL 15 is not being used (
* This can still happen (client times out while waiting for char to confirm auth data)
* @see DBApply
*/
-int auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
+int auth_db_cleanup_sub(union DBKey key, struct DBData *data, va_list ap)
+{
struct auth_node *node = DB->data2ptr(data);
nullpo_retr(1, node);
@@ -794,7 +803,7 @@ bool chrif_char_ask_name(int acc, const char* character_name, unsigned short ope
WFIFOHEAD(chrif->fd,44);
WFIFOW(chrif->fd,0) = 0x2b0e;
WFIFOL(chrif->fd,2) = acc;
- safestrncpy((char*)WFIFOP(chrif->fd,6), character_name, NAME_LENGTH);
+ safestrncpy(WFIFOP(chrif->fd,6), character_name, NAME_LENGTH);
WFIFOW(chrif->fd,30) = operation_type;
if (operation_type == CHAR_ASK_NAME_BAN || operation_type == CHAR_ASK_NAME_CHARBAN) {
@@ -825,7 +834,7 @@ bool chrif_changesex(struct map_session_data *sd, bool change_account)
WFIFOHEAD(chrif->fd,44);
WFIFOW(chrif->fd,0) = 0x2b0e;
WFIFOL(chrif->fd,2) = sd->status.account_id;
- safestrncpy((char*)WFIFOP(chrif->fd,6), sd->status.name, NAME_LENGTH);
+ safestrncpy(WFIFOP(chrif->fd,6), sd->status.name, NAME_LENGTH);
WFIFOW(chrif->fd,30) = change_account ? CHAR_ASK_NAME_CHANGESEX : CHAR_ASK_NAME_CHANGECHARSEX;
if (!change_account)
WFIFOB(chrif->fd,32) = sd->status.sex == SEX_MALE ? SEX_FEMALE : SEX_MALE;
@@ -931,14 +940,14 @@ bool chrif_divorceack(int char_id, int partner_id) {
sd->status.partner_id = 0;
for(i = 0; i < MAX_INVENTORY; i++)
if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F)
- pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE);
}
if( ( sd = map->charid2sd(partner_id) ) != NULL && sd->status.partner_id == char_id ) {
sd->status.partner_id = 0;
for(i = 0; i < MAX_INVENTORY; i++)
if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F)
- pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE);
}
return true;
@@ -993,9 +1002,9 @@ void chrif_idbanned(int fd) {
if(0<ret_status && ret_status<=9)
clif->message(sd->fd, msg_sd(sd,411+ret_status)); // Message IDs (for search convenience): 412, 413, 414, 415, 416, 417, 418, 419, 420
else if(ret_status==100)
- clif->message(sd->fd, msg_sd(sd,421));
+ clif->message(sd->fd, msg_sd(sd,421)); // Your account has been totally erased.
else
- clif->message(sd->fd, msg_sd(sd,420)); //"Your account has not more authorized."
+ clif->message(sd->fd, msg_sd(sd,420)); //"Your account is not longer authorized."
} else if (RFIFOB(fd,6) == 1) { // 1: ban
time_t timestamp;
char tmpstr[2048];
@@ -1053,19 +1062,17 @@ int chrif_disconnectplayer(int fd) {
/*==========================================
* Request/Receive top 10 Fame character list
*------------------------------------------*/
-int chrif_updatefamelist(struct map_session_data* sd) {
- char type;
+int chrif_updatefamelist(struct map_session_data *sd)
+{
+ int type;
nullpo_retr(0, sd);
chrif_check(-1);
- switch(sd->class_ & MAPID_UPPERMASK) {
- case MAPID_BLACKSMITH: type = RANKTYPE_BLACKSMITH; break;
- case MAPID_ALCHEMIST: type = RANKTYPE_ALCHEMIST; break;
- case MAPID_TAEKWON: type = RANKTYPE_TAEKWON; break;
- default:
- return 0;
- }
+ type = pc->famelist_type(sd->job);
+
+ if (type == RANKTYPE_UNKNOWN)
+ return 0;
WFIFOHEAD(chrif->fd, 11);
WFIFOW(chrif->fd,0) = 0x2b10;
@@ -1171,8 +1178,9 @@ bool chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of th
data.tick = DIFF_TICK32(td->tick,tick); //Duration that is left before ending.
else
data.tick = 0; //Negative tick does not necessarily mean that sc has expired
- } else
- data.tick = -1; //Infinite duration
+ } else {
+ data.tick = INFINITE_DURATION;
+ }
data.type = i;
data.val1 = sc->data[i]->val1;
data.val2 = sc->data[i]->val2;
@@ -1219,7 +1227,7 @@ bool chrif_load_scdata(int fd) {
count = RFIFOW(fd,12); //sc_count
for (i = 0; i < count; i++) {
- struct status_change_data *data = (struct status_change_data*)RFIFOP(fd,14 + i*sizeof(struct status_change_data));
+ const struct status_change_data *data = RFIFOP(fd,14 + i*sizeof(struct status_change_data));
status->change_start(NULL, &sd->bl, (sc_type)data->type, 10000, data->val1, data->val2, data->val3, data->val4,
data->tick, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK|SCFLAG_LOADED|SCFLAG_FIXEDRATE);
}
@@ -1410,7 +1418,7 @@ int chrif_parse(int fd) {
if (result == 1) continue; // Treated in intif
if (result == 2) return 0; // Didn't have enough data (len==-1)
- ShowWarning("chrif_parse: session #%d, intif->parse failed (unrecognized command 0x%.4x).\n", fd, cmd);
+ ShowWarning("chrif_parse: session #%d, intif->parse failed (unrecognized command 0x%.4x).\n", fd, (unsigned int)cmd);
sockt->eof(fd);
return 0;
}
@@ -1434,10 +1442,10 @@ int chrif_parse(int fd) {
case 0x2b03: clif->charselectok(RFIFOL(fd,2), RFIFOB(fd,6)); break;
case 0x2b04: chrif->recvmap(fd); break;
case 0x2b06: chrif->changemapserverack(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), RFIFOW(fd,18), RFIFOW(fd,20), RFIFOW(fd,22), RFIFOL(fd,24), RFIFOW(fd,28)); break;
- case 0x2b09: map->addnickdb(RFIFOL(fd,2), (char*)RFIFOP(fd,6)); break;
+ case 0x2b09: map->addnickdb(RFIFOL(fd,2), RFIFOP(fd,6)); break;
case 0x2b0a: sockt->datasync(fd, false); break;
case 0x2b0d: chrif->changedsex(fd); break;
- case 0x2b0f: chrif->char_ask_name_answer(RFIFOL(fd,2), (char*)RFIFOP(fd,6), RFIFOW(fd,30), RFIFOW(fd,32)); break;
+ case 0x2b0f: chrif->char_ask_name_answer(RFIFOL(fd,2), RFIFOP(fd,6), RFIFOW(fd,30), RFIFOW(fd,32)); break;
case 0x2b12: chrif->divorceack(RFIFOL(fd,2), RFIFOL(fd,6)); break;
case 0x2b14: chrif->idbanned(fd); break;
case 0x2b1b: chrif->recvfamelist(fd); break;
@@ -1451,7 +1459,7 @@ int chrif_parse(int fd) {
case 0x2b25: chrif->deadopt(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
case 0x2b27: chrif->authfail(fd); break;
default:
- ShowError("chrif_parse : unknown packet (session #%d): 0x%x. Disconnecting.\n", fd, cmd);
+ ShowError("chrif_parse : unknown packet (session #%d): 0x%x. Disconnecting.\n", fd, (unsigned int)cmd);
sockt->eof(fd);
return 0;
}
@@ -1614,7 +1622,8 @@ void chrif_del_scdata_single(int account_id, int char_id, short type)
/**
* @see DBApply
*/
-int auth_db_final(DBKey key, DBData *data, va_list ap) {
+int auth_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct auth_node *node = DB->data2ptr(data);
nullpo_ret(node);
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 6a5ec36b6..615521e0f 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -72,7 +72,7 @@ struct chrif_interface {
/* */
struct eri *auth_db_ers; //For re-utilizing player login structures.
- DBMap* auth_db; // int id -> struct auth_node*
+ struct DBMap *auth_db; // int id -> struct auth_node*
/* */
int packet_len_table[CHRIF_PACKET_LEN_TABLE_SIZE];
int fd;
@@ -133,10 +133,10 @@ struct chrif_interface {
int (*check_connect_char_server) (int tid, int64 tick, int id, intptr_t data);
bool (*auth_logout) (struct map_session_data *sd, enum sd_state state);
void (*save_ack) (int fd);
- int (*reconnect) (DBKey key, DBData *data, va_list ap);
- int (*auth_db_cleanup_sub) (DBKey key, DBData *data, va_list ap);
+ int (*reconnect) (union DBKey key, struct DBData *data, va_list ap);
+ int (*auth_db_cleanup_sub) (union DBKey key, struct DBData *data, va_list ap);
bool (*char_ask_name_answer) (int acc, const char* player_name, uint16 type, uint16 answer);
- int (*auth_db_final) (DBKey key, DBData *data, va_list ap);
+ int (*auth_db_final) (union DBKey key, struct DBData *data, va_list ap);
int (*send_usercount_tochar) (int tid, int64 tick, int id, intptr_t data);
int (*auth_db_cleanup) (int tid, int64 tick, int id, intptr_t data);
diff --git a/src/map/clif.c b/src/map/clif.c
index 3b2f255ef..524378439 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -190,7 +190,7 @@ static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, s
#endif // 0
//To identify disguised characters.
-static inline bool disguised(struct block_list* bl)
+bool clif_isdisguised(struct block_list* bl)
{
struct map_session_data *sd = BL_CAST(BL_PC, bl);
if (sd == NULL || sd->disguise == -1)
@@ -198,22 +198,6 @@ static inline bool disguised(struct block_list* bl)
return true;
}
-//Guarantees that the given string does not exceeds the allowed size, as well as making sure it's null terminated. [Skotlex]
-static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned int max) {
- nullpo_retr(0, mes);
- if (len <= 0)
- {
- mes[0] = '\0';
- Assert_retr(0, len > 0);
- }
- if( len > max )
- len = max;
-
- mes[len-1] = '\0';
-
- return len;
-}
-
/*==========================================
* Ip setting of map-server
*------------------------------------------*/
@@ -281,24 +265,50 @@ uint32 clif_refresh_ip(void)
return 0;
}
+unsigned char clif_bl_type(struct block_list *bl)
+{
#if PACKETVER >= 20071106
-static inline unsigned char clif_bl_type(struct block_list *bl) {
- nullpo_retr(0x1, bl);
+ struct view_data *vd;
+ nullpo_retr(CLUT_NPC, bl);
+
switch (bl->type) {
- case BL_PC: return (disguised(bl) && !pc->db_checkid(status->get_viewdata(bl)->class_))? 0x1:0x0; //PC_TYPE
- case BL_ITEM: return 0x2; //ITEM_TYPE
- case BL_SKILL: return 0x3; //SKILL_TYPE
- case BL_CHAT: return 0x4; //UNKNOWN_TYPE
- case BL_MOB: return pc->db_checkid(status->get_viewdata(bl)->class_)?0x0:0x5; //NPC_MOB_TYPE
- case BL_NPC: return pc->db_checkid(status->get_viewdata(bl)->class_)?0x0:0x6; //NPC_EVT_TYPE
- case BL_PET: return pc->db_checkid(status->get_viewdata(bl)->class_)?0x0:0x7; //NPC_PET_TYPE
- case BL_HOM: return 0x8; //NPC_HOM_TYPE
- case BL_MER: return 0x9; //NPC_MERSOL_TYPE
- case BL_ELEM: return 0xa; //NPC_ELEMENTAL_TYPE
- default: return 0x1; //NPC_TYPE
+ case BL_PC:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+
+ if (clif->isdisguised(bl) && !pc->db_checkid(vd->class))
+ return CLUT_NPC;
+ return CLUT_PC;
+ case BL_ITEM:
+ return CLUT_ITEM;
+ case BL_SKILL:
+ return CLUT_SKILL;
+ case BL_CHAT:
+ return CLUT_UNKNOWN;
+ case BL_MOB:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+ return pc->db_checkid(vd->class) ? CLUT_PC : CLUT_MOB;
+ case BL_NPC:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+ return pc->db_checkid(vd->class) ? CLUT_PC : CLUT_EVENT;
+ case BL_PET:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+ return pc->db_checkid(vd->class) ? CLUT_PC : CLUT_PET;
+ case BL_HOM:
+ return CLUT_HOMNUCLUS;
+ case BL_MER:
+ return CLUT_MERCNARY;
+ case BL_ELEM:
+ return CLUT_ELEMENTAL;
+ default:
+ return CLUT_NPC;
}
-}
#endif
+ return CLUT_UNKNOWN;
+}
/*==========================================
* sub process of clif_send
@@ -335,17 +345,17 @@ int clif_send_sub(struct block_list *bl, va_list ap) {
return 0;
break;
case AREA_WOC:
- if (sd->chatID || bl == src_bl)
+ if (sd->chat_id != 0 || bl == src_bl)
return 0;
break;
case AREA_WOSC: {
if (src_bl->type == BL_PC) {
const struct map_session_data *ssd = BL_UCCAST(BL_PC, src_bl);
- if (ssd != NULL && sd->chatID != 0 && (sd->chatID == ssd->chatID))
+ if (ssd != NULL && sd->chat_id != 0 && (sd->chat_id == ssd->chat_id))
return 0;
} else if (src_bl->type == BL_NPC) {
const struct npc_data *nd = BL_UCCAST(BL_NPC, src_bl);
- if (nd != NULL && sd->chatID != 0 && (sd->chatID == nd->chat_id))
+ if (nd != NULL && sd->chat_id != 0 && (sd->chat_id == nd->chat_id))
return 0;
}
}
@@ -441,8 +451,8 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
break;
case AREA_CHAT_WOC:
nullpo_retr(true, bl);
- map->foreachinarea(clif->send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5),
- bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC);
+ map->foreachinarea(clif->send_sub, bl->m, bl->x-CHAT_AREA_SIZE, bl->y-CHAT_AREA_SIZE,
+ bl->x+CHAT_AREA_SIZE, bl->y+CHAT_AREA_SIZE, BL_PC, buf, len, bl, AREA_WOC);
break;
case CHAT:
@@ -451,7 +461,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
{
const struct chat_data *cd = NULL;
if (sd != NULL) {
- cd = map->id2cd(sd->chatID);
+ cd = map->id2cd(sd->chat_id);
} else {
cd = BL_CCAST(BL_CHAT, bl);
}
@@ -645,7 +655,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
break;
default:
- ShowError("clif_send: Unrecognized type %d\n",type);
+ ShowError("clif_send: Unrecognized type %u\n", type);
return false;
}
@@ -667,7 +677,8 @@ void clif_authok(struct map_session_data *sd)
#if PACKETVER >= 20080102
p.font = sd->status.font;
#endif
-#if PACKETVER >= 20141016
+// Some clients smaller than 20160330 cant be tested [4144]
+#if PACKETVER >= 20141016 && PACKETVER < 20160330
p.sex = sd->status.sex;
#endif
clif->send(&p,sizeof(p),&sd->bl,SELF);
@@ -839,7 +850,7 @@ void clif_clearunit_area(struct block_list* bl, clr_type type)
clif->send(buf, packet_len(0x80), bl, type == CLR_DEAD ? AREA : AREA_WOS);
- if(disguised(bl)) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
clif->send(buf, packet_len(0x80), bl, SELF);
}
@@ -944,21 +955,22 @@ void clif_set_unit_idle2(struct block_list* bl, struct map_session_data *tsd, en
p.PacketType = idle_unit2Type;
#if PACKETVER >= 20071106
- p.objecttype = clif_bl_type(bl);
+ p.objecttype = clif->bl_type(bl);
#endif
p.GID = bl->id;
p.speed = status->get_speed(bl);
p.bodyState = (sc) ? sc->opt1 : 0;
p.healthState = (sc) ? sc->opt2 : 0;
p.effectState = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
- p.job = vd->class_;
+ p.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
p.shield = vd->shield;
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.shield = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -995,7 +1007,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
nullpo_retv(bl);
#if PACKETVER < 20091103
- if( !pc->db_checkid(vd->class_) ) {
+ if (!pc->db_checkid(vd->class)) {
clif->set_unit_idle2(bl,tsd,target);
return;
}
@@ -1006,7 +1018,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
p.PacketType = idle_unitType;
#if PACKETVER >= 20091103
p.PacketLength = sizeof(p);
- p.objecttype = clif_bl_type(bl);
+ p.objecttype = clif->bl_type(bl);
#endif
#if PACKETVER >= 20131223
p.AID = bl->id;
@@ -1018,7 +1030,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
p.bodyState = (sc) ? sc->opt1 : 0;
p.healthState = (sc) ? sc->opt2 : 0;
p.effectState = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
- p.job = vd->class_;
+ p.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
@@ -1027,7 +1039,8 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#endif
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.accessory = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1066,13 +1079,20 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#if PACKETVER >= 20150513
p.body = vd->body_style;
#endif
-
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
+ safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
+#endif
clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
- if( disguised(bl) ) {
+ if (clif->isdisguised(bl)) {
#if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1094,7 +1114,7 @@ void clif_spawn_unit2(struct block_list* bl, enum send_target target) {
p.PacketType = spawn_unit2Type;
#if PACKETVER >= 20071106
- p.objecttype = clif_bl_type(bl);
+ p.objecttype = clif->bl_type(bl);
#endif
p.GID = bl->id;
p.speed = status->get_speed(bl);
@@ -1104,11 +1124,12 @@ void clif_spawn_unit2(struct block_list* bl, enum send_target target) {
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
- p.job = vd->class_;
+ p.job = vd->class;
p.shield = vd->shield;
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.shield = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1136,7 +1157,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
nullpo_retv(bl);
#if PACKETVER < 20091103
- if( !pc->db_checkid(vd->class_) ) {
+ if (!pc->db_checkid(vd->class)) {
clif->spawn_unit2(bl,target);
return;
}
@@ -1147,7 +1168,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
p.PacketType = spawn_unitType;
#if PACKETVER >= 20091103
p.PacketLength = sizeof(p);
- p.objecttype = clif_bl_type(bl);
+ p.objecttype = clif->bl_type(bl);
#endif
#if PACKETVER >= 20131223
p.AID = bl->id;
@@ -1159,7 +1180,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
p.bodyState = (sc) ? sc->opt1 : 0;
p.healthState = (sc) ? sc->opt2 : 0;
p.effectState = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
- p.job = vd->class_;
+ p.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
@@ -1168,7 +1189,8 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#endif
p.accessory2 = vd->head_top;
p.accessory3 = vd->head_mid;
- if( bl->type == BL_NPC && vd->class_ == FLAG_CLASS ) { //The hell, why flags work like this?
+ if (bl->type == BL_NPC && vd->class == FLAG_CLASS) {
+ // The hell, why flags work like this?
p.accessory = status->get_emblem_id(bl);
p.accessory2 = GetWord(g_id, 1);
p.accessory3 = GetWord(g_id, 0);
@@ -1206,13 +1228,21 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#if PACKETVER >= 20150513
p.body = vd->body_style;
#endif
- if( disguised(bl) ) {
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
+ safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
+#endif
+ if (clif->isdisguised(bl)) {
nullpo_retv(sd);
- if( sd->status.class_ != sd->disguise )
+ if (sd->status.class != sd->disguise)
clif->send(&p,sizeof(p),bl,target);
#if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1242,11 +1272,11 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
p.PacketLength = sizeof(p);
#endif
#if PACKETVER >= 20071106
- p.objecttype = clif_bl_type(bl);
+ p.objecttype = clif->bl_type(bl);
#endif
#if PACKETVER >= 20131223
p.AID = bl->id;
- p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE
+ p.GID = (sd) ? sd->status.char_id : 0; // CCODE
#else
p.GID = bl->id;
#endif
@@ -1254,7 +1284,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
p.bodyState = (sc) ? sc->opt1 : 0;
p.healthState = (sc) ? sc->opt2 : 0;
p.effectState = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
- p.job = vd->class_;
+ p.job = vd->class;
p.head = vd->hair_style;
p.weapon = vd->weapon;
p.accessory = vd->head_bottom;
@@ -1297,13 +1327,21 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#if PACKETVER >= 20150513
p.body = vd->body_style;
#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
+ safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
+#endif
clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
- if( disguised(bl) ) {
+ if (clif->isdisguised(bl)) {
#if PACKETVER >= 20091103
- p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class_) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+ p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1315,7 +1353,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
/// 01b0 <id>.L <type>.B <value>.L
/// type:
/// unused
-void clif_class_change(struct block_list *bl, int class_, int type)
+void clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd)
{
nullpo_retv(bl);
@@ -1326,7 +1364,11 @@ void clif_class_change(struct block_list *bl, int class_, int type)
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type;
WBUFL(buf,7)=class_;
- clif->send(buf,packet_len(0x1b0),bl,AREA);
+
+ if (sd == NULL)
+ clif->send(buf, packet_len(0x1b0), bl, AREA);
+ else
+ clif->send(buf, packet_len(0x1b0), &sd->bl, SELF);
}
}
@@ -1347,6 +1389,7 @@ void clif_spiritball_single(int fd, struct map_session_data *sd) {
*------------------------------------------*/
void clif_charm_single(int fd, struct map_session_data *sd)
{
+#if PACKETVER >= 20110809
nullpo_retv(sd);
WFIFOHEAD(fd, packet_len(0x08cf));
WFIFOW(fd,0) = 0x08cf;
@@ -1354,6 +1397,7 @@ void clif_charm_single(int fd, struct map_session_data *sd)
WFIFOW(fd,6) = sd->charm_type;
WFIFOW(fd,8) = sd->charm_count;
WFIFOSET(fd, packet_len(0x08cf));
+#endif
}
/*==========================================
@@ -1412,7 +1456,7 @@ bool clif_spawn(struct block_list *bl)
if( !vd )
return false;
- if (vd->class_ == INVISIBLE_CLASS)
+ if (vd->class == INVISIBLE_CLASS)
return true; // Doesn't need to be spawned, so everything is alright
if (bl->type == BL_NPC) {
@@ -1442,7 +1486,7 @@ bool clif_spawn(struct block_list *bl)
if (sd->bg_id != 0 && map->list[sd->bl.m].flag.battleground)
clif->sendbgemblem_area(sd);
for (i = 0; i < sd->sc_display_count; i++) {
- clif->sc_load(&sd->bl, sd->bl.id,AREA,status->dbs->IconChangeTable[sd->sc_display[i]->type],sd->sc_display[i]->val1,sd->sc_display[i]->val2,sd->sc_display[i]->val3);
+ clif->sc_continue(&sd->bl, sd->bl.id,AREA,status->dbs->IconChangeTable[sd->sc_display[i]->type],sd->sc_display[i]->val1,sd->sc_display[i]->val2,sd->sc_display[i]->val3);
}
if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count > 0)
clif->spiritcharm(sd);
@@ -1482,6 +1526,15 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
struct status_data *hstatus;
unsigned char buf[128];
enum homun_type htype;
+ int offset = 0;
+
+// probably can works also for < 20141223, but in 3CeaM packet size defined only for 20150513
+#if PACKETVER < 20150513
+ int cmd = 0x22e;
+#else
+ int cmd = 0x9f7;
+#endif
+ int len = packet_len(cmd);
nullpo_retv(sd);
nullpo_retv(hd);
@@ -1489,65 +1542,75 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
hstatus = &hd->battle_status;
htype = homun->class2type(hd->homunculus.class_);
- memset(buf,0,packet_len(0x22e));
- WBUFW(buf,0)=0x22e;
- memcpy(WBUFP(buf,2),hd->homunculus.name,NAME_LENGTH);
+ memset(buf, 0, len);
+ WBUFW(buf, 0) = cmd;
+ memcpy(WBUFP(buf, 2), hd->homunculus.name, NAME_LENGTH);
// Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true)
- WBUFB(buf,26)=(battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0);
- WBUFW(buf,27)=hd->homunculus.level;
- WBUFW(buf,29)=hd->homunculus.hunger;
- WBUFW(buf,31)=(unsigned short) (hd->homunculus.intimacy / 100) ;
- WBUFW(buf,33)=0; // equip id
+ WBUFB(buf, 26) = (!battle_config.hom_rename && hd->homunculus.rename_flag ? 0x1 : 0x0) | (hd->homunculus.vaporize == HOM_ST_REST ? 0x2 : 0) | (hd->homunculus.hp > 0 ? 0x4 : 0);
+ WBUFW(buf, 27) = hd->homunculus.level;
+ WBUFW(buf, 29) = hd->homunculus.hunger;
+ WBUFW(buf, 31) = (unsigned short) (hd->homunculus.intimacy / 100) ;
+ WBUFW(buf, 33) = 0; // equip id
#ifdef RENEWAL
WBUFW(buf, 35) = cap_value(hstatus->rhw.atk2, 0, INT16_MAX);
#else
- WBUFW(buf,35)=cap_value(hstatus->rhw.atk2+hstatus->batk, 0, INT16_MAX);
+ WBUFW(buf,35) = cap_value(hstatus->rhw.atk2 + hstatus->batk, 0, INT16_MAX);
#endif
- WBUFW(buf,37)=cap_value(hstatus->matk_max, 0, INT16_MAX);
- WBUFW(buf,39)=hstatus->hit;
+ WBUFW(buf,37) = cap_value(hstatus->matk_max, 0, INT16_MAX);
+ WBUFW(buf,39) = hstatus->hit;
if (battle_config.hom_setting&0x10)
- WBUFW(buf,41)=hstatus->luk/3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious]
+ WBUFW(buf, 41) = hstatus->luk / 3 + 1; //crit is a +1 decimal value! Just display purpose.[Vicious]
else
- WBUFW(buf,41)=hstatus->cri/10;
+ WBUFW(buf, 41) = hstatus->cri / 10;
#ifdef RENEWAL
WBUFW(buf, 43) = hstatus->def + hstatus->def2;
WBUFW(buf, 45) = hstatus->mdef + hstatus->mdef2;
#else
- WBUFW(buf,43)=hstatus->def + hstatus->vit ;
+ WBUFW(buf, 43) =hstatus->def + hstatus->vit ;
WBUFW(buf, 45) = hstatus->mdef;
#endif
- WBUFW(buf,47)=hstatus->flee;
- WBUFW(buf,49)=(flag)?0:hstatus->amotion;
+ WBUFW(buf, 47) = hstatus->flee;
+ WBUFW(buf, 49) = (flag) ? 0 : hstatus->amotion;
+
+// probably can works also for < 20141223, but in 3CeaM packet size defined only for 20150513
+#if PACKETVER < 20150513
if (hstatus->max_hp > INT16_MAX) {
- WBUFW(buf,51) = hstatus->hp/(hstatus->max_hp/100);
- WBUFW(buf,53) = 100;
+ WBUFW(buf, 51) = hstatus->hp / (hstatus->max_hp / 100);
+ WBUFW(buf, 53) = 100;
} else {
- WBUFW(buf,51)=hstatus->hp;
- WBUFW(buf,53)=hstatus->max_hp;
+ WBUFW(buf, 51) = hstatus->hp;
+ WBUFW(buf, 53) = hstatus->max_hp;
}
+#else
+ WBUFL(buf, 51) = hstatus->hp;
+ WBUFL(buf, 55) = hstatus->max_hp;
+ offset = 4;
+#endif
+
if (hstatus->max_sp > INT16_MAX) {
- WBUFW(buf,55) = hstatus->sp/(hstatus->max_sp/100);
- WBUFW(buf,57) = 100;
+ WBUFW(buf, 55 + offset) = hstatus->sp / (hstatus->max_sp / 100);
+ WBUFW(buf, 57 + offset) = 100;
} else {
- WBUFW(buf,55)=hstatus->sp;
- WBUFW(buf,57)=hstatus->max_sp;
+ WBUFW(buf, 55 + offset) = hstatus->sp;
+ WBUFW(buf, 57 + offset) = hstatus->max_sp;
}
- WBUFL(buf,59)=hd->homunculus.exp;
- WBUFL(buf,63)=hd->exp_next;
- switch( htype ) {
+ WBUFL(buf, 59 + offset) = hd->homunculus.exp;
+ WBUFL(buf, 63 + offset) = hd->exp_next;
+ switch (htype) {
case HT_REG:
case HT_EVO:
- if( hd->homunculus.level >= battle_config.hom_max_level )
- WBUFL(buf,63)=0;
+ if (hd->homunculus.level >= battle_config.hom_max_level)
+ WBUFL(buf, 63 + offset) = 0;
break;
case HT_S:
- if( hd->homunculus.level >= battle_config.hom_S_max_level )
- WBUFL(buf,63)=0;
+ if (hd->homunculus.level >= battle_config.hom_S_max_level)
+ WBUFL(buf, 63 + offset) = 0;
break;
}
- WBUFW(buf,67)=hd->homunculus.skillpts;
- WBUFW(buf,69)=status_get_range(&hd->bl);
- clif->send(buf,packet_len(0x22e),&sd->bl,SELF);
+ WBUFW(buf, 67 + offset) = hd->homunculus.skillpts;
+ WBUFW(buf, 69 + offset) = status_get_range(&hd->bl);
+
+ clif->send(buf, len, &sd->bl, SELF);
}
/// Notification about a change in homunuculus' state (ZC_CHANGESTATE_MER).
@@ -1612,7 +1675,7 @@ void clif_homskillinfoblock(struct map_session_data *sd) {
WFIFOW(fd, len + 8) = 0;
WFIFOW(fd, len + 10) = 0;
}
- safestrncpy((char*)WFIFOP(fd, len + 12), skill->get_name(id), NAME_LENGTH);
+ safestrncpy(WFIFOP(fd, len + 12), skill->get_name(id), NAME_LENGTH);
WFIFOB(fd, len + 36) = (hd->homunculus.hskill[j].lv < homun->skill_tree_get_max(id, hd->homunculus.class_)) ? 1 : 0;
len += 37;
}
@@ -1740,7 +1803,7 @@ void clif_move(struct unit_data *ud)
bl = ud->bl;
nullpo_retv(bl);
vd = status->get_viewdata(bl);
- if (!vd || vd->class_ == INVISIBLE_CLASS)
+ if (vd == NULL || vd->class == INVISIBLE_CLASS)
return; //This performance check is needed to keep GM-hidden objects from being notified to bots.
if (bl->type == BL_NPC) {
@@ -1769,7 +1832,7 @@ void clif_move(struct unit_data *ud)
clif->send(buf, packet_len(0x86), bl, AREA_WOS);
- if (disguised(bl)) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2)=-bl->id;
clif->send(buf, packet_len(0x86), bl, SELF);
}
@@ -1816,7 +1879,7 @@ void clif_changemap(struct map_session_data *sd, short m, int x, int y) {
WFIFOHEAD(fd,packet_len(0x91));
WFIFOW(fd,0) = 0x91;
- mapindex->getmapname_ext(map->list[m].custom_name ? map->list[map->list[m].instance_src_map].name : map->list[m].name, (char*)WFIFOP(fd,2));
+ mapindex->getmapname_ext(map->list[m].custom_name ? map->list[map->list[m].instance_src_map].name : map->list[m].name, WFIFOP(fd,2));
WFIFOW(fd,18) = x;
WFIFOW(fd,20) = y;
WFIFOSET(fd,packet_len(0x91));
@@ -1831,7 +1894,7 @@ void clif_changemapserver(struct map_session_data* sd, unsigned short map_index,
WFIFOHEAD(fd,packet_len(0x92));
WFIFOW(fd,0) = 0x92;
- mapindex->getmapname_ext(mapindex_id2name(map_index), (char*)WFIFOP(fd,2));
+ mapindex->getmapname_ext(mapindex_id2name(map_index), WFIFOP(fd,2));
WFIFOW(fd,18) = x;
WFIFOW(fd,20) = y;
WFIFOL(fd,22) = htonl(ip);
@@ -1862,7 +1925,7 @@ void clif_fixpos(struct block_list *bl) {
WBUFW(buf,8) = bl->y;
clif->send(buf, packet_len(0x88), bl, AREA);
- if( disguised(bl) ) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
clif->send(buf, packet_len(0x88), bl, SELF);
}
@@ -1970,21 +2033,38 @@ void clif_selllist(struct map_session_data *sd)
/// - set npcid of dialog window (0 by default)
/// - if set to clear on next mes, clear contents
/// - append this text
-void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) {
- int fd = sd->fd;
- size_t slen;
+void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes)
+{
+ int fd, slen;
+#ifdef SCRIPT_MES_STRIP_LINEBREAK
+ char *stripmes = NULL;
+ int i;
+#endif
nullpo_retv(sd);
nullpo_retv(mes);
- slen = strlen(mes) + 9;
+
+ fd = sd->fd;
+ slen = (int)strlen(mes) + 9;
+ Assert_retv(slen <= INT16_MAX);
sd->state.dialog = 1;
WFIFOHEAD(fd, slen);
- WFIFOW(fd,0)=0xb4;
- WFIFOW(fd,2)=slen;
- WFIFOL(fd,4)=npcid;
- memcpy((char*)WFIFOP(fd,8), mes, slen-8);
+ WFIFOW(fd,0) = 0xb4;
+ WFIFOW(fd,2) = slen;
+ WFIFOL(fd,4) = npcid;
+#ifdef SCRIPT_MES_STRIP_LINEBREAK
+ stripmes = aStrdup(mes);
+ for (i = 0; stripmes[i] != '\0'; ++i) {
+ if (stripmes[i] == '\r')
+ stripmes[i] = ' ';
+ }
+ memcpy(WFIFOP(fd,8), stripmes, slen-8);
+ aFree(stripmes);
+#else // ! SCRIPT_MES_STRIP_LINEBREAK
+ memcpy(WFIFOP(fd,8), mes, slen-8);
+#endif // SCRIPT_MES_STRIP_LINEBREAK
WFIFOSET(fd,WFIFOW(fd,2));
}
@@ -2085,25 +2165,28 @@ void clif_sendfakenpc(struct map_session_data *sd, int npcid) {
/// WARNING: the 'cancel' button closes other windows besides the dialog window and the menu window.
/// Which suggests their have intertwined behavior. (probably the mouse targeting)
/// TODO investigate behavior of other windows [FlavioJS]
-void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes) {
- int fd;
- size_t slen;
+void clif_scriptmenu(struct map_session_data *sd, int npcid, const char *mes)
+{
+ int fd, slen;
struct block_list *bl = NULL;
nullpo_retv(sd);
nullpo_retv(mes);
+
fd = sd->fd;
- slen = strlen(mes) + 9;
+ slen = (int)strlen(mes) + 9;
+ Assert_retv(slen <= INT16_MAX);
+
if (!sd->state.using_fake_npc && (npcid == npc->fake_nd->bl.id || ((bl = map->id2bl(npcid)) != NULL && (bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))))
clif->sendfakenpc(sd, npcid);
WFIFOHEAD(fd, slen);
- WFIFOW(fd,0)=0xb7;
- WFIFOW(fd,2)=slen;
- WFIFOL(fd,4)=npcid;
- memcpy((char*)WFIFOP(fd,8), mes, slen-8);
+ WFIFOW(fd,0) = 0xb7;
+ WFIFOW(fd,2) = slen;
+ WFIFOL(fd,4) = npcid;
+ memcpy(WFIFOP(fd,8), mes, slen-8);
WFIFOSET(fd,WFIFOW(fd,2));
}
@@ -2211,7 +2294,7 @@ void clif_cutin(struct map_session_data* sd, const char* image, int type)
fd=sd->fd;
WFIFOHEAD(fd, packet_len(0x1b3));
WFIFOW(fd,0)=0x1b3;
- strncpy((char*)WFIFOP(fd,2),image,64);
+ strncpy(WFIFOP(fd,2),image,64);
WFIFOB(fd,66)=type;
WFIFOSET(fd,packet_len(0x1b3));
}
@@ -2320,23 +2403,37 @@ void clif_addcards2(unsigned short *cards, struct item* item) {
}
/**
- * Fills in RandomOptions(Bonuses) of items into the buffer
+ * Fills in ItemOptions(Bonuses) of items into the buffer
*
- * Dummy datais used since this feature isn't supported yet (ITEM_RDM_OPT).
- * A maximum of 5 random options can be supported.
+ * A maximum of 5 item options can be supported.
*
* @param buf[in,out] The buffer to write to. The pointer must be valid and initialized.
* @param item[in] The source item.
*/
-void clif_add_random_options(unsigned char* buf, struct item* item)
+ int clif_add_item_options(struct ItemOptions *buf, const struct item *it)
{
- int i;
- nullpo_retv(buf);
- for (i = 0; i < 5; i++){
- WBUFW(buf,i*5+0) = 0; // OptIndex
- WBUFW(buf,i*5+2) = 0; // Value
- WBUFB(buf,i*5+4) = 0; // Param1
+ int i = 0, j = 0, total_options = 0;
+
+ nullpo_ret(buf);
+
+ // Append the buffer with existing options first.
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++) {
+ if (it->option[i].index) {
+ WBUFW(buf, j * 5 + 0) = it->option[i].index; // OptIndex
+ WBUFW(buf, j * 5 + 2) = it->option[i].value; // Value
+ WBUFB(buf, j * 5 + 4) = it->option[i].param; // Param1
+ total_options++;
+ j++;
+ }
}
+ // Append the remaining buffer with no values;
+ for (; j < MAX_ITEM_OPTIONS || j < 5; j++) {
+ WBUFW(buf, j * 5 + 0) = 0;
+ WBUFW(buf, j * 5 + 2) = 0;
+ WBUFB(buf, j * 5 + 4) = 0;
+ }
+
+ return total_options;
}
/// Notifies the client, about a received inventory item or the result of a pick-up request.
@@ -2360,9 +2457,6 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
p.count = amount;
if( !fail ) {
-#if PACKETVER >= 20150226
- int i;
-#endif
if( n < 0 || n >= MAX_INVENTORY || sd->status.inventory[n].nameid <=0 || sd->inventory_data[n] == NULL )
return;
@@ -2372,7 +2466,7 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
p.nameid = sd->status.inventory[n].nameid;
p.IsIdentified = sd->status.inventory[n].identify ? 1 : 0;
- p.IsDamaged = sd->status.inventory[n].attribute ? 1 : 0;
+ p.IsDamaged = (sd->status.inventory[n].attribute & ATTR_BROKEN) != 0 ? 1 : 0;
p.refiningLevel =sd->status.inventory[n].refine;
clif->addcards2(&p.slot.card[0], &sd->status.inventory[n]);
p.location = pc->equippoint(sd,n);
@@ -2387,11 +2481,7 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
p.bindOnEquipType = sd->status.inventory[n].bound && !itemdb->isstackable2(sd->inventory_data[n]) ? 2 : sd->inventory_data[n]->flag.bindonequip ? 1 : 0;
#endif
#if PACKETVER >= 20150226
- for (i=0; i<5; i++){
- p.option_data[i].index = 0;
- p.option_data[i].value = 0;
- p.option_data[i].param = 0;
- }
+ clif->add_item_options(&p.option_data[0], &sd->status.inventory[n]);
#endif
}
p.result = (unsigned char)fail;
@@ -2464,41 +2554,39 @@ void clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *
}
-void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos) {
-#if PACKETVER >= 20150226
- int j;
-#endif
+void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *it, struct item_data *id, int eqp_pos)
+{
nullpo_retv(p);
- nullpo_retv(i);
+ nullpo_retv(it);
nullpo_retv(id);
p->index = idx;
if (id->view_id > 0)
p->ITID = id->view_id;
else
- p->ITID = i->nameid;
+ p->ITID = it->nameid;
p->type = itemtype(id->type);
#if PACKETVER < 20120925
- p->IsIdentified = i->identify ? 1 : 0;
+ p->IsIdentified = it->identify ? 1 : 0;
#endif
p->location = eqp_pos;
- p->WearState = i->equip;
+ p->WearState = it->equip;
#if PACKETVER < 20120925
- p->IsDamaged = i->attribute ? 1 : 0;
+ p->IsDamaged = (it->attribute & ATTR_BROKEN) != 0 ? 1 : 0;
#endif
- p->RefiningLevel = i->refine;
+ p->RefiningLevel = it->refine;
- clif->addcards2(&p->slot.card[0], i);
+ clif->addcards2(&p->slot.card[0], it);
#if PACKETVER >= 20071002
- p->HireExpireDate = i->expire_time;
+ p->HireExpireDate = it->expire_time;
#endif
#if PACKETVER >= 20080102
- p->bindOnEquipType = i->bound ? 2 : id->flag.bindonequip ? 1 : 0;
+ p->bindOnEquipType = it->bound ? 2 : id->flag.bindonequip ? 1 : 0;
#endif
#if PACKETVER >= 20100629
@@ -2506,19 +2594,14 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct
#endif
#if PACKETVER >= 20120925
- p->Flag.IsIdentified = i->identify ? 1 : 0;
- p->Flag.IsDamaged = i->attribute ? 1 : 0;
- p->Flag.PlaceETCTab = i->favorite ? 1 : 0;
+ p->Flag.IsIdentified = it->identify ? 1 : 0;
+ p->Flag.IsDamaged = (it->attribute & ATTR_BROKEN) != 0 ? 1 : 0;
+ p->Flag.PlaceETCTab = it->favorite ? 1 : 0;
p->Flag.SpareBits = 0;
#endif
#if PACKETVER >= 20150226
- p->option_count = 0;
- for (j=0; j<5; j++){
- p->option_data[j].index = 0;
- p->option_data[j].value = 0;
- p->option_data[j].param = 0;
- }
+ p->option_count = clif->add_item_options(p->option_data, it);
#endif
}
@@ -3111,31 +3194,31 @@ void clif_changelook(struct block_list *bl,int type,int val)
vd->shield = val;
break;
case LOOK_BASE:
- if( !sd ) break;
+ if (sd == NULL)
+ break;
- if ( val == INVISIBLE_CLASS ) /* nothing to change look */
+ if (val == INVISIBLE_CLASS) /* nothing to change look */
return;
- if( sd->sc.option&OPTION_COSTUME )
+ if (sd->sc.option & OPTION_COSTUME)
vd->weapon = vd->shield = 0;
- if( !vd->cloth_color )
+ if (!vd->cloth_color)
break;
- if (sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette)
+ if ((sd->sc.option & OPTION_WEDDING) != 0 && battle_config.wedding_ignorepalette == true)
vd->cloth_color = 0;
- if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette)
+ if ((sd->sc.option & OPTION_XMAS) != 0 && battle_config.xmas_ignorepalette == true)
vd->cloth_color = 0;
- if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette)
+ if ((sd->sc.option & OPTION_SUMMER) != 0 && battle_config.summer_ignorepalette == true)
vd->cloth_color = 0;
- if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette)
+ if ((sd->sc.option & OPTION_HANBOK) != 0 && battle_config.hanbok_ignorepalette == true)
vd->cloth_color = 0;
- if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */)
+ if ((sd->sc.option & OPTION_OKTOBERFEST) != 0 && battle_config.oktoberfest_ignorepalette == true)
vd->cloth_color = 0;
- if (vd->body_style && (
- sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS ||
- sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK ||
- sd->sc.option&OPTION_OKTOBERFEST))
+ if ((sd->sc.option & OPTION_SUMMER2) != 0 && battle_config.summer2_ignorepalette == true)
+ vd->cloth_color = 0;
+ if (vd->body_style != 0 && (sd->sc.option & OPTION_COSTUME) != 0)
vd->body_style = 0;
break;
case LOOK_HAIR:
@@ -3154,16 +3237,18 @@ void clif_changelook(struct block_list *bl,int type,int val)
vd->hair_color = val;
break;
case LOOK_CLOTHES_COLOR:
- if( val && sd ) {
- if( sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette )
+ if (val && sd != NULL) {
+ if ((sd->sc.option & OPTION_WEDDING) != 0 && battle_config.wedding_ignorepalette == true)
+ val = 0;
+ if ((sd->sc.option & OPTION_XMAS) != 0 && battle_config.xmas_ignorepalette == true)
val = 0;
- if( sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette )
+ if ((sd->sc.option & OPTION_SUMMER) != 0 && battle_config.summer_ignorepalette == true)
val = 0;
- if( sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette )
+ if ((sd->sc.option & OPTION_HANBOK) != 0 && battle_config.hanbok_ignorepalette == true)
val = 0;
- if( sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette )
+ if ((sd->sc.option & OPTION_OKTOBERFEST) != 0 && battle_config.oktoberfest_ignorepalette == true)
val = 0;
- if( sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */ )
+ if ((sd->sc.option & OPTION_SUMMER2) != 0 && battle_config.summer2_ignorepalette == true)
val = 0;
}
vd->cloth_color = val;
@@ -3195,17 +3280,14 @@ void clif_changelook(struct block_list *bl,int type,int val)
#endif
break;
case LOOK_BODY2:
- if (val && (
- sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS ||
- sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK ||
- sd->sc.option&OPTION_OKTOBERFEST))
+ if (sd != NULL && (sd->sc.option&OPTION_COSTUME) != OPTION_NOTHING)
val = 0;
vd->body_style = val;
break;
}
// prevent leaking the presence of GM-hidden objects
- if( sc && sc->option&OPTION_INVISIBLE && !disguised(bl) )
+ if (sc && sc->option&OPTION_INVISIBLE && !clif->isdisguised(bl))
target = SELF;
#if PACKETVER < 4
clif->sendlook(bl, bl->id, type, val, 0, target);
@@ -3216,11 +3298,12 @@ void clif_changelook(struct block_list *bl,int type,int val)
val = vd->weapon;
val2 = vd->shield;
}
- if( disguised(bl) ) {
+ if (clif->isdisguised(bl)) {
clif->sendlook(bl, bl->id, type, val, val2, AREA_WOS);
clif->sendlook(bl, -bl->id, type, val, val2, SELF);
- } else
+ } else {
clif->sendlook(bl, bl->id, type, val, val2, target);
+ }
#endif
}
@@ -3501,15 +3584,16 @@ void clif_changeoption(struct block_list* bl)
WBUFW(buf,8) = (sc) ? sc->opt2 : 0;
WBUFL(buf,10) = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
WBUFB(buf,14) = (sd)? sd->status.karma : 0;
- if(disguised(bl)) {
+ if (clif->isdisguised(bl)) {
clif->send(buf,packet_len(0x229),bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
clif->send(buf,packet_len(0x229),bl,SELF);
WBUFL(buf,2) = bl->id;
WBUFL(buf,10) = OPTION_INVISIBLE;
clif->send(buf,packet_len(0x229),bl,SELF);
- } else
+ } else {
clif->send(buf,packet_len(0x229),bl,AREA);
+ }
#else
WBUFW(buf,0) = 0x119;
WBUFL(buf,2) = bl->id;
@@ -3517,15 +3601,16 @@ void clif_changeoption(struct block_list* bl)
WBUFW(buf,8) = (sc) ? sc->opt2 : 0;
WBUFL(buf,10) = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
WBUFB(buf,12) = (sd)? sd->status.karma : 0;
- if(disguised(bl)) {
+ if (clif->isdisguised(bl)) {
clif->send(buf,packet_len(0x119),bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
clif->send(buf,packet_len(0x119),bl,SELF);
WBUFL(buf,2) = bl->id;
WBUFW(buf,10) = OPTION_INVISIBLE;
clif->send(buf,packet_len(0x119),bl,SELF);
- } else
+ } else {
clif->send(buf,packet_len(0x119),bl,AREA);
+ }
#endif
}
@@ -3543,15 +3628,16 @@ void clif_changeoption2(struct block_list* bl) {
WBUFL(buf,6) = (sc != NULL) ? sc->option : ((bl->type == BL_NPC) ? BL_UCCAST(BL_NPC, bl)->option : 0);
WBUFL(buf,10) = clif_setlevel(bl);
WBUFL(buf,14) = (sc) ? sc->opt3 : 0;
- if(disguised(bl)) {
+ if (clif->isdisguised(bl)) {
clif->send(buf,packet_len(0x28a),bl,AREA_WOS);
WBUFL(buf,2) = -bl->id;
clif->send(buf,packet_len(0x28a),bl,SELF);
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = OPTION_INVISIBLE;
clif->send(buf,packet_len(0x28a),bl,SELF);
- } else
+ } else {
clif->send(buf,packet_len(0x28a),bl,AREA);
+ }
}
/// Notifies the client about the result of an item use request.
@@ -3623,26 +3709,29 @@ void clif_createchat(struct map_session_data* sd, int flag)
/// 1 = public
/// 2 = arena (npc waiting room)
/// 3 = PK zone (non-clickable)
-void clif_dispchat(struct chat_data* cd, int fd)
+void clif_dispchat(struct chat_data *cd, int fd)
{
unsigned char buf[128];
uint8 type;
+ int len;
- if( cd == NULL || cd->owner == NULL )
+ if (cd == NULL || cd->owner == NULL)
return;
type = (cd->owner->type == BL_PC ) ? (cd->pub) ? 1 : 0
: (cd->owner->type == BL_NPC) ? (cd->limit) ? 2 : 3
: 1;
+ len = (int)strlen(cd->title);
+ Assert_retv(len <= INT16_MAX - 17);
WBUFW(buf, 0) = 0xd7;
- WBUFW(buf, 2) = 17 + strlen(cd->title);
+ WBUFW(buf, 2) = 17 + len;
WBUFL(buf, 4) = cd->owner->id;
WBUFL(buf, 8) = cd->bl.id;
WBUFW(buf,12) = cd->limit;
WBUFW(buf,14) = (cd->owner->type == BL_NPC) ? cd->users+1 : cd->users;
WBUFB(buf,16) = type;
- memcpy((char*)WBUFP(buf,17), cd->title, strlen(cd->title)); // not zero-terminated
+ memcpy(WBUFP(buf,17), cd->title, len); // not zero-terminated
if( fd ) {
WFIFOHEAD(fd,WBUFW(buf,2));
@@ -3660,10 +3749,11 @@ void clif_dispchat(struct chat_data* cd, int fd)
/// 1 = public
/// 2 = arena (npc waiting room)
/// 3 = PK zone (non-clickable)
-void clif_changechatstatus(struct chat_data* cd)
+void clif_changechatstatus(struct chat_data *cd)
{
unsigned char buf[128];
uint8 type;
+ int len;
if( cd == NULL || cd->usersd[0] == NULL )
return;
@@ -3671,15 +3761,17 @@ void clif_changechatstatus(struct chat_data* cd)
type = (cd->owner->type == BL_PC ) ? (cd->pub) ? 1 : 0
: (cd->owner->type == BL_NPC) ? (cd->limit) ? 2 : 3
: 1;
+ len = (int)strlen(cd->title);
+ Assert_retv(len <= INT16_MAX - 17);
WBUFW(buf, 0) = 0xdf;
- WBUFW(buf, 2) = 17 + strlen(cd->title);
+ WBUFW(buf, 2) = 17 + len;
WBUFL(buf, 4) = cd->owner->id;
WBUFL(buf, 8) = cd->bl.id;
WBUFW(buf,12) = cd->limit;
WBUFW(buf,14) = (cd->owner->type == BL_NPC) ? cd->users+1 : cd->users;
WBUFB(buf,16) = type;
- memcpy((char*)WBUFP(buf,17), cd->title, strlen(cd->title)); // not zero-terminated
+ memcpy(WBUFP(buf,17), cd->title, len); // not zero-terminated
clif->send(buf,WBUFW(buf,2),cd->owner,CHAT);
}
@@ -3841,7 +3933,7 @@ void clif_traderequest(struct map_session_data *sd, const char *name)
#if PACKETVER < 6
WFIFOHEAD(fd,packet_len(0xe5));
WFIFOW(fd,0) = 0xe5;
- safestrncpy((char*)WFIFOP(fd,2), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2), name, NAME_LENGTH);
WFIFOSET(fd,packet_len(0xe5));
#else // PACKETVER >= 6
tsd = map->id2sd(sd->trade_partner);
@@ -3850,7 +3942,7 @@ void clif_traderequest(struct map_session_data *sd, const char *name)
WFIFOHEAD(fd,packet_len(0x1f4));
WFIFOW(fd,0) = 0x1f4;
- safestrncpy((char*)WFIFOP(fd,2), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2), name, NAME_LENGTH);
WFIFOL(fd,26) = tsd->status.char_id;
WFIFOW(fd,30) = tsd->status.base_level;
WFIFOSET(fd,packet_len(0x1f4));
@@ -3927,7 +4019,7 @@ void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd
WBUFW(buf,15)= 0; //card (4w)
WBUFW(buf,17)= 0; //card (4w)
#if PACKETVER >= 20150226
- clif->add_random_options(WBUFP(buf, 19), &sd->status.inventory[index]);
+ clif->add_item_options(WBUFP(buf, 19), &sd->status.inventory[index]);
#endif
}
else
@@ -3953,7 +4045,7 @@ void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd
WBUFB(buf,10)= sd->status.inventory[index].refine; //refine
clif->addcards(WBUFP(buf, 11), &sd->status.inventory[index]);
#if PACKETVER >= 20150226
- clif->add_random_options(WBUFP(buf, 19), &sd->status.inventory[index]);
+ clif->add_item_options(WBUFP(buf, 19), &sd->status.inventory[index]);
#endif
}
WFIFOSET(fd,packet_len(tradeaddType));
@@ -4084,7 +4176,7 @@ void clif_storageitemadded(struct map_session_data* sd, struct item* i, int inde
WFIFOB(fd,12+offset) = i->refine; //refine
clif->addcards(WFIFOP(fd,13+offset), i);
#if PACKETVER >= 20150226
- clif->add_random_options(WFIFOP(fd,21+offset), i);
+ clif->add_item_options(WFIFOP(fd, 21 + offset), i);
#endif
WFIFOSET(fd,packet_len(storageaddType));
}
@@ -4097,12 +4189,13 @@ void clif_storageitemremoved(struct map_session_data* sd, int index, int amount)
nullpo_retv(sd);
- fd=sd->fd;
- WFIFOHEAD(fd,packet_len(0xf6));
- WFIFOW(fd,0)=0xf6; // Storage item removed
- WFIFOW(fd,2)=index+1;
- WFIFOL(fd,4)=amount;
- WFIFOSET(fd,packet_len(0xf6));
+ fd = sd->fd;
+
+ WFIFOHEAD(fd, packet_len(0xf6));
+ WFIFOW(fd, 0) = 0xf6; // Storage item removed
+ WFIFOW(fd, 2) = index + 1;
+ WFIFOL(fd, 4) = amount;
+ WFIFOSET(fd, packet_len(0xf6));
}
/// Closes storage (ZC_CLOSE_STORE).
@@ -4128,8 +4221,8 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
nullpo_retv(sd);
nullpo_retv(dstsd);
- if( dstsd->chatID ) {
- struct chat_data *cd = map->id2cd(dstsd->chatID);
+ if (dstsd->chat_id != 0) {
+ struct chat_data *cd = map->id2cd(dstsd->chat_id);
if (cd != NULL && cd->usersd[0] == dstsd)
clif->dispchat(cd,sd->fd);
} else if( dstsd->state.vending )
@@ -4143,7 +4236,7 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
clif->charm_single(sd->fd, dstsd);
for( i = 0; i < dstsd->sc_display_count; i++ ) {
- clif->sc_load(&sd->bl,dstsd->bl.id,SELF,status->dbs->IconChangeTable[dstsd->sc_display[i]->type],dstsd->sc_display[i]->val1,dstsd->sc_display[i]->val2,dstsd->sc_display[i]->val3);
+ clif->sc_continue(&sd->bl,dstsd->bl.id,SELF,status->dbs->IconChangeTable[dstsd->sc_display[i]->type],dstsd->sc_display[i]->val1,dstsd->sc_display[i]->val2,dstsd->sc_display[i]->val3);
}
if( (sd->status.party_id && dstsd->status.party_id == sd->status.party_id) || //Party-mate, or hpdisp setting.
(sd->bg_id && sd->bg_id == dstsd->bg_id) || //BattleGround
@@ -4170,7 +4263,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
nullpo_retv(bl);
vd = status->get_viewdata(bl);
- if (!vd || vd->class_ == INVISIBLE_CLASS)
+ if (vd == NULL || vd->class == INVISIBLE_CLASS)
return;
if (bl->type == BL_NPC) {
@@ -4333,16 +4426,17 @@ int clif_damage(struct block_list* src, struct block_list* dst, int sdelay, int
p.is_sp_damaged = 0; // TODO: IsSPDamage - Displays blue digits.
#endif
- if(disguised(dst)) {
+ if (clif->isdisguised(dst)) {
clif->send(&p,sizeof(p),dst,AREA_WOS);
p.targetGID = -dst->id;
clif->send(&p,sizeof(p),dst,SELF);
- } else
+ } else {
clif->send(&p,sizeof(p),dst,AREA);
+ }
- if(disguised(src)) {
+ if (clif->isdisguised(src)) {
p.GID = -src->id;
- if (disguised(dst))
+ if (clif->isdisguised(dst))
p.targetGID = dst->id;
if(damage > 0) p.damage = -1;
@@ -4391,7 +4485,7 @@ void clif_sitting(struct block_list* bl)
WBUFB(buf,26) = 2;
clif->send(buf, packet_len(0x8a), bl, AREA);
- if(disguised(bl)) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf, 2) = - bl->id;
clif->send(buf, packet_len(0x8a), bl, SELF);
}
@@ -4410,7 +4504,7 @@ void clif_standing(struct block_list* bl)
WBUFB(buf,26) = 3;
clif->send(buf, packet_len(0x8a), bl, AREA);
- if(disguised(bl)) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf, 2) = - bl->id;
clif->send(buf, packet_len(0x8a), bl, SELF);
}
@@ -4425,7 +4519,7 @@ void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_targe
WBUFW(buf,2) = x;
WBUFW(buf,4) = y;
WBUFW(buf,6) = type;
- mapindex->getmapname_ext(map->list[m].custom_name ? map->list[map->list[m].instance_src_map].name : map->list[m].name,(char*)WBUFP(buf,8));
+ mapindex->getmapname_ext(map->list[m].custom_name ? map->list[map->list[m].instance_src_map].name : map->list[m].name, WBUFP(buf,8));
if( fd ) {
WFIFOHEAD(fd,packet_len(0x192));
@@ -4629,11 +4723,11 @@ int clif_outsight(struct block_list *bl,va_list ap)
nullpo_ret(bl);
switch(bl->type){
case BL_PC:
- if (sd->vd.class_ != INVISIBLE_CLASS)
+ if (sd->vd.class != INVISIBLE_CLASS)
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
- if (sd->chatID) {
- struct chat_data *cd = map->id2cd(sd->chatID);
- if(cd->usersd[0]==sd)
+ if (sd->chat_id != 0) {
+ struct chat_data *cd = map->id2cd(sd->chat_id);
+ if (cd != NULL && cd->usersd[0] == sd)
clif->dispchat(cd,tsd->fd);
}
if( sd->state.vending )
@@ -4652,7 +4746,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
default:
- if ((vd=status->get_viewdata(bl)) && vd->class_ != INVISIBLE_CLASS)
+ if ((vd=status->get_viewdata(bl)) && vd->class != INVISIBLE_CLASS)
clif->clearunit_single(bl->id,CLR_OUTSIGHT,tsd->fd);
break;
}
@@ -4661,7 +4755,7 @@ int clif_outsight(struct block_list *bl,va_list ap)
nullpo_ret(tbl);
if (tbl->type == BL_SKILL) //Trap knocked out of sight
clif->clearchar_skillunit(BL_UCAST(BL_SKILL, tbl), sd->fd);
- else if ((vd = status->get_viewdata(tbl)) && vd->class_ != INVISIBLE_CLASS
+ else if ((vd = status->get_viewdata(tbl)) != NULL && vd->class != INVISIBLE_CLASS
&& !(tbl->type == BL_NPC && (BL_UCAST(BL_NPC, tbl)->option&OPTION_INVISIBLE)))
clif->clearunit_single(tbl->id,CLR_OUTSIGHT,sd->fd);
}
@@ -4735,9 +4829,9 @@ void clif_skillinfoblock(struct map_session_data *sd)
WFIFOW(fd, len + 8) = 0;
WFIFOW(fd, len + 10)= 0;
}
- safestrncpy((char*)WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
- WFIFOB(fd,len+36) = (sd->status.skill[i].lv < skill->tree_get_max(id, sd->status.class_))? 1:0;
+ WFIFOB(fd,len+36) = (sd->status.skill[i].lv < skill->tree_get_max(id, sd->status.class))? 1:0;
else
WFIFOB(fd,len+36) = 0;
len += 37;
@@ -4786,9 +4880,9 @@ void clif_addskill(struct map_session_data *sd, int id)
WFIFOW(fd,10) = 0;
WFIFOW(fd,12) = 0;
}
- safestrncpy((char*)WFIFOP(fd,14), skill->get_name(id), NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,14), skill->get_name(id), NAME_LENGTH);
if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT)
- WFIFOB(fd,38) = (skill_lv < skill->tree_get_max(id, sd->status.class_))? 1:0;
+ WFIFOB(fd,38) = (skill_lv < skill->tree_get_max(id, sd->status.class))? 1:0;
else
WFIFOB(fd,38) = 0;
WFIFOSET(fd,packet_len(0x111));
@@ -4833,7 +4927,7 @@ void clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, in
WFIFOW(fd, 6) = skill->get_sp(skill_id, skill_lv);
WFIFOW(fd, 8) = (flag)?skill->get_range2(&sd->bl, skill_id, skill_lv) : skill->get_range(skill_id, skill_lv);
if( flag )
- WFIFOB(fd,10) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class_)) ? 1 : 0;
+ WFIFOB(fd,10) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class)) ? 1 : 0;
else
WFIFOB(fd,10) = 1;
@@ -4866,7 +4960,7 @@ void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf)
WFIFOW(fd,12) = 0;
}
if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT)
- WFIFOB(fd,14) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class_))? 1:0;
+ WFIFOB(fd,14) = (skill_lv < skill->tree_get_max(skill_id, sd->status.class))? 1:0;
else
WFIFOB(fd,14) = 0;
WFIFOSET(fd,packet_len(0x7e1));
@@ -4887,7 +4981,7 @@ void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf)
/// is disposable:
/// 0 = yellow chat text "[src name] will use skill [skill name]."
/// 1 = no text
-void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime)
+void clif_useskill(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime)
{
#if PACKETVER < 20091124
const int cmd = 0x13e;
@@ -4895,6 +4989,7 @@ void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x,
const int cmd = 0x7fb;
#endif
unsigned char buf[32];
+ int property = skill->get_ele(skill_id, skill_lv);
WBUFW(buf,0) = cmd;
WBUFL(buf,2) = src_id;
@@ -4908,12 +5003,13 @@ void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x,
WBUFB(buf,24) = 0; // isDisposable
#endif
- if (disguised(bl)) {
+ if (clif->isdisguised(bl)) {
clif->send(buf,packet_len(cmd), bl, AREA_WOS);
WBUFL(buf,2) = -src_id;
clif->send(buf,packet_len(cmd), bl, SELF);
- } else
+ } else {
clif->send(buf,packet_len(cmd), bl, AREA);
+ }
}
/// Notifies clients in area, that an object canceled casting (ZC_DISPEL).
@@ -5043,16 +5139,17 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick
WBUFW(buf, 26) = skill_lv;
WBUFW(buf, 28) = div;
WBUFB(buf, 30) = type;
- if (disguised(dst)) {
+ if (clif->isdisguised(dst)) {
clif->send(buf, packet_len(0x114), dst, AREA_WOS);
WBUFL(buf, 8) = -dst->id;
clif->send(buf, packet_len(0x114), dst, SELF);
- } else
+ } else {
clif->send(buf, packet_len(0x114), dst, AREA);
+ }
- if (disguised(src)) {
+ if (clif->isdisguised(src)) {
WBUFL(buf, 4) = -src->id;
- if (disguised(dst))
+ if (clif->isdisguised(dst))
WBUFL(buf, 8) = dst->id;
if (damage > 0)
WBUFW(buf, 24) = -1;
@@ -5082,16 +5179,17 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick
#else
WBUFB(buf, 32) = (type == BDT_SKILL) ? BDT_MULTIHIT : type;
#endif
- if (disguised(dst)) {
+ if (clif->isdisguised(dst)) {
clif->send(buf, packet_len(0x1de), dst, AREA_WOS);
WBUFL(buf,8)=-dst->id;
clif->send(buf, packet_len(0x1de), dst, SELF);
- } else
+ } else {
clif->send(buf, packet_len(0x1de), dst, AREA);
+ }
- if (disguised(src)) {
+ if (clif->isdisguised(src)) {
WBUFL(buf, 4) = -src->id;
- if (disguised(dst))
+ if (clif->isdisguised(dst))
WBUFL(buf, 8) = dst->id;
if (damage > 0)
WBUFL(buf, 24) = -1;
@@ -5140,15 +5238,15 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic
WBUFW(buf,32)=div;
WBUFB(buf,34)=type;
clif->send(buf,packet_len(0x115),src,AREA);
- if(disguised(src)) {
+ if (clif->isdisguised(src)) {
WBUFL(buf,4)=-src->id;
if(damage > 0)
WBUFW(buf,28)=-1;
clif->send(buf,packet_len(0x115),src,SELF);
}
- if (disguised(dst)) {
+ if (clif->isdisguised(dst)) {
WBUFL(buf,8)=-dst->id;
- if (disguised(src))
+ if (clif->isdisguised(src))
WBUFL(buf,4)=src->id;
else if(damage > 0)
WBUFW(buf,28)=-1;
@@ -5160,33 +5258,46 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic
}
#endif // 0
-/// Non-damaging skill effect (ZC_USE_SKILL).
-/// 011a <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.B
-int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail)
+/// Non-damaging skill effect.
+/// 011a <skill id>.W <skill lv>.W <dst id>.L <src id>.L <result>.B (ZC_USE_SKILL)
+/// 09cb <skill id>.W <skill lv>.L <dst id>.L <src id>.L <result>.B (ZC_USE_SKILL2)
+int clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail)
{
unsigned char buf[32];
+ short offset = 0;
+#if PACKETVER < 20131223
+ short cmd = 0x11a;
+#else
+ short cmd = 0x9cb;
+#endif
+ int len = packet_len(cmd);
nullpo_ret(dst);
- WBUFW(buf,0)=0x11a;
- WBUFW(buf,2)=skill_id;
- WBUFW(buf,4)=min(heal, INT16_MAX);
- WBUFL(buf,6)=dst->id;
- WBUFL(buf,10)=src?src->id:0;
- WBUFB(buf,14)=fail;
-
- if (disguised(dst)) {
- clif->send(buf,packet_len(0x11a),dst,AREA_WOS);
- WBUFL(buf,6)=-dst->id;
- clif->send(buf,packet_len(0x11a),dst,SELF);
+ WBUFW(buf, 0) = cmd;
+ WBUFW(buf, 2) = skill_id;
+#if PACKETVER < 20131223
+ WBUFW(buf, 4) = min(heal, INT16_MAX);
+#else
+ WBUFL(buf, 4) = min(heal, INT_MAX);
+ offset += 2;
+#endif
+ WBUFL(buf, 6 + offset) = dst->id;
+ WBUFL(buf, 10 + offset) = src ? src->id : 0;
+ WBUFB(buf, 14 + offset) = fail;
+
+ if (clif->isdisguised(dst)) {
+ clif->send(buf, len, dst, AREA_WOS);
+ WBUFL(buf, 6 + offset) = -dst->id;
+ clif->send(buf, len, dst, SELF);
} else
- clif->send(buf,packet_len(0x11a),dst,AREA);
+ clif->send(buf, len, dst, AREA);
- if(src && disguised(src)) {
- WBUFL(buf,10)=-src->id;
- if (disguised(dst))
- WBUFL(buf,6)=dst->id;
- clif->send(buf,packet_len(0x11a),src,SELF);
+ if (src && clif->isdisguised(src)) {
+ WBUFL(buf, 10 + offset) = -src->id;
+ if (clif->isdisguised(dst))
+ WBUFL(buf, 6 + offset) = dst->id;
+ clif->send(buf, len, src, SELF);
}
return fail;
@@ -5206,12 +5317,13 @@ void clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int
WBUFW(buf,10)=x;
WBUFW(buf,12)=y;
WBUFL(buf,14)=(uint32)tick;
- if(disguised(src)) {
+ if (clif->isdisguised(src)) {
clif->send(buf,packet_len(0x117),src,AREA_WOS);
WBUFL(buf,4)=-src->id;
clif->send(buf,packet_len(0x117),src,SELF);
- } else
+ } else {
clif->send(buf,packet_len(0x117),src,AREA);
+ }
}
/// Presents a list of available warp destinations (ZC_WARPLIST).
@@ -5227,12 +5339,12 @@ void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 s
WFIFOW(fd,0) = 0x11c;
WFIFOW(fd,2) = skill_id;
memset(WFIFOP(fd,4), 0x00, 4*MAP_NAME_LENGTH_EXT);
- if (map1 == (unsigned short)-1) strcpy((char*)WFIFOP(fd,4), "Random");
+ if (map1 == (unsigned short)-1) strcpy(WFIFOP(fd,4), "Random");
else // normal map name
- if (map1 > 0) mapindex->getmapname_ext(mapindex_id2name(map1), (char*)WFIFOP(fd,4));
- if (map2 > 0) mapindex->getmapname_ext(mapindex_id2name(map2), (char*)WFIFOP(fd,20));
- if (map3 > 0) mapindex->getmapname_ext(mapindex_id2name(map3), (char*)WFIFOP(fd,36));
- if (map4 > 0) mapindex->getmapname_ext(mapindex_id2name(map4), (char*)WFIFOP(fd,52));
+ if (map1 > 0) mapindex->getmapname_ext(mapindex_id2name(map1), WFIFOP(fd,4));
+ if (map2 > 0) mapindex->getmapname_ext(mapindex_id2name(map2), WFIFOP(fd,20));
+ if (map3 > 0) mapindex->getmapname_ext(mapindex_id2name(map3), WFIFOP(fd,36));
+ if (map4 > 0) mapindex->getmapname_ext(mapindex_id2name(map4), WFIFOP(fd,52));
WFIFOSET(fd,packet_len(0x11c));
sd->menuskill_id = skill_id;
@@ -5491,24 +5603,25 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val
/// Send message (modified by [Yor]) (ZC_NOTIFY_PLAYERCHAT).
/// 008e <packet len>.W <message>.?B
-void clif_displaymessage(const int fd, const char* mes) {
+void clif_displaymessage(const int fd, const char *mes)
+{
nullpo_retv(mes);
- if( map->cpsd_active && fd == 0 ) {
+ if (map->cpsd_active && fd == 0) {
ShowInfo("HCP: %s\n",mes);
- } else if ( fd > 0 ) {
+ } else if (fd > 0) {
#if PACKETVER == 20141022
/** for some reason game client crashes depending on message pattern (only for this packet) **/
/** so we redirect to ZC_NPC_CHAT **/
clif->messagecolor_self(fd, COLOR_DEFAULT, mes);
#else
- size_t len;
+ int len = (int)strnlen(mes, 255);
- if ( ( len = strnlen(mes, 255) ) > 0 ) { // don't send a void message (it's not displaying on the client chat). @help can send void line.
+ if (len > 0) { // don't send a void message (it's not displaying on the client chat). @help can send void line.
WFIFOHEAD(fd, 5 + len);
WFIFOW(fd,0) = 0x8e;
- WFIFOW(fd,2) = 5 + len; // 4 + len + NULL terminate
- safestrncpy((char *)WFIFOP(fd,4), mes, len + 1);
+ WFIFOW(fd,2) = 5 + len; // 4 + len + NUL terminate
+ safestrncpy(WFIFOP(fd,4), mes, len + 1);
WFIFOSET(fd, 5 + len);
}
#endif
@@ -5529,7 +5642,7 @@ void clif_displaymessage2(const int fd, const char* mes) {
line = strtok(message, "\n");
while(line != NULL) {
// Limit message to 255+1 characters (otherwise it causes a buffer overflow in the client)
- size_t len = strnlen(line, 255);
+ int len = (int)strnlen(line, 255);
if (len > 0) { // don't send a void message (it's not displaying on the client chat). @help can send void line.
if( map->cpsd_active && fd == 0 ) {
@@ -5538,7 +5651,7 @@ void clif_displaymessage2(const int fd, const char* mes) {
WFIFOHEAD(fd, 5 + len);
WFIFOW(fd,0) = 0x8e;
WFIFOW(fd,2) = 5 + len; // 4 + len + NULL terminate
- safestrncpy((char *)WFIFOP(fd,4), line, len + 1);
+ safestrncpy(WFIFOP(fd,4), line, len + 1);
WFIFOSET(fd, 5 + len);
}
}
@@ -5567,11 +5680,11 @@ void clif_displaymessage_sprintf(const int fd, const char *mes, ...) {
/* process */
va_start(ap,mes);
- len += vsnprintf((char *)WFIFOP(fd,4), 255, mes, ap);
+ len += vsnprintf(WFIFOP(fd,4), 255, mes, ap);
va_end(ap);
/* adjusting */
- ptr = (char *)WFIFOP(fd,4);
+ ptr = WFIFOP(fd,4);
ptr[len - 1] = '\0';
/* */
@@ -5583,7 +5696,7 @@ void clif_displaymessage_sprintf(const int fd, const char *mes, ...) {
}
/// Send broadcast message in yellow or blue without font formatting (ZC_BROADCAST).
/// 009a <packet len>.W <message>.?B
-void clif_broadcast(struct block_list *bl, const char *mes, size_t len, int type, enum send_target target)
+void clif_broadcast(struct block_list *bl, const char *mes, int len, int type, enum send_target target)
{
int lp = (type&BC_COLOR_MASK) ? 4 : 0;
unsigned char *buf = NULL;
@@ -5607,38 +5720,38 @@ void clif_broadcast(struct block_list *bl, const char *mes, size_t len, int type
* Displays a message on a 'bl' to all it's nearby clients
* Used by npc_globalmessage
*------------------------------------------*/
-void clif_GlobalMessage(struct block_list* bl, const char* message) {
+void clif_GlobalMessage(struct block_list *bl, const char *message)
+{
char buf[256];
- size_t len;
+ int len;
nullpo_retv(bl);
- if(!message)
+ if (message == NULL)
return;
- len = strlen(message)+1;
+ len = (int)strlen(message)+1;
- if (len > sizeof(buf)-8) {
- ShowWarning("clif_GlobalMessage: Truncating too long message '%s' (len=%"PRIuS").\n", message, len);
- len = sizeof(buf)-8;
+ if (len > (int)sizeof(buf)-8) {
+ ShowWarning("clif_GlobalMessage: Truncating too long message '%s' (len=%d).\n", message, len);
+ len = (int)sizeof(buf)-8;
}
- WBUFW(buf,0)=0x8d;
- WBUFW(buf,2)=len+8;
- WBUFL(buf,4)=bl->id;
- safestrncpy((char *) WBUFP(buf,8),message,len);
- clif->send((unsigned char *) buf,WBUFW(buf,2),bl,ALL_CLIENT);
-
+ WBUFW(buf,0) = 0x8d;
+ WBUFW(buf,2) = len+8;
+ WBUFL(buf,4) = bl->id;
+ safestrncpy(WBUFP(buf,8),message,len);
+ clif->send(buf,WBUFW(buf,2),bl,ALL_CLIENT);
}
/// Send broadcast message with font formatting (ZC_BROADCAST2).
/// 01c3 <packet len>.W <fontColor>.L <fontType>.W <fontSize>.W <fontAlign>.W <fontY>.W <message>.?B
-void clif_broadcast2(struct block_list* bl, const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target)
+void clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target)
{
unsigned char *buf;
nullpo_retv(mes);
- buf = (unsigned char*)aMalloc((16 + len)*sizeof(unsigned char));
+ buf = aMalloc((16 + len)*sizeof(unsigned char));
WBUFW(buf,0) = 0x1c3;
WBUFW(buf,2) = len + 16;
WBUFL(buf,4) = fontColor;
@@ -5658,13 +5771,24 @@ void clif_broadcast2(struct block_list* bl, const char* mes, size_t len, unsigne
/// 5 = HP (SP_HP)
/// 7 = SP (SP_SP)
/// ? = ignored
-void clif_heal(int fd,int type,int val)
+void clif_heal(int fd, int type, int val)
{
- WFIFOHEAD(fd,packet_len(0x13d));
- WFIFOW(fd,0)=0x13d;
- WFIFOW(fd,2)=type;
- WFIFOW(fd,4)=cap_value(val,0,INT16_MAX);
- WFIFOSET(fd,packet_len(0x13d));
+#if PACKETVER < 20150513
+ short cmd = 0x13d;
+#else
+ short cmd = 0xa27;
+#endif
+ int len = packet_len(cmd);
+
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = cmd;
+ WFIFOW(fd, 2) = type;
+#if PACKETVER < 20150513
+ WFIFOW(fd, 4) = cap_value(val, 0, INT16_MAX);
+#else
+ WFIFOL(fd, 4) = cap_value(val, 0, INT_MAX);
+#endif
+ WFIFOSET(fd, len);
}
/// Displays resurrection effect (ZC_RESURRECTION).
@@ -5682,7 +5806,7 @@ void clif_resurrection(struct block_list *bl,int type)
WBUFW(buf,6)=0;
clif->send(buf,packet_len(0x148),bl, type == 1 ? AREA : AREA_WOS);
- if (disguised(bl)) {
+ if (clif->isdisguised(bl)) {
struct map_session_data *sd = BL_UCAST(BL_PC, bl);
if (sd->fontcolor) {
WBUFL(buf,2)=-bl->id;
@@ -5806,7 +5930,7 @@ void clif_upgrademessage(int fd, int result, int item_id)
/// Whisper is transmitted to the destination player (ZC_WHISPER).
/// 0097 <packet len>.W <nick>.24B <message>.?B
/// 0097 <packet len>.W <nick>.24B <isAdmin>.L <message>.?B (PACKETVER >= 20091104)
-void clif_wis_message(int fd, const char *nick, const char *mes, size_t mes_len)
+void clif_wis_message(int fd, const char *nick, const char *mes, int mes_len)
{
#if PACKETVER >= 20091104
struct map_session_data *ssd = NULL;
@@ -5815,21 +5939,21 @@ void clif_wis_message(int fd, const char *nick, const char *mes, size_t mes_len)
nullpo_retv(mes);
#if PACKETVER < 20091104
- WFIFOHEAD(fd, mes_len + NAME_LENGTH + 4);
+ WFIFOHEAD(fd, mes_len + NAME_LENGTH + 5);
WFIFOW(fd,0) = 0x97;
- WFIFOW(fd,2) = mes_len + NAME_LENGTH + 4;
- safestrncpy((char*)WFIFOP(fd,4), nick, NAME_LENGTH);
- safestrncpy((char*)WFIFOP(fd,28), mes, mes_len);
+ WFIFOW(fd,2) = mes_len + NAME_LENGTH + 5;
+ safestrncpy(WFIFOP(fd,4), nick, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,28), mes, mes_len + 1);
WFIFOSET(fd,WFIFOW(fd,2));
#else
ssd = map->nick2sd(nick);
- WFIFOHEAD(fd, mes_len + NAME_LENGTH + 8);
+ WFIFOHEAD(fd, mes_len + NAME_LENGTH + 9);
WFIFOW(fd,0) = 0x97;
- WFIFOW(fd,2) = mes_len + NAME_LENGTH + 8;
- safestrncpy((char*)WFIFOP(fd,4), nick, NAME_LENGTH);
+ WFIFOW(fd,2) = mes_len + NAME_LENGTH + 9;
+ safestrncpy(WFIFOP(fd,4), nick, NAME_LENGTH);
WFIFOL(fd,28) = (ssd && pc_get_group_level(ssd) == 99) ? 1 : 0; // isAdmin; if nonzero, also displays text above char
- safestrncpy((char*)WFIFOP(fd,32), mes, mes_len);
+ safestrncpy(WFIFOP(fd,32), mes, mes_len + 1);
WFIFOSET(fd,WFIFOW(fd,2));
#endif
}
@@ -5865,7 +5989,7 @@ void clif_solved_charname(int fd, int charid, const char* name)
WFIFOHEAD(fd,packet_len(0x194));
WFIFOW(fd,0)=0x194;
WFIFOL(fd,2)=charid;
- safestrncpy((char*)WFIFOP(fd,6), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,6), name, NAME_LENGTH);
WFIFOSET(fd,packet_len(0x194));
}
@@ -5979,7 +6103,7 @@ void clif_item_repair_list(struct map_session_data *sd,struct map_session_data *
WFIFOW(fd,0)=0x1fc;
for (i = c = 0; i < MAX_INVENTORY; i++) {
int nameid = dstsd->status.inventory[i].nameid;
- if (nameid > 0 && dstsd->status.inventory[i].attribute != 0) { // && skill_can_repair(sd,nameid)) {
+ if (nameid > 0 && (dstsd->status.inventory[i].attribute & ATTR_BROKEN) != 0) { // && skill_can_repair(sd,nameid)) {
WFIFOW(fd,c*13+4) = i;
WFIFOW(fd,c*13+6) = nameid;
WFIFOB(fd,c*13+8) = dstsd->status.inventory[i].refine;
@@ -6089,7 +6213,7 @@ void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv
WFIFOW(fd, 8)=skill_lv;
WFIFOW(fd,10)=skill->get_sp(skill_id,skill_lv);
WFIFOW(fd,12)=skill->get_range2(&sd->bl, skill_id,skill_lv);
- safestrncpy((char*)WFIFOP(fd,14),skill->get_name(skill_id),NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,14),skill->get_name(skill_id),NAME_LENGTH);
WFIFOB(fd,38)=0;
WFIFOSET(fd,packet_len(0x147));
}
@@ -6127,7 +6251,7 @@ void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
WBUFB(buf,12+offset)=sd->status.cart[n].refine;
clif->addcards(WBUFP(buf,13+offset), &sd->status.cart[n]);
#if PACKETVER >= 20150226
- clif->add_random_options(WBUFP(buf,21+offset), &sd->status.cart[n]);
+ clif->add_item_options(WBUFP(buf, 21 + offset), &sd->status.cart[n]);
#endif
WFIFOSET(fd,packet_len(cartaddType));
}
@@ -6176,7 +6300,7 @@ void clif_showvendingboard(struct block_list* bl, const char* message, int fd)
WBUFW(buf,0) = 0x131;
WBUFL(buf,2) = bl->id;
- safestrncpy((char*)WBUFP(buf,6), message, 80);
+ safestrncpy(WBUFP(buf,6), message, 80);
if( fd ) {
WFIFOHEAD(fd,packet_len(0x131));
@@ -6255,7 +6379,7 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven
WFIFOB(fd,offset+13+i*item_length) = vsd->status.cart[index].refine;
clif->addcards(WFIFOP(fd,offset+14+i*item_length), &vsd->status.cart[index]);
#if PACKETVER >= 20150226
- clif->add_random_options(WFIFOP(fd,offset+22+i*item_length), &vsd->status.cart[index]);
+ clif->add_item_options(WFIFOP(fd, offset + 22 + i * item_length), &vsd->status.cart[index]);
#endif
}
WFIFOSET(fd,WFIFOW(fd,2));
@@ -6321,34 +6445,46 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
WFIFOB(fd,21+i*item_length) = sd->status.cart[index].refine;
clif->addcards(WFIFOP(fd,22+i*item_length), &sd->status.cart[index]);
#if PACKETVER >= 20150226
- clif->add_random_options(WFIFOP(fd,30+22+i*item_length), &sd->status.cart[index]);
+ clif->add_item_options(WFIFOP(fd, 30 + i * item_length), &sd->status.cart[index]);
#endif
}
WFIFOSET(fd,WFIFOW(fd,2));
-#if PACKETVER >= 20141022
+#if PACKETVER >= 20140625
/** should go elsewhere perhaps? it has to be bundled with this however. **/
- WFIFOHEAD(fd, 3);
+ WFIFOHEAD(fd, packet_len(0xa28));
WFIFOW(fd, 0) = 0xa28;
WFIFOB(fd, 2) = 0;/** 1 is failure. our current responses to failure are working so not yet implemented **/
- WFIFOSET(fd, 3);
+ WFIFOSET(fd, packet_len(0xa28));
#endif
}
-/// Inform merchant that someone has bought an item (ZC_DELETEITEM_FROM_MCSTORE).
-/// 0137 <index>.W <amount>.W
-void clif_vendingreport(struct map_session_data* sd, int index, int amount)
+/// Inform merchant that someone has bought an item.
+/// 0137 <index>.W <amount>.W (ZC_DELETEITEM_FROM_MCSTORE).
+/// 09e5 <index>.W <amount>.W <GID>.L <Date>.L <zeny>.L (ZC_DELETEITEM_FROM_MCSTORE2).
+void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny)
{
int fd;
+#if PACKETVER < 20141016 // TODO : not sure for client date [Napster]
+ const int cmd = 0x137;
+#else
+ const int cmd = 0x9e5;
+#endif
+ const int len = packet_len(cmd);
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd,packet_len(0x137));
- WFIFOW(fd,0) = 0x137;
- WFIFOW(fd,2) = index+2;
- WFIFOW(fd,4) = amount;
- WFIFOSET(fd,packet_len(0x137));
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = cmd;
+ WFIFOW(fd, 2) = index + 2;
+ WFIFOW(fd, 4) = amount;
+#if PACKETVER >= 20141016
+ WFIFOL(fd,6) = char_id; // GID
+ WFIFOL(fd,10) = (int)time(NULL); // Date
+ WFIFOL(fd,14) = zeny; // zeny
+#endif
+ WFIFOSET(fd, len);
}
/// Result of organizing a party (ZC_ACK_MAKE_GROUP).
@@ -6404,7 +6540,7 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
WBUFB(buf,14) = (p->party.member[i].online)?0:1;
memcpy(WBUFP(buf,15), p->party.name, NAME_LENGTH);
memcpy(WBUFP(buf,39), sd->status.name, NAME_LENGTH);
- mapindex->getmapname_ext(map->list[sd->bl.m].custom_name ? map->list[map->list[sd->bl.m].instance_src_map].name : map->list[sd->bl.m].name, (char*)WBUFP(buf,63));
+ mapindex->getmapname_ext(map->list[sd->bl.m].custom_name ? map->list[map->list[sd->bl.m].instance_src_map].name : map->list[sd->bl.m].name, WBUFP(buf,63));
WBUFB(buf,79) = (p->party.item&1)?1:0;
WBUFB(buf,80) = (p->party.item&2)?1:0;
clif->send(buf,packet_len(0x1e9),&sd->bl,PARTY);
@@ -6437,7 +6573,7 @@ void clif_party_info(struct party_data* p, struct map_session_data *sd)
WBUFL(buf,28+c*46) = m->account_id;
memcpy(WBUFP(buf,28+c*46+4), m->name, NAME_LENGTH);
- mapindex->getmapname_ext(mapindex_id2name(m->map), (char*)WBUFP(buf,28+c*46+28));
+ mapindex->getmapname_ext(mapindex_id2name(m->map), WBUFP(buf,28+c*46+28));
WBUFB(buf,28+c*46+44) = (m->leader) ? 0 : 1;
WBUFB(buf,28+c*46+45) = (m->online) ? 0 : 1;
c++;
@@ -6517,7 +6653,7 @@ void clif_party_inviteack(struct map_session_data* sd, const char* nick, int res
#if PACKETVER < 20070904
if( result == 7 ) {
- clif->message(fd, msg_sd(sd,3));
+ clif->message(fd, msg_sd(sd,3)); // Character not found.
return;
}
#endif
@@ -6525,13 +6661,13 @@ void clif_party_inviteack(struct map_session_data* sd, const char* nick, int res
#if PACKETVER < 20070821
WFIFOHEAD(fd,packet_len(0xfd));
WFIFOW(fd,0) = 0xfd;
- safestrncpy((char*)WFIFOP(fd,2),nick,NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2),nick,NAME_LENGTH);
WFIFOB(fd,26) = result;
WFIFOSET(fd,packet_len(0xfd));
#else
WFIFOHEAD(fd,packet_len(0x2c5));
WFIFOW(fd,0) = 0x2c5;
- safestrncpy((char*)WFIFOP(fd,2),nick,NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2),nick,NAME_LENGTH);
WFIFOL(fd,26) = result;
WFIFOSET(fd,packet_len(0x2c5));
#endif
@@ -6615,7 +6751,7 @@ void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int
/// Party chat message (ZC_NOTIFY_CHAT_PARTY).
/// 0109 <packet len>.W <account id>.L <message>.?B
-void clif_party_message(struct party_data* p, int account_id, const char* mes, int len)
+void clif_party_message(struct party_data *p, int account_id, const char *mes, int len)
{
struct map_session_data *sd;
int i;
@@ -6623,22 +6759,24 @@ void clif_party_message(struct party_data* p, int account_id, const char* mes, i
nullpo_retv(p);
nullpo_retv(mes);
- for(i=0; i < MAX_PARTY && !p->data[i].sd;i++);
- if(i < MAX_PARTY){
+ ARR_FIND(0, MAX_PARTY, i, p->data[i].sd != NULL);
+
+ if (i < MAX_PARTY) {
unsigned char buf[1024];
+ int maxlen = (int)sizeof(buf) - 9;
- if (len > sizeof(buf)-8) {
- ShowWarning("clif_party_message: Truncated message '%s' (len=%d, max=%"PRIuS", party_id=%d).\n",
- mes, len, sizeof(buf)-8, p->party.party_id);
- len = sizeof(buf)-8;
+ if (len > maxlen) {
+ ShowWarning("clif_party_message: Truncated message '%s' (len=%d, max=%d, party_id=%d).\n",
+ mes, len, maxlen, p->party.party_id);
+ len = maxlen;
}
sd = p->data[i].sd;
- WBUFW(buf,0)=0x109;
- WBUFW(buf,2)=len+8;
- WBUFL(buf,4)=account_id;
- safestrncpy((char *)WBUFP(buf,8), mes, len);
- clif->send(buf,len+8,&sd->bl,PARTY);
+ WBUFW(buf,0) = 0x109;
+ WBUFW(buf,2) = len+9;
+ WBUFL(buf,4) = account_id;
+ safestrncpy(WBUFP(buf,8), mes, len+1);
+ clif->send(buf, len+9, &sd->bl, PARTY);
}
}
@@ -6998,21 +7136,31 @@ void clif_devotion(struct block_list *src, struct map_session_data *tsd)
if( src->type == BL_MER )
{
struct mercenary_data *md = BL_CAST(BL_MER,src);
+ int skill_lvl;
if( md && md->master && md->devotion_flag )
WBUFL(buf,6) = md->master->bl.id;
- WBUFW(buf,26) = skill->get_range2(src, ML_DEVOTION, mercenary->checkskill(md, ML_DEVOTION));
+ skill_lvl = mercenary->checkskill(md, ML_DEVOTION);
+ if (skill_lvl > 0)
+ WBUFW(buf, 26) = skill->get_range2(src, ML_DEVOTION, skill_lvl);
+ else
+ WBUFW(buf, 26) = 0;
}
else
{
int i;
struct map_session_data *sd = BL_CAST(BL_PC,src);
+ int skill_lvl;
if( sd == NULL )
return;
for( i = 0; i < MAX_PC_DEVOTION; i++ )
WBUFL(buf,6+4*i) = sd->devotion[i];
- WBUFW(buf,26) = skill->get_range2(src, CR_DEVOTION, pc->checkskill(sd, CR_DEVOTION));
+ skill_lvl = pc->checkskill(sd, CR_DEVOTION);
+ if (skill_lvl > 0)
+ WBUFW(buf, 26) = skill->get_range2(src, CR_DEVOTION, skill_lvl);
+ else
+ WBUFW(buf, 26) = 0;
}
if( tsd )
@@ -7112,6 +7260,13 @@ void clif_mvp_item(struct map_session_data *sd,int nameid)
/// 010b <exp>.L
void clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
{
+#if PACKETVER >= 20131223 // Kro removed this packet [Napster]
+ if (battle_config.mvp_exp_reward_message) {
+ char e_msg[CHAT_SIZE_MAX];
+ sprintf(e_msg, msg_txt(855), exp);
+ clif->messagecolor_self(sd->fd, COLOR_CYAN, e_msg); // Congratulations! You are the MVP! Your reward EXP Points are %u !!
+ }
+#else
int fd;
nullpo_retv(sd);
@@ -7121,6 +7276,7 @@ void clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
WFIFOW(fd,0)=0x10b;
WFIFOL(fd,2)=cap_value(exp,0,INT32_MAX);
WFIFOSET(fd,packet_len(0x10b));
+#endif
}
/// Dropped MVP item reward message (ZC_THROW_MVPITEM).
@@ -7303,7 +7459,7 @@ void clif_guild_basicinfo(struct map_session_data *sd) {
memcpy(WFIFOP(fd,46),g->name, NAME_LENGTH);
memcpy(WFIFOP(fd,70),g->master, NAME_LENGTH);
- safestrncpy((char*)WFIFOP(fd,94),msg_sd(sd,300+guild->checkcastles(g)),16); // "'N' castles"
+ safestrncpy(WFIFOP(fd,94),msg_sd(sd,300+guild->checkcastles(g)),16); // "'N' castles"
WFIFOL(fd,110) = 0; // zeny
WFIFOSET(fd,packet_len(0x1b6));
@@ -7366,7 +7522,7 @@ void clif_guild_memberlist(struct map_session_data *sd)
WFIFOW(fd,c*104+12)=m->hair;
WFIFOW(fd,c*104+14)=m->hair_color;
WFIFOW(fd,c*104+16)=m->gender;
- WFIFOW(fd,c*104+18)=m->class_;
+ WFIFOW(fd,c*104+18)=m->class;
WFIFOW(fd,c*104+20)=m->lv;
WFIFOL(fd,c*104+22)=(int)cap_value(m->exp,0,INT32_MAX);
WFIFOL(fd,c*104+26)=m->online;
@@ -7546,7 +7702,7 @@ void clif_guild_skillinfo(struct map_session_data* sd)
WFIFOW(fd, p + 8) = 0;
WFIFOW(fd, p + 10) = 0;
}
- safestrncpy((char*)WFIFOP(fd,p+12), skill->get_name(id), NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,p+12), skill->get_name(id), NAME_LENGTH);
WFIFOB(fd,p+36)= (g->skill[i].lv < guild->skill_get_max(id) && sd == g->member[0].sd) ? 1 : 0;
c++;
}
@@ -7647,8 +7803,8 @@ void clif_guild_expulsion(struct map_session_data* sd, const char* name, const c
nullpo_retv(mes);
WBUFW(buf,0) = cmd;
- safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH);
- safestrncpy((char*)WBUFP(buf,26), mes, 40);
+ safestrncpy(WBUFP(buf,2), name, NAME_LENGTH);
+ safestrncpy(WBUFP(buf,26), mes, 40);
#if PACKETVER < 20100803
memset(WBUFP(buf,66), 0, NAME_LENGTH); // account name (not used for security reasons)
#endif
@@ -7715,7 +7871,7 @@ void clif_guild_message(struct guild *g,int account_id,const char *mes,int len)
WBUFW(buf, 0) = 0x17f;
WBUFW(buf, 2) = len + 5;
- safestrncpy((char*)WBUFP(buf,4), mes, len+1);
+ safestrncpy(WBUFP(buf,4), mes, len+1);
if ((sd = guild->getavailablesd(g)) != NULL)
clif->send(buf, WBUFW(buf,2), &sd->bl, GUILD_NOBG);
@@ -7859,7 +8015,7 @@ void clif_talkiebox(struct block_list* bl, const char* talkie)
WBUFW(buf,0) = 0x191;
WBUFL(buf,2) = bl->id;
- safestrncpy((char*)WBUFP(buf,6),talkie,MESSAGE_SIZE);
+ safestrncpy(WBUFP(buf,6),talkie,MESSAGE_SIZE);
clif->send(buf,packet_len(0x191),bl,AREA);
}
@@ -7942,7 +8098,7 @@ void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_sess
WFIFOW(fd,0) = 0x1e2;
WFIFOL(fd,2) = ssd->status.account_id;
WFIFOL(fd,6) = ssd->status.char_id;
- safestrncpy((char*)WFIFOP(fd,10), ssd->status.name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,10), ssd->status.name, NAME_LENGTH);
WFIFOSET(fd, packet_len(0x1e2));
}
*/
@@ -7950,24 +8106,26 @@ void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_sess
/*==========================================
* Displays a message using the guild-chat colors to the specified targets. [Skotlex]
*------------------------------------------*/
-void clif_disp_message(struct block_list* src, const char* mes, size_t len, enum send_target target)
+void clif_disp_message(struct block_list *src, const char *mes, enum send_target target)
{
unsigned char buf[256];
+ int len;
+
+ nullpo_retv(mes);
+ nullpo_retv(src);
+ len = (int)strlen(mes);
if (len == 0)
return;
- nullpo_retv(src);
- nullpo_retv(mes);
-
- if (len > sizeof(buf)-5) {
- ShowWarning("clif_disp_message: Truncated message '%s' (len=%"PRIuS", max=%"PRIuS", aid=%d).\n", mes, len, sizeof(buf)-5, src->id);
- len = sizeof(buf)-5;
+ if (len > (int)sizeof(buf)-5) {
+ ShowWarning("clif_disp_message: Truncated message '%s' (len=%d, max=%"PRIuS", aid=%d).\n", mes, len, sizeof(buf)-5, src->id);
+ len = (int)sizeof(buf)-5;
}
WBUFW(buf, 0) = 0x17f;
WBUFW(buf, 2) = len + 5;
- safestrncpy((char*)WBUFP(buf,4), mes, len+1);
+ safestrncpy(WBUFP(buf,4), mes, len+1);
clif->send(buf, WBUFW(buf,2), src, target);
}
@@ -8041,7 +8199,7 @@ void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd,
WFIFOHEAD(fd,packet_len(0x14b));
WFIFOW(fd,0) = 0x14b;
WFIFOB(fd,2) = type;
- safestrncpy((char*)WFIFOP(fd,3), sd->status.name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,3), sd->status.name, NAME_LENGTH);
WFIFOSET(fd, packet_len(0x14b));
}
@@ -8099,7 +8257,7 @@ void clif_playBGM(struct map_session_data* sd, const char* name)
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x7fe));
WFIFOW(fd,0) = 0x7fe;
- safestrncpy((char*)WFIFOP(fd,2), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2), name, NAME_LENGTH);
WFIFOSET(fd,packet_len(0x7fe));
}
@@ -8127,7 +8285,7 @@ void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x1d3));
WFIFOW(fd,0) = 0x1d3;
- safestrncpy((char*)WFIFOP(fd,2), name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2), name, NAME_LENGTH);
WFIFOB(fd,26) = type;
WFIFOL(fd,27) = 0;
WFIFOL(fd,31) = bl->id;
@@ -8142,7 +8300,7 @@ void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum
nullpo_retv(name);
WBUFW(buf,0) = 0x1d3;
- safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH);
+ safestrncpy(WBUFP(buf,2), name, NAME_LENGTH);
WBUFB(buf,26) = type;
WBUFL(buf,27) = 0;
WBUFL(buf,31) = bl->id;
@@ -8167,7 +8325,7 @@ void clif_specialeffect(struct block_list* bl, int type, enum send_target target
clif->send(buf, packet_len(0x1f3), bl, target);
- if (disguised(bl)) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
clif->send(buf, packet_len(0x1f3), bl, SELF);
}
@@ -8199,8 +8357,7 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen
clif->send(buf, packet_len(0x284), bl, target);
- if( disguised(bl) )
- {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
clif->send(buf, packet_len(0x284), bl, SELF);
}
@@ -8216,17 +8373,18 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen
*/
void clif_messagecolor_self(int fd, uint32 color, const char *msg)
{
- size_t msg_len;
+ int msg_len;
nullpo_retv(msg);
- msg_len = strlen(msg) + 1;
+ msg_len = (int)strlen(msg) + 1;
+ Assert_retv(msg_len <= INT16_MAX - 12);
WFIFOHEAD(fd,msg_len + 12);
WFIFOW(fd,0) = 0x2C1;
WFIFOW(fd,2) = msg_len + 12;
WFIFOL(fd,4) = 0;
WFIFOL(fd,8) = RGB2BGR(color);
- safestrncpy((char*)WFIFOP(fd,12), msg, msg_len);
+ safestrncpy(WFIFOP(fd,12), msg, msg_len);
WFIFOSET(fd, msg_len + 12);
}
@@ -8239,17 +8397,19 @@ void clif_messagecolor_self(int fd, uint32 color, const char *msg)
* @param color Message color (RGB format: 0xRRGGBB)
* @param msg Message text
*/
-void clif_messagecolor(struct block_list* bl, uint32 color, const char *msg)
+void clif_messagecolor(struct block_list *bl, uint32 color, const char *msg)
{
- size_t msg_len = strlen(msg) + 1;
+ int msg_len;
uint8 buf[256];
nullpo_retv(bl);
nullpo_retv(msg);
- if (msg_len > sizeof(buf)-12) {
- ShowWarning("clif_messagecolor: Truncating too long message '%s' (len=%"PRIuS").\n", msg, msg_len);
- msg_len = sizeof(buf)-12;
+ msg_len = (int)strlen(msg) + 1;
+
+ if (msg_len > (int)sizeof(buf)-12) {
+ ShowWarning("clif_messagecolor: Truncating too long message '%s' (len=%d).\n", msg, msg_len);
+ msg_len = (int)sizeof(buf)-12;
}
WBUFW(buf,0) = 0x2C1;
@@ -8272,9 +8432,11 @@ void clif_refresh_storagewindow(struct map_session_data *sd)
nullpo_retv(sd);
// Notify the client that the storage is open
if (sd->state.storage_flag == STORAGE_FLAG_NORMAL) {
- storage->sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
- clif->storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
- clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
+ if (sd->storage.aggregate > 0) {
+ storage->sortitem(VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item));
+ clif->storagelist(sd, VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item));
+ }
+ clif->updatestorageamount(sd, sd->storage.aggregate, MAX_STORAGE);
}
// Notify the client that the gstorage is open otherwise it will
// remain locked forever and nobody will be able to access it
@@ -8329,7 +8491,7 @@ void clif_refresh(struct map_session_data *sd)
clif->elemental_info(sd);
map->foreachinrange(clif->getareachar,&sd->bl,AREA_SIZE,BL_ALL,sd);
clif->weather_check(sd);
- if( sd->chatID )
+ if (sd->chat_id != 0)
chat->leave(sd, false);
if( sd->state.vending )
clif->openvending(sd, sd->bl.id, sd->vending);
@@ -8345,7 +8507,7 @@ void clif_refresh(struct map_session_data *sd)
mail->clear(sd);
- if( disguised(&sd->bl) ) {/* refresh-da */
+ if (clif->isdisguised(&sd->bl)) {/* refresh-da */
short disguise = sd->disguise;
pc->disguise(sd, -1);
pc->disguise(sd, disguise);
@@ -8475,7 +8637,7 @@ void clif_charnameack (int fd, struct block_list *bl)
memcpy(WBUFP(buf,6), BL_UCCAST(BL_ELEM, bl)->db->name, NAME_LENGTH);
break;
default:
- ShowError("clif_charnameack: bad type %d(%d)\n", bl->type, bl->id);
+ ShowError("clif_charnameack: bad type %u(%d)\n", bl->type, bl->id);
return;
}
@@ -8560,8 +8722,7 @@ void clif_slide(struct block_list *bl, int x, int y)
WBUFW(buf, 8) = y;
clif->send(buf, packet_len(0x1ff), bl, AREA);
- if( disguised(bl) )
- {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
clif->send(buf, packet_len(0x1ff), bl, SELF);
}
@@ -8569,34 +8730,33 @@ void clif_slide(struct block_list *bl, int x, int y)
/// Public chat message (ZC_NOTIFY_CHAT). lordalfa/Skotlex - used by @me as well
/// 008d <packet len>.W <id>.L <message>.?B
-void clif_disp_overhead(struct block_list *bl, const char* mes)
+void clif_disp_overhead(struct block_list *bl, const char *mes)
{
unsigned char buf[256]; //This should be more than sufficient, the theoretical max is CHAT_SIZE + 8 (pads and extra inserted crap)
- size_t len_mes;
+ int mes_len;
nullpo_retv(bl);
nullpo_retv(mes);
- len_mes = strlen(mes)+1; //Account for \0
+ mes_len = (int)strlen(mes)+1; //Account for \0
- if (len_mes > sizeof(buf)-8) {
- ShowError("clif_disp_overhead: Message too long (length %"PRIuS")\n", len_mes);
- len_mes = sizeof(buf)-8; //Trunk it to avoid problems.
+ if (mes_len > (int)sizeof(buf)-8) {
+ ShowError("clif_disp_overhead: Message too long (length %d)\n", mes_len);
+ mes_len = sizeof(buf)-8; //Trunk it to avoid problems.
}
// send message to others
WBUFW(buf,0) = 0x8d;
- WBUFW(buf,2) = len_mes + 8; // len of message + 8 (command+len+id)
+ WBUFW(buf,2) = mes_len + 8; // len of message + 8 (command+len+id)
WBUFL(buf,4) = bl->id;
- safestrncpy((char*)WBUFP(buf,8), mes, len_mes);
+ safestrncpy(WBUFP(buf,8), mes, mes_len);
clif->send(buf, WBUFW(buf,2), bl, AREA_CHAT_WOC);
// send back message to the speaker
- if( bl->type == BL_PC ) {
+ if (bl->type == BL_PC) {
WBUFW(buf,0) = 0x8e;
- WBUFW(buf, 2) = len_mes + 4;
- safestrncpy((char*)WBUFP(buf,4), mes, len_mes);
+ WBUFW(buf, 2) = mes_len + 4;
+ safestrncpy(WBUFP(buf,4), mes, mes_len);
clif->send(buf, WBUFW(buf,2), bl, SELF);
}
-
}
/*==========================
@@ -8680,7 +8840,7 @@ void clif_starskill(struct map_session_data* sd, const char* mapname, int monste
WFIFOHEAD(fd,packet_len(0x20e));
WFIFOW(fd,0) = 0x20e;
- safestrncpy((char*)WFIFOP(fd,2), mapname, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,2), mapname, NAME_LENGTH);
WFIFOL(fd,26) = monster_id;
WFIFOB(fd,30) = star;
WFIFOB(fd,31) = result;
@@ -8795,7 +8955,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
safestrncpy(viewequip_list.characterName, tsd->status.name, NAME_LENGTH);
- viewequip_list.job = tsd->status.class_;
+ viewequip_list.job = tsd->status.class;
viewequip_list.head = tsd->vd.hair_style;
viewequip_list.accessory = tsd->vd.head_bottom;
viewequip_list.accessory2 = tsd->vd.head_mid;
@@ -8880,119 +9040,153 @@ void clif_msgtable_skill(struct map_session_data* sd, uint16 skill_id, int msg_i
WFIFOSET(fd, packet_len(0x7e6));
}
-/// Validates one global/guild/party/whisper message packet and tries to recognize its components.
-/// Returns true if the packet was parsed successfully.
-/// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00
-/// 1 - <packet id>.w <packet len>.w <name>.24B <message>.?B 00
-bool clif_process_message(struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) {
- char *text, *name, *message;
- unsigned int packetlen, textlen;
- size_t namelen, messagelen;
- int fd = sd->fd;
+/**
+ * Validates and processes a global/guild/party message packet.
+ *
+ * @param[in] sd The source character.
+ * @param[in] packet The packet data.
+ * @param[out] out_buf The output buffer (must be a valid buffer), that will
+ * be filled with "Name : Message".
+ * @param[in] out_buflen The size of out_buf (including the NUL terminator).
+ * @return a pointer to the "Message" part of out_buf.
+ * @retval NULL if the validation failed, the messages was a command or the
+ * character can't send chat messages. out_buf shan't be used.
+ */
+const char *clif_process_chat_message(struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen)
+{
+ const char *srcname = NULL, *srcmessage = NULL, *message = NULL;
+ int textlen = 0, namelen = 0, messagelen = 0;
- nullpo_retr(false, sd);
- nullpo_retr(false, name_);
- nullpo_retr(false, namelen_);
- nullpo_retr(false, message_);
- nullpo_retr(false, messagelen_);
-
- *name_ = NULL;
- *namelen_ = 0;
- *message_ = NULL;
- *messagelen_ = 0;
-
- packetlen = RFIFOW(fd,2);
- // basic structure checks
- if (packetlen < 4 + 1) {
+ nullpo_ret(sd);
+ nullpo_ret(packet);
+ nullpo_ret(out_buf);
+
+ if (packet->packet_len < 4 + 1) {
// 4-byte header and at least an empty string is expected
- ShowWarning("clif_process_message: Received malformed packet from player '%s' (no message data)!\n", sd->status.name);
- return false;
+ ShowWarning("clif_process_chat_message: Received malformed packet from player '%s' (no message data)!\n", sd->status.name);
+ return NULL;
}
- text = (char*)RFIFOP(fd,4);
- textlen = packetlen - 4;
+#if PACKETVER >= 20151001
+ // Packet doesn't include a NUL terminator
+ textlen = packet->packet_len - 4;
+#else // PACKETVER < 20151001
+ // Packet includes a NUL terminator
+ textlen = packet->packet_len - 4 - 1;
+#endif // PACKETVER > 20151001
- // process <name> part of the packet
- if( format == 0 )
- {// name and message are separated by ' : '
- // validate name
- name = text;
- namelen = strnlen(sd->status.name, NAME_LENGTH-1); // name length (w/o zero byte)
+ // name and message are separated by ' : '
+ srcname = packet->message;
+ namelen = (int)strnlen(sd->status.name, NAME_LENGTH-1); // name length (w/o zero byte)
- if( strncmp(name, sd->status.name, namelen) || // the text must start with the speaker's name
- name[namelen] != ' ' || name[namelen+1] != ':' || name[namelen+2] != ' ' ) // followed by ' : '
- {
- //Hacked message, or infamous "client desynchronize" issue where they pick one char while loading another.
- ShowWarning("clif_process_message: Player '%s' sent a message using an incorrect name! Forcing a relog...\n", sd->status.name);
- sockt->eof(fd); // Just kick them out to correct it.
- return false;
- }
+ if (strncmp(srcname, sd->status.name, namelen) != 0 // the text must start with the speaker's name
+ || srcname[namelen] != ' ' || srcname[namelen+1] != ':' || srcname[namelen+2] != ' ' // followed by ' : '
+ ) {
+ //Hacked message, or infamous "client desynchronize" issue where they pick one char while loading another.
+ ShowWarning("clif_process_chat_message: Player '%s' sent a message using an incorrect name! Forcing a relog...\n", sd->status.name);
+ sockt->eof(sd->fd); // Just kick them out to correct it.
+ return NULL;
+ }
- message = name + namelen + 3;
- messagelen = textlen - namelen - 3; // this should be the message length (w/ zero byte included)
+ srcmessage = packet->message + namelen + 3; // <name> " : " <message>
+ messagelen = textlen - namelen - 3;
+
+ if (messagelen >= CHAT_SIZE_MAX || textlen >= out_buflen) {
+ // messages mustn't be too long
+ // Normally you can only enter CHATBOX_SIZE-1 letters into the chat box, but Frost Joke / Dazzler's text can be longer.
+ // Also, the physical size of strings that use multibyte encoding can go multiple times over the chatbox capacity.
+ // Neither the official client nor server place any restriction on the length of the data in the packet,
+ // but we'll only allow reasonably long strings here. This also makes sure that they fit into the `chatlog` table.
+ ShowWarning("clif_process_chat_message: Player '%s' sent a message too long ('%.*s')!\n", sd->status.name, CHATBOX_SIZE-1, srcmessage);
+ return NULL;
}
- else
- {// name has fixed width
- if( textlen < NAME_LENGTH + 1 )
- {
- ShowWarning("clif_process_message: Received malformed packet from player '%s' (packet length is incorrect)!\n", sd->status.name);
- return false;
- }
- // validate name
- name = text;
- namelen = strnlen(name, NAME_LENGTH-1); // name length (w/o zero byte)
+ safestrncpy(out_buf, packet->message, textlen+1); // [!] packet->message is not necessarily NUL terminated
+ message = out_buf + namelen + 3;
- if (name[namelen] != '\0') {
- // only restriction is that the name must be zero-terminated
- ShowWarning("clif_process_message: Player '%s' sent an unterminated name!\n", sd->status.name);
- return false;
- }
+ if (!pc->process_chat_message(sd, message))
+ return NULL;
+ return message;
+}
- message = name + NAME_LENGTH;
- messagelen = textlen - NAME_LENGTH; // this should be the message length (w/ zero byte included)
- }
+/**
+ * Validates and processes a whisper message packet.
+ *
+ * @param[in] sd The source character.
+ * @param[in] packet The packet data.
+ * @param[out] out_name The parsed target name buffer (must be a valid
+ * buffer of size NAME_LENGTH).
+ * @param[out] out_message The output message buffer (must be a valid buffer).
+ * @param[in] out_messagelen The size of out_message.
+ * @retval true if the validation succeeded and the message is a chat message.
+ * @retval false if the validation failed, the messages was a command or the
+ * character can't send chat messages. out_name and out_message
+ * shan't be used.
+ */
+bool clif_process_whisper_message(struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen)
+{
+ int namelen = 0, messagelen = 0;
- if (messagelen != strnlen(message, messagelen)+1) {
- // the declared length must match real length
- ShowWarning("clif_process_message: Received malformed packet from player '%s' (length is incorrect)!\n", sd->status.name);
+ nullpo_retr(false, sd);
+ nullpo_retr(false, packet);
+ nullpo_retr(false, out_name);
+ nullpo_retr(false, out_message);
+
+ if (packet->packet_len < NAME_LENGTH + 4 + 1) {
+ // 4-byte header and at least an empty string is expected
+ ShowWarning("clif_process_whisper_message: Received malformed packet from player '%s' (packet length is incorrect)!\n", sd->status.name);
return false;
}
- // verify <message> part of the packet
- if (message[messagelen-1] != '\0') {
- // message must be zero-terminated
- ShowWarning("clif_process_message: Player '%s' sent an unterminated message string!\n", sd->status.name);
+
+ // validate name
+ namelen = (int)strnlen(packet->name, NAME_LENGTH-1); // name length (w/o zero byte)
+
+ if (packet->name[namelen] != '\0') {
+ // only restriction is that the name must be zero-terminated
+ ShowWarning("clif_process_whisper_message: Player '%s' sent an unterminated name!\n", sd->status.name);
return false;
}
- if (messagelen > CHAT_SIZE_MAX-1) {
+
+#if PACKETVER >= 20151001
+ // Packet doesn't include a NUL terminator
+ messagelen = packet->packet_len - NAME_LENGTH - 4;
+#else // PACKETVER < 20151001
+ // Packet includes a NUL terminator
+ messagelen = packet->packet_len - NAME_LENGTH - 4 - 1;
+#endif // PACKETVER > 20151001
+
+ if (messagelen >= CHAT_SIZE_MAX || messagelen >= out_messagelen) {
// messages mustn't be too long
// Normally you can only enter CHATBOX_SIZE-1 letters into the chat box, but Frost Joke / Dazzler's text can be longer.
// Also, the physical size of strings that use multibyte encoding can go multiple times over the chatbox capacity.
// Neither the official client nor server place any restriction on the length of the data in the packet,
// but we'll only allow reasonably long strings here. This also makes sure that they fit into the `chatlog` table.
- ShowWarning("clif_process_message: Player '%s' sent a message too long ('%.*s')!\n", sd->status.name, CHAT_SIZE_MAX-1, message);
+ ShowWarning("clif_process_whisper_message: Player '%s' sent a message too long ('%.*s')!\n", sd->status.name, CHAT_SIZE_MAX-1, packet->message);
return false;
}
- *name_ = name;
- *namelen_ = namelen;
- *message_ = message;
- *messagelen_ = messagelen;
+ safestrncpy(out_name, packet->name, namelen+1); // [!] packet->name is not NUL terminated
+ safestrncpy(out_message, packet->message, messagelen+1); // [!] packet->message is not necessarily NUL terminated
+
+ if (!pc->process_chat_message(sd, out_message))
+ return false;
+
return true;
}
void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, char *msg)
{
- DBIterator *iter;
+ struct DBIterator *iter;
struct map_session_data *user;
- unsigned short msg_len;
+ int msg_len;
uint32 color;
nullpo_retv(chan);
nullpo_retv(sd);
nullpo_retv(msg);
iter = db_iterator(chan->users);
- msg_len = strlen(msg) + 1;
+ msg_len = (int)strlen(msg) + 1;
+ Assert_retv(msg_len <= INT16_MAX - 12);
color = channel->config->colors[chan->color];
WFIFOHEAD(sd->fd,msg_len + 12);
@@ -9000,7 +9194,7 @@ void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, ch
WFIFOW(sd->fd,2) = msg_len + 12;
WFIFOL(sd->fd,4) = 0;
WFIFOL(sd->fd,8) = RGB2BGR(color);
- safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);
+ safestrncpy(WFIFOP(sd->fd,12), msg, msg_len);
for (user = dbi_first(iter); dbi_exists(iter); user = dbi_next(iter)) {
if( user->fd == sd->fd )
@@ -9017,23 +9211,24 @@ void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, ch
void clif_channel_msg2(struct channel_data *chan, char *msg)
{
- DBIterator *iter;
+ struct DBIterator *iter;
struct map_session_data *user;
unsigned char buf[210];
- unsigned short msg_len;
+ int msg_len;
uint32 color;
nullpo_retv(chan);
nullpo_retv(msg);
iter = db_iterator(chan->users);
- msg_len = strlen(msg) + 1;
+ msg_len = (int)strlen(msg) + 1;
+ Assert_retv(msg_len <= INT16_MAX - 12);
color = channel->config->colors[chan->color];
WBUFW(buf,0) = 0x2C1;
WBUFW(buf,2) = msg_len + 12;
WBUFL(buf,4) = 0;
WBUFL(buf,8) = RGB2BGR(color);
- safestrncpy((char*)WBUFP(buf,12), msg, msg_len);
+ safestrncpy(WBUFP(buf,12), msg, msg_len);
for (user = dbi_first(iter); dbi_exists(iter); user = dbi_next(iter)) {
WFIFOHEAD(user->fd,msg_len + 12);
@@ -9148,7 +9343,7 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
sd->state.warping = 0;
sd->state.dialog = 0;/* reset when warping, client dialog will go missing */
- // look
+ // Character Looks
#if PACKETVER < 4
clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
@@ -9158,21 +9353,26 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
if(sd->vd.cloth_color)
clif->refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
+
if (sd->vd.body_style)
clif->refreshlook(&sd->bl,sd->bl.id,LOOK_BODY2,sd->vd.body_style,SELF);
- // item
- clif->inventorylist(sd); // inventory list first, otherwise deleted items in pc->checkitem show up as 'unknown item'
- pc->checkitem(sd);
- // cart
+ // Send character inventory to the client.
+ // call this before pc->checkitem() so that the client isn't called to delete a non-existent item.
+ clif->inventorylist(sd);
+
+ // Send the cart inventory, counts & weight to the client.
if(pc_iscarton(sd)) {
clif->cartlist(sd);
- clif->updatestatus(sd,SP_CARTINFO);
+ clif->updatestatus(sd, SP_CARTINFO);
}
- // weight
- clif->updatestatus(sd,SP_WEIGHT);
- clif->updatestatus(sd,SP_MAXWEIGHT);
+ // Check for and delete unavailable/disabled items.
+ pc->checkitem(sd);
+
+ // Send the character's weight to the client.
+ clif->updatestatus(sd, SP_WEIGHT);
+ clif->updatestatus(sd, SP_MAXWEIGHT);
// guild
// (needs to go before clif_spawn() to show guild emblems correctly)
@@ -9392,7 +9592,7 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
if( map->list[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) {
char output[128];
sprintf(output, "[ Kill Steal Protection Disabled. KS is allowed in this map ]");
- clif->broadcast(&sd->bl, output, strlen(output) + 1, BC_BLUE, SELF);
+ clif->broadcast(&sd->bl, output, (int)strlen(output) + 1, BC_BLUE, SELF);
}
map->iwall_get(sd); // Updates Walls Info on this Map to Client
@@ -9459,7 +9659,8 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
clif->clearunit_area(&sd->bl, CLR_DEAD);
else {
skill->usave_trigger(sd);
- sd->ud.dir = 0;/* enforce north-facing (not visually, virtually) */
+ if (battle_config.player_warp_keep_direction == 1)
+ clif->changed_dir(&sd->bl, SELF); // Visually updates player facing direction
}
// Trigger skill effects if you appear standing on them
@@ -9474,7 +9675,7 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) {
struct questinfo *qi = &map->list[sd->bl.m].qi_data[i];
if( quest->check(sd, qi->quest_id, HAVEQUEST) == -1 ) {// Check if quest is not started
if( qi->hasJob ) { // Check if quest is job-specific, check is user is said job class.
- if( sd->class_ == qi->job )
+ if (sd->status.class == qi->job)
clif->quest_show_event(sd, &qi->nd->bl, qi->icon, qi->color);
} else {
clif->quest_show_event(sd, &qi->nd->bl, qi->icon, qi->color);
@@ -9665,11 +9866,9 @@ void clif_parse_QuitGame(int fd, struct map_session_data *sd) __attribute__((non
void clif_parse_QuitGame(int fd, struct map_session_data *sd)
{
/* Rovert's prevent logout option fixed [Valaris] */
- if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] &&
- (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )
- {
+ if (!sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] && !sd->sc.data[SC_SUHIDE] &&
+ (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)) {
sockt->eof(fd);
-
clif->disconnect_ack(sd, 0);
} else {
clif->disconnect_ack(sd, 1);
@@ -9699,7 +9898,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
// 'see people in GM hide' cheat detection
#if 0 /* disabled due to false positives (network lag + request name of char that's about to hide = race condition) */
sc = status->get_sc(bl);
- if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) &&
+ if (sc && sc->option&OPTION_INVISIBLE && !clif->isdisguised(bl) &&
bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple
pc_get_group_level(sd) < battle_config.hack_info_GM_level
) {
@@ -9718,149 +9917,114 @@ int clif_undisguise_timer(int tid, int64 tick, int id, intptr_t data) {
struct map_session_data * sd;
if( (sd = map->id2sd(id)) ) {
sd->fontcolor_tid = INVALID_TIMER;
- if( sd->fontcolor && sd->disguise == sd->status.class_ )
+ if (sd->fontcolor && sd->disguise == sd->status.class)
pc->disguise(sd,-1);
}
return 0;
}
-void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-/// Validates and processes global messages
-/// 008c <packet len>.W <text>.?B (<name> : <message>) 00 (CZ_REQUEST_CHAT)
-/// There are various variants of this packet.
-void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
+/**
+ * Validates and processed global messages.
+ *
+ * There are various variants of this packet.
+ *
+ * @code
+ * 008c <packet len>.W <text>.?B (<name> : <message>) 00 (CZ_REQUEST_CHAT)
+ * @endcode
+ *
+ * @param fd The incoming file descriptor.
+ * @param sd The related character.
+ */
+void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+void clif_parse_GlobalMessage(int fd, struct map_session_data *sd)
{
- const char* text = (char*)RFIFOP(fd,4);
- size_t textlen = RFIFOW(fd,2) - 4;
-
- char *name, *message, *fakename = NULL;
- size_t namelen, messagelen;
+ const struct packet_chat_message *packet = NULL;
+ char full_message[CHAT_SIZE_MAX + NAME_LENGTH + 3 + 1];
+ const char *message = NULL;
+ bool is_fakename = false;
+ int outlen = 0;
- bool is_fake;
-
- // validate packet and retrieve name and message
- if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
+ packet = RP2PTR(fd);
+ message = clif->process_chat_message(sd, packet, full_message, sizeof full_message);
+ if (message == NULL)
return;
- if( atcommand->exec(fd, sd, message, true) )
- return;
+ pc->check_supernovice_call(sd, message);
- if( !pc->can_talk(sd) )
+ if (sd->gcbind != NULL) {
+ channel->send(sd->gcbind, sd, message);
return;
-
- if( battle_config.min_chat_delay ) { //[Skotlex]
- if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
- return;
- sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
}
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE ) {
- unsigned int next = pc->nextbaseexp(sd);
- if( next == 0 ) next = pc->thisbaseexp(sd);
- if( next ) { // 0%, 10%, 20%, ...
- int percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. );
- if( (battle_config.snovice_call_type || percent) && ( percent%100 ) == 0 ) {// 10.0%, 20.0%, ..., 90.0%
- switch (sd->state.snovice_call_flag) {
- case 0:
- if( strstr(message, msg_txt(1479)) ) // "Dear angel, can you hear my voice?"
- sd->state.snovice_call_flag = 1;
- break;
- case 1: {
- char buf[256];
- snprintf(buf, 256, msg_txt(1480), sd->status.name);
- if( strstr(message, buf) ) // "I am %s Super Novice~"
- sd->state.snovice_call_flag = 2;
- }
- break;
- case 2:
- if( strstr(message, msg_txt(1481)) ) // "Help me out~ Please~ T_T"
- sd->state.snovice_call_flag = 3;
- break;
- case 3:
- sc_start(NULL,&sd->bl, status->skill2sc(MO_EXPLOSIONSPIRITS), 100, 17, skill->get_time(MO_EXPLOSIONSPIRITS, 5)); //Lv17-> +50 critical (noted by Poki) [Skotlex]
- clif->skill_nodamage(&sd->bl, &sd->bl, MO_EXPLOSIONSPIRITS, 5, 1); // prayer always shows successful Lv5 cast and disregards noskill restrictions
- sd->state.snovice_call_flag = 0;
- break;
- }
- }
- }
+ if (sd->fakename[0] != '\0') {
+ is_fakename = true;
+ outlen = (int)strlen(sd->fakename) + (int)strlen(message) + 3 + 1;
+ } else {
+ outlen = (int)strlen(full_message) + 1;
}
- pc->update_idle_time(sd, BCIDLE_CHAT);
-
- if( sd->gcbind ) {
- channel->send(sd->gcbind,sd,message);
- return;
- } else if ( sd->fontcolor && !sd->chatID ) {
- char mout[200];
- unsigned char mylen = 1;
+ if (sd->fontcolor != 0 && sd->chat_id == 0) {
uint32 color = 0;
- if( sd->disguise == -1 ) {
+ if (sd->disguise == -1) {
sd->fontcolor_tid = timer->add(timer->gettick()+5000, clif->undisguise_timer, sd->bl.id, 0);
- pc->disguise(sd,sd->status.class_);
- if( pc_isdead(sd) )
+ pc->disguise(sd,sd->status.class);
+ if (pc_isdead(sd))
clif->clearunit_single(-sd->bl.id, CLR_DEAD, sd->fd);
- if( unit->is_walking(&sd->bl) )
+ if (unit->is_walking(&sd->bl))
clif->move(&sd->ud);
- } else if ( sd->disguise == sd->status.class_ && sd->fontcolor_tid != INVALID_TIMER ) {
+ } else if (sd->disguise == sd->status.class && sd->fontcolor_tid != INVALID_TIMER) {
const struct TimerData *td;
- if( (td = timer->get(sd->fontcolor_tid)) ) {
+ if ((td = timer->get(sd->fontcolor_tid)) != NULL)
timer->settick(sd->fontcolor_tid, td->tick+5000);
- }
}
- mylen += snprintf(mout, 200, "%s : %s",sd->fakename[0]?sd->fakename:sd->status.name,message);
-
color = channel->config->colors[sd->fontcolor - 1];
- WFIFOHEAD(fd,mylen + 12);
+ WFIFOHEAD(fd, outlen + 12);
WFIFOW(fd,0) = 0x2C1;
- WFIFOW(fd,2) = mylen + 12;
+ WFIFOW(fd,2) = outlen + 12;
WFIFOL(fd,4) = sd->bl.id;
WFIFOL(fd,8) = RGB2BGR(color);
- safestrncpy((char*)WFIFOP(fd,12), mout, mylen);
+ if (is_fakename)
+ safesnprintf(WFIFOP(fd, 12), outlen, "%s : %s", sd->fakename, message);
+ else
+ safestrncpy(WFIFOP(fd, 12), full_message, outlen);
clif->send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, AREA_WOS);
WFIFOL(fd,4) = -sd->bl.id;
- WFIFOSET(fd, mylen + 12);
+ WFIFOSET(fd, outlen + 12);
return;
}
- /**
- * Fake Name Design by FatalEror (bug report #9)
- **/
- if( ( is_fake = ( sd->fakename[0] ) ) ) {
- fakename = (char*) aMalloc(strlen(sd->fakename)+messagelen+3);
- strcpy(fakename, sd->fakename);
- strcat(fakename, " : ");
- strcat(fakename, message);
- textlen = strlen(fakename) + 1;
+ {
+ // send message to others
+ void *buf = aMalloc(8 + outlen);
+ WBUFW(buf, 0) = 0x8d;
+ WBUFW(buf, 2) = 8 + outlen;
+ WBUFL(buf, 4) = sd->bl.id;
+ if (is_fakename)
+ safesnprintf(WBUFP(buf, 8), outlen, "%s : %s", sd->fakename, message);
+ else
+ safestrncpy(WBUFP(buf, 8), full_message, outlen);
+ //FIXME: chat has range of 9 only
+ clif->send(buf, WBUFW(buf, 2), &sd->bl, sd->chat_id != 0 ? CHAT_WOS : AREA_CHAT_WOC);
+ aFree(buf);
}
- // send message to others (using the send buffer for temp. storage)
- WFIFOHEAD(fd, 8 + textlen);
- WFIFOW(fd,0) = 0x8d;
- WFIFOW(fd,2) = 8 + textlen;
- WFIFOL(fd,4) = sd->bl.id;
- safestrncpy((char*)WFIFOP(fd,8), is_fake ? fakename : text, textlen);
- //FIXME: chat has range of 9 only
- clif->send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
// send back message to the speaker
- if( is_fake ) {
- WFIFOW(fd,0) = 0x8e;
- WFIFOW(fd,2) = textlen + 4;
- safestrncpy((char*)WFIFOP(fd,4), fakename, textlen);
- aFree(fakename);
- } else {
- memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
- WFIFOW(fd,0) = 0x8e;
- }
+ WFIFOHEAD(fd, 4 + outlen);
+ WFIFOW(fd, 0) = 0x8e;
+ WFIFOW(fd, 2) = 4 + outlen;
+ if (is_fakename)
+ safesnprintf(WFIFOP(fd, 4), outlen, "%s : %s", sd->fakename, message);
+ else
+ safestrncpy(WFIFOP(fd, 4), full_message, outlen);
WFIFOSET(fd, WFIFOW(fd,2));
// Chat logging type 'O' / Global Chat
logs->chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
// trigger listening npcs
- map->foreachinrange(npc_chat->sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl);
+ map->foreachinrange(npc_chat->sub, &sd->bl, AREA_SIZE, BL_NPC, full_message, strlen(full_message), &sd->bl);
}
void clif_parse_MapMove(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -9870,10 +10034,9 @@ void clif_parse_MapMove(int fd, struct map_session_data *sd) __attribute__((nonn
void clif_parse_MapMove(int fd, struct map_session_data *sd)
{
char command[MAP_NAME_LENGTH_EXT+25];
- char* map_name;
+ char map_name[MAP_NAME_LENGTH_EXT];
- map_name = (char*)RFIFOP(fd,2);
- map_name[MAP_NAME_LENGTH_EXT-1]='\0';
+ safestrncpy(map_name, RFIFOP(fd,2), MAP_NAME_LENGTH_EXT);
sprintf(command, "%cmapmove %s %d %d", atcommand->at_symbol, map_name, RFIFOW(fd,18), RFIFOW(fd,20));
atcommand->exec(fd, sd, command, true);
}
@@ -9905,7 +10068,7 @@ void clif_changed_dir(struct block_list *bl, enum send_target target)
clif->send(buf, packet_len(0x9c), bl, target);
- if (disguised(bl)) {
+ if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;
WBUFW(buf,6) = 0;
clif->send(buf, packet_len(0x9c), bl, SELF);
@@ -9937,7 +10100,7 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd)
{
int emoticon = RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[0]);
- if (battle_config.basic_skill_check == 0 || pc->checkskill(sd, NV_BASIC) >= 2) {
+ if (battle_config.basic_skill_check == 0 || pc->check_basicskill(sd, 2)) {
if (emoticon == E_MUTE) {// prevent use of the mute emote [Valaris]
clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1);
return;
@@ -9997,7 +10160,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
sd->sc.data[SC_TRICKDEAD] ||
(sd->sc.data[SC_AUTOCOUNTER] && action_type != 0x07) ||
sd->sc.data[SC_BLADESTOP] ||
- sd->sc.data[SC_DEEP_SLEEP] )
+ sd->sc.data[SC_DEEP_SLEEP] ||
+ sd->sc.data[SC_SUHIDE] )
)
return;
@@ -10024,7 +10188,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
if( sd->sc.option&OPTION_COSTUME )
return;
- if (!battle_config.sdelay_attack_enable && pc->checkskill(sd, SA_FREECAST) <= 0) {
+ if (!battle_config.sdelay_attack_enable && pc->checkskill(sd, SA_FREECAST) <= 0 && (skill->get_inf2(sd->ud.skill_id) & (INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) == 0) {
if (DIFF_TICK(tick, sd->ud.canact_tick) < 0) {
clif->skill_fail(sd, 1, USESKILL_FAIL_SKILLINTERVAL, 0);
return;
@@ -10037,7 +10201,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
}
break;
case 0x02: // sitdown
- if (battle_config.basic_skill_check && pc->checkskill(sd, NV_BASIC) < 3) {
+ if (battle_config.basic_skill_check && !pc->check_basicskill(sd, 3)) {
clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 2);
break;
}
@@ -10122,7 +10286,7 @@ void clif_parse_Restart(int fd, struct map_session_data *sd) {
case 0x01:
/* Rovert's Prevent logout option - Fixed [Valaris] */
if (!sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK]
- && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY]
+ && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] && !sd->sc.data[SC_SUHIDE]
&& (!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout)
) {
//Send to char-server for character selection.
@@ -10134,37 +10298,28 @@ void clif_parse_Restart(int fd, struct map_session_data *sd) {
}
}
-void clif_parse_WisMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-/// Validates and processes whispered messages (CZ_WHISPER).
-/// 0096 <packet len>.W <nick>.24B <message>.?B
+/**
+ * Validates and processes whispered messages (CZ_WHISPER).
+ *
+ * @code
+ * 0096 <packet len>.W <nick>.24B <message>.?B
+ * @endcode
+ *
+ * @param fd The incoming file descriptor.
+ * @param sd The related character.
+ */
+void clif_parse_WisMessage(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
void clif_parse_WisMessage(int fd, struct map_session_data* sd)
{
struct map_session_data* dstsd;
int i;
- char *target, *message;
- size_t namelen, messagelen;
-
- // validate packet and retrieve name and message
- if( !clif->process_message(sd, 1, &target, &namelen, &message, &messagelen) )
- return;
-
- if ( atcommand->exec(fd, sd, message, true) )
- return;
+ char target[NAME_LENGTH], message[CHAT_SIZE_MAX + 1];
+ const struct packet_whisper_message *packet = RP2PTR(fd);
- // Statuses that prevent the player from whispering
- if( !pc->can_talk(sd) )
+ if (!clif->process_whisper_message(sd, packet, target, message, sizeof message))
return;
- if (battle_config.min_chat_delay) { //[Skotlex]
- if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0) {
- return;
- }
- sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
- }
-
- pc->update_idle_time(sd, BCIDLE_CHAT);
-
// Chat logging type 'W' / Whisper
logs->chat(LOG_CHAT_WHISPER, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, target, message);
@@ -10172,7 +10327,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
// Lordalfa - Paperboy - To whisper NPC commands //
//-------------------------------------------------------//
if (target[0] && (strncasecmp(target,"NPC:",4) == 0) && (strlen(target) > 4)) {
- char* str = target+4; //Skip the NPC: string part.
+ const char *str = target+4; //Skip the NPC: string part.
struct npc_data *nd;
if ((nd = npc->name2id(str))) {
char split_data[NUM_WHISPER_VAR][CHAT_SIZE_MAX];
@@ -10207,7 +10362,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
return;
}
} else if( target[0] == '#' ) {
- char *chname = target;
+ const char *chname = target;
struct channel_data *chan = channel->search(chname, sd);
if (chan) {
@@ -10216,7 +10371,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
if (k < sd->channel_count || channel->join(chan, sd, "", true) == HCS_STATUS_OK) {
channel->send(chan,sd,message);
} else {
- clif->message(fd, msg_fd(fd,1402));
+ clif->message(fd, msg_fd(fd,1402)); //You're not in that channel, type '@join <#channel_name>'
}
return;
} else if (strcmpi(&chname[1], channel->config->ally_name) == 0) {
@@ -10234,7 +10389,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
// if there are 'Test' player on an other map-server and 'test' player on this map-server,
// and if we ask for 'Test', we must not contact 'test' player
// so, we send information to inter-server, which is the only one which decide (and copy correct name).
- intif->wis_message(sd, target, message, messagelen);
+ intif->wis_message(sd, target, message, (int)strlen(message));
return;
}
@@ -10248,10 +10403,10 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
}
// if player is autotrading
- if( dstsd->state.autotrade ) {
+ if (dstsd->state.autotrade) {
char output[256];
sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name);
- clif->wis_message(fd, map->wisp_server_name, output, strlen(output) + 1);
+ clif->wis_message(fd, map->wisp_server_name, output, (int)strlen(output));
return;
}
@@ -10268,22 +10423,29 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
clif->wis_end(fd, 0); // 0: success to send wisper
// Normal message
- clif->wis_message(dstsd->fd, sd->status.name, message, messagelen);
+ clif->wis_message(dstsd->fd, sd->status.name, message, (int)strlen(message));
}
-void clif_parse_Broadcast(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
+void clif_parse_Broadcast(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /b /nb (CZ_BROADCAST).
/// Request to broadcast a message on whole server.
/// 0099 <packet len>.W <text>.?B 00
-void clif_parse_Broadcast(int fd, struct map_session_data* sd) {
- char command[CHAT_SIZE_MAX+11];
- char* msg = (char*)RFIFOP(fd,4);
- unsigned int len = RFIFOW(fd,2)-4;
+void clif_parse_Broadcast(int fd, struct map_session_data *sd)
+{
+ const char commandname[] = "kami";
+ char command[sizeof commandname + 2 + CHAT_SIZE_MAX] = ""; // '@' command + ' ' + message + NUL
+ int len = (int)RFIFOW(fd,2) - 4;
+
+ if (len < 0)
+ return;
+
+ sprintf(command, "%c%s ", atcommand->at_symbol, commandname);
- // as the length varies depending on the command used, just block unreasonably long strings
- mes_len_check(msg, len, CHAT_SIZE_MAX);
+ // as the length varies depending on the command used, truncate unreasonably long strings
+ if (len >= (int)(sizeof command - strlen(command)))
+ len = (int)(sizeof command - strlen(command)) - 1;
- sprintf(command, "%ckami %s", atcommand->at_symbol, msg);
+ strncat(command, RFIFOP(fd,4), len);
atcommand->exec(fd, sd, command, true);
}
@@ -10312,6 +10474,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
sd->sc.data[SC_TRICKDEAD] ||
sd->sc.data[SC_BLADESTOP] ||
sd->sc.data[SC_CLOAKINGEXCEED] ||
+ sd->sc.data[SC_SUHIDE] ||
pc_ismuted(&sd->sc, MANNER_NOITEM)
) )
break;
@@ -10378,7 +10541,7 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
return;
}
- if ( (!sd->npc_id && pc_istrading(sd)) || sd->chatID )
+ if ((!sd->npc_id && pc_istrading(sd)) || sd->chat_id != 0)
return;
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
@@ -10395,16 +10558,18 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd) __attribute__((non
/// Request to equip an item (CZ_REQ_WEAR_EQUIP).
/// 00a9 <index>.W <position>.W
/// 0998 <index>.W <position>.L
-void clif_parse_EquipItem(int fd,struct map_session_data *sd) {
- struct packet_equip_item *p = RP2PTR(fd);
+void clif_parse_EquipItem(int fd,struct map_session_data *sd)
+{
+ const struct packet_equip_item *p = RP2PTR(fd);
+ int index = 0;
if(pc_isdead(sd)) {
clif->clearunit_area(&sd->bl,CLR_DEAD);
return;
}
- p->index = p->index - 2;
- if (p->index >= MAX_INVENTORY)
+ index = p->index - 2;
+ if (index >= MAX_INVENTORY)
return; //Out of bounds check.
if( sd->npc_id ) {
@@ -10415,26 +10580,26 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd) {
else if ( pc_cant_act2(sd) || sd->state.prerefining )
return;
- if(!sd->status.inventory[p->index].identify) {
- clif->equipitemack(sd,p->index,0,EIA_FAIL);// fail
+ if(!sd->status.inventory[index].identify) {
+ clif->equipitemack(sd, index, 0, EIA_FAIL);// fail
return;
}
- if(!sd->inventory_data[p->index])
+ if(!sd->inventory_data[index])
return;
- if(sd->inventory_data[p->index]->type == IT_PETARMOR){
- pet->equipitem(sd,p->index);
+ if(sd->inventory_data[index]->type == IT_PETARMOR){
+ pet->equipitem(sd, index);
return;
}
pc->update_idle_time(sd, BCIDLE_USEITEM);
//Client doesn't send the position for ammo.
- if(sd->inventory_data[p->index]->type == IT_AMMO)
- pc->equipitem(sd,p->index,EQP_AMMO);
+ if(sd->inventory_data[index]->type == IT_AMMO)
+ pc->equipitem(sd, index, EQP_AMMO);
else
- pc->equipitem(sd,p->index,p->wearLocation);
+ pc->equipitem(sd, index, p->wearLocation);
}
void clif_parse_UnequipItem(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -10477,9 +10642,11 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
clif->clearunit_area(&sd->bl,CLR_DEAD);
return;
}
- if( sd->npc_id || sd->state.workinprogress&2 ){
-#ifdef RENEWAL
- clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message.
+ if (sd->npc_id || sd->state.workinprogress & 2) {
+#if PACKETVER >= 20110309
+ clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS);
+#else
+ clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48));
#endif
return;
}
@@ -10492,9 +10659,11 @@ void clif_parse_NpcClicked(int fd,struct map_session_data *sd)
clif->pActionRequest_sub(sd, 0x07, bl->id, timer->gettick());
break;
case BL_NPC:
- if( sd->ud.skill_id < RK_ENCHANTBLADE && sd->ud.skilltimer != INVALID_TIMER ) {// TODO: should only work with none 3rd job skills
-#ifdef RENEWAL
+ if (sd->ud.skill_id < RK_ENCHANTBLADE && sd->ud.skilltimer != INVALID_TIMER) { // TODO: should only work with none 3rd job skills
+#if PACKETVER >= 20110309
clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS);
+#else
+ clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48));
#endif
break;
}
@@ -10540,14 +10709,30 @@ void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd) __attribute_
/// 00c8 <packet len>.W { <amount>.W <name id>.W }*
void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
{
- int n = (RFIFOW(fd,2)-4) /4;
- unsigned short* item_list = (unsigned short*)RFIFOP(fd,4);
+ int n = ((int)RFIFOW(fd,2)-4) / 4;
int result;
- if( sd->state.trading || !sd->npc_shopid || pc_has_permission(sd,PC_PERM_DISABLE_STORE) )
+ Assert_retv(n >= 0);
+
+ if( sd->state.trading || !sd->npc_shopid || pc_has_permission(sd,PC_PERM_DISABLE_STORE) ) {
result = 1;
- else
- result = npc->buylist(sd,n,item_list);
+ } else {
+ struct itemlist item_list = { 0 };
+ int i;
+
+ VECTOR_INIT(item_list);
+ VECTOR_ENSURE(item_list, n, 1);
+ for (i = 0; i < n; i++) {
+ struct itemlist_entry entry = { 0 };
+
+ entry.amount = RFIFOW(fd, 4 + 4 * i);
+ entry.id = RFIFOW(fd, 4 + 4 * i + 2);
+
+ VECTOR_PUSH(item_list, entry);
+ }
+ result = npc->buylist(sd, &item_list);
+ VECTOR_CLEAR(item_list);
+ }
sd->npc_shopid = 0; //Clear shop data.
@@ -10576,15 +10761,32 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd) __attribute_
void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
{
int fail=0,n;
- unsigned short *item_list;
- n = (RFIFOW(fd,2)-4) /4;
- item_list = (unsigned short*)RFIFOP(fd,4);
+ n = ((int)RFIFOW(fd,2)-4) /4;
+
+ Assert_retv(n >= 0);
- if (sd->state.trading || !sd->npc_shopid)
+ if (sd->state.trading || !sd->npc_shopid) {
fail = 1;
- else
- fail = npc->selllist(sd,n,item_list);
+ } else {
+ struct itemlist item_list = { 0 };
+ int i;
+
+ VECTOR_INIT(item_list);
+ VECTOR_ENSURE(item_list, n, 1);
+
+ for (i = 0; i < n; i++) {
+ struct itemlist_entry entry = { 0 };
+
+ entry.id = (int)RFIFOW(fd, 4 + 4 * i) - 2;
+ entry.amount = RFIFOW(fd, 4 + 4 * i + 2);
+
+ VECTOR_PUSH(item_list, entry);
+ }
+ fail = npc->selllist(sd, &item_list);
+
+ VECTOR_CLEAR(item_list);
+ }
sd->npc_shopid = 0; //Clear shop data.
@@ -10602,14 +10804,14 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd)
int len = RFIFOW(fd,2)-15;
int limit = RFIFOW(fd,4);
bool pub = (RFIFOB(fd,6) != 0);
- const char* password = (char*)RFIFOP(fd,7); //not zero-terminated
- const char* title = (char*)RFIFOP(fd,15); // not zero-terminated
+ const char *password = RFIFOP(fd,7); //not zero-terminated
+ const char *title = RFIFOP(fd,15); // not zero-terminated
char s_password[CHATROOM_PASS_SIZE];
char s_title[CHATROOM_TITLE_SIZE];
if (pc_ismuted(&sd->sc, MANNER_NOROOM))
return;
- if(battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 4) {
+ if(battle_config.basic_skill_check && !pc->check_basicskill(sd, 4)) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,3);
return;
}
@@ -10637,7 +10839,7 @@ void clif_parse_ChatAddMember(int fd, struct map_session_data* sd) __attribute__
void clif_parse_ChatAddMember(int fd, struct map_session_data* sd)
{
int chatid = RFIFOL(fd,2);
- const char* password = (char*)RFIFOP(fd,6); // not zero-terminated
+ const char *password = RFIFOP(fd,6); // not zero-terminated
chat->join(sd,chatid,password);
}
@@ -10653,8 +10855,8 @@ void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd)
int len = RFIFOW(fd,2)-15;
int limit = RFIFOW(fd,4);
bool pub = (RFIFOB(fd,6) != 0);
- const char* password = (char*)RFIFOP(fd,7); // not zero-terminated
- const char* title = (char*)RFIFOP(fd,15); // not zero-terminated
+ const char *password = RFIFOP(fd,7); // not zero-terminated
+ const char *title = RFIFOP(fd,15); // not zero-terminated
char s_password[CHATROOM_PASS_SIZE];
char s_title[CHATROOM_TITLE_SIZE];
@@ -10675,7 +10877,7 @@ void clif_parse_ChangeChatOwner(int fd, struct map_session_data* sd) __attribute
/// 1 = normal
void clif_parse_ChangeChatOwner(int fd, struct map_session_data* sd)
{
- chat->change_owner(sd,(char*)RFIFOP(fd,6));
+ chat->change_owner(sd, RFIFOP(fd,6));
}
void clif_parse_KickFromChat(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -10683,7 +10885,7 @@ void clif_parse_KickFromChat(int fd,struct map_session_data *sd) __attribute__((
/// 00e2 <name>.24B
void clif_parse_KickFromChat(int fd,struct map_session_data *sd)
{
- chat->kick(sd,(char*)RFIFOP(fd,2));
+ chat->kick(sd, RFIFOP(fd,2));
}
void clif_parse_ChatLeave(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -10703,10 +10905,10 @@ void clif_noask_sub(struct map_session_data *src, struct map_session_data *targe
nullpo_retv(src);
// Your request has been rejected by autoreject option.
msg = msg_sd(src,392);
- clif_disp_onlyself(src, msg, strlen(msg));
+ clif_disp_onlyself(src, msg);
//Notice that a request was rejected.
snprintf(output, 256, msg_sd(target,393+type), src->status.name, 256);
- clif_disp_onlyself(target, output, strlen(output));
+ clif_disp_onlyself(target, output);
}
void clif_parse_TradeRequest(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -10717,7 +10919,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd) {
t_sd = map->id2sd(RFIFOL(fd,2));
- if(!sd->chatID && pc_cant_act(sd))
+ if (sd->chat_id == 0 && pc_cant_act(sd))
return; //You can trade while in a chatroom.
// @noask [LuzZza]
@@ -10726,7 +10928,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd) {
return;
}
- if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 1) {
+ if( battle_config.basic_skill_check && !pc->check_basicskill(sd, 1)) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,0);
return;
}
@@ -10837,39 +11039,38 @@ void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
void clif_parse_ChangeCart(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change cart's visual look (CZ_REQ_CHANGECART).
/// 01af <num>.W
-void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
+void clif_parse_ChangeCart(int fd, struct map_session_data *sd)
{// TODO: State tracking?
int type;
- if( pc->checkskill(sd, MC_CHANGECART) < 1 )
+ if (pc->checkskill(sd, MC_CHANGECART) == 0)
return;
-#ifdef RENEWAL
- if( sd->npc_id || sd->state.workinprogress&1 ){
+ if (sd->npc_id || sd->state.workinprogress & 1) {
+#if PACKETVER >= 20110309
clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS);
+#else
+ clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48));
+#endif
return;
}
-#endif
- type = (int)RFIFOW(fd,2);
+ type = RFIFOW(fd, 2);
+
+ if (
#ifdef NEW_CARTS
- if( (type == 9 && sd->status.base_level > 131) ||
- (type == 8 && sd->status.base_level > 121) ||
- (type == 7 && sd->status.base_level > 111) ||
- (type == 6 && sd->status.base_level > 101) ||
+ (type == 9 && sd->status.base_level > 130) ||
+ (type == 8 && sd->status.base_level > 120) ||
+ (type == 7 && sd->status.base_level > 110) ||
+ (type == 6 && sd->status.base_level > 100) ||
+#endif
(type == 5 && sd->status.base_level > 90) ||
(type == 4 && sd->status.base_level > 80) ||
(type == 3 && sd->status.base_level > 65) ||
(type == 2 && sd->status.base_level > 40) ||
(type == 1))
-#else
- if( (type == 5 && sd->status.base_level > 90) ||
- (type == 4 && sd->status.base_level > 80) ||
- (type == 3 && sd->status.base_level > 65) ||
- (type == 2 && sd->status.base_level > 40) ||
- (type == 1))
-#endif
- pc->setcart(sd,type);
+
+ pc->setcart(sd, type);
}
/// Request to select cart's visual look for new cart design (CZ_SELECTCART).
@@ -10882,7 +11083,7 @@ void clif_parse_SelectCart(int fd, struct map_session_data *sd)
if (!sd || !pc->checkskill(sd, MC_CARTDECORATE) || RFIFOL(fd, 2) != sd->status.account_id)
return;
- type = (int)RFIFOB(fd, 6);
+ type = RFIFOB(fd, 6);
if (type <= MAX_BASE_CARTS || type > MAX_CARTS)
return;
@@ -11056,9 +11257,11 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
// Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
pc->update_idle_time(sd, BCIDLE_USESKILLTOID);
- if( sd->npc_id || sd->state.workinprogress&1 ){
-#ifdef RENEWAL
- clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message.
+ if (sd->npc_id || sd->state.workinprogress & 1) {
+#if PACKETVER >= 20110309
+ clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS);
+#else
+ clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48));
#endif
return;
}
@@ -11115,7 +11318,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
sd->skillitem = sd->skillitemlv = 0;
- if( skill_id >= GD_SKILLBASE ) {
+ if (skill_id >= GD_SKILLBASE && skill_id < GD_MAX) {
if( sd->state.gmaster_flag )
skill_lv = guild->checkskill(sd->guild, skill_id);
else
@@ -11153,12 +11356,14 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
return;
}
-#ifdef RENEWAL
- if( sd->state.workinprogress&1 ){
- clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message.
+ if (sd->state.workinprogress & 1) {
+#if PACKETVER >= 20110309
+ clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS);
+#else
+ clif->messagecolor_self(fd, COLOR_WHITE, msg_fd(fd, 48));
+#endif
return;
}
-#endif
//Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
pc->update_idle_time(sd, BCIDLE_USESKILLTOPOS);
@@ -11171,7 +11376,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uint16 ski
return;
}
//You can't use Graffiti/TalkieBox AND have a vending open, so this is safe.
- safestrncpy(sd->message, (char*)RFIFOP(fd,skillmoreinfo), MESSAGE_SIZE);
+ safestrncpy(sd->message, RFIFOP(fd,skillmoreinfo), MESSAGE_SIZE);
}
if( sd->ud.skilltimer != INVALID_TIMER )
@@ -11264,7 +11469,7 @@ void clif_parse_UseSkillMap(int fd, struct map_session_data* sd)
uint16 skill_id = RFIFOW(fd,2);
char map_name[MAP_NAME_LENGTH];
- mapindex->getmapname((char*)RFIFOP(fd,4), map_name);
+ mapindex->getmapname(RFIFOP(fd,4), map_name);
sd->state.workinprogress = 0;
if(skill_id != sd->menuskill_id)
@@ -11425,7 +11630,7 @@ void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd) __attribute__
void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
{
int npcid = RFIFOL(fd,2);
- int amount = (int)RFIFOL(fd,6);
+ int amount = RFIFOL(fd,6);
if (amount >= 0)
sd->npc_amount = amount;
@@ -11439,9 +11644,14 @@ void clif_parse_NpcStringInput(int fd, struct map_session_data* sd) __attribute_
/// 01d5 <packet len>.W <npc id>.L <string>.?B
void clif_parse_NpcStringInput(int fd, struct map_session_data* sd)
{
- int message_len = RFIFOW(fd,2)-8;
+// [4144] can't confirm exact client version. At least >= correct for 20150513
+#if PACKETVER >= 20151029
+ int message_len = RFIFOW(fd, 2) - 7;
+#else
+ int message_len = RFIFOW(fd, 2) - 8;
+#endif
int npcid = RFIFOL(fd,4);
- const char* message = (char*)RFIFOP(fd,8);
+ const char *message = RFIFOP(fd,8);
if( message_len <= 0 )
return; // invalid input
@@ -11489,12 +11699,12 @@ void clif_parse_OneClick_ItemIdentify(int fd, struct map_session_data *sd)
int cmd = RFIFOW(fd,0);
short idx = RFIFOW(fd, packet_db[cmd].pos[0]) - 2;
int n;
-
+
if (idx < 0 || idx >= MAX_INVENTORY || sd->inventory_data[idx] == NULL || sd->status.inventory[idx].nameid <= 0)
return;
-
+
if ((n = pc->have_magnifier(sd) ) != INDEX_NOT_FOUND &&
- pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER) == 0)
+ pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME) == 0)
skill->identify(sd, idx);
}
@@ -11595,20 +11805,26 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) {
atcommand->exec(fd, sd, cmd, true);
}
-void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
+void clif_parse_LocalBroadcast(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// /lb /nlb (CZ_LOCALBROADCAST).
/// Request to broadcast a message on current map.
/// 019c <packet len>.W <text>.?B
-void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd)
+void clif_parse_LocalBroadcast(int fd, struct map_session_data *sd)
{
- char command[CHAT_SIZE_MAX+16];
- char* msg = (char*)RFIFOP(fd,4);
- unsigned int len = RFIFOW(fd,2)-4;
+ const char commandname[] = "lkami";
+ char command[sizeof commandname + 2 + CHAT_SIZE_MAX] = ""; // '@' + command + ' ' + message + NUL
+ int len = (int)RFIFOW(fd,2) - 4;
- // as the length varies depending on the command used, just block unreasonably long strings
- mes_len_check(msg, len, CHAT_SIZE_MAX);
+ if (len < 0)
+ return;
+
+ sprintf(command, "%c%s ", atcommand->at_symbol, commandname);
- sprintf(command, "%clkami %s", atcommand->at_symbol, msg);
+ // as the length varies depending on the command used, truncate unreasonably long strings
+ if (len >= (int)(sizeof command - strlen(command)))
+ len = (int)(sizeof command - strlen(command)) - 1;
+
+ strncat(command, RFIFOP(fd,4), len);
atcommand->exec(fd, sd, command, true);
}
@@ -11755,16 +11971,18 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) __attribute__((
/// Party creation request
/// 00f9 <party name>.24B (CZ_MAKE_GROUP)
/// 01e8 <party name>.24B <item pickup rule>.B <item share rule>.B (CZ_MAKE_GROUP2)
-void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
- char* name = (char*)RFIFOP(fd,2);
- name[NAME_LENGTH-1] = '\0';
+void clif_parse_CreateParty(int fd, struct map_session_data *sd)
+{
+ char name[NAME_LENGTH];
+
+ safestrncpy(name, RFIFOP(fd,2), NAME_LENGTH);
if( map->list[sd->bl.m].flag.partylock ) {
// Party locked.
- clif->message(fd, msg_fd(fd,227));
+ clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map.
return;
}
- if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 7 ) {
+ if (battle_config.basic_skill_check && !pc->check_basicskill(sd, 7)) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,4);
return;
}
@@ -11773,18 +11991,20 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
}
void clif_parse_CreateParty2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_CreateParty2(int fd, struct map_session_data *sd) {
- char* name = (char*)RFIFOP(fd,2);
+void clif_parse_CreateParty2(int fd, struct map_session_data *sd)
+{
+ char name[NAME_LENGTH];
int item1 = RFIFOB(fd,26);
int item2 = RFIFOB(fd,27);
- name[NAME_LENGTH-1] = '\0';
+
+ safestrncpy(name, RFIFOP(fd,2), NAME_LENGTH);
if( map->list[sd->bl.m].flag.partylock ) {
// Party locked.
- clif->message(fd, msg_fd(fd,227));
+ clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map.
return;
}
- if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 7 ) {
+ if (battle_config.basic_skill_check && !pc->check_basicskill(sd, 7)) {
clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,4);
return;
}
@@ -11801,7 +12021,7 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd) {
if(map->list[sd->bl.m].flag.partylock) {
// Party locked.
- clif->message(fd, msg_fd(fd,227));
+ clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map.
return;
}
@@ -11816,14 +12036,16 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd) {
}
void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) {
+void clif_parse_PartyInvite2(int fd, struct map_session_data *sd)
+{
struct map_session_data *t_sd;
- char *name = (char*)RFIFOP(fd,2);
- name[NAME_LENGTH-1] = '\0';
+ char name[NAME_LENGTH];
+
+ safestrncpy(name, RFIFOP(fd,2), NAME_LENGTH);
if(map->list[sd->bl.m].flag.partylock) {
// Party locked.
- clif->message(fd, msg_fd(fd,227));
+ clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map.
return;
}
@@ -11861,7 +12083,7 @@ void clif_parse_LeaveParty(int fd, struct map_session_data *sd) __attribute__((n
void clif_parse_LeaveParty(int fd, struct map_session_data *sd) {
if(map->list[sd->bl.m].flag.partylock) {
// Party locked.
- clif->message(fd, msg_fd(fd,227));
+ clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map.
return;
}
party->leave(sd);
@@ -11873,10 +12095,10 @@ void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) __attribu
void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) {
if(map->list[sd->bl.m].flag.partylock) {
// Party locked.
- clif->message(fd, msg_fd(fd,227));
+ clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map.
return;
}
- party->removemember(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
+ party->removemember(sd, RFIFOL(fd,2), RFIFOP(fd,6));
}
void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -11910,36 +12132,26 @@ void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd)
#endif
}
-void clif_parse_PartyMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-/// Validates and processes party messages (CZ_REQUEST_CHAT_PARTY).
-/// 0108 <packet len>.W <text>.?B (<name> : <message>) 00
-void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
+/**
+ * Validates and processes party messages (CZ_REQUEST_CHAT_PARTY).
+ *
+ * @code
+ * 0108 <packet len>.W <text>.?B (<name> : <message>) 00
+ * @endcode
+ *
+ * @param fd The incoming file descriptor.
+ * @param sd The related character.
+ */
+void clif_parse_PartyMessage(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+void clif_parse_PartyMessage(int fd, struct map_session_data *sd)
{
- const char* text = (char*)RFIFOP(fd,4);
- int textlen = RFIFOW(fd,2) - 4;
+ const struct packet_chat_message *packet = RP2PTR(fd);
+ char message[CHAT_SIZE_MAX + NAME_LENGTH + 3 + 1];
- char *name, *message;
- size_t namelen, messagelen;
-
- // validate packet and retrieve name and message
- if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
- return;
-
- if( atcommand->exec(fd, sd, message, true) )
+ if (clif->process_chat_message(sd, packet, message, sizeof message) == NULL)
return;
- if( !pc->can_talk(sd) )
- return;
-
- if (battle_config.min_chat_delay) {
- if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
- return;
- sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
- }
-
- pc->update_idle_time(sd, BCIDLE_CHAT);
-
- party->send_message(sd, text, textlen);
+ party->send_message(sd, message);
}
void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -12173,7 +12385,7 @@ void clif_parse_PartyRecruitRegisterReq(int fd, struct map_session_data* sd)
{
#ifdef PARTY_RECRUIT
short level = RFIFOW(fd,2);
- const char *notice = (const char*)RFIFOP(fd, 4);
+ const char *notice = RFIFOP(fd, 4);
party->recruit_register(sd, level, notice);
#else
@@ -12296,9 +12508,7 @@ void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd) __att
void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd)
{
#ifdef PARTY_RECRUIT
- const char *notice;
-
- notice = (const char*)RFIFOP(fd, 2);
+ const char *notice = RFIFOP(fd, 2);
party->recruit_update(sd, notice);
#else
@@ -12417,7 +12627,7 @@ void clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd)
nullpo_retv(sd);
WBUFW(buf, 0) = 0x8f2;
WBUFL(buf, 2) = sd->status.account_id;
- WBUFL(buf, 6) = sd->status.class_;
+ WBUFL(buf, 6) = sd->status.class;
WBUFW(buf, 10) = sd->status.base_level;
memcpy(WBUFP(buf, 12), sd->status.name, NAME_LENGTH);
@@ -12599,8 +12809,8 @@ void clif_parse_PurchaseReq(int fd, struct map_session_data* sd) __attribute__((
void clif_parse_PurchaseReq(int fd, struct map_session_data* sd)
{
int len = (int)RFIFOW(fd,2) - 8;
- int id = (int)RFIFOL(fd,4);
- const uint8* data = (uint8*)RFIFOP(fd,8);
+ int id = RFIFOL(fd,4);
+ const uint8 *data = RFIFOP(fd,8);
vending->purchase(sd, id, sd->vended_id, data, len/4);
@@ -12614,9 +12824,9 @@ void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd) __attribute__(
void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd)
{
int len = (int)RFIFOW(fd,2) - 12;
- int aid = (int)RFIFOL(fd,4);
- int uid = (int)RFIFOL(fd,8);
- const uint8* data = (uint8*)RFIFOP(fd,12);
+ int aid = RFIFOL(fd,4);
+ int uid = RFIFOL(fd,8);
+ const uint8 *data = RFIFOP(fd,12);
vending->purchase(sd, aid, uid, data, len/4);
@@ -12633,9 +12843,9 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) __attribute__((
/// 1 = open
void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
short len = (short)RFIFOW(fd,2) - 85;
- const char* message = (char*)RFIFOP(fd,4);
- bool flag = (bool)RFIFOB(fd,84);
- const uint8* data = (uint8*)RFIFOP(fd,85);
+ const char *message = RFIFOP(fd,4);
+ bool flag = (RFIFOB(fd,84) != 0) ? true : false;
+ const uint8 *data = RFIFOP(fd,85);
if( !flag )
sd->state.prevend = sd->state.workinprogress = 0;
@@ -12660,13 +12870,13 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
void clif_parse_CreateGuild(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
/// Guild creation request (CZ_REQ_MAKE_GUILD).
/// 0165 <char id>.L <guild name>.24B
-void clif_parse_CreateGuild(int fd,struct map_session_data *sd) {
- char* name = (char*)RFIFOP(fd,6);
- name[NAME_LENGTH-1] = '\0';
+void clif_parse_CreateGuild(int fd,struct map_session_data *sd)
+{
+ char name[NAME_LENGTH];
+ safestrncpy(name, RFIFOP(fd,6), NAME_LENGTH);
if(map->list[sd->bl.m].flag.guildlock) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
@@ -12717,7 +12927,7 @@ void clif_parse_GuildRequestInfo(int fd, struct map_session_data *sd)
clif->guild_expulsionlist(sd);
break;
default:
- ShowError("clif: guild request info: unknown type %d\n", RFIFOL(fd,2));
+ ShowError("clif: guild request info: unknown type %u\n", RFIFOL(fd,2));
break;
}
}
@@ -12733,7 +12943,7 @@ void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd)
return;
for(i = 4; i < RFIFOW(fd,2); i += 40 ){
- guild->change_position(sd->status.guild_id, RFIFOL(fd,i), RFIFOL(fd,i+4), RFIFOL(fd,i+12), (char*)RFIFOP(fd,i+16));
+ guild->change_position(sd->status.guild_id, RFIFOL(fd,i), RFIFOL(fd,i+4), RFIFOL(fd,i+12), RFIFOP(fd,i+16));
}
}
@@ -12782,7 +12992,7 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
//uint8 b;
//uint8 g;
//uint8 r;
- unsigned int rgb:24;
+ uint32 rgb:24;
} __attribute__((packed));
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
@@ -12792,7 +13002,8 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
int header = 0, bitmap = 0, offbits = 0, palettesize = 0;
nullpo_retr(false, emblem);
- if( decode_zip(buf, &buf_len, emblem, emblem_len) != 0 || buf_len < BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE
+ if (grfio->decode_zip(buf, &buf_len, emblem, emblem_len) != 0
+ || buf_len < BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE
|| RBUFW(buf,0) != 0x4d42 // BITMAPFILEHEADER.bfType (signature)
|| RBUFL(buf,2) != buf_len // BITMAPFILEHEADER.bfSize (file size)
|| RBUFL(buf,14) != BITMAPINFOHEADER_SIZE // BITMAPINFOHEADER.biSize (other headers are not supported)
@@ -12848,8 +13059,8 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
switch( RBUFW(buf,28) ) {
case 8: // palette indexes
{
- const uint8 *indexes = (const uint8 *)RBUFP(buf,offbits);
- const uint32 *palette = (const uint32 *)RBUFP(buf,BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE);
+ const uint8 *indexes = RBUFP(buf,offbits);
+ const uint32 *palette = RBUFP(buf,BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE);
for (i = 0; i < BITMAP_WIDTH * BITMAP_HEIGHT; i++) {
if( indexes[i] >= palettesize ) // Invalid color
@@ -12867,7 +13078,7 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
}
case 24: // full colors
{
- const struct s_bitmaptripple *pixels = (const struct s_bitmaptripple*)RBUFP(buf,offbits);
+ const struct s_bitmaptripple *pixels = RBUFP(buf,offbits);
for (i = 0; i < BITMAP_WIDTH * BITMAP_HEIGHT; i++) {
// if( pixels[i].r < 0xF8 || pixels[i].g > 0x07 || pixels[i].b < 0xF8 )
@@ -12915,18 +13126,22 @@ void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd) __attribu
void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd)
{
int guild_id = RFIFOL(fd,2);
- char* msg1 = (char*)RFIFOP(fd,6);
- char* msg2 = (char*)RFIFOP(fd,66);
+ char *msg1 = NULL, *msg2 = NULL;
- if(!sd->state.gmaster_flag)
+ if (!sd->state.gmaster_flag)
return;
+ msg1 = aStrndup(RFIFOP(fd,6), MAX_GUILDMES1-1);
+ msg2 = aStrndup(RFIFOP(fd,66), MAX_GUILDMES2-1);
+
// compensate for some client defects when using multilingual mode
if (msg1[0] == '|' && msg1[3] == '|') msg1+= 3; // skip duplicate marker
if (msg2[0] == '|' && msg2[3] == '|') msg2+= 3; // skip duplicate marker
if (msg2[0] == '|') msg2[strnlen(msg2, MAX_GUILDMES2)-1] = '\0'; // delete extra space at the end of string
guild->change_notice(sd, guild_id, msg1, msg2);
+ aFree(msg1);
+ aFree(msg2);
}
// Helper function for guild invite functions
@@ -12937,8 +13152,7 @@ bool clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_sessi
nullpo_retr(false, sd);
nullpo_retr(false, t_sd);
if ( map->list[sd->bl.m].flag.guildlock ) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return false;
}
@@ -12964,14 +13178,15 @@ void clif_parse_GuildInvite(int fd,struct map_session_data *sd) {
void clif_parse_GuildInvite2(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Guild invite request (/guildinvite) (CZ_REQ_JOIN_GUILD2).
/// 0916 <char name>.24B
-void clif_parse_GuildInvite2(int fd, struct map_session_data *sd) {
- char *nick = (char*)RFIFOP(fd, 2);
- struct map_session_data *t_sd = map->nick2sd(nick);
+void clif_parse_GuildInvite2(int fd, struct map_session_data *sd)
+{
+ char nick[NAME_LENGTH];
+ struct map_session_data *t_sd = NULL;
- nick[NAME_LENGTH - 1] = '\0';
+ safestrncpy(nick, RFIFOP(fd, 2), NAME_LENGTH);
+ t_sd = map->nick2sd(nick);
- if (!clif_sub_guild_invite(fd, sd, t_sd))
- return;
+ clif_sub_guild_invite(fd, sd, t_sd);
}
void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -12990,8 +13205,7 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd) __attribute__((no
/// 0159 <guild id>.L <account id>.L <char id>.L <reason>.40B
void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
if(map->list[sd->bl.m].flag.guildlock) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
if( sd->bg_id ) {
@@ -12999,7 +13213,7 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
return;
}
- guild->leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
+ guild->leave(sd,RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOP(fd,14));
}
void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -13007,46 +13221,35 @@ void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) __attribute__
/// 015b <guild id>.L <account id>.L <char id>.L <reason>.40B
void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd) {
if( map->list[sd->bl.m].flag.guildlock || sd->bg_id ) {
- // Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
- guild->expulsion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
+ guild->expulsion(sd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOP(fd,14));
}
-void clif_parse_GuildMessage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-/// Validates and processes guild messages (CZ_GUILD_CHAT).
-/// 017e <packet len>.W <text>.?B (<name> : <message>) 00
-void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
+/**
+ * Validates and processes guild messages (CZ_GUILD_CHAT).
+ *
+ * @code
+ * 017e <packet len>.W <text>.?B (<name> : <message>) 00
+ * @endcode
+ *
+ * @param fd The incoming file descriptor.
+ * @param sd The related character.
+ */
+void clif_parse_GuildMessage(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+void clif_parse_GuildMessage(int fd, struct map_session_data *sd)
{
- const char* text = (char*)RFIFOP(fd,4);
- int textlen = RFIFOW(fd,2) - 4;
+ const struct packet_chat_message *packet = RP2PTR(fd);
+ char message[CHAT_SIZE_MAX + NAME_LENGTH + 3 + 1];
- char *name, *message;
- size_t namelen, messagelen;
-
- // validate packet and retrieve name and message
- if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
- return;
-
- if( atcommand->exec(fd, sd, message, true) )
- return;
-
- if( !pc->can_talk(sd) )
+ if (clif->process_chat_message(sd, packet, message, sizeof message) == NULL)
return;
- if (battle_config.min_chat_delay) {
- if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0)
- return;
- sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
- }
-
- pc->update_idle_time(sd, BCIDLE_CHAT);
-
- if( sd->bg_id )
- bg->send_message(sd, text, textlen);
+ if (sd->bg_id)
+ bg->send_message(sd, message);
else
- guild->send_message(sd, text, textlen);
+ guild->send_message(sd, message);
}
void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -13059,8 +13262,7 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) {
return;
if(map->list[sd->bl.m].flag.guildlock) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
@@ -13097,8 +13299,7 @@ void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd) {
return;
if(map->list[sd->bl.m].flag.guildlock) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
guild->delalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
@@ -13114,8 +13315,7 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) {
return;
if(map->list[sd->bl.m].flag.guildlock) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
@@ -13138,11 +13338,10 @@ void clif_parse_GuildBreak(int fd, struct map_session_data *sd) __attribute__((n
/// field name and size is same as the one in CH_DELETE_CHAR.
void clif_parse_GuildBreak(int fd, struct map_session_data *sd) {
if( map->list[sd->bl.m].flag.guildlock ) {
- //Guild locked.
- clif->message(fd, msg_fd(fd,228));
+ clif->message(fd, msg_fd(fd,228)); // Guild modification is disabled in this map.
return;
}
- guild->dobreak(sd,(char*)RFIFOP(fd,2));
+ guild->dobreak(sd, RFIFOP(fd,2));
}
/// Pet
@@ -13218,7 +13417,7 @@ void clif_parse_ChangePetName(int fd, struct map_session_data *sd) __attribute__
/// 01a5 <name>.24B
void clif_parse_ChangePetName(int fd, struct map_session_data *sd)
{
- pet->change_name(sd,(char*)RFIFOP(fd,2));
+ pet->change_name(sd, RFIFOP(fd,2));
}
void clif_parse_GMKick(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -13241,7 +13440,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) {
case BL_PC:
{
char command[NAME_LENGTH+6];
- sprintf(command, "%ckick %s", atcommand->at_symbol, status->get_name(target));
+ sprintf(command, "%ckick %s", atcommand->at_symbol, clif->get_bl_name(target));
atcommand->exec(fd, sd, command, true);
}
break;
@@ -13256,7 +13455,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) {
clif->GM_kickack(sd, 0);
return;
}
- sprintf(command, "/kick %s (%d)", status->get_name(target), status->get_class(target));
+ sprintf(command, "/kick %s (%d)", clif->get_bl_name(target), status->get_class(target));
logs->atcommand(sd, command);
status_percent_damage(&sd->bl, target, 100, 0, true); // can invalidate 'target'
}
@@ -13299,12 +13498,12 @@ void clif_parse_GMShift(int fd, struct map_session_data *sd) __attribute__((nonn
/// Request to warp to a character with given name.
/// 01bb <char name>.24B
void clif_parse_GMShift(int fd, struct map_session_data *sd)
-{// FIXME: remove is supposed to receive account name for clients prior 20100803RE
- char *player_name;
+{
+ // FIXME: remove is supposed to receive account name for clients prior 20100803RE
+ char player_name[NAME_LENGTH];
char command[NAME_LENGTH+8];
- player_name = (char*)RFIFOP(fd,2);
- player_name[NAME_LENGTH-1] = '\0';
+ safestrncpy(player_name, RFIFOP(fd,2), NAME_LENGTH);
sprintf(command, "%cjumpto %s", atcommand->at_symbol, player_name);
atcommand->exec(fd, sd, command, true);
@@ -13335,12 +13534,12 @@ void clif_parse_GMRecall(int fd, struct map_session_data *sd) __attribute__((non
/// Request to summon a player with given name to own position.
/// 01bd <char name>.24B
void clif_parse_GMRecall(int fd, struct map_session_data *sd)
-{// FIXME: recall is supposed to receive account name for clients prior 20100803RE
- char *player_name;
- char command [NAME_LENGTH+8];
+{
+ // FIXME: recall is supposed to receive account name for clients prior 20100803RE
+ char player_name[NAME_LENGTH];
+ char command[NAME_LENGTH+8];
- player_name = (char*)RFIFOP(fd,2);
- player_name[NAME_LENGTH-1] = '\0';
+ safestrncpy(player_name, RFIFOP(fd,2), NAME_LENGTH);
sprintf(command, "%crecall %s", atcommand->at_symbol, player_name);
atcommand->exec(fd, sd, command, true);
@@ -13376,16 +13575,16 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) __attribute
/// /item agitinvest - reset current global agit investments.(not yet implemented)
/// 013f <item/mob name>.24B
/// 09ce <item/mob name>.100B [Ind/Yommy<3]
-void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) {
- struct packet_gm_monster_item *p = RP2PTR(fd);
+void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd)
+{
+ const struct packet_gm_monster_item *p = RP2PTR(fd);
int i, count;
- char *item_monster_name;
+ char item_monster_name[sizeof p->str];
struct item_data *item_array[10];
struct mob_db *mob_array[10];
char command[256];
- item_monster_name = p->str;
- item_monster_name[(sizeof(struct packet_gm_monster_item)-2)-1] = '\0';
+ safestrncpy(item_monster_name, p->str, sizeof(item_monster_name));
if ( (count=itemdb->search_name_array(item_array, 10, item_monster_name, 1)) > 0 ) {
for(i = 0; i < count; i++) {
@@ -13506,9 +13705,10 @@ void clif_parse_GMRc(int fd, struct map_session_data* sd) __attribute__((nonnull
void clif_parse_GMRc(int fd, struct map_session_data* sd)
{
char command[NAME_LENGTH+15];
- char *name = (char*)RFIFOP(fd,2);
+ char name[NAME_LENGTH];
+
+ safestrncpy(name, RFIFOP(fd,2), NAME_LENGTH);
- name[NAME_LENGTH-1] = '\0';
sprintf(command, "%cmute %d %s", atcommand->at_symbol, 60, name);
atcommand->exec(fd, sd, command, true);
}
@@ -13523,7 +13723,7 @@ void clif_account_name(struct map_session_data* sd, int account_id, const char*
WFIFOHEAD(fd,packet_len(0x1e0));
WFIFOW(fd,0) = 0x1e0;
WFIFOL(fd,2) = account_id;
- safestrncpy((char*)WFIFOP(fd,6), accname, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,6), accname, NAME_LENGTH);
WFIFOSET(fd,packet_len(0x1e0));
}
@@ -13567,13 +13767,14 @@ void clif_parse_PMIgnore(int fd, struct map_session_data* sd) __attribute__((non
/// type:
/// 0 = (/ex nick) deny speech from nick
/// 1 = (/in nick) allow speech from nick
-void clif_parse_PMIgnore(int fd, struct map_session_data* sd) {
- char* nick;
+void clif_parse_PMIgnore(int fd, struct map_session_data* sd)
+{
+ char nick[NAME_LENGTH];
uint8 type;
int i;
- nick = (char*)RFIFOP(fd,2); // speed up
- nick[NAME_LENGTH-1] = '\0'; // to be sure that the player name has at most 23 characters
+ safestrncpy(nick, RFIFOP(fd,2), NAME_LENGTH);
+
type = RFIFOB(fd,26);
if( type == 0 ) { // Add name to ignore list (block)
@@ -13682,12 +13883,13 @@ void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd)
{
if (sd->state.doridori) return;
- switch (sd->class_&MAPID_UPPERMASK) {
+ switch (sd->job & MAPID_UPPERMASK) {
case MAPID_SOUL_LINKER:
case MAPID_STAR_GLADIATOR:
case MAPID_TAEKWON:
if (!sd->state.rest)
break;
+ FALLTHROUGH
case MAPID_SUPER_NOVICE:
sd->state.doridori=1;
break;
@@ -13709,7 +13911,7 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd)
/* game client is currently broken on this (not sure the packetver range) */
/* it sends the request when the criteria doesn't match (and of course we let it fail) */
/* so restoring the old parse_globalmes method. */
- if( ( sd->class_&MAPID_UPPERMASK ) == MAPID_SUPER_NOVICE ) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
unsigned int next = pc->nextbaseexp(sd);
if( next == 0 ) next = pc->thisbaseexp(sd);
if( next ) {
@@ -13831,12 +14033,14 @@ void clif_friendlist_req(struct map_session_data* sd, int account_id, int char_i
void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to add a player as friend (CZ_ADD_FRIENDS).
/// 0202 <name>.24B
-void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) {
+void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd)
+{
struct map_session_data *f_sd;
int i;
- char *nick = (char*)RFIFOP(fd,2);
+ char nick[NAME_LENGTH];
+
+ safestrncpy(nick, RFIFOP(fd,2), NAME_LENGTH);
- nick[NAME_LENGTH - 1] = '\0';
f_sd = map->nick2sd(nick);
// ensure that the request player's friend list is not full
@@ -13849,7 +14053,7 @@ void clif_parse_FriendsListAdd(int fd, struct map_session_data *sd) {
// Friend doesn't exist (no player with this name)
if (f_sd == NULL) {
- clif->message(fd, msg_fd(fd,3));
+ clif->message(fd, msg_fd(fd,3)); // "Character not found."
return;
}
@@ -14055,46 +14259,43 @@ void clif_ranklist_sub(unsigned char *buf, enum fame_list_type type) {
for( i = 0; i < 10 && i < MAX_FAME_LIST; i++ ) {
if( list[i].id > 0 ) {
if( strcmp(list[i].name, "-") == 0 && (name = map->charid2nick(list[i].id)) != NULL ) {
- strncpy((char *)(WBUFP(buf, 24 * i)), name, NAME_LENGTH);
+ strncpy(WBUFP(buf, 24 * i), name, NAME_LENGTH);
} else {
- strncpy((char *)(WBUFP(buf, 24 * i)), list[i].name, NAME_LENGTH);
+ strncpy(WBUFP(buf, 24 * i), list[i].name, NAME_LENGTH);
}
} else {
- strncpy((char *)(WBUFP(buf, 24 * i)), "None", 5);
+ strncpy(WBUFP(buf, 24 * i), "None", 5);
}
WBUFL(buf, 24 * 10 + i * 4) = list[i].fame; //points
}
for( ;i < 10; i++ ) { // In case the MAX is less than 10.
- strncpy((char *)(WBUFP(buf, 24 * i)), "Unavailable", 12);
+ strncpy(WBUFP(buf, 24 * i), "Unavailable", 12);
WBUFL(buf, 24 * 10 + i * 4) = 0;
}
}
/// 097d <RankingType>.W {<CharName>.24B <point>L}*10 <mypoint>L (ZC_ACK_RANKING)
-void clif_ranklist(struct map_session_data *sd, enum fame_list_type type) {
+void clif_ranklist(struct map_session_data *sd, enum fame_list_type type)
+{
+#if PACKETVER >= 20120502
int fd;
- int mypoint = 0;
- int upperMask;
+ int len = packet_len(0x97d);
nullpo_retv(sd);
fd = sd->fd;
- upperMask = sd->class_&MAPID_UPPERMASK;
- WFIFOHEAD(fd, 288);
+ WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x97d;
WFIFOW(fd, 2) = type;
clif_ranklist_sub(WFIFOP(fd,4), type);
- if( (upperMask == MAPID_BLACKSMITH && type == RANKTYPE_BLACKSMITH)
- || (upperMask == MAPID_ALCHEMIST && type == RANKTYPE_ALCHEMIST)
- || (upperMask == MAPID_TAEKWON && type == RANKTYPE_TAEKWON)
- ) {
- mypoint = sd->status.fame;
+ if (pc->famelist_type(sd->job) == type) {
+ WFIFOL(fd, 284) = sd->status.fame; //mypoint
} else {
- mypoint = 0;
+ WFIFOL(fd, 284) = 0; //mypoint
}
- WFIFOL(fd, 284) = mypoint; //mypoint
- WFIFOSET(fd, 288);
+ WFIFOSET(fd, len);
+#endif
}
void clif_parse_ranklist(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -14114,8 +14315,9 @@ void clif_parse_ranklist(int fd, struct map_session_data *sd) {
}
// 097e <RankingType>.W <point>.L <TotalPoint>.L (ZC_UPDATE_RANKING_POINT)
-void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points) {
-#if PACKETVER < 20130710
+void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points)
+{
+#if PACKETVER < 20120502
switch( type ) {
case RANKTYPE_BLACKSMITH: clif->fame_blacksmith(sd,points); break;
case RANKTYPE_ALCHEMIST: clif->fame_alchemist(sd,points); break;
@@ -14124,15 +14326,16 @@ void clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type t
#else
int fd;
+ int len = packet_len(0x97e);
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd, 12);
+ WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x97e;
WFIFOW(fd, 2) = type;
WFIFOL(fd, 4) = points;
WFIFOL(fd, 8) = sd->status.fame;
- WFIFOSET(fd, 12);
+ WFIFOSET(fd, len);
#endif
}
@@ -14248,7 +14451,7 @@ void clif_ranking_pk(struct map_session_data* sd) {
WFIFOHEAD(fd,packet_len(0x238));
WFIFOW(fd,0) = 0x238;
for (i = 0; i < 10;i ++) {
- strncpy((char*)WFIFOP(fd, i * 24 + 2), "Unknown", NAME_LENGTH);
+ strncpy(WFIFOP(fd, i * 24 + 2), "Unknown", NAME_LENGTH);
WFIFOL(fd,i*4+242) = 0;
}
WFIFOSET(fd, packet_len(0x238));
@@ -14308,8 +14511,9 @@ void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv)
void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// Request to change homunculus' name (CZ_RENAME_MER).
/// 0231 <name>.24B
-void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd) {
- homun->change_name(sd,(char*)RFIFOP(fd,2));
+void clif_parse_ChangeHomunculusName(int fd, struct map_session_data *sd)
+{
+ homun->change_name(sd, RFIFOP(fd,2));
}
void clif_parse_HomMoveToMaster(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -14476,7 +14680,7 @@ void clif_parse_Check(int fd, struct map_session_data *sd)
if(!pc_has_permission(sd, PC_PERM_USE_CHECK))
return;
- safestrncpy(charname, (const char*)RFIFOP(fd,packet_db[RFIFOW(fd,0)].pos[0]), sizeof(charname));
+ safestrncpy(charname, RFIFOP(fd,packet_db[RFIFOW(fd,0)].pos[0]), sizeof(charname));
if( ( pl_sd = map->nick2sd(charname) ) == NULL || pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) {
return;
@@ -14567,8 +14771,8 @@ void clif_Mail_new(int fd, int mail_id, const char *sender, const char *title)
WFIFOHEAD(fd,packet_len(0x24a));
WFIFOW(fd,0) = 0x24a;
WFIFOL(fd,2) = mail_id;
- safestrncpy((char*)WFIFOP(fd,6), title, MAIL_TITLE_LENGTH);
- safestrncpy((char*)WFIFOP(fd,46), sender, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,6), title, MAIL_TITLE_LENGTH);
+ safestrncpy(WFIFOP(fd,46), sender, NAME_LENGTH);
WFIFOSET(fd,packet_len(0x24a));
}
@@ -14623,7 +14827,7 @@ void clif_Mail_refreshinbox(struct map_session_data *sd)
if( md->full ) {// TODO: is this official?
char output[100];
sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
}
}
@@ -14661,11 +14865,16 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id)
struct mail_message *msg = &sd->mail.inbox.msg[i];
struct item *item = &msg->item;
struct item_data *data;
- size_t msg_len = strlen(msg->body), len;
+ int msg_len = (int)strlen(msg->body), len;
- if( msg_len == 0 ) {
+ if (msg_len == 0) {
strcpy(msg->body, "(no message)");
- msg_len = strlen(msg->body);
+ msg_len = (int)strlen(msg->body);
+ }
+
+ if (msg_len > UINT8_MAX) {
+ Assert_report(msg_len > UINT8_MAX);
+ msg_len = UINT8_MAX;
}
len = 101 + msg_len;
@@ -14674,8 +14883,8 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id)
WFIFOW(fd,0) = 0x242;
WFIFOW(fd,2) = len;
WFIFOL(fd,4) = msg->id;
- safestrncpy((char*)WFIFOP(fd,8), msg->title, MAIL_TITLE_LENGTH + 1);
- safestrncpy((char*)WFIFOP(fd,48), msg->send_name, NAME_LENGTH + 1);
+ safestrncpy(WFIFOP(fd,8), msg->title, MAIL_TITLE_LENGTH + 1);
+ safestrncpy(WFIFOP(fd,48), msg->send_name, NAME_LENGTH + 1);
WFIFOL(fd,72) = 0;
WFIFOL(fd,76) = msg->zeny;
@@ -14693,8 +14902,8 @@ void clif_Mail_read(struct map_session_data *sd, int mail_id)
} else // no item, set all to zero
memset(WFIFOP(fd,80), 0x00, 19);
- WFIFOB(fd,99) = (unsigned char)msg_len;
- safestrncpy((char*)WFIFOP(fd,100), msg->body, msg_len + 1);
+ WFIFOB(fd,99) = (uint8)msg_len;
+ safestrncpy(WFIFOP(fd,100), msg->body, msg_len + 1);
WFIFOSET(fd,len);
if (msg->status == MAIL_UNREAD) {
@@ -14727,7 +14936,6 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
{
int mail_id = RFIFOL(fd,2);
int i;
- bool fail = false;
if( !chrif->isconnected() )
return;
@@ -14751,6 +14959,7 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd)
if( sd->mail.inbox.msg[i].item.nameid > 0 ) {
struct item_data *data;
unsigned int weight;
+ bool fail = false;
if ((data = itemdb->exists(sd->mail.inbox.msg[i].item.nameid)) == NULL)
return;
@@ -14919,15 +15128,15 @@ void clif_parse_Mail_send(int fd, struct map_session_data *sd)
msg.send_id = sd->status.char_id;
msg.dest_id = 0; // will attempt to resolve name
safestrncpy(msg.send_name, sd->status.name, NAME_LENGTH);
- safestrncpy(msg.dest_name, (char*)RFIFOP(fd,4), NAME_LENGTH);
- safestrncpy(msg.title, (char*)RFIFOP(fd,28), MAIL_TITLE_LENGTH);
+ safestrncpy(msg.dest_name, RFIFOP(fd,4), NAME_LENGTH);
+ safestrncpy(msg.title, RFIFOP(fd,28), MAIL_TITLE_LENGTH);
if (msg.title[0] == '\0') {
return; // Message has no length and somehow client verification was skipped.
}
if (body_len)
- safestrncpy(msg.body, (char*)RFIFOP(fd,69), body_len + 1);
+ safestrncpy(msg.body, RFIFOP(fd,69), body_len + 1);
else
memset(msg.body, 0x00, MAIL_BODY_LENGTH);
@@ -14967,7 +15176,7 @@ void clif_Auction_openwindow(struct map_session_data *sd)
/// Returns auction item search results (ZC_AUCTION_ITEM_REQ_SEARCH).
/// 0252 <packet len>.W <pages>.L <count>.L { <auction id>.L <seller name>.24B <name id>.W <type>.L <amount>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <now price>.L <max price>.L <buyer name>.24B <delete time>.L }*
-void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf)
+void clif_Auction_results(struct map_session_data *sd, short count, short pages, const uint8 *buf)
{
int i, fd, len = sizeof(struct auction_data);
struct auction_data auction;
@@ -14986,7 +15195,7 @@ void clif_Auction_results(struct map_session_data *sd, short count, short pages,
memcpy(&auction, RBUFP(buf,i * len), len);
WFIFOL(fd,k) = auction.auction_id;
- safestrncpy((char*)WFIFOP(fd,4+k), auction.seller_name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,4+k), auction.seller_name, NAME_LENGTH);
if( (item = itemdb->exists(auction.item.nameid)) != NULL && item->view_id > 0 )
WFIFOW(fd,28+k) = item->view_id;
@@ -15004,7 +15213,7 @@ void clif_Auction_results(struct map_session_data *sd, short count, short pages,
WFIFOW(fd,45+k) = auction.item.card[3];
WFIFOL(fd,47+k) = auction.price;
WFIFOL(fd,51+k) = auction.buynow;
- safestrncpy((char*)WFIFOP(fd,55+k), auction.buyer_name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,55+k), auction.buyer_name, NAME_LENGTH);
WFIFOL(fd,79+k) = (uint32)auction.timestamp;
}
WFIFOSET(fd,WFIFOW(fd,2));
@@ -15111,10 +15320,10 @@ void clif_Auction_message(int fd, unsigned char flag)
/// 2 = Auction ID is incorrect
void clif_Auction_close(int fd, unsigned char flag)
{
- WFIFOHEAD(fd,packet_len(0x25e));
+ WFIFOHEAD(fd, 4);
WFIFOW(fd,0) = 0x25d; // BUG: The client identifies this packet as 0x25d (CZ_AUCTION_REQ_MY_SELL_STOP)
WFIFOW(fd,2) = flag;
- WFIFOSET(fd,packet_len(0x25e));
+ WFIFOSET(fd, 4);
}
void clif_parse_Auction_register(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -15188,7 +15397,7 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
// Auction checks...
if( sd->status.inventory[sd->auction.index].bound && !pc_can_give_bound_items(sd) ) {
- clif->message(sd->fd, msg_sd(sd,293));
+ clif->message(sd->fd, msg_sd(sd,293)); // This bound item cannot be traded to that character.
clif->auction_message(fd, 2); // The auction has been canceled
return;
}
@@ -15241,7 +15450,7 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
int bid = RFIFOL(fd,6);
if( !pc_can_give_items(sd) ) { //They aren't supposed to give zeny [Inkfish]
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
return;
}
@@ -15278,7 +15487,7 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd)
clif->pAuction_cancelreg(fd, sd);
- safestrncpy(search_text, (char*)RFIFOP(fd,8), sizeof(search_text));
+ safestrncpy(search_text, RFIFOP(fd,8), sizeof(search_text));
intif->Auction_requestlist(sd->status.char_id, type, price, search_text, page);
}
@@ -15414,13 +15623,25 @@ void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)
int len = RFIFOW(fd,2);
int points = RFIFOL(fd,4);
int count = RFIFOW(fd,8);
- unsigned short* item_list = (unsigned short*)RFIFOP(fd,10);
+ struct itemlist item_list = { 0 };
+ int i;
if( len < 10 || len != 10 + count * 4) {
- ShowWarning("Player %u sent incorrect cash shop buy packet (len %u:%u)!\n", sd->status.char_id, len, 10 + count * 4);
+ ShowWarning("Player %d sent incorrect cash shop buy packet (len %d:%d)!\n", sd->status.char_id, len, 10 + count * 4);
return;
}
- fail = npc->cashshop_buylist(sd,points,count,item_list);
+ VECTOR_INIT(item_list);
+ VECTOR_ENSURE(item_list, count, 1);
+ for (i = 0; i < count; i++) {
+ struct itemlist_entry entry = { 0 };
+
+ entry.amount = RFIFOW(fd, 10 + 4 * i);
+ entry.id = RFIFOW(fd, 10 + 4 * i + 2); // Nameid
+
+ VECTOR_PUSH(item_list, entry);
+ }
+ fail = npc->cashshop_buylist(sd, points, &item_list);
+ VECTOR_CLEAR(item_list);
#endif
}
@@ -15539,7 +15760,7 @@ void clif_bossmapinfo(int fd, struct mob_data *md, short flag)
WFIFOW(fd,11) = hours; // Hours
WFIFOW(fd,13) = minutes; // Minutes
}
- safestrncpy((char*)WFIFOP(fd,19), md->db->jname, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,19), md->db->jname, NAME_LENGTH);
}
WFIFOSET(fd,70);
@@ -15571,7 +15792,7 @@ void clif_parse_EquipTick(int fd, struct map_session_data* sd) __attribute__((no
/// 1 = enabled
void clif_parse_EquipTick(int fd, struct map_session_data* sd)
{
- bool flag = (bool)RFIFOL(fd,6);
+ bool flag = (RFIFOL(fd,6) != 0) ? true : false;
sd->status.show_equip = flag;
clif->equiptickack(sd, flag);
}
@@ -15605,7 +15826,7 @@ void clif_quest_send_list(struct map_session_data *sd)
+ sd->avail_quests * (sizeof(struct packet_quest_list_info)
+ MAX_QUEST_OBJECTIVES * sizeof(struct packet_mission_info_sub)); // >= than the actual length
buf = aMalloc(len);
- packet = (struct packet_quest_list_header *)WBUFP(buf, 0);
+ packet = WBUFP(buf, 0);
real_len = sizeof(*packet);
packet->PacketType = questListType;
@@ -15915,7 +16136,7 @@ void clif_mercenary_info(struct map_session_data *sd) {
#endif
WFIFOW(fd,18) = mstatus->flee;
WFIFOW(fd,20) = mstatus->amotion;
- safestrncpy((char*)WFIFOP(fd,22), md->db->name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,22), md->db->name, NAME_LENGTH);
WFIFOW(fd,46) = md->db->lv;
WFIFOL(fd,48) = mstatus->hp;
WFIFOL(fd,52) = mstatus->max_hp;
@@ -15957,7 +16178,7 @@ void clif_mercenary_skillblock(struct map_session_data *sd)
WFIFOW(fd, len + 8) = 0;
WFIFOW(fd, len + 10) = 0;
}
- safestrncpy((char*)WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,len+12), skill->get_name(id), NAME_LENGTH);
WFIFOB(fd,len+36) = 0; // Skillable for Mercenary?
len += 37;
}
@@ -16028,28 +16249,46 @@ void clif_readbook(int fd, int book_id, int page)
/// Battlegrounds
///
-/// Updates HP bar of a camp member (ZC_BATTLEFIELD_NOTIFY_HP).
-/// 02e0 <account id>.L <name>.24B <hp>.W <max hp>.W
+/// Updates HP bar of a camp member.
+/// 02e0 <account id>.L <name>.24B <hp>.W <max hp>.W (ZC_BATTLEFIELD_NOTIFY_HP).
+/// 0a0e <account id>.L <hp>.L <max hp>.L (ZC_BATTLEFIELD_NOTIFY_HP2)
void clif_bg_hp(struct map_session_data *sd)
{
unsigned char buf[34];
+
+// packet version can be wrong, because inconsistend data in other servers. From packets table it start from 20140312 [4144]
+#if PACKETVER < 20140613
const int cmd = 0x2e0;
nullpo_retv(sd);
- WBUFW(buf,0) = cmd;
- WBUFL(buf,2) = sd->status.account_id;
- memcpy(WBUFP(buf,6), sd->status.name, NAME_LENGTH);
+ WBUFW(buf, 0) = cmd;
+ WBUFL(buf, 2) = sd->status.account_id;
+ memcpy(WBUFP(buf, 6), sd->status.name, NAME_LENGTH);
- if( sd->battle_status.max_hp > INT16_MAX )
+ if (sd->battle_status.max_hp > INT16_MAX)
{ // To correctly display the %hp bar. [Skotlex]
- WBUFW(buf,30) = sd->battle_status.hp/(sd->battle_status.max_hp/100);
- WBUFW(buf,32) = 100;
+ WBUFW(buf, 30) = sd->battle_status.hp / (sd->battle_status.max_hp / 100);
+ WBUFW(buf, 32) = 100;
}
else
{
- WBUFW(buf,30) = sd->battle_status.hp;
- WBUFW(buf,32) = sd->battle_status.max_hp;
+ WBUFW(buf, 30) = sd->battle_status.hp;
+ WBUFW(buf, 32) = sd->battle_status.max_hp;
}
+#else
+ const int cmd = 0xa0e;
+ nullpo_retv(sd);
+
+ WBUFW(buf, 0) = cmd;
+ WBUFL(buf, 2) = sd->status.account_id;
+ if (sd->battle_status.max_hp > INT32_MAX) {
+ WBUFL(buf, 6) = sd->battle_status.hp / (sd->battle_status.max_hp / 100);
+ WBUFL(buf, 10) = 100;
+ } else {
+ WBUFL(buf, 6) = sd->battle_status.hp;
+ WBUFL(buf, 10) = sd->battle_status.max_hp;
+ }
+#endif
clif->send(buf, packet_len(cmd), &sd->bl, BG_AREA_WOS);
}
@@ -16064,7 +16303,7 @@ void clif_bg_xy(struct map_session_data *sd)
WBUFW(buf,0)=0x2df;
WBUFL(buf,2)=sd->status.account_id;
memcpy(WBUFP(buf,6), sd->status.name, NAME_LENGTH);
- WBUFW(buf,30)=sd->status.class_;
+ WBUFW(buf,30)=sd->status.class;
WBUFW(buf,32)=sd->bl.x;
WBUFW(buf,34)=sd->bl.y;
@@ -16088,58 +16327,53 @@ void clif_bg_xy_remove(struct map_session_data *sd)
/// Notifies clients of a battleground message (ZC_BATTLEFIELD_CHAT).
/// 02dc <packet len>.W <account id>.L <name>.24B <message>.?B
-void clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes, size_t len)
+void clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes)
{
struct map_session_data *sd;
unsigned char *buf;
+ int len;
nullpo_retv(bgd);
nullpo_retv(name);
nullpo_retv(mes);
- if( !bgd->count || (sd = bg->getavailablesd(bgd)) == NULL )
+
+ if (!bgd->count || (sd = bg->getavailablesd(bgd)) == NULL)
return;
+ len = (int)strlen(mes);
+ Assert_retv(len <= INT16_MAX - NAME_LENGTH - 8);
buf = (unsigned char*)aMalloc((len + NAME_LENGTH + 8)*sizeof(unsigned char));
WBUFW(buf,0) = 0x2dc;
WBUFW(buf,2) = len + NAME_LENGTH + 8;
WBUFL(buf,4) = src_id;
memcpy(WBUFP(buf,8), name, NAME_LENGTH);
- memcpy(WBUFP(buf,32), mes, len);
+ memcpy(WBUFP(buf,32), mes, len); // [!] no NUL terminator
clif->send(buf,WBUFW(buf,2), &sd->bl, BG);
aFree(buf);
}
-void clif_parse_BattleChat(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-/// Validates and processes battlechat messages [pakpil] (CZ_BATTLEFIELD_CHAT).
-/// 0x2db <packet len>.W <text>.?B (<name> : <message>) 00
-void clif_parse_BattleChat(int fd, struct map_session_data* sd)
+/**
+ * Validates and processes battlechat messages [pakpil] (CZ_BATTLEFIELD_CHAT).
+ *
+ * @code
+ * 0x2db <packet len>.W <text>.?B (<name> : <message>) 00
+ * @endcode
+ *
+ * @param fd The incoming file descriptor.
+ * @param sd The related character.
+ */
+void clif_parse_BattleChat(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+void clif_parse_BattleChat(int fd, struct map_session_data *sd)
{
- const char* text = (char*)RFIFOP(fd,4);
- int textlen = RFIFOW(fd,2) - 4;
+ const struct packet_chat_message *packet = RP2PTR(fd);
+ char message[CHAT_SIZE_MAX + NAME_LENGTH + 3 + 1];
- char *name, *message;
- size_t namelen, messagelen;
-
- if( !clif->process_message(sd, 0, &name, &namelen, &message, &messagelen) )
- return;
-
- if( atcommand->exec(fd, sd, message, true) )
+ if (clif->process_chat_message(sd, packet, message, sizeof message) == NULL)
return;
- if( !pc->can_talk(sd) )
- return;
-
- if( battle_config.min_chat_delay ) {
- if( DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0 )
- return;
- sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
- }
-
- pc->update_idle_time(sd, BCIDLE_CHAT);
-
- bg->send_message(sd, text, textlen);
+ bg->send_message(sd, message);
}
/// Notifies client of a battleground score change (ZC_BATTLEFIELD_NOTIFY_POINT).
@@ -16179,7 +16413,7 @@ void clif_sendbgemblem_area(struct map_session_data *sd)
WBUFW(buf, 0) = 0x2dd;
WBUFL(buf,2) = sd->bl.id;
- safestrncpy((char*)WBUFP(buf,6), sd->status.name, NAME_LENGTH); // name don't show in screen.
+ safestrncpy(WBUFP(buf,6), sd->status.name, NAME_LENGTH); // name don't show in screen.
WBUFW(buf,30) = sd->bg_id;
clif->send(buf,packet_len(0x2dd), &sd->bl, AREA);
}
@@ -16190,7 +16424,7 @@ void clif_sendbgemblem_single(int fd, struct map_session_data *sd)
WFIFOHEAD(fd,32);
WFIFOW(fd,0) = 0x2dd;
WFIFOL(fd,2) = sd->bl.id;
- safestrncpy((char*)WFIFOP(fd,6), sd->status.name, NAME_LENGTH);
+ safestrncpy(WFIFOP(fd,6), sd->status.name, NAME_LENGTH);
WFIFOW(fd,30) = sd->bg_id;
WFIFOSET(fd,packet_len(0x2dd));
}
@@ -16402,36 +16636,51 @@ void clif_parse_LessEffect(int fd, struct map_session_data* sd)
sd->state.lesseffect = ( isLess != 0 );
}
-void clif_parse_ItemListWindowSelected(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
+void clif_parse_ItemListWindowSelected(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/// S 07e4 <length>.w <option>.l <val>.l {<index>.w <amount>.w).4b*
-void clif_parse_ItemListWindowSelected(int fd, struct map_session_data* sd) {
- int n = (RFIFOW(fd,2)-12) / 4;
+void clif_parse_ItemListWindowSelected(int fd, struct map_session_data *sd)
+{
+ int n = ((int)RFIFOW(fd,2) - 12) / 4;
int type = RFIFOL(fd,4);
int flag = RFIFOL(fd,8); // Button clicked: 0 = Cancel, 1 = OK
- unsigned short* item_list = (unsigned short*)RFIFOP(fd,12);
+ struct itemlist item_list = { 0 };
+ int i;
if( sd->state.trading || sd->npc_shopid )
return;
- if( flag == 0 || n == 0) {
+ if (flag == 0 || n <= 0) {
clif_menuskill_clear(sd);
return; // Canceled by player.
}
- if( sd->menuskill_id != SO_EL_ANALYSIS && sd->menuskill_id != GN_CHANGEMATERIAL ) {
+ if (n > MAX_INVENTORY)
+ n = MAX_INVENTORY; // It should be impossible to have more than that.
+
+ if (sd->menuskill_id != SO_EL_ANALYSIS && sd->menuskill_id != GN_CHANGEMATERIAL) {
clif_menuskill_clear(sd);
return; // Prevent hacking.
}
+ VECTOR_INIT(item_list);
+ VECTOR_ENSURE(item_list, n, 1);
+ for (i = 0; i < n; i++) {
+ struct itemlist_entry entry = { 0 };
+ entry.id = (int)RFIFOW(fd, 12 + 4 * i) - 2; // Inventory index
+ entry.amount = RFIFOW(fd, 12 + 4 * i + 2);
+ VECTOR_PUSH(item_list, entry);
+ }
+
switch( type ) {
case 0: // Change Material
- skill->changematerial(sd,n,item_list);
+ skill->changematerial(sd, &item_list);
break;
case 1: // Level 1: Pure to Rough
case 2: // Level 2: Rough to Pure
- skill->elementalanalysis(sd,n,type,item_list);
+ skill->elementalanalysis(sd, type, &item_list);
break;
}
+ VECTOR_CLEAR(item_list);
clif_menuskill_clear(sd);
return;
@@ -16498,6 +16747,7 @@ void clif_elemental_info(struct map_session_data *sd) {
/// 0810 <slots>.B
void clif_buyingstore_open(struct map_session_data* sd)
{
+#if PACKETVER >= 20100303
int fd;
nullpo_retv(sd);
@@ -16506,6 +16756,7 @@ void clif_buyingstore_open(struct map_session_data* sd)
WFIFOW(fd,0) = 0x810;
WFIFOB(fd,2) = sd->buyingstore.slots;
WFIFOSET(fd,packet_len(0x810));
+#endif
}
void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -16516,7 +16767,7 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) __attrib
/// 1 = open
void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
const unsigned int blocksize = 8;
- uint8* itemlist;
+ const uint8 *itemlist;
char storename[MESSAGE_SIZE];
unsigned char result;
int zenylimit;
@@ -16528,13 +16779,13 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
// TODO: Make this check global for all variable length packets.
if( packet_len < 89 )
{// minimum packet length
- ShowError("clif_parse_ReqOpenBuyingStore: Malformed packet (expected length=%u, length=%u, account_id=%d).\n", 89, packet_len, sd->bl.id);
+ ShowError("clif_parse_ReqOpenBuyingStore: Malformed packet (expected length=%u, length=%u, account_id=%d).\n", 89U, packet_len, sd->bl.id);
return;
}
zenylimit = RFIFOL(fd,info->pos[1]);
result = RFIFOL(fd,info->pos[2]);
- safestrncpy(storename, (const char*)RFIFOP(fd,info->pos[3]), sizeof(storename));
+ safestrncpy(storename, RFIFOP(fd,info->pos[3]), sizeof(storename));
itemlist = RFIFOP(fd,info->pos[4]);
// so that buyingstore_create knows, how many elements it has access to
@@ -16559,6 +16810,7 @@ void clif_parse_ReqOpenBuyingStore(int fd, struct map_session_data* sd) {
/// ? = nothing
void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short result, unsigned int weight)
{
+#if PACKETVER >= 20100420
int fd;
nullpo_retv(sd);
@@ -16568,6 +16820,7 @@ void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short re
WFIFOW(fd,2) = result;
WFIFOL(fd,4) = weight;
WFIFOSET(fd,packet_len(0x812));
+#endif
}
/// Notification, that the requested buying store was created (ZC_MYITEMLIST_BUYING_STORE).
@@ -16600,6 +16853,7 @@ void clif_buyingstore_myitemlist(struct map_session_data* sd)
/// 0814 <account id>.L <store name>.80B
void clif_buyingstore_entry(struct map_session_data* sd)
{
+#if PACKETVER >= 20100420
uint8 buf[86];
nullpo_retv(sd);
@@ -16608,9 +16862,11 @@ void clif_buyingstore_entry(struct map_session_data* sd)
memcpy(WBUFP(buf,6), sd->message, MESSAGE_SIZE);
clif->send(buf, packet_len(0x814), &sd->bl, AREA_WOS);
+#endif
}
void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd)
{
+#if PACKETVER >= 20100420
int fd;
nullpo_retv(sd);
@@ -16620,6 +16876,7 @@ void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_sessi
WFIFOL(fd,2) = pl_sd->bl.id;
memcpy(WFIFOP(fd,6), pl_sd->message, MESSAGE_SIZE);
WFIFOSET(fd,packet_len(0x814));
+#endif
}
void clif_parse_ReqCloseBuyingStore(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -16633,6 +16890,7 @@ void clif_parse_ReqCloseBuyingStore(int fd, struct map_session_data* sd) {
/// 0816 <account id>.L
void clif_buyingstore_disappear_entry(struct map_session_data* sd)
{
+#if PACKETVER >= 20100309
uint8 buf[6];
nullpo_retv(sd);
@@ -16640,9 +16898,12 @@ void clif_buyingstore_disappear_entry(struct map_session_data* sd)
WBUFL(buf,2) = sd->bl.id;
clif->send(buf, packet_len(0x816), &sd->bl, AREA_WOS);
+#endif
}
+
void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd)
{
+#if PACKETVER >= 20100309
int fd;
nullpo_retv(sd);
@@ -16652,6 +16913,7 @@ void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct
WFIFOW(fd,0) = 0x816;
WFIFOL(fd,2) = pl_sd->bl.id;
WFIFOSET(fd,packet_len(0x816));
+#endif
}
/// Request to open someone else's buying store (CZ_REQ_CLICK_TO_BUYING_STORE).
@@ -16698,7 +16960,7 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) __attri
/// 0819 <packet len>.W <account id>.L <store id>.L { <index>.W <name id>.W <amount>.W }*
void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
const unsigned int blocksize = 6;
- uint8* itemlist;
+ const uint8 *itemlist;
int account_id;
unsigned int count, packet_len, buyer_id;
struct s_packet_db* info = &packet_db[RFIFOW(fd,0)];
@@ -16707,7 +16969,7 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
if( packet_len < 12 )
{// minimum packet length
- ShowError("clif_parse_ReqTradeBuyingStore: Malformed packet (expected length=%u, length=%u, account_id=%d).\n", 12, packet_len, sd->bl.id);
+ ShowError("clif_parse_ReqTradeBuyingStore: Malformed packet (expected length=%u, length=%u, account_id=%d).\n", 12U, packet_len, sd->bl.id);
return;
}
@@ -16720,7 +16982,7 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
if( packet_len%blocksize )
{
- ShowError("clif_parse_ReqTradeBuyingStore: Unexpected item list size %u (account_id=%d, buyer_id=%u, block size=%u)\n", packet_len, sd->bl.id, account_id, blocksize);
+ ShowError("clif_parse_ReqTradeBuyingStore: Unexpected item list size %u (account_id=%d, buyer_id=%d, block size=%u)\n", packet_len, sd->bl.id, account_id, blocksize);
return;
}
count = packet_len/blocksize;
@@ -16736,6 +16998,7 @@ void clif_parse_ReqTradeBuyingStore(int fd, struct map_session_data* sd) {
/// ? = nothing
void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short result)
{
+#if PACKETVER >= 20100420
int fd;
nullpo_retv(sd);
@@ -16744,22 +17007,36 @@ void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short resu
WFIFOW(fd,0) = 0x81a;
WFIFOW(fd,2) = result;
WFIFOSET(fd,packet_len(0x81a));
+#endif
}
/// Updates the zeny limit and an item in the buying store item list (ZC_UPDATE_ITEM_FROM_BUYING_STORE).
/// 081b <name id>.W <amount>.W <limit zeny>.L
-void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount)
+void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny)
{
int fd;
+#if PACKETVER < 20141016 // TODO : not sure for client date [Napster]
+ const int cmd = 0x81b;
+#else
+ const int cmd = 0x9e6;
+#endif
+ const int len = packet_len(cmd);
nullpo_retv(sd);
fd = sd->fd;
- WFIFOHEAD(fd,packet_len(0x81b));
- WFIFOW(fd,0) = 0x81b;
- WFIFOW(fd,2) = nameid;
- WFIFOW(fd,4) = amount; // amount of nameid received
- WFIFOL(fd,6) = sd->buyingstore.zenylimit;
- WFIFOSET(fd,packet_len(0x81b));
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = cmd;
+ WFIFOW(fd, 2) = nameid;
+ WFIFOW(fd, 4) = amount; // amount of nameid received
+#if PACKETVER < 20141016
+ WFIFOL(fd, 6) = sd->buyingstore.zenylimit;
+#else
+ WFIFOL(fd, 6) = zeny; // zeny
+ WFIFOL(fd, 10) = sd->buyingstore.zenylimit;
+ WFIFOL(fd, 14) = char_id; // GID
+ WFIFOL(fd, 18) = (int)time(NULL); // date
+#endif
+ WFIFOSET(fd, len);
}
/// Deletes item from inventory, that was sold to a buying store (ZC_ITEM_DELETE_BUYING_STORE).
@@ -16770,6 +17047,7 @@ void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short na
/// NOTE: This function has to be called _instead_ of clif_delitem/clif_dropitem.
void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsigned short amount, int price)
{
+#if PACKETVER >= 20100420
int fd;
nullpo_retv(sd);
@@ -16780,6 +17058,7 @@ void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsi
WFIFOW(fd,4) = amount;
WFIFOL(fd,6) = price; // price per item, client calculates total Zeny by itself
WFIFOSET(fd,packet_len(0x81c));
+#endif
}
/// Notifies the seller, that a buying store trade failed (ZC_FAILED_TRADE_BUYING_STORE_TO_SELLER).
@@ -16791,6 +17070,7 @@ void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsi
/// ? = nothing
void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short result, unsigned short nameid)
{
+#if PACKETVER >= 20100420
int fd;
nullpo_retv(sd);
@@ -16800,6 +17080,7 @@ void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short res
WFIFOW(fd,2) = result;
WFIFOW(fd,4) = nameid;
WFIFOSET(fd,packet_len(0x824));
+#endif
}
void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -16827,7 +17108,7 @@ void clif_parse_SearchStoreInfo(int fd, struct map_session_data* sd) {
if( packet_len < 15 )
{// minimum packet length
- ShowError("clif_parse_SearchStoreInfo: Malformed packet (expected length=%u, length=%u, account_id=%d).\n", 15, packet_len, sd->bl.id);
+ ShowError("clif_parse_SearchStoreInfo: Malformed packet (expected length=%u, length=%u, account_id=%d).\n", 15U, packet_len, sd->bl.id);
return;
}
@@ -16919,6 +17200,7 @@ void clif_search_store_info_ack(struct map_session_data* sd)
/// 4 = "No sale (purchase) information available." (0x705)
void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason)
{
+#if PACKETVER >= 20100601
int fd;
nullpo_retv(sd);
@@ -16927,6 +17209,7 @@ void clif_search_store_info_failed(struct map_session_data* sd, unsigned char re
WFIFOW(fd,0) = 0x837;
WFIFOB(fd,2) = reason;
WFIFOSET(fd,packet_len(0x837));
+#endif
}
void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -16944,6 +17227,7 @@ void clif_parse_SearchStoreInfoNextPage(int fd, struct map_session_data* sd)
/// 1 = Search Stores (Cash), asks for confirmation, when clicking a store
void clif_open_search_store_info(struct map_session_data* sd)
{
+#if PACKETVER >= 20100608
int fd;
nullpo_retv(sd);
@@ -16955,6 +17239,7 @@ void clif_open_search_store_info(struct map_session_data* sd)
WFIFOB(fd,4) = (unsigned char)min(sd->searchstore.uses, UINT8_MAX);
#endif
WFIFOSET(fd,packet_len(0x83a));
+#endif
}
void clif_parse_CloseSearchStoreInfo(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -16985,6 +17270,7 @@ void clif_parse_SearchStoreInfoListItemClick(int fd, struct map_session_data* sd
/// 083d <xPos>.W <yPos>.W
void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y)
{
+#if PACKETVER >= 20100608
int fd;
nullpo_retv(sd);
@@ -16994,6 +17280,7 @@ void clif_search_store_info_click_ack(struct map_session_data* sd, short x, shor
WFIFOW(fd,2) = x;
WFIFOW(fd,4) = y;
WFIFOSET(fd,packet_len(0x83d));
+#endif
}
/// Parse function for packet debugging.
@@ -17009,10 +17296,10 @@ void clif_parse_debug(int fd,struct map_session_data *sd) {
if( packet_len == -1 ) {// variable length
packet_len = RFIFOW(fd,2); // clif_parse ensures, that this amount of data is already received
}
- ShowDebug("Packet debug of 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
+ ShowDebug("Packet debug of 0x%04X (length %d), %s session #%d, %d/%d (AID/CID)\n", (unsigned int)cmd, packet_len, sd->state.active ? "authed" : "unauthed", fd, sd->status.account_id, sd->status.char_id);
} else {
packet_len = (int)RFIFOREST(fd);
- ShowDebug("Packet debug of 0x%04X (length %d), session #%d\n", cmd, packet_len, fd);
+ ShowDebug("Packet debug of 0x%04X (length %d), session #%d\n", (unsigned int)cmd, packet_len, fd);
}
ShowDump(RFIFOP(fd,0), packet_len);
@@ -17262,6 +17549,7 @@ void clif_parse_SkillSelectMenu(int fd, struct map_session_data *sd) {
*------------------------------------------*/
void clif_charm(struct map_session_data *sd)
{
+#if PACKETVER >= 20110809
unsigned char buf[10];
nullpo_retv(sd);
@@ -17271,6 +17559,7 @@ void clif_charm(struct map_session_data *sd)
WBUFW(buf,6) = sd->charm_type;
WBUFW(buf,8) = sd->charm_count;
clif->send(buf,packet_len(0x08cf),&sd->bl,AREA);
+#endif
}
void clif_parse_MoveItem(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -17308,8 +17597,8 @@ void clif_parse_MoveItem(int fd, struct map_session_data *sd) {
/* [Ind/Hercules] */
void clif_cashshop_db(void) {
- config_t cashshop_conf;
- config_setting_t *cashshop = NULL, *cats = NULL;
+ struct config_t cashshop_conf;
+ struct config_setting_t *cashshop = NULL, *cats = NULL;
const char *config_filename = "db/cashshop_db.conf"; // FIXME hardcoded name
int i, item_count_t = 0;
for( i = 0; i < CASHSHOP_TAB_MAX; i++ ) {
@@ -17317,16 +17606,14 @@ void clif_cashshop_db(void) {
clif->cs.item_count[i] = 0;
}
- if (libconfig->read_file(&cashshop_conf, config_filename)) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&cashshop_conf, config_filename))
return;
- }
cashshop = libconfig->lookup(&cashshop_conf, "cash_shop");
if( cashshop != NULL && (cats = libconfig->setting_get_elem(cashshop, 0)) != NULL ) {
for(i = 0; i < CASHSHOP_TAB_MAX; i++) {
- config_setting_t *cat;
+ struct config_setting_t *cat;
char entry_name[10];
sprintf(entry_name,"cat_%d",i);
@@ -17335,7 +17622,7 @@ void clif_cashshop_db(void) {
int k, item_count = libconfig->setting_length(cat);
for(k = 0; k < item_count; k++) {
- config_setting_t *entry = libconfig->setting_get_elem(cat,k);
+ struct config_setting_t *entry = libconfig->setting_get_elem(cat,k);
const char *name = config_setting_name(entry);
int price = libconfig->setting_get_int(entry);
struct item_data * data = NULL;
@@ -17374,6 +17661,7 @@ void clif_cashshop_db(void) {
/// Items that are in favorite tab of inventory (ZC_ITEM_FAVORITE).
/// 0900 <index>.W <favorite>.B
void clif_favorite_item(struct map_session_data* sd, unsigned short index) {
+#if PACKETVER >= 20120410
int fd;
nullpo_retv(sd);
@@ -17383,9 +17671,11 @@ void clif_favorite_item(struct map_session_data* sd, unsigned short index) {
WFIFOW(fd,2) = index+2;
WFIFOB(fd,4) = (sd->status.inventory[index].favorite == 1) ? 0 : 1;
WFIFOSET(fd,packet_len(0x908));
+#endif
}
void clif_snap( struct block_list *bl, short x, short y ) {
+#if PACKETVER >= 20110809
unsigned char buf[10];
nullpo_retv(bl);
@@ -17395,9 +17685,12 @@ void clif_snap( struct block_list *bl, short x, short y ) {
WBUFW(buf,8) = y;
clif->send(buf,packet_len(0x8d2),bl,AREA);
+#endif
}
-void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
+void clif_monster_hp_bar(struct mob_data *md, struct map_session_data *sd)
+{
+#if PACKETVER >= 20120228
struct packet_monster_hp p;
nullpo_retv(md);
@@ -17408,6 +17701,7 @@ void clif_monster_hp_bar( struct mob_data* md, struct map_session_data *sd ) {
p.MaxHP = md->status.max_hp;
clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
}
/* [Ind/Hercules] placeholder for unsupported incoming packets (avoids server disconnecting client) */
@@ -17436,7 +17730,9 @@ void clif_parse_CashShopClose(int fd, struct map_session_data *sd) {
}
void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
+void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd)
+{
+#if PACKETVER >= 20110614
int i, j = 0;
for( i = 0; i < CASHSHOP_TAB_MAX; i++ ) {
@@ -17456,6 +17752,7 @@ void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) {
WFIFOSET(fd, 8 + ( clif->cs.item_count[i] * 6 ));
}
+#endif
}
void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -17549,7 +17846,9 @@ void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) {
void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
/* [Ind/Hercules] */
-void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) {
+void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd)
+{
+#if PACKETVER >= 20110222
short tab = RFIFOW(fd, 2);
int j;
@@ -17568,9 +17867,12 @@ void clif_parse_CashShopReqTab(int fd, struct map_session_data *sd) {
}
WFIFOSET(fd, 10 + ( clif->cs.item_count[tab] * 6 ));
+#endif
}
+
/* [Ind/Hercules] */
-void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t)
+{
#if PACKETVER >= 20121010
struct packet_maptypeproperty2 p;
struct map_session_data *sd = NULL;
@@ -17621,26 +17923,29 @@ void clif_partytickack(struct map_session_data* sd, bool flag) {
WFIFOSET(sd->fd, packet_len(0x2c9));
}
-void clif_ShowScript(struct block_list* bl, const char* message) {
+void clif_ShowScript(struct block_list *bl, const char *message)
+{
+#if PACKETVER >= 20110111
char buf[256];
- size_t len;
+ int len;
nullpo_retv(bl);
- if(!message)
+ if (message == NULL)
return;
- len = strlen(message)+1;
+ len = (int)strlen(message)+1;
- if (len > sizeof(buf)-8) {
- ShowWarning("clif_ShowScript: Truncating too long message '%s' (len=%"PRIuS").\n", message, len);
- len = sizeof(buf)-8;
+ if (len > (int)sizeof(buf)-8) {
+ ShowWarning("clif_ShowScript: Truncating too long message '%s' (len=%d).\n", message, len);
+ len = (int)sizeof(buf)-8;
}
- WBUFW(buf,0)=0x8b3;
- WBUFW(buf,2)=len+8;
- WBUFL(buf,4)=bl->id;
- safestrncpy((char *) WBUFP(buf,8),message,len);
- clif->send((unsigned char *) buf,WBUFW(buf,2),bl,ALL_CLIENT);
+ WBUFW(buf,0) = 0x8b3;
+ WBUFW(buf,2) = len+8;
+ WBUFL(buf,4) = bl->id;
+ safestrncpy(WBUFP(buf,8),message,len);
+ clif->send(buf,WBUFW(buf,2),bl,AREA);
+#endif
}
void clif_status_change_end(struct block_list *bl, int tid, enum send_target target, int type) {
@@ -17679,7 +17984,8 @@ void clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK
}
}
-void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, char *name) {
+void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, const char *name)
+{
struct packet_bgqueue_notice_delete p;
nullpo_retv(sd);
@@ -17691,8 +17997,9 @@ void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_
}
void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) {
- struct packet_bgqueue_register *p = RP2PTR(fd);
+void clif_parse_bgqueue_register(int fd, struct map_session_data *sd)
+{
+ const struct packet_bgqueue_register *p = RP2PTR(fd);
struct bg_arena *arena = NULL;
if( !bg->queue_on ) return; /* temp, until feature is complete */
@@ -17729,19 +18036,21 @@ void clif_bgqueue_update_info(struct map_session_data *sd, unsigned char arena_i
}
void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) {
- struct packet_bgqueue_checkstate *p = RP2PTR(fd);
+void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd)
+{
+ const struct packet_bgqueue_checkstate *p = RP2PTR(fd);
- nullpo_retv(sd);
- if ( sd->bg_queue.arena && sd->bg_queue.type ) {
+ if (sd->bg_queue.arena && sd->bg_queue.type) {
clif->bgqueue_update_info(sd,sd->bg_queue.arena->id,bg->id2pos(sd->bg_queue.arena->queue_id,sd->status.account_id));
- } else
+ } else {
clif->bgqueue_notice_delete(sd, BGQND_FAIL_NOT_QUEUING,p->bg_name);
+ }
}
void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) {
- struct packet_bgqueue_revoke_req *p = RP2PTR(fd);
+void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd)
+{
+ const struct packet_bgqueue_revoke_req *p = RP2PTR(fd);
if( sd->bg_queue.arena )
bg->queue_pc_cleanup(sd);
@@ -17750,8 +18059,9 @@ void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) {
}
void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) {
- struct packet_bgqueue_battlebegin_ack *p = RP2PTR(fd);
+void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd)
+{
+ const struct packet_bgqueue_battlebegin_ack *p = RP2PTR(fd);
struct bg_arena *arena;
if( !bg->queue_on ) return; /* temp, until feature is complete */
@@ -17792,14 +18102,17 @@ void clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char arena_
clif->send(&p,sizeof(p), &sd->bl, target);
}
-void clif_scriptclear(struct map_session_data *sd, int npcid) {
+void clif_scriptclear(struct map_session_data *sd, int npcid)
+{
+#if PACKETVER >= 20110928
struct packet_script_clear p;
nullpo_retv(sd);
p.PacketType = script_clearType;
p.NpcID = npcid;
- clif->send(&p,sizeof(p), &sd->bl, SELF);
+ clif->send(&p, sizeof(p), &sd->bl, SELF);
+#endif
}
/* Made Possible Thanks to Yommy! */
@@ -17887,10 +18200,11 @@ void clif_cart_additem_ack(struct map_session_data *sd, int flag) {
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
-void clif_parse_BankDeposit(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/* Bank System [Yommy/Hercules] */
-void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
- struct packet_banking_deposit_req *p = RP2PTR(fd);
+void clif_parse_BankDeposit(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+void clif_parse_BankDeposit(int fd, struct map_session_data *sd)
+{
+ const struct packet_banking_deposit_req *p = RP2PTR(fd);
int money;
if (!battle_config.feature_banking) {
@@ -17903,9 +18217,10 @@ void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
pc->bank_deposit(sd,money);
}
-void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {
- struct packet_banking_withdraw_req *p = RP2PTR(fd);
+void clif_parse_BankWithdraw(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
+void clif_parse_BankWithdraw(int fd, struct map_session_data *sd)
+{
+ const struct packet_banking_withdraw_req *p = RP2PTR(fd);
int money;
if (!battle_config.feature_banking) {
@@ -17919,7 +18234,9 @@ void clif_parse_BankWithdraw(int fd, struct map_session_data* sd) {
}
void clif_parse_BankCheck(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-void clif_parse_BankCheck(int fd, struct map_session_data* sd) {
+void clif_parse_BankCheck(int fd, struct map_session_data* sd)
+{
+#if PACKETVER >= 20130313
struct packet_banking_check p;
if (!battle_config.feature_banking) {
@@ -17932,6 +18249,7 @@ void clif_parse_BankCheck(int fd, struct map_session_data* sd) {
p.Reason = (short)0;
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
void clif_parse_BankOpen(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -17944,7 +18262,9 @@ void clif_parse_BankClose(int fd, struct map_session_data* sd) {
return;
}
-void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason) {
+void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason)
+{
+#if PACKETVER >= 20130313
struct packet_banking_deposit_ack p;
nullpo_retv(sd);
@@ -17954,9 +18274,12 @@ void clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK r
p.Reason = (short)reason;
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
-void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason) {
+void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason)
+{
+#if PACKETVER >= 20130313
struct packet_banking_withdraw_ack p;
nullpo_retv(sd);
@@ -17966,6 +18289,7 @@ void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK
p.Reason = (short)reason;
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
/* TODO: official response packet (tried 0x8cb/0x97b but the display was quite screwed up.) */
@@ -17978,7 +18302,7 @@ void clif_show_modifiers (struct map_session_data *sd) {
snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%",
sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death);
- clif->broadcast2(&sd->bl,output, strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF);
+ clif->broadcast2(&sd->bl, output, (int)strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF);
}
}
@@ -18140,32 +18464,30 @@ void clif_parse_NPCMarketClosed(int fd, struct map_session_data *sd) {
sd->npc_shopid = 0;
}
-void clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char response) {
+void clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, unsigned char response)
+{
#if PACKETVER >= 20131223
unsigned short c = 0;
nullpo_retv(sd);
- nullpo_retv(req);
+ nullpo_retv(item_list);
npcmarket_result.PacketType = npcmarketresultackType;
npcmarket_result.result = response == 0 ? 1 : 0;/* find other values */
- if( npcmarket_result.result ) {
- unsigned short i, list_size = (req->PacketLength - 4) / sizeof(req->list[0]), j;
- struct npc_data* nd;
- struct npc_item_list *shop = NULL;
- unsigned short shop_size = 0;
-
- nd = map->id2nd(sd->npc_shopid);
-
- shop = nd->u.scr.shop->item;
- shop_size = nd->u.scr.shop->items;
+ if (npcmarket_result.result) {
+ struct npc_data *nd = map->id2nd(sd->npc_shopid);
+ struct npc_item_list *shop = nd->u.scr.shop->item;
+ unsigned short shop_size = nd->u.scr.shop->items;
+ int i;
- for(i = 0; i < list_size; i++) {
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ const struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ int j;
- npcmarket_result.list[i].ITID = req->list[i].ITID;
- npcmarket_result.list[i].qty = req->list[i].qty;
+ npcmarket_result.list[i].ITID = entry->id;
+ npcmarket_result.list[i].qty = entry->amount;
- ARR_FIND( 0, shop_size, j, req->list[i].ITID == shop[j].nameid );
+ ARR_FIND( 0, shop_size, j, entry->id == shop[j].nameid);
npcmarket_result.list[i].price = (j != shop_size) ? shop[j].value : 0;
@@ -18180,11 +18502,32 @@ void clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_npc
}
void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
-void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd) {
+void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd)
+{
#if PACKETVER >= 20131223
- struct packet_npc_market_purchase *p = RP2PTR(fd);
+ const struct packet_npc_market_purchase *p = RP2PTR(fd);
+ int response = 0, i;
+ int count = (p->PacketLength - 4) / sizeof p->list[0];
+ struct itemlist item_list;
+
+ Assert_retv(count >= 0 && count <= MAX_INVENTORY);
+
+ VECTOR_INIT(item_list);
+ VECTOR_ENSURE(item_list, count, 1);
+
+ for (i = 0; i < count; i++) {
+ struct itemlist_entry entry = { 0 };
+
+ entry.id = p->list[i].ITID;
+ entry.amount = p->list[i].qty;
+
+ VECTOR_PUSH(item_list, entry);
+ }
+
+ response = npc->market_buylist(sd, &item_list);
+ clif->npc_market_purchase_ack(sd, &item_list, response);
- clif->npc_market_purchase_ack(sd,p,npc->market_buylist(sd,(p->PacketLength - 4) / sizeof(p->list[0]),p));
+ VECTOR_CLEAR(item_list);
#endif
}
@@ -18203,10 +18546,11 @@ void clif_PartyLeaderChanged(struct map_session_data *sd, int prev_leader_aid, i
void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
/* Roulette System [Yommy/Hercules] */
void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) {
+#if PACKETVER >= 20140612
struct packet_roulette_open_ack p;
if( !battle_config.feature_roulette ) {
- clif->message(fd,"Roulette is disabled");
+ clif->message(fd, msg_fd(fd,82)); // Roulette is disabled
return;
}
@@ -18221,15 +18565,18 @@ void clif_parse_RouletteOpen(int fd, struct map_session_data* sd) {
p.SilverPoint = pc_readglobalreg(sd, script->add_str("TmpRouletteSilver"));
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
-void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) {
+void clif_parse_RouletteInfo(int fd, struct map_session_data* sd)
+{
+#if PACKETVER >= 20140612
struct packet_roulette_info_ack p;
unsigned short i, j, count = 0;
if( !battle_config.feature_roulette ) {
- clif->message(fd,"Roulette is disabled");
+ clif->message(fd, msg_fd(fd,82)); // Roulette is disabled
return;
}
@@ -18247,13 +18594,13 @@ void clif_parse_RouletteInfo(int fd, struct map_session_data* sd) {
}
}
clif->send(&p,sizeof(p), &sd->bl, SELF);
- return;
+#endif
}
void clif_parse_RouletteClose(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
void clif_parse_RouletteClose(int fd, struct map_session_data* sd) {
if( !battle_config.feature_roulette ) {
- clif->message(fd,"Roulette is disabled");
+ clif->message(fd, msg_fd(fd,82)); // Roulette is disabled
return;
}
@@ -18269,7 +18616,7 @@ void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) {
short stage = sd->roulette.stage;
if( !battle_config.feature_roulette ) {
- clif->message(fd,"Roulette is disabled");
+ clif->message(fd, msg_fd(fd,82)); // Roulette is disabled
return;
}
@@ -18304,7 +18651,7 @@ void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) {
it.nameid = clif->rd.nameid[stage][0];
it.identify = 1;
- pc->additem(sd, &it, clif->rd.qty[stage][0], LOG_TYPE_OTHER);/** TODO maybe a new log type for roulette items? **/
+ pc->additem(sd, &it, clif->rd.qty[stage][0], LOG_TYPE_ROULETTE);/** TODO maybe a new log type for roulette items? **/
sd->roulette.stage = 0;
result = GENERATE_ROULETTE_LOSING;
@@ -18321,11 +18668,13 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) __attribut
/**
* Request to cash in!
**/
-void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
+void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd)
+{
+#if PACKETVER >= 20140612
struct packet_roulette_itemrecv_ack p;
if( !battle_config.feature_roulette ) {
- clif->message(fd,"Roulette is disabled");
+ clif->message(fd, msg_fd(fd,82)); // Roulette is disabled
return;
}
@@ -18339,7 +18688,7 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
it.nameid = clif->rd.nameid[sd->roulette.prizeStage][sd->roulette.prizeIdx];
it.identify = 1;
- switch (pc->additem(sd, &it, clif->rd.qty[sd->roulette.prizeStage][sd->roulette.prizeIdx], LOG_TYPE_OTHER)) {
+ switch (pc->additem(sd, &it, clif->rd.qty[sd->roulette.prizeStage][sd->roulette.prizeIdx], LOG_TYPE_ROULETTE)) {
case 0:
p.Result = RECV_ITEM_SUCCESS;
sd->roulette.claimPrize = false;
@@ -18364,12 +18713,12 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) {
p.Result = RECV_ITEM_FAILED;
clif->send(&p,sizeof(p), &sd->bl, SELF);
- return;
+#endif
}
bool clif_parse_roulette_db(void) {
- config_t roulette_conf;
- config_setting_t *roulette = NULL, *levels = NULL;
+ struct config_t roulette_conf;
+ struct config_setting_t *roulette = NULL, *levels = NULL;
const char *config_filename = "db/roulette_db.conf"; // FIXME hardcoded name
int i, j, item_count_t = 0;
@@ -18377,15 +18726,13 @@ bool clif_parse_roulette_db(void) {
clif->rd.items[i] = 0;
}
- if (libconfig->read_file(&roulette_conf, config_filename)) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&roulette_conf, config_filename))
return false;
- }
roulette = libconfig->lookup(&roulette_conf, "roulette");
if( roulette != NULL && (levels = libconfig->setting_get_elem(roulette, 0)) != NULL ) {
for(i = 0; i < MAX_ROULETTE_LEVEL; i++) {
- config_setting_t *level;
+ struct config_setting_t *level;
char entry_name[10];
sprintf(entry_name,"level_%d",i+1);
@@ -18394,7 +18741,7 @@ bool clif_parse_roulette_db(void) {
int k, item_count = libconfig->setting_length(level);
for(k = 0; k < item_count; k++) {
- config_setting_t *entry = libconfig->setting_get_elem(level,k);
+ struct config_setting_t *entry = libconfig->setting_get_elem(level,k);
const char *name = config_setting_name(entry);
int qty = libconfig->setting_get_int(entry);
struct item_data * data = NULL;
@@ -18461,7 +18808,9 @@ bool clif_parse_roulette_db(void) {
/**
*
**/
-void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID) {
+void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID)
+{
+#if PACKETVER >= 20140612
struct packet_roulette_generate_ack p;
nullpo_retv(sd);
@@ -18475,6 +18824,7 @@ void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char resul
p.RemainSilver = pc_readglobalreg(sd, script->add_str("TmpRouletteSilver"));
clif->send(&p,sizeof(p), &sd->bl, SELF);
+#endif
}
/**
@@ -18482,6 +18832,7 @@ void clif_roulette_generate_ack(struct map_session_data *sd, unsigned char resul
*/
void clif_openmergeitem(int fd, struct map_session_data *sd)
{
+#if PACKETVER > 20120228
int i = 0, n = 0, j = 0;
struct merge_item merge_items[MAX_INVENTORY];
struct merge_item *merge_items_[MAX_INVENTORY] = {0};
@@ -18524,6 +18875,7 @@ void clif_openmergeitem(int fd, struct map_session_data *sd)
for ( i = 0; i < j; i++ )
WFIFOW(fd,i*2+4) = merge_items_[i]->position;
WFIFOSET(fd,2*j+4);
+#endif
}
int clif_comparemergeitem(const void *a, const void *b)
@@ -18540,6 +18892,7 @@ int clif_comparemergeitem(const void *a, const void *b)
void clif_ackmergeitems(int fd, struct map_session_data *sd)
{
+#if PACKETVER > 20120228
int i = 0, n = 0, length = 0, count = 0;
int16 nameid = 0, indexes[MAX_INVENTORY] = {0}, amounts[MAX_INVENTORY] = {0};
struct item item_data;
@@ -18619,6 +18972,7 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd)
WFIFOW(fd,4) = count;
WFIFOB(fd,6) = MERGEITEM_SUCCESS;
WFIFOSET(fd,7);
+#endif
}
void clif_cancelmergeitem (int fd, struct map_session_data *sd)
@@ -18629,6 +18983,7 @@ void clif_cancelmergeitem (int fd, struct map_session_data *sd)
void clif_dressroom_open(struct map_session_data *sd, int view)
{
+#if PACKETVER >= 20150513
int fd;
nullpo_retv(sd);
@@ -18638,6 +18993,7 @@ void clif_dressroom_open(struct map_session_data *sd, int view)
WFIFOW(fd,0)=0xa02;
WFIFOW(fd,2)=view;
WFIFOSET(fd,packet_len(0xa02));
+#endif
}
/// Request to select cart's visual look for new cart design (ZC_SELECTCART).
@@ -18662,6 +19018,64 @@ void clif_selectcart(struct map_session_data *sd)
#endif
}
+/// Starts navigation to the given target on client side
+void clif_navigate_to(struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id)
+{
+// probably this packet with other fields present in older packet versions
+#if PACKETVER >= 20120307
+ int fd;
+
+ nullpo_retv(sd);
+ nullpo_retv(mapname);
+ fd = sd->fd;
+ WFIFOHEAD(fd, packet_len(0x8e2));
+ WFIFOW(fd, 0) = 0x8e2;
+
+ // How detailed will our navigation be?
+ if (mob_id > 0) {
+ x = 0;
+ y = 0;
+ WFIFOB(fd, 2) = 3; // monster with destination field
+ } else if (x > 0 && y > 0) {
+ WFIFOB(fd, 2) = 0; // with coordinates
+ } else {
+ x = 0;
+ y = 0;
+ WFIFOB(fd, 2) = 1; // without coordinates(will fail if you are already on the map)
+ }
+
+ // Which services can be used for transportation?
+ WFIFOB(fd, 3) = flag;
+ // If this flag is set, the navigation window will not be opened up
+ WFIFOB(fd, 4) = hideWindow;
+ // Target map
+ safestrncpy((char*)WFIFOP(fd, 5), mapname, MAP_NAME_LENGTH_EXT);
+ // Target x
+ WFIFOW(fd, 21) = x;
+ // Target y
+ WFIFOW(fd, 23) = y;
+ // Target monster ID
+ WFIFOW(fd, 25) = mob_id;
+ WFIFOSET(fd, packet_len(0x8e2));
+#endif
+}
+
+/**
+ * Returns the name of the given bl, in a client-friendly format.
+ *
+ * @param bl The requested bl.
+ * @return The bl's name (guaranteed to be non-NULL).
+ */
+const char *clif_get_bl_name(const struct block_list *bl)
+{
+ const char *name = status->get_name(bl);
+
+ if (name == NULL)
+ return "Unknown";
+
+ return name;
+}
+
/* */
unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) {
if( sd ) {
@@ -18761,7 +19175,7 @@ int clif_parse(int fd) {
// filter out invalid / unsupported packets
if (cmd > MAX_PACKET_DB || cmd < MIN_PACKET_DB || packet_db[cmd].len == 0) {
ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x (0x%04x), %"PRIuS" bytes received), disconnecting session #%d.\n",
- cmd, RFIFOW(fd,0), RFIFOREST(fd), fd);
+ (unsigned int)cmd, RFIFOW(fd,0), RFIFOREST(fd), fd);
#ifdef DUMP_INVALID_PACKET
ShowDump(RFIFOP(fd,0), RFIFOREST(fd));
#endif
@@ -18777,7 +19191,7 @@ int clif_parse(int fd) {
packet_len = RFIFOW(fd,2);
if (packet_len < 4 || packet_len > 32768) {
- ShowWarning("clif_parse: Received packet 0x%04x specifies invalid packet_len (%d), disconnecting session #%d.\n", cmd, packet_len, fd);
+ ShowWarning("clif_parse: Received packet 0x%04x specifies invalid packet_len (%d), disconnecting session #%d.\n", (unsigned int)cmd, packet_len, fd);
#ifdef DUMP_INVALID_PACKET
ShowDump(RFIFOP(fd,0), RFIFOREST(fd));
#endif
@@ -18791,7 +19205,11 @@ int clif_parse(int fd) {
return 0; // not enough data received to form the packet
if( battle_config.packet_obfuscation == 2 || cmd != RFIFOW(fd, 0) || (sd && sd->parse_cmd_func == clif_parse_cmd_decrypt) ) {
- RFIFOW(fd, 0) = cmd;
+ // Note: Overriding const qualifier to re-inject the decoded packet ID.
+#define RFIFOP_mutable(fd, pos) ((void *)(sockt->session[fd]->rdata + sockt->session[fd]->rdata_pos + (pos)))
+ int16 *packet_id = RFIFOP_mutable(fd, 0);
+#undef RFIFOP_mutable
+ *packet_id = cmd;
if( sd ) {
sd->cryptKey = (( sd->cryptKey * clif->cryptKey[1] ) + clif->cryptKey[2]) & 0xFFFFFFFF; // Update key for the next packet
}
@@ -18865,12 +19283,12 @@ static void __attribute__ ((unused)) packetdb_addpacket(short cmd, int len, ...)
pFunc func;
if (cmd > MAX_PACKET_DB) {
- ShowError("Packet Error: packet 0x%x is greater than the maximum allowed (0x%x), skipping...\n", cmd, MAX_PACKET_DB);
+ ShowError("Packet Error: packet 0x%x is greater than the maximum allowed (0x%x), skipping...\n", (unsigned int)cmd, (unsigned int)MAX_PACKET_DB);
return;
}
if (cmd < MIN_PACKET_DB) {
- ShowError("Packet Error: packet 0x%x is lower than the minimum allowed (0x%x), skipping...\n", cmd, MIN_PACKET_DB);
+ ShowError("Packet Error: packet 0x%x is lower than the minimum allowed (0x%x), skipping...\n", (unsigned int)cmd, (unsigned int)MIN_PACKET_DB);
return;
}
@@ -19163,6 +19581,7 @@ void clif_defaults(void) {
clif->autoshadowspell_list = clif_autoshadowspell_list;
clif->skill_itemlistwindow = clif_skill_itemlistwindow;
clif->sc_load = clif_status_change2;
+ clif->sc_continue = clif_status_change2;
clif->sc_end = clif_status_change_end;
clif->initialstatus = clif_initialstatus;
clif->cooldown_list = clif_skill_cooldown_list;
@@ -19196,7 +19615,7 @@ void clif_defaults(void) {
clif->skill_poseffect = clif_skill_poseffect;
clif->skill_estimation = clif_skill_estimation;
clif->skill_warppoint = clif_skill_warppoint;
- clif->skillcasting = clif_skillcasting;
+ clif->useskill = clif_useskill;
clif->produce_effect = clif_produceeffect;
clif->devotion = clif_devotion;
clif->spiritball = clif_spiritball;
@@ -19244,7 +19663,8 @@ void clif_defaults(void) {
clif->message = clif_displaymessage;
clif->messageln = clif_displaymessage2;
clif->messages = clif_displaymessage_sprintf;
- clif->process_message = clif_process_message;
+ clif->process_chat_message = clif_process_chat_message;
+ clif->process_whisper_message = clif_process_whisper_message;
clif->wisexin = clif_wisexin;
clif->wisall = clif_wisall;
clif->PMIgnoreList = clif_PMIgnoreList;
@@ -19481,6 +19901,10 @@ void clif_defaults(void) {
clif->ackmergeitems = clif_ackmergeitems;
/* Cart Deco */
clif->selectcart = clif_selectcart;
+ /* */
+ clif->isdisguised = clif_isdisguised;
+ clif->navigate_to = clif_navigate_to;
+ clif->bl_type = clif_bl_type;
/*------------------------
*- Parse Incoming Packet
@@ -19723,8 +20147,9 @@ void clif_defaults(void) {
clif->pNPCMarketClosed = clif_parse_NPCMarketClosed;
clif->pNPCMarketPurchase = clif_parse_NPCMarketPurchase;
/* */
- clif->add_random_options = clif_add_random_options;
+ clif->add_item_options = clif_add_item_options;
clif->pHotkeyRowShift = clif_parse_HotkeyRowShift;
clif->dressroom_open = clif_dressroom_open;
clif->pOneClick_ItemIdentify = clif_parse_OneClick_ItemIdentify;
+ clif->get_bl_name = clif_get_bl_name;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index d68a09393..ccb227267 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -40,6 +40,7 @@ struct guild;
struct homun_data;
struct item;
struct item_data;
+struct itemlist; // map/itemdb.h
struct map_session_data;
struct mercenary_data;
struct mob_data;
@@ -59,14 +60,16 @@ struct view_data;
**/
#define packet_len(cmd) packet_db[cmd].len
#define clif_menuskill_clear(sd) ((sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0)
-#define clif_disp_onlyself(sd,mes,len) clif->disp_message( &(sd)->bl, (mes), (len), SELF )
+#define clif_disp_onlyself(sd, mes) clif->disp_message(&(sd)->bl, (mes), SELF)
#define MAX_ROULETTE_LEVEL 7 /** client-defined value **/
#define MAX_ROULETTE_COLUMNS 9 /** client-defined value **/
#define RGB2BGR(c) (((c) & 0x0000FF) << 16 | ((c) & 0x00FF00) | ((c) & 0xFF0000) >> 16)
+#define COLOR_CYAN 0x00ffffU
#define COLOR_RED 0xff0000U
#define COLOR_GREEN 0x00ff00U
#define COLOR_WHITE 0xffffffU
+#define COLOR_YELLOW 0xffff00U
#define COLOR_DEFAULT COLOR_GREEN
/**
@@ -356,30 +359,32 @@ typedef enum useskill_fail_cause { // clif_skill_fail
}useskill_fail_cause;
enum clif_messages {
- MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight.
- MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting.
- MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired.
- MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died.
- MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary.
- MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away.
- MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area
- MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area.
- MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public.
- MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted.
- MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on
- MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount.
- MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab.
- MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done.
- MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found.
- MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found.
- MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found.
- MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials.
- MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found.
- MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found.
- MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be.
- MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use
- MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found.
- MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found.
+ MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight.
+ MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting.
+ MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired.
+ MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died.
+ MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary.
+ MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away.
+ MSG_PARTY_MEMBER_NOT_SUMMONED = 0x4c5, ///< The party member was not summoned because you are not the party leader.
+ MSG_PARTY_NO_MEMBER_IN_MAP = 0x4c6, ///< There is no party member to summon in the current map.
+ MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area
+ MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area.
+ MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public.
+ MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted.
+ MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on
+ MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount.
+ MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab.
+ MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done.
+ MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found.
+ MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found.
+ MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found.
+ MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials.
+ MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found.
+ MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found.
+ MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be.
+ MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use
+ MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found.
+ MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found.
};
/**
@@ -519,7 +524,7 @@ enum CLOSE_ROULETTE_ACK {
/**
* Reason for item deletion (clif->delitem)
- */
+ **/
enum delitem_reason {
DELITEM_NORMAL = 0, /// Normal
DELITEM_SKILLUSE = 1, /// Item used for a skill
@@ -531,9 +536,9 @@ enum delitem_reason {
DELITEM_ANALYSIS = 7, /// Consumed by Four Spirit Analysis (SO_EL_ANALYSIS) skill
};
-/*
-* Merge items reasons
-*/
+/**
+ * Merge items reasons
+ **/
enum mergeitem_reason {
MERGEITEM_SUCCESS = 0x0,
@@ -542,6 +547,23 @@ enum mergeitem_reason {
};
/**
+ * Clif Unit Type
+ **/
+enum clif_unittype {
+ CLUT_PC = 0x0,
+ CLUT_NPC = 0x1,
+ CLUT_ITEM = 0x2,
+ CLUT_SKILL = 0x3,
+ CLUT_UNKNOWN = 0x4,
+ CLUT_MOB = 0x5,
+ CLUT_EVENT = 0x6,
+ CLUT_PET = 0x7,
+ CLUT_HOMNUCLUS = 0x8,
+ CLUT_MERCNARY = 0x9,
+ CLUT_ELEMENTAL = 0xa,
+};
+
+/**
* Structures
**/
typedef void (*pFunc)(int, struct map_session_data *); //cant help but put it first
@@ -562,8 +584,8 @@ struct cdelayed_damage {
};
struct merge_item {
- int16 position;
- int16 nameid;
+ int16 position;
+ int16 nameid;
};
/**
@@ -653,7 +675,7 @@ struct clif_interface {
void (*changetraplook) (struct block_list *bl,int val);
void (*refreshlook) (struct block_list *bl,int id,int type,int val,enum send_target target);
void (*sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target);
- void (*class_change) (struct block_list *bl,int class_,int type);
+ void (*class_change) (struct block_list *bl,int class_,int type, struct map_session_data *sd);
void (*skill_delunit) (struct skill_unit *su);
void (*skillunit_update) (struct block_list* bl);
int (*clearunit_delayed_sub) (int tid, int64 tick, int id, intptr_t data);
@@ -773,6 +795,7 @@ struct clif_interface {
int (*autoshadowspell_list) (struct map_session_data *sd);
int (*skill_itemlistwindow) ( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
void (*sc_load) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3);
+ void (*sc_continue) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3);
void (*sc_end) (struct block_list *bl, int tid, enum send_target target, int type);
void (*initialstatus) (struct map_session_data *sd);
void (*cooldown_list) (int fd, struct skill_cd* cd);
@@ -806,7 +829,7 @@ struct clif_interface {
void (*skill_poseffect) (struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick);
void (*skill_estimation) (struct map_session_data *sd,struct block_list *dst);
void (*skill_warppoint) (struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
- void (*skillcasting) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime);
+ void (*useskill) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime);
void (*produce_effect) (struct map_session_data* sd,int flag,int nameid);
void (*devotion) (struct block_list *src, struct map_session_data *tsd);
void (*spiritball) (struct block_list *bl);
@@ -840,11 +863,11 @@ struct clif_interface {
void (*clearchat) (struct chat_data *cd,int fd);
void (*leavechat) (struct chat_data* cd, struct map_session_data* sd, bool flag);
void (*changechatstatus) (struct chat_data* cd);
- void (*wis_message) (int fd, const char* nick, const char* mes, size_t mes_len);
+ void (*wis_message) (int fd, const char *nick, const char *mes, int mes_len);
void (*wis_end) (int fd, int flag);
- void (*disp_message) (struct block_list* src, const char* mes, size_t len, enum send_target target);
- void (*broadcast) (struct block_list* bl, const char* mes, size_t len, int type, enum send_target target);
- void (*broadcast2) (struct block_list* bl, const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
+ void (*disp_message) (struct block_list *src, const char *mes, enum send_target target);
+ void (*broadcast) (struct block_list *bl, const char *mes, int len, int type, enum send_target target);
+ void (*broadcast2) (struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
void (*messagecolor_self) (int fd, uint32 color, const char *msg);
void (*messagecolor) (struct block_list* bl, uint32 color, const char* msg);
void (*disp_overhead) (struct block_list *bl, const char* mes);
@@ -855,7 +878,8 @@ struct clif_interface {
void (*messageln) (const int fd, const char* mes);
/* message+s(printf) */
void (*messages) (const int fd, const char *mes, ...) __attribute__((format(printf, 2, 3)));
- bool (*process_message) (struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_);
+ const char *(*process_chat_message) (struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen);
+ bool (*process_whisper_message) (struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen);
void (*wisexin) (struct map_session_data *sd,int type,int flag);
void (*wisall) (struct map_session_data *sd,int type,int flag);
void (*PMIgnoreList) (struct map_session_data* sd);
@@ -876,7 +900,7 @@ struct clif_interface {
void (*vendinglist) (struct map_session_data* sd, unsigned int id, struct s_vending* vending_list);
void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail);
void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending_list);
- void (*vendingreport) (struct map_session_data* sd, int index, int amount);
+ void (*vendingreport) (struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
/* storage handling */
void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length);
void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount);
@@ -941,7 +965,7 @@ struct clif_interface {
void (*bg_hp) (struct map_session_data *sd);
void (*bg_xy) (struct map_session_data *sd);
void (*bg_xy_remove) (struct map_session_data *sd);
- void (*bg_message) (struct battleground_data *bgd, int src_id, const char *name, const char *mes, size_t len);
+ void (*bg_message) (struct battleground_data *bgd, int src_id, const char *name, const char *mes);
void (*bg_updatescore) (int16 m);
void (*bg_updatescore_single) (struct map_session_data *sd);
void (*sendbgemblem_area) (struct map_session_data *sd);
@@ -997,7 +1021,7 @@ struct clif_interface {
void (*mail_setattachment) (int fd, int index, uint8 flag);
/* auction-related */
void (*auction_openwindow) (struct map_session_data *sd);
- void (*auction_results) (struct map_session_data *sd, short count, short pages, uint8 *buf);
+ void (*auction_results) (struct map_session_data *sd, short count, short pages, const uint8 *buf);
void (*auction_message) (int fd, unsigned char flag);
void (*auction_close) (int fd, unsigned char flag);
void (*auction_setitem) (int fd, int index, bool fail);
@@ -1038,7 +1062,7 @@ struct clif_interface {
void (*buyingstore_disappear_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd);
void (*buyingstore_itemlist) (struct map_session_data* sd, struct map_session_data* pl_sd);
void (*buyingstore_trade_failed_buyer) (struct map_session_data* sd, short result);
- void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount);
+ void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny);
void (*buyingstore_delete_item) (struct map_session_data* sd, short index, unsigned short amount, int price);
void (*buyingstore_trade_failed_seller) (struct map_session_data* sd, short result, unsigned short nameid);
/* search store-related */
@@ -1051,7 +1075,7 @@ struct clif_interface {
void (*elemental_updatestatus) (struct map_session_data *sd, int type);
/* bgqueue */
void (*bgqueue_ack) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id);
- void (*bgqueue_notice_delete) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, char *name);
+ void (*bgqueue_notice_delete) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, const char *name);
void (*bgqueue_update_info) (struct map_session_data *sd, unsigned char arena_id, int position);
void (*bgqueue_joined) (struct map_session_data *sd, int pos);
void (*bgqueue_pcleft) (struct map_session_data *sd);
@@ -1080,7 +1104,7 @@ struct clif_interface {
int (*delay_damage_sub) (int tid, int64 tick, int id, intptr_t data);
/* NPC Market */
void (*npc_market_open) (struct map_session_data *sd, struct npc_data *nd);
- void (*npc_market_purchase_ack) (struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char response);
+ void (*npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response);
/* */
bool (*parse_roulette_db) (void);
void (*roulette_generate_ack) (struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID);
@@ -1089,7 +1113,10 @@ struct clif_interface {
void (*cancelmergeitem) (int fd, struct map_session_data *sd);
int (*comparemergeitem) (const void *a, const void *b);
void (*ackmergeitems) (int fd, struct map_session_data *sd);
-
+ /* */
+ bool (*isdisguised) (struct block_list* bl);
+ void (*navigate_to) (struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id);
+ unsigned char (*bl_type) (struct block_list *bl);
/*------------------------
*- Parse Incoming Packet
*------------------------*/
@@ -1328,13 +1355,15 @@ struct clif_interface {
void (*pNPCMarketClosed) (int fd, struct map_session_data *sd);
void (*pNPCMarketPurchase) (int fd, struct map_session_data *sd);
/* */
- void (*add_random_options) (unsigned char* buf, struct item* item);
+ int (*add_item_options) (struct ItemOptions *buf, const struct item *it);
void (*pHotkeyRowShift) (int fd, struct map_session_data *sd);
void (*dressroom_open) (struct map_session_data *sd, int view);
void (*pOneClick_ItemIdentify) (int fd,struct map_session_data *sd);
/* Cart Deco */
- void(*selectcart) (struct map_session_data *sd);
- void(*pSelectCart) (int fd, struct map_session_data *sd);
+ void (*selectcart) (struct map_session_data *sd);
+ void (*pSelectCart) (int fd, struct map_session_data *sd);
+
+ const char *(*get_bl_name) (const struct block_list *bl);
};
#ifdef HERCULES_CORE
diff --git a/src/map/date.c b/src/map/date.c
index 5579962bf..a20578e51 100644
--- a/src/map/date.c
+++ b/src/map/date.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/date.h b/src/map/date.h
index 831539e3c..3a109d1ad 100644
--- a/src/map/date.h
+++ b/src/map/date.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/duel.c b/src/map/duel.c
index c658ea3e3..558dc1d9e 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -73,7 +73,7 @@ static int duel_showinfo_sub(struct map_session_data* sd, va_list va)
if (sd->duel_group != ssd->duel_group) return 0;
sprintf(output, " %d. %s", ++(*p), sd->status.name);
- clif_disp_onlyself(ssd, output, strlen(output));
+ clif_disp_onlyself(ssd, output);
return 1;
}
@@ -93,7 +93,7 @@ void duel_showinfo(const unsigned int did, struct map_session_data* sd) {
duel->list[did].members_count,
duel->list[did].members_count + duel->list[did].invites_count);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
map->foreachpc(duel_showinfo_sub, sd, &p);
}
@@ -113,7 +113,7 @@ int duel_create(struct map_session_data* sd, const unsigned int maxpl) {
duel->list[i].max_players_limit = maxpl;
safestrncpy(output, msg_sd(sd,372), sizeof(output)); // " -- Duel has been created (@invite/@leave) --"
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
clif->maptypeproperty2(&sd->bl,SELF);
@@ -127,14 +127,14 @@ void duel_invite(const unsigned int did, struct map_session_data* sd, struct map
nullpo_retv(target_sd);
// " -- Player %s invites %s to duel --"
sprintf(output, msg_sd(sd,373), sd->status.name, target_sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, DUEL_WOS);
target_sd->duel_invite = did;
duel->list[did].invites_count++;
// "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
sprintf(output, msg_sd(target_sd,374), sd->status.name);
- clif->broadcast(&target_sd->bl, output, strlen(output)+1, BC_BLUE, SELF);
+ clif->broadcast(&target_sd->bl, output, (int)strlen(output)+1, BC_BLUE, SELF);
}
static int duel_leave_sub(struct map_session_data* sd, va_list va)
@@ -152,7 +152,7 @@ void duel_leave(const unsigned int did, struct map_session_data* sd) {
nullpo_retv(sd);
// " <- Player %s has left duel --"
sprintf(output, msg_sd(sd,375), sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, DUEL_WOS);
duel->list[did].members_count--;
if(duel->list[did].members_count == 0) {
@@ -177,7 +177,7 @@ void duel_accept(const unsigned int did, struct map_session_data* sd) {
// " -> Player %s has accepted duel --"
sprintf(output, msg_sd(sd,376), sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, DUEL_WOS);
clif->map_property(sd, MAPPROPERTY_FREEPVPZONE);
clif->maptypeproperty2(&sd->bl,SELF);
@@ -189,7 +189,7 @@ void duel_reject(const unsigned int did, struct map_session_data* sd) {
nullpo_retv(sd);
// " -- Player %s has rejected duel --"
sprintf(output, msg_sd(sd,377), sd->status.name);
- clif->disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
+ clif->disp_message(&sd->bl, output, DUEL_WOS);
duel->list[did].invites_count--;
sd->duel_invite = 0;
diff --git a/src/map/duel.h b/src/map/duel.h
index 60b5b09ab..c0af04df6 100644
--- a/src/map/duel.h
+++ b/src/map/duel.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/elemental.c b/src/map/elemental.c
index a87deb7d7..ae1fda0a2 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -254,7 +254,8 @@ void elemental_summon_init(struct elemental_data *ed) {
ed->regen.state.block = 0;
}
-int elemental_data_received(struct s_elemental *ele, bool flag) {
+int elemental_data_received(const struct s_elemental *ele, bool flag)
+{
struct map_session_data *sd;
struct elemental_data *ed;
struct s_elemental_db *db;
@@ -544,28 +545,38 @@ int elemental_change_mode_ack(struct elemental_data *ed, int mode) {
return 1;
}
-/*===============================================================
- * Change elemental mode.
- *-------------------------------------------------------------*/
-int elemental_change_mode(struct elemental_data *ed, int mode) {
+/**
+ * Changes elemental mode.
+ *
+ * @param ed The elemental data.
+ * @param mode The new mode.
+ * @retval 1 in case of success.
+ */
+int elemental_change_mode(struct elemental_data *ed, uint32 mode)
+{
+ int skillmode = EL_SKILLMODE_PASIVE;
nullpo_ret(ed);
// Remove target
elemental->unlocktarget(ed);
// Removes the effects of the previous mode.
- if(ed->elemental.mode != mode ) elemental->clean_effect(ed);
+ if (ed->elemental.mode != mode)
+ elemental->clean_effect(ed);
ed->battle_status.mode = ed->elemental.mode = mode;
// Normalize elemental mode to elemental skill mode.
- if( mode == EL_MODE_AGGRESSIVE ) mode = EL_SKILLMODE_AGGRESSIVE; // Aggressive spirit mode -> Aggressive spirit skill.
- else if( mode == EL_MODE_ASSIST ) mode = EL_SKILLMODE_ASSIST; // Assist spirit mode -> Assist spirit skill.
- else mode = EL_SKILLMODE_PASIVE; // Passive spirit mode -> Passive spirit skill.
+ if (mode == EL_MODE_AGGRESSIVE)
+ skillmode = EL_SKILLMODE_AGGRESSIVE; // Aggressive spirit mode -> Aggressive spirit skill.
+ else if (mode == EL_MODE_ASSIST)
+ skillmode = EL_SKILLMODE_ASSIST; // Assist spirit mode -> Assist spirit skill.
+ else
+ skillmode = EL_SKILLMODE_PASIVE; // Passive spirit mode -> Passive spirit skill.
// Use a skill immediately after every change mode.
- if( mode != EL_SKILLMODE_AGGRESSIVE )
- elemental->change_mode_ack(ed,mode);
+ if (skillmode != EL_SKILLMODE_AGGRESSIVE)
+ elemental->change_mode_ack(ed, skillmode);
return 1;
}
@@ -680,7 +691,8 @@ int elemental_ai_sub_timer_activesearch(struct block_list *bl, va_list ap) {
int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *sd, int64 tick) {
struct block_list *target = NULL;
- int master_dist, view_range, mode;
+ int master_dist, view_range;
+ uint32 mode;
nullpo_ret(ed);
nullpo_ret(sd);
@@ -692,7 +704,7 @@ int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *s
if( DIFF_TICK(tick,ed->last_spdrain_time) >= 10000 ){// Drain SP every 10 seconds
int sp = 5;
- switch (ed->vd->class_) {
+ switch (ed->vd->class) {
case ELEID_EL_AGNI_M:
case ELEID_EL_AQUA_M:
case ELEID_EL_VENTUS_M:
@@ -759,7 +771,7 @@ int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *s
return 0;
}
- if( mode == EL_MODE_AGGRESSIVE ) {
+ if (mode == EL_MODE_AGGRESSIVE) {
target = map->id2bl(ed->ud.target);
if( !target )
@@ -852,7 +864,7 @@ int read_elementaldb(void) {
db->lv = atoi(str[3]);
estatus = &db->status;
- db->vd.class_ = db->class_;
+ db->vd.class = db->class_;
estatus->max_hp = atoi(str[4]);
estatus->max_sp = atoi(str[5]);
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 1a98670e0..f13d095df 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -122,11 +122,11 @@ struct elemental_interface {
struct view_data * (*get_viewdata) (int class_);
int (*create) (struct map_session_data *sd, int class_, unsigned int lifetime);
- int (*data_received) (struct s_elemental *ele, bool flag);
+ int (*data_received) (const struct s_elemental *ele, bool flag);
int (*save) (struct elemental_data *ed);
int (*change_mode_ack) (struct elemental_data *ed, int mode);
- int (*change_mode) (struct elemental_data *ed, int mode);
+ int (*change_mode) (struct elemental_data *ed, uint32 mode);
void (*heal) (struct elemental_data *ed, int hp, int sp);
int (*dead) (struct elemental_data *ed);
diff --git a/src/map/guild.c b/src/map/guild.c
index f4f0c0528..6e5b1c539 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -178,7 +178,7 @@ struct guild* guild_search(int guild_id)
struct guild* guild_searchname(char* str)
{
struct guild* g;
- DBIterator *iter = db_iterator(guild->db);
+ struct DBIterator *iter = db_iterator(guild->db);
nullpo_retr(NULL, str);
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) )
@@ -201,7 +201,7 @@ struct guild_castle* guild_castle_search(int gcid)
struct guild_castle* guild_mapindex2gc(short map_index)
{
struct guild_castle* gc;
- DBIterator *iter = db_iterator(guild->castle_db);
+ struct DBIterator *iter = db_iterator(guild->castle_db);
for( gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter) )
{
@@ -230,15 +230,18 @@ struct map_session_data* guild_getavailablesd(struct guild* g)
}
/// lookup: player AID/CID -> member index
-int guild_getindex(struct guild *g,int account_id,int char_id)
+int guild_getindex(const struct guild *g, int account_id, int char_id)
{
int i;
if( g == NULL )
- return -1;
+ return INDEX_NOT_FOUND;
ARR_FIND( 0, g->max_member, i, g->member[i].account_id == account_id && g->member[i].char_id == char_id );
- return( i < g->max_member ) ? i : -1;
+ if (i == g->max_member)
+ return INDEX_NOT_FOUND;
+
+ return i;
}
/// lookup: player sd -> member position
@@ -265,7 +268,7 @@ void guild_makemember(struct guild_member *m,struct map_session_data *sd)
m->hair = sd->status.hair;
m->hair_color = sd->status.hair_color;
m->gender = sd->status.sex;
- m->class_ = sd->status.class_;
+ m->class = sd->status.class;
m->lv = sd->status.base_level;
//m->exp = 0;
//m->exp_payper = 0;
@@ -279,16 +282,16 @@ void guild_makemember(struct guild_member *m,struct map_session_data *sd)
* Server cache to be flushed to inter the Guild EXP
* @see DBApply
*/
-int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
+int guild_payexp_timer_sub(union DBKey key, struct DBData *data, va_list ap)
+{
int i;
struct guild_expcache *c;
struct guild *g;
c = DB->data2ptr(data);
- if (
- (g = guild->search(c->guild_id)) == NULL ||
- (i = guild->getindex(g, c->account_id, c->char_id)) < 0
+ if ((g = guild->search(c->guild_id)) == NULL
+ || (i = guild->getindex(g, c->account_id, c->char_id)) == INDEX_NOT_FOUND
) {
ers_free(guild->expcache_ers, c);
return 0;
@@ -316,7 +319,7 @@ int guild_payexp_timer(int tid, int64 tick, int id, intptr_t data) {
* Taken from party_send_xy_timer_sub. [Skotlex]
* @see DBApply
*/
-int guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
+int guild_send_xy_timer_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild *g = DB->data2ptr(data);
int i;
@@ -396,8 +399,11 @@ int guild_created(int account_id,int guild_id) {
//struct guild *g;
sd->status.guild_id=guild_id;
clif->guild_created(sd,0); // Success
- if(battle_config.guild_emperium_check)
- pc->delitem(sd, pc->search_inventory(sd, ITEMID_EMPERIUM), 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); //emperium consumption
+ if (battle_config.guild_emperium_check) {
+ int n = pc->search_inventory(sd, ITEMID_EMPERIUM);
+ if (n != INDEX_NOT_FOUND)
+ pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); //emperium consumption
+ }
return 0;
}
@@ -410,20 +416,18 @@ int guild_request_info(int guild_id)
//Information request with event
int guild_npc_request_info(int guild_id,const char *event)
{
- if( guild->search(guild_id) )
- {
- if( event && *event )
+ if (guild->search(guild_id) != NULL) {
+ if (event != NULL && *event != '\0')
npc->event_do(event);
return 0;
}
- if( event && *event )
- {
+ if (event != NULL && *event != '\0') {
struct eventlist *ev;
- DBData prev;
- ev=(struct eventlist *)aCalloc(sizeof(struct eventlist),1);
- memcpy(ev->name,event,strlen(event));
+ struct DBData prev;
+ CREATE(ev, struct eventlist, 1);
+ safestrncpy(ev->name, event, sizeof(ev->name));
//The one in the db (if present) becomes the next event from this.
if (guild->infoevent_db->put(guild->infoevent_db, DB->i2key(guild_id), DB->ptr2data(ev), &prev))
ev->next = DB->data2ptr(&prev);
@@ -433,7 +437,7 @@ int guild_npc_request_info(int guild_id,const char *event)
}
//Confirmation of the character belongs to guild
-int guild_check_member(struct guild *g)
+int guild_check_member(const struct guild *g)
{
int i;
struct map_session_data *sd;
@@ -447,7 +451,7 @@ int guild_check_member(struct guild *g)
continue;
i = guild->getindex(g,sd->status.account_id,sd->status.char_id);
- if (i < 0) {
+ if (i == INDEX_NOT_FOUND) {
sd->status.guild_id=0;
sd->guild_emblem_id=0;
ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);
@@ -475,10 +479,11 @@ int guild_recv_noinfo(int guild_id)
}
//Get and display information for all member
-int guild_recv_info(struct guild *sg) {
+int guild_recv_info(const struct guild *sg)
+{
struct guild *g,before;
int i,bm,m;
- DBData data;
+ struct DBData data;
struct map_session_data *sd;
bool guild_new = false;
struct channel_data *aChSysSave = NULL;
@@ -753,9 +758,9 @@ void guild_member_joined(struct map_session_data *sd)
guild->block_skill(sd, 300000);
}
i = guild->getindex(g, sd->status.account_id, sd->status.char_id);
- if (i == -1)
+ if (i == INDEX_NOT_FOUND) {
sd->status.guild_id = 0;
- else {
+ } else {
g->member[i].sd = sd;
sd->guild = g;
@@ -875,7 +880,7 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, i
// find the member and perform expulsion
i = guild->getindex(g, account_id, char_id);
- if( i != -1 && strcmp(g->member[i].name,g->master) != 0 ) //Can't expel the GL!
+ if (i != INDEX_NOT_FOUND && strcmp(g->member[i].name,g->master) != 0) //Can't expel the GL!
intif->guild_leave(g->guild_id,account_id,char_id,1,mes);
return 0;
@@ -892,7 +897,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c
return 0; // no such guild (error!)
i = guild->getindex(g, account_id, char_id);
- if( i == -1 )
+ if (i == INDEX_NOT_FOUND)
return 0; // not a member (inconsistency!)
online_member_sd = guild->getavailablesd(g);
@@ -972,11 +977,11 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
return 0;
intif->guild_memberinfoshort(g->guild_id,
- sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class_);
+ sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class);
if(!online){
- int i=guild->getindex(g,sd->status.account_id,sd->status.char_id);
- if(i>=0)
+ int i = guild->getindex(g,sd->status.account_id,sd->status.char_id);
+ if (i != INDEX_NOT_FOUND)
g->member[i].sd=NULL;
else
ShowError("guild_send_memberinfoshort: Failed to locate member %d:%d in guild %d!\n", sd->status.account_id, sd->status.char_id, g->guild_id);
@@ -991,9 +996,9 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
return 0;
}
-int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
+int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class)
{ // cleaned up [LuzZza]
- int i,alv,c,idx=-1,om=0,oldonline=-1;
+ int i, alv, c, idx = INDEX_NOT_FOUND, om = 0, oldonline = -1;
struct guild *g = guild->search(guild_id);
if(g == NULL)
@@ -1006,7 +1011,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
oldonline=m->online;
m->online=online;
m->lv=lv;
- m->class_=class_;
+ m->class = class;
idx=i;
}
alv+=m->lv;
@@ -1015,7 +1020,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
om++;
}
- if(idx == -1 || c == 0) {
+ if (idx == INDEX_NOT_FOUND || c == 0) {
//Treat char_id who doesn't match guild_id (not found as member)
struct map_session_data *sd = map->id2sd(account_id);
if(sd && sd->status.char_id == char_id) {
@@ -1056,14 +1061,15 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
/*====================================================
* Send a message to whole guild
*---------------------------------------------------*/
-int guild_send_message(struct map_session_data *sd,const char *mes,int len)
+int guild_send_message(struct map_session_data *sd, const char *mes)
{
+ int len = (int)strlen(mes);
nullpo_ret(sd);
- if(sd->status.guild_id==0)
+ if (sd->status.guild_id == 0)
return 0;
- intif->guild_message(sd->status.guild_id,sd->status.account_id,mes,len);
- guild->recv_message(sd->status.guild_id,sd->status.account_id,mes,len);
+ intif->guild_message(sd->status.guild_id, sd->status.account_id, mes, len);
+ guild->recv_message(sd->status.guild_id, sd->status.account_id, mes, len);
// Chat logging type 'G' / Guild Chat
logs->chat(LOG_CHAT_GUILD, sd->status.guild_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
@@ -1126,7 +1132,7 @@ int guild_change_position(int guild_id,int idx,int mode,int exp_mode,const char
/*====================================================
* Notification of member has changed his guild title
*---------------------------------------------------*/
-int guild_position_changed(int guild_id,int idx,struct guild_position *p)
+int guild_position_changed(int guild_id, int idx, const struct guild_position *p)
{
struct guild *g=guild->search(guild_id);
int i;
@@ -1221,7 +1227,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
}
}
{// update guardians (mobs)
- DBIterator* iter = db_iterator(guild->castle_db);
+ struct DBIterator *iter = db_iterator(guild->castle_db);
struct guild_castle* gc;
for( gc = (struct guild_castle*)dbi_first(iter) ; dbi_exists(iter); gc = (struct guild_castle*)dbi_next(iter) )
{
@@ -1259,7 +1265,7 @@ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data)
/**
* @see DBCreateData
*/
-DBData create_expcache(DBKey key, va_list args)
+struct DBData create_expcache(union DBKey key, va_list args)
{
struct guild_expcache *c;
struct map_session_data *sd = va_arg(args, struct map_session_data*);
@@ -1717,7 +1723,7 @@ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id
* Notification for the guild disbanded
* @see DBApply
*/
-int guild_broken_sub(DBKey key, DBData *data, va_list ap)
+int guild_broken_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild *g = DB->data2ptr(data);
int guild_id=va_arg(ap,int);
@@ -1743,7 +1749,7 @@ int guild_broken_sub(DBKey key, DBData *data, va_list ap)
* Invoked on Castles when a guild is broken. [Skotlex]
* @see DBApply
*/
-int castle_guild_broken_sub(DBKey key, DBData *data, va_list ap)
+int castle_guild_broken_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild_castle *gc = DB->data2ptr(data);
int guild_id = va_arg(ap, int);
@@ -1824,7 +1830,7 @@ int guild_gm_change(int guild_id, struct map_session_data *sd)
return 0;
//Notify servers that master has changed.
- intif->guild_change_gm(guild_id, sd->status.name, strlen(sd->status.name)+1);
+ intif->guild_change_gm(guild_id, sd->status.name, (int)strlen(sd->status.name)+1);
return 1;
}
@@ -1883,7 +1889,8 @@ int guild_gm_changed(int guild_id, int account_id, int char_id)
/*====================================================
* Guild disbanded
*---------------------------------------------------*/
-int guild_break(struct map_session_data *sd,char *name) {
+int guild_break(struct map_session_data *sd, const char *name)
+{
struct guild *g;
struct unit_data *ud;
int i;
@@ -1951,7 +1958,7 @@ void guild_castle_map_init(void)
if (num > 0) {
struct guild_castle* gc = NULL;
int *castle_ids, *cursor;
- DBIterator* iter = NULL;
+ struct DBIterator *iter = NULL;
CREATE(castle_ids, int, num);
cursor = castle_ids;
@@ -2064,7 +2071,7 @@ void guild_castle_reconnect(int castle_id, int index, int value)
}
// Load castle data then invoke OnAgitInit* on last
-int guild_castledataloadack(int len, struct guild_castle *gc)
+int guild_castledataloadack(int len, const struct guild_castle *gc)
{
int i;
int n = (len-4) / sizeof(struct guild_castle);
@@ -2149,7 +2156,7 @@ int guild_checkcastles(struct guild *g)
{
int nb_cas = 0;
struct guild_castle* gc = NULL;
- DBIterator *iter = db_iterator(guild->castle_db);
+ struct DBIterator *iter = db_iterator(guild->castle_db);
for (gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter)) {
if (gc->guild_id == g->guild_id) {
@@ -2218,7 +2225,8 @@ void guild_flag_remove(struct npc_data *nd) {
/**
* @see DBApply
*/
-int eventlist_db_final(DBKey key, DBData *data, va_list ap) {
+int eventlist_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct eventlist *next = NULL;
struct eventlist *current = DB->data2ptr(data);
while (current != NULL) {
@@ -2232,7 +2240,8 @@ int eventlist_db_final(DBKey key, DBData *data, va_list ap) {
/**
* @see DBApply
*/
-int guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
+int guild_expcache_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
ers_free(guild->expcache_ers, DB->data2ptr(data));
return 0;
}
@@ -2240,7 +2249,8 @@ int guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
/**
* @see DBApply
*/
-int guild_castle_db_final(DBKey key, DBData *data, va_list ap) {
+int guild_castle_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct guild_castle* gc = DB->data2ptr(data);
if( gc->temp_guardians )
aFree(gc->temp_guardians);
@@ -2279,8 +2289,9 @@ void do_init_guild(bool minimal) {
timer->add_interval(timer->gettick()+GUILD_SEND_XY_INVERVAL,guild->send_xy_timer,0,0,GUILD_SEND_XY_INVERVAL);
}
-void do_final_guild(void) {
- DBIterator *iter = db_iterator(guild->db);
+void do_final_guild(void)
+{
+ struct DBIterator *iter = db_iterator(guild->db);
struct guild *g;
for( g = dbi_first(iter); dbi_exists(iter); g = dbi_next(iter) ) {
diff --git a/src/map/guild.h b/src/map/guild.h
index 10749f8ad..cdb28a37b 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -71,10 +71,10 @@ struct guild_interface {
void (*init) (bool minimal);
void (*final) (void);
/* */
- DBMap* db; // int guild_id -> struct guild*
- DBMap* castle_db; // int castle_id -> struct guild_castle*
- DBMap* expcache_db; // int char_id -> struct guild_expcache*
- DBMap* infoevent_db; // int guild_id -> struct eventlist*
+ struct DBMap *db; // int guild_id -> struct guild*
+ struct DBMap *castle_db; // int castle_id -> struct guild_castle*
+ struct DBMap *expcache_db; // int char_id -> struct guild_expcache*
+ struct DBMap *infoevent_db; // int guild_id -> struct eventlist*
/* */
struct eri *expcache_ers; //For handling of guild exp payment.
/* */
@@ -98,7 +98,7 @@ struct guild_interface {
struct guild_castle *(*mapindex2gc) (short map_index);
/* */
struct map_session_data *(*getavailablesd) (struct guild *g);
- int (*getindex) (struct guild *g,int account_id,int char_id);
+ int (*getindex) (const struct guild *g, int account_id, int char_id);
int (*getposition) (struct guild *g, struct map_session_data *sd);
unsigned int (*payexp) (struct map_session_data *sd,unsigned int exp);
int (*getexp) (struct map_session_data *sd,int exp); // [Celest]
@@ -107,7 +107,7 @@ struct guild_interface {
int (*created) (int account_id,int guild_id);
int (*request_info) (int guild_id);
int (*recv_noinfo) (int guild_id);
- int (*recv_info) (struct guild *sg);
+ int (*recv_info) (const struct guild *sg);
int (*npc_request_info) (int guild_id,const char *ev);
int (*invite) (struct map_session_data *sd,struct map_session_data *tsd);
int (*reply_invite) (struct map_session_data *sd,int guild_id,int flag);
@@ -126,27 +126,27 @@ struct guild_interface {
int (*check_alliance) (int guild_id1, int guild_id2, int flag);
/* */
int (*send_memberinfoshort) (struct map_session_data *sd,int online);
- int (*recv_memberinfoshort) (int guild_id,int account_id,int char_id,int online,int lv,int class_);
+ int (*recv_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int16 class);
int (*change_memberposition) (int guild_id,int account_id,int char_id,short idx);
int (*memberposition_changed) (struct guild *g,int idx,int pos);
int (*change_position) (int guild_id,int idx,int mode,int exp_mode,const char *name);
- int (*position_changed) (int guild_id,int idx,struct guild_position *p);
+ int (*position_changed) (int guild_id, int idx, const struct guild_position *p);
int (*change_notice) (struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2);
int (*notice_changed) (int guild_id,const char *mes1,const char *mes2);
int (*change_emblem) (struct map_session_data *sd,int len,const char *data);
int (*emblem_changed) (int len,int guild_id,int emblem_id,const char *data);
- int (*send_message) (struct map_session_data *sd,const char *mes,int len);
+ int (*send_message) (struct map_session_data *sd, const char *mes);
int (*recv_message) (int guild_id,int account_id,const char *mes,int len);
int (*send_dot_remove) (struct map_session_data *sd);
int (*skillupack) (int guild_id,uint16 skill_id,int account_id);
- int (*dobreak) (struct map_session_data *sd,char *name);
+ int (*dobreak) (struct map_session_data *sd, const char *name);
int (*broken) (int guild_id,int flag);
int (*gm_change) (int guild_id, struct map_session_data *sd);
int (*gm_changed) (int guild_id, int account_id, int char_id);
/* */
void (*castle_map_init) (void);
int (*castledatasave) (int castle_id,int index,int value);
- int (*castledataloadack) (int len, struct guild_castle *gc);
+ int (*castledataloadack) (int len, const struct guild_castle *gc);
void (*castle_reconnect) (int castle_id, int index, int value);
/* */
void (*agit_start) (void);
@@ -166,17 +166,17 @@ struct guild_interface {
struct map_session_data *(*sd_check) (int guild_id, int account_id, int char_id);
bool (*read_guildskill_tree_db) (char* split[], int columns, int current);
bool (*read_castledb) (char* str[], int columns, int current);
- int (*payexp_timer_sub) (DBKey key, DBData *data, va_list ap);
- int (*send_xy_timer_sub) (DBKey key, DBData *data, va_list ap);
+ int (*payexp_timer_sub) (union DBKey key, struct DBData *data, va_list ap);
+ int (*send_xy_timer_sub) (union DBKey key, struct DBData *data, va_list ap);
int (*send_xy_timer) (int tid, int64 tick, int id, intptr_t data);
- DBData (*create_expcache) (DBKey key, va_list args);
- int (*eventlist_db_final) (DBKey key, DBData *data, va_list ap);
- int (*expcache_db_final) (DBKey key, DBData *data, va_list ap);
- int (*castle_db_final) (DBKey key, DBData *data, va_list ap);
- int (*broken_sub) (DBKey key, DBData *data, va_list ap);
- int (*castle_broken_sub) (DBKey key, DBData *data, va_list ap);
+ struct DBData (*create_expcache) (union DBKey key, va_list args);
+ int (*eventlist_db_final) (union DBKey key, struct DBData *data, va_list ap);
+ int (*expcache_db_final) (union DBKey key, struct DBData *data, va_list ap);
+ int (*castle_db_final) (union DBKey key, struct DBData *data, va_list ap);
+ int (*broken_sub) (union DBKey key, struct DBData *data, va_list ap);
+ int (*castle_broken_sub) (union DBKey key, struct DBData *data, va_list ap);
void (*makemember) (struct guild_member *m,struct map_session_data *sd);
- int (*check_member) (struct guild *g);
+ int (*check_member) (const struct guild *g);
int (*get_alliance_count) (struct guild *g,int flag);
void (*castle_reconnect_sub) (void *key, void *data, va_list ap);
};
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index b642c197f..91a455416 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -356,14 +356,14 @@ bool homunculus_levelup(struct homun_data *hd) {
max = &hd->homunculusDB->gmax;
min = &hd->homunculusDB->gmin;
- growth_max_hp = rnd_value(min->HP, max->HP);
- growth_max_sp = rnd_value(min->SP, max->SP);
- growth_str = rnd_value(min->str, max->str);
- growth_agi = rnd_value(min->agi, max->agi);
- growth_vit = rnd_value(min->vit, max->vit);
- growth_dex = rnd_value(min->dex, max->dex);
- growth_int = rnd_value(min->int_,max->int_);
- growth_luk = rnd_value(min->luk, max->luk);
+ growth_max_hp = rnd->value(min->HP, max->HP);
+ growth_max_sp = rnd->value(min->SP, max->SP);
+ growth_str = rnd->value(min->str, max->str);
+ growth_agi = rnd->value(min->agi, max->agi);
+ growth_vit = rnd->value(min->vit, max->vit);
+ growth_dex = rnd->value(min->dex, max->dex);
+ growth_int = rnd->value(min->int_,max->int_);
+ growth_luk = rnd->value(min->luk, max->luk);
//Aegis discards the decimals in the stat growth values!
growth_str-=growth_str%10;
@@ -391,7 +391,7 @@ bool homunculus_levelup(struct homun_data *hd) {
growth_max_hp, growth_max_sp,
growth_str/10.0, growth_agi/10.0, growth_vit/10.0,
growth_int/10.0, growth_dex/10.0, growth_luk/10.0);
- clif_disp_onlyself(hd->master,output,strlen(output));
+ clif_disp_onlyself(hd->master, output);
}
return true;
}
@@ -399,7 +399,7 @@ bool homunculus_levelup(struct homun_data *hd) {
int homunculus_change_class(struct homun_data *hd, short class_) {
int i = homun->db_search(class_,HOMUNCULUS_CLASS);
nullpo_retr(0, hd);
- if(i < 0)
+ if (i == INDEX_NOT_FOUND)
return 0;
hd->homunculusDB = &homun->dbs->db[i];
hd->homunculus.class_ = class_;
@@ -432,14 +432,14 @@ bool homunculus_evolve(struct homun_data *hd) {
hom = &hd->homunculus;
max = &hd->homunculusDB->emax;
min = &hd->homunculusDB->emin;
- hom->max_hp += rnd_value(min->HP, max->HP);
- hom->max_sp += rnd_value(min->SP, max->SP);
- hom->str += 10*rnd_value(min->str, max->str);
- hom->agi += 10*rnd_value(min->agi, max->agi);
- hom->vit += 10*rnd_value(min->vit, max->vit);
- hom->int_+= 10*rnd_value(min->int_,max->int_);
- hom->dex += 10*rnd_value(min->dex, max->dex);
- hom->luk += 10*rnd_value(min->luk, max->luk);
+ hom->max_hp += rnd->value(min->HP, max->HP);
+ hom->max_sp += rnd->value(min->SP, max->SP);
+ hom->str += 10*rnd->value(min->str, max->str);
+ hom->agi += 10*rnd->value(min->agi, max->agi);
+ hom->vit += 10*rnd->value(min->vit, max->vit);
+ hom->int_+= 10*rnd->value(min->int_,max->int_);
+ hom->dex += 10*rnd->value(min->dex, max->dex);
+ hom->luk += 10*rnd->value(min->luk, max->luk);
hom->intimacy = 500;
unit->remove_map(&hd->bl, CLR_OUTSIGHT, ALC_MARK);
@@ -705,7 +705,8 @@ void homunculus_hunger_timer_delete(struct homun_data *hd) {
}
}
-int homunculus_change_name(struct map_session_data *sd,char *name) {
+int homunculus_change_name(struct map_session_data *sd, const char *name)
+{
int i;
struct homun_data *hd;
nullpo_retr(1, sd);
@@ -725,21 +726,26 @@ int homunculus_change_name(struct map_session_data *sd,char *name) {
return intif_rename_hom(sd, name);
}
-bool homunculus_change_name_ack(struct map_session_data *sd, char* name, int flag) {
+bool homunculus_change_name_ack(struct map_session_data *sd, const char *name, int flag)
+{
struct homun_data *hd;
+ char *newname = NULL;
nullpo_retr(false, sd);
nullpo_retr(false, name);
hd = sd->hd;
nullpo_retr(false, hd);
if (!homun_alive(hd)) return false;
- normalize_name(name," ");//bugreport:3032
+ newname = aStrndup(name, NAME_LENGTH-1);
+ normalize_name(newname, " ");//bugreport:3032 // FIXME[Haru]: This should be normalized by the inter-server (so that it's const here)
- if ( !flag || !strlen(name) ) {
+ if (flag == 0 || strlen(newname) == 0) {
clif->message(sd->fd, msg_sd(sd,280)); // You cannot use this name
+ aFree(newname);
return false;
}
- safestrncpy(hd->homunculus.name,name,NAME_LENGTH);
+ safestrncpy(hd->homunculus.name, newname, NAME_LENGTH);
+ aFree(newname);
clif->charnameack (0,&hd->bl);
hd->homunculus.rename_flag = 1;
clif->hominfo(sd,hd,0);
@@ -763,14 +769,25 @@ int homunculus_db_search(int key,int type) {
return i;
break;
default:
- return -1;
+ return INDEX_NOT_FOUND;
}
}
- return -1;
+ return INDEX_NOT_FOUND;
}
-// Create homunc structure
-bool homunculus_create(struct map_session_data *sd, struct s_homunculus *hom) {
+/**
+ * Creates and initializes an homunculus.
+ *
+ * @remark
+ * The char_id field in the source homunculus data is ignored (the sd's
+ * character ID is used instead).
+ *
+ * @param sd The owner character.
+ * @param hom The homunculus source data.
+ * @retval false in case of errors.
+ */
+bool homunculus_create(struct map_session_data *sd, const struct s_homunculus *hom)
+{
struct homun_data *hd;
int i = 0;
@@ -780,7 +797,7 @@ bool homunculus_create(struct map_session_data *sd, struct s_homunculus *hom) {
Assert_retr(false, sd->status.hom_id == 0 || sd->hd == 0 || sd->hd->master == sd);
i = homun->db_search(hom->class_,HOMUNCULUS_CLASS);
- if(i < 0) {
+ if (i == INDEX_NOT_FOUND) {
ShowError("homunculus_create: unknown class [%d] for homunculus '%s', requesting deletion.\n", hom->class_, hom->name);
sd->status.hom_id = 0;
intif->homunculus_requestdelete(hom->hom_id);
@@ -794,6 +811,7 @@ bool homunculus_create(struct map_session_data *sd, struct s_homunculus *hom) {
hd->master = sd;
hd->homunculusDB = &homun->dbs->db[i];
memcpy(&hd->homunculus, hom, sizeof(struct s_homunculus));
+ hd->homunculus.char_id = sd->status.char_id; // Fix character ID if necessary.
hd->exp_next = homun->dbs->exptable[hd->homunculus.level - 1];
status->set_viewdata(&hd->bl, hd->homunculus.class_);
@@ -830,7 +848,7 @@ bool homunculus_call(struct map_session_data *sd) {
nullpo_retr(false, sd);
if (!sd->status.hom_id) //Create a new homun.
- return homun->creation_request(sd, HM_CLASS_BASE + rnd_value(0, 7));
+ return homun->creation_request(sd, HM_CLASS_BASE + rnd->value(0, 7));
// If homunc not yet loaded, load it
if (!sd->hd)
@@ -863,35 +881,38 @@ bool homunculus_call(struct map_session_data *sd) {
}
// Receive homunculus data from char server
-bool homunculus_recv_data(int account_id, struct s_homunculus *sh, int flag) {
+bool homunculus_recv_data(int account_id, const struct s_homunculus *sh, int flag)
+{
struct map_session_data *sd;
struct homun_data *hd;
nullpo_retr(false, sh);
+
sd = map->id2sd(account_id);
- if(!sd)
+ if (sd == NULL)
return false;
- if (sd->status.char_id != sh->char_id) {
- if (sd->status.hom_id == sh->hom_id)
- sh->char_id = sd->status.char_id; //Correct char id.
- else
- return false;
- }
- if(!flag) { // Failed to load
+
+ if (flag == 0) { // Failed to load
sd->status.hom_id = 0;
return false;
}
- if (!sd->status.hom_id) //Hom just created.
+ if (sd->status.char_id != sh->char_id && sd->status.hom_id != sh->hom_id)
+ return false;
+
+ if (sd->status.hom_id == 0) //Hom just created.
sd->status.hom_id = sh->hom_id;
- if (sd->hd) //uh? Overwrite the data.
- memcpy(&sd->hd->homunculus, sh, sizeof(struct s_homunculus));
- else
+ if (sd->hd != NULL) {
+ //uh? Overwrite the data.
+ memcpy(&sd->hd->homunculus, sh, sizeof sd->hd->homunculus);
+ sd->hd->homunculus.char_id = sd->status.char_id; // Correct char id if necessary.
+ } else {
homun->create(sd, sh);
+ }
hd = sd->hd;
- if(hd && hd->homunculus.hp && hd->homunculus.vaporize == HOM_ST_ACTIVE && hd->bl.prev == NULL && sd->bl.prev != NULL) {
+ if(hd != NULL && hd->homunculus.hp && hd->homunculus.vaporize == HOM_ST_ACTIVE && hd->bl.prev == NULL && sd->bl.prev != NULL) {
enum homun_type htype = homun->class2type(hd->homunculus.class_);
map->addblock(&hd->bl);
@@ -927,7 +948,8 @@ bool homunculus_creation_request(struct map_session_data *sd, int class_) {
nullpo_retr(false, sd);
i = homun->db_search(class_,HOMUNCULUS_CLASS);
- if(i < 0) return false;
+ if (i == INDEX_NOT_FOUND)
+ return false;
memset(&hom, 0, sizeof(struct s_homunculus));
//Initial data
@@ -1053,14 +1075,14 @@ bool homunculus_shuffle(struct homun_data *hd) {
//Evolved bonuses
struct s_homunculus *hom = &hd->homunculus;
struct h_stats *max = &hd->homunculusDB->emax, *min = &hd->homunculusDB->emin;
- hom->max_hp += rnd_value(min->HP, max->HP);
- hom->max_sp += rnd_value(min->SP, max->SP);
- hom->str += 10*rnd_value(min->str, max->str);
- hom->agi += 10*rnd_value(min->agi, max->agi);
- hom->vit += 10*rnd_value(min->vit, max->vit);
- hom->int_+= 10*rnd_value(min->int_,max->int_);
- hom->dex += 10*rnd_value(min->dex, max->dex);
- hom->luk += 10*rnd_value(min->luk, max->luk);
+ hom->max_hp += rnd->value(min->HP, max->HP);
+ hom->max_sp += rnd->value(min->SP, max->SP);
+ hom->str += 10*rnd->value(min->str, max->str);
+ hom->agi += 10*rnd->value(min->agi, max->agi);
+ hom->vit += 10*rnd->value(min->vit, max->vit);
+ hom->int_+= 10*rnd->value(min->int_,max->int_);
+ hom->dex += 10*rnd->value(min->dex, max->dex);
+ hom->luk += 10*rnd->value(min->luk, max->luk);
}
hd->homunculus.exp = exp;
@@ -1193,7 +1215,7 @@ void homunculus_read_db(void) {
if( i > 0 ) {
char filepath[256];
- sprintf(filepath, "%s/%s", map->db_path, filename[i]);
+ snprintf(filepath, 256, "%s/%s", map->db_path, filename[i]);
if( !exists(filepath) ) {
continue;
@@ -1328,7 +1350,7 @@ void do_init_homunculus(bool minimal) {
//Stock view data for homuncs
memset(homun->dbs->viewdb, 0, sizeof(homun->dbs->viewdb));
for (class_ = 0; class_ < MAX_HOMUNCULUS_CLASS; class_++)
- homun->dbs->viewdb[class_].class_ = HM_CLASS_BASE+class_;
+ homun->dbs->viewdb[class_].class = HM_CLASS_BASE + class_;
}
void do_final_homunculus(void) {
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index c2ce042ec..a80392cf6 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -186,13 +186,13 @@ struct homunculus_interface {
bool (*feed) (struct map_session_data *sd, struct homun_data *hd);
int (*hunger_timer) (int tid, int64 tick, int id, intptr_t data);
void (*hunger_timer_delete) (struct homun_data *hd);
- int (*change_name) (struct map_session_data *sd,char *name);
- bool (*change_name_ack) (struct map_session_data *sd, char* name, int flag);
+ int (*change_name) (struct map_session_data *sd, const char *name);
+ bool (*change_name_ack) (struct map_session_data *sd, const char *name, int flag);
int (*db_search) (int key,int type);
- bool (*create) (struct map_session_data *sd, struct s_homunculus *hom);
+ bool (*create) (struct map_session_data *sd, const struct s_homunculus *hom);
void (*init_timers) (struct homun_data * hd);
bool (*call) (struct map_session_data *sd);
- bool (*recv_data) (int account_id, struct s_homunculus *sh, int flag);
+ bool (*recv_data) (int account_id, const struct s_homunculus *sh, int flag);
bool (*creation_request) (struct map_session_data *sd, int class_);
bool (*ressurect) (struct map_session_data* sd, unsigned char per, short x, short y);
void (*revive) (struct homun_data *hd, unsigned int hp, unsigned int sp);
diff --git a/src/map/instance.c b/src/map/instance.c
index 5e8256c88..21ee6bf80 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -106,7 +106,7 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
icptr = &g->instances;
break;
default:
- ShowError("instance_create: unknown type %d for owner_id %d and name %s.\n", type,owner_id,name);
+ ShowError("instance_create: unknown type %u for owner_id %d and name %s.\n", type, owner_id, name);
return -1;
}
@@ -551,7 +551,7 @@ void instance_destroy(int instance_id) {
struct party_data *p = NULL;
struct guild *g = NULL;
short *iptr = NULL;
- int type, j;
+ int type;
unsigned int now = (unsigned int)time(NULL);
if( !instance->valid(instance_id) )
@@ -591,14 +591,15 @@ void instance_destroy(int instance_id) {
icptr = &g->instances;
break;
default:
- ShowError("instance_destroy: unknown type %d for owner_id %d and name '%s'.\n", instance->list[instance_id].owner_type,instance->list[instance_id].owner_id,instance->list[instance_id].name);
+ ShowError("instance_destroy: unknown type %u for owner_id %d and name '%s'.\n", instance->list[instance_id].owner_type, instance->list[instance_id].owner_id, instance->list[instance_id].name);
break;
}
if( iptr != NULL ) {
- ARR_FIND(0, *icptr, j, iptr[j] == instance_id);
- if( j != *icptr )
- iptr[j] = -1;
+ int i;
+ ARR_FIND(0, *icptr, i, iptr[i] == instance_id);
+ if (i != *icptr)
+ iptr[i] = -1;
}
if (instance->list[instance_id].map) {
diff --git a/src/map/instance.h b/src/map/instance.h
index 2019b1a42..141d37a8f 100644
--- a/src/map/instance.h
+++ b/src/map/instance.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/intif.c b/src/map/intif.c
index 1968ebe67..61d2e3633 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -132,7 +132,7 @@ int intif_delete_petdata(int pet_id)
return 1;
}
-int intif_rename(struct map_session_data *sd, int type, char *name)
+int intif_rename(struct map_session_data *sd, int type, const char *name)
{
if (intif->CheckForCharServer())
return 1;
@@ -150,7 +150,7 @@ int intif_rename(struct map_session_data *sd, int type, char *name)
}
// GM Send a message
-int intif_broadcast(const char* mes, size_t len, int type)
+int intif_broadcast(const char *mes, int len, int type)
{
int lp = (type&BC_COLOR_MASK) ? 4 : 0;
@@ -182,7 +182,7 @@ int intif_broadcast(const char* mes, size_t len, int type)
return 0;
}
-int intif_broadcast2(const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY)
+int intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY)
{
nullpo_ret(mes);
Assert_ret(len < 32000);
@@ -222,7 +222,7 @@ int intif_main_message(struct map_session_data* sd, const char* message)
snprintf( output, sizeof(output), msg_txt(386), sd->status.name, message );
// send the message using the inter-server broadcast service
- intif->broadcast2( output, strlen(output) + 1, 0xFE000000, 0, 0, 0, 0 );
+ intif->broadcast2(output, (int)strlen(output) + 1, 0xFE000000, 0, 0, 0, 0);
// log the chat message
logs->chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message );
@@ -231,7 +231,7 @@ int intif_main_message(struct map_session_data* sd, const char* message)
}
// The transmission of Wisp/Page to inter-server (player not found on this server)
-int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, size_t mes_len)
+int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len)
{
if (intif->CheckForCharServer())
return 0;
@@ -279,12 +279,14 @@ int intif_wis_replay(int id, int flag)
// The transmission of GM only Wisp/Page from server to inter-server
int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes)
{
- size_t mes_len;
+ int mes_len;
if (intif->CheckForCharServer())
return 0;
nullpo_ret(wisp_name);
nullpo_ret(mes);
- mes_len = strlen(mes) + 1; // + null
+ mes_len = (int)strlen(mes) + 1; // + null
+ Assert_ret(mes_len > 0 && mes_len <= INT16_MAX - 32);
+
WFIFOHEAD(inter_fd, mes_len + 32);
WFIFOW(inter_fd,0) = 0x3003;
WFIFOW(inter_fd,2) = mes_len + 32;
@@ -300,10 +302,11 @@ int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes)
}
//Request for saving registry values.
-int intif_saveregistry(struct map_session_data *sd) {
- DBIterator *iter;
- DBKey key;
- DBData *data;
+int intif_saveregistry(struct map_session_data *sd)
+{
+ struct DBIterator *iter;
+ union DBKey key;
+ struct DBData *data;
int plen = 0;
size_t len;
@@ -350,7 +353,7 @@ int intif_saveregistry(struct map_session_data *sd) {
WFIFOB(inter_fd, plen) = (unsigned char)len;/* won't be higher; the column size is 32 */
plen += 1;
- safestrncpy((char*)WFIFOP(inter_fd,plen), varname, len);
+ safestrncpy(WFIFOP(inter_fd,plen), varname, len);
plen += len;
WFIFOL(inter_fd, plen) = script_getvaridx(key.i64);
@@ -368,7 +371,7 @@ int intif_saveregistry(struct map_session_data *sd) {
WFIFOB(inter_fd, plen) = (unsigned char)len;/* won't be higher; the column size is 254 */
plen += 1;
- safestrncpy((char*)WFIFOP(inter_fd,plen), p->value, len);
+ safestrncpy(WFIFOP(inter_fd,plen), p->value, len);
plen += len;
} else {
script->reg_destroy_single(sd,key.i64,&p->flag);
@@ -436,6 +439,135 @@ int intif_request_registry(struct map_session_data *sd, int flag)
return 0;
}
+//=================================================================
+// Account Storage
+//-----------------------------------------------------------------
+
+/**
+ * Request the inter-server for a character's storage data.
+ * @packet 0x3010 [out] <account_id>.L
+ * @param sd [in] pointer to session data.
+ */
+void intif_request_account_storage(const struct map_session_data *sd)
+{
+ nullpo_retv(sd);
+
+ /* Check for character server availability */
+ if (intif->CheckForCharServer())
+ return;
+
+ WFIFOHEAD(inter_fd, 6);
+ WFIFOW(inter_fd, 0) = 0x3010;
+ WFIFOL(inter_fd, 2) = sd->status.account_id;
+ WFIFOSET(inter_fd, 6);
+}
+
+/**
+ * Parse the reception of account storage from the inter-server.
+ * @packet 0x3805 [in] <packet_len>.W <account_id>.L <struct item[]>.P
+ * @param fd [in] file/socket descriptor.
+ */
+void intif_parse_account_storage(int fd)
+{
+ int account_id = 0, payload_size = 0, storage_count = 0;
+ int i = 0;
+ struct map_session_data *sd = NULL;
+
+ Assert_retv(fd > 0);
+
+ payload_size = RFIFOW(fd, 2) - 8;
+
+ if ((account_id = RFIFOL(fd, 4)) == 0 || (sd = map->id2sd(account_id)) == NULL) {
+ ShowError("intif_parse_account_storage: Session pointer was null for account id %d!\n", account_id);
+ return;
+ }
+
+ if (sd->storage.received == true) {
+ ShowError("intif_parse_account_storage: Multiple calls from the inter-server received.\n");
+ return;
+ }
+
+ storage_count = (payload_size/sizeof(struct item));
+
+ VECTOR_ENSURE(sd->storage.item, storage_count, 1);
+
+ sd->storage.aggregate = storage_count; // Total items in storage.
+
+ for (i = 0; i < storage_count; i++) {
+ const struct item *it = RFIFOP(fd, 8 + i * sizeof(struct item));
+ VECTOR_PUSH(sd->storage.item, *it);
+ }
+
+ sd->storage.received = true; // Mark the storage state as received.
+ sd->storage.save = false; // Initialize the save flag as false.
+
+ pc->checkitem(sd); // re-check remaining items.
+}
+
+/**
+ * Send account storage information for saving.
+ * @packet 0x3011 [out] <packet_len>.W <account_id>.L <struct item[]>.P
+ * @param sd [in] pointer to session data.
+ */
+void intif_send_account_storage(const struct map_session_data *sd)
+{
+ int len = 0, i = 0, c = 0;
+
+ nullpo_retv(sd);
+
+ // Assert that at this point in the code, both flags are true.
+ Assert_retv(sd->storage.save == true);
+ Assert_retv(sd->storage.received == true);
+
+ if (intif->CheckForCharServer())
+ return;
+
+ len = 8 + sd->storage.aggregate * sizeof(struct item);
+
+ WFIFOHEAD(inter_fd, len);
+
+ WFIFOW(inter_fd, 0) = 0x3011;
+ WFIFOW(inter_fd, 2) = (uint16) len;
+ WFIFOL(inter_fd, 4) = sd->status.account_id;
+ for (i = 0, c = 0; i < VECTOR_LENGTH(sd->storage.item); i++) {
+ if (VECTOR_INDEX(sd->storage.item, i).nameid == 0)
+ continue;
+ memcpy(WFIFOP(inter_fd, 8 + c * sizeof(struct item)), &VECTOR_INDEX(sd->storage.item, i), sizeof(struct item));
+ c++;
+ }
+
+ WFIFOSET(inter_fd, len);
+}
+
+/**
+ * Parse acknowledgement packet for the saving of an account's storage.
+ * @packet 0x3808 [in] <account_id>.L <saved_flag>.B
+ * @param fd [in] file/socket descriptor.
+ */
+void intif_parse_account_storage_save_ack(int fd)
+{
+ int account_id = RFIFOL(fd, 2);
+ uint8 saved = RFIFOB(fd, 6);
+ struct map_session_data *sd = NULL;
+
+ Assert_retv(account_id > 0);
+ Assert_retv(fd > 0);
+
+ if ((sd = map->id2sd(account_id)) == NULL)
+ return; // character is most probably offline.
+
+ if (saved == 0) {
+ ShowError("intif_parse_account_storage_save_ack: Storage has not been saved! (AID: %d)\n", account_id);
+ return;
+ }
+
+ sd->storage.save = false; // Storage has been saved.
+}
+
+//=================================================================
+// Guild Storage
+//-----------------------------------------------------------------
+
int intif_request_guild_storage(int account_id,int guild_id)
{
if (intif->CheckForCharServer())
@@ -463,7 +595,7 @@ int intif_send_guild_storage(int account_id,struct guild_storage *gstor)
}
// Party creation request
-int intif_create_party(struct party_member *member,char *name,int item,int item2)
+int intif_create_party(struct party_member *member, const char *name, int item, int item2)
{
if (intif->CheckForCharServer())
return 0;
@@ -657,7 +789,7 @@ int intif_guild_addmember(int guild_id,struct guild_member *m)
}
// Request a new leader for guild
-int intif_guild_change_gm(int guild_id, const char* name, size_t len)
+int intif_guild_change_gm(int guild_id, const char *name, int len)
{
if (intif->CheckForCharServer())
return 0;
@@ -684,13 +816,13 @@ int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const cha
WFIFOL(inter_fd, 6) = account_id;
WFIFOL(inter_fd,10) = char_id;
WFIFOB(inter_fd,14) = flag;
- safestrncpy((char*)WFIFOP(inter_fd,15),mes,40);
+ safestrncpy(WFIFOP(inter_fd,15),mes,40);
WFIFOSET(inter_fd,55);
return 0;
}
//Update request / Lv online status of the guild members
-int intif_guild_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
+int intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class)
{
if (intif->CheckForCharServer())
return 0;
@@ -701,7 +833,7 @@ int intif_guild_memberinfoshort(int guild_id,int account_id,int char_id,int onli
WFIFOL(inter_fd,10) = char_id;
WFIFOB(inter_fd,14) = online;
WFIFOW(inter_fd,15) = lv;
- WFIFOW(inter_fd,17) = class_;
+ WFIFOW(inter_fd,17) = class;
WFIFOSET(inter_fd,19);
return 0;
}
@@ -837,8 +969,8 @@ int intif_guild_notice(int guild_id,const char *mes1,const char *mes2)
WFIFOHEAD(inter_fd,186);
WFIFOW(inter_fd,0)=0x303e;
WFIFOL(inter_fd,2)=guild_id;
- memcpy(WFIFOP(inter_fd,6),mes1,MAX_GUILDMES1);
- memcpy(WFIFOP(inter_fd,66),mes2,MAX_GUILDMES2);
+ safestrncpy(WFIFOP(inter_fd, 6), mes1, MAX_GUILDMES1);
+ safestrncpy(WFIFOP(inter_fd, 66), mes2, MAX_GUILDMES2);
WFIFOSET(inter_fd,186);
return 0;
}
@@ -956,13 +1088,13 @@ int intif_homunculus_requestdelete(int homun_id)
// Wisp/Page reception // rewritten by [Yor]
void intif_parse_WisMessage(int fd) {
struct map_session_data* sd;
- char *wisp_source;
+ const char *wisp_source;
char name[NAME_LENGTH];
int id, i;
id=RFIFOL(fd,4);
- safestrncpy(name, (char*)RFIFOP(fd,32), NAME_LENGTH);
+ safestrncpy(name, RFIFOP(fd,32), NAME_LENGTH);
sd = map->nick2sd(name);
if(sd == NULL || strcmp(sd->status.name, name) != 0) {
//Not found
@@ -973,7 +1105,7 @@ void intif_parse_WisMessage(int fd) {
intif_wis_replay(id, 2);
return;
}
- wisp_source = (char *) RFIFOP(fd,8); // speed up [Yor]
+ wisp_source = RFIFOP(fd,8); // speed up [Yor]
for(i=0; i < MAX_IGNORE_LIST &&
sd->ignore[i].name[0] != '\0' &&
strcmp(sd->ignore[i].name, wisp_source) != 0
@@ -985,24 +1117,27 @@ void intif_parse_WisMessage(int fd) {
return;
}
//Success to send whisper.
- clif->wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56);
+ clif->wis_message(sd->fd, wisp_source, RFIFOP(fd,56),RFIFOW(fd,2)-57);
intif_wis_replay(id,0); // success
}
// Wisp/page transmission result reception
-void intif_parse_WisEnd(int fd) {
+void intif_parse_WisEnd(int fd)
+{
struct map_session_data* sd;
+ const char *playername = RFIFOP(fd, 2);
if (battle_config.etc_log)
- ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target
- sd = map->nick2sd((char *)RFIFOP(fd,2));
+ ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", playername, RFIFOB(fd,26)); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target
+ sd = map->nick2sd(playername);
if (sd != NULL)
clif->wis_end(sd->fd, RFIFOB(fd,26));
return;
}
-int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
+int intif_parse_WisToGM_sub(struct map_session_data *sd, va_list va)
+{
int permission = va_arg(va, int);
char *wisp_name;
char *message;
@@ -1020,22 +1155,22 @@ int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
// Received wisp message from map-server via char-server for ALL gm
// 0x3003/0x3803 <packet_len>.w <wispname>.24B <permission>.l <message>.?B
-void mapif_parse_WisToGM(int fd)
+void intif_parse_WisToGM(int fd)
{
int permission, mes_len;
char Wisp_name[NAME_LENGTH];
char mbuf[255] = { 0 };
char *message;
- mes_len = RFIFOW(fd,2) - 32;
+ mes_len = RFIFOW(fd,2) - 33; // Length not including the NUL terminator
Assert_retv(mes_len > 0 && mes_len < 32000);
- message = (char *) (mes_len >= 255 ? (char *) aMalloc(mes_len) : mbuf);
+ message = (mes_len >= 255 ? aMalloc(mes_len + 1) : mbuf);
permission = RFIFOL(fd,28);
- safestrncpy(Wisp_name, (char*)RFIFOP(fd,4), NAME_LENGTH);
- safestrncpy(message, (char*)RFIFOP(fd,32), mes_len);
+ safestrncpy(Wisp_name, RFIFOP(fd,4), NAME_LENGTH);
+ safestrncpy(message, RFIFOP(fd,32), mes_len + 1);
// information is sent to all online GM
- map->foreachpc(mapif_parse_WisToGM_sub, permission, Wisp_name, message, mes_len);
+ map->foreachpc(intif->pWisToGM_sub, permission, Wisp_name, message, mes_len);
if (message != mbuf)
aFree(message);
@@ -1098,17 +1233,17 @@ void intif_parse_Registers(int fd)
char sval[254];
for (i = 0; i < max; i++) {
int len = RFIFOB(fd, cursor);
- safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
+ safestrncpy(key, RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
cursor += len + 1;
index = RFIFOL(fd, cursor);
cursor += 4;
len = RFIFOB(fd, cursor);
- safestrncpy(sval, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len));
+ safestrncpy(sval, RFIFOP(fd, cursor + 1), min((int)sizeof(sval), len));
cursor += len + 1;
- script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (void*)sval, NULL);
+ script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, sval, NULL);
}
/**
* Vessel!
@@ -1121,7 +1256,7 @@ void intif_parse_Registers(int fd)
int ival;
int len = RFIFOB(fd, cursor);
- safestrncpy(key, (char*)RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
+ safestrncpy(key, RFIFOP(fd, cursor + 1), min((int)sizeof(key), len));
cursor += len + 1;
index = RFIFOL(fd, cursor);
@@ -1130,7 +1265,7 @@ void intif_parse_Registers(int fd)
ival = RFIFOL(fd, cursor);
cursor += 4;
- script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (void*)h64BPTRSIZE(ival), NULL);
+ script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (const void *)h64BPTRSIZE(ival), NULL);
}
}
script->parser_current_file = NULL;/* reset */
@@ -1156,7 +1291,7 @@ void intif_parse_LoadGuildStorage(int fd)
sd=map->id2sd( RFIFOL(fd,4) );
if( flag ){ //If flag != 0, we attach a player and open the storage
if(sd==NULL){
- ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
+ ShowError("intif_parse_LoadGuildStorage: user not found %u\n", RFIFOL(fd,4));
return;
}
}
@@ -1194,29 +1329,29 @@ void intif_parse_SaveGuildStorage(int fd)
void intif_parse_PartyCreated(int fd)
{
if(battle_config.etc_log)
- ShowInfo("intif: party created by account %d\n\n", RFIFOL(fd,2));
- party->created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15));
+ ShowInfo("intif: party created by account %u\n\n", RFIFOL(fd,2));
+ party->created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), RFIFOP(fd,15));
}
// Receive party info
void intif_parse_PartyInfo(int fd) {
if (RFIFOW(fd,2) == 12) {
- ShowWarning("intif: party noinfo (char_id=%d party_id=%d)\n", RFIFOL(fd,4), RFIFOL(fd,8));
+ ShowWarning("intif: party noinfo (char_id=%u party_id=%u)\n", RFIFOL(fd,4), RFIFOL(fd,8));
party->recv_noinfo(RFIFOL(fd,8), RFIFOL(fd,4));
return;
}
if (RFIFOW(fd,2) != 8+sizeof(struct party))
- ShowError("intif: party info: data size mismatch (char_id=%d party_id=%d packet_len=%d expected_len=%"PRIuS")\n",
+ ShowError("intif: party info: data size mismatch (char_id=%u party_id=%u packet_len=%d expected_len=%"PRIuS")\n",
RFIFOL(fd,4), RFIFOL(fd,8), RFIFOW(fd,2), 8+sizeof(struct party));
- party->recv_info((struct party *)RFIFOP(fd,8), RFIFOL(fd,4));
+ party->recv_info(RFIFOP(fd,8), RFIFOL(fd,4));
}
// ACK adding party member
void intif_parse_PartyMemberAdded(int fd)
{
if(battle_config.etc_log)
- ShowInfo("intif: party member added Party (%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
+ ShowInfo("intif: party member added Party (%u), Account(%u), Char(%u)\n", RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10));
party->member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14));
}
@@ -1230,7 +1365,7 @@ void intif_parse_PartyOptionChanged(int fd)
void intif_parse_PartyMemberWithdraw(int fd)
{
if(battle_config.etc_log)
- ShowInfo("intif: party member withdraw: Party(%d), Account(%d), Char(%d)\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
+ ShowInfo("intif: party member withdraw: Party(%u), Account(%u), Char(%u)\n", RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10));
party->member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10));
}
@@ -1247,7 +1382,7 @@ void intif_parse_PartyMove(int fd)
// ACK party messages
void intif_parse_PartyMessage(int fd) {
- party->recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
+ party->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12);
}
// ACK guild creation
@@ -1258,26 +1393,26 @@ void intif_parse_GuildCreated(int fd) {
// ACK guild infos
void intif_parse_GuildInfo(int fd) {
if (RFIFOW(fd,2) == 8) {
- ShowWarning("intif: guild noinfo %d\n",RFIFOL(fd,4));
+ ShowWarning("intif: guild noinfo %u\n", RFIFOL(fd,4));
guild->recv_noinfo(RFIFOL(fd,4));
return;
}
if (RFIFOW(fd,2)!=sizeof(struct guild)+4)
- ShowError("intif: guild info: data size mismatch - Gid: %d recv size: %d Expected size: %"PRIuS"\n",
- RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4);
- guild->recv_info((struct guild *)RFIFOP(fd,4));
+ ShowError("intif: guild info: data size mismatch - Gid: %u recv size: %d Expected size: %"PRIuS"\n",
+ RFIFOL(fd,4), RFIFOW(fd,2), sizeof(struct guild)+4);
+ guild->recv_info(RFIFOP(fd,4));
}
// ACK adding guild member
void intif_parse_GuildMemberAdded(int fd) {
if(battle_config.etc_log)
- ShowInfo("intif: guild member added %d %d %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
+ ShowInfo("intif: guild member added %u %u %u %d\n", RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14));
guild->member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14));
}
// ACK member leaving guild
void intif_parse_GuildMemberWithdraw(int fd) {
- guild->member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(char *)RFIFOP(fd,55),(char *)RFIFOP(fd,15));
+ guild->member_withdraw(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOP(fd,55), RFIFOP(fd,15));
}
// ACK guild member basic info
@@ -1308,15 +1443,19 @@ void intif_parse_GuildBasicInfoChanged(int fd) {
case GBI_SKILLPOINT: g->skill_point = RFIFOL(fd,10); break;
case GBI_SKILLLV: {
int idx, max;
- struct guild_skill *gs = (struct guild_skill *)RFIFOP(fd,10);
+ const struct guild_skill *p_gs = RFIFOP(fd,10);
+ struct guild_skill *gs = NULL;
- idx = gs->id - GD_SKILLBASE;
+ idx = p_gs->id - GD_SKILLBASE;
Assert_retv(idx >= 0 && idx < MAX_GUILDSKILL);
+
+ gs = &g->skill[idx];
+ memcpy(gs, p_gs, sizeof(*gs));
+
max = guild->skill_get_max(gs->id);
- if( gs->lv > max )
+ if (gs->lv > max)
gs->lv = max;
- memcpy(&(g->skill[idx]), gs, sizeof(g->skill[idx]));
break;
}
}
@@ -1340,7 +1479,7 @@ void intif_parse_GuildMemberInfoChanged(int fd) {
return;
idx = guild->getindex(g,account_id,char_id);
- if( idx == -1 )
+ if (idx == INDEX_NOT_FOUND)
return;
switch( type ) {
@@ -1349,7 +1488,7 @@ void intif_parse_GuildMemberInfoChanged(int fd) {
case GMI_HAIR: g->member[idx].hair = RFIFOW(fd,18); break;
case GMI_HAIR_COLOR: g->member[idx].hair_color = RFIFOW(fd,18); break;
case GMI_GENDER: g->member[idx].gender = RFIFOW(fd,18); break;
- case GMI_CLASS: g->member[idx].class_ = RFIFOW(fd,18); break;
+ case GMI_CLASS: g->member[idx].class = RFIFOW(fd,18); break;
case GMI_LEVEL: g->member[idx].lv = RFIFOW(fd,18); break;
}
}
@@ -1357,9 +1496,9 @@ void intif_parse_GuildMemberInfoChanged(int fd) {
// ACK change of guild title
void intif_parse_GuildPosition(int fd) {
if (RFIFOW(fd,2)!=sizeof(struct guild_position)+12)
- ShowError("intif: guild info: data size mismatch (%d) %d != %"PRIuS"\n",
- RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild_position)+12);
- guild->position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12));
+ ShowError("intif: guild info: data size mismatch (%u) %d != %"PRIuS"\n",
+ RFIFOL(fd,4), RFIFOW(fd,2), sizeof(struct guild_position) + 12);
+ guild->position_changed(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12));
}
// ACK change of guild skill update
@@ -1369,27 +1508,27 @@ void intif_parse_GuildSkillUp(int fd) {
// ACK change of guild relationship
void intif_parse_GuildAlliance(int fd) {
- guild->allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
+ guild->allianceack(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), RFIFOB(fd,18), RFIFOP(fd,19), RFIFOP(fd,43));
}
// ACK change of guild notice
void intif_parse_GuildNotice(int fd) {
- guild->notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
+ guild->notice_changed(RFIFOL(fd,2), RFIFOP(fd,6), RFIFOP(fd,66));
}
// ACK change of guild emblem
void intif_parse_GuildEmblem(int fd) {
- guild->emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
+ guild->emblem_changed(RFIFOW(fd,2)-12, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12));
}
// ACK guild message
void intif_parse_GuildMessage(int fd) {
- guild->recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
+ guild->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12);
}
// Reply guild castle data request
void intif_parse_GuildCastleDataLoad(int fd) {
- guild->castledataloadack(RFIFOW(fd,2), (struct guild_castle *)RFIFOP(fd,4));
+ guild->castledataloadack(RFIFOW(fd,2), RFIFOP(fd,4));
}
// ACK change of guildmaster
@@ -1440,10 +1579,10 @@ void intif_parse_ChangeNameOk(int fd)
case 0: //Players [NOT SUPPORTED YET]
break;
case 1: //Pets
- pet->change_name_ack(sd, (char*)RFIFOP(fd,12), RFIFOB(fd,11));
+ pet->change_name_ack(sd, RFIFOP(fd,12), RFIFOB(fd,11));
break;
case 2: //Hom
- homun->change_name_ack(sd, (char*)RFIFOP(fd,12), RFIFOB(fd,11));
+ homun->change_name_ack(sd, RFIFOP(fd,12), RFIFOB(fd,11));
break;
}
return;
@@ -1459,7 +1598,7 @@ void intif_parse_CreateHomunculus(int fd) {
ShowError("intif: create homun data: data size mismatch %d != %"PRIuS"\n", len, sizeof(struct s_homunculus));
return;
}
- homun->recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8)) ;
+ homun->recv_data(RFIFOL(fd,4), RFIFOP(fd,9), RFIFOB(fd,8)) ;
}
void intif_parse_RecvHomunculusData(int fd) {
@@ -1470,13 +1609,13 @@ void intif_parse_RecvHomunculusData(int fd) {
ShowError("intif: homun data: data size mismatch %d != %"PRIuS"\n", len, sizeof(struct s_homunculus));
return;
}
- homun->recv_data(RFIFOL(fd,4), (struct s_homunculus*)RFIFOP(fd,9), RFIFOB(fd,8));
+ homun->recv_data(RFIFOL(fd,4), RFIFOP(fd,9), RFIFOB(fd,8));
}
/* Really? Whats the point, shouldn't be sent when successful then [Ind] */
void intif_parse_SaveHomunculusOk(int fd) {
if(RFIFOB(fd,6) != 1)
- ShowError("homunculus data save failure for account %d\n", RFIFOL(fd,2));
+ ShowError("homunculus data save failure for account %u\n", RFIFOL(fd,2));
}
/* Really? Whats the point, shouldn't be sent when successful then [Ind] */
@@ -1527,7 +1666,7 @@ void intif_parse_QuestLog(int fd) {
sd->quest_log = NULL;
}
} else {
- struct quest *received = (struct quest *)RFIFOP(fd, 8);
+ const struct quest *received = RFIFOP(fd, 8);
int i, k = num_received;
if (sd->quest_log) {
RECREATE(sd->quest_log, struct quest, num_received);
@@ -1647,7 +1786,7 @@ void intif_parse_MailInboxReceived(int fd) {
else if( battle_config.mail_show_status && ( battle_config.mail_show_status == 1 || sd->mail.inbox.unread ) ) {
char output[128];
sprintf(output, msg_sd(sd,510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
}
}
/*------------------------------------------
@@ -1691,7 +1830,7 @@ void intif_parse_MailGetAttach(int fd) {
sd = map->charid2sd( RFIFOL(fd,4) );
if (sd == NULL) {
- ShowError("intif_parse_MailGetAttach: char not found %d\n",RFIFOL(fd,4));
+ ShowError("intif_parse_MailGetAttach: char not found %u\n", RFIFOL(fd,4));
return;
}
@@ -1769,7 +1908,7 @@ void intif_parse_MailReturn(int fd) {
short fail = RFIFOB(fd,10);
if( sd == NULL ) {
- ShowError("intif_parse_MailReturn: char not found %d\n",RFIFOL(fd,2));
+ ShowError("intif_parse_MailReturn: char not found %u\n", RFIFOL(fd, 2));
return;
}
@@ -1837,8 +1976,8 @@ void intif_parse_MailSend(int fd) {
void intif_parse_MailNew(int fd) {
struct map_session_data *sd = map->charid2sd(RFIFOL(fd,2));
int mail_id = RFIFOL(fd,6);
- const char* sender_name = (char*)RFIFOP(fd,10);
- const char* title = (char*)RFIFOP(fd,34);
+ const char *sender_name = RFIFOP(fd,10);
+ const char *title = RFIFOP(fd,34);
if( sd == NULL )
return;
@@ -1876,7 +2015,7 @@ void intif_parse_AuctionResults(int fd) {
struct map_session_data *sd = map->charid2sd(RFIFOL(fd,4));
short count = RFIFOW(fd,8);
short pages = RFIFOW(fd,10);
- uint8* data = RFIFOP(fd,12);
+ const uint8 *data = RFIFOP(fd,12);
if( sd == NULL )
return;
@@ -2063,7 +2202,7 @@ void intif_parse_MercenaryReceived(int fd) {
return;
}
- mercenary->data_received((struct s_mercenary*)RFIFOP(fd,5), RFIFOB(fd,4));
+ mercenary->data_received(RFIFOP(fd,5), RFIFOB(fd,4));
}
int intif_mercenary_request(int merc_id, int char_id)
@@ -2145,7 +2284,7 @@ void intif_parse_ElementalReceived(int fd) {
return;
}
- elemental->data_received((struct s_elemental*)RFIFOP(fd,5), RFIFOB(fd,4));
+ elemental->data_received(RFIFOP(fd,5), RFIFOB(fd,4));
}
int intif_elemental_request(int ele_id, int char_id)
@@ -2207,7 +2346,7 @@ void intif_request_accinfo( int u_fd, int aid, int group_lv, char* query ) {
WFIFOL(inter_fd,2) = u_fd;
WFIFOL(inter_fd,6) = aid;
WFIFOL(inter_fd,10) = group_lv;
- safestrncpy((char *)WFIFOP(inter_fd,14), query, NAME_LENGTH);
+ safestrncpy(WFIFOP(inter_fd,14), query, NAME_LENGTH);
WFIFOSET(inter_fd,2 + 4 + 4 + 4 + NAME_LENGTH);
@@ -2224,7 +2363,7 @@ void intif_parse_MessageToFD(int fd) {
/* matching e.g. previous fd owner didn't dc during request or is still the same */
if( sd && sd->bl.id == aid ) {
char msg[512];
- safestrncpy(msg, (char*)RFIFOP(fd,12), RFIFOW(fd,2) - 12);
+ safestrncpy(msg, RFIFOP(fd,12), RFIFOW(fd,2) - 12);
clif->messagecolor_self(u_fd, COLOR_DEFAULT ,msg);
}
@@ -2288,16 +2427,18 @@ int intif_parse(int fd)
switch(cmd){
case 0x3800:
if (RFIFOL(fd,4) == 0xFF000000) //Normal announce.
- clif->broadcast(NULL, (char *) RFIFOP(fd,16), packet_len-16, BC_DEFAULT, ALL_CLIENT);
+ clif->broadcast(NULL, RFIFOP(fd,16), packet_len-16, BC_DEFAULT, ALL_CLIENT);
else //Color announce.
- clif->broadcast2(NULL, (char *) RFIFOP(fd,16), packet_len-16, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOW(fd,10), RFIFOW(fd,12), RFIFOW(fd,14), ALL_CLIENT);
+ clif->broadcast2(NULL, RFIFOP(fd,16), packet_len-16, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOW(fd,10), RFIFOW(fd,12), RFIFOW(fd,14), ALL_CLIENT);
break;
case 0x3801: intif->pWisMessage(fd); break;
case 0x3802: intif->pWisEnd(fd); break;
case 0x3803: intif->pWisToGM(fd); break;
case 0x3804: intif->pRegisters(fd); break;
+ case 0x3805: intif->pAccountStorage(fd); break;
case 0x3806: intif->pChangeNameOk(fd); break;
case 0x3807: intif->pMessageToFD(fd); break;
+ case 0x3808: intif->pAccountStorageSaveAck(fd); break;
case 0x3818: intif->pLoadGuildStorage(fd); break;
case 0x3819: intif->pSaveGuildStorage(fd); break;
case 0x3820: intif->pPartyCreated(fd); break;
@@ -2384,7 +2525,7 @@ int intif_parse(int fd)
*-------------------------------------*/
void intif_defaults(void) {
const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = {
- -1,-1,27,-1, -1, 0,37,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
+ -1,-1,27,-1, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
0, 0, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810
39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820
10,-1,15, 0, 79,19, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
@@ -2411,6 +2552,8 @@ void intif_defaults(void) {
intif->wis_message_to_gm = intif_wis_message_to_gm;
intif->saveregistry = intif_saveregistry;
intif->request_registry = intif_request_registry;
+ intif->request_account_storage = intif_request_account_storage;
+ intif->send_account_storage = intif_send_account_storage;
intif->request_guild_storage = intif_request_guild_storage;
intif->send_guild_storage = intif_send_guild_storage;
intif->create_party = intif_create_party;
@@ -2482,11 +2625,13 @@ void intif_defaults(void) {
/* parse functions */
intif->pWisMessage = intif_parse_WisMessage;
intif->pWisEnd = intif_parse_WisEnd;
- intif->pWisToGM_sub = mapif_parse_WisToGM_sub;
- intif->pWisToGM = mapif_parse_WisToGM;
+ intif->pWisToGM_sub = intif_parse_WisToGM_sub;
+ intif->pWisToGM = intif_parse_WisToGM;
intif->pRegisters = intif_parse_Registers;
intif->pChangeNameOk = intif_parse_ChangeNameOk;
intif->pMessageToFD = intif_parse_MessageToFD;
+ intif->pAccountStorage = intif_parse_account_storage;
+ intif->pAccountStorageSaveAck = intif_parse_account_storage_save_ack;
intif->pLoadGuildStorage = intif_parse_LoadGuildStorage;
intif->pSaveGuildStorage = intif_parse_SaveGuildStorage;
intif->pPartyCreated = intif_parse_PartyCreated;
diff --git a/src/map/intif.h b/src/map/intif.h
index 0bcaae941..3d6a52440 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -59,16 +59,18 @@ struct intif_interface {
int (*parse) (int fd);
int (*create_pet)(int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id,
short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name);
- int (*broadcast) (const char* mes, size_t len, int type);
- int (*broadcast2) (const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY);
+ int (*broadcast) (const char *mes, int len, int type);
+ int (*broadcast2) (const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY);
int (*main_message) (struct map_session_data* sd, const char* message);
- int (*wis_message) (struct map_session_data *sd,char *nick,char *mes,size_t mes_len);
+ int (*wis_message) (struct map_session_data *sd, const char *nick, const char *mes, int mes_len);
int (*wis_message_to_gm) (char *Wisp_name, int permission, char *mes);
int (*saveregistry) (struct map_session_data *sd);
int (*request_registry) (struct map_session_data *sd, int flag);
+ void (*request_account_storage) (const struct map_session_data *sd);
+ void (*send_account_storage) (const struct map_session_data *sd);
int (*request_guild_storage) (int account_id, int guild_id);
int (*send_guild_storage) (int account_id, struct guild_storage *gstor);
- int (*create_party) (struct party_member *member,char *name,int item,int item2);
+ int (*create_party) (struct party_member *member, const char *name, int item, int item2);
int (*request_partyinfo) (int party_id, int char_id);
int (*party_addmember) (int party_id,struct party_member *member);
int (*party_changeoption) (int party_id, int account_id, int exp, int item);
@@ -81,10 +83,10 @@ struct intif_interface {
int (*guild_request_info) (int guild_id);
int (*guild_addmember) (int guild_id, struct guild_member *m);
int (*guild_leave) (int guild_id, int account_id, int char_id, int flag, const char *mes);
- int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int class_);
+ int (*guild_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int16 class);
int (*guild_break) (int guild_id);
int (*guild_message) (int guild_id, int account_id, const char *mes, int len);
- int (*guild_change_gm) (int guild_id, const char* name, size_t len);
+ int (*guild_change_gm) (int guild_id, const char *name, int len);
int (*guild_change_basicinfo) (int guild_id, int type, const void *data, int len);
int (*guild_change_memberinfo) (int guild_id, int account_id, int char_id, int type, const void *data, int len);
int (*guild_position) (int guild_id, int idx, struct guild_position *p);
@@ -98,7 +100,7 @@ struct intif_interface {
int (*request_petdata) (int account_id, int char_id, int pet_id);
int (*save_petdata) (int account_id, struct s_pet *p);
int (*delete_petdata) (int pet_id);
- int (*rename) (struct map_session_data *sd, int type, char *name);
+ int (*rename) (struct map_session_data *sd, int type, const char *name);
int (*homunculus_create) (int account_id, struct s_homunculus *sh);
bool (*homunculus_requestload) (int account_id, int homun_id);
int (*homunculus_requestsave) (int account_id, struct s_homunculus* sh);
@@ -139,8 +141,10 @@ struct intif_interface {
int (*pWisToGM_sub) (struct map_session_data* sd,va_list va);
void (*pWisToGM) (int fd);
void (*pRegisters) (int fd);
+ void (*pAccountStorage) (int fd);
void (*pChangeNameOk) (int fd);
void (*pMessageToFD) (int fd);
+ void (*pAccountStorageSaveAck) (int fd);
void (*pLoadGuildStorage) (int fd);
void (*pSaveGuildStorage) (int fd);
void (*pPartyCreated) (int fd);
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
index 3d8ec8b5d..d087588af 100644
--- a/src/map/irc-bot.c
+++ b/src/map/irc-bot.c
@@ -48,10 +48,7 @@ struct irc_bot_interface *ircbot;
char send_string[IRC_MESSAGE_LENGTH];
-/**
- * Timer callback to (re-)connect to an IRC server
- * @see timer->do_timer
- */
+/// @copydoc irc_bot_interface::connect_timer()
int irc_connect_timer(int tid, int64 tick, int id, intptr_t data) {
struct hSockOpt opt;
if( ircbot->isOn || ++ircbot->fails >= 3 )
@@ -71,53 +68,43 @@ int irc_connect_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
-/**
- * Timer callback to send identification commands to an IRC server
- * @see timer->do_timer
- */
+/// @copydoc irc_bot_interface::identify_timer()
int irc_identify_timer(int tid, int64 tick, int id, intptr_t data) {
if( !ircbot->isOn )
return 0;
sprintf(send_string, "USER HerculesWS%d 8 * : Hercules IRC Bridge",rnd()%777);
- ircbot->send(send_string);
+ ircbot->send(send_string, true);
sprintf(send_string, "NICK %s", channel->config->irc_nick);
- ircbot->send(send_string);
+ ircbot->send(send_string, true);
timer->add(timer->gettick() + 3000, ircbot->join_timer, 0, 0);
return 0;
}
-/**
- * Timer callback to join channels (and optionally send NickServ commands)
- * @see timer->do_timer
- */
+/// @copydoc irc_bot_interface::join_timer()
int irc_join_timer(int tid, int64 tick, int id, intptr_t data) {
if( !ircbot->isOn )
return 0;
if (channel->config->irc_nick_pw[0] != '\0') {
sprintf(send_string, "PRIVMSG NICKSERV : IDENTIFY %s", channel->config->irc_nick_pw);
- ircbot->send(send_string);
+ ircbot->send(send_string, true);
if (channel->config->irc_use_ghost) {
sprintf(send_string, "PRIVMSG NICKSERV : GHOST %s %s", channel->config->irc_nick, channel->config->irc_nick_pw);
+ ircbot->send(send_string, true);
}
}
sprintf(send_string, "JOIN %s", channel->config->irc_channel);
- ircbot->send(send_string);
+ ircbot->send(send_string, true);
ircbot->isIn = true;
return 0;
}
-/**
- * Search the handler for a given IRC received command
- * @param function_name Name of the received IRC command
- * @return Function pointer to the command handler, NULL in case
- * of unhandled commands
- */
+/// @copydoc irc_bot_interface::func_search()
struct irc_func* irc_func_search(char* function_name) {
int i;
nullpo_retr(NULL, function_name);
@@ -129,12 +116,9 @@ struct irc_func* irc_func_search(char* function_name) {
return NULL;
}
-/**
- * Parser for the IRC server connection
- * @see do_sockets
- */
+/// @copydoc irc_bot_interface::parse()
int irc_parse(int fd) {
- char *parse_string = NULL, *str_safe = NULL;
+ char *parse_string = NULL, *p = NULL, *str_safe = NULL;
if (sockt->session[fd]->flag.eof) {
sockt->close(fd);
@@ -150,31 +134,23 @@ int irc_parse(int fd) {
if( !RFIFOREST(fd) )
return 0;
- parse_string = (char*)RFIFOP(fd,0);
- parse_string[ RFIFOREST(fd) - 1 ] = '\0';
+ parse_string = aMalloc(RFIFOREST(fd));
+ safestrncpy(parse_string, RFIFOP(fd,0), RFIFOREST(fd));
+ RFIFOSKIP(fd, RFIFOREST(fd));
+ RFIFOFLUSH(fd);
- parse_string = strtok_r(parse_string,"\r\n",&str_safe);
+ p = strtok_r(parse_string,"\r\n",&str_safe);
- while (parse_string != NULL) {
+ while (p != NULL) {
ircbot->parse_sub(fd,parse_string);
- parse_string = strtok_r(NULL,"\r\n",&str_safe);
+ p = strtok_r(NULL,"\r\n",&str_safe);
}
+ aFree(parse_string);
- RFIFOSKIP(fd, RFIFOREST(fd));
- RFIFOFLUSH(fd);
return 0;
}
-/**
- * Parse the source from a received irc message
- * @param source Source string, as reported by the server
- * @param nick Pointer to a string where to return the nick (may not be NULL,
- * needs to be able to fit an IRC_NICK_LENGTH long string)
- * @param ident Pointer to a string where to return the ident (may not be
- * NULL, needs to be able to fit an IRC_IDENT_LENGTH long string)
- * @param host Pointer to a string where to return the hostname (may not be
- * NULL, needs to be able to fit an IRC_HOST_LENGTH long string)
- */
+/// @copydoc irc_bot_interface::parse_source()
void irc_parse_source(char *source, char *nick, char *ident, char *host) {
int i, pos = 0;
size_t len;
@@ -198,12 +174,7 @@ void irc_parse_source(char *source, char *nick, char *ident, char *host) {
}
}
-/**
- * Parse a received message from the irc server, and do the appropriate action
- * for the detected command
- * @param fd IRC server connection file descriptor
- * @param str Raw received message
- */
+/// @copydoc irc_bot_interface::parse_sub()
void irc_parse_sub(int fd, char *str) {
char source[180], command[60], buf1[IRC_MESSAGE_LENGTH], buf2[IRC_MESSAGE_LENGTH];
char *target = buf1, *message = buf2;
@@ -233,35 +204,92 @@ void irc_parse_sub(int fd, char *str) {
func->func(fd,command,source,target,message);
}
-/**
- * Send a raw command to the irc server
- * @param str Command to send
- */
-void irc_send(char *str) {
+/// @copydoc irc_bot_interface::queue()
+void irc_queue(char *str)
+{
+ struct message_flood *queue_entry = NULL;
+
+ if (!ircbot->flood_protection_enabled) {
+ ircbot->send(str, true);
+ return;
+ }
+
+ if (ircbot->message_current == NULL) {
+ // No queue yet
+ if (ircbot->messages_burst_count < ircbot->flood_protection_burst) {
+ ircbot->send(str, true);
+ if (DIFF_TICK(timer->gettick(), ircbot->last_message_tick) <= ircbot->flood_protection_rate)
+ ircbot->messages_burst_count++;
+ else
+ ircbot->messages_burst_count = 0;
+ ircbot->last_message_tick = timer->gettick();
+ } else { //queue starts
+ CREATE(queue_entry, struct message_flood, 1);
+ safestrncpy(queue_entry->message, str, sizeof(queue_entry->message));
+ queue_entry->next = NULL;
+ ircbot->message_current = queue_entry;
+ ircbot->message_last = queue_entry;
+ ircbot->queue_tid = timer->add(timer->gettick() + ircbot->flood_protection_rate, ircbot->queue_timer, 0, 0); //start queue timer
+ ircbot->messages_burst_count = 0;
+ }
+ } else {
+ CREATE(queue_entry, struct message_flood, 1);
+ safestrncpy(queue_entry->message, str, sizeof(queue_entry->message));
+ queue_entry->next = NULL;
+ ircbot->message_last->next = queue_entry;
+ ircbot->message_last = queue_entry;
+ }
+}
+
+/// @copydoc irc_bot_interface::queue_timer()
+int irc_queue_timer(int tid, int64 tick, int id, intptr_t data)
+{
+ struct message_flood *queue_entry = ircbot->message_current;
+ nullpo_ret(queue_entry);
+
+ ircbot->send(queue_entry->message, true);
+ if (queue_entry->next != NULL) {
+ ircbot->message_current = queue_entry->next;
+ ircbot->queue_tid = timer->add(timer->gettick() + ircbot->flood_protection_rate, ircbot->queue_timer, 0, 0);
+ } else {
+ ircbot->message_current = NULL;
+ ircbot->message_last = NULL;
+ ircbot->queue_tid = INVALID_TIMER;
+ }
+
+ aFree(queue_entry);
+
+ return 0;
+}
+
+/// @copydoc irc_bot_interface::send()
+void irc_send(char *str, bool force)
+{
size_t len;
nullpo_retv(str);
len = strlen(str) + 2;
if (len > IRC_MESSAGE_LENGTH-3)
len = IRC_MESSAGE_LENGTH-3;
+
+ if (!force && ircbot->flood_protection_enabled) {
+ // Add to queue
+ ircbot->queue(str);
+ return;
+ }
+
WFIFOHEAD(ircbot->fd, len);
- snprintf((char*)WFIFOP(ircbot->fd,0),IRC_MESSAGE_LENGTH, "%s\r\n", str);
+ snprintf(WFIFOP(ircbot->fd,0),IRC_MESSAGE_LENGTH, "%s\r\n", str);
WFIFOSET(ircbot->fd, len);
}
-/**
- * Handler for the PING IRC command (send back a PONG)
- * @see irc_parse_sub
- */
+/// @copydoc irc_interface_bot::pong()
void irc_pong(int fd, char *cmd, char *source, char *target, char *msg) {
nullpo_retv(cmd);
snprintf(send_string, IRC_MESSAGE_LENGTH, "PONG %s", cmd);
- ircbot->send(send_string);
+ ircbot->send(send_string, false);
}
-/**
- * Handler for CTCP commands received via PRIVMSG
- * @see irc_privmsg
- */
+/// @copydoc irc_interface_bot::privmsg_ctcp()
void irc_privmsg_ctcp(int fd, char *cmd, char *source, char *target, char *msg) {
char source_nick[IRC_NICK_LENGTH], source_ident[IRC_IDENT_LENGTH], source_host[IRC_HOST_LENGTH];
@@ -282,7 +310,7 @@ void irc_privmsg_ctcp(int fd, char *cmd, char *source, char *target, char *msg)
// Ignore it
} else if( strcmpi(cmd,"PING") == 0 ) {
snprintf(send_string, IRC_MESSAGE_LENGTH, "NOTICE %s :\001PING %s\001",source_nick,msg);
- ircbot->send(send_string);
+ ircbot->send(send_string, false);
} else if( strcmpi(cmd,"TIME") == 0 ) {
time_t time_server; // variable for number of seconds (used with time() function)
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
@@ -296,10 +324,10 @@ void irc_privmsg_ctcp(int fd, char *cmd, char *source, char *target, char *msg)
strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X.
snprintf(send_string, IRC_MESSAGE_LENGTH, "NOTICE %s :\001TIME %s\001",source_nick,temp);
- ircbot->send(send_string);
+ ircbot->send(send_string, false);
} else if( strcmpi(cmd,"VERSION") == 0 ) {
- snprintf(send_string, IRC_MESSAGE_LENGTH, "NOTICE %s :\001VERSION Hercules.ws IRC Bridge\001",source_nick);
- ircbot->send(send_string);
+ snprintf(send_string, IRC_MESSAGE_LENGTH, "NOTICE %s :\001VERSION Herc.ws IRC Bridge\001",source_nick);
+ ircbot->send(send_string, false);
#ifdef IRCBOT_DEBUG
} else {
ShowWarning("Unknown CTCP command received %s (%s) from %s\n",cmd,msg,source);
@@ -307,10 +335,7 @@ void irc_privmsg_ctcp(int fd, char *cmd, char *source, char *target, char *msg)
}
}
-/**
- * Handler for the PRIVMSG IRC command (action depends on the message contents)
- * @see irc_parse_sub
- */
+/// @copydoc irc_bot_interface::privmsg()
void irc_privmsg(int fd, char *cmd, char *source, char *target, char *msg) {
size_t len = msg ? strlen(msg) : 0;
nullpo_retv(source);
@@ -321,7 +346,7 @@ void irc_privmsg(int fd, char *cmd, char *source, char *target, char *msg) {
command[0] = message[0] = '\0';
sscanf(msg, "\001%499[^\001\r\n ] %499[^\r\n\001]\001", command, message);
- irc_privmsg_ctcp(fd, command, source, target, message);
+ ircbot->privmsg_ctcp(fd, command, source, target, message);
#ifdef IRCBOT_DEBUG
} else if (strcmpi(target, channel->config->irc_nick) == 0) {
ShowDebug("irc_privmsg: Received message from %s: '%s'\n", source ? source : "(null)", msg);
@@ -348,11 +373,7 @@ void irc_privmsg(int fd, char *cmd, char *source, char *target, char *msg) {
}
}
-/**
- * Handler for the JOIN IRC command (notify an in-game channel of users joining
- * the IRC channel)
- * @see irc_parse_sub
- */
+/// @copydoc irc_bot_interface::userjoin()
void irc_userjoin(int fd, char *cmd, char *source, char *target, char *msg) {
char source_nick[IRC_NICK_LENGTH], source_ident[IRC_IDENT_LENGTH], source_host[IRC_HOST_LENGTH];
@@ -368,11 +389,7 @@ void irc_userjoin(int fd, char *cmd, char *source, char *target, char *msg) {
}
}
-/**
- * Handler for the PART and QUIT IRC commands (notify an in-game channel of
- * users leaving the IRC channel)
- * @see irc_parse_sub
- */
+/// @copydoc irc_bot_interface::userleave()
void irc_userleave(int fd, char *cmd, char *source, char *target, char *msg) {
char source_nick[IRC_NICK_LENGTH], source_ident[IRC_IDENT_LENGTH], source_host[IRC_HOST_LENGTH];
@@ -391,11 +408,7 @@ void irc_userleave(int fd, char *cmd, char *source, char *target, char *msg) {
}
}
-/**
- * Handler for the NICK IRC commands (notify an in-game channel of users
- * changing their name while in the IRC channel)
- * @see irc_parse_sub
- */
+/// @copydoc irc_bot_interface::usernick()
void irc_usernick(int fd, char *cmd, char *source, char *target, char *msg) {
char source_nick[IRC_NICK_LENGTH], source_ident[IRC_IDENT_LENGTH], source_host[IRC_HOST_LENGTH];
@@ -411,11 +424,7 @@ void irc_usernick(int fd, char *cmd, char *source, char *target, char *msg) {
}
}
-/**
- * Relay a chat message to the irc channel the bot is connected to
- * @param name Sender's name
- * @param msg Message text
- */
+/// @copydoc irc_bot_interface::relay()
void irc_relay(const char *name, const char *msg)
{
if (!ircbot->isIn)
@@ -427,12 +436,10 @@ void irc_relay(const char *name, const char *msg)
else
sprintf(send_string,"PRIVMSG %s :%s", channel->config->irc_channel, msg);
- ircbot->send(send_string);
+ ircbot->send(send_string, false);
}
-/**
- * IRC bot initializer
- */
+/// @copydoc irc_bot_interface::init()
void irc_bot_init(bool minimal) {
/// Command handlers
const struct irc_func irc_func_base[] = {
@@ -478,22 +485,31 @@ void irc_bot_init(bool minimal) {
ircbot->isOn = false;
timer->add_func_list(ircbot->connect_timer, "irc_connect_timer");
+ timer->add_func_list(ircbot->queue_timer, "irc_queue_timer");
+
timer->add(timer->gettick() + 7000, ircbot->connect_timer, 0, 0);
}
-/**
- * IRC bot finalizer
- */
+/// @copydoc irc_bot_interface::final()
void irc_bot_final(void) {
int i;
if (!channel->config->irc)
return;
if( ircbot->isOn ) {
- ircbot->send("QUIT :Hercules is shutting down");
+ ircbot->send("QUIT :Hercules is shutting down", true);
sockt->close(ircbot->fd);
}
+ if (ircbot->queue_tid != INVALID_TIMER)
+ timer->delete(ircbot->queue_tid, ircbot->queue_timer);
+
+ while (ircbot->message_current != NULL) {
+ struct message_flood *next = ircbot->message_current->next;
+ aFree(ircbot->message_current);
+ ircbot->message_current = next;
+ }
+
for( i = 0; i < ircbot->funcs.size; i++ ) {
aFree(ircbot->funcs.list[i]);
}
@@ -508,6 +524,15 @@ void ircbot_defaults(void) {
ircbot->channel = NULL;
+ ircbot->flood_protection_enabled = true;
+ ircbot->flood_protection_rate = 1000;
+ ircbot->flood_protection_burst = 3;
+ ircbot->last_message_tick = INVALID_TIMER;
+ ircbot->queue_tid = INVALID_TIMER;
+ ircbot->messages_burst_count = 0;
+ ircbot->message_current = NULL;
+ ircbot->message_last = NULL;
+
ircbot->init = irc_bot_init;
ircbot->final = irc_bot_final;
@@ -521,11 +546,14 @@ void ircbot_defaults(void) {
ircbot->identify_timer = irc_identify_timer;
ircbot->join_timer = irc_join_timer;
+ ircbot->queue_timer = irc_queue_timer;
+ ircbot->queue = irc_queue;
ircbot->send = irc_send;
ircbot->relay = irc_relay;
ircbot->pong = irc_pong;
ircbot->privmsg = irc_privmsg;
+ ircbot->privmsg_ctcp = irc_privmsg_ctcp;
ircbot->userjoin = irc_userjoin;
ircbot->userleave = irc_userleave;
diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h
index dc67e2fe8..54f462e35 100644
--- a/src/map/irc-bot.h
+++ b/src/map/irc-bot.h
@@ -39,6 +39,11 @@ struct irc_func {
void (*func)(int, char*, char*, char*, char*);
};
+struct message_flood {
+ char message[IRC_MESSAGE_LENGTH];
+ struct message_flood *next;
+};
+
struct irc_bot_interface {
int fd;
bool isIn, isOn;
@@ -46,6 +51,15 @@ struct irc_bot_interface {
unsigned char fails;
uint32 ip;
unsigned short port;
+ /* messages flood protection */
+ bool flood_protection_enabled;
+ int flood_protection_rate;
+ int flood_protection_burst;
+ int64 last_message_tick;
+ int messages_burst_count;
+ int queue_tid;
+ struct message_flood *message_current;
+ struct message_flood *message_last;
/* */
struct channel_data *channel;
/* */
@@ -53,27 +67,132 @@ struct irc_bot_interface {
struct irc_func **list;
unsigned int size;
} funcs;
- /* */
+
+ /**
+ * IRC bot initializer
+ */
void (*init) (bool minimal);
+
+ /**
+ * IRC bot finalizer
+ */
void (*final) (void);
- /* */
+
+ /**
+ * Parser for the IRC server connection
+ * @see do_sockets
+ */
int (*parse) (int fd);
+
+ /**
+ * Parse a received message from the irc server, and do the appropriate action
+ * for the detected command
+ * @param fd IRC server connection file descriptor
+ * @param str Raw received message
+ */
void (*parse_sub) (int fd, char *str);
+
+ /**
+ * Parse the source from a received irc message
+ * @param source Source string, as reported by the server
+ * @param nick Pointer to a string where to return the nick (may not be NULL,
+ * needs to be able to fit an IRC_NICK_LENGTH long string)
+ * @param ident Pointer to a string where to return the ident (may not be
+ * NULL, needs to be able to fit an IRC_IDENT_LENGTH long string)
+ * @param host Pointer to a string where to return the hostname (may not be
+ * NULL, needs to be able to fit an IRC_HOST_LENGTH long string)
+ */
void (*parse_source) (char *source, char *nick, char *ident, char *host);
- /* */
+
+ /**
+ * Search the handler for a given IRC received command
+ * @param function_name Name of the received IRC command
+ * @return Function pointer to the command handler, NULL in case
+ * of unhandled commands
+ */
struct irc_func* (*func_search) (char* function_name);
- /* */
+
+ /**
+ * Timer callback to (re-)connect to an IRC server
+ * @see timer_interface::do_timer
+ */
int (*connect_timer) (int tid, int64 tick, int id, intptr_t data);
+
+ /**
+ * Timer callback to send identification commands to an IRC server
+ * @see timer_interface::do_timer
+ */
int (*identify_timer) (int tid, int64 tick, int id, intptr_t data);
+
+ /**
+ * Timer callback to join channels (and optionally send NickServ commands)
+ * @see timer_interface::do_timer
+ */
int (*join_timer) (int tid, int64 tick, int id, intptr_t data);
- /* */
- void (*send)(char *str);
+
+ /**
+ * Timer callback to send queued IRC Commands
+ * @see timer_interface::do_timer
+ */
+ int (*queue_timer) (int tid, int64 tick, int id, intptr_t data);
+
+ /**
+ * Decides if an IRC Command should be queued or not, based on the flood protection settings.
+ *
+ * @param str Command to be checked
+ */
+ void (*queue) (char *str);
+
+ /**
+ * Send a raw command to the irc server
+ * @param str Command to send
+ */
+ void (*send)(char *str, bool force);
+
+ /**
+ * Relay a chat message to the irc channel the bot is connected to
+ * @param name Sender's name
+ * @param msg Message text
+ */
void (*relay) (const char *name, const char *msg);
- /* */
+
+ /**
+ * Handler for the PING IRC command (send back a PONG)
+ * @see irc_bot_interface::parse_sub
+ */
void (*pong) (int fd, char *cmd, char *source, char *target, char *msg);
+
+ /**
+ * Handler for the PRIVMSG IRC command (action depends on the message contents)
+ * @see irc_bot_interface::parse_sub
+ */
void (*privmsg) (int fd, char *cmd, char *source, char *target, char *msg);
+
+ /**
+ * Handler for CTCP commands received via PRIVMSG
+ * @see irc_bot_interface::privmsg
+ */
+ void (*privmsg_ctcp) (int fd, char *cmd, char *source, char *target, char *msg);
+
+ /**
+ * Handler for the JOIN IRC command (notify an in-game channel of users joining
+ * the IRC channel)
+ * @see irc_bot_interface::parse_sub
+ */
void (*userjoin) (int fd, char *cmd, char *source, char *target, char *msg);
+
+ /**
+ * Handler for the PART and QUIT IRC commands (notify an in-game channel of
+ * users leaving the IRC channel)
+ * @see irc_bot_interface::parse_sub
+ */
void (*userleave) (int fd, char *cmd, char *source, char *target, char *msg);
+
+ /**
+ * Handler for the NICK IRC commands (notify an in-game channel of users
+ * changing their name while in the IRC channel)
+ * @see irc_bot_interface::parse_sub
+ */
void (*usernick) (int fd, char *cmd, char *source, char *target, char *msg);
};
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index bd552dd16..9a43bae14 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -49,7 +49,7 @@ struct itemdb_interface *itemdb;
* name = item alias, so we should find items aliases first. if not found then look for "jname" (full name)
* @see DBApply
*/
-int itemdb_searchname_sub(DBKey key, DBData *data, va_list ap)
+int itemdb_searchname_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct item_data *item = DB->data2ptr(data), **dst, **dst2;
char *str;
@@ -112,7 +112,7 @@ struct item_data* itemdb_name2id(const char *str) {
/**
* @see DBMatcher
*/
-int itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap)
+int itemdb_searchname_array_sub(union DBKey key, struct DBData data, va_list ap)
{
struct item_data *item = DB->data2ptr(&data);
char *str;
@@ -170,10 +170,10 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str,
// search in the db
if( count < size )
{
- DBData *db_data[MAX_SEARCH];
+ struct DBData *db_data[MAX_SEARCH];
int db_count = 0;
size -= count;
- db_count = itemdb->other->getall(itemdb->other, (DBData**)&db_data, size, itemdb->searchname_array_sub, str);
+ db_count = itemdb->other->getall(itemdb->other, (struct DBData**)&db_data, size, itemdb->searchname_array_sub, str);
for (i = 0; i < db_count; i++)
data[count++] = DB->data2ptr(db_data[i]);
count += db_count;
@@ -321,6 +321,16 @@ struct item_data* itemdb_exists(int nameid)
return item;
}
+/**
+ * Searches for the item_option data.
+ * @param option_index as the index of the item option (client side).
+ * @return pointer to struct item_option data or NULL.
+ */
+struct item_option *itemdb_option_exists(int idx)
+{
+ return (struct item_option *)idb_get(itemdb->options, idx);
+}
+
/// Returns human readable name for given item type.
/// @param type Type id to retrieve name for ( IT_* ).
const char* itemdb_typename(int type)
@@ -342,81 +352,224 @@ const char* itemdb_typename(int type)
return "Unknown Type";
}
-/*==========================================
- * Converts the jobid from the format in itemdb
- * to the format used by the map server. [Skotlex]
- *------------------------------------------*/
-void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask)
+/**
+ * Converts the JobID to the format used by map-server to check item
+ * restriction as per job.
+ *
+ * @param bclass Pointer to the variable containing the new format
+ * @param job_id Variable containing JobID
+ * @param enable Boolean value which (un)set the restriction.
+ *
+ * @author Dastgir
+ */
+void itemdb_jobid2mapid(uint64 *bclass, int job_class, bool enable)
{
+ uint64 mask[3] = { 0 };
int i;
+
nullpo_retv(bclass);
- bclass[0]= bclass[1]= bclass[2]= 0;
+
+ switch (job_class) {
+ // Base Classes
+ case JOB_NOVICE:
+ case JOB_SUPER_NOVICE:
+ mask[0] = 1ULL << MAPID_NOVICE;
+ mask[1] = 1ULL << MAPID_NOVICE;
+ break;
+ case JOB_SWORDMAN:
+ mask[0] = 1ULL << MAPID_SWORDMAN;
+ break;
+ case JOB_MAGE:
+ mask[0] = 1ULL << MAPID_MAGE;
+ break;
+ case JOB_ARCHER:
+ mask[0] = 1ULL << MAPID_ARCHER;
+ break;
+ case JOB_ACOLYTE:
+ mask[0] = 1ULL << MAPID_ACOLYTE;
+ break;
+ case JOB_MERCHANT:
+ mask[0] = 1ULL << MAPID_MERCHANT;
+ break;
+ case JOB_THIEF:
+ mask[0] = 1ULL << MAPID_THIEF;
+ break;
+ // 2-1 Classes
+ case JOB_KNIGHT:
+ mask[1] = 1ULL << MAPID_SWORDMAN;
+ break;
+ case JOB_PRIEST:
+ mask[1] = 1ULL << MAPID_ACOLYTE;
+ break;
+ case JOB_WIZARD:
+ mask[1] = 1ULL << MAPID_MAGE;
+ break;
+ case JOB_BLACKSMITH:
+ mask[1] = 1ULL << MAPID_MERCHANT;
+ break;
+ case JOB_HUNTER:
+ mask[1] = 1ULL << MAPID_ARCHER;
+ break;
+ case JOB_ASSASSIN:
+ mask[1] = 1ULL << MAPID_THIEF;
+ break;
+ // 2-2 Classes
+ case JOB_CRUSADER:
+ mask[2] = 1ULL << MAPID_SWORDMAN;
+ break;
+ case JOB_MONK:
+ mask[2] = 1ULL << MAPID_ACOLYTE;
+ break;
+ case JOB_SAGE:
+ mask[2] = 1ULL << MAPID_MAGE;
+ break;
+ case JOB_ALCHEMIST:
+ mask[2] = 1ULL << MAPID_MERCHANT;
+ break;
+ case JOB_BARD:
+ mask[2] = 1ULL << MAPID_ARCHER;
+ break;
+ case JOB_ROGUE:
+ mask[2] = 1ULL << MAPID_THIEF;
+ break;
+ // Extended Classes
+ case JOB_TAEKWON:
+ mask[0] = 1ULL << MAPID_TAEKWON;
+ break;
+ case JOB_STAR_GLADIATOR:
+ mask[1] = 1ULL << MAPID_TAEKWON;
+ break;
+ case JOB_SOUL_LINKER:
+ mask[2] = 1ULL << MAPID_TAEKWON;
+ break;
+ case JOB_GUNSLINGER:
+ mask[0] = 1ULL << MAPID_GUNSLINGER;
+ mask[1] = 1ULL << MAPID_GUNSLINGER;
+ break;
+ case JOB_NINJA:
+ mask[0] = 1ULL << MAPID_NINJA;
+ mask[1] = 1ULL << MAPID_NINJA;
+ break;
+ case JOB_KAGEROU:
+ case JOB_OBORO:
+ mask[1] = 1ULL << MAPID_NINJA;
+ break;
+ case JOB_REBELLION:
+ mask[1] = 1ULL << MAPID_GUNSLINGER;
+ break;
+ case JOB_SUMMONER:
+ mask[0] = 1ULL << MAPID_SUMMONER;
+ break;
+ // Other Classes
+ case JOB_GANGSI: //Bongun/Munak
+ mask[0] = 1ULL << MAPID_GANGSI;
+ break;
+ case JOB_DEATH_KNIGHT:
+ mask[1] = 1ULL << MAPID_GANGSI;
+ break;
+ case JOB_DARK_COLLECTOR:
+ mask[2] = 1ULL << MAPID_GANGSI;
+ break;
+ }
+
+ for (i = 0; i < ARRAYLENGTH(mask); i++) {
+ if (mask[i] == 0)
+ continue;
+ if (enable)
+ bclass[i] |= mask[i];
+ else
+ bclass[i] &= ~mask[i];
+ }
+}
+
+/**
+ * Converts the JobMask to the format used by map-server to check item
+ * restriction as per job.
+ *
+ * @param bclass Pointer to the variable containing the new format.
+ * @param jobmask Variable containing JobMask.
+ */
+void itemdb_jobmask2mapid(uint64 *bclass, uint64 jobmask)
+{
+ nullpo_retv(bclass);
+ bclass[0] = bclass[1] = bclass[2] = 0;
//Base classes
- if (jobmask & 1<<JOB_NOVICE) {
+ if (jobmask & 1ULL<<JOB_NOVICE) {
//Both Novice/Super-Novice are counted with the same ID
- bclass[0] |= 1<<MAPID_NOVICE;
- bclass[1] |= 1<<MAPID_NOVICE;
- }
- for (i = JOB_NOVICE+1; i <= JOB_THIEF; i++)
- {
- if (jobmask & 1<<i)
- bclass[0] |= 1<<(MAPID_NOVICE+i);
- }
+ bclass[0] |= 1ULL<<MAPID_NOVICE;
+ bclass[1] |= 1ULL<<MAPID_NOVICE;
+ }
+ if (jobmask & 1ULL<<JOB_SWORDMAN)
+ bclass[0] |= 1ULL<<MAPID_SWORDMAN;
+ if (jobmask & 1ULL<<JOB_MAGE)
+ bclass[0] |= 1ULL<<MAPID_MAGE;
+ if (jobmask & 1ULL<<JOB_ARCHER)
+ bclass[0] |= 1ULL<<MAPID_ARCHER;
+ if (jobmask & 1ULL<<JOB_ACOLYTE)
+ bclass[0] |= 1ULL<<MAPID_ACOLYTE;
+ if (jobmask & 1ULL<<JOB_MERCHANT)
+ bclass[0] |= 1ULL<<MAPID_MERCHANT;
+ if (jobmask & 1ULL<<JOB_THIEF)
+ bclass[0] |= 1ULL<<MAPID_THIEF;
//2-1 classes
- if (jobmask & 1<<JOB_KNIGHT)
- bclass[1] |= 1<<MAPID_SWORDMAN;
- if (jobmask & 1<<JOB_PRIEST)
- bclass[1] |= 1<<MAPID_ACOLYTE;
- if (jobmask & 1<<JOB_WIZARD)
- bclass[1] |= 1<<MAPID_MAGE;
- if (jobmask & 1<<JOB_BLACKSMITH)
- bclass[1] |= 1<<MAPID_MERCHANT;
- if (jobmask & 1<<JOB_HUNTER)
- bclass[1] |= 1<<MAPID_ARCHER;
- if (jobmask & 1<<JOB_ASSASSIN)
- bclass[1] |= 1<<MAPID_THIEF;
+ if (jobmask & 1ULL<<JOB_KNIGHT)
+ bclass[1] |= 1ULL<<MAPID_SWORDMAN;
+ if (jobmask & 1ULL<<JOB_PRIEST)
+ bclass[1] |= 1ULL<<MAPID_ACOLYTE;
+ if (jobmask & 1ULL<<JOB_WIZARD)
+ bclass[1] |= 1ULL<<MAPID_MAGE;
+ if (jobmask & 1ULL<<JOB_BLACKSMITH)
+ bclass[1] |= 1ULL<<MAPID_MERCHANT;
+ if (jobmask & 1ULL<<JOB_HUNTER)
+ bclass[1] |= 1ULL<<MAPID_ARCHER;
+ if (jobmask & 1ULL<<JOB_ASSASSIN)
+ bclass[1] |= 1ULL<<MAPID_THIEF;
//2-2 classes
- if (jobmask & 1<<JOB_CRUSADER)
- bclass[2] |= 1<<MAPID_SWORDMAN;
- if (jobmask & 1<<JOB_MONK)
- bclass[2] |= 1<<MAPID_ACOLYTE;
- if (jobmask & 1<<JOB_SAGE)
- bclass[2] |= 1<<MAPID_MAGE;
- if (jobmask & 1<<JOB_ALCHEMIST)
- bclass[2] |= 1<<MAPID_MERCHANT;
- if (jobmask & 1<<JOB_BARD)
- bclass[2] |= 1<<MAPID_ARCHER;
+ if (jobmask & 1ULL<<JOB_CRUSADER)
+ bclass[2] |= 1ULL<<MAPID_SWORDMAN;
+ if (jobmask & 1ULL<<JOB_MONK)
+ bclass[2] |= 1ULL<<MAPID_ACOLYTE;
+ if (jobmask & 1ULL<<JOB_SAGE)
+ bclass[2] |= 1ULL<<MAPID_MAGE;
+ if (jobmask & 1ULL<<JOB_ALCHEMIST)
+ bclass[2] |= 1ULL<<MAPID_MERCHANT;
+ if (jobmask & 1ULL<<JOB_BARD)
+ bclass[2] |= 1ULL<<MAPID_ARCHER;
#if 0 // Bard/Dancer share the same slot now.
- if (jobmask & 1<<JOB_DANCER)
- bclass[2] |= 1<<MAPID_ARCHER;
+ if (jobmask & 1ULL<<JOB_DANCER)
+ bclass[2] |= 1ULL<<MAPID_ARCHER;
#endif // 0
- if (jobmask & 1<<JOB_ROGUE)
- bclass[2] |= 1<<MAPID_THIEF;
+ if (jobmask & 1ULL<<JOB_ROGUE)
+ bclass[2] |= 1ULL<<MAPID_THIEF;
//Special classes that don't fit above.
- if (jobmask & 1<<21) //Taekwon boy
- bclass[0] |= 1<<MAPID_TAEKWON;
- if (jobmask & 1<<22) //Star Gladiator
- bclass[1] |= 1<<MAPID_TAEKWON;
- if (jobmask & 1<<23) //Soul Linker
- bclass[2] |= 1<<MAPID_TAEKWON;
- if (jobmask & 1<<JOB_GUNSLINGER)
- {//Rebellion job can equip Gunslinger equips. [Rytech]
- bclass[0] |= 1<<MAPID_GUNSLINGER;
- bclass[1] |= 1<<MAPID_GUNSLINGER;
- }
- if (jobmask & 1<<JOB_NINJA)
- {bclass[0] |= 1<<MAPID_NINJA;
- bclass[1] |= 1<<MAPID_NINJA;}//Kagerou/Oboro jobs can equip Ninja equips. [Rytech]
- if (jobmask & 1<<26) //Bongun/Munak
- bclass[0] |= 1<<MAPID_GANGSI;
- if (jobmask & 1<<27) //Death Knight
- bclass[1] |= 1<<MAPID_GANGSI;
- if (jobmask & 1<<28) //Dark Collector
- bclass[2] |= 1<<MAPID_GANGSI;
- if (jobmask & 1<<29) //Kagerou / Oboro
- bclass[1] |= 1<<MAPID_NINJA;
- if (jobmask & 1<<30) //Rebellion
- bclass[1] |= 1<<MAPID_GUNSLINGER;
+ if (jobmask & 1ULL<<21) //Taekwon boy
+ bclass[0] |= 1ULL<<MAPID_TAEKWON;
+ if (jobmask & 1ULL<<22) //Star Gladiator
+ bclass[1] |= 1ULL<<MAPID_TAEKWON;
+ if (jobmask & 1ULL<<23) //Soul Linker
+ bclass[2] |= 1ULL<<MAPID_TAEKWON;
+ if (jobmask & 1ULL<<JOB_GUNSLINGER) {
+ //Rebellion job can equip Gunslinger equips. [Rytech]
+ bclass[0] |= 1ULL<<MAPID_GUNSLINGER;
+ bclass[1] |= 1ULL<<MAPID_GUNSLINGER;
+ }
+ if (jobmask & 1ULL<<JOB_NINJA) {
+ //Kagerou/Oboro jobs can equip Ninja equips. [Rytech]
+ bclass[0] |= 1ULL<<MAPID_NINJA;
+ bclass[1] |= 1ULL<<MAPID_NINJA;
+ }
+ if (jobmask & 1ULL<<26) //Bongun/Munak
+ bclass[0] |= 1ULL<<MAPID_GANGSI;
+ if (jobmask & 1ULL<<27) //Death Knight
+ bclass[1] |= 1ULL<<MAPID_GANGSI;
+ if (jobmask & 1ULL<<28) //Dark Collector
+ bclass[2] |= 1ULL<<MAPID_GANGSI;
+ if (jobmask & 1ULL<<29) //Kagerou / Oboro
+ bclass[1] |= 1ULL<<MAPID_NINJA;
+ if (jobmask & 1ULL<<30) //Rebellion
+ bclass[1] |= 1ULL<<MAPID_GUNSLINGER;
+ if (jobmask & 1ULL<<31) //Summoner
+ bclass[0] |= 1ULL<<MAPID_SUMMONER;
}
void create_dummy_data(void)
@@ -637,8 +790,8 @@ int itemdb_isidentified2(struct item_data *data) {
}
void itemdb_read_groups(void) {
- config_t item_group_conf;
- config_setting_t *itg = NULL, *it = NULL;
+ struct config_t item_group_conf;
+ struct config_setting_t *itg = NULL, *it = NULL;
#ifdef RENEWAL
const char *config_filename = "db/re/item_group.conf"; // FIXME hardcoded name
#else
@@ -648,10 +801,8 @@ void itemdb_read_groups(void) {
int i = 0, count = 0, c;
unsigned int *gsize = NULL;
- if (libconfig->read_file(&item_group_conf, config_filename)) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&item_group_conf, config_filename))
return;
- }
gsize = aMalloc( libconfig->setting_length(item_group_conf.root) * sizeof(unsigned int) );
@@ -929,8 +1080,8 @@ bool itemdb_read_cached_packages(const char *config_filename) {
return true;
}
void itemdb_read_packages(void) {
- config_t item_packages_conf;
- config_setting_t *itg = NULL, *it = NULL, *t = NULL;
+ struct config_t item_packages_conf;
+ struct config_setting_t *itg = NULL, *it = NULL, *t = NULL;
#ifdef RENEWAL
const char *config_filename = "db/re/item_packages.conf"; // FIXME hardcoded name
#else
@@ -946,10 +1097,8 @@ void itemdb_read_packages(void) {
return;
}
- if (libconfig->read_file(&item_packages_conf, config_filename)) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&item_packages_conf, config_filename))
return;
- }
must = aMalloc( libconfig->setting_length(item_packages_conf.root) * sizeof(unsigned int) );
random = aMalloc( libconfig->setting_length(item_packages_conf.root) * sizeof(unsigned int) );
@@ -1160,9 +1309,128 @@ void itemdb_read_packages(void) {
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, config_filename);
}
+/**
+ * Processes any (plugin-defined) additional fields for a itemdb_options entry.
+ *
+ * @param[in,out] entry The destination ito entry, already initialized
+ * (item_opt.index, status.mode are expected to be already set).
+ * @param[in] t The libconfig entry.
+ * @param[in] source Source of the entry (file name), to be displayed in
+ * case of validation errors.
+ */
+void itemdb_readdb_options_additional_fields(struct item_option *ito, struct config_setting_t *t, const char *source)
+{
+ // do nothing. plugins can do their own work
+}
+
+/**
+ * Reads the Item Options configuration file.
+ */
+void itemdb_read_options(void)
+{
+ struct config_t item_options_db;
+ struct config_setting_t *ito = NULL, *conf = NULL;
+ int index = 0, count = 0;
+ const char *filepath = "db/item_options.conf";
+ VECTOR_DECL(int) duplicate_id;
+
+ if (!libconfig->load_file(&item_options_db, filepath))
+ return;
+
+#ifdef ENABLE_CASE_CHECK
+ script->parser_current_file = filepath;
+#endif // ENABLE_CASE_CHECK
+
+ if ((ito=libconfig->setting_get_member(item_options_db.root, "item_options_db")) == NULL) {
+ ShowError("itemdb_read_options: '%s' could not be loaded.\n", filepath);
+ libconfig->destroy(&item_options_db);
+ return;
+ }
+
+ VECTOR_INIT(duplicate_id);
+
+ VECTOR_ENSURE(duplicate_id, libconfig->setting_length(ito), 1);
+
+ while ((conf = libconfig->setting_get_elem(ito, index++))) {
+ struct item_option t_opt = { 0 }, *s_opt = NULL;
+ const char *str = NULL;
+ int i = 0;
+
+ /* Id Lookup */
+ if (!libconfig->setting_lookup_int16(conf, "Id", &t_opt.index) || t_opt.index <= 0) {
+ ShowError("itemdb_read_options: Invalid Option Id provided for entry %d in '%s', skipping...\n", t_opt.index, filepath);
+ continue;
+ }
+
+ /* Checking for duplicate entries. */
+ ARR_FIND(0, VECTOR_LENGTH(duplicate_id), i, VECTOR_INDEX(duplicate_id, i) == t_opt.index);
+
+ if (i != VECTOR_LENGTH(duplicate_id)) {
+ ShowError("itemdb_read_options: Duplicate entry for Option Id %d in '%s', skipping...\n", t_opt.index, filepath);
+ continue;
+ }
+
+ VECTOR_PUSH(duplicate_id, t_opt.index);
+
+ /* Name Lookup */
+ if (!libconfig->setting_lookup_string(conf, "Name", &str)) {
+ ShowError("itemdb_read_options: Invalid Option Name '%s' provided for Id %d in '%s', skipping...\n", str, t_opt.index, filepath);
+ continue;
+ }
+
+ /* check for illegal characters in the constant. */
+ {
+ const char *c = str;
+
+ while (ISALNUM(*c) || *c == '_')
+ ++c;
+
+ if (*c != '\0') {
+ ShowError("itemdb_read_options: Invalid characters in Option Name '%s' for Id %d in '%s', skipping...\n", str, t_opt.index, filepath);
+ continue;
+ }
+ }
+
+ /* Set name as a script constant with index as value. */
+ script->set_constant2(str, t_opt.index, false, false);
+
+ /* Script Code Lookup */
+ if (!libconfig->setting_lookup_string(conf, "Script", &str)) {
+ ShowError("itemdb_read_options: Script code not found for entry %s (Id: %d) in '%s', skipping...\n", str, t_opt.index, filepath);
+ continue;
+ }
+
+ /* Set Script */
+ t_opt.script = *str ? script->parse(str, filepath, t_opt.index, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
+
+ /* Additional fields through plugins */
+ itemdb->readdb_options_additional_fields(&t_opt, ito, filepath);
+
+ /* Allocate memory and copy contents */
+ CREATE(s_opt, struct item_option, 1);
+
+ *s_opt = t_opt;
+
+ /* Store ptr in the database */
+ idb_put(itemdb->options, t_opt.index, s_opt);
+
+ count++;
+ }
+
+#ifdef ENABLE_CASE_CHECK
+ script->parser_current_file = NULL;
+#endif // ENABLE_CASE_CHECK
+
+ libconfig->destroy(&item_options_db);
+
+ VECTOR_CLEAR(duplicate_id);
+
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath);
+}
+
void itemdb_read_chains(void) {
- config_t item_chain_conf;
- config_setting_t *itc = NULL;
+ struct config_t item_chain_conf;
+ struct config_setting_t *itc = NULL;
#ifdef RENEWAL
const char *config_filename = "db/re/item_chain.conf"; // FIXME hardcoded name
#else
@@ -1170,10 +1438,8 @@ void itemdb_read_chains(void) {
#endif
int i = 0, count = 0;
- if (libconfig->read_file(&item_chain_conf, config_filename)) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&item_chain_conf, config_filename))
return;
- }
CREATE(itemdb->chains, struct item_chain, libconfig->setting_length(item_chain_conf.root));
itemdb->chain_count = (unsigned short)libconfig->setting_length(item_chain_conf.root);
@@ -1186,7 +1452,7 @@ void itemdb_read_chains(void) {
struct item_chain_entry *prev = NULL;
const char *name = config_setting_name(itc);
int c = 0;
- config_setting_t *entry = NULL;
+ struct config_setting_t *entry = NULL;
script->set_constant2(name, i-1, false, false);
itemdb->chains[count].qty = (unsigned short)libconfig->setting_length(itc);
@@ -1261,7 +1527,7 @@ void itemdb_read_combos(void)
char filepath[256];
FILE* fp;
- sprintf(filepath, "%s/%s", map->db_path, DBPATH"item_combo_db.txt");
+ snprintf(filepath, 256, "%s/%s", map->db_path, DBPATH"item_combo_db.txt");
if ((fp = fopen(filepath, "r")) == NULL) {
ShowError("itemdb_read_combos: File not found \"%s\".\n", filepath);
@@ -1286,7 +1552,7 @@ void itemdb_read_combos(void)
if (!strchr(p,',')) {
/* is there even a single column? */
- ShowError("itemdb_read_combos: Insufficient columns in line %d of \"%s\", skipping.\n", lines, filepath);
+ ShowError("itemdb_read_combos: Insufficient columns in line %u of \"%s\", skipping.\n", lines, filepath);
continue;
}
@@ -1300,13 +1566,13 @@ void itemdb_read_combos(void)
p++;
if (str[1][0] != '{') {
- ShowError("itemdb_read_combos(#1): Invalid format (Script column) in line %d of \"%s\", skipping.\n", lines, filepath);
+ ShowError("itemdb_read_combos(#1): Invalid format (Script column) in line %u of \"%s\", skipping.\n", lines, filepath);
continue;
}
/* no ending key anywhere (missing \}\) */
if ( str[1][strlen(str[1])-1] != '}' ) {
- ShowError("itemdb_read_combos(#2): Invalid format (Script column) in line %d of \"%s\", skipping.\n", lines, filepath);
+ ShowError("itemdb_read_combos(#2): Invalid format (Script column) in line %u of \"%s\", skipping.\n", lines, filepath);
continue;
} else {
int items[MAX_ITEMS_PER_COMBO];
@@ -1314,14 +1580,14 @@ void itemdb_read_combos(void)
struct item_combo *combo = NULL;
if((retcount = itemdb->combo_split_atoi(str[0], items)) < 2) {
- ShowError("itemdb_read_combos: line %d of \"%s\" doesn't have enough items to make for a combo (min:2), skipping.\n", lines, filepath);
+ ShowError("itemdb_read_combos: line %u of \"%s\" doesn't have enough items to make for a combo (min:2), skipping.\n", lines, filepath);
continue;
}
/* validate */
for(v = 0; v < retcount; v++) {
if( !itemdb->exists(items[v]) ) {
- ShowError("itemdb_read_combos: line %d of \"%s\" contains unknown item ID %d, skipping.\n", lines, filepath,items[v]);
+ ShowError("itemdb_read_combos: line %u of \"%s\" contains unknown item ID %d, skipping.\n", lines, filepath, items[v]);
break;
}
}
@@ -1420,6 +1686,30 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
return 0;
}
+ {
+ const char *c = entry->name;
+ while (ISALNUM(*c) || *c == '_')
+ ++c;
+
+ if (*c != '\0') {
+ ShowWarning("itemdb_validate_entry: Invalid characters in the AegisName '%s' for item %d in '%s'. Skipping.\n",
+ entry->name, entry->nameid, source);
+ if (entry->script) {
+ script->free_code(entry->script);
+ entry->script = NULL;
+ }
+ if (entry->equip_script) {
+ script->free_code(entry->equip_script);
+ entry->equip_script = NULL;
+ }
+ if (entry->unequip_script) {
+ script->free_code(entry->unequip_script);
+ entry->unequip_script = NULL;
+ }
+ return 0;
+ }
+ }
+
if( entry->type < 0 || entry->type == IT_UNKNOWN || entry->type == IT_UNKNOWN2
|| (entry->type > IT_DELAYCONSUME && entry->type < IT_CASH ) || entry->type >= IT_MAX
) {
@@ -1462,7 +1752,7 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
if (entry->flag.trade_restriction > ITR_ALL) {
ShowWarning("itemdb_validate_entry: Invalid trade restriction flag 0x%x for item %d (%s) in '%s', defaulting to none.\n",
- entry->flag.trade_restriction, entry->nameid, entry->jname, source);
+ (unsigned int)entry->flag.trade_restriction, entry->nameid, entry->jname, source);
entry->flag.trade_restriction = ITR_NONE;
}
@@ -1498,6 +1788,12 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
memset(&entry->stack, '\0', sizeof(entry->stack));
}
+ if (entry->type == IT_WEAPON && (entry->look < 0 || entry->look >= MAX_SINGLE_WEAPON_TYPE)) {
+ ShowWarning("itemdb_validate_entry: Invalid View for weapon items. View value %d for item %d (%s) in '%s', defaulting to 1.\n",
+ entry->look, entry->nameid, entry->jname, source);
+ entry->look = 1;
+ }
+
entry->wlv = cap_value(entry->wlv, REFINE_TYPE_ARMOR, REFINE_TYPE_MAX);
if( !entry->elvmax )
@@ -1507,7 +1803,10 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
if( entry->type != IT_ARMOR && entry->type != IT_WEAPON && !entry->flag.no_refine )
entry->flag.no_refine = 1;
-
+
+ if (entry->type != IT_ARMOR && entry->type != IT_WEAPON && !entry->flag.no_options)
+ entry->flag.no_options = 1;
+
if (entry->flag.available != 1) {
entry->flag.available = 1;
entry->view_id = 0;
@@ -1535,9 +1834,42 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
return item->nameid;
}
-void itemdb_readdb_additional_fields(int itemid, config_setting_t *it, int n, const char *source)
+void itemdb_readdb_additional_fields(int itemid, struct config_setting_t *it, int n, const char *source)
{
- // do nothing. plugins can do own work
+ // do nothing. plugins can do own work
+}
+
+/**
+ * Processes job names and changes it into mapid format.
+ *
+ * @param id item_data entry.
+ * @param t Libconfig setting entry. It is expected to be valid and it won't
+ * be freed (it is care of the caller to do so if necessary).
+ */
+void itemdb_readdb_job_sub(struct item_data *id, struct config_setting_t *t)
+{
+ int idx = 0;
+ struct config_setting_t *it = NULL;
+ bool enable_all = false;
+
+ id->class_base[0] = id->class_base[1] = id->class_base[2] = 0;
+
+ if (libconfig->setting_lookup_bool_real(t, "All", &enable_all) && enable_all) {
+ itemdb->jobmask2mapid(id->class_base, UINT64_MAX);
+ }
+ while ((it = libconfig->setting_get_elem(t, idx++)) != NULL) {
+ const char *job_name = config_setting_name(it);
+ int job_id;
+
+ if (strcmp(job_name, "All") == 0)
+ continue;
+
+ if ((job_id = pc->check_job_name(job_name)) == -1) {
+ ShowWarning("itemdb_readdb_job_sub: unknown job name '%s'!\n", job_name);
+ } else {
+ itemdb->jobid2mapid(id->class_base, job_id, libconfig->setting_get_bool(it));
+ }
+ }
}
/**
@@ -1553,9 +1885,9 @@ void itemdb_readdb_additional_fields(int itemid, config_setting_t *it, int n, co
* validation errors.
* @return Nameid of the validated entry, or 0 in case of failure.
*/
-int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source) {
+int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char *source) {
struct item_data id = { 0 };
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
const char *str = NULL;
int i32 = 0;
bool inherit = false;
@@ -1681,10 +2013,17 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
if( itemdb->lookup_const(it, "Slots", &i32) && i32 >= 0 )
id.slot = i32;
- if( itemdb->lookup_const(it, "Job", &i32) ) // This is an unsigned value, do not check for >= 0
- itemdb->jobid2mapid(id.class_base, (unsigned int)i32);
- else if( !inherit )
- itemdb->jobid2mapid(id.class_base, UINT_MAX);
+ if ((t = libconfig->setting_get_member(it, "Job")) != NULL) {
+ if (config_setting_is_group(t)) {
+ itemdb->readdb_job_sub(&id, t);
+ } else if (itemdb->lookup_const(it, "Job", &i32)) { // This is an unsigned value, do not check for >= 0
+ itemdb->jobmask2mapid(id.class_base, (uint64)i32);
+ } else if (!inherit) {
+ itemdb->jobmask2mapid(id.class_base, UINT64_MAX);
+ }
+ } else if (!inherit) {
+ itemdb->jobmask2mapid(id.class_base, UINT64_MAX);
+ }
if( itemdb->lookup_const(it, "Upper", &i32) && i32 >= 0 )
id.class_upper = (unsigned int)i32;
@@ -1715,6 +2054,9 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
if( (t = libconfig->setting_get_member(it, "Refine")) )
id.flag.no_refine = libconfig->setting_get_bool(t) ? 0 : 1;
+
+ if ((t = libconfig->setting_get_member(it, "DisableOptions")))
+ id.flag.no_options = libconfig->setting_get_bool(t) ? 1 : 0;
if( itemdb->lookup_const(it, "View", &i32) && i32 >= 0 )
id.look = i32;
@@ -1731,12 +2073,15 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
if ((t = libconfig->setting_get_member(it, "KeepAfterUse")))
id.flag.keepafteruse = libconfig->setting_get_bool(t) ? 1 : 0;
+ if ((t = libconfig->setting_get_member(it, "DropAnnounce")))
+ id.flag.drop_announce = libconfig->setting_get_bool(t) ? 1 : 0;
+
if (itemdb->lookup_const(it, "Delay", &i32) && i32 >= 0)
id.delay = i32;
if ( (t = libconfig->setting_get_member(it, "Trade")) ) {
if (config_setting_is_group(t)) {
- config_setting_t *tt = NULL;
+ struct config_setting_t *tt = NULL;
if ((tt = libconfig->setting_get_member(t, "override"))) {
id.gm_lv_trade_override = libconfig->setting_get_int(tt);
@@ -1802,7 +2147,7 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
if ((t = libconfig->setting_get_member(it, "Nouse"))) {
if (config_setting_is_group(t)) {
- config_setting_t *nt = NULL;
+ struct config_setting_t *nt = NULL;
if ((nt = libconfig->setting_get_member(t, "override"))) {
id.item_usage.override = libconfig->setting_get_int(nt);
@@ -1850,7 +2195,7 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
return itemdb->validate_entry(&id, n, source);
}
-bool itemdb_lookup_const(const config_setting_t *it, const char *name, int *value)
+bool itemdb_lookup_const(const struct config_setting_t *it, const char *name, int *value)
{
nullpo_retr(false, name);
nullpo_retr(false, value);
@@ -1879,19 +2224,24 @@ bool itemdb_lookup_const(const config_setting_t *it, const char *name, int *valu
*/
int itemdb_readdb_libconfig(const char *filename) {
bool duplicate[MAX_ITEMDB];
- config_t item_db_conf;
- config_setting_t *itdb, *it;
+ struct config_t item_db_conf;
+ struct config_setting_t *itdb, *it;
char filepath[256];
int i = 0, count = 0;
nullpo_ret(filename);
+
sprintf(filepath, "%s/%s", map->db_path, filename);
- memset(&duplicate,0,sizeof(duplicate));
- if( libconfig->read_file(&item_db_conf, filepath) || !(itdb = libconfig->setting_get_member(item_db_conf.root, "item_db")) ) {
+ if (!libconfig->load_file(&item_db_conf, filepath))
+ return 0;
+
+ if ((itdb = libconfig->setting_get_member(item_db_conf.root, "item_db")) == NULL) {
ShowError("can't read %s\n", filepath);
return 0;
}
+ memset(&duplicate,0,sizeof(duplicate));
+
while( (it = libconfig->setting_get_elem(itdb,i++)) ) {
int nameid = itemdb->readdb_libconfig_sub(it, i-1, filename);
@@ -1928,7 +2278,7 @@ uint64 itemdb_unique_id(struct map_session_data *sd) {
*/
void itemdb_read(bool minimal) {
int i;
- DBData prev;
+ struct DBData prev;
const char *filename[] = {
DBPATH"item_db.conf",
@@ -1953,6 +2303,7 @@ void itemdb_read(bool minimal) {
itemdb->read_groups();
itemdb->read_chains();
itemdb->read_packages();
+ itemdb->read_options();
}
@@ -2005,7 +2356,7 @@ void destroy_item_data(struct item_data* self, int free_self)
/**
* @see DBApply
*/
-int itemdb_final_sub(DBKey key, DBData *data, va_list ap)
+int itemdb_final_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct item_data *id = DB->data2ptr(data);
@@ -2014,6 +2365,17 @@ int itemdb_final_sub(DBKey key, DBData *data, va_list ap)
return 0;
}
+
+int itemdb_options_final_sub(union DBKey key, struct DBData *data, va_list ap)
+{
+ struct item_option *ito = DB->data2ptr(data);
+
+ if (ito->script != NULL)
+ script->free_code(ito->script);
+
+ return 0;
+}
+
void itemdb_clear(bool total) {
int i;
// clear the previous itemdb data
@@ -2077,6 +2439,7 @@ void itemdb_clear(bool total) {
return;
itemdb->other->clear(itemdb->other, itemdb->final_sub);
+ itemdb->options->clear(itemdb->options, itemdb->options_final_sub);
memset(itemdb->array, 0, sizeof(itemdb->array));
@@ -2127,22 +2490,27 @@ void itemdb_reload(void) {
for (sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) {
memset(sd->item_delay, 0, sizeof(sd->item_delay)); // reset item delays
pc->setinventorydata(sd);
- if( battle_config.item_check )
- sd->state.itemcheck = 1;
+
+ if (battle->bc->item_check != PCCHECKITEM_NONE) // Check and flag items for inspection.
+ sd->itemcheck = (enum pc_checkitem_types) battle->bc->item_check;
+
/* clear combo bonuses */
- if( sd->combo_count ) {
+ if (sd->combo_count) {
aFree(sd->combos);
sd->combos = NULL;
sd->combo_count = 0;
if( pc->load_combo(sd) > 0 )
status_calc_pc(sd,SCO_FORCE);
}
+
+ // Check for and delete unavailable/disabled items.
pc->checkitem(sd);
}
mapit->free(iter);
}
-void itemdb_name_constants(void) {
- DBIterator *iter = db_iterator(itemdb->names);
+void itemdb_name_constants(void)
+{
+ struct DBIterator *iter = db_iterator(itemdb->names);
struct item_data *data;
#ifdef ENABLE_CASE_CHECK
@@ -2160,6 +2528,7 @@ void do_final_itemdb(void) {
itemdb->clear(true);
itemdb->other->destroy(itemdb->other, itemdb->final_sub);
+ itemdb->options->destroy(itemdb->options, itemdb->options_final_sub);
itemdb->destroy_item_data(&itemdb->dummy, 0);
db_destroy(itemdb->names);
}
@@ -2167,6 +2536,7 @@ void do_final_itemdb(void) {
void do_init_itemdb(bool minimal) {
memset(itemdb->array, 0, sizeof(itemdb->array));
itemdb->other = idb_alloc(DB_OPT_BASE);
+ itemdb->options = idb_alloc(DB_OPT_RELEASE_DATA);
itemdb->names = strdb_alloc(DB_OPT_BASE,ITEM_NAME_LENGTH);
itemdb->create_dummy_data(); //Dummy data item.
itemdb->read(minimal);
@@ -2177,7 +2547,7 @@ void do_init_itemdb(bool minimal) {
clif->cashshop_load();
/** it failed? we disable it **/
- if( !clif->parse_roulette_db() )
+ if (battle_config.feature_roulette == 1 && !clif->parse_roulette_db())
battle_config.feature_roulette = 0;
}
void itemdb_defaults(void) {
@@ -2209,6 +2579,7 @@ void itemdb_defaults(void) {
itemdb->read_groups = itemdb_read_groups;
itemdb->read_chains = itemdb_read_chains;
itemdb->read_packages = itemdb_read_packages;
+ itemdb->read_options = itemdb_read_options;
/* */
itemdb->write_cached_packages = itemdb_write_cached_packages;
itemdb->read_cached_packages = itemdb_read_cached_packages;
@@ -2219,6 +2590,7 @@ void itemdb_defaults(void) {
itemdb->load = itemdb_load;
itemdb->search = itemdb_search;
itemdb->exists = itemdb_exists;
+ itemdb->option_exists = itemdb_option_exists;
itemdb->in_group = itemdb_in_group;
itemdb->group_item = itemdb_searchrandomid;
itemdb->chain_item = itemdb_chain_item;
@@ -2227,6 +2599,7 @@ void itemdb_defaults(void) {
itemdb->searchname_array_sub = itemdb_searchname_array_sub;
itemdb->searchrandomid = itemdb_searchrandomid;
itemdb->typename = itemdb_typename;
+ itemdb->jobmask2mapid = itemdb_jobmask2mapid;
itemdb->jobid2mapid = itemdb_jobid2mapid;
itemdb->create_dummy_data = create_dummy_data;
itemdb->create_item_data = create_item_data;
@@ -2250,13 +2623,16 @@ void itemdb_defaults(void) {
itemdb->read_combos = itemdb_read_combos;
itemdb->gendercheck = itemdb_gendercheck;
itemdb->validate_entry = itemdb_validate_entry;
+ itemdb->readdb_options_additional_fields = itemdb_readdb_options_additional_fields;
itemdb->readdb_additional_fields = itemdb_readdb_additional_fields;
+ itemdb->readdb_job_sub = itemdb_readdb_job_sub;
itemdb->readdb_libconfig_sub = itemdb_readdb_libconfig_sub;
itemdb->readdb_libconfig = itemdb_readdb_libconfig;
itemdb->unique_id = itemdb_unique_id;
itemdb->read = itemdb_read;
itemdb->destroy_item_data = destroy_item_data;
itemdb->final_sub = itemdb_final_sub;
+ itemdb->options_final_sub = itemdb_options_final_sub;
itemdb->clear = itemdb_clear;
itemdb->id2combo = itemdb_id2combo;
itemdb->is_item_usable = itemdb_is_item_usable;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 8a0ec389d..35cd154cb 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,10 +23,10 @@
/* #include "map/map.h" */
#include "common/hercules.h"
-#include "common/conf.h"
#include "common/db.h"
#include "common/mmo.h" // ITEM_NAME_LENGTH
+struct config_setting_t;
struct script_code;
struct hplugin_data_store;
@@ -54,6 +54,7 @@ enum item_itemid {
ITEMID_WHITE_POTION = 504,
ITEMID_BLUE_POTION = 505,
ITEMID_APPLE = 512,
+ ITEMID_CARROT = 515,
ITEMID_HOLY_WATER = 523,
ITEMID_PUMPKIN = 535,
ITEMID_RED_SLIM_POTION = 545,
@@ -64,7 +65,7 @@ enum item_itemid {
ITEMID_BRANCH_OF_DEAD_TREE = 604,
ITEMID_ANODYNE = 605,
ITEMID_ALOEBERA = 606,
- ITEMID_MAGNIFIER = 611,
+ ITEMID_SPECTACLES = 611,
ITEMID_POISON_BOTTLE = 678,
ITEMID_EMPTY_BOTTLE = 713,
ITEMID_EMPERIUM = 714,
@@ -92,15 +93,15 @@ enum item_itemid {
ITEMID_IRON_ORE = 1002,
ITEMID_PHRACON = 1010,
ITEMID_EMVERETARCON = 1011,
- ITEMID_TRAP = 1065,
+ ITEMID_BOOBY_TRAP = 1065,
ITEMID_PILEBUNCKER = 1549,
ITEMID_ANGRA_MANYU = 1599,
ITEMID_STRANGE_EMBRYO = 6415,
ITEMID_FACE_PAINT = 6120,
- ITEMID_SCARLET_POINT = 6360,
- ITEMID_INDIGO_POINT = 6361,
- ITEMID_YELLOW_WISH_POINT = 6362,
- ITEMID_LIME_GREEN_POINT = 6363,
+ ITEMID_SCARLET_PTS = 6360,
+ ITEMID_INDIGO_PTS = 6361,
+ ITEMID_YELLOW_WISH_PTS = 6362,
+ ITEMID_LIME_GREEN_PTS = 6363,
ITEMID_STONE = 7049,
ITEMID_FIRE_BOTTLE = 7135,
ITEMID_ACID_BOTTLE = 7136,
@@ -110,9 +111,8 @@ enum item_itemid {
ITEMID_FRAGMENT_OF_CRYSTAL = 7321,
ITEMID_SKULL_ = 7420,
ITEMID_TOKEN_OF_SIEGFRIED = 7621,
- ITEMID_GOLD_KEY77 = 7782,
- ITEMID_SILVER_KEY77 = 7783,
- ITEMID_TRAP_ALLOY = 7940,
+ ITEMID_SPECIAL_ALLOY_TRAP = 7940,
+ ITEMID_CATNIP_FRUIT = 11602,
ITEMID_RED_POUCH_OF_SURPRISE = 12024,
ITEMID_BLOODY_DEAD_BRANCH = 12103,
ITEMID_PORING_BOX = 12109,
@@ -137,14 +137,31 @@ enum item_itemid {
ITEMID_MAGIC_CASTLE = 12308,
ITEMID_BULGING_HEAD = 12309,
ITEMID_THICK_MANUAL50 = 12312,
- ITEMID_NOVICE_MAGNIFIER = 12325,
- ITEMID_ANCILLA = 12333,
- ITEMID_REPAIR_A = 12392,
- ITEMID_REPAIR_B = 12393,
- ITEMID_REPAIR_C = 12394,
+ ITEMID_N_MAGNIFIER = 12325,
+ ITEMID_ANSILA = 12333,
+ ITEMID_REPAIRA = 12392,
+ ITEMID_REPAIRB = 12393,
+ ITEMID_REPAIRC = 12394,
ITEMID_BLACK_THING = 12435,
- ITEMID_REINS_OF_MOUNT = 12622,
+ ITEMID_BOARDING_HALTER = 12622,
ITEMID_NOBLE_NAMEPLATE = 12705,
+ ITEMID_POISON_PARALYSIS = 12717,
+ ITEMID_POISON_LEECH = 12718,
+ ITEMID_POISON_OBLIVION = 12719,
+ ITEMID_POISON_CONTAMINATION = 12720,
+ ITEMID_POISON_NUMB = 12721,
+ ITEMID_POISON_FEVER = 12722,
+ ITEMID_POISON_LAUGHING = 12723,
+ ITEMID_POISON_FATIGUE = 12724,
+ ITEMID_NAUTHIZ = 12725,
+ ITEMID_RAIDO = 12726,
+ ITEMID_BERKANA = 12727,
+ ITEMID_ISA = 12728,
+ ITEMID_OTHILA = 12729,
+ ITEMID_URUZ = 12730,
+ ITEMID_THURISAZ = 12731,
+ ITEMID_WYRD = 12732,
+ ITEMID_HAGALAZ = 12733,
ITEMID_DUN_TELE_SCROLL1 = 14527,
ITEMID_BATTLE_MANUAL25 = 14532,
ITEMID_BATTLE_MANUAL100 = 14533,
@@ -159,6 +176,7 @@ enum item_itemid {
ITEMID_PILEBUNCKER_S = 16030,
ITEMID_PILEBUNCKER_P = 16031,
ITEMID_PILEBUNCKER_T = 16032,
+ ITEMID_LUX_ANIMA = 22540,
};
enum cards_item_list {
@@ -248,49 +266,6 @@ enum mercenary_scroll_item_list {
};
/**
- * Cash Food
- */
-enum cash_food_item_list {
- ITEMID_STR_DISH10_ = 12202,
- ITEMID_AGI_DISH10_, // 12203
- ITEMID_INT_DISH10_, // 12204
- ITEMID_DEX_DISH10_, // 12205
- ITEMID_LUK_DISH10_, // 12206
- ITEMID_VIT_DISH10_, // 12207
-};
-
-/**
- * GC Poison
- */
-enum poison_item_list {
- ITEMID_POISON_PARALYSIS = 12717,
- ITEMID_POISON_LEECH, // 12718
- ITEMID_POISON_OBLIVION, // 12719
- ITEMID_POISON_CONTAMINATION, // 12720
- ITEMID_POISON_NUMB, // 12721
- ITEMID_POISON_FEVER, // 12722
- ITEMID_POISON_LAUGHING, // 12723
- ITEMID_POISON_FATIGUE, // 12724
-};
-
-
-/**
- * Rune Knight
- **/
-enum rune_item_list {
- ITEMID_NAUTHIZ = 12725,
- ITEMID_RAIDO, // 12726
- ITEMID_BERKANA, // 12727
- ITEMID_ISA, // 12728
- ITEMID_OTHILA, // 12729
- ITEMID_URUZ, // 12730
- ITEMID_THURISAZ, // 12731
- ITEMID_WYRD, // 12732
- ITEMID_HAGALAZ, // 12733
- ITEMID_LUX_ANIMA = 22540,
-};
-
-/**
* Geneticist
*/
enum geneticist_item_list {
@@ -386,7 +361,7 @@ enum ItemTradeRestrictions {
};
/**
- * Iten No-use restrictions
+ * Item No-use restrictions
*/
enum ItemNouseRestrictions {
INR_NONE = 0x0, ///< No restrictions
@@ -395,6 +370,24 @@ enum ItemNouseRestrictions {
INR_ALL = 0x1 ///< Sum of all the above values
};
+/**
+ * Item Option Types
+ */
+enum ItemOptionTypes {
+ IT_OPT_INDEX = 0,
+ IT_OPT_VALUE,
+ IT_OPT_PARAM,
+ IT_OPT_MAX
+};
+
+/** Convenience item list (entry) used in various functions */
+struct itemlist_entry {
+ int id; ///< Item ID or (inventory) index
+ int16 amount; ///< Amount
+};
+/** Convenience item list used in various functions */
+VECTOR_STRUCT_DECL(itemlist, struct itemlist_entry);
+
struct item_combo {
struct script_code *script;
unsigned short nameid[MAX_ITEMS_PER_COMBO];/* nameid array */
@@ -452,6 +445,11 @@ struct item_package {
unsigned short must_qty;
};
+struct item_option {
+ int16 index;
+ struct script_code *script;
+};
+
struct item_data {
uint16 nameid;
char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
@@ -478,7 +476,7 @@ struct item_data {
int delay;
//Lupus: I rearranged order of these fields due to compatibility with ITEMINFO script command
// some script commands should be revised as well...
- unsigned int class_base[3]; ///< Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2)
+ uint64 class_base[3]; ///< Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2)
unsigned class_upper : 6; ///< Specifies if the upper-type can equip it (bitfield, 0x01: normal, 0x02: upper, 0x04: baby normal, 0x08: third normal, 0x10: third upper, 0x20: third baby)
struct {
unsigned short chance;
@@ -497,6 +495,8 @@ struct item_data {
unsigned bindonequip : 1;
unsigned keepafteruse : 1;
unsigned force_serial : 1;
+ unsigned no_options: 1; // < disallows use of item options on the item. (non-equippable items are automatically flagged) [Smokexyz]
+ unsigned drop_announce : 1; // Official Drop Announce [Jedzkie]
} flag;
struct {// item stacking limitation
unsigned short amount;
@@ -538,13 +538,12 @@ struct item_data {
#define itemdb_value_buy(n) (itemdb->search(n)->value_buy)
#define itemdb_value_sell(n) (itemdb->search(n)->value_sell)
#define itemdb_canrefine(n) (!itemdb->search(n)->flag.no_refine)
+#define itemdb_allowoption(n) (!itemdb->search(n)->flag.no_options)
-#define itemdb_is_rune(n) (((n) >= ITEMID_NAUTHIZ && (n) <= ITEMID_HAGALAZ) || (n) == ITEMID_LUX_ANIMA)
-#define itemdb_is_element(n) ((n) >= ITEMID_SCARLET_POINT && (n) <= ITEMID_LIME_GREEN_POINT)
+#define itemdb_is_element(n) ((n) >= ITEMID_SCARLET_PTS && (n) <= ITEMID_LIME_GREEN_PTS)
#define itemdb_is_spellbook(n) ((n) >= ITEMID_MAGIC_BOOK_FB && (n) <= ITEMID_MAGIC_BOOK_DL)
#define itemdb_is_poison(n) ((n) >= ITEMID_POISON_PARALYSIS && (n) <= ITEMID_POISON_FATIGUE)
#define itemid_isgemstone(n) ((n) >= ITEMID_YELLOW_GEMSTONE && (n) <= ITEMID_BLUE_GEMSTONE)
-#define itemdb_iscashfood(n) ((n) >= ITEMID_STR_DISH10_ && (n) <= ITEMID_VIT_DISH10_)
#define itemdb_is_GNbomb(n) ((n) >= ITEMID_APPLE_BOMB && (n) <= ITEMID_VERY_HARD_LUMP)
#define itemdb_is_GNthrowable(n) ((n) >= ITEMID_MYSTERIOUS_POWDER && (n) <= ITEMID_BLACK_THING_TO_THROW)
#define itemid_is_pilebunker(n) ((n) == ITEMID_PILEBUNCKER || (n) == ITEMID_PILEBUNCKER_P || (n) == ITEMID_PILEBUNCKER_S || (n) == ITEMID_PILEBUNCKER_T)
@@ -581,15 +580,17 @@ struct itemdb_interface {
struct item_combo **combos;
unsigned short combo_count;
/* */
- DBMap *names;
+ struct DBMap *names;
/* */
struct item_data *array[MAX_ITEMDB];
- DBMap *other;// int nameid -> struct item_data*
+ struct DBMap *other;// int nameid -> struct item_data*
+ struct DBMap *options; // int opt_id -> struct item_option*
struct item_data dummy; //This is the default dummy item used for non-existant items. [Skotlex]
/* */
void (*read_groups) (void);
void (*read_chains) (void);
void (*read_packages) (void);
+ void (*read_options) (void);
/* */
void (*write_cached_packages) (const char *config_filename);
bool (*read_cached_packages) (const char *config_filename);
@@ -600,15 +601,17 @@ struct itemdb_interface {
struct item_data* (*load)(int nameid);
struct item_data* (*search)(int nameid);
struct item_data* (*exists) (int nameid);
+ struct item_option* (*option_exists) (int idx);
bool (*in_group) (struct item_group *group, int nameid);
int (*group_item) (struct item_group *group);
int (*chain_item) (unsigned short chain_id, int *rate);
void (*package_item) (struct map_session_data *sd, struct item_package *package);
- int (*searchname_sub) (DBKey key, DBData *data, va_list ap);
- int (*searchname_array_sub) (DBKey key, DBData data, va_list ap);
+ int (*searchname_sub) (union DBKey key, struct DBData *data, va_list ap);
+ int (*searchname_array_sub) (union DBKey key, struct DBData data, va_list ap);
int (*searchrandomid) (struct item_group *group);
const char* (*typename) (int type);
- void (*jobid2mapid) (unsigned int *bclass, unsigned int jobmask);
+ void (*jobmask2mapid) (uint64 *bclass, uint64 jobmask);
+ void (*jobid2mapid) (uint64 *bclass, int job_class, bool enable);
void (*create_dummy_data) (void);
struct item_data* (*create_item_data) (int nameid);
int (*isequip) (int nameid);
@@ -631,17 +634,20 @@ struct itemdb_interface {
void (*read_combos) (void);
int (*gendercheck) (struct item_data *id);
int (*validate_entry) (struct item_data *entry, int n, const char *source);
- void (*readdb_additional_fields) (int itemid, config_setting_t *it, int n, const char *source);
- int (*readdb_libconfig_sub) (config_setting_t *it, int n, const char *source);
+ void (*readdb_options_additional_fields) (struct item_option *ito, struct config_setting_t *t, const char *source);
+ void (*readdb_additional_fields) (int itemid, struct config_setting_t *it, int n, const char *source);
+ void (*readdb_job_sub) (struct item_data *id, struct config_setting_t *t);
+ int (*readdb_libconfig_sub) (struct config_setting_t *it, int n, const char *source);
int (*readdb_libconfig) (const char *filename);
uint64 (*unique_id) (struct map_session_data *sd);
void (*read) (bool minimal);
void (*destroy_item_data) (struct item_data *self, int free_self);
- int (*final_sub) (DBKey key, DBData *data, va_list ap);
+ int (*final_sub) (union DBKey key, struct DBData *data, va_list ap);
+ int (*options_final_sub) (union DBKey key, struct DBData *data, va_list ap);
void (*clear) (bool total);
struct item_combo * (*id2combo) (unsigned short id);
bool (*is_item_usable) (struct item_data *item);
- bool (*lookup_const) (const config_setting_t *it, const char *name, int *value);
+ bool (*lookup_const) (const struct config_setting_t *it, const char *name, int *value);
};
#ifdef HERCULES_CORE
diff --git a/src/map/log.c b/src/map/log.c
index 942acb706..6419c4766 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -28,6 +28,7 @@
#include "map/mob.h"
#include "map/pc.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/sql.h" // SQL_INNODB
@@ -62,11 +63,21 @@ char log_picktype2char(e_log_pick_type type) {
case LOG_TYPE_BUYING_STORE: return 'B'; // (B)uying Store
case LOG_TYPE_LOOT: return 'L'; // (L)oot (consumed monster pick/drop)
case LOG_TYPE_BANK: return 'K'; // Ban(K) Transactions
+ case LOG_TYPE_DIVORCE: return 'Y'; // Divorce
+ case LOG_TYPE_ROULETTE: return 'Z'; // Roulette
+ case LOG_TYPE_RENTAL: return 'W'; // Rental
+ case LOG_TYPE_CARD: return 'Q'; // Card
+ case LOG_TYPE_INV_INVALID: return 'J'; // Invalid in inventory
+ case LOG_TYPE_CART_INVALID: return 'H'; // Invalid in cart
+ case LOG_TYPE_EGG: return '@'; // Egg
+ case LOG_TYPE_QUEST: return '0'; // Quest
+ case LOG_TYPE_SKILL: return '1'; // Skill
+ case LOG_TYPE_REFINE: return '2'; // Refine
case LOG_TYPE_OTHER: return 'X'; // Other
}
// should not get here, fallback
- ShowDebug("log_picktype2char: Unknown pick type %d.\n", type);
+ ShowDebug("log_picktype2char: Unknown pick type %u.\n", type);
return 'X';
}
@@ -81,7 +92,7 @@ char log_chattype2char(e_log_chat_type type) {
}
// should not get here, fallback
- ShowDebug("log_chattype2char: Unknown chat type %d.\n", type);
+ ShowDebug("log_chattype2char: Unknown chat type %u.\n", type);
return 'O';
}
@@ -109,8 +120,9 @@ bool should_log_item(int nameid, int amount, int refine, struct item_data *id) {
return false;
}
-void log_branch_sub_sql(struct map_session_data* sd) {
- SqlStmt* stmt;
+void log_branch_sub_sql(struct map_session_data* sd)
+{
+ struct SqlStmt *stmt;
nullpo_retv(sd);
stmt = SQL->StmtMalloc(logs->mysql_handle);
@@ -149,12 +161,15 @@ void log_branch(struct map_session_data* sd) {
}
void log_pick_sub_sql(int id, int16 m, e_log_pick_type type, int amount, struct item* itm, struct item_data *data) {
nullpo_retv(itm);
- if( SQL_ERROR == SQL->Query(logs->mysql_handle,
- LOG_QUERY " INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`, `unique_id`) "
- "VALUES (NOW(), '%d', '%c', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%"PRIu64"')",
+ if (SQL_ERROR == SQL->Query(logs->mysql_handle,
+ LOG_QUERY " INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, "
+ "`opt_idx0`, `opt_val0`, `opt_idx1`, `opt_val1`, `opt_idx2`, `opt_val2`, `opt_idx3`, `opt_val3`, `opt_idx4`, `opt_val4`, `map`, `unique_id`) "
+ "VALUES (NOW(), '%d', '%c', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s', '%"PRIu64"')",
logs->config.log_pick, id, logs->picktype2char(type), itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3],
- map->list[m].name, itm->unique_id)
- ) {
+ itm->option[0].index, itm->option[0].value, itm->option[1].index, itm->option[1].value, itm->option[2].index, itm->option[2].value,
+ itm->option[3].index, itm->option[3].value, itm->option[4].index, itm->option[4].value,
+ map->list[m].name, itm->unique_id))
+ {
Sql_ShowDebug(logs->mysql_handle);
return;
}
@@ -269,15 +284,16 @@ void log_mvpdrop(struct map_session_data* sd, int monster_id, int* log_mvp)
logs->mvpdrop_sub(sd,monster_id,log_mvp);
}
-void log_atcommand_sub_sql(struct map_session_data* sd, const char* message) {
- SqlStmt* stmt;
+void log_atcommand_sub_sql(struct map_session_data* sd, const char* message)
+{
+ struct SqlStmt *stmt;
nullpo_retv(sd);
nullpo_retv(message);
stmt = SQL->StmtMalloc(logs->mysql_handle);
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_gm, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
|| SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, message, safestrnlen(message, 255))
|| SQL_SUCCESS != SQL->StmtExecute(stmt) )
{
SqlStmt_ShowDebug(stmt);
@@ -312,17 +328,18 @@ void log_atcommand(struct map_session_data* sd, const char* message)
logs->atcommand_sub(sd,message);
}
-void log_npc_sub_sql(struct map_session_data *sd, const char *message) {
- SqlStmt* stmt;
+void log_npc_sub_sql(struct map_session_data *sd, const char *message)
+{
+ struct SqlStmt *stmt;
nullpo_retv(sd);
nullpo_retv(message);
stmt = SQL->StmtMalloc(logs->mysql_handle);
- if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_npc, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
- || SQL_SUCCESS != SQL->StmtExecute(stmt) )
- {
+ if (SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", logs->config.log_npc, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, message, safestrnlen(message, 255))
+ || SQL_SUCCESS != SQL->StmtExecute(stmt)
+ ) {
SqlStmt_ShowDebug(stmt);
SQL->StmtFree(stmt);
return;
@@ -369,14 +386,14 @@ void log_npc(struct map_session_data* sd, const char* message)
*/
void log_chat_sub_sql(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message)
{
- SqlStmt* stmt;
+ struct SqlStmt* stmt;
nullpo_retv(dst_charname);
nullpo_retv(message);
stmt = SQL->StmtMalloc(logs->mysql_handle);
if( SQL_SUCCESS != SQL->StmtPrepare(stmt, LOG_QUERY " INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%c', '%d', '%d', '%d', '%s', '%d', '%d', ?, ?)", logs->config.log_chat, logs->chattype2char(type), type_id, src_charid, src_accid, mapname, x, y)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (char*)dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, CHAT_SIZE_MAX))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
+ || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, message, safestrnlen(message, CHAT_SIZE_MAX))
|| SQL_SUCCESS != SQL->StmtExecute(stmt)
) {
SqlStmt_ShowDebug(stmt);
@@ -466,119 +483,251 @@ void log_sql_final(void) {
logs->mysql_handle = NULL;
}
-void log_set_defaults(void) {
+/**
+ * Initializes logs->config variables
+ */
+void log_set_defaults(void)
+{
memset(&logs->config, 0, sizeof(logs->config));
- //LOG FILTER Default values
+ //map_log default values
+ logs->config.enable_logs = 0xFFFFF;
+ logs->config.commands = true;
+
+ //map_log/database default values
+ logs->config.sql_logs = true;
+ // file/table names defaults are defined inside log_config_read_database
+
+ //map_log/filter/item default values
+ logs->config.filter = 1; // logs any item
logs->config.refine_items_log = 5; // log refined items, with refine >= +5
logs->config.rare_items_log = 100; // log rare items. drop chance <= 1%
logs->config.price_items_log = 1000; // 1000z
logs->config.amount_items_log = 100;
}
-int log_config_read(const char* cfgName) {
- static int count = 0;
- char line[1024], w1[1024], w2[1024];
- FILE *fp;
+/**
+ * Reads 'map_log/database' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool log_config_read_database(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_log/database")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("log_config_read: map_log/database was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_bool_real(setting, "use_sql", &logs->config.sql_logs);
- nullpo_retr(1, cfgName);
- if( count++ == 0 )
+ // map_log.database defaults are defined in order to not make unecessary calls to safestrncpy [Panikon]
+ if (libconfig->setting_lookup_mutable_string(setting, "log_branch_db",
+ logs->config.log_branch, sizeof(logs->config.log_branch)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_branch, "branchlog", sizeof(logs->config.log_branch));
+
+ if (libconfig->setting_lookup_mutable_string(setting, "log_pick_db",
+ logs->config.log_pick, sizeof(logs->config.log_pick)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_pick, "picklog", sizeof(logs->config.log_pick));
+
+ if (libconfig->setting_lookup_mutable_string(setting, "log_zeny_db",
+ logs->config.log_zeny, sizeof(logs->config.log_zeny)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_zeny, "zenylog", sizeof(logs->config.log_zeny));
+
+ if (libconfig->setting_lookup_mutable_string(setting, "log_mvpdrop_db",
+ logs->config.log_mvpdrop, sizeof(logs->config.log_mvpdrop)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_mvpdrop, "mvplog", sizeof(logs->config.log_mvpdrop));
+
+ if (libconfig->setting_lookup_mutable_string(setting, "log_gm_db",
+ logs->config.log_gm, sizeof(logs->config.log_gm)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_gm, "atcommandlog", sizeof(logs->config.log_gm));
+
+ if (libconfig->setting_lookup_mutable_string(setting, "log_npc_db",
+ logs->config.log_npc, sizeof(logs->config.log_npc)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_npc, "npclog", sizeof(logs->config.log_npc));
+
+ if (libconfig->setting_lookup_mutable_string(setting, "log_chat_db",
+ logs->config.log_chat, sizeof(logs->config.log_chat)) == CONFIG_FALSE)
+ safestrncpy(logs->config.log_chat, "chatlog", sizeof(logs->config.log_chat));
+
+ return true;
+}
+
+/**
+ * Reads 'map_log/filter/item' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool log_config_read_filter_item(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_log/filter/item")) == NULL) {
+ if (!imported)
+ ShowError("log_config_read: map_log/filter/item was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_int(setting, "log_filter", &logs->config.filter);
+ libconfig->setting_lookup_int(setting, "refine_items_log", &logs->config.refine_items_log);
+ libconfig->setting_lookup_int(setting, "rare_items_log", &logs->config.rare_items_log);
+ libconfig->setting_lookup_int(setting, "price_items_log", &logs->config.price_items_log);
+ libconfig->setting_lookup_int(setting, "amount_items_log", &logs->config.amount_items_log);
+ return true;
+}
+
+/**
+ * Reads 'map_log.filter.chat' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool log_config_read_filter_chat(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_log/filter/chat")) == NULL) {
+ if (!imported)
+ ShowError("log_config_read: map_log/filter/chat was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_int(setting, "log_chat", &logs->config.chat);
+ libconfig->setting_lookup_bool_real(setting, "log_chat_woe_disable", &logs->config.log_chat_woe_disable);
+ return true;
+}
+
+/**
+ * Reads 'map_log.filter' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool log_config_read_filter(const char *filename, struct config_t *config, bool imported)
+{
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if (!log_config_read_filter_item(filename, config, imported))
+ retval = false;
+ if (!log_config_read_filter_chat(filename, config, imported))
+ retval = false;
+
+ return retval;
+}
+
+/**
+ * Reads 'map_log' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool log_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ struct config_setting_t *setting = NULL;
+ const char *import;
+ const char *target; // Type of storage 'file'/'table'
+ int temp;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!imported)
log_set_defaults();
- if( ( fp = fopen(cfgName, "r") ) == NULL ) {
- ShowError("Log configuration file not found at: %s\n", cfgName);
- return 1;
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "map_log")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("log_config_read: map_log was not found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- if (line[0] == '/' && line[1] == '/')
- continue;
-
- if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) == 2) {
- if( strcmpi(w1, "enable_logs") == 0 )
- logs->config.enable_logs = (e_log_pick_type)config_switch(w2);
- else if( strcmpi(w1, "sql_logs") == 0 )
- logs->config.sql_logs = (bool)config_switch(w2);
-//start of common filter settings
- else if( strcmpi(w1, "rare_items_log") == 0 )
- logs->config.rare_items_log = atoi(w2);
- else if( strcmpi(w1, "refine_items_log") == 0 )
- logs->config.refine_items_log = atoi(w2);
- else if( strcmpi(w1, "price_items_log") == 0 )
- logs->config.price_items_log = atoi(w2);
- else if( strcmpi(w1, "amount_items_log") == 0 )
- logs->config.amount_items_log = atoi(w2);
-//end of common filter settings
- else if( strcmpi(w1, "log_branch") == 0 )
- logs->config.branch = config_switch(w2);
- else if( strcmpi(w1, "log_filter") == 0 )
- logs->config.filter = config_switch(w2);
- else if( strcmpi(w1, "log_zeny") == 0 )
- logs->config.zeny = config_switch(w2);
- else if( strcmpi(w1, "log_commands") == 0 )
- logs->config.commands = config_switch(w2);
- else if( strcmpi(w1, "log_npc") == 0 )
- logs->config.npc = config_switch(w2);
- else if( strcmpi(w1, "log_chat") == 0 )
- logs->config.chat = config_switch(w2);
- else if( strcmpi(w1, "log_mvpdrop") == 0 )
- logs->config.mvpdrop = config_switch(w2);
- else if( strcmpi(w1, "log_chat_woe_disable") == 0 )
- logs->config.log_chat_woe_disable = (bool)config_switch(w2);
- else if( strcmpi(w1, "log_branch_db") == 0 )
- safestrncpy(logs->config.log_branch, w2, sizeof(logs->config.log_branch));
- else if( strcmpi(w1, "log_pick_db") == 0 )
- safestrncpy(logs->config.log_pick, w2, sizeof(logs->config.log_pick));
- else if( strcmpi(w1, "log_zeny_db") == 0 )
- safestrncpy(logs->config.log_zeny, w2, sizeof(logs->config.log_zeny));
- else if( strcmpi(w1, "log_mvpdrop_db") == 0 )
- safestrncpy(logs->config.log_mvpdrop, w2, sizeof(logs->config.log_mvpdrop));
- else if( strcmpi(w1, "log_gm_db") == 0 )
- safestrncpy(logs->config.log_gm, w2, sizeof(logs->config.log_gm));
- else if( strcmpi(w1, "log_npc_db") == 0 )
- safestrncpy(logs->config.log_npc, w2, sizeof(logs->config.log_npc));
- else if( strcmpi(w1, "log_chat_db") == 0 )
- safestrncpy(logs->config.log_chat, w2, sizeof(logs->config.log_chat));
- //support the import command, just like any other config
- else if( strcmpi(w1,"import") == 0 )
- logs->config_read(w2);
- else if (HPM->parseConf(w1, w2, HPCT_LOG))
- ; // handled by plugins
- else
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
- }
+ if (libconfig->setting_lookup_int(setting, "enable", &temp) == CONFIG_TRUE) {
+ logs->config.enable_logs = temp&LOG_TYPE_ALL; // e_log_pick_type
}
+ libconfig->setting_lookup_int(setting, "log_zeny", &logs->config.zeny);
+ libconfig->setting_lookup_bool_real(setting, "log_branch", &logs->config.branch);
+ libconfig->setting_lookup_bool_real(setting, "log_mvpdrop", &logs->config.mvpdrop);
+ libconfig->setting_lookup_bool_real(setting, "log_commands", &logs->config.commands);
+ libconfig->setting_lookup_bool_real(setting, "log_npc", &logs->config.npc);
- fclose(fp);
+ if (!log_config_read_database(filename, &config, imported))
+ retval = false;
+ if (!log_config_read_filter(filename, &config, imported))
+ retval = false;
- if( --count == 0 ) {// report final logging state
- const char* target = logs->config.sql_logs ? "table" : "file";
+ if (!HPM->parse_conf(&config, filename, HPCT_LOG, imported))
+ retval = false;
- if( logs->config.enable_logs && logs->config.filter ) {
- ShowInfo("Logging item transactions to %s '%s'.\n", target, logs->config.log_pick);
- }
- if( logs->config.branch ) {
- ShowInfo("Logging monster summon item usage to %s '%s'.\n", target, logs->config.log_pick);
- }
- if( logs->config.chat ) {
- ShowInfo("Logging chat to %s '%s'.\n", target, logs->config.log_chat);
- }
- if( logs->config.commands ) {
- ShowInfo("Logging commands to %s '%s'.\n", target, logs->config.log_gm);
- }
- if( logs->config.mvpdrop ) {
- ShowInfo("Logging MVP monster rewards to %s '%s'.\n", target, logs->config.log_mvpdrop);
- }
- if( logs->config.npc ) {
- ShowInfo("Logging 'logmes' messages to %s '%s'.\n", target, logs->config.log_npc);
- }
- if( logs->config.zeny ) {
- ShowInfo("Logging Zeny transactions to %s '%s'.\n", target, logs->config.log_zeny);
+ target = logs->config.sql_logs ? "table" : "file";
+
+ if (logs->config.enable_logs && logs->config.filter)
+ ShowInfo("Logging item transactions to %s '%s'.\n", target, logs->config.log_pick);
+
+ if (logs->config.branch)
+ ShowInfo("Logging monster summon item usage to %s '%s'.\n", target, logs->config.log_branch);
+
+ if (logs->config.chat)
+ ShowInfo("Logging chat to %s '%s'.\n", target, logs->config.log_chat);
+
+ if (logs->config.commands)
+ ShowInfo("Logging commands to %s '%s'.\n", target, logs->config.log_gm);
+
+ if (logs->config.mvpdrop)
+ ShowInfo("Logging MVP monster rewards to %s '%s'.\n", target, logs->config.log_mvpdrop);
+
+ if (logs->config.npc)
+ ShowInfo("Logging 'logmes' messages to %s '%s'.\n", target, logs->config.log_npc);
+
+ if (logs->config.zeny)
+ ShowInfo("Logging Zeny transactions to %s '%s'.\n", target, logs->config.log_zeny);
+
+ logs->config_done();
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, map->LOG_CONF_NAME) == 0) {
+ ShowWarning("log_config_read: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!logs->config_read(import, true))
+ retval = false;
}
- logs->config_done();
}
- return 0;
+ libconfig->destroy(&config);
+ return retval;
}
void log_config_complete(void) {
@@ -593,6 +742,9 @@ void log_config_complete(void) {
}
}
+/**
+ * Initializes the log interface to the default values.
+ */
void log_defaults(void) {
logs = &log_s;
diff --git a/src/map/log.h b/src/map/log.h
index fbd0acc0e..7ff36d126 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,11 +22,11 @@
#define MAP_LOG_H
#include "common/hercules.h"
-#include "common/sql.h"
/**
* Declarations
**/
+struct Sql; // common/sql.h
struct item;
struct item_data;
struct map_session_data;
@@ -57,29 +57,40 @@ typedef enum e_log_chat_type {
} e_log_chat_type;
typedef enum e_log_pick_type {
- LOG_TYPE_NONE = 0,
- LOG_TYPE_TRADE = 0x00001,
- LOG_TYPE_VENDING = 0x00002,
- LOG_TYPE_PICKDROP_PLAYER = 0x00004,
- LOG_TYPE_PICKDROP_MONSTER = 0x00008,
- LOG_TYPE_NPC = 0x00010,
- LOG_TYPE_SCRIPT = 0x00020,
- LOG_TYPE_STEAL = 0x00040,
- LOG_TYPE_CONSUME = 0x00080,
- LOG_TYPE_PRODUCE = 0x00100,
- LOG_TYPE_MVP = 0x00200,
- LOG_TYPE_COMMAND = 0x00400,
- LOG_TYPE_STORAGE = 0x00800,
- LOG_TYPE_GSTORAGE = 0x01000,
- LOG_TYPE_MAIL = 0x02000,
- LOG_TYPE_AUCTION = 0x04000,
- LOG_TYPE_BUYING_STORE = 0x08000,
- LOG_TYPE_OTHER = 0x10000,
- LOG_TYPE_BANK = 0x20000,
+ LOG_TYPE_NONE = 0x00000000,
+ LOG_TYPE_TRADE = 0x00000001,
+ LOG_TYPE_VENDING = 0x00000002,
+ LOG_TYPE_PICKDROP_PLAYER = 0x00000004,
+ LOG_TYPE_PICKDROP_MONSTER = 0x00000008,
+ LOG_TYPE_NPC = 0x00000010,
+ LOG_TYPE_SCRIPT = 0x00000020,
+ LOG_TYPE_STEAL = 0x00000040,
+ LOG_TYPE_CONSUME = 0x00000080,
+ LOG_TYPE_PRODUCE = 0x00000100,
+ LOG_TYPE_MVP = 0x00000200,
+ LOG_TYPE_COMMAND = 0x00000400,
+ LOG_TYPE_STORAGE = 0x00000800,
+ LOG_TYPE_GSTORAGE = 0x00001000,
+ LOG_TYPE_MAIL = 0x00002000,
+ LOG_TYPE_AUCTION = 0x00004000,
+ LOG_TYPE_BUYING_STORE = 0x00008000,
+ LOG_TYPE_OTHER = 0x00010000,
+ LOG_TYPE_BANK = 0x00020000,
+ LOG_TYPE_DIVORCE = 0x00040000,
+ LOG_TYPE_ROULETTE = 0x00080000,
+ LOG_TYPE_RENTAL = 0x00100000,
+ LOG_TYPE_CARD = 0x00200000,
+ LOG_TYPE_INV_INVALID = 0x00400000,
+ LOG_TYPE_CART_INVALID = 0x00800000,
+ LOG_TYPE_EGG = 0x01000000,
+ LOG_TYPE_QUEST = 0x02000000,
+ LOG_TYPE_SKILL = 0x04000000,
+ LOG_TYPE_REFINE = 0x08000000,
+
// combinations
LOG_TYPE_LOOT = LOG_TYPE_PICKDROP_MONSTER|LOG_TYPE_CONSUME,
// all
- LOG_TYPE_ALL = 0xFFFFF,
+ LOG_TYPE_ALL = 0xFFFFFFFF,
} e_log_pick_type;
/// filters for item logging
@@ -107,7 +118,8 @@ struct log_interface {
bool sql_logs;
bool log_chat_woe_disable;
int rare_items_log,refine_items_log,price_items_log,amount_items_log;
- int branch, mvpdrop, zeny, commands, npc, chat;
+ int zeny, chat;
+ bool branch, mvpdrop, commands, npc;
char log_branch[64], log_pick[64], log_zeny[64], log_mvpdrop[64], log_gm[64], log_npc[64], log_chat[64];
} config;
/* */
@@ -116,7 +128,7 @@ struct log_interface {
char db_id[32];
char db_pw[100];
char db_name[32];
- Sql* mysql_handle;
+ struct Sql *mysql_handle;
/* */
void (*pick_pc) (struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm, struct item_data *data);
void (*pick_mob) (struct mob_data* md, e_log_pick_type type, int amount, struct item* itm, struct item_data *data);
@@ -135,7 +147,7 @@ struct log_interface {
void (*branch_sub) (struct map_session_data* sd);
void (*mvpdrop_sub) (struct map_session_data* sd, int monster_id, int* log_mvp);
- int (*config_read) (const char* cfgName);
+ bool (*config_read) (const char *filename, bool imported);
void (*config_done) (void);
void (*sql_init) (void);
void (*sql_final) (void);
diff --git a/src/map/mail.c b/src/map/mail.c
index e446a10d2..d8a354cc7 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/mail.h b/src/map/mail.h
index 94100e608..0391f83c4 100644
--- a/src/map/mail.h
+++ b/src/map/mail.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/map.c b/src/map/map.c
index 3dad25fce..16d5e645d 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -69,6 +69,7 @@
#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h" // WFIFO*()
+#include "common/sql.h"
#include "common/strlib.h"
#include "common/timer.h"
#include "common/utils.h"
@@ -78,6 +79,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#ifndef _WIN32
#include <unistd.h>
#endif
@@ -192,6 +194,7 @@ void map_update_cell_bl( struct block_list *bl, bool increase ) {
#ifdef CELL_NOSTACK
int pos;
+ nullpo_retv(bl);
if( bl->m < 0 || bl->x < 0 || bl->x >= map->list[bl->m].xs
|| bl->y < 0 || bl->y >= map->list[bl->m].ys
|| !(bl->type&BL_CHAR) )
@@ -308,9 +311,14 @@ int map_delblock(struct block_list* bl)
* (which are executed by default on BL_CHAR types)
*------------------------------------------*/
int map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) {
- int x0 = bl->x, y0 = bl->y;
struct status_change *sc = NULL;
- int moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
+ int x0, y0;
+ int moveblock;
+
+ nullpo_ret(bl);
+ x0 = bl->x;
+ y0 = bl->y;
+ moveblock = ( x0/BLOCK_SIZE != x1/BLOCK_SIZE || y0/BLOCK_SIZE != y1/BLOCK_SIZE);
if (!bl->prev) {
//Block not in map, just update coordinates, but do naught else.
@@ -329,6 +337,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) {
//status_change_end(bl, SC_BLADESTOP, INVALID_TIMER); //Won't stop when you are knocked away, go figure...
status_change_end(bl, SC_NJ_TATAMIGAESHI, INVALID_TIMER);
status_change_end(bl, SC_MAGICROD, INVALID_TIMER);
+ status_change_end(bl, SC_SU_STOOP, INVALID_TIMER);
if (sc && sc->data[SC_PROPERTYWALK] &&
sc->data[SC_PROPERTYWALK]->val3 >= skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) )
status_change_end(bl,SC_PROPERTYWALK,INVALID_TIMER);
@@ -476,6 +485,8 @@ struct skill_unit* map_find_skill_unit_oncell(struct block_list* target,int16 x,
int16 m,bx,by;
struct block_list *bl;
struct skill_unit *su;
+
+ nullpo_retr(NULL, target);
m = target->m;
if (x < 0 || y < 0 || (x >= map->list[m].xs) || (y >= map->list[m].ys))
@@ -674,49 +685,95 @@ static int bl_getall_area(int type, int m, int x0, int y0, int x1, int y1, int (
x1 = min(x1, map->list[m].xs - 1);
y1 = min(y1, map->list[m].ys - 1);
- for (by = y0 / BLOCK_SIZE; by <= y1 / BLOCK_SIZE; by++) {
- for (bx = x0 / BLOCK_SIZE; bx <= x1 / BLOCK_SIZE; bx++) {
- if (type&~BL_MOB) {
- for (bl = map->list[m].block[bx + by * map->list[m].bxs]; bl != NULL; bl = bl->next) {
- if (bl->type&type && bl->x >= x0 && bl->x <= x1 && bl->y >= y0 && bl->y <= y1) {
- if( map->bl_list_count >= map->bl_list_size )
- map_bl_list_expand();
- if (func) {
- va_start(args, func);
- if (func(bl, args)) {
+ {
+ const int x0b = x0 / BLOCK_SIZE;
+ const int x1b = x1 / BLOCK_SIZE;
+ const int y0b = y0 / BLOCK_SIZE;
+ const int y1b = y1 / BLOCK_SIZE;
+ const struct map_data *const listm = &map->list[m];
+ const int bxs0 = listm->bxs;
+
+ // duplication for better performance
+ if (func != NULL) {
+ if (type & ~BL_MOB) {
+ for (by = y0b; by <= y1b; by++) {
+ const int bxs = by * bxs0;
+ for (bx = x0b; bx <= x1b; bx++) {
+ for (bl = listm->block[bx + bxs]; bl != NULL; bl = bl->next) {
+ const int x = bl->x;
+ const int y = bl->y;
+ if (bl->type & type && x >= x0 && x <= x1 && y >= y0 && y <= y1) {
+ va_start(args, func);
+ if (func(bl, args)) {
+ if (map->bl_list_count >= map->bl_list_size)
+ map_bl_list_expand();
+ map->bl_list[map->bl_list_count++] = bl;
+ found++;
+ }
+ va_end(args);
+ }
+ }
+ }
+ }
+ }
+ if (type & BL_MOB) {
+ for (by = y0b; by <= y1b; by++) {
+ const int bxs = by * bxs0;
+ for (bx = x0b; bx <= x1b; bx++) {
+ for (bl = listm->block_mob[bx + bxs]; bl != NULL; bl = bl->next) {
+ const int x = bl->x;
+ const int y = bl->y;
+ if (x >= x0 && x <= x1 && y >= y0 && y <= y1) {
+ va_start(args, func);
+ if (func(bl, args)) {
+ if (map->bl_list_count >= map->bl_list_size)
+ map_bl_list_expand();
+ map->bl_list[map->bl_list_count++] = bl;
+ found++;
+ }
+ va_end(args);
+ }
+ }
+ }
+ }
+ }
+ } else { // func != NULL
+ if (type & ~BL_MOB) {
+ for (by = y0b; by <= y1b; by++) {
+ const int bxs = by * bxs0;
+ for (bx = x0b; bx <= x1b; bx++) {
+ for (bl = listm->block[bx + bxs]; bl != NULL; bl = bl->next) {
+ const int x = bl->x;
+ const int y = bl->y;
+ if (bl->type & type && x >= x0 && x <= x1 && y >= y0 && y <= y1) {
+ if (map->bl_list_count >= map->bl_list_size)
+ map_bl_list_expand();
map->bl_list[map->bl_list_count++] = bl;
found++;
}
- va_end(args);
- } else {
- map->bl_list[map->bl_list_count++] = bl;
- found++;
}
}
}
}
- if (type&BL_MOB) { // TODO: fix this code duplication
- for (bl = map->list[m].block_mob[bx + by * map->list[m].bxs]; bl != NULL; bl = bl->next) {
- if (bl->x >= x0 && bl->x <= x1 && bl->y >= y0 && bl->y <= y1) {
- if( map->bl_list_count >= map->bl_list_size )
- map_bl_list_expand();
- if (func) {
- va_start(args, func);
- if (func(bl, args)) {
+ if (type & BL_MOB) {
+ for (by = y0b; by <= y1b; by++) {
+ const int bxs = by * bxs0;
+ for (bx = x0b; bx <= x1b; bx++) {
+ for (bl = listm->block_mob[bx + bxs]; bl != NULL; bl = bl->next) {
+ const int x = bl->x;
+ const int y = bl->y;
+ if (x >= x0 && x <= x1 && y >= y0 && y <= y1) {
+ if (map->bl_list_count >= map->bl_list_size)
+ map_bl_list_expand();
map->bl_list[map->bl_list_count++] = bl;
found++;
}
- va_end(args);
- } else {
- map->bl_list[map->bl_list_count++] = bl;
- found++;
}
}
}
}
}
}
-
return found;
}
@@ -853,6 +910,9 @@ static int bl_vgetall_inshootrange(struct block_list *bl, va_list args)
struct block_list *center = va_arg(args, struct block_list*);
#ifdef CIRCULAR_AREA
int range = va_arg(args, int);
+ nullpo_ret(center);
+ nullpo_ret(bl);
+
if (!check_distance_bl(center, bl, range))
return 0;
#endif
@@ -1040,6 +1100,9 @@ static int bl_vgetall_inmovearea(struct block_list *bl, va_list args)
struct block_list *center = va_arg(args, struct block_list*);
int range = va_arg(args, int);
+ nullpo_ret(bl);
+ nullpo_ret(center);
+
if ((dx > 0 && bl->x < center->x - range + dx) ||
(dx < 0 && bl->x > center->x + range + dx) ||
(dy > 0 && bl->y < center->y - range + dy) ||
@@ -1202,11 +1265,15 @@ static int bl_vgetall_inpath(struct block_list *bl, va_list args)
int len_limit = va_arg(args, int);
int magnitude2 = va_arg(args, int);
- int xi = bl->x;
- int yi = bl->y;
+ int xi;
+ int yi;
int xu, yu;
+ int k;
- int k = ( xi - x0 ) * ( x1 - x0 ) + ( yi - y0 ) * ( y1 - y0 );
+ nullpo_ret(bl);
+ xi = bl->x;
+ yi = bl->y;
+ k = ( xi - x0 ) * ( x1 - x0 ) + ( yi - y0 ) * ( y1 - y0 );
if ( k < 0 || k > len_limit ) //Since more skills use this, check for ending point as well.
return 0;
@@ -1421,6 +1488,9 @@ int map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, int16
int free_cell,i,j;
int free_cells[9][2];
+ nullpo_ret(x);
+ nullpo_ret(y);
+
for(free_cell=0,i=-1;i<=1;i++){
if(i+*y<0 || i+*y>=map->list[m].ys)
continue;
@@ -1467,6 +1537,9 @@ int map_search_freecell(struct block_list *src, int16 m, int16 *x,int16 *y, int1
int rx2 = 2*rx+1;
int ry2 = 2*ry+1;
+ nullpo_ret(x);
+ nullpo_ret(y);
+
if( !src && (!(flag&1) || flag&2) )
{
ShowDebug("map_search_freecell: Incorrect usage! When src is NULL, flag has to be &1 and can't have &2\n");
@@ -1477,6 +1550,7 @@ int map_search_freecell(struct block_list *src, int16 m, int16 *x,int16 *y, int1
bx = *x;
by = *y;
} else {
+ nullpo_ret(src);
bx = src->x;
by = src->y;
m = src->m;
@@ -1533,10 +1607,15 @@ int map_search_freecell(struct block_list *src, int16 m, int16 *x,int16 *y, int1
bool map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag)
{
uint8 dir = 6;
- int16 tx = *x;
- int16 ty = *y;
+ int16 tx;
+ int16 ty;
int costrange = 10;
+ nullpo_ret(x);
+ nullpo_ret(y);
+ tx = *x;
+ ty = *y;
+
if(!map->count_oncell(m, tx, ty, type, flag))
return true; //Current cell is free
@@ -1657,7 +1736,7 @@ int map_addflooritem(const struct block_list *bl, struct item *item_data, int am
/**
* @see DBCreateData
*/
-DBData create_charid2nick(DBKey key, va_list args)
+struct DBData create_charid2nick(union DBKey key, va_list args)
{
struct charid2nick *p;
CREATE(p, struct charid2nick, 1);
@@ -1694,7 +1773,7 @@ void map_delnickdb(int charid, const char* name)
{
struct charid2nick* p;
struct charid_request* req;
- DBData data;
+ struct DBData data;
if (!map->nick_db->remove(map->nick_db, DB->i2key(charid), &data) || (p = DB->data2ptr(&data)) == NULL)
return;
@@ -1793,6 +1872,8 @@ void map_deliddb(struct block_list *bl)
int map_quit(struct map_session_data *sd) {
int i;
+ nullpo_ret(sd);
+
if(!sd->state.active) { //Removing a player that is not active.
struct auth_node *node = chrif->search(sd->status.account_id);
if (node && node->char_id == sd->status.char_id &&
@@ -1849,6 +1930,7 @@ int map_quit(struct map_session_data *sd) {
case SC_GDSKILL_REGENERATION:
if( !sd->sc.data[i]->val4 )
break;
+ FALLTHROUGH
default:
status_change_end(&sd->bl, (sc_type)i, INVALID_TIMER);
}
@@ -2166,9 +2248,9 @@ struct map_session_data * map_nick2sd(const char *nick)
/*==========================================
* Convext Mirror
*------------------------------------------*/
-struct mob_data * map_getmob_boss(int16 m)
+struct mob_data *map_getmob_boss(int16 m)
{
- DBIterator* iter;
+ struct DBIterator *iter;
struct mob_data *md = NULL;
bool found = false;
@@ -2230,11 +2312,11 @@ uint32 map_race_id2mask(int race)
/// Applies func to all the players in the db.
/// Stops iterating if func returns -1.
-void map_vforeachpc(int (*func)(struct map_session_data* sd, va_list args), va_list args) {
- DBIterator* iter;
- struct map_session_data* sd;
+void map_vforeachpc(int (*func)(struct map_session_data* sd, va_list args), va_list args)
+{
+ struct DBIterator *iter = db_iterator(map->pc_db);
+ struct map_session_data *sd = NULL;
- iter = db_iterator(map->pc_db);
for( sd = dbi_first(iter); dbi_exists(iter); sd = dbi_next(iter) )
{
va_list argscopy;
@@ -2262,11 +2344,11 @@ void map_foreachpc(int (*func)(struct map_session_data* sd, va_list args), ...)
/// Applies func to all the mobs in the db.
/// Stops iterating if func returns -1.
-void map_vforeachmob(int (*func)(struct mob_data* md, va_list args), va_list args) {
- DBIterator* iter;
- struct mob_data* md;
+void map_vforeachmob(int (*func)(struct mob_data* md, va_list args), va_list args)
+{
+ struct DBIterator *iter = db_iterator(map->mobid_db);
+ struct mob_data *md = NULL;
- iter = db_iterator(map->mobid_db);
for (md = dbi_first(iter); dbi_exists(iter); md = dbi_next(iter)) {
va_list argscopy;
int ret;
@@ -2293,11 +2375,11 @@ void map_foreachmob(int (*func)(struct mob_data* md, va_list args), ...) {
/// Applies func to all the npcs in the db.
/// Stops iterating if func returns -1.
-void map_vforeachnpc(int (*func)(struct npc_data* nd, va_list args), va_list args) {
- DBIterator* iter;
- struct block_list* bl;
+void map_vforeachnpc(int (*func)(struct npc_data* nd, va_list args), va_list args)
+{
+ struct DBIterator *iter = db_iterator(map->id_db);
+ struct block_list *bl = NULL;
- iter = db_iterator(map->id_db);
for (bl = dbi_first(iter); dbi_exists(iter); bl = dbi_next(iter)) {
if (bl->type == BL_NPC) {
struct npc_data *nd = BL_UCAST(BL_NPC, bl);
@@ -2327,11 +2409,11 @@ void map_foreachnpc(int (*func)(struct npc_data* nd, va_list args), ...) {
/// Applies func to everything in the db.
/// Stops iterating gif func returns -1.
-void map_vforeachregen(int (*func)(struct block_list* bl, va_list args), va_list args) {
- DBIterator* iter;
- struct block_list* bl;
+void map_vforeachregen(int (*func)(struct block_list* bl, va_list args), va_list args)
+{
+ struct DBIterator *iter = db_iterator(map->regen_db);
+ struct block_list *bl = NULL;
- iter = db_iterator(map->regen_db);
for (bl = dbi_first(iter); dbi_exists(iter); bl = dbi_next(iter)) {
va_list argscopy;
int ret;
@@ -2358,11 +2440,11 @@ void map_foreachregen(int (*func)(struct block_list* bl, va_list args), ...) {
/// Applies func to everything in the db.
/// Stops iterating if func returns -1.
-void map_vforeachiddb(int (*func)(struct block_list* bl, va_list args), va_list args) {
- DBIterator* iter;
- struct block_list* bl;
+void map_vforeachiddb(int (*func)(struct block_list* bl, va_list args), va_list args)
+{
+ struct DBIterator *iter = db_iterator(map->id_db);
+ struct block_list *bl = NULL;
- iter = db_iterator(map->id_db);
for (bl = dbi_first(iter); dbi_exists(iter); bl = dbi_next(iter)) {
va_list argscopy;
int ret;
@@ -2389,11 +2471,10 @@ void map_foreachiddb(int (*func)(struct block_list* bl, va_list args), ...) {
/// Iterator.
/// Can filter by bl type.
-struct s_mapiterator
-{
- enum e_mapitflags flags;// flags for special behaviour
- enum bl_type types;// what bl types to return
- DBIterator* dbi;// database iterator
+struct s_mapiterator {
+ enum e_mapitflags flags; ///< flags for special behaviour
+ enum bl_type types; ///< what bl types to return
+ struct DBIterator *dbi; ///< database iterator
};
/// Returns true if the block_list matches the description in the iterator.
@@ -2547,6 +2628,7 @@ bool map_addnpc(int16 m,struct npc_data *nd) {
// Returns the index of successful, or -1 if the list was full.
int map_addmobtolist(unsigned short m, struct spawn_data *spawn) {
int i;
+ nullpo_retr(-1, spawn);
ARR_FIND( 0, MAX_MOB_LIST_PER_MAP, i, map->list[m].moblist[i] == NULL );
if( i < MAX_MOB_LIST_PER_MAP ) {
map->list[m].moblist[i] = spawn;
@@ -2628,6 +2710,7 @@ int map_removemobs_timer(int tid, int64 tick, int id, intptr_t data) {
}
void map_removemobs(int16 m) {
+ Assert_retv(m >= 0 && m < map->count);
if (map->list[m].mob_delete_timer != INVALID_TIMER) // should never happen
return; //Mobs are already scheduled for removal
@@ -2662,6 +2745,8 @@ int16 map_mapindex2mapid(unsigned short map_index) {
int map_mapname2ipport(unsigned short name, uint32* ip, uint16* port) {
struct map_data_other_server *mdos;
+ nullpo_retr(-1, ip);
+ nullpo_retr(-1, port);
mdos = (struct map_data_other_server*)uidb_get(map->map_db,(unsigned int)name);
if(mdos==NULL || mdos->cell) //If gat isn't null, this is a local map.
return -1;
@@ -2737,11 +2822,19 @@ uint8 map_calc_dir(struct block_list* src, int16 x, int16 y)
*------------------------------------------*/
int map_random_dir(struct block_list *bl, int16 *x, int16 *y)
{
- short xi = *x-bl->x;
- short yi = *y-bl->y;
+ short xi;
+ short yi;
short i=0;
- int dist2 = xi*xi + yi*yi;
- short dist = (short)sqrt((float)dist2);
+ int dist2;
+ short dist;
+
+ nullpo_ret(bl);
+ nullpo_ret(x);
+ nullpo_ret(y);
+ xi = *x-bl->x;
+ yi = *y-bl->y;
+ dist2 = xi*xi + yi*yi;
+ dist = (short)sqrt((float)dist2);
if (dist < 1) dist =1;
@@ -2794,7 +2887,10 @@ int map_cell2gat(struct mapcell cell) {
return 1; // default to 'wall'
}
void map_cellfromcache(struct map_data *m) {
- struct map_cache_map_info *info = (struct map_cache_map_info *)m->cellPos;
+ struct map_cache_map_info *info;
+
+ nullpo_retv(m);
+ info = (struct map_cache_map_info *)m->cellPos;
if (info) {
char decode_buffer[MAX_MAP_SIZE];
@@ -2804,7 +2900,7 @@ void map_cellfromcache(struct map_data *m) {
size = (unsigned long)info->xs*(unsigned long)info->ys;
// TO-DO: Maybe handle the scenario, if the decoded buffer isn't the same size as expected? [Shinryo]
- decode_zip(decode_buffer, &size, m->cellPos+sizeof(struct map_cache_map_info), info->len);
+ grfio->decode_zip(decode_buffer, &size, m->cellPos+sizeof(struct map_cache_map_info), info->len);
CREATE(m->cell, struct mapcell, size);
// Set cell properties
@@ -2897,6 +2993,7 @@ int map_getcellp(struct map_data* m, const struct block_list *bl, int16 x, int16
/* [Ind/Hercules] */
int map_sub_getcellp(struct map_data* m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
+ nullpo_ret(m);
map->cellfromcache(m);
m->getcellp = map->getcellp;
m->setcell = map->setcell;
@@ -2963,6 +3060,9 @@ void map_setgatcell(int16 m, int16 x, int16 y, int gat) {
*------------------------------------------*/
void map_iwall_nextxy(int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1)
{
+ nullpo_retv(x1);
+ nullpo_retv(y1);
+
if( dir == 0 || dir == 4 )
*x1 = x; // Keep X
else if( dir > 0 && dir < 4 )
@@ -3022,12 +3122,15 @@ bool map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable
return true;
}
-void map_iwall_get(struct map_session_data *sd) {
+void map_iwall_get(struct map_session_data *sd)
+{
struct iwall_data *iwall;
- DBIterator* iter;
+ struct DBIterator *iter;
int16 x1, y1;
int i;
+ nullpo_retv(sd);
+
if( map->list[sd->bl.m].iwall_num < 1 )
return;
@@ -3068,7 +3171,7 @@ void map_iwall_remove(const char *wall_name)
/**
* @see DBCreateData
*/
-DBData create_map_data_other_server(DBKey key, va_list args)
+struct DBData create_map_data_other_server(union DBKey key, va_list args)
{
struct map_data_other_server *mdos;
unsigned short map_index = (unsigned short)key.ui;
@@ -3103,9 +3206,10 @@ int map_setipport(unsigned short map_index, uint32 ip, uint16 port)
* Delete all the other maps server management
* @see DBApply
*/
-int map_eraseallipport_sub(DBKey key, DBData *data, va_list va)
+int map_eraseallipport_sub(union DBKey key, struct DBData *data, va_list va)
{
struct map_data_other_server *mdos = DB->data2ptr(data);
+ nullpo_ret(mdos);
if(mdos->cell == NULL) {
db_remove(map->map_db,key);
aFree(mdos);
@@ -3192,6 +3296,9 @@ int map_readfromcache(struct map_data *m, char *buffer) {
struct map_cache_map_info *info = NULL;
char *p = buffer + sizeof(struct map_cache_main_header);
+ nullpo_ret(m);
+ nullpo_ret(buffer);
+
for(i = 0; i < header->map_count; i++) {
info = (struct map_cache_map_info *)p;
@@ -3226,22 +3333,46 @@ int map_readfromcache(struct map_data *m, char *buffer) {
return 0; // Not found
}
-int map_addmap(const char* mapname) {
+/**
+ * Adds a new empty map to the map list.
+ *
+ * Assumes that there's enough space in the map list.
+ *
+ * @param mapname The new map's name.
+ * @return success state.
+ */
+int map_addmap(const char *mapname)
+{
map->list[map->count].instance_id = -1;
mapindex->getmapname(mapname, map->list[map->count++].name);
return 0;
}
-void map_delmapid(int id) {
+/**
+ * Removes a map from the map list.
+ *
+ * @param id The map ID.
+ */
+void map_delmapid(int id)
+{
+ Assert_retv(id >= 0 && id < map->count);
ShowNotice("Removing map [ %s ] from maplist"CL_CLL"\n",map->list[id].name);
memmove(map->list+id, map->list+id+1, sizeof(map->list[0])*(map->count-id-1));
map->count--;
}
-int map_delmap(char* mapname) {
+/**
+ * Removes a map fromt he map list.
+ *
+ * @param mapname The name of the map to remove.
+ * @return the number of removed maps.
+ */
+int map_delmap(const char *mapname)
+{
int i;
char map_name[MAP_NAME_LENGTH];
+ nullpo_ret(mapname);
if (strcmpi(mapname, "all") == 0) {
map->count = 0;
return 0;
@@ -3263,6 +3394,8 @@ int map_delmap(char* mapname) {
void map_zone_clear_single(struct map_zone_data *zone) {
int i;
+ nullpo_retv(zone);
+
for(i = 0; i < zone->disabled_skills_count; i++) {
aFree(zone->disabled_skills[i]);
}
@@ -3300,9 +3433,10 @@ void map_zone_clear_single(struct map_zone_data *zone) {
/**
*
**/
-void map_zone_db_clear(void) {
- struct map_zone_data *zone;
- DBIterator *iter = db_iterator(map->zone_db);
+void map_zone_db_clear(void)
+{
+ struct DBIterator *iter = db_iterator(map->zone_db);
+ struct map_zone_data *zone = NULL;
for(zone = dbi_first(iter); dbi_exists(iter); zone = dbi_next(iter)) {
map->zone_clear_single(zone);
@@ -3319,6 +3453,7 @@ void map_zone_db_clear(void) {
}
void map_clean(int i) {
int v;
+ Assert_retv(i >= 0 && i < map->count);
if(map->list[i].cell && map->list[i].cell != (struct mapcell *)0xdeadbeaf) aFree(map->list[i].cell);
if(map->list[i].block) aFree(map->list[i].block);
if(map->list[i].block_mob) aFree(map->list[i].block_mob);
@@ -3515,16 +3650,18 @@ void map_flags_init(void) {
int map_waterheight(char* mapname)
{
char fn[256];
- char *rsw, *found;
+ char *rsw = NULL;
+ const char *found;
+ nullpo_retr(NO_WATER, mapname);
//Look up for the rsw
snprintf(fn, sizeof(fn), "data\\%s.rsw", mapname);
- if ( (found = grfio_find_file(fn)) )
+ if ((found = grfio->find_file(fn)))
safestrncpy(fn, found, sizeof(fn)); // replace with real name
// read & convert fn
- rsw = (char *) grfio_read (fn);
+ rsw = grfio_read(fn);
if (rsw) {
//Load water height from file
int wh = (int) *(float*)(rsw+166);
@@ -3545,9 +3682,10 @@ int map_readgat (struct map_data* m)
int water_height;
size_t xy, off, num_cells;
+ nullpo_ret(m);
sprintf(filename, "data\\%s.gat", m->name);
- gat = (uint8 *) grfio_read(filename);
+ gat = grfio_read(filename);
if (gat == NULL)
return 0;
@@ -3582,10 +3720,12 @@ int map_readgat (struct map_data* m)
* Add/Remove map to the map_db
*--------------------------------------*/
void map_addmap2db(struct map_data *m) {
+ nullpo_retv(m);
map->index2mapid[m->index] = m->m;
}
void map_removemapdb(struct map_data *m) {
+ nullpo_retv(m);
map->index2mapid[m->index] = -1;
}
@@ -3600,8 +3740,8 @@ int map_readallmaps (void) {
if( map->enable_grf )
ShowStatus("Loading maps (using GRF files)...\n");
else {
- char mapcachefilepath[254];
- sprintf(mapcachefilepath,"%s/%s%s",map->db_path,DBPATH,"map_cache.dat");
+ char mapcachefilepath[256];
+ snprintf(mapcachefilepath, 256, "%s/%s%s", map->db_path, DBPATH, "map_cache.dat");
ShowStatus("Loading maps (using %s as map cache)...\n", mapcachefilepath);
if( (fp = fopen(mapcachefilepath, "rb")) == NULL ) {
ShowFatalError("Unable to open map cache file "CL_WHITE"%s"CL_RESET"\n", mapcachefilepath);
@@ -3683,177 +3823,387 @@ int map_readallmaps (void) {
return 0;
}
-/*==========================================
- * Read map server configuration files (conf/map_server.conf...)
- *------------------------------------------*/
-int map_config_read(char *cfgName) {
- char line[1024], w1[1024], w2[1024];
- FILE *fp;
+/**
+ * Reads 'map_configuration/console' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_config_read_console(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
- fp = fopen(cfgName,"r");
- if( fp == NULL ) {
- ShowError("Map configuration file not found at: %s\n", cfgName);
- return 1;
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_configuration/console")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("map_config_read: map_configuration/console was not found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- char* ptr;
+ libconfig->setting_lookup_bool_real(setting, "stdout_with_ansisequence", &showmsg->stdout_with_ansisequence);
+ if (libconfig->setting_lookup_int(setting, "console_silent", &showmsg->silent) == CONFIG_TRUE) {
+ if (showmsg->silent) // only bother if its actually enabled
+ ShowInfo("Console Silent Setting: %d\n", showmsg->silent);
+ }
+ libconfig->setting_lookup_mutable_string(setting, "timestamp_format", showmsg->timestamp_format, sizeof(showmsg->timestamp_format));
+ libconfig->setting_lookup_int(setting, "console_msg_log", &showmsg->console_log);
- if (line[0] == '/' && line[1] == '/')
- continue;
- if ((ptr = strstr(line, "//")) != NULL)
- *ptr = '\n'; //Strip comments
- if (sscanf(line, "%1023[^:]: %1023[^\t\r\n]", w1, w2) < 2)
- continue;
+ return true;
+}
- //Strip trailing spaces
- ptr = w2 + strlen(w2);
- while (--ptr >= w2 && *ptr == ' ');
- ptr++;
- *ptr = '\0';
-
- if(strcmpi(w1,"timestamp_format")==0)
- safestrncpy(showmsg->timestamp_format, w2, 20);
- else if(strcmpi(w1,"stdout_with_ansisequence")==0)
- showmsg->stdout_with_ansisequence = config_switch(w2) ? true : false;
- else if(strcmpi(w1,"console_silent")==0) {
- showmsg->silent = atoi(w2);
- if (showmsg->silent) // only bother if its actually enabled
- ShowInfo("Console Silent Setting: %d\n", atoi(w2));
- } else if (strcmpi(w1, "userid")==0)
- chrif->setuserid(w2);
- else if (strcmpi(w1, "passwd") == 0)
- chrif->setpasswd(w2);
- else if (strcmpi(w1, "char_ip") == 0)
- map->char_ip_set = chrif->setip(w2);
- else if (strcmpi(w1, "char_port") == 0)
- chrif->setport(atoi(w2));
- else if (strcmpi(w1, "map_ip") == 0)
- map->ip_set = clif->setip(w2);
- else if (strcmpi(w1, "bind_ip") == 0)
- clif->setbindip(w2);
- else if (strcmpi(w1, "map_port") == 0) {
- clif->setport(atoi(w2));
- map->port = (atoi(w2));
- } else if (strcmpi(w1, "map") == 0)
- map->count++;
- else if (strcmpi(w1, "delmap") == 0)
- map->count--;
- else if (strcmpi(w1, "npc") == 0)
- npc->addsrcfile(w2);
- else if (strcmpi(w1, "delnpc") == 0)
- npc->delsrcfile(w2);
- else if (strcmpi(w1, "autosave_time") == 0) {
- map->autosave_interval = atoi(w2);
- if (map->autosave_interval < 1) //Revert to default saving.
- map->autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
- else
- map->autosave_interval *= 1000; //Pass from sec to ms
- } else if (strcmpi(w1, "minsave_time") == 0) {
- map->minsave_interval= atoi(w2);
- if (map->minsave_interval < 1)
- map->minsave_interval = 1;
- } else if (strcmpi(w1, "save_settings") == 0)
- map->save_settings = atoi(w2);
- else if (strcmpi(w1, "help_txt") == 0)
- strcpy(map->help_txt, w2);
- else if (strcmpi(w1, "help2_txt") == 0)
- strcpy(map->help2_txt, w2);
- else if (strcmpi(w1, "charhelp_txt") == 0)
- strcpy(map->charhelp_txt, w2);
- else if(strcmpi(w1,"db_path") == 0)
- safestrncpy(map->db_path,w2,255);
- else if (strcmpi(w1, "enable_spy") == 0)
- map->enable_spy = config_switch(w2);
- else if (strcmpi(w1, "use_grf") == 0)
- map->enable_grf = config_switch(w2);
- else if (strcmpi(w1, "console_msg_log") == 0)
- showmsg->console_log = atoi(w2);//[Ind]
- else if (strcmpi(w1, "default_language") == 0)
- safestrncpy(map->default_lang_str, w2, sizeof(map->default_lang_str));
- else if (strcmpi(w1, "import") == 0)
- map->config_read(w2);
+/**
+ * Reads 'map_configuration/sql_connection' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_config_read_connection(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_configuration/sql_connection")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("map_config_read: map_configuration/sql_connection was not found in %s!\n", filename);
+ ShowWarning("map_config_read_connection: Defaulting sql_connection...\n");
+ return false;
+ }
+
+ libconfig->setting_lookup_int(setting, "db_port", &map->server_port);
+ libconfig->setting_lookup_mutable_string(setting, "db_hostname", map->server_ip, sizeof(map->server_ip));
+ libconfig->setting_lookup_mutable_string(setting, "db_username", map->server_id, sizeof(map->server_id));
+ libconfig->setting_lookup_mutable_string(setting, "db_password", map->server_pw, sizeof(map->server_pw));
+ libconfig->setting_lookup_mutable_string(setting, "db_database", map->server_db, sizeof(map->server_db));
+ libconfig->setting_lookup_mutable_string(setting, "default_codepage", map->default_codepage, sizeof(map->default_codepage));
+ return true;
+}
+
+/**
+ * Reads 'map_configuration/inter' and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_config_read_inter(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+ const char *str = NULL;
+ char temp[24];
+ uint16 port;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_configuration/inter")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("map_config_read: map_configuration/inter was not found in %s!\n", filename);
+ return false;
+ }
+
+ // Login information
+ if (libconfig->setting_lookup_mutable_string(setting, "userid", temp, sizeof(temp)) == CONFIG_TRUE)
+ chrif->setuserid(temp);
+ if (libconfig->setting_lookup_mutable_string(setting, "passwd", temp, sizeof(temp)) == CONFIG_TRUE)
+ chrif->setpasswd(temp);
+
+ // Char and map-server information
+ if (libconfig->setting_lookup_string(setting, "char_ip", &str) == CONFIG_TRUE)
+ map->char_ip_set = chrif->setip(str);
+ if (libconfig->setting_lookup_uint16(setting, "char_port", &port) == CONFIG_TRUE)
+ chrif->setport(port);
+
+ if (libconfig->setting_lookup_string(setting, "map_ip", &str) == CONFIG_TRUE)
+ map->ip_set = clif->setip(str);
+ if (libconfig->setting_lookup_uint16(setting, "map_port", &port) == CONFIG_TRUE) {
+ clif->setport(port);
+ map->port = port;
+ }
+ if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE)
+ clif->setbindip(str);
+
+ return true;
+}
+
+/**
+ * Reads 'map_configuration/database' and initializes required variables
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_config_read_database(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "map_configuration/database")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("map_config_read: map_configuration/database was not found in %s!\n", filename);
+ return false;
+ }
+ libconfig->setting_lookup_mutable_string(setting, "db_path", map->db_path, sizeof(map->db_path));
+ libconfig->setting_lookup_int(setting, "save_settings", &map->save_settings);
+
+ if (libconfig->setting_lookup_int(setting, "autosave_time", &map->autosave_interval) == CONFIG_TRUE) {
+ if (map->autosave_interval < 1) // Revert to default saving
+ map->autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
else
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
+ map->autosave_interval *= 1000; // Pass from s to ms
+ }
+ if (libconfig->setting_lookup_int(setting, "minsave_time", &map->minsave_interval) == CONFIG_TRUE) {
+ if (map->minsave_interval < 1)
+ map->minsave_interval = 1;
}
- fclose(fp);
- return 0;
+ return true;
}
-int map_config_read_sub(char *cfgName) {
- char line[1024], w1[1024], w2[1024];
- FILE *fp;
- fp = fopen(cfgName,"r");
- if (fp == NULL) {
- ShowError("Map configuration file not found at: %s\n", cfgName);
- return 1;
+/**
+ * Reads 'map_configuration/map_list'/'map_configuration/map_removed' and adds
+ * or removes maps from map-server.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_config_read_map_list(const char *filename, struct config_t *config, bool imported)
+{
+ struct config_setting_t *setting = NULL;
+ int i, count = 0;
+ struct DBMap *deleted_maps;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, MAP_NAME_LENGTH);
+
+ // Remove maps
+ if ((setting = libconfig->lookup(config, "map_configuration/map_removed")) != NULL) {
+ count = libconfig->setting_length(setting);
+ for (i = 0; i < count; i++) {
+ const char *mapname;
+
+ if ((mapname = libconfig->setting_get_string_elem(setting, i)) == NULL || mapname[0] == '\0')
+ continue;
+
+ strdb_put(deleted_maps, mapname, NULL);
+
+ if (imported) // Map list is empty on the first run, only do this for imported files.
+ map->delmap(mapname);
+ }
+ }
+
+ if ((setting = libconfig->lookup(config, "map_configuration/map_list")) == NULL) {
+ db_destroy(deleted_maps);
+ if (imported)
+ return true;
+ ShowError("map_config_read_map_list: map_configuration/map_list was not found in %s!\n", filename);
+ return false;
+ }
+
+ // Add maps to map->list
+ count = libconfig->setting_length(setting);
+
+ if (count <= 0) {
+ db_destroy(deleted_maps);
+ if (imported)
+ return true;
+ ShowWarning("map_config_read_map_list: no maps found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- char* ptr;
+ RECREATE(map->list, struct map_data, map->count + count); // TODO: VECTOR candidate
+
+ for (i = 0; i < count; i++) {
+ const char *mapname;
- if (line[0] == '/' && line[1] == '/')
+ if ((mapname = libconfig->setting_get_string_elem(setting, i)) == NULL || mapname[0] == '\0')
continue;
- if ((ptr = strstr(line, "//")) != NULL)
- *ptr = '\n'; //Strip comments
- if (sscanf(line, "%1023[^:]: %1023[^\t\r\n]", w1, w2) < 2)
+
+ if (strdb_exists(deleted_maps, mapname))
continue;
- //Strip trailing spaces
- ptr = w2 + strlen(w2);
- while (--ptr >= w2 && *ptr == ' ');
- ptr++;
- *ptr = '\0';
+ map->addmap(mapname);
+ }
+
+ RECREATE(map->list, struct map_data, map->count);
+
+ db_destroy(deleted_maps);
+ return true;
+}
+
+/**
+ * Reads map-server configuration files (map-server.conf) and initialises
+ * required variables.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "map_configuration")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("map_config_read: map_configuration was not found in %s!\n", filename);
+ return false;
+ }
- if (strcmpi(w1, "map") == 0)
- map->addmap(w2);
- else if (strcmpi(w1, "delmap") == 0)
- map->delmap(w2);
- else if (strcmpi(w1, "import") == 0)
- map->config_read_sub(w2);
+ libconfig->setting_lookup_mutable_string(setting, "help_txt", map->help_txt, sizeof(map->help_txt));
+ libconfig->setting_lookup_mutable_string(setting, "charhelp_txt", map->charhelp_txt, sizeof(map->charhelp_txt));
+ libconfig->setting_lookup_bool(setting, "enable_spy", &map->enable_spy);
+ libconfig->setting_lookup_bool(setting, "use_grf", &map->enable_grf);
+ libconfig->setting_lookup_mutable_string(setting, "default_language", map->default_lang_str, sizeof(map->default_lang_str));
+
+ if (!map_config_read_console(filename, &config, imported))
+ retval = false;
+ if (!map_config_read_connection(filename, &config, imported))
+ retval = false;
+ if (!map_config_read_inter(filename, &config, imported))
+ retval = false;
+ if (!map_config_read_database(filename, &config, imported))
+ retval = false;
+ if (!map_config_read_map_list(filename, &config, imported))
+ retval = false;
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, map->MAP_CONF_NAME) == 0) {
+ ShowWarning("map_config_read: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!map->config_read(import, true))
+ retval = false;
+ }
}
- fclose(fp);
- return 0;
+ libconfig->destroy(&config);
+ return retval;
}
-void map_reloadnpc_sub(char *cfgName) {
- char line[1024], w1[1024], w2[1024];
- FILE *fp;
- fp = fopen(cfgName,"r");
- if (fp == NULL) {
- ShowError("Map configuration file not found at: %s\n", cfgName);
- return;
+/**
+ * Reads 'npc_global_list'/'npc_removed_list' and adds or removes NPC sources
+ * from map-server.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool map_read_npclist(const char *filename, bool imported)
+{
+ struct config_t config;
+ struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
+ bool remove_all = false;
+
+ struct DBMap *deleted_npcs;
+
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ deleted_npcs = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, 0);
+
+ // Remove NPCs
+ if ((setting = libconfig->lookup(&config, "npc_removed_list")) != NULL) {
+ int i, del_count = libconfig->setting_length(setting);
+ for (i = 0; i < del_count; i++) {
+ const char *scriptname;
+
+ if ((scriptname = libconfig->setting_get_string_elem(setting, i)) == NULL || scriptname[0] == '\0')
+ continue;
+
+ if (strcmp(scriptname, "all") == 0) {
+ remove_all = true;
+ npc->clearsrcfile();
+ } else {
+ strdb_put(deleted_npcs, scriptname, NULL);
+ npc->delsrcfile(scriptname);
+ }
+ }
}
- while (fgets(line, sizeof(line), fp)) {
- char* ptr;
+ if ((setting = libconfig->lookup(&config, "npc_global_list")) != NULL) {
+ int i, count = libconfig->setting_length(setting);
+ if (count <= 0) {
+ if (!imported) {
+ ShowWarning("map_read_npclist: no NPCs found in %s!\n", filename);
+ retval = false;
+ }
+ }
+ for (i = 0; i < count; i++) {
+ const char *scriptname;
+
+ if ((scriptname = libconfig->setting_get_string_elem(setting, i)) == NULL || scriptname[0] == '\0')
+ continue;
- if (line[0] == '/' && line[1] == '/')
- continue;
- if ((ptr = strstr(line, "//")) != NULL)
- *ptr = '\n'; //Strip comments
- if (sscanf(line, "%1023[^:]: %1023[^\t\r\n]", w1, w2) < 2)
- continue;
+ if (remove_all || strdb_exists(deleted_npcs, scriptname))
+ continue;
- //Strip trailing spaces
- ptr = w2 + strlen(w2);
- while (--ptr >= w2 && *ptr == ' ');
- ptr++;
- *ptr = '\0';
-
- if (strcmpi(w1, "npc") == 0)
- npc->addsrcfile(w2);
- else if (strcmpi(w1, "import") == 0)
- map->reloadnpc_sub(w2);
- else if (strcmpi(w1, "delnpc") == 0)
- npc->delsrcfile(w2);
- else
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
+ npc->addsrcfile(scriptname);
+ }
+ } else {
+ ShowError("map_read_npclist: npc_global_list was not found in %s!\n", filename);
+ retval = false;
+ }
+
+ db_destroy(deleted_npcs);
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ const char *base_npclist = NULL;
+#ifdef RENEWAL
+ base_npclist = "npc/re/scripts_main.conf";
+#else
+ base_npclist = "npc/pre-re/scripts_main.conf";
+#endif
+ if (strcmp(import, filename) == 0 || strcmp(import, base_npclist) == 0) {
+ ShowWarning("map_read_npclist: Loop detected! Skipping 'import'...\n");
+ } else {
+ if (!map->read_npclist(import, true))
+ retval = false;
+ }
}
- fclose(fp);
+ libconfig->destroy(&config);
+ return retval;
}
/**
@@ -3864,12 +4214,12 @@ void map_reloadnpc_sub(char *cfgName) {
void map_reloadnpc(bool clear) {
int i;
if (clear)
- npc->addsrcfile("clear"); // this will clear the current script list
+ npc->clearsrcfile();
#ifdef RENEWAL
- map->reloadnpc_sub("npc/re/scripts_main.conf");
+ map->read_npclist("npc/re/scripts_main.conf", false);
#else
- map->reloadnpc_sub("npc/pre-re/scripts_main.conf");
+ map->read_npclist("npc/pre-re/scripts_main.conf", false);
#endif
// Append extra scripts
@@ -3878,62 +4228,126 @@ void map_reloadnpc(bool clear) {
}
}
-int inter_config_read(char *cfgName) {
- char line[1024],w1[1024],w2[1024];
- FILE *fp;
+/**
+ * Reads inter-server.conf and initializes required variables.
+ *
+ * @param filename Path to configuration file
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool inter_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ const struct config_setting_t *setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
- if (!(fp = fopen(cfgName,"r"))) {
- ShowError("File not found: %s\n",cfgName);
- return 1;
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "inter_configuration")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("inter_config_read: inter_configuration was not found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- if (line[0] == '/' && line[1] == '/')
- continue;
- if (sscanf(line,"%1023[^:]: %1023[^\r\n]", w1, w2) < 2)
- continue;
- /* map sql stuff */
- if(strcmpi(w1,"map_server_ip")==0)
- safestrncpy(map->server_ip, w2, sizeof(map->server_ip));
- else if(strcmpi(w1,"map_server_port")==0)
- map->server_port=atoi(w2);
- else if(strcmpi(w1,"map_server_id")==0)
- safestrncpy(map->server_id, w2, sizeof(map->server_id));
- else if(strcmpi(w1,"map_server_pw")==0)
- safestrncpy(map->server_pw, w2, sizeof(map->server_pw));
- else if(strcmpi(w1,"map_server_db")==0)
- safestrncpy(map->server_db, w2, sizeof(map->server_db));
- else if(strcmpi(w1,"default_codepage")==0)
- safestrncpy(map->default_codepage, w2, sizeof(map->default_codepage));
- else if(strcmpi(w1,"autotrade_merchants_db")==0)
- safestrncpy(map->autotrade_merchants_db, w2, sizeof(map->autotrade_merchants_db));
- else if(strcmpi(w1,"autotrade_data_db")==0)
- safestrncpy(map->autotrade_data_db, w2, sizeof(map->autotrade_data_db));
- else if(strcmpi(w1,"npc_market_data_db")==0)
- safestrncpy(map->npc_market_data_db, w2, sizeof(map->npc_market_data_db));
- /* sql log db */
- else if(strcmpi(w1,"log_db_ip")==0)
- safestrncpy(logs->db_ip, w2, sizeof(logs->db_ip));
- else if(strcmpi(w1,"log_db_id")==0)
- safestrncpy(logs->db_id, w2, sizeof(logs->db_id));
- else if(strcmpi(w1,"log_db_pw")==0)
- safestrncpy(logs->db_pw, w2, sizeof(logs->db_pw));
- else if(strcmpi(w1,"log_db_port")==0)
- logs->db_port = atoi(w2);
- else if(strcmpi(w1,"log_db_db")==0)
- safestrncpy(logs->db_name, w2, sizeof(logs->db_name));
- /* mapreg */
- else if( mapreg->config_read(w1,w2) )
- continue;
- /* import */
- else if(strcmpi(w1,"import")==0)
- map->inter_config_read(w2);
- else
- HPM->parseConf(w1, w2, HPCT_MAP_INTER);
+ if (!map->inter_config_read_database_names(filename, &config, imported))
+ retval = false;
+ if (!map->inter_config_read_connection(filename, &config, imported))
+ retval = false;
+
+ if (!HPM->parse_conf(&config, filename, HPCT_MAP_INTER, imported))
+ retval = false;
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, map->INTER_CONF_NAME) == 0) {
+ ShowWarning("inter_config_read: Loop detected in %s! Skipping 'import'...\n", filename);
+ } else {
+ if (!map->inter_config_read(import, true))
+ retval = false;
+ }
}
- fclose(fp);
- return 0;
+ libconfig->destroy(&config);
+ return retval;
+}
+
+/**
+ * Reads the 'inter_configuration/log/sql_connection' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool inter_config_read_connection(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/log/sql_connection")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("inter_config_read: inter_configuration/log/sql_connection was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_int(setting, "db_port", &logs->db_port);
+ libconfig->setting_lookup_mutable_string(setting, "db_hostname", logs->db_ip, sizeof(logs->db_ip));
+ libconfig->setting_lookup_mutable_string(setting, "db_username", logs->db_id, sizeof(logs->db_id));
+ libconfig->setting_lookup_mutable_string(setting, "db_password", logs->db_pw, sizeof(logs->db_pw));
+ libconfig->setting_lookup_mutable_string(setting, "db_database", logs->db_name, sizeof(logs->db_name));
+
+ return true;
+}
+
+/**
+ * Reads the 'inter_configuration/database_names' config entry and initializes required variables.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool inter_config_read_database_names(const char *filename, const struct config_t *config, bool imported)
+{
+ const struct config_setting_t *setting = NULL;
+ bool retval = true;
+
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/database_names")) == NULL) {
+ if (imported)
+ return true;
+ ShowError("inter_config_read: inter_configuration/database_names was not found in %s!\n", filename);
+ return false;
+ }
+
+ libconfig->setting_lookup_mutable_string(setting, "autotrade_merchants_db", map->autotrade_merchants_db, sizeof(map->autotrade_merchants_db));
+ libconfig->setting_lookup_mutable_string(setting, "autotrade_data_db", map->autotrade_data_db, sizeof(map->autotrade_data_db));
+ libconfig->setting_lookup_mutable_string(setting, "npc_market_data_db", map->npc_market_data_db, sizeof(map->npc_market_data_db));
+
+ if (!mapreg->config_read(filename, setting, imported))
+ retval = false;
+
+ if ((setting = libconfig->lookup(config, "inter_configuration/database_names/registry")) == NULL) {
+ if (imported)
+ return retval;
+ ShowError("inter_config_read: inter_configuration/database_names/registry was not found in %s!\n", filename);
+ return false;
+ }
+ return retval;
}
/*=======================================
@@ -3979,7 +4393,10 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone
struct map_zone_data *zone = NULL;
int cursor, i, j;
- sprintf(newzone, "%s+%s",main->name,other->name);
+ nullpo_retr(NULL, main);
+ nullpo_retr(NULL, other);
+
+ snprintf(newzone, MAP_ZONE_NAME_LENGTH, "%s+%s", main->name, other->name);
if( (zone = strdb_get(map->zone_db, newzone)) )
return zone;/* this zone has already been merged */
@@ -4072,6 +4489,7 @@ void map_zone_change2(int m, struct map_zone_data *zone)
{
const char *empty = "";
+ Assert_retv(m >= 0 && m < map->count);
if( map->list[m].zone == zone )
return;
@@ -4089,6 +4507,7 @@ void map_zone_change2(int m, struct map_zone_data *zone)
}
/* when changing from a mapflag to another during runtime */
void map_zone_change(int m, struct map_zone_data *zone, const char* start, const char* buffer, const char* filepath) {
+ Assert_retv(m >= 0 && m < map->count);
map->list[m].prev_zone = map->list[m].zone;
if( map->list[m].zone_mf_count )
@@ -4101,6 +4520,7 @@ void map_zone_remove(int m)
char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
unsigned short k;
const char *empty = "";
+ Assert_retv(m >= 0 && m < map->count);
for(k = 0; k < map->list[m].zone_mf_count; k++) {
size_t len = strlen(map->list[m].zone_mf[k]),j;
params[0] = '\0';
@@ -4123,6 +4543,7 @@ void map_zone_remove(int m)
map->list[m].zone_mf_count = 0;
}
static inline void map_zone_mf_cache_add(int m, char *rflag) {
+ Assert_retv(m >= 0 && m < map->count);
RECREATE(map->list[m].zone_mf, char *, ++map->list[m].zone_mf_count);
CREATE(map->list[m].zone_mf[map->list[m].zone_mf_count - 1], char, MAP_ZONE_MAPFLAG_LENGTH);
safestrncpy(map->list[m].zone_mf[map->list[m].zone_mf_count - 1], rflag, MAP_ZONE_MAPFLAG_LENGTH);
@@ -4133,6 +4554,10 @@ bool map_zone_mf_cache(int m, char *flag, char *params) {
char rflag[MAP_ZONE_MAPFLAG_LENGTH];
int state = 1;
+ nullpo_retr(false, flag);
+ nullpo_retr(false, params);
+ Assert_retr(false, m >= 0 && m < map->count);
+
if (params[0] != '\0' && !strcmpi(params, "off"))
state = 0;
@@ -4829,6 +5254,8 @@ void map_zone_apply(int m, struct map_zone_data *zone, const char* start, const
int i;
const char *empty = "";
char flag[MAP_ZONE_MAPFLAG_LENGTH], params[MAP_ZONE_MAPFLAG_LENGTH];
+ Assert_retv(m >= 0 && m < map->count);
+ nullpo_retv(zone);
map->list[m].zone = zone;
for(i = 0; i < zone->mapflags_count; i++) {
size_t len = strlen(zone->mapflags[i]);
@@ -4939,8 +5366,9 @@ unsigned short map_zone_str2skillid(const char *name) {
enum bl_type map_zone_bl_type(const char *entry, enum map_zone_skill_subtype *subtype) {
char temp[200], *parse;
enum bl_type bl = BL_NUL;
- *subtype = MZS_NONE;
+ nullpo_retr(BL_NUL, subtype);
+ *subtype = MZS_NONE;
if( !entry )
return BL_NUL;
@@ -4982,27 +5410,27 @@ enum bl_type map_zone_bl_type(const char *entry, enum map_zone_skill_subtype *su
}
/* [Ind/Hercules] */
void read_map_zone_db(void) {
- config_t map_zone_db;
- config_setting_t *zones = NULL;
+ struct config_t map_zone_db;
+ struct config_setting_t *zones = NULL;
/* TODO: #ifndef required for re/pre-re */
#ifdef RENEWAL
const char *config_filename = "db/re/map_zone_db.conf"; // FIXME hardcoded name
#else
const char *config_filename = "db/pre-re/map_zone_db.conf"; // FIXME hardcoded name
#endif
- if (libconfig->read_file(&map_zone_db, config_filename))
+ if (!libconfig->load_file(&map_zone_db, config_filename))
return;
zones = libconfig->lookup(&map_zone_db, "zones");
if (zones != NULL) {
struct map_zone_data *zone;
- config_setting_t *zone_e;
- config_setting_t *skills;
- config_setting_t *items;
- config_setting_t *mapflags;
- config_setting_t *commands;
- config_setting_t *caps;
+ struct config_setting_t *zone_e;
+ struct config_setting_t *skills;
+ struct config_setting_t *items;
+ struct config_setting_t *mapflags;
+ struct config_setting_t *commands;
+ struct config_setting_t *caps;
const char *name;
const char *zonename;
int i,h,v,j;
@@ -5017,7 +5445,7 @@ void read_map_zone_db(void) {
zone_e = libconfig->setting_get_elem(zones, i);
if (!libconfig->setting_lookup_string(zone_e, "name", &zonename)) {
- ShowError("map_zone_db: missing zone name, skipping... (%s:%d)\n",
+ ShowError("map_zone_db: missing zone name, skipping... (%s:%u)\n",
config_setting_source_file(zone_e), config_setting_source_line(zone_e));
libconfig->setting_remove_elem(zones,i);/* remove from the tree */
--zone_count;
@@ -5054,7 +5482,7 @@ void read_map_zone_db(void) {
disabled_skills_count = libconfig->setting_length(skills);
/* validate */
for(h = 0; h < libconfig->setting_length(skills); h++) {
- config_setting_t *skillinfo = libconfig->setting_get_elem(skills, h);
+ struct config_setting_t *skillinfo = libconfig->setting_get_elem(skills, h);
name = config_setting_name(skillinfo);
if( !map->zone_str2skillid(name) ) {
ShowError("map_zone_db: unknown skill (%s) in disabled_skills for zone '%s', skipping skill...\n",name,zone->name);
@@ -5069,7 +5497,7 @@ void read_map_zone_db(void) {
/* all ok, process */
CREATE( zone->disabled_skills, struct map_zone_disabled_skill_entry *, disabled_skills_count );
for(h = 0, v = 0; h < libconfig->setting_length(skills); h++) {
- config_setting_t *skillinfo = libconfig->setting_get_elem(skills, h);
+ struct config_setting_t *skillinfo = libconfig->setting_get_elem(skills, h);
struct map_zone_disabled_skill_entry * entry;
enum bl_type type;
name = config_setting_name(skillinfo);
@@ -5092,7 +5520,7 @@ void read_map_zone_db(void) {
disabled_items_count = libconfig->setting_length(items);
/* validate */
for(h = 0; h < libconfig->setting_length(items); h++) {
- config_setting_t *item = libconfig->setting_get_elem(items, h);
+ struct config_setting_t *item = libconfig->setting_get_elem(items, h);
name = config_setting_name(item);
if( !map->zone_str2itemid(name) ) {
ShowError("map_zone_db: unknown item (%s) in disabled_items for zone '%s', skipping item...\n",name,zone->name);
@@ -5111,7 +5539,7 @@ void read_map_zone_db(void) {
CREATE(zone->cant_disable_items, int, zone->cant_disable_items_count);
}
for(h = 0, v = 0, j = 0; h < libconfig->setting_length(items); h++) {
- config_setting_t *item = libconfig->setting_get_elem(items, h);
+ struct config_setting_t *item = libconfig->setting_get_elem(items, h);
name = config_setting_name(item);
if( libconfig->setting_get_bool(item) ) { /* only add if enabled */
@@ -5143,7 +5571,7 @@ void read_map_zone_db(void) {
disabled_commands_count = libconfig->setting_length(commands);
/* validate */
for(h = 0; h < libconfig->setting_length(commands); h++) {
- config_setting_t *command = libconfig->setting_get_elem(commands, h);
+ struct config_setting_t *command = libconfig->setting_get_elem(commands, h);
name = config_setting_name(command);
if( !atcommand->exists(name) ) {
ShowError("map_zone_db: unknown command '%s' in disabled_commands for zone '%s', skipping entry...\n",name,zone->name);
@@ -5158,7 +5586,7 @@ void read_map_zone_db(void) {
/* all ok, process */
CREATE( zone->disabled_commands, struct map_zone_disabled_command_entry *, disabled_commands_count );
for(h = 0, v = 0; h < libconfig->setting_length(commands); h++) {
- config_setting_t *command = libconfig->setting_get_elem(commands, h);
+ struct config_setting_t *command = libconfig->setting_get_elem(commands, h);
struct map_zone_disabled_command_entry * entry;
int group_lv;
name = config_setting_name(command);
@@ -5179,7 +5607,7 @@ void read_map_zone_db(void) {
capped_skills_count = libconfig->setting_length(caps);
/* validate */
for(h = 0; h < libconfig->setting_length(caps); h++) {
- config_setting_t *cap = libconfig->setting_get_elem(caps, h);
+ struct config_setting_t *cap = libconfig->setting_get_elem(caps, h);
name = config_setting_name(cap);
if( !map->zone_str2skillid(name) ) {
ShowError("map_zone_db: unknown skill (%s) in skill_damage_cap for zone '%s', skipping skill...\n",name,zone->name);
@@ -5194,7 +5622,7 @@ void read_map_zone_db(void) {
/* all ok, process */
CREATE( zone->capped_skills, struct map_zone_skill_damage_cap_entry *, capped_skills_count );
for(h = 0, v = 0; h < libconfig->setting_length(caps); h++) {
- config_setting_t *cap = libconfig->setting_get_elem(caps, h);
+ struct config_setting_t *cap = libconfig->setting_get_elem(caps, h);
struct map_zone_skill_damage_cap_entry * entry;
enum bl_type type;
name = config_setting_name(cap);
@@ -5219,8 +5647,8 @@ void read_map_zone_db(void) {
/* process inheritance, aka loop through the whole thing again :P */
for (i = 0; i < zone_count; ++i) {
- config_setting_t *inherit_tree = NULL;
- config_setting_t *new_entry = NULL;
+ struct config_setting_t *inherit_tree = NULL;
+ struct config_setting_t *new_entry = NULL;
int inherit_count;
zone_e = libconfig->setting_get_elem(zones, i);
@@ -5278,7 +5706,7 @@ void read_map_zone_db(void) {
for(j = 0; j < disabled_skills_count_i; j++) {
int k;
for(k = 0; k < disabled_skills_count; k++) {
- config_setting_t *skillinfo = libconfig->setting_get_elem(skills, k);
+ struct config_setting_t *skillinfo = libconfig->setting_get_elem(skills, k);
if( map->zone_str2skillid(config_setting_name(skillinfo)) == izone->disabled_skills[j]->nameid ) {
break;
}
@@ -5302,7 +5730,7 @@ void read_map_zone_db(void) {
for(j = 0; j < disabled_items_count_i; j++) {
int k;
for(k = 0; k < disabled_items_count; k++) {
- config_setting_t *item = libconfig->setting_get_elem(items, k);
+ struct config_setting_t *item = libconfig->setting_get_elem(items, k);
name = config_setting_name(item);
@@ -5348,7 +5776,7 @@ void read_map_zone_db(void) {
for(j = 0; j < disabled_commands_count_i; j++) {
int k;
for(k = 0; k < disabled_commands_count; k++) {
- config_setting_t *command = libconfig->setting_get_elem(commands, k);
+ struct config_setting_t *command = libconfig->setting_get_elem(commands, k);
if( atcommand->exists(config_setting_name(command))->func == izone->disabled_commands[j]->cmd ) {
break;
}
@@ -5372,7 +5800,7 @@ void read_map_zone_db(void) {
for(j = 0; j < capped_skills_count_i; j++) {
int k;
for(k = 0; k < capped_skills_count; k++) {
- config_setting_t *cap = libconfig->setting_get_elem(caps, k);
+ struct config_setting_t *cap = libconfig->setting_get_elem(caps, k);
if( map->zone_str2skillid(config_setting_name(cap)) == izone->capped_skills[j]->nameid ) {
break;
}
@@ -5414,6 +5842,8 @@ int map_get_new_bonus_id (void) {
void map_add_questinfo(int m, struct questinfo *qi) {
unsigned short i;
+ nullpo_retv(qi);
+ Assert_retv(m >= 0 && m < map->count);
/* duplicate, override */
for(i = 0; i < map->list[m].qi_count; i++) {
if( map->list[m].qi_data[i].nd == qi->nd )
@@ -5429,6 +5859,7 @@ void map_add_questinfo(int m, struct questinfo *qi) {
bool map_remove_questinfo(int m, struct npc_data *nd) {
unsigned short i;
+ Assert_retr(false, m >= 0 && m < map->count);
for(i = 0; i < map->list[m].qi_count; i++) {
struct questinfo *qi = &map->list[m].qi_data[i];
if( qi->nd == nd ) {
@@ -5445,7 +5876,8 @@ bool map_remove_questinfo(int m, struct npc_data *nd) {
/**
* @see DBApply
*/
-int map_db_final(DBKey key, DBData *data, va_list ap) {
+int map_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct map_data_other_server *mdos = DB->data2ptr(data);
if(mdos && iMalloc->verify_ptr(mdos) && mdos->cell == NULL)
@@ -5457,7 +5889,7 @@ int map_db_final(DBKey key, DBData *data, va_list ap) {
/**
* @see DBApply
*/
-int nick_db_final(DBKey key, DBData *data, va_list args)
+int nick_db_final(union DBKey key, struct DBData *data, va_list args)
{
struct charid2nick* p = DB->data2ptr(data);
struct charid_request* req;
@@ -5504,7 +5936,8 @@ int cleanup_sub(struct block_list *bl, va_list ap) {
/**
* @see DBApply
*/
-int cleanup_db_sub(DBKey key, DBData *data, va_list va) {
+int cleanup_db_sub(union DBKey key, struct DBData *data, va_list va)
+{
return map->cleanup_sub(DB->data2ptr(data), va);
}
@@ -5585,8 +6018,8 @@ int do_final(void) {
map->map_db->destroy(map->map_db, map->db_final);
mapindex->final();
- if(map->enable_grf)
- grfio_final();
+ if (map->enable_grf)
+ grfio->final();
db_destroy(map->id_db);
db_destroy(map->pc_db);
@@ -5910,22 +6343,6 @@ static CMDLINEARG(loadscript)
}
/**
- * --generate-translations
- *
- * Creates "./generated_translations.pot"
- * @see cmdline->exec
- **/
-static CMDLINEARG(generatetranslations) {
- script->lang_export_file = aStrdup("./generated_translations.pot");
-
- if( !(script->lang_export_fp = fopen(script->lang_export_file,"wb")) ) {
- ShowError("export-dialog: failed to open '%s' for writing\n",script->lang_export_file);
- }
- core->runflag = CORE_ST_STOP;
- return true;
-}
-
-/**
* Defines the local command line arguments
*/
void cmdline_args_init_local(void)
@@ -5941,7 +6358,6 @@ void cmdline_args_init_local(void)
CMDLINEARG_DEF2(log-config, logconfig, "Alternative logging configuration.", CMDLINE_OPT_NORMAL|CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(script-check, scriptcheck, "Doesn't run the server, only tests the scripts passed through --load-script.", CMDLINE_OPT_SILENT);
CMDLINEARG_DEF2(load-script, loadscript, "Loads an additional script (can be repeated).", CMDLINE_OPT_NORMAL|CMDLINE_OPT_PARAM);
- CMDLINEARG_DEF2(generate-translations, generatetranslations, "Creates './generated_translations.pot' file with all translateable strings from scripts, server terminates afterwards.", CMDLINE_OPT_NORMAL);
}
int do_init(int argc, char *argv[])
@@ -5955,12 +6371,12 @@ int do_init(int argc, char *argv[])
map_load_defaults();
- map->INTER_CONF_NAME = aStrdup("conf/inter-server.conf");
- map->LOG_CONF_NAME = aStrdup("conf/logs.conf");
- map->MAP_CONF_NAME = aStrdup("conf/map-server.conf");
- map->BATTLE_CONF_FILENAME = aStrdup("conf/battle.conf");
+ map->INTER_CONF_NAME = aStrdup("conf/common/inter-server.conf");
+ map->LOG_CONF_NAME = aStrdup("conf/map/logs.conf");
+ map->MAP_CONF_NAME = aStrdup("conf/map/map-server.conf");
+ map->BATTLE_CONF_FILENAME = aStrdup("conf/map/battle.conf");
map->ATCOMMAND_CONF_FILENAME = aStrdup("conf/atcommand.conf");
- map->SCRIPT_CONF_NAME = aStrdup("conf/script.conf");
+ map->SCRIPT_CONF_NAME = aStrdup("conf/map/script.conf");
map->MSG_CONF_NAME = aStrdup("conf/messages.conf");
map->GRF_PATH_FILENAME = aStrdup("conf/grf-files.txt");
@@ -5973,10 +6389,30 @@ int do_init(int argc, char *argv[])
cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL);
minimal = map->minimal;/* temp (perhaps make minimal a mask with options of what to load? e.g. plugin 1 does minimal |= mob_db; */
if (!minimal) {
- map->config_read(map->MAP_CONF_NAME);
- CREATE(map->list,struct map_data,map->count);
- map->count = 0;
- map->config_read_sub(map->MAP_CONF_NAME);
+ map->config_read(map->MAP_CONF_NAME, false);
+
+ {
+ // TODO: Remove this when no longer needed.
+#define CHECK_OLD_LOCAL_CONF(oldname, newname) do { \
+ if (stat((oldname), &fileinfo) == 0 && fileinfo.st_size > 0) { \
+ ShowWarning("An old configuration file \"%s\" was found.\n", (oldname)); \
+ ShowWarning("If it contains settings you wish to keep, please merge them into \"%s\".\n", (newname)); \
+ ShowWarning("Otherwise, just delete it.\n"); \
+ ShowInfo("Resuming in 10 seconds...\n"); \
+ HSleep(10); \
+ } \
+} while (0)
+ struct stat fileinfo;
+
+ CHECK_OLD_LOCAL_CONF("conf/import/map_conf.txt", "conf/import/map-server.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/inter_conf.txt", "conf/import/inter-server.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/log_conf.txt", "conf/import/logs.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/script_conf.txt", "conf/import/script.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/packet_conf.txt", "conf/import/socket.conf");
+ CHECK_OLD_LOCAL_CONF("conf/import/battle_conf.txt", "conf/import/battle.conf");
+
+#undef CHECK_OLD_LOCAL_CONF
+ }
// loads npcs
map->reloadnpc(false);
@@ -5987,7 +6423,9 @@ int do_init(int argc, char *argv[])
char ip_str[16];
sockt->ip2str(sockt->addr_[0], ip_str);
- ShowWarning("Not all IP addresses in /conf/map-server.conf configured, auto-detecting...\n");
+#ifndef BUILDBOT
+ ShowWarning("Not all IP addresses in /conf/map/map-server.conf configured, auto-detecting...\n");
+#endif
if (sockt->naddr_ == 0)
ShowError("Unable to determine your IP address...\n");
@@ -6002,12 +6440,12 @@ int do_init(int argc, char *argv[])
chrif->setip(ip_str);
}
- battle->config_read(map->BATTLE_CONF_FILENAME);
+ battle->config_read(map->BATTLE_CONF_FILENAME, false);
atcommand->msg_read(map->MSG_CONF_NAME, false);
- map->inter_config_read(map->INTER_CONF_NAME);
- logs->config_read(map->LOG_CONF_NAME);
+ map->inter_config_read(map->INTER_CONF_NAME, false);
+ logs->config_read(map->LOG_CONF_NAME, false);
}
- script->config_read(map->SCRIPT_CONF_NAME);
+ script->config_read(map->SCRIPT_CONF_NAME, false);
map->id_db = idb_alloc(DB_OPT_BASE);
map->pc_db = idb_alloc(DB_OPT_BASE); //Added for reliable map->id2sd() use. [Skotlex]
@@ -6045,8 +6483,8 @@ int do_init(int argc, char *argv[])
}
}
- if(map->enable_grf)
- grfio_init(map->GRF_PATH_FILENAME);
+ if (map->enable_grf)
+ grfio->init(map->GRF_PATH_FILENAME);
map->readallmaps();
@@ -6151,7 +6589,6 @@ void map_defaults(void) {
sprintf(map->db_path ,"db");
sprintf(map->help_txt ,"conf/help.txt");
- sprintf(map->help2_txt ,"conf/help2.txt");
sprintf(map->charhelp_txt ,"conf/charhelp.txt");
sprintf(map->wisp_server_name ,"Server"); // can be modified in char-server configuration file
@@ -6164,12 +6601,12 @@ void map_defaults(void) {
map->night_flag = 0; // 0=day, 1=night [Yor]
map->enable_spy = 0; //To enable/disable @spy commands, which consume too much cpu time when sending packets. [Skotlex]
- map->INTER_CONF_NAME="conf/inter-server.conf";
- map->LOG_CONF_NAME="conf/logs.conf";
- map->MAP_CONF_NAME = "conf/map-server.conf";
- map->BATTLE_CONF_FILENAME = "conf/battle.conf";
+ map->INTER_CONF_NAME="conf/common/inter-server.conf";
+ map->LOG_CONF_NAME="conf/map/logs.conf";
+ map->MAP_CONF_NAME = "conf/map/map-server.conf";
+ map->BATTLE_CONF_FILENAME = "conf/map/battle.conf";
map->ATCOMMAND_CONF_FILENAME = "conf/atcommand.conf";
- map->SCRIPT_CONF_NAME = "conf/script.conf";
+ map->SCRIPT_CONF_NAME = "conf/map/script.conf";
map->MSG_CONF_NAME = "conf/messages.conf";
map->GRF_PATH_FILENAME = "conf/grf-files.txt";
@@ -6375,9 +6812,10 @@ void map_defaults(void) {
map->readgat = map_readgat;
map->readallmaps = map_readallmaps;
map->config_read = map_config_read;
- map->config_read_sub = map_config_read_sub;
- map->reloadnpc_sub = map_reloadnpc_sub;
+ map->read_npclist = map_read_npclist;
map->inter_config_read = inter_config_read;
+ map->inter_config_read_database_names = inter_config_read_database_names;
+ map->inter_config_read_connection = inter_config_read_connection;
map->sql_init = map_sql_init;
map->sql_close = map_sql_close;
map->zone_mf_cache = map_zone_mf_cache;
diff --git a/src/map/map.h b/src/map/map.h
index ff7ca2d38..d4284b3f7 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -27,11 +27,13 @@
#include "common/db.h"
#include "common/mapindex.h"
#include "common/mmo.h"
-#include "common/sql.h"
#include <stdio.h>
#include <stdarg.h>
+/* Forward Declarations */
+struct Sql; // common/sql.h
+struct config_t; // common/conf.h
struct mob_data;
struct npc_data;
struct channel_data;
@@ -45,6 +47,7 @@ enum E_MAPSERVER_ST {
#define MAX_NPC_PER_MAP 512
#define AREA_SIZE (battle->bc->area_size)
+#define CHAT_AREA_SIZE (battle->bc->chat_area_size)
#define DAMAGELOG_SIZE 30
#define LOOTITEM_SIZE 10
#define MAX_MOBSKILL 50
@@ -72,7 +75,7 @@ enum E_MAPSERVER_ST {
//Super Novices are considered the 2-1 version of the novice! Novices are considered a first class type.
enum {
//Novice And 1-1 Jobs
- MAPID_NOVICE = 0x0,
+ MAPID_NOVICE = 0,
MAPID_SWORDMAN,
MAPID_MAGE,
MAPID_ARCHER,
@@ -86,118 +89,250 @@ enum {
MAPID_XMAS,
MAPID_SUMMER,
MAPID_GANGSI,
+ MAPID_SUMMONER,
+ MAPID_1_1_MAX,
+
//2-1 Jobs
- MAPID_SUPER_NOVICE = JOBL_2_1|0x0,
- MAPID_KNIGHT,
- MAPID_WIZARD,
- MAPID_HUNTER,
- MAPID_PRIEST,
- MAPID_BLACKSMITH,
- MAPID_ASSASSIN,
- MAPID_STAR_GLADIATOR,
- MAPID_REBELLION = JOBL_2_1|0x09,
- MAPID_KAGEROUOBORO = JOBL_2_1|0x0A,
- MAPID_DEATH_KNIGHT = JOBL_2_1|0x0E,
+ MAPID_SUPER_NOVICE = JOBL_2_1 | MAPID_NOVICE,
+ MAPID_KNIGHT = JOBL_2_1 | MAPID_SWORDMAN,
+ MAPID_WIZARD = JOBL_2_1 | MAPID_MAGE,
+ MAPID_HUNTER = JOBL_2_1 | MAPID_ARCHER,
+ MAPID_PRIEST = JOBL_2_1 | MAPID_ACOLYTE,
+ MAPID_BLACKSMITH = JOBL_2_1 | MAPID_MERCHANT,
+ MAPID_ASSASSIN = JOBL_2_1 | MAPID_THIEF,
+ MAPID_STAR_GLADIATOR = JOBL_2_1 | MAPID_TAEKWON,
+ // = JOBL_2_1 | MAPID_WEDDING,
+ MAPID_REBELLION = JOBL_2_1 | MAPID_GUNSLINGER,
+ MAPID_KAGEROUOBORO = JOBL_2_1 | MAPID_NINJA,
+ // = JOBL_2_1 | MAPID_XMAS,
+ // = JOBL_2_1 | MAPID_SUMMER,
+ MAPID_DEATH_KNIGHT = JOBL_2_1 | MAPID_GANGSI,
+ // = JOBL_2_1 | MAPID_SUMMONER,
+
//2-2 Jobs
- MAPID_CRUSADER = JOBL_2_2|0x1,
- MAPID_SAGE,
- MAPID_BARDDANCER,
- MAPID_MONK,
- MAPID_ALCHEMIST,
- MAPID_ROGUE,
- MAPID_SOUL_LINKER,
- MAPID_DARK_COLLECTOR = JOBL_2_2|0x0E,
+ // = JOBL_2_1 | MAPID_NOVICE,
+ MAPID_CRUSADER = JOBL_2_2 | MAPID_SWORDMAN,
+ MAPID_SAGE = JOBL_2_2 | MAPID_MAGE,
+ MAPID_BARDDANCER = JOBL_2_2 | MAPID_ARCHER,
+ MAPID_MONK = JOBL_2_2 | MAPID_ACOLYTE,
+ MAPID_ALCHEMIST = JOBL_2_2 | MAPID_MERCHANT,
+ MAPID_ROGUE = JOBL_2_2 | MAPID_THIEF,
+ MAPID_SOUL_LINKER = JOBL_2_2 | MAPID_TAEKWON,
+ // = JOBL_2_2 | MAPID_WEDDING,
+ // = JOBL_2_2 | MAPID_GUNSLINGER,
+ // = JOBL_2_2 | MAPID_NINJA,
+ // = JOBL_2_2 | MAPID_XMAS,
+ // = JOBL_2_2 | MAPID_SUMMER,
+ MAPID_DARK_COLLECTOR = JOBL_2_2 | MAPID_GANGSI,
+ // = JOBL_2_2 | MAPID_SUMMONER,
+
//Trans Novice And Trans 1-1 Jobs
- MAPID_NOVICE_HIGH = JOBL_UPPER|0x0,
- MAPID_SWORDMAN_HIGH,
- MAPID_MAGE_HIGH,
- MAPID_ARCHER_HIGH,
- MAPID_ACOLYTE_HIGH,
- MAPID_MERCHANT_HIGH,
- MAPID_THIEF_HIGH,
+ MAPID_NOVICE_HIGH = JOBL_UPPER | MAPID_NOVICE,
+ MAPID_SWORDMAN_HIGH = JOBL_UPPER | MAPID_SWORDMAN,
+ MAPID_MAGE_HIGH = JOBL_UPPER | MAPID_MAGE,
+ MAPID_ARCHER_HIGH = JOBL_UPPER | MAPID_ARCHER,
+ MAPID_ACOLYTE_HIGH = JOBL_UPPER | MAPID_ACOLYTE,
+ MAPID_MERCHANT_HIGH = JOBL_UPPER | MAPID_MERCHANT,
+ MAPID_THIEF_HIGH = JOBL_UPPER | MAPID_THIEF,
+ // = JOBL_UPPER | MAPID_TAEKWON,
+ // = JOBL_UPPER | MAPID_WEDDING,
+ // = JOBL_UPPER | MAPID_GUNSLINGER,
+ // = JOBL_UPPER | MAPID_NINJA,
+ // = JOBL_UPPER | MAPID_XMAS,
+ // = JOBL_UPPER | MAPID_SUMMER,
+ // = JOBL_UPPER | MAPID_GANGSI,
+ // = JOBL_UPPER | MAPID_SUMMONER,
+
//Trans 2-1 Jobs
- MAPID_LORD_KNIGHT = JOBL_UPPER|JOBL_2_1|0x1,
- MAPID_HIGH_WIZARD,
- MAPID_SNIPER,
- MAPID_HIGH_PRIEST,
- MAPID_WHITESMITH,
- MAPID_ASSASSIN_CROSS,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_NOVICE,
+ MAPID_LORD_KNIGHT = JOBL_UPPER | JOBL_2_1 | MAPID_SWORDMAN,
+ MAPID_HIGH_WIZARD = JOBL_UPPER | JOBL_2_1 | MAPID_MAGE,
+ MAPID_SNIPER = JOBL_UPPER | JOBL_2_1 | MAPID_ARCHER,
+ MAPID_HIGH_PRIEST = JOBL_UPPER | JOBL_2_1 | MAPID_ACOLYTE,
+ MAPID_WHITESMITH = JOBL_UPPER | JOBL_2_1 | MAPID_MERCHANT,
+ MAPID_ASSASSIN_CROSS = JOBL_UPPER | JOBL_2_1 | MAPID_THIEF,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_TAEKWON,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_WEDDING,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_GUNSLINGER,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_NINJA,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_XMAS,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_SUMMER,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_GANGSI,
+ // = JOBL_UPPER | JOBL_2_1 | MAPID_SUMMONER,
+
//Trans 2-2 Jobs
- MAPID_PALADIN = JOBL_UPPER|JOBL_2_2|0x1,
- MAPID_PROFESSOR,
- MAPID_CLOWNGYPSY,
- MAPID_CHAMPION,
- MAPID_CREATOR,
- MAPID_STALKER,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_NOVICE,
+ MAPID_PALADIN = JOBL_UPPER | JOBL_2_2 | MAPID_SWORDMAN,
+ MAPID_PROFESSOR = JOBL_UPPER | JOBL_2_2 | MAPID_MAGE,
+ MAPID_CLOWNGYPSY = JOBL_UPPER | JOBL_2_2 | MAPID_ARCHER,
+ MAPID_CHAMPION = JOBL_UPPER | JOBL_2_2 | MAPID_ACOLYTE,
+ MAPID_CREATOR = JOBL_UPPER | JOBL_2_2 | MAPID_MERCHANT,
+ MAPID_STALKER = JOBL_UPPER | JOBL_2_2 | MAPID_THIEF,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_TAEKWON,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_WEDDING,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_GUNSLINGER,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_NINJA,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_XMAS,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_SUMMER,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_GANGSI,
+ // = JOBL_UPPER | JOBL_2_2 | MAPID_SUMMONER,
+
//Baby Novice And Baby 1-1 Jobs
- MAPID_BABY = JOBL_BABY|0x0,
- MAPID_BABY_SWORDMAN,
- MAPID_BABY_MAGE,
- MAPID_BABY_ARCHER,
- MAPID_BABY_ACOLYTE,
- MAPID_BABY_MERCHANT,
- MAPID_BABY_THIEF,
+ MAPID_BABY = JOBL_BABY | MAPID_NOVICE,
+ MAPID_BABY_SWORDMAN = JOBL_BABY | MAPID_SWORDMAN,
+ MAPID_BABY_MAGE = JOBL_BABY | MAPID_MAGE,
+ MAPID_BABY_ARCHER = JOBL_BABY | MAPID_ARCHER,
+ MAPID_BABY_ACOLYTE = JOBL_BABY | MAPID_ACOLYTE,
+ MAPID_BABY_MERCHANT = JOBL_BABY | MAPID_MERCHANT,
+ MAPID_BABY_THIEF = JOBL_BABY | MAPID_THIEF,
+ // = JOBL_BABY | MAPID_TAEKWON,
+ // = JOBL_BABY | MAPID_WEDDING,
+ // = JOBL_BABY | MAPID_GUNSLINGER,
+ // = JOBL_BABY | MAPID_NINJA,
+ // = JOBL_BABY | MAPID_XMAS,
+ // = JOBL_BABY | MAPID_SUMMER,
+ // = JOBL_BABY | MAPID_GANGSI,
+ // = JOBL_BABY | MAPID_SUMMONER,
+
//Baby 2-1 Jobs
- MAPID_SUPER_BABY = JOBL_BABY|JOBL_2_1|0x0,
- MAPID_BABY_KNIGHT,
- MAPID_BABY_WIZARD,
- MAPID_BABY_HUNTER,
- MAPID_BABY_PRIEST,
- MAPID_BABY_BLACKSMITH,
- MAPID_BABY_ASSASSIN,
+ MAPID_SUPER_BABY = JOBL_BABY | JOBL_2_1 | MAPID_NOVICE,
+ MAPID_BABY_KNIGHT = JOBL_BABY | JOBL_2_1 | MAPID_SWORDMAN,
+ MAPID_BABY_WIZARD = JOBL_BABY | JOBL_2_1 | MAPID_MAGE,
+ MAPID_BABY_HUNTER = JOBL_BABY | JOBL_2_1 | MAPID_ARCHER,
+ MAPID_BABY_PRIEST = JOBL_BABY | JOBL_2_1 | MAPID_ACOLYTE,
+ MAPID_BABY_BLACKSMITH = JOBL_BABY | JOBL_2_1 | MAPID_MERCHANT,
+ MAPID_BABY_ASSASSIN = JOBL_BABY | JOBL_2_1 | MAPID_THIEF,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_TAEKWON,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_WEDDING,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_GUNSLINGER,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_NINJA,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_XMAS,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_SUMMER,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_GANGSI,
+ // = JOBL_BABY | JOBL_2_1 | MAPID_SUMMONER,
+
//Baby 2-2 Jobs
- MAPID_BABY_CRUSADER = JOBL_BABY|JOBL_2_2|0x1,
- MAPID_BABY_SAGE,
- MAPID_BABY_BARDDANCER,
- MAPID_BABY_MONK,
- MAPID_BABY_ALCHEMIST,
- MAPID_BABY_ROGUE,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_NOVICE,
+ MAPID_BABY_CRUSADER = JOBL_BABY | JOBL_2_2 | MAPID_SWORDMAN,
+ MAPID_BABY_SAGE = JOBL_BABY | JOBL_2_2 | MAPID_MAGE,
+ MAPID_BABY_BARDDANCER = JOBL_BABY | JOBL_2_2 | MAPID_ARCHER,
+ MAPID_BABY_MONK = JOBL_BABY | JOBL_2_2 | MAPID_ACOLYTE,
+ MAPID_BABY_ALCHEMIST = JOBL_BABY | JOBL_2_2 | MAPID_MERCHANT,
+ MAPID_BABY_ROGUE = JOBL_BABY | JOBL_2_2 | MAPID_THIEF,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_TAEKWON,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_WEDDING,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_GUNSLINGER,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_NINJA,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_XMAS,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_SUMMER,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_GANGSI,
+ // = JOBL_BABY | JOBL_2_2 | MAPID_SUMMONER,
+
//3-1 Jobs
- MAPID_SUPER_NOVICE_E = JOBL_THIRD|JOBL_2_1|0x0,
- MAPID_RUNE_KNIGHT,
- MAPID_WARLOCK,
- MAPID_RANGER,
- MAPID_ARCH_BISHOP,
- MAPID_MECHANIC,
- MAPID_GUILLOTINE_CROSS,
+ MAPID_SUPER_NOVICE_E = JOBL_THIRD | JOBL_2_1 | MAPID_NOVICE,
+ MAPID_RUNE_KNIGHT = JOBL_THIRD | JOBL_2_1 | MAPID_SWORDMAN,
+ MAPID_WARLOCK = JOBL_THIRD | JOBL_2_1 | MAPID_MAGE,
+ MAPID_RANGER = JOBL_THIRD | JOBL_2_1 | MAPID_ARCHER,
+ MAPID_ARCH_BISHOP = JOBL_THIRD | JOBL_2_1 | MAPID_ACOLYTE,
+ MAPID_MECHANIC = JOBL_THIRD | JOBL_2_1 | MAPID_MERCHANT,
+ MAPID_GUILLOTINE_CROSS = JOBL_THIRD | JOBL_2_1 | MAPID_THIEF,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_TAEKWON,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_WEDDING,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_GUNSLINGER,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_NINJA,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_XMAS,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_SUMMER,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_GANGSI,
+ // = JOBL_THIRD | JOBL_2_1 | MAPID_SUMMONER,
+
//3-2 Jobs
- MAPID_ROYAL_GUARD = JOBL_THIRD|JOBL_2_2|0x1,
- MAPID_SORCERER,
- MAPID_MINSTRELWANDERER,
- MAPID_SURA,
- MAPID_GENETIC,
- MAPID_SHADOW_CHASER,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_NOVICE,
+ MAPID_ROYAL_GUARD = JOBL_THIRD | JOBL_2_2 | MAPID_SWORDMAN,
+ MAPID_SORCERER = JOBL_THIRD | JOBL_2_2 | MAPID_MAGE,
+ MAPID_MINSTRELWANDERER = JOBL_THIRD | JOBL_2_2 | MAPID_ARCHER,
+ MAPID_SURA = JOBL_THIRD | JOBL_2_2 | MAPID_ACOLYTE,
+ MAPID_GENETIC = JOBL_THIRD | JOBL_2_2 | MAPID_MERCHANT,
+ MAPID_SHADOW_CHASER = JOBL_THIRD | JOBL_2_2 | MAPID_THIEF,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_TAEKWON,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_WEDDING,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_GUNSLINGER,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_NINJA,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_XMAS,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_SUMMER,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_GANGSI,
+ // = JOBL_THIRD | JOBL_2_2 | MAPID_SUMMONER,
+
//Trans 3-1 Jobs
- MAPID_RUNE_KNIGHT_T = JOBL_THIRD|JOBL_UPPER|JOBL_2_1|0x1,
- MAPID_WARLOCK_T,
- MAPID_RANGER_T,
- MAPID_ARCH_BISHOP_T,
- MAPID_MECHANIC_T,
- MAPID_GUILLOTINE_CROSS_T,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_NOVICE,
+ MAPID_RUNE_KNIGHT_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_SWORDMAN,
+ MAPID_WARLOCK_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_MAGE,
+ MAPID_RANGER_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_ARCHER,
+ MAPID_ARCH_BISHOP_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_ACOLYTE,
+ MAPID_MECHANIC_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_MERCHANT,
+ MAPID_GUILLOTINE_CROSS_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_THIEF,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_TAEKWON,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_WEDDING,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_GUNSLINGER,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_NINJA,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_XMAS,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_SUMMER,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_GANGSI,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_1 | MAPID_SUMMONER,
+
//Trans 3-2 Jobs
- MAPID_ROYAL_GUARD_T = JOBL_THIRD|JOBL_UPPER|JOBL_2_2|0x1,
- MAPID_SORCERER_T,
- MAPID_MINSTRELWANDERER_T,
- MAPID_SURA_T,
- MAPID_GENETIC_T,
- MAPID_SHADOW_CHASER_T,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_NOVICE,
+ MAPID_ROYAL_GUARD_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_SWORDMAN,
+ MAPID_SORCERER_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_MAGE,
+ MAPID_MINSTRELWANDERER_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_ARCHER,
+ MAPID_SURA_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_ACOLYTE,
+ MAPID_GENETIC_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_MERCHANT,
+ MAPID_SHADOW_CHASER_T = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_THIEF,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_TAEKWON,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_WEDDING,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_GUNSLINGER,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_NINJA,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_XMAS,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_SUMMER,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_GANGSI,
+ // = JOBL_THIRD | JOBL_UPPER | JOBL_2_2 | MAPID_SUMMONER,
+
//Baby 3-1 Jobs
- MAPID_SUPER_BABY_E = JOBL_THIRD|JOBL_BABY|JOBL_2_1|0x0,
- MAPID_BABY_RUNE,
- MAPID_BABY_WARLOCK,
- MAPID_BABY_RANGER,
- MAPID_BABY_BISHOP,
- MAPID_BABY_MECHANIC,
- MAPID_BABY_CROSS,
+ MAPID_SUPER_BABY_E = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_NOVICE,
+ MAPID_BABY_RUNE = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_SWORDMAN,
+ MAPID_BABY_WARLOCK = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_MAGE,
+ MAPID_BABY_RANGER = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_ARCHER,
+ MAPID_BABY_BISHOP = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_ACOLYTE,
+ MAPID_BABY_MECHANIC = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_MERCHANT,
+ MAPID_BABY_CROSS = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_THIEF,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_TAEKWON,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_WEDDING,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_GUNSLINGER,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_NINJA,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_XMAS,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_SUMMER,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_GANGSI,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_1 | MAPID_SUMMONER,
+
//Baby 3-2 Jobs
- MAPID_BABY_GUARD = JOBL_THIRD|JOBL_BABY|JOBL_2_2|0x1,
- MAPID_BABY_SORCERER,
- MAPID_BABY_MINSTRELWANDERER,
- MAPID_BABY_SURA,
- MAPID_BABY_GENETIC,
- MAPID_BABY_CHASER,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_NOVICE,
+ MAPID_BABY_GUARD = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_SWORDMAN,
+ MAPID_BABY_SORCERER = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_MAGE,
+ MAPID_BABY_MINSTRELWANDERER = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_ARCHER,
+ MAPID_BABY_SURA = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_ACOLYTE,
+ MAPID_BABY_GENETIC = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_MERCHANT,
+ MAPID_BABY_CHASER = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_THIEF,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_TAEKWON,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_WEDDING,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_GUNSLINGER,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_NINJA,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_XMAS,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_SUMMER,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_GANGSI,
+ // = JOBL_THIRD | JOBL_BABY | JOBL_2_2 | MAPID_SUMMONER,
};
+STATIC_ASSERT(((MAPID_1_1_MAX - 1) | MAPID_BASEMASK) == MAPID_BASEMASK, "First class map IDs do not fit into MAPID_BASEMASK");
+
// Max size for inputs to Graffiti, Talkie Box and Vending text prompts
#define MESSAGE_SIZE (79 + 1)
// String length you can write in the 'talking box'
@@ -398,7 +533,7 @@ struct flooritem_data {
struct item item_data;
};
-enum status_point_types {
+enum status_point_types { //we better clean up this enum and change it name [Hemagx]
SP_SPEED,SP_BASEEXP,SP_JOBEXP,SP_KARMA,SP_MANNER,SP_HP,SP_MAXHP,SP_SP, // 0-7
SP_MAXSP,SP_STATUSPOINT,SP_0a,SP_BASELEVEL,SP_SKILLPOINT,SP_STR,SP_AGI,SP_VIT, // 8-15
SP_INT,SP_DEX,SP_LUK,SP_CLASS,SP_ZENY,SP_SEX,SP_NEXTBASEEXP,SP_NEXTJOBEXP, // 16-23
@@ -418,6 +553,7 @@ enum status_point_types {
SP_MOD_EXP=125,
SP_MOD_DROP=126,
SP_MOD_DEATH=127,
+ SP_BANKVAULT=128,
// Mercenaries
SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190,
@@ -966,7 +1102,6 @@ struct map_interface {
char db_path[256];
char help_txt[256];
- char help2_txt[256];
char charhelp_txt[256];
char wisp_server_name[NAME_LENGTH];
@@ -993,9 +1128,9 @@ struct map_interface {
char server_id[32];
char server_pw[100];
char server_db[32];
- Sql* mysql_handle;
+ struct Sql *mysql_handle;
- int port;
+ uint16 port;
int users;
int enable_grf; //To enable/disable reading maps from GRF files, bypassing mapcache [blackhole89]
bool ip_set;
@@ -1003,16 +1138,16 @@ struct map_interface {
int16 index2mapid[MAX_MAPINDEX];
/* */
- DBMap* id_db; // int id -> struct block_list*
- DBMap* pc_db; // int id -> struct map_session_data*
- DBMap* mobid_db; // int id -> struct mob_data*
- DBMap* bossid_db; // int id -> struct mob_data* (MVP db)
- DBMap* map_db; // unsigned int mapindex -> struct map_data_other_server*
- DBMap* nick_db; // int char_id -> struct charid2nick* (requested names of offline characters)
- DBMap* charid_db; // int char_id -> struct map_session_data*
- DBMap* regen_db; // int id -> struct block_list* (status_natural_heal processing)
- DBMap* zone_db; // string => struct map_zone_data
- DBMap* iwall_db;
+ struct DBMap *id_db; // int id -> struct block_list*
+ struct DBMap *pc_db; // int id -> struct map_session_data*
+ struct DBMap *mobid_db; // int id -> struct mob_data*
+ struct DBMap *bossid_db; // int id -> struct mob_data* (MVP db)
+ struct DBMap *map_db; // unsigned int mapindex -> struct map_data_other_server*
+ struct DBMap *nick_db; // int char_id -> struct charid2nick* (requested names of offline characters)
+ struct DBMap *charid_db; // int char_id -> struct map_session_data*
+ struct DBMap *regen_db; // int id -> struct block_list* (status_natural_heal processing)
+ struct DBMap *zone_db; // string => struct map_zone_data
+ struct DBMap *iwall_db;
struct block_list **block_free;
int block_free_count, block_free_lock, block_free_list_size;
struct block_list **bl_list;
@@ -1146,7 +1281,7 @@ END_ZEROED_BLOCK;
int (*cleanup_sub) (struct block_list *bl, va_list ap);
- int (*delmap) (char* mapname);
+ int (*delmap) (const char *mapname);
void (*flags_init) (void);
bool (*iwall_set) (int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char* wall_name);
@@ -1166,7 +1301,7 @@ END_ZEROED_BLOCK;
int (*freeblock_timer) (int tid, int64 tick, int id, intptr_t data);
int (*searchrandfreecell) (int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack);
int (*count_sub) (struct block_list *bl, va_list ap);
- DBData (*create_charid2nick) (DBKey key, va_list args);
+ struct DBData (*create_charid2nick) (union DBKey key, va_list args);
int (*removemobs_sub) (struct block_list *bl, va_list ap);
struct mapcell (*gat2cell) (int gat);
int (*cell2gat) (struct mapcell cell);
@@ -1175,8 +1310,8 @@ END_ZEROED_BLOCK;
int (*sub_getcellp) (struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
void (*sub_setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
void (*iwall_nextxy) (int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1);
- DBData (*create_map_data_other_server) (DBKey key, va_list args);
- int (*eraseallipport_sub) (DBKey key, DBData *data, va_list va);
+ struct DBData (*create_map_data_other_server) (union DBKey key, va_list args);
+ int (*eraseallipport_sub) (union DBKey key, struct DBData *data, va_list va);
char* (*init_mapcache) (FILE *fp);
int (*readfromcache) (struct map_data *m, char *buffer);
int (*addmap) (const char *mapname);
@@ -1186,10 +1321,11 @@ END_ZEROED_BLOCK;
int (*waterheight) (char *mapname);
int (*readgat) (struct map_data *m);
int (*readallmaps) (void);
- int (*config_read) (char *cfgName);
- int (*config_read_sub) (char *cfgName);
- void (*reloadnpc_sub) (char *cfgName);
- int (*inter_config_read) (char *cfgName);
+ bool (*config_read) (const char *filename, bool imported);
+ bool (*read_npclist) (const char *filename, bool imported);
+ bool (*inter_config_read) (const char *filename, bool imported);
+ bool (*inter_config_read_database_names) (const char *filename, const struct config_t *config, bool imported);
+ bool (*inter_config_read_connection) (const char *filename, const struct config_t *config, bool imported);
int (*sql_init) (void);
int (*sql_close) (void);
bool (*zone_mf_cache) (int m, char *flag, char *params);
@@ -1197,9 +1333,9 @@ END_ZEROED_BLOCK;
unsigned short (*zone_str2skillid) (const char *name);
enum bl_type (*zone_bl_type) (const char *entry, enum map_zone_skill_subtype *subtype);
void (*read_zone_db) (void);
- int (*db_final) (DBKey key, DBData *data, va_list ap);
- int (*nick_db_final) (DBKey key, DBData *data, va_list args);
- int (*cleanup_db_sub) (DBKey key, DBData *data, va_list va);
+ int (*db_final) (union DBKey key, struct DBData *data, va_list ap);
+ int (*nick_db_final) (union DBKey key, struct DBData *data, va_list args);
+ int (*cleanup_db_sub) (union DBKey key, struct DBData *data, va_list va);
int (*abort_sub) (struct map_session_data *sd, va_list ap);
void (*update_cell_bl) (struct block_list *bl, bool increase);
int (*get_new_bonus_id) (void);
diff --git a/src/map/mapreg.h b/src/map/mapreg.h
index dfe1dfb2d..642bce48e 100644
--- a/src/map/mapreg.h
+++ b/src/map/mapreg.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,6 +25,8 @@
#include "common/hercules.h"
#include "common/db.h"
+/* Forward Declarations */
+struct config_setting_t; // common/conf.h
struct eri;
/** Container for a mapreg value */
@@ -59,9 +61,9 @@ struct mapreg_interface {
void (*load) (void);
void (*save) (void);
int (*save_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*destroyreg) (DBKey key, DBData *data, va_list ap);
+ int (*destroyreg) (union DBKey key, struct DBData *data, va_list ap);
void (*reload) (void);
- bool (*config_read) (const char *w1, const char *w2);
+ bool (*config_read) (const char *filename, const struct config_setting_t *config, bool imported);
};
#ifdef HERCULES_CORE
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index 9bf67196e..4cdb91b21 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,9 +25,11 @@
#include "map/map.h" // map-"mysql_handle
#include "map/script.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/db.h"
#include "common/ers.h"
#include "common/memmgr.h"
+#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/sql.h"
#include "common/strlib.h"
@@ -76,6 +78,7 @@ bool mapreg_setreg(int64 uid, int val) {
unsigned int i = script_getvaridx(uid);
const char* name = script->get_str(num);
+ nullpo_retr(true, name);
if( val != 0 ) {
if( (m = i64db_get(mapreg->regs.vars, uid)) ) {
m->u.i = val;
@@ -97,7 +100,7 @@ bool mapreg_setreg(int64 uid, int val) {
if (name[1] != '@' && !mapreg->skip_insert) {// write new variable to database
char tmp_str[(SCRIPT_VARNAME_LENGTH+1)*2+1];
SQL->EscapeStringLen(map->mysql_handle, tmp_str, name, strnlen(name, SCRIPT_VARNAME_LENGTH+1));
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%d','%d')", mapreg->table, tmp_str, i, val) )
+ if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%u','%d')", mapreg->table, tmp_str, i, val) )
Sql_ShowDebug(map->mysql_handle);
}
i64db_put(mapreg->regs.vars, uid, m);
@@ -111,7 +114,7 @@ bool mapreg_setreg(int64 uid, int val) {
i64db_remove(mapreg->regs.vars, uid);
if( name[1] != '@' ) {// Remove from database because it is unused.
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%d'", mapreg->table, name, i) )
+ if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%u'", mapreg->table, name, i) )
Sql_ShowDebug(map->mysql_handle);
}
}
@@ -132,11 +135,13 @@ bool mapreg_setregstr(int64 uid, const char* str) {
unsigned int i = script_getvaridx(uid);
const char* name = script->get_str(num);
+ nullpo_retr(true, name);
+
if( str == NULL || *str == 0 ) {
if( i )
script->array_update(&mapreg->regs, uid, true);
if(name[1] != '@') {
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%d'", mapreg->table, name, i) )
+ if (SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `varname`='%s' AND `index`='%u'", mapreg->table, name, i))
Sql_ShowDebug(map->mysql_handle);
}
if( (m = i64db_get(mapreg->regs.vars, uid)) ) {
@@ -170,7 +175,7 @@ bool mapreg_setregstr(int64 uid, const char* str) {
char tmp_str2[255*2+1];
SQL->EscapeStringLen(map->mysql_handle, tmp_str, name, strnlen(name, SCRIPT_VARNAME_LENGTH+1));
SQL->EscapeStringLen(map->mysql_handle, tmp_str2, str, strnlen(str, 255));
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%d','%s')", mapreg->table, tmp_str, i, tmp_str2) )
+ if( SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s`(`varname`,`index`,`value`) VALUES ('%s','%u','%s')", mapreg->table, tmp_str, i, tmp_str2) )
Sql_ShowDebug(map->mysql_handle);
}
i64db_put(mapreg->regs.vars, uid, m);
@@ -190,7 +195,7 @@ void script_load_mapreg(void) {
| varname | index | value |
+-------------------------+
*/
- SqlStmt* stmt = SQL->StmtMalloc(map->mysql_handle);
+ struct SqlStmt *stmt = SQL->StmtMalloc(map->mysql_handle);
char varname[SCRIPT_VARNAME_LENGTH+1];
int index;
char value[255+1];
@@ -236,15 +241,17 @@ void script_load_mapreg(void) {
/**
* Saves permanent variables to database.
*/
-void script_save_mapreg(void) {
+void script_save_mapreg(void)
+{
if (mapreg->dirty) {
- DBIterator *iter = db_iterator(mapreg->regs.vars);
- struct mapreg_save *m;
+ struct DBIterator *iter = db_iterator(mapreg->regs.vars);
+ struct mapreg_save *m = NULL;
for (m = dbi_first(iter); dbi_exists(iter); m = dbi_next(iter)) {
if (m->save) {
int num = script_getvarid(m->uid);
int i = script_getvaridx(m->uid);
const char* name = script->get_str(num);
+ nullpo_retv(name);
if (!m->is_string) {
if( SQL_ERROR == SQL->Query(map->mysql_handle, "UPDATE `%s` SET `value`='%d' WHERE `varname`='%s' AND `index`='%d' LIMIT 1", mapreg->table, m->u.i, name, i) )
Sql_ShowDebug(map->mysql_handle);
@@ -277,7 +284,8 @@ int script_autosave_mapreg(int tid, int64 tick, int id, intptr_t data) {
*
* @see DBApply
*/
-int mapreg_destroyreg(DBKey key, DBData *data, va_list ap) {
+int mapreg_destroyreg(union DBKey key, struct DBData *data, va_list ap)
+{
struct mapreg_save *m = NULL;
if (data->type != DB_DATA_PTR) // Sanity check
@@ -342,11 +350,19 @@ void mapreg_init(void) {
/**
* Loads the mapreg configuration file.
+ *
+ * @param filename Path to configuration file (used in error and warning messages).
+ * @param config The current config being parsed.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
*/
-bool mapreg_config_read(const char* w1, const char* w2) {
- if(!strcmpi(w1, "mapreg_db"))
- safestrncpy(mapreg->table, w2, sizeof(mapreg->table));
- else
+bool mapreg_config_read(const char *filename, const struct config_setting_t *config, bool imported)
+{
+ nullpo_retr(false, filename);
+ nullpo_retr(false, config);
+
+ if (libconfig->setting_lookup_mutable_string(config, "mapreg_db", mapreg->table, sizeof(mapreg->table)) != CONFIG_TRUE)
return false;
return true;
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index e6c911ef6..f5d3fe11c 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -66,19 +66,23 @@ int merc_search_index(int class_)
{
int i;
ARR_FIND(0, MAX_MERCENARY_CLASS, i, mercenary->db[i].class_ == class_);
- return (i == MAX_MERCENARY_CLASS)?-1:i;
+ if (i == MAX_MERCENARY_CLASS)
+ return INDEX_NOT_FOUND;
+ return i;
}
bool merc_class(int class_)
{
- return (bool)(mercenary->search_index(class_) > -1);
+ if (mercenary->search_index(class_) != INDEX_NOT_FOUND)
+ return true;
+ return false;
}
struct view_data * merc_get_viewdata(int class_)
{
int i = mercenary->search_index(class_);
- if( i < 0 )
- return 0;
+ if (i == INDEX_NOT_FOUND)
+ return NULL;
return &mercenary->db[i].vd;
}
@@ -90,7 +94,7 @@ int merc_create(struct map_session_data *sd, int class_, unsigned int lifetime)
int i;
nullpo_retr(0,sd);
- if( (i = mercenary->search_index(class_)) < 0 )
+ if ((i = mercenary->search_index(class_)) == INDEX_NOT_FOUND)
return 0;
db = &mercenary->db[i];
@@ -230,6 +234,7 @@ int mercenary_set_calls(struct mercenary_data *md, int value)
int mercenary_save(struct mercenary_data *md)
{
+ nullpo_retr(1, md);
md->mercenary.hp = md->battle_status.hp;
md->mercenary.sp = md->battle_status.sp;
md->mercenary.life_time = mercenary->get_lifetime(md);
@@ -261,7 +266,10 @@ int merc_contract_end_timer(int tid, int64 tick, int id, intptr_t data) {
int merc_delete(struct mercenary_data *md, int reply)
{
- struct map_session_data *sd = md->master;
+ struct map_session_data *sd;
+
+ nullpo_retr(0, md);
+ sd = md->master;
md->mercenary.life_time = 0;
mercenary->contract_stop(md);
@@ -295,22 +303,26 @@ void merc_contract_stop(struct mercenary_data *md)
void merc_contract_init(struct mercenary_data *md)
{
+ nullpo_retv(md);
if( md->contract_timer == INVALID_TIMER )
md->contract_timer = timer->add(timer->gettick() + md->mercenary.life_time, mercenary->contract_end_timer, md->master->bl.id, 0);
md->regen.state.block = 0;
}
-int merc_data_received(struct s_mercenary *merc, bool flag) {
+int merc_data_received(const struct s_mercenary *merc, bool flag)
+{
struct map_session_data *sd;
struct mercenary_data *md;
struct s_mercenary_db *db;
- int i = mercenary->search_index(merc->class_);
+ int i;
+ nullpo_ret(merc);
+ i = mercenary->search_index(merc->class_);
if( (sd = map->charid2sd(merc->char_id)) == NULL )
return 0;
- if( !flag || i < 0 )
- { // Not created - loaded - DB info
+ if (!flag || i == INDEX_NOT_FOUND) {
+ // Not created - loaded - DB info
sd->status.mer_id = 0;
return 0;
}
@@ -365,6 +377,7 @@ int merc_data_received(struct s_mercenary *merc, bool flag) {
void mercenary_heal(struct mercenary_data *md, int hp, int sp)
{
+ nullpo_retv(md);
if( hp )
clif->mercenary_updatestatus(md->master, SP_HP);
if( sp )
@@ -382,12 +395,14 @@ int mercenary_killbonus(struct mercenary_data *md)
const enum sc_type scs[] = { SC_MER_FLEE, SC_MER_ATK, SC_MER_HP, SC_MER_SP, SC_MER_HIT };
int index = rnd() % ARRAYLENGTH(scs);
+ nullpo_ret(md);
sc_start(NULL,&md->bl, scs[index], 100, rnd() % 5, 600000);
return 0;
}
int mercenary_kills(struct mercenary_data *md)
{
+ nullpo_ret(md);
md->mercenary.kill_count++;
md->mercenary.kill_count = cap_value(md->mercenary.kill_count, 0, INT_MAX);
@@ -420,6 +435,8 @@ bool read_mercenarydb_sub(char* str[], int columns, int current) {
struct s_mercenary_db *db;
struct status_data *mstatus;
+ nullpo_retr(false, str);
+ Assert_retr(false, current >= 0 && current < MAX_MERCENARY_CLASS);
db = &mercenary->db[current];
db->class_ = atoi(str[0]);
safestrncpy(db->sprite, str[1], NAME_LENGTH);
@@ -427,7 +444,7 @@ bool read_mercenarydb_sub(char* str[], int columns, int current) {
db->lv = atoi(str[3]);
mstatus = &db->status;
- db->vd.class_ = db->class_;
+ db->vd.class = db->class_;
mstatus->max_hp = atoi(str[4]);
mstatus->max_sp = atoi(str[5]);
@@ -481,6 +498,7 @@ bool read_mercenary_skilldb_sub(char* str[], int columns, int current)
int i, class_;
uint16 skill_id, skill_lv;
+ nullpo_retr(false, str);
class_ = atoi(str[0]);
ARR_FIND(0, MAX_MERCENARY_CLASS, i, class_ == mercenary->db[i].class_);
if( i == MAX_MERCENARY_CLASS )
diff --git a/src/map/mercenary.h b/src/map/mercenary.h
index 1b3453a84..0af75e8a2 100644
--- a/src/map/mercenary.h
+++ b/src/map/mercenary.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -120,7 +120,7 @@ struct mercenary_interface {
struct view_data * (*get_viewdata) (int class_);
int (*create) (struct map_session_data *sd, int class_, unsigned int lifetime);
- int (*data_received) (struct s_mercenary *merc, bool flag);
+ int (*data_received) (const struct s_mercenary *merc, bool flag);
int (*save) (struct mercenary_data *md);
void (*heal) (struct mercenary_data *md, int hp, int sp);
diff --git a/src/map/mob.c b/src/map/mob.c
index bc78c6098..52705cf4d 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -46,6 +46,7 @@
#include "map/status.h"
#include "common/HPM.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/db.h"
#include "common/ers.h"
#include "common/memmgr.h"
@@ -113,6 +114,8 @@ struct mob_chat *mob_chat(short id) {
int mobdb_searchname(const char *str)
{
int i;
+
+ nullpo_ret(str);
for(i=0;i<=MAX_MOB_DB;i++){
struct mob_db *monster = mob->db(i);
if(monster == mob->dummy) //Skip dummy mobs.
@@ -128,10 +131,13 @@ int mobdb_searchname(const char *str)
return 0;
}
int mobdb_searchname_array_sub(struct mob_db* monster, const char *str, int flag) {
+
+ nullpo_ret(monster);
if (monster == mob->dummy)
return 1;
if(!monster->base_exp && !monster->job_exp && monster->spawn[0].qty < 1)
return 1; // Monsters with no base/job exp and no spawn point are, by this criteria, considered "slave mobs" and excluded from search results
+ nullpo_ret(str);
if( !flag ) {
if(stristr(monster->jname,str))
return 0;
@@ -155,6 +161,7 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time)
{
struct npc_data *nd;
+ nullpo_retv(md);
if ( md->tomb_nid )
mob->mvptomb_destroy(md);
@@ -180,6 +187,7 @@ void mvptomb_create(struct mob_data *md, char *killer, time_t time)
void mvptomb_destroy(struct mob_data *md) {
struct npc_data *nd;
+ nullpo_retv(md);
if ( (nd = map->id2nd(md->tomb_nid)) ) {
int16 m, i;
@@ -211,6 +219,7 @@ int mobdb_searchname_array(struct mob_db** data, int size, const char *str, int
{
int count = 0, i;
struct mob_db* monster;
+ nullpo_ret(data);
for(i=0;i<=MAX_MOB_DB;i++){
monster = mob->db(i);
if (monster == mob->dummy || mob->is_clone(i) ) //keep clones out (or you leak player stats)
@@ -252,6 +261,7 @@ int mob_parse_dataset(struct spawn_data *data)
{
size_t len;
+ nullpo_ret(data);
if ((!mob->db_checkid(data->class_) && !mob->is_clone(data->class_)) || !data->num)
return 0;
@@ -275,6 +285,7 @@ int mob_parse_dataset(struct spawn_data *data)
*------------------------------------------*/
struct mob_data* mob_spawn_dataset(struct spawn_data *data) {
struct mob_data *md = NULL;
+ nullpo_retr(NULL, data);
CREATE(md, struct mob_data, 1);
md->bl.id= npc->get_new_npc_id();
md->bl.type = BL_MOB;
@@ -327,6 +338,7 @@ int mob_get_random_id(int type, int flag, int lv)
ShowError("mob_get_random_id: Invalid type (%d) of random monster.\n", type);
return 0;
}
+ Assert_ret(type >= 0 && type < MAX_RANDOMMONSTER);
do {
if (type)
class_ = summon[type].class_[rnd()%summon[type].qty];
@@ -409,7 +421,7 @@ bool mob_ksprotected(struct block_list *src, struct block_list *target) {
if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 )
{
sprintf(output, "[KS Warning!! - Owner : %s]", pl_sd->status.name);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
sd->ks_floodprotect_tick = tick + 2000;
}
@@ -418,7 +430,7 @@ bool mob_ksprotected(struct block_list *src, struct block_list *target) {
if( DIFF_TICK(pl_sd->ks_floodprotect_tick, tick) <= 0 )
{
sprintf(output, "[Watch out! %s is trying to KS you!]", sd->status.name);
- clif_disp_onlyself(pl_sd, output, strlen(output));
+ clif_disp_onlyself(pl_sd, output);
pl_sd->ks_floodprotect_tick = tick + 2000;
}
@@ -633,6 +645,11 @@ int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobnam
struct guild *g=NULL;
struct guild_castle *gc;
int16 m;
+
+ nullpo_ret(mapname);
+ nullpo_ret(mobname);
+ nullpo_ret(event);
+
memset(&data, 0, sizeof(struct spawn_data));
data.num = 1;
@@ -727,6 +744,10 @@ int mob_spawn_bg(const char* mapname, short x, short y, const char* mobname, int
struct spawn_data data;
int16 m;
+ nullpo_ret(mapname);
+ nullpo_ret(mobname);
+ nullpo_ret(event);
+
if( (m = map->mapname2mapid(mapname)) < 0 ) {
ShowWarning("mob_spawn_bg: Map [%s] not found.\n", mapname);
return 0;
@@ -743,7 +764,7 @@ int mob_spawn_bg(const char* mapname, short x, short y, const char* mobname, int
data.class_ = class_;
if( (x <= 0 || y <= 0) && !map->search_freecell(NULL, m, &x, &y, -1,-1, 1) ) {
- ShowWarning("mob_spawn_bg: Couldn't locate a spawn cell for guardian class %d (bg_id %d) at map %s\n",class_, bg_id, map->list[m].name);
+ ShowWarning("mob_spawn_bg: Couldn't locate a spawn cell for guardian class %d (bg_id %u) at map %s\n", class_, bg_id, map->list[m].name);
return 0;
}
@@ -841,9 +862,12 @@ int mob_delayspawn(int tid, int64 tick, int id, intptr_t data) {
*------------------------------------------*/
int mob_setdelayspawn(struct mob_data *md)
{
- unsigned int spawntime, mode;
+ unsigned int spawntime;
+ uint32 mode;
struct mob_db *db;
+ nullpo_ret(md);
+
if (!md->spawn) //Doesn't has respawn data!
return unit->free(&md->bl,CLR_DEAD);
@@ -901,6 +925,7 @@ int mob_spawn (struct mob_data *md)
int64 tick = timer->gettick();
int64 c = 0;
+ nullpo_retr(1, md);
md->last_thinktime = tick;
if (md->bl.prev != NULL)
unit->remove_map(&md->bl,CLR_RESPAWN,ALC_MARK);
@@ -988,8 +1013,10 @@ int mob_spawn (struct mob_data *md)
/*==========================================
* Determines if the mob can change target. [Skotlex]
*------------------------------------------*/
-int mob_can_changetarget(struct mob_data* md, struct block_list* target, int mode)
+int mob_can_changetarget(const struct mob_data *md, const struct block_list *target, uint32 mode)
{
+ nullpo_ret(md);
+ nullpo_ret(target);
// if the monster was provoked ignore the above rule [celest]
if(md->state.provoke_flag)
{
@@ -1005,7 +1032,7 @@ int mob_can_changetarget(struct mob_data* md, struct block_list* target, int mod
return 0;
return (battle_config.mob_ai&0x4 || check_distance_bl(&md->bl, target, 3));
case MSS_RUSH:
- return (mode&MD_CHANGETARGET_CHASE);
+ return (mode&MD_CHANGETARGET_CHASE) ? 1 : 0;
case MSS_FOLLOW:
case MSS_ANGRY:
case MSS_IDLE:
@@ -1044,17 +1071,19 @@ int mob_target(struct mob_data *md,struct block_list *bl,int dist)
/*==========================================
* The ?? routine of an active monster
*------------------------------------------*/
-int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
+int mob_ai_sub_hard_activesearch(struct block_list *bl, va_list ap)
{
struct mob_data *md;
struct block_list **target;
- int mode;
+ uint32 mode;
int dist;
nullpo_ret(bl);
md=va_arg(ap,struct mob_data *);
target= va_arg(ap,struct block_list**);
- mode= va_arg(ap,int);
+ mode = va_arg(ap, uint32);
+ nullpo_ret(md);
+ nullpo_ret(target);
//If can't seek yet, not an enemy, or you can't attack it, skip.
if (md->bl.id == bl->id || (*target) == bl || !status->check_skilluse(&md->bl, bl, 0, 0))
@@ -1070,6 +1099,7 @@ int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
case BL_PC:
if (BL_UCCAST(BL_PC, bl)->state.gangsterparadise && !(status_get_mode(&md->bl)&MD_BOSS))
return 0; //Gangster paradise protection.
+ FALLTHROUGH
default:
if (battle_config.hom_setting&0x4 &&
(*target) && (*target)->type == BL_HOM && bl->type != BL_HOM)
@@ -1109,8 +1139,10 @@ int mob_ai_sub_hard_changechase(struct block_list *bl,va_list ap) {
struct block_list **target;
nullpo_ret(bl);
- md=va_arg(ap,struct mob_data *);
- target= va_arg(ap,struct block_list**);
+ md = va_arg(ap,struct mob_data *);
+ target = va_arg(ap,struct block_list**);
+ nullpo_ret(md);
+ nullpo_ret(target);
//If can't seek yet, not an enemy, or you can't attack it, skip.
if( md->bl.id == bl->id || *target == bl
@@ -1137,6 +1169,8 @@ int mob_ai_sub_hard_bg_ally(struct block_list *bl,va_list ap) {
nullpo_ret(bl);
md=va_arg(ap,struct mob_data *);
target= va_arg(ap,struct block_list**);
+ nullpo_retr(1, md);
+ nullpo_retr(1, target);
if( status->check_skilluse(&md->bl, bl, 0, 0) && battle->check_target(&md->bl,bl,BCT_ENEMY)<=0 ) {
(*target) = bl;
@@ -1155,6 +1189,8 @@ int mob_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
md=va_arg(ap,struct mob_data *);
target= va_arg(ap,struct block_list**);
+ nullpo_ret(md);
+ nullpo_ret(target);
dist=distance_bl(&md->bl, bl);
if(mob->can_reach(md,bl,dist+1, MSS_LOOT) &&
@@ -1175,6 +1211,9 @@ int mob_warpchase_sub(struct block_list *bl,va_list ap) {
struct npc_data *nd = NULL;
nullpo_ret(bl);
+ nullpo_ret(target);
+ nullpo_ret(target_nd);
+ nullpo_ret(min_distance);
Assert_ret(bl->type == BL_NPC);
nd = BL_UCAST(BL_NPC, bl);
@@ -1199,6 +1238,7 @@ int mob_warpchase_sub(struct block_list *bl,va_list ap) {
int mob_ai_sub_hard_slavemob(struct mob_data *md, int64 tick) {
struct block_list *bl;
+ nullpo_ret(md);
bl=map->id2bl(md->master_id);
if (!bl || status->isdead(bl)) {
@@ -1287,6 +1327,7 @@ int mob_unlocktarget(struct mob_data *md, int64 tick) {
break;
//Because it is not unset when the mob finishes walking.
md->state.skillstate = MSS_IDLE;
+ FALLTHROUGH
case MSS_IDLE:
// Idle skill.
if (!(++md->ud.walk_count%IDLE_SKILL_INTERVAL) && mob->skill_use(md, tick, -1))
@@ -1376,6 +1417,7 @@ int mob_warpchase(struct mob_data *md, struct block_list *target)
{
struct npc_data *warp = NULL;
int distance = AREA_SIZE;
+ nullpo_ret(md);
if (!(target && battle_config.mob_ai&0x40 && battle_config.mob_warp&1))
return 0; //Can't warp chase.
@@ -1400,9 +1442,10 @@ int mob_warpchase(struct mob_data *md, struct block_list *target)
*------------------------------------------*/
bool mob_ai_sub_hard(struct mob_data *md, int64 tick) {
struct block_list *tbl = NULL, *abl = NULL;
- int mode;
+ uint32 mode;
int view_range, can_move;
+ nullpo_retr(false, md);
if(md->bl.prev == NULL || md->status.hp <= 0)
return false;
@@ -1541,7 +1584,7 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) {
}
if ((!tbl && mode&MD_AGGRESSIVE) || md->state.skillstate == MSS_FOLLOW) {
- map->foreachinrange (mob->ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl, mode);
+ map->foreachinrange(mob->ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl, mode);
} else if ((mode&MD_CHANGECHASE && (md->state.skillstate == MSS_RUSH || md->state.skillstate == MSS_FOLLOW)) || (md->sc.count && md->sc.data[SC__CHAOS])) {
int search_size;
search_size = view_range<md->status.rhw.range ? view_range:md->status.rhw.range;
@@ -1609,7 +1652,7 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) {
memmove(&md->lootitem[0], &md->lootitem[1], (LOOTITEM_SIZE-1)*sizeof(md->lootitem[0]));
memcpy (&md->lootitem[LOOTITEM_SIZE-1], &fitem->item_data, sizeof(md->lootitem[0]));
}
- if (pc->db_checkid(md->vd->class_)) {
+ if (pc->db_checkid(md->vd->class)) {
//Give them walk act/delay to properly mimic players. [Skotlex]
clif->takeitem(&md->bl,tbl);
md->ud.canact_tick = tick + md->status.amotion;
@@ -1700,6 +1743,7 @@ int mob_ai_sub_hard_timer(struct block_list *bl, va_list ap)
*------------------------------------------*/
int mob_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int64 tick;
+ nullpo_ret(sd);
tick=va_arg(ap, int64);
map->foreachinrange(mob->ai_sub_hard_timer,&sd->bl, AREA_SIZE+ACTIVE_AI_RANGE, BL_MOB,tick);
@@ -1808,7 +1852,10 @@ struct item_drop* mob_setdropitem(int nameid, int qty, struct item_data *data) {
*------------------------------------------*/
struct item_drop* mob_setlootitem(struct item* item)
{
- struct item_drop *drop = ers_alloc(item_drop_ers, struct item_drop);
+ struct item_drop *drop ;
+
+ nullpo_retr(NULL, item);
+ drop = ers_alloc(item_drop_ers, struct item_drop);
memcpy(&drop->item_data, item, sizeof(struct item));
drop->next = NULL;
return drop;
@@ -1845,6 +1892,9 @@ void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct ite
{
struct map_session_data *sd = NULL;
+ nullpo_retv(md);
+ nullpo_retv(dlist);
+ nullpo_retv(ditem);
//Logs items, dropped by mobs [Lupus]
logs->pick_mob(md, loot?LOG_TYPE_LOOT:LOG_TYPE_PICKDROP_MONSTER, -ditem->item_data.amount, &ditem->item_data, NULL);
@@ -1930,6 +1980,9 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
{
int char_id = 0, flag = MDLF_NORMAL;
+ nullpo_retv(md);
+ nullpo_retv(src);
+
if( damage < 0 )
return; //Do nothing for absorbed damage.
if( !damage && !(src->type&DEFAULT_ENEMY_TYPE(md)) )
@@ -2040,6 +2093,7 @@ void mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
}
//Call when a mob has received damage.
void mob_damage(struct mob_data *md, struct block_list *src, int damage) {
+ nullpo_retv(md);
if (damage > 0) { //Store total damage...
if (UINT_MAX - (unsigned int)damage > md->tdmg)
md->tdmg+=damage;
@@ -2097,18 +2151,21 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
struct map_session_data *sd = BL_CAST(BL_PC, src);
struct map_session_data *tmpsd[DAMAGELOG_SIZE] = { NULL };
struct map_session_data *mvp_sd = sd, *second_sd = NULL, *third_sd = NULL;
+ struct item_data *id = NULL;
struct {
struct party_data *p;
int id,zeny;
unsigned int base_exp,job_exp;
} pt[DAMAGELOG_SIZE] = { { 0 } };
- int i, temp, count, m = md->bl.m;
+ int i, temp, count, m;
int dmgbltypes = 0; // bitfield of all bl types, that caused damage to the mob and are eligible for exp distribution
unsigned int mvp_damage;
int64 tick = timer->gettick();
bool rebirth, homkillonly;
+ nullpo_retr(3, md);
+ m = md->bl.m;
mstatus = &md->status;
if( md->guardian_data && md->guardian_data->number >= 0 && md->guardian_data->number < MAX_GUARDIANS )
@@ -2283,11 +2340,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
if(flag) {
if(base_exp || job_exp) {
if( md->dmglog[i].flag != MDLF_PET || battle_config.pet_attack_exp_to_master ) {
-#ifdef RENEWAL_EXP
- int rate = pc->level_penalty_mod(md->level - (tmpsd[i])->status.base_level, md->status.race, md->status.mode, 1);
- base_exp = (unsigned int)cap_value(base_exp * rate / 100, 1, UINT_MAX);
- job_exp = (unsigned int)cap_value(job_exp * rate / 100, 1, UINT_MAX);
-#endif
pc->gainexp(tmpsd[i], &md->bl, base_exp, job_exp, false);
}
}
@@ -2356,7 +2408,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
drop_rate += (int)(0.5+drop_rate*status_get_luk(src)*battle_config.drops_by_luk2/10000.);
}
if (sd && battle_config.pk_mode &&
- (int)(md->level - sd->status.base_level) >= 20)
+ md->level - sd->status.base_level >= 20)
drop_rate = (int)(drop_rate*1.25); // pk_mode increase drops if 20 level difference [Valaris]
// Increase drop rate if user has SC_CASH_RECEIVEITEM
@@ -2388,21 +2440,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
ditem = mob->setdropitem(md->db->dropitem[i].nameid, 1, it);
- //A Rare Drop Global Announce by Lupus
- if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) {
- char message[128];
- sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100);
- //MSG: "'%s' won %s's %s (chance: %0.02f%%)"
- intif->broadcast(message, strlen(message)+1, BC_DEFAULT);
+ // Official Drop Announce [Jedzkie]
+ if (mvp_sd != NULL) {
+ if ((id = itemdb->search(it->nameid)) != NULL && id->flag.drop_announce) {
+ clif->item_drop_announce(mvp_sd, it->nameid, md->name);
+ }
}
- /* heres the thing we got the feature set up however we're still discussing how to best define the ids,
- * so while we discuss, for a small period of time, the list is hardcoded (yes officially only those 2 use it,
- * thus why we're unsure on how to best place the setting) */
- /* temp, will not be hardcoded for long thudu. */
- if (it->nameid == ITEMID_GOLD_KEY77 || it->nameid == ITEMID_SILVER_KEY77) /* for when not hardcoded: add a check on mvp bonus drop as well */
- clif->item_drop_announce(mvp_sd, it->nameid, md->name);
-
// Announce first, or else ditem will be freed. [Lance]
// By popular demand, use base drop rate for autoloot code. [Skotlex]
mob->item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, homkillonly);
@@ -2500,60 +2544,54 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
pc->gainexp(mvp_sd, &md->bl, mexp,0, false);
log_mvp[1] = mexp;
- if( !(map->list[m].flag.nomvploot || type&1) ) {
+ if (!(map->list[m].flag.nomvploot || type&1)) {
/* pose them randomly in the list -- so on 100% drop servers it wont always drop the same item */
- int mdrop_id[MAX_MVP_DROP];
- int mdrop_p[MAX_MVP_DROP];
- struct item item;
-
- memset(&mdrop_id,0,MAX_MVP_DROP*sizeof(int));
-
- for(i = 0; i < MAX_MVP_DROP; i++) {
- while( 1 ) {
- int va = rnd()%MAX_MVP_DROP;
- if( !mdrop_id[va] || !md->db->mvpitem[i].nameid ) {
- mdrop_id[va] = md->db->mvpitem[i].nameid;
- mdrop_p[va] = md->db->mvpitem[i].p;
- break;
- }
- }
+ struct {
+ int nameid;
+ int p;
+ } mdrop[MAX_MVP_DROP] = { { 0 } };
+
+ for (i = 0; i < MAX_MVP_DROP; i++) {
+ int rpos;
+ if (md->db->mvpitem[i].nameid == 0)
+ continue;
+ do {
+ rpos = rnd()%MAX_MVP_DROP;
+ } while (mdrop[rpos].nameid != 0);
+
+ mdrop[rpos].nameid = md->db->mvpitem[i].nameid;
+ mdrop[rpos].p = md->db->mvpitem[i].p;
}
- for(i = 0; i < MAX_MVP_DROP; i++) {
- struct item_data *data;
- if(mdrop_id[i] <= 0)
+ for (i = 0; i < MAX_MVP_DROP; i++) {
+ struct item_data *data = NULL;
+ int rate = 0;
+
+ if (mdrop[i].nameid <= 0)
continue;
- if(! (data = itemdb->exists(mdrop_id[i])) )
+ if ((data = itemdb->exists(mdrop[i].nameid)) == NULL)
continue;
- temp = mdrop_p[i];
- if(temp <= 0 && !battle_config.drop_rate0item)
- temp = 1;
- if(temp <= rnd()%10000+1) //if ==0, then it doesn't drop
- continue;
+ rate = mdrop[i].p;
+ if (rate <= 0 && !battle_config.drop_rate0item)
+ rate = 1;
+ if (rate > rnd()%10000) {
+ struct item item = { 0 };
- memset(&item,0,sizeof(item));
- item.nameid=mdrop_id[i];
- item.identify= itemdb->isidentified2(data);
- clif->mvp_item(mvp_sd,item.nameid);
- log_mvp[0] = item.nameid;
-
- //A Rare MVP Drop Global Announce by Lupus
- if(temp<=battle_config.rare_drop_announce) {
- char message[128];
- sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, data->jname, temp/100.);
- //MSG: "'%s' won %s's %s (chance: %0.02f%%)"
- intif->broadcast(message, strlen(message)+1, BC_DEFAULT);
- }
+ item.nameid = mdrop[i].nameid;
+ item.identify = itemdb->isidentified2(data);
+ clif->mvp_item(mvp_sd, item.nameid);
+ log_mvp[0] = item.nameid;
- if((temp = pc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
- clif->additem(mvp_sd,0,0,temp);
- map->addflooritem(&md->bl, &item, 1, mvp_sd->bl.m, mvp_sd->bl.x, mvp_sd->bl.y, mvp_sd->status.char_id, (second_sd?second_sd->status.char_id : 0), (third_sd ? third_sd->status.char_id : 0), 1);
- }
+ if((temp = pc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
+ clif->additem(mvp_sd,0,0,temp);
+ map->addflooritem(&md->bl, &item, 1, mvp_sd->bl.m, mvp_sd->bl.x, mvp_sd->bl.y, mvp_sd->status.char_id, (second_sd?second_sd->status.char_id : 0), (third_sd ? third_sd->status.char_id : 0), 1);
+ }
- //Logs items, MVP prizes [Lupus]
- logs->pick_mob(md, LOG_TYPE_MVP, -1, &item, data);
- break;
+ //Logs items, MVP prizes [Lupus]
+ logs->pick_mob(md, LOG_TYPE_MVP, -1, &item, data);
+ break;
+ }
}
}
@@ -2580,7 +2618,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
if( sd ) {
if( sd->mission_mobid == md->class_) { //TK_MISSION [Skotlex]
if (++sd->mission_count >= 100 && (temp = mob->get_random_id(0, 0xE, sd->status.base_level)) != 0) {
- pc->addfame(sd, 1);
+ pc->addfame(sd, RANKTYPE_TAEKWON, 1);
sd->mission_mobid = temp;
pc_setglobalreg(sd,script->add_str("TK_MISSION_ID"), temp);
sd->mission_count = 0;
@@ -2629,7 +2667,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
if( !rebirth ) {
- if( pc->db_checkid(md->vd->class_) ) {//Player mobs are not removed automatically by the client.
+ if (pc->db_checkid(md->vd->class)) {
+ // Player mobs are not removed automatically by the client.
/* first we set them dead, then we delay the out sight effect */
clif->clearunit_area(&md->bl,CLR_DEAD);
clif->clearunit_delayed(&md->bl, CLR_OUTSIGHT,tick+3000);
@@ -2659,6 +2698,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
void mob_revive(struct mob_data *md, unsigned int hp)
{
int64 tick = timer->gettick();
+
+ nullpo_retv(md);
md->state.skillstate = MSS_IDLE;
md->last_thinktime = tick;
md->next_walktime = tick+rnd()%1000+MIN_RANDOMWALKTIME;
@@ -2774,7 +2815,7 @@ int mob_class_change (struct mob_data *md, int class_) {
mob_stop_walking(md, STOPWALKING_FLAG_NONE);
unit->skillcastcancel(&md->bl, 0);
status->set_viewdata(&md->bl, class_);
- clif->class_change(&md->bl, md->vd->class_, 1);
+ clif->class_change(&md->bl, md->vd->class, 1, NULL);
status_calc_mob(md, SCO_FIRST);
md->ud.state.speed_changed = 1; //Speed change update.
@@ -2806,6 +2847,7 @@ int mob_class_change (struct mob_data *md, int class_) {
*------------------------------------------*/
void mob_heal(struct mob_data *md, unsigned int heal)
{
+ nullpo_retv(md);
if (battle_config.show_mob_info&3)
clif->charnameack (0, &md->bl);
#if PACKETVER >= 20131223
@@ -2840,6 +2882,7 @@ int mob_warpslave_sub(struct block_list *bl, va_list ap)
range = va_arg(ap, int);
nullpo_ret(bl);
+ nullpo_ret(master);
Assert_ret(bl->type == BL_MOB);
md = BL_UCAST(BL_MOB, bl);
@@ -2857,6 +2900,7 @@ int mob_warpslave_sub(struct block_list *bl, va_list ap)
* appear in randomly.
*------------------------------------------*/
int mob_warpslave(struct block_list *bl, int range) {
+ nullpo_ret(bl);
if (range < 1)
range = 1; //Min range needed to avoid crashes and stuff. [Skotlex]
@@ -2884,6 +2928,7 @@ int mob_countslave_sub(struct block_list *bl, va_list ap)
* Counts the number of slaves a mob has on the map.
*------------------------------------------*/
int mob_countslave(struct block_list *bl) {
+ nullpo_ret(bl);
return map->foreachinmap(mob->countslave_sub, bl->m, BL_MOB,bl->id);
}
@@ -2986,18 +3031,20 @@ int mob_summonslave(struct mob_data *md2,int *value,int amount,uint16 skill_id)
/*==========================================
* MOBskill lookup (get skillindex through skill_id)
- * Returns -1 if not found.
+ * Returns INDEX_NOT_FOUND if not found.
*------------------------------------------*/
int mob_skill_id2skill_idx(int class_,uint16 skill_id)
{
int i, max = mob->db(class_)->maxskill;
struct mob_skill *ms=mob->db(class_)->skill;
- if(ms==NULL)
- return -1;
+ if (ms == NULL)
+ return INDEX_NOT_FOUND;
- ARR_FIND( 0, max, i, ms[i].skill_id == skill_id );
- return ( i < max ) ? i : -1;
+ ARR_FIND(0, max, i, ms[i].skill_id == skill_id);
+ if (i == max)
+ return INDEX_NOT_FOUND;
+ return i;
}
/*==========================================
@@ -3010,6 +3057,8 @@ int mob_getfriendhprate_sub(struct block_list *bl,va_list ap)
struct mob_data *md;
md = va_arg(ap,struct mob_data *);
+ nullpo_ret(bl);
+ nullpo_ret(md);
min_rate=va_arg(ap,int);
max_rate=va_arg(ap,int);
fr=va_arg(ap,struct block_list **);
@@ -3226,6 +3275,7 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) {
bl = map->id2bl(md->master_id);
if (bl) //Otherwise, fall through.
break;
+ FALLTHROUGH
case MST_FRIEND:
bl = fbl?fbl:(fmd?&fmd->bl:&md->bl);
break;
@@ -3268,6 +3318,7 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) {
bl = map->id2bl(md->master_id);
if (bl) //Otherwise, fall through.
break;
+ FALLTHROUGH
case MST_FRIEND:
if (fbl) {
bl = fbl;
@@ -3276,6 +3327,7 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) {
bl = &fmd->bl;
break;
} // else fall through
+ FALLTHROUGH
default:
bl = &md->bl;
break;
@@ -3320,6 +3372,8 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) {
int mobskill_event(struct mob_data *md, struct block_list *src, int64 tick, int flag) {
int target_id, res = 0;
+ nullpo_ret(md);
+ nullpo_ret(src);
if(md->bl.prev == NULL || md->status.hp <= 0)
return 0;
@@ -3366,7 +3420,8 @@ int mob_is_clone(int class_)
//If mode is not passed, a default aggressive mode is used.
//If master_id is passed, clone is attached to him.
//Returns: ID of newly crafted copy.
-int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, int mode, int flag, unsigned int duration) {
+int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, uint32 mode, int flag, unsigned int duration)
+{
int class_;
int i,j,h,inf, fd;
struct mob_data *md;
@@ -3380,7 +3435,7 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
return 0;
ARR_FIND( MOB_CLONE_START, MOB_CLONE_END, class_, mob->db_data[class_] == NULL );
- if(class_ >= MOB_CLONE_END)
+ if(class_ < 0 || class_ >= MOB_CLONE_END)
return 0;
db = mob->db_data[class_]=(struct mob_db*)aCalloc(1, sizeof(struct mob_db));
@@ -3396,7 +3451,7 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
mstatus->lhw.atk2= mstatus->dex + mstatus->lhw.atk + mstatus->lhw.atk2; //Max ATK
mstatus->lhw.atk = mstatus->dex; //Min ATK
}
- if (mode) //User provided mode.
+ if (mode != MD_NONE) //User provided mode.
mstatus->mode = mode;
else if (flag&1) //Friendly Character, remove looting.
mstatus->mode &= ~MD_LOOTER;
@@ -3420,8 +3475,8 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
//Go Backwards to give better priority to advanced skills.
for (i=0,j = MAX_SKILL_TREE-1;j>=0 && i< MAX_MOBSKILL ;j--) {
- int idx = pc->skill_tree[pc->class2idx(sd->status.class_)][j].idx;
- int skill_id = pc->skill_tree[pc->class2idx(sd->status.class_)][j].id;
+ int idx = pc->skill_tree[pc->class2idx(sd->status.class)][j].idx;
+ int skill_id = pc->skill_tree[pc->class2idx(sd->status.class)][j].id;
if (!skill_id || sd->status.skill[idx].lv < 1 ||
(skill->dbs->db[idx].inf2&(INF2_WEDDING_SKILL|INF2_GUILD_SKILL))
)
@@ -3570,7 +3625,10 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
int mob_clone_delete(struct mob_data *md)
{
- const int class_ = md->class_;
+ int class_;
+
+ nullpo_ret(md);
+ class_ = md->class_;
if (class_ >= MOB_CLONE_START && class_ < MOB_CLONE_END
&& mob->db_data[class_]!=NULL) {
mob->destroy_mob_db(class_);
@@ -3634,13 +3692,19 @@ unsigned int mob_drop_adjust(int baserate, int rate_adjust, unsigned short rate_
{
int64 rate = baserate;
- if (battle_config.logarithmic_drops && rate_adjust > 0 && rate_adjust != 100 && baserate > 0) //Logarithmic drops equation by Ishizu-Chan
- //Equation: Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5))
- //x is the normal Droprate, y is the Modificator.
- rate = rate * pow((5.0 - log10(rate)), (log(rate_adjust/100.) / log(5.0))) + 0.5;
- else
- //Classical linear rate adjustment.
- rate = apply_percentrate64(rate, rate_adjust, 100);
+ Assert_ret(baserate >= 0);
+
+ if (rate_adjust != 100 && baserate > 0) {
+ if (battle_config.logarithmic_drops && rate_adjust > 0) {
+ // Logarithmic drops equation by Ishizu-Chan
+ //Equation: Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5))
+ //x is the normal Droprate, y is the Modificator.
+ rate = (int64)(baserate * pow((5.0 - log10(baserate)), (log(rate_adjust/100.) / log(5.0))) + 0.5);
+ } else {
+ //Classical linear rate adjustment.
+ rate = apply_percentrate64(baserate, rate_adjust, 100);
+ }
+ }
return (unsigned int)cap_value(rate,rate_min,rate_max);
}
@@ -3654,6 +3718,7 @@ unsigned int mob_drop_adjust(int baserate, int rate_adjust, unsigned short rate_
*/
void item_dropratio_adjust(int nameid, int mob_id, int *rate_adjust)
{
+ nullpo_retv(rate_adjust);
if( item_drop_ratio_db[nameid] ) {
if( item_drop_ratio_db[nameid]->mob_id[0] ) { // only for listed mobs
int i;
@@ -3685,9 +3750,10 @@ static inline int mob_parse_dbrow_cap_value(int class_, int min, int max, int va
* (mob_id is expected to be already set).
* @param[in] t The libconfig entry.
*/
-void mob_read_db_stats_sub(struct mob_db *entry, config_setting_t *t)
+void mob_read_db_stats_sub(struct mob_db *entry, struct config_setting_t *t)
{
int i32;
+ nullpo_retv(entry);
if (mob->lookup_const(t, "Str", &i32) && i32 >= 0) {
entry->status.str = mob_parse_dbrow_cap_value(entry->mob_id, UINT16_MIN, UINT16_MAX, i32);
}
@@ -3716,43 +3782,45 @@ void mob_read_db_stats_sub(struct mob_db *entry, config_setting_t *t)
*
* @return The parsed mode.
*/
-int mob_read_db_mode_sub(struct mob_db *entry, config_setting_t *t)
+uint32 mob_read_db_mode_sub(struct mob_db *entry, struct config_setting_t *t)
{
- int mode = 0;
- config_setting_t *t2;
+ uint32 mode = 0;
+ struct config_setting_t *t2;
if ((t2 = libconfig->setting_get_member(t, "CanMove")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CANMOVE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CANMOVE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Looter")))
- mode |= libconfig->setting_get_bool(t2) ? MD_LOOTER : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_LOOTER : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Aggressive")))
- mode |= libconfig->setting_get_bool(t2) ? MD_AGGRESSIVE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_AGGRESSIVE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Assist")))
- mode |= libconfig->setting_get_bool(t2) ? MD_ASSIST : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_ASSIST : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "CastSensorIdle")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CASTSENSOR_IDLE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CASTSENSOR_IDLE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Boss")))
- mode |= libconfig->setting_get_bool(t2) ? MD_BOSS : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_BOSS : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Plant")))
- mode |= libconfig->setting_get_bool(t2) ? MD_PLANT : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_PLANT : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "CanAttack")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CANATTACK : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CANATTACK : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Detector")))
- mode |= libconfig->setting_get_bool(t2) ? MD_DETECTOR : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_DETECTOR : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "CastSensorChase")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CASTSENSOR_CHASE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CASTSENSOR_CHASE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "ChangeChase")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CHANGECHASE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CHANGECHASE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "Angry")))
- mode |= libconfig->setting_get_bool(t2) ? MD_ANGRY : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_ANGRY : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "ChangeTargetMelee")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CHANGETARGET_MELEE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CHANGETARGET_MELEE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "ChangeTargetChase")))
- mode |= libconfig->setting_get_bool(t2) ? MD_CHANGETARGET_CHASE : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_CHANGETARGET_CHASE : MD_NONE;
if ((t2 = libconfig->setting_get_member(t, "TargetWeak")))
- mode |= libconfig->setting_get_bool(t2) ? MD_TARGETWEAK : 0;
+ mode |= libconfig->setting_get_bool(t2) ? MD_TARGETWEAK : MD_NONE;
+ if ((t2 = libconfig->setting_get_member(t, "NoKnockback")))
+ mode |= libconfig->setting_get_bool(t2) ? MD_NOKNOCKBACK : MD_NONE;
- return mode;
+ return mode & MD_MASK;
}
/**
@@ -3762,13 +3830,14 @@ int mob_read_db_mode_sub(struct mob_db *entry, config_setting_t *t)
* (mob_id is expected to be already set).
* @param[in] t The libconfig entry.
*/
-void mob_read_db_mvpdrops_sub(struct mob_db *entry, config_setting_t *t)
+void mob_read_db_mvpdrops_sub(struct mob_db *entry, struct config_setting_t *t)
{
- config_setting_t *drop;
+ struct config_setting_t *drop;
int i = 0;
int idx = 0;
int i32;
+ nullpo_retv(entry);
while (idx < MAX_MVP_DROP && (drop = libconfig->setting_get_elem(t, i))) {
const char *name = config_setting_name(drop);
int rate_adjust = battle_config.item_rate_mvp;
@@ -3818,14 +3887,15 @@ void mob_read_db_mvpdrops_sub(struct mob_db *entry, config_setting_t *t)
* (mob_id, status.mode are expected to be already set).
* @param[in] t The libconfig entry.
*/
-void mob_read_db_drops_sub(struct mob_db *entry, config_setting_t *t)
+void mob_read_db_drops_sub(struct mob_db *entry, struct config_setting_t *t)
{
- config_setting_t *drop;
+ struct config_setting_t *drop;
int i = 0;
int idx = 0;
int i32;
int k;
+ nullpo_retv(entry);
while (idx < MAX_MOB_DROP && (drop = libconfig->setting_get_elem(t, i))) {
const char *name = config_setting_name(drop);
int rate_adjust, type;
@@ -3947,6 +4017,7 @@ int mob_db_validate_entry(struct mob_db *entry, int n, const char *source)
{
struct mob_data data;
+ nullpo_ret(entry);
if (entry->mob_id <= 1000 || entry->mob_id > MAX_MOB_DB) {
ShowError("mob_db_validate_entry: Invalid monster ID %d, must be in range %d-%d.\n", entry->mob_id, 1000, MAX_MOB_DB);
return 0;
@@ -4045,10 +4116,10 @@ int mob_db_validate_entry(struct mob_db *entry, int n, const char *source)
* validation errors.
* @return Mob ID of the validated entry, or 0 in case of failure.
*/
-int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
+int mob_read_db_sub(struct config_setting_t *mobt, int n, const char *source)
{
struct mob_db md = { 0 };
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
const char *str = NULL;
int i32 = 0;
bool inherit = false;
@@ -4100,6 +4171,7 @@ int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
* ChangeTargetMelee: true/false
* ChangeTargetChase: true/false
* TargetWeak: true/false
+ * NoKnockback: true/false
* }
* MoveSpeed: move speed
* AttackDelay: attack delay
@@ -4121,7 +4193,7 @@ int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
return 0;
}
md.mob_id = i32;
- md.vd.class_ = md.mob_id;
+ md.vd.class = md.mob_id;
if ((t = libconfig->setting_get_member(mobt, "Inherit")) && (inherit = libconfig->setting_get_bool(t))) {
if (!mob->db_data[md.mob_id]) {
@@ -4276,7 +4348,7 @@ int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
if (config_setting_is_group(t)) {
md.status.mode = mob->read_db_mode_sub(&md, t);
} else if (mob->lookup_const(mobt, "Mode", &i32) && i32 >= 0) {
- md.status.mode = i32;
+ md.status.mode = (uint32)i32 & MD_MASK;
}
}
if (!battle_config.monster_active_enable)
@@ -4353,12 +4425,12 @@ int mob_read_db_sub(config_setting_t *mobt, int n, const char *source)
* @param[in] source Source of the entry (file name), to be displayed in
* case of validation errors.
*/
-void mob_read_db_additional_fields(struct mob_db *entry, config_setting_t *t, int n, const char *source)
+void mob_read_db_additional_fields(struct mob_db *entry, struct config_setting_t *t, int n, const char *source)
{
// do nothing. plugins can do own work
}
-bool mob_lookup_const(const config_setting_t *it, const char *name, int *value)
+bool mob_lookup_const(const struct config_setting_t *it, const char *name, int *value)
{
if (libconfig->setting_lookup_int(it, name, value))
{
@@ -4376,9 +4448,11 @@ bool mob_lookup_const(const config_setting_t *it, const char *name, int *value)
return false;
}
-bool mob_get_const(const config_setting_t *it, int *value)
+bool mob_get_const(const struct config_setting_t *it, int *value)
{
const char *str = config_setting_get_string(it);
+
+ nullpo_retr(false, value);
if (str && *str && script->get_constant(str, value))
return true;
@@ -4413,10 +4487,10 @@ void mob_readdb(void) {
int mob_read_libconfig(const char *filename, bool ignore_missing)
{
bool duplicate[MAX_MOB_DB] = { 0 };
- config_t mob_db_conf;
+ struct config_t mob_db_conf;
char filepath[256];
- config_setting_t *mdb;
- config_setting_t *t;
+ struct config_setting_t *mdb;
+ struct config_setting_t *t;
int i = 0, count = 0;
nullpo_ret(filename);
@@ -4425,7 +4499,10 @@ int mob_read_libconfig(const char *filename, bool ignore_missing)
if (ignore_missing && !exists(filepath))
return 0;
- if (libconfig->read_file(&mob_db_conf, filepath) || !(mdb = libconfig->setting_get_member(mob_db_conf.root, "mob_db"))) {
+ if (!libconfig->load_file(&mob_db_conf, filepath))
+ return 0;
+
+ if ((mdb = libconfig->setting_get_member(mob_db_conf.root, "mob_db")) == NULL) {
ShowError("can't read %s\n", filepath);
return 0;
}
@@ -4470,8 +4547,9 @@ void mob_name_constants(void) {
*------------------------------------------*/
bool mob_readdb_mobavail(char* str[], int columns, int current)
{
- int class_, k;
+ int class_, view_class;
+ nullpo_retr(false, str);
class_=atoi(str[0]);
if(mob->db(class_) == mob->dummy) {
@@ -4480,13 +4558,13 @@ bool mob_readdb_mobavail(char* str[], int columns, int current)
return false;
}
- k=atoi(str[1]);
+ view_class = atoi(str[1]);
memset(&mob->db_data[class_]->vd, 0, sizeof(struct view_data));
- mob->db_data[class_]->vd.class_=k;
+ mob->db_data[class_]->vd.class = view_class;
//Player sprites
- if(pc->db_checkid(k) && columns==12) {
+ if (pc->db_checkid(view_class) && columns == 12) {
mob->db_data[class_]->vd.sex=atoi(str[2]);
mob->db_data[class_]->vd.hair_style=atoi(str[3]);
mob->db_data[class_]->vd.hair_color=atoi(str[4]);
@@ -4583,6 +4661,8 @@ bool mob_parse_row_chatdb(char** str, const char* source, int line, int* last_ms
int msg_id;
size_t len;
+ nullpo_retr(false, str);
+ nullpo_retr(false, last_msg_id);
msg_id = atoi(str[0]);
if (msg_id <= 0 || msg_id > MAX_MOB_CHAT)
@@ -4671,7 +4751,7 @@ void mob_readchatdb(void) {
if( j < 2 || str[2]==NULL)
{
- ShowError("mob_readchatdb: Insufficient number of fields for skill at %s, line %d\n", arc, lines);
+ ShowError("mob_readchatdb: Insufficient number of fields for skill at %s, line %u\n", arc, lines);
continue;
}
@@ -4767,6 +4847,7 @@ bool mob_parse_row_mobskilldb(char** str, int columns, int current)
int i =0, j, tmp;
uint16 sidx = 0;
+ nullpo_retr(false, str);
mob_id = atoi(str[0]);
if (mob_id > 0 && mob->db(mob_id) == mob->dummy)
@@ -4891,19 +4972,23 @@ bool mob_parse_row_mobskilldb(char** str, int columns, int current)
ms->val[3]=(int)strtol(str[15],NULL,0);
ms->val[4]=(int)strtol(str[16],NULL,0);
- if(ms->skill_id == NPC_EMOTION && mob_id>0 &&
- ms->val[1] == mob->db(mob_id)->status.mode)
- {
- ms->val[1] = 0;
+ if (ms->skill_id == NPC_EMOTION) {
+ ms->val[1] &= MD_MASK;
+ ms->val[2] &= MD_MASK;
+ ms->val[3] &= MD_MASK;
+ }
+ if (ms->skill_id == NPC_EMOTION && mob_id > 0
+ && (uint32)ms->val[1] == mob->db(mob_id)->status.mode) {
+ ms->val[1] = MD_NONE;
ms->val[4] = 1; //request to return mode to normal.
}
- if (ms->skill_id == NPC_EMOTION_ON && mob_id>0 && ms->val[1]) {
+ if (ms->skill_id == NPC_EMOTION_ON && mob_id>0 && ms->val[1] != MD_NONE) {
//Adds a mode to the mob.
//Remove aggressive mode when the new mob type is passive.
if (!(ms->val[1]&MD_AGGRESSIVE))
- ms->val[3]|=MD_AGGRESSIVE;
- ms->val[2]|= ms->val[1]; //Add the new mode.
- ms->val[1] = 0; //Do not "set" it.
+ ms->val[3] |= MD_AGGRESSIVE;
+ ms->val[2] |= (uint32)ms->val[1]; //Add the new mode.
+ ms->val[1] = MD_NONE; //Do not "set" it.
}
if(*str[17])
@@ -4961,7 +5046,7 @@ void mob_readskilldb(void) {
for( fi = 0; fi < ARRAYLENGTH(filename); ++fi ) {
if(fi > 0) {
char filepath[256];
- sprintf(filepath, "%s/%s", map->db_path, filename[fi]);
+ snprintf(filepath, 256, "%s/%s", map->db_path, filename[fi]);
if(!exists(filepath)) {
continue;
}
@@ -4978,6 +5063,7 @@ bool mob_readdb_race2(char* fields[], int columns, int current)
{
int race, i;
+ nullpo_retr(false, fields);
race = atoi(fields[0]);
if (race < RC2_NONE || race >= RC2_MAX) {
@@ -5002,6 +5088,8 @@ bool mob_readdb_race2(char* fields[], int columns, int current)
bool mob_readdb_itemratio(char* str[], int columns, int current)
{
int nameid, ratio, i;
+
+ nullpo_retr(false, str);
nameid = atoi(str[0]);
if( itemdb->exists(nameid) == NULL )
@@ -5103,7 +5191,9 @@ int do_init_mob(bool minimal) {
void mob_destroy_mob_db(int index)
{
- struct mob_db *data = mob->db_data[index];
+ struct mob_db *data;
+ Assert_retv(index >= 0 && index <= MAX_MOB_DB);
+ data = mob->db_data[index];
HPM->data_store_destroy(&data->hdata);
aFree(data);
mob->db_data[index] = NULL;
diff --git a/src/map/mob.h b/src/map/mob.h
index 9a5239b11..7f2accedf 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -459,7 +459,7 @@ struct mob_interface {
int (*setdelayspawn) (struct mob_data *md);
int (*count_sub) (struct block_list *bl, va_list ap);
int (*spawn) (struct mob_data *md);
- int (*can_changetarget) (struct mob_data *md, struct block_list *target, int mode);
+ int (*can_changetarget) (const struct mob_data *md, const struct block_list *target, uint32 mode);
int (*target) (struct mob_data *md, struct block_list *bl, int dist);
int (*ai_sub_hard_activesearch) (struct block_list *bl, va_list ap);
int (*ai_sub_hard_changechase) (struct block_list *bl, va_list ap);
@@ -505,21 +505,21 @@ struct mob_interface {
int (*skill_use) (struct mob_data *md, int64 tick, int event);
int (*skill_event) (struct mob_data *md, struct block_list *src, int64 tick, int flag);
int (*is_clone) (int class_);
- int (*clone_spawn) (struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, int mode, int flag, unsigned int duration);
+ int (*clone_spawn) (struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, uint32 mode, int flag, unsigned int duration);
int (*clone_delete) (struct mob_data *md);
unsigned int (*drop_adjust) (int baserate, int rate_adjust, unsigned short rate_min, unsigned short rate_max);
void (*item_dropratio_adjust) (int nameid, int mob_id, int *rate_adjust);
void (*readdb) (void);
- bool (*lookup_const) (const config_setting_t *it, const char *name, int *value);
- bool (*get_const) (const config_setting_t *it, int *value);
+ bool (*lookup_const) (const struct config_setting_t *it, const char *name, int *value);
+ bool (*get_const) (const struct config_setting_t *it, int *value);
int (*db_validate_entry) (struct mob_db *entry, int n, const char *source);
int (*read_libconfig) (const char *filename, bool ignore_missing);
- void (*read_db_additional_fields) (struct mob_db *entry, config_setting_t *it, int n, const char *source);
- int (*read_db_sub) (config_setting_t *mobt, int id, const char *source);
- void (*read_db_drops_sub) (struct mob_db *entry, config_setting_t *t);
- void (*read_db_mvpdrops_sub) (struct mob_db *entry, config_setting_t *t);
- int (*read_db_mode_sub) (struct mob_db *entry, config_setting_t *t);
- void (*read_db_stats_sub) (struct mob_db *entry, config_setting_t *t);
+ void (*read_db_additional_fields) (struct mob_db *entry, struct config_setting_t *it, int n, const char *source);
+ int (*read_db_sub) (struct config_setting_t *mobt, int id, const char *source);
+ void (*read_db_drops_sub) (struct mob_db *entry, struct config_setting_t *t);
+ void (*read_db_mvpdrops_sub) (struct mob_db *entry, struct config_setting_t *t);
+ uint32 (*read_db_mode_sub) (struct mob_db *entry, struct config_setting_t *t);
+ void (*read_db_stats_sub) (struct mob_db *entry, struct config_setting_t *t);
void (*name_constants) (void);
bool (*readdb_mobavail) (char *str[], int columns, int current);
int (*read_randommonster) (void);
diff --git a/src/map/npc.c b/src/map/npc.c
index 23b0b9555..2876ea595 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -47,6 +47,7 @@
#include "common/nullpo.h"
#include "common/showmsg.h"
#include "common/socket.h"
+#include "common/sql.h"
#include "common/strlib.h"
#include "common/timer.h"
#include "common/utils.h"
@@ -61,17 +62,6 @@
struct npc_interface npc_s;
struct npc_interface *npc;
-static int npc_id=START_NPC_NUM;
-static int npc_warp=0;
-static int npc_shop=0;
-static int npc_script=0;
-static int npc_mob=0;
-static int npc_delay_mob=0;
-static int npc_cache_mob=0;
-
-static const char *npc_last_path;
-static const char *npc_last_ref;
-struct npc_path_data *npc_last_npd;
//For holding the view data of npc classes. [Skotlex]
static struct view_data npc_viewdb[MAX_NPC_CLASS];
@@ -131,15 +121,15 @@ bool npc_db_checkid(int id)
/// Returns a new npc id that isn't being used in id_db.
/// Fatal error if nothing is available.
int npc_get_new_npc_id(void) {
- if( npc_id >= START_NPC_NUM && !map->blid_exists(npc_id) )
- return npc_id++;// available
+ if (npc->npc_id >= START_NPC_NUM && !map->blid_exists(npc->npc_id))
+ return npc->npc_id++;// available
else {// find next id
- int base_id = npc_id;
- while( base_id != ++npc_id ) {
- if( npc_id < START_NPC_NUM )
- npc_id = START_NPC_NUM;
- if( !map->blid_exists(npc_id) )
- return npc_id++;// available
+ int base_id = npc->npc_id;
+ while (base_id != ++npc->npc_id) {
+ if (npc->npc_id < START_NPC_NUM)
+ npc->npc_id = START_NPC_NUM;
+ if (!map->blid_exists(npc->npc_id))
+ return npc->npc_id++;// available
}
// full loop, nothing available
ShowFatalError("npc_get_new_npc_id: All ids are taken. Exiting...");
@@ -176,6 +166,7 @@ int npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd)
{
char name[EVENT_NAME_LENGTH];
+ nullpo_retr(1, nd);
if( nd->touching_id )
return 0; // Attached a player already. Can't trigger on anyone else.
@@ -190,6 +181,8 @@ int npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd)
{
char name[EVENT_NAME_LENGTH];
+ nullpo_retr(1, sd);
+ nullpo_retr(1, nd);
if (sd->areanpc_id == nd->bl.id)
return 0;
@@ -201,6 +194,8 @@ int npc_onuntouch_event(struct map_session_data *sd, struct npc_data *nd)
{
char name[EVENT_NAME_LENGTH];
+ nullpo_ret(sd);
+ nullpo_ret(nd);
if (sd->areanpc_id != nd->bl.id)
return 0;
@@ -366,7 +361,7 @@ int npc_event_dequeue(struct map_session_data* sd)
/**
* @see DBCreateData
*/
-DBData npc_event_export_create(DBKey key, va_list args)
+struct DBData npc_event_export_create(union DBKey key, va_list args)
{
struct linkdb_node** head_ptr;
CREATE(head_ptr, struct linkdb_node*, 1);
@@ -380,8 +375,12 @@ DBData npc_event_export_create(DBKey key, va_list args)
*------------------------------------------*/
int npc_event_export(struct npc_data *nd, int i)
{
- char* lname = nd->u.scr.label_list[i].name;
- int pos = nd->u.scr.label_list[i].pos;
+ char* lname;
+ int pos;
+ nullpo_ret(nd);
+ Assert_ret(i >= 0 && i < nd->u.scr.label_list_num);
+ lname = nd->u.scr.label_list[i].name;
+ pos = nd->u.scr.label_list[i].pos;
if ((lname[0] == 'O' || lname[0] == 'o') && (lname[1] == 'N' || lname[1] == 'n')) {
struct event_data *ev;
struct linkdb_node **label_linkdb = NULL;
@@ -434,6 +433,7 @@ void npc_event_doall_sub(void *key, void *data, va_list ap)
// runs the specified event (supports both single-npc and global events)
int npc_event_do(const char* name)
{
+ nullpo_ret(name);
if( name[0] == ':' && name[1] == ':' ) {
return npc->event_doall(name+2); // skip leading "::"
}
@@ -538,9 +538,12 @@ void npc_event_do_oninit( bool reload )
int npc_timerevent_export(struct npc_data *nd, int i)
{
int t = 0, len = 0;
- char *lname = nd->u.scr.label_list[i].name;
- int pos = nd->u.scr.label_list[i].pos;
- if (sscanf(lname, "OnTimer%d%n", &t, &len) == 1 && lname[len] == '\0') {
+ char *lname;
+ int pos;
+ nullpo_ret(nd);
+ lname = nd->u.scr.label_list[i].name;
+ pos = nd->u.scr.label_list[i].pos;
+ if (sscanf(lname, "OnTimer%d%n", &t, &len) == 1 && len < NAME_LENGTH && lname[len] == '\0') {
// Timer event
struct npc_timerevent_list *te = nd->u.scr.timer_event;
int j, k = nd->u.scr.timeramount;
@@ -580,6 +583,8 @@ int npc_timerevent(int tid, int64 tick, int id, intptr_t data)
struct timer_event_data *ted = (struct timer_event_data*)data;
struct map_session_data *sd=NULL;
+ nullpo_ret(ted);
+
if( nd == NULL ) {
ShowError("npc_timerevent: NPC not found??\n");
return 0;
@@ -732,6 +737,7 @@ void npc_timerevent_quit(struct map_session_data* sd)
struct npc_data* nd;
struct timer_event_data *ted;
+ nullpo_retv(sd);
// Check timer existence
if( sd->npc_timer_id == INVALID_TIMER )
return;
@@ -763,6 +769,7 @@ void npc_timerevent_quit(struct map_session_data* sd)
{
int old_rid,old_timer;
int64 old_tick;
+ nullpo_retv(ted);
//Set timer related info.
old_rid = (nd->u.scr.rid == sd->bl.id ? 0 : nd->u.scr.rid); // Detach rid if the last attached player logged off.
@@ -831,6 +838,8 @@ int npc_settimerevent_tick(struct npc_data* nd, int newtimer)
int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char* eventname)
{
+ nullpo_retr(2, sd);
+ nullpo_retr(2, eventname);
if ( sd->npc_id != 0 )
{
//Enqueue the event trigger.
@@ -915,9 +924,11 @@ int npc_touch_areanpc_sub(struct block_list *bl, va_list ap) {
* If not, it unsets it and searches for another player in range.
*------------------------------------------*/
int npc_touchnext_areanpc(struct map_session_data* sd, bool leavemap) {
- struct npc_data *nd = map->id2nd(sd->touching_id);
+ struct npc_data *nd;
short xs, ys;
+ nullpo_retr(1, sd);
+ nd = map->id2nd(sd->touching_id);
if( !nd || nd->touching_id != sd->bl.id )
return 1;
@@ -949,7 +960,7 @@ int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
int j, found_warp = 0;
nullpo_retr(1, sd);
-
+ Assert_retr(1, m >= 0 && m < map->count);
#if 0 // Why not enqueue it? [Inkfish]
if(sd->npc_id)
return 1;
@@ -1034,6 +1045,7 @@ int npc_untouch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
{
struct npc_data *nd = NULL;
nullpo_retr(1, sd);
+ Assert_retr(1, m >= 0 && m < map->count);
if (!sd->areanpc_id)
return 0;
@@ -1053,11 +1065,16 @@ int npc_untouch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y)
// Return 1 if Warped
int npc_touch_areanpc2(struct mob_data *md)
{
- int i, m = md->bl.m, x = md->bl.x, y = md->bl.y, id;
+ int i, m, x, y, id;
char eventname[EVENT_NAME_LENGTH];
struct event_data* ev;
int xs, ys;
+ nullpo_ret(md);
+ m = md->bl.m;
+ x = md->bl.x;
+ y = md->bl.y;
+
for( i = 0; i < map->list[m].npc_num; i++ ) {
if( map->list[m].npc[i]->option&OPTION_INVISIBLE )
continue;
@@ -1116,6 +1133,8 @@ int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) {
int x0,y0,x1,y1;
int xs,ys;
+ Assert_retr(1, m >= 0 && m < map->count);
+
if (range < 0) return 0;
x0 = max(x-range, 0);
y0 = max(y-range, 0);
@@ -1187,6 +1206,7 @@ struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* b
if (distance > nd->area_size)
distance = nd->area_size;
+ nullpo_retr(NULL, bl);
if (bl->m != sd->bl.m ||
bl->x < sd->bl.x - distance || bl->x > sd->bl.x + distance ||
bl->y < sd->bl.y - distance || bl->y > sd->bl.y + distance)
@@ -1208,6 +1228,9 @@ int npc_globalmessage(const char* name, const char* mes)
if (!nd)
return 0;
+ nullpo_ret(name);
+ nullpo_ret(mes);
+
snprintf(temp, sizeof(temp), "%s : %s", name, mes);
clif->GlobalMessage(&nd->bl,temp);
@@ -1219,6 +1242,7 @@ void run_tomb(struct map_session_data* sd, struct npc_data* nd) {
char buffer[200];
char time[10];
+ nullpo_retv(nd);
strftime(time, sizeof(time), "%H:%M", localtime(&nd->u.tomb.kill_time));
// TODO: Find exact color?
@@ -1386,16 +1410,19 @@ int npc_buysellsel(struct map_session_data* sd, int id, int type) {
/*==========================================
* Cash Shop Buy List
*------------------------------------------*/
-int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, unsigned short* item_list) {
- int i, j, nameid, amount, new_, w, vt;
+int npc_cashshop_buylist(struct map_session_data *sd, int points, struct itemlist *item_list)
+{
+ int i, j, new_, w, vt;
struct npc_data *nd = NULL;
struct npc_item_list *shop = NULL;
unsigned short shop_size = 0;
+ nullpo_retr(ERROR_TYPE_SYSTEM, sd);
+ nullpo_retr(ERROR_TYPE_SYSTEM, item_list);
if( sd->state.trading )
return ERROR_TYPE_EXCHANGE;
- if( count <= 0 )
+ if (VECTOR_LENGTH(*item_list) <= 0)
return ERROR_TYPE_ITEM_ID;
if( points < 0 )
@@ -1421,24 +1448,23 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
vt = 0; // Global Value
// Validating Process ----------------------------------------------------
- for( i = 0; i < count; i++ ) {
- nameid = item_list[i*2+1];
- amount = item_list[i*2+0];
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
- if( !itemdb->exists(nameid) || amount <= 0 )
+ if (!itemdb->exists(entry->id) || entry->amount <= 0)
return ERROR_TYPE_ITEM_ID;
- ARR_FIND(0,shop_size,j,shop[j].nameid == nameid);
- if( j == shop_size || shop[j].value <= 0 )
+ ARR_FIND(0,shop_size,j,shop[j].nameid == entry->id);
+ if (j == shop_size || shop[j].value <= 0)
return ERROR_TYPE_ITEM_ID;
- if( !itemdb->isstackable(nameid) && amount > 1 ) {
+ if (!itemdb->isstackable(entry->id) && entry->amount > 1) {
ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n",
- sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);
- amount = item_list[i*2+0] = 1;
+ sd->status.name, sd->status.account_id, sd->status.char_id, entry->amount, entry->id);
+ entry->amount = 1;
}
- switch( pc->checkadditem(sd,nameid,amount) ) {
+ switch (pc->checkadditem(sd, entry->id, entry->amount)) {
case ADDITEM_NEW:
new_++;
break;
@@ -1446,8 +1472,8 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
return ERROR_TYPE_INVENTORY_WEIGHT;
}
- vt += shop[j].value * amount;
- w += itemdb_weight(nameid) * amount;
+ vt += shop[j].value * entry->amount;
+ w += itemdb_weight(entry->id) * entry->amount;
}
if( w + sd->weight > sd->max_weight )
@@ -1468,18 +1494,16 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
pc->paycash(sd,vt,points);
}
// Delivery Process ----------------------------------------------------
- for( i = 0; i < count; i++ ) {
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
struct item item_tmp;
- nameid = item_list[i*2+1];
- amount = item_list[i*2+0];
-
memset(&item_tmp,0,sizeof(item_tmp));
- if( !pet->create_egg(sd,nameid) ) {
- item_tmp.nameid = nameid;
+ if (!pet->create_egg(sd, entry->id)) {
+ item_tmp.nameid = entry->id;
item_tmp.identify = 1;
- pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
+ pc->additem(sd, &item_tmp, entry->amount, LOG_TYPE_NPC);
}
}
@@ -1487,21 +1511,27 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns
}
//npc_buylist for script-controlled shops.
-int npc_buylist_sub(struct map_session_data* sd, int n, unsigned short* item_list, struct npc_data* nd)
+int npc_buylist_sub(struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd)
{
char npc_ev[EVENT_NAME_LENGTH];
int i;
int key_nameid = 0;
int key_amount = 0;
+ nullpo_ret(item_list);
+ nullpo_ret(nd);
+
// discard old contents
script->cleararray_pc(sd, "@bought_nameid", (void*)0);
script->cleararray_pc(sd, "@bought_quantity", (void*)0);
// save list of bought items
- for( i = 0; i < n; i++ ) {
- script->setarray_pc(sd, "@bought_nameid", i, (void*)(intptr_t)item_list[i*2+1], &key_nameid);
- script->setarray_pc(sd, "@bought_quantity", i, (void*)(intptr_t)item_list[i*2], &key_amount);
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ intptr_t nameid = entry->id;
+ intptr_t amount = entry->amount;
+ script->setarray_pc(sd, "@bought_nameid", i, (void *)nameid, &key_nameid);
+ script->setarray_pc(sd, "@bought_quantity", i, (void *)amount, &key_amount);
}
// invoke event
@@ -1513,8 +1543,9 @@ int npc_buylist_sub(struct map_session_data* sd, int n, unsigned short* item_lis
/**
* Loads persistent NPC Market Data from SQL
**/
-void npc_market_fromsql(void) {
- SqlStmt* stmt = SQL->StmtMalloc(map->mysql_handle);
+void npc_market_fromsql(void)
+{
+ struct SqlStmt *stmt = SQL->StmtMalloc(map->mysql_handle);
char name[NAME_LENGTH+1];
int itemid;
int amount;
@@ -1564,8 +1595,10 @@ void npc_market_fromsql(void) {
* Saves persistent NPC Market Data into SQL
**/
void npc_market_tosql(struct npc_data *nd, unsigned short index) {
- if( SQL_ERROR == SQL->Query(map->mysql_handle, "REPLACE INTO `%s` VALUES ('%s','%d','%d')",
- map->npc_market_data_db, nd->exname, nd->u.scr.shop->item[index].nameid, nd->u.scr.shop->item[index].qty) )
+ nullpo_retv(nd);
+ Assert_retv(index < nd->u.scr.shop->items);
+ if (SQL_ERROR == SQL->Query(map->mysql_handle, "REPLACE INTO `%s` VALUES ('%s','%d','%u')",
+ map->npc_market_data_db, nd->exname, nd->u.scr.shop->item[index].nameid, nd->u.scr.shop->item[index].qty))
Sql_ShowDebug(map->mysql_handle);
}
/**
@@ -1585,12 +1618,16 @@ void npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
* Removes persistent NPC Market Data from SQL
**/
void npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
+ nullpo_retv(nd);
+ Assert_retv(index == USHRT_MAX || index < nd->u.scr.shop->items);
npc->market_delfromsql_sub(nd->exname, index == USHRT_MAX ? index : nd->u.scr.shop->item[index].nameid);
}
/**
* Judges whether to allow and spawn a trader's window.
**/
bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
+ nullpo_retr(false, sd);
+ nullpo_retr(false, nd);
if( !nd->u.scr.shop || !nd->u.scr.shop->items )
return false;
@@ -1629,7 +1666,7 @@ bool npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
* @param master id of the original npc
**/
void npc_trader_update(int master) {
- DBIterator* iter;
+ struct DBIterator *iter;
struct block_list* bl;
struct npc_data *master_nd = map->id2nd(master);
@@ -1656,6 +1693,9 @@ void npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd) {
char evname[EVENT_NAME_LENGTH];
struct event_data *ev = NULL;
+ nullpo_retv(nd);
+ nullpo_retv(sd);
+
npc->trader_funds[0] = npc->trader_funds[1] = 0;/* clear */
switch( nd->u.scr.shop->type ) {
@@ -1693,6 +1733,8 @@ bool npc_trader_pay(struct npc_data *nd, struct map_session_data *sd, int price,
char evname[EVENT_NAME_LENGTH];
struct event_data *ev = NULL;
+ nullpo_retr(false, nd);
+ nullpo_retr(false, sd);
npc->trader_ok = false;/* clear */
snprintf(evname, EVENT_NAME_LENGTH, "%s::OnPayFunds",nd->exname);
@@ -1715,6 +1757,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
int i, price, w;
unsigned short shop_size = 0;
+ nullpo_retr(ERROR_TYPE_SYSTEM, sd);
if( amount <= 0 )
return ERROR_TYPE_ITEM_ID;
@@ -1771,7 +1814,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
if ((int64)shop[i].value * amount > INT_MAX) {
ShowWarning("npc_cashshop_buy: Item '%s' (%d) price overflow attempt!\n", item->name, nameid);
- ShowDebug("(NPC:'%s' (%s,%d,%d), player:'%s' (%d/%d), value:%d, amount:%d)\n",
+ ShowDebug("(NPC:'%s' (%s,%d,%d), player:'%s' (%d/%d), value:%u, amount:%d)\n",
nd->exname, map->list[nd->bl.m].name, nd->bl.x, nd->bl.y,
sd->status.name, sd->status.account_id, sd->status.char_id,
shop[i].value, amount);
@@ -1805,11 +1848,15 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po
return ERROR_TYPE_NONE;
}
-/// Player item purchase from npc shop.
-///
-/// @param item_list 'n' pairs <amount,itemid>
-/// @return result code for clif->parse_NpcBuyListSend
-int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
+/**
+ * Processes a player item purchase from npc shop.
+ *
+ * @param sd Buyer character.
+ * @param item_list List of items.
+ * @return result code for clif->parse_NpcBuyListSend.
+ */
+int npc_buylist(struct map_session_data *sd, struct itemlist *item_list)
+{
struct npc_data* nd;
struct npc_item_list *shop = NULL;
int64 z;
@@ -1838,30 +1885,29 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
w = 0;
new_ = 0;
// process entries in buy list, one by one
- for( i = 0; i < n; ++i ) {
- int nameid, amount, value;
+ for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) {
+ int value;
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
// find this entry in the shop's sell list
ARR_FIND( 0, shop_size, j,
- item_list[i*2+1] == shop[j].nameid || //Normal items
- item_list[i*2+1] == itemdb_viewid(shop[j].nameid) //item_avail replacement
+ entry->id == shop[j].nameid || //Normal items
+ entry->id == itemdb_viewid(shop[j].nameid) //item_avail replacement
);
-
- if( j == shop_size )
+ if (j == shop_size)
return 3; // no such item in shop
- amount = item_list[i*2+0];
- nameid = item_list[i*2+1] = shop[j].nameid; //item_avail replacement
+ entry->id = shop[j].nameid; //item_avail replacement
value = shop[j].value;
- if( !itemdb->exists(nameid) )
+ if (!itemdb->exists(entry->id))
return 3; // item no longer in itemdb
- if( !itemdb->isstackable(nameid) && amount > 1 ) {
+ if (!itemdb->isstackable(entry->id) && entry->amount > 1) {
//Exploit? You can't buy more than 1 of equipment types o.O
ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n",
- sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);
- amount = item_list[i*2+0] = 1;
+ sd->status.name, sd->status.account_id, sd->status.char_id, entry->amount, entry->id);
+ entry->amount = 1;
}
if( nd->master_nd ) {
@@ -1869,7 +1915,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
continue;
}
- switch( pc->checkadditem(sd,nameid,amount) ) {
+ switch (pc->checkadditem(sd, entry->id, entry->amount)) {
case ADDITEM_EXIST:
break;
@@ -1883,12 +1929,12 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
value = pc->modifybuyvalue(sd,value);
- z += (int64)value * amount;
- w += itemdb_weight(nameid) * amount;
+ z += (int64)value * entry->amount;
+ w += itemdb_weight(entry->id) * entry->amount;
}
- if( nd->master_nd != NULL ) //Script-based shops.
- return npc->buylist_sub(sd,n,item_list,nd->master_nd);
+ if (nd->master_nd != NULL) //Script-based shops.
+ return npc->buylist_sub(sd, item_list, nd->master_nd);
if (z > sd->status.zeny)
return 1; // Not enough Zeny
@@ -1899,19 +1945,17 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
pc->payzeny(sd, (int)z, LOG_TYPE_NPC, NULL);
- for( i = 0; i < n; ++i ) {
- int nameid = item_list[i*2+1];
- int amount = item_list[i*2+0];
-
- if (itemdb_type(nameid) == IT_PETEGG) {
- pet->create_egg(sd, nameid);
+ for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ if (itemdb_type(entry->id) == IT_PETEGG) {
+ pet->create_egg(sd, entry->id);
} else {
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid = nameid;
+ item_tmp.nameid = entry->id;
item_tmp.identify = 1;
- pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
+ pc->additem(sd, &item_tmp, entry->amount, LOG_TYPE_NPC);
}
}
@@ -1932,9 +1976,10 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) {
}
/**
- * parses incoming npc market purchase list
+ * Processes incoming npc market purchase list
**/
-int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, struct packet_npc_market_purchase *p) {
+int npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list)
+{
struct npc_data* nd;
struct npc_item_list *shop = NULL;
int64 z;
@@ -1942,11 +1987,11 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
unsigned short shop_size = 0;
nullpo_retr(1, sd);
- nullpo_retr(1, p);
+ nullpo_retr(1, item_list);
nd = npc->checknear(sd,map->id2bl(sd->npc_shopid));
- if( nd == NULL || nd->subtype != SCRIPT || !list_size || !nd->u.scr.shop || nd->u.scr.shop->type != NST_MARKET )
+ if (nd == NULL || nd->subtype != SCRIPT || VECTOR_LENGTH(*item_list) == 0 || !nd->u.scr.shop || nd->u.scr.shop->type != NST_MARKET)
return 1;
shop = nd->u.scr.shop->item;
@@ -1957,37 +2002,37 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
new_ = 0;
// process entries in buy list, one by one
- for( i = 0; i < list_size; ++i ) {
- int nameid, amount, value;
+ for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) {
+ int value;
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
// find this entry in the shop's sell list
ARR_FIND( 0, shop_size, j,
- p->list[i].ITID == shop[j].nameid || //Normal items
- p->list[i].ITID == itemdb_viewid(shop[j].nameid) //item_avail replacement
+ entry->id == shop[j].nameid || //Normal items
+ entry->id == itemdb_viewid(shop[j].nameid) //item_avail replacement
);
-
- if( j == shop_size ) /* TODO find official response for this */
+ if (j == shop_size) /* TODO find official response for this */
return 1; // no such item in shop
- if( p->list[i].qty > shop[j].qty )
+ entry->id = shop[j].nameid; //item_avail replacement
+
+ if (entry->amount > (int)shop[j].qty)
return 1;
- amount = p->list[i].qty;
- nameid = p->list[i].ITID = shop[j].nameid; //item_avail replacement
value = shop[j].value;
npc_market_qty[i] = j;
- if( !itemdb->exists(nameid) ) /* TODO find official response for this */
+ if (!itemdb->exists(entry->id)) /* TODO find official response for this */
return 1; // item no longer in itemdb
- if( !itemdb->isstackable(nameid) && amount > 1 ) {
+ if (!itemdb->isstackable(entry->id) && entry->amount > 1) {
//Exploit? You can't buy more than 1 of equipment types o.O
ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n",
- sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);
- amount = p->list[i].qty = 1;
+ sd->status.name, sd->status.account_id, sd->status.char_id, entry->amount, entry->id);
+ entry->amount = 1;
}
- switch( pc->checkadditem(sd,nameid,amount) ) {
+ switch (pc->checkadditem(sd, entry->id, entry->amount)) {
case ADDITEM_EXIST:
break;
case ADDITEM_NEW:
@@ -1997,8 +2042,8 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
return 1;
}
- z += (int64)value * amount;
- w += itemdb_weight(nameid) * amount;
+ z += (int64)value * entry->amount;
+ w += itemdb_weight(entry->id) * entry->amount;
}
if (z > sd->status.zeny) /* TODO find official response for this */
@@ -2012,28 +2057,27 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
pc->payzeny(sd,(int)z,LOG_TYPE_NPC, NULL);
- for( i = 0; i < list_size; ++i ) {
- int nameid = p->list[i].ITID;
- int amount = p->list[i].qty;
+ for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
j = npc_market_qty[i];
- if( p->list[i].qty > shop[j].qty ) /* wohoo someone tampered with the packet. */
+ if (entry->amount > (int)shop[j].qty) /* wohoo someone tampered with the packet. */
return 1;
- shop[j].qty -= amount;
+ shop[j].qty -= entry->amount;
npc->market_tosql(nd,j);
- if (itemdb_type(nameid) == IT_PETEGG) {
- pet->create_egg(sd, nameid);
+ if (itemdb_type(entry->id) == IT_PETEGG) {
+ pet->create_egg(sd, entry->id);
} else {
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid = nameid;
+ item_tmp.nameid = entry->id;
item_tmp.identify = 1;
- pc->additem(sd,&item_tmp,amount,LOG_TYPE_NPC);
+ pc->additem(sd, &item_tmp, entry->amount, LOG_TYPE_NPC);
}
}
@@ -2041,10 +2085,12 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st
}
/// npc_selllist for script-controlled shops
-int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_list, struct npc_data* nd)
+int npc_selllist_sub(struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd)
{
char npc_ev[EVENT_NAME_LENGTH];
char card_slot[NAME_LENGTH];
+ char opt_index_str[NAME_LENGTH];
+ char opt_value_str[NAME_LENGTH];
int i, j;
int key_nameid = 0;
int key_amount = 0;
@@ -2052,6 +2098,12 @@ int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_li
int key_attribute = 0;
int key_identify = 0;
int key_card[MAX_SLOTS];
+ int key_opt_idx[MAX_ITEM_OPTIONS];
+ int key_opt_value[MAX_ITEM_OPTIONS];
+
+ nullpo_ret(sd);
+ nullpo_ret(item_list);
+ nullpo_ret(nd);
// discard old contents
script->cleararray_pc(sd, "@sold_nameid", (void*)0);
@@ -2068,21 +2120,39 @@ int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_li
}
// save list of to be sold items
- for (i = 0; i < n; i++) {
- int idx = item_list[i*2]-2;
-
- script->setarray_pc(sd, "@sold_nameid", i, (void*)(intptr_t)sd->status.inventory[idx].nameid, &key_nameid);
- script->setarray_pc(sd, "@sold_quantity", i, (void*)(intptr_t)item_list[i*2+1], &key_amount);
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ struct item *item = &sd->status.inventory[entry->id];
+ intptr_t nameid = item->nameid;
+ intptr_t amount = entry->amount;
+ intptr_t refine = item->refine;
+ intptr_t attribute = item->attribute;
+ intptr_t identify = item->identify;
+
+ script->setarray_pc(sd, "@sold_nameid", i, (void*)nameid, &key_nameid);
+ script->setarray_pc(sd, "@sold_quantity", i, (void*)amount, &key_amount);
// process item based information into the arrays
- script->setarray_pc(sd, "@sold_refine", i, (void*)(intptr_t)sd->status.inventory[idx].refine, &key_refine);
- script->setarray_pc(sd, "@sold_attribute", i, (void*)(intptr_t)sd->status.inventory[idx].attribute, &key_attribute);
- script->setarray_pc(sd, "@sold_identify", i, (void*)(intptr_t)sd->status.inventory[idx].identify, &key_identify);
+ script->setarray_pc(sd, "@sold_refine", i, (void*)refine, &key_refine);
+ script->setarray_pc(sd, "@sold_attribute", i, (void*)attribute, &key_attribute);
+ script->setarray_pc(sd, "@sold_identify", i, (void*)identify, &key_identify);
for (j = 0; j < MAX_SLOTS; j++) {
+ intptr_t card = item->card[j];
// store each of the cards/special info from the item in the array
snprintf(card_slot, sizeof(card_slot), "@sold_card%d", j + 1);
- script->setarray_pc(sd, card_slot, i, (void*)(intptr_t)sd->status.inventory[idx].card[j], &key_card[j]);
+ script->setarray_pc(sd, card_slot, i, (void*)card, &key_card[j]);
+ }
+
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++) {
+ intptr_t opt_idx = item->option[j].index;
+ intptr_t opt_value = item->option[j].value;
+
+ snprintf(opt_index_str, sizeof(opt_index_str), "@slot_opt_idx%d", j + 1);
+ script->setarray_pc(sd, opt_index_str, i, (void*)opt_idx, &key_opt_idx[j]);
+
+ snprintf(opt_value_str, sizeof(opt_value_str), "@slot_opt_val%d", j + 1);
+ script->setarray_pc(sd, opt_value_str, i, (void*)opt_value, &key_opt_value[j]);
}
}
@@ -2097,7 +2167,8 @@ int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_li
///
/// @param item_list 'n' pairs <index,amount>
/// @return result code for clif->parse_NpcSellListSend
-int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list) {
+int npc_selllist(struct map_session_data *sd, struct itemlist *item_list)
+{
int64 z;
int i,skill_t, skill_idx = skill->get_index(MC_OVERCHARGE);
struct npc_data *nd;
@@ -2111,20 +2182,21 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
}
if( nd->subtype != SHOP ) {
- if( !(nd->subtype == SCRIPT && nd->u.scr.shop && nd->u.scr.shop->type == NST_ZENY) )
+ if (!(nd->subtype == SCRIPT && nd->u.scr.shop && (nd->u.scr.shop->type == NST_ZENY || nd->u.scr.shop->type == NST_MARKET)))
return 1;
}
z = 0;
- // verify the sell list
- for (i = 0; i < n; i++) {
- int nameid, amount, idx, value;
+ if (sd->status.zeny >= MAX_ZENY && nd->master_nd == NULL)
+ return 1;
- idx = item_list[i*2]-2;
- amount = item_list[i*2+1];
+ // verify the sell list
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ int nameid, value, idx = entry->id;
- if (idx >= MAX_INVENTORY || idx < 0 || amount < 0) {
+ if (idx >= MAX_INVENTORY || idx < 0 || entry->amount < 0) {
return 1;
}
@@ -2136,7 +2208,7 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
nameid = sd->status.inventory[idx].nameid;
- if (!nameid || !sd->inventory_data[idx] || sd->status.inventory[idx].amount < amount) {
+ if (!nameid || !sd->inventory_data[idx] || sd->status.inventory[idx].amount < entry->amount) {
return 1;
}
@@ -2147,30 +2219,31 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
value = pc->modifysellvalue(sd, sd->inventory_data[idx]->value_sell);
- z += (int64)value * amount;
+ z += (int64)value * entry->amount;
}
if( nd->master_nd ) { // Script-controlled shops
- return npc->selllist_sub(sd, n, item_list, nd->master_nd);
+ return npc->selllist_sub(sd, item_list, nd->master_nd);
}
// delete items
- for( i = 0; i < n; i++ ) {
- int amount, idx;
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
+ struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ int idx = entry->id;
- idx = item_list[i*2]-2;
- amount = item_list[i*2+1];
-
- if( sd->inventory_data[idx]->type == IT_PETEGG && sd->status.inventory[idx].card[0] == CARD0_PET ) {
- if( pet->search_petDB_index(sd->status.inventory[idx].nameid, PET_EGG) >= 0 ) {
+ if (sd->inventory_data[idx]->type == IT_PETEGG && sd->status.inventory[idx].card[0] == CARD0_PET) {
+ if (pet->search_petDB_index(sd->status.inventory[idx].nameid, PET_EGG) >= 0) {
intif->delete_petdata(MakeDWord(sd->status.inventory[idx].card[1], sd->status.inventory[idx].card[2]));
}
}
- pc->delitem(sd, idx, amount, 0, DELITEM_SOLD, LOG_TYPE_NPC);
+ pc->delitem(sd, idx, entry->amount, 0, DELITEM_SOLD, LOG_TYPE_NPC);
}
- if( z > MAX_ZENY )
+ if (z + sd->status.zeny > MAX_ZENY && nd->master_nd == NULL)
+ return 1;
+
+ if (z > MAX_ZENY)
z = MAX_ZENY;
pc->getzeny(sd, (int)z, LOG_TYPE_NPC, NULL);
@@ -2216,7 +2289,7 @@ int npc_remove_map(struct npc_data* nd) {
/**
* @see DBApply
*/
-int npc_unload_ev(DBKey key, DBData *data, va_list ap)
+int npc_unload_ev(union DBKey key, struct DBData *data, va_list ap)
{
struct event_data* ev = DB->data2ptr(data);
char* npcname = va_arg(ap, char *);
@@ -2231,7 +2304,7 @@ int npc_unload_ev(DBKey key, DBData *data, va_list ap)
/**
* @see DBApply
*/
-int npc_unload_ev_label(DBKey key, DBData *data, va_list ap)
+int npc_unload_ev_label(union DBKey key, struct DBData *data, va_list ap)
{
struct linkdb_node **label_linkdb = DB->data2ptr(data);
struct npc_data* nd = va_arg(ap, struct npc_data *);
@@ -2247,6 +2320,7 @@ int npc_unload_dup_sub(struct npc_data* nd, va_list args)
{
int src_id;
+ nullpo_ret(nd);
src_id = va_arg(args, int);
if (nd->src_id == src_id)
npc->unload(nd, true);
@@ -2255,6 +2329,7 @@ int npc_unload_dup_sub(struct npc_data* nd, va_list args)
//Removes all npcs that are duplicates of the passed one. [Skotlex]
void npc_unload_duplicates(struct npc_data* nd) {
+ nullpo_retv(nd);
map->foreachnpc(npc->unload_dup_sub,nd->bl.id);
}
@@ -2372,23 +2447,22 @@ void npc_clearsrcfile(void)
npc->src_files = NULL;
}
-/// Adds a npc source file (or removes all)
-void npc_addsrcfile(const char* name)
+/**
+ * Adds a npc source file.
+ *
+ * @param name The file name to add.
+ */
+void npc_addsrcfile(const char *name)
{
struct npc_src_list* file;
struct npc_src_list* file_prev = NULL;
- if( strcmpi(name, "clear") == 0 )
- {
- npc->clearsrcfile();
- return;
- }
+ nullpo_retv(name);
// prevent multiple insert of source files
file = npc->src_files;
- while( file != NULL )
- {
- if( strcmp(name, file->name) == 0 )
+ while (file != NULL) {
+ if (strcmp(name, file->name) == 0)
return;// found the file, no need to insert it again
file_prev = file;
file = file->next;
@@ -2403,23 +2477,21 @@ void npc_addsrcfile(const char* name)
file_prev->next = file;
}
-/// Removes a npc source file (or all)
-void npc_delsrcfile(const char* name)
+/**
+ * Removes a npc source file.
+ *
+ * @param name The file name to remove.
+ */
+void npc_delsrcfile(const char *name)
{
struct npc_src_list* file = npc->src_files;
struct npc_src_list* file_prev = NULL;
- if( strcmpi(name, "all") == 0 )
- {
- npc->clearsrcfile();
- return;
- }
+ nullpo_retv(name);
- while( file != NULL )
- {
- if( strcmp(file->name, name) == 0 )
- {
- if( npc->src_files == file )
+ while (file != NULL) {
+ if (strcmp(file->name, name) == 0) {
+ if (npc->src_files == file)
npc->src_files = file->next;
else
file_prev->next = file->next;
@@ -2442,10 +2514,10 @@ const char *npc_retainpathreference(const char *filepath)
struct npc_path_data * npd = NULL;
nullpo_ret(filepath);
- if (npc_last_path == filepath) {
- if (npc_last_npd != NULL)
- npc_last_npd->references++;
- return npc_last_ref;
+ if (npc->npc_last_path == filepath) {
+ if (npc->npc_last_npd != NULL)
+ npc->npc_last_npd->references++;
+ return npc->npc_last_ref;
}
if ((npd = strdb_get(npc->path_db,filepath)) == NULL) {
@@ -2460,9 +2532,9 @@ const char *npc_retainpathreference(const char *filepath)
npd->references++;
- npc_last_npd = npd;
- npc_last_ref = npd->path;
- npc_last_path = filepath;
+ npc->npc_last_npd = npd;
+ npc->npc_last_ref = npd->path;
+ npc->npc_last_path = filepath;
return npd->path;
}
@@ -2478,7 +2550,7 @@ void npc_releasepathreference(const char *filepath)
nullpo_retv(filepath);
- if (filepath != npc_last_ref) {
+ if (filepath != npc->npc_last_ref) {
npd = strdb_get(npc->path_db, filepath);
}
@@ -2496,12 +2568,14 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con
struct npc_data* dnd;// duplicate npc
char newname[NAME_LENGTH];
+ nullpo_retv(nd);
+ nullpo_retv(name);
// parse name
p = strstr(name,"::");
if( p ) { // <Display name>::<Unique name>
size_t len = p-name;
if( len > NAME_LENGTH ) {
- ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
+ ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %d characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
safestrncpy(nd->name, name, sizeof(nd->name));
} else {
memcpy(nd->name, name, len);
@@ -2509,12 +2583,12 @@ void npc_parsename(struct npc_data* nd, const char* name, const char* start, con
}
len = strlen(p+2);
if( len > NAME_LENGTH )
- ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
+ ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %d characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
safestrncpy(nd->exname, p+2, sizeof(nd->exname));
} else {// <Display name>
size_t len = strlen(name);
if( len > NAME_LENGTH )
- ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
+ ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line '%d'. Truncating to %d characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);
safestrncpy(nd->name, name, sizeof(nd->name));
safestrncpy(nd->exname, name, sizeof(nd->exname));
}
@@ -2551,6 +2625,7 @@ int npc_parseview(const char* w4, const char* start, const char* buffer, const c
int val = FAKE_NPC, i = 0;
char viewid[1024]; // Max size of name from constants.conf, see script->read_constdb.
+ nullpo_retr(FAKE_NPC, w4);
// Extract view ID / constant
while (w4[i] != '\0') {
if (ISSPACE(w4[i]) || w4[i] == '/' || w4[i] == ',')
@@ -2566,7 +2641,7 @@ int npc_parseview(const char* w4, const char* start, const char* buffer, const c
{
// Check if constant exists and get its value.
if(!script->get_constant(viewid, &val)) {
- ShowWarning("npc_parseview: Invalid NPC constant '%s' specified in file '%s', line'%d'. Defaulting to INVISIBLE_CLASS. \n", viewid, filepath, strline(buffer,start-buffer));
+ ShowWarning("npc_parseview: Invalid NPC constant '%s' specified in file '%s', line '%d'. Defaulting to INVISIBLE_CLASS.\n", viewid, filepath, strline(buffer,start-buffer));
val = INVISIBLE_CLASS;
}
} else {
@@ -2582,6 +2657,7 @@ int npc_parseview(const char* w4, const char* start, const char* buffer, const c
// Checks if given view is an ID or constant.
bool npc_viewisid(const char * viewid)
{
+ nullpo_retr(false, viewid);
if (atoi(viewid) != FAKE_NPC) {
// Loop through view, looking for non-numeric character.
while (*viewid) {
@@ -2628,6 +2704,8 @@ struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short
int i, flag = 0;
struct npc_data *nd;
+ nullpo_retr(NULL, name);
+
nd = npc->create_npc(WARP, from_mapid, from_x, from_y, 0, battle_config.warp_point_debug ? WARP_DEBUG_CLASS : WARP_CLASS);
safestrncpy(nd->exname, name, ARRAYLENGTH(nd->exname));
@@ -2676,6 +2754,9 @@ const char *npc_parse_warp(const char *w1, const char *w2, const char *w3, const
char mapname[32], to_mapname[32];
struct npc_data *nd;
+ nullpo_retr(strchr(start,'\n'), w1);
+ nullpo_retr(strchr(start,'\n'), w4);
+
// w1=<from map name>,<fromX>,<fromY>,<facing>
// w4=<spanx>,<spany>,<to map name>,<toX>,<toY>
if( sscanf(w1, "%31[^,],%d,%d", mapname, &x, &y) != 3
@@ -2709,7 +2790,7 @@ const char *npc_parse_warp(const char *w1, const char *w2, const char *w3, const
nd->u.warp.y = to_y;
nd->u.warp.xs = xs;
nd->u.warp.ys = ys;
- npc_warp++;
+ npc->npc_warp++;
npc->add_to_location(nd);
@@ -2747,6 +2828,8 @@ const char *npc_parse_shop(const char *w1, const char *w2, const char *w3, const
struct npc_data *nd;
enum npc_subtype type;
+ nullpo_retr(strchr(start,'\n'), w1);
+ nullpo_retr(strchr(start,'\n'), w4);
if( strcmp(w1,"-") == 0 ) {
// 'floating' shop
x = y = dir = 0;
@@ -2762,7 +2845,7 @@ const char *npc_parse_shop(const char *w1, const char *w2, const char *w3, const
}
if (dir < 0 || dir > 7) {
- ShowError("npc_parse_ship: Invalid NPC facing direction '%d' in file '%s', line '%d'.\n", dir, filepath, strline(buffer, start-buffer));
+ ShowError("npc_parse_shop: Invalid NPC facing direction '%d' in file '%s', line '%d'.\n", dir, filepath, strline(buffer, start-buffer));
if (retval) *retval = EXIT_FAILURE;
return strchr(start,'\n');//continue
}
@@ -2852,7 +2935,7 @@ const char *npc_parse_shop(const char *w1, const char *w2, const char *w3, const
npc->parsename(nd, w3, start, buffer, filepath);
nd->path = npc->retainpathreference(filepath);
- ++npc_shop;
+ ++npc->npc_shop;
npc->add_to_location(nd);
return strchr(start,'\n');// continue
@@ -2861,6 +2944,7 @@ const char *npc_parse_shop(const char *w1, const char *w2, const char *w3, const
void npc_convertlabel_db(struct npc_label_list* label_list, const char *filepath) {
int i;
+ nullpo_retv(label_list);
for( i = 0; i < script->label_count; i++ ) {
const char* lname = script->get_str(script->labels[i].key);
int lpos = script->labels[i].pos;
@@ -2987,6 +3071,7 @@ const char *npc_parse_script(const char *w1, const char *w2, const char *w3, con
int label_list_num;
struct npc_data* nd;
+ nullpo_retr(NULL, w1);
if (strcmp(w1, "-") == 0) {
// floating npc
x = 0;
@@ -3056,7 +3141,7 @@ const char *npc_parse_script(const char *w1, const char *w2, const char *w3, con
if( options&NPO_TRADER )
nd->u.scr.trader = true;
nd->u.scr.shop = NULL;
- ++npc_script;
+ ++npc->npc_script;
npc->add_to_location(nd);
//-----------------------------------------
@@ -3123,7 +3208,10 @@ bool npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd, i
int i;
bool retval = true;
- ++npc_script;
+ nullpo_retr(false, nd);
+ nullpo_retr(false, snd);
+
+ ++npc->npc_script;
nd->u.scr.xs = xs;
nd->u.scr.ys = ys;
nd->u.scr.script = snd->u.scr.script;
@@ -3167,7 +3255,10 @@ bool npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd, i
*/
bool npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
{
- ++npc_shop;
+ nullpo_retr(false, nd);
+ nullpo_retr(false, snd);
+
+ ++npc->npc_shop;
nd->u.shop.shop_item = snd->u.shop.shop_item;
nd->u.shop.count = snd->u.shop.count;
@@ -3182,7 +3273,10 @@ bool npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd, int
*/
bool npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
{
- ++npc_warp;
+ nullpo_retr(false, nd);
+ nullpo_retr(false, snd);
+
+ ++npc->npc_warp;
nd->u.warp.xs = xs;
nd->u.warp.ys = ys;
nd->u.warp.mapindex = snd->u.warp.mapindex;
@@ -3211,6 +3305,9 @@ bool npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd, int
*/
bool npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options)
{
+ nullpo_retr(false, nd);
+ nullpo_retr(false, snd);
+
nd->src_id = snd->bl.id;
switch (nd->subtype) {
case SCRIPT:
@@ -3276,6 +3373,8 @@ const char *npc_parse_duplicate(const char *w1, const char *w2, const char *w3,
struct npc_data* dnd;
end = strchr(start,'\n');
+ nullpo_retr(end, w2);
+ nullpo_retr(end, w4);
length = strlen(w2);
// get the npc being duplicated
@@ -3360,7 +3459,13 @@ int npc_duplicate4instance(struct npc_data *snd, int16 m)
int dm = -1, im = -1, xs = -1, ys = -1;
struct npc_data *nd = NULL;
- if( m == -1 || map->list[m].instance_id == -1 )
+ if (m == -1)
+ return 1;
+
+ Assert_retr(1, m >= 0 && m < map->count);
+ nullpo_retr(1, snd);
+
+ if (map->list[m].instance_id == -1)
return 1;
snprintf(newname, ARRAYLENGTH(newname), "dup_%d_%d", map->list[m].instance_id, snd->bl.id);
@@ -3404,10 +3509,15 @@ int npc_duplicate4instance(struct npc_data *snd, int16 m)
}
//Set mapcell CELL_NPC to trigger event later
-void npc_setcells(struct npc_data* nd) {
- int16 m = nd->bl.m, x = nd->bl.x, y = nd->bl.y, xs, ys;
+void npc_setcells(struct npc_data* nd)
+{
+ int16 m, x, y, xs, ys;
int i,j;
+ nullpo_retv(nd);
+ m = nd->bl.m;
+ x = nd->bl.x;
+ y = nd->bl.y;
switch(nd->subtype) {
case WARP:
xs = nd->u.warp.xs;
@@ -3449,9 +3559,13 @@ int npc_unsetcells_sub(struct block_list *bl, va_list ap)
}
void npc_unsetcells(struct npc_data* nd) {
- int16 m = nd->bl.m, x = nd->bl.x, y = nd->bl.y, xs, ys;
+ int16 m, x, y, xs, ys;
int i,j, x0, x1, y0, y1;
+ nullpo_retv(nd);
+ m = nd->bl.m;
+ x = nd->bl.x;
+ y = nd->bl.y;
switch(nd->subtype) {
case WARP:
xs = nd->u.warp.xs;
@@ -3486,7 +3600,9 @@ void npc_unsetcells(struct npc_data* nd) {
void npc_movenpc(struct npc_data* nd, int16 x, int16 y)
{
- const int16 m = nd->bl.m;
+ int16 m;
+ nullpo_retv(nd);
+ m = nd->bl.m;
if (m < 0 || nd->bl.prev == NULL) return; //Not on a map.
x = cap_value(x, 0, map->list[m].xs-1);
@@ -3504,6 +3620,7 @@ void npc_movenpc(struct npc_data* nd, int16 x, int16 y)
void npc_setdisplayname(struct npc_data* nd, const char* newname)
{
nullpo_retv(nd);
+ nullpo_retv(newname);
safestrncpy(nd->name, newname, sizeof(nd->name));
if( map->list[nd->bl.m].users )
@@ -3538,6 +3655,7 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c
size_t len;
nullpo_ret(sd);
+ nullpo_ret(message);
if( ev == NULL || (nd = ev->nd) == NULL ) {
ShowError("npc_event: event not found [%s]\n", eventname);
@@ -3561,7 +3679,7 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c
}
st = script->alloc_state(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id);
- script->setd_sub(st, NULL, ".@atcmd_command$", 0, (void *)command, NULL);
+ script->setd_sub(st, NULL, ".@atcmd_command$", 0, command, NULL);
len = strlen(message);
if (len) {
@@ -3617,12 +3735,19 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c
*/
const char *npc_parse_function(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval)
{
- DBMap* func_db;
- DBData old_data;
+ struct DBMap *func_db;
+ struct DBData old_data;
struct script_code *scriptroot;
const char* end;
const char* script_start;
+ nullpo_retr(NULL, w1);
+ nullpo_retr(NULL, w2);
+ nullpo_retr(NULL, w3);
+ nullpo_retr(NULL, w4);
+ nullpo_retr(NULL, start);
+ nullpo_retr(NULL, retval);
+
script_start = strstr(start,"\t{");
end = strchr(start,'\n');
if( *w4 != '{' || script_start == NULL || (end != NULL && script_start > end) ) {
@@ -3650,7 +3775,7 @@ const char *npc_parse_function(const char *w1, const char *w2, const char *w3, c
struct script_code *oldscript = (struct script_code*)DB->data2ptr(&old_data);
ShowWarning("npc_parse_function: Overwriting user function [%s] in file '%s', line '%d'.\n", w3, filepath, strline(buffer,start-buffer));
script->free_vars(oldscript->local.vars);
- aFree(oldscript->script_buf);
+ VECTOR_CLEAR(oldscript->script_buf);
aFree(oldscript);
}
@@ -3666,6 +3791,7 @@ void npc_parse_mob2(struct spawn_data* mobspawn)
{
int i;
+ nullpo_retv(mobspawn);
for( i = mobspawn->active; i < mobspawn->num; ++i ) {
struct mob_data* md = mob->spawn_dataset(mobspawn);
md->spawn = mobspawn;
@@ -3699,6 +3825,11 @@ const char *npc_parse_mob(const char *w1, const char *w2, const char *w3, const
struct spawn_data mobspawn, *data;
struct mob_db* db;
+ nullpo_retr(strchr(start,'\n'), w1);
+ nullpo_retr(strchr(start,'\n'), w2);
+ nullpo_retr(strchr(start,'\n'), w3);
+ nullpo_retr(strchr(start,'\n'), w4);
+
memset(&mobspawn, 0, sizeof(struct spawn_data));
mobspawn.state.boss = (strcmp(w2,"boss_monster") == 0 ? 1 : 0);
@@ -3841,7 +3972,7 @@ const char *npc_parse_mob(const char *w1, const char *w2, const char *w3, const
// spawn / cache the new mobs
if( battle_config.dynamic_mobs && map->addmobtolist(data->m, data) >= 0 ) {
data->state.dynamic = true;
- npc_cache_mob += data->num;
+ npc->npc_cache_mob += data->num;
// check if target map has players
// (usually shouldn't occur when map server is just starting,
@@ -3852,10 +3983,10 @@ const char *npc_parse_mob(const char *w1, const char *w2, const char *w3, const
} else {
data->state.dynamic = false;
npc->parse_mob2(data);
- npc_delay_mob += data->num;
+ npc->npc_delay_mob += data->num;
}
- npc_mob++;
+ npc->npc_mob++;
return strchr(start,'\n');// continue
}
@@ -3905,6 +4036,9 @@ const char *npc_parse_mapflag(const char *w1, const char *w2, const char *w3, co
char mapname[32];
int state = 1;
+ nullpo_retr(strchr(start,'\n'), w1);
+ nullpo_retr(strchr(start,'\n'), w3);
+
// w1=<mapname>
if( sscanf(w1, "%31[^,]", mapname) != 1 )
{
@@ -4329,6 +4463,7 @@ const char *npc_parse_mapflag(const char *w1, const char *w2, const char *w3, co
*/
const char *npc_parse_unknown_object(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval)
{
+ nullpo_retr(start, retval);
ShowError("npc_parsesrcfile: Unable to parse, probably a missing or extra TAB in file '%s', line '%d'. Skipping line...\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4);
start = strchr(start,'\n');// skip and continue
*retval = EXIT_FAILURE;
@@ -4353,6 +4488,8 @@ int npc_parsesrcfile(const char* filepath, bool runOnInit) {
char* buffer;
const char* p;
+ nullpo_retr(EXIT_FAILURE, filepath);
+
// read whole file to buffer
fp = fopen(filepath, "rb");
if( fp == NULL ) {
@@ -4536,7 +4673,7 @@ int npc_script_event(struct map_session_data* sd, enum npce_event type)
if (type == NPCE_MAX)
return 0;
if (!sd) {
- ShowError("npc_script_event: NULL sd. Event Type %d\n", type);
+ ShowError("npc_script_event: NULL sd. Event Type %u\n", type);
return 0;
}
for (i = 0; i<script_event[type].event_count; i++)
@@ -4561,11 +4698,10 @@ void npc_read_event_script(void)
{"Kill NPC Event",script->config.kill_mob_event_name},
};
- for (i = 0; i < NPCE_MAX; i++)
- {
- DBIterator* iter;
- DBKey key;
- DBData *data;
+ for (i = 0; i < NPCE_MAX; i++) {
+ struct DBIterator *iter;
+ union DBKey key;
+ struct DBData *data;
char name[64]="::";
safestrncpy(name+2,config[i].event_name,62);
@@ -4608,9 +4744,10 @@ void npc_read_event_script(void)
/**
* @see DBApply
*/
-int npc_path_db_clear_sub(DBKey key, DBData *data, va_list args)
+int npc_path_db_clear_sub(union DBKey key, struct DBData *data, va_list args)
{
struct npc_path_data *npd = DB->data2ptr(data);
+ nullpo_ret(npd);
if (npd->path)
aFree(npd->path);
return 0;
@@ -4619,7 +4756,7 @@ int npc_path_db_clear_sub(DBKey key, DBData *data, va_list args)
/**
* @see DBApply
*/
-int npc_ev_label_db_clear_sub(DBKey key, DBData *data, va_list args)
+int npc_ev_label_db_clear_sub(union DBKey key, struct DBData *data, va_list args)
{
struct linkdb_node **label_linkdb = DB->data2ptr(data);
linkdb_final(label_linkdb); // linked data (struct event_data*) is freed when clearing ev_db
@@ -4646,12 +4783,12 @@ void npc_process_files( int npc_min ) {
"\t-'"CL_WHITE"%d"CL_RESET"' Spawn sets\n"
"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Cached\n"
"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
- npc_id - npc_min, npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
+ npc->npc_id - npc_min, npc->npc_warp, npc->npc_shop, npc->npc_script, npc->npc_mob, npc->npc_cache_mob, npc->npc_delay_mob);
}
//Clear then reload npcs files
int npc_reload(void) {
- int npc_new_min = npc_id;
+ int npc_new_min = npc->npc_id;
struct s_mapiterator* iter;
struct block_list* bl;
@@ -4667,9 +4804,9 @@ int npc_reload(void) {
db_clear(npc->ev_db);
npc->ev_label_db->clear(npc->ev_label_db, npc->ev_label_db_clear_sub);
- npc_last_npd = NULL;
- npc_last_path = NULL;
- npc_last_ref = NULL;
+ npc->npc_last_npd = NULL;
+ npc->npc_last_path = NULL;
+ npc->npc_last_ref = NULL;
//Remove all npcs/mobs. [Skotlex]
iter = mapit_geteachiddb();
@@ -4709,8 +4846,8 @@ int npc_reload(void) {
// clear mob spawn lookup index
mob->clear_spawninfo();
- npc_warp = npc_shop = npc_script = 0;
- npc_mob = npc_cache_mob = npc_delay_mob = 0;
+ npc->npc_warp = npc->npc_shop = npc->npc_script = 0;
+ npc->npc_mob = npc->npc_cache_mob = npc->npc_delay_mob = 0;
// reset mapflags
map->flags_init();
@@ -4748,11 +4885,14 @@ int npc_reload(void) {
}
//Unload all npc in the given file
-bool npc_unloadfile( const char* filepath ) {
- DBIterator * iter = db_iterator(npc->name_db);
+bool npc_unloadfile(const char *filepath)
+{
+ struct DBIterator *iter = db_iterator(npc->name_db);
struct npc_data* nd = NULL;
bool found = false;
+ nullpo_retr(false, filepath);
+
for( nd = dbi_first(iter); dbi_exists(iter); nd = dbi_next(iter) ) {
if( nd->path && strcasecmp(nd->path,filepath) == 0 ) { // FIXME: This can break in case-sensitive file systems
found = true;
@@ -4791,6 +4931,9 @@ int do_final_npc(void) {
void npc_debug_warps_sub(struct npc_data* nd) {
int16 m;
+
+ nullpo_retv(nd);
+
if (nd->bl.type != BL_NPC || nd->subtype != WARP || nd->bl.m < 0)
return;
@@ -4827,32 +4970,26 @@ static void npc_debug_warps(void) {
int do_init_npc(bool minimal) {
int i;
- memset(&npc->base_ud, 0, sizeof( struct unit_data) );
- npc->base_ud.bl = NULL;
- npc->base_ud.walktimer = INVALID_TIMER;
- npc->base_ud.skilltimer = INVALID_TIMER;
- npc->base_ud.attacktimer = INVALID_TIMER;
- npc->base_ud.attackabletime =
- npc->base_ud.canact_tick =
- npc->base_ud.canmove_tick = timer->gettick();
+ unit->init_ud(&npc->base_ud);
+ npc->base_ud.bl = NULL;
//Stock view data for normal npcs.
memset(&npc_viewdb, 0, sizeof(npc_viewdb));
- npc_viewdb[0].class_ = INVISIBLE_CLASS; //Invisible class is stored here.
+ npc_viewdb[0].class = INVISIBLE_CLASS; //Invisible class is stored here.
for( i = 1; i < MAX_NPC_CLASS; i++ )
- npc_viewdb[i].class_ = i;
+ npc_viewdb[i].class = i;
for( i = MAX_NPC_CLASS2_START; i < MAX_NPC_CLASS2_END; i++ )
- npc_viewdb2[i - MAX_NPC_CLASS2_START].class_ = i;
+ npc_viewdb2[i - MAX_NPC_CLASS2_START].class = i;
npc->ev_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, EVENT_NAME_LENGTH);
npc->ev_label_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, NAME_LENGTH);
npc->name_db = strdb_alloc(DB_OPT_BASE, NAME_LENGTH);
npc->path_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, 0);
- npc_last_npd = NULL;
- npc_last_path = NULL;
- npc_last_ref = NULL;
+ npc->npc_last_npd = NULL;
+ npc->npc_last_path = NULL;
+ npc->npc_last_ref = NULL;
// Should be loaded before npc processing, otherwise labels could overwrite constant values
// and lead to undefined behavior [Panikon]
@@ -4881,12 +5018,6 @@ int do_init_npc(bool minimal) {
timer->add_func_list(npc->timerevent,"npc_timerevent");
}
- if( script->lang_export_fp ) {
- ShowInfo("Lang exported to '%s'\n",script->lang_export_file);
- fclose(script->lang_export_fp);
- script->lang_export_fp = NULL;
- }
-
// Init dummy NPC
CREATE(npc->fake_nd, struct npc_data, 1);
npc->fake_nd->bl.m = -1;
@@ -4896,7 +5027,7 @@ int do_init_npc(bool minimal) {
strcpy(npc->fake_nd->name,"FAKE_NPC");
memcpy(npc->fake_nd->exname, npc->fake_nd->name, 9);
- npc_script++;
+ npc->npc_script++;
npc->fake_nd->bl.type = BL_NPC;
npc->fake_nd->subtype = SCRIPT;
@@ -4910,6 +5041,17 @@ int do_init_npc(bool minimal) {
void npc_defaults(void) {
npc = &npc_s;
+ npc->npc_id = START_NPC_NUM;
+ npc->npc_warp = 0;
+ npc->npc_shop = 0;
+ npc->npc_script = 0;
+ npc->npc_mob = 0;
+ npc->npc_delay_mob = 0;
+ npc->npc_cache_mob = 0;
+ npc->npc_last_path = NULL;
+ npc->npc_last_ref = NULL;
+ npc->npc_last_npd = NULL;
+
npc->motd = NULL;
npc->ev_db = NULL;
npc->ev_label_db = NULL;
diff --git a/src/map/npc.h b/src/map/npc.h
index 568ddfe87..3bd11d536 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -27,7 +27,11 @@
#include "common/hercules.h"
#include "common/db.h"
+#include <pcre.h>
+
+/* Forward declarations */
struct hplugin_data_store;
+struct itemlist; // map/itemdb.h
struct view_data;
enum npc_parse_options {
@@ -121,7 +125,6 @@ struct npc_data {
struct hplugin_data_store *hdata; ///< HPM Plugin Data Store
};
-
#define START_NPC_NUM 110000000
enum actor_classes {
@@ -138,7 +141,7 @@ enum actor_classes {
#define MAX_NPC_CLASS 1000
// New NPC range
#define MAX_NPC_CLASS2_START 10001
-#define MAX_NPC_CLASS2_END 10178
+#define MAX_NPC_CLASS2_END 10248
//Script NPC events.
enum npce_event {
@@ -173,10 +176,10 @@ struct npc_path_data {
struct npc_interface {
/* */
struct npc_data *motd;
- DBMap *ev_db; // const char* event_name -> struct event_data*
- DBMap *ev_label_db; // const char* label_name (without leading "::") -> struct linkdb_node** (key: struct npc_data*; data: struct event_data*)
- DBMap *name_db; // const char* npc_name -> struct npc_data*
- DBMap *path_db;
+ struct DBMap *ev_db; // const char* event_name -> struct event_data*
+ struct DBMap *ev_label_db; // const char* label_name (without leading "::") -> struct linkdb_node** (key: struct npc_data*; data: struct event_data*)
+ struct DBMap *name_db; // const char* npc_name -> struct npc_data*
+ struct DBMap *path_db;
struct eri *timer_event_ers; //For the npc timer data. [Skotlex]
struct npc_data *fake_nd;
struct npc_src_list *src_files;
@@ -184,6 +187,16 @@ struct npc_interface {
/* npc trader global data, for ease of transition between the script, cleared on every usage */
bool trader_ok;
int trader_funds[2];
+ int npc_id;
+ int npc_warp;
+ int npc_shop;
+ int npc_script;
+ int npc_mob;
+ int npc_delay_mob;
+ int npc_cache_mob;
+ const char *npc_last_path;
+ const char *npc_last_ref;
+ struct npc_path_data *npc_last_npd;
/* */
int (*init) (bool minimal);
int (*final) (void);
@@ -199,7 +212,7 @@ struct npc_interface {
int (*enable) (const char *name, int flag);
struct npc_data* (*name2id) (const char *name);
int (*event_dequeue) (struct map_session_data *sd);
- DBData (*event_export_create) (DBKey key, va_list args);
+ struct DBData (*event_export_create) (union DBKey key, va_list args);
int (*event_export) (struct npc_data *nd, int i);
int (*event_sub) (struct map_session_data *sd, struct event_data *ev, const char *eventname);
void (*event_doall_sub) (void *key, void *data, va_list ap);
@@ -228,15 +241,15 @@ struct npc_interface {
int (*click) (struct map_session_data *sd, struct npc_data *nd);
int (*scriptcont) (struct map_session_data *sd, int id, bool closing);
int (*buysellsel) (struct map_session_data *sd, int id, int type);
- int (*cashshop_buylist) (struct map_session_data *sd, int points, int count, unsigned short *item_list);
- int (*buylist_sub) (struct map_session_data *sd, int n, unsigned short *item_list, struct npc_data *nd);
+ int (*cashshop_buylist) (struct map_session_data *sd, int points, struct itemlist *item_list);
+ int (*buylist_sub) (struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd);
int (*cashshop_buy) (struct map_session_data *sd, int nameid, int amount, int points);
- int (*buylist) (struct map_session_data *sd, int n, unsigned short *item_list);
- int (*selllist_sub) (struct map_session_data *sd, int n, unsigned short *item_list, struct npc_data *nd);
- int (*selllist) (struct map_session_data *sd, int n, unsigned short *item_list);
+ int (*buylist) (struct map_session_data *sd, struct itemlist *item_list);
+ int (*selllist_sub) (struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd);
+ int (*selllist) (struct map_session_data *sd, struct itemlist *item_list);
int (*remove_map) (struct npc_data *nd);
- int (*unload_ev) (DBKey key, DBData *data, va_list ap);
- int (*unload_ev_label) (DBKey key, DBData *data, va_list ap);
+ int (*unload_ev) (union DBKey key, struct DBData *data, va_list ap);
+ int (*unload_ev_label) (union DBKey key, struct DBData *data, va_list ap);
int (*unload_dup_sub) (struct npc_data *nd, va_list args);
void (*unload_duplicates) (struct npc_data *nd);
int (*unload) (struct npc_data *nd, bool single);
@@ -278,8 +291,8 @@ struct npc_interface {
int (*parsesrcfile) (const char *filepath, bool runOnInit);
int (*script_event) (struct map_session_data *sd, enum npce_event type);
void (*read_event_script) (void);
- int (*path_db_clear_sub) (DBKey key, DBData *data, va_list args);
- int (*ev_label_db_clear_sub) (DBKey key, DBData *data, va_list args);
+ int (*path_db_clear_sub) (union DBKey key, struct DBData *data, va_list args);
+ int (*ev_label_db_clear_sub) (union DBKey key, struct DBData *data, va_list args);
int (*reload) (void);
bool (*unloadfile) (const char *filepath);
void (*do_clear_npc) (void);
@@ -289,7 +302,7 @@ struct npc_interface {
void (*trader_count_funds) (struct npc_data *nd, struct map_session_data *sd);
bool (*trader_pay) (struct npc_data *nd, struct map_session_data *sd, int price, int points);
void (*trader_update) (int master);
- int (*market_buylist) (struct map_session_data* sd, unsigned short list_size, struct packet_npc_market_purchase *p);
+ int (*market_buylist) (struct map_session_data *sd, struct itemlist *item_list);
bool (*trader_open) (struct map_session_data *sd, struct npc_data *nd);
void (*market_fromsql) (void);
void (*market_tosql) (struct npc_data *nd, unsigned short index);
@@ -308,9 +321,6 @@ void npc_defaults(void);
HPShared struct npc_interface *npc;
-/* comes from npc_chat.c */
-#include <pcre/include/pcre.h>
-
/**
* Structure containing all info associated with a single pattern block
*/
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 001baf3ea..b8caa5df3 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -31,8 +31,7 @@
#include "common/strlib.h"
#include "common/timer.h"
-#include <pcre/include/pcre.h>
-
+#include <pcre.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -101,6 +100,7 @@ struct pcre_interface *libpcre;
*/
void finalize_pcrematch_entry(struct pcrematch_entry* e)
{
+ nullpo_retv(e);
libpcre->free(e->pcre_);
libpcre->free(e->pcre_extra_);
aFree(e->pattern);
@@ -112,7 +112,10 @@ void finalize_pcrematch_entry(struct pcrematch_entry* e)
*/
struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) {
struct pcrematch_set *pcreset;
- struct npc_parse *npcParse = nd->chatdb;
+ struct npc_parse *npcParse;
+
+ nullpo_retr(NULL, nd);
+ npcParse = nd->chatdb;
if (npcParse == NULL)
nd->chatdb = npcParse = (struct npc_parse *)aCalloc(sizeof(struct npc_parse), 1);
@@ -152,7 +155,9 @@ struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) {
void activate_pcreset(struct npc_data* nd, int setid)
{
struct pcrematch_set *pcreset;
- struct npc_parse *npcParse = nd->chatdb;
+ struct npc_parse *npcParse;
+ nullpo_retv(nd);
+ npcParse = nd->chatdb;
if (npcParse == NULL)
return; // Nothing to activate...
pcreset = npcParse->inactive;
@@ -185,7 +190,9 @@ void activate_pcreset(struct npc_data* nd, int setid)
void deactivate_pcreset(struct npc_data* nd, int setid)
{
struct pcrematch_set *pcreset;
- struct npc_parse *npcParse = nd->chatdb;
+ struct npc_parse *npcParse;
+ nullpo_retv(nd);
+ npcParse = nd->chatdb;
if (npcParse == NULL)
return; // Nothing to deactivate...
if (setid == -1) {
@@ -222,7 +229,9 @@ void delete_pcreset(struct npc_data* nd, int setid)
{
int active = 1;
struct pcrematch_set *pcreset;
- struct npc_parse *npcParse = nd->chatdb;
+ struct npc_parse *npcParse;
+ nullpo_retv(nd);
+ npcParse = nd->chatdb;
if (npcParse == NULL)
return; // Nothing to deactivate...
pcreset = npcParse->active;
@@ -270,8 +279,12 @@ void delete_pcreset(struct npc_data* nd, int setid)
*/
struct pcrematch_entry* create_pcrematch_entry(struct pcrematch_set* set)
{
- struct pcrematch_entry * e = (struct pcrematch_entry *) aCalloc(sizeof(struct pcrematch_entry), 1);
- struct pcrematch_entry * last = set->head;
+ struct pcrematch_entry *e;
+ struct pcrematch_entry *last;
+
+ nullpo_retr(NULL, set);
+ e = (struct pcrematch_entry *)aCalloc(sizeof(struct pcrematch_entry), 1);
+ last = set->head;
// Normally we would have just stuck it at the end of the list but
// this doesn't sink up with peoples usage pattern. They wanted
@@ -304,6 +317,7 @@ void npc_chat_def_pattern(struct npc_data* nd, int setid, const char* pattern, c
struct pcrematch_set * s = npc_chat->lookup_pcreset(nd, setid);
struct pcrematch_entry *e = npc_chat->create_pcrematch_entry(s);
+ nullpo_retv(e);
e->pattern = aStrdup(pattern);
e->label = aStrdup(label);
e->pcre_ = libpcre->compile(pattern, PCRE_CASELESS, &err, &erroff, NULL);
@@ -318,7 +332,10 @@ void npc_chat_def_pattern(struct npc_data* nd, int setid, const char* pattern, c
*/
void npc_chat_finalize(struct npc_data* nd)
{
- struct npc_parse *npcParse = nd->chatdb;
+ struct npc_parse *npcParse;
+
+ nullpo_retv(nd);
+ npcParse = nd->chatdb;
if (npcParse == NULL)
return;
@@ -359,6 +376,8 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
len = va_arg(ap,int);
sd = va_arg(ap,struct map_session_data *);
+ nullpo_ret(sd);
+
// iterate across all active sets
for (pcreset = npcParse->active; pcreset != NULL; pcreset = pcreset->next)
{
@@ -374,7 +393,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
// save out the matched strings
for (i = 0; i < r; i++)
{
- char var[6], val[255];
+ char var[15], val[255];
snprintf(var, sizeof(var), "$@p%i$", i);
libpcre->copy_substring(msg, offsets, r, i, val, sizeof(val));
script->set_var(sd, var, val);
diff --git a/src/map/packets.h b/src/map/packets.h
index 0badd94f5..0a774561d 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -1868,15 +1868,111 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0859,-1);
#endif
+// 2010-12-21aRagexe
+#if PACKETVER >= 20101221
+// shuffle packets not added
+// new packets
+ packet(0x08b1,-1); // ZC_MCSTORE_NOTMOVEITEM_LIST
+#endif
+
+// 2011-01-11aRagexe
+#if PACKETVER >= 20110111
+// shuffle packets not added
+// new packets
+ packet(0x08b3,-1); // ZC_SHOWSCRIPT
+#endif
+
+// 2011-01-25aRagexe
+#if PACKETVER >= 20110125
+// shuffle packets not added
+// new packets
+ packet(0x08b4,2); // ZC_START_COLLECTION
+ packet(0x08b5,6,clif->pDull,2); // CZ_TRYCOLLECTION
+ packet(0x08b6,3); // ZC_TRYCOLLECTION
+#endif
+
+// 2011-01-31aRagexe
+#if PACKETVER >= 20110131
+// shuffle packets not added
+// new packets
+ packet(0x02f3,-1,clif->pDull); // CZ_IRMAIL_SEND
+ packet(0x02f4,3); // ZC_IRMAIL_SEND_RES
+ packet(0x02f5,7); // ZC_IRMAIL_NOTIFY
+ packet(0x02f6,7,clif->pDull,2); // CZ_IRMAIL_LIST
+#endif
+
+// 2011-02-22aRagexe
+#if PACKETVER >= 20110222
+// shuffle packets not added
+// new packets
+ packet(0x08c0,-1); // ZC_ACK_SE_CASH_ITEM_LIST2
+ packet(0x08c1,2,clif->pDull); // CZ_MACRO_START
+ packet(0x08c2,2,clif->pDull); // CZ_MACRO_STOP
+#endif
+
+// 2011-04-19aRagexe
+#if PACKETVER >= 20110419
+// shuffle packets not added
+// new packets
+ packet(0x08c7,-1); // ZC_SKILL_ENTRY3
+#endif
+
+// 2011-06-14aRagexe
+#if PACKETVER >= 20110614
+// shuffle packets not added
+// new packets
+ packet(0x08c8,34); // ZC_NOTIFY_ACT3
+ packet(0x08c9,2,clif->pCashShopSchedule,0);
+ packet(0x08ca,-1); // ZC_ACK_SCHEDULER_CASHITEM
+#endif
+
+// 2011-06-27aRagexe
+#if PACKETVER >= 20110627
+// shuffle packets not added
+// new packets
+ packet(0x08cb,-1); // ZC_PERSONAL_INFOMATION
+#endif
+
//2011-07-18aRagexe (Thanks to Yommy!)
#if PACKETVER >= 20110718
+// shuffle packets not added
packet(0x0844,2,clif->pCashShopOpen,2);/* tell server cashshop window is being open */
packet(0x084a,2,clif->pCashShopClose,2);/* tell server cashshop window is being closed */
packet(0x0846,4,clif->pCashShopReqTab,2);
- packet(0x08c9,2,clif->pCashShopSchedule,0);
packet(0x0848,-1,clif->pCashShopBuy,2);
#endif
+// 2011-08-02aRagexe
+#if PACKETVER >= 20110802
+// shuffle packets not added
+// new packets
+ packet(0x09dc,2); // unknown
+#endif
+
+// 2011-08-09aRagexe
+#if PACKETVER >= 20110809
+// shuffle packets not added
+// new packets
+ packet(0x08cf,10); // ZC_SPIRITS_ATTRIBUTE
+ packet(0x08d0,9); // ZC_REQ_WEAR_EQUIP_ACK2
+ packet(0x08d1,7); // ZC_REQ_TAKEOFF_EQUIP_ACK2
+ packet(0x08d2,10); // ZC_FASTMOVE
+#endif
+
+// 2011-08-16aRagexe
+#if PACKETVER >= 20110816
+// shuffle packets not added
+// new packets
+ packet(0x08d3,10); // ZC_SE_CASHSHOP_UPDATE
+#endif
+
+// 2011-09-28aRagexe
+#if PACKETVER >= 20110928
+// shuffle packets not added
+// new packets
+ packet(0x08d6,6); // ZC_CLEAR_DIALOG
+#endif
+
//2011-10-05aRagexeRE
#if PACKETVER >= 20111005
packet(0x0364,5,clif->pWalkToXY,2);
@@ -1891,7 +1987,6 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x088a,6,clif->pGetCharNameRequest,2);
packet(0x0838,6,clif->pSolveCharName,2);
packet(0x0439,8,clif->pUseItem,2,4);
- packet(0x08d2,10);
packet(0x08d7,28,clif->pBGQueueRegister,2);
packet(0x090a,26,clif->pBGQueueCheckState,2);
packet(0x08da,26,clif->pBGQueueRevokeReq,2);
@@ -1954,6 +2049,8 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
packet(0x0439,8,clif->pUseItem,2,4);
+// changed packet sizes
+ packet(0x08e2,27); // ZC_NAVIGATION_ACTIVE
#endif
//2012-04-10aRagexeRE
@@ -2021,7 +2118,6 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x08FB,6,clif->pDull,2); //bookingcanceljoinparty
packet(0x0907,5,clif->pMoveItem,2,4);
packet(0x0908,5);
- packet(0x08CF,10);//Amulet spirits
packet(0x0977,14);//Monster HP Bar
#endif
@@ -2042,18 +2138,28 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x096A,6,clif->pGetCharNameRequest,2);
packet(0x0368,6,clif->pSolveCharName,2);
packet(0x08E5,41,clif->pPartyRecruitRegisterReq,2,4);
- packet(0x08d2,10);
packet(0x0916,26,clif->pGuildInvite2,2);
#endif
+// 2012-05-02aRagexeRE
+#if PACKETVER >= 20120502
+// shuffle packets not added
+ packet(0x097d,288); // ZC_ACK_RANKING
+ packet(0x097e,12); // ZC_UPDATE_RANKING_POINT
+ packet(0x097f,-1); // ZC_SELECTCART
+ packet(0x0980,7,clif->pSelectCart); // CZ_SELECTCART
+#endif
+
#ifndef PACKETVER_RE
#if PACKETVER >= 20120604
+// shuffle packets not added
packet(0x0861,18,clif->pPartyRecruitRegisterReq,2,4,6);
#endif
#endif
//2012-06-18aRagexeRE
#if PACKETVER >= 20120618
+// shuffle packets not added
packet(0x0983,29);
#endif
@@ -2112,6 +2218,46 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
packet(0x096A,6,clif->pGetCharNameRequest,2);
packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2012-09-25aRagexe
+#if PACKETVER >= 20120925
+// new packets (not all)
+ packet(0x0998,8,clif->pEquipItem,2,4);
+#endif
+
+// 2013-02-06aRagexe
+#if PACKETVER >= 20130206
+// new packets
+ packet(0x09a4,18); // ZC_DISPATCH_TIMING_INFO_CHN
+// changed packet sizes
+#endif
+
+// 2013-03-06aRagexe
+#if PACKETVER >= 20130306
+// new packets
+ packet(0x09a6,12); // ZC_BANKING_CHECK
+ packet(0x09a7,14,clif->pDull/*,XXX*/); // CZ_REQ_BANKING_DEPOSIT
+ packet(0x09a8,4); // ZC_ACK_BANKING_DEPOSIT
+ packet(0x09a9,14,clif->pDull/*,XXX*/); // CZ_REQ_BANKING_WITHDRAW
+ packet(0x09aa,4); // ZC_ACK_BANKING_WITHDRAW
+// changed packet sizes
+#endif
+
+// 2013-03-13aRagexe
+#if PACKETVER >= 20130313
+// new packets
+ packet(0x09ab,-1,clif->pDull/*,XXX*/); // CZ_REQ_BANKING_CHECK
+ packet(0x09ac,20,clif->pDull/*,XXX*/); // CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO
+ packet(0x09ad,6); // ZC_ACK_CASH_BARGAIN_SALE_ITEM_INFO
+ packet(0x09ae,-1,clif->pDull/*,XXX*/); // CZ_REQ_APPLY_BARGAIN_SALE_ITEM
+ packet(0x09af,-1); // ZC_ACK_APPLY_BARGAIN_SALE_ITEM
+ packet(0x09b0,8,clif->pDull/*,XXX*/); // CZ_REQ_REMOVE_BARGAIN_SALE_ITEM
+ packet(0x09b1,6); // ZC_ACK_REMOVE_BARGAIN_SALE_ITEM
+ packet(0x09b2,-1); // ZC_NOTIFY_BARGAIN_SALE_SELLING
+// changed packet sizes
#endif
//2013-03-20Ragexe (Judas + Yommy)
@@ -2142,23 +2288,46 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x085D,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- //packet(0x095A,8); // unknown usage
packet(0x0868,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0888,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x086D,26,clif->pPartyInvite2,2);
- //packet(0x0890,4); // unknown usage
packet(0x086F,26,clif->pFriendsListAdd,2);
packet(0x093F,5,clif->pHomMenu,2,4);
packet(0x0947,36,clif->pStoragePassword,0);
+ packet(0x0890,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x095a,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
// Shuffle End
- // New Packets
- packet(0x0998,8,clif->pEquipItem,2,4);
+ // New Packets (wrong version or packet not exists)
packet(0x0447,2); // PACKET_CZ_BLOCKING_PLAY_CANCEL
packet(0x099f,24);
// New Packets End
#endif
+#if PACKETVER >= 20130320
+// new packets
+// changed packet sizes
+ packet(0x09a7,10,clif->pBankDeposit,2,4,6); // CZ_REQ_BANKING_DEPOSIT
+ packet(0x09a8,12); // ZC_ACK_BANKING_DEPOSIT
+ packet(0x09a9,10,clif->pBankWithdraw,2,4,6); // CZ_REQ_BANKING_WITHDRAW
+ packet(0x09aa,12); // ZC_ACK_BANKING_WITHDRAW
+ packet(0x09ab,6,clif->pBankCheck,2,4); // CZ_REQ_BANKING_CHECK
+#endif
+
+// 2013-03-27bRagexe
+#if PACKETVER >= 20130327
+// new packets
+ packet(0x09ac,-1,clif->pDull/*,XXX*/); // CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO
+ packet(0x09ad,10); // ZC_ACK_CASH_BARGAIN_SALE_ITEM_INFO
+ packet(0x09ae,17,clif->pDull/*,XXX*/); // CZ_REQ_APPLY_BARGAIN_SALE_ITEM
+ packet(0x09af,4); // ZC_ACK_APPLY_BARGAIN_SALE_ITEM
+ packet(0x09b0,8,clif->pDull/*,XXX*/); // CZ_REQ_REMOVE_BARGAIN_SALE_ITEM
+ packet(0x09b1,4); // ZC_ACK_REMOVE_BARGAIN_SALE_ITEM
+ packet(0x09b2,6); // ZC_NOTIFY_BARGAIN_SALE_SELLING
+ packet(0x09b3,6); // ZC_NOTIFY_BARGAIN_SALE_CLOSE
+// changed packet sizes
+#endif
+
//2013-05-15aRagexe (Shakto)
#if PACKETVER >= 20130515
// Shuffle Start
@@ -2187,14 +2356,14 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x092D,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- //packet(0x08AA,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0963,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0943,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0947,26,clif->pPartyInvite2,2);
- //packet(0x0862,4); // CZ_GANGSI_RANK
packet(0x0962,26,clif->pFriendsListAdd,2);
packet(0x0931,5,clif->pHomMenu,2,4);
packet(0x093E,36,clif->pStoragePassword,0);
+ packet(0x0862,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x08aa,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
// Shuffle End
#endif
@@ -2226,14 +2395,14 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x089B,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- //packet(0x0965,8); // CZ_JOIN_BATTLE_FIELD
packet(0x086A,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x08A9,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0950,26,clif->pPartyInvite2,2);
- //packet(0x08AC,4); // CZ_GANGSI_RANK
packet(0x0362,26,clif->pFriendsListAdd,2);
packet(0x0926,5,clif->pHomMenu,2,4);
packet(0x088E,36,clif->pStoragePassword,0);
+ packet(0x08ac,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x0965,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
// Shuffle End
#endif
@@ -2264,14 +2433,14 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x0874,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x088E,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0958,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0919,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x08A8,26,clif->pPartyInvite2,2);
- // packet(0x0888,4); // CZ_GANGSI_RANK
packet(0x0877,26,clif->pFriendsListAdd,2);
packet(0x023B,5,clif->pHomMenu,2,4);
packet(0x0956,36,clif->pStoragePassword,0);
+ packet(0x0888,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x088e,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
#endif
//2013-06-05Ragexe (Shakto)
@@ -2301,19 +2470,20 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0436,4); // CZ_GANGSI_RANK
packet(0x023B,26,clif->pFriendsListAdd,2);
packet(0x0361,5,clif->pHomMenu,2,4);
packet(0x0883,36,clif->pStoragePassword,0);
packet(0x097C,4,clif->pRanklist);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
#endif
//2013-06-12Ragexe (Shakto)
#if PACKETVER >= 20130612
+// most shuffle packets used from 20130605
packet(0x087E,5,clif->pChangeDir,2,4);
packet(0x0919,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0940,26,clif->pFriendsListAdd,2);
@@ -2348,14 +2518,14 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x08A7,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x087A,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0942,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x095B,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0887,26,clif->pPartyInvite2,2);
- // packet(0x0878,4); // CZ_GANGSI_RANK
packet(0x0953,26,clif->pFriendsListAdd,2);
packet(0x02C4,5,clif->pHomMenu,2,4);
packet(0x0864,36,clif->pStoragePassword,0);
+ packet(0x0878,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x087a,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
#endif
//2013-06-26Ragexe (Shakto)
@@ -2385,14 +2555,14 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x0894,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x0860,8); // CZ_JOIN_BATTLE_FIELD
packet(0x08A5,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x088C,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0895,26,clif->pPartyInvite2,2);
- // packet(0x088F,4); // CZ_GANGSI_RANK
packet(0x08AB,26,clif->pFriendsListAdd,2);
packet(0x0960,5,clif->pHomMenu,2,4);
packet(0x0930,36,clif->pStoragePassword,0);
+ packet(0x0860,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x088f,4,clif->pDull); // CZ_GANGSI_RANK
#endif
//2013-07-03Ragexe (Shakto)
@@ -2410,29 +2580,84 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0436,4); // CZ_GANGSI_RANK
packet(0x0360,26,clif->pFriendsListAdd,2);
packet(0x094A,5,clif->pHomMenu,2,4);
packet(0x0873,36,clif->pStoragePassword,0);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2013-04-17aRagexe
+#if PACKETVER >= 20130417
+// new packets
+ packet(0x09b4,6,clif->pDull/*,XXX*/); // CZ_OPEN_BARGAIN_SALE_TOOL
+ packet(0x09b5,2); // ZC_OPEN_BARGAIN_SALE_TOOL
+ packet(0x09b6,6,clif->pBankOpen,2,4); // CZ_REQ_OPEN_BANKING
+ packet(0x09b7,4); // ZC_ACK_OPEN_BANKING
+ packet(0x09b8,6,clif->pBankClose,2,4); // CZ_REQ_CLOSE_BANKING
+ packet(0x09b9,4); // ZC_ACK_CLOSE_BANKING
+// changed packet sizes
+#endif
+
+// 2013-04-24aRagexe
+#if PACKETVER >= 20130424
+// new packets
+ packet(0x09ba,6,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_GUILD_STORAGE
+ packet(0x09bb,4); // ZC_ACK_OPEN_GUILD_STORAGE
+ packet(0x09bc,6,clif->pDull/*,XXX*/); // CZ_CLOSE_BARGAIN_SALE_TOOL
+ packet(0x09bd,2); // ZC_CLOSE_BARGAIN_SALE_TOOL
+// changed packet sizes
+#endif
+
+// 2013-05-02aRagexe
+#if PACKETVER >= 20130502
+// new packets
+ packet(0x09be,6,clif->pDull/*,XXX*/); // CZ_REQ_CLOSE_GUILD_STORAGE
+ packet(0x09bf,4); // ZC_ACK_CLOSE_GUILD_STORAGE
+// changed packet sizes
+ packet(0x09bb,6); // ZC_ACK_OPEN_GUILD_STORAGE
+#endif
+
+// 2013-05-15aRagexe
+#if PACKETVER >= 20130515
+// new packets
+ packet(0x09c0,11); // ZC_ACTION_MOVE
+ packet(0x09c1,11); // ZC_C_MARKERINFO
+// changed packet sizes
+ packet(0x09a8,16); // ZC_ACK_BANKING_DEPOSIT
+ packet(0x09aa,16); // ZC_ACK_BANKING_WITHDRAW
+#endif
+
+// 2013-05-29Ragexe
+#if PACKETVER >= 20130529
+// new packets
+ packet(0x09c3,8,clif->pDull/*,XXX*/); // CZ_REQ_COUNT_BARGAIN_SALE_ITEM
+// changed packet sizes
#endif
-/* Bank System [Yommy/Hercules] */
-#if PACKETVER >= 20130724
- packet(0x09A6,12); // ZC_BANKING_CHECK
- packet(0x09A7,10,clif->pBankDeposit,2,4,6);
- packet(0x09A8,16); // ZC_ACK_BANKING_DEPOSIT
- packet(0x09A9,10,clif->pBankWithdraw,2,4,6);
- packet(0x09AA,16); // ZC_ACK_BANKING_WITHDRAW
- packet(0x09AB,6,clif->pBankCheck,2,4);
- ////
- packet(0x09B6,6,clif->pBankOpen,2,4);
- packet(0x09B7,4); // ZC_ACK_OPEN_BANKING
- packet(0x09B8,6,clif->pBankClose,2,4);
- packet(0x09B9,4); // ZC_ACK_CLOSE_BANKING
+// 2013-06-05Ragexe
+#if PACKETVER >= 20130605
+// new packets
+ packet(0x09c4,8); // ZC_ACK_COUNT_BARGAIN_SALE_ITEM
+#endif
+
+// 2013-06-18aRagexe
+#if PACKETVER >= 20130618
+// new packets
+ packet(0x09ca,23); // ZC_SKILL_ENTRY5
+// changed packet sizes
+#endif
+
+// 2013-07-17cRagexe
+#if PACKETVER >= 20130717
+// new packets
+ packet(0x09cb,17); // ZC_USE_SKILL2
+ packet(0x09cc,-1); // ZC_SECRETSCAN_DATA
+// changed packet sizes
+ packet(0x09c1,10); // ZC_C_MARKERINFO
#endif
//2013-08-07Ragexe (Shakto)
@@ -2462,14 +2687,21 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0436,4); // CZ_GANGSI_RANK
packet(0x023B,26,clif->pFriendsListAdd,2);
packet(0x0361,5,clif->pHomMenu,2,4);
packet(0x0887,36,clif->pStoragePassword,0);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2013-08-07aRagexe
+#if PACKETVER >= 20130807
+// new packets
+ packet(0x09cd,8); // ZC_MSG_COLOR
+// changed packet sizes
#endif
//2013-08-14aRagexe - Themon
@@ -2499,14 +2731,137 @@ packet(0x96e,-1,clif->ackmergeitems);
#else // not PACKETVER_RE
packet(0x0959,18,clif->pPartyBookingRegisterReq,2,4);
#endif // PACKETVER_RE
- // packet(0x0896,8); // CZ_JOIN_BATTLE_FIELD
packet(0x08A4,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0368,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0927,26,clif->pPartyInvite2,2);
- // packet(0x0815,4); // CZ_GANGSI_RANK
packet(0x0281,26,clif->pFriendsListAdd,2);
packet(0x0958,5,clif->pHomMenu,2,4);
packet(0x0885,36,clif->pStoragePassword,0);
+ packet(0x0815,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x0896,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+#endif
+
+// 2013-08-14aRagexe
+#if PACKETVER >= 20130814
+// new packets
+ packet(0x09ce,102,clif->pGM_Monster_Item,2); // CZ_ITEM_CREATE_EX
+ packet(0x09cf,-1); // ZC_NPROTECTGAMEGUARDCSAUTH
+ packet(0x09d0,-1,clif->pDull/*,XXX*/); // CZ_NPROTECTGAMEGUARDCSAUTH
+// changed packet sizes
+#endif
+
+// 2013-08-21bRagexe
+#if PACKETVER >= 20130821
+// new packets
+ packet(0x09d1,14); // ZC_PROGRESS_ACTOR
+// changed packet sizes
+#endif
+
+// 2013-08-28bRagexe
+#if PACKETVER >= 20130828
+// new packets
+ packet(0x09d2,-1); // ZC_GUILDSTORAGE_ITEMLIST_NORMAL_V5
+ packet(0x09d3,-1); // ZC_GUILDSTORAGE_ITEMLIST_EQUIP_V5
+// changed packet sizes
+ packet(0x09ba,2,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_GUILD_STORAGE
+ packet(0x09be,2,clif->pDull/*,XXX*/); // CZ_REQ_CLOSE_GUILD_STORAGE
+#endif
+
+// 2013-09-04aRagexe
+#if PACKETVER >= 20130904
+// new packets
+// changed packet sizes
+ packet(0x09ca,-1); // ZC_SKILL_ENTRY5
+#endif
+
+// 2013-09-11aRagexe
+#if PACKETVER >= 20130911
+// new packets
+ packet(0x09d4,2,clif->pNPCShopClosed); // CZ_NPC_TRADE_QUIT
+ packet(0x09d5,-1); // ZC_NPC_MARKET_OPEN
+ packet(0x09d6,-1,clif->pNPCMarketPurchase); // CZ_NPC_MARKET_PURCHASE
+ packet(0x09d7,-1); // ZC_NPC_MARKET_PURCHASE_RESULT
+ packet(0x09d8,2,clif->pNPCMarketClosed); // CZ_NPC_MARKET_CLOSE
+ packet(0x09d9,2,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG
+ packet(0x09da,2); // ZC_ACK_GUILDSTORAGE_LOG
+// changed packet sizes
+#endif
+
+// 2013-09-25aRagexe
+#if PACKETVER >= 20130925
+// new packets
+// changed packet sizes
+ packet(0x09da,10); // ZC_ACK_GUILDSTORAGE_LOG
+#endif
+
+// 2013-10-02aRagexe
+#if PACKETVER >= 20131002
+// new packets
+// changed packet sizes
+ packet(0x09d9,4,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG
+ packet(0x09da,-1); // ZC_ACK_GUILDSTORAGE_LOG
+#endif
+
+// 2013-10-16aRagexe
+#if PACKETVER >= 20131016
+// new packets
+// changed packet sizes
+ packet(0x09d9,6,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG
+#endif
+
+// 2013-10-23aRagexe
+#if PACKETVER >= 20131023
+// new packets
+ packet(0x09db,-1); // ZC_NOTIFY_MOVEENTRY10
+ packet(0x09dc,-1); // ZC_NOTIFY_NEWENTRY10
+ packet(0x09dd,-1); // ZC_NOTIFY_STANDENTRY10
+// changed packet sizes
+ packet(0x09d9,4,clif->pDull/*,XXX*/); // CZ_REQ_GUILDSTORAGE_LOG
+#endif
+
+// 2013-10-30aRagexe
+#if PACKETVER >= 20131030
+// new packets
+ packet(0x09de,-1); // ZC_WHISPER02
+ packet(0x09df,7); // ZC_ACK_WHISPER02
+ packet(0x09e0,-1); // SC_LOGIN_ANSWER_WITH_ID
+#endif
+
+// 2013-11-06aRagexe
+#if PACKETVER >= 20131106
+// new packets
+ packet(0x09e1,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_BODY_TO_GUILDSTORAGE
+ packet(0x09e2,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_GUILDSTORAGE_TO_BODY
+ packet(0x09e3,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_CART_TO_GUILDSTORAGE
+ packet(0x09e4,8,clif->pDull/*,XXX*/); // CZ_MOVE_ITEM_FROM_GUILDSTORAGE_TO_CART
+// changed packet sizes
+#endif
+
+// 2013-11-20dRagexe
+#if PACKETVER >= 20131120
+// new packets
+ packet(0x09e5,14); // ZC_DELETEITEM_FROM_MCSTORE2
+ packet(0x09e6,18); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2
+// changed packet sizes
+#endif
+
+// 2013-11-27bRagexe
+#if PACKETVER >= 20131127
+// new packets
+// changed packet sizes
+ packet(0x09e5,18); // ZC_DELETEITEM_FROM_MCSTORE2
+ packet(0x09e6,22); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2
+#endif
+
+// 2013-12-11dRagexe
+#if PACKETVER >= 20131211
+// new packets
+ packet(0x09e7,2); // ZC_NOTIFY_UNREAD_RODEX
+ packet(0x09e8,18,clif->pDull/*,XXX*/); // CZ_OPEN_RODEXBOX
+ packet(0x09e9,2,clif->pDull/*,XXX*/); // CZ_CLOSE_RODEXBOX
+ packet(0x09ed,-1); // ZC_ACK_SEND_RODEX
+ packet(0x09ee,-1,clif->pDull/*,XXX*/); // CZ_REQ_NEXT_RODEX
+// changed packet sizes
#endif
// 2013-12-18bRagexe - Yommy
@@ -2532,20 +2887,28 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x092F,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x087B,4); // CZ_GANGSI_RANK
packet(0x08AB,26,clif->pFriendsListAdd,2);
packet(0x0811,5,clif->pHomMenu,2,4);
packet(0x085C,36,clif->pStoragePassword,0);
- /* New */
- packet(0x09d4,2,clif->pNPCShopClosed);
- packet(0x09ce,102,clif->pGM_Monster_Item,2);
- /* NPC Market */
- packet(0x09d8,2,clif->pNPCMarketClosed);
- packet(0x09d6,-1,clif->pNPCMarketPurchase);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x087b,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2013-12-18bRagexe
+#if PACKETVER >= 20131218
+// new packets
+ packet(0x09ea,10,clif->pDull/*,XXX*/); // CZ_REQ_READ_RODEX
+ packet(0x09eb,14); // ZC_ACK_READ_RODEX
+ packet(0x09ef,11,clif->pDull/*,XXX*/); // CZ_REQ_REFRESH_RODEX
+ packet(0x09f0,-1); // ZC_ACK_RODEX_LIST
+ packet(0x09f5,11,clif->pDull/*,XXX*/); // CZ_REQ_DELETE_RODEX
+ packet(0x09f6,11); // ZC_ACK_DELETE_RODEX
+// changed packet sizes
+ packet(0x09e8,10,clif->pDull/*,XXX*/); // CZ_OPEN_RODEXBOX
+ packet(0x09ee,11,clif->pDull/*,XXX*/); // CZ_REQ_NEXT_RODEX
#endif
// 2013-12-23cRagexe - Yommy
@@ -2571,15 +2934,22 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0436,4); // CZ_GANGSI_RANK
packet(0x023B,26,clif->pFriendsListAdd,2);
packet(0x0361,5,clif->pHomMenu,2,4);
packet(0x08A4,36,clif->pStoragePassword,0);
- packet(0x09df,7);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2013-12-23bRagexe
+#if PACKETVER >= 20131223
+// new packets
+// changed packet sizes
+ packet(0x09ea,11,clif->pDull/*,XXX*/); // CZ_REQ_READ_RODEX
+ packet(0x09eb,24); // ZC_ACK_READ_RODEX
#endif
// 2013-12-30aRagexe - Yommy
@@ -2605,49 +2975,101 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x094C,2,clif->pReqCloseBuyingStore,0);
packet(0x0365,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x091F,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x093E,8); // CZ_JOIN_BATTLE_FIELD
packet(0x022D,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x089C,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x08A9,26,clif->pPartyInvite2,2);
- // packet(0x087E,4); // CZ_GANGSI_RANK
packet(0x0943,26,clif->pFriendsListAdd,2);
packet(0x0949,5,clif->pHomMenu,2,4);
packet(0x091D,36,clif->pStoragePassword,0);
+ packet(0x087e,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x093e,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+#endif
+
+// 2013-12-30aRagexe
+#if PACKETVER >= 20131230
+// new packets
+ packet(0x09ec,-1,clif->pDull/*,XXX*/); // CZ_REQ_SEND_RODEX
+ packet(0x09ed,3); // ZC_ACK_SEND_RODEX
+ packet(0x09f7,75); // ZC_PROPERTY_HOMUN_2
+// changed packet sizes
+ packet(0x09eb,23); // ZC_ACK_READ_RODEX
#endif
// 2014 Packet Data
-// 2014-01-15eRagexe - YomRawr
+// 2014-01-15eRagexe
+#if PACKETVER == 20140115
+// shuffle packets
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_MOVE2
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQUEST_TIME2
+ packet(0x0361,6,clif->pDropItem,2,4); // CZ_CHANGE_DIRECTION2
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND2
+ packet(0x0367,8,clif->pMoveFromKafra,2,4); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX2
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME2
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQNAME_BYGID2
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_ACT2
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL2
+ packet(0x0802,6,clif->pGetCharNameRequest,2); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0865,36,clif->pStoragePassword,0); // ZC_REASSEMBLY_AUTH12
+ packet(0x0887,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REASSEMBLY_AUTH04
+ packet(0x088a,8,clif->pDull/*,XXX*/); // CZ_REASSEMBLY_AUTH07
+ packet(0x088e,8,clif->pMoveToKafra,2,4); // CZ_REASSEMBLY_AUTH11
+ packet(0x089b,26,clif->pFriendsListAdd,2); // CZ_REASSEMBLY_AUTH24
+ packet(0x08a7,5,clif->pChangeDir,2,4); // CZ_REASSEMBLY_AUTH36
+ packet(0x092d,5,clif->pHomMenu,2,4); // ZC_REASSEMBLY_AUTH65
+ packet(0x0940,6,clif->pTakeItem,2); // ZC_REASSEMBLY_AUTH84
+ packet(0x095b,4,clif->pDull/*,XXX*/); // CZ_REASSEMBLY_AUTH69
+ packet(0x095d,26,clif->pPartyInvite2,2); // CZ_REASSEMBLY_AUTH71
+ packet(0x0965,-1,clif->pItemListWindowSelected,2,4,8); // CZ_REASSEMBLY_AUTH79
+ packet(0x0966,19,clif->pWantToConnection,2,6,10,14,18); // CZ_REASSEMBLY_AUTH80
+ packet(0x096a,18,clif->pPartyBookingRegisterReq,2,4); // CZ_REASSEMBLY_AUTH84
+#endif
+
+// 2014-01-15cRagexeRE
#if PACKETVER >= 20140115
- packet(0x0369,7,clif->pActionRequest,2,6);
- packet(0x083C,10,clif->pUseSkillToId,2,4,6);
- packet(0x0437,5,clif->pWalkToXY,2);
- packet(0x035F,6,clif->pTickSend,2);
- packet(0x08A7,5,clif->pChangeDir,2,4);
- packet(0x0940,6,clif->pTakeItem,2);
- packet(0x0361,6,clif->pDropItem,2,4);
- packet(0x088E,8,clif->pMoveToKafra,2,4);
- packet(0x0367,8,clif->pMoveFromKafra,2,4);
- packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
- packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
- packet(0x0802,6,clif->pGetCharNameRequest,2);
- packet(0x0368,6,clif->pSolveCharName,2);
- packet(0x0360,12,clif->pSearchStoreInfoListItemClick,2,6,10);
- packet(0x0817,2,clif->pSearchStoreInfoNextPage,0);
- packet(0x0815,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
- packet(0x096A,-1,clif->pReqTradeBuyingStore,2,4,8,12);
- packet(0x088A,6,clif->pReqClickBuyingStore,2);
- packet(0x0965,2,clif->pReqCloseBuyingStore,0);
- packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
- packet(0x096A,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x088A,8); // CZ_JOIN_BATTLE_FIELD
- packet(0x0965,-1,clif->pItemListWindowSelected,2,4,8);
- packet(0x0966,19,clif->pWantToConnection,2,6,10,14,18);
- packet(0x095D,26,clif->pPartyInvite2,2);
- // packet(0x095B,4); // CZ_GANGSI_RANK
- packet(0x089B,26,clif->pFriendsListAdd,2);
- packet(0x092D,5,clif->pHomMenu,2,4);
- packet(0x0865,36,clif->pStoragePassword,0);
+// new packets
+ packet(0x09f1,10,clif->pDull/*,XXX*/); // CZ_REQ_ZENY_FROM_RODEX
+ packet(0x09f2,3); // ZC_ACK_ZENY_FROM_RODEX
+ packet(0x09f3,15,clif->pDull/*,XXX*/); // CZ_REQ_ITEM_FROM_RODEX
+ packet(0x09f4,12); // ZC_ACK_ITEM_FROM_RODEX
+ packet(0x09f8,-1); // ZC_ALL_QUEST_LIST3
+ packet(0x09f9,131); // ZC_ADD_QUEST_EX
+ packet(0x09fa,-1); // ZC_UPDATE_MISSION_HUNT_EX
+// changed packet sizes
+ packet(0x09eb,-1); // ZC_ACK_READ_RODEX
+#endif
+
+// 2014-01-22aRagexeRE
+#if PACKETVER >= 20140122
+// new packets
+ packet(0x09fb,-1,clif->pDull/*,XXX*/); // CZ_PET_EVOLUTION
+ packet(0x09fc,6); // ZC_PET_EVOLUTION_RESULT
+ packet(0x09fd,-1); // ZC_NOTIFY_MOVEENTRY11
+ packet(0x09fe,-1); // ZC_NOTIFY_NEWENTRY11
+ packet(0x09ff,-1); // ZC_NOTIFY_STANDENTRY11
+// changed packet sizes
+ packet(0x09f9,143); // ZC_ADD_QUEST_EX
+#endif
+
+// 2014-01-29bRagexeRE
+#if PACKETVER >= 20140129
+// new packets
+ packet(0x0a00,269); // ZC_SHORTCUT_KEY_LIST_V3
+ packet(0x0a01,3,clif->pHotkeyRowShift,2); // CZ_SHORTCUTKEYBAR_ROTATE
+// Warning hercules using this packets for items manipulation. In RagexeRE from 20140129 and before 20140305, this actions broken.
+#ifdef PACKETVER_RE
+// changed packet sizes
+ packet(0x01c4,43); // ZC_ADD_ITEM_TO_STORE2
+ packet(0x01c5,43); // ZC_ADD_ITEM_TO_CART2
+ packet(0x080f,41); // ZC_ADD_EXCHANGE_ITEM2
+ packet(0x0990,52); // ZC_ITEM_PICKUP_ACK_V5
+#endif // PACKETVER_RE
#endif
// 2014-02-05bRagexe - Themon
@@ -2673,15 +3095,44 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0436,4); // CZ_GANGSI_RANK
packet(0x023B,26,clif->pFriendsListAdd,2);
packet(0x0361,5,clif->pHomMenu,2,4);
packet(0x0938,36,clif->pStoragePassword,0);
- packet(0x09DF,7);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2014-02-12aRagexeRE
+#if PACKETVER >= 20140212
+// new packets
+ packet(0x0a02,4); // ZC_DRESSROOM_OPEN
+// changed packet sizes
+ packet(0x09e8,11,clif->pDull/*,XXX*/); // CZ_OPEN_RODEXBOX
+#endif
+
+// 2014-02-19aRagexeRE
+#if PACKETVER >= 20140219
+// Warning hercules using this packets for items manipulation. In RagexeRE from 20140129 and before 20140305, this actions broken.
+#ifdef PACKETVER_RE
+// changed packet sizes
+ packet(0x01c4,53); // ZC_ADD_ITEM_TO_STORE2
+ packet(0x01c5,53); // ZC_ADD_ITEM_TO_CART2
+ packet(0x080f,51); // ZC_ADD_EXCHANGE_ITEM2
+ packet(0x0990,62); // ZC_ITEM_PICKUP_ACK_V5
+#endif // PACKETVER_RE
+#endif
+
+// 2014-02-26aRagexeRE
+#if PACKETVER >= 20140226
+// new packets
+ packet(0x0a03,14,clif->pDull/*,XXX*/); // CZ_REQ_CANCEL_WRITE_RODEX
+ packet(0x0a04,11,clif->pDull/*,XXX*/); // CZ_REQ_ADD_ITEM_RODEX
+ packet(0x0a05,6); // ZC_ACK_ADD_ITEM_RODEX
+ packet(0x0a06,5,clif->pDull/*,XXX*/); // CZ_REQ_REMOVE_RODEX_ITEM
+// changed packet sizes
#endif
// 2014-03-05bRagexe - Themon
@@ -2707,15 +3158,59 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0361,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0438,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0878,4); // CZ_GANGSI_RANK
packet(0x07E4,26,clif->pFriendsListAdd,2);
packet(0x0934,5,clif->pHomMenu,2,4);
packet(0x095e,36,clif->pStoragePassword,0);
- packet(0x09DF,7);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0878,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2014-03-05aRagexeRE
+#if PACKETVER >= 20140305
+// new packets
+ packet(0x0a07,4); // ZC_ACK_REMOVE_RODEX_ITEM
+ packet(0x0a08,5,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_WRITE_RODEX
+ packet(0x0a09,50); // ZC_ADD_EXCHANGE_ITEM3
+ packet(0x0a0a,52); // ZC_ADD_ITEM_TO_STORE3
+ packet(0x0a0b,52); // ZC_ADD_ITEM_TO_CART3
+ packet(0x0a0c,61); // ZC_ITEM_PICKUP_ACK_V6
+ packet(0x0a0d,4); // ZC_INVENTORY_ITEMLIST_EQUIP_V6
+// changed packet sizes
+#ifdef PACKETVER_RE
+ packet(0x01c4,22); // ZC_ADD_ITEM_TO_STORE2
+ packet(0x01c5,22); // ZC_ADD_ITEM_TO_CART2
+ packet(0x080f,20); // ZC_ADD_EXCHANGE_ITEM2
+ packet(0x0990,31); // ZC_ITEM_PICKUP_ACK_V5
+#endif // PACKETVER_RE
+ packet(0x09f3,10,clif->pDull/*,XXX*/); // CZ_REQ_ITEM_FROM_RODEX
+ packet(0x09f4,3); // ZC_ACK_ITEM_FROM_RODEX
+#endif
+
+// 2014-03-12bRagexeRE
+#if PACKETVER >= 20140312
+// new packets
+ packet(0x0a0e,14); // ZC_BATTLEFIELD_NOTIFY_HP2
+// changed packet sizes
+ packet(0x0a09,45); // ZC_ADD_EXCHANGE_ITEM3
+ packet(0x0a0a,47); // ZC_ADD_ITEM_TO_STORE3
+ packet(0x0a0b,47); // ZC_ADD_ITEM_TO_CART3
+ packet(0x0a0c,56); // ZC_ITEM_PICKUP_ACK_V6
+ packet(0x0a0d,-1); // ZC_INVENTORY_ITEMLIST_EQUIP_V6
+#endif
+
+// 2014-03-26cRagexeRE
+#if PACKETVER >= 20140326
+// changed packet sizes
+ packet(0x09f1,11,clif->pDull/*,XXX*/); // CZ_REQ_ZENY_FROM_RODEX
+ packet(0x09f2,4); // ZC_ACK_ZENY_FROM_RODEX
+ packet(0x09f3,11,clif->pDull/*,XXX*/); // CZ_REQ_ITEM_FROM_RODEX
+ packet(0x09f4,4); // ZC_ACK_ITEM_FROM_RODEX
+ packet(0x0a03,2,clif->pDull/*,XXX*/); // CZ_REQ_CANCEL_WRITE_RODEX
+ packet(0x0a07,6); // ZC_ACK_REMOVE_RODEX_ITEM
+ packet(0x0a08,7,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_WRITE_RODEX
#endif
// 2014-04-02gRagexe - Themon
@@ -2741,15 +3236,30 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0867,2,clif->pReqCloseBuyingStore,0);
packet(0x0944,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x08AC,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x094C,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0883,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0920,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0890,26,clif->pPartyInvite2,2);
- // packet(0x088C,4); // CZ_GANGSI_RANK
packet(0x089A,26,clif->pFriendsListAdd,2);
packet(0x0896,5,clif->pHomMenu,2,4);
packet(0x0926,36,clif->pStoragePassword,0);
- packet(0x09DF,7);
+ packet(0x088c,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x094c,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+#endif
+
+// 2014-04-02eRagexeRE
+#if PACKETVER >= 20140402
+// new packets
+ packet(0x0a0f,-1); // ZC_CART_ITEMLIST_EQUIP_V6
+ packet(0x0a10,-1); // ZC_STORE_ITEMLIST_EQUIP_V6
+ packet(0x0a11,-1); // ZC_GUILDSTORAGE_ITEMLIST_EQUIP_V6
+// changed packet sizes
+#endif
+
+// 2014-04-09aRagexeRE
+#if PACKETVER >= 20140409
+// changed packet sizes
+ packet(0x09f2,12); // ZC_ACK_ZENY_FROM_RODEX
+ packet(0x09f4,12); // ZC_ACK_ITEM_FROM_RODEX
#endif
// 2014-04-16aRagexe - Themon
@@ -2775,15 +3285,163 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0436,4); // CZ_GANGSI_RANK
packet(0x023B,26,clif->pFriendsListAdd,2);
packet(0x0361,5,clif->pHomMenu,2,4);
packet(0x095C,36,clif->pStoragePassword,0);
- packet(0x09DF,7);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
+#endif
+
+// 2014-04-16aRagexeRE
+#if PACKETVER >= 20140416
+// new packets
+ packet(0x0a04,6,clif->pDull/*,XXX*/); // CZ_REQ_ADD_ITEM_RODEX
+ packet(0x0a12,27); // ZC_ACK_OPEN_WRITE_RODEX
+ packet(0x0a13,2,clif->pDull/*,XXX*/); // CZ_CHECK_RECEIVE_CHARACTER_NAME
+// changed packet sizes
+ packet(0x0a05,48); // ZC_ACK_ADD_ITEM_RODEX
+ packet(0x0a06,6,clif->pDull/*,XXX*/); // CZ_REQ_REMOVE_RODEX_ITEM
+ packet(0x0a07,7); // ZC_ACK_REMOVE_RODEX_ITEM
+ packet(0x0a08,26,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_WRITE_RODEX
+#endif
+
+// 2014-04-23aRagexeRE
+#if PACKETVER >= 20140423
+// new packets
+ packet(0x0a14,6); // ZC_CHECK_RECEIVE_CHARACTER_NAME
+// changed packet sizes
+ packet(0x0a13,26,clif->pDull/*,XXX*/); // CZ_CHECK_RECEIVE_CHARACTER_NAME
+#endif
+
+// 2014-04-30aRagexeRE
+#if PACKETVER >= 20140430
+// new packets
+ packet(0x0a15,11); // ZC_GOLDPCCAFE_POINT
+ packet(0x0a16,26,clif->pDull/*,XXX*/); // CZ_DYNAMICNPC_CREATE_REQUEST
+ packet(0x0a17,6); // ZC_DYNAMICNPC_CREATE_RESULT
+#endif
+
+// 2014-05-08bRagexeRE
+#if PACKETVER >= 20140508
+// changed packet sizes
+ packet(0x0a15,12); // ZC_GOLDPCCAFE_POINT
+#endif
+
+// 2014-05-21aRagexeRE
+#if PACKETVER >= 20140521
+// changed packet sizes
+ packet(0x0a07,9); // ZC_ACK_REMOVE_RODEX_ITEM
+ packet(0x0a14,10); // ZC_CHECK_RECEIVE_CHARACTER_NAME
+#endif
+
+/* Roulette System [Yommy/Hercules] */
+// 2014-06-05aRagexe
+#if PACKETVER >= 20140605
+// new packets
+ packet(0x0a18,2); // ZC_ACCEPT_ENTER3
+ packet(0x0a19,-1,clif->pDull/*,XXX*/); // CZ_REQ_OPEN_ROULETTE
+ packet(0x0a1a,10); // ZC_ACK_OPEN_ROULETTE
+ packet(0x0A1B,2,clif->pRouletteInfo,0); // HEADER_CZ_REQ_ROULETTE_INFO
+ packet(0x0a1c,6); // ZC_ACK_ROULEITTE_INFO
+ packet(0x0a1d,14,clif->pDull/*,XXX*/); // CZ_REQ_CLOSE_ROULETTE
+#endif
+
+/* Roulette System [Yommy/Hercules] */
+// 2014-06-11bRagexe / RE. moved by 4144
+#if PACKETVER >= 20140611
+// new packets
+ packet(0x0a1e,3); // ZC_ACK_CLOSE_ROULETTE
+ packet(0x0a1f,2,clif->pRouletteGenerate,0); // CZ_REQ_GENERATE_ROULETTE
+ packet(0x0a20,21); // ZC_ACK_GENERATE_ROULETTE
+ packet(0x0a21,6,clif->pDull/*,XXX*/); // CZ_RECV_ROULETTE_ITEM
+ packet(0x0a22,3); // ZC_RECV_ROULETTE_ITEM
+ packet(0x0a23,-1); // ZC_ALL_ACH_LIST
+ packet(0x0a24,35); // ZC_ACH_UPDATE
+ packet(0x0a25,6,clif->pDull/*,XXX*/); // CZ_REQ_ACH_REWARD
+ packet(0x0a26,7); // ZC_REQ_ACH_REWARD_ACK
+// changed packet sizes
+ packet(0x0a18,14); // ZC_ACCEPT_ENTER3
+ packet(0x0a19,2,clif->pRouletteOpen,0); // CZ_REQ_OPEN_ROULETTE
+ packet(0x0a1a,23); // ZC_ACK_OPEN_ROULETTE
+ packet(0x0a1c,-1); // ZC_ACK_ROULEITTE_INFO
+ packet(0x0a1d,2,clif->pRouletteClose,0); // CZ_REQ_CLOSE_ROULETTE
+#endif
+
+// 2014-06-18cRagexeRE
+#if PACKETVER >= 20140618
+// changed packet sizes
+ packet(0x0a21,3,clif->pRouletteRecvItem,2); // CZ_RECV_ROULETTE_ITEM
+ packet(0x0a22,5); // ZC_RECV_ROULETTE_ITEM
+#endif
+
+// 2014-06-25aRagexeRE
+#if PACKETVER >= 20140625
+// new packets
+ packet(0x0a27,8); // ZC_RECOVERY2
+ packet(0x0a28,3); // ZC_ACK_OPENSTORE2
+// changed packet sizes
+ packet(0x0a24,36); // ZC_ACH_UPDATE
+#endif
+
+// 2014-07-02aRagexeRE
+#if PACKETVER >= 20140702
+// new packets
+ packet(0x0a29,6); // ZC_REQ_AU_BOT
+ packet(0x0a2a,6,clif->pDull/*,XXX*/); // CZ_ACK_AU_BOT
+#endif
+
+// 2014-07-16aRagexeRE
+#if PACKETVER >= 20140716
+// changed packet sizes
+ packet(0x09e7,3); // ZC_NOTIFY_UNREAD_RODEX
+#endif
+
+// 2014-07-23aRagexeRE
+#if PACKETVER >= 20140723
+// new packets
+ packet(0x0a2b,14); // ZC_SE_CASHSHOP_OPEN2
+ packet(0x0a2c,12); // ZC_SE_PC_BUY_TAIWANCASHITEM_RESULT
+// changed packet sizes
+ packet(0x0a24,56); // ZC_ACH_UPDATE
+#endif
+
+// 2014-08-20aRagexeRE
+#if PACKETVER >= 20140820
+// new packets
+ packet(0x0a2d,-1); // ZC_EQUIPWIN_MICROSCOPE_V6
+#endif
+
+// 2014-09-03aRagexeRE
+#if PACKETVER >= 20140903
+// new packets
+ packet(0x0a2e,6,clif->pDull/*,XXX*/); // CZ_REQ_CHANGE_TITLE
+ packet(0x0a2f,7); // ZC_ACK_CHANGE_TITLE
+// changed packet sizes
+#endif
+
+// 2014-09-24bRagexeRE
+#if PACKETVER >= 20140924
+// new packets
+ packet(0x0a30,106); // ZC_ACK_REQNAMEALL2
+ packet(0x0a31,-1); // ZC_RESULT_PACKAGE_ITEM_TEST
+ packet(0x0a32,2); // ZC_OPEN_RODEX_THROUGH_NPC_ONLY
+ packet(0x0a33,7); // ZC_UPDATE_ROULETTE_COIN
+ packet(0x0a34,6); // ZC_UPDATE_TAIWANCASH
+#endif
+
+// 2014-10-01bRagexeRE
+#if PACKETVER >= 20141001
+// changed packet sizes
+ packet(0x0a24,66); // ZC_ACH_UPDATE
+#endif
+
+// 2014-10-08bRagexeRE
+#if PACKETVER >= 20141008
+// changed packet sizes
+ packet(0x0a05,49); // ZC_ACK_ADD_ITEM_RODEX
#endif
// 2014-10-16aRagexe - YomRawr
@@ -2809,30 +3467,14 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x0363,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x086E,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0802,26,clif->pPartyInvite2,2);
- // packet(0x0922,4); // CZ_GANGSI_RANK
packet(0x094B,26,clif->pFriendsListAdd,2);
packet(0x0364,5,clif->pHomMenu,2,4);
packet(0x0936,36,clif->pStoragePassword,0);
- packet(0x09DF,7);
- packet(0x0a00,269);
-#endif
-
-/* Roulette System [Yommy/Hercules] */
-#if PACKETVER >= 20141016
- packet(0x0A19,2,clif->pRouletteOpen,0); // HEADER_CZ_REQ_OPEN_ROULETTE
- packet(0x0A1A,23); // HEADER_ZC_ACK_OPEN_ROULETTE
- packet(0x0A1B,2,clif->pRouletteInfo,0); // HEADER_CZ_REQ_ROULETTE_INFO
- packet(0x0A1C,-1); // HEADER_ZC_ACK_ROULEITTE_INFO
- packet(0x0A1D,2,clif->pRouletteClose,0); // HEADER_CZ_REQ_CLOSE_ROULETTE
- packet(0x0A1E,3); // HEADER_ZC_ACK_CLOSE_ROULETTE
- packet(0x0A1F,2,clif->pRouletteGenerate,0); // HEADER_CZ_REQ_GENERATE_ROULETTE
- packet(0x0A20,21); // HEADER_ZC_ACK_GENERATE_ROULETTE
- packet(0x0A21,3,clif->pRouletteRecvItem,2); // HEADER_CZ_RECV_ROULETTE_ITEM
- packet(0x0A22,5); // HEADER_ZC_RECV_ROULETTE_ITEM
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0922,4,clif->pDull); // CZ_GANGSI_RANK
#endif
// 2014-10-22bRagexe - YomRawr
@@ -2858,25 +3500,462 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x0817,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0955,18,clif->pPartyBookingRegisterReq,2,4);
- // packet(0x092B,8); // CZ_JOIN_BATTLE_FIELD
packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x093B,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x0896,26,clif->pPartyInvite2,2);
- // packet(0x08AB,4); // CZ_GANGSI_RANK
packet(0x091A,26,clif->pFriendsListAdd,2);
packet(0x0899,5,clif->pHomMenu,2,4);
packet(0x0438,36,clif->pStoragePassword,0);
- packet(0x0A01,3,clif->pHotkeyRowShift,2);
+ packet(0x08ab,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x092b,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
#endif
-#if PACKETVER >= 20150226
- packet(0x0A09,45);
- packet(0x0A0A,47);
- packet(0x0A0B,47);
- packet(0x0A0C,56);
- packet(0x0A0D,-1);
- packet(0x0A0F,-1);
- packet(0x0A10,-1);
+// 2014-11-19bRagexeRE
+#if PACKETVER >= 20141119
+// new packets
+ packet(0x0A35,4,clif->pOneClick_ItemIdentify,2);
+// changed packet sizes
+ packet(0x0a05,53); // ZC_ACK_ADD_ITEM_RODEX
+#endif
+
+// 2014-11-26aRagexeRE
+#if PACKETVER >= 20141126
+// new packets
+ packet(0x0a36,7); // ZC_HP_INFO_TINY
+ packet(0x0a37,57); // ZC_ITEM_PICKUP_ACK_V7
+#endif
+
+// 2015-01-07aRagexeRE
+#if PACKETVER == 20150107
+// shuffle packets
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x087c,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0895,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x092d,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0943,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0947,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-01-14aRagexe
+#if PACKETVER == 20150114
+// shuffle packets
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0868,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0899,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0946,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0955,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0957,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-01-28aRagexe
+#if PACKETVER == 20150128
+// shuffle packets
+ packet(0x0202,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x023b,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x035f,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0365,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0368,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0838,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x085a,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0864,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x086d,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0870,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0874,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0875,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0876,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x087d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0888,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x089a,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x08ab,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x091f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0927,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0929,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x092d,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0938,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x093a,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0944,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x094d,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x094e,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0952,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0963,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0968,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+#endif
+// 2015-01-28aRagexeRE
+#if PACKETVER >= 20150128
+// new packets
+ packet(0x0a38,3);
+#endif
+
+// 2015-02-04aRagexe
+#if PACKETVER == 20150204
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0966,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-02-25aRagexeRE
+#if PACKETVER == 20150225
+// shuffle packets
+ packet(0x02c4,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0362,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0819,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0867,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0885,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0896,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x089b,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x089c,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x08a4,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0940,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0946,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0948,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x094f,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0952,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0955,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x096a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+#endif
+
+// 2015-02-26aRagexeRE
+#if PACKETVER == 20150226
+// shuffle packets
+ packet(0x02c4,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0362,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0819,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0867,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0885,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0896,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x089b,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x089c,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x08a4,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0940,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0946,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0948,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x094f,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0952,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0955,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x096a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+#endif
+
+// 2015-03-11aRagexeRE
+#if PACKETVER == 20150311
+// shuffle packets
+ packet(0x023b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0360,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0436,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0438,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0838,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x086a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x086c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x087b,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0883,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0886,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0888,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0896,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x08a1,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x08a3,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x08a5,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x08a6,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x091c,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0928,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x092a,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x092e,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x093b,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0943,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0946,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0957,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0958,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x095b,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0963,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0964,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+#endif
+
+// 2015-03-11aRagexeRE
+#if PACKETVER >= 20150311
+// new packets
+ packet(0x0a3a,12);
+// changed packet sizes
+#endif
+
+// 2015-03-25aRagexe
+#if PACKETVER == 20150325
+// shuffle packets
+ packet(0x0202,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0363,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0365,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0438,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0802,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0819,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x085d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x086f,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x087c,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x087e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0883,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0885,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0891,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0893,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0897,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0899,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x08a1,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x08a7,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0919,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x092c,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0931,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0932,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0938,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0940,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0947,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x094a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0950,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0954,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0969,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+#endif
+
+// 2015-04-01aRagexe
+#if PACKETVER == 20150401
+// shuffle packets
+ packet(0x0362,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0367,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0437,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x083c,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x085e,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x086f,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0875,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x087e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x088c,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x088f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0895,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0898,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x089c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x08a5,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x091b,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x091c,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0922,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0924,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0938,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0939,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x093a,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x093b,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x093e,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0946,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0949,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x094b,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0953,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x095f,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0964,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+#endif
+
+// 2015-04-15aRagexeRE
+#if PACKETVER >= 20150415
+// changed packet sizes
+ packet(0x0a39,36); // CH_UNKNOWN_MAKE_CHAR // in char server used from 20151001. is this correct?
+#endif
+
+// 2015-04-22aRagexeRE
+#if PACKETVER == 20150422
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0955,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-04-22aRagexeRE
+#if PACKETVER >= 20150422
+// new packets
+ packet(0x0a3b,-1);
+// changed packet sizes
+#endif
+
+// 2015-04-29aRagexe
+#if PACKETVER == 20150429
+// shuffle packets
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0363,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0867,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x086a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0886,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x088f,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0894,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0899,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x089f,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x08a6,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x08a8,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x08ad,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0929,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x093d,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0943,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-05-07bRagexe
+#if PACKETVER == 20150507
+// shuffle packets
+ packet(0x023b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0864,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0887,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0889,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0924,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x092e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x093b,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0941,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0942,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0953,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0955,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0958,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
#endif
// 2015-05-13aRagexe
@@ -2902,25 +3981,2133 @@ packet(0x96e,-1,clif->ackmergeitems);
packet(0x022D,2,clif->pReqCloseBuyingStore,0);
packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
packet(0x0883,18,clif->pPartyBookingRegisterReq,2,4);
- packet(0x02C4,8); // CZ_JOIN_BATTLE_FIELD
+ packet(0x02C4,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
packet(0x0960,-1,clif->pItemListWindowSelected,2,4,8);
packet(0x0363,19,clif->pWantToConnection,2,6,10,14,18);
packet(0x094A,26,clif->pPartyInvite2,2);
- packet(0x0927,4); // CZ_GANGSI_RANK
+ packet(0x0927,4,clif->pDull); // CZ_GANGSI_RANK
packet(0x08A8,26,clif->pFriendsListAdd,2);
packet(0x0817,5,clif->pHomMenu,2,4);
packet(0x0923,36,clif->pStoragePassword,0);
- packet(0x09E8,11,clif->pDull); // CZ_OPEN_MAILBOX
- packet(0x0A2E,6,clif->pDull); // TITLE
- packet(0x0A02,4); // ZC_DRESSROOM_OPEN
- packet(0x0A35,4,clif->pOneClick_ItemIdentify,2);
+ packet(0x0a27,8); // ZC_RECOVERY2
+#endif
+
+// 2015-05-20aRagexeRE
+#if PACKETVER >= 20150520
+// new packets
+ packet(0x0a3c,-1);
+ packet(0x0a3d,18,clif->pDull/*,XXX*/);
+#endif
+
+// 2015-05-27aRagexe
+#if PACKETVER == 20150527
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x083c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0940,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-06-03bRagexeRE
+#if PACKETVER >= 20150603
+// new packets
+ packet(0x0a3e,-1);
+#endif
+
+// 2015-06-17aRagexeRE
+#if PACKETVER == 20150617
+// shuffle packets
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0362,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0363,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0365,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07ec,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0811,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0869,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x086a,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x086b,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0870,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x087a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0886,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0894,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0940,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x094e,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-06-18aRagexeRE
+#if PACKETVER == 20150618
+// shuffle packets
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0362,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0363,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0365,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07ec,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0811,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0869,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x086a,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x086b,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0870,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x087a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0886,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0894,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0940,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x094e,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-06-24aRagexeRE
+#if PACKETVER >= 20150624
+// new packets
+ packet(0x0a3f,9);
+#endif
+
+// 2015-08-12aRagexeRE
+#if PACKETVER >= 20150812
+// new packets
+ packet(0x0a40,11);
+#endif
+
+// 2015-08-19aRagexeRE
+#if PACKETVER == 20150819
+// shuffle packets
+ packet(0x0202,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x022d,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0281,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x085d,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0862,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0865,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0871,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0888,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0919,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x091e,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0927,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0940,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0961,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0967,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-08-26aRagexeRE
+#if PACKETVER == 20150826
+// shuffle packets
+ packet(0x0362,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0368,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0436,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x07ec,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0819,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0861,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0865,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x086b,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0870,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x087b,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x088b,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x088d,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0890,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0891,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x08a0,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x08a1,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x08a4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x08a8,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0924,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0928,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x092e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x093b,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0945,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x094f,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0951,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0959,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0964,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0968,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0969,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+#endif
+
+// 2015-09-09aRagexeRE
+#if PACKETVER >= 20150909
+// new packets
+ packet(0x0a41,18);
+#endif
+
+// 2015-09-16aRagexeRE
+#if PACKETVER >= 20150916
+// new packets
+ packet(0x0a42,43);
+#endif
+
+// 2015-10-01aRagexe
+#if PACKETVER == 20151001
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0960,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-10-07aRagexeRE
+#if PACKETVER == 20151007
+// shuffle packets
+ packet(0x0202,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0862,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x093f,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x095f,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0961,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0967,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-10-07aRagexeRE
+#if PACKETVER >= 20151007
+// new packets
+ packet(0x0a43,85);
+ packet(0x0a44,-1);
+#endif
+
+// 2015-10-14bRagexeRE
+#if PACKETVER == 20151014
+// shuffle packets
+ packet(0x0202,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0817,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0838,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x085a,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085c,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0860,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0863,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0867,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0872,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0874,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0881,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0883,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0884,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0889,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x088e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x089a,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x089b,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x089f,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x08aa,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x091c,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x091d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0930,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0934,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0944,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x094f,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0956,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x095e,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0961,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0964,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+#endif
+
+// 2015-10-28cRagexeRE
+#if PACKETVER == 20151028
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0860,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-10-28cRagexeRE
+#if PACKETVER >= 20151028
+// new packets
+ packet(0x0a45,-1);
+#endif
+
+// 2015-10-29aRagexe
+#if PACKETVER >= 20151029
+ packet(0x0369,7,clif->pActionRequest,2,6);
+ packet(0x083C,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0437,5,clif->pWalkToXY,2);
+ packet(0x035F,6,clif->pTickSend,2);
+ packet(0x0202,5,clif->pChangeDir,2,4);
+ packet(0x07E4,6,clif->pTakeItem,2);
+ packet(0x0362,6,clif->pDropItem,2,4);
+ packet(0x07EC,8,clif->pMoveToKafra,2,4);
+ packet(0x0364,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x096A,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0360,6,clif->pReqClickBuyingStore,2);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x022D,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x0802,26,clif->pPartyInvite2,2);
+ packet(0x023B,26,clif->pFriendsListAdd,2);
+ packet(0x0361,5,clif->pHomMenu,2,4);
+ packet(0x0860,36,clif->pStoragePassword,0);
+ packet(0x0363,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0436,4,clif->pDull); // CZ_GANGSI_RANK
#endif
-#if PACKETVER >= 20150805 // RagexeRE
- packet(0x097f,-1); // ZC_SELECTCART
- packet(0x0980,7,clif->pSelectCart); // CZ_SELECTCART
+// 2015-11-04aRagexe
+#if PACKETVER >= 20151104
+ packet(0x0369,7,clif->pActionRequest,2,6);
+ packet(0x083C,10,clif->pUseSkillToId,2,4,6);
+ packet(0x0363,5,clif->pWalkToXY,2);
+ packet(0x0886,6,clif->pTickSend,2);
+ packet(0x0928,5,clif->pChangeDir,2,4);
+ packet(0x0964,6,clif->pTakeItem,2);
+ packet(0x0437,6,clif->pDropItem,2,4);
+ packet(0x088B,8,clif->pMoveToKafra,2,4);
+ packet(0x0364,8,clif->pMoveFromKafra,2,4);
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x0887,6,clif->pGetCharNameRequest,2);
+ packet(0x0368,6,clif->pSolveCharName,2);
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0815,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0436,6,clif->pReqClickBuyingStore,2);
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0);
+ packet(0x023B,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0811,18,clif->pPartyBookingRegisterReq,2,4,6);
+ packet(0x093A,-1,clif->pItemListWindowSelected,2,4,8,12);
+ packet(0x0360,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x08A5,26,clif->pPartyInvite2,2);
+ packet(0x07EC,26,clif->pFriendsListAdd,2);
+ packet(0x088D,5,clif->pHomMenu,2,4);
+ packet(0x0940,36,clif->pStoragePassword,2,4,20);
+ packet(0x08a3,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x0939,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+// new packets
+ packet(0x0a46,14,clif->pDull/*,XXX*/);
+ packet(0x0a47,3);
+ packet(0x0a48,2,clif->pDull/*,XXX*/);
+// changed packet sizes
+ packet(0x0a45,2);
+#endif
+
+// 2015-11-18aRagexeRE
+#if PACKETVER == 20151118
+// shuffle packets
+ packet(0x022d,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x035f,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0365,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x086b,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x088b,36,clif->pStoragePassword,2,4,20); // CZ_ACK_STORE_PASSWORD
+ packet(0x08ab,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0921,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0925,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x092e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x092f,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x093c,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0943,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0946,-1,clif->pItemListWindowSelected,2,4,8,12); // CZ_ITEMLISTWIN_RES
+ packet(0x0957,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x095c,18,clif->pPartyBookingRegisterReq,2,4,6); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-11-18aRagexeRE
+#if PACKETVER >= 20151118
+// new packets
+ packet(0x0a49,22);
+ packet(0x0a4a,6);
+ packet(0x0a4b,22);
+ packet(0x0a4c,28);
+#endif
+
+// 2015-12-02bRagexeRE
+#if PACKETVER == 20151202
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8,12); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4,6); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0870,36,clif->pStoragePassword,2,4,20); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2015-12-16aRagexe
+#if PACKETVER >= 20151216
+ packet(0x089D,7,clif->pActionRequest,2,6);
+ packet(0x0968,10,clif->pUseSkillToId,2,4,6);
+ packet(0x08A2,5,clif->pWalkToXY,2);
+ packet(0x085B,6,clif->pTickSend,2);
+ packet(0x022D,5,clif->pChangeDir,2,4);
+ packet(0x08A9,6,clif->pTakeItem,2);
+ packet(0x0966,6,clif->pDropItem,2,4);
+ packet(0x08AC,8,clif->pMoveToKafra,2,4);
+ packet(0x0864,8,clif->pMoveFromKafra,2,4);
+ packet(0x0865,10,clif->pUseSkillToPos,2,4,6,8);
+ packet(0x0874,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10);
+ packet(0x088B,6,clif->pGetCharNameRequest,2);
+ packet(0x089E,6,clif->pSolveCharName,2);
+ packet(0x0436,12,clif->pSearchStoreInfoListItemClick,2,6,10);
+ packet(0x0960,2,clif->pSearchStoreInfoNextPage,0);
+ packet(0x0944,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15);
+ packet(0x0954,-1,clif->pReqTradeBuyingStore,2,4,8,12);
+ packet(0x0361,6,clif->pReqClickBuyingStore,2);
+ packet(0x083C,2,clif->pReqCloseBuyingStore,0);
+ packet(0x0870,-1,clif->pReqOpenBuyingStore,2,4,8,9,89);
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4);
+ packet(0x0949,-1,clif->pItemListWindowSelected,2,4,8);
+ packet(0x0947,19,clif->pWantToConnection,2,6,10,14,18);
+ packet(0x086E,26,clif->pPartyInvite2,2);
+ packet(0x091D,26,clif->pFriendsListAdd,2);
+ packet(0x0362,5,clif->pHomMenu,2,4);
+ packet(0x0885,36,clif->pStoragePassword,0);
+ packet(0x0364,4,clif->pDull); // CZ_GANGSI_RANK
+ packet(0x086a,8,clif->pDull); // CZ_JOIN_BATTLE_FIELD
+#endif
+
+// 2015-12-23bRagexeRE
+#if PACKETVER == 20151223
+// shuffle packets
+ packet(0x02c4,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0362,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0802,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0815,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0864,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0866,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x086e,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0872,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0875,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0876,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0881,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0884,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0886,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x088d,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0890,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0891,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0898,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x08aa,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0918,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x091a,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x091b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0920,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0923,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0924,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x095e,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x095f,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0965,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0967,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+#endif
+
+// 2016-01-27aRagexeRE
+#if PACKETVER >= 20160127
+// new packets
+ packet(0x0a4d,-1);
+// changed packet sizes
+#endif
+
+// 2016-01-27bRagexeRE
+#if PACKETVER == 20160127
+// shuffle packets
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0922,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x095a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0961,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-02-03aRagexeRE
+#if PACKETVER == 20160203
+// shuffle packets
+ packet(0x0202,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0437,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0811,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0835,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x086c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0872,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0873,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x088c,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0918,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x093e,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0940,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0947,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0954,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x095a,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x095d,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-02-17cRagexeRE
+#if PACKETVER == 20160217
+// shuffle packets
+ packet(0x0202,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x023b,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0362,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0365,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0864,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0870,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0873,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x087a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0888,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x088d,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x088f,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0899,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x08a0,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x08a9,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x08ac,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x08ad,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x091d,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0920,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0926,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x092e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x093b,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x093e,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0941,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x094a,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x094f,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x095e,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0966,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0967,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0969,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+#endif
+
+// 2016-03-02bRagexeRE
+#if PACKETVER == 20160302
+// shuffle packets
+ packet(0x022d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0367,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0802,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0819,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x085b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0864,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0865,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0867,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0868,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0873,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0875,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x087a,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x087d,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0883,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x08a6,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x08a9,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x091a,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0927,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x092d,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x092f,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0945,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x094e,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0950,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0957,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x095a,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0960,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0961,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0967,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0968,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+#endif
+
+// 2016-03-02bRagexeRE
+#if PACKETVER >= 20160302
+// new packets
+ packet(0x0a4e,4);
+ packet(0x0a4f,-1,clif->pDull/*,XXX*/);
+ packet(0x0a50,6);
+ packet(0x0a51,34);
+// changed packet sizes
+#endif
+
+// 2016-03-09aRagexeRE
+#if PACKETVER == 20160309
+// shuffle packets
+ packet(0x023b,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0281,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0364,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0819,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0838,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x083c,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x085a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x085f,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0866,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x086a,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0873,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x087c,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x087e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x089b,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x089d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x08a7,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x091d,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0920,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0922,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0929,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x092a,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x092e,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0932,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x094f,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0956,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x095e,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x096a,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+#endif
+
+// 2016-03-16aRagexeRE
+#if PACKETVER >= 20160316
+// new packets
+ packet(0x0a52,20,clif->pDull/*,XXX*/);
+ packet(0x0a53,10);
+ packet(0x0a54,-1);
+ packet(0x0a55,2);
+ packet(0x0a56,6,clif->pDull/*,XXX*/);
+ packet(0x0a57,6);
+ packet(0x0a58,8);
+ packet(0x0a59,-1);
+ packet(0x0a5a,2,clif->pDull/*,XXX*/);
+ packet(0x0a5b,7);
+ packet(0x0a5c,18,clif->pDull/*,XXX*/);
+ packet(0x0a5d,6);
+// changed packet sizes
+#endif
+
+// 2016-03-23aRagexeRE
+#if PACKETVER >= 20160323
+// new packets
+ packet(0x0a68,3);
+ packet(0x0a69,6);
+ packet(0x0a6a,12);
+ packet(0x0a6b,-1);
+// changed packet sizes
+#endif
+
+// 2016-03-30aRagexeRE
+#if PACKETVER == 20160330
+// shuffle packets
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0365,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0867,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x086d,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0878,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x087f,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0889,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x088b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x088d,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0918,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0925,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x092a,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x092c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0930,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0939,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x093b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-03-30aRagexeRE
+#if PACKETVER >= 20160330
+// new packets
+ packet(0x0a6c,7,clif->pDull/*,XXX*/);
+ packet(0x0a6d,-1);
+ packet(0x0a6e,-1);
+ packet(0x0a6f,-1);
+// changed packet sizes
+#endif
+
+// 2016-04-20aRagexeRE
+#if PACKETVER == 20160420
+// shuffle packets
+ packet(0x022d,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x02c4,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x035f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0864,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0870,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0872,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0874,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0884,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0888,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x088b,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x08a5,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x092f,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0935,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x094e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x095c,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-04-27aRagexeRE
+#if PACKETVER >= 20160427
+// new packets
+// changed packet sizes
+ packet(0x0a50,4);
+#endif
+
+// 2016-05-04aRagexeRE
+#if PACKETVER >= 20160504
+// new packets
+ packet(0x0a70,2,clif->pDull/*,XXX*/);
+ packet(0x0a71,-1);
+ packet(0x0a72,61);
+// changed packet sizes
+#endif
+
+// 2016-05-11aRagexeRE
+#if PACKETVER == 20160511
+// shuffle packets
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085e,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0894,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x089b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0918,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0920,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0940,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-05-11aRagexeRE
+#if PACKETVER >= 20160511
+// new packets
+ packet(0x0a73,6);
+ packet(0x0a74,8);
+// changed packet sizes
+#endif
+
+// 2016-05-18aRagexeRE
+#if PACKETVER >= 20160518
+// new packets
+ packet(0x0a76,80);
+// changed packet sizes
+ packet(0x0a73,2);
+#endif
+
+// 2016-05-25aRagexeRE
+#if PACKETVER == 20160525
+// shuffle packets
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085a,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x085e,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0867,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x086a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0899,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x089c,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x091d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x092c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0937,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0945,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x094a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x094e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0951,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0956,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-05-25aRagexeRE
+#if PACKETVER >= 20160525
+// new packets
+ packet(0x0a77,15);
+ packet(0x0a78,15);
+// changed packet sizes
+#endif
+
+// 2016-06-01aRagexeRE
+#if PACKETVER >= 20160601
+// new packets
+ packet(0x0a79,-1);
+ packet(0x0a7b,-1);
+ packet(0x0a7c,-1);
+ packet(0x0a7d,-1);
+// changed packet sizes
+#endif
+
+// 2016-06-08aRagexeRE
+#if PACKETVER == 20160608
+// shuffle packets
+ packet(0x022d,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x02c4,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x035f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0437,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07ec,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0802,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085c,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0885,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0889,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0899,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x089b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x08a6,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x093b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x094d,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0958,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x095b,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0969,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-06-15aRagexeRE
+#if PACKETVER == 20160615
+// shuffle packets
+ packet(0x0281,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0363,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0364,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0369,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x083c,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0866,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0870,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x087d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x087e,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x087f,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0884,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0887,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0888,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x088a,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x088d,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0891,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0898,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x092f,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x093e,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0947,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0948,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x094a,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x094b,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0954,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0957,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0958,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x095c,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x095e,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0961,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+#endif
+
+// 2016-06-15aRagexeRE
+#if PACKETVER >= 20160615
+// new packets
+ packet(0x0a7e,4);
+ packet(0x0a7f,-1);
+ packet(0x0a80,2);
+ packet(0x0a81,3);
+// changed packet sizes
+#endif
+
+// 2016-06-22aRagexeRE
+#if PACKETVER >= 20160622
+// new packets
+ packet(0x0a82,46);
+ packet(0x0a83,46);
+ packet(0x0a84,94);
+ packet(0x0a85,82);
+ packet(0x0a86,-1);
+ packet(0x0a87,4);
+ packet(0x0a88,2);
+// changed packet sizes
+#endif
+
+// 2016-06-29aRagexeRE
+#if PACKETVER >= 20160629
+// new packets
+ packet(0x0a89,32);
+ packet(0x0a8a,6);
+ packet(0x0a8b,2);
+ packet(0x0a8c,2);
+ packet(0x0a8d,-1);
+// changed packet sizes
+ packet(0x0a80,6);
+#endif
+
+// 2016-06-30aRagexeRE
+#if PACKETVER == 20160630
+// shuffle packets
+ packet(0x0202,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x022d,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x035f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0363,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0368,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x085c,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x085e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0860,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0861,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0863,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0867,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x086b,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0881,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0885,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x088e,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0893,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x091e,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0922,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0925,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0926,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x093e,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0946,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0948,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x094a,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0957,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x095a,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0968,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0969,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x096a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+#endif
+
+// 2016-07-06cRagexeRE
+#if PACKETVER == 20160706
+// shuffle packets
+ packet(0x0362,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0436,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x085f,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0860,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0869,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x086b,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0884,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0886,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0889,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0892,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0899,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x08a4,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x08a5,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x08a8,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0918,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x091b,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0924,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0926,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0927,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0929,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x092d,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0939,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x093d,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0944,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0945,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x094c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0952,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0957,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0958,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+#endif
+
+// 2016-07-06cRagexeRE
+#if PACKETVER >= 20160706
+// new packets
+ packet(0x0a81,3);
+// changed packet sizes
+ packet(0x0a7e,-1);
+ packet(0x0a89,57);
+#endif
+
+// 2016-07-13bRagexeRE
+#if PACKETVER == 20160713
+// shuffle packets
+ packet(0x022d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0363,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0364,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0838,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0860,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0865,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0869,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0875,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0877,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x087b,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0883,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x088d,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0892,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x089a,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x089f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x08a2,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x08a4,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x091c,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x091d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0921,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0922,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x092c,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0931,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0939,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0944,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0945,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0947,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0957,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x095b,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+#endif
+
+// 2016-07-13aRagexeRE
+#if PACKETVER >= 20160713
+// new packets
+// changed packet sizes
+ packet(0x0a87,-1);
+#endif
+
+// 2016-07-20aRagexeRE
+#if PACKETVER == 20160720
+// shuffle packets
+ packet(0x0362,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0363,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0365,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x07e4,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0819,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0838,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x085b,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x086a,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x086d,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x087f,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0883,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0887,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0897,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x089a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x089c,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x089e,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x08a0,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x08aa,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0917,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x091c,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x092a,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x093b,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x093e,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0946,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x094d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0953,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x095b,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0960,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0969,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+#endif
+
+// 2016-07-20aRagexeRE
+#if PACKETVER >= 20160720
+// new packets
+ packet(0x0a8e,2);
+ packet(0x0a8f,2);
+ packet(0x0a90,3);
+// changed packet sizes
+#endif
+
+// 2016-07-27aRagexeRE
+#if PACKETVER >= 20160727
+// new packets
+ packet(0x0a91,-1);
+ packet(0x0a92,-1);
+ packet(0x0a93,3);
+// changed packet sizes
+#endif
+
+// 2016-07-27bRagexeRE
+#if PACKETVER == 20160727
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x023b,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0362,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0363,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0436,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0438,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x07ec,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0866,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0868,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0869,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0874,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0877,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0883,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0887,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x088e,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0891,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x089f,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x08a2,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x08a4,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x08a7,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x092e,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0936,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0941,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0946,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0949,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0951,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x095f,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0966,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0969,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+#endif
+
+// 2016-08-03bRagexeRE
+#if PACKETVER >= 20160803
+// new packets
+ packet(0x0a94,2);
+// changed packet sizes
+ packet(0x0a81,4);
+#endif
+
+// 2016-08-31bRagexeRE
+#if PACKETVER == 20160831
+// shuffle packets
+ packet(0x022d,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0366,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x07ec,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0835,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0865,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x086d,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0870,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0874,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0876,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0878,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x087c,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x08a8,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x08a9,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0917,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x091b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x092c,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x092e,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0938,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x093a,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0946,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x094a,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x094f,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0950,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0954,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0957,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x095e,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0960,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0964,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0967,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+#endif
+
+// 2016-09-07aRagexeRE
+#if PACKETVER == 20160907
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x091c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-09-07aRagexeRE
+#if PACKETVER >= 20160907
+// new packets
+ packet(0x0a95,4);
+// changed packet sizes
+#endif
+
+// 2016-09-21bRagexeRE
+#if PACKETVER == 20160921
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x094a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-09-21bRagexeRE
+#if PACKETVER >= 20160921
+// new packets
+ packet(0x0a96,51);
+// changed packet sizes
+ packet(0x0a37,59); // ZC_ITEM_PICKUP_ACK_V7
+#endif
+
+// 2016-09-28cRagexeRE
+#if PACKETVER >= 20160928
+// new packets
+ packet(0x0a97,8);
+ packet(0x0a98,12);
+ packet(0x0a99,8);
+ packet(0x0a9a,10);
+ packet(0x0a9b,-1);
+ packet(0x0a9c,2);
+ packet(0x0a9d,4);
+ packet(0x0a9e,2);
+ packet(0x0a9f,2);
+// changed packet sizes
+#endif
+
+// 2016-10-05aRagexeRE
+#if PACKETVER >= 20161005
+// new packets
+ packet(0x0aa0,2,clif->pDull/*,XXX*/);
+ packet(0x0aa1,4);
+ packet(0x0aa2,-1);
+ packet(0x0aa3,7);
+ packet(0x0aa4,2);
+// changed packet sizes
+#endif
+
+// 2016-10-12aRagexeRE
+#if PACKETVER == 20161012
+// shuffle packets
+ packet(0x023b,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0364,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0365,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0369,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x07ec,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0819,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x085b,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x085e,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0863,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0868,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x086d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0872,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0875,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0880,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0893,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x08a0,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x092d,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0936,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0937,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0939,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0943,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0944,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x094f,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0951,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x095c,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0962,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0966,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0967,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+#endif
+
+// 2016-10-26bRagexeRE
+#if PACKETVER == 20161026
+// shuffle packets
+ packet(0x0363,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0438,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0802,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x085a,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x085f,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0861,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0862,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x086a,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x086c,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x086e,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x087a,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x087c,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x087f,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0886,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0891,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0894,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0898,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x091a,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x091b,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0926,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x092c,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x092e,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x092f,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0930,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x094b,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0953,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x095c,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x095e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0962,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+#endif
+
+// 2016-10-26bRagexeRE
+#if PACKETVER >= 20161026
+// new packets
+ packet(0x0aa5,-1);
+ packet(0x0aa6,36);
+// changed packet sizes
+#endif
+
+// 2016-11-09bRagexeRE
+#if PACKETVER == 20161109
+// shuffle packets
+ packet(0x02c4,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0361,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0362,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0366,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x085d,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x085e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0865,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x086a,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x086d,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0870,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0876,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x087a,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0881,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x088e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0891,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0898,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x089a,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x089d,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x089f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x08a7,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x08ad,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0927,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0937,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x093c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x093f,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0954,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0956,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+#endif
+
+// 2016-11-30aRagexeRE
+#if PACKETVER >= 20161130
+// new packets
+ packet(0x0aa7,6);
+ packet(0x0aa8,5);
+ packet(0x0aa9,-1);
+ packet(0x0aaa,-1);
+ packet(0x0aab,-1);
+// changed packet sizes
+#endif
+
+// 2016-12-07eRagexeRE
+#if PACKETVER == 20161207
+// shuffle packets
+ packet(0x023b,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0867,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0868,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0875,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x087e,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0886,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x08a1,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x08a2,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x08ad,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0918,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x091d,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0943,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x095d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0965,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-12-07cRagexeRE
+#if PACKETVER >= 20161207
+// new packets
+ packet(0x0aac,67);
+// changed packet sizes
+#endif
+
+// 2016-12-14bRagexeRE
+#if PACKETVER == 20161214
+// shuffle packets
+ packet(0x022d,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0281,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x02c4,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0364,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0436,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085a,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0862,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x086d,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0887,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0895,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0899,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x08a6,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x092e,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x093d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2016-12-21aRagexeRE
+#if PACKETVER == 20161221
+// shuffle packets
+ packet(0x035f,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0366,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0438,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0817,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x085b,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0866,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0876,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0881,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0884,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0885,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x088c,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0890,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0899,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x089a,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x089b,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x08aa,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x091e,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0926,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0928,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x092c,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x092e,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0930,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0943,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0946,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x094b,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x095a,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0964,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0965,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+#endif
+
+// 2016-12-21aRagexeRE
+#if PACKETVER >= 20161221
+// new packets
+ packet(0x0aad,47);
+ packet(0x0aae,2);
+ packet(0x0aaf,6);
+ packet(0x0ab0,6);
+ packet(0x0ab1,10);
+// changed packet sizes
+#endif
+
+// 2016-12-28aRagexeRE
+#if PACKETVER >= 20161228
+// new packets
+// changed packet sizes
+ packet(0x0ab1,14);
+#endif
+
+// 2017-01-04bRagexeRE
+#if PACKETVER >= 20170104
+// new packets
+ packet(0x0ab2,7);
+ packet(0x0ab3,15);
+// changed packet sizes
+#endif
+
+// 2017-01-11aRagexeRE
+#if PACKETVER >= 20170111
+// new packets
+ packet(0x0ab4,4);
+ packet(0x0ab5,2);
+ packet(0x0ab6,6);
+ packet(0x0ab7,4);
+ packet(0x0ab8,2);
+ packet(0x0ab9,39);
+// changed packet sizes
+#endif
+
+// 2017-01-18aRagexeRE
+#if PACKETVER >= 20170118
+// new packets
+ packet(0x0aba,2);
+ packet(0x0abb,2);
+// changed packet sizes
+ packet(0x0aad,51);
+ packet(0x0ab3,19);
+#endif
+
+// 2017-01-25aRagexeRE
+#if PACKETVER == 20170125
+// shuffle packets
+ packet(0x0438,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0811,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x086e,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0876,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0877,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0879,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x087b,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x087d,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0881,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0884,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0893,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0894,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0895,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0898,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x089b,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x08a5,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x091b,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x091c,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x091d,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0920,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0929,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x092b,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0930,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x093c,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0943,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0944,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x095c,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0965,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0968,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+#endif
+
+// 2017-02-01aRagexeRE
+#if PACKETVER >= 20170201
+// new packets
+ packet(0x0abc,-1);
+// changed packet sizes
+#endif
+
+// 2017-02-08aRagexeRE
+#if PACKETVER == 20170208
+// shuffle packets
+ packet(0x02c4,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0367,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085c,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0860,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x087a,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x088c,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0892,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x08a1,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x08ac,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0921,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0923,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x092d,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0932,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0937,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2017-02-15aRagexeRE
+#if PACKETVER >= 20170215
+// new packets
+ packet(0x0abd,10);
+// changed packet sizes
+#endif
+
+// 2017-02-22aRagexeRE
+#if PACKETVER >= 20170222
+// new packets
+ packet(0x0abe,116);
+ packet(0x0abf,114);
+// changed packet sizes
+#endif
+
+// 2017-02-28aRagexeRE
+#if PACKETVER == 20170228
+// shuffle packets
+ packet(0x022d,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0360,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0362,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0819,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x085e,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0863,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x086b,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0873,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0874,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0876,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0883,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0884,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0889,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0893,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x089e,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x08a0,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x08a2,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x08a6,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x08a7,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x091f,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x092a,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x092e,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0937,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x093e,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0944,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0947,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0948,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0952,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0955,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+#endif
+
+// 2017-02-28aRagexeRE
+#if PACKETVER >= 20170228
+// new packets
+ packet(0x0ac0,26);
+ packet(0x0ac1,26);
+ packet(0x0ac2,-1);
+ packet(0x0ac3,2);
+ packet(0x0ac4,-1);
+ packet(0x0ac5,156,clif->pDull/*,XXX*/);
+ packet(0x0ac6,156);
+ packet(0x0ac7,156);
+// changed packet sizes
+ packet(0x0abe,-1);
+ packet(0x0abf,-1);
+#endif
+
+// 2017-03-08bRagexeRE
+#if PACKETVER == 20170308
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x087d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2017-03-08bRagexeRE
+#if PACKETVER >= 20170308
+// new packets
+ packet(0x0ac8,2);
+ packet(0x0ac9,-1);
+// changed packet sizes
+#endif
+
+// 2017-03-15cRagexeRE
+#if PACKETVER == 20170315
+// shuffle packets
+ packet(0x02c4,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x035f,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0360,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0366,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0367,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0436,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x07ec,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x085c,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0863,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x086a,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0872,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x087b,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0884,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x088b,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x088d,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x088f,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0892,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x089c,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x08aa,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x091a,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x091b,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x091d,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0920,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0922,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0944,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x094a,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x094e,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0950,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0952,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+#endif
+
+// 2017-03-22aRagexeRE
+#if PACKETVER == 20170322
+// shuffle packets
+ packet(0x0202,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x022d,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x023b,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0281,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0361,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0362,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0363,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0364,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x0365,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0436,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x07e4,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x07ec,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0802,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x091a,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2017-03-22aRagexeRE
+#if PACKETVER >= 20170322
+// new packets
+ packet(0x0aca,3);
+// changed packet sizes
+#endif
+
+// 2017-03-29dRagexeRE
+#if PACKETVER == 20170329
+// shuffle packets
+ packet(0x0281,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0363,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0835,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085d,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x087a,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0888,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x08a8,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0917,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0926,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0929,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x092e,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x0937,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0939,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0949,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x095f,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2017-03-29cRagexeRE
+#if PACKETVER >= 20170329
+// new packets
+// changed packet sizes
+ packet(0x0aac,69);
+#endif
+
+// 2017-04-05bRagexeRE
+#if PACKETVER == 20170405
+// shuffle packets
+ packet(0x022d,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x0281,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x035f,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x0360,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0362,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0363,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0368,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x0369,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
+ packet(0x0437,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0811,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0815,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0817,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x0819,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x0835,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0838,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x083c,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x085f,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x0860,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0864,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x0865,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x086f,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0893,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x08a5,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x094c,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x094f,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0964,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x096a,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+#endif
+
+// 2017-04-05bRagexeRE
+#if PACKETVER >= 20170405
+// new packets
+ packet(0x0acb,12);
+ packet(0x0acc,18);
+// changed packet sizes
+#endif
+
+// 2017-04-19bRagexeRE
+#if PACKETVER >= 20170419
+// new packets
+ packet(0x0acd,23);
+// changed packet sizes
+ packet(0x0a99,4);
+#endif
+
+// 2017-04-26dRagexeRE
+#if PACKETVER >= 20170426
+// new packets
+// changed packet sizes
+ packet(0x0a98,10);
+#endif
+
+// 2017-05-02dRagexeRE
+#if PACKETVER >= 20170502
+// new packets
+ packet(0x0ace,4);
+// changed packet sizes
+#endif
+
+// 2017-05-17aRagexeRE
+#if PACKETVER == 20170517
+// shuffle packets
+ packet(0x0364,8,clif->pDull/*,XXX*/); // CZ_JOIN_BATTLE_FIELD
+ packet(0x0367,-1,clif->pReqOpenBuyingStore,2,4,8,9,89); // CZ_REQ_OPEN_BUYING_STORE
+ packet(0x0437,7,clif->pActionRequest,2,6); // CZ_REQUEST_ACT
+ packet(0x0802,18,clif->pPartyBookingRegisterReq,2,4); // CZ_PARTY_BOOKING_REQ_REGISTER
+ packet(0x0815,10,clif->pUseSkillToId,2,4,6); // CZ_USE_SKILL
+ packet(0x0817,10,clif->pUseSkillToPos,2,4,6,8); // CZ_USE_SKILL_TOGROUND
+ packet(0x0868,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); // CZ_USE_SKILL_TOGROUND_WITHTALKBOX
+ packet(0x0875,2,clif->pSearchStoreInfoNextPage,0); // CZ_SEARCH_STORE_INFO_NEXT_PAGE
+ packet(0x087b,6,clif->pSolveCharName,2); // CZ_REQNAME_BYGID
+ packet(0x087d,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); // CZ_SEARCH_STORE_INFO
+ packet(0x088c,8,clif->pMoveFromKafra,2,4); // CZ_MOVE_ITEM_FROM_STORE_TO_BODY
+ packet(0x088d,5,clif->pChangeDir,2,4); // CZ_CHANGE_DIRECTION
+ packet(0x0894,6,clif->pGetCharNameRequest,2); // CZ_REQNAME
+ packet(0x0896,12,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK
+ packet(0x0899,26,clif->pPartyInvite2,2); // CZ_PARTY_JOIN_REQ
+ packet(0x089e,4,clif->pDull/*,XXX*/); // CZ_GANGSI_RANK
+ packet(0x089f,2,clif->pReqCloseBuyingStore,0); // CZ_REQ_CLOSE_BUYING_STORE
+ packet(0x08a2,6,clif->pTickSend,2); // CZ_REQUEST_TIME
+ packet(0x08a8,5,clif->pWalkToXY,2); // CZ_REQUEST_MOVE
+ packet(0x08aa,8,clif->pMoveToKafra,2,4); // CZ_MOVE_ITEM_FROM_BODY_TO_STORE
+ packet(0x091b,-1,clif->pReqTradeBuyingStore,2,4,8,12); // CZ_REQ_TRADE_BUYING_STORE
+ packet(0x0923,19,clif->pWantToConnection,2,6,10,14,18); // CZ_ENTER
+ packet(0x093b,6,clif->pDropItem,2,4); // CZ_ITEM_THROW
+ packet(0x0945,-1,clif->pItemListWindowSelected,2,4,8); // CZ_ITEMLISTWIN_RES
+ packet(0x0946,6,clif->pReqClickBuyingStore,2); // CZ_REQ_CLICK_TO_BUYING_STORE
+ packet(0x0947,36,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD
+ packet(0x0958,5,clif->pHomMenu,2,4); // CZ_COMMAND_MER
+ packet(0x0960,26,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS
+ packet(0x0964,6,clif->pTakeItem,2); // CZ_ITEM_PICKUP
#endif
+
/* PacketKeys: http://herc.ws/board/topic/1105-hercules-wpe-free-june-14th-patch/ */
#if PACKETVER >= 20110817
packetKeys(0x053D5CED,0x3DED6DED,0x6DED6DED); /* Thanks to Shakto */
@@ -3162,10 +6349,254 @@ packet(0x96e,-1,clif->ackmergeitems);
// 2015 Packet Keys
+#if PACKETVER == 20150107
+ packetKeys(0x6C494A14,0x4DDB6427,0x3E6D7B65); /* 4144 */
+#endif
+
+#if PACKETVER == 20150114
+ packetKeys(0x21C96102,0x13142934,0x1ABF4EA3); /* 4144 */
+#endif
+
+#if PACKETVER == 20150128
+ packetKeys(0x77CA2D55,0x28B608F0,0x75B47957); /* 4144 */
+#endif
+
+#if PACKETVER == 20150204
+ packetKeys(0x134529DB,0x5B4F6CEF,0x29EF11EF); /* 4144 */
+#endif
+
+#if PACKETVER == 20150225
+ packetKeys(0x57FD4B7B,0x19CC16FB,0x0D255D72); /* 4144 */
+#endif
+
+#if PACKETVER == 20150226
+ packetKeys(0x57FD4B7B,0x19CC16FB,0x0D255D72); /* 4144 */
+#endif
+
+#if PACKETVER == 20150311
+ packetKeys(0x48C45D97,0x06CE09B0,0x5836642F); /* 4144 */
+#endif
+
+#if PACKETVER == 20150325
+ packetKeys(0x68F62B8C,0x337C3468,0x38FC0AC7); /* 4144 */
+#endif
+
+#if PACKETVER == 20150401
+ packetKeys(0x207F3A08,0x57E6160C,0x02A60382); /* 4144 */
+#endif
+
+#if PACKETVER == 20150422
+ packetKeys(0x10D22CE2,0x69E279E2,0x79E279E2); /* 4144 */
+#endif
+
+#if PACKETVER == 20150429
+ packetKeys(0x2BF61A71,0x565D5DDF,0x0FB90019); /* 4144 */
+#endif
+
+#if PACKETVER == 20150507
+ packetKeys(0x55B54373,0x58967821,0x67F41832); /* 4144 */
+#endif
+
#if PACKETVER >= 20150513
packetKeys(0x62C86D09,0x75944F17,0x112C133D); /* Dastgir */
#endif
+#if PACKETVER == 20150527
+ packetKeys(0x35AE7BAE,0x3BAE3BAE,0x3BAE3BAE); /* 4144 */
+#endif
+
+#if PACKETVER == 20150617
+ packetKeys(0x250F7E09,0x25416076,0x029A780E); /* 4144 */
+#endif
+
+#if PACKETVER == 20150618
+ packetKeys(0x250F7E09,0x25416076,0x029A780E); /* 4144 */
+#endif
+
+#if PACKETVER == 20150819
+ packetKeys(0x1A2400E0,0x736E5686,0x10F315D5); /* 4144 */
+#endif
+
+#if PACKETVER == 20150826
+ packetKeys(0x77883C56,0x1829359F,0x0DE635B6); /* 4144 */
+#endif
+
+#if PACKETVER >= 20151001
+ packetKeys(0x5CFF4561,0x32514AD1,0x06D126D1); /* Dastgir */
+#endif
+
+#if PACKETVER == 20151007
+ packetKeys(0x3C6447A8,0x032170D7,0x6490476C); /* 4144 */
+#endif
+
+#if PACKETVER == 20151014
+ packetKeys(0x402728A8,0x5D0E309F,0x240018FD); /* 4144 */
+#endif
+
+#if PACKETVER == 20151028
+ packetKeys(0x45B945B9,0x45B945B9,0x45B945B9); /* 4144 */
+#endif
+
+#if PACKETVER >= 20151029
+ packetKeys(0x45B945B9,0x45B945B9,0x45B945B9); /* Dastgir */
+#endif
+
+#if PACKETVER >= 20151104
+ packetKeys(0x4C17382A,0x7ED174C9,0x29961E4F); /* ossi0110 */
+#endif
+
+#if PACKETVER == 20151118
+ packetKeys(0x734C3241,0x6E846F34,0x731C06D6); /* 4144 */
+#endif
+
+#if PACKETVER == 20151202
+ packetKeys(0x4EDE52DE,0x52DE52DE,0x52DE52DE); /* 4144 */
+#endif
+
+#if PACKETVER >= 20151216
+ packetKeys(0x25DD643D,0x61AC39DE,0x77A8206D); /* Dastgir */
+#endif
+
+#if PACKETVER == 20151223
+ packetKeys(0x347D68D0,0x2C705320,0x7B4A199D); /* 4144 */
+#endif
+
+#if PACKETVER == 20160127
+ packetKeys(0x6B1E7146,0x612C47E6,0x274E56EE); /* 4144 */
+#endif
+
+#if PACKETVER == 20160203
+ packetKeys(0x3E1411AF,0x6C744497,0x7CFA1BDE); /* 4144 */
+#endif
+
+#if PACKETVER == 20160217
+ packetKeys(0x25895A8E,0x09421C19,0x763A2D7A); /* 4144 */
+#endif
+
+#if PACKETVER == 20160302
+ packetKeys(0x7B4441B9,0x5BBC63AF,0x45DA0E71); /* 4144 */
+#endif
+
+#if PACKETVER == 20160309
+ packetKeys(0x21587520,0x353A7706,0x1B722B25); /* 4144 */
+#endif
+
+#if PACKETVER == 20160330
+ packetKeys(0x02050940,0x545336FF,0x7E7D4902); /* 4144 */
+#endif
+
+#if PACKETVER == 20160420
+ packetKeys(0x67D2163A,0x3068215B,0x4835474D); /* 4144 */
+#endif
+
+#if PACKETVER == 20160511
+ packetKeys(0x3C666FE2,0x27E84E3E,0x53E11BA5); /* 4144 */
+#endif
+
+#if PACKETVER == 20160525
+ packetKeys(0x485C45B6,0x47DC6192,0x76B34A36); /* 4144 */
+#endif
+
+#if PACKETVER == 20160608
+ packetKeys(0x11D74609,0x77C43E8A,0x44290F53); /* 4144 */
+#endif
+
+#if PACKETVER == 20160615
+ packetKeys(0x062C5C26,0x6CF47E82,0x4DD53480); /* 4144 */
+#endif
+
+#if PACKETVER == 20160630
+ packetKeys(0x0DF31CCC,0x54281606,0x5C4C6855); /* 4144 */
+#endif
+
+#if PACKETVER == 20160706
+ packetKeys(0x33A766D0,0x743F04F8,0x0FA0276C); /* 4144 */
+#endif
+
+#if PACKETVER == 20160713
+ packetKeys(0x714F2495,0x7DDC6F32,0x3FD8533D); /* 4144 */
+#endif
+
+#if PACKETVER == 20160720
+ packetKeys(0x4F8A19C0,0x2D8E085C,0x37BB67D6); /* 4144 */
+#endif
+
+#if PACKETVER == 20160727
+ packetKeys(0x3C6952AB,0x26E4077F,0x37E25DF7); /* 4144 */
+#endif
+
+#if PACKETVER == 20160831
+ packetKeys(0x564E13B0,0x7F680549,0x382D273B); /* 4144 */
+#endif
+
+#if PACKETVER == 20160907
+ packetKeys(0x32E5237D,0x57BD4DBD,0x5DBD5DBD); /* 4144 */
+#endif
+
+#if PACKETVER == 20160921
+ packetKeys(0x11CD15CD,0x15CD15CD,0x15CD15CD); /* 4144 */
+#endif
+
+#if PACKETVER == 20161012
+ packetKeys(0x5E2311F2,0x14FD012C,0x76EB64F6); /* 4144 */
+#endif
+
+#if PACKETVER == 20161026
+ packetKeys(0x2CB86AE6,0x7D12660E,0x1B004DEB); /* 4144 */
+#endif
+
+#if PACKETVER == 20161109
+ packetKeys(0x0A5277C0,0x2DB17506,0x0E8F26DA); /* 4144 */
+#endif
+
+#if PACKETVER == 20161207
+ packetKeys(0x52D267AA,0x4FE42156,0x1292153E); /* 4144 */
+#endif
+
+#if PACKETVER == 20161214
+ packetKeys(0x4DDE217B,0x07863AE0,0x5B591656); /* 4144 */
+#endif
+
+#if PACKETVER == 20161221
+ packetKeys(0x69CB4F56,0x793C165E,0x673A2354); /* 4144 */
+#endif
+
+#if PACKETVER == 20170125
+ packetKeys(0x066E04FE,0x3004224A,0x04FF0458); /* 4144 */
+#endif
+
+#if PACKETVER == 20170208
+ packetKeys(0x6A764E5F,0x0609570D,0x28AE07FA); /* 4144 */
+#endif
+
+#if PACKETVER == 20170228
+ packetKeys(0x771D4F2B,0x20EF1F4C,0x0D5135C8); /* 4144 */
+#endif
+
+#if PACKETVER == 20170308
+ packetKeys(0x653470A9,0x6B316A71,0x5C712C71); /* 4144 */
+#endif
+
+#if PACKETVER == 20170315
+ packetKeys(0x399A0856,0x56642A94,0x7F77157D); /* 4144 */
+#endif
+
+#if PACKETVER == 20170322
+ packetKeys(0x2050167B,0x01731233,0x40337033); /* 4144 */
+#endif
+
+#if PACKETVER == 20170329
+ packetKeys(0x18B31A80,0x1B0B1D56,0x16857D6A); /* 4144 */
+#endif
+
+#if PACKETVER == 20170405
+ packetKeys(0x1FDE7DAC,0x2F9F5B63,0x3F2062AF); /* 4144 */
+#endif
+
+#if PACKETVER == 20170517
+ packetKeys(0x2CC4749A,0x1FA954DC,0x72276857); /* 4144 */
+#endif
+
#if defined(OBFUSCATIONKEY1) && defined(OBFUSCATIONKEY2) && defined(OBFUSCATIONKEY3)
packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3);
#endif
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index cc8389a6b..0bd85db7f 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -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-2016 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
@@ -26,6 +26,11 @@
#include "common/cbasetypes.h"
#include "common/mmo.h"
+// Packet DB
+#define MIN_PACKET_DB 0x0064
+#define MAX_PACKET_DB 0x0F00
+#define MAX_PACKET_POS 20
+
/**
*
**/
@@ -136,8 +141,11 @@ enum packet_headers {
authokType = 0x73,
#elif PACKETVER < 20141022
authokType = 0x2eb,
-#else
+// Some clients smaller than 20160330 cant be tested [4144]
+#elif PACKETVER < 20160330
authokType = 0xa18,
+#else
+ authokType = 0x2eb,
#endif
script_clearType = 0x8d6,
package_item_announceType = 0x7fd,
@@ -281,7 +289,7 @@ enum packet_headers {
maptypeproperty2Type = 0x99b,
npcmarketresultackType = 0x9d7,
npcmarketopenType = 0x9d5,
-#if PACKETVER >= 20131223
+#if PACKETVER >= 20131223 // version probably can be 20131030 [4144]
wisendType = 0x9df,
#else
wisendType = 0x98,
@@ -307,186 +315,187 @@ enum packet_headers {
* structs for data
*/
struct EQUIPSLOTINFO {
- unsigned short card[4];
+ uint16 card[4];
} __attribute__((packed));
struct NORMALITEM_INFO {
- short index;
- unsigned short ITID;
- unsigned char type;
+ int16 index;
+ uint16 ITID;
+ uint8 type;
#if PACKETVER < 20120925
uint8 IsIdentified;
#endif
- short count;
+ int16 count;
#if PACKETVER >= 20120925
- unsigned int WearState;
+ uint32 WearState;
#else
- unsigned short WearState;
+ uint16 WearState;
#endif
#if PACKETVER >= 5
struct EQUIPSLOTINFO slot;
#endif
#if PACKETVER >= 20080102
- int HireExpireDate;
+ int32 HireExpireDate;
#endif
#if PACKETVER >= 20120925
struct {
- unsigned char IsIdentified : 1;
- unsigned char PlaceETCTab : 1;
- unsigned char SpareBits : 6;
+ uint8 IsIdentified : 1;
+ uint8 PlaceETCTab : 1;
+ uint8 SpareBits : 6;
} Flag;
#endif
} __attribute__((packed));
-struct RndOptions {
- short index;
- short value;
- unsigned char param;
+struct ItemOptions {
+ int16 index;
+ int16 value;
+ uint8 param;
} __attribute__((packed));
struct EQUIPITEM_INFO {
- short index;
- unsigned short ITID;
- unsigned char type;
+ int16 index;
+ uint16 ITID;
+ uint8 type;
#if PACKETVER < 20120925
uint8 IsIdentified;
#endif
#if PACKETVER >= 20120925
- unsigned int location;
- unsigned int WearState;
+ uint32 location;
+ uint32 WearState;
#else
- unsigned short location;
- unsigned short WearState;
+ uint16 location;
+ uint16 WearState;
#endif
#if PACKETVER < 20120925
uint8 IsDamaged;
#endif
- unsigned char RefiningLevel;
+ uint8 RefiningLevel;
struct EQUIPSLOTINFO slot;
#if PACKETVER >= 20071002
- int HireExpireDate;
+ int32 HireExpireDate;
#endif
#if PACKETVER >= 20080102
- unsigned short bindOnEquipType;
+ uint16 bindOnEquipType;
#endif
#if PACKETVER >= 20100629
- unsigned short wItemSpriteNumber;
+ uint16 wItemSpriteNumber;
#endif
#if PACKETVER >= 20150226
- unsigned char option_count;
- struct RndOptions option_data[5];
+ uint8 option_count;
+ struct ItemOptions option_data[MAX_ITEM_OPTIONS];
#endif
#if PACKETVER >= 20120925
struct {
- unsigned char IsIdentified : 1;
- unsigned char IsDamaged : 1;
- unsigned char PlaceETCTab : 1;
- unsigned char SpareBits : 5;
+ uint8 IsIdentified : 1;
+ uint8 IsDamaged : 1;
+ uint8 PlaceETCTab : 1;
+ uint8 SpareBits : 5;
} Flag;
#endif
} __attribute__((packed));
struct packet_authok {
- short PacketType;
- unsigned int startTime;
- unsigned char PosDir[3];
- unsigned char xSize;
- unsigned char ySize;
+ int16 PacketType;
+ uint32 startTime;
+ uint8 PosDir[3];
+ uint8 xSize;
+ uint8 ySize;
#if PACKETVER >= 20080102
- short font;
+ int16 font;
#endif
-#if PACKETVER >= 20141022
- unsigned char sex;
+// Some clients smaller than 20160330 cant be tested [4144]
+#if PACKETVER >= 20141022 && PACKETVER < 20160330
+ uint8 sex;
#endif
} __attribute__((packed));
struct packet_monster_hp {
- short PacketType;
- unsigned int GID;
- int HP;
- int MaxHP;
+ int16 PacketType;
+ uint32 GID;
+ int32 HP;
+ int32 MaxHP;
} __attribute__((packed));
struct packet_sc_notick {
- short PacketType;
- short index;
- unsigned int AID;
- unsigned char state;
+ int16 PacketType;
+ int16 index;
+ uint32 AID;
+ uint8 state;
} __attribute__((packed));
struct packet_additem {
- short PacketType;
- unsigned short Index;
- unsigned short count;
- unsigned short nameid;
+ int16 PacketType;
+ uint16 Index;
+ uint16 count;
+ uint16 nameid;
uint8 IsIdentified;
uint8 IsDamaged;
- unsigned char refiningLevel;
+ uint8 refiningLevel;
struct EQUIPSLOTINFO slot;
#if PACKETVER >= 20120925
- unsigned int location;
+ uint32 location;
#else
- unsigned short location;
+ uint16 location;
#endif
- unsigned char type;
- unsigned char result;
+ uint8 type;
+ uint8 result;
#if PACKETVER >= 20061218
- int HireExpireDate;
+ int32 HireExpireDate;
#endif
#if PACKETVER >= 20071002
- unsigned short bindOnEquipType;
+ uint16 bindOnEquipType;
#endif
#if PACKETVER >= 20150226
- struct RndOptions option_data[5];
+ struct ItemOptions option_data[MAX_ITEM_OPTIONS];
#endif
} __attribute__((packed));
struct packet_dropflooritem {
- short PacketType;
- unsigned int ITAID;
- unsigned short ITID;
+ int16 PacketType;
+ uint32 ITAID;
+ uint16 ITID;
#if PACKETVER >= 20130000 /* not sure date */
- unsigned short type;
+ uint16 type;
#endif
uint8 IsIdentified;
- short xPos;
- short yPos;
- unsigned char subX;
- unsigned char subY;
- short count;
+ int16 xPos;
+ int16 yPos;
+ uint8 subX;
+ uint8 subY;
+ int16 count;
} __attribute__((packed));
struct packet_idle_unit2 {
#if PACKETVER < 20091103
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20071106
- unsigned char objecttype;
-#endif
- unsigned int GID;
- short speed;
- short bodyState;
- short healthState;
- short effectState;
- short job;
- short head;
- short weapon;
- short accessory;
- short shield;
- short accessory2;
- short accessory3;
- short headpalette;
- short bodypalette;
- short headDir;
- unsigned int GUID;
- short GEmblemVer;
- short honor;
- short virtue;
+ uint8 objecttype;
+#endif
+ uint32 GID;
+ int16 speed;
+ int16 bodyState;
+ int16 healthState;
+ int16 effectState;
+ int16 job;
+ int16 head;
+ int16 weapon;
+ int16 accessory;
+ int16 shield;
+ int16 accessory2;
+ int16 accessory3;
+ int16 headpalette;
+ int16 bodypalette;
+ int16 headDir;
+ uint32 GUID;
+ int16 GEmblemVer;
+ int16 honor;
+ int16 virtue;
uint8 isPKModeON;
- unsigned char sex;
- unsigned char PosDir[3];
- unsigned char xSize;
- unsigned char ySize;
- unsigned char state;
- short clevel;
+ uint8 sex;
+ uint8 PosDir[3];
+ uint8 xSize;
+ uint8 ySize;
+ uint8 state;
+ int16 clevel;
#else // ! PACKETVER < 20091103
UNAVAILABLE_STRUCT;
#endif // PACKETVER < 20091103
@@ -494,470 +503,482 @@ struct packet_idle_unit2 {
struct packet_spawn_unit2 {
#if PACKETVER < 20091103
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20071106
- unsigned char objecttype;
-#endif
- unsigned int GID;
- short speed;
- short bodyState;
- short healthState;
- short effectState;
- short head;
- short weapon;
- short accessory;
- short job;
- short shield;
- short accessory2;
- short accessory3;
- short headpalette;
- short bodypalette;
- short headDir;
+ uint8 objecttype;
+#endif
+ uint32 GID;
+ int16 speed;
+ int16 bodyState;
+ int16 healthState;
+ int16 effectState;
+ int16 head;
+ int16 weapon;
+ int16 accessory;
+ int16 job;
+ int16 shield;
+ int16 accessory2;
+ int16 accessory3;
+ int16 headpalette;
+ int16 bodypalette;
+ int16 headDir;
uint8 isPKModeON;
- unsigned char sex;
- unsigned char PosDir[3];
- unsigned char xSize;
- unsigned char ySize;
+ uint8 sex;
+ uint8 PosDir[3];
+ uint8 xSize;
+ uint8 ySize;
#else // ! PACKETVER < 20091103
UNAVAILABLE_STRUCT;
#endif // PACKETVER < 20091103
} __attribute__((packed));
struct packet_spawn_unit {
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20091103
- short PacketLength;
- unsigned char objecttype;
+ int16 PacketLength;
+ uint8 objecttype;
#endif
#if PACKETVER >= 20131223
- unsigned int AID;
+ uint32 AID;
#endif
- unsigned int GID;
- short speed;
- short bodyState;
- short healthState;
+ uint32 GID;
+ int16 speed;
+ int16 bodyState;
+ int16 healthState;
#if PACKETVER < 20080102
- short effectState;
+ int16 effectState;
#else
- int effectState;
+ int32 effectState;
#endif
- short job;
- short head;
+ int16 job;
+ int16 head;
#if PACKETVER < 7
- short weapon;
+ int16 weapon;
#else
- int weapon;
+ int32 weapon;
#endif
- short accessory;
+ int16 accessory;
#if PACKETVER < 7
- short shield;
+ int16 shield;
#endif
- short accessory2;
- short accessory3;
- short headpalette;
- short bodypalette;
- short headDir;
+ int16 accessory2;
+ int16 accessory3;
+ int16 headpalette;
+ int16 bodypalette;
+ int16 headDir;
#if PACKETVER >= 20101124
- short robe;
+ int16 robe;
#endif
- unsigned int GUID;
- short GEmblemVer;
- short honor;
+ uint32 GUID;
+ int16 GEmblemVer;
+ int16 honor;
#if PACKETVER > 7
- int virtue;
+ int32 virtue;
#else
- short virtue;
+ int16 virtue;
#endif
uint8 isPKModeON;
- unsigned char sex;
- unsigned char PosDir[3];
- unsigned char xSize;
- unsigned char ySize;
- short clevel;
+ uint8 sex;
+ uint8 PosDir[3];
+ uint8 xSize;
+ uint8 ySize;
+ int16 clevel;
#if PACKETVER >= 20080102
- short font;
+ int16 font;
#endif
#if PACKETVER >= 20120221
- int maxHP;
- int HP;
- unsigned char isBoss;
+ int32 maxHP;
+ int32 HP;
+ uint8 isBoss;
#endif
#if PACKETVER >= 20150513
- short body;
+ int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
+ char name[NAME_LENGTH];
#endif
} __attribute__((packed));
struct packet_unit_walking {
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20091103
- short PacketLength;
+ int16 PacketLength;
#endif
#if PACKETVER > 20071106
- unsigned char objecttype;
+ uint8 objecttype;
#endif
#if PACKETVER >= 20131223
- unsigned int AID;
+ uint32 AID;
#endif
- unsigned int GID;
- short speed;
- short bodyState;
- short healthState;
+ uint32 GID;
+ int16 speed;
+ int16 bodyState;
+ int16 healthState;
#if PACKETVER < 7
- short effectState;
+ int16 effectState;
#else
- int effectState;
+ int32 effectState;
#endif
- short job;
- short head;
+ int16 job;
+ int16 head;
#if PACKETVER < 7
- short weapon;
+ int16 weapon;
#else
- int weapon;
+ int32 weapon;
#endif
- short accessory;
- unsigned int moveStartTime;
+ int16 accessory;
+ uint32 moveStartTime;
#if PACKETVER < 7
- short shield;
+ int16 shield;
#endif
- short accessory2;
- short accessory3;
- short headpalette;
- short bodypalette;
- short headDir;
+ int16 accessory2;
+ int16 accessory3;
+ int16 headpalette;
+ int16 bodypalette;
+ int16 headDir;
#if PACKETVER >= 20101124
- short robe;
+ int16 robe;
#endif
- unsigned int GUID;
- short GEmblemVer;
- short honor;
+ uint32 GUID;
+ int16 GEmblemVer;
+ int16 honor;
#if PACKETVER > 7
- int virtue;
+ int32 virtue;
#else
- short virtue;
+ int16 virtue;
#endif
uint8 isPKModeON;
- unsigned char sex;
- unsigned char MoveData[6];
- unsigned char xSize;
- unsigned char ySize;
- short clevel;
+ uint8 sex;
+ uint8 MoveData[6];
+ uint8 xSize;
+ uint8 ySize;
+ int16 clevel;
#if PACKETVER >= 20080102
- short font;
+ int16 font;
#endif
#if PACKETVER >= 20120221
- int maxHP;
- int HP;
- unsigned char isBoss;
+ int32 maxHP;
+ int32 HP;
+ uint8 isBoss;
#endif
#if PACKETVER >= 20150513
- short body;
+ int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
+ char name[NAME_LENGTH];
#endif
} __attribute__((packed));
struct packet_idle_unit {
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20091103
- short PacketLength;
- unsigned char objecttype;
+ int16 PacketLength;
+ uint8 objecttype;
#endif
#if PACKETVER >= 20131223
- unsigned int AID;
+ uint32 AID;
#endif
- unsigned int GID;
- short speed;
- short bodyState;
- short healthState;
+ uint32 GID;
+ int16 speed;
+ int16 bodyState;
+ int16 healthState;
#if PACKETVER < 20080102
- short effectState;
+ int16 effectState;
#else
- int effectState;
+ int32 effectState;
#endif
- short job;
- short head;
+ int16 job;
+ int16 head;
#if PACKETVER < 7
- short weapon;
+ int16 weapon;
#else
- int weapon;
+ int32 weapon;
#endif
- short accessory;
+ int16 accessory;
#if PACKETVER < 7
- short shield;
+ int16 shield;
#endif
- short accessory2;
- short accessory3;
- short headpalette;
- short bodypalette;
- short headDir;
+ int16 accessory2;
+ int16 accessory3;
+ int16 headpalette;
+ int16 bodypalette;
+ int16 headDir;
#if PACKETVER >= 20101124
- short robe;
+ int16 robe;
#endif
- unsigned int GUID;
- short GEmblemVer;
- short honor;
+ uint32 GUID;
+ int16 GEmblemVer;
+ int16 honor;
#if PACKETVER > 7
- int virtue;
+ int32 virtue;
#else
- short virtue;
+ int16 virtue;
#endif
uint8 isPKModeON;
- unsigned char sex;
- unsigned char PosDir[3];
- unsigned char xSize;
- unsigned char ySize;
- unsigned char state;
- short clevel;
+ uint8 sex;
+ uint8 PosDir[3];
+ uint8 xSize;
+ uint8 ySize;
+ uint8 state;
+ int16 clevel;
#if PACKETVER >= 20080102
- short font;
+ int16 font;
#endif
#if PACKETVER >= 20120221
- int maxHP;
- int HP;
- unsigned char isBoss;
+ int32 maxHP;
+ int32 HP;
+ uint8 isBoss;
#endif
#if PACKETVER >= 20150513
- short body;
+ int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
+ char name[NAME_LENGTH];
#endif
} __attribute__((packed));
struct packet_status_change {
- short PacketType;
- short index;
- unsigned int AID;
- unsigned char state;
+ int16 PacketType;
+ int16 index;
+ uint32 AID;
+ uint8 state;
#if PACKETVER >= 20120618
- unsigned int Total;
+ uint32 Total;
#endif
#if PACKETVER >= 20090121
- unsigned int Left;
- int val1;
- int val2;
- int val3;
+ uint32 Left;
+ int32 val1;
+ int32 val2;
+ int32 val3;
#endif
} __attribute__((packed));
struct packet_status_change_end {
- short PacketType;
- short index;
- unsigned int AID;
- unsigned char state;
+ int16 PacketType;
+ int16 index;
+ uint32 AID;
+ uint8 state;
} __attribute__((packed));
struct packet_status_change2 {
- short PacketType;
- short index;
- unsigned int AID;
- unsigned char state;
- unsigned int Left;
- int val1;
- int val2;
- int val3;
+ int16 PacketType;
+ int16 index;
+ uint32 AID;
+ uint8 state;
+ uint32 Left;
+ int32 val1;
+ int32 val2;
+ int32 val3;
} __attribute__((packed));
struct packet_maptypeproperty2 {
- short PacketType;
- short type;
+ int16 PacketType;
+ int16 type;
struct {
- unsigned int party : 1; // Show attack cursor on non-party members (PvP)
- unsigned int guild : 1; // Show attack cursor on non-guild members (GvG)
- unsigned int siege : 1; // Show emblem over characters' heads when in GvG (WoE castle)
- unsigned int mineffect : 1; // Automatically enable /mineffect
- unsigned int nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members)
- unsigned int countpk : 1; /// Show the PvP counter
- unsigned int nopartyformation : 1; /// Prevent party creation/modification
- unsigned int bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect
- unsigned int nocostume : 1; /// Does not show costume sprite.
- unsigned int usecart : 1; /// Allow opening cart inventory
- unsigned int summonstarmiracle : 1; // TODO: What does this do? Related to Taekwon Masters, but I have no idea.
- unsigned int SpareBits : 15; /// Currently ignored, reserved for future updates
+ uint32 party : 1; // Show attack cursor on non-party members (PvP)
+ uint32 guild : 1; // Show attack cursor on non-guild members (GvG)
+ uint32 siege : 1; // Show emblem over characters' heads when in GvG (WoE castle)
+ uint32 mineffect : 1; // Automatically enable /mineffect
+ uint32 nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members)
+ uint32 countpk : 1; /// Show the PvP counter
+ uint32 nopartyformation : 1; /// Prevent party creation/modification
+ uint32 bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect
+ uint32 nocostume : 1; /// Does not show costume sprite.
+ uint32 usecart : 1; /// Allow opening cart inventory
+ uint32 summonstarmiracle : 1; // TODO: What does this do? Related to Taekwon Masters, but I have no idea.
+ uint32 SpareBits : 15; /// Currently ignored, reserved for future updates
} flag;
} __attribute__((packed));
struct packet_bgqueue_ack {
- short PacketType;
- unsigned char type;
+ int16 PacketType;
+ uint8 type;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_notice_delete {
- short PacketType;
- unsigned char type;
+ int16 PacketType;
+ uint8 type;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_register {
- short PacketType;
- short type;
+ int16 PacketType;
+ int16 type;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_update_info {
- short PacketType;
+ int16 PacketType;
char bg_name[NAME_LENGTH];
- int position;
+ int32 position;
} __attribute__((packed));
struct packet_bgqueue_checkstate {
- short PacketType;
+ int16 PacketType;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_revoke_req {
- short PacketType;
+ int16 PacketType;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_battlebegin_ack {
- short PacketType;
- unsigned char result;
+ int16 PacketType;
+ uint8 result;
char bg_name[NAME_LENGTH];
char game_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_notify_entry {
- short PacketType;
+ int16 PacketType;
char name[NAME_LENGTH];
- int position;
+ int32 position;
} __attribute__((packed));
struct packet_bgqueue_battlebegins {
- short PacketType;
+ int16 PacketType;
char bg_name[NAME_LENGTH];
char game_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_script_clear {
- short PacketType;
- unsigned int NpcID;
+ int16 PacketType;
+ uint32 NpcID;
} __attribute__((packed));
/* made possible thanks to Yommy!! */
struct packet_package_item_announce {
- short PacketType;
- short PacketLength;
- unsigned char type;
- unsigned short ItemID;
- char len;
+ int16 PacketType;
+ int16 PacketLength;
+ uint8 type;
+ uint16 ItemID;
+ int8 len;
char Name[NAME_LENGTH];
- char unknown;
- unsigned short BoxItemID;
+ int8 unknown;
+ uint16 BoxItemID;
} __attribute__((packed));
/* made possible thanks to Yommy!! */
struct packet_item_drop_announce {
- short PacketType;
- short PacketLength;
- unsigned char type;
- unsigned short ItemID;
- char len;
+ int16 PacketType;
+ int16 PacketLength;
+ uint8 type;
+ uint16 ItemID;
+ int8 len;
char Name[NAME_LENGTH];
char monsterNameLen;
char monsterName[NAME_LENGTH];
} __attribute__((packed));
struct packet_cart_additem_ack {
- short PacketType;
- char result;
+ int16 PacketType;
+ int8 result;
} __attribute__((packed));
struct packet_banking_check {
- short PacketType;
+ int16 PacketType;
int64 Money;
- short Reason;
+ int16 Reason;
} __attribute__((packed));
struct packet_banking_deposit_req {
- short PacketType;
- unsigned int AID;
- int Money;
+ int16 PacketType;
+ uint32 AID;
+ int32 Money;
} __attribute__((packed));
struct packet_banking_withdraw_req {
- short PacketType;
- unsigned int AID;
- int Money;
+ int16 PacketType;
+ uint32 AID;
+ int32 Money;
} __attribute__((packed));
struct packet_banking_deposit_ack {
- short PacketType;
- short Reason;
+ int16 PacketType;
+ int16 Reason;
int64 Money;
- int Balance;
+ int32 Balance;
} __attribute__((packed));
struct packet_banking_withdraw_ack {
- short PacketType;
- short Reason;
+ int16 PacketType;
+ int16 Reason;
int64 Money;
- int Balance;
+ int32 Balance;
} __attribute__((packed));
/* Roulette System [Yommy/Hercules] */
struct packet_roulette_open_ack {
- short PacketType;
- char Result;
- int Serial;
- char Step;
- char Idx;
- short AdditionItemID;
- int GoldPoint;
- int SilverPoint;
- int BronzePoint;
+ int16 PacketType;
+ int8 Result;
+ int32 Serial;
+ int8 Step;
+ int8 Idx;
+ int16 AdditionItemID;
+ int32 GoldPoint;
+ int32 SilverPoint;
+ int32 BronzePoint;
} __attribute__((packed));
struct packet_roulette_info_ack {
- short PacketType;
- short PacketLength;
- unsigned int RouletteSerial;
+ int16 PacketType;
+ int16 PacketLength;
+ uint32 RouletteSerial;
struct {
- unsigned short Row;
- unsigned short Position;
- unsigned short ItemId;
- unsigned short Count;
+ uint16 Row;
+ uint16 Position;
+ uint16 ItemId;
+ uint16 Count;
} ItemInfo[42];
} __attribute__((packed));
struct packet_roulette_close_ack {
- short PacketType;
- unsigned char Result;
+ int16 PacketType;
+ uint8 Result;
} __attribute__((packed));
struct packet_roulette_generate_ack {
- short PacketType;
- unsigned char Result;
- unsigned short Step;
- unsigned short Idx;
- unsigned short AdditionItemID;
- int RemainGold;
- int RemainSilver;
- int RemainBronze;
+ int16 PacketType;
+ uint8 Result;
+ uint16 Step;
+ uint16 Idx;
+ uint16 AdditionItemID;
+ int32 RemainGold;
+ int32 RemainSilver;
+ int32 RemainBronze;
} __attribute__((packed));
struct packet_roulette_itemrecv_req {
- short PacketType;
- unsigned char Condition;
+ int16 PacketType;
+ uint8 Condition;
} __attribute__((packed));
struct packet_roulette_itemrecv_ack {
- short PacketType;
- unsigned char Result;
- unsigned short AdditionItemID;
+ int16 PacketType;
+ uint8 Result;
+ uint16 AdditionItemID;
} __attribute__((packed));
struct packet_itemlist_normal {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
struct NORMALITEM_INFO list[MAX_ITEMLIST];
} __attribute__((packed));
struct packet_itemlist_equip {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
struct EQUIPITEM_INFO list[MAX_ITEMLIST];
} __attribute__((packed));
struct packet_storelist_normal {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
#if PACKETVER >= 20120925
char name[NAME_LENGTH];
#endif
@@ -965,8 +986,8 @@ struct packet_storelist_normal {
} __attribute__((packed));
struct packet_storelist_equip {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
#if PACKETVER >= 20120925
char name[NAME_LENGTH];
#endif
@@ -974,124 +995,124 @@ struct packet_storelist_equip {
} __attribute__((packed));
struct packet_equip_item {
- short PacketType;
- unsigned short index;
+ int16 PacketType;
+ uint16 index;
#if PACKETVER >= 20120925
- unsigned int wearLocation;
+ uint32 wearLocation;
#else
- unsigned short wearLocation;
+ uint16 wearLocation;
#endif
} __attribute__((packed));
struct packet_equipitem_ack {
- short PacketType;
- unsigned short index;
+ int16 PacketType;
+ uint16 index;
#if PACKETVER >= 20120925
- unsigned int wearLocation;
+ uint32 wearLocation;
#else
- unsigned short wearLocation;
+ uint16 wearLocation;
#endif
#if PACKETVER >= 20100629
- unsigned short wItemSpriteNumber;
+ uint16 wItemSpriteNumber;
#endif
- unsigned char result;
+ uint8 result;
} __attribute__((packed));
struct packet_unequipitem_ack {
- short PacketType;
- unsigned short index;
+ int16 PacketType;
+ uint16 index;
#if PACKETVER >= 20120925
- unsigned int wearLocation;
+ uint32 wearLocation;
#else
- unsigned short wearLocation;
+ uint16 wearLocation;
#endif
- unsigned char result;
+ uint8 result;
} __attribute__((packed));
struct packet_viewequip_ack {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
char characterName[NAME_LENGTH];
- short job;
- short head;
- short accessory;
- short accessory2;
- short accessory3;
+ int16 job;
+ int16 head;
+ int16 accessory;
+ int16 accessory2;
+ int16 accessory3;
#if PACKETVER >= 20101124
- short robe;
+ int16 robe;
#endif
- short headpalette;
- short bodypalette;
- unsigned char sex;
+ int16 headpalette;
+ int16 bodypalette;
+ uint8 sex;
struct EQUIPITEM_INFO list[MAX_INVENTORY];
} __attribute__((packed));
struct packet_notify_bounditem {
- short PacketType;
- unsigned short index;
+ int16 PacketType;
+ uint16 index;
} __attribute__((packed));
struct packet_skill_entry {
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20110718
- short PacketLength;
+ int16 PacketLength;
#endif
- unsigned int AID;
- unsigned int creatorAID;
- short xPos;
- short yPos;
+ uint32 AID;
+ uint32 creatorAID;
+ int16 xPos;
+ int16 yPos;
#if PACKETVER >= 20121212
- int job;
+ int32 job;
#else
- unsigned char job;
+ uint8 job;
#endif
#if PACKETVER >= 20110718
- char RadiusRange;
+ int8 RadiusRange;
#endif
- unsigned char isVisible;
+ uint8 isVisible;
#if PACKETVER >= 20130731
- unsigned char level;
+ uint8 level;
#endif
} __attribute__((packed));
struct packet_graffiti_entry {
- short PacketType;
- unsigned int AID;
- unsigned int creatorAID;
- short xPos;
- short yPos;
- unsigned char job;
- unsigned char isVisible;
- unsigned char isContens;
+ int16 PacketType;
+ uint32 AID;
+ uint32 creatorAID;
+ int16 xPos;
+ int16 yPos;
+ uint8 job;
+ uint8 isVisible;
+ uint8 isContens;
char msg[80];
} __attribute__((packed));
struct packet_damage {
- short PacketType;
- unsigned int GID;
- unsigned int targetGID;
- unsigned int startTime;
- int attackMT;
- int attackedMT;
+ int16 PacketType;
+ uint32 GID;
+ uint32 targetGID;
+ uint32 startTime;
+ int32 attackMT;
+ int32 attackedMT;
#if PACKETVER < 20071113
- short damage;
+ int16 damage;
#else
- int damage;
+ int32 damage;
#endif
#if PACKETVER >= 20131223
- unsigned char is_sp_damaged;
+ uint8 is_sp_damaged;
#endif
- short count;
- unsigned char action;
+ int16 count;
+ uint8 action;
#if PACKETVER < 20071113
- short leftDamage;
+ int16 leftDamage;
#else
- int leftDamage;
+ int32 leftDamage;
#endif
} __attribute__((packed));
struct packet_gm_monster_item {
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20131218
char str[100];
#else
@@ -1100,35 +1121,35 @@ struct packet_gm_monster_item {
} __attribute__((packed));
struct packet_npc_market_purchase {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
struct {
- unsigned short ITID;
- int qty;
- } list[MAX_INVENTORY];/* assuming MAX_INVENTORY is max since you can't hold more than MAX_INVENTORY items thus cant buy that many at once. */
+ uint16 ITID;
+ int32 qty;
+ } list[]; // Note: We assume this should be <= MAX_INVENTORY (since you can't hold more than MAX_INVENTORY items thus cant buy that many at once).
} __attribute__((packed));
struct packet_npc_market_result_ack {
- short PacketType;
- short PacketLength;
- unsigned char result;
+ int16 PacketType;
+ int16 PacketLength;
+ uint8 result;
struct {
- unsigned short ITID;
- unsigned short qty;
- unsigned int price;
+ uint16 ITID;
+ uint16 qty;
+ uint32 price;
} list[MAX_INVENTORY];/* assuming MAX_INVENTORY is max since you can't hold more than MAX_INVENTORY items thus cant buy that many at once. */
} __attribute__((packed));
struct packet_npc_market_open {
- short PacketType;
- short PacketLength;
+ int16 PacketType;
+ int16 PacketLength;
/* inner struct figured by Ind after some annoying hour of debugging (data Thanks to Yommy) */
struct {
- unsigned short nameid;
- unsigned char type;
- unsigned int price;
- unsigned int qty;
- unsigned short view;
+ uint16 nameid;
+ uint8 type;
+ uint32 price;
+ uint32 qty;
+ uint16 view;
// It seems that the client doesn't have any hard-coded limit for this list
// it's possible to send up to 1890 items without dropping a packet that's
// too large [Panikon]
@@ -1136,30 +1157,30 @@ struct packet_npc_market_open {
} __attribute__((packed));
struct packet_wis_end {
- short PacketType;
- char result;
+ int16 PacketType;
+ int8 result;
#if PACKETVER >= 20131223
- unsigned int unknown;/* maybe AID, not sure what for (works sending as 0) */
+ uint32 unknown;/* maybe AID, not sure what for (works sending as 0) */
#endif
} __attribute__((packed));
struct packet_party_leader_changed {
- short PacketType;
- unsigned int prev_leader_aid;
- unsigned int new_leader_aid;
+ int16 PacketType;
+ uint32 prev_leader_aid;
+ uint32 new_leader_aid;
} __attribute__((packed));
struct packet_hotkey {
#ifdef HOTKEY_SAVING
- short PacketType;
+ int16 PacketType;
#if PACKETVER >= 20141022
- char Rotate;
+ int8 Rotate;
#endif
struct {
- char isSkill; // 0: Item, 1:Skill
- unsigned int ID; // Item/Skill ID
- short count; // Item Quantity/Skill Level
+ int8 isSkill; // 0: Item, 1:Skill
+ uint32 ID; // Item/Skill ID
+ int16 count; // Item Quantity/Skill Level
} hotkey[MAX_HOTKEYS];
#else // not HOTKEY_SAVING
UNAVAILABLE_STRUCT;
@@ -1207,6 +1228,19 @@ struct packet_quest_list_header {
//struct packet_quest_list_info list[]; // Variable-length
} __attribute__((packed));
+struct packet_chat_message {
+ uint16 packet_id;
+ int16 packet_len;
+ char message[];
+} __attribute__((packed));
+
+struct packet_whisper_message {
+ uint16 packet_id;
+ int16 packet_len;
+ char name[NAME_LENGTH];
+ char message[];
+} __attribute__((packed));
+
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris
diff --git a/src/map/party.c b/src/map/party.c
index a3e59c281..26b4bae8b 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -58,27 +58,39 @@ struct party_interface *party;
* Used when creating/adding people to a party. [Skotlex]
*------------------------------------------*/
void party_fill_member(struct party_member* member, struct map_session_data* sd, unsigned int leader) {
+ nullpo_retv(member);
+ nullpo_retv(sd);
+
member->account_id = sd->status.account_id;
member->char_id = sd->status.char_id;
safestrncpy(member->name, sd->status.name, NAME_LENGTH);
- member->class_ = sd->status.class_;
+ member->class = sd->status.class;
member->map = sd->mapindex;
member->lv = sd->status.base_level;
member->online = 1;
member->leader = leader;
}
-/// Get the member_id of a party member.
-/// Return -1 if not in party.
-int party_getmemberid(struct party_data* p, struct map_session_data* sd) {
+
+/**
+ * Gets the member_id of a party member.
+ *
+ * @param p Party data.
+ * @param sd Member data.
+ * @return the member_id.
+ * @retval INDEX_NOT_FOUND if not in party.
+ */
+int party_getmemberid(struct party_data *p, struct map_session_data *sd)
+{
int member_id;
- nullpo_retr(-1, p);
- if( sd == NULL )
- return -1;// no player
+ nullpo_retr(INDEX_NOT_FOUND, p);
+
+ if (sd == NULL)
+ return INDEX_NOT_FOUND; // no player
ARR_FIND(0, MAX_PARTY, member_id,
p->party.member[member_id].account_id == sd->status.account_id &&
p->party.member[member_id].char_id == sd->status.char_id);
- if( member_id == MAX_PARTY )
- return -1;// not found
+ if (member_id == MAX_PARTY)
+ return INDEX_NOT_FOUND; // not found
return member_id;
}
@@ -113,7 +125,8 @@ struct map_session_data *party_sd_check(int party_id, int account_id, int char_i
return sd;
}
-int party_db_final(DBKey key, DBData *data, va_list ap) {
+int party_db_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct party_data *p;
if ((p = DB->data2ptr(data))) {
@@ -137,9 +150,8 @@ struct party_data* party_searchname(const char* str)
{
struct party_data* p;
- DBIterator *iter = db_iterator(party->db);
- for( p = dbi_first(iter); dbi_exists(iter); p = dbi_next(iter) )
- {
+ struct DBIterator *iter = db_iterator(party->db);
+ for (p = dbi_first(iter); dbi_exists(iter); p = dbi_next(iter)) {
if( strncmpi(p->party.name,str,NAME_LENGTH) == 0 )
break;
}
@@ -148,11 +160,14 @@ struct party_data* party_searchname(const char* str)
return p;
}
-int party_create(struct map_session_data *sd,char *name,int item,int item2)
+int party_create(struct map_session_data *sd, const char *name,int item,int item2)
{
struct party_member leader;
char tname[NAME_LENGTH];
+ nullpo_retr(0, sd);
+ nullpo_retr(0, name);
+
safestrncpy(tname, name, NAME_LENGTH);
trim(tname);
@@ -175,7 +190,8 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2)
return 0;
}
-void party_created(int account_id,int char_id,int fail,int party_id,char *name) {
+void party_created(int account_id, int char_id, int fail, int party_id, const char *name)
+{
struct map_session_data *sd;
sd=map->id2sd(account_id);
@@ -218,33 +234,39 @@ int party_recv_noinfo(int party_id, int char_id) {
void party_check_state(struct party_data *p) {
int i;
+ nullpo_retv(p);
memset(&p->state, 0, sizeof(p->state));
- for (i = 0; i < MAX_PARTY; i ++) {
+ for (i = 0; i < MAX_PARTY; i++) {
if (!p->party.member[i].online) continue; //Those not online shouldn't apart to skill usage and all that.
- switch (p->party.member[i].class_) {
+ switch (p->party.member[i].class) {
case JOB_MONK:
case JOB_BABY_MONK:
case JOB_CHAMPION:
+ case JOB_SURA:
+ case JOB_SURA_T:
+ case JOB_BABY_SURA:
p->state.monk = 1;
- break;
+ break;
case JOB_STAR_GLADIATOR:
p->state.sg = 1;
- break;
+ break;
case JOB_SUPER_NOVICE:
case JOB_SUPER_BABY:
+ case JOB_SUPER_NOVICE_E:
+ case JOB_SUPER_BABY_E:
p->state.snovice = 1;
- break;
+ break;
case JOB_TAEKWON:
p->state.tk = 1;
- break;
+ break;
}
}
}
-int party_recv_info(struct party* sp, int char_id)
+int party_recv_info(const struct party *sp, int char_id)
{
struct party_data* p;
- struct party_member* member;
+ const struct party_member *member;
struct map_session_data* sd;
int removed[MAX_PARTY];// member_id in old data
int removed_count = 0;
@@ -252,6 +274,7 @@ int party_recv_info(struct party* sp, int char_id)
int added_count = 0;
int j;
int member_id;
+ int leader_account_id = 0, leader_char_id = 0;
nullpo_ret(sp);
@@ -265,8 +288,12 @@ int party_recv_info(struct party* sp, int char_id)
ARR_FIND(0, MAX_PARTY, i,
sp->member[i].account_id == member->account_id &&
sp->member[i].char_id == member->char_id);
- if (i == MAX_PARTY)
+ if (i == MAX_PARTY) {
removed[removed_count++] = member_id;
+ } else if (member->leader != 0) {
+ leader_account_id = member->account_id;
+ leader_char_id = member->char_id;
+ }
}
for (member_id = 0; member_id < MAX_PARTY; ++member_id) {
member = &sp->member[member_id];
@@ -294,6 +321,7 @@ int party_recv_info(struct party* sp, int char_id)
continue;// not online
party->member_withdraw(sp->party_id, sd->status.account_id, sd->status.char_id);
}
+
memcpy(&p->party, sp, sizeof(struct party));
memset(&p->state, 0, sizeof(p->state));
memset(&p->data, 0, sizeof(p->data));
@@ -302,6 +330,8 @@ int party_recv_info(struct party* sp, int char_id)
if ( member->char_id == 0 )
continue;// empty
p->data[member_id].sd = party->sd_check(sp->party_id, member->account_id, member->char_id);
+ if (member->account_id == leader_account_id && member->char_id == leader_char_id)
+ p->party.member[member_id].leader = 1;
}
party->check_state(p);
while( added_count > 0 ) { // new in party
@@ -325,7 +355,7 @@ int party_recv_info(struct party* sp, int char_id)
if( char_id != 0 ) {
// requester
sd = map->charid2sd(char_id);
- if( sd && sd->status.party_id == sp->party_id && party->getmemberid(p,sd) == -1 )
+ if (sd != NULL && sd->status.party_id == sp->party_id && party->getmemberid(p,sd) == INDEX_NOT_FOUND)
sd->status.party_id = 0;// was not in the party
}
return 0;
@@ -345,7 +375,7 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd)
ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd);
if( i == MAX_PARTY || !p->party.member[i].leader ) {
- clif->message(sd->fd, msg_sd(sd,282));
+ clif->message(sd->fd, msg_sd(sd,282)); // You need to be a party leader to use this command.
return 0;
}
@@ -397,6 +427,8 @@ void party_reply_invite(struct map_session_data *sd,int party_id,int flag) {
struct map_session_data* tsd;
struct party_member member;
+ nullpo_retv(sd);
+
if( sd->party_invite != party_id )
{// forged
sd->party_invite = 0;
@@ -426,8 +458,11 @@ void party_reply_invite(struct map_session_data *sd,int party_id,int flag) {
//- Player must be authed/active and belong to a party before calling this method
void party_member_joined(struct map_session_data *sd)
{
- struct party_data* p = party->search(sd->status.party_id);
+ struct party_data* p;
int i;
+
+ nullpo_retv(sd);
+ p = party->search(sd->status.party_id);
if (!p) {
party->request_info(sd->status.party_id, sd->status.char_id);
return;
@@ -510,7 +545,7 @@ int party_member_added(int party_id,int account_id,int char_id, int flag) {
}
/// Party member 'sd' requesting kick of member with <account_id, name>.
-int party_removemember(struct map_session_data* sd, int account_id, char* name)
+int party_removemember(struct map_session_data* sd, int account_id, const char *name)
{
struct party_data *p;
int i;
@@ -526,6 +561,7 @@ int party_removemember(struct map_session_data* sd, int account_id, char* name)
if( !p->party.member[i].leader )
return 0; // only party leader may remove members
+ nullpo_retr(0, name);
ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && strncmp(p->party.member[i].name,name,NAME_LENGTH) == 0 );
if( i == MAX_PARTY )
return 0; // no such char in party
@@ -540,6 +576,7 @@ int party_leave(struct map_session_data *sd)
struct party_data *p;
int i;
+ nullpo_ret(sd);
p = party->search(sd->status.party_id);
if( p == NULL )
return 0;
@@ -562,11 +599,43 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
int i;
ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id );
if( i < MAX_PARTY ) {
+ bool was_leader = false;
+ int prev_leader_accountId = 0;
+ if (p->party.member[i].leader != 0) {
+ was_leader = true;
+ prev_leader_accountId = p->party.member[i].account_id;
+ }
+
clif->party_withdraw(p,sd,account_id,p->party.member[i].name,0x0);
memset(&p->party.member[i], 0, sizeof(p->party.member[0]));
memset(&p->data[i], 0, sizeof(p->data[0]));
p->party.count--;
party->check_state(p);
+
+ if (was_leader) {
+ int k;
+ // Member was party leader, try to pick a new leader from online members
+ ARR_FIND(0, MAX_PARTY, k, p->party.member[k].account_id != 0 && p->party.member[k].online == 1);
+
+ if (k == MAX_PARTY) {
+ // No online members, get an offline one
+ ARR_FIND(0, MAX_PARTY, k, p->party.member[k].account_id != 0);
+ }
+
+ if (k < MAX_PARTY) {
+ // Update party's leader
+ p->party.member[k].leader = 1;
+
+ if (p->data[k].sd != NULL) {
+ /** update members **/
+ clif->PartyLeaderChanged(p->data[k].sd, prev_leader_accountId, p->data[k].sd->status.account_id);
+ }
+
+ //Update info.
+ intif->party_leaderchange(p->party.party_id, p->party.member[k].account_id, p->party.member[k].char_id);
+ clif->party_info(p, NULL);
+ }
+ }
}
}
@@ -658,12 +727,12 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
return false;
if (!tsd || tsd->status.party_id != sd->status.party_id) {
- clif->message(sd->fd, msg_sd(sd,283));
+ clif->message(sd->fd, msg_sd(sd,283)); // Target character must be online and in your current party.
return false;
}
if( map->list[sd->bl.m].flag.partylock ) {
- clif->message(sd->fd, msg_sd(sd,287));
+ clif->message(sd->fd, msg_sd(sd,287)); // You cannot change party leaders in this map.
return false;
}
@@ -675,8 +744,7 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts
return false; //Shouldn't happen
if (!p->party.member[mi].leader) {
- //Need to be a party leader.
- clif->message(sd->fd, msg_sd(sd,282));
+ clif->message(sd->fd, msg_sd(sd,282)); // You need to be a party leader to use this command.
return false;
}
@@ -733,6 +801,8 @@ void party_send_movemap(struct map_session_data *sd)
{
struct party_data *p;
+ nullpo_retv(sd);
+
if( sd->status.party_id==0 )
return;
@@ -772,6 +842,8 @@ int party_send_logout(struct map_session_data *sd)
struct party_data *p;
int i;
+ nullpo_ret(sd);
+
if(!sd->status.party_id)
return 0;
@@ -788,12 +860,19 @@ int party_send_logout(struct map_session_data *sd)
return 1;
}
-int party_send_message(struct map_session_data *sd,const char *mes,int len)
+int party_send_message(struct map_session_data *sd, const char *mes)
{
- if(sd->status.party_id==0)
+ int len;
+
+ nullpo_ret(sd);
+ nullpo_ret(mes);
+
+ len = (int)strlen(mes);
+
+ if (sd->status.party_id == 0)
return 0;
- intif->party_message(sd->status.party_id,sd->status.account_id,mes,len);
- party->recv_message(sd->status.party_id,sd->status.account_id,mes,len);
+ intif->party_message(sd->status.party_id, sd->status.account_id, mes, len);
+ party->recv_message(sd->status.party_id, sd->status.account_id, mes, len);
// Chat logging type 'P' / Party Chat
logs->chat(LOG_CHAT_PARTY, sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
@@ -833,6 +912,8 @@ int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id
return 0; //Unknown case?
}
+ nullpo_ret(sd);
+
for(i=0;i<MAX_PARTY;i++){
if ((p_sd = p->data[i].sd) == NULL)
continue;
@@ -840,15 +921,14 @@ int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id
continue;
switch(skill_id) {
case TK_COUNTER: //Increase Triple Attack rate of Monks.
- if((p_sd->class_&MAPID_UPPERMASK) == MAPID_MONK
- && pc->checkskill(p_sd,MO_TRIPLEATTACK)) {
+ if ((p_sd->job & MAPID_UPPERMASK) == MAPID_MONK && pc->checkskill(p_sd, MO_TRIPLEATTACK)) {
sc_start4(&p_sd->bl,&p_sd->bl,SC_SKILLRATE_UP,100,MO_TRIPLEATTACK,
50+50*skill_lv, //+100/150/200% rate
0,0,skill->get_time(SG_FRIEND, 1));
}
break;
case MO_COMBOFINISH: //Increase Counter rate of Star Gladiators
- if((p_sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
+ if ((p_sd->job & MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
&& sd->sc.data[SC_COUNTERKICK_READY]
&& pc->checkskill(p_sd,SG_FRIEND)) {
sc_start4(&p_sd->bl,&p_sd->bl,SC_SKILLRATE_UP,100,TK_COUNTER,
@@ -861,10 +941,11 @@ int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id
return 0;
}
-int party_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
+int party_send_xy_timer(int tid, int64 tick, int id, intptr_t data)
+{
+ struct DBIterator *iter = db_iterator(party->db);
struct party_data* p;
- DBIterator *iter = db_iterator(party->db);
// for each existing party,
for( p = dbi_first(iter); dbi_exists(iter); p = dbi_next(iter) )
{
@@ -919,11 +1000,9 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
{
struct map_session_data* sd[MAX_PARTY];
unsigned int i, c;
-#ifdef RENEWAL_EXP
- unsigned int job_exp_bonus, base_exp_bonus;
-#endif
nullpo_ret(p);
+ nullpo_ret(src);
// count the number of players eligible for exp sharing
for (i = c = 0; i < MAX_PARTY; i++) {
@@ -948,21 +1027,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
zeny = (unsigned int) cap_value(zeny * bonus/100, INT_MIN, INT_MAX);
}
-#ifdef RENEWAL_EXP
- base_exp_bonus = base_exp;
- job_exp_bonus = job_exp;
-#endif
-
for (i = 0; i < c; i++) {
-#ifdef RENEWAL_EXP
- struct mob_data *md = BL_CAST(BL_MOB, src);
- if (md != NULL && md->db->mexp == 0) {
- int rate = pc->level_penalty_mod(md->level - (sd[i])->status.base_level, md->status.race, md->status.mode, 1);
-
- base_exp = (unsigned int)cap_value(base_exp_bonus * rate / 100, 1, UINT_MAX);
- job_exp = (unsigned int)cap_value(job_exp_bonus * rate / 100, 1, UINT_MAX);
- }
-#endif
pc->gainexp(sd[i], src, base_exp, job_exp, false);
if (zeny) // zeny from mobs [Valaris]
@@ -976,8 +1041,12 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
{
struct map_session_data *target = NULL;
int i;
+
+ nullpo_ret(item_data);
+
if (p && p->party.item&2 && (first_charid || !(battle_config.party_share_type&1)))
{
+ nullpo_ret(sd);
//item distribution to party members.
if (battle_config.party_share_type&2) {
//Round Robin
@@ -1039,6 +1108,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i
int party_send_dot_remove(struct map_session_data *sd)
{
+ nullpo_ret(sd);
if (sd->status.party_id)
clif->party_xy_remove(sd);
return 0;
@@ -1054,6 +1124,7 @@ int party_sub_count(struct block_list *bl, va_list ap)
nullpo_ret(bl);
Assert_ret(bl->type == BL_PC);
sd = BL_UCCAST(BL_PC, bl);
+ nullpo_ret(sd);
if (sd->state.autotrade)
return 0;
@@ -1128,7 +1199,7 @@ int party_sub_count_chorus(struct block_list *bl, va_list ap)
if (battle_config.idle_no_share && pc_isidle(sd))
return 0;
- if ( (sd->class_&MAPID_THIRDMASK) != MAPID_MINSTRELWANDERER )
+ if ((sd->job & MAPID_THIRDMASK) != MAPID_MINSTRELWANDERER)
return 0;
return 1;
@@ -1166,6 +1237,9 @@ void party_recruit_register(struct map_session_data *sd, short level, const char
#ifdef PARTY_RECRUIT
struct party_booking_ad_info *pb_ad;
+ nullpo_retv(sd);
+ nullpo_retv(notice);
+
pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id);
if( pb_ad == NULL )
@@ -1196,6 +1270,9 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi
struct party_booking_ad_info *pb_ad;
int i;
+ nullpo_retv(sd);
+ nullpo_retv(job);
+
pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id);
if( pb_ad == NULL )
{
@@ -1229,6 +1306,7 @@ void party_recruit_update(struct map_session_data *sd, const char *notice) {
#ifdef PARTY_RECRUIT
struct party_booking_ad_info *pb_ad;
+ nullpo_retv(sd);
pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id);
if( pb_ad == NULL )
@@ -1250,6 +1328,9 @@ void party_booking_update(struct map_session_data *sd, short* job) {
int i;
struct party_booking_ad_info *pb_ad;
+ nullpo_retv(sd);
+ nullpo_retv(job);
+
pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id);
if( pb_ad == NULL )
@@ -1274,8 +1355,9 @@ void party_recruit_search(struct map_session_data *sd, short level, short mapid,
int count = 0;
struct party_booking_ad_info* result_list[PARTY_BOOKING_RESULTS];
bool more_result = false;
- DBIterator* iter = db_iterator(party->booking_db);
+ struct DBIterator *iter = db_iterator(party->booking_db);
+ nullpo_retv(sd);
memset(result_list, 0, sizeof(result_list));
for( pb_ad = dbi_first(iter); dbi_exists(iter); pb_ad = dbi_next(iter) )
@@ -1305,7 +1387,9 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid,
int count = 0;
struct party_booking_ad_info* result_list[PARTY_BOOKING_RESULTS];
bool more_result = false;
- DBIterator* iter = db_iterator(party->booking_db);
+ struct DBIterator *iter = db_iterator(party->booking_db);
+
+ nullpo_retv(sd);
memset(result_list, 0, sizeof(result_list));
@@ -1342,6 +1426,8 @@ bool party_booking_delete(struct map_session_data *sd)
{
struct party_booking_ad_info* pb_ad;
+ nullpo_retr(false, sd);
+
if((pb_ad = (struct party_booking_ad_info*)idb_get(party->booking_db, sd->status.char_id))!=NULL)
{
#ifdef PARTY_RECRUIT
diff --git a/src/map/party.h b/src/map/party.h
index 828916b88..aa0977499 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -85,8 +85,8 @@ struct party_booking_ad_info {
* created by Susu
*-------------------------------------*/
struct party_interface {
- DBMap* db; // int party_id -> struct party_data* (releases data)
- DBMap* booking_db; // int char_id -> struct party_booking_ad_info* (releases data) // Party Booking [Spiria]
+ struct DBMap *db; // int party_id -> struct party_data* (releases data)
+ struct DBMap *booking_db; // int char_id -> struct party_booking_ad_info* (releases data) // Party Booking [Spiria]
unsigned int booking_nextid;
/* funcs */
void (*init) (bool minimal);
@@ -97,18 +97,18 @@ struct party_interface {
int (*getmemberid) (struct party_data* p, struct map_session_data* sd);
struct map_session_data* (*getavailablesd) (struct party_data *p);
- int (*create) (struct map_session_data *sd,char *name, int item, int item2);
- void (*created) (int account_id,int char_id,int fail,int party_id,char *name);
+ int (*create) (struct map_session_data *sd, const char *name, int item, int item2);
+ void (*created) (int account_id, int char_id, int fail, int party_id, const char *name);
int (*request_info) (int party_id, int char_id);
int (*invite) (struct map_session_data *sd,struct map_session_data *tsd);
void (*member_joined) (struct map_session_data *sd);
int (*member_added) (int party_id,int account_id,int char_id,int flag);
int (*leave) (struct map_session_data *sd);
- int (*removemember) (struct map_session_data *sd,int account_id,char *name);
+ int (*removemember) (struct map_session_data *sd, int account_id, const char *name);
int (*member_withdraw) (int party_id,int account_id,int char_id);
void (*reply_invite) (struct map_session_data *sd,int party_id,int flag);
int (*recv_noinfo) (int party_id, int char_id);
- int (*recv_info) (struct party* sp, int char_id);
+ int (*recv_info) (const struct party *sp, int char_id);
int (*recv_movemap) (int party_id,int account_id,int char_id, unsigned short mapid,int online,int lv);
int (*broken) (int party_id);
int (*optionchanged) (int party_id,int account_id,int exp,int item,int flag);
@@ -117,7 +117,7 @@ struct party_interface {
void (*send_movemap) (struct map_session_data *sd);
void (*send_levelup) (struct map_session_data *sd);
int (*send_logout) (struct map_session_data *sd);
- int (*send_message) (struct map_session_data *sd,const char *mes,int len);
+ int (*send_message) (struct map_session_data *sd, const char *mes);
int (*recv_message) (int party_id,int account_id,const char *mes,int len);
int (*skill_check) (struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv);
int (*send_xy_clear) (struct party_data *p);
@@ -145,7 +145,7 @@ struct party_interface {
struct map_session_data *(*sd_check) (int party_id, int account_id, int char_id);
void (*check_state) (struct party_data *p);
struct party_booking_ad_info* (*create_booking_data) (void);
- int (*db_final) (DBKey key, DBData *data, va_list ap);
+ int (*db_final) (union DBKey key, struct DBData *data, va_list ap);
};
#ifdef HERCULES_CORE
diff --git a/src/map/path.c b/src/map/path.c
index 543497c33..509a82c7e 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -89,6 +89,7 @@ int path_blownpos(struct block_list *bl, int16 m,int16 x0,int16 y0,int16 dx,int1
{
struct map_data *md;
+ Assert_retr(-1, m >= 0 && m < map->count);
if( !map->list[m].cell )
return -1;
md = &map->list[m];
@@ -126,6 +127,8 @@ bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,i
struct map_data *md;
struct shootpath_data s_spd;
+ Assert_retr(false, m >= 0 && m < map->count);
+
if( spd == NULL )
spd = &s_spd; // use dummy output variable
@@ -189,10 +192,8 @@ bool path_search_long(struct shootpath_data *spd,struct block_list *bl,int16 m,i
/// Ensures there is enough space in array to store new element.
static void heap_push_node(struct node_heap *heap, struct path_node *node)
{
-#ifndef __clang_analyzer__ // TODO: Figure out why clang's static analyzer doesn't like this
BHEAP_ENSURE(*heap, 1, 256);
BHEAP_PUSH2(*heap, node, NODE_MINTOPCMP, swap_ptr);
-#endif // __clang_analyzer__
}
/// Updates path_node in the binary node_heap.
@@ -254,10 +255,12 @@ static int add_path(struct node_heap *heap, struct path_node *tp, int16 x, int16
*------------------------------------------*/
bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell)
{
- register int i, j, x, y, dx, dy;
+ register int i, x, y, dx, dy;
struct map_data *md;
struct walkpath_data s_wpd;
+ Assert_retr(false, m >= 0 && m < map->count);
+
if (wpd == NULL)
wpd = &s_wpd; // use dummy output variable
@@ -315,8 +318,7 @@ bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int1
}
return false; // easy path unsuccessful
- }
- else { // !(flag&1)
+ } else { // !(flag&1)
// A* (A-star) pathfinding
// We always use A* for finding walkpaths because it is what game client uses.
// Easy pathfinding cuts corners of non-walkable cells, but client always walks around it.
@@ -331,6 +333,7 @@ bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int1
int xs = md->xs - 1;
int ys = md->ys - 1;
int len = 0;
+ int j;
memset(tp, 0, sizeof(tp));
// Start node
@@ -407,7 +410,7 @@ bool path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int1
}
for (it = current; it->parent != NULL; it = it->parent, len++);
- if (len > sizeof(wpd->path)) {
+ if (len > (int)sizeof(wpd->path)) {
return false;
}
diff --git a/src/map/path.h b/src/map/path.h
index c84b77eb0..1e67a8d97 100644
--- a/src/map/path.h
+++ b/src/map/path.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/pc.c b/src/map/pc.c
index 8d1df71a9..2303a83ca 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -63,6 +63,7 @@
#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h"
+#include "common/sql.h"
#include "common/strlib.h" // safestrncpy()
#include "common/sysinfo.h"
#include "common/timer.h"
@@ -79,10 +80,13 @@ struct pc_interface *pc;
//Converts a class to its array index for CLASS_COUNT defined arrays.
//Note that it does not do a validity check for speed purposes, where parsing
//player input make sure to use a pc->db_checkid first!
-int pc_class2idx(int class_) {
- if (class_ >= JOB_NOVICE_HIGH)
- return class_- JOB_NOVICE_HIGH+JOB_MAX_BASIC;
- return class_;
+int pc_class2idx(int class)
+{
+ if (class >= JOB_NOVICE_HIGH) {
+ class += - JOB_NOVICE_HIGH + JOB_MAX_BASIC;
+ }
+ Assert_ret(class >= 0 && class < CLASS_COUNT);
+ return class;
}
/**
@@ -108,6 +112,7 @@ struct map_session_data* pc_get_dummy_sd(void)
int pc_set_group(struct map_session_data *sd, int group_id)
{
GroupSettings *group = pcg->id2group(group_id);
+ nullpo_retr(1, sd);
if (group == NULL)
return 1;
sd->group_id = group_id;
@@ -120,6 +125,7 @@ int pc_set_group(struct map_session_data *sd, int group_id)
*/
bool pc_should_log_commands(struct map_session_data *sd)
{
+ nullpo_retr(true, sd);
return pcg->should_log_commands(sd->group);
}
@@ -140,7 +146,8 @@ int pc_invincible_timer(int tid, int64 tick, int id, intptr_t data)
return 0;
}
-void pc_setinvincibletimer(struct map_session_data* sd, int val) {
+void pc_setinvincibletimer(struct map_session_data* sd, int val)
+{
nullpo_retv(sd);
val += map->list[sd->bl.m].invincible_time_inc;
@@ -241,7 +248,7 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max)
memmove(sd->spirit_timer+i+1, sd->spirit_timer+i, (sd->spiritball-i)*sizeof(int));
sd->spirit_timer[i] = tid;
sd->spiritball++;
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD)
clif->millenniumshield(&sd->bl,sd->spiritball);
else
clif->spiritball(&sd->bl);
@@ -280,7 +287,7 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type)
}
if(!type) {
- if( (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD )
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD)
clif->millenniumshield(&sd->bl,sd->spiritball);
else
clif->spiritball(&sd->bl);
@@ -380,52 +387,108 @@ int pc_banding(struct map_session_data *sd, uint16 skill_lv) {
return c;
}
-// Increases a player's fame points and displays a notice to him
-void pc_addfame(struct map_session_data *sd,int count)
+/**
+ * Increases a player's fame points and displays a notice to them.
+ *
+ * If the character's job class doesn't allow the specified rank type, nothing
+ * happens and the request is ignored.
+ *
+ * @param sd The target character.
+ * @param type The fame list type (@see enum fame_list_type).
+ * @param count The amount of points to add.
+ */
+void pc_addfame(struct map_session_data *sd, int ranktype, int count)
{
- int ranktype = -1;
nullpo_retv(sd);
+
+ switch (ranktype) {
+ case RANKTYPE_BLACKSMITH:
+ if ((sd->job & MAPID_UPPERMASK) != MAPID_BLACKSMITH)
+ return;
+ break;
+ case RANKTYPE_ALCHEMIST:
+ if ((sd->job & MAPID_UPPERMASK) != MAPID_ALCHEMIST)
+ return;
+ break;
+ case RANKTYPE_TAEKWON:
+ if ((sd->job & MAPID_UPPERMASK) != MAPID_TAEKWON)
+ return;
+ break;
+ case RANKTYPE_PK:
+ // Not supported
+ FALLTHROUGH
+ default:
+ Assert_retv(0);
+ }
+
sd->status.fame += count;
- if(sd->status.fame > MAX_FAME)
+ if (sd->status.fame > MAX_FAME)
sd->status.fame = MAX_FAME;
- switch(sd->class_&MAPID_UPPERMASK){
- case MAPID_BLACKSMITH: ranktype = RANKTYPE_BLACKSMITH; break;
- case MAPID_ALCHEMIST: ranktype = RANKTYPE_ALCHEMIST; break;
- case MAPID_TAEKWON: ranktype = RANKTYPE_TAEKWON; break;
- }
+
clif->update_rankingpoint(sd, ranktype, count);
chrif->updatefamelist(sd);
}
-// Check whether a player ID is in the fame rankers' list of its job, returns his/her position if so, 0 else
-unsigned char pc_famerank(int char_id, int job)
+/**
+ * Returns a character's rank in the specified fame list.
+ *
+ * @param char_id The character ID.
+ * @param ranktype The rank list type (@see enum fame_list_type).
+ * @return The rank position (1-based index)
+ * @retval 0 if the character isn't in the specified list.
+ */
+int pc_fame_rank(int char_id, int ranktype)
{
int i;
- switch(job){
- case MAPID_BLACKSMITH: // Blacksmith
- for(i = 0; i < MAX_FAME_LIST; i++){
- if(pc->smith_fame_list[i].id == char_id)
- return i + 1;
- }
- break;
- case MAPID_ALCHEMIST: // Alchemist
- for(i = 0; i < MAX_FAME_LIST; i++){
- if(pc->chemist_fame_list[i].id == char_id)
- return i + 1;
- }
- break;
- case MAPID_TAEKWON: // Taekwon
- for(i = 0; i < MAX_FAME_LIST; i++){
- if(pc->taekwon_fame_list[i].id == char_id)
- return i + 1;
- }
- break;
+ switch (ranktype) {
+ case RANKTYPE_BLACKSMITH:
+ for (i = 0; i < MAX_FAME_LIST; i++) {
+ if (pc->smith_fame_list[i].id == char_id)
+ return i + 1;
+ }
+ break;
+ case RANKTYPE_ALCHEMIST:
+ for (i = 0; i < MAX_FAME_LIST; i++) {
+ if (pc->chemist_fame_list[i].id == char_id)
+ return i + 1;
+ }
+ break;
+ case RANKTYPE_TAEKWON:
+ for (i = 0; i < MAX_FAME_LIST; i++) {
+ if (pc->taekwon_fame_list[i].id == char_id)
+ return i + 1;
+ }
+ break;
+ case RANKTYPE_PK: // Not implemented
+ FALLTHROUGH
+ default:
+ Assert_ret(0);
}
return 0;
}
+/**
+ * Returns the appropriate fame list type for the given job.
+ *
+ * @param job_mapid The job (in MapID format)
+ * @return the appropriate fame list type (@see enum fame_list_type).
+ * @retval RANKTYPE_UNKNOWN if no appropriate type exists.
+ */
+int pc_famelist_type(uint16 job_mapid) {
+ switch (job_mapid & MAPID_UPPERMASK) {
+ case MAPID_BLACKSMITH:
+ return RANKTYPE_BLACKSMITH;
+ case MAPID_ALCHEMIST:
+ return RANKTYPE_ALCHEMIST;
+ case MAPID_TAEKWON:
+ return RANKTYPE_TAEKWON;
+ default:
+ return RANKTYPE_UNKNOWN;
+ }
+}
+
int pc_setrestartvalue(struct map_session_data *sd,int type) {
struct status_data *st, *bst;
nullpo_ret(sd);
@@ -465,6 +528,7 @@ int pc_inventory_rental_end(int tid, int64 tick, int id, intptr_t data) {
int pc_inventory_rental_clear(struct map_session_data *sd)
{
+ nullpo_ret(sd);
if( sd->rental_timer != INVALID_TIMER )
{
timer->delete(sd->rental_timer, pc->inventory_rental_end);
@@ -475,11 +539,15 @@ int pc_inventory_rental_clear(struct map_session_data *sd)
}
/* assumes i is valid (from default areas where it is called, it is) */
void pc_rental_expire(struct map_session_data *sd, int i) {
- short nameid = sd->status.inventory[i].nameid;
+ short nameid;
+
+ nullpo_retv(sd);
+ Assert_retv(i >= 0 && i < MAX_INVENTORY);
+ nameid = sd->status.inventory[i].nameid;
/* Soon to be dropped, we got plans to integrate it with item db */
switch( nameid ) {
- case ITEMID_REINS_OF_MOUNT:
+ case ITEMID_BOARDING_HALTER:
status_change_end(&sd->bl,SC_ALL_RIDING,INVALID_TIMER);
break;
case ITEMID_LOVE_ANGEL:
@@ -539,13 +607,14 @@ void pc_rental_expire(struct map_session_data *sd, int i) {
}
clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
- pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_RENTAL);
}
void pc_inventory_rentals(struct map_session_data *sd)
{
int i, c = 0;
int64 expire_tick, next_tick = INT64_MAX;
+ nullpo_retv(sd);
for( i = 0; i < MAX_INVENTORY; i++ )
{ // Check for Rentals on Inventory
if( sd->status.inventory[i].nameid == 0 )
@@ -672,10 +741,12 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
sd->client_tick = client_tick;
sd->state.active = 0; //to be set to 1 after player is fully authed and loaded.
sd->bl.type = BL_PC;
- sd->canlog_tick = timer->gettick();
+ if (battle_config.prevent_logout_trigger & PLT_LOGIN)
+ sd->canlog_tick = timer->gettick();
//Required to prevent homunculus copuing a base speed of 0.
sd->battle_status.speed = sd->base_status.speed = DEFAULT_WALK_SPEED;
sd->state.warp_clean = 1;
+ sd->catch_target_class = -1;
return 0;
}
@@ -684,6 +755,7 @@ int pc_equippoint(struct map_session_data *sd,int n)
int ep = 0;
nullpo_ret(sd);
+ Assert_ret(n >= 0 && n < MAX_INVENTORY);
if(!sd->inventory_data[n])
return 0;
@@ -697,8 +769,8 @@ int pc_equippoint(struct map_session_data *sd,int n)
|| sd->inventory_data[n]->look == W_1HAXE
) {
if (pc->checkskill(sd,AS_LEFT) > 0
- || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN
- || (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO
+ || (sd->job & MAPID_UPPERMASK) == MAPID_ASSASSIN
+ || (sd->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO
) {
//Kagerou and Oboro can dual wield daggers. [Rytech]
if( ep == EQP_HAND_R )
@@ -810,6 +882,7 @@ bool pc_isequipped(struct map_session_data *sd, int nameid)
{
int i, j;
+ nullpo_retr(false, sd);
for (i = 0; i < EQI_MAX; i++) {
int index = sd->equip_index[i];
if( index < 0 ) continue;
@@ -872,7 +945,7 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
return false;
}
- if( !( ( b_sd->status.class_ >= JOB_NOVICE && b_sd->status.class_ <= JOB_THIEF ) || b_sd->status.class_ == JOB_SUPER_NOVICE ) )
+ if (!(b_sd->status.class >= JOB_NOVICE && b_sd->status.class <= JOB_THIEF) && b_sd->status.class != JOB_SUPER_NOVICE)
return false;
return true;
@@ -883,19 +956,20 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd
*------------------------------------------*/
bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd)
{
- int job, joblevel;
+ int class, joblevel;
unsigned int jobexp;
if( !pc->can_Adopt(p1_sd, p2_sd, b_sd) )
return false;
+ nullpo_retr(false, b_sd);
// Preserve current job levels and progress
joblevel = b_sd->status.job_level;
jobexp = b_sd->status.job_exp;
- job = pc->mapid2jobid(b_sd->class_|JOBL_BABY, b_sd->status.sex);
- if( job != -1 && !pc->jobchange(b_sd, job, 0) )
- { // Success, proceed to configure parents and baby skills
+ class = pc->mapid2jobid(b_sd->job | JOBL_BABY, b_sd->status.sex);
+ if (class != -1 && !pc->jobchange(b_sd, class, 0)) {
+ // Success, proceed to configure parents and baby skills
p1_sd->status.child = b_sd->status.char_id;
p2_sd->status.child = b_sd->status.char_id;
b_sd->status.father = p1_sd->status.char_id;
@@ -944,11 +1018,11 @@ int pc_isequip(struct map_session_data *sd,int n)
if(pc_has_permission(sd, PC_PERM_USE_ALL_EQUIPMENT))
return 1;
- if (item->elv && sd->status.base_level < (unsigned int)item->elv) {
+ if (item->elv && sd->status.base_level < item->elv) {
clif->msgtable(sd, MSG_ITEM_CANT_EQUIP_LVL);
return 0;
}
- if (item->elvmax && sd->status.base_level > (unsigned int)item->elvmax) {
+ if (item->elvmax && sd->status.base_level > item->elvmax) {
clif->msgtable(sd, MSG_ITEM_CANT_EQUIP_LVL);
return 0;
}
@@ -956,12 +1030,11 @@ int pc_isequip(struct map_session_data *sd,int n)
return 0;
if ( item->equip & EQP_AMMO ) {
- if ( (sd->state.active && !pc_iscarton(sd)) // check if sc data is already loaded.
- && (sd->status.class_ == JOB_GENETIC_T || sd->status.class_ == JOB_GENETIC) ) {
+ if (sd->state.active && !pc_iscarton(sd) && (sd->job & MAPID_THIRDMASK) == MAPID_GENETIC) { // check if sc data is already loaded.
clif->msgtable(sd, MSG_ITEM_NEED_CART);
return 0;
}
- if ( !pc_ismadogear(sd) && (sd->status.class_ == JOB_MECHANIC_T || sd->status.class_ == JOB_MECHANIC) ) {
+ if (!pc_ismadogear(sd) && (sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC) {
clif->msgtable(sd, MSG_ITEM_NEED_MADO);
return 0;
}
@@ -998,14 +1071,26 @@ int pc_isequip(struct map_session_data *sd,int n)
}
}
//Not equipable by class. [Skotlex]
- if (!(1<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)]))
+ if (((1ULL<<(sd->job & MAPID_BASEMASK)) & item->class_base[(sd->job & JOBL_2_1) != 0 ? 1 : ((sd->job & JOBL_2_2) != 0 ? 2 : 0)]) == 0)
return 0;
//Not usable by upper class. [Inkfish]
while( 1 ) {
- if( item->class_upper&ITEMUPPER_NORMAL && !(sd->class_&(JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) ) break;
- if( item->class_upper&ITEMUPPER_UPPER && sd->class_&(JOBL_UPPER|JOBL_THIRD) ) break;
- if( item->class_upper&ITEMUPPER_BABY && sd->class_&JOBL_BABY ) break;
- if( item->class_upper&ITEMUPPER_THIRD && sd->class_&JOBL_THIRD ) break;
+ if ((item->class_upper & ITEMUPPER_NORMAL) != 0) {
+ if ((sd->job & (JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) == 0)
+ break;
+ }
+ if ((item->class_upper & ITEMUPPER_UPPER) != 0) {
+ if ((sd->job & (JOBL_UPPER|JOBL_THIRD)) != 0)
+ break;
+ }
+ if ((item->class_upper & ITEMUPPER_BABY) != 0) {
+ if ((sd->job & JOBL_BABY) != 0)
+ break;
+ }
+ if ((item->class_upper & ITEMUPPER_THIRD) != 0) {
+ if ((sd->job & JOBL_THIRD) != 0)
+ break;
+ }
return 0;
}
@@ -1033,10 +1118,14 @@ int pc_isequip(struct map_session_data *sd,int n)
* No problem with the session id
* set the status that has been sent from char server
*------------------------------------------*/
-bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers) {
+bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers)
+{
int i;
int64 tick = timer->gettick();
- uint32 ip = sockt->session[sd->fd]->client_addr;
+ uint32 ip;
+
+ nullpo_retr(false, sd);
+ ip = sockt->session[sd->fd]->client_addr;
sd->login_id2 = login_id2;
@@ -1055,13 +1144,16 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
}
//Set the map-server used job id. [Skotlex]
- i = pc->jobid2mapid(sd->status.class_);
- if (i == -1) { //Invalid class?
- ShowError("pc_authok: Invalid class %d for player %s (%d:%d). Class was changed to novice.\n", sd->status.class_, sd->status.name, sd->status.account_id, sd->status.char_id);
- sd->status.class_ = JOB_NOVICE;
- sd->class_ = MAPID_NOVICE;
- } else
- sd->class_ = i;
+ {
+ int job = pc->jobid2mapid(sd->status.class);
+ if (job == -1) {
+ ShowError("pc_authok: Invalid class %d for player %s (%d:%d). Class was changed to novice.\n", sd->status.class, sd->status.name, sd->status.account_id, sd->status.char_id);
+ sd->status.class = JOB_NOVICE;
+ sd->job = MAPID_NOVICE;
+ } else {
+ sd->job = job;
+ }
+ }
// Checks and fixes to character status data, that are required
// in case of configuration change or stuff, which cannot be
@@ -1142,7 +1234,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->sc.option = sd->status.option; //This is the actual option used in battle.
//Set here because we need the inventory data for weapon sprite parsing.
- status->set_viewdata(&sd->bl, sd->status.class_);
+ status->set_viewdata(&sd->bl, sd->status.class);
unit->dataset(&sd->bl);
sd->guild_x = -1;
@@ -1159,13 +1251,14 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->bg_queue.type = 0;
VECTOR_INIT(sd->script_queues);
+ VECTOR_INIT(sd->storage.item); // initialize storage item vector.
sd->state.dialog = 0;
sd->delayed_damage = 0;
- if( battle_config.item_check )
- sd->state.itemcheck = 1;
+ if (battle->bc->item_check != PCCHECKITEM_NONE) // Check and flag items for inspection.
+ sd->itemcheck = (enum pc_checkitem_types) battle->bc->item_check;
// Event Timers
for( i = 0; i < MAX_EVENTTIMER; i++ )
@@ -1212,7 +1305,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
//display login notice
ShowInfo("'"CL_WHITE"%s"CL_RESET"' logged in."
" (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"',"
- " IP: '"CL_WHITE"%d.%d.%d.%d"CL_RESET"',"
+ " IP: '"CL_WHITE"%u.%u.%u.%u"CL_RESET"',"
" Group '"CL_WHITE"%d"CL_RESET"').\n",
sd->status.name, sd->status.account_id, sd->status.char_id,
CONVIP(ip), sd->group_id);
@@ -1266,6 +1359,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
*------------------------------------------*/
void pc_authfail(struct map_session_data *sd)
{
+ nullpo_retv(sd);
clif->authfail_fd(sd->fd, 0);
return;
}
@@ -1303,6 +1397,7 @@ int pc_reg_received(struct map_session_data *sd)
{
int i, idx = 0;
+ nullpo_ret(sd);
sd->vars_ok = true;
sd->change_level_2nd = pc_readglobalreg(sd,script->add_str("jobchange_level"));
@@ -1316,7 +1411,7 @@ int pc_reg_received(struct map_session_data *sd)
// Cooking Exp
sd->cook_mastery = pc_readglobalreg(sd,script->add_str("COOK_MASTERY"));
- if( (sd->class_&MAPID_BASEMASK) == MAPID_TAEKWON ) {
+ if ((sd->job & MAPID_BASEMASK) == MAPID_TAEKWON) {
// Better check for class rather than skill to prevent "skill resets" from unsetting this
sd->mission_mobid = pc_readglobalreg(sd,script->add_str("TK_MISSION_ID"));
sd->mission_count = pc_readglobalreg(sd,script->add_str("TK_MISSION_COUNT"));
@@ -1389,6 +1484,9 @@ int pc_reg_received(struct map_session_data *sd)
status_calc_pc(sd,SCO_FIRST|SCO_FORCE);
chrif->scdata_request(sd->status.account_id, sd->status.char_id);
+ // Storage Request
+ intif->request_account_storage(sd);
+
intif->Mail_requestinbox(sd->status.char_id, 0); // MAIL SYSTEM - Request Mail Inbox
intif->request_questlog(sd);
@@ -1398,7 +1496,7 @@ int pc_reg_received(struct map_session_data *sd)
}
if (pc_isinvisible(sd)) {
- sd->vd.class_ = INVISIBLE_CLASS;
+ sd->vd.class = INVISIBLE_CLASS;
clif->message(sd->fd, msg_sd(sd,11)); // Invisible: On
// decrement the number of pvp players on the map
map->list[sd->bl.m].users_pvp--;
@@ -1445,17 +1543,17 @@ int pc_calc_skillpoint(struct map_session_data* sd) {
int pc_calc_skilltree(struct map_session_data *sd)
{
int i,id=0,flag;
- int c=0;
+ int class = 0, classidx = 0;
nullpo_ret(sd);
i = pc->calc_skilltree_normalize_job(sd);
- c = pc->mapid2jobid(i, sd->status.sex);
- if( c == -1 )
- { //Unable to normalize job??
+ class = pc->mapid2jobid(i, sd->status.sex);
+ if (class == -1) {
+ //Unable to normalize job??
ShowError("pc_calc_skilltree: Unable to normalize job %d for character %s (%d:%d)\n", i, sd->status.name, sd->status.account_id, sd->status.char_id);
return 1;
}
- c = pc->class2idx(c);
+ classidx = pc->class2idx(class);
for( i = 0; i < MAX_SKILL; i++ ) {
if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].flag != SKILL_FLAG_PERM_GRANTED ) //Don't touch these
@@ -1464,10 +1562,10 @@ int pc_calc_skilltree(struct map_session_data *sd)
if( sd->status.skill[i].flag == SKILL_FLAG_PERMANENT ) {
switch( skill->dbs->db[i].nameid ) {
case NV_TRICKDEAD:
- if( (sd->class_&(MAPID_BASEMASK|JOBL_2)) != MAPID_NOVICE ) {
- sd->status.skill[i].id = 0;
- sd->status.skill[i].lv = 0;
- sd->status.skill[i].flag = 0;
+ if ((sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) {
+ sd->status.skill[i].id = 0;
+ sd->status.skill[i].lv = 0;
+ sd->status.skill[i].flag = 0;
}
break;
}
@@ -1537,16 +1635,16 @@ int pc_calc_skilltree(struct map_session_data *sd)
do {
flag = 0;
- for (i = 0; i < MAX_SKILL_TREE && (id = pc->skill_tree[c][i].id) > 0; i++) {
- int idx = pc->skill_tree[c][i].idx;
+ for (i = 0; i < MAX_SKILL_TREE && (id = pc->skill_tree[classidx][i].id) > 0; i++) {
+ int idx = pc->skill_tree[classidx][i].idx;
bool satisfied = true;
if (sd->status.skill[idx].id > 0)
continue; //Skill already known.
if (!battle_config.skillfree) {
int j;
- for (j = 0; j < VECTOR_LENGTH(pc->skill_tree[c][i].need); j++) {
- struct skill_tree_requirement *req = &VECTOR_INDEX(pc->skill_tree[c][i].need, j);
+ for (j = 0; j < VECTOR_LENGTH(pc->skill_tree[classidx][i].need); j++) {
+ struct skill_tree_requirement *req = &VECTOR_INDEX(pc->skill_tree[classidx][i].need, j);
int level;
if (sd->status.skill[req->idx].id == 0
|| sd->status.skill[req->idx].flag == SKILL_FLAG_TEMPORARY
@@ -1561,8 +1659,8 @@ int pc_calc_skilltree(struct map_session_data *sd)
break;
}
}
- if (sd->status.job_level < pc->skill_tree[c][i].joblv) {
- int jobid = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree
+ if (sd->status.job_level < (int)pc->skill_tree[classidx][i].joblv) {
+ int jobid = pc->mapid2jobid(sd->job, sd->status.sex); // need to get its own skilltree
if (jobid > -1) {
if (!pc->skill_tree[pc->class2idx(jobid)][i].inherited)
satisfied = false; // job level requirement wasn't satisfied
@@ -1593,16 +1691,17 @@ int pc_calc_skilltree(struct map_session_data *sd)
} while(flag);
//
- if( c > 0 && (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && sd->status.skill_point == 0 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
- {
- /* Taekwon Ranger Bonus Skill Tree
+ if (classidx > 0 && (sd->job & MAPID_UPPERMASK) == MAPID_TAEKWON
+ && sd->status.base_level >= 90 && sd->status.skill_point == 0
+ && pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON) > 0) {
+ /* Taekwon Ranker Bonus Skill Tree
============================================
- Grant All Taekwon Tree, but only as Bonus Skills in case they drop from ranking.
- (c > 0) to avoid grant Novice Skill Tree in case of Skill Reset (need more logic)
- (sd->status.skill_point == 0) to wait until all skill points are asigned to avoid problems with Job Change quest. */
- for( i = 0; i < MAX_SKILL_TREE && (id = pc->skill_tree[c][i].id) > 0; i++ ) {
- int idx = pc->skill_tree[c][i].idx;
+ for (i = 0; i < MAX_SKILL_TREE && (id = pc->skill_tree[classidx][i].id) > 0; i++) {
+ int idx = pc->skill_tree[classidx][i].idx;
if( (skill->dbs->db[idx].inf2&(INF2_QUEST_SKILL|INF2_WEDDING_SKILL)) )
continue; //Do not include Quest/Wedding skills.
@@ -1613,7 +1712,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
sd->status.skill[idx].flag = SKILL_FLAG_REPLACED_LV_0 + sd->status.skill[idx].lv; // Remember original level
}
- sd->status.skill[idx].lv = skill->tree_get_max(id, sd->status.class_);
+ sd->status.skill[idx].lv = skill->tree_get_max(id, sd->status.class);
}
}
@@ -1629,6 +1728,7 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id)
if(battle_config.skillfree)
return; //Function serves no purpose if this is set
+ nullpo_retv(sd);
i = pc->calc_skilltree_normalize_job(sd);
c = pc->mapid2jobid(i, sd->status.sex);
if (c == -1) { //Unable to normalize job??
@@ -1664,8 +1764,8 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id)
if (!satisfied)
continue;
- if (sd->status.job_level < pc->skill_tree[c][i].joblv) {
- int jobid = pc->mapid2jobid(sd->class_, sd->status.sex); // need to get its own skilltree
+ if (sd->status.job_level < (int)pc->skill_tree[c][i].joblv) {
+ int jobid = pc->mapid2jobid(sd->job, sd->status.sex); // need to get its own skilltree
if (jobid > -1) {
if (!pc->skill_tree[pc->class2idx(jobid)][i].inherited)
continue;
@@ -1694,6 +1794,7 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id)
int pc_clean_skilltree(struct map_session_data *sd)
{
int i;
+ nullpo_ret(sd);
for (i = 0; i < MAX_SKILL; i++){
if (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[i].flag == SKILL_FLAG_PLAGIARIZED) {
sd->status.skill[i].id = 0;
@@ -1711,10 +1812,12 @@ int pc_clean_skilltree(struct map_session_data *sd)
int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
{
int skill_point, novice_skills;
- int c = sd->class_;
+ uint16 job;
+ nullpo_ret(sd);
+ job = sd->job;
if (!battle_config.skillup_limit || pc_has_permission(sd, PC_PERM_ALL_SKILL))
- return c;
+ return job;
skill_point = pc->calc_skillpoint(sd);
@@ -1722,62 +1825,57 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd)
sd->sktree.second = sd->sktree.third = 0;
- // limit 1st class and above to novice job levels
- if(skill_point < novice_skills) {
- c = MAPID_NOVICE;
- }
- // limit 2nd class and above to first class job levels (super novices are exempt)
- else if ((sd->class_&JOBL_2) && (sd->class_&MAPID_UPPERMASK) != MAPID_SUPER_NOVICE)
- {
+ if (skill_point < novice_skills && (sd->job & MAPID_BASEMASK) != MAPID_SUMMONER) {
+ // limit 1st class and above to novice job levels
+ job = MAPID_NOVICE;
+ } else if ((sd->job & JOBL_2) != 0 && (sd->job & MAPID_UPPERMASK) != MAPID_SUPER_NOVICE) {
+ // limit 2nd class and above to first class job levels (super novices are exempt)
// regenerate change_level_2nd
- if (!sd->change_level_2nd)
- {
- if (sd->class_&JOBL_THIRD)
- {
+ if (sd->change_level_2nd == 0) {
+ if ((sd->job & JOBL_THIRD) != 0) {
// if neither 2nd nor 3rd jobchange levels are known, we have to assume a default for 2nd
- if (!sd->change_level_3rd)
- sd->change_level_2nd = pc->max_level[pc->class2idx(pc->mapid2jobid(sd->class_&MAPID_UPPERMASK, sd->status.sex))][1];
- else
+ if (sd->change_level_3rd == 0) {
+ sd->change_level_2nd = pc->max_level[pc->class2idx(pc->mapid2jobid(sd->job & MAPID_UPPERMASK, sd->status.sex))][1];
+ } else {
sd->change_level_2nd = 1 + skill_point + sd->status.skill_point
- (sd->status.job_level - 1)
- (sd->change_level_3rd - 1)
- novice_skills;
- }
- else
- {
+ }
+ } else {
sd->change_level_2nd = 1 + skill_point + sd->status.skill_point
- (sd->status.job_level - 1)
- novice_skills;
}
- pc_setglobalreg (sd, script->add_str("jobchange_level"), sd->change_level_2nd);
+ pc_setglobalreg(sd, script->add_str("jobchange_level"), sd->change_level_2nd);
}
if (skill_point < novice_skills + (sd->change_level_2nd - 1)) {
- c &= MAPID_BASEMASK;
+ job &= MAPID_BASEMASK;
sd->sktree.second = ( novice_skills + (sd->change_level_2nd - 1) ) - skill_point;
- } else if(sd->class_&JOBL_THIRD) { // limit 3rd class to 2nd class/trans job levels
+ } else if ((sd->job & JOBL_THIRD) != 0) { // limit 3rd class to 2nd class/trans job levels
// regenerate change_level_3rd
- if (!sd->change_level_3rd) {
+ if (sd->change_level_3rd == 0) {
sd->change_level_3rd = 1 + skill_point + sd->status.skill_point
- (sd->status.job_level - 1)
- (sd->change_level_2nd - 1)
- novice_skills;
- pc_setglobalreg (sd, script->add_str("jobchange_level_3rd"), sd->change_level_3rd);
+ pc_setglobalreg(sd, script->add_str("jobchange_level_3rd"), sd->change_level_3rd);
}
if (skill_point < novice_skills + (sd->change_level_2nd - 1) + (sd->change_level_3rd - 1)) {
- c &= MAPID_UPPERMASK;
+ job &= MAPID_UPPERMASK;
sd->sktree.third = (novice_skills + (sd->change_level_2nd - 1) + (sd->change_level_3rd - 1)) - skill_point;
}
}
}
// restore non-limiting flags
- c |= sd->class_&(JOBL_UPPER|JOBL_BABY);
+ job |= sd->job & (JOBL_UPPER|JOBL_BABY);
- return c;
+ return job;
}
/*==========================================
@@ -1818,37 +1916,40 @@ int pc_updateweightstatus(struct map_session_data *sd)
return 0;
}
-int pc_disguise(struct map_session_data *sd, int class_) {
- if (class_ == -1 && sd->disguise == -1)
+int pc_disguise(struct map_session_data *sd, int class)
+{
+ nullpo_ret(sd);
+ if (class == -1 && sd->disguise == -1)
return 0;
- if (class_ >= 0 && sd->disguise == class_)
+ if (class >= 0 && sd->disguise == class)
return 0;
if (pc_isinvisible(sd)) { //Character is invisible. Stealth class-change. [Skotlex]
- sd->disguise = class_; //viewdata is set on uncloaking.
+ sd->disguise = class; //viewdata is set on uncloaking.
return 2;
}
if (sd->bl.prev != NULL) {
- if( class_ == -1 && sd->disguise == sd->status.class_ ) {
+ if (class == -1 && sd->disguise == sd->status.class) {
clif->clearunit_single(-sd->bl.id,CLR_OUTSIGHT,sd->fd);
- } else if ( class_ != sd->status.class_ ) {
+ } else if (class != sd->status.class) {
pc_stop_walking(sd, STOPWALKING_FLAG_NONE);
clif->clearunit_area(&sd->bl, CLR_OUTSIGHT);
}
}
- if (class_ == -1) {
+ if (class == -1) {
sd->disguise = -1;
- class_ = sd->status.class_;
- } else
- sd->disguise = class_;
+ class = sd->status.class;
+ } else {
+ sd->disguise = class;
+ }
- status->set_viewdata(&sd->bl, class_);
+ status->set_viewdata(&sd->bl, class);
clif->changeoption(&sd->bl);
// We need to update the client so it knows that a costume is being used
if( sd->sc.option&OPTION_COSTUME ) {
- clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
+ clif->changelook(&sd->bl, LOOK_BASE, sd->vd.class);
clif->changelook(&sd->bl,LOOK_WEAPON,0);
clif->changelook(&sd->bl,LOOK_SHIELD,0);
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
@@ -1856,13 +1957,13 @@ int pc_disguise(struct map_session_data *sd, int class_) {
if (sd->bl.prev != NULL) {
clif->spawn(&sd->bl);
- if (class_ == sd->status.class_ && pc_iscarton(sd)) {
+ if (class == sd->status.class && pc_iscarton(sd)) {
//It seems the cart info is lost on undisguise.
clif->cartlist(sd);
clif->updatestatus(sd,SP_CARTINFO);
}
- if (sd->chatID) {
- struct chat_data *cd = map->id2cd(sd->chatID);
+ if (sd->chat_id != 0) {
+ struct chat_data *cd = map->id2cd(sd->chat_id);
if (cd != NULL)
clif->dispchat(cd,0);
@@ -1878,6 +1979,8 @@ int pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, s
if( !rate )
return 0;
+ nullpo_ret(spell);
+ Assert_ret(max <= 15); // autospell array size
for( i = 0; i < max && spell[i].id; i++ )
{
if( (spell[i].card_id == card_id || spell[i].rate < 0 || rate < 0) && spell[i].id == id && spell[i].lv == lv )
@@ -1914,6 +2017,8 @@ int pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_ski
if( !rate )
return 0;
+ nullpo_ret(spell);
+ Assert_ret(max <= 15); // autospell array size
for( i = 0; i < max && spell[i].id; i++ )
{
; // each autospell works independently
@@ -1949,6 +2054,8 @@ int pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_ski
int pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration)
{
int i;
+
+ nullpo_ret(effect);
if (!(flag&(ATF_SHORT|ATF_LONG)))
flag|=ATF_SHORT|ATF_LONG; //Default range: both
if (!(flag&(ATF_TARGET|ATF_SELF)))
@@ -1978,6 +2085,8 @@ int pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id, int16
int pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target) {
int i;
+
+ nullpo_ret(effect);
for( i = 0; i < max && effect[i].skill; i++ ) {
if( effect[i].id == id && effect[i].skill == skill_id && effect[i].target == target ) {
effect[i].rate += rate;
@@ -1998,6 +2107,7 @@ int pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, enum sc_
int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short group, int race_mask, int rate) {
int i;
+ nullpo_ret(drop);
//Apply config rate adjustment settings.
if (rate >= 0) { //Absolute drop.
if (battle_config.item_rate_adddrop != 100)
@@ -2045,6 +2155,8 @@ int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short
int pc_addautobonus(struct s_autobonus *bonus,char max,const char *bonus_script,short rate,unsigned int dur,short flag,const char *other_script,unsigned short pos,bool onskill) {
int i;
+ nullpo_ret(bonus);
+ nullpo_ret(bonus_script);
ARR_FIND(0, max, i, bonus[i].rate == 0);
if( i == max )
{
@@ -2081,6 +2193,7 @@ int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,c
{
int i;
nullpo_ret(sd);
+ nullpo_ret(autobonus);
for( i = 0; i < max; i++ )
{
@@ -2152,6 +2265,7 @@ int pc_bonus_addele(struct map_session_data* sd, unsigned char ele, short rate,
int i;
struct weapon_data* wd;
+ nullpo_ret(sd);
wd = (sd->state.lr_flag ? &sd->left_weapon : &sd->right_weapon);
ARR_FIND(0, MAX_PC_BONUS, i, wd->addele2[i].rate == 0);
@@ -2185,6 +2299,7 @@ int pc_bonus_subele(struct map_session_data* sd, unsigned char ele, short rate,
{
int i;
+ nullpo_ret(sd);
ARR_FIND(0, MAX_PC_BONUS, i, sd->subele2[i].rate == 0);
if (i == MAX_PC_BONUS)
@@ -2883,6 +2998,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val) {
break;
default:
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
+ Assert_report(0);
break;
}
return 0;
@@ -3675,6 +3791,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
#endif
default:
ShowWarning("pc_bonus2: unknown type %d %d %d!\n",type,type2,val);
+ Assert_report(0);
break;
}
return 0;
@@ -3847,6 +3964,7 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val)
default:
ShowWarning("pc_bonus3: unknown type %d %d %d %d!\n",type,type2,type3,val);
+ Assert_report(0);
break;
}
@@ -3941,6 +4059,7 @@ int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4
default:
ShowWarning("pc_bonus4: unknown type %d %d %d %d %d!\n",type,type2,type3,type4,val);
+ Assert_report(0);
break;
}
@@ -3968,6 +4087,7 @@ int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4
default:
ShowWarning("pc_bonus5: unknown type %d %d %d %d %d %d!\n",type,type2,type3,type4,type5,val);
+ Assert_report(0);
break;
}
@@ -4085,7 +4205,7 @@ bool pc_can_insert_card_into(struct map_session_data* sd, int idx_card, int idx_
ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->status.inventory[idx_equip].card[i] == 0);
if (i == sd->inventory_data[idx_equip]->slot)
return false; // no free slots
- return true;
+ return true;
}
/**
@@ -4105,7 +4225,7 @@ bool pc_can_insert_card(struct map_session_data* sd, int idx_card)
return false; // target card missing
if (sd->inventory_data[idx_card]->type != IT_CARD)
return false; // must be a card
- return true;
+ return true;
}
/*==========================================
@@ -4129,7 +4249,7 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
// remember the card id to insert
nameid = sd->status.inventory[idx_card].nameid;
- if( pc->delitem(sd, idx_card, 1, 1, DELITEM_NORMAL, LOG_TYPE_OTHER) == 1 )
+ if( pc->delitem(sd, idx_card, 1, 1, DELITEM_NORMAL, LOG_TYPE_CARD) == 1 )
{// failed
clif->insert_card(sd,idx_equip,idx_card,1);
}
@@ -4139,9 +4259,9 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->status.inventory[idx_equip].card[i] == 0);
if (i == sd->inventory_data[idx_equip]->slot)
return 0; // no free slots
- logs->pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]);
+ logs->pick_pc(sd, LOG_TYPE_CARD, -1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]);
sd->status.inventory[idx_equip].card[i] = nameid;
- logs->pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]);
+ logs->pick_pc(sd, LOG_TYPE_CARD, 1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]);
clif->insert_card(sd,idx_equip,idx_card,0);
return 1;
}
@@ -4268,7 +4388,7 @@ int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type,
if( zeny > 0 && sd->state.showzeny ) {
char output[255];
sprintf(output, "Removed %dz.", zeny);
- clif_disp_onlyself(sd,output,strlen(output));
+ clif_disp_onlyself(sd, output);
}
return 0;
@@ -4310,7 +4430,7 @@ int pc_paycash(struct map_session_data *sd, int price, int points)
{
char output[128];
sprintf(output, msg_sd(sd,504), points, cash, sd->kafraPoints, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
}
return cash+points;
}
@@ -4335,7 +4455,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
if( battle_config.cashshop_show_points )
{
sprintf(output, msg_sd(sd,505), cash, sd->cashPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
}
return cash;
}
@@ -4358,7 +4478,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points)
if( battle_config.cashshop_show_points )
{
sprintf(output, msg_sd(sd,506), points, sd->kafraPoints);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
}
return points;
}
@@ -4396,7 +4516,7 @@ int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type,
if( zeny > 0 && sd->state.showzeny ) {
char output[255];
sprintf(output, "Gained %dz.", zeny);
- clif_disp_onlyself(sd,output,strlen(output));
+ clif_disp_onlyself(sd, output);
}
return 0;
@@ -4555,6 +4675,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type)
{
nullpo_retr(1, sd);
+ Assert_retr(1, n >= 0 && n < MAX_INVENTORY);
if(sd->status.inventory[n].nameid==0 || amount <= 0 || sd->status.inventory[n].amount<amount || sd->inventory_data[n] == NULL)
return 1;
@@ -4602,13 +4723,13 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
return 0;
if( map->list[sd->bl.m].flag.nodrop ) {
- clif->message (sd->fd, msg_sd(sd,271));
- return 0; //Can't drop items in nodrop mapflag maps.
+ clif->message (sd->fd, msg_sd(sd,271)); // You can't drop items in this map
+ return 0;
}
if( !pc->candrop(sd,&sd->status.inventory[n]) )
{
- clif->message (sd->fd, msg_sd(sd,263));
+ clif->message (sd->fd, msg_sd(sd,263)); // This item cannot be dropped.
return 0;
}
@@ -4698,6 +4819,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
int nameid;
nullpo_ret(sd);
+ Assert_ret(n >= 0 && n < MAX_INVENTORY);
item = sd->inventory_data[n];
nameid = sd->status.inventory[n].nameid;
@@ -4723,17 +4845,43 @@ int pc_isUseitem(struct map_session_data *sd,int n)
switch( nameid ) { // TODO: Is there no better way to handle this, other than hardcoding item IDs?
case ITEMID_ANODYNE:
- if( map_flag_gvg2(sd->bl.m) )
- return 0;
- /* Fall through */
- case ITEMID_ALOEBERA:
- if( pc_issit(sd) )
+ if (map_flag_gvg2(sd->bl.m))
return 0;
break;
+
+ case ITEMID_GIANT_FLY_WING: {
+ struct party_data *p;
+
+ if (!sd->status.party_id) {
+ clif->msgtable(sd, MSG_PARTY_MEMBER_NOT_SUMMONED);
+ break;
+ }
+
+ if ((p = party->search(sd->status.party_id)) != NULL) {
+ int i;
+ int16 m;
+
+ ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd);
+
+ if (i == MAX_PARTY || !p->party.member[i].leader) {
+ clif->msgtable(sd, MSG_PARTY_MEMBER_NOT_SUMMONED);
+ break;
+ }
+
+ m = sd->bl.m;
+
+ ARR_FIND(0, MAX_PARTY, i, p->data[i].sd && p->data[i].sd != sd && p->data[i].sd->bl.m == m);
+
+ if (i == MAX_PARTY || pc_isdead(p->data[i].sd)) {
+ clif->msgtable(sd, MSG_PARTY_NO_MEMBER_IN_MAP);
+ break;
+ }
+ }
+ }
+ FALLTHROUGH
case ITEMID_WING_OF_FLY:
- case ITEMID_GIANT_FLY_WING:
- if( map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m) ) {
- clif->skill_mapinfomessage(sd,0);
+ if (map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m)) {
+ clif->skill_mapinfomessage(sd, 0);
return 0;
}
/* Fall through */
@@ -4759,25 +4907,6 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( map->list[sd->bl.m].flag.nobranch || map_flag_gvg2(sd->bl.m) )
return 0;
break;
- case ITEMID_BUBBLE_GUM:
- case ITEMID_COMP_BUBBLE_GUM:
- if( sd->sc.data[SC_CASH_RECEIVEITEM] )
- return 0;
- break;
- case ITEMID_BATTLE_MANUAL:
- case ITEMID_COMP_BATTLE_MANUAL:
- case ITEMID_THICK_MANUAL50:
- case ITEMID_NOBLE_NAMEPLATE:
- case ITEMID_BATTLE_MANUAL25:
- case ITEMID_BATTLE_MANUAL100:
- case ITEMID_BATTLE_MANUAL_X3:
- if( sd->sc.data[SC_CASH_PLUSEXP] )
- return 0;
- break;
- case ITEMID_JOB_MANUAL50:
- if( sd->sc.data[SC_CASH_PLUSONLYJOBEXP] )
- return 0;
- break;
// Mercenary Items
case ITEMID_MERCENARY_RED_POTION:
@@ -4804,17 +4933,6 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( nameid >= ITEMID_BOW_MERCENARY_SCROLL1 && nameid <= ITEMID_SPEARMERCENARY_SCROLL10 && sd->md != NULL ) // Mercenary Scrolls
return 0;
- /**
- * Only Rune Knights may use runes
- **/
- if( itemdb_is_rune(nameid) && (sd->class_&MAPID_THIRDMASK) != MAPID_RUNE_KNIGHT )
- return 0;
- /**
- * Only GCross may use poisons
- **/
- else if( itemdb_is_poison(nameid) && (sd->class_&MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS )
- return 0;
-
if( item->package || item->group ) {
if (pc_is90overweight(sd)) {
clif->msgtable(sd, MSG_ITEM_CANT_OBTAIN_WEIGHT);
@@ -4830,42 +4948,58 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if(item->sex != 2 && sd->status.sex != item->sex)
return 0;
//Required level check
- if (item->elv && sd->status.base_level < (unsigned int)item->elv) {
+ if (item->elv && sd->status.base_level < item->elv) {
clif->msgtable(sd, MSG_ITEM_CANT_USE_LVL);
return 0;
}
- if (item->elvmax && sd->status.base_level > (unsigned int)item->elvmax) {
+ if (item->elvmax && sd->status.base_level > item->elvmax) {
clif->msgtable(sd, MSG_ITEM_CANT_USE_LVL);
return 0;
}
//Not equipable by class. [Skotlex]
- if (!(
- (1<<(sd->class_&MAPID_BASEMASK)) &
- (item->class_base[(sd->class_&JOBL_2_1) ? 1 : ((sd->class_&JOBL_2_2) ? 2 : 0)])
- ))
+ if (((1ULL << (sd->job & MAPID_BASEMASK)) & (item->class_base[(sd->job & JOBL_2_1) ? 1 : ((sd->job & JOBL_2_2) ? 2 : 0)])) == 0)
return 0;
//Not usable by upper class. [Haru]
while( 1 ) {
// Normal classes (no upper, no baby, no third classes)
- if( item->class_upper&ITEMUPPER_NORMAL && !(sd->class_&(JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) ) break;
+ if ((item->class_upper & ITEMUPPER_NORMAL) != 0) {
+ if ((sd->job & (JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) == 0)
+ break;
+ }
+ if ((item->class_upper & ITEMUPPER_UPPER) != 0) {
#ifdef RENEWAL
- // Upper classes (no third classes)
- if( item->class_upper&ITEMUPPER_UPPER && sd->class_&JOBL_UPPER && !(sd->class_&JOBL_THIRD) ) break;
+ // Upper classes (no third classes)
+ if ((sd->job & JOBL_UPPER) != 0 && (sd->job&JOBL_THIRD) == 0)
+ break;
#else
- //pre-re has no use for the extra, so we maintain the previous for backwards compatibility
- if( item->class_upper&ITEMUPPER_UPPER && sd->class_&(JOBL_UPPER|JOBL_THIRD) ) break;
+ //pre-re has no use for the extra, so we maintain the previous for backwards compatibility
+ if ((sd->job & (JOBL_UPPER|JOBL_THIRD)) != 0)
+ break;
#endif
+ }
// Baby classes (no third classes)
- if( item->class_upper&ITEMUPPER_BABY && sd->class_&JOBL_BABY && !(sd->class_&JOBL_THIRD) ) break;
+ if ((item->class_upper & ITEMUPPER_BABY) != 0) {
+ if ((sd->job & JOBL_BABY) != 0 && (sd->job&JOBL_THIRD) == 0)
+ break;
+ }
// Third classes (no upper, no baby classes)
- if( item->class_upper&ITEMUPPER_THIRD && sd->class_&JOBL_THIRD && !(sd->class_&(JOBL_UPPER|JOBL_BABY)) ) break;
+ if ((item->class_upper & ITEMUPPER_THIRD) != 0) {
+ if ((sd->job & JOBL_THIRD) != 0 && (sd->job & (JOBL_UPPER|JOBL_BABY)) == 0)
+ break;
+ }
// Upper third classes
- if( item->class_upper&ITEMUPPER_THURDUPPER && sd->class_&JOBL_THIRD && sd->class_&JOBL_UPPER ) break;
+ if ((item->class_upper & ITEMUPPER_THURDUPPER) != 0) {
+ if ((sd->job & JOBL_THIRD) != 0 && (sd->job & JOBL_UPPER) != 0)
+ break;
+ }
// Baby third classes
- if( item->class_upper&ITEMUPPER_THIRDBABY && sd->class_&JOBL_THIRD && sd->class_&JOBL_BABY ) break;
+ if ((item->class_upper & ITEMUPPER_THIRDBABY) != 0) {
+ if ((sd->job & JOBL_THIRD) != 0 && (sd->job & JOBL_BABY) != 0)
+ break;
+ }
return 0;
}
@@ -4884,11 +5018,13 @@ int pc_useitem(struct map_session_data *sd,int n) {
bool removeItem = false;
nullpo_ret(sd);
+ Assert_ret(n >= 0 && n < MAX_INVENTORY);
- if( sd->npc_id || sd->state.workinprogress&1 ){
- /* TODO: add to clif->messages enum */
-#ifdef RENEWAL
- clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS); // TODO look for the client date that has this message.
+ if (sd->npc_id || sd->state.workinprogress & 1) {
+#if PACKETVER >= 20110309
+ clif->msgtable(sd, MSG_NPC_WORK_IN_PROGRESS);
+#else
+ clif->messagecolor_self(sd->fd, COLOR_WHITE, msg_sd(sd, 48));
#endif
return 0;
}
@@ -4919,18 +5055,17 @@ int pc_useitem(struct map_session_data *sd,int n) {
sd->sc.data[SC_DEEP_SLEEP] ||
sd->sc.data[SC_SATURDAY_NIGHT_FEVER] ||
sd->sc.data[SC_COLD] ||
+ sd->sc.data[SC_SUHIDE] ||
pc_ismuted(&sd->sc, MANNER_NOITEM)
))
return 0;
- //Prevent mass item usage. [Skotlex]
- if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 ||
- (itemdb_iscashfood(nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0)
- )
+ // Prevent mass item usage. [Skotlex]
+ if (DIFF_TICK(sd->canuseitem_tick, tick) > 0)
return 0;
/* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */
- if( sd->inventory_data[n]->flag.delay_consume && nameid != ITEMID_REINS_OF_MOUNT ) {
+ if (sd->inventory_data[n]->flag.delay_consume && nameid != ITEMID_BOARDING_HALTER) {
if( sd->sc.data[SC_ALL_RIDING] )
return 0;
else if( pc_issit(sd) )
@@ -4943,21 +5078,28 @@ int pc_useitem(struct map_session_data *sd,int n) {
if( sd->inventory_data[n]->flag.delay_consume && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status->check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) )
return 0;
- if( sd->inventory_data[n]->delay > 0 ) {
- ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid );
- if( i == MAX_ITEMDELAYS ) /* item not found. try first empty now */
- ARR_FIND(0, MAX_ITEMDELAYS, i, !sd->item_delay[i].nameid );
- if( i < MAX_ITEMDELAYS ) {
- if( sd->item_delay[i].nameid ) {// found
- if( DIFF_TICK(sd->item_delay[i].tick, tick) > 0 ) {
- int e_tick = (int)(DIFF_TICK(sd->item_delay[i].tick, tick)/1000);
- clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, e_tick + 1); // [%d] seconds left until you can use
+ if (sd->inventory_data[n]->delay > 0) {
+ ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == nameid);
+ if (i == MAX_ITEMDELAYS) /* item not found. try first empty now */
+ ARR_FIND(0, MAX_ITEMDELAYS, i, sd->item_delay[i].nameid == 0);
+ if (i < MAX_ITEMDELAYS) {
+ if (sd->item_delay[i].nameid != 0) {// found
+ if (DIFF_TICK(sd->item_delay[i].tick, tick) > 0) {
+ int delay_tick = (int)(DIFF_TICK(sd->item_delay[i].tick, tick) / 1000);
+#if PACKETVER >= 20101123
+ clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, delay_tick + 1); // [%d] seconds left until you can use
+#else
+ char delay_msg[100];
+ clif->msgtable_num(sd, MSG_SECONDS_UNTIL_USE, delay_tick + 1); // [%d] seconds left until you can use
+ sprintf(delay_msg, msg_sd(sd, 26), delay_tick + 1);
+ clif->messagecolor_self(sd->fd, COLOR_YELLOW, delay_msg);
+#endif
return 0; // Delay has not expired yet
}
} else {// not yet used item (all slots are initially empty)
sd->item_delay[i].nameid = nameid;
}
- if (!(nameid == ITEMID_REINS_OF_MOUNT && pc_hasmount(sd)))
+ if (!(nameid == ITEMID_BOARDING_HALTER && pc_hasmount(sd)))
sd->item_delay[i].tick = tick + sd->inventory_data[n]->delay;
} else {// should not happen
ShowError("pc_useitem: Exceeded item delay array capacity! (nameid=%d, char_id=%d)\n", nameid, sd->status.char_id);
@@ -5005,18 +5147,15 @@ int pc_useitem(struct map_session_data *sd,int n) {
}
}
- if(sd->status.inventory[n].card[0]==CARD0_CREATE &&
- pc->famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST))
- {
+ if (sd->status.inventory[n].card[0] == CARD0_CREATE
+ && pc->fame_rank(MakeDWord(sd->status.inventory[n].card[2], sd->status.inventory[n].card[3]), RANKTYPE_ALCHEMIST) > 0) {
script->potion_flag = 2; // Famous player's potions have 50% more efficiency
if (sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_ROGUE)
script->potion_flag = 3; //Even more effective potions.
}
- //Update item use time.
+ // Update item use time.
sd->canuseitem_tick = tick + battle_config.item_use_interval;
- if( itemdb_iscashfood(nameid) )
- sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval;
script->run_use_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id);
script->potion_flag = 0;
@@ -5051,7 +5190,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
if (!itemdb_cancartstore(item_data, pc_get_group_level(sd)) || (item_data->bound > IBT_ACCOUNT && !pc_can_give_bound_items(sd))) {
// Check item trade restrictions
- clif->message (sd->fd, msg_sd(sd,264));
+ clif->message (sd->fd, msg_sd(sd,264)); // This item cannot be stored.
return 1;/* TODO: there is no official response to this? */
}
@@ -5104,6 +5243,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type) {
struct item_data * data;
nullpo_retr(1, sd);
+ Assert_retr(1, n >= 0 && n < MAX_INVENTORY);
if( sd->status.cart[n].nameid == 0 || sd->status.cart[n].amount < amount || !(data = itemdb->exists(sd->status.cart[n].nameid)) )
return 1;
@@ -5162,6 +5302,7 @@ int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
struct item* item_data;
nullpo_retr(-1, sd);
+ Assert_retr(-1, idx >= 0 && idx < MAX_CART);
item_data = &sd->status.cart[idx];
if( item_data->nameid == 0 || item_data->amount == 0 )
@@ -5196,9 +5337,12 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
return flag;
}
-void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) {
+
+void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type)
+{
int i;
+ nullpo_retv(sd);
switch( type ) {
/* both restricted to inventory */
case IBT_PARTY:
@@ -5328,26 +5472,21 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
//Logs items, Stolen from mobs [Lupus]
logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data);
- //A Rare Steal Global Announce by Lupus
- if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) {
- char message[128];
- sprintf (message, msg_txt(542), sd->status.name, md->db->jname, data->jname, (float)md->db->dropitem[i].p / 100);
- //MSG: "'%s' stole %s's %s (chance: %0.02f%%)"
- intif->broadcast(message, strlen(message)+1, BC_DEFAULT);
- }
return 1;
}
/**
* Steals zeny from a monster through the RG_STEALCOIN skill.
*
- * @param sd Source character
- * @param target Target monster
+ * @param sd Source character
+ * @param target Target monster
+ * @param skill_lv Skill Level
*
* @return Amount of stolen zeny (0 in case of failure)
- **/
-int pc_steal_coin(struct map_session_data *sd, struct block_list *target) {
- int rate, skill_lv;
+ */
+int pc_steal_coin(struct map_session_data *sd, struct block_list *target, uint16 skill_lv)
+{
+ int rate;
struct mob_data *md = BL_CAST(BL_MOB, target);
if (sd == NULL || md == NULL)
@@ -5359,7 +5498,6 @@ int pc_steal_coin(struct map_session_data *sd, struct block_list *target) {
if (mob_is_treasure(md))
return 0;
- skill_lv = pc->checkskill(sd, RG_STEALCOIN);
rate = skill_lv * 10 + (sd->status.base_level - md->level) * 2 + sd->battle_status.dex / 2 + sd->battle_status.luk / 2;
if(rnd()%1000 < rate) {
int amount = md->level * skill_lv / 10 + md->level * 8 + rnd()%(md->level * 2 + 1); // mob_lv * skill_lv / 10 + random [mob_lv*8; mob_lv*10]
@@ -5526,6 +5664,8 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
npc->script_event(sd, NPCE_LOGOUT);
//remove from map, THEN change x/y coordinates
unit->remove_map_pc(sd,clrtype);
+ if (battle_config.player_warp_keep_direction == 0)
+ sd->ud.dir = 0; // makes character face north
sd->mapindex = map_index;
sd->bl.x=x;
sd->bl.y=y;
@@ -5556,6 +5696,9 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
vending->close(sd);
}
+ if (battle_config.player_warp_keep_direction == 0)
+ sd->ud.dir = 0; // makes character face north
+
if(sd->bl.prev != NULL){
unit->remove_map_pc(sd,clrtype);
clif->changemap(sd,m,x,y); // [MouseJstr]
@@ -5805,10 +5948,9 @@ int pc_checkequip(struct map_session_data *sd,int pos)
* Convert's from the client's lame Job ID system
* to the map server's 'makes sense' system. [Skotlex]
*------------------------------------------*/
-int pc_jobid2mapid(unsigned short b_class)
+int pc_jobid2mapid(int16 class)
{
- switch(b_class)
- {
+ switch (class) {
//Novice And 1-1 Jobs
case JOB_NOVICE: return MAPID_NOVICE;
case JOB_SWORDMAN: return MAPID_SWORDMAN;
@@ -5824,6 +5966,7 @@ int pc_jobid2mapid(unsigned short b_class)
case JOB_XMAS: return MAPID_XMAS;
case JOB_SUMMER: return MAPID_SUMMER;
case JOB_GANGSI: return MAPID_GANGSI;
+ case JOB_SUMMONER: return MAPID_SUMMONER;
//2-1 Jobs
case JOB_SUPER_NOVICE: return MAPID_SUPER_NOVICE;
case JOB_KNIGHT: return MAPID_KNIGHT;
@@ -5947,10 +6090,9 @@ int pc_jobid2mapid(unsigned short b_class)
}
//Reverts the map-style class id to the client-style one.
-int pc_mapid2jobid(unsigned short class_, int sex)
+int pc_mapid2jobid(uint16 job, int sex)
{
- switch(class_)
- {
+ switch (job) {
//Novice And 1-1 Jobs
case MAPID_NOVICE: return JOB_NOVICE;
case MAPID_SWORDMAN: return JOB_SWORDMAN;
@@ -5966,6 +6108,7 @@ int pc_mapid2jobid(unsigned short class_, int sex)
case MAPID_XMAS: return JOB_XMAS;
case MAPID_SUMMER: return JOB_SUMMER;
case MAPID_GANGSI: return JOB_GANGSI;
+ case MAPID_SUMMONER: return JOB_SUMMONER;
//2-1 Jobs
case MAPID_SUPER_NOVICE: return JOB_SUPER_NOVICE;
case MAPID_KNIGHT: return JOB_KNIGHT;
@@ -6084,9 +6227,9 @@ int pc_mapid2jobid(unsigned short class_, int sex)
/*====================================================
* This function return the name of the job (by [Yor])
*----------------------------------------------------*/
-const char* job_name(int class_)
+const char *job_name(int class)
{
- switch (class_) {
+ switch (class) {
case JOB_NOVICE: // 550
case JOB_SWORDMAN: // 551
case JOB_MAGE: // 552
@@ -6094,7 +6237,7 @@ const char* job_name(int class_)
case JOB_ACOLYTE: // 554
case JOB_MERCHANT: // 555
case JOB_THIEF: // 556
- return msg_txt(550 - JOB_NOVICE+class_);
+ return msg_txt(550 - JOB_NOVICE + class);
case JOB_KNIGHT: // 557
case JOB_PRIEST: // 558
@@ -6102,7 +6245,7 @@ const char* job_name(int class_)
case JOB_BLACKSMITH: // 560
case JOB_HUNTER: // 561
case JOB_ASSASSIN: // 562
- return msg_txt(557 - JOB_KNIGHT+class_);
+ return msg_txt(557 - JOB_KNIGHT + class);
case JOB_KNIGHT2:
return msg_txt(557);
@@ -6114,7 +6257,7 @@ const char* job_name(int class_)
case JOB_ALCHEMIST: // 567
case JOB_BARD: // 568
case JOB_DANCER: // 569
- return msg_txt(563 - JOB_CRUSADER+class_);
+ return msg_txt(563 - JOB_CRUSADER + class);
case JOB_CRUSADER2:
return msg_txt(563);
@@ -6124,7 +6267,7 @@ const char* job_name(int class_)
case JOB_GUNSLINGER: // 572
case JOB_NINJA: // 573
case JOB_XMAS: // 574
- return msg_txt(570 - JOB_WEDDING+class_);
+ return msg_txt(570 - JOB_WEDDING + class);
case JOB_SUMMER:
return msg_txt(621);
@@ -6136,7 +6279,7 @@ const char* job_name(int class_)
case JOB_ACOLYTE_HIGH: // 579
case JOB_MERCHANT_HIGH: // 580
case JOB_THIEF_HIGH: // 581
- return msg_txt(575 - JOB_NOVICE_HIGH+class_);
+ return msg_txt(575 - JOB_NOVICE_HIGH + class);
case JOB_LORD_KNIGHT: // 582
case JOB_HIGH_PRIEST: // 583
@@ -6144,7 +6287,7 @@ const char* job_name(int class_)
case JOB_WHITESMITH: // 585
case JOB_SNIPER: // 586
case JOB_ASSASSIN_CROSS: // 587
- return msg_txt(582 - JOB_LORD_KNIGHT+class_);
+ return msg_txt(582 - JOB_LORD_KNIGHT + class);
case JOB_LORD_KNIGHT2:
return msg_txt(582);
@@ -6156,7 +6299,7 @@ const char* job_name(int class_)
case JOB_CREATOR: // 592
case JOB_CLOWN: // 593
case JOB_GYPSY: // 594
- return msg_txt(588 - JOB_PALADIN + class_);
+ return msg_txt(588 - JOB_PALADIN + class);
case JOB_PALADIN2:
return msg_txt(588);
@@ -6168,7 +6311,7 @@ const char* job_name(int class_)
case JOB_BABY_ACOLYTE: // 599
case JOB_BABY_MERCHANT: // 600
case JOB_BABY_THIEF: // 601
- return msg_txt(595 - JOB_BABY + class_);
+ return msg_txt(595 - JOB_BABY + class);
case JOB_BABY_KNIGHT: // 602
case JOB_BABY_PRIEST: // 603
@@ -6176,7 +6319,7 @@ const char* job_name(int class_)
case JOB_BABY_BLACKSMITH: // 605
case JOB_BABY_HUNTER: // 606
case JOB_BABY_ASSASSIN: // 607
- return msg_txt(602 - JOB_BABY_KNIGHT + class_);
+ return msg_txt(602 - JOB_BABY_KNIGHT + class);
case JOB_BABY_KNIGHT2:
return msg_txt(602);
@@ -6188,7 +6331,7 @@ const char* job_name(int class_)
case JOB_BABY_ALCHEMIST: // 612
case JOB_BABY_BARD: // 613
case JOB_BABY_DANCER: // 614
- return msg_txt(608 - JOB_BABY_CRUSADER + class_);
+ return msg_txt(608 - JOB_BABY_CRUSADER + class);
case JOB_BABY_CRUSADER2:
return msg_txt(608);
@@ -6207,7 +6350,7 @@ const char* job_name(int class_)
case JOB_GANGSI: // 622
case JOB_DEATH_KNIGHT: // 623
case JOB_DARK_COLLECTOR: // 624
- return msg_txt(622 - JOB_GANGSI+class_);
+ return msg_txt(622 - JOB_GANGSI + class);
case JOB_RUNE_KNIGHT: // 625
case JOB_WARLOCK: // 626
@@ -6215,7 +6358,7 @@ const char* job_name(int class_)
case JOB_ARCH_BISHOP: // 628
case JOB_MECHANIC: // 629
case JOB_GUILLOTINE_CROSS: // 630
- return msg_txt(625 - JOB_RUNE_KNIGHT+class_);
+ return msg_txt(625 - JOB_RUNE_KNIGHT + class);
case JOB_RUNE_KNIGHT_T: // 656
case JOB_WARLOCK_T: // 657
@@ -6223,7 +6366,7 @@ const char* job_name(int class_)
case JOB_ARCH_BISHOP_T: // 659
case JOB_MECHANIC_T: // 660
case JOB_GUILLOTINE_CROSS_T: // 661
- return msg_txt(656 - JOB_RUNE_KNIGHT_T+class_);
+ return msg_txt(656 - JOB_RUNE_KNIGHT_T + class);
case JOB_ROYAL_GUARD: // 631
case JOB_SORCERER: // 632
@@ -6232,7 +6375,7 @@ const char* job_name(int class_)
case JOB_SURA: // 635
case JOB_GENETIC: // 636
case JOB_SHADOW_CHASER: // 637
- return msg_txt(631 - JOB_ROYAL_GUARD+class_);
+ return msg_txt(631 - JOB_ROYAL_GUARD + class);
case JOB_ROYAL_GUARD_T: // 662
case JOB_SORCERER_T: // 663
@@ -6241,7 +6384,7 @@ const char* job_name(int class_)
case JOB_SURA_T: // 666
case JOB_GENETIC_T: // 667
case JOB_SHADOW_CHASER_T: // 668
- return msg_txt(662 - JOB_ROYAL_GUARD_T+class_);
+ return msg_txt(662 - JOB_ROYAL_GUARD_T + class);
case JOB_RUNE_KNIGHT2:
return msg_txt(625);
@@ -6280,7 +6423,7 @@ const char* job_name(int class_)
case JOB_BABY_SURA: // 648
case JOB_BABY_GENETIC: // 649
case JOB_BABY_CHASER: // 650
- return msg_txt(638 - JOB_BABY_RUNE+class_);
+ return msg_txt(638 - JOB_BABY_RUNE + class);
case JOB_BABY_RUNE2:
return msg_txt(638);
@@ -6296,15 +6439,18 @@ const char* job_name(int class_)
case JOB_SUPER_NOVICE_E: // 651
case JOB_SUPER_BABY_E: // 652
- return msg_txt(651 - JOB_SUPER_NOVICE_E+class_);
+ return msg_txt(651 - JOB_SUPER_NOVICE_E + class);
case JOB_KAGEROU: // 653
case JOB_OBORO: // 654
- return msg_txt(653 - JOB_KAGEROU+class_);
+ return msg_txt(653 - JOB_KAGEROU + class);
case JOB_REBELLION:
return msg_txt(655);
+ case JOB_SUMMONER:
+ return msg_txt(669);
+
default:
return msg_txt(620); // "Unknown Job"
}
@@ -6430,8 +6576,10 @@ int pc_check_job_name(const char *name) {
{ "Kagerou", JOB_KAGEROU },
{ "Oboro", JOB_OBORO },
{ "Rebellion", JOB_REBELLION },
+ { "Summoner", JOB_SUMMONER },
};
+ nullpo_retr(-1, name);
len = ARRAYLENGTH(names);
ARR_FIND(0, len, i, strcmpi(names[i].name, name) == 0);
@@ -6498,6 +6646,7 @@ int pc_stop_following (struct map_session_data *sd)
int pc_follow(struct map_session_data *sd,int target_id) {
struct block_list *bl = map->id2bl(target_id);
+ nullpo_retr(1, sd);
if (bl == NULL /*|| bl->type != BL_PC*/)
return 1;
if (sd->followtimer != INVALID_TIMER)
@@ -6512,18 +6661,20 @@ int pc_follow(struct map_session_data *sd,int target_id) {
int pc_checkbaselevelup(struct map_session_data *sd) {
unsigned int next = pc->nextbaseexp(sd);
+ nullpo_ret(sd);
if (!next || sd->status.base_exp < next)
return 0;
do {
+ int status_points = 0;
sd->status.base_exp -= next;
//Kyoki pointed out that the max overcarry exp is the exp needed for the previous level -1. [Skotlex]
if(!battle_config.multi_level_up && sd->status.base_exp > next-1)
sd->status.base_exp = next-1;
- next = pc->gets_status_point(sd->status.base_level);
- sd->status.base_level ++;
- sd->status.status_point += next;
+ status_points = pc->gets_status_point(sd->status.base_level);
+ sd->status.base_level++;
+ sd->status.status_point += status_points;
} while ((next=pc->nextbaseexp(sd)) > 0 && sd->status.base_exp >= next);
@@ -6537,7 +6688,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
status_calc_pc(sd,SCO_FORCE);
status_percent_heal(&sd->bl,100,100);
- if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
sc_start(NULL,&sd->bl,status->skill2sc(PR_KYRIE),100,1,skill->get_time(PR_KYRIE,1));
sc_start(NULL,&sd->bl,status->skill2sc(PR_IMPOSITIO),100,1,skill->get_time(PR_IMPOSITIO,1));
sc_start(NULL,&sd->bl,status->skill2sc(PR_MAGNIFICAT),100,1,skill->get_time(PR_MAGNIFICAT,1));
@@ -6545,7 +6696,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
sc_start(NULL,&sd->bl,status->skill2sc(PR_SUFFRAGIUM),100,1,skill->get_time(PR_SUFFRAGIUM,1));
if (sd->state.snovice_dead_flag)
sd->state.snovice_dead_flag = 0; //Reenable steelbody resurrection on dead.
- } else if( (sd->class_&MAPID_BASEMASK) == MAPID_TAEKWON ) {
+ } else if ((sd->job & MAPID_BASEMASK) == MAPID_TAEKWON) {
sc_start(NULL,&sd->bl,status->skill2sc(AL_INCAGI),100,10,600000);
sc_start(NULL,&sd->bl,status->skill2sc(AL_BLESSING),100,10,600000);
}
@@ -6561,9 +6712,10 @@ int pc_checkbaselevelup(struct map_session_data *sd) {
void pc_baselevelchanged(struct map_session_data *sd) {
int i;
+ nullpo_retv(sd);
for( i = 0; i < EQI_MAX; i++ ) {
if( sd->equip_index[i] >= 0 ) {
- if( sd->inventory_data[ sd->equip_index[i] ]->elvmax && sd->status.base_level > (unsigned int)sd->inventory_data[ sd->equip_index[i] ]->elvmax )
+ if (sd->inventory_data[sd->equip_index[i]]->elvmax != 0 && sd->status.base_level > sd->inventory_data[ sd->equip_index[i] ]->elvmax)
pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
}
}
@@ -6583,8 +6735,8 @@ int pc_checkjoblevelup(struct map_session_data *sd)
if(!battle_config.multi_level_up && sd->status.job_exp > next-1)
sd->status.job_exp = next-1;
- sd->status.job_level ++;
- sd->status.skill_point ++;
+ sd->status.job_level++;
+ sd->status.skill_point++;
} while ((next=pc->nextjobexp(sd)) > 0 && sd->status.job_exp >= next);
@@ -6605,34 +6757,72 @@ int pc_checkjoblevelup(struct map_session_data *sd)
* Alters EXP based on self bonuses that do not get shared with the party
**/
void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src) {
- int bonus = 0;
- struct status_data *st = status->get_status_data(src);
+ int buff_ratio = 0, buff_job_ratio = 0, race_ratio = 0, pk_ratio = 0;
+ int64 jexp, bexp;
- if (sd->expaddrace[st->race])
- bonus += sd->expaddrace[st->race];
- bonus += sd->expaddrace[(st->mode&MD_BOSS) ? RC_BOSS : RC_NONBOSS];
+ nullpo_retv(sd);
+ nullpo_retv(base_exp);
+ nullpo_retv(job_exp);
+
+ jexp = *job_exp;
+ bexp = *base_exp;
+
+ if (src != NULL) {
+ const struct status_data *st = status->get_status_data(src);
+
+#ifdef RENEWAL_EXP //should happen first before we caluclate any modifiers
+ if (src->type == BL_MOB) {
+ const struct mob_data *md = BL_UCAST(BL_MOB, src);
+ int re_mod;
+ re_mod = pc->level_penalty_mod(md->level - sd->status.base_level, md->status.race, md->status.mode, 1);
+ jexp = apply_percentrate64(jexp, re_mod, 100);
+ bexp = apply_percentrate64(bexp, re_mod, 100);
+ }
+#endif
- if (battle_config.pk_mode
- && (int)(status->get_lv(src) - sd->status.base_level) >= 20)
- bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]
+ //Race modifier
+ if (sd->expaddrace[st->race])
+ race_ratio += sd->expaddrace[st->race];
+ race_ratio += sd->expaddrace[(st->mode&MD_BOSS) ? RC_BOSS : RC_NONBOSS];
+ }
- if (sd->sc.data[SC_CASH_PLUSEXP])
- bonus += sd->sc.data[SC_CASH_PLUSEXP]->val1;
- if (sd->sc.data[SC_OVERLAPEXPUP])
- bonus += sd->sc.data[SC_OVERLAPEXPUP]->val1;
- *base_exp = (unsigned int) cap_value(*base_exp + apply_percentrate64(*base_exp, bonus, 100), 1, UINT_MAX);
+ //PK modifier
+ /* this doesn't exist in Aegis, instead there's a CrazyKiller check which double all EXP from this point */
+ if (battle_config.pk_mode && status->get_lv(src) - sd->status.base_level >= 20)
+ pk_ratio += 15; // pk_mode additional exp if monster >20 levels [Valaris]
+
+ //Buffs modifier
+ if (sd->sc.data[SC_CASH_PLUSEXP]) {
+ buff_job_ratio += sd->sc.data[SC_CASH_PLUSEXP]->val1;
+ buff_ratio += sd->sc.data[SC_CASH_PLUSEXP]->val1;
+ }
+ if (sd->sc.data[SC_OVERLAPEXPUP]) {
+ buff_job_ratio += sd->sc.data[SC_OVERLAPEXPUP]->val1;
+ buff_ratio += sd->sc.data[SC_OVERLAPEXPUP]->val1;
+ }
if (sd->sc.data[SC_CASH_PLUSONLYJOBEXP])
- bonus += sd->sc.data[SC_CASH_PLUSONLYJOBEXP]->val1;
+ buff_job_ratio += sd->sc.data[SC_CASH_PLUSONLYJOBEXP]->val1;
- *job_exp = (unsigned int) cap_value(*job_exp + apply_percentrate64(*job_exp, bonus, 100), 1, UINT_MAX);
+ //Applying Race and PK modifier First then Premium (Perment modifier) and finally buff modifier
+ jexp += apply_percentrate64(jexp, race_ratio, 100);
+ jexp += apply_percentrate64(jexp, pk_ratio, 100);
+
+ bexp += apply_percentrate64(bexp, race_ratio, 100);
+ bexp += apply_percentrate64(bexp, pk_ratio, 100);
- if (sd->status.mod_exp != 100) {
- *base_exp = (unsigned int) cap_value(apply_percentrate64(*base_exp, sd->status.mod_exp, 100), 1, UINT_MAX);
- *job_exp = (unsigned int) cap_value(apply_percentrate64(*job_exp, sd->status.mod_exp, 100), 1, UINT_MAX);
+ if (sd->status.mod_exp != 100) {
+ jexp = apply_percentrate64(jexp, sd->status.mod_exp, 100);
+ bexp = apply_percentrate64(bexp, sd->status.mod_exp, 100);
}
+
+ bexp += apply_percentrate64(bexp, buff_ratio, 100);
+ jexp += apply_percentrate64(jexp, buff_ratio + buff_job_ratio, 100);
+
+ *job_exp = (unsigned int)cap_value(jexp, 1, UINT_MAX);
+ *base_exp = (unsigned int)cap_value(bexp, 1, UINT_MAX);
}
/**
@@ -6646,24 +6836,25 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in
unsigned int nextb=0, nextj=0;
nullpo_ret(sd);
- if(sd->bl.prev == NULL || pc_isdead(sd))
+ if (sd->bl.prev == NULL || pc_isdead(sd))
return false;
- if(!battle_config.pvp_exp && map->list[sd->bl.m].flag.pvp) // [MouseJstr]
+ if (!battle_config.pvp_exp && map->list[sd->bl.m].flag.pvp) // [MouseJstr]
return false; // no exp on pvp maps
- if( pc_has_permission(sd,PC_PERM_DISABLE_EXP) )
+ if (pc_has_permission(sd,PC_PERM_DISABLE_EXP))
return false;
- if(sd->status.guild_id>0)
- base_exp-=guild->payexp(sd,base_exp);
+ if (src)
+ pc->calcexp(sd, &base_exp, &job_exp, src);
- if(src) pc->calcexp(sd, &base_exp, &job_exp, src);
+ if (sd->status.guild_id > 0)
+ base_exp -= guild->payexp(sd,base_exp);
nextb = pc->nextbaseexp(sd);
nextj = pc->nextjobexp(sd);
- if(sd->state.showexp || battle_config.max_exp_gain_rate){
+ if (sd->state.showexp || battle_config.max_exp_gain_rate) {
if (nextb > 0)
nextbp = (float) base_exp / (float) nextb;
if (nextj > 0)
@@ -6718,7 +6909,7 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in
char output[256];
sprintf(output,
"Experience Gained Base:%u (%.2f%%) Job:%u (%.2f%%)",base_exp,nextbp*(float)100,job_exp,nextjp*(float)100);
- clif_disp_onlyself(sd,output,strlen(output));
+ clif_disp_onlyself(sd, output);
}
return true;
@@ -6727,14 +6918,14 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned in
/*==========================================
* Returns max level for this character.
*------------------------------------------*/
-unsigned int pc_maxbaselv(struct map_session_data *sd)
+int pc_maxbaselv(const struct map_session_data *sd)
{
- return pc->max_level[pc->class2idx(sd->status.class_)][0];
+ return pc->max_level[pc->class2idx(sd->status.class)][0];
}
-unsigned int pc_maxjoblv(struct map_session_data *sd)
+int pc_maxjoblv(const struct map_session_data *sd)
{
- return pc->max_level[pc->class2idx(sd->status.class_)][1];
+ return pc->max_level[pc->class2idx(sd->status.class)][1];
}
/*==========================================
@@ -6742,23 +6933,23 @@ unsigned int pc_maxjoblv(struct map_session_data *sd)
*------------------------------------------*/
//Base exp needed for next level.
-unsigned int pc_nextbaseexp(struct map_session_data *sd)
+unsigned int pc_nextbaseexp(const struct map_session_data *sd)
{
nullpo_ret(sd);
- if(sd->status.base_level>=pc->maxbaselv(sd) || sd->status.base_level<=0)
+ if (sd->status.base_level >= pc->maxbaselv(sd) || sd->status.base_level <= 0)
return 0;
- return pc->exp_table[pc->class2idx(sd->status.class_)][0][sd->status.base_level-1];
+ return pc->exp_table[pc->class2idx(sd->status.class)][0][sd->status.base_level-1];
}
//Base exp needed for this level.
-unsigned int pc_thisbaseexp(struct map_session_data *sd)
+unsigned int pc_thisbaseexp(const struct map_session_data *sd)
{
- if(sd->status.base_level>pc->maxbaselv(sd) || sd->status.base_level<=1)
+ if (sd->status.base_level > pc->maxbaselv(sd) || sd->status.base_level <= 1)
return 0;
- return pc->exp_table[pc->class2idx(sd->status.class_)][0][sd->status.base_level-2];
+ return pc->exp_table[pc->class2idx(sd->status.class)][0][sd->status.base_level-2];
}
/*==========================================
@@ -6769,21 +6960,21 @@ unsigned int pc_thisbaseexp(struct map_session_data *sd)
*------------------------------------------*/
//Job exp needed for next level.
-unsigned int pc_nextjobexp(struct map_session_data *sd)
+unsigned int pc_nextjobexp(const struct map_session_data *sd)
{
nullpo_ret(sd);
- if(sd->status.job_level>=pc->maxjoblv(sd) || sd->status.job_level<=0)
+ if (sd->status.job_level >= pc->maxjoblv(sd) || sd->status.job_level <= 0)
return 0;
- return pc->exp_table[pc->class2idx(sd->status.class_)][1][sd->status.job_level-1];
+ return pc->exp_table[pc->class2idx(sd->status.class)][1][sd->status.job_level-1];
}
//Job exp needed for this level.
-unsigned int pc_thisjobexp(struct map_session_data *sd)
+unsigned int pc_thisjobexp(const struct map_session_data *sd)
{
- if(sd->status.job_level>pc->maxjoblv(sd) || sd->status.job_level<=1)
+ if (sd->status.job_level > pc->maxjoblv(sd) || sd->status.job_level <= 1)
return 0;
- return pc->exp_table[pc->class2idx(sd->status.class_)][1][sd->status.job_level-2];
+ return pc->exp_table[pc->class2idx(sd->status.class)][1][sd->status.job_level-2];
}
/// Returns the value of the specified stat.
@@ -7014,13 +7205,14 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
if( sd->status.skill_point > 0 &&
sd->status.skill[index].id &&
sd->status.skill[index].flag == SKILL_FLAG_PERMANENT && //Don't allow raising while you have granted skills. [Skotlex]
- sd->status.skill[index].lv < skill->tree_get_max(skill_id, sd->status.class_) )
+ sd->status.skill[index].lv < skill->tree_get_max(skill_id, sd->status.class) )
{
sd->status.skill[index].lv++;
sd->status.skill_point--;
if( !skill->dbs->db[index].inf )
status_calc_pc(sd,SCO_NONE); // Only recalculate for passive skills.
- else if( sd->status.skill_point == 0 && (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ else if (sd->status.skill_point == 0 && (sd->job & MAPID_UPPERMASK) == MAPID_TAEKWON
+ && sd->status.base_level >= 90 && pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON) > 0)
pc->calc_skilltree(sd); // Required to grant all TK Ranger skills.
else
pc->check_skilltree(sd, skill_id); // Check if a new skill can Lvlup
@@ -7032,9 +7224,9 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
if (!pc_has_permission(sd, PC_PERM_ALL_SKILL)) // may skill everything at any time anyways, and this would cause a huge slowdown
clif->skillinfoblock(sd);
} else if( battle_config.skillup_limit ){
- if (sd->sktree.second)
+ if (sd->sktree.second != 0)
clif->msgtable_num(sd, MSG_SKILL_POINTS_LEFT_JOB1, sd->sktree.second);
- else if (sd->sktree.third)
+ else if (sd->sktree.third != 0)
clif->msgtable_num(sd, MSG_SKILL_POINTS_LEFT_JOB2, sd->sktree.third);
else if (pc->calc_skillpoint(sd) < 9) /* TODO: official response? */
clif->messagecolor_self(sd->fd, COLOR_RED, "You need the basic skills");
@@ -7076,8 +7268,8 @@ int pc_allskillup(struct map_session_data *sd)
}
} else {
int id;
- for (i = 0; i < MAX_SKILL_TREE && (id=pc->skill_tree[pc->class2idx(sd->status.class_)][i].id) > 0; i++) {
- int idx = pc->skill_tree[pc->class2idx(sd->status.class_)][i].idx;
+ for (i = 0; i < MAX_SKILL_TREE && (id=pc->skill_tree[pc->class2idx(sd->status.class)][i].id) > 0; i++) {
+ int idx = pc->skill_tree[pc->class2idx(sd->status.class)][i].idx;
int inf2 = skill->dbs->db[idx].inf2;
if (
(inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn) ||
@@ -7087,7 +7279,7 @@ int pc_allskillup(struct map_session_data *sd)
continue; //Cannot be learned normally.
sd->status.skill[idx].id = id;
- sd->status.skill[idx].lv = skill->tree_get_max(id, sd->status.class_); // celest
+ sd->status.skill[idx].lv = skill->tree_get_max(id, sd->status.class); // celest
}
}
status_calc_pc(sd,SCO_NONE);
@@ -7124,7 +7316,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
sd->status.int_=1;
sd->status.dex=1;
sd->status.luk=1;
- if(sd->status.class_ == JOB_NOVICE_HIGH) {
+ if (sd->status.class == JOB_NOVICE_HIGH) {
sd->status.status_point=100; // not 88 [celest]
// give platinum skills upon changing
pc->skill(sd, NV_FIRSTAID, 1, SKILL_GRANT_PERMANENT);
@@ -7201,7 +7393,7 @@ int pc_resetstate(struct map_session_data* sd)
return 0;
}
- sd->status.status_point = pc->statp[sd->status.base_level] + ((sd->class_&JOBL_UPPER) ? 52 : 0); // extra 52+48=100 stat points
+ sd->status.status_point = pc->statp[sd->status.base_level] + ((sd->job & JOBL_UPPER) != 0 ? 52 : 0); // extra 52+48=100 stat points
}
else
{
@@ -7259,7 +7451,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
int i, inf2, skill_point=0;
nullpo_ret(sd);
- if( flag&PCRESETSKILL_CHSEX && (sd->class_&MAPID_UPPERMASK) != MAPID_BARDDANCER )
+ if (flag&PCRESETSKILL_CHSEX && (sd->job & MAPID_UPPERMASK) != MAPID_BARDDANCER)
return 0;
if( !(flag&PCRESETSKILL_RECOUNT) ) { //Remove stuff lost when resetting skills.
@@ -7267,7 +7459,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
/**
* It has been confirmed on official server that when you reset skills with a ranked tweakwon your skills are not reset (because you have all of them anyway)
**/
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON))
return 0;
if( pc->checkskill(sd, SG_DEVIL) && !pc->nextjobexp(sd) ) //Remove perma blindness due to skill-reset. [Skotlex]
@@ -7283,7 +7475,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
i &= ~OPTION_WUG;
if( i&OPTION_WUGRIDER && pc->checkskill(sd, RA_WUGRIDER) )
i &= ~OPTION_WUGRIDER;
- if( i&OPTION_MADOGEAR && ( sd->class_&MAPID_THIRDMASK ) == MAPID_MECHANIC )
+ if (i&OPTION_MADOGEAR && (sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC)
i &= ~OPTION_MADOGEAR;
#ifndef NEW_CARTS
if( i&OPTION_CART && pc->checkskill(sd, MC_PUSHCART) )
@@ -7297,6 +7489,9 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( homun_alive(sd->hd) && pc->checkskill(sd, AM_CALLHOMUN) )
homun->vaporize(sd, HOM_ST_REST);
+
+ if ((sd->sc.data[SC_SPRITEMABLE] && pc->checkskill(sd, SU_SPRITEMABLE)))
+ status_change_end(&sd->bl, SC_SPRITEMABLE, INVALID_TIMER);
}
for( i = 1; i < MAX_SKILL; i++ ) {
@@ -7314,14 +7509,16 @@ int pc_resetskill(struct map_session_data* sd, int flag)
skill_id = skill->dbs->db[i].nameid;
// Don't reset trick dead if not a novice/baby
- if( skill_id == NV_TRICKDEAD && (sd->class_&(MAPID_BASEMASK|JOBL_2)) != MAPID_NOVICE ) {
+ if (skill_id == NV_TRICKDEAD && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE) {
sd->status.skill[i].lv = 0;
sd->status.skill[i].flag = 0;
continue;
}
// do not reset basic skill
- if( skill_id == NV_BASIC && (sd->class_&(MAPID_BASEMASK|JOBL_2)) != MAPID_NOVICE )
+ if (skill_id == NV_BASIC && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE)
+ continue;
+ if (skill_id == SU_BASIC_SKILL && (sd->job & MAPID_BASEMASK) != MAPID_SUMMONER)
continue;
if( sd->status.skill[i].flag == SKILL_FLAG_PERM_GRANTED )
@@ -7420,22 +7617,42 @@ int pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id)
return bonus;
}
-int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) {
+int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id)
+{
int i, bonus = sd->bonus.add_heal_rate;
- if( bonus ) {
- switch( skill_id ) {
- case AL_HEAL: if( !(battle_config.skill_add_heal_rate&1) ) bonus = 0; break;
- case PR_SANCTUARY: if( !(battle_config.skill_add_heal_rate&2) ) bonus = 0; break;
- case AM_POTIONPITCHER: if( !(battle_config.skill_add_heal_rate&4) ) bonus = 0; break;
- case CR_SLIMPITCHER: if( !(battle_config.skill_add_heal_rate&8) ) bonus = 0; break;
- case BA_APPLEIDUN: if( !(battle_config.skill_add_heal_rate&16)) bonus = 0; break;
+ if (bonus) {
+ switch (skill_id) {
+ case AL_HEAL:
+ if ((battle_config.skill_add_heal_rate & 1) == 0)
+ bonus = 0;
+ break;
+ case PR_SANCTUARY:
+ if ((battle_config.skill_add_heal_rate & 2) == 0)
+ bonus = 0;
+ break;
+ case AM_POTIONPITCHER:
+ if ((battle_config.skill_add_heal_rate & 4) == 0)
+ bonus = 0;
+ break;
+ case CR_SLIMPITCHER:
+ if ((battle_config.skill_add_heal_rate & 8) == 0)
+ bonus = 0;
+ break;
+ case BA_APPLEIDUN:
+ if ((battle_config.skill_add_heal_rate & 16) == 0)
+ bonus = 0;
+ break;
+ case AB_HIGHNESSHEAL:
+ if ((battle_config.skill_add_heal_rate & 32) == 0)
+ bonus = 0;
+ break;
}
}
ARR_FIND(0, ARRAYLENGTH(sd->skillheal), i, sd->skillheal[i].id == skill_id);
- if( i < ARRAYLENGTH(sd->skillheal) )
+ if (i < ARRAYLENGTH(sd->skillheal))
bonus += sd->skillheal[i].val;
return bonus;
@@ -7504,7 +7721,8 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
if( sd->status.ele_id > 0 )
elemental->set_target(sd,src);
- sd->canlog_tick = timer->gettick();
+ if (battle_config.prevent_logout_trigger & PLT_DAMAGE)
+ sd->canlog_tick = timer->gettick();
}
/*==========================================
@@ -7620,7 +7838,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
if (md->target_id==sd->bl.id)
mob->unlocktarget(md,tick);
if (battle_config.mobs_level_up && md->status.hp
- && (unsigned int)md->level < pc->maxbaselv(sd)
+ && md->level < pc->maxbaselv(sd)
&& !md->guardian_data && md->special_state.ai == AI_NONE// Guardians/summons should not level. [Skotlex]
) {
// monster level up [Valaris]
@@ -7699,7 +7917,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
}
// activate Steel body if a super novice dies at 99+% exp [celest]
- if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && !sd->state.snovice_dead_flag) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && !sd->state.snovice_dead_flag) {
unsigned int next = pc->nextbaseexp(sd);
if( next == 0 ) next = pc->thisbaseexp(sd);
if( get_percentage(sd->status.base_exp,next) >= 99 ) {
@@ -7718,7 +7936,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
// changed penalty options, added death by player if pk_mode [Valaris]
if( battle_config.death_penalty_type
- && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE // only novices will receive no penalty
+ && (sd->job & MAPID_UPPERMASK) != MAPID_NOVICE // only novices will receive no penalty
&& !map->list[sd->bl.m].flag.noexppenalty && !map_flag_gvg2(sd->bl.m)
&& !sd->sc.data[SC_BABY] && !sd->sc.data[SC_CASH_DEATHPENALTY]
) {
@@ -7867,6 +8085,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) {
}
void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) {
+ nullpo_retv(sd);
if(hp) clif->updatestatus(sd,SP_HP);
if(sp) clif->updatestatus(sd,SP_SP);
@@ -7886,7 +8105,7 @@ void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) {
/*==========================================
* script reading pc status registry
*------------------------------------------*/
-int pc_readparam(struct map_session_data* sd,int type)
+int pc_readparam(const struct map_session_data *sd, int type)
{
int val = 0;
@@ -7896,12 +8115,13 @@ int pc_readparam(struct map_session_data* sd,int type)
case SP_SKILLPOINT: val = sd->status.skill_point; break;
case SP_STATUSPOINT: val = sd->status.status_point; break;
case SP_ZENY: val = sd->status.zeny; break;
+ case SP_BANKVAULT: val = sd->status.bank_vault; break;
case SP_BASELEVEL: val = sd->status.base_level; break;
case SP_JOBLEVEL: val = sd->status.job_level; break;
- case SP_CLASS: val = sd->status.class_; break;
- case SP_BASEJOB: val = pc->mapid2jobid(sd->class_&MAPID_UPPERMASK, sd->status.sex); break; //Base job, extracting upper type.
- case SP_UPPER: val = (sd->class_&JOBL_UPPER) ? 1 : ((sd->class_&JOBL_BABY) ? 2 : 0); break;
- case SP_BASECLASS: val = pc->mapid2jobid(sd->class_&MAPID_BASEMASK, sd->status.sex); break; //Extract base class tree. [Skotlex]
+ case SP_CLASS: val = sd->status.class; break;
+ case SP_BASEJOB: val = pc->mapid2jobid(sd->job & MAPID_UPPERMASK, sd->status.sex); break; //Base job, extracting upper type.
+ case SP_UPPER: val = (sd->job & JOBL_UPPER) != 0 ? 1 : ((sd->job & JOBL_BABY) != 0 ? 2 : 0); break;
+ case SP_BASECLASS: val = pc->mapid2jobid(sd->job & MAPID_BASEMASK, sd->status.sex); break; //Extract base class tree. [Skotlex]
case SP_SEX: val = sd->status.sex; break;
case SP_WEIGHT: val = sd->weight; break;
case SP_MAXWEIGHT: val = sd->max_weight; break;
@@ -7944,7 +8164,7 @@ int pc_readparam(struct map_session_data* sd,int type)
case SP_VARCASTRATE:
#endif
case SP_CASTRATE:
- val = sd->castrate+=val;
+ val = sd->castrate;
break;
case SP_MAXHPRATE: val = sd->hprate; break;
case SP_MAXSPRATE: val = sd->sprate; break;
@@ -8040,19 +8260,20 @@ int pc_readparam(struct map_session_data* sd,int type)
*------------------------------------------*/
int pc_setparam(struct map_session_data *sd,int type,int val)
{
+ int delta;
nullpo_ret(sd);
switch(type){
case SP_BASELEVEL:
- if ((unsigned int)val > pc->maxbaselv(sd)) //Capping to max
+ if (val > pc->maxbaselv(sd)) //Capping to max
val = pc->maxbaselv(sd);
- if ((unsigned int)val > sd->status.base_level) {
+ if (val > sd->status.base_level) {
int stat = 0, i;
- for (i = 0; i < (int)((unsigned int)val - sd->status.base_level); i++)
+ for (i = 0; i < val - sd->status.base_level; i++)
stat += pc->gets_status_point(sd->status.base_level + i);
sd->status.status_point += stat;
}
- sd->status.base_level = (unsigned int)val;
+ sd->status.base_level = val;
sd->status.base_exp = 0;
// clif->updatestatus(sd, SP_BASELEVEL); // Gets updated at the bottom
clif->updatestatus(sd, SP_NEXTBASEEXP);
@@ -8065,12 +8286,13 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
}
break;
case SP_JOBLEVEL:
- if ((unsigned int)val >= sd->status.job_level) {
- if ((unsigned int)val > pc->maxjoblv(sd)) val = pc->maxjoblv(sd);
+ if (val >= sd->status.job_level) {
+ if (val > pc->maxjoblv(sd))
+ val = pc->maxjoblv(sd);
sd->status.skill_point += val - sd->status.job_level;
clif->updatestatus(sd, SP_SKILLPOINT);
}
- sd->status.job_level = (unsigned int)val;
+ sd->status.job_level = val;
sd->status.job_exp = 0;
// clif->updatestatus(sd, SP_JOBLEVEL); // Gets updated at the bottom
clif->updatestatus(sd, SP_NEXTJOBEXP);
@@ -8089,6 +8311,19 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
logs->zeny(sd, LOG_TYPE_SCRIPT, sd, -(sd->status.zeny - cap_value(val, 0, MAX_ZENY)));
sd->status.zeny = cap_value(val, 0, MAX_ZENY);
break;
+ case SP_BANKVAULT:
+ val = cap_value(val, 0, MAX_BANK_ZENY);
+ delta = (val - sd->status.bank_vault);
+ sd->status.bank_vault = val;
+ if (map->save_settings & 256) {
+ chrif->save(sd, 0); // send to char server
+ }
+ if (delta > 0) {
+ clif->bank_deposit(sd, BDA_SUCCESS);
+ } else if (delta < 0) {
+ clif->bank_withdraw(sd, BWA_SUCCESS);
+ }
+ return 1; // the vault uses a different packet
case SP_BASEEXP:
if(pc->nextbaseexp(sd) > 0) {
sd->status.base_exp = val;
@@ -8202,6 +8437,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
*------------------------------------------*/
void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int type)
{
+ nullpo_retv(sd);
if (type) {
if (hp)
clif->heal(sd->fd,SP_HP,hp);
@@ -8225,6 +8461,7 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
{
int bonus, tmp;
+ nullpo_ret(sd);
if(hp) {
int i;
bonus = 100 + (sd->battle_status.vit<<1)
@@ -8291,6 +8528,9 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
if( sd->sc.data[SC_EXTREMITYFIST2] )
sp = 0;
#endif
+ if (sd->sc.data[SC_BITESCAR]) {
+ hp = 0;
+ }
}
return status->heal(&sd->bl, hp, sp, 1);
@@ -8353,46 +8593,45 @@ int jobchange_killclone(struct block_list *bl, va_list ap)
* Called when player changes job
* Rewrote to make it tidider [Celest]
*------------------------------------------*/
-int pc_jobchange(struct map_session_data *sd,int job, int upper)
+int pc_jobchange(struct map_session_data *sd, int class, int upper)
{
int i, fame_flag=0;
- int b_class, idx = 0;
+ int job, idx = 0;
nullpo_ret(sd);
- if (job < 0)
+ if (class < 0)
return 1;
//Normalize job.
- b_class = pc->jobid2mapid(job);
- if (b_class == -1)
+ job = pc->jobid2mapid(class);
+ if (job == -1)
return 1;
switch (upper) {
case 1:
- b_class|= JOBL_UPPER;
+ job |= JOBL_UPPER;
break;
case 2:
- b_class|= JOBL_BABY;
+ job |= JOBL_BABY;
break;
}
//This will automatically adjust bard/dancer classes to the correct gender
//That is, if you try to jobchange into dancer, it will turn you to bard.
- job = pc->mapid2jobid(b_class, sd->status.sex);
- if (job == -1)
+ class = pc->mapid2jobid(job, sd->status.sex);
+ if (class == -1)
return 1;
- if ((unsigned short)b_class == sd->class_)
+ if ((uint16)job == sd->job)
return 1; //Nothing to change.
- // changing from 1st to 2nd job
- if ((b_class&JOBL_2) && !(sd->class_&JOBL_2) && (b_class&MAPID_UPPERMASK) != MAPID_SUPER_NOVICE) {
+ if ((job & JOBL_2) != 0 && (sd->job & JOBL_2) == 0 && (job & MAPID_UPPERMASK) != MAPID_SUPER_NOVICE) {
+ // changing from 1st to 2nd job
sd->change_level_2nd = sd->status.job_level;
- pc_setglobalreg (sd, script->add_str("jobchange_level"), sd->change_level_2nd);
- }
- // changing from 2nd to 3rd job
- else if((b_class&JOBL_THIRD) && !(sd->class_&JOBL_THIRD)) {
+ pc_setglobalreg(sd, script->add_str("jobchange_level"), sd->change_level_2nd);
+ } else if((job & JOBL_THIRD) != 0 && (sd->job & JOBL_THIRD) == 0) {
+ // changing from 2nd to 3rd job
sd->change_level_3rd = sd->status.job_level;
- pc_setglobalreg (sd, script->add_str("jobchange_level_3rd"), sd->change_level_3rd);
+ pc_setglobalreg(sd, script->add_str("jobchange_level_3rd"), sd->change_level_3rd);
}
if(sd->cloneskill_id) {
@@ -8421,10 +8660,10 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
pc_setglobalreg(sd, script->add_str("REPRODUCE_SKILL_LV"),0);
}
- if ( (b_class&MAPID_UPPERMASK) != (sd->class_&MAPID_UPPERMASK) ) { //Things to remove when changing class tree.
- const int class_ = pc->class2idx(sd->status.class_);
+ if ((job & MAPID_UPPERMASK) != (sd->job & MAPID_UPPERMASK)) { //Things to remove when changing class tree.
+ const int class_idx = pc->class2idx(sd->status.class);
short id;
- for(i = 0; i < MAX_SKILL_TREE && (id = pc->skill_tree[class_][i].id) > 0; i++) {
+ for (i = 0; i < MAX_SKILL_TREE && (id = pc->skill_tree[class_idx][i].id) > 0; i++) {
//Remove status specific to your current tree skills.
enum sc_type sc = status->skill2sc(id);
if (sc > SC_COMMON_MAX && sd->sc.data[sc])
@@ -8432,14 +8671,18 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
}
}
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR && (b_class&MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR && (job & MAPID_UPPERMASK) != MAPID_STAR_GLADIATOR) {
/* going off star glad lineage, reset feel to not store no-longer-used vars in the database */
pc->resetfeel(sd);
}
- sd->status.class_ = job;
- fame_flag = pc->famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK);
- sd->class_ = (unsigned short)b_class;
+ sd->status.class = class;
+ {
+ int fame_list_type = pc->famelist_type(sd->job);
+ if (fame_list_type != RANKTYPE_UNKNOWN)
+ fame_flag = pc->fame_rank(sd->status.char_id, fame_list_type);
+ }
+ sd->job = (uint16)job;
sd->status.job_level=1;
sd->status.job_exp=0;
@@ -8468,8 +8711,8 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
if (sd->disguise != -1)
pc->disguise(sd, -1);
- status->set_viewdata(&sd->bl, job);
- clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
+ status->set_viewdata(&sd->bl, class);
+ clif->changelook(&sd->bl, LOOK_BASE, sd->vd.class); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
if(sd->vd.cloth_color)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
if (sd->vd.body_style)
@@ -8488,7 +8731,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
//Remove peco/cart/falcon
i = sd->sc.option;
- if( i&OPTION_RIDING && (!pc->checkskill(sd, KN_RIDING) || (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) )
+ if (i&OPTION_RIDING && (!pc->checkskill(sd, KN_RIDING) || (sd->job & MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT))
i&=~OPTION_RIDING;
if( i&OPTION_FALCON && !pc->checkskill(sd, HT_FALCON) )
i&=~OPTION_FALCON;
@@ -8513,6 +8756,9 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
if(homun_alive(sd->hd) && !pc->checkskill(sd, AM_CALLHOMUN))
homun->vaporize(sd, HOM_ST_REST);
+ if ((sd->sc.data[SC_SPRITEMABLE] && pc->checkskill(sd, SU_SPRITEMABLE)))
+ status_change_end(&sd->bl, SC_SPRITEMABLE, INVALID_TIMER);
+
if(sd->status.manner < 0)
clif->changestatus(sd,SP_MANNER,sd->status.manner);
@@ -8521,12 +8767,12 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
pc->equiplookall(sd);
//if you were previously famous, not anymore.
- if (fame_flag) {
+ if (fame_flag != 0) {
chrif->save(sd,0);
chrif->buildfamelist();
} else if (sd->status.fame > 0) {
//It may be that now they are famous?
- switch (sd->class_&MAPID_UPPERMASK) {
+ switch (sd->job & MAPID_UPPERMASK) {
case MAPID_BLACKSMITH:
case MAPID_ALCHEMIST:
case MAPID_TAEKWON:
@@ -8566,7 +8812,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
switch(type){
case LOOK_BASE:
status->set_viewdata(&sd->bl, val);
- clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_);
+ clif->changelook(&sd->bl, LOOK_BASE, sd->vd.class);
clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
if (sd->vd.cloth_color)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
@@ -8712,8 +8958,8 @@ int pc_setoption(struct map_session_data *sd,int type)
return 0; //Disguises break sprite changes
if (new_look < 0) { //Restore normal look.
- status->set_viewdata(&sd->bl, sd->status.class_);
- new_look = sd->vd.class_;
+ status->set_viewdata(&sd->bl, sd->status.class);
+ new_look = sd->vd.class;
}
pc_stop_attack(sd); //Stop attacking on new view change (to prevent wedding/santa attacks.
@@ -8795,6 +9041,7 @@ int pc_setcart(struct map_session_data *sd,int type) {
**/
void pc_setfalcon(struct map_session_data *sd, bool flag)
{
+ nullpo_retv(sd);
if (flag) {
if (pc->checkskill(sd,HT_FALCON) > 0) // add falcon if he have the skill
pc->setoption(sd,sd->sc.option|OPTION_FALCON);
@@ -8813,6 +9060,7 @@ void pc_setfalcon(struct map_session_data *sd, bool flag)
**/
void pc_setridingpeco(struct map_session_data *sd, bool flag)
{
+ nullpo_retv(sd);
if (flag) {
if (pc->checkskill(sd, KN_RIDING))
pc->setoption(sd, sd->sc.option|OPTION_RIDING);
@@ -8831,8 +9079,9 @@ void pc_setridingpeco(struct map_session_data *sd, bool flag)
**/
void pc_setmadogear(struct map_session_data *sd, bool flag)
{
+ nullpo_retv(sd);
if (flag) {
- if ((sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC)
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC)
pc->setoption(sd, sd->sc.option|OPTION_MADOGEAR);
} else if (pc_ismadogear(sd)) {
pc->setoption(sd, sd->sc.option&~OPTION_MADOGEAR);
@@ -8849,6 +9098,7 @@ void pc_setmadogear(struct map_session_data *sd, bool flag)
**/
void pc_setridingdragon(struct map_session_data *sd, unsigned int type)
{
+ nullpo_retv(sd);
if (type&OPTION_DRAGON) {
// Ensure only one dragon is set at a time.
if (type&OPTION_DRAGON1)
@@ -8881,6 +9131,7 @@ void pc_setridingdragon(struct map_session_data *sd, unsigned int type)
**/
void pc_setridingwug(struct map_session_data *sd, bool flag)
{
+ nullpo_retv(sd);
if (flag) {
if (pc->checkskill(sd, RA_WUGRIDER) > 0)
pc->setoption(sd,sd->sc.option|OPTION_WUGRIDER);
@@ -8948,6 +9199,7 @@ int pc_candrop(struct map_session_data *sd, struct item *item)
* For '@type' variables (temporary numeric char reg)
**/
int pc_readreg(struct map_session_data* sd, int64 reg) {
+ nullpo_ret(sd);
return i64db_iget(sd->regs.vars, reg);
}
/**
@@ -8956,6 +9208,7 @@ int pc_readreg(struct map_session_data* sd, int64 reg) {
void pc_setreg(struct map_session_data* sd, int64 reg, int val) {
unsigned int index = script_getvaridx(reg);
+ nullpo_retv(sd);
if( val ) {
i64db_iput(sd->regs.vars, reg, val);
if( index )
@@ -8973,6 +9226,7 @@ void pc_setreg(struct map_session_data* sd, int64 reg, int val) {
char* pc_readregstr(struct map_session_data* sd, int64 reg) {
struct script_reg_str *p = NULL;
+ nullpo_retr(NULL, sd);
p = i64db_get(sd->regs.vars, reg);
return p ? p->value : NULL;
@@ -8983,8 +9237,10 @@ char* pc_readregstr(struct map_session_data* sd, int64 reg) {
void pc_setregstr(struct map_session_data* sd, int64 reg, const char* str) {
struct script_reg_str *p = NULL;
unsigned int index = script_getvaridx(reg);
- DBData prev;
+ struct DBData prev;
+ nullpo_retv(sd);
+ nullpo_retv(str);
if( str[0] ) {
p = ers_alloc(pc->str_reg_ers, struct script_reg_str);
@@ -9020,6 +9276,7 @@ void pc_setregstr(struct map_session_data* sd, int64 reg, const char* str) {
int pc_readregistry(struct map_session_data *sd, int64 reg) {
struct script_reg_num *p = NULL;
+ nullpo_ret(sd);
if (!sd->vars_ok) {
ShowError("pc_readregistry: Trying to read reg %s before it's been loaded!\n", script->get_str(script_getvarid(reg)));
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
@@ -9041,6 +9298,7 @@ int pc_readregistry(struct map_session_data *sd, int64 reg) {
char* pc_readregistry_str(struct map_session_data *sd, int64 reg) {
struct script_reg_str *p = NULL;
+ nullpo_retr(NULL, sd);
if (!sd->vars_ok) {
ShowError("pc_readregistry_str: Trying to read reg %s before it's been loaded!\n", script->get_str(script_getvarid(reg)));
//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.
@@ -9064,11 +9322,12 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
const char *regname = script->get_str( script_getvarid(reg) );
unsigned int index = script_getvaridx(reg);
+ nullpo_ret(sd);
/* SAAD! those things should be stored elsewhere e.g. char ones in char table, the cash ones in account_data table! */
switch( regname[0] ) {
default: //Char reg
if( !strcmp(regname,"PC_DIE_COUNTER") && sd->die_counter != val ) {
- int i = (!sd->die_counter && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE);
+ int i = (!sd->die_counter && (sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE);
sd->die_counter = val;
if( i )
status_calc_pc(sd,SCO_NONE); // Lost the bonus.
@@ -9106,7 +9365,7 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
if( !pc->reg_load )
p->flag.update = 1;/* either way, it will require either delete or replace */
} else if( val ) {
- DBData prev;
+ struct DBData prev;
if( index )
script->array_update(&sd->regs, reg, false);
@@ -9139,6 +9398,8 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
const char *regname = script->get_str( script_getvarid(reg) );
unsigned int index = script_getvaridx(reg);
+ nullpo_ret(sd);
+ nullpo_ret(val);
if ( !pc->reg_load && !sd->vars_ok ) {
ShowError("pc_setregistry_str : refusing to set %s until vars are received.\n", regname);
return 0;
@@ -9159,7 +9420,7 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
if( !pc->reg_load )
p->flag.update = 1;/* either way, it will require either delete or replace */
} else if( val[0] ) {
- DBData prev;
+ struct DBData prev;
if( index )
script->array_update(&sd->regs, reg, false);
@@ -9216,6 +9477,7 @@ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
{
int i;
nullpo_ret(sd);
+ nullpo_ret(name);
ARR_FIND( 0, MAX_EVENTTIMER, i, sd->eventtimer[i] == INVALID_TIMER );
if( i == MAX_EVENTTIMER )
@@ -9236,6 +9498,7 @@ int pc_deleventtimer(struct map_session_data *sd,const char *name)
int i;
nullpo_ret(sd);
+ nullpo_ret(name);
if (sd->eventcount <= 0)
return 0;
@@ -9304,6 +9567,8 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
int index, success = 0;
struct pc_combos *combo;
+ nullpo_ret(sd);
+ nullpo_ret(data);
for( i = 0; i < data->combos_count; i++ ) {
/* ensure this isn't a duplicate combo */
@@ -9379,6 +9644,8 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
int i, retval = 0;
+ nullpo_ret(sd);
+ nullpo_ret(data);
if( !sd->combos )
return 0;/* nothing to do here, player has no combos */
@@ -9423,6 +9690,7 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
}
int pc_load_combo(struct map_session_data *sd) {
int i, ret = 0;
+ nullpo_ret(sd);
for( i = 0; i < EQI_MAX; i++ ) {
struct item_data *id = NULL;
int idx = sd->equip_index[i];
@@ -9455,6 +9723,7 @@ int pc_load_combo(struct map_session_data *sd) {
**/
void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, int pos)
{
+ nullpo_retv(sd);
if ((!map_no_view(sd->bl.m,EQP_SHADOW_WEAPON) && pos & EQP_SHADOW_WEAPON) ||
(pos & EQP_HAND_R)) {
if(id)
@@ -9565,8 +9834,8 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
pos = pc->equippoint(sd,n); //With a few exceptions, item should go in all specified slots.
if(battle_config.battle_log)
- ShowInfo("equip %d(%d) %x:%x\n",sd->status.inventory[n].nameid,n,id?id->equip:0,req_pos);
- if(!pc->isequip(sd,n) || !(pos&req_pos) || sd->status.inventory[n].equip != 0 || sd->status.inventory[n].attribute==1 ) { // [Valaris]
+ ShowInfo("equip %d(%d) %x:%x\n", sd->status.inventory[n].nameid, n, (unsigned int)(id ? id->equip : 0), (unsigned int)req_pos);
+ if(!pc->isequip(sd,n) || !(pos&req_pos) || sd->status.inventory[n].equip != 0 || (sd->status.inventory[n].attribute & ATTR_BROKEN) != 0 ) { // [Valaris]
// FIXME: pc->isequip: equip level failure uses 2 instead of 0
clif->equipitemack(sd,n,0,EIA_FAIL); // fail
return 0;
@@ -9685,6 +9954,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
**/
void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
{
+ nullpo_retv(sd);
if (pos & EQP_HAND_R) {
sd->weapontype1 = 0;
sd->status.weapon = sd->weapontype2;
@@ -9749,127 +10019,142 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
*------------------------------------------*/
int pc_unequipitem(struct map_session_data *sd,int n,int flag)
{
- int i,iflag;
- bool status_cacl = false;
+ int i, iflag;
+ bool status_calc = false;
int pos;
+
nullpo_ret(sd);
- if( n < 0 || n >= MAX_INVENTORY ) {
- clif->unequipitemack(sd,0,0,UIA_FAIL);
+ if (n < 0 || n >= MAX_INVENTORY) {
+ clif->unequipitemack(sd, 0, 0, UIA_FAIL);
return 0;
}
// if player is berserk then cannot unequip
- if (!(flag&PCUNEQUIPITEM_FORCE) && sd->sc.count && (sd->sc.data[SC_BERSERK] || sd->sc.data[SC_NO_SWITCH_EQUIP]) )
- {
- clif->unequipitemack(sd,n,0,UIA_FAIL);
+ if (!(flag & PCUNEQUIPITEM_FORCE) && sd->sc.count && (sd->sc.data[SC_BERSERK] || sd->sc.data[SC_NO_SWITCH_EQUIP])) {
+ clif->unequipitemack(sd, n, 0, UIA_FAIL);
return 0;
}
- if( !(flag&PCUNEQUIPITEM_FORCE) && sd->sc.count && sd->sc.data[SC_KYOUGAKU] )
- {
- clif->unequipitemack(sd,n,0,UIA_FAIL);
+ if (!(flag & PCUNEQUIPITEM_FORCE) && sd->sc.count && sd->sc.data[SC_KYOUGAKU]) {
+ clif->unequipitemack(sd, n, 0, UIA_FAIL);
return 0;
}
- if(battle_config.battle_log)
- ShowInfo("unequip %d %x:%x\n",n,pc->equippoint(sd,n),sd->status.inventory[n].equip);
+ if (battle_config.battle_log)
+ ShowInfo("unequip %d %x:%x\n", n, (unsigned int)(pc->equippoint(sd, n)), sd->status.inventory[n].equip);
- if(!sd->status.inventory[n].equip){ //Nothing to unequip
- clif->unequipitemack(sd,n,0,UIA_FAIL);
+ if (sd->status.inventory[n].equip == 0) { //Nothing to unequip
+ clif->unequipitemack(sd, n, 0, UIA_FAIL);
return 0;
}
- for(i=0;i<EQI_MAX;i++) {
- if(sd->status.inventory[n].equip & pc->equip_pos[i])
+
+ for (i = 0; i < EQI_MAX; i++) {
+ if (sd->status.inventory[n].equip & pc->equip_pos[i])
sd->equip_index[i] = -1;
}
pos = sd->status.inventory[n].equip;
pc->unequipitem_pos(sd, n, pos);
- clif->unequipitemack(sd,n,pos,UIA_SUCCESS);
+ clif->unequipitemack(sd, n, pos, UIA_SUCCESS);
- if((pos & EQP_ARMS) &&
- sd->weapontype1 == 0 && sd->weapontype2 == 0 && (!sd->sc.data[SC_TK_SEVENWIND] || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!)
- skill->enchant_elemental_end(&sd->bl,-1);
+ if ((pos & EQP_ARMS) &&
+ sd->weapontype1 == 0 && sd->weapontype2 == 0 && (sd->sc.data[SC_TK_SEVENWIND] == 0 || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!)
+ skill->enchant_elemental_end(&sd->bl, -1);
- if(pos & EQP_ARMOR) {
+ if (pos & EQP_ARMOR) {
// On Armor Change...
status_change_end(&sd->bl, SC_BENEDICTIO, INVALID_TIMER);
status_change_end(&sd->bl, SC_ARMOR_RESIST, INVALID_TIMER);
}
+#ifdef RENEWAL
+ if (battle->bc->bow_unequip_arrow && pos&EQP_ARMS && sd->equip_index[EQI_AMMO] > 0)
+ pc->unequipitem(sd, sd->equip_index[EQI_AMMO], PCUNEQUIPITEM_FORCE);
+#endif
+
if( sd->state.autobonus&pos )
sd->state.autobonus &= ~sd->status.inventory[n].equip; //Check for activated autobonus [Inkfish]
- sd->status.inventory[n].equip=0;
+ sd->status.inventory[n].equip = 0;
iflag = sd->npc_item_flag;
/* check for combos (MUST be before status_calc_pc) */
- if ( sd->inventory_data[n] ) {
- if( sd->inventory_data[n]->combos_count ) {
- if( pc->removecombo(sd,sd->inventory_data[n]) )
- status_cacl = true;
- } if(itemdb_isspecial(sd->status.inventory[n].card[0]))
- ; //No cards
- else {
- for( i = 0; i < sd->inventory_data[n]->slot; i++ ) {
+ if (sd->inventory_data[n] != NULL) {
+ if (sd->inventory_data[n]->combos_count) {
+ if (pc->removecombo(sd, sd->inventory_data[n]))
+ status_calc = true;
+ }
+ if (itemdb_isspecial(sd->status.inventory[n].card[0]) == false) {
+ for (i = 0; i < sd->inventory_data[n]->slot; i++) {
struct item_data *data;
- if (!sd->status.inventory[n].card[i])
+ if (sd->status.inventory[n].card[i] == 0)
continue;
- if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) {
- if( data->combos_count ) {
- if( pc->removecombo(sd,data) )
- status_cacl = true;
+ if ((data = itemdb->exists(sd->status.inventory[n].card[i])) != NULL) {
+ if (data->combos_count) {
+ if (pc->removecombo(sd, data))
+ status_calc = true;
}
}
}
}
+ /* Item Options checking */
+ for (i = 0; i < MAX_ITEM_OPTIONS; i++) {
+ struct item_option *ito = NULL;
+ int16 item_option = sd->status.inventory[n].option[i].index;
+
+ if (item_option <= 0)
+ continue;
+ if ((ito = itemdb->option_exists(sd->status.inventory[n].option[i].index)) == NULL)
+ continue;
+
+ status_calc = true;
+ }
}
- if(flag&PCUNEQUIPITEM_RECALC || status_cacl) {
+ if (flag & PCUNEQUIPITEM_RECALC || status_calc) {
pc->checkallowskill(sd);
- status_calc_pc(sd,SCO_NONE);
+ status_calc_pc(sd, SCO_NONE);
}
- if(sd->sc.data[SC_CRUCIS] && !battle->check_undead(sd->battle_status.race,sd->battle_status.def_ele))
+ if (sd->sc.data[SC_CRUCIS] && battle->check_undead(sd->battle_status.race, sd->battle_status.def_ele) == false)
status_change_end(&sd->bl, SC_CRUCIS, INVALID_TIMER);
//OnUnEquip script [Skotlex]
- if (sd->inventory_data[n]) {
- if (sd->inventory_data[n]->unequip_script) {
- if ( battle_config.unequip_restricted_equipment & 1 ) {
- ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == sd->status.inventory[n].nameid);
- if ( i == map->list[sd->bl.m].zone->disabled_items_count )
+ if (sd->inventory_data[n] != NULL) {
+ if (sd->inventory_data[n]->unequip_script != NULL) {
+ if (battle_config.unequip_restricted_equipment & 1) {
+ ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, i, map->list[sd->bl.m].zone->disabled_items[i] == sd->status.inventory[n].nameid);
+ if (i == map->list[sd->bl.m].zone->disabled_items_count)
script->run_item_unequip_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id);
}
else
script->run_item_unequip_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id);
}
- if(itemdb_isspecial(sd->status.inventory[n].card[0]))
- ; //No cards
- else {
- for( i = 0; i < sd->inventory_data[n]->slot; i++ ) {
- struct item_data *data;
- if (!sd->status.inventory[n].card[i])
+ if (itemdb_isspecial(sd->status.inventory[n].card[0]) == false) {
+ for (i = 0; i < sd->inventory_data[n]->slot; i++) {
+ struct item_data *data = NULL;
+ if (sd->status.inventory[n].card[i] == 0)
continue;
- if ( ( data = itemdb->exists(sd->status.inventory[n].card[i]) ) != NULL ) {
- if ( data->unequip_script ) {
- if ( battle_config.unequip_restricted_equipment & 2 ) {
+ if ((data = itemdb->exists(sd->status.inventory[n].card[i])) != NULL) {
+ if (data->unequip_script) {
+ if (battle_config.unequip_restricted_equipment & 2) {
int j;
- ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, j, map->list[sd->bl.m].zone->disabled_items[j] == sd->status.inventory[n].card[i]);
- if ( j == map->list[sd->bl.m].zone->disabled_items_count )
+ ARR_FIND(0, map->list[sd->bl.m].zone->disabled_items_count, j, map->list[sd->bl.m].zone->disabled_items[j] == sd->status.inventory[n].card[i]);
+ if (j == map->list[sd->bl.m].zone->disabled_items_count)
script->run_item_unequip_script(sd, data, npc->fake_nd->bl.id);
- }
- else
+ } else {
script->run_item_unequip_script(sd, data, npc->fake_nd->bl.id);
+ }
}
}
}
}
}
+
sd->npc_item_flag = iflag;
return 1;
@@ -9885,99 +10170,108 @@ int pc_checkitem(struct map_session_data *sd)
nullpo_ret(sd);
- if (sd->state.vending) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam)
+ if (sd->state.vending == 1) // Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam)
return 0;
- if (sd->state.itemcheck) { // check for invalid(ated) items
- int id;
- for (i = 0; i < MAX_INVENTORY; i++) {
- id = sd->status.inventory[i].nameid;
+ if (sd->itemcheck != PCCHECKITEM_NONE) { // check for invalid(ated) items
+ int id = 0;
- if (!id)
- continue;
+ if (sd->itemcheck & PCCHECKITEM_INVENTORY) {
+ for (i = 0; i < MAX_INVENTORY; i++) {
+ if ((id = sd->status.inventory[i].nameid) == 0)
+ continue;
- if (!itemdb_available(id)) {
- ShowWarning("Removed invalid/disabled item id %d from inventory (amount=%d, char_id=%d).\n", id, sd->status.inventory[i].amount, sd->status.char_id);
- pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
- continue;
+ if (!itemdb_available(id)) {
+ ShowWarning("pc_checkitem: Removed invalid/disabled item id %d from inventory (amount=%d, char_id=%d).\n", id, sd->status.inventory[i].amount, sd->status.char_id);
+ pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_INV_INVALID);
+ continue;
+ }
+
+ if (sd->status.inventory[i].unique_id == 0 && !itemdb->isstackable(id))
+ sd->status.inventory[i].unique_id = itemdb->unique_id(sd);
}
- if (!sd->status.inventory[i].unique_id && !itemdb->isstackable(id))
- sd->status.inventory[i].unique_id = itemdb->unique_id(sd);
+ sd->itemcheck &= ~PCCHECKITEM_INVENTORY;
}
- for( i = 0; i < MAX_CART; i++ ) {
- id = sd->status.cart[i].nameid;
+ if (sd->itemcheck & PCCHECKITEM_CART) {
+ for (i = 0; i < MAX_CART; i++) {
+ if ((id = sd->status.cart[i].nameid) == 0)
+ continue;
- if (!id)
- continue;
+ if( !itemdb_available(id) ) {
+ ShowWarning("pc_checkitem: Removed invalid/disabled item id %d from cart (amount=%d, char_id=%d).\n", id, sd->status.cart[i].amount, sd->status.char_id);
+ pc->cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_CART_INVALID);
+ continue;
+ }
- if( !itemdb_available(id) ) {
- ShowWarning("Removed invalid/disabled item id %d from cart (amount=%d, char_id=%d).\n", id, sd->status.cart[i].amount, sd->status.char_id);
- pc->cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_OTHER);
- continue;
+ if (sd->status.cart[i].unique_id == 0 && !itemdb->isstackable(id))
+ sd->status.cart[i].unique_id = itemdb->unique_id(sd);
}
- if ( !sd->status.cart[i].unique_id && !itemdb->isstackable(id) )
- sd->status.cart[i].unique_id = itemdb->unique_id(sd);
+ sd->itemcheck &= ~PCCHECKITEM_CART;
}
- for( i = 0; i < MAX_STORAGE; i++ ) {
- id = sd->status.storage.items[i].nameid;
+ if (sd->itemcheck & PCCHECKITEM_STORAGE && sd->storage.received == true) {
+ for (i = 0; i < VECTOR_LENGTH(sd->storage.item); i++) {
+ struct item *it = &VECTOR_INDEX(sd->storage.item, i);
- if (!id)
- continue;
+ if ((id = it->nameid) == 0)
+ continue;
- if( id && !itemdb_available(id) ) {
- ShowWarning("Removed invalid/disabled item id %d from storage (amount=%d, char_id=%d).\n", id, sd->status.storage.items[i].amount, sd->status.char_id);
- storage->delitem(sd, i, sd->status.storage.items[i].amount);
- storage->close(sd);
- continue;
+ if (!itemdb_available(id)) {
+ ShowWarning("pc_checkitem: Removed invalid/disabled item id %d from storage (amount=%d, char_id=%d).\n", id, it->amount, sd->status.char_id);
+ storage->delitem(sd, i, it->amount);
+ continue;
+ }
+
+ if (it->unique_id == 0 && itemdb->isstackable(id) == 0)
+ it->unique_id = itemdb->unique_id(sd);
}
- if ( !sd->status.storage.items[i].unique_id && !itemdb->isstackable(id) )
- sd->status.storage.items[i].unique_id = itemdb->unique_id(sd);
+ storage->close(sd);
+
+ sd->itemcheck &= ~PCCHECKITEM_STORAGE;
}
- if (sd->guild) {
+ if (sd->guild && sd->itemcheck & PCCHECKITEM_GSTORAGE) {
struct guild_storage *guild_storage = idb_get(gstorage->db,sd->guild->guild_id);
if (guild_storage) {
- for( i = 0; i < MAX_GUILD_STORAGE; i++ ) {
- id = guild_storage->items[i].nameid;
-
- if (!id)
+ for (i = 0; i < MAX_GUILD_STORAGE; i++) {
+ if ((id = guild_storage->items[i].nameid) == 0)
continue;
- if( !itemdb_available(id) ) {
- ShowWarning("Removed invalid/disabled item id %d from guild storage (amount=%d, char_id=%d, guild_id=%d).\n", id, guild_storage->items[i].amount, sd->status.char_id, sd->guild->guild_id);
+ if (!itemdb_available(id)) {
+ ShowWarning("pc_checkitem: Removed invalid/disabled item id %d from guild storage (amount=%d, char_id=%d, guild_id=%d).\n", id, guild_storage->items[i].amount, sd->status.char_id, sd->guild->guild_id);
gstorage->delitem(sd, guild_storage, i, guild_storage->items[i].amount);
gstorage->close(sd); // force closing
continue;
}
- if (!guild_storage->items[i].unique_id && !itemdb->isstackable(id))
+ if (guild_storage->items[i].unique_id == 0 && !itemdb->isstackable(id))
guild_storage->items[i].unique_id = itemdb->unique_id(sd);
}
}
+
+ sd->itemcheck &= ~PCCHECKITEM_GSTORAGE;
}
- sd->state.itemcheck = 0;
}
- for( i = 0; i < MAX_INVENTORY; i++) {
+ for (i = 0; i < MAX_INVENTORY; i++) {
- if( sd->status.inventory[i].nameid == 0 )
+ if (sd->status.inventory[i].nameid == 0)
continue;
- if( !sd->status.inventory[i].equip )
+ if (sd->status.inventory[i].equip == 0)
continue;
- if( sd->status.inventory[i].equip&~pc->equippoint(sd,i) ) {
+ if (sd->status.inventory[i].equip & ~pc->equippoint(sd,i)) {
pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE);
calc_flag = 1;
continue;
}
- if (battle_config.unequip_restricted_equipment&1) {
+ if (battle_config.unequip_restricted_equipment & 1) {
int j;
for (j = 0; j < map->list[sd->bl.m].zone->disabled_items_count; j++) {
if (map->list[sd->bl.m].zone->disabled_items[j] == sd->status.inventory[i].nameid) {
@@ -9987,7 +10281,7 @@ int pc_checkitem(struct map_session_data *sd)
}
}
- if (battle_config.unequip_restricted_equipment&2) {
+ if (battle_config.unequip_restricted_equipment & 2) {
if (!itemdb_isspecial(sd->status.inventory[i].card[0])) {
int j, slot;
for (slot = 0; slot < MAX_SLOTS; slot++) {
@@ -10003,9 +10297,9 @@ int pc_checkitem(struct map_session_data *sd)
}
- if( calc_flag && sd->state.active ) {
+ if (calc_flag != 0 && sd->state.active == 1) {
pc->checkallowskill(sd);
- status_calc_pc(sd,SCO_NONE);
+ status_calc_pc(sd, SCO_NONE);
}
return 0;
@@ -10040,6 +10334,7 @@ int pc_calc_pvprank_sub(struct block_list *bl, va_list ap)
int pc_calc_pvprank(struct map_session_data *sd) {
int old;
struct map_data *m;
+ nullpo_ret(sd);
m=&map->list[sd->bl.m];
old=sd->pvp_rank;
sd->pvp_rank=1;
@@ -10094,7 +10389,7 @@ int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
{
if(sd == NULL || dstsd == NULL ||
sd->status.partner_id > 0 || dstsd->status.partner_id > 0 ||
- (sd->class_&JOBL_BABY) || (dstsd->class_&JOBL_BABY))
+ (sd->job & JOBL_BABY) != 0 || (dstsd->job & JOBL_BABY) != 0)
return -1;
sd->status.partner_id = dstsd->status.char_id;
dstsd->status.partner_id = sd->status.char_id;
@@ -10132,9 +10427,9 @@ int pc_divorce(struct map_session_data *sd)
for( i = 0; i < MAX_INVENTORY; i++ )
{
if( sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F )
- pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE);
if( p_sd->status.inventory[i].nameid == WEDDING_RING_M || p_sd->status.inventory[i].nameid == WEDDING_RING_F )
- pc->delitem(p_sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(p_sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE);
}
clif->divorced(sd, p_sd->status.name);
@@ -10158,7 +10453,7 @@ struct map_session_data *pc_get_partner(struct map_session_data *sd) {
* Get sd father charid. (Need to be baby)
*------------------------------------------*/
struct map_session_data *pc_get_father(struct map_session_data *sd) {
- if (sd && sd->class_&JOBL_BABY && sd->status.father > 0)
+ if (sd && (sd->job & JOBL_BABY) != 0 && sd->status.father > 0)
// charid2sd returns NULL if not found
return map->charid2sd(sd->status.father);
@@ -10169,7 +10464,7 @@ struct map_session_data *pc_get_father(struct map_session_data *sd) {
* Get sd mother charid. (Need to be baby)
*------------------------------------------*/
struct map_session_data *pc_get_mother(struct map_session_data *sd) {
- if (sd && sd->class_&JOBL_BABY && sd->status.mother > 0)
+ if (sd && (sd->job & JOBL_BABY) != 0 && sd->status.mother > 0)
// charid2sd returns NULL if not found
return map->charid2sd(sd->status.mother);
@@ -10194,6 +10489,7 @@ void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
{
int hp = 0, sp = 0;
+ nullpo_retv(sd);
if( pc_isdead(sd) )
return;
@@ -10227,6 +10523,7 @@ void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
void pc_regen (struct map_session_data *sd, unsigned int diff_tick) {
int hp = 0, sp = 0;
+ nullpo_retv(sd);
if (sd->hp_regen.value) {
sd->hp_regen.tick += diff_tick;
while (sd->hp_regen.tick >= sd->hp_regen.rate) {
@@ -10304,6 +10601,7 @@ int pc_autosave(int tid, int64 tick, int id, intptr_t data) {
}
int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap) {
+ nullpo_ret(sd);
if (sd->state.night != map->night_flag && map->list[sd->bl.m].flag.nightenabled) { //Night/day state does not match.
clif->status_change(&sd->bl, SI_SKE, map->night_flag, 0, 0, 0, 0); //New night effect by dynamix [Skotlex]
sd->state.night = map->night_flag;
@@ -10327,7 +10625,7 @@ int map_day_timer(int tid, int64 tick, int id, intptr_t data) {
map->night_flag = 0; // 0=day, 1=night [Yor]
map->foreachpc(pc->daynight_timer_sub);
safestrncpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60), sizeof(tmp_soutput)); // The day has arrived!
- intif->broadcast(tmp_soutput, strlen(tmp_soutput) + 1, BC_DEFAULT);
+ intif->broadcast(tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT);
return 0;
}
@@ -10347,7 +10645,7 @@ int map_night_timer(int tid, int64 tick, int id, intptr_t data) {
map->night_flag = 1; // 0=day, 1=night [Yor]
map->foreachpc(pc->daynight_timer_sub);
safestrncpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59), sizeof(tmp_soutput)); // The night has fallen...
- intif->broadcast(tmp_soutput, strlen(tmp_soutput) + 1, BC_DEFAULT);
+ intif->broadcast(tmp_soutput, (int)strlen(tmp_soutput) + 1, BC_DEFAULT);
return 0;
}
@@ -10368,6 +10666,7 @@ void pc_overheat(struct map_session_data *sd, int val) {
int heat = val, skill_lv,
limit[] = { 10, 20, 28, 46, 66 };
+ nullpo_retv(sd);
if( !pc_ismadogear(sd) || sd->sc.data[SC_OVERHEAT] )
return; // already burning
@@ -10393,6 +10692,7 @@ bool pc_isautolooting(struct map_session_data *sd, int nameid)
{
int i = 0;
+ nullpo_ret(sd);
if (sd->state.autoloottype && sd->state.autoloottype&(1<<itemdb_type(nameid)))
return true;
@@ -10538,11 +10838,18 @@ void pc_del_charm(struct map_session_data *sd, int count, int type)
clif->spiritcharm(sd);
}
-/*==========================================
- * Renewal EXP/Itemdrop rate modifier base on level penalty
- * 1=exp 2=itemdrop
- *------------------------------------------*/
-int pc_level_penalty_mod(int diff, unsigned char race, unsigned short mode, int type) {
+
+/**
+ * Renewal EXP/Itemdrop rate modifier base on level penalty.
+ *
+ * @param diff Level difference.
+ * @param race Monster race.
+ * @param mode Monster mode.
+ * @param type Modifier type (1=exp 2=itemdrop)
+ * @return The percent rate modifier (100 = 100%)
+ */
+int pc_level_penalty_mod(int diff, unsigned char race, uint32 mode, int type)
+{
#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
int rate = 100, i;
@@ -10574,6 +10881,7 @@ int pc_split_str(char *str,char **val,int num)
{
int i;
+ nullpo_ret(val);
for (i=0; i<num && str; i++){
val[i] = str;
str = strchr(str,',');
@@ -10586,6 +10894,7 @@ int pc_split_str(char *str,char **val,int num)
int pc_split_atoi(char* str, int* val, char sep, int max)
{
int i,j;
+ nullpo_ret(val);
for (i=0; i<max; i++) {
if (!str) break;
val[i] = atoi(str);
@@ -10603,6 +10912,7 @@ int pc_split_atoui(char* str, unsigned int* val, char sep, int max)
{
static int warning=0;
int i,j;
+ nullpo_ret(val);
for (i=0; i<max; i++) {
double f;
if (!str) break;
@@ -10642,8 +10952,8 @@ int pc_split_atoui(char* str, unsigned int* val, char sep, int max)
*/
void pc_read_skill_tree(void)
{
- config_t skill_tree_conf;
- config_setting_t *skt = NULL;
+ struct config_t skill_tree_conf;
+ struct config_setting_t *skt = NULL;
char config_filename[128];
int i = 0;
struct s_mapiterator *iter;
@@ -10651,14 +10961,12 @@ void pc_read_skill_tree(void)
bool loaded[CLASS_COUNT] = { false };
safesnprintf(config_filename, sizeof(config_filename), "%s/"DBPATH"skill_tree.conf", map->db_path);
- if (libconfig->read_file(&skill_tree_conf, config_filename)) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&skill_tree_conf, config_filename))
return;
- }
// Foreach job
while ((skt = libconfig->setting_get_elem(skill_tree_conf.root, i++))) {
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
int job_idx;
const char *job_name = config_setting_name(skt);
int job_id = pc->check_job_name(job_name);
@@ -10748,11 +11056,11 @@ void pc_read_skill_tree(void)
}
if ((t = libconfig->setting_get_member(skt, "skills")) != NULL) {
int j = 0;
- config_setting_t *sk = NULL;
+ struct config_setting_t *sk = NULL;
// Foreach skill
while ((sk = libconfig->setting_get_elem(t, j++)) != NULL) {
int skill_id, sk_idx;
- config_setting_t *rsk = NULL;
+ struct config_setting_t *rsk = NULL;
const char *sk_name = config_setting_name(sk);
struct skill_tree_entry *tree_entry = NULL;
@@ -10857,6 +11165,7 @@ bool pc_readdb_levelpenalty(char* fields[], int columns, int current) {
#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
int type, race, diff;
+ nullpo_retr(false, fields);
type = atoi(fields[0]);
race = atoi(fields[1]);
diff = atoi(fields[2]);
@@ -10907,7 +11216,7 @@ int pc_readdb(void) {
while(fgets(line, sizeof(line), fp)) {
int jobs[CLASS_COUNT], job_count, job, job_id;
int type;
- unsigned int ui,maxlv;
+ int maxlv;
char *split[4];
if(line[0]=='/' && line[1]=='/')
continue;
@@ -10929,7 +11238,7 @@ int pc_readdb(void) {
}
maxlv = atoi(split[0]);
if (maxlv > MAX_LEVEL) {
- ShowWarning("pc_readdb: Specified max level %u for job %d is beyond server's limit (%u).\n ", maxlv, job_id, MAX_LEVEL);
+ ShowWarning("pc_readdb: Specified max level %d for job %d is beyond server's limit (%d).\n ", maxlv, job_id, MAX_LEVEL);
maxlv = MAX_LEVEL;
}
count++;
@@ -10940,15 +11249,15 @@ int pc_readdb(void) {
//The reasoning behind the -2 is this... if the max level is 5, then the array
//should look like this:
//0: x, 1: x, 2: x: 3: x 4: 0 <- last valid value is at 3.
- while ((ui = pc->max_level[job][type]) >= 2 && pc->exp_table[job][type][ui-2] <= 0)
+ while ((i = pc->max_level[job][type]) >= 2 && pc->exp_table[job][type][i-2] <= 0)
pc->max_level[job][type]--;
if (pc->max_level[job][type] < maxlv) {
- ShowWarning("pc_readdb: Specified max %u for job %d, but that job's exp table only goes up to level %u.\n", maxlv, job_id, pc->max_level[job][type]);
+ ShowWarning("pc_readdb: Specified max %d for job %d, but that job's exp table only goes up to level %d.\n", maxlv, job_id, pc->max_level[job][type]);
ShowInfo("Filling the missing values with the last exp entry.\n");
//Fill the requested values with the last entry.
- ui = (pc->max_level[job][type] <= 2? 0: pc->max_level[job][type]-2);
- for (; ui+2 < maxlv; ui++)
- pc->exp_table[job][type][ui] = pc->exp_table[job][type][ui-1];
+ i = (pc->max_level[job][type] <= 2 ? 0: pc->max_level[job][type]-2);
+ for (; i+2 < maxlv; i++)
+ pc->exp_table[job][type][i] = pc->exp_table[job][type][i-1];
pc->max_level[job][type] = maxlv;
}
//ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job_id, pc->max_level[job][type]);
@@ -10961,7 +11270,7 @@ int pc_readdb(void) {
job = pc->class2idx(job_id);
memcpy(pc->exp_table[job][type], pc->exp_table[jobs[0]][type], sizeof(pc->exp_table[0][0]));
pc->max_level[job][type] = maxlv;
- //ShowDebug("%s - Class %d: %u\n", type?"Job":"Base", job_id, pc->max_level[job][type]);
+ //ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job_id, pc->max_level[job][type]);
}
}
fclose(fp);
@@ -11001,18 +11310,18 @@ int pc_readdb(void) {
ShowError("can't read %s\n", line);
return 1;
}
- while(fgets(line, sizeof(line), fp))
- {
+ while (fgets(line, sizeof(line), fp)) {
char *split[10];
int lv,n;
- if(line[0]=='/' && line[1]=='/')
+ if (line[0]=='/' && line[1]=='/')
continue;
- for(j=0,p=line;j<3 && p;j++){
- split[j]=p;
- p=strchr(p,',');
- if(p) *p++=0;
+ for (j = 0, p = line; j < 3 && p != NULL; j++) {
+ split[j] = p;
+ p = strchr(p,',');
+ if (p != NULL)
+ *p++ = 0;
}
- if( j < 2 )
+ if (j < 2)
continue;
lv=atoi(split[0]);
@@ -11024,8 +11333,8 @@ int pc_readdb(void) {
if(line[0]=='/' && line[1]=='/')
continue;
- for ( j = ELE_NEUTRAL, p = line; j<n && j<ELE_MAX && p; j++ ) {
- while(*p==32 && *p>0)
+ for (j = ELE_NEUTRAL, p = line; j < n && j < ELE_MAX && p != NULL; j++) {
+ while (*p == ' ')
p++;
battle->attr_fix_table[lv-1][i][j]=atoi(p);
#ifndef RENEWAL
@@ -11033,7 +11342,8 @@ int pc_readdb(void) {
battle->attr_fix_table[lv-1][i][j] = 0;
#endif
p=strchr(p,',');
- if(p) *p++=0;
+ if (p != NULL)
+ *p++ = 0;
}
i++;
@@ -11088,9 +11398,9 @@ void pc_validate_levels(void) {
if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER)
continue; //Classes that do not need exp tables.
j = pc->class2idx(i);
- if (!pc->max_level[j][0])
+ if (pc->max_level[j][0] == 0)
ShowWarning("Class %s (%d) does not has a base exp table.\n", pc->job_name(i), i);
- if (!pc->max_level[j][1])
+ if (pc->max_level[j][1] == 0)
ShowWarning("Class %s (%d) does not has a job exp table.\n", pc->job_name(i), i);
}
}
@@ -11099,6 +11409,7 @@ void pc_itemcd_do(struct map_session_data *sd, bool load) {
int i,cursor = 0;
struct item_cd* cd = NULL;
+ nullpo_retv(sd);
if( load ) {
if( !(cd = idb_get(pc->itemcd_db, sd->status.char_id)) ) {
// no skill cooldown is associated with this character
@@ -11130,7 +11441,10 @@ void pc_itemcd_do(struct map_session_data *sd, bool load) {
}
void pc_bank_deposit(struct map_session_data *sd, int money) {
- unsigned int limit_check = money+sd->status.bank_vault;
+ unsigned int limit_check;
+
+ nullpo_retv(sd);
+ limit_check = money + sd->status.bank_vault;
if( money <= 0 || limit_check > MAX_BANK_ZENY ) {
clif->bank_deposit(sd,BDA_OVERFLOW);
@@ -11150,8 +11464,10 @@ void pc_bank_deposit(struct map_session_data *sd, int money) {
}
}
void pc_bank_withdraw(struct map_session_data *sd, int money) {
- unsigned int limit_check = money+sd->status.zeny;
+ unsigned int limit_check;
+ nullpo_retv(sd);
+ limit_check = money + sd->status.zeny;
if (money <= 0) {
clif->bank_withdraw(sd,BWA_UNKNOWN_ERROR);
return;
@@ -11175,6 +11491,7 @@ void pc_bank_withdraw(struct map_session_data *sd, int money) {
}
/* status change data arrived from char-server */
void pc_scdata_received(struct map_session_data *sd) {
+ nullpo_retv(sd);
pc->inventory_rentals(sd);
clif->show_modifiers(sd);
@@ -11182,7 +11499,7 @@ void pc_scdata_received(struct map_session_data *sd) {
time_t exp_time = sd->expiration_time;
char tmpstr[1024];
strftime(tmpstr, sizeof(tmpstr) - 1, msg_sd(sd,501), localtime(&exp_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S."
- clif->wis_message(sd->fd, map->wisp_server_name, tmpstr, strlen(tmpstr)+1);
+ clif->wis_message(sd->fd, map->wisp_server_name, tmpstr, (int)strlen(tmpstr));
pc->expire_check(sd);
}
@@ -11223,6 +11540,7 @@ int pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
void pc_expire_check(struct map_session_data *sd) {
+ nullpo_retv(sd);
/* ongoing timer */
if( sd->expiration_tid != INVALID_TIMER )
return;
@@ -11280,6 +11598,7 @@ void pc_autotrade_start(struct map_session_data *sd) {
int i;
char *data;
+ nullpo_retv(sd);
if (SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT `itemkey`,`amount`,`price` FROM `%s` WHERE `char_id` = '%d'",map->autotrade_data_db,sd->status.char_id))
Sql_ShowDebug(map->mysql_handle);
@@ -11324,6 +11643,7 @@ void pc_autotrade_start(struct map_session_data *sd) {
void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update_action action) {
int i;
+ nullpo_retv(sd);
/* either way, this goes down */
if( action != PAUC_START ) {
if (SQL_ERROR == SQL->Query(map->mysql_handle, "DELETE FROM `%s` WHERE `char_id` = '%d'",map->autotrade_data_db,sd->status.char_id))
@@ -11349,13 +11669,13 @@ void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update
))
Sql_ShowDebug(map->mysql_handle);
}
- /* yes we want it to fall */
+ FALLTHROUGH
case PAUC_REFRESH:
for( i = 0; i < sd->vend_num; i++ ) {
if( sd->vending[i].amount == 0 )
continue;
- if (SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s` (`char_id`,`itemkey`,`amount`,`price`) VALUES ('%d','%d','%d','%d')",
+ if (SQL_ERROR == SQL->Query(map->mysql_handle, "INSERT INTO `%s` (`char_id`,`itemkey`,`amount`,`price`) VALUES ('%d','%d','%d','%u')",
map->autotrade_data_db,
sd->status.char_id,
sd->status.cart[sd->vending[i].index].id,
@@ -11377,6 +11697,7 @@ void pc_autotrade_prepare(struct map_session_data *sd) {
char title[MESSAGE_SIZE];
unsigned char sex;
+ nullpo_retv(sd);
CREATE(data, struct autotrade_vending, 1);
memcpy(data->vending, sd->vending, sizeof(sd->vending));
@@ -11423,6 +11744,7 @@ void pc_autotrade_populate(struct map_session_data *sd) {
struct autotrade_vending *data;
int i, j, k, cursor = 0;
+ nullpo_retv(sd);
if( !(data = idb_get(pc->at_db,sd->status.char_id)) )
return;
@@ -11462,8 +11784,10 @@ void pc_autotrade_populate(struct map_session_data *sd) {
/**
* @see DBApply
*/
-int pc_autotrade_final(DBKey key, DBData *data, va_list ap) {
+int pc_autotrade_final(union DBKey key, struct DBData *data, va_list ap)
+{
struct autotrade_vending* at_v = DB->data2ptr(data);
+ nullpo_ret(at_v);
HPM->data_store_destroy(&at_v->hdata);
return 0;
}
@@ -11476,16 +11800,17 @@ void pc_update_idle_time(struct map_session_data* sd, enum e_battle_config_idlet
}
//Checks if the given class value corresponds to a player class. [Skotlex]
-//JOB_NOVICE isn't checked for class_ is supposed to be unsigned
-bool pc_db_checkid(unsigned int class_)
+//JOB_NOVICE isn't checked for class is supposed to be unsigned
+bool pc_db_checkid(int class)
{
- return class_ < JOB_MAX_BASIC
- || (class_ >= JOB_NOVICE_HIGH && class_ <= JOB_DARK_COLLECTOR )
- || (class_ >= JOB_RUNE_KNIGHT && class_ <= JOB_MECHANIC_T2 )
- || (class_ >= JOB_BABY_RUNE && class_ <= JOB_BABY_MECHANIC2 )
- || (class_ >= JOB_SUPER_NOVICE_E && class_ <= JOB_SUPER_BABY_E )
- || (class_ >= JOB_KAGEROU && class_ <= JOB_OBORO )
- || (class_ >= JOB_REBELLION && class_ < JOB_MAX );
+ return class < JOB_MAX_BASIC
+ || (class >= JOB_NOVICE_HIGH && class <= JOB_DARK_COLLECTOR )
+ || (class >= JOB_RUNE_KNIGHT && class <= JOB_MECHANIC_T2 )
+ || (class >= JOB_BABY_RUNE && class <= JOB_BABY_MECHANIC2 )
+ || (class >= JOB_SUPER_NOVICE_E && class <= JOB_SUPER_BABY_E )
+ || (class >= JOB_KAGEROU && class <= JOB_OBORO )
+ || (class == JOB_REBELLION)
+ || (class >= JOB_SUMMONER && class < JOB_MAX );
}
/**
@@ -11496,12 +11821,108 @@ bool pc_db_checkid(unsigned int class_)
int pc_have_magnifier(struct map_session_data *sd)
{
int n;
- n = pc->search_inventory(sd, ITEMID_MAGNIFIER);
+ n = pc->search_inventory(sd, ITEMID_SPECTACLES);
if (n == INDEX_NOT_FOUND)
- n = pc->search_inventory(sd, ITEMID_NOVICE_MAGNIFIER);
+ n = pc->search_inventory(sd, ITEMID_N_MAGNIFIER);
return n;
}
+/**
+ * Checks if player have basic skills learned.
+ * @param sd Player Data
+ * @param level Required Level of Novice Skill
+ * @return bool true, if requirement is satisfied
+ */
+bool pc_check_basicskill(struct map_session_data *sd, int level) {
+ if (pc->checkskill(sd, NV_BASIC) >= level || pc->checkskill(sd, SU_BASIC_SKILL))
+ return true;
+ return false;
+}
+
+/**
+ * Verifies a chat message, searching for atcommands, checking if the sender
+ * character can chat, and updating the idle timer.
+ *
+ * @param sd The sender character.
+ * @param message The message text.
+ * @return Whether the message is a valid chat message.
+ */
+bool pc_process_chat_message(struct map_session_data *sd, const char *message)
+{
+ nullpo_retr(false, sd);
+ if (atcommand->exec(sd->fd, sd, message, true)) {
+ return false;
+ }
+
+ if (!pc->can_talk(sd)) {
+ return false;
+ }
+
+ if (battle_config.min_chat_delay != 0) {
+ if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0) {
+ return false;
+ }
+ sd->cantalk_tick = timer->gettick() + battle_config.min_chat_delay;
+ }
+
+ pc->update_idle_time(sd, BCIDLE_CHAT);
+
+ return true;
+}
+
+/**
+ * Checks a chat message, scanning for the Super Novice prayer sequence.
+ *
+ * If a match is found, the angel is invoked or the counter is incremented as
+ * appropriate.
+ *
+ * @param sd The sender character.
+ * @param message The message text.
+ */
+void pc_check_supernovice_call(struct map_session_data *sd, const char *message)
+{
+ unsigned int next = pc->nextbaseexp(sd);
+ int percent = 0;
+
+ nullpo_retv(sd);
+ nullpo_retv(message);
+ if ((sd->job & MAPID_UPPERMASK) != MAPID_SUPER_NOVICE)
+ return;
+ if (next == 0)
+ next = pc->thisbaseexp(sd);
+ if (next == 0)
+ return;
+
+ // 0%, 10%, 20%, ...
+ percent = (int)( ( (float)sd->status.base_exp/(float)next )*1000. );
+ if ((battle_config.snovice_call_type != 0 || percent != 0) && (percent%100) == 0) {
+ // 10.0%, 20.0%, ..., 90.0%
+ switch (sd->state.snovice_call_flag) {
+ case 0:
+ if (strstr(message, msg_txt(1479))) // "Dear angel, can you hear my voice?"
+ sd->state.snovice_call_flag = 1;
+ break;
+ case 1:
+ {
+ char buf[256];
+ snprintf(buf, 256, msg_txt(1480), sd->status.name);
+ if (strstr(message, buf)) // "I am %s Super Novice~"
+ sd->state.snovice_call_flag = 2;
+ }
+ break;
+ case 2:
+ if (strstr(message, msg_txt(1481))) // "Help me out~ Please~ T_T"
+ sd->state.snovice_call_flag = 3;
+ break;
+ case 3:
+ sc_start(NULL, &sd->bl, status->skill2sc(MO_EXPLOSIONSPIRITS), 100, 17, skill->get_time(MO_EXPLOSIONSPIRITS, 5)); //Lv17-> +50 critical (noted by Poki) [Skotlex]
+ clif->skill_nodamage(&sd->bl, &sd->bl, MO_EXPLOSIONSPIRITS, 5, 1); // prayer always shows successful Lv5 cast and disregards noskill restrictions
+ sd->state.snovice_call_flag = 0;
+ break;
+ }
+ }
+}
+
void do_final_pc(void) {
db_destroy(pc->itemcd_db);
pc->at_db->destroy(pc->at_db,pc->autotrade_final);
@@ -11785,7 +12206,8 @@ void pc_defaults(void) {
pc->addspiritball = pc_addspiritball;
pc->delspiritball = pc_delspiritball;
pc->addfame = pc_addfame;
- pc->famerank = pc_famerank;
+ pc->fame_rank = pc_fame_rank;
+ pc->famelist_type = pc_famelist_type;
pc->set_hate_mob = pc_set_hate_mob;
pc->getmaxspiritball = pc_getmaxspiritball;
@@ -11857,6 +12279,9 @@ void pc_defaults(void) {
pc->db_checkid = pc_db_checkid;
pc->validate_levels = pc_validate_levels;
+ pc->check_supernovice_call = pc_check_supernovice_call;
+ pc->process_chat_message = pc_process_chat_message;
+
/**
* Autotrade persistency [Ind/Hercules <3]
**/
@@ -11869,6 +12294,8 @@ void pc_defaults(void) {
pc->check_job_name = pc_check_job_name;
pc->update_idle_time = pc_update_idle_time;
-
+
pc->have_magnifier = pc_have_magnifier;
+
+ pc->check_basicskill = pc_check_basicskill;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index 06bc5e5ae..af52f8946 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -33,8 +33,9 @@
#include "map/status.h" // enum sc_type, OPTION_*
#include "map/unit.h" // struct unit_data, struct view_data
#include "map/vending.h" // struct s_vending
-#include "common/hercules.h"
+#include "common/db.h"
#include "common/ers.h" // struct eri
+#include "common/hercules.h"
#include "common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus, NEW_CARTS
/**
@@ -72,6 +73,14 @@ enum equip_index {
EQI_MAX
};
+enum prevent_logout_trigger {
+ PLT_NONE = 0x0,
+ PLT_LOGIN = 0x1,
+ PLT_ATTACK = 0x2,
+ PLT_SKILL = 0x4,
+ PLT_DAMAGE = 0x8
+};
+
enum pc_unequipitem_flag {
PCUNEQUIPITEM_NONE = 0x0, ///< Just unequip
PCUNEQUIPITEM_RECALC = 0x1, ///< Recalculate status after unequipping
@@ -85,6 +94,14 @@ enum pc_resetskill_flag {
PCRESETSKILL_CHSEX = 0x4, // just reset the skills if the player class is a bard/dancer type (for changesex.)
};
+enum pc_checkitem_types {
+ PCCHECKITEM_NONE = 0x0,
+ PCCHECKITEM_INVENTORY = 0x1,
+ PCCHECKITEM_CART = 0x2,
+ PCCHECKITEM_STORAGE = 0x4,
+ PCCHECKITEM_GSTORAGE = 0x8
+};
+
struct weapon_data {
int atkmods[3];
BEGIN_ZEROED_BLOCK; // all the variables within this block get zero'ed in each call of status_calc_pc
@@ -216,7 +233,6 @@ struct map_session_data {
unsigned int hold_recalc : 1;
unsigned int snovice_call_flag : 3; //Summon Angel (stage 1~3)
unsigned int hpmeter_visible : 1;
- unsigned int itemcheck : 1;
unsigned int standalone : 1;/* [Ind/Hercules <3] */
unsigned int loggingout : 1;
unsigned int warp_clean : 1;
@@ -234,7 +250,7 @@ struct map_session_data {
unsigned int bonus_coma : 1;
} special_state;
int login_id1, login_id2;
- unsigned short class_; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
+ uint16 job; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
/// Groups & permissions
int group_id;
@@ -242,7 +258,9 @@ struct map_session_data {
unsigned int extra_temp_permissions; /* permissions from @addperm */
struct mmo_charstatus status;
- struct item_data* inventory_data[MAX_INVENTORY]; // direct pointers to itemdb entries (faster than doing item_id lookups)
+ struct item_data *inventory_data[MAX_INVENTORY]; // direct pointers to itemdb entries (faster than doing item_id lookups)
+ struct storage_data storage; ///< Account Storage
+ enum pc_checkitem_types itemcheck;
short equip_index[EQI_MAX];
unsigned int weight,max_weight;
int cart_weight,cart_num,cart_weight_max;
@@ -257,7 +275,7 @@ struct map_session_data {
struct script_state *st;
char npc_str[CHATBOX_SIZE]; // for passing npc input box text to script engine
int npc_timer_id; //For player attached npc timers. [Skotlex]
- unsigned int chatID;
+ int chat_id;
int64 idletime;
struct {
int npc_id;
@@ -302,8 +320,8 @@ BEGIN_ZEROED_BLOCK; // this block will be globally zeroed at the beginning of st
int reseff[SC_COMMON_MAX-SC_COMMON_MIN+1];
int weapon_coma_ele[ELE_MAX];
int weapon_coma_race[RC_MAX];
- int weapon_atk[16];
- int weapon_atk_rate[16];
+ int weapon_atk[MAX_WEAPON_TYPE];
+ int weapon_atk_rate[MAX_WEAPON_TYPE];
int arrow_addele[ELE_MAX];
int arrow_addrace[RC_MAX];
int arrow_addsize[3];
@@ -455,8 +473,8 @@ END_ZEROED_BLOCK;
int eventtimer[MAX_EVENTTIMER];
unsigned short eventcount; // [celest]
- unsigned char change_level_2nd; // job level when changing from 1st to 2nd class [jobchange_level in global_reg_value]
- unsigned char change_level_3rd; // job level when changing from 2nd to 3rd class [jobchange_level_3rd in global_reg_value]
+ int change_level_2nd; // job level when changing from 1st to 2nd class [jobchange_level in global_reg_value]
+ int change_level_3rd; // job level when changing from 2nd to 3rd class [jobchange_level_3rd in global_reg_value]
char fakename[NAME_LENGTH]; // fake names [Valaris]
@@ -530,7 +548,7 @@ END_ZEROED_BLOCK;
unsigned char channel_count;
struct channel_data *gcbind;
unsigned char fontcolor;
- unsigned int fontcolor_tid;
+ int fontcolor_tid;
int64 hchsysch_tick;
/* [Ind/Hercules] */
@@ -563,7 +581,7 @@ END_ZEROED_BLOCK;
/* */
struct {
- unsigned int second,third;
+ int second, third;
} sktree;
/**
@@ -609,15 +627,15 @@ END_ZEROED_BLOCK;
#define pc_setsit(sd) ( (sd)->state.dead_sit = (sd)->vd.dead_sit = 2 )
#define pc_isdead(sd) ( (sd)->state.dead_sit == 1 )
#define pc_issit(sd) ( (sd)->vd.dead_sit == 2 )
-#define pc_isidle(sd) ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share )
+#define pc_isidle(sd) ( (sd)->chat_id != 0 || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share )
#define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading )
-#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
+#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
/* equals pc_cant_act except it doesn't check for chat rooms */
#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend )
#define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) )
-#define pc_setchatid(sd,n) ( (sd)->chatID = n )
+#define pc_setchatid(sd,n) ( (sd)->chat_id = (n) )
#define pc_ishiding(sd) ( (sd)->sc.option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) )
#define pc_iscloaking(sd) ( !((sd)->sc.option&OPTION_CHASEWALK) && ((sd)->sc.option&OPTION_CLOAK) )
#define pc_ischasewalk(sd) ( (sd)->sc.option&OPTION_CHASEWALK )
@@ -634,12 +652,13 @@ END_ZEROED_BLOCK;
#define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle->bc->natural_heal_weight_rate )
#define pc_is90overweight(sd) ( (sd)->weight*10 >= (sd)->max_weight*9 )
#define pc_maxparameter(sd) ( \
- ( ((sd)->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO \
- || ((sd)->class_&MAPID_UPPERMASK) == MAPID_REBELLION \
- || ((sd)->class_&MAPID_THIRDMASK) == MAPID_SUPER_NOVICE_E \
- ) ? battle->bc->max_extended_parameter : ((sd)->class_&JOBL_THIRD) ? \
- (((sd)->class_&JOBL_BABY) ? battle->bc->max_baby_third_parameter : battle->bc->max_third_parameter ) : \
- (((sd)->class_&JOBL_BABY) ? battle->bc->max_baby_parameter : battle->bc->max_parameter) \
+ ((sd)->job & MAPID_BASEMASK) == MAPID_SUMMONER ? battle->bc->max_summoner_parameter : \
+ ( ((sd)->job & MAPID_UPPERMASK) == MAPID_KAGEROUOBORO \
+ || ((sd)->job & MAPID_UPPERMASK) == MAPID_REBELLION \
+ || ((sd)->job & MAPID_THIRDMASK) == MAPID_SUPER_NOVICE_E \
+ ) ? battle->bc->max_extended_parameter : ((sd)->job & JOBL_THIRD) ? \
+ (((sd)->job & JOBL_BABY) ? battle->bc->max_baby_third_parameter : battle->bc->max_third_parameter ) : \
+ (((sd)->job & JOBL_BABY) ? battle->bc->max_baby_parameter : battle->bc->max_parameter) \
)
/// Generic check for mounts
#define pc_hasmount(sd) ( (sd)->sc.option&(OPTION_RIDING|OPTION_WUGRIDER|OPTION_DRAGON|OPTION_MADOGEAR) )
@@ -657,7 +676,7 @@ END_ZEROED_BLOCK;
#define pc_stop_attack(sd) (unit->stop_attack(&(sd)->bl))
//Weapon check considering dual wielding.
-#define pc_check_weapontype(sd, type) ((type)&((sd)->status.weapon < MAX_WEAPON_TYPE? \
+#define pc_check_weapontype(sd, type) ((type)&((sd)->status.weapon < MAX_SINGLE_WEAPON_TYPE? \
1<<(sd)->status.weapon:(1<<(sd)->weapontype1)|(1<<(sd)->weapontype2)|(1<<(sd)->status.weapon)))
// clientside display macros (values to the left/right of the "+")
@@ -784,9 +803,9 @@ struct autotrade_vending {
struct pc_interface {
/* */
- DBMap *at_db;/* char id -> struct autotrade_vending */
+ struct DBMap *at_db;/* char id -> struct autotrade_vending */
/* */
- DBMap* itemcd_db;
+ struct DBMap *itemcd_db;
/* */
int day_timer_tid;
int night_timer_tid;
@@ -794,7 +813,7 @@ struct pc_interface {
BEGIN_ZEROED_BLOCK; /* Everything within this block will be memset to 0 when status_defaults() is executed */
unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
- unsigned int max_level[CLASS_COUNT][2];
+ int max_level[CLASS_COUNT][2];
unsigned int statp[MAX_LEVEL+1];
unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1];
/* */
@@ -822,7 +841,7 @@ END_ZEROED_BLOCK; /* End */
void (*final) (void);
struct map_session_data* (*get_dummy_sd) (void);
- int (*class2idx) (int class_);
+ int (*class2idx) (int class);
bool (*can_talk) (struct map_session_data *sd);
bool (*can_attack) ( struct map_session_data *sd, int target_id );
@@ -834,7 +853,7 @@ END_ZEROED_BLOCK; /* End */
int (*makesavestatus) (struct map_session_data *sd);
void (*respawn) (struct map_session_data* sd, clr_type clrtype);
int (*setnewpc) (struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd);
- bool (*authok) (struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers);
+ bool (*authok) (struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers);
void (*authfail) (struct map_session_data *sd);
int (*reg_received) (struct map_session_data *sd);
@@ -900,7 +919,7 @@ END_ZEROED_BLOCK; /* End */
bool (*can_insert_card_into) (struct map_session_data* sd, int idx_card, int idx_equip);
int (*steal_item) (struct map_session_data *sd,struct block_list *bl, uint16 skill_lv);
- int (*steal_coin) (struct map_session_data *sd,struct block_list *bl);
+ int (*steal_coin) (struct map_session_data *sd,struct block_list *bl, uint16 skill_lv);
int (*modifybuyvalue) (struct map_session_data *sd,int orig_value);
int (*modifysellvalue) (struct map_session_data *sd,int orig_value);
@@ -908,15 +927,15 @@ END_ZEROED_BLOCK; /* End */
int (*follow) (struct map_session_data *sd, int target_id); // [MouseJstr]
int (*stop_following) (struct map_session_data *sd);
- unsigned int (*maxbaselv) (struct map_session_data *sd);
- unsigned int (*maxjoblv) (struct map_session_data *sd);
+ int (*maxbaselv) (const struct map_session_data *sd);
+ int (*maxjoblv) (const struct map_session_data *sd);
int (*checkbaselevelup) (struct map_session_data *sd);
int (*checkjoblevelup) (struct map_session_data *sd);
bool (*gainexp) (struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest);
- unsigned int (*nextbaseexp) (struct map_session_data *sd);
- unsigned int (*thisbaseexp) (struct map_session_data *sd);
- unsigned int (*nextjobexp) (struct map_session_data *sd);
- unsigned int (*thisjobexp) (struct map_session_data *sd);
+ unsigned int (*nextbaseexp) (const struct map_session_data *sd);
+ unsigned int (*thisbaseexp) (const struct map_session_data *sd);
+ unsigned int (*nextjobexp) (const struct map_session_data *sd);
+ unsigned int (*thisjobexp) (const struct map_session_data *sd);
int (*gets_status_point) (int level);
int (*need_status_point) (struct map_session_data *sd,int type,int val);
int (*maxparameterincrease) (struct map_session_data* sd, int type);
@@ -946,7 +965,7 @@ END_ZEROED_BLOCK; /* End */
void (*heal) (struct map_session_data *sd,unsigned int hp,unsigned int sp, int type);
int (*itemheal) (struct map_session_data *sd,int itemid, int hp,int sp);
int (*percentheal) (struct map_session_data *sd,int hp,int sp);
- int (*jobchange) (struct map_session_data *sd,int job, int upper);
+ int (*jobchange) (struct map_session_data *sd, int class, int upper);
int (*setoption) (struct map_session_data *sd,int type);
int (*setcart) (struct map_session_data* sd, int type);
void (*setfalcon) (struct map_session_data *sd, bool flag);
@@ -957,7 +976,7 @@ END_ZEROED_BLOCK; /* End */
int (*changelook) (struct map_session_data *sd,int type,int val);
int (*equiplookall) (struct map_session_data *sd);
- int (*readparam) (struct map_session_data *sd,int type);
+ int (*readparam) (const struct map_session_data *sd, int type);
int (*setparam) (struct map_session_data *sd,int type,int val);
int (*readreg) (struct map_session_data *sd, int64 reg);
void (*setreg) (struct map_session_data *sd, int64 reg,int val);
@@ -990,10 +1009,10 @@ END_ZEROED_BLOCK; /* End */
void (*setstand) (struct map_session_data *sd);
int (*candrop) (struct map_session_data *sd,struct item *item);
- int (*jobid2mapid) (unsigned short b_class); // Skotlex
+ int (*jobid2mapid) (int16 class); // Skotlex
int (*mapid2jobid) (unsigned short class_, int sex); // Skotlex
- const char * (*job_name) (int class_);
+ const char * (*job_name) (int class);
void (*setinvincibletimer) (struct map_session_data* sd, int val);
void (*delinvincibletimer) (struct map_session_data* sd);
@@ -1001,8 +1020,9 @@ END_ZEROED_BLOCK; /* End */
int (*addspiritball) (struct map_session_data *sd,int interval,int max);
int (*delspiritball) (struct map_session_data *sd,int count,int type);
int (*getmaxspiritball) (struct map_session_data *sd, int min);
- void (*addfame) (struct map_session_data *sd,int count);
- unsigned char (*famerank) (int char_id, int job);
+ void (*addfame) (struct map_session_data *sd, int ranktype, int count);
+ int (*fame_rank) (int char_id, int ranktype);
+ int (*famelist_type) (uint16 job_mapid);
int (*set_hate_mob) (struct map_session_data *sd, int pos, struct block_list *bl);
int (*readdb) (void);
@@ -1013,7 +1033,7 @@ END_ZEROED_BLOCK; /* End */
int (*inventory_rental_clear) (struct map_session_data *sd);
void (*inventory_rental_add) (struct map_session_data *sd, int seconds);
- int (*disguise) (struct map_session_data *sd, int class_);
+ int (*disguise) (struct map_session_data *sd, int class);
bool (*isautolooting) (struct map_session_data *sd, int nameid);
void (*overheat) (struct map_session_data *sd, int val);
@@ -1028,7 +1048,7 @@ END_ZEROED_BLOCK; /* End */
void (*del_charm) (struct map_session_data *sd, int count, int type);
void (*baselevelchanged) (struct map_session_data *sd);
- int (*level_penalty_mod) (int diff, unsigned char race, unsigned short mode, int type);
+ int (*level_penalty_mod) (int diff, unsigned char race, uint32 mode, int type);
int (*calc_skillpoint) (struct map_session_data* sd);
int (*invincible_timer) (int tid, int64 tick, int id, intptr_t data);
@@ -1072,7 +1092,7 @@ END_ZEROED_BLOCK; /* End */
int (*global_expiration_timer) (int tid, int64 tick, int id, intptr_t data);
void (*expire_check) (struct map_session_data *sd);
- bool (*db_checkid) (unsigned int class_);
+ bool (*db_checkid) (int class);
void (*validate_levels) (void);
@@ -1084,12 +1104,16 @@ END_ZEROED_BLOCK; /* End */
void (*autotrade_start) (struct map_session_data *sd);
void (*autotrade_prepare) (struct map_session_data *sd);
void (*autotrade_populate) (struct map_session_data *sd);
- int (*autotrade_final) (DBKey key, DBData *data, va_list ap);
+ int (*autotrade_final) (union DBKey key, struct DBData *data, va_list ap);
int (*check_job_name) (const char *name);
void (*update_idle_time) (struct map_session_data* sd, enum e_battle_config_idletime type);
-
+
int (*have_magnifier) (struct map_session_data *sd);
+
+ bool (*process_chat_message) (struct map_session_data *sd, const char *message);
+ void (*check_supernovice_call) (struct map_session_data *sd, const char *message);
+ bool (*check_basicskill) (struct map_session_data *sd, int level);
};
#ifdef HERCULES_CORE
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index bd46b9616..9645300ef 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -63,19 +63,19 @@ static inline GroupSettings* name2group(const char* group_name)
* @private
*/
static void read_config(void) {
- config_t pc_group_config;
- config_setting_t *groups = NULL;
+ struct config_t pc_group_config;
+ struct config_setting_t *groups = NULL;
const char *config_filename = "conf/groups.conf"; // FIXME hardcoded name
int group_count = 0;
- if (libconfig->read_file(&pc_group_config, config_filename))
+ if (!libconfig->load_file(&pc_group_config, config_filename))
return;
groups = libconfig->lookup(&pc_group_config, "groups");
if (groups != NULL) {
GroupSettings *group_settings = NULL;
- DBIterator *iter = NULL;
+ struct DBIterator *iter = NULL;
int i, loop = 0;
group_count = libconfig->setting_length(groups);
@@ -83,7 +83,7 @@ static void read_config(void) {
int id = 0, level = 0;
const char *groupname = NULL;
int log_commands = 0;
- config_setting_t *group = libconfig->setting_get_elem(groups, i);
+ struct config_setting_t *group = libconfig->setting_get_elem(groups, i);
if (!libconfig->setting_lookup_int(group, "id", &id)) {
ShowConfigWarning(group, "pc_groups:read_config: \"groups\" list member #%d has undefined id, removing...", i);
@@ -106,11 +106,11 @@ static void read_config(void) {
if (!libconfig->setting_lookup_string(group, "name", &groupname)) {
char temp[20];
- config_setting_t *name = NULL;
+ struct config_setting_t *name = NULL;
snprintf(temp, sizeof(temp), "Group %d", id);
if ((name = config_setting_add(group, "name", CONFIG_TYPE_STRING)) == NULL ||
!config_setting_set_string(name, temp)) {
- ShowError("pc_groups:read_config: failed to set missing group name, id=%d, skipping... (%s:%d)\n",
+ ShowError("pc_groups:read_config: failed to set missing group name, id=%d, skipping... (%s:%u)\n",
id, config_setting_source_file(group), config_setting_source_line(group));
--i;
--group_count;
@@ -148,7 +148,7 @@ static void read_config(void) {
// Check if all commands and permissions exist
iter = db_iterator(pcg->db);
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
- config_setting_t *commands = group_settings->commands, *permissions = group_settings->permissions;
+ struct config_setting_t *commands = group_settings->commands, *permissions = group_settings->permissions;
int count = 0;
// Make sure there is "commands" group
@@ -157,7 +157,7 @@ static void read_config(void) {
count = libconfig->setting_length(commands);
for (i = 0; i < count; ++i) {
- config_setting_t *command = libconfig->setting_get_elem(commands, i);
+ struct config_setting_t *command = libconfig->setting_get_elem(commands, i);
const char *name = config_setting_name(command);
if (!atcommand->exists(name)) {
ShowConfigWarning(command, "pc_groups:read_config: non-existent command name '%s', removing...", name);
@@ -173,7 +173,7 @@ static void read_config(void) {
count = libconfig->setting_length(permissions);
for(i = 0; i < count; ++i) {
- config_setting_t *permission = libconfig->setting_get_elem(permissions, i);
+ struct config_setting_t *permission = libconfig->setting_get_elem(permissions, i);
const char *name = config_setting_name(permission);
int j;
@@ -193,7 +193,7 @@ static void read_config(void) {
while (i < group_count) {
iter = db_iterator(pcg->db);
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
- config_setting_t *inherit = NULL,
+ struct config_setting_t *inherit = NULL,
*commands = group_settings->commands,
*permissions = group_settings->permissions;
int j, inherit_count = 0, done = 0;
@@ -258,11 +258,11 @@ static void read_config(void) {
// Pack permissions into GroupSettings.e_permissions for faster checking
iter = db_iterator(pcg->db);
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
- config_setting_t *permissions = group_settings->permissions;
+ struct config_setting_t *permissions = group_settings->permissions;
int count = libconfig->setting_length(permissions);
for (i = 0; i < count; ++i) {
- config_setting_t *perm = libconfig->setting_get_elem(permissions, i);
+ struct config_setting_t *perm = libconfig->setting_get_elem(permissions, i);
const char *name = config_setting_name(perm);
int val = libconfig->setting_get_bool(perm);
int j;
@@ -280,9 +280,9 @@ static void read_config(void) {
// to atcommand->load_group() for processing.
if (group_count > 0) {
GroupSettings **pc_groups = NULL;
- config_setting_t **commands = NULL;
+ struct config_setting_t **commands = NULL;
CREATE(pc_groups, GroupSettings*, group_count);
- CREATE(commands, config_setting_t*, group_count);
+ CREATE(commands, struct config_setting_t*, group_count);
i = 0;
iter = db_iterator(pcg->db);
for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) {
@@ -310,6 +310,7 @@ static void read_config(void) {
*/
bool pc_group_has_permission(GroupSettings *group, unsigned int permission)
{
+ nullpo_retr(false, group);
return ((group->e_permissions&permission) != 0);
}
@@ -319,6 +320,7 @@ bool pc_group_has_permission(GroupSettings *group, unsigned int permission)
*/
bool pc_group_should_log_commands(GroupSettings *group)
{
+ nullpo_retr(true, group);
return group->log_commands;
}
@@ -348,6 +350,7 @@ GroupSettings* pc_group_id2group(int group_id)
*/
const char* pc_group_get_name(GroupSettings *group)
{
+ nullpo_retr(NULL, group);
return group->name;
}
@@ -359,6 +362,7 @@ const char* pc_group_get_name(GroupSettings *group)
*/
int pc_group_get_level(GroupSettings *group)
{
+ nullpo_ret(group);
return group->level;
}
@@ -370,6 +374,7 @@ int pc_group_get_level(GroupSettings *group)
*/
int pc_group_get_idx(GroupSettings *group)
{
+ nullpo_ret(group);
return group->index;
}
@@ -380,6 +385,7 @@ int pc_group_get_idx(GroupSettings *group)
unsigned int pc_groups_add_permission(const char *name) {
uint64 key = 0x1;
unsigned char i;
+ nullpo_ret(name);
for(i = 0; i < pcg->permission_count; i++) {
if( strcmpi(name,pcg->permissions[i].name) == 0 ) {
@@ -446,7 +452,7 @@ void do_init_pc_groups(void) {
for(i = 0; i < len; i++) {
unsigned int p;
if( ( p = pc_groups_add_permission(pc_g_defaults[i].name) ) != pc_g_defaults[i].permission )
- ShowError("do_init_pc_groups: %s error : %d != %d\n",pc_g_defaults[i].name,p,pc_g_defaults[i].permission);
+ ShowError("do_init_pc_groups: %s error : %u != %u\n", pc_g_defaults[i].name, p, pc_g_defaults[i].permission);
}
/**
@@ -465,9 +471,10 @@ void do_init_pc_groups(void) {
/**
* @see DBApply
*/
-static int group_db_clear_sub(DBKey key, DBData *data, va_list args)
+static int group_db_clear_sub(union DBKey key, struct DBData *data, va_list args)
{
GroupSettings *group = DB->data2ptr(data);
+ nullpo_ret(group);
if (group->name)
aFree(group->name);
return 0;
diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
index 62704fb12..7c933f054 100644
--- a/src/map/pc_groups.h
+++ b/src/map/pc_groups.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,8 +22,10 @@
#define MAP_PC_GROUPS_H
#include "common/hercules.h"
-#include "common/conf.h"
-#include "common/db.h"
+
+/* Forward Declarations */
+struct DBMap; // common/db.h
+struct config_setting_t;
/// PC permissions
enum e_pc_permission {
@@ -66,11 +68,11 @@ struct GroupSettings {
bool log_commands; // groups.[].log_commands
int index; // internal index of the group (contiguous range starting at 0) [Ind]
/// Following are used/available only during config reading
- config_setting_t *commands; // groups.[].commands
- config_setting_t *permissions; // groups.[].permissions
- config_setting_t *inherit; // groups.[].inherit
+ struct config_setting_t *commands; // groups.[].commands
+ struct config_setting_t *permissions; // groups.[].permissions
+ struct config_setting_t *inherit; // groups.[].inherit
bool inheritance_done; // have all inheritance rules been evaluated?
- config_setting_t *root; // groups.[]
+ struct config_setting_t *root; // groups.[]
};
typedef struct GroupSettings GroupSettings;
@@ -89,8 +91,8 @@ struct pc_groups_new_permission {
struct pc_groups_interface {
/* */
- DBMap* db; // id -> GroupSettings
- DBMap* name_db; // name -> GroupSettings
+ struct DBMap *db; // id -> GroupSettings
+ struct DBMap *name_db; // name -> GroupSettings
/* */
struct pc_groups_permission_table *permissions;
unsigned char permission_count;
diff --git a/src/map/pet.c b/src/map/pet.c
index c6f7e8cca..9ac496659 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -91,6 +91,7 @@ void pet_set_intimate(struct pet_data *pd, int value)
int pet_create_egg(struct map_session_data *sd, int item_id)
{
int pet_id = pet->search_petDB_index(item_id, PET_EGG);
+ nullpo_ret(sd);
if (pet_id < 0) return 0; //No pet egg here.
if (!pc->inventoryblank(sd)) return 0; // Inventory full
sd->catch_target_class = pet->db[pet_id].class_;
@@ -117,6 +118,7 @@ int pet_unlocktarget(struct pet_data *pd)
* Pet Attack Skill [Skotlex]
*------------------------------------------*/
int pet_attackskill(struct pet_data *pd, int target_id) {
+ nullpo_ret(pd);
if (!battle_config.pet_status_support || !pd->a_skill ||
(battle_config.pet_equip_required && !pd->pet.equip))
return 0;
@@ -148,6 +150,7 @@ int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type)
struct pet_data *pd;
int rate;
+ nullpo_ret(sd);
pd = sd->pd;
Assert_ret(pd->msd == 0 || pd->msd->pd == pd);
@@ -291,6 +294,7 @@ int pet_performance(struct map_session_data *sd, struct pet_data *pd)
{
int val;
+ nullpo_retr(1, pd);
if (pd->pet.intimate > 900)
val = (pd->petDB->s_perfor > 0)? 4:3;
else if(pd->pet.intimate > 750) //TODO: this is way too high
@@ -309,6 +313,8 @@ int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
struct item tmp_item;
int flag;
+ nullpo_retr(1, sd);
+ nullpo_retr(1, pd);
pet->lootitem_drop(pd,sd);
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = pd->petDB->EggID;
@@ -317,7 +323,7 @@ int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
tmp_item.card[1] = GetWord(pd->pet.pet_id,0);
tmp_item.card[2] = GetWord(pd->pet.pet_id,1);
tmp_item.card[3] = pd->pet.rename_flag;
- if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
+ if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_EGG))) {
clif->additem(sd,0,0,flag);
map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
@@ -336,6 +342,7 @@ int pet_data_init(struct map_session_data *sd, struct s_pet *petinfo)
int i=0,interval=0;
nullpo_retr(1, sd);
+ nullpo_retr(1, petinfo);
Assert_retr(1, sd->status.pet_id == 0 || sd->pd == 0 || sd->pd->msd == sd);
if(sd->status.account_id != petinfo->account_id || sd->status.char_id != petinfo->char_id) {
@@ -407,6 +414,7 @@ int pet_data_init(struct map_session_data *sd, struct s_pet *petinfo)
int pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo)
{
nullpo_retr(1, sd);
+ nullpo_retr(1, petinfo);
Assert_retr(1, sd->status.pet_id == 0 || sd->pd == 0 || sd->pd->msd == sd);
if(sd->status.pet_id && petinfo->incubate == 1) {
@@ -443,6 +451,7 @@ int pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo)
int pet_recv_petdata(int account_id,struct s_pet *p,int flag) {
struct map_session_data *sd;
+ nullpo_retr(1, p);
sd = map->id2sd(account_id);
if(sd == NULL)
return 1;
@@ -464,7 +473,7 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag) {
return 1;
}
if (!pet->birth_process(sd,p)) //Pet hatched. Delete egg.
- pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_EGG);
} else {
pet->data_init(sd,p);
if(sd->pd && sd->bl.prev != NULL) {
@@ -646,11 +655,12 @@ int pet_menu(struct map_session_data *sd,int menunum)
return 0;
}
-int pet_change_name(struct map_session_data *sd,char *name)
+int pet_change_name(struct map_session_data *sd, const char *name)
{
int i;
struct pet_data *pd;
nullpo_retr(1, sd);
+ nullpo_retr(1, name);
pd = sd->pd;
if((pd == NULL) || (pd->pet.rename_flag == 1 && !battle_config.pet_rename))
@@ -664,19 +674,26 @@ int pet_change_name(struct map_session_data *sd,char *name)
return intif_rename_pet(sd, name);
}
-int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
+int pet_change_name_ack(struct map_session_data *sd, const char *name, int flag)
{
- struct pet_data *pd = sd->pd;
- if (!pd) return 0;
+ struct pet_data *pd;
+ char *newname = NULL;
+ nullpo_ret(sd);
+ nullpo_ret(name);
+ pd = sd->pd;
+ if (pd == NULL) return 0;
- normalize_name(name," ");//bugreport:3032
+ newname = aStrndup(name, NAME_LENGTH-1);
+ normalize_name(newname, " ");//bugreport:3032 // FIXME[Haru]: This should be normalized by the inter-server (so that it's const here)
- if ( !flag || !strlen(name) ) {
+ if (flag == 0 || strlen(newname) == 0) {
clif->message(sd->fd, msg_sd(sd,280)); // You cannot use this name for your pet.
clif->send_petstatus(sd); //Send status so client knows oet name change got rejected.
+ aFree(newname);
return 0;
}
- memcpy(pd->pet.name, name, NAME_LENGTH);
+ safestrncpy(pd->pet.name, newname, NAME_LENGTH);
+ aFree(newname);
clif->charnameack (0,&pd->bl);
pd->pet.rename_flag = 1;
clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
@@ -699,7 +716,7 @@ int pet_equipitem(struct map_session_data *sd,int index) {
return 1;
}
- pc->delitem(sd, index, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, index, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME);
pd->pet.equip = nameid;
status->set_viewdata(&pd->bl, pd->pet.class_); //Updates view_data.
clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom);
@@ -720,6 +737,8 @@ int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
struct item tmp_item;
int nameid,flag;
+ nullpo_retr(1, sd);
+ nullpo_retr(1, pd);
if(pd->pet.equip == 0)
return 1;
@@ -730,7 +749,7 @@ int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
memset(&tmp_item,0,sizeof(tmp_item));
tmp_item.nameid = nameid;
tmp_item.identify = 1;
- if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) {
+ if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_CONSUME))) {
clif->additem(sd,0,0,flag);
map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
@@ -758,6 +777,7 @@ int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
int pet_food(struct map_session_data *sd, struct pet_data *pd) {
int i, food_id;
+ nullpo_retr(1, pd);
food_id = pd->petDB->FoodID;
i = pc->search_inventory(sd, food_id);
if(i == INDEX_NOT_FOUND) {
@@ -843,6 +863,7 @@ int pet_randomwalk(struct pet_data *pd, int64 tick)
int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick) {
struct block_list *target = NULL;
+ nullpo_ret(pd);
if(pd->bl.prev == NULL || sd == NULL || sd->bl.prev == NULL)
return 0;
@@ -955,6 +976,7 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick
int pet_ai_sub_foreachclient(struct map_session_data *sd,va_list ap) {
int64 tick = va_arg(ap,int64);
+ nullpo_ret(sd);
if(sd->status.pet_id && sd->pd)
pet->ai_sub_hard(sd->pd,sd,tick);
@@ -1110,7 +1132,8 @@ int pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) {
if(sd==NULL || sd->pd == NULL || sd->pd->recovery == NULL)
return 1;
- pd=sd->pd;
+ pd = sd->pd;
+ nullpo_retr(1, pd);
if(pd->recovery->timer != tid) {
ShowError("pet_recovery_timer %d != %d\n",pd->recovery->timer,tid);
@@ -1142,6 +1165,7 @@ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
return 1;
pd=sd->pd;
+ nullpo_retr(1, pd);
if(pd->s_skill->timer != tid) {
ShowError("pet_skill_support_timer %d != %d\n",pd->s_skill->timer,tid);
diff --git a/src/map/pet.h b/src/map/pet.h
index 83e39a887..9a0287b42 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -154,8 +154,8 @@ struct pet_interface {
int (*food) (struct map_session_data *sd, struct pet_data *pd);
int (*ai_sub_hard_lootsearch) (struct block_list *bl, va_list ap);
int (*menu) (struct map_session_data *sd, int menunum);
- int (*change_name) (struct map_session_data *sd, char *name);
- int (*change_name_ack) (struct map_session_data *sd, char *name, int flag);
+ int (*change_name) (struct map_session_data *sd, const char *name);
+ int (*change_name_ack) (struct map_session_data *sd, const char *name, int flag);
int (*equipitem) (struct map_session_data *sd, int index);
int (*randomwalk) (struct pet_data *pd, int64 tick);
int (*ai_sub_hard) (struct pet_data *pd, struct map_session_data *sd, int64 tick);
diff --git a/src/map/quest.c b/src/map/quest.c
index 0dbea56f8..ed8e5bd33 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -81,6 +81,7 @@ int quest_pc_login(struct map_session_data *sd)
int i;
#endif
+ nullpo_retr(1, sd);
if(sd->avail_quests == 0)
return 1;
@@ -111,6 +112,7 @@ int quest_add(struct map_session_data *sd, int quest_id)
int n;
struct quest_db *qi = quest->db(quest_id);
+ nullpo_retr(-1, sd);
if( qi == &quest->dummy ) {
ShowError("quest_add: quest %d not found in DB.\n", quest_id);
return -1;
@@ -122,6 +124,7 @@ int quest_add(struct map_session_data *sd, int quest_id)
}
n = sd->avail_quests; // Insertion point
+ Assert_retr(-1, sd->avail_quests <= sd->num_quests);
sd->num_quests++;
sd->avail_quests++;
@@ -163,6 +166,7 @@ int quest_change(struct map_session_data *sd, int qid1, int qid2)
int i;
struct quest_db *qi = quest->db(qid2);
+ nullpo_retr(-1, sd);
if( qi == &quest->dummy ) {
ShowError("quest_change: quest %d not found in DB.\n", qid2);
return -1;
@@ -213,6 +217,7 @@ int quest_delete(struct map_session_data *sd, int quest_id)
{
int i;
+ nullpo_retr(-1, sd);
//Search for quest
ARR_FIND(0, sd->num_quests, i, sd->quest_log[i].quest_id == quest_id);
@@ -283,6 +288,7 @@ void quest_update_objective(struct map_session_data *sd, int mob_id)
{
int i,j;
+ nullpo_retv(sd);
for (i = 0; i < sd->avail_quests; i++) {
struct quest_db *qi = NULL;
@@ -316,7 +322,7 @@ void quest_update_objective(struct map_session_data *sd, int mob_id)
item.nameid = dropitem->nameid;
item.identify = itemdb->isidentified2(data);
item.amount = 1;
- if((temp = pc->additem(sd, &item, 1, LOG_TYPE_OTHER)) != 0) { // TODO: We might want a new log type here?
+ if((temp = pc->additem(sd, &item, 1, LOG_TYPE_QUEST)) != 0) { // TODO: We might want a new log type here?
// Failed to obtain the item
clif->additem(sd, 0, 0, temp);
}
@@ -338,6 +344,7 @@ int quest_update_status(struct map_session_data *sd, int quest_id, enum quest_st
{
int i;
+ nullpo_retr(-1, sd);
ARR_FIND(0, sd->avail_quests, i, sd->quest_log[i].quest_id == quest_id);
if( i == sd->avail_quests ) {
ShowError("quest_update_status: Character %d doesn't have quest %d.\n", sd->status.char_id, quest_id);
@@ -388,6 +395,7 @@ int quest_check(struct map_session_data *sd, int quest_id, enum quest_check_type
{
int i;
+ nullpo_retr(-1, sd);
ARR_FIND(0, sd->num_quests, i, sd->quest_log[i].quest_id == quest_id);
if (i == sd->num_quests)
return -1;
@@ -409,7 +417,7 @@ int quest_check(struct map_session_data *sd, int quest_id, enum quest_check_type
}
return 0;
default:
- ShowError("quest_check_quest: Unknown parameter %d",type);
+ ShowError("quest_check_quest: Unknown parameter %u", type);
break;
}
@@ -425,12 +433,13 @@ int quest_check(struct map_session_data *sd, int quest_id, enum quest_check_type
* @return The parsed quest entry.
* @retval NULL in case of errors.
*/
-struct quest_db *quest_read_db_sub(config_setting_t *cs, int n, const char *source)
+struct quest_db *quest_read_db_sub(struct config_setting_t *cs, int n, const char *source)
{
struct quest_db *entry = NULL;
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
int i32 = 0, quest_id;
const char *str = NULL;
+ nullpo_retr(NULL, cs);
/*
* Id: Quest ID [int]
* Name: Quest Name [string]
@@ -477,7 +486,7 @@ struct quest_db *quest_read_db_sub(config_setting_t *cs, int n, const char *sour
for (i = 0; i < len && entry->objectives_count < MAX_QUEST_OBJECTIVES; i++) {
// Note: We ensure that objectives_count < MAX_QUEST_OBJECTIVES because
// quest_log (as well as the client) expect this maximum size.
- config_setting_t *tt = libconfig->setting_get_elem(t, i);
+ struct config_setting_t *tt = libconfig->setting_get_elem(t, i);
int mob_id = 0, count = 0;
if (!tt)
break;
@@ -496,7 +505,7 @@ struct quest_db *quest_read_db_sub(config_setting_t *cs, int n, const char *sour
if ((t=libconfig->setting_get_member(cs, "Drops")) && config_setting_is_list(t)) {
int i, len = libconfig->setting_length(t);
for (i = 0; i < len; i++) {
- config_setting_t *tt = libconfig->setting_get_elem(t, i);
+ struct config_setting_t *tt = libconfig->setting_get_elem(t, i);
int mob_id = 0, nameid = 0, rate = 0;
if (!tt)
break;
@@ -527,13 +536,16 @@ struct quest_db *quest_read_db_sub(config_setting_t *cs, int n, const char *sour
int quest_read_db(void)
{
char filepath[256];
- config_t quest_db_conf;
- config_setting_t *qdb = NULL, *q = NULL;
+ struct config_t quest_db_conf;
+ struct config_setting_t *qdb = NULL, *q = NULL;
int i = 0, count = 0;
const char *filename = "quest_db.conf";
- sprintf(filepath, "%s/%s", map->db_path, filename);
- if (libconfig->read_file(&quest_db_conf, filepath) || !(qdb = libconfig->setting_get_member(quest_db_conf.root, "quest_db"))) {
+ snprintf(filepath, 256, "%s/%s", map->db_path, filename);
+ if (!libconfig->load_file(&quest_db_conf, filepath))
+ return -1;
+
+ if ((qdb = libconfig->setting_get_member(quest_db_conf.root, "quest_db")) == NULL) {
ShowError("can't read %s\n", filepath);
return -1;
}
diff --git a/src/map/quest.h b/src/map/quest.h
index 8e2cb4e23..8837a1fb6 100644
--- a/src/map/quest.h
+++ b/src/map/quest.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,10 +22,11 @@
#define MAP_QUEST_H
#include "common/hercules.h"
-#include "common/conf.h"
#include "common/mmo.h" // enum quest_state
+/* Forward Declarations */
struct block_list;
+struct config_setting_t;
struct map_session_data;
#define MAX_QUEST_DB (60355+1) // Highest quest ID + 1
@@ -77,7 +78,7 @@ struct quest_interface {
int (*check) (struct map_session_data *sd, int quest_id, enum quest_check_type type);
void (*clear) (void);
int (*read_db) (void);
- struct quest_db *(*read_db_sub) (config_setting_t *cs, int n, const char *source);
+ struct quest_db *(*read_db_sub) (struct config_setting_t *cs, int n, const char *source);
};
#ifdef HERCULES_CORE
diff --git a/src/map/script.c b/src/map/script.c
index f3c839555..b22c88cfe 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -55,6 +55,8 @@
#include "map/storage.h"
#include "map/unit.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
#include "common/memmgr.h"
#include "common/md5calc.h"
#include "common/mmo.h" // NEW_CARTS
@@ -62,6 +64,7 @@
#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h" // usage: getcharip
+#include "common/sql.h"
#include "common/strlib.h"
#include "common/sysinfo.h"
#include "common/timer.h"
@@ -80,36 +83,21 @@
struct script_interface script_s;
struct script_interface *script;
-static inline int GETVALUE(const unsigned char* buf, int i) {
- return (int)MakeDWord(MakeWord(buf[i], buf[i+1]), MakeWord(buf[i+2], 0));
-}
-static inline void SETVALUE(unsigned char* buf, int i, int n) {
- buf[i] = GetByte(n, 0);
- buf[i+1] = GetByte(n, 1);
- buf[i+2] = GetByte(n, 2);
-}
-
-static inline void script_string_buf_ensure(struct script_string_buf *buf, size_t ensure) {
- if( buf->pos+ensure >= buf->size ) {
- do {
- buf->size += 512;
- } while ( buf->pos+ensure >= buf->size );
- RECREATE(buf->ptr, char, buf->size);
- }
-}
-
-static inline void script_string_buf_addb(struct script_string_buf *buf,uint8 b) {
- if( buf->pos+1 >= buf->size ) {
- buf->size += 512;
- RECREATE(buf->ptr, char, buf->size);
- }
- buf->ptr[buf->pos++] = b;
+static inline int GETVALUE(const struct script_buf *buf, int i) __attribute__((nonnull (1)));
+static inline int GETVALUE(const struct script_buf *buf, int i)
+{
+ Assert_ret(VECTOR_LENGTH(*buf) > i + 2);
+ return (int)MakeDWord(MakeWord(VECTOR_INDEX(*buf, i), VECTOR_INDEX(*buf, i+1)),
+ MakeWord(VECTOR_INDEX(*buf, i+2), 0));
}
-static inline void script_string_buf_destroy(struct script_string_buf *buf) {
- if( buf->ptr )
- aFree(buf->ptr);
- memset(buf,0,sizeof(struct script_string_buf));
+static inline void SETVALUE(struct script_buf *buf, int i, int n) __attribute__((nonnull (1)));
+static inline void SETVALUE(struct script_buf *buf, int i, int n)
+{
+ Assert_retv(VECTOR_LENGTH(*buf) > i + 2);
+ VECTOR_INDEX(*buf, i) = GetByte(n, 0);
+ VECTOR_INDEX(*buf, i+1) = GetByte(n, 1);
+ VECTOR_INDEX(*buf, i+2) = GetByte(n, 2);
}
const char* script_op2name(int op) {
@@ -148,6 +136,7 @@ const char* script_op2name(int op) {
RETURN_OP_NAME(C_ADD);
RETURN_OP_NAME(C_SUB);
RETURN_OP_NAME(C_MUL);
+ RETURN_OP_NAME(C_POW);
RETURN_OP_NAME(C_DIV);
RETURN_OP_NAME(C_MOD);
RETURN_OP_NAME(C_NEG);
@@ -173,6 +162,7 @@ const char* script_op2name(int op) {
static void script_dump_stack(struct script_state* st)
{
int i;
+ nullpo_retv(st);
ShowMessage("\tstart = %d\n", st->start);
ShowMessage("\tend = %d\n", st->end);
ShowMessage("\tdefsp = %d\n", st->stack->defsp);
@@ -215,6 +205,7 @@ static void script_dump_stack(struct script_state* st)
void script_reportsrc(struct script_state *st) {
struct block_list* bl;
+ nullpo_retv(st);
if( st->oid == 0 )
return; //Can't report source.
@@ -234,9 +225,9 @@ void script_reportsrc(struct script_state *st) {
break;
default:
if( bl->m >= 0 )
- ShowDebug("Source (Non-NPC type %d): name %s at %s (%d,%d)\n", bl->type, status->get_name(bl), map->list[bl->m].name, bl->x, bl->y);
+ ShowDebug("Source (Non-NPC type %u): name %s at %s (%d,%d)\n", bl->type, clif->get_bl_name(bl), map->list[bl->m].name, bl->x, bl->y);
else
- ShowDebug("Source (Non-NPC type %d): name %s (invisible/not on a map)\n", bl->type, status->get_name(bl));
+ ShowDebug("Source (Non-NPC type %u): name %s (invisible/not on a map)\n", bl->type, clif->get_bl_name(bl));
break;
}
}
@@ -264,7 +255,7 @@ void script_reportdata(struct script_data* data)
case C_NAME:// reference
if( reference_tovariable(data) ) {// variable
const char* name = reference_getname(data);
- ShowDebug("Data: variable name='%s' index=%d\n", name, reference_getindex(data));
+ ShowDebug("Data: variable name='%s' index=%u\n", name, reference_getindex(data));
} else if( reference_toconstant(data) ) {// constant
ShowDebug("Data: constant name='%s' value=%d\n", reference_getname(data), reference_getconstant(data));
} else if( reference_toparam(data) ) {// param
@@ -319,7 +310,7 @@ void script_reportfunc(struct script_state* st)
/*==========================================
* Output error message
*------------------------------------------*/
-static void disp_error_message2(const char *mes,const char *pos,int report) analyzer_noreturn;
+static void disp_error_message2(const char *mes,const char *pos,int report) __attribute__((nonnull (1))) analyzer_noreturn;
static void disp_error_message2(const char *mes,const char *pos,int report) {
script->error_msg = aStrdup(mes);
script->error_pos = pos;
@@ -348,6 +339,7 @@ void check_event(struct script_state *st, const char *evt)
unsigned int calc_hash(const char* p) {
unsigned int h;
+ nullpo_ret(p);
#if defined(SCRIPT_HASH_DJB2)
h = 5381;
while( *p ) // hash*33 + c
@@ -383,6 +375,7 @@ unsigned int calc_hash_ci(const char* p) {
unsigned int h = 0;
#ifdef ENABLE_CASE_CHECK
+ nullpo_ret(p);
#if defined(SCRIPT_HASH_DJB2)
h = 5381;
while( *p ) // hash*33 + c
@@ -437,8 +430,10 @@ int script_search_str(const char* p)
return -1;
}
-void script_casecheck_clear_sub(struct casecheck_data *ccd) {
+void script_casecheck_clear_sub(struct casecheck_data *ccd)
+{
#ifdef ENABLE_CASE_CHECK
+ nullpo_retv(ccd);
if (ccd->str_data) {
aFree(ccd->str_data);
ccd->str_data = NULL;
@@ -468,6 +463,7 @@ const char *script_casecheck_add_str_sub(struct casecheck_data *ccd, const char
#ifdef ENABLE_CASE_CHECK
int len;
int h = script->calc_hash_ci(p);
+ nullpo_retr(NULL, ccd);
if (ccd->str_hash[h] == 0) {
//empty bucket, add new node here
ccd->str_hash[h] = ccd->str_num;
@@ -603,21 +599,26 @@ int script_add_str(const char* p)
return script->str_num++;
}
-/// Appends 1 byte to the script buffer.
+/**
+ * Appends 1 byte to the script buffer.
+ *
+ * @param a The byte to append.
+ */
void add_scriptb(int a)
{
- if( script->pos+1 >= script->size )
- {
- script->size += SCRIPT_BLOCK_SIZE;
- RECREATE(script->buf,unsigned char,script->size);
- }
- script->buf[script->pos++] = (uint8)(a);
+ VECTOR_ENSURE(script->buf, 1, SCRIPT_BLOCK_SIZE);
+ VECTOR_PUSH(script->buf, (uint8)a);
}
-/// Appends a c_op value to the script buffer.
-/// The value is variable-length encoded into 8-bit blocks.
-/// The encoding scheme is ( 01?????? )* 00??????, LSB first.
-/// All blocks but the last hold 7 bits of data, topmost bit is always 1 (carries).
+/**
+ * Appends a c_op value to the script buffer.
+ *
+ * The value is variable-length encoded into 8-bit blocks.
+ * The encoding scheme is ( 01?????? )* 00??????, LSB first.
+ * All blocks but the last hold 7 bits of data, topmost bit is always 1 (carries).
+ *
+ * @param a The value to append.
+ */
void add_scriptc(int a)
{
while( a >= 0x40 )
@@ -629,10 +630,15 @@ void add_scriptc(int a)
script->addb(a);
}
-/// Appends an integer value to the script buffer.
-/// The value is variable-length encoded into 8-bit blocks.
-/// The encoding scheme is ( 11?????? )* 10??????, LSB first.
-/// All blocks but the last hold 7 bits of data, topmost bit is always 1 (carries).
+/**
+ * Appends an integer value to the script buffer.
+ *
+ * The value is variable-length encoded into 8-bit blocks.
+ * The encoding scheme is ( 11?????? )* 10??????, LSB first.
+ * All blocks but the last hold 7 bits of data, topmost bit is always 1 (carries).
+ *
+ * @param a The value to append.
+ */
void add_scripti(int a)
{
while( a >= 0x40 )
@@ -643,11 +649,11 @@ void add_scripti(int a)
script->addb(a|0x80);
}
-/// Appends a script->str_data object (label/function/variable/integer) to the script buffer.
-
-///
-/// @param l The id of the script->str_data entry
-// Maximum up to 16M
+/**
+ * Appends a script->str_data object (label/function/variable/integer) to the script buffer.
+ *
+ * @param l The id of the script->str_data entry (Maximum up to 16M)
+ */
void add_scriptl(int l)
{
int backpatch = script->str_data[l].backpatch;
@@ -664,7 +670,7 @@ void add_scriptl(int l)
case C_USERFUNC:
// Embedded data backpatch there is a possibility of label
script->addc(C_NAME);
- script->str_data[l].backpatch = script->pos;
+ script->str_data[l].backpatch = VECTOR_LENGTH(script->buf);
script->addb(backpatch);
script->addb(backpatch>>8);
script->addb(backpatch>>16);
@@ -702,9 +708,9 @@ void set_label(int l,int pos, const char* script_pos)
script->str_data[l].type=(script->str_data[l].type == C_USERFUNC ? C_USERFUNC_POS : C_POS);
script->str_data[l].label=pos;
for (i = script->str_data[l].backpatch; i >= 0 && i != 0x00ffffff; ) {
- int next = GETVALUE(script->buf,i);
- script->buf[i-1]=(script->str_data[l].type == C_USERFUNC ? C_USERFUNC_POS : C_POS);
- SETVALUE(script->buf,i,pos);
+ int next = GETVALUE(&script->buf, i);
+ VECTOR_INDEX(script->buf, i-1) = (script->str_data[l].type == C_USERFUNC ? C_USERFUNC_POS : C_POS);
+ SETVALUE(&script->buf, i, pos);
i = next;
}
}
@@ -749,7 +755,9 @@ const char* script_skip_space(const char* p)
/// Skips a word.
/// A word consists of undercores and/or alphanumeric characters,
/// and valid variable prefixes/postfixes.
-const char* skip_word(const char* p) {
+const char* skip_word(const char* p)
+{
+ nullpo_retr(NULL, p);
// prefix
switch( *p ) {
case '@':// temporary char variable
@@ -764,7 +772,7 @@ const char* skip_word(const char* p) {
p += ( p[1] == '@' ? 2 : 1 ); break;
}
- while( ISALNUM(*p) || *p == '_' || *p == '\'' )
+ while (ISALNUM(*p) || *p == '_')
++p;
// postfix
@@ -780,6 +788,7 @@ int add_word(const char* p) {
size_t len;
int i;
+ nullpo_retr(0, p);
// Check for a word
len = script->skip_word(p) - p;
if( len == 0 )
@@ -808,26 +817,26 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
char *arg = NULL;
char null_arg = '\0';
int func;
- bool nested_call = false, macro = false;
+ bool macro = false;
+ nullpo_retr(NULL, p);
// is need add check for arg null pointer below?
func = script->add_word(p);
- if( script->str_data[func].type == C_FUNC ) {
- /** only when unset (-1), valid values are >= 0 **/
- if( script->syntax.last_func == -1 )
- script->syntax.last_func = script->str_data[func].val;
- else { //Nested function call
- script->syntax.nested_call++;
- nested_call = true;
-
- if( script->str_data[func].val == script->buildin_lang_macro_offset ) {
+ if (script->str_data[func].type == C_FUNC) {
+ script->syntax.nested_call++;
+ if (script->syntax.last_func != -1) {
+ if (script->str_data[func].val == script->buildin_lang_macro_offset) {
script->syntax.lang_macro_active = true;
macro = true;
+ } else if (script->str_data[func].val == script->buildin_lang_macro_fmtstring_offset) {
+ script->syntax.lang_macro_fmtstring_active = true;
+ macro = true;
}
}
if( !macro ) {
// buildin function
+ script->syntax.last_func = script->str_data[func].val;
script->addl(func);
script->addc(C_ARG);
}
@@ -916,18 +925,17 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
disp_error_message("parse_callfunc: expected ')' to close argument list",p);
++p;
- if( script->str_data[func].val == script->buildin_lang_macro_offset )
+ if (script->str_data[func].val == script->buildin_lang_macro_offset)
script->syntax.lang_macro_active = false;
+ else if (script->str_data[func].val == script->buildin_lang_macro_fmtstring_offset)
+ script->syntax.lang_macro_fmtstring_active = false;
}
- if( nested_call )
- script->syntax.nested_call--;
-
- if( !script->syntax.nested_call )
- script->syntax.last_func = -1;
-
- if( !macro )
+ if (!macro) {
+ if (0 == --script->syntax.nested_call)
+ script->syntax.last_func = -1;
script->addc(C_FUNC);
+ }
return p;
}
@@ -939,7 +947,7 @@ void parse_nextline(bool first, const char* p)
if( !first )
{
script->addc(C_EOL); // mark end of line for stack cleanup
- script->set_label(LABEL_NEXTLINE, script->pos, p); // fix up '-' labels
+ script->set_label(LABEL_NEXTLINE, VECTOR_LENGTH(script->buf), p); // fix up '-' labels
}
// initialize data for new '-' label fix up scheduling
@@ -990,6 +998,7 @@ const char* parse_variable(const char* p)
const char *p2 = NULL;
const char *var = p;
+ nullpo_retr(NULL, p);
if( ( p[0] == '+' && p[1] == '+' && (type = C_ADD_PRE, true) ) // pre ++
|| ( p[0] == '-' && p[1] == '-' && (type = C_SUB_PRE, true) ) // pre --
) {
@@ -1027,6 +1036,7 @@ const char* parse_variable(const char* p)
|| ( p[0] == '|' && p[1] == '=' && (type = C_OR, true) ) // |=
|| ( p[0] == '&' && p[1] == '=' && (type = C_AND, true) ) // &=
|| ( p[0] == '*' && p[1] == '=' && (type = C_MUL, true) ) // *=
+ || ( p[0] == '*' && p[1] == '*' && p[2] == '=' && (type = C_POW, true) ) // **=
|| ( p[0] == '/' && p[1] == '=' && (type = C_DIV, true) ) // /=
|| ( p[0] == '%' && p[1] == '=' && (type = C_MOD, true) ) // %=
|| ( p[0] == '+' && p[1] == '+' && (type = C_ADD_POST, true) ) // post ++
@@ -1050,6 +1060,7 @@ const char* parse_variable(const char* p)
case C_L_SHIFT: // <<=
case C_R_SHIFT: // >>=
+ case C_POW: // **=
p = script->skip_space( &p[3] );
break;
@@ -1063,6 +1074,8 @@ const char* parse_variable(const char* p)
}
// push the set function onto the stack
+ script->syntax.nested_call++;
+ script->syntax.last_func = script->str_data[script->buildin_set_ref].val;
script->addl(script->buildin_set_ref);
script->addc(C_ARG);
@@ -1114,6 +1127,8 @@ const char* parse_variable(const char* p)
// close the script by appending the function operator
script->addc(C_FUNC);
+ if (--script->syntax.nested_call == 0)
+ script->syntax.last_func = -1;
// push the buffer from the method
return p;
@@ -1156,13 +1171,22 @@ bool is_number(const char *p) {
}
/**
+ * Duplicates a script string into the script string list.
*
- **/
-int script_string_dup(char *str) {
- size_t len = strlen(str);
+ * Grows the script string list as needed.
+ *
+ * @param str The string to insert.
+ * @return the string position in the script string list.
+ */
+int script_string_dup(char *str)
+{
+ int len;
int pos = script->string_list_pos;
- while( pos+len+1 >= script->string_list_size ) {
+ nullpo_retr(pos, str);
+ len = (int)strlen(str);
+
+ while (pos+len+1 >= script->string_list_size) {
script->string_list_size += (1024*1024)/2;
RECREATE(script->string_list,char,script->string_list_size);
}
@@ -1176,231 +1200,199 @@ int script_string_dup(char *str) {
/*==========================================
* Analysis section
*------------------------------------------*/
-const char* parse_simpleexpr(const char *p)
+const char *parse_simpleexpr(const char *p)
{
p=script->skip_space(p);
- if(*p==';' || *p==',')
+ nullpo_retr(NULL, p);
+ if (*p == ';' || *p == ',')
disp_error_message("parse_simpleexpr: unexpected end of expression",p);
- if(*p=='(') {
- int i = script->syntax.curly_count-1;
- if (i >= 0 && script->syntax.curly[i].type == TYPE_ARGLIST)
- ++script->syntax.curly[i].count;
- p=script->parse_subexpr(p+1,-1);
- p=script->skip_space(p);
- if( (i=script->syntax.curly_count-1) >= 0 && script->syntax.curly[i].type == TYPE_ARGLIST
- && script->syntax.curly[i].flag == ARGLIST_UNDEFINED && --script->syntax.curly[i].count == 0
- ) {
- if( *p == ',' ) {
- script->syntax.curly[i].flag = ARGLIST_PAREN;
- return p;
- } else {
- script->syntax.curly[i].flag = ARGLIST_NO_PAREN;
- }
- }
- if( *p != ')' )
- disp_error_message("parse_simpleexpr: unmatched ')'",p);
- ++p;
- } else if(is_number(p)) {
- char *np;
- long long lli;
- while(*p == '0' && ISDIGIT(p[1])) p++; // Skip leading zeros, we don't support octal literals
- lli=strtoll(p,&np,0);
- if( lli < INT_MIN ) {
- lli = INT_MIN;
- script->disp_warning_message("parse_simpleexpr: underflow detected, capping value to INT_MIN",p);
- } else if( lli > INT_MAX ) {
- lli = INT_MAX;
- script->disp_warning_message("parse_simpleexpr: overflow detected, capping value to INT_MAX",p);
- }
- script->addi((int)lli); // Cast is safe, as it's already been checked for overflows
- p=np;
- } else if(*p=='"') {
- struct string_translation *st = NULL;
- const char *start_point = p;
- bool duplicate = true;
- struct script_string_buf *sbuf = &script->parse_simpleexpr_str;
-
- do {
- p++;
- while( *p && *p != '"' ) {
- if( (unsigned char)p[-1] <= 0x7e && *p == '\\' ) {
- char buf[8];
- size_t len = sv->skip_escaped_c(p) - p;
- size_t n = sv->unescape_c(buf, p, len);
- if( n != 1 )
- ShowDebug("parse_simpleexpr: unexpected length %d after unescape (\"%.*s\" -> %.*s)\n", (int)n, (int)len, p, (int)n, buf);
- p += len;
- script_string_buf_addb(sbuf, *buf);
- continue;
- } else if( *p == '\n' ) {
- disp_error_message("parse_simpleexpr: unexpected newline @ string",p);
- }
- script_string_buf_addb(sbuf, *p++);
- }
- if(!*p)
- disp_error_message("parse_simpleexpr: unexpected end of file @ string",p);
- p++; //'"'
- p = script->skip_space(p);
- } while( *p && *p == '"' );
-
- script_string_buf_addb(sbuf, 0);
-
- if (!(script->syntax.translation_db && (st = strdb_get(script->syntax.translation_db, sbuf->ptr)) != NULL)) {
- script->addc(C_STR);
-
- if( script->pos+sbuf->pos >= script->size ) {
- do {
- script->size += SCRIPT_BLOCK_SIZE;
- } while( script->pos+sbuf->pos >= script->size );
- RECREATE(script->buf,unsigned char,script->size);
- }
+ if (*p == '(') {
+ return script->parse_simpleexpr_paren(p);
+ } else if (is_number(p)) {
+ return script->parse_simpleexpr_number(p);
+ } else if(*p == '"') {
+ return script->parse_simpleexpr_string(p);
+ } else {
+ return script->parse_simpleexpr_name(p);
+ }
+}
- memcpy(script->buf+script->pos, sbuf->ptr, sbuf->pos);
- script->pos += sbuf->pos;
+const char *parse_simpleexpr_paren(const char *p)
+{
+ int i = script->syntax.curly_count - 1;
+ nullpo_retr(NULL, p);
+ if (i >= 0 && script->syntax.curly[i].type == TYPE_ARGLIST)
+ ++script->syntax.curly[i].count;
+ p = script->parse_subexpr(p + 1, -1);
+ p = script->skip_space(p);
+ if ((i = script->syntax.curly_count - 1) >= 0
+ && script->syntax.curly[i].type == TYPE_ARGLIST
+ && script->syntax.curly[i].flag == ARGLIST_UNDEFINED
+ && --script->syntax.curly[i].count == 0
+ ) {
+ if (*p == ',') {
+ script->syntax.curly[i].flag = ARGLIST_PAREN;
+ return p;
} else {
- int expand = sizeof(int) + sizeof(uint8);
- unsigned char j;
- unsigned int st_cursor = 0;
+ script->syntax.curly[i].flag = ARGLIST_NO_PAREN;
+ }
+ }
+ if (*p != ')')
+ disp_error_message("parse_simpleexpr: unmatched ')'", p);
- script->addc(C_LSTR);
+ return p + 1;
+}
- expand += (sizeof(char*) + sizeof(uint8)) * st->translations;
+const char *parse_simpleexpr_number(const char *p)
+{
+ char *np = NULL;
+ long long lli;
- while( script->pos+expand >= script->size ) {
- script->size += SCRIPT_BLOCK_SIZE;
- RECREATE(script->buf,unsigned char,script->size);
- }
+ nullpo_retr(NULL, p);
+ while (*p == '0' && ISDIGIT(p[1]))
+ p++; // Skip leading zeros, we don't support octal literals
- *((int *)(&script->buf[script->pos])) = st->string_id;
- *((uint8 *)(&script->buf[script->pos + sizeof(int)])) = st->translations;
+ lli = strtoll(p, &np, 0);
+ if (lli < INT_MIN) {
+ lli = INT_MIN;
+ script->disp_warning_message("parse_simpleexpr: underflow detected, capping value to INT_MIN", p);
+ } else if (lli > INT_MAX) {
+ lli = INT_MAX;
+ script->disp_warning_message("parse_simpleexpr: overflow detected, capping value to INT_MAX", p);
+ }
+ script->addi((int)lli); // Cast is safe, as it's already been checked for overflows
- script->pos += sizeof(int) + sizeof(uint8);
+ return np;
+}
- for(j = 0; j < st->translations; j++) {
- *((uint8 *)(&script->buf[script->pos])) = RBUFB(st->buf, st_cursor);
- *((char **)(&script->buf[script->pos+sizeof(uint8)])) = &st->buf[st_cursor + sizeof(uint8)];
- script->pos += sizeof(char*) + sizeof(uint8);
- st_cursor += sizeof(uint8);
- while(st->buf[st_cursor++]);
- st_cursor += sizeof(uint8);
- }
- }
+const char *parse_simpleexpr_string(const char *p)
+{
+ const char *start_point = p;
- /* When exporting we don't know what is a translation and what isn't */
- if( script->lang_export_fp && sbuf->pos > 1 ) {//sbuf->pos will always be at least 1 because of the '\0'
- if( !script->syntax.strings ) {
- script->syntax.strings = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, 0);
+ nullpo_retr(NULL, p);
+ do {
+ p++;
+ while (*p != '\0' && *p != '"') {
+ if ((unsigned char)p[-1] <= 0x7e && *p == '\\') {
+ char buf[8];
+ size_t len = sv->skip_escaped_c(p) - p;
+ size_t n = sv->unescape_c(buf, p, len);
+ if (n != 1)
+ ShowDebug("parse_simpleexpr: unexpected length %d after unescape (\"%.*s\" -> %.*s)\n", (int)n, (int)len, p, (int)n, buf);
+ p += len;
+ VECTOR_ENSURE(script->parse_simpleexpr_strbuf, 1, 512);
+ VECTOR_PUSH(script->parse_simpleexpr_strbuf, buf[0]);
+ continue;
}
-
- if( !strdb_exists(script->syntax.strings,sbuf->ptr) ) {
- strdb_put(script->syntax.strings, sbuf->ptr, NULL);
- duplicate = false;
+ if (*p == '\n') {
+ disp_error_message("parse_simpleexpr: unexpected newline @ string", p);
}
+ VECTOR_ENSURE(script->parse_simpleexpr_strbuf, 1, 512);
+ VECTOR_PUSH(script->parse_simpleexpr_strbuf, *p++);
}
+ if (*p == '\0')
+ disp_error_message("parse_simpleexpr: unexpected end of file @ string", p);
+ p++; //'"'
+ p = script->skip_space(p);
+ } while (*p != '\0' && *p == '"');
- if( script->lang_export_fp && !duplicate &&
- ( ( ( script->syntax.last_func == script->buildin_mes_offset ||
- script->syntax.last_func == script->buildin_select_offset ) && !script->syntax.nested_call
- ) || script->syntax.lang_macro_active ) ) {
- const char *line_start = start_point;
- const char *line_end = start_point;
- struct script_string_buf *lbuf = &script->lang_export_line_buf;
- struct script_string_buf *ubuf = &script->lang_export_unescaped_buf;
- size_t line_length, cursor;
+ VECTOR_ENSURE(script->parse_simpleexpr_strbuf, 1, 512);
+ VECTOR_PUSH(script->parse_simpleexpr_strbuf, '\0');
- while( line_start > script->parser_current_src ) {
- if( *line_start != '\n' )
- line_start--;
- else
- break;
- }
+ script->add_translatable_string(&script->parse_simpleexpr_strbuf, start_point);
- while( *line_end != '\n' && *line_end != '\0' )
- line_end++;
+ VECTOR_TRUNCATE(script->parse_simpleexpr_strbuf);
- line_length = (size_t)(line_end - line_start);
- if( line_length > 0 ) {
- script_string_buf_ensure(lbuf,line_length + 1);
+ return p;
+}
- memcpy(lbuf->ptr, line_start, line_length);
- lbuf->pos = line_length;
- script_string_buf_addb(lbuf, 0);
+const char *parse_simpleexpr_name(const char *p)
+{
+ int l;
+ const char *pv = NULL;
- normalize_name(lbuf->ptr, "\r\n\t ");
- }
+ // label , register , function etc
+ if (script->skip_word(p) == p)
+ disp_error_message("parse_simpleexpr: unexpected character", p);
- for(cursor = 0; cursor < sbuf->pos; cursor++) {
- if( sbuf->ptr[cursor] == '"' )
- script_string_buf_addb(ubuf, '\\');
- script_string_buf_addb(ubuf, sbuf->ptr[cursor]);
- }
- script_string_buf_addb(ubuf, 0);
-
- fprintf(script->lang_export_fp, "#: %s\n"
- "# %s\n"
- "msgctxt \"%s\"\n"
- "msgid \"%s\"\n"
- "msgstr \"\"\n",
- script->parser_current_file ? script->parser_current_file : "Unknown File",
- lbuf->ptr,
- script->parser_current_npc_name ? script->parser_current_npc_name : "Unknown NPC",
- ubuf->ptr
- );
- lbuf->pos = 0;
- ubuf->pos = 0;
+ l = script->add_word(p);
+ if (script->str_data[l].type == C_FUNC || script->str_data[l].type == C_USERFUNC || script->str_data[l].type == C_USERFUNC_POS) {
+ return script->parse_callfunc(p,1,0);
+#ifdef SCRIPT_CALLFUNC_CHECK
+ } else {
+ const char *name = script->get_str(l);
+ if (strdb_get(script->userfunc_db,name) != NULL) {
+ return script->parse_callfunc(p, 1, 1);
}
- sbuf->pos = 0;
+#endif
+ }
+
+ if ((pv = script->parse_variable(p)) != NULL) {
+ // successfully processed a variable assignment
+ return pv;
+ }
+
+ if (script->str_data[l].type == C_INT && script->str_data[l].deprecated) {
+ disp_warning_message("This constant is deprecated and it will be removed in a future version. Please see the script documentation and constants.conf for an alternative.\n", p);
+ }
+
+ p = script->skip_word(p);
+ if (*p == '[') {
+ // array(name[i] => getelementofarray(name,i) )
+ script->addl(script->buildin_getelementofarray_ref);
+ script->addc(C_ARG);
+ script->addl(l);
+
+ p = script->parse_subexpr(p + 1, -1);
+ p = script->skip_space(p);
+ if (*p != ']')
+ disp_error_message("parse_simpleexpr: unmatched ']'", p);
+ ++p;
+ script->addc(C_FUNC);
} else {
- int l;
- const char* pv;
+ script->addl(l);
+ }
- // label , register , function etc
- if(script->skip_word(p)==p)
- disp_error_message("parse_simpleexpr: unexpected character",p);
+ return p;
+}
- l=script->add_word(p);
- if( script->str_data[l].type == C_FUNC || script->str_data[l].type == C_USERFUNC || script->str_data[l].type == C_USERFUNC_POS) {
- return script->parse_callfunc(p,1,0);
-#ifdef SCRIPT_CALLFUNC_CHECK
- } else {
- const char* name = script->get_str(l);
- if( strdb_get(script->userfunc_db,name) != NULL ) {
- return script->parse_callfunc(p,1,1);
- }
-#endif
- }
+void script_add_translatable_string(const struct script_string_buf *string, const char *start_point)
+{
+ struct string_translation *st = NULL;
- if( (pv = script->parse_variable(p)) ) {
- // successfully processed a variable assignment
- return pv;
- }
+ nullpo_retv(string);
+ if (script->syntax.translation_db == NULL
+ || (st = strdb_get(script->syntax.translation_db, VECTOR_DATA(*string))) == NULL) {
+ script->addc(C_STR);
- if (script->str_data[l].type == C_INT && script->str_data[l].deprecated) {
- disp_warning_message("This constant is deprecated and it will be removed in a future version. Please see the script documentation and constants.conf for an alternative.\n", p);
- }
+ VECTOR_ENSURE(script->buf, VECTOR_LENGTH(*string), SCRIPT_BLOCK_SIZE);
- p=script->skip_word(p);
- if( *p == '[' ) {
- // array(name[i] => getelementofarray(name,i) )
- script->addl(script->buildin_getelementofarray_ref);
- script->addc(C_ARG);
- script->addl(l);
+ VECTOR_PUSHARRAY(script->buf, VECTOR_DATA(*string), VECTOR_LENGTH(*string));
+ } else {
+ unsigned char u;
+ int st_cursor = 0;
- p=script->parse_subexpr(p+1,-1);
- p=script->skip_space(p);
- if( *p != ']' )
- disp_error_message("parse_simpleexpr: unmatched ']'",p);
- ++p;
- script->addc(C_FUNC);
- } else {
- script->addl(l);
- }
+ script->addc(C_LSTR);
- }
+ VECTOR_ENSURE(script->buf, (int)(sizeof(st->string_id) + sizeof(st->translations)), SCRIPT_BLOCK_SIZE);
+ VECTOR_PUSHARRAY(script->buf, (void *)&st->string_id, sizeof(st->string_id));
+ VECTOR_PUSHARRAY(script->buf, (void *)&st->translations, sizeof(st->translations));
- return p;
+ for (u = 0; u != st->translations; u++) {
+ struct string_translation_entry *entry = (void *)(st->buf+st_cursor);
+ char *stringptr = &entry->string[0];
+ st_cursor += sizeof(*entry);
+ VECTOR_ENSURE(script->buf, (int)(sizeof(entry->lang_id) + sizeof(char *)), SCRIPT_BLOCK_SIZE);
+ VECTOR_PUSHARRAY(script->buf, (void *)&entry->lang_id, sizeof(entry->lang_id));
+ VECTOR_PUSHARRAY(script->buf, (void *)&stringptr, sizeof(stringptr));
+ st_cursor += sizeof(uint8); // FIXME: What are we skipping here?
+ while (st->buf[st_cursor++] != 0)
+ (void)0; // Skip string
+ st_cursor += sizeof(uint8); // FIXME: What are we skipping here?
+ }
+ }
}
/*==========================================
@@ -1410,6 +1402,7 @@ const char* script_parse_subexpr(const char* p,int limit)
{
int op,opl,len;
+ nullpo_retr(NULL, p);
p=script->skip_space(p);
if( *p == '-' ) {
@@ -1434,6 +1427,7 @@ const char* script_parse_subexpr(const char* p,int limit)
(op=C_OP3, opl=0, len=1,*p=='?') // ?:
|| (op=C_ADD, opl=9, len=1,*p=='+') // +
|| (op=C_SUB, opl=9, len=1,*p=='-') // -
+ || (op=C_POW, opl=11,len=2,*p=='*' && p[1]=='*') // **
|| (op=C_MUL, opl=10,len=1,*p=='*') // *
|| (op=C_DIV, opl=10,len=1,*p=='/') // /
|| (op=C_MOD, opl=10,len=1,*p=='%') // %
@@ -1475,6 +1469,7 @@ const char* script_parse_subexpr(const char* p,int limit)
*------------------------------------------*/
const char* parse_expr(const char *p)
{
+ nullpo_retr(NULL, p);
switch(*p) {
case ')': case ';': case ':': case '[': case ']':
case '}':
@@ -1491,6 +1486,7 @@ const char* parse_line(const char* p)
{
const char* p2;
+ nullpo_retr(NULL, p);
p=script->skip_space(p);
if(*p==';') {
//Close decision for if(); for(); while();
@@ -1551,6 +1547,7 @@ const char* parse_line(const char* p)
// { ... } Closing process
const char* parse_curly_close(const char* p)
{
+ nullpo_retr(NULL, p);
if(script->syntax.curly_count <= 0) {
disp_error_message("parse_curly_close: unexpected string",p);
return p + 1;
@@ -1565,34 +1562,34 @@ const char* parse_curly_close(const char* p)
char label[256];
int l;
// Remove temporary variables
- sprintf(label,"__setr $@__SW%x_VAL,0;",script->syntax.curly[pos].index);
+ sprintf(label, "__setr $@__SW%x_VAL,0;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// Go to the end pointer unconditionally
- sprintf(label,"goto __SW%x_FIN;",script->syntax.curly[pos].index);
+ sprintf(label,"goto __SW%x_FIN;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// You are here labeled
- sprintf(label,"__SW%x_%x",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label,"__SW%x_%x", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
l=script->add_str(label);
- script->set_label(l,script->pos, p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
if(script->syntax.curly[pos].flag) {
//Exists default
- sprintf(label,"goto __SW%x_DEF;",script->syntax.curly[pos].index);
+ sprintf(label,"goto __SW%x_DEF;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
}
// Label end
- sprintf(label,"__SW%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label,"__SW%x_FIN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos, p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
linkdb_final(&script->syntax.curly[pos].case_label); // free the list of case label
script->syntax.curly_count--;
//Closing decision if, for , while
@@ -1611,6 +1608,7 @@ const char* parse_syntax(const char* p)
{
const char *p2 = script->skip_word(p);
+ nullpo_retr(NULL, p);
switch(*p) {
case 'B':
case 'b':
@@ -1620,16 +1618,16 @@ const char* parse_syntax(const char* p)
int pos = script->syntax.curly_count - 1;
while(pos >= 0) {
if(script->syntax.curly[pos].type == TYPE_DO) {
- sprintf(label,"goto __DO%x_FIN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __DO%x_FIN;", (unsigned int)script->syntax.curly[pos].index);
break;
} else if(script->syntax.curly[pos].type == TYPE_FOR) {
- sprintf(label,"goto __FR%x_FIN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __FR%x_FIN;", (unsigned int)script->syntax.curly[pos].index);
break;
} else if(script->syntax.curly[pos].type == TYPE_WHILE) {
- sprintf(label,"goto __WL%x_FIN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __WL%x_FIN;", (unsigned int)script->syntax.curly[pos].index);
break;
} else if(script->syntax.curly[pos].type == TYPE_SWITCH) {
- sprintf(label,"goto __SW%x_FIN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __SW%x_FIN;", (unsigned int)script->syntax.curly[pos].index);
break;
}
pos--;
@@ -1663,15 +1661,15 @@ const char* parse_syntax(const char* p)
char *np;
if(script->syntax.curly[pos].count != 1) {
//Jump for FALLTHRU
- sprintf(label,"goto __SW%x_%xJ;",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label,"goto __SW%x_%xJ;", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// You are here labeled
- sprintf(label,"__SW%x_%x",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label,"__SW%x_%x", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
l=script->add_str(label);
- script->set_label(l,script->pos, p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
}
//Decision statement switch
p = script->skip_space(p2);
@@ -1701,7 +1699,7 @@ const char* parse_syntax(const char* p)
if(*p != ':')
disp_error_message("parse_syntax: expect ':'",p);
sprintf(label,"if(%d != $@__SW%x_VAL) goto __SW%x_%x;",
- v,script->syntax.curly[pos].index,script->syntax.curly[pos].index,script->syntax.curly[pos].count+1);
+ v, (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count+1);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
// Bad I do not parse twice
p2 = script->parse_line(label);
@@ -1709,16 +1707,16 @@ const char* parse_syntax(const char* p)
script->syntax.curly_count--;
if(script->syntax.curly[pos].count != 1) {
// Label after the completion of FALLTHRU
- sprintf(label,"__SW%x_%xJ",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label, "__SW%x_%xJ", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
}
// check duplication of case label [Rayce]
if(linkdb_search(&script->syntax.curly[pos].case_label, (void*)h64BPTRSIZE(v)) != NULL)
disp_error_message("parse_syntax: dup 'case'",p);
linkdb_insert(&script->syntax.curly[pos].case_label, (void*)h64BPTRSIZE(v), (void*)1);
- sprintf(label,"__setr $@__SW%x_VAL,0;",script->syntax.curly[pos].index);
+ sprintf(label, "__setr $@__SW%x_VAL,0;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
@@ -1732,14 +1730,14 @@ const char* parse_syntax(const char* p)
int pos = script->syntax.curly_count - 1;
while(pos >= 0) {
if(script->syntax.curly[pos].type == TYPE_DO) {
- sprintf(label,"goto __DO%x_NXT;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __DO%x_NXT;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[pos].flag = 1; //Flag put the link for continue
break;
} else if(script->syntax.curly[pos].type == TYPE_FOR) {
- sprintf(label,"goto __FR%x_NXT;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __FR%x_NXT;", (unsigned int)script->syntax.curly[pos].index);
break;
} else if(script->syntax.curly[pos].type == TYPE_WHILE) {
- sprintf(label,"goto __WL%x_NXT;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __WL%x_NXT;", (unsigned int)script->syntax.curly[pos].index);
break;
}
pos--;
@@ -1776,20 +1774,20 @@ const char* parse_syntax(const char* p)
if(*p != ':') {
disp_error_message("parse_syntax: need ':'",p);
}
- sprintf(label,"__SW%x_%x",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label, "__SW%x_%x", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
// Skip to the next link w/o condition
- sprintf(label,"goto __SW%x_%x;",script->syntax.curly[pos].index,script->syntax.curly[pos].count+1);
+ sprintf(label, "goto __SW%x_%x;", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count + 1);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// The default label
- sprintf(label,"__SW%x_DEF",script->syntax.curly[pos].index);
+ sprintf(label, "__SW%x_DEF", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
script->syntax.curly[script->syntax.curly_count - 1].flag = 1;
script->syntax.curly[pos].count++;
@@ -1805,9 +1803,9 @@ const char* parse_syntax(const char* p)
script->syntax.curly[script->syntax.curly_count].index = script->syntax.index++;
script->syntax.curly[script->syntax.curly_count].flag = 0;
// Label of the (do) form here
- sprintf(label,"__DO%x_BGN",script->syntax.curly[script->syntax.curly_count].index);
+ sprintf(label, "__DO%x_BGN", (unsigned int)script->syntax.curly[script->syntax.curly_count].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
script->syntax.curly_count++;
return p;
}
@@ -1836,9 +1834,9 @@ const char* parse_syntax(const char* p)
script->syntax.curly_count--;
// Form the start of label decision
- sprintf(label,"__FR%x_J",script->syntax.curly[pos].index);
+ sprintf(label, "__FR%x_J", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
p=script->skip_space(p);
if(*p == ';') {
@@ -1846,7 +1844,7 @@ const char* parse_syntax(const char* p)
;
} else {
// Skip to the end point if the condition is false
- sprintf(label,"__FR%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__FR%x_FIN", (unsigned int)script->syntax.curly[pos].index);
script->addl(script->add_str("__jump_zero"));
script->addc(C_ARG);
p=script->parse_expr(p);
@@ -1859,15 +1857,15 @@ const char* parse_syntax(const char* p)
p++;
// Skip to the beginning of the loop
- sprintf(label,"goto __FR%x_BGN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __FR%x_BGN;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// Labels to form the next loop
- sprintf(label,"__FR%x_NXT",script->syntax.curly[pos].index);
+ sprintf(label, "__FR%x_NXT", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
// Process the next time you enter the loop
// A ')' last for; flag to be treated as'
@@ -1878,15 +1876,15 @@ const char* parse_syntax(const char* p)
script->parse_syntax_for_flag = 0;
// Skip to the determination process conditions
- sprintf(label,"goto __FR%x_J;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __FR%x_J;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// Loop start labeling
- sprintf(label,"__FR%x_BGN",script->syntax.curly[pos].index);
+ sprintf(label, "__FR%x_BGN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
return p;
} else if( p2 - p == 8 && strncmp(p, "function", 8) == 0 ) {
// internal script function
@@ -1925,7 +1923,7 @@ const char* parse_syntax(const char* p)
++script->syntax.curly_count;
// Jump over the function code
- sprintf(label, "goto __FN%x_FIN;", script->syntax.curly[script->syntax.curly_count-1].index);
+ sprintf(label, "goto __FN%x_FIN;", (unsigned int)script->syntax.curly[script->syntax.curly_count-1].index);
script->syntax.curly[script->syntax.curly_count].type = TYPE_NULL;
++script->syntax.curly_count;
script->parse_line(label);
@@ -1936,9 +1934,9 @@ const char* parse_syntax(const char* p)
if( script->str_data[l].type == C_NOP || script->str_data[l].type == C_USERFUNC )// register only, if the name was not used by something else
{
script->str_data[l].type = C_USERFUNC;
- script->set_label(l, script->pos, p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
if( script->parse_options&SCRIPT_USE_LABEL_DB )
- script->label_add(l,script->pos);
+ script->label_add(l, VECTOR_LENGTH(script->buf));
}
else
disp_error_message("parse_syntax:function: function name is invalid", func_name);
@@ -1964,7 +1962,7 @@ const char* parse_syntax(const char* p)
script->syntax.curly[script->syntax.curly_count].count = 1;
script->syntax.curly[script->syntax.curly_count].index = script->syntax.index++;
script->syntax.curly[script->syntax.curly_count].flag = 0;
- sprintf(label,"__IF%x_%x",script->syntax.curly[script->syntax.curly_count].index,script->syntax.curly[script->syntax.curly_count].count);
+ sprintf(label, "__IF%x_%x", (unsigned int)script->syntax.curly[script->syntax.curly_count].index, (unsigned int)script->syntax.curly[script->syntax.curly_count].count);
script->syntax.curly_count++;
script->addl(script->add_str("__jump_zero"));
script->addc(C_ARG);
@@ -1988,7 +1986,7 @@ const char* parse_syntax(const char* p)
script->syntax.curly[script->syntax.curly_count].count = 1;
script->syntax.curly[script->syntax.curly_count].index = script->syntax.index++;
script->syntax.curly[script->syntax.curly_count].flag = 0;
- sprintf(label,"$@__SW%x_VAL",script->syntax.curly[script->syntax.curly_count].index);
+ sprintf(label, "$@__SW%x_VAL", (unsigned int)script->syntax.curly[script->syntax.curly_count].index);
script->syntax.curly_count++;
script->addl(script->add_str("__setr"));
script->addc(C_ARG);
@@ -2016,12 +2014,12 @@ const char* parse_syntax(const char* p)
script->syntax.curly[script->syntax.curly_count].index = script->syntax.index++;
script->syntax.curly[script->syntax.curly_count].flag = 0;
// Form the start of label decision
- sprintf(label,"__WL%x_NXT",script->syntax.curly[script->syntax.curly_count].index);
+ sprintf(label, "__WL%x_NXT", (unsigned int)script->syntax.curly[script->syntax.curly_count].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
// Skip to the end point if the condition is false
- sprintf(label,"__WL%x_FIN",script->syntax.curly[script->syntax.curly_count].index);
+ sprintf(label, "__WL%x_FIN", (unsigned int)script->syntax.curly[script->syntax.curly_count].index);
script->syntax.curly_count++;
script->addl(script->add_str("__jump_zero"));
script->addc(C_ARG);
@@ -2040,6 +2038,7 @@ const char* parse_syntax_close(const char *p) {
// If (...) for (...) hoge (); as to make sure closed closed once again
int flag;
+ nullpo_retr(NULL, p);
do {
p = script->parse_syntax_close_sub(p,&flag);
} while(flag);
@@ -2067,15 +2066,15 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
script->parse_nextline(false, p);
// Skip to the last location if
- sprintf(label,"goto __IF%x_FIN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __IF%x_FIN;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// Put the label of the location
- sprintf(label,"__IF%x_%x",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label, "__IF%x_%x", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
script->syntax.curly[pos].count++;
p = script->skip_space(p);
@@ -2090,7 +2089,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
if(*p != '(') {
disp_error_message("need '('",p);
}
- sprintf(label,"__IF%x_%x",script->syntax.curly[pos].index,script->syntax.curly[pos].count);
+ sprintf(label, "__IF%x_%x", (unsigned int)script->syntax.curly[pos].index, (unsigned int)script->syntax.curly[pos].count);
script->addl(script->add_str("__jump_zero"));
script->addc(C_ARG);
p=script->parse_expr(p);
@@ -2111,9 +2110,9 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
// Close if
script->syntax.curly_count--;
// Put the label of the final location
- sprintf(label,"__IF%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__IF%x_FIN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
if(script->syntax.curly[pos].flag == 1) {
// Because the position of the pointer is the same if not else for this
return bp;
@@ -2124,9 +2123,9 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
if(script->syntax.curly[pos].flag) {
// (Come here continue) to form the label here
- sprintf(label,"__DO%x_NXT",script->syntax.curly[pos].index);
+ sprintf(label, "__DO%x_NXT", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
}
// Skip to the end point if the condition is false
@@ -2144,7 +2143,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
// do-block end is a new line
script->parse_nextline(false, p);
- sprintf(label,"__DO%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__DO%x_FIN", (unsigned int)script->syntax.curly[pos].index);
script->addl(script->add_str("__jump_zero"));
script->addc(C_ARG);
p=script->parse_expr(p);
@@ -2153,15 +2152,15 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
script->addc(C_FUNC);
// Skip to the starting point
- sprintf(label,"goto __DO%x_BGN;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __DO%x_BGN;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// Form label of the end point conditions
- sprintf(label,"__DO%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__DO%x_FIN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
p = script->skip_space(p);
if(*p != ';') {
disp_error_message("parse_syntax: need ';'",p);
@@ -2175,15 +2174,15 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
script->parse_nextline(false, p);
// Skip to the next loop
- sprintf(label,"goto __FR%x_NXT;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __FR%x_NXT;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// End for labeling
- sprintf(label,"__FR%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__FR%x_FIN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
script->syntax.curly_count--;
return p;
} else if(script->syntax.curly[pos].type == TYPE_WHILE) {
@@ -2191,15 +2190,15 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
script->parse_nextline(false, p);
// Skip to the decision while
- sprintf(label,"goto __WL%x_NXT;",script->syntax.curly[pos].index);
+ sprintf(label, "goto __WL%x_NXT;", (unsigned int)script->syntax.curly[pos].index);
script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL;
script->parse_line(label);
script->syntax.curly_count--;
// End while labeling
- sprintf(label,"__WL%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__WL%x_FIN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
script->syntax.curly_count--;
return p;
} else if(script->syntax.curly[pos].type == TYPE_USERFUNC) {
@@ -2210,9 +2209,9 @@ const char* parse_syntax_close_sub(const char* p,int* flag)
script->syntax.curly_count--;
// Put the label of the location
- sprintf(label,"__FN%x_FIN",script->syntax.curly[pos].index);
+ sprintf(label, "__FN%x_FIN", (unsigned int)script->syntax.curly[pos].index);
l=script->add_str(label);
- script->set_label(l,script->pos,p);
+ script->set_label(l, VECTOR_LENGTH(script->buf), p);
script->syntax.curly_count--;
return p;
} else {
@@ -2226,6 +2225,7 @@ bool script_get_constant(const char* name, int* value)
{
int n = script->search_str(name);
+ nullpo_retr(false, value);
if( n == -1 || script->str_data[n].type != C_INT )
{// not found or not a constant
return false;
@@ -2289,15 +2289,18 @@ void script_set_constant2(const char *name, int value, bool is_parameter, bool i
*/
void read_constdb(void)
{
- config_t constants_conf;
+ struct config_t constants_conf;
char filepath[256];
- config_setting_t *cdb;
- config_setting_t *t;
+ struct config_setting_t *cdb;
+ struct config_setting_t *t;
int i = 0;
- sprintf(filepath, "%s/constants.conf", map->db_path);
+ snprintf(filepath, 256, "%s/constants.conf", map->db_path);
+
+ if (!libconfig->load_file(&constants_conf, filepath))
+ return;
- if (libconfig->read_file(&constants_conf, filepath) || !(cdb = libconfig->setting_get_member(constants_conf.root, "constants_db"))) {
+ if ((cdb = libconfig->setting_get_member(constants_conf.root, "constants_db")) == NULL) {
ShowError("can't read %s\n", filepath);
return;
}
@@ -2345,6 +2348,8 @@ void read_constdb(void)
} else {
value = libconfig->setting_get_int(t);
}
+ if (is_parameter)
+ ShowWarning("read_constdb: Defining parameters in the constants configuration is deprecated and will no longer be possible in a future version. Parameters should be defined in source. (parameter = '%s')\n", name);
script->set_constant(name, value, is_parameter, is_deprecated);
}
script->constdb_comment(NULL);
@@ -2363,6 +2368,50 @@ void script_constdb_comment(const char *comment)
(void)comment;
}
+void script_load_parameters(void)
+{
+ int i = 0;
+ struct {
+ char *name;
+ enum status_point_types type;
+ } parameters[] = {
+ {"BaseExp", SP_BASEEXP},
+ {"JobExp", SP_JOBEXP},
+ {"Karma", SP_KARMA},
+ {"Manner", SP_MANNER},
+ {"Hp", SP_HP},
+ {"MaxHp", SP_MAXHP},
+ {"Sp", SP_SP},
+ {"MaxSp", SP_MAXSP},
+ {"StatusPoint", SP_STATUSPOINT},
+ {"BaseLevel", SP_BASELEVEL},
+ {"SkillPoint", SP_SKILLPOINT},
+ {"Class", SP_CLASS},
+ {"Zeny", SP_ZENY},
+ {"BankVault", SP_BANKVAULT},
+ {"Sex", SP_SEX},
+ {"NextBaseExp", SP_NEXTBASEEXP},
+ {"NextJobExp", SP_NEXTJOBEXP},
+ {"Weight", SP_WEIGHT},
+ {"MaxWeight", SP_MAXWEIGHT},
+ {"JobLevel", SP_JOBLEVEL},
+ {"Upper", SP_UPPER},
+ {"BaseJob", SP_BASEJOB},
+ {"BaseClass", SP_BASECLASS},
+ {"killerrid", SP_KILLERRID},
+ {"killedrid", SP_KILLEDRID},
+ {"SlotChange", SP_SLOTCHANGE},
+ {"CharRename", SP_CHARRENAME},
+ {"ModExp", SP_MOD_EXP},
+ {"ModDrop", SP_MOD_DROP},
+ {"ModDeath", SP_MOD_DEATH},
+ };
+
+ script->constdb_comment("Parameters");
+ for (i=0; i < ARRAYLENGTH(parameters); ++i)
+ script->set_constant(parameters[i].name, parameters[i].type, true, false);
+ script->constdb_comment(NULL);
+}
// Standard UNIX tab size is 8
#define TAB_SIZE 8
#define update_tabstop(tabstop,chars) \
@@ -2493,9 +2542,6 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
script->parse_cleanup_timer_id = timer->add(timer->gettick() + 10, script->parse_cleanup_timer, 0, 0);
}
- if( script->syntax.strings ) /* used only when generating translation file */
- db_destroy(script->syntax.strings);
-
memset(&script->syntax,0,sizeof(script->syntax));
script->syntax.last_func = -1;/* as valid values are >= 0 */
if( script->parser_current_npc_name ) {
@@ -2505,11 +2551,7 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
script->syntax.translation_db = strdb_get(script->translation_db, script->parser_current_npc_name);
}
- if( !script->buf ) {
- script->buf = (unsigned char *)aMalloc(SCRIPT_BLOCK_SIZE*sizeof(unsigned char));
- script->size = SCRIPT_BLOCK_SIZE;
- }
- script->pos=0;
+ VECTOR_TRUNCATE(script->buf);
script->parse_nextline(true, NULL);
// who called parse_script is responsible for clearing the database after using it, but just in case... lets clear it here
@@ -2523,7 +2565,7 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
if( script->error_report )
script->error(src,file,line,script->error_msg,script->error_pos);
aFree( script->error_msg );
- script->pos = 0;
+ VECTOR_TRUNCATE(script->buf);
for(i=LABEL_START;i<script->str_num;i++)
if(script->str_data[i].type == C_NOP) script->str_data[i].type = C_NAME;
for(i=0; i<size; i++)
@@ -2543,9 +2585,9 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
p=script->skip_space(p);
if( options&SCRIPT_IGNORE_EXTERNAL_BRACKETS )
{// does not require brackets around the script
- if( *p == '\0' && !(options&SCRIPT_RETURN_EMPTY_SCRIPT) )
- {// empty script and can return NULL
- script->pos = 0;
+ if (*p == '\0' && !(options&SCRIPT_RETURN_EMPTY_SCRIPT)) {
+ // empty script and can return NULL
+ VECTOR_TRUNCATE(script->buf);
#ifdef ENABLE_CASE_CHECK
script->local_casecheck.clear();
script->parser_current_src = NULL;
@@ -2563,9 +2605,9 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
if (retval) *retval = EXIT_FAILURE;
}
p = script->skip_space(p+1);
- if( *p == '}' && !(options&SCRIPT_RETURN_EMPTY_SCRIPT) )
- {// empty script and can return NULL
- script->pos = 0;
+ if (*p == '}' && !(options&SCRIPT_RETURN_EMPTY_SCRIPT)) {
+ // empty script and can return NULL
+ VECTOR_TRUNCATE(script->buf);
#ifdef ENABLE_CASE_CHECK
script->local_casecheck.clear();
script->parser_current_src = NULL;
@@ -2597,9 +2639,9 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
tmpp=script->skip_space(script->skip_word(p));
if(*tmpp==':' && !(strncmp(p,"default:",8) == 0 && p + 7 == tmpp)) {
i=script->add_word(p);
- script->set_label(i,script->pos,p);
+ script->set_label(i, VECTOR_LENGTH(script->buf), p);
if( script->parse_options&SCRIPT_USE_LABEL_DB )
- script->label_add(i,script->pos);
+ script->label_add(i, VECTOR_LENGTH(script->buf));
p=tmpp+1;
p=script->skip_space(p);
continue;
@@ -2621,8 +2663,8 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
script->str_data[i].type=C_NAME;
script->str_data[i].label=i;
for (j = script->str_data[i].backpatch; j >= 0 && j != 0x00ffffff; ) {
- int next = GETVALUE(script->buf,j);
- SETVALUE(script->buf,j,i);
+ int next = GETVALUE(&script->buf, j);
+ SETVALUE(&script->buf, j, i);
j = next;
}
} else if(script->str_data[i].type == C_USERFUNC) {
@@ -2639,37 +2681,39 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
}
#ifdef SCRIPT_DEBUG_DISP
- for(i=0;i<script->pos;i++) {
- if((i&15)==0) ShowMessage("%04x : ",i);
- ShowMessage("%02x ",script->buf[i]);
- if((i&15)==15) ShowMessage("\n");
+ for (i = 0; i < VECTOR_LENGTH(script->buf); i++) {
+ if ((i&15) == 0)
+ ShowMessage("%04x : ",i);
+ ShowMessage("%02x ", VECTOR_INDEX(script->buf, i));
+ if ((i&15) == 15)
+ ShowMessage("\n");
}
ShowMessage("\n");
#endif
#ifdef SCRIPT_DEBUG_DISASM
i = 0;
- while(i < script->pos) {
- int j = i;
- c_op op = script->get_com(script->buf,&i);
+ while (i < VECTOR_LENGTH(script->buf)) {
+ c_op op = script->get_com(&script->buf, &i);
+ int j = i; // Note: i is modified in the line above.
ShowMessage("%06x %s", i, script->op2name(op));
- j = i;
- switch(op) {
+
+ switch (op) {
case C_INT:
- ShowMessage(" %d", script->get_num(script->buf,&i));
+ ShowMessage(" %d", script->get_num(&script->buf, &i));
break;
case C_POS:
- ShowMessage(" 0x%06x", *(int*)(script->buf+i)&0xffffff);
+ ShowMessage(" 0x%06x", *(int*)(&VECTOR_INDEX(script->buf, i))&0xffffff);
i += 3;
break;
case C_NAME:
- j = (*(int*)(script->buf+i)&0xffffff);
+ j = (*(int*)(&VECTOR_INDEX(script->buf, i))&0xffffff);
ShowMessage(" %s", ( j == 0xffffff ) ? "?? unknown ??" : script->get_str(j));
i += 3;
break;
case C_STR:
- j = (int)strlen((char*)script->buf + i);
- ShowMessage(" %s", script->buf + i);
+ j = (int)strlen((char*)&VECTOR_INDEX(script->buf, i));
+ ShowMessage(" %s", &VECTOR_INDEX(script->buf, i));
i += j+1;
break;
}
@@ -2678,9 +2722,9 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
#endif
CREATE(code,struct script_code,1);
- code->script_buf = (unsigned char *)aMalloc(script->pos*sizeof(unsigned char));
- memcpy(code->script_buf, script->buf, script->pos);
- code->script_size = script->pos;
+ VECTOR_INIT(code->script_buf);
+ VECTOR_ENSURE(code->script_buf, VECTOR_LENGTH(script->buf), 1);
+ VECTOR_PUSHARRAY(code->script_buf, VECTOR_DATA(script->buf), VECTOR_LENGTH(script->buf));
code->local.vars = NULL;
code->local.arrays = NULL;
#ifdef ENABLE_CASE_CHECK
@@ -2697,6 +2741,7 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
struct map_session_data *script_rid2sd(struct script_state *st)
{
struct map_session_data *sd;
+ nullpo_retr(NULL, st);
if( !( sd = map->id2sd(st->rid) ) ) {
ShowError("script_rid2sd: fatal error ! player not attached!\n");
script->reportfunc(st);
@@ -2746,7 +2791,16 @@ char *get_val_npcscope_str(struct script_state* st, struct reg_db *n, struct scr
return NULL;
}
+char *get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ struct script_reg_str *p = NULL;
+ nullpo_retr(NULL, n);
+
+ p = i64db_get(n->vars, reference_getuid(data));
+ return p ? p->value : NULL;
+}
+
char *get_val_instance_str(struct script_state* st, const char* name, struct script_data* data) {
+ nullpo_retr(NULL, st);
if (st->instance_id >= 0) {
return (char*)i64db_get(instance->list[st->instance_id].regs.vars, reference_getuid(data));
} else {
@@ -2762,6 +2816,14 @@ int get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct scrip
return 0;
}
+int get_val_pc_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ struct script_reg_num *p = NULL;
+ nullpo_retr(0, n);
+
+ p = i64db_get(n->vars, reference_getuid(data));
+ return p ? p->value : 0;
+}
+
int get_val_instance_num(struct script_state* st, const char* name, struct script_data* data) {
if (st->instance_id >= 0)
return (int)i64db_iget(instance->list[st->instance_id].regs.vars, reference_getuid(data));
@@ -2784,7 +2846,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
char postfix;
struct map_session_data *sd = NULL;
- if( !data_isreference(data) )
+ if (!data_isreference(data))
return data;// not a variable/constant
name = reference_getname(data);
@@ -2799,10 +2861,10 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
}
//##TODO use reference_tovariable(data) when it's confirmed that it works [FlavioJS]
- if( !reference_toconstant(data) && not_server_variable(prefix) ) {
+ if (!reference_toconstant(data) && not_server_variable(prefix) && reference_getref(data) == NULL) {
sd = script->rid2sd(st);
- if( sd == NULL ) {// needs player attached
- if( postfix == '$' ) {// string variable
+ if (sd == NULL) {// needs player attached
+ if (postfix == '$') {// string variable
ShowWarning("script_get_val: cannot access player variable '%s', defaulting to \"\"\n", name);
data->type = C_CONSTSTR;
data->u.str = "";
@@ -2815,43 +2877,58 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
}
}
- if( postfix == '$' ) {// string variable
+ if (postfix == '$') {
+ // string variable
+ const char *str = NULL;
- switch( prefix ) {
- case '@':
- data->u.str = pc->readregstr(sd, data->u.num);
- break;
- case '$':
- data->u.str = mapreg->readregstr(data->u.num);
- break;
- case '#':
- if( name[1] == '#' )
- data->u.str = pc_readaccountreg2str(sd, data->u.num);// global
- else
- data->u.str = pc_readaccountregstr(sd, data->u.num);// local
- break;
- case '.':
- if (data->ref)
- data->u.str = script->get_val_ref_str(st, data->ref, data);
- else if (name[1] == '@')
- data->u.str = script->get_val_scope_str(st, &st->stack->scope, data);
- else
- data->u.str = script->get_val_npc_str(st, &st->script->local, data);
- break;
- case '\'':
- data->u.str = script->get_val_instance_str(st, name, data);
- break;
- default:
- data->u.str = pc_readglobalreg_str(sd, data->u.num);
- break;
+ switch (prefix) {
+ case '@':
+ if (data->ref) {
+ str = script->get_val_ref_str(st, data->ref, data);
+ } else {
+ str = pc->readregstr(sd, data->u.num);
+ }
+ break;
+ case '$':
+ str = mapreg->readregstr(data->u.num);
+ break;
+ case '#':
+ if (data->ref) {
+ str = script->get_val_pc_ref_str(st, data->ref, data);
+ } else if (name[1] == '#') {
+ str = pc_readaccountreg2str(sd, data->u.num);// global
+ } else {
+ str = pc_readaccountregstr(sd, data->u.num);// local
+ }
+ break;
+ case '.':
+ if (data->ref) {
+ str = script->get_val_ref_str(st, data->ref, data);
+ } else if (name[1] == '@') {
+ str = script->get_val_scope_str(st, &st->stack->scope, data);
+ } else {
+ str = script->get_val_npc_str(st, &st->script->local, data);
+ }
+ break;
+ case '\'':
+ str = script->get_val_instance_str(st, name, data);
+ break;
+ default:
+ if (data->ref) {
+ str = script->get_val_pc_ref_str(st, data->ref, data);
+ } else {
+ str = pc_readglobalreg_str(sd, data->u.num);
+ }
+ break;
}
- if( data->u.str == NULL || data->u.str[0] == '\0' ) {// empty string
+ if (str == NULL || str[0] == '\0') {
+ // empty string
data->type = C_CONSTSTR;
data->u.str = "";
} else {// duplicate string
data->type = C_STR;
- data->u.str = aStrdup(data->u.str);
+ data->u.mutstr = aStrdup(str);
}
} else {// integer variable
@@ -2862,36 +2939,48 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
data->u.num = reference_getconstant(data);
} else if( reference_toparam(data) ) {
data->u.num = pc->readparam(sd, reference_getparamtype(data));
- } else
- switch( prefix ) {
- case '@':
+ } else {
+ switch (prefix) {
+ case '@':
+ if (data->ref) {
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ } else {
data->u.num = pc->readreg(sd, data->u.num);
- break;
- case '$':
- data->u.num = mapreg->readreg(data->u.num);
- break;
- case '#':
- if( name[1] == '#' )
- data->u.num = pc_readaccountreg2(sd, data->u.num);// global
- else
- data->u.num = pc_readaccountreg(sd, data->u.num);// local
- break;
- case '.':
- if (data->ref)
- data->u.num = script->get_val_ref_num(st, data->ref, data);
- else if (name[1] == '@')
- data->u.num = script->get_val_scope_num(st, &st->stack->scope, data);
- else
- data->u.num = script->get_val_npc_num(st, &st->script->local, data);
- break;
- case '\'':
- data->u.num = script->get_val_instance_num(st, name, data);
- break;
- default:
+ }
+ break;
+ case '$':
+ data->u.num = mapreg->readreg(data->u.num);
+ break;
+ case '#':
+ if (data->ref) {
+ data->u.num = script->get_val_pc_ref_num(st, data->ref, data);
+ } else if (name[1] == '#') {
+ data->u.num = pc_readaccountreg2(sd, data->u.num);// global
+ } else {
+ data->u.num = pc_readaccountreg(sd, data->u.num);// local
+ }
+ break;
+ case '.':
+ if (data->ref) {
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ } else if (name[1] == '@') {
+ data->u.num = script->get_val_scope_num(st, &st->stack->scope, data);
+ } else {
+ data->u.num = script->get_val_npc_num(st, &st->script->local, data);
+ }
+ break;
+ case '\'':
+ data->u.num = script->get_val_instance_num(st, name, data);
+ break;
+ default:
+ if (data->ref) {
+ data->u.num = script->get_val_pc_ref_num(st, data->ref, data);
+ } else {
data->u.num = pc_readglobalreg(sd, data->u.num);
- break;
+ }
+ break;
}
-
+ }
}
data->ref = NULL;
@@ -2908,12 +2997,17 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
* @param ref[in] the container to look up the reference into.
* @return the retrieved value of the reference.
*/
-void* get_val2(struct script_state* st, int64 uid, struct reg_db *ref) {
+const void *get_val2(struct script_state *st, int64 uid, struct reg_db *ref)
+{
struct script_data* data;
+ nullpo_retr(NULL, st);
script->push_val(st->stack, C_NAME, uid, ref);
data = script_getdatatop(st, -1);
script->get_val(st, data);
- return (data->type == C_INT ? (void*)h64BPTRSIZE((int32)data->u.num) : (void*)h64BPTRSIZE(data->u.str)); // u.num is int32 because it comes from script->get_val
+ if (data->type == C_INT) // u.num is int32 because it comes from script->get_val
+ return (const void *)h64BPTRSIZE((int32)data->u.num);
+ else
+ return (const void *)h64BPTRSIZE(data->u.str);
}
/**
* Because, currently, array members with key 0 are indifferenciable from normal variables, we should ensure its actually in
@@ -2921,17 +3015,21 @@ void* get_val2(struct script_state* st, int64 uid, struct reg_db *ref) {
**/
void script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref) {
const char *name = script->get_str(script_getvarid(uid));
- // is here st can be null pointer and st->rid is wrong?
- struct reg_db *src = script->array_src(st, sd ? sd : st->rid ? map->id2sd(st->rid) : NULL, name, ref);
+ struct reg_db *src = NULL;
bool insert = false;
- if (sd && !st) {
- /* when sd comes, st isn't available */
+ if (st == NULL) {
+ // Special case with no st available, only sd
+ nullpo_retv(sd);
+ src = script->array_src(NULL, sd, name, ref);
insert = true;
} else {
+ if (sd == NULL && st->rid != 0)
+ sd = map->id2sd(st->rid); // Retrieve the missing sd
+ src = script->array_src(st, sd, name, ref);
if( is_string_variable(name) ) {
- char* str = (char*)script->get_val2(st, uid, ref);
- if( str && *str )
+ const char *str = script->get_val2(st, uid, ref);
+ if (str != NULL && *str != '\0')
insert = true;
script_removetop(st, -1, 0);
} else {
@@ -2995,7 +3093,8 @@ unsigned int script_array_highest_key(struct script_state *st, struct map_sessio
}
return 0;
}
-int script_free_array_db(DBKey key, DBData *data, va_list ap) {
+int script_free_array_db(union DBKey key, struct DBData *data, va_list ap)
+{
struct script_array *sa = DB->data2ptr(data);
aFree(sa->members);
ers_free(script->array_ers, sa);
@@ -3005,6 +3104,8 @@ int script_free_array_db(DBKey key, DBData *data, va_list ap) {
* Clears script_array and removes it from script->array_db
**/
void script_array_delete(struct reg_db *src, struct script_array *sa) {
+ nullpo_retv(src);
+ nullpo_retv(sa);
aFree(sa->members);
idb_remove(src->arrays, sa->id);
ers_free(script->array_ers, sa);
@@ -3017,6 +3118,7 @@ void script_array_delete(struct reg_db *src, struct script_array *sa) {
void script_array_remove_member(struct reg_db *src, struct script_array *sa, unsigned int idx) {
unsigned int i, cursor;
+ nullpo_retv(sa);
/* its the only member left, no need to do anything other than delete the array data */
if( sa->size == 1 ) {
script->array_delete(src,sa);
@@ -3041,8 +3143,8 @@ void script_array_remove_member(struct reg_db *src, struct script_array *sa, uns
* @param idx the index of the array member being inserted
**/
void script_array_add_member(struct script_array *sa, unsigned int idx) {
+ nullpo_retv(sa);
RECREATE(sa->members, unsigned int, ++sa->size);
-
sa->members[sa->size - 1] = idx;
}
/**
@@ -3051,33 +3153,43 @@ void script_array_add_member(struct script_array *sa, unsigned int idx) {
**/
struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
struct reg_db *src = NULL;
+ nullpo_retr(NULL, name);
- switch( name[0] ) {
+ switch (name[0]) {
/* from player */
- default: /* char reg */
- case '@':/* temp char reg */
- case '#':/* account reg */
+ default: /* char reg */
+ case '@':/* temp char reg */
+ case '#':/* account reg */
+ if (ref != NULL) {
+ src = ref;
+ } else {
+ nullpo_retr(NULL, sd);
src = &sd->regs;
- break;
- case '$':/* map reg */
- src = &mapreg->regs;
- break;
- case '.':/* npc/script */
- if( ref )
- src = ref;
- else
- src = (name[1] == '@') ? &st->stack->scope : &st->script->local;
- break;
- case '\'':/* instance */
- if( st->instance_id >= 0 ) {
- src = &instance->list[st->instance_id].regs;
- }
- break;
+ }
+ break;
+ case '$':/* map reg */
+ src = &mapreg->regs;
+ break;
+ case '.':/* npc/script */
+ if (ref != NULL) {
+ src = ref;
+ } else {
+ nullpo_retr(NULL, st);
+ src = (name[1] == '@') ? &st->stack->scope : &st->script->local;
+ }
+ break;
+ case '\'':/* instance */
+ nullpo_retr(NULL, st);
+ if (st->instance_id >= 0) {
+ src = &instance->list[st->instance_id].regs;
+ }
+ break;
}
- if( src ) {
- if( !src->arrays )
+ if (src) {
+ if (!src->arrays) {
src->arrays = idb_alloc(DB_OPT_BASE);
+ }
return src;
}
return NULL;
@@ -3095,6 +3207,7 @@ void script_array_update(struct reg_db *src, int64 num, bool empty) {
int id = script_getvarid(num);
unsigned int index = script_getvaridx(num);
+ nullpo_retv(src);
if (!src->arrays) {
src->arrays = idb_alloc(DB_OPT_BASE);
} else {
@@ -3134,6 +3247,7 @@ void set_reg_npcscope_str(struct script_state* st, struct reg_db *n, int64 num,
{
if (n)
{
+ nullpo_retv(str);
if (str[0]) {
i64db_put(n->vars, num, aStrdup(str));
if (script_getvaridx(num))
@@ -3146,6 +3260,99 @@ void set_reg_npcscope_str(struct script_state* st, struct reg_db *n, int64 num,
}
}
+void set_reg_pc_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str)
+{
+ struct script_reg_str *p = NULL;
+ unsigned int index = script_getvaridx(num);
+
+ nullpo_retv(n);
+
+ if ((p = i64db_get(n->vars, num)) != NULL) {
+ if (str[0]) {
+ if (p->value) {
+ aFree(p->value);
+ } else if (index) {
+ script->array_update(n, num, false);
+ }
+ p->value = aStrdup(str);
+ } else {
+ p->value = NULL;
+ if (index) {
+ script->array_update(n, num, true);
+ }
+ }
+
+ if (!pc->reg_load) {
+ p->flag.update = 1;
+ }
+ } else if (str[0]) {
+ struct DBData prev;
+ if (index) {
+ script->array_update(n, num, false);
+ }
+
+ p = ers_alloc(pc->str_reg_ers, struct script_reg_str);
+ p->value = aStrdup(str);
+
+ if (!pc->reg_load) {
+ p->flag.update = 1;
+ }
+ p->flag.type = 1;
+
+ if(n->vars->put(n->vars, DB->i642key(num), DB->ptr2data(p), &prev)) {
+ p = DB->data2ptr(&prev);
+ if (p->value) {
+ aFree(p->value);
+ }
+ ers_free(pc->str_reg_ers, p);
+ }
+ }
+}
+
+void set_reg_pc_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val)
+{
+ struct script_reg_num *p = NULL;
+ unsigned int index = script_getvaridx(num);
+
+ nullpo_retv(n);
+
+ if ((p = i64db_get(n->vars, num)) != NULL) {
+ if (val) {
+ if (!p->value && index) {
+ script->array_update(n, num, false);
+ }
+ p->value = val;
+ } else {
+ p->value = 0;
+ if (index) {
+ script->array_update(n, num, true);
+ }
+ }
+
+ if (!pc->reg_load) {
+ p->flag.update = 1;
+ }
+ } else if (val) {
+ struct DBData prev;
+ if (index) {
+ script->array_update(n, num, false);
+ }
+
+ p = ers_alloc(pc->num_reg_ers, struct script_reg_num);
+ p->value = val;
+
+ if (!pc->reg_load) {
+ p->flag.update = 1;
+ }
+ p->flag.type = 1;
+
+ if(n->vars->put(n->vars, DB->i642key(num), DB->ptr2data(p), &prev)) {
+ p = DB->data2ptr(&prev);
+ ers_free(pc->num_reg_ers, p);
+ }
+ }
+}
+
void set_reg_npcscope_num(struct script_state* st, struct reg_db *n, int64 num, const char* name, int val)
{
if (n) {
@@ -3163,6 +3370,7 @@ void set_reg_npcscope_num(struct script_state* st, struct reg_db *n, int64 num,
void set_reg_instance_str(struct script_state* st, int64 num, const char* name, const char *str)
{
+ nullpo_retv(st);
if (st->instance_id >= 0) {
if (str[0]) {
i64db_put(instance->list[st->instance_id].regs.vars, num, aStrdup(str));
@@ -3181,6 +3389,7 @@ void set_reg_instance_str(struct script_state* st, int64 num, const char* name,
void set_reg_instance_num(struct script_state* st, int64 num, const char* name, int val)
{
+ nullpo_retv(st);
if (st->instance_id >= 0) {
if (val != 0) {
i64db_iput(instance->list[st->instance_id].regs.vars, num, val);
@@ -3213,57 +3422,78 @@ void set_reg_instance_num(struct script_state* st, int64 num, const char* name,
*------------------------------------------*/
int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref)
{
- char prefix = name[0];
+ char prefix;
+ nullpo_ret(name);
+ prefix = name[0];
if (strlen(name) > SCRIPT_VARNAME_LENGTH) {
ShowError("script:set_reg: variable name too long. '%s'\n", name);
- script->reportsrc(st);
- st->state = END;
+ if (st) {
+ script->reportsrc(st);
+ st->state = END;
+ }
return 0;
}
- if( is_string_variable(name) ) {// string variable
+ if (is_string_variable(name)) {// string variable
const char *str = (const char*)value;
switch (prefix) {
- case '@':
+ case '@':
+ if (ref) {
+ script->set_reg_ref_str(st, ref, num, name, str);
+ } else {
pc->setregstr(sd, num, str);
- return 1;
- case '$':
- return mapreg->setregstr(num, str);
- case '#':
- return (name[1] == '#') ?
- pc_setaccountreg2str(sd, num, str) :
- pc_setaccountregstr(sd, num, str);
- case '.':
- if (ref)
- script->set_reg_ref_str(st, ref, num, name, str);
- else if (name[1] == '@')
- script->set_reg_scope_str(st, &st->stack->scope, num, name, str);
- else
- script->set_reg_npc_str(st, &st->script->local, num, name, str);
- return 1;
- case '\'':
- set_reg_instance_str(st, num, name, str);
- return 1;
- default:
- return pc_setglobalreg_str(sd, num, str);
+ }
+ return 1;
+ case '$':
+ mapreg->setregstr(num, str);
+ return 1;
+ case '#':
+ if (ref) {
+ script->set_reg_pc_ref_str(st, ref, num, name, str);
+ } else if (name[1] == '#') {
+ pc_setaccountreg2str(sd, num, str);
+ } else {
+ pc_setaccountregstr(sd, num, str);
+ }
+ return 1;
+ case '.':
+ if (ref) {
+ script->set_reg_ref_str(st, ref, num, name, str);
+ } else if (name[1] == '@') {
+ script->set_reg_scope_str(st, &st->stack->scope, num, name, str);
+ } else {
+ script->set_reg_npc_str(st, &st->script->local, num, name, str);
+ }
+ return 1;
+ case '\'':
+ set_reg_instance_str(st, num, name, str);
+ return 1;
+ default:
+ if (ref) {
+ script->set_reg_pc_ref_str(st, ref, num, name, str);
+ } else {
+ pc_setglobalreg_str(sd, num, str);
+ }
+ return 1;
}
} else {// integer variable
// FIXME: This isn't safe, in 32bits systems we're converting a 64bit pointer
// to a 32bit int, this will lead to overflows! [Panikon]
int val = (int)h64BPTRSIZE(value);
- if(script->str_data[script_getvarid(num)].type == C_PARAM) {
- if( pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0 ) {
- if( st != NULL ) {
+ if (script->str_data[script_getvarid(num)].type == C_PARAM) {
+ if (pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0) {
+ if (st != NULL) {
ShowError("script:set_reg: failed to set param '%s' to %d.\n", name, val);
script->reportsrc(st);
// Instead of just stop the script execution we let the character close
// the window if it was open.
st->state = (sd->state.dialog) ? CLOSE : END;
- if( st->state == CLOSE )
+ if(st->state == CLOSE) {
clif->scriptclose(sd, st->oid);
+ }
}
return 0;
}
@@ -3271,28 +3501,44 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con
}
switch (prefix) {
- case '@':
+ case '@':
+ if (ref) {
+ script->set_reg_ref_num(st, ref, num, name, val);
+ } else {
pc->setreg(sd, num, val);
- return 1;
- case '$':
- return mapreg->setreg(num, val);
- case '#':
- return (name[1] == '#') ?
- pc_setaccountreg2(sd, num, val) :
- pc_setaccountreg(sd, num, val);
- case '.':
- if (ref)
- script->set_reg_ref_num(st, ref, num, name, val);
- else if (name[1] == '@')
- script->set_reg_scope_num(st, &st->stack->scope, num, name, val);
- else
- script->set_reg_npc_num(st, &st->script->local, num, name, val);
- return 1;
- case '\'':
- set_reg_instance_num(st, num, name, val);
- return 1;
- default:
- return pc_setglobalreg(sd, num, val);
+ }
+ return 1;
+ case '$':
+ mapreg->setreg(num, val);
+ return 1;
+ case '#':
+ if (ref) {
+ script->set_reg_pc_ref_num(st, ref, num, name, val);
+ } else if (name[1] == '#') {
+ pc_setaccountreg2(sd, num, val);
+ } else {
+ pc_setaccountreg(sd, num, val);
+ }
+ return 1;
+ case '.':
+ if (ref) {
+ script->set_reg_ref_num(st, ref, num, name, val);
+ } else if (name[1] == '@') {
+ script->set_reg_scope_num(st, &st->stack->scope, num, name, val);
+ } else {
+ script->set_reg_npc_num(st, &st->script->local, num, name, val);
+ }
+ return 1;
+ case '\'':
+ set_reg_instance_num(st, num, name, val);
+ return 1;
+ default:
+ if (ref) {
+ script->set_reg_pc_ref_num(st, ref, num, name, val);
+ } else {
+ pc_setglobalreg(sd, num, val);
+ }
+ return 1;
}
}
}
@@ -3302,59 +3548,59 @@ int set_var(struct map_session_data *sd, char *name, void *val)
return script->set_reg(NULL, sd, reference_uid(script->add_str(name),0), name, val, NULL);
}
-void setd_sub(struct script_state *st, struct map_session_data *sd, const char *varname, int elem, void *value, struct reg_db *ref)
+void setd_sub(struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref)
{
script->set_reg(st, sd, reference_uid(script->add_str(varname),elem), varname, value, ref);
}
/// Converts the data to a string
-const char* conv_str(struct script_state* st, struct script_data* data)
+const char *conv_str(struct script_state *st, struct script_data* data)
{
- char* p;
-
script->get_val(st, data);
- if( data_isstring(data) )
- {// nothing to convert
+ if (data_isstring(data)) {
+ // nothing to convert
+ return data->u.str;
}
- else if( data_isint(data) )
- {// int -> string
+ if (data_isint(data)) {
+ // int -> string
+ char *p;
CREATE(p, char, ITEM_NAME_LENGTH);
snprintf(p, ITEM_NAME_LENGTH, "%"PRId64"", data->u.num);
p[ITEM_NAME_LENGTH-1] = '\0';
data->type = C_STR;
- data->u.str = p;
+ data->u.mutstr = p;
+ return data->u.mutstr;
}
- else if( data_isreference(data) )
- {// reference -> string
+ if (data_isreference(data)) {
+ // reference -> string
//##TODO when does this happen (check script->get_val) [FlavioJS]
data->type = C_CONSTSTR;
data->u.str = reference_getname(data);
- }
- else
- {// unsupported data type
- ShowError("script:conv_str: cannot convert to string, defaulting to \"\"\n");
- script->reportdata(data);
- script->reportsrc(st);
- data->type = C_CONSTSTR;
- data->u.str = "";
- }
+ return data->u.str;
+ }
+ // unsupported data type
+ ShowError("script:conv_str: cannot convert to string, defaulting to \"\"\n");
+ script->reportdata(data);
+ script->reportsrc(st);
+ data->type = C_CONSTSTR;
+ data->u.str = "";
return data->u.str;
}
/// Converts the data to an int
-int conv_num(struct script_state* st, struct script_data* data) {
- char* p;
+int conv_num(struct script_state *st, struct script_data *data)
+{
long num;
script->get_val(st, data);
- if( data_isint(data) )
- {// nothing to convert
+ if (data_isint(data)) {
+ // nothing to convert
+ return (int)data->u.num;
}
- else if( data_isstring(data) )
- {// string -> int
+ if (data_isstring(data)) {
+ // string -> int
// the result does not overflow or underflow, it is capped instead
// ex: 999999999999 is capped to INT_MAX (2147483647)
- p = data->u.str;
errno = 0;
num = strtol(data->u.str, NULL, 10);// change radix to 0 to support octal numbers "o377" and hex numbers "0xFF"
if( errno == ERANGE
@@ -3376,22 +3622,21 @@ int conv_num(struct script_state* st, struct script_data* data) {
script->reportdata(data);
script->reportsrc(st);
}
- if( data->type == C_STR )
- aFree(p);
+ if (data->type == C_STR)
+ aFree(data->u.mutstr);
data->type = C_INT;
data->u.num = (int)num;
+ return (int)data->u.num;
}
#if 0
+ // unsupported data type
// FIXME this function is being used to retrieve the position of labels and
// probably other stuff [FlavioJS]
- else
- {// unsupported data type
- ShowError("script:conv_num: cannot convert to number, defaulting to 0\n");
- script->reportdata(data);
- script->reportsrc(st);
- data->type = C_INT;
- data->u.num = 0;
- }
+ ShowError("script:conv_num: cannot convert to number, defaulting to 0\n");
+ script->reportdata(data);
+ script->reportsrc(st);
+ data->type = C_INT;
+ data->u.num = 0;
#endif
return (int)data->u.num;
}
@@ -3402,6 +3647,7 @@ int conv_num(struct script_state* st, struct script_data* data) {
/// Increases the size of the stack
void stack_expand(struct script_stack* stack) {
+ nullpo_retv(stack);
stack->sp_max += 64;
stack->stack_data = (struct script_data*)aRealloc(stack->stack_data,
stack->sp_max * sizeof(stack->stack_data[0]) );
@@ -3411,6 +3657,7 @@ void stack_expand(struct script_stack* stack) {
/// Pushes a value into the stack (with reference)
struct script_data* push_val(struct script_stack* stack, enum c_op type, int64 val, struct reg_db *ref) {
+ nullpo_retr(NULL, stack);
if( stack->sp >= stack->sp_max )
script->stack_expand(stack);
stack->stack_data[stack->sp].type = type;
@@ -3421,11 +3668,25 @@ struct script_data* push_val(struct script_stack* stack, enum c_op type, int64 v
}
/// Pushes a string into the stack
-struct script_data* push_str(struct script_stack* stack, enum c_op type, char* str)
+struct script_data *push_str(struct script_stack *stack, char *str)
{
+ nullpo_retr(NULL, stack);
if( stack->sp >= stack->sp_max )
script->stack_expand(stack);
- stack->stack_data[stack->sp].type = type;
+ stack->stack_data[stack->sp].type = C_STR;
+ stack->stack_data[stack->sp].u.mutstr = str;
+ stack->stack_data[stack->sp].ref = NULL;
+ stack->sp++;
+ return &stack->stack_data[stack->sp-1];
+}
+
+/// Pushes a constant string into the stack
+struct script_data *push_conststr(struct script_stack *stack, const char *str)
+{
+ nullpo_retr(NULL, stack);
+ if( stack->sp >= stack->sp_max )
+ script->stack_expand(stack);
+ stack->stack_data[stack->sp].type = C_CONSTSTR;
stack->stack_data[stack->sp].u.str = str;
stack->stack_data[stack->sp].ref = NULL;
stack->sp++;
@@ -3434,6 +3695,7 @@ struct script_data* push_str(struct script_stack* stack, enum c_op type, char* s
/// Pushes a retinfo into the stack
struct script_data* push_retinfo(struct script_stack* stack, struct script_retinfo* ri, struct reg_db *ref) {
+ nullpo_retr(NULL, stack);
if( stack->sp >= stack->sp_max )
script->stack_expand(stack);
stack->stack_data[stack->sp].type = C_RETINFO;
@@ -3445,12 +3707,13 @@ struct script_data* push_retinfo(struct script_stack* stack, struct script_retin
/// Pushes a copy of the target position into the stack
struct script_data* push_copy(struct script_stack* stack, int pos) {
+ nullpo_retr(NULL, stack);
switch( stack->stack_data[pos].type ) {
case C_CONSTSTR:
- return script->push_str(stack, C_CONSTSTR, stack->stack_data[pos].u.str);
+ return script->push_conststr(stack, stack->stack_data[pos].u.str);
break;
case C_STR:
- return script->push_str(stack, C_STR, aStrdup(stack->stack_data[pos].u.str));
+ return script->push_str(stack, aStrdup(stack->stack_data[pos].u.mutstr));
break;
case C_RETINFO:
ShowFatalError("script:push_copy: can't create copies of C_RETINFO. Exiting...\n");
@@ -3469,10 +3732,13 @@ struct script_data* push_copy(struct script_stack* stack, int pos) {
/// Removes the values in indexes [start,end[ from the stack.
/// Adjusts all stack pointers.
void pop_stack(struct script_state* st, int start, int end) {
- struct script_stack* stack = st->stack;
+ struct script_stack* stack;
struct script_data* data;
int i;
+ nullpo_retv(st);
+ stack = st->stack;
+
if( start < 0 )
start = 0;
if( end > stack->sp )
@@ -3484,8 +3750,8 @@ void pop_stack(struct script_state* st, int start, int end) {
for( i = start; i < end; i++ )
{
data = &stack->stack_data[i];
- if( data->type == C_STR )
- aFree(data->u.str);
+ if (data->type == C_STR)
+ aFree(data->u.mutstr);
if( data->type == C_RETINFO )
{
struct script_retinfo* ri = data->u.ri;
@@ -3537,7 +3803,8 @@ void pop_stack(struct script_state* st, int start, int end) {
/*==========================================
* Release script dependent variable, dependent variable of function
*------------------------------------------*/
-void script_free_vars(struct DBMap* var_storage) {
+void script_free_vars(struct DBMap *var_storage)
+{
if( var_storage ) {
// destroy the storage construct containing the variables
db_destroy(var_storage);
@@ -3553,7 +3820,7 @@ void script_free_code(struct script_code* code)
script->free_vars(code->local.vars);
if (code->local.arrays)
code->local.arrays->destroy(code->local.arrays,script->array_free_db);
- aFree(code->script_buf);
+ VECTOR_CLEAR(code->script_buf);
aFree(code);
}
@@ -3607,11 +3874,12 @@ struct script_state* script_alloc_state(struct script_code* rootscript, int pos,
///
/// @param st Script state
void script_free_state(struct script_state* st) {
+ nullpo_retv(st);
if( idb_exists(script->st_db,st->id) ) {
struct map_session_data *sd = st->rid ? map->id2sd(st->rid) : NULL;
if(st->bk_st) {// backup was not restored
- ShowDebug("script_free_state: Previous script state lost (rid=%d, oid=%d, state=%d, bk_npcid=%d).\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
+ ShowDebug("script_free_state: Previous script state lost (rid=%d, oid=%d, state=%u, bk_npcid=%d).\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
}
if(sd && sd->st == st) { //Current script is aborted.
@@ -3668,6 +3936,7 @@ void script_free_state(struct script_state* st) {
* @param ref[in] Reference to be added.
*/
void script_add_pending_ref(struct script_state *st, struct reg_db *ref) {
+ nullpo_retv(st);
RECREATE(st->pending_refs, struct reg_db*, ++st->pending_ref_count);
st->pending_refs[st->pending_ref_count-1] = ref;
}
@@ -3678,32 +3947,32 @@ void script_add_pending_ref(struct script_state *st, struct reg_db *ref) {
/*==========================================
* Read command
*------------------------------------------*/
-c_op get_com(unsigned char *scriptbuf,int *pos)
+c_op get_com(const struct script_buf *scriptbuf, int *pos)
{
int i = 0, j = 0;
- if(scriptbuf[*pos]>=0x80) {
+ if (VECTOR_INDEX(*scriptbuf, *pos) >= 0x80) {
return C_INT;
}
- while(scriptbuf[*pos]>=0x40) {
- i=scriptbuf[(*pos)++]<<j;
+ while (VECTOR_INDEX(*scriptbuf, *pos) >= 0x40) {
+ i = VECTOR_INDEX(*scriptbuf, (*pos)++) << j;
j+=6;
}
- return (c_op)(i+(scriptbuf[(*pos)++]<<j));
+ return (c_op)(i+(VECTOR_INDEX(*scriptbuf, (*pos)++)<<j));
}
/*==========================================
* Income figures
*------------------------------------------*/
-int get_num(unsigned char *scriptbuf,int *pos)
+int get_num(const struct script_buf *scriptbuf, int *pos)
{
int i,j;
i=0; j=0;
- while(scriptbuf[*pos]>=0xc0) {
- i+=(scriptbuf[(*pos)++]&0x7f)<<j;
+ while (VECTOR_INDEX(*scriptbuf, *pos) >= 0xc0) {
+ i+= (VECTOR_INDEX(*scriptbuf, (*pos)++)&0x7f)<<j;
j+=6;
}
- return i+((scriptbuf[(*pos)++]&0x7f)<<j);
+ return i+((VECTOR_INDEX(*scriptbuf, (*pos)++)&0x7f)<<j);
}
/// Ternary operators
@@ -3716,12 +3985,11 @@ void op_3(struct script_state* st, int op)
data = script_getdatatop(st, -3);
script->get_val(st, data);
- if( data_isstring(data) )
- flag = data->u.str[0];// "" -> false
- else if( data_isint(data) )
+ if (data_isstring(data)) {
+ flag = data->u.str[0]; // "" -> false
+ } else if (data_isint(data)) {
flag = data->u.num == 0 ? 0 : 1;// 0 -> false
- else
- {
+ } else {
ShowError("script:op_3: invalid data for the ternary operator test\n");
script->reportdata(data);
script->reportsrc(st);
@@ -3764,7 +4032,7 @@ void op_2str(struct script_state* st, int op, const char* s1, const char* s2)
pcre *compiled_regex;
pcre_extra *extra_regex;
const char *pcre_error, *pcre_match;
- int pcre_erroroffset, offsetcount, i;
+ int pcre_erroroffset, offsetcount;
int offsets[256*3]; // (max_capturing_groups+1)*3
compiled_regex = libpcre->compile(s2, 0, &pcre_error, &pcre_erroroffset, NULL);
@@ -3805,8 +4073,9 @@ void op_2str(struct script_state* st, int op, const char* s1, const char* s2)
return;
}
- if( op == C_RE_EQ ) {
- for( i = 0; i < offsetcount; i++ ) {
+ if (op == C_RE_EQ) {
+ int i;
+ for (i = 0; i < offsetcount; i++) {
libpcre->get_substring(s1, offsets, offsetcount, i, &pcre_match);
mapreg->setregstr(reference_uid(script->add_str("$@regexmatch$"), i), pcre_match);
libpcre->free_substring(pcre_match);
@@ -3881,6 +4150,7 @@ void op_2num(struct script_state* st, int op, int i1, int i2)
case C_ADD: ret = i1 + i2; ret64 = (int64)i1 + i2; break;
case C_SUB: ret = i1 - i2; ret64 = (int64)i1 - i2; break;
case C_MUL: ret = i1 * i2; ret64 = (int64)i1 * i2; break;
+ case C_POW: ret = (int)pow((double)i1, (double)i2); ret64 = (int64)pow((double)i1, (double)i2); break;
default:
ShowError("script:op_2num: unexpected number operator %s i1=%d i2=%d\n", script->op2name(op), i1, i2);
script->reportsrc(st);
@@ -3942,10 +4212,9 @@ void op_2(struct script_state *st, int op)
script->op_2str(st, op, left->u.str, right->u.str);
script_removetop(st, leftref.type == C_NOP ? -3 : -2, -1);// pop the two values before the top one
- if (leftref.type != C_NOP)
- {
+ if (leftref.type != C_NOP) {
if (left->type == C_STR) // don't free C_CONSTSTR
- aFree(left->u.str);
+ aFree(left->u.mutstr);
*left = leftref;
}
}
@@ -4014,10 +4283,17 @@ void op_1(struct script_state* st, int op)
///
/// @param st Script state whose stack arguments should be inspected.
/// @param func Built-in function for which the arguments are intended.
-void script_check_buildin_argtype(struct script_state* st, int func)
+bool script_check_buildin_argtype(struct script_state* st, int func)
{
int idx, invalid = 0;
- char* sf = script->buildin[script->str_data[func].val];
+ char* sf;
+ if (script->str_data[func].val < 0 || script->str_data[func].val >= script->buildin_count) {
+ ShowDebug("Function: %s\n", script->get_str(func));
+ ShowError("Script data corruption detected!\n");
+ script->reportsrc(st);
+ return false;
+ }
+ sf = script->buildin[script->str_data[func].val];
for (idx = 2; script_hasdata(st, idx); idx++) {
struct script_data* data = script_getdata(st, idx);
@@ -4088,6 +4364,7 @@ void script_check_buildin_argtype(struct script_state* st, int func)
ShowDebug("Function: %s\n", script->get_str(func));
script->reportsrc(st);
}
+ return true;
}
/// Executes a buildin command.
@@ -4097,6 +4374,7 @@ int run_func(struct script_state *st)
struct script_data* data;
int i,start_sp,end_sp,func;
+ nullpo_retr(1, st);
end_sp = st->stack->sp;// position after the last argument
for( i = end_sp-1; i > 0 ; --i )
if( st->stack->stack_data[i].type == C_ARG )
@@ -4125,7 +4403,11 @@ int run_func(struct script_state *st)
}
if( script->config.warn_func_mismatch_argtypes ) {
- script->check_buildin_argtype(st, func);
+ if (script->check_buildin_argtype(st, func) == false)
+ {
+ st->state = END;
+ return 1;
+ }
}
if(script->str_data[func].func) {
@@ -4194,8 +4476,9 @@ void run_script(struct script_code *rootscript, int pos, int rid, int oid) {
script->run_main(st);
}
-void script_stop_instances(struct script_code *code) {
- DBIterator *iter;
+void script_stop_instances(struct script_code *code)
+{
+ struct DBIterator *iter;
struct script_state* st;
if( !script->active_scripts )
@@ -4239,6 +4522,7 @@ int run_script_timer(int tid, int64 tick, int id, intptr_t data) {
void script_detach_state(struct script_state* st, bool dequeue_event) {
struct map_session_data* sd;
+ nullpo_retv(st);
if(st->rid && (sd = map->id2sd(st->rid))!=NULL) {
sd->st = st->bk_st;
sd->npc_id = st->bk_npcid;
@@ -4258,7 +4542,7 @@ void script_detach_state(struct script_state* st, bool dequeue_event) {
npc->event_dequeue(sd);
}
} else if(st->bk_st) { // rid was set to 0, before detaching the script state
- ShowError("script_detach_state: Found previous script state without attached player (rid=%d, oid=%d, state=%d, bk_npcid=%d)\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
+ ShowError("script_detach_state: Found previous script state without attached player (rid=%d, oid=%d, state=%u, bk_npcid=%d)\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
script->reportsrc(st->bk_st);
script->free_state(st->bk_st);
@@ -4272,13 +4556,14 @@ void script_detach_state(struct script_state* st, bool dequeue_event) {
void script_attach_state(struct script_state* st) {
struct map_session_data* sd;
+ nullpo_retv(st);
if(st->rid && (sd = map->id2sd(st->rid))!=NULL)
{
if(st!=sd->st)
{
if(st->bk_st)
{// there is already a backup
- ShowDebug("script_free_state: Previous script state lost (rid=%d, oid=%d, state=%d, bk_npcid=%d).\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
+ ShowDebug("script_free_state: Previous script state lost (rid=%d, oid=%d, state=%u, bk_npcid=%d).\n", st->bk_st->rid, st->bk_st->oid, st->bk_st->state, st->bk_npcid);
}
st->bk_st = sd->st;
st->bk_npcid = sd->npc_id;
@@ -4307,6 +4592,7 @@ void run_script_main(struct script_state *st) {
struct script_stack *stack = st->stack;
struct npc_data *nd;
+ nullpo_retv(st);
script->attach_state(st);
nd = map->id2nd(st->oid);
@@ -4323,7 +4609,7 @@ void run_script_main(struct script_state *st) {
st->state = RUN;
while( st->state == RUN ) {
- enum c_op c = script->get_com(st->script->script_buf,&st->pos);
+ enum c_op c = script->get_com(&st->script->script_buf, &st->pos);
switch(c) {
case C_EOL:
if( stack->defsp > stack->sp )
@@ -4332,43 +4618,47 @@ void run_script_main(struct script_state *st) {
script->pop_stack(st, stack->defsp, stack->sp);// pop unused stack data. (unused return value)
break;
case C_INT:
- script->push_val(stack,C_INT,script->get_num(st->script->script_buf,&st->pos),NULL);
+ script->push_val(stack,C_INT,script->get_num(&st->script->script_buf, &st->pos), NULL);
break;
case C_POS:
case C_NAME:
- script->push_val(stack,c,GETVALUE(st->script->script_buf,st->pos),NULL);
+ script->push_val(stack,c,GETVALUE(&st->script->script_buf, st->pos), NULL);
st->pos+=3;
break;
case C_ARG:
script->push_val(stack,c,0,NULL);
break;
case C_STR:
- script->push_str(stack,C_CONSTSTR,(char*)(st->script->script_buf+st->pos));
- while(st->script->script_buf[st->pos++]);
+ script->push_conststr(stack, (const char *)&VECTOR_INDEX(st->script->script_buf, st->pos));
+ while (VECTOR_INDEX(st->script->script_buf, st->pos++) != 0)
+ (void)0; // Skip string
break;
case C_LSTR:
{
- int string_id = *((int *)(&st->script->script_buf[st->pos]));
- uint8 translations = *((uint8 *)(&st->script->script_buf[st->pos+sizeof(int)]));
struct map_session_data *lsd = NULL;
-
- st->pos += sizeof(int) + sizeof(uint8);
+ uint8 translations = 0;
+ int string_id = *((int *)(&VECTOR_INDEX(st->script->script_buf, st->pos)));
+ st->pos += sizeof(string_id);
+ translations = *((uint8 *)(&VECTOR_INDEX(st->script->script_buf, st->pos)));
+ st->pos += sizeof(translations);
if( (!st->rid || !(lsd = map->id2sd(st->rid)) || !lsd->lang_id) && !map->default_lang_id )
- script->push_str(stack,C_CONSTSTR,script->string_list+string_id);
+ script->push_conststr(stack, script->string_list+string_id);
else {
uint8 k, wlang_id = lsd ? lsd->lang_id : map->default_lang_id;
int offset = st->pos;
for(k = 0; k < translations; k++) {
- uint8 lang_id = *(uint8 *)(&st->script->script_buf[offset]);
+ uint8 lang_id = *(uint8 *)(&VECTOR_INDEX(st->script->script_buf, offset));
offset += sizeof(uint8);
if( lang_id == wlang_id )
break;
offset += sizeof(char*);
}
- script->push_str(stack,C_CONSTSTR,
- ( k == translations ) ? script->string_list+string_id : *(char**)(&st->script->script_buf[offset]) );
+ if (k == translations)
+ script->push_conststr(stack, script->string_list+string_id);
+ else
+ script->push_conststr(stack, *(const char**)(&VECTOR_INDEX(st->script->script_buf, offset)));
}
st->pos += ( ( sizeof(char*) + sizeof(uint8) ) * translations );
}
@@ -4398,6 +4688,7 @@ void run_script_main(struct script_state *st) {
case C_ADD:
case C_SUB:
case C_MUL:
+ case C_POW:
case C_DIV:
case C_MOD:
case C_EQ:
@@ -4427,7 +4718,7 @@ void run_script_main(struct script_state *st) {
break;
default:
- ShowError("unknown command : %d @ %d\n",c,st->pos);
+ ShowError("unknown command : %u @ %d\n", c, st->pos);
st->state=END;
break;
}
@@ -4476,58 +4767,62 @@ void run_script_main(struct script_state *st) {
}
}
-int script_config_read(char *cfgName) {
- int i;
- char line[1024],w1[1024],w2[1024];
- FILE *fp;
+/**
+ * Reads 'script_configuration' and initializes required variables.
+ *
+ * @param filename Path to configuration file.
+ * @param imported Whether the current config is imported from another file.
+ *
+ * @retval false in case of error.
+ */
+bool script_config_read(const char *filename, bool imported)
+{
+ struct config_t config;
+ struct config_setting_t * setting = NULL;
+ const char *import = NULL;
+ bool retval = true;
- if( !( fp = fopen(cfgName,"r") ) ) {
- ShowError("File not found: %s\n", cfgName);
- return 1;
+ nullpo_retr(false, filename);
+
+ if (!libconfig->load_file(&config, filename))
+ return false;
+
+ if ((setting = libconfig->lookup(&config, "script_configuration")) == NULL) {
+ libconfig->destroy(&config);
+ if (imported)
+ return true;
+ ShowError("script_config_read: script_configuration was not found in %s!\n", filename);
+ return false;
}
- while (fgets(line, sizeof(line), fp)) {
- if (line[0] == '/' && line[1] == '/')
- continue;
- i = sscanf(line,"%1023[^:]: %1023[^\r\n]", w1, w2);
- if(i!=2)
- continue;
- if(strcmpi(w1,"warn_func_mismatch_paramnum")==0) {
- script->config.warn_func_mismatch_paramnum = config_switch(w2);
- }
- else if(strcmpi(w1,"check_cmdcount")==0) {
- script->config.check_cmdcount = config_switch(w2);
- }
- else if(strcmpi(w1,"check_gotocount")==0) {
- script->config.check_gotocount = config_switch(w2);
- }
- else if(strcmpi(w1,"input_min_value")==0) {
- script->config.input_min_value = config_switch(w2);
- }
- else if(strcmpi(w1,"input_max_value")==0) {
- script->config.input_max_value = config_switch(w2);
- }
- else if(strcmpi(w1,"warn_func_mismatch_argtypes")==0) {
- script->config.warn_func_mismatch_argtypes = config_switch(w2);
- }
- else if(strcmpi(w1,"import")==0) {
- script->config_read(w2);
- }
- else if(HPM->parseConf(w1, w2, HPCT_SCRIPT)) {
- ; // handled by plugin
+ libconfig->setting_lookup_bool_real(setting, "warn_func_mismatch_paramnum", &script->config.warn_func_mismatch_paramnum);
+ libconfig->setting_lookup_bool_real(setting, "warn_func_mismatch_argtypes", &script->config.warn_func_mismatch_argtypes);
+ libconfig->setting_lookup_int(setting, "check_cmdcount", &script->config.check_cmdcount);
+ libconfig->setting_lookup_int(setting, "check_gotocount", &script->config.check_gotocount);
+ libconfig->setting_lookup_int(setting, "input_min_value", &script->config.input_min_value);
+ libconfig->setting_lookup_int(setting, "input_max_value", &script->config.input_max_value);
+
+ if (!HPM->parse_conf(&config, filename, HPCT_SCRIPT, imported))
+ retval = false;
+
+ // import should overwrite any previous configuration, so it should be called last
+ if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
+ if (strcmp(import, filename) == 0 || strcmp(import, map->SCRIPT_CONF_NAME) == 0) {
+ ShowWarning("script_config_read: Loop detected! Skipping 'import'...\n");
} else {
- ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
+ if (!script->config_read(import, true))
+ retval = false;
}
}
- fclose(fp);
- return 0;
+ libconfig->destroy(&config);
+ return retval;
}
/**
* @see DBApply
*/
-int db_script_free_code_sub(DBKey key, DBData *data, va_list ap)
+int db_script_free_code_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct script_code *code = DB->data2ptr(data);
if (code)
@@ -4603,9 +4898,11 @@ void script_setarray_pc(struct map_session_data* sd, const char* varname, uint32
/**
* Clears persistent variables from memory
**/
-int script_reg_destroy(DBKey key, DBData *data, va_list ap) {
+int script_reg_destroy(union DBKey key, struct DBData *data, va_list ap)
+{
struct script_reg_state *src;
+ nullpo_ret(data);
if( data->type != DB_DATA_PTR )/* got no need for those! */
return 0;
@@ -4627,6 +4924,8 @@ int script_reg_destroy(DBKey key, DBData *data, va_list ap) {
* Clears a single persistent variable
**/
void script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct script_reg_state *data) {
+ nullpo_retv(sd);
+ nullpo_retv(data);
i64db_remove(sd->regs.vars, reg);
if( data->type ) {
@@ -4641,6 +4940,7 @@ void script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct sc
}
}
unsigned int *script_array_cpy_list(struct script_array *sa) {
+ nullpo_retr(NULL, sa);
if( sa->size > script->generic_ui_array_size )
script->generic_ui_array_expand(sa->size);
memcpy(script->generic_ui_array, sa->members, sizeof(unsigned int)*sa->size);
@@ -4653,9 +4953,10 @@ void script_generic_ui_array_expand (unsigned int plus) {
/*==========================================
* Destructor
*------------------------------------------*/
-void do_final_script(void) {
+void do_final_script(void)
+{
int i;
- DBIterator *iter;
+ struct DBIterator *iter;
struct script_state *st;
#ifdef SCRIPT_DEBUG_HASH
@@ -4732,6 +5033,8 @@ void do_final_script(void) {
aFree(script->str_buf);
for( i = 0; i < atcommand->binding_count; i++ ) {
+ aFree(atcommand->binding[i]->at_groups);
+ aFree(atcommand->binding[i]->char_groups);
aFree(atcommand->binding[i]);
}
@@ -4780,9 +5083,6 @@ void do_final_script(void) {
script->clear_translations(false);
script->parser_clean_leftovers();
-
- if( script->lang_export_file )
- aFree(script->lang_export_file);
}
/**
@@ -4790,6 +5090,7 @@ void do_final_script(void) {
**/
uint8 script_add_language(const char *name) {
uint8 lang_id = script->max_lang_id;
+ nullpo_ret(name);
RECREATE(script->languages, char *, ++script->max_lang_id);
script->languages[lang_id] = aStrdup(name);
@@ -4800,11 +5101,11 @@ uint8 script_add_language(const char *name) {
* Goes thru db/translations.conf file
**/
void script_load_translations(void) {
- config_t translations_conf;
+ struct config_t translations_conf;
const char *config_filename = "db/translations.conf"; // FIXME hardcoded name
- config_setting_t *translations = NULL;
+ struct config_setting_t *translations = NULL;
int i, size;
- uint32 total = 0;
+ int total = 0;
uint8 lang_id = 0, k;
if (map->minimal) // No translations in minimal mode
@@ -4822,12 +5123,10 @@ void script_load_translations(void) {
script->add_language("English");/* 0 is default, which is whatever is in the npc files hardcoded (in our case, English) */
- if (libconfig->read_file(&translations_conf, config_filename)) {
- ShowError("load_translations: can't read '%s'\n", config_filename);
+ if (!libconfig->load_file(&translations_conf, config_filename))
return;
- }
- if( !(translations = libconfig->lookup(&translations_conf, "translations")) ) {
+ if ((translations = libconfig->lookup(&translations_conf, "translations")) == NULL) {
ShowError("load_translations: invalid format on '%s'\n",config_filename);
return;
}
@@ -4843,25 +5142,22 @@ void script_load_translations(void) {
for(i = 0; i < size; i++) {
const char *translation_file = libconfig->setting_get_string_elem(translations, i);
- script->load_translation(translation_file, ++lang_id, &total);
+ total += script->load_translation(translation_file, ++lang_id);
}
libconfig->destroy(&translations_conf);
- if( total ) {
- DBIterator *main_iter;
- DBIterator *sub_iter;
- DBMap *string_db;
+ if (total != 0) {
+ struct DBIterator *main_iter;
+ struct DBMap *string_db;
struct string_translation *st = NULL;
- uint32 j = 0;
- CREATE(script->translation_buf, char *, total);
- script->translation_buf_size = total;
+ VECTOR_ENSURE(script->translation_buf, total, 1);
main_iter = db_iterator(script->translation_db);
- for( string_db = dbi_first(main_iter); dbi_exists(main_iter); string_db = dbi_next(main_iter) ) {
- sub_iter = db_iterator(string_db);
- for( st = dbi_first(sub_iter); dbi_exists(sub_iter); st = dbi_next(sub_iter) ) {
- script->translation_buf[j++] = st->buf;
+ for (string_db = dbi_first(main_iter); dbi_exists(main_iter); string_db = dbi_next(main_iter)) {
+ struct DBIterator *sub_iter = db_iterator(string_db);
+ for (st = dbi_first(sub_iter); dbi_exists(sub_iter); st = dbi_next(sub_iter)) {
+ VECTOR_PUSH(script->translation_buf, st->buf);
}
dbi_destroy(sub_iter);
}
@@ -4883,143 +5179,258 @@ void script_load_translations(void) {
}
/**
+ * Generates a language name from a translation filename.
*
- **/
-const char * script_get_translation_file_name(const char *file) {
- static char file_name[200];
- int i, len = (int)strlen(file), last_bar = -1, last_dot = -1;
+ * @param file The filename.
+ * @return The corresponding translation name.
+ */
+const char *script_get_translation_file_name(const char *file)
+{
+ const char *basename = NULL, *last_dot = NULL;
- for(i = 0; i < len; i++) {
- if( file[i] == '/' || file[i] == '\\' )
- last_bar = i;
- else if ( file[i] == '.' )
- last_dot = i;
+ nullpo_retr("Unknown", file);
+
+ basename = strrchr(file, '/');;
+#ifdef WIN32
+ {
+ const char *basename_windows = strrchr(file, '\\');
+ if (basename_windows > basename)
+ basename = basename_windows;
}
+#endif // WIN32
+ if (basename == NULL)
+ basename = file;
+ else
+ basename++; // Skip slash
+ Assert_retr("Unknown", *basename != '\0');
+
+ last_dot = strrchr(basename, '.');
+ if (last_dot != NULL) {
+ static char file_name[200];
+ if (last_dot == basename)
+ return basename + 1;
- if( last_bar != -1 || last_dot != -1 ) {
- if( last_bar != -1 && last_dot < last_bar )
- last_dot = -1;
- safestrncpy(file_name, file+(last_bar >= 0 ? last_bar+1 : 0), ( last_dot >= 0 ? ( last_bar >= 0 ? last_dot - last_bar : last_dot ) : sizeof(file_name) ));
+ safestrncpy(file_name, basename, last_dot - basename + 1);
return file_name;
}
- return file;
+ return basename;
}
/**
- * Parses a individual translation file
- **/
-void script_load_translation(const char *file, uint8 lang_id, uint32 *total) {
- uint32 translations = 0;
+ * Parses and adds a translated string to the translations database.
+ *
+ * @param file Translations file being parsed (for error messages).
+ * @param lang_id Language ID being parsed.
+ * @param msgctxt Message context (i.e. NPC name)
+ * @param msgid Message ID (source string)
+ * @param msgstr Translated message
+ * @return success state
+ * @retval true if a new string was added.
+ */
+bool script_load_translation_addstring(const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr)
+{
+ nullpo_retr(false, file);
+ nullpo_retr(false, msgctxt);
+ nullpo_retr(false, msgid);
+ nullpo_retr(false, msgstr);
+
+ if (VECTOR_LENGTH(*msgid) <= 1) {
+ // Empty ID (i.e. header) to be ignored
+ return false;
+ }
+
+ if (VECTOR_LENGTH(*msgstr) <= 1) {
+ // Empty (untranslated) string to be ignored
+ return false;
+ }
+
+ if (msgctxt[0] == '\0') {
+ // Missing context
+ ShowWarning("script_load_translation: Missing context for msgid '%s' in '%s'. Skipping.\n",
+ VECTOR_DATA(*msgid), file);
+ return false;
+ }
+
+ if (strcasecmp(msgctxt, "messages.conf") == 0) {
+ int i;
+ for (i = 0; i < MAX_MSG; i++) {
+ if (atcommand->msg_table[0][i] != NULL && strcmpi(atcommand->msg_table[0][i], VECTOR_DATA(*msgid)) == 0) {
+ if (atcommand->msg_table[lang_id][i] != NULL)
+ aFree(atcommand->msg_table[lang_id][i]);
+ atcommand->msg_table[lang_id][i] = aStrdup(VECTOR_DATA(*msgstr));
+ break;
+ }
+ }
+ } else {
+ int msgstr_len = VECTOR_LENGTH(*msgstr);
+ int inner_len = 1 + msgstr_len + 1; //uint8 lang_id + msgstr_len + '\0'
+ struct string_translation *st = NULL;
+ struct DBMap *string_db;
+
+ if ((string_db = strdb_get(script->translation_db, msgctxt)) == NULL) {
+ string_db = strdb_alloc(DB_OPT_DUP_KEY, 0);
+ strdb_put(script->translation_db, msgctxt, string_db);
+ }
+
+ if ((st = strdb_get(string_db, VECTOR_DATA(*msgid))) == NULL) {
+ CREATE(st, struct string_translation, 1);
+ st->string_id = script->string_dup(VECTOR_DATA(*msgid));
+ strdb_put(string_db, VECTOR_DATA(*msgid), st);
+ }
+ RECREATE(st->buf, uint8, st->len + inner_len);
+
+ WBUFB(st->buf, st->len) = lang_id;
+ safestrncpy(WBUFP(st->buf, st->len + 1), VECTOR_DATA(*msgstr), msgstr_len + 1);
+
+ st->translations++;
+ st->len += inner_len;
+ }
+ return true;
+}
+
+/**
+ * Parses an individual translation file.
+ *
+ * @param file The filename to parse.
+ * @param lang_id The language identifier.
+ * @return The amount of strings loaded.
+ */
+int script_load_translation(const char *file, uint8 lang_id)
+{
+ int translations = 0;
char line[1024];
char msgctxt[NAME_LENGTH*2+1] = { 0 };
- DBMap *string_db;
- size_t i;
FILE *fp;
- struct script_string_buf msgid = { 0 }, msgstr = { 0 };
+ int lineno = 0;
+ struct script_string_buf msgid, msgstr;
- if( !(fp = fopen(file,"rb")) ) {
+ nullpo_ret(file);
+
+ if ((fp = fopen(file,"rb")) == NULL) {
ShowError("load_translation: failed to open '%s' for reading\n",file);
- return;
+ return 0;
}
+ VECTOR_INIT(msgid);
+ VECTOR_INIT(msgstr);
+
script->add_language(script->get_translation_file_name(file));
- if( lang_id >= atcommand->max_message_table )
+ if (lang_id >= atcommand->max_message_table)
atcommand->expand_message_table();
- while(fgets(line, sizeof(line), fp)) {
- size_t len = strlen(line), cursor = 0;
+ while (fgets(line, sizeof(line), fp) != NULL) {
+ int len = (int)strlen(line);
+ int i;
+ lineno++;
- if( len <= 1 )
+ if(len <= 1)
continue;
- if( line[0] == '#' )
+ if (line[0] == '#')
continue;
- if( strncasecmp(line,"msgctxt \"", 9) == 0 ) {
+ if (VECTOR_LENGTH(msgid) > 0 && VECTOR_LENGTH(msgstr) > 0) {
+ if (line[0] == '"') {
+ // Continuation line
+ (void)VECTOR_POP(msgstr); // Pop final '\0'
+ for (i = 8; i < len - 2; i++) {
+ VECTOR_ENSURE(msgstr, 1, 512);
+ if (line[i] == '\\' && line[i+1] == '"') {
+ VECTOR_PUSH(msgstr, '"');
+ i++;
+ } else {
+ VECTOR_PUSH(msgstr, line[i]);
+ }
+ }
+ VECTOR_ENSURE(msgstr, 1, 512);
+ VECTOR_PUSH(msgstr, '\0');
+ continue;
+ }
+
+ // Add string
+ if (script->load_translation_addstring(file, lang_id, msgctxt, &msgid, &msgstr))
+ translations++;
+
+ msgctxt[0] = '\0';
+ VECTOR_TRUNCATE(msgid);
+ VECTOR_TRUNCATE(msgstr);
+ }
+
+ if (strncasecmp(line,"msgctxt \"", 9) == 0) {
+ int cursor = 0;
msgctxt[0] = '\0';
- for(i = 9; i < len - 2; i++) {
- if( line[i] == '\\' && line[i+1] == '"' ) {
+ for (i = 9; i < len - 2; i++) {
+ if (line[i] == '\\' && line[i+1] == '"') {
msgctxt[cursor] = '"';
i++;
- } else
+ } else {
msgctxt[cursor] = line[i];
- if( ++cursor >= sizeof(msgctxt) - 1 )
+ }
+ if (++cursor >= (int)sizeof(msgctxt) - 1)
break;
}
msgctxt[cursor] = '\0';
- } else if ( strncasecmp(line, "msgid \"", 7) == 0 ) {
- msgid.pos = 0;
- for(i = 7; i < len - 2; i++) {
- if( line[i] == '\\' && line[i+1] == '"' ) {
- script_string_buf_addb(&msgid, '"');
- i++;
- } else
- script_string_buf_addb(&msgid, line[i]);
- }
- script_string_buf_addb(&msgid,0);
- } else if ( len > 9 && line[9] != '"' && strncasecmp(line, "msgstr \"",8) == 0 ) {
- msgstr.pos = 0;
- for(i = 8; i < len - 2; i++) {
- if( line[i] == '\\' && line[i+1] == '"' ) {
- script_string_buf_addb(&msgstr, '"');
- i++;
- } else
- script_string_buf_addb(&msgstr, line[i]);
- }
- script_string_buf_addb(&msgstr,0);
- }
-
- if( msgctxt[0] && msgid.pos > 1 && msgstr.pos > 1 ) {
- size_t msgstr_len = msgstr.pos;
- unsigned int inner_len = 1 + (uint32)msgstr_len + 1; //uint8 lang_id + msgstr_len + '\0'
- if( strcasecmp(msgctxt, "messages.conf") == 0 ) {
- int k;
+ // New context, reset everything
+ VECTOR_TRUNCATE(msgid);
+ VECTOR_TRUNCATE(msgstr);
+ continue;
+ }
- for(k = 0; k < MAX_MSG; k++) {
- if( atcommand->msg_table[0][k] && strcmpi(atcommand->msg_table[0][k],msgid.ptr) == 0 ) {
- if( atcommand->msg_table[lang_id][k] )
- aFree(atcommand->msg_table[lang_id][k]);
- atcommand->msg_table[lang_id][k] = aStrdup(msgstr.ptr);
- break;
- }
+ if (strncasecmp(line, "msgid \"", 7) == 0) {
+ VECTOR_TRUNCATE(msgid);
+ for (i = 7; i < len - 2; i++) {
+ VECTOR_ENSURE(msgid, 1, 512);
+ if (line[i] == '\\' && line[i+1] == '"') {
+ VECTOR_PUSH(msgid, '"');
+ i++;
+ } else {
+ VECTOR_PUSH(msgid, line[i]);
}
- } else {
- struct string_translation *st = NULL;
+ }
+ VECTOR_ENSURE(msgid, 1, 512);
+ VECTOR_PUSH(msgid, '\0');
- if( !( string_db = strdb_get(script->translation_db, msgctxt) ) ) {
- string_db = strdb_alloc(DB_OPT_DUP_KEY, 0);
- strdb_put(script->translation_db, msgctxt, string_db);
- }
+ // New id, reset string if any
+ VECTOR_TRUNCATE(msgstr);
+ continue;
+ }
- if( !(st = strdb_get(string_db, msgid.ptr) ) ) {
- CREATE(st, struct string_translation, 1);
- st->string_id = script->string_dup(msgid.ptr);
- strdb_put(string_db, msgid.ptr, st);
+ if (VECTOR_LENGTH(msgid) > 0 && strncasecmp(line, "msgstr \"", 8) == 0) {
+ VECTOR_TRUNCATE(msgstr);
+ for (i = 8; i < len - 2; i++) {
+ VECTOR_ENSURE(msgstr, 1, 512);
+ if (line[i] == '\\' && line[i+1] == '"') {
+ VECTOR_PUSH(msgstr, '"');
+ i++;
+ } else {
+ VECTOR_PUSH(msgstr, line[i]);
}
- RECREATE(st->buf, char, st->len + inner_len);
-
- WBUFB(st->buf, st->len) = lang_id;
- safestrncpy((char*)WBUFP(st->buf, st->len + 1), msgstr.ptr, msgstr_len + 1);
-
- st->translations++;
- st->len += inner_len;
}
- msgctxt[0] = '\0';
- msgid.pos = msgstr.pos = 0;
- translations++;
+ VECTOR_ENSURE(msgstr, 1, 512);
+ VECTOR_PUSH(msgstr, '\0');
+
+ continue;
}
+
+ ShowWarning("script_load_translation: Unexpected input at '%s' in file '%s' line %d. Skipping.\n",
+ line, file, lineno);
}
- *total += translations;
+ // Add last string
+ if (VECTOR_LENGTH(msgid) > 0 && VECTOR_LENGTH(msgstr) > 0) {
+ if (script->load_translation_addstring(file, lang_id, msgctxt, &msgid, &msgstr))
+ translations++;
+ }
fclose(fp);
- script_string_buf_destroy(&msgid);
- script_string_buf_destroy(&msgstr);
+ VECTOR_CLEAR(msgid);
+ VECTOR_CLEAR(msgstr);
- ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' translations in '"CL_WHITE"%s"CL_RESET"'.\n", translations, file);
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' translations in '"CL_WHITE"%s"CL_RESET"'.\n", translations, file);
+ return translations;
}
/**
@@ -5035,15 +5446,10 @@ void script_clear_translations(bool reload) {
script->string_list_pos = 0;
script->string_list_size = 0;
- if( script->translation_buf ) {
- for(i = 0; i < script->translation_buf_size; i++) {
- aFree(script->translation_buf[i]);
- }
- aFree(script->translation_buf);
+ while (VECTOR_LENGTH(script->translation_buf) > 0) {
+ aFree(VECTOR_POP(script->translation_buf));
}
-
- script->translation_buf = NULL;
- script->translation_buf_size = 0;
+ VECTOR_CLEAR(script->translation_buf);
if( script->languages ) {
for(i = 0; i < script->max_lang_id; i++)
@@ -5064,12 +5470,13 @@ void script_clear_translations(bool reload) {
/**
*
**/
-int script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
- DBMap *string_db = DB->data2ptr(data);
+int script_translation_db_destroyer(union DBKey key, struct DBData *data, va_list ap)
+{
+ struct DBMap *string_db = DB->data2ptr(data);
if( db_size(string_db) ) {
struct string_translation *st = NULL;
- DBIterator *iter = db_iterator(string_db);
+ struct DBIterator *iter = db_iterator(string_db);
for( st = dbi_first(iter); dbi_exists(iter); st = dbi_next(iter) ) {
aFree(st);
@@ -5084,26 +5491,16 @@ int script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
/**
*
**/
-void script_parser_clean_leftovers(void) {
- if( script->buf )
- aFree(script->buf);
-
- script->buf = NULL;
- script->size = 0;
+void script_parser_clean_leftovers(void)
+{
+ VECTOR_CLEAR(script->buf);
if( script->translation_db ) {
script->translation_db->destroy(script->translation_db,script->translation_db_destroyer);
script->translation_db = NULL;
}
- if( script->syntax.strings ) { /* used only when generating translation file */
- db_destroy(script->syntax.strings);
- script->syntax.strings = NULL;
- }
-
- script_string_buf_destroy(&script->parse_simpleexpr_str);
- script_string_buf_destroy(&script->lang_export_line_buf);
- script_string_buf_destroy(&script->lang_export_unescaped_buf);
+ VECTOR_CLEAR(script->parse_simpleexpr_strbuf);
}
/**
@@ -5122,6 +5519,7 @@ int script_parse_cleanup_timer(int tid, int64 tick, int id, intptr_t data) {
*------------------------------------------*/
void do_init_script(bool minimal) {
script->parse_cleanup_timer_id = INVALID_TIMER;
+ VECTOR_INIT(script->parse_simpleexpr_strbuf);
script->st_db = idb_alloc(DB_OPT_BASE);
script->userfunc_db = strdb_alloc(DB_OPT_DUP_KEY,0);
@@ -5139,6 +5537,7 @@ void do_init_script(bool minimal) {
script->parse_builtin();
script->read_constdb();
+ script->load_parameters();
script->hardcoded_constants();
if (minimal)
@@ -5148,9 +5547,10 @@ void do_init_script(bool minimal) {
script->load_translations();
}
-int script_reload(void) {
+int script_reload(void)
+{
int i;
- DBIterator *iter;
+ struct DBIterator *iter;
struct script_state *st;
#ifdef ENABLE_CASE_CHECK
@@ -5169,6 +5569,8 @@ int script_reload(void) {
script->label_count = 0;
for( i = 0; i < atcommand->binding_count; i++ ) {
+ aFree(atcommand->binding[i]->at_groups);
+ aFree(atcommand->binding[i]->char_groups);
aFree(atcommand->binding[i]);
}
@@ -5198,6 +5600,7 @@ int script_reload(void) {
const char *script_getfuncname(struct script_state *st) {
struct script_data *data;
+ nullpo_retr(NULL, st);
data = &st->stack->stack_data[st->start];
if( data->type == C_NAME && script->str_data[data->u.num].type == C_FUNC )
@@ -5206,6 +5609,231 @@ const char *script_getfuncname(struct script_state *st) {
return NULL;
}
+/**
+ * Writes a string to a StringBuf by combining a format string and a set of
+ * arguments taken from the current script state (caller script function
+ * arguments).
+ *
+ * @param[in] st Script state (must have at least a string at index
+ * 'start').
+ * @param[in] start Index of the format string argument.
+ * @param[out] out Output string buffer (managed by the caller, must be
+ * already initialized)
+ * @retval false if an error occurs.
+ */
+bool script_sprintf(struct script_state *st, int start, struct StringBuf *out)
+{
+ const char *format = NULL;
+ const char *p = NULL, *np = NULL;
+ char *buf = NULL;
+ int buf_len = 0;
+ int lastarg = start;
+ int argc = script_lastdata(st) + 1;
+
+ nullpo_retr(-1, out);
+ Assert_retr(-1, start >= 2 && start <= argc);
+ Assert_retr(-1, script_hasdata(st, start));
+
+ p = format = script_getstr(st, start);
+
+ /*
+ * format-string = "" / *(text / placeholder)
+ * placeholder = "%%" / "%n" / std-placeholder
+ * std-placeholder = "%" [pos-parameter] [flags] [width] [precision] [length] type
+ * pos-parameter = number "$"
+ * flags = *("-" / "+" / "0" / SP)
+ * width = number / ("*" [pos-parameter])
+ * precision = "." (number / ("*" [pos-parameter]))
+ * length = "hh" / "h" / "l" / "ll" / "L" / "z" / "j" / "t"
+ * type = "d" / "i" / "u" / "f" / "F" / "e" / "E" / "g" / "G" / "x" / "X" / "o" / "s" / "c" / "p" / "a" / "A"
+ * number = digit-nonzero *DIGIT
+ * digit-nonzero = "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
+ */
+
+ while ((np = strchr(p, '%')) != NULL) {
+ bool flag_plus = false, flag_minus = false, flag_zero = false, flag_space = false;
+ bool positional_arg = false;
+ int width = 0, nextarg = lastarg + 1, thisarg = nextarg;
+
+ if (p != np) {
+ int len = (int)(np - p + 1);
+ if (buf_len < len) {
+ RECREATE(buf, char, len);
+ buf_len = len;
+ }
+ safestrncpy(buf, p, len);
+ StrBuf->AppendStr(out, buf);
+ }
+ np++;
+
+ // placeholder = "%%" ; (special case)
+ if (*np == '%') {
+ StrBuf->AppendStr(out, "%");
+ p = np + 1;
+ continue;
+ }
+ // placeholder = "%n" ; (ignored)
+ if (*np == 'n') {
+ ShowWarning("script_sprintf: Format %%n not supported! Skipping...\n");
+ script->reportsrc(st);
+ lastarg = nextarg;
+ p = np + 1;
+ continue;
+ }
+
+ // std-placeholder = "%" [pos-parameter] [flags] [width] [precision] [length] type
+
+ // pos-parameter = number "$"
+ if (ISDIGIT(*np) && *np != '0') {
+ const char *pp = np;
+ while (ISDIGIT(*pp))
+ pp++;
+ if (*pp == '$') {
+ thisarg = atoi(np) + start;
+ positional_arg = true;
+ np = pp + 1;
+ }
+ }
+
+ if (thisarg >= argc) {
+ ShowError("buildin_sprintf: Not enough arguments passed!\n");
+ if (buf != NULL)
+ aFree(buf);
+ return false;
+ }
+
+ // flags = *("-" / "+" / "0" / SP)
+ while (true) {
+ if (*np == '-') {
+ flag_minus = true;
+ } else if (*np == '+') {
+ flag_plus = true;
+ } else if (*np == ' ') {
+ flag_space = true;
+ } else if (*np == '0') {
+ flag_zero = true;
+ } else {
+ break;
+ }
+ np++;
+ }
+
+ // width = number / ("*" [pos-parameter])
+ if (ISDIGIT(*np)) {
+ width = atoi(np);
+ while (ISDIGIT(*np))
+ np++;
+ } else if (*np == '*') {
+ bool positional_widtharg = false;
+ int width_arg;
+ np++;
+ // pos-parameter = number "$"
+ if (ISDIGIT(*np) && *np != '0') {
+ const char *pp = np;
+ while (ISDIGIT(*pp))
+ pp++;
+ if (*pp == '$') {
+ width_arg = atoi(np) + start;
+ positional_widtharg = true;
+ np = pp + 1;
+ }
+ }
+ if (!positional_widtharg) {
+ width_arg = nextarg;
+ nextarg++;
+ if (!positional_arg)
+ thisarg++;
+ }
+
+ if (width_arg >= argc || thisarg >= argc) {
+ ShowError("buildin_sprintf: Not enough arguments passed!\n");
+ if (buf != NULL)
+ aFree(buf);
+ return false;
+ }
+ width = script_getnum(st, width_arg);
+ }
+
+ // precision = "." (number / ("*" [pos-parameter])) ; (not needed/implemented)
+
+ // length = "hh" / "h" / "l" / "ll" / "L" / "z" / "j" / "t" ; (not needed/implemented)
+
+ // type = "d" / "i" / "u" / "f" / "F" / "e" / "E" / "g" / "G" / "x" / "X" / "o" / "s" / "c" / "p" / "a" / "A"
+ if (buf_len < 16) {
+ RECREATE(buf, char, 16);
+ buf_len = 16;
+ }
+ {
+ int i = 0;
+ memset(buf, '\0', buf_len);
+ buf[i++] = '%';
+ if (flag_minus)
+ buf[i++] = '-';
+ if (flag_plus)
+ buf[i++] = '+';
+ else if (flag_space) // ignored if '+' is specified
+ buf[i++] = ' ';
+ if (flag_zero)
+ buf[i++] = '0';
+ if (width > 0)
+ safesnprintf(buf + i, buf_len - i - 1, "%d", width);
+ }
+ buf[(int)strlen(buf)] = *np;
+ switch (*np) {
+ case 'd':
+ case 'i':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'o':
+ // Piggyback printf
+ StrBuf->Printf(out, buf, script_getnum(st, thisarg));
+ break;
+ case 's':
+ // Piggyback printf
+ StrBuf->Printf(out, buf, script_getstr(st, thisarg));
+ break;
+ case 'c':
+ {
+ const char *str = script_getstr(st, thisarg);
+ // Piggyback printf
+ StrBuf->Printf(out, buf, str[0]);
+ }
+ break;
+ case 'f':
+ case 'F':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ case 'p':
+ case 'a':
+ case 'A':
+ ShowWarning("buildin_sprintf: Format %%%c not supported! Skipping...\n", *np);
+ script->reportsrc(st);
+ lastarg = nextarg;
+ p = np + 1;
+ continue;
+ default:
+ ShowError("buildin_sprintf: Invalid format string.\n");
+ if (buf != NULL)
+ aFree(buf);
+ return false;
+ }
+ lastarg = nextarg;
+ p = np + 1;
+ }
+
+ // Append the remaining part
+ if (p != NULL)
+ StrBuf->AppendStr(out, p);
+
+ if (buf != NULL)
+ aFree(buf);
+
+ return true;
+}
+
//-----------------------------------------------------------------------------
// buildin functions
//
@@ -5221,20 +5849,42 @@ const char *script_getfuncname(struct script_state *st) {
BUILDIN(mes)
{
struct map_session_data *sd = script->rid2sd(st);
- if( sd == NULL )
+ if (sd == NULL)
return true;
- if( !script_hasdata(st, 3) ) {// only a single line detected in the script
- clif->scriptmes(sd, st->oid, script_getstr(st, 2));
- } else {// parse multiple lines as they exist
- int i;
+ clif->scriptmes(sd, st->oid, script_getstr(st, 2));
- for( i = 2; script_hasdata(st, i); i++ ) {
- // send the message to the client
- clif->scriptmes(sd, st->oid, script_getstr(st, i));
- }
+ return true;
+}
+
+/**
+ * Appends a message to the npc dialog, applying format string conversions (see
+ * sprintf).
+ *
+ * If a dialog doesn't exist yet, one is created.
+ *
+ * @code
+ * mes "<message>";
+ * @endcode
+ */
+BUILDIN(mesf)
+{
+ struct map_session_data *sd = script->rid2sd(st);
+ struct StringBuf buf;
+
+ if (sd == NULL)
+ return true;
+
+ StrBuf->Init(&buf);
+
+ if (!script_sprintf(st, 2, &buf)) {
+ StrBuf->Destroy(&buf);
+ return false;
}
+ clif->scriptmes(sd, st->oid, StrBuf->Value(&buf));
+ StrBuf->Destroy(&buf);
+
return true;
}
@@ -5299,6 +5949,7 @@ int menu_countoptions(const char* str, int max_count, int* total)
int count = 0;
int bogus_total;
+ nullpo_ret(str);
if( total == NULL )
total = &bogus_total;
++(*total);
@@ -5922,6 +6573,9 @@ int buildin_areawarp_sub(struct block_list *bl, va_list ap)
pc->randomwarp(sd, CLR_TELEPORT);
} else if (x3 != 0 && y3 != 0) {
int max, tx, ty, j = 0;
+ int16 m;
+
+ m = map->mapindex2mapid(index);
// choose a suitable max number of attempts
if( (max = (y3-y2+1)*(x3-x2+1)*3) > 1000 )
@@ -5932,7 +6586,7 @@ int buildin_areawarp_sub(struct block_list *bl, va_list ap)
tx = rnd()%(x3-x2+1)+x2;
ty = rnd()%(y3-y2+1)+y2;
j++;
- } while (map->getcell(index, bl, tx, ty, CELL_CHKNOPASS) && j < max);
+ } while (map->getcell(m, bl, tx, ty, CELL_CHKNOPASS) && j < max);
pc->setpos(sd, index, tx, ty, CLR_OUTSIGHT);
} else {
@@ -6047,9 +6701,10 @@ BUILDIN(warpchar) {
return true;
}
/*==========================================
- * Warpparty - [Fredzilla] [Paradox924X]
- * Syntax: warpparty "to_mapname",x,y,Party_ID,{"from_mapname"};
+ * Warpparty - [Fredzilla] [Paradox924X] [Jedzkie] [Dastgir]
+ * Syntax: warpparty("<to_mapname>", <x>, <y>, <party_id>, "<from_mapname>", <include_leader>)
* If 'from_mapname' is specified, only the party members on that map will be warped
+ * If 'include_leader' option is set to false, the leader will be warped too.
*------------------------------------------*/
BUILDIN(warpparty)
{
@@ -6059,78 +6714,84 @@ BUILDIN(warpparty)
int type;
int map_index;
int i;
+ bool include_leader = true;
- const char* str = script_getstr(st,2);
- int x = script_getnum(st,3);
- int y = script_getnum(st,4);
- int p_id = script_getnum(st,5);
+ const char* str = script_getstr(st, 2);
+ int x = script_getnum(st, 3);
+ int y = script_getnum(st, 4);
+ int p_id = script_getnum(st, 5);
const char* str2 = NULL;
- if ( script_hasdata(st,6) )
- str2 = script_getstr(st,6);
+
+ if (script_hasdata(st, 6))
+ str2 = script_getstr(st, 6);
+ if (script_hasdata(st, 7))
+ include_leader = script_getnum(st, 7);
p = party->search(p_id);
- if(!p)
+
+ if (p == NULL)
return true;
- type = ( strcmp(str,"Random")==0 ) ? 0
- : ( strcmp(str,"SavePointAll")==0 ) ? 1
- : ( strcmp(str,"SavePoint")==0 ) ? 2
- : ( strcmp(str,"Leader")==0 ) ? 3
+ type = (strcmp(str, "Random") == 0) ? 0
+ : (strcmp(str, "SavePointAll") == 0) ? 1
+ : (strcmp(str, "SavePoint") == 0) ? 2
+ : (strcmp(str, "Leader") == 0) ? 3
: 4;
- switch (type)
- {
- case 3:
- for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
- if (i == MAX_PARTY || !p->data[i].sd) //Leader not found / not online
- return true;
- pl_sd = p->data[i].sd;
- map_index = pl_sd->mapindex;
- x = pl_sd->bl.x;
- y = pl_sd->bl.y;
- break;
- case 4:
- map_index = script->mapindexname2id(st,str);
- break;
- case 2:
- //"SavePoint" uses save point of the currently attached player
- if (( sd = script->rid2sd(st) ) == NULL )
- return true;
- /* Fall through */
- default:
- map_index = 0;
- break;
+ switch (type) {
+ case 3:
+ ARR_FIND(0, MAX_PARTY, i, p->party.member[i].leader);
+ if (i == MAX_PARTY || !p->data[i].sd) // Leader not found / not online
+ return true;
+ pl_sd = p->data[i].sd;
+ map_index = pl_sd->mapindex;
+ x = pl_sd->bl.x;
+ y = pl_sd->bl.y;
+ break;
+ case 4:
+ map_index = script->mapindexname2id(st, str);
+ break;
+ case 2:
+ // "SavePoint" uses save point of the currently attached player
+ if ((sd = script->rid2sd(st)) == NULL)
+ return true;
+ /* Fall through */
+ default:
+ map_index = 0;
+ break;
}
for (i = 0; i < MAX_PARTY; i++) {
- if( !(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id )
+ if (!(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id)
continue;
- if( str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0 )
+ if (str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0)
continue;
- if( pc_isdead(pl_sd) )
+ if (pc_isdead(pl_sd))
continue;
- switch( type )
- {
- case 0: // Random
- if(!map->list[pl_sd->bl.m].flag.nowarp)
- pc->randomwarp(pl_sd,CLR_TELEPORT);
- break;
- case 1: // SavePointAll
- if(!map->list[pl_sd->bl.m].flag.noreturn)
- pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 2: // SavePoint
- if(!map->list[pl_sd->bl.m].flag.noreturn)
- pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 3: // Leader
- case 4: // m,x,y
- if(!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
- pc->setpos(pl_sd,map_index,x,y,CLR_TELEPORT);
- break;
+ if (include_leader == false && p->party.member[i].leader)
+ continue;
+
+ switch( type ) {
+ case 0: // Random
+ if (!map->list[pl_sd->bl.m].flag.nowarp)
+ pc->randomwarp(pl_sd, CLR_TELEPORT);
+ break;
+ case 1: // SavePointAll
+ if (!map->list[pl_sd->bl.m].flag.noreturn)
+ pc->setpos(pl_sd, pl_sd->status.save_point.map, pl_sd->status.save_point.x, pl_sd->status.save_point.y, CLR_TELEPORT);
+ break;
+ case 2: // SavePoint
+ if (!map->list[pl_sd->bl.m].flag.noreturn)
+ pc->setpos(pl_sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+ break;
+ case 3: // Leader
+ case 4: // m,x,y
+ if (!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
+ pc->setpos(pl_sd, map_index, x, y, CLR_TELEPORT);
+ break;
}
}
@@ -6138,61 +6799,67 @@ BUILDIN(warpparty)
}
/*==========================================
* Warpguild - [Fredzilla]
- * Syntax: warpguild "mapname",x,y,Guild_ID;
+ * Syntax: warpguild "mapname",x,y,Guild_ID,{"from_mapname"};
*------------------------------------------*/
BUILDIN(warpguild)
{
struct map_session_data *sd = NULL;
- struct map_session_data *pl_sd;
struct guild* g;
- struct s_mapiterator* iter;
int type;
+ int i;
+ int16 map_id = -1;
- const char* str = script_getstr(st,2);
- int x = script_getnum(st,3);
- int y = script_getnum(st,4);
- int gid = script_getnum(st,5);
+ const char *str = script_getstr(st, 2);
+ int x = script_getnum(st, 3);
+ int y = script_getnum(st, 4);
+ int gid = script_getnum(st, 5);
+
+ if (script_hasdata(st, 6)) {
+ map_id = map->mapname2mapid(script_getstr(st, 6));
+ }
g = guild->search(gid);
- if( g == NULL )
+ if (g == NULL)
return true;
- type = ( strcmp(str,"Random")==0 ) ? 0
- : ( strcmp(str,"SavePointAll")==0 ) ? 1
- : ( strcmp(str,"SavePoint")==0 ) ? 2
+ type = (strcmp(str, "Random") == 0) ? 0
+ : (strcmp(str, "SavePointAll") == 0) ? 1
+ : (strcmp(str, "SavePoint") == 0) ? 2
: 3;
- if( type == 2 && ( sd = script->rid2sd(st) ) == NULL )
+ if (type == 2 && (sd = script->rid2sd(st)) == NULL)
{// "SavePoint" uses save point of the currently attached player
return true;
}
- iter = mapit_getallusers();
- for (pl_sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); pl_sd = BL_UCAST(BL_PC, mapit->next(iter))) {
- if( pl_sd->status.guild_id != gid )
- continue;
+ for (i = 0; i < MAX_GUILD; i++) {
+ if (g->member[i].online && g->member[i].sd != NULL) {
+ struct map_session_data *pl_sd = g->member[i].sd;
- switch( type )
- {
+ if (map_id >= 0 && map_id != pl_sd->bl.m)
+ continue;
+
+ switch (type)
+ {
case 0: // Random
- if(!map->list[pl_sd->bl.m].flag.nowarp)
- pc->randomwarp(pl_sd,CLR_TELEPORT);
+ if (!map->list[pl_sd->bl.m].flag.nowarp)
+ pc->randomwarp(pl_sd, CLR_TELEPORT);
break;
case 1: // SavePointAll
- if(!map->list[pl_sd->bl.m].flag.noreturn)
- pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
+ if (!map->list[pl_sd->bl.m].flag.noreturn)
+ pc->setpos(pl_sd, pl_sd->status.save_point.map, pl_sd->status.save_point.x, pl_sd->status.save_point.y, CLR_TELEPORT);
break;
case 2: // SavePoint
- if(!map->list[pl_sd->bl.m].flag.noreturn)
- pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
+ if (!map->list[pl_sd->bl.m].flag.noreturn)
+ pc->setpos(pl_sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
break;
case 3: // m,x,y
- if(!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
- pc->setpos(pl_sd,script->mapindexname2id(st,str),x,y,CLR_TELEPORT);
+ if (!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
+ pc->setpos(pl_sd, script->mapindexname2id(st, str), x, y, CLR_TELEPORT);
break;
+ }
}
}
- mapit->free(iter);
return true;
}
@@ -6229,7 +6896,8 @@ BUILDIN(itemheal)
}
sd = script->rid2sd(st);
- if (!sd) return true;
+ if (sd == NULL)
+ return true;
pc->itemheal(sd,sd->itemid,hp,sp);
return true;
}
@@ -6251,13 +6919,16 @@ BUILDIN(percentheal)
}
sd = script->rid2sd(st);
- if( sd == NULL )
+ if (sd == NULL)
return true;
#ifdef RENEWAL
if( sd->sc.data[SC_EXTREMITYFIST2] )
sp = 0;
#endif
- pc->percentheal(sd,hp,sp);
+ if (sd->sc.data[SC_BITESCAR]) {
+ hp = 0;
+ }
+ pc->percentheal(sd, hp, sp);
return true;
}
@@ -6266,18 +6937,18 @@ BUILDIN(percentheal)
*------------------------------------------*/
BUILDIN(jobchange)
{
- int job, upper=-1;
+ int class, upper=-1;
- job=script_getnum(st,2);
+ class = script_getnum(st,2);
if( script_hasdata(st,3) )
upper=script_getnum(st,3);
- if (pc->db_checkid(job)) {
+ if (pc->db_checkid(class)) {
struct map_session_data *sd = script->rid2sd(st);
if (sd == NULL)
return true;
- pc->jobchange(sd, job, upper);
+ pc->jobchange(sd, class, upper);
}
return true;
@@ -6288,8 +6959,8 @@ BUILDIN(jobchange)
*------------------------------------------*/
BUILDIN(jobname)
{
- int class_=script_getnum(st,2);
- script_pushconststr(st, (char*)pc->job_name(class_));
+ int class = script_getnum(st,2);
+ script_pushconststr(st, pc->job_name(class));
return true;
}
@@ -6338,16 +7009,13 @@ BUILDIN(input)
} else {
// take received text/value and store it in the designated variable
sd->state.menu_or_input = 0;
- if( is_string_variable(name) )
- {
+ if (is_string_variable(name)) {
int len = (int)strlen(sd->npc_str);
- script->set_reg(st, sd, uid, name, (void*)sd->npc_str, script_getref(st,2));
+ script->set_reg(st, sd, uid, name, sd->npc_str, script_getref(st,2));
script_pushint(st, (len > max ? 1 : len < min ? -1 : 0));
- }
- else
- {
+ } else {
int amount = sd->npc_amount;
- script->set_reg(st, sd, uid, name, (void*)h64BPTRSIZE(cap_value(amount,min,max)), script_getref(st,2));
+ script->set_reg(st, sd, uid, name, (const void *)h64BPTRSIZE(cap_value(amount,min,max)), script_getref(st,2));
script_pushint(st, (amount > max ? 1 : amount < min ? -1 : 0));
}
st->state = RUN;
@@ -6434,9 +7102,9 @@ BUILDIN(__setr)
}
if (is_string_variable(name))
- script->set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
+ script->set_reg(st, sd, num, name, script_getstr(st, 3), script_getref(st, 2));
else
- script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(script_getnum(st,3)),script_getref(st,2));
+ script->set_reg(st, sd, num, name, (const void *)h64BPTRSIZE(script_getnum(st, 3)), script_getref(st, 2));
return true;
}
@@ -6483,15 +7151,14 @@ BUILDIN(setarray)
if( end > SCRIPT_MAX_ARRAYSIZE )
end = SCRIPT_MAX_ARRAYSIZE;
- if( is_string_variable(name) )
- {// string array
- for( i = 3; start < end; ++start, ++i )
- script->set_reg(st, sd, reference_uid(id, start), name, (void*)script_getstr(st,i), reference_getref(data));
- }
- else
- {// int array
- for( i = 3; start < end; ++start, ++i )
- script->set_reg(st, sd, reference_uid(id, start), name, (void*)h64BPTRSIZE(script_getnum(st,i)), reference_getref(data));
+ if (is_string_variable(name)) {
+ // string array
+ for (i = 3; start < end; ++start, ++i)
+ script->set_reg(st, sd, reference_uid(id, start), name, script_getstr(st, i), reference_getref(data));
+ } else {
+ // int array
+ for (i = 3; start < end; ++start, ++i)
+ script->set_reg(st, sd, reference_uid(id, start), name, (const void *)h64BPTRSIZE(script_getnum(st, i)), reference_getref(data));
}
return true;
}
@@ -6507,7 +7174,7 @@ BUILDIN(cleararray)
uint32 start;
uint32 end;
int32 id;
- void* v;
+ const void *v = NULL;
struct map_session_data *sd = NULL;
data = script_getdata(st, 2);
@@ -6530,10 +7197,10 @@ BUILDIN(cleararray)
return true;// no player attached
}
- if( is_string_variable(name) )
- v = (void*)script_getstr(st, 3);
+ if (is_string_variable(name))
+ v = script_getstr(st, 3);
else
- v = (void*)h64BPTRSIZE(script_getnum(st, 3));
+ v = (const void *)h64BPTRSIZE(script_getnum(st, 3));
end = start + script_getnum(st, 4);
if( end > SCRIPT_MAX_ARRAYSIZE )
@@ -6558,7 +7225,6 @@ BUILDIN(copyarray)
int32 idx2;
int32 id1;
int32 id2;
- void* v;
int32 i;
uint32 count;
struct map_session_data *sd = NULL;
@@ -6606,20 +7272,25 @@ BUILDIN(copyarray)
if( is_same_reference(data1, data2) && idx1 > idx2 ) {
// destination might be overlapping the source - copy in reverse order
for( i = count - 1; i >= 0; --i ) {
- v = script->get_val2(st, reference_uid(id2, idx2 + i), reference_getref(data2));
- script->set_reg(st, sd, reference_uid(id1, idx1 + i), name1, v, reference_getref(data1));
+ const void *value = script->get_val2(st, reference_uid(id2, idx2 + i), reference_getref(data2));
+ script->set_reg(st, sd, reference_uid(id1, idx1 + i), name1, value, reference_getref(data1));
script_removetop(st, -1, 0);
}
} else {
// normal copy
for( i = 0; i < count; ++i ) {
if( idx2 + i < SCRIPT_MAX_ARRAYSIZE ) {
- v = script->get_val2(st, reference_uid(id2, idx2 + i), reference_getref(data2));
- script->set_reg(st, sd, reference_uid(id1, idx1 + i), name1, v, reference_getref(data1));
+ const void *value = script->get_val2(st, reference_uid(id2, idx2 + i), reference_getref(data2));
+ script->set_reg(st, sd, reference_uid(id1, idx1 + i), name1, value, reference_getref(data1));
script_removetop(st, -1, 0);
} else {
// out of range - assume ""/0
- script->set_reg(st, sd, reference_uid(id1, idx1 + i), name1, (is_string_variable(name1)?(void*)"":(void*)0), reference_getref(data1));
+ const void *value;
+ if (is_string_variable(name1))
+ value = "";
+ else
+ value = (const void *)0;
+ script->set_reg(st, sd, reference_uid(id1, idx1 + i), name1, value, reference_getref(data1));
}
}
}
@@ -6648,8 +7319,25 @@ BUILDIN(getarraysize)
script_pushint(st, script->array_highest_key(st,st->rid ? script->rid2sd(st) : NULL,reference_getname(data),reference_getref(data)));
return true;
}
-int script_array_index_cmp(const void *a, const void *b) {
- return ( *(unsigned int*)a - *(unsigned int*)b );
+int script_array_index_cmp(const void *a, const void *b)
+{
+ return (*(const unsigned int *)a - *(const unsigned int *)b); // FIXME: Is the unsigned difference really intended here?
+}
+
+BUILDIN(getarrayindex)
+{
+ struct script_data *data = script_getdata(st, 2);
+
+ if (!data_isreference(data) || reference_toconstant(data))
+ {
+ ShowError("script:getarrayindex: not a variable\n");
+ script->reportdata(data);
+ st->state = END;
+ return false;// not a variable
+ }
+
+ script_pushint(st, reference_getindex(data));
+ return true;
}
/// Deletes count or all the elements in an array, from the starting index.
@@ -6722,7 +7410,7 @@ BUILDIN(deletearray)
// Better to iterate directly on the array, no speed-up from using sa
for( ; start + count < end; ++start ) {
// Compact and overwrite
- void* v = script->get_val2(st, reference_uid(id, start + count), reference_getref(data));
+ const void *v = script->get_val2(st, reference_uid(id, start + count), reference_getref(data));
script->set_reg(st, sd, reference_uid(id, start), name, v, reference_getref(data));
script_removetop(st, -1, 0);
}
@@ -6746,7 +7434,7 @@ BUILDIN(deletearray)
for( ; i < size && list[i] < end; i++ ) {
// Move back count positions any entries between start+count to fill the gaps
- void* v = script->get_val2(st, reference_uid(id, list[i]), reference_getref(data));
+ const void *v = script->get_val2(st, reference_uid(id, list[i]), reference_getref(data));
script->set_reg(st, sd, reference_uid(id, list[i]-count), name, v, reference_getref(data));
script_removetop(st, -1, 0);
// Clear their originals
@@ -7000,7 +7688,7 @@ BUILDIN(checkweight)
// item id
id = itemdb->exists(script_getnum(st, i));
} else {
- ShowError("buildin_checkweight: invalid type for argument '%d'.\n", i);
+ ShowError("buildin_checkweight: invalid type for argument '%u'.\n", i);
script_pushint(st,0);
return false;
}
@@ -7303,7 +7991,7 @@ BUILDIN(getitem2)
int get_count, i;
memset(&item_tmp,0,sizeof(item_tmp));
if (item_data == NULL)
- return -1;
+ return false;
if(item_data->type==IT_WEAPON || item_data->type==IT_ARMOR) {
ref = cap_value(ref, 0, MAX_REFINE);
}
@@ -7539,13 +8227,101 @@ BUILDIN(makeitem)
return true;
}
+/*==========================================
+* makeitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,{"<map name>",<X>,<Y>,<range>};
+*------------------------------------------*/
+BUILDIN(makeitem2)
+{
+ struct map_session_data *sd = NULL;
+ struct item_data *i_data;
+ int nameid = 0, amount;
+ int16 x, y, m = -1, range;
+ struct item item_tmp;
+
+ if (script_isstringtype(st, 2)) {
+ const char *name = script_getstr(st, 2);
+ struct item_data *item_data = itemdb->search_name(name);
+ if (item_data != NULL)
+ nameid = item_data->nameid;
+ } else {
+ nameid = script_getnum(st, 2);
+ }
+
+ i_data = itemdb->exists(nameid);
+ if (i_data == NULL) {
+ ShowError("makeitem2: Unknown item %d requested.\n", nameid);
+ return true;
+ }
+
+ if (script_hasdata(st, 11)) {
+ m = map->mapname2mapid(script_getstr(st, 11));
+ } else {
+ sd = script->rid2sd(st);
+ if (sd == NULL)
+ return true;
+ m = sd->bl.m;
+ }
+
+ if (m == -1) {
+ ShowError("makeitem2: Nonexistant map requested.\n");
+ return true;
+ }
+
+ x = (script_hasdata(st, 12) ? script_getnum(st, 12) : 0);
+ y = (script_hasdata(st, 13) ? script_getnum(st, 13) : 0);
+
+ // pick random position on map
+ if (x <= 0 || x >= map->list[m].xs || y <= 0 || y >= map->list[m].ys) {
+ sd = map->id2sd(st->rid);
+ if ((x < 0 || y < 0) && sd == NULL) {
+ x = 0;
+ y = 0;
+ map->search_freecell(NULL, m, &x, &y, -1, -1, 1);
+ } else {
+ range = (script_hasdata(st, 14) ? cap_value(script_getnum(st, 14), 1, battle_config.area_size) : 3);
+ map->search_freecell(&sd->bl, sd->bl.m, &x, &y, range, range, 0); // Locate spot next to player.
+ }
+ }
+
+ // if equip or weapon or egg type only drop one.
+ switch (i_data->type) {
+ case IT_ARMOR:
+ case IT_WEAPON:
+ case IT_PETARMOR:
+ case IT_PETEGG:
+ amount = 1;
+ break;
+ default:
+ amount = cap_value(script_getnum(st, 3), 1, MAX_AMOUNT);
+ break;
+ }
+
+ memset(&item_tmp, 0, sizeof(item_tmp));
+ item_tmp.nameid = nameid;
+ item_tmp.identify = script_getnum(st, 4);
+ item_tmp.refine = cap_value(script_getnum(st, 5), 0, MAX_REFINE);
+ item_tmp.attribute = script_getnum(st, 6);
+ item_tmp.card[0] = (short)script_getnum(st, 7);
+ item_tmp.card[1] = (short)script_getnum(st, 8);
+ item_tmp.card[2] = (short)script_getnum(st, 9);
+ item_tmp.card[3] = (short)script_getnum(st, 10);
+
+ map->addflooritem(NULL, &item_tmp, amount, m, x, y, 0, 0, 0, 0);
+
+ return true;
+}
+
/// Counts / deletes the current item given by idx.
/// Used by buildin_delitem_search
/// Relies on all input data being already fully valid.
void buildin_delitem_delete(struct map_session_data* sd, int idx, int* amount, bool delete_items)
{
int delamount;
- struct item* inv = &sd->status.inventory[idx];
+ struct item* inv;
+
+ nullpo_retv(sd);
+ nullpo_retv(amount);
+ inv = &sd->status.inventory[idx];
delamount = ( amount[0] < inv->amount ) ? amount[0] : inv->amount;
@@ -7572,6 +8348,8 @@ bool buildin_delitem_search(struct map_session_data* sd, struct item* it, bool e
int i, amount;
struct item* inv;
+ nullpo_retr(false, sd);
+ nullpo_retr(false, it);
// prefer always non-equipped items
it->equip = 0;
@@ -7816,20 +8594,26 @@ BUILDIN(disableitemuse)
BUILDIN(readparam) {
int type;
struct map_session_data *sd;
+ struct script_data *data = script_getdata(st, 2);
- type=script_getnum(st,2);
- if (script_hasdata(st,3))
- sd = script->nick2sd(st, script_getstr(st,3));
- else
- sd=script->rid2sd(st);
+ if (reference_toparam(data)) {
+ type = reference_getparamtype(data);
+ } else {
+ type = script->conv_num(st, data);
+ }
+
+ if (script_hasdata(st, 3)) {
+ sd = script->nick2sd(st, script_getstr(st, 3));
+ } else {
+ sd = script->rid2sd(st);
+ }
if (sd == NULL) {
- script_pushint(st,-1);
+ script_pushint(st, -1);
return true;
}
- script_pushint(st,pc->readparam(sd,type));
-
+ script_pushint(st, pc->readparam(sd, type));
return true;
}
@@ -7994,7 +8778,7 @@ BUILDIN(getpartyleader)
switch (type) {
case 1: script_pushint(st,p->party.member[i].account_id); break;
case 2: script_pushint(st,p->party.member[i].char_id); break;
- case 3: script_pushint(st,p->party.member[i].class_); break;
+ case 3: script_pushint(st,p->party.member[i].class); break;
case 4: script_pushstrcopy(st,mapindex_id2name(p->party.member[i].map)); break;
case 5: script_pushint(st,p->party.member[i].lv); break;
default: script_pushstrcopy(st,p->party.member[i].name); break;
@@ -8118,39 +8902,48 @@ BUILDIN(getguildmember)
*------------------------------------------*/
BUILDIN(strcharinfo)
{
- int num;
struct guild* g;
struct party_data* p;
- struct map_session_data *sd = script->rid2sd(st);
- if (sd == NULL) //Avoid crashing....
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 4))
+ sd = map->id2sd(script_getnum(st, 4));
+ else
+ sd = script->rid2sd(st);
+
+ if (sd == NULL) {
+ if(script_hasdata(st, 3)) {
+ script_pushcopy(st, 3);
+ } else {
+ script_pushconststr(st, "");
+ }
return true;
+ }
- num=script_getnum(st,2);
- switch(num) {
- case 0:
- script_pushstrcopy(st,sd->status.name);
- break;
- case 1:
- if( ( p = party->search(sd->status.party_id) ) != NULL ) {
- script_pushstrcopy(st,p->party.name);
- } else {
- script_pushconststr(st,"");
- }
- break;
- case 2:
- if( ( g = sd->guild ) != NULL ) {
- script_pushstrcopy(st,g->name);
- } else {
- script_pushconststr(st,"");
- }
- break;
- case 3:
- script_pushconststr(st,map->list[sd->bl.m].name);
- break;
- default:
- ShowWarning("buildin_strcharinfo: unknown parameter.\n");
- script_pushconststr(st,"");
- break;
+ switch (script_getnum(st, 2)) {
+ case 0:
+ script_pushstrcopy(st, sd->status.name);
+ break;
+ case 1:
+ if ((p = party->search(sd->status.party_id)) != NULL) {
+ script_pushstrcopy(st, p->party.name);
+ } else {
+ script_pushconststr(st, "");
+ }
+ break;
+ case 2:
+ if ((g = sd->guild) != NULL) {
+ script_pushstrcopy(st, g->name);
+ } else {
+ script_pushconststr(st, "");
+ }
+ break;
+ case 3:
+ script_pushconststr(st, map->list[sd->bl.m].name);
+ break;
+ default:
+ ShowWarning("script:strcharinfo: unknown parameter.\n");
+ script_pushconststr(st, "");
}
return true;
@@ -8167,41 +8960,51 @@ BUILDIN(strcharinfo)
*------------------------------------------*/
BUILDIN(strnpcinfo)
{
- int num;
char *buf,*name=NULL;
- struct npc_data *nd = map->id2nd(st->oid);
+ struct npc_data *nd;
+
+ if (script_hasdata(st, 4))
+ nd = map->id2nd(script_getnum(st, 4));
+ else
+ nd = map->id2nd(st->oid);
+
if (nd == NULL) {
- script_pushconststr(st, "");
+ if (script_hasdata(st, 3)) {
+ script_pushcopy(st, 3);
+ } else {
+ script_pushconststr(st, "");
+ }
return true;
}
- num = script_getnum(st,2);
- switch(num) {
- case 0: // display name
+ switch (script_getnum(st,2)) {
+ case 0: // display name
+ name = aStrdup(nd->name);
+ break;
+ case 1: // visible part of display name
+ if ((buf = strchr(nd->name,'#')) != NULL) {
name = aStrdup(nd->name);
- break;
- case 1: // visible part of display name
- if((buf = strchr(nd->name,'#')) != NULL)
- {
- name = aStrdup(nd->name);
- name[buf - nd->name] = 0;
- } else // Return the name, there is no '#' present
- name = aStrdup(nd->name);
- break;
- case 2: // # fragment
- if((buf = strchr(nd->name,'#')) != NULL)
- name = aStrdup(buf+1);
- break;
- case 3: // unique name
- name = aStrdup(nd->exname);
- break;
- case 4: // map name
- if( nd->bl.m >= 0 ) // Only valid map indexes allowed (issue:8034)
- name = aStrdup(map->list[nd->bl.m].name);
- break;
+ name[buf - nd->name] = 0;
+ } else { // Return the name, there is no '#' present
+ name = aStrdup(nd->name);
+ }
+ break;
+ case 2: // # fragment
+ if ((buf = strchr(nd->name,'#')) != NULL) {
+ name = aStrdup(buf+1);
+ }
+ break;
+ case 3: // unique name
+ name = aStrdup(nd->exname);
+ break;
+ case 4: // map name
+ if (nd->bl.m >= 0) { // Only valid map indexes allowed (issue:8034)
+ name = aStrdup(map->list[nd->bl.m].name);
+ }
+ break;
}
- if(name)
+ if (name)
script_pushstr(st, name);
else
script_pushconststr(st, "");
@@ -8309,7 +9112,7 @@ BUILDIN(getbrokenid)
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
- if(sd->status.inventory[i].attribute) {
+ if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
brokencounter++;
if(num==brokencounter) {
id=sd->status.inventory[i].nameid;
@@ -8334,7 +9137,7 @@ BUILDIN(getbrokencount)
return true;
for (i = 0; i < MAX_INVENTORY; i++) {
- if (sd->status.inventory[i].attribute)
+ if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0)
counter++;
}
@@ -8356,10 +9159,11 @@ BUILDIN(repair)
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
- if(sd->status.inventory[i].attribute) {
+ if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
repaircounter++;
if(num==repaircounter) {
- sd->status.inventory[i].attribute=0;
+ sd->status.inventory[i].attribute |= ATTR_BROKEN;
+ sd->status.inventory[i].attribute ^= ATTR_BROKEN;
clif->equiplist(sd);
clif->produce_effect(sd, 0, sd->status.inventory[i].nameid);
clif->misceffect(&sd->bl, 3);
@@ -8383,9 +9187,10 @@ BUILDIN(repairall)
for(i = 0; i < MAX_INVENTORY; i++)
{
- if(sd->status.inventory[i].nameid && sd->status.inventory[i].attribute)
+ if (sd->status.inventory[i].nameid && (sd->status.inventory[i].attribute & ATTR_BROKEN) != 0)
{
- sd->status.inventory[i].attribute = 0;
+ sd->status.inventory[i].attribute |= ATTR_BROKEN;
+ sd->status.inventory[i].attribute ^= ATTR_BROKEN;
clif->produce_effect(sd,0,sd->status.inventory[i].nameid);
repaircounter++;
}
@@ -8450,6 +9255,35 @@ BUILDIN(getequipisenableref)
return true;
}
+/**
+ * Checks if the equipped item allows options.
+ * *getequipisenableopt(<equipment_index>);
+ *
+ * @param equipment_index as the inventory index of the equipment.
+ * @return 1 on enabled 0 on disabled.
+ */
+BUILDIN(getequipisenableopt)
+{
+ int i = -1, index = script_getnum(st, 2);
+ struct map_session_data *sd = script->rid2sd(st);
+
+ if (sd == NULL) {
+ script_pushint(st, -1);
+ ShowError("buildin_getequipisenableopt: player is not attached!");
+ return false;
+ }
+
+ if (index > 0 && index <= ARRAYLENGTH(script->equip))
+ i = pc->checkequip(sd, script->equip[index - 1]);
+
+ if (i >=0 && sd->inventory_data[i] && !sd->inventory_data[i]->flag.no_options && !sd->status.inventory[i].expire_time)
+ script_pushint(st, 1);
+ else
+ script_pushint(st, 0);
+
+ return true;
+}
+
/*==========================================
* Chk if the item equiped at pos is identify (huh ?)
* return (npc)
@@ -8536,20 +9370,32 @@ BUILDIN(getequipweaponlv)
* 0 : false (max refine level or unequip..)
*------------------------------------------*/
BUILDIN(getequippercentrefinery) {
- int i = -1,num;
+ int i = -1, num;
struct map_session_data *sd;
+ int type = 0;
+
+ num = script_getnum(st, 2);
+ type = (script_hasdata(st, 3)) ? script_getnum(st, 3) : REFINE_CHANCE_TYPE_NORMAL;
- num = script_getnum(st,2);
sd = script->rid2sd(st);
- if( sd == NULL )
+ if (sd == NULL)
return true;
+ if (type < REFINE_CHANCE_TYPE_NORMAL || type >= REFINE_CHANCE_TYPE_MAX) {
+ ShowError("buildin_getequippercentrefinery: Invalid type (%d) provided!\n", type);
+ script_pushint(st, 0);
+ return false;
+ }
+
+
if (num > 0 && num <= ARRAYLENGTH(script->equip))
- i=pc->checkequip(sd,script->equip[num-1]);
- if(i >= 0 && sd->status.inventory[i].nameid && sd->status.inventory[i].refine < MAX_REFINE)
- script_pushint(st,status->get_refine_chance(itemdb_wlv(sd->status.inventory[i].nameid), (int)sd->status.inventory[i].refine));
+ i = pc->checkequip(sd, script->equip[num - 1]);
+
+ if (i >= 0 && sd->status.inventory[i].nameid != 0 && sd->status.inventory[i].refine < MAX_REFINE)
+ script_pushint(st,
+ status->get_refine_chance(itemdb_wlv(sd->status.inventory[i].nameid), (int) sd->status.inventory[i].refine, (enum refine_chance_type) type));
else
- script_pushint(st,0);
+ script_pushint(st, 0);
return true;
}
@@ -8599,15 +9445,15 @@ BUILDIN(successrefitem)
sd->status.char_id == (int)MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3])
) { // Fame point system [DracoRPG]
switch (sd->inventory_data[i]->wlv) {
- case 1:
- pc->addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
- break;
- case 2:
- pc->addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
- break;
- case 3:
- pc->addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
- break;
+ case 1:
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
+ break;
+ case 2:
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
+ break;
+ case 3:
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
+ break;
}
}
}
@@ -8788,7 +9634,7 @@ BUILDIN(bonus) {
val1 = skill->name2id(script_getstr(st, 3));
break;
}
- // else fall through
+ FALLTHROUGH
default:
val1 = script_getnum(st,3);
break;
@@ -8836,7 +9682,8 @@ BUILDIN(bonus) {
return true;
}
-BUILDIN(autobonus) {
+BUILDIN(autobonus)
+{
unsigned int dur;
short rate;
short atk_type = 0;
@@ -8845,7 +9692,7 @@ BUILDIN(autobonus) {
if (sd == NULL)
return true; // no player attached
- if( sd->state.autobonus&sd->status.inventory[status->current_equip_item_index].equip )
+ if (status->current_equip_item_index < 0 || sd->state.autobonus&sd->status.inventory[status->current_equip_item_index].equip)
return true;
rate = script_getnum(st,3);
@@ -8870,7 +9717,8 @@ BUILDIN(autobonus) {
return true;
}
-BUILDIN(autobonus2) {
+BUILDIN(autobonus2)
+{
unsigned int dur;
short rate;
short atk_type = 0;
@@ -8879,7 +9727,7 @@ BUILDIN(autobonus2) {
if (sd == NULL)
return true; // no player attached
- if( sd->state.autobonus&sd->status.inventory[status->current_equip_item_index].equip )
+ if (status->current_equip_item_index < 0 || sd->state.autobonus&sd->status.inventory[status->current_equip_item_index].equip)
return true;
rate = script_getnum(st,3);
@@ -8904,7 +9752,8 @@ BUILDIN(autobonus2) {
return true;
}
-BUILDIN(autobonus3) {
+BUILDIN(autobonus3)
+{
unsigned int dur;
short rate,atk_type;
const char *bonus_script, *other_script = NULL;
@@ -8912,7 +9761,7 @@ BUILDIN(autobonus3) {
if (sd == NULL)
return true; // no player attached
- if( sd->state.autobonus&sd->status.inventory[status->current_equip_item_index].equip )
+ if (status->current_equip_item_index < 0 || sd->state.autobonus&sd->status.inventory[status->current_equip_item_index].equip)
return true;
rate = script_getnum(st,3);
@@ -9009,6 +9858,9 @@ BUILDIN(guildskill) {
skill_id = ( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
level = script_getnum(st,3);
+ if (skill_id < GD_SKILLBASE || skill_id >= GD_MAX)
+ return true; // not guild skill
+
id = skill_id - GD_SKILLBASE;
max_points = guild->skill_get_max(skill_id);
@@ -9150,7 +10002,13 @@ BUILDIN(end) {
BUILDIN(checkoption)
{
int option;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -9169,7 +10027,13 @@ BUILDIN(checkoption)
BUILDIN(checkoption1)
{
int opt1;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -9188,7 +10052,13 @@ BUILDIN(checkoption1)
BUILDIN(checkoption2)
{
int opt2;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -9212,7 +10082,13 @@ BUILDIN(setoption)
{
int option;
int flag = 1;
- struct map_session_data *sd = script->rid2sd(st);
+ struct map_session_data *sd;
+
+ if (script_hasdata(st, 4))
+ sd = map->id2sd(script_getnum(st, 4));
+ else
+ sd = script->rid2sd(st);
+
if (sd == NULL)
return true;// no player attached, report source
@@ -9402,7 +10278,7 @@ BUILDIN(setmount)
flag = SETMOUNT_TYPE_AUTODETECT;
}
// Sanity checks and auto-detection
- if ((sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) {
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT) {
if (pc->checkskill(sd, RK_DRAGONTRAINING)) {
// Rune Knight (Dragon)
unsigned int option;
@@ -9414,11 +10290,11 @@ BUILDIN(setmount)
OPTION_DRAGON1); // default value
pc->setridingdragon(sd, option);
}
- } else if ((sd->class_&MAPID_THIRDMASK) == MAPID_RANGER) {
+ } else if ((sd->job & MAPID_THIRDMASK) == MAPID_RANGER) {
// Ranger (Warg)
if (pc->checkskill(sd, RA_WUGRIDER))
pc->setridingwug(sd, true);
- } else if ((sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC) {
+ } else if ((sd->job & MAPID_THIRDMASK) == MAPID_MECHANIC) {
// Mechanic (Mado Gear)
if (pc->checkskill(sd, NC_MADOLICENCE))
pc->setmadogear(sd, true);
@@ -9592,9 +10468,17 @@ BUILDIN(openstorage)
{
struct map_session_data *sd = script->rid2sd(st);
if (sd == NULL)
- return true;
+ return false;
+
+ if (sd->storage.received == false) {
+ script_pushint(st, 0);
+ ShowWarning("buildin_openstorage: Storage data for AID %d has not been loaded.\n", sd->bl.id);
+ return false;
+ }
storage->open(sd);
+
+ script_pushint(st, 1); // success flag.
return true;
}
@@ -9791,7 +10675,7 @@ BUILDIN(monster)
size = script_getnum(st, 9);
if (size > 3)
{
- ShowWarning("buildin_monster: Attempted to spawn non-existing size %d for monster class %d\n", size, class_);
+ ShowWarning("buildin_monster: Attempted to spawn non-existing size %u for monster class %d\n", size, class_);
return false;
}
}
@@ -9800,7 +10684,7 @@ BUILDIN(monster)
{
ai = script_getnum(st, 10);
if (ai > AI_FLORA) {
- ShowWarning("buildin_monster: Attempted to spawn non-existing ai %d for monster class %d\n", ai, class_);
+ ShowWarning("buildin_monster: Attempted to spawn non-existing ai %u for monster class %d\n", ai, class_);
return false;
}
}
@@ -9896,7 +10780,7 @@ BUILDIN(areamonster) {
if (script_hasdata(st, 11)) {
size = script_getnum(st, 11);
if (size > 3) {
- ShowWarning("buildin_monster: Attempted to spawn non-existing size %d for monster class %d\n", size, class_);
+ ShowWarning("buildin_monster: Attempted to spawn non-existing size %u for monster class %d\n", size, class_);
return false;
}
}
@@ -9904,7 +10788,7 @@ BUILDIN(areamonster) {
if (script_hasdata(st, 12)) {
ai = script_getnum(st, 12);
if (ai > AI_FLORA) {
- ShowWarning("buildin_monster: Attempted to spawn non-existing ai %d for monster class %d\n", ai, class_);
+ ShowWarning("buildin_monster: Attempted to spawn non-existing ai %u for monster class %d\n", ai, class_);
return false;
}
}
@@ -10010,6 +10894,7 @@ int buildin_killmonsterall_sub_strip(struct block_list *bl,va_list ap)
struct mob_data *md;
md = BL_CAST(BL_MOB, bl);
+ nullpo_ret(md);
if (md->npc_event[0])
md->npc_event[0] = 0;
@@ -10049,7 +10934,8 @@ BUILDIN(killmonsterall) {
*------------------------------------------*/
BUILDIN(clone) {
struct map_session_data *sd, *msd = NULL;
- int char_id,master_id=0,x,y, mode = 0, flag = 0, m;
+ int char_id, master_id = 0, x, y, flag = 0, m;
+ uint32 mode = 0;
unsigned int duration = 0;
const char *mapname, *event;
@@ -10062,8 +10948,8 @@ BUILDIN(clone) {
if( script_hasdata(st,7) )
master_id=script_getnum(st,7);
- if( script_hasdata(st,8) )
- mode=script_getnum(st,8);
+ if (script_hasdata(st,8))
+ mode = script_getnum(st,8);
if( script_hasdata(st,9) )
flag=script_getnum(st,9);
@@ -10127,19 +11013,29 @@ BUILDIN(donpcevent)
*------------------------------------------*/
BUILDIN(addtimer)
{
- int tick = script_getnum(st,2);
+ int tick = script_getnum(st, 2);
const char* event = script_getstr(st, 3);
struct map_session_data *sd;
script->check_event(st, event);
- sd = script->rid2sd(st);
- if( sd == NULL )
- return true;
- if (!pc->addeventtimer(sd,tick,event)) {
- ShowWarning("buildin_addtimer: Event timer is full, can't add new event timer. (cid:%d timer:%s)\n",sd->status.char_id,event);
+ if (script_hasdata(st, 4))
+ sd = map->id2sd(script_getnum(st, 4));
+ else
+ sd = script->rid2sd(st);
+
+ if (sd == NULL) {
+ script_pushint(st, 0);
+ return false;
+ }
+
+ if (!pc->addeventtimer(sd, tick, event)) {
+ ShowWarning("script:addtimer: Event timer is full, can't add new event timer. (cid:%d timer:%s)\n", sd->status.char_id, event);
+ script_pushint(st, 0);
return false;
}
+
+ script_pushint(st, 1);
return true;
}
/*==========================================
@@ -10150,12 +11046,17 @@ BUILDIN(deltimer)
struct map_session_data *sd;
event=script_getstr(st, 2);
- sd = script->rid2sd(st);
- if( sd == NULL )
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
+ if (sd == NULL)
return true;
script->check_event(st, event);
- pc->deleventtimer(sd,event);
+ pc->deleventtimer(sd, event);
return true;
}
/*==========================================
@@ -10166,14 +11067,198 @@ BUILDIN(addtimercount)
int tick;
struct map_session_data *sd;
- event=script_getstr(st, 2);
- tick=script_getnum(st,3);
- sd = script->rid2sd(st);
- if( sd == NULL )
+ event = script_getstr(st, 2);
+ tick = script_getnum(st, 3);
+
+ if (script_hasdata(st, 4))
+ sd = map->id2sd(script_getnum(st, 4));
+ else
+ sd = script->rid2sd(st);
+
+ if (sd == NULL)
return true;
script->check_event(st, event);
- pc->addeventtimercount(sd,event,tick);
+ pc->addeventtimercount(sd, event, tick);
+ return true;
+}
+
+enum gettimer_mode {
+ GETTIMER_COUNT = 0,
+ GETTIMER_TICK_NEXT = 1,
+ GETTIMER_TICK_LAST = 2,
+};
+
+BUILDIN(gettimer)
+{
+ struct map_session_data *sd;
+ const struct TimerData *td;
+ int i;
+ int tick;
+ const char *event = NULL;
+ int val = 0;
+ bool first = true;
+ short mode = script_getnum(st, 2);
+
+ if (script_hasdata(st, 3))
+ sd = map->id2sd(script_getnum(st, 3));
+ else
+ sd = script->rid2sd(st);
+
+ if (script_hasdata(st, 4)) {
+ event = script_getstr(st, 4);
+ script->check_event(st, event);
+ }
+
+ if (sd == NULL) {
+ script_pushint(st, -1);
+ return true;
+ }
+
+ switch (mode) {
+ case GETTIMER_COUNT:
+ // get number of timers
+ for (i = 0; i < MAX_EVENTTIMER; i++) {
+ if (sd->eventtimer[i] != INVALID_TIMER) {
+ if (event != NULL) {
+ td = timer->get(sd->eventtimer[i]);
+ Assert_retr(false, td != NULL);
+
+ if (strcmp((char *)(td->data), event) == 0) {
+ val++;
+ }
+ } else {
+ val++;
+ }
+ }
+ }
+ break;
+ case GETTIMER_TICK_NEXT:
+ // get the number of tick before the next timer runs
+ for (i = 0; i < MAX_EVENTTIMER; i++) {
+ if (sd->eventtimer[i] != INVALID_TIMER) {
+ td = timer->get(sd->eventtimer[i]);
+ Assert_retr(false, td != NULL);
+ tick = max(0, DIFF_TICK32(td->tick, timer->gettick()));
+
+ if (event != NULL) {
+ if ((first == true || tick < val) && strcmp((char *)(td->data), event) == 0) {
+ val = tick;
+ first = false;
+ }
+ } else if (first == true || tick < val) {
+ val = tick;
+ first = false;
+ }
+ }
+ }
+ break;
+ case GETTIMER_TICK_LAST:
+ // get the number of ticks before the last timer runs
+ for (i = MAX_EVENTTIMER - 1; i >= 0; i--) {
+ if (sd->eventtimer[i] != INVALID_TIMER) {
+ td = timer->get(sd->eventtimer[i]);
+ Assert_retr(false, td != NULL);
+ tick = max(0, DIFF_TICK32(td->tick, timer->gettick()));
+
+ if (event != NULL) {
+ if (strcmp((char *)(td->data), event) == 0) {
+ val = max(val, tick);
+ }
+ } else {
+ val = max(val, tick);
+ }
+ }
+ }
+ break;
+ }
+
+ script_pushint(st, val);
+ return true;
+}
+
+int buildin_getunits_sub(struct block_list *bl, va_list ap)
+{
+ struct script_state *st = va_arg(ap, struct script_state *);
+ struct map_session_data *sd = va_arg(ap, struct map_session_data *);
+ int32 id = va_arg(ap, int32);
+ uint32 start = va_arg(ap, uint32);
+ uint32 *count = va_arg(ap, uint32 *);
+ uint32 limit = va_arg(ap, uint32);
+ const char *name = va_arg(ap, const char *);
+ struct reg_db *ref = va_arg(ap, struct reg_db *);
+ uint32 index = start + *count;
+
+ if (index >= SCRIPT_MAX_ARRAYSIZE || *count > limit) {
+ return 1;
+ }
+
+ script->set_reg(st, sd, reference_uid(id, index), name,
+ (const void *)h64BPTRSIZE(bl->id), ref);
+
+ (*count)++;
+ return 0;
+}
+
+BUILDIN(getunits)
+{
+ const char *mapname, *name;
+ int16 m, x1, y1, x2, y2;
+ int32 id;
+ uint32 start;
+ struct reg_db *ref;
+ enum bl_type type = script_getnum(st, 2);
+ struct script_data *data = script_getdata(st, 3);
+ uint32 count = 0, limit = script_getnum(st, 4);
+ struct map_session_data *sd = NULL;
+
+ if (!data_isreference(data) || reference_toconstant(data)) {
+ ShowError("script:getunits: second argument must be a variable\n");
+ script->reportdata(data);
+ st->state = END;
+ return false;
+ }
+
+ id = reference_getid(data);
+ start = reference_getindex(data);
+ name = reference_getname(data);
+ ref = reference_getref(data);
+
+ if (not_server_variable(*name)) {
+ sd = script->rid2sd(st);
+ if (sd == NULL) {
+ return true; // player variable but no player attached
+ }
+ }
+
+ if (is_string_variable(name)) {
+ ShowError("script:getunits: second argument must be an integer variable\n");
+ script->reportdata(data);
+ st->state = END;
+ return false;
+ }
+
+ if (limit < 1 || limit > SCRIPT_MAX_ARRAYSIZE) {
+ limit = SCRIPT_MAX_ARRAYSIZE;
+ }
+
+ mapname = script_getstr(st, 5);
+ m = map->mapname2mapid(mapname);
+
+ if (script_hasdata(st, 9)) {
+ x1 = script_getnum(st, 6);
+ y1 = script_getnum(st, 7);
+ x2 = script_getnum(st, 8);
+ y2 = script_getnum(st, 9);
+
+ map->foreachinarea(buildin_getunits_sub, m, x1, y1, x2, y2, type,
+ st, sd, id, start, &count, limit, name, ref);
+ } else {
+ map->foreachinmap(buildin_getunits_sub, m, type,
+ st, sd, id, start, &count, limit, name, ref);
+ }
+
+ script_pushint(st, count);
return true;
}
@@ -10431,7 +11516,8 @@ BUILDIN(playerattached) {
/*==========================================
*------------------------------------------*/
-BUILDIN(announce) {
+BUILDIN(announce)
+{
const char *mes = script_getstr(st,2);
int flag = script_getnum(st,3);
const char *fontColor = script_hasdata(st,4) ? script_getstr(st,4) : NULL;
@@ -10439,6 +11525,8 @@ BUILDIN(announce) {
int fontSize = script_hasdata(st,6) ? script_getnum(st,6) : 12; // default fontSize
int fontAlign = script_hasdata(st,7) ? script_getnum(st,7) : 0; // default fontAlign
int fontY = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontY
+ size_t len = strlen(mes);
+ Assert_retr(false, len < INT_MAX);
if( flag&(BC_TARGET_MASK|BC_SOURCE_MASK) ) {
// Broadcast source or broadcast region defined
@@ -10463,14 +11551,14 @@ BUILDIN(announce) {
}
if (fontColor)
- clif->broadcast2(bl, mes, (int)strlen(mes)+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target);
+ clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target);
else
- clif->broadcast(bl, mes, (int)strlen(mes)+1, flag&BC_COLOR_MASK, target);
+ clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target);
} else {
if (fontColor)
- intif->broadcast2(mes, (int)strlen(mes)+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY);
+ intif->broadcast2(mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY);
else
- intif->broadcast(mes, (int)strlen(mes)+1, flag&BC_COLOR_MASK);
+ intif->broadcast(mes, (int)len+1, flag&BC_COLOR_MASK);
}
return true;
}
@@ -10478,10 +11566,10 @@ BUILDIN(announce) {
*------------------------------------------*/
int buildin_announce_sub(struct block_list *bl, va_list ap)
{
- char *mes = va_arg(ap, char *);
+ const char *mes = va_arg(ap, const char *);
int len = va_arg(ap, int);
int type = va_arg(ap, int);
- char *fontColor = va_arg(ap, char *);
+ const char *fontColor = va_arg(ap, const char *);
short fontType = (short)va_arg(ap, int);
short fontSize = (short)va_arg(ap, int);
short fontAlign = (short)va_arg(ap, int);
@@ -10528,7 +11616,8 @@ BUILDIN(itemeffect)
return true;
}
-BUILDIN(mapannounce) {
+BUILDIN(mapannounce)
+{
const char *mapname = script_getstr(st,2);
const char *mes = script_getstr(st,3);
int flag = script_getnum(st,4);
@@ -10538,17 +11627,20 @@ BUILDIN(mapannounce) {
int fontAlign = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontAlign
int fontY = script_hasdata(st,9) ? script_getnum(st,9) : 0; // default fontY
int16 m;
+ size_t len = strlen(mes);
+ Assert_retr(false, len < INT_MAX);
if ((m = map->mapname2mapid(mapname)) < 0)
return true;
map->foreachinmap(script->buildin_announce_sub, m, BL_PC,
- mes, strlen(mes)+1, flag&BC_COLOR_MASK, fontColor, fontType, fontSize, fontAlign, fontY);
+ mes, (int)len+1, flag&BC_COLOR_MASK, fontColor, fontType, fontSize, fontAlign, fontY);
return true;
}
/*==========================================
*------------------------------------------*/
-BUILDIN(areaannounce) {
+BUILDIN(areaannounce)
+{
const char *mapname = script_getstr(st,2);
int x0 = script_getnum(st,3);
int y0 = script_getnum(st,4);
@@ -10562,12 +11654,14 @@ BUILDIN(areaannounce) {
int fontAlign = script_hasdata(st,12) ? script_getnum(st,12) : 0; // default fontAlign
int fontY = script_hasdata(st,13) ? script_getnum(st,13) : 0; // default fontY
int16 m;
+ size_t len = strlen(mes);
+ Assert_retr(false, len < INT_MAX);
if ((m = map->mapname2mapid(mapname)) < 0)
return true;
map->foreachinarea(script->buildin_announce_sub, m, x0, y0, x1, y1, BL_PC,
- mes, strlen(mes)+1, flag&BC_COLOR_MASK, fontColor, fontType, fontSize, fontAlign, fontY);
+ mes, (int)len+1, flag&BC_COLOR_MASK, fontColor, fontType, fontSize, fontAlign, fontY);
return true;
}
@@ -10682,6 +11776,7 @@ BUILDIN(getmapusers) {
int buildin_getareausers_sub(struct block_list *bl,va_list ap)
{
int *users=va_arg(ap,int *);
+ nullpo_ret(users);
(*users)++;
return 0;
}
@@ -11004,14 +12099,16 @@ BUILDIN(getstatus)
case 3: script_pushint(st, sd->sc.data[id]->val3); break;
case 4: script_pushint(st, sd->sc.data[id]->val4); break;
case 5:
- {
- struct TimerData* td = (struct TimerData*)timer->get(sd->sc.data[id]->timer);
+ if (sd->sc.data[id]->infinite_duration) {
+ script_pushint(st, INFINITE_DURATION);
+ } else {
+ const struct TimerData *td = timer->get(sd->sc.data[id]->timer);
- if( td ) {
- // return the amount of time remaining
- script_pushint(st, (int)(td->tick - timer->gettick())); // TODO: change this to int64 when we'll support 64 bit script values
+ if (td != NULL) {
+ // return the amount of time remaining
+ script_pushint(st, (int)(td->tick - timer->gettick())); // TODO: change this to int64 when we'll support 64 bit script values
+ }
}
- }
break;
default: script_pushint(st, 1); break;
}
@@ -11180,22 +12277,22 @@ BUILDIN(homunculus_shuffle)
//These two functions bring the eA MAPID_* class functionality to scripts.
BUILDIN(eaclass)
{
- int class_;
+ int class;
if (script_hasdata(st,2)) {
- class_ = script_getnum(st,2);
+ class = script_getnum(st,2);
} else {
struct map_session_data *sd = script->rid2sd(st);
if (sd == NULL)
return true;
- class_ = sd->status.class_;
+ class = sd->status.class;
}
- script_pushint(st,pc->jobid2mapid(class_));
+ script_pushint(st,pc->jobid2mapid(class));
return true;
}
BUILDIN(roclass)
{
- int class_ =script_getnum(st,2);
+ int job = script_getnum(st,2);
int sex;
if (script_hasdata(st,3)) {
sex = script_getnum(st,3);
@@ -11206,7 +12303,7 @@ BUILDIN(roclass)
else
sex = 1; //Just use male when not found.
}
- script_pushint(st,pc->mapid2jobid(class_, sex));
+ script_pushint(st,pc->mapid2jobid(job, sex));
return true;
}
@@ -11302,12 +12399,12 @@ BUILDIN(changebase)
if(vclass == JOB_WEDDING)
{
if (!battle_config.wedding_modifydisplay || //Do not show the wedding sprites
- sd->class_&JOBL_BABY //Baby classes screw up when showing wedding sprites. [Skotlex] They don't seem to anymore.
+ sd->job & JOBL_BABY //Baby classes screw up when showing wedding sprites. [Skotlex] They don't seem to anymore.
)
return true;
}
- if(sd->disguise == -1 && vclass != sd->vd.class_)
+ if (sd->disguise == -1 && vclass != sd->vd.class)
pc->changelook(sd,LOOK_BASE,vclass); //Updated client view. Base, Weapon and Cloth Colors.
return true;
@@ -11512,6 +12609,7 @@ BUILDIN(getwaitingroomstate)
case 0:
for (i = 0; i < cd->users; i++) {
struct map_session_data *sd = cd->usersd[i];
+ nullpo_retr(false, sd);
mapreg->setreg(reference_uid(script->add_str("$@chatmembers"), i), sd->bl.id);
}
script_pushint(st, cd->users);
@@ -11525,8 +12623,8 @@ BUILDIN(getwaitingroomstate)
case 32: script_pushint(st, (cd->users >= cd->limit)); break;
case 33: script_pushint(st, (cd->users >= cd->trigger)); break;
- case 34: script_pushint(st, cd->minLvl); break;
- case 35: script_pushint(st, cd->maxLvl); break;
+ case 34: script_pushint(st, cd->min_level); break;
+ case 35: script_pushint(st, cd->max_level); break;
case 36: script_pushint(st, cd->zeny); break;
default: script_pushint(st, -1); break;
}
@@ -11567,6 +12665,7 @@ BUILDIN(warpwaitingpc)
for (i = 0; i < n && cd->users > 0; i++) {
struct map_session_data *sd = cd->usersd[0];
+ nullpo_retr(false, sd);
if (strcmp(map_name,"SavePoint") == 0 && map->list[sd->bl.m].flag.noteleport) {
// can't teleport on this map
break;
@@ -12103,7 +13202,7 @@ BUILDIN(emotion) {
clif->emotion(&sd->bl,type);
} else if( script_hasdata(st,4) ) {
struct npc_data *nd = npc->name2id(script_getstr(st,4));
- if (nd == NULL)
+ if (nd != NULL)
clif->emotion(&nd->bl,type);
} else {
clif->emotion(map->id2bl(st->oid),type);
@@ -12217,7 +13316,7 @@ BUILDIN(flagemblem)
if( nd == NULL ) {
ShowError("script:flagemblem: npc %d not found\n", st->oid);
} else if( nd->subtype != SCRIPT ) {
- ShowError("script:flagemblem: unexpected subtype %d for npc %d '%s'\n", nd->subtype, st->oid, nd->exname);
+ ShowError("script:flagemblem: unexpected subtype %u for npc %d '%s'\n", nd->subtype, st->oid, nd->exname);
} else {
bool changed = ( nd->u.scr.guild_id != g_id )?true:false;
nd->u.scr.guild_id = g_id;
@@ -12957,6 +14056,190 @@ BUILDIN(getiteminfo)
return true;
}
+/**
+ * Returns the value of the current equipment being parsed using static variables -
+ * current_equip_item_index and current_equip_option_index.
+ * !!Designed to be used with item_options.conf only!!
+ * *getequippedoptioninfo(<info_type>);
+ *
+ * @param (int) Types -
+ * IT_OPT_INDEX ID of the item option.
+ * IT_OPT_VALUE Amount of the bonus to be added.
+ * @return value of the type or -1.
+ */
+BUILDIN(getequippedoptioninfo)
+{
+ int val = 0, type = script_getnum(st, 2);
+ struct map_session_data *sd = NULL;
+
+ if ((sd = script->rid2sd(st)) == NULL || status->current_equip_item_index == -1 || status->current_equip_option_index == -1
+ || !sd->status.inventory[status->current_equip_item_index].option[status->current_equip_option_index].index) {
+ script_pushint(st, -1);
+ return false;
+ }
+
+ switch (type) {
+ case IT_OPT_INDEX:
+ val = sd->status.inventory[status->current_equip_item_index].option[status->current_equip_option_index].index;
+ break;
+ case IT_OPT_VALUE:
+ val = sd->status.inventory[status->current_equip_item_index].option[status->current_equip_option_index].value;
+ break;
+ default:
+ ShowError("buildin_getequippedoptioninfo: Invalid option data type %d (Max %d).\n", type, IT_OPT_MAX-1);
+ script_pushint(st, -1);
+ return false;
+ }
+
+ script_pushint(st, val);
+
+ return true;
+}
+
+/**
+ * Gets the option information of an equipment.
+ * *getequipoptioninfo(<equip_index>,<slot>,<type>);
+ *
+ * @param equip_index as the Index of the Equipment.
+ * @param slot as the slot# of the Item Option (1 to MAX_ITEM_OPTIONS)
+ * @param type IT_OPT_INDEX or IT_OPT_VALUE.
+ * @return (int) value or -1 on failure.
+ */
+BUILDIN(getequipoption)
+{
+ int val = 0, equip_index = script_getnum(st, 2);
+ int slot = script_getnum(st, 3);
+ int opt_type = script_getnum(st, 4);
+ int i = -1;
+ struct map_session_data *sd = script->rid2sd(st);
+
+ if (sd == NULL) {
+ script_pushint(st, -1);
+ ShowError("buildin_getequipoptioninfo: Player not attached!\n");
+ return false;
+ }
+
+ if (slot <= 0 || slot > MAX_ITEM_OPTIONS) {
+ script_pushint(st, -1);
+ ShowError("buildin_getequipoptioninfo: Invalid option slot %d (Min: 1, Max: %d) provided.\n", slot, MAX_ITEM_OPTIONS);
+ return false;
+ }
+
+ if (equip_index > 0 && equip_index <= ARRAYLENGTH(script->equip)) {
+ if ((i = pc->checkequip(sd, script->equip[equip_index - 1])) == -1) {
+ ShowError("buildin_getequipoptioninfo: No equipment is equipped in the given index %d.\n", equip_index);
+ script_pushint(st, -1);
+ return false;
+ }
+ } else {
+ ShowError("buildin_getequipoptioninfo: Invalid equipment index %d provided.\n", equip_index);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ if (sd->status.inventory[i].nameid != 0) {
+ switch (opt_type) {
+ case IT_OPT_INDEX:
+ val = sd->status.inventory[i].option[slot-1].index;
+ break;
+ case IT_OPT_VALUE:
+ val = sd->status.inventory[i].option[slot-1].value;
+ break;
+ default:
+ ShowError("buildin_geteqiupoptioninfo: Invalid option data type %d provided.\n", opt_type);
+ script_pushint(st, -1);
+ break;
+ }
+ }
+
+ script_pushint(st, val);
+
+ return true;
+}
+
+/**
+ * Set an equipment's option value.
+ * *setequipoption(<equip_index>,<slot>,<opt_index>,<value>);
+ *
+ * @param equip_index as the inventory index of the equipment.
+ * @param slot as the slot of the item option (1 to MAX_ITEM_OPTIONS)
+ * @param opt_index as the index of the option available as "Id" in db/item_options.conf.
+ * @param value as the value of the option type.
+ * For IT_OPT_INDEX see "Name" in item_options.conf
+ * For IT_OPT_VALUE, the value of the script bonus.
+ * @return 0 on failure, 1 on success.
+ */
+BUILDIN(setequipoption)
+{
+ int equip_index = script_getnum(st, 2);
+ int slot = script_getnum(st, 3);
+ int opt_index = script_getnum(st, 4);
+ int value = script_getnum(st, 5);
+ int i = -1;
+
+ struct map_session_data *sd = script->rid2sd(st);
+ struct item_option *ito = NULL;
+
+ if (sd == NULL) {
+ script_pushint(st, 0);
+ ShowError("buildin_setequipoption: Player not attached!\n");
+ return false;
+ }
+
+ if (slot <= 0 || slot > MAX_ITEM_OPTIONS) {
+ script_pushint(st, 0);
+ ShowError("buildin_setequipoption: Invalid option index %d (Min: 1, Max: %d) provided.\n", slot, MAX_ITEM_OPTIONS);
+ return false;
+ }
+
+ if (equip_index > 0 && equip_index <= ARRAYLENGTH(script->equip)) {
+ if ((i = pc->checkequip(sd, script->equip[equip_index - 1])) == -1) {
+ ShowError("buildin_setequipoptioninfo: No equipment is equipped in the given index %d.\n", equip_index);
+ script_pushint(st, 0);
+ return false;
+ }
+ } else {
+ ShowError("buildin_setequipoptioninfo: Invalid equipment index %d provided.\n", equip_index);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ if (sd->status.inventory[i].nameid != 0) {
+
+ if ((ito = itemdb->option_exists(opt_index)) == NULL) {
+ script_pushint(st, 0);
+ ShowError("buildin_setequipotion: Option index %d does not exist!\n", opt_index);
+ return false;
+ } else if (value < -INT16_MAX || value > INT16_MAX) {
+ script_pushint(st, 0);
+ ShowError("buildin_setequipotion: Option value %d exceeds maximum limit (%d to %d) for type!\n", value, -INT16_MAX, INT16_MAX);
+ return false;
+ }
+ /* Add Option Index */
+ sd->status.inventory[i].option[slot-1].index = ito->index;
+ /* Add Option Value */
+ sd->status.inventory[i].option[slot-1].value = value;
+
+ /* Unequip and simulate deletion of the item. */
+ pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE); // status calc will happen in pc->equipitem() below
+ clif->refine(sd->fd, 0, i, sd->status.inventory[i].refine); // notify client of a refine.
+ clif->delitem(sd, i, 1, DELITEM_MATERIALCHANGE); // notify client to simulate item deletion.
+ /* Log deletion of the item. */
+ logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
+ /* Equip and simulate addition of the item. */
+ clif->additem(sd, i, 1, 0); // notify client to simulate item addition.
+ /* Log addition of the item. */
+ logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i], sd->inventory_data[i]);
+ pc->equipitem(sd, i, sd->status.inventory[i].equip); // force equip the item at the original position.
+ clif->misceffect(&sd->bl, 2); // show effect
+ }
+
+ script_pushint(st, 1);
+
+ return true;
+
+}
+
/*==========================================
* Set some values of an item [Lupus]
* Price, Weight, etc...
@@ -13117,7 +14400,7 @@ BUILDIN(petloot)
BUILDIN(getinventorylist)
{
struct map_session_data *sd = script->rid2sd(st);
- char card_var[NAME_LENGTH];
+ char card_var[SCRIPT_VARNAME_LENGTH];
int i,j=0,k;
if(!sd) return true;
@@ -13138,6 +14421,14 @@ BUILDIN(getinventorylist)
sprintf(card_var, "@inventorylist_card%d",k+1);
pc->setreg(sd,reference_uid(script->add_str(card_var), j),sd->status.inventory[i].card[k]);
}
+ for (k = 0; k < MAX_ITEM_OPTIONS; k++) {
+ sprintf(card_var, "@inventorylist_opt_id%d", k + 1);
+ pc->setreg(sd, reference_uid(script->add_str(card_var), j), sd->status.inventory[i].option[k].index);
+ sprintf(card_var, "@inventorylist_opt_val%d", k + 1);
+ pc->setreg(sd, reference_uid(script->add_str(card_var), j), sd->status.inventory[i].option[k].value);
+ sprintf(card_var, "@inventorylist_opt_param%d", k + 1);
+ pc->setreg(sd, reference_uid(script->add_str(card_var), j), sd->status.inventory[i].option[k].param);
+ }
pc->setreg(sd,reference_uid(script->add_str("@inventorylist_expire"), j),sd->status.inventory[i].expire_time);
pc->setreg(sd,reference_uid(script->add_str("@inventorylist_bound"), j),sd->status.inventory[i].bound);
j++;
@@ -13150,7 +14441,7 @@ BUILDIN(getinventorylist)
BUILDIN(getcartinventorylist)
{
struct map_session_data *sd = script->rid2sd(st);
- char card_var[26];
+ char card_var[SCRIPT_VARNAME_LENGTH];
int i,j=0,k;
if(!sd) return true;
@@ -13167,6 +14458,14 @@ BUILDIN(getcartinventorylist)
sprintf(card_var, "@cartinventorylist_card%d",k+1);
pc->setreg(sd,reference_uid(script->add_str(card_var), j),sd->status.cart[i].card[k]);
}
+ for (k = 0; k < MAX_ITEM_OPTIONS; k++) {
+ sprintf(card_var, "@cartinventorylist_opt_id%d", k + 1);
+ pc->setreg(sd, reference_uid(script->add_str(card_var), j), sd->status.cart[i].option[k].index);
+ sprintf(card_var, "@cartinventorylist_opt_val%d", k + 1);
+ pc->setreg(sd, reference_uid(script->add_str(card_var), j), sd->status.cart[i].option[k].value);
+ sprintf(card_var, "@cartinventorylist_opt_param%d", k + 1);
+ pc->setreg(sd, reference_uid(script->add_str(card_var), j), sd->status.cart[i].option[k].param);
+ }
pc->setreg(sd,reference_uid(script->add_str("@cartinventorylist_expire"), j),sd->status.cart[i].expire_time);
pc->setreg(sd,reference_uid(script->add_str("@cartinventorylist_bound"), j),sd->status.cart[i].bound);
j++;
@@ -13251,15 +14550,26 @@ BUILDIN(undisguise)
* Transform a bl to another class,
* @type unused
*------------------------------------------*/
-BUILDIN(classchange) {
- int class_,type;
- struct block_list *bl=map->id2bl(st->oid);
+BUILDIN(classchange)
+{
+ int class, type, target;
+ struct block_list *bl = map->id2bl(st->oid);
+
+ if (bl == NULL)
+ return true;
- if(bl==NULL) return true;
+ class = script_getnum(st, 2);
+ type = script_getnum(st, 3);
+ target = script_hasdata(st, 4) ? script_getnum(st, 4) : 0;
- class_=script_getnum(st,2);
- type=script_getnum(st,3);
- clif->class_change(bl,class_,type);
+ if (target > 0) {
+ struct map_session_data *sd = script->charid2sd(st, target);
+ if (sd != NULL) {
+ clif->class_change(bl, class, type, sd);
+ }
+ } else {
+ clif->class_change(bl, class, type, NULL);
+ }
return true;
}
@@ -13311,6 +14621,7 @@ int playbgm_foreachpc_sub(struct map_session_data* sd, va_list args)
{
const char* name = va_arg(args, const char*);
+ nullpo_ret(name);
clif->playBGM(sd, name);
return 0;
}
@@ -13582,25 +14893,43 @@ BUILDIN(npcskilleffect) {
* Special effects [Valaris]
*------------------------------------------*/
BUILDIN(specialeffect) {
- struct block_list *bl=map->id2bl(st->oid);
- int type = script_getnum(st,2);
- enum send_target target = script_hasdata(st,3) ? (send_target)script_getnum(st,3) : AREA;
+ struct block_list *bl = NULL;
+ int type = script_getnum(st, 2);
+ enum send_target target = AREA;
- if(bl==NULL)
- return true;
+ if (script_hasdata(st, 3)) {
+ target = script_getnum(st, 3);
+ }
- if (script_hasdata(st,4)) {
- struct npc_data *nd = npc->name2id(script_getstr(st,4));
- if (nd != NULL)
- clif->specialeffect(&nd->bl, type, target);
+ if (script_hasdata(st, 4)) {
+ if (script_isstringtype(st, 4)) {
+ struct npc_data *nd = npc->name2id(script_getstr(st, 4));
+ if (nd != NULL) {
+ bl = &nd->bl;
+ }
+ } else {
+ bl = map->id2bl(script_getnum(st, 4));
+ }
} else {
- if (target == SELF) {
- struct map_session_data *sd = script->rid2sd(st);
- if (sd != NULL)
- clif->specialeffect_single(bl,type,sd->fd);
+ bl = map->id2bl(st->oid);
+ }
+
+ if (bl == NULL) {
+ return true;
+ }
+
+ if (target == SELF) {
+ struct map_session_data *sd;
+ if (script_hasdata(st, 5)) {
+ sd = map->id2sd(script_getnum(st, 5));
} else {
- clif->specialeffect(bl, type, target);
+ sd = script->rid2sd(st);
}
+ if (sd != NULL) {
+ clif->specialeffect_single(bl, type, sd->fd);
+ }
+ } else {
+ clif->specialeffect(bl, type, target);
}
return true;
@@ -13704,7 +15033,7 @@ BUILDIN(dispbottom)
int color = script_getnum(st,3);
clif->messagecolor_self(sd->fd, color, message);
} else {
- clif_disp_onlyself(sd, message, (int)strlen(message));
+ clif_disp_onlyself(sd, message);
}
return true;
@@ -13910,7 +15239,7 @@ BUILDIN(movenpc)
y = script_getnum(st,4);
if ((nd = npc->name2id(npc_name)) == NULL)
- return -1;
+ return false;
if (script_hasdata(st,5))
nd->dir = script_getnum(st,5) % 8;
@@ -14356,7 +15685,7 @@ BUILDIN(getmapxy)
sd=script->rid2sd(st);
else
sd=NULL;
- script->set_reg(st,sd,num,name,(void*)mapname,script_getref(st,2));
+ script->set_reg(st, sd, num, name, mapname, script_getref(st, 2));
//Set MapX
num=st->stack->stack_data[st->start+3].u.num;
@@ -14367,7 +15696,7 @@ BUILDIN(getmapxy)
sd=script->rid2sd(st);
else
sd=NULL;
- script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(x),script_getref(st,3));
+ script->set_reg(st, sd, num, name, (const void *)h64BPTRSIZE(x), script_getref(st, 3));
//Set MapY
num=st->stack->stack_data[st->start+4].u.num;
@@ -14378,7 +15707,7 @@ BUILDIN(getmapxy)
sd=script->rid2sd(st);
else
sd=NULL;
- script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(y),script_getref(st,4));
+ script->set_reg(st, sd, num, name, (const void *)h64BPTRSIZE(y), script_getref(st, 4));
//Return Success value
script_pushint(st,0);
@@ -14626,7 +15955,10 @@ BUILDIN(getrefine)
if (sd == NULL)
return true;
- script_pushint(st,sd->status.inventory[status->current_equip_item_index].refine);
+ if (status->current_equip_item_index < 0)
+ script_pushint(st, 0);
+ else
+ script_pushint(st, sd->status.inventory[status->current_equip_item_index].refine);
return true;
}
@@ -14860,6 +16192,49 @@ BUILDIN(charat) {
}
//=======================================================
+// isstr <argument>
+//
+// returns type:
+// 0 - int
+// 1 - string
+// 2 - other
+//-------------------------------------------------------
+BUILDIN(isstr)
+{
+ if (script_isinttype(st, 2)) {
+ script_pushint(st, 0);
+ } else if (script_isstringtype(st, 2)) {
+ script_pushint(st, 1);
+ } else {
+ script_pushint(st, 2);
+ }
+ return true;
+}
+
+//=======================================================
+// chr <int>
+//-------------------------------------------------------
+BUILDIN(chr)
+{
+ char output[2];
+ output[0] = script_getnum(st, 2);
+ output[1] = '\0';
+
+ script_pushstrcopy(st, output);
+ return true;
+}
+
+//=======================================================
+// ord <chr>
+//-------------------------------------------------------
+BUILDIN(ord)
+{
+ const char *chr = script_getstr(st, 2);
+ script_pushint(st, *chr);
+ return true;
+}
+
+//=======================================================
// setchar <string>, <char>, <index>
//-------------------------------------------------------
BUILDIN(setchar)
@@ -15038,7 +16413,7 @@ BUILDIN(explode)
if (str[i] == delimiter && (int64)start + k < (int64)(SCRIPT_MAX_ARRAYSIZE-1)) { // FIXME[Haru]: SCRIPT_MAX_ARRAYSIZE should really be unsigned (and INT32_MAX)
//break at delimiter but ignore after reaching last array index
temp[j] = '\0';
- script->set_reg(st, sd, reference_uid(id, start + k), name, (void*)temp, reference_getref(data));
+ script->set_reg(st, sd, reference_uid(id, start + k), name, temp, reference_getref(data));
k++;
j = 0;
} else {
@@ -15047,7 +16422,7 @@ BUILDIN(explode)
}
//set last string
temp[j] = '\0';
- script->set_reg(st, sd, reference_uid(id, start + k), name, (void*)temp, reference_getref(data));
+ script->set_reg(st, sd, reference_uid(id, start + k), name, temp, reference_getref(data));
aFree(temp);
@@ -15108,7 +16483,7 @@ BUILDIN(implode)
size_t len = 0, glue_len = 0, k = 0;
const char *glue = NULL, *temp;
for(i = 0; i <= array_size; ++i) {
- temp = (char*) script->get_val2(st, reference_uid(id, i), reference_getref(data));
+ temp = script->get_val2(st, reference_uid(id, i), reference_getref(data));
len += strlen(temp);
script_removetop(st, -1, 0);
}
@@ -15123,7 +16498,7 @@ BUILDIN(implode)
//build output
for(i = 0; i < array_size; ++i) {
- temp = (char*) script->get_val2(st, reference_uid(id, i), reference_getref(data));
+ temp = script->get_val2(st, reference_uid(id, i), reference_getref(data));
len = strlen(temp);
memcpy(&output[k], temp, len);
k += len;
@@ -15133,7 +16508,7 @@ BUILDIN(implode)
}
script_removetop(st, -1, 0);
}
- temp = (char*) script->get_val2(st, reference_uid(id, array_size), reference_getref(data));
+ temp = script->get_val2(st, reference_uid(id, array_size), reference_getref(data));
len = strlen(temp);
memcpy(&output[k], temp, len);
k += len;
@@ -15151,130 +16526,19 @@ BUILDIN(implode)
// Implements C sprintf, except format %n. The resulting string is
// returned, instead of being saved in variable by reference.
//-------------------------------------------------------
-BUILDIN(sprintf) {
- unsigned int argc = 0, arg = 0;
- const char* format;
- char* p;
- char* q;
- char* buf = NULL;
- char* buf2 = NULL;
- struct script_data* data;
- size_t len, buf2_len = 0;
- StringBuf final_buf;
-
- // Fetch init data
- format = script_getstr(st, 2);
- argc = script_lastdata(st)-2;
- len = strlen(format);
-
- // Skip parsing, where no parsing is required.
- if(len==0) {
- script_pushconststr(st,"");
- return true;
- }
-
- // Pessimistic alloc
- CREATE(buf, char, len+1);
-
- // Need not be parsed, just solve stuff like %%.
- if(argc==0) {
- memcpy(buf,format,len+1);
- script_pushstrcopy(st, buf);
- aFree(buf);
- return true;
- }
-
- safestrncpy(buf, format, len+1);
-
- // Issue sprintf for each parameter
- StrBuf->Init(&final_buf);
- q = buf;
- while((p = strchr(q, '%'))!=NULL) {
- if(p!=q) {
- len = p-q+1;
- if(buf2_len<len) {
- RECREATE(buf2, char, len);
- buf2_len = len;
- }
- safestrncpy(buf2, q, len);
- StrBuf->AppendStr(&final_buf, buf2);
- q = p;
- }
- p = q+1;
- if(*p=='%') { // %%
- StrBuf->AppendStr(&final_buf, "%");
- q+=2;
- continue;
- }
- if(*p=='n') { // %n
- ShowWarning("buildin_sprintf: Format %%n not supported! Skipping...\n");
- script->reportsrc(st);
- q+=2;
- continue;
- }
- if(arg>=argc) {
- ShowError("buildin_sprintf: Not enough arguments passed!\n");
- aFree(buf);
- if(buf2) aFree(buf2);
- StrBuf->Destroy(&final_buf);
- script_pushconststr(st,"");
- return false;
- }
- if((p = strchr(q+1, '%'))==NULL) {
- p = strchr(q, 0); // EOS
- }
- len = p-q+1;
- if(buf2_len<len) {
- RECREATE(buf2, char, len);
- buf2_len = len;
- }
- safestrncpy(buf2, q, len);
- q = p;
-
- // Note: This assumes the passed value being the correct
- // type to the current format specifier. If not, the server
- // probably crashes or returns anything else, than expected,
- // but it would behave in normal code the same way so it's
- // the scripter's responsibility.
- data = script_getdata(st, arg+3);
- if(data_isstring(data)) { // String
- StrBuf->Printf(&final_buf, buf2, script_getstr(st, arg+3));
- } else if(data_isint(data)) { // Number
- StrBuf->Printf(&final_buf, buf2, script_getnum(st, arg+3));
- } else if(data_isreference(data)) { // Variable
- char* name = reference_getname(data);
- if(name[strlen(name)-1]=='$') { // var Str
- StrBuf->Printf(&final_buf, buf2, script_getstr(st, arg+3));
- } else { // var Int
- StrBuf->Printf(&final_buf, buf2, script_getnum(st, arg+3));
- }
- } else { // Unsupported type
- ShowError("buildin_sprintf: Unknown argument type!\n");
- aFree(buf);
- if(buf2) aFree(buf2);
- StrBuf->Destroy(&final_buf);
- script_pushconststr(st,"");
- return false;
- }
- arg++;
- }
-
- // Append anything left
- if(*q) {
- StrBuf->AppendStr(&final_buf, q);
- }
+BUILDIN(sprintf)
+{
+ struct StringBuf buf;
+ StrBuf->Init(&buf);
- // Passed more, than needed
- if(arg<argc) {
- ShowWarning("buildin_sprintf: Unused arguments passed.\n");
- script->reportsrc(st);
+ if (!script_sprintf(st, 2, &buf)) {
+ StrBuf->Destroy(&buf);
+ script_pushconststr(st, "");
+ return false;
}
- script_pushstrcopy(st, StrBuf->Value(&final_buf));
-
- aFree(buf);
- if(buf2) aFree(buf2);
- StrBuf->Destroy(&final_buf);
+ script_pushstrcopy(st, StrBuf->Value(&buf));
+ StrBuf->Destroy(&buf);
return true;
}
@@ -15367,12 +16631,12 @@ BUILDIN(sscanf) {
if(sscanf(str, buf, ref_str)==0) {
break;
}
- script->set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)(ref_str), reference_getref(data));
+ script->set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, ref_str, reference_getref(data));
} else { // Number
if(sscanf(str, buf, &ref_int)==0) {
break;
}
- script->set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)h64BPTRSIZE(ref_int), reference_getref(data));
+ script->set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (const void *)h64BPTRSIZE(ref_int), reference_getref(data));
}
arg++;
@@ -15688,6 +16952,10 @@ BUILDIN(sqrt) //[zBuffer]
{
double i, a;
i = script_getnum(st,2);
+ if (i < 0) {
+ ShowError("sqrt from negative value\n");
+ return false;
+ }
a = sqrt(i);
script_pushint(st,(int)a);
return true;
@@ -15755,7 +17023,7 @@ BUILDIN(md5)
tmpstr = script_getstr(st,2);
md5str = (char *)aMalloc((32+1)*sizeof(char));
- MD5_String(tmpstr, md5str);
+ md5->string(tmpstr, md5str);
script_pushstr(st, md5str);
return true;
}
@@ -15812,8 +17080,8 @@ BUILDIN(swap)
value2 = script_getstr(st,3);
if (strcmpi(value1, value2)) {
- script->set_reg(st, sd, uid1, varname1, (void*)(value2), script_getref(st,3));
- script->set_reg(st, sd, uid2, varname2, (void*)(value1), script_getref(st,2));
+ script->set_reg(st, sd, uid1, varname1, value2, script_getref(st,3));
+ script->set_reg(st, sd, uid2, varname2, value1, script_getref(st,2));
}
}
else {
@@ -15823,8 +17091,8 @@ BUILDIN(swap)
value2 = script_getnum(st,3);
if (value1 != value2) {
- script->set_reg(st, sd, uid1, varname1, (void*)h64BPTRSIZE(value2), script_getref(st,3));
- script->set_reg(st, sd, uid2, varname2, (void*)h64BPTRSIZE(value1), script_getref(st,2));
+ script->set_reg(st, sd, uid1, varname1, (const void *)h64BPTRSIZE(value2), script_getref(st,3));
+ script->set_reg(st, sd, uid2, varname2, (const void *)h64BPTRSIZE(value1), script_getref(st,2));
}
}
return true;
@@ -15853,16 +17121,16 @@ BUILDIN(setd)
}
}
- if( is_string_variable(varname) ) {
- script->setd_sub(st, sd, varname, elem, (void *)script_getstr(st, 3), NULL);
+ if (is_string_variable(varname)) {
+ script->setd_sub(st, sd, varname, elem, script_getstr(st, 3), NULL);
} else {
- script->setd_sub(st, sd, varname, elem, (void *)h64BPTRSIZE(script_getnum(st, 3)), NULL);
+ script->setd_sub(st, sd, varname, elem, (const void *)h64BPTRSIZE(script_getnum(st, 3)), NULL);
}
return true;
}
-int buildin_query_sql_sub(struct script_state* st, Sql* handle)
+int buildin_query_sql_sub(struct script_state *st, struct Sql *handle)
{
int i, j;
struct map_session_data *sd = NULL;
@@ -15934,7 +17202,7 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle)
}
}
if( i == max_rows && max_rows < SQL->NumRows(handle) ) {
- ShowWarning("script:query_sql: Only %d/%u rows have been stored.\n", max_rows, (unsigned int)SQL->NumRows(handle));
+ ShowWarning("script:query_sql: Only %u/%u rows have been stored.\n", max_rows, (unsigned int)SQL->NumRows(handle));
script->reportsrc(st);
}
@@ -16342,7 +17610,7 @@ BUILDIN(getmonsterinfo)
script_pushconststr(st,"null");
else
script_pushint(st,-1);
- return -1;
+ return false;
}
monster = mob->db(mob_id);
switch ( script_getnum(st,3) ) {
@@ -16401,7 +17669,7 @@ BUILDIN(checkchatting) {
sd = script->rid2sd(st);
if (sd != NULL)
- script_pushint(st,(sd->chatID != 0));
+ script_pushint(st, (sd->chat_id != 0));
else
script_pushint(st,0);
@@ -16478,7 +17746,7 @@ BUILDIN(searchitem)
for( i = 0; i < count; ++start, ++i )
{// Set array
- void* v = (void*)h64BPTRSIZE((int)items[i]->nameid);
+ const void *v = (const void *)h64BPTRSIZE((int)items[i]->nameid);
script->set_reg(st, sd, reference_uid(id, start), name, v, reference_getref(data));
}
@@ -16596,6 +17864,1592 @@ BUILDIN(getunittype) {
return true;
}
+/**
+ * Sets real-time unit data for a game object.
+ * Setunitdata <GUID>,<DataType>,<Val1>{,<Val2>,<Val3>}
+ * @param1 GUID GID of the unit.
+ * @param2 DataType Type of Data to be set for the unit.
+ * @param3 Value#1 Value to be passed as change in data.
+ * @param4 Value#2 Optional int value to be passed for certain data types.
+ * @param5 Value#3 Optional int value to be passed for certain data types.
+ * @return 1 on success, 0 on failure.
+ */
+BUILDIN(setunitdata)
+{
+ struct block_list *bl = NULL;
+ const char *mapname = NULL, *udtype = NULL;
+ int type = 0, val = 0, val2 = 0, val3 = 0;
+ struct map_session_data *tsd = NULL;
+
+ bl = map->id2bl(script_getnum(st, 2));
+
+ if (bl == NULL) {
+ ShowWarning("buildin_setunitdata: Error in finding object with given GID %d!\n", script_getnum(st, 2));
+ script_pushint(st, 0);
+ return false;
+ }
+
+ type = script_getnum(st, 3);
+
+ /* type bounds */
+ if (type < UDT_SIZE || type >= UDT_MAX) { // Note: UDT_TYPE is not valid here
+ ShowError("buildin_setunitdata: Invalid unit data type %d provided.\n", type);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ /* Mandatory Argument 3 */
+ if (type == UDT_MAPIDXY) {
+ if (!script_isstringtype(st, 4)) {
+ ShowError("buildin_setunitdata: Invalid data type for argument #3.\n");
+ script_pushint(st, 0);
+ return false;
+ }
+ mapname = script_getstr(st, 4);
+ } else {
+ if (script_isstringtype(st, 4)) {
+ ShowError("buildin_setunitdata: Invalid data type for argument #3.\n");
+ script_pushint(st, 0);
+ return false;
+ }
+ val = script_getnum(st, 4);
+ }
+/* checks if value is out of bounds. */
+#define setunitdata_check_bounds(arg, min, max) \
+ do { \
+ if (script_getnum(st, (arg)) < (min) || script_getnum(st, (arg)) > (max)) { \
+ ShowError("buildin_setunitdata: Invalid value %d for argument #%d. (min: %d, max: %d)\n", script_getnum(st, (arg)), (arg)-1, (min), (max)); \
+ script_pushint(st, 0); \
+ return false; \
+ } \
+ } while(0);
+/* checks if value is out of bounds. */
+#define setunitdata_check_min(arg, min) \
+ do { \
+ if (script_getnum(st, (arg)) < (min)) { \
+ ShowError("buildin_setunitdata: Invalid value %d for argument #%d. (min: %d)\n", script_getnum(st, (arg)), (arg)-1, (min)); \
+ script_pushint(st, 0); \
+ return false; \
+ } \
+ } while(0);
+/* checks if the argument doesn't exist, if required.
+ * also checks if the argument exists, if not required. */
+#define setunitdata_assert_arg(arg, required) \
+ do { \
+ if (required && !script_hasdata(st, (arg))) { \
+ ShowError("buildin_setunitdata: Type %d reqires argument #%d.\n", type, (arg)-1); \
+ script_pushint(st, 0); \
+ return false; \
+ } else if (!required && script_hasdata(st, arg)) { \
+ ShowError("buildin_setunitdata: Argument %d is not required for type %d.\n", (arg)-1, type); \
+ script_pushint(st, 0); \
+ return false; \
+ } \
+ } while (0);
+/* checks if the data is an integer. */
+#define setunitdata_check_int(arg) \
+ do { \
+ setunitdata_assert_arg((arg), true); \
+ if (script_isstringtype(st, (arg))) { \
+ ShowError("buildin_setunitdata: Argument #%d expects integer, string given.\n", (arg)-1); \
+ script_pushint(st, 0); \
+ return false; \
+ } \
+ } while(0);
+/* checks if the data is a string. */
+#define setunitdata_check_string(arg) \
+ do { \
+ setunitdata_assert_arg((arg), true); \
+ if (script_isinttype(st, (arg))) { \
+ ShowError("buildin_setunitdata: Argument #%d expects string, integer given.\n", (arg)-1); \
+ script_pushint(st, 0); \
+ return false; \
+ } \
+ } while(0);
+
+ if (type != UDT_MAPIDXY && type != UDT_WALKTOXY) {
+ setunitdata_assert_arg(5, false);
+ setunitdata_assert_arg(6, false);
+ }
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ setunitdata_check_bounds(4, SZ_SMALL, SZ_BIG);
+ break;
+ case UDT_LEVEL:
+ case UDT_HP:
+ case UDT_MAXHP:
+ case UDT_SP:
+ case UDT_MAXSP:
+ case UDT_CLASS:
+ case UDT_HEADBOTTOM:
+ case UDT_HEADMIDDLE:
+ case UDT_HEADTOP:
+ case UDT_CLOTHCOLOR:
+ case UDT_SHIELD:
+ case UDT_WEAPON:
+ case UDT_INTIMACY:
+ case UDT_LIFETIME:
+ case UDT_MERC_KILLCOUNT:
+ setunitdata_check_min(4, 0);
+ break;
+ case UDT_MASTERAID:
+ setunitdata_check_min(4, 0);
+ tsd = map->id2sd(val);
+ if (tsd == NULL) {
+ ShowWarning("buildin_setunitdata: Account ID %d not found for master change!\n",val);
+ script_pushint(st, 0);
+ return false;
+ }
+ break;
+ case UDT_MASTERCID:
+ setunitdata_check_min(4, 0);
+ tsd = map->charid2sd(val);
+ if (tsd == NULL) {
+ ShowWarning("buildin_setunitdata: Character ID %d not found for master change!\n",val);
+ script_pushint(st, 0);
+ return false;
+ }
+ break;
+ case UDT_MAPIDXY:
+ if ((val = map->mapname2mapid(mapname)) == -1) {
+ ShowError("buildin_setunitdata: Non-existent map %s provided.\n", mapname);
+ return false;
+ }
+ setunitdata_check_int(5);
+ setunitdata_check_int(6);
+ setunitdata_check_bounds(5, 0, MAX_MAP_SIZE/2);
+ setunitdata_check_bounds(6, 0, MAX_MAP_SIZE/2);
+ val2 = script_getnum(st, 5);
+ val3 = script_getnum(st, 6);
+ break;
+ case UDT_WALKTOXY:
+ setunitdata_assert_arg(6, false);
+ setunitdata_check_int(5);
+ val2 = script_getnum(st, 5);
+ setunitdata_check_bounds(4, 0, MAX_MAP_SIZE/2);
+ setunitdata_check_bounds(5, 0, MAX_MAP_SIZE/2);
+ break;
+ case UDT_SPEED:
+ setunitdata_check_bounds(4, 0, MAX_WALK_SPEED);
+ break;
+ case UDT_MODE:
+ setunitdata_check_bounds(4, MD_NONE, MD_MASK);
+ break;
+ case UDT_AI:
+ setunitdata_check_bounds(4, AI_NONE, AI_MAX-1);
+ break;
+ case UDT_SCOPTION:
+ setunitdata_check_bounds(4, OPTION_NOTHING, OPTION_COSTUME);
+ break;
+ case UDT_SEX:
+ setunitdata_check_bounds(4, SEX_FEMALE, SEX_MALE);
+ break;
+ case UDT_HAIRSTYLE:
+ setunitdata_check_bounds(4, 0, battle->bc->max_hair_style);
+ break;
+ case UDT_HAIRCOLOR:
+ setunitdata_check_bounds(4, 0, battle->bc->max_hair_color);
+ break;
+ case UDT_LOOKDIR:
+ setunitdata_check_bounds(4, 0, 7);
+ break;
+ case UDT_CANMOVETICK:
+ setunitdata_check_min(4, 0);
+ break;
+ case UDT_STR:
+ case UDT_AGI:
+ case UDT_VIT:
+ case UDT_INT:
+ case UDT_DEX:
+ case UDT_LUK:
+ case UDT_STATPOINT:
+ case UDT_ATKRANGE:
+ case UDT_ATKMIN:
+ case UDT_ATKMAX:
+ case UDT_MATKMIN:
+ case UDT_MATKMAX:
+ case UDT_AMOTION:
+ case UDT_ADELAY:
+ case UDT_DMOTION:
+ setunitdata_check_bounds(4, 0, USHRT_MAX);
+ break;
+ case UDT_DEF:
+ case UDT_MDEF:
+ case UDT_HIT:
+ case UDT_FLEE:
+ case UDT_PDODGE:
+ case UDT_CRIT:
+ setunitdata_check_bounds(4, 0, SHRT_MAX);
+ break;
+ case UDT_HUNGER:
+ setunitdata_check_bounds(4, 0, 99);
+ break;
+ case UDT_RACE:
+ case UDT_ELETYPE:
+ case UDT_ELELEVEL:
+ setunitdata_check_bounds(4, 0, CHAR_MAX);
+ break;
+ default:
+ break;
+ }
+
+#undef setunitdata_check_bounds
+#undef setunitdata_assert_arg
+#undef setunitdata_check_int
+#undef setunitdata_check_string
+
+ /* Set the values */
+ switch (bl->type) {
+ case BL_MOB:
+ {
+ struct mob_data *md = BL_UCAST(BL_MOB, bl);
+ nullpo_retr(false, md);
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ md->status.size = (unsigned char) val;
+ break;
+ case UDT_LEVEL:
+ md->level = val;
+ break;
+ case UDT_HP:
+ status->set_hp(bl, (unsigned int) val, 0);
+ clif->charnameack(0, &md->bl);
+ break;
+ case UDT_MAXHP:
+ md->status.max_hp = (unsigned int) val;
+ clif->charnameack(0, &md->bl);
+ break;
+ case UDT_SP:
+ status->set_sp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXSP:
+ md->status.max_sp = (unsigned int) val;
+ break;
+ case UDT_MASTERAID:
+ md->master_id = val;
+ break;
+ case UDT_MAPIDXY:
+ unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
+ break;
+ case UDT_WALKTOXY:
+ if (!unit->walktoxy(bl, (short) val, (short) val2, 2))
+ unit->movepos(bl, (short) val, (short) val2, 0, 0);
+ break;
+ case UDT_SPEED:
+ md->status.speed = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_MODE:
+ md->status.mode = (enum e_mode) val;
+ break;
+ case UDT_AI:
+ md->special_state.ai = (enum ai) val;
+ break;
+ case UDT_SCOPTION:
+ md->sc.option = (unsigned int) val;
+ break;
+ case UDT_SEX:
+ md->vd->sex = (char) val;
+ break;
+ case UDT_CLASS:
+ mob->class_change(md, val);
+ break;
+ case UDT_HAIRSTYLE:
+ clif->changelook(bl, LOOK_HAIR, val);
+ break;
+ case UDT_HAIRCOLOR:
+ clif->changelook(bl, LOOK_HAIR_COLOR, val);
+ break;
+ case UDT_HEADBOTTOM:
+ clif->changelook(bl, LOOK_HEAD_BOTTOM, val);
+ break;
+ case UDT_HEADMIDDLE:
+ clif->changelook(bl, LOOK_HEAD_MID, val);
+ break;
+ case UDT_HEADTOP:
+ clif->changelook(bl, LOOK_HEAD_TOP, val);
+ break;
+ case UDT_CLOTHCOLOR:
+ clif->changelook(bl, LOOK_CLOTHES_COLOR, val);
+ break;
+ case UDT_SHIELD:
+ clif->changelook(bl, LOOK_SHIELD, val);
+ break;
+ case UDT_WEAPON:
+ clif->changelook(bl, LOOK_WEAPON, val);
+ break;
+ case UDT_LOOKDIR:
+ unit->setdir(bl, (uint8) val);
+ break;
+ case UDT_CANMOVETICK:
+ md->ud.canmove_tick = val;
+ break;
+ case UDT_STR:
+ md->status.str = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_AGI:
+ md->status.agi = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_VIT:
+ md->status.vit = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_INT:
+ md->status.int_ = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_DEX:
+ md->status.dex = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_LUK:
+ md->status.luk = (unsigned short) val;
+ status->calc_misc(bl, &md->status, md->level);
+ break;
+ case UDT_ATKRANGE:
+ md->status.rhw.range = (unsigned short) val;
+ break;
+ case UDT_ATKMIN:
+ md->status.rhw.atk = (unsigned short) val;
+ break;
+ case UDT_ATKMAX:
+ md->status.rhw.atk2 = (unsigned short) val;
+ break;
+ case UDT_MATKMIN:
+ md->status.matk_min = (unsigned short) val;
+ break;
+ case UDT_MATKMAX:
+ md->status.matk_max = (unsigned short) val;
+ break;
+ case UDT_DEF:
+ md->status.def = (defType) val;
+ break;
+ case UDT_MDEF:
+ md->status.mdef = (defType) val;
+ break;
+ case UDT_HIT:
+ md->status.hit = (short) val;
+ break;
+ case UDT_FLEE:
+ md->status.flee = (short) val;
+ break;
+ case UDT_PDODGE:
+ md->status.flee2 = (short) val;
+ break;
+ case UDT_CRIT:
+ md->status.cri = (short) val;
+ break;
+ case UDT_RACE:
+ md->status.race = (unsigned char) val;
+ break;
+ case UDT_ELETYPE:
+ md->status.def_ele = (unsigned char) val;
+ break;
+ case UDT_ELELEVEL:
+ md->status.ele_lv = (unsigned char) val;
+ break;
+ case UDT_AMOTION:
+ md->status.amotion = (unsigned short) val;
+ break;
+ case UDT_ADELAY:
+ md->status.adelay = (unsigned short) val;
+ break;
+ case UDT_DMOTION:
+ md->status.dmotion = (unsigned short) val;
+ break;
+ default:
+ ShowWarning("buildin_setunitdata: Invalid data type '%s' for mob unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ case BL_HOM:
+ {
+ struct homun_data *hd = BL_UCAST(BL_HOM, bl);
+
+ nullpo_retr(false, hd);
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ hd->base_status.size = (unsigned char) val;
+ break;
+ case UDT_LEVEL:
+ hd->homunculus.level = (short) val;
+ break;
+ case UDT_HP:
+ status->set_hp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXHP:
+ hd->homunculus.max_hp = val;
+ break;
+ case UDT_SP:
+ status->set_sp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXSP:
+ hd->homunculus.max_sp = val;
+ break;
+ case UDT_MASTERCID:
+ hd->homunculus.char_id = val;
+ hd->master = tsd;
+ break;
+ case UDT_MAPIDXY:
+ unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
+ break;
+ case UDT_WALKTOXY:
+ if (!unit->walktoxy(bl, (short) val, (short) val2, 2))
+ unit->movepos(bl, (short) val, (short) val2, 0, 0);
+ break;
+ case UDT_SPEED:
+ hd->base_status.speed = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_LOOKDIR:
+ unit->setdir(bl, (unsigned char) val);
+ break;
+ case UDT_CANMOVETICK:
+ hd->ud.canmove_tick = val;
+ break;
+ case UDT_STR:
+ hd->base_status.str = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_AGI:
+ hd->base_status.agi = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_VIT:
+ hd->base_status.vit = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_INT:
+ hd->base_status.int_ = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_DEX:
+ hd->base_status.dex = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_LUK:
+ hd->base_status.luk = (unsigned short) val;
+ status->calc_misc(bl, &hd->base_status, hd->homunculus.level);
+ break;
+ case UDT_ATKRANGE:
+ hd->base_status.rhw.range = (unsigned short) val;
+ break;
+ case UDT_ATKMIN:
+ hd->base_status.rhw.atk = (unsigned short) val;
+ break;
+ case UDT_ATKMAX:
+ hd->base_status.rhw.atk2 = (unsigned short) val;
+ break;
+ case UDT_MATKMIN:
+ hd->base_status.matk_min = (unsigned short) val;
+ break;
+ case UDT_MATKMAX:
+ hd->base_status.matk_max = (unsigned short) val;
+ break;
+ case UDT_DEF:
+ hd->base_status.def = (defType) val;
+ break;
+ case UDT_MDEF:
+ hd->base_status.mdef = (defType) val;
+ break;
+ case UDT_HIT:
+ hd->base_status.hit = (short) val;
+ break;
+ case UDT_FLEE:
+ hd->base_status.flee = (short) val;
+ break;
+ case UDT_PDODGE:
+ hd->base_status.flee2 = (short) val;
+ break;
+ case UDT_CRIT:
+ hd->base_status.cri = (short) val;
+ break;
+ case UDT_RACE:
+ hd->base_status.race = (unsigned char) val;
+ break;
+ case UDT_ELETYPE:
+ hd->base_status.def_ele = (unsigned char) val;
+ break;
+ case UDT_ELELEVEL:
+ hd->base_status.ele_lv = (unsigned char) val;
+ break;
+ case UDT_AMOTION:
+ hd->base_status.amotion = (unsigned short) val;
+ break;
+ case UDT_ADELAY:
+ hd->base_status.adelay = (unsigned short) val;
+ break;
+ case UDT_DMOTION:
+ hd->base_status.dmotion = (unsigned short) val;
+ break;
+ case UDT_HUNGER:
+ hd->homunculus.hunger = (short) val;
+ clif->send_homdata(hd->master, SP_HUNGRY, hd->homunculus.hunger);
+ break;
+ case UDT_INTIMACY:
+ homun->add_intimacy(hd, (unsigned int) val);
+ clif->send_homdata(hd->master, SP_INTIMATE, hd->homunculus.intimacy / 100);
+ break;
+ default:
+ ShowWarning("buildin_setunitdata: Invalid data type '%s' for homunculus unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ clif->send_homdata(hd->master, SP_ACK, 0); // send homun data
+ }
+ break;
+ case BL_PET:
+ {
+ struct pet_data *pd = BL_UCAST(BL_PET, bl);
+
+ nullpo_retr(false, pd);
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ pd->status.size = (unsigned char) val;
+ break;
+ case UDT_LEVEL:
+ pd->pet.level = (short) val;
+ break;
+ case UDT_HP:
+ status->set_hp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXHP:
+ pd->status.max_hp = (unsigned int) val;
+ break;
+ case UDT_SP:
+ status->set_sp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXSP:
+ pd->status.max_sp = (unsigned int) val;
+ break;
+ case UDT_MASTERAID:
+ pd->pet.account_id = val;
+ pd->msd = tsd;
+ break;
+ case UDT_MAPIDXY:
+ unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
+ break;
+ case UDT_WALKTOXY:
+ if (!unit->walktoxy(bl, (short) val, (short) val2, 2))
+ unit->movepos(bl, (short) val, (short) val2, 0, 0);
+ break;
+ case UDT_SPEED:
+ pd->status.speed = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_LOOKDIR:
+ unit->setdir(bl, (unsigned char) val);
+ break;
+ case UDT_CANMOVETICK:
+ pd->ud.canmove_tick = val;
+ break;
+ case UDT_STR:
+ pd->status.str = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_AGI:
+ pd->status.agi = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_VIT:
+ pd->status.vit = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_INT:
+ pd->status.int_ = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_DEX:
+ pd->status.dex = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_LUK:
+ pd->status.luk = (unsigned short) val;
+ status->calc_misc(bl, &pd->status, pd->pet.level);
+ break;
+ case UDT_ATKRANGE:
+ pd->status.rhw.range = (unsigned short) val;
+ break;
+ case UDT_ATKMIN:
+ pd->status.rhw.atk = (unsigned short) val;
+ break;
+ case UDT_ATKMAX:
+ pd->status.rhw.atk2 = (unsigned short) val;
+ break;
+ case UDT_MATKMIN:
+ pd->status.matk_min = (unsigned short) val;
+ break;
+ case UDT_MATKMAX:
+ pd->status.matk_max = (unsigned short) val;
+ break;
+ case UDT_DEF:
+ pd->status.def = (defType) val;
+ break;
+ case UDT_MDEF:
+ pd->status.mdef = (defType) val;
+ break;
+ case UDT_HIT:
+ pd->status.hit = (short) val;
+ break;
+ case UDT_FLEE:
+ pd->status.flee = (short) val;
+ break;
+ case UDT_PDODGE:
+ pd->status.flee2 = (short) val;
+ break;
+ case UDT_CRIT:
+ pd->status.cri = (short) val;
+ break;
+ case UDT_RACE:
+ pd->status.race = (unsigned char) val;
+ break;
+ case UDT_ELETYPE:
+ pd->status.def_ele = (unsigned char) val;
+ break;
+ case UDT_ELELEVEL:
+ pd->status.ele_lv = (unsigned char) val;
+ break;
+ case UDT_AMOTION:
+ pd->status.amotion = (unsigned short) val;
+ break;
+ case UDT_ADELAY:
+ pd->status.adelay = (unsigned short) val;
+ break;
+ case UDT_DMOTION:
+ pd->status.dmotion = (unsigned short) val;
+ break;
+ case UDT_INTIMACY:
+ pet->set_intimate(pd, val);
+ clif->send_petdata(pd->msd, pd, 1, pd->pet.intimate);
+ break;
+ case UDT_HUNGER:
+ pd->pet.hungry = (short) val;
+ break;
+ default:
+ ShowWarning("buildin_setunitdata: Invalid data type '%s' for pet unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ clif->send_petstatus(pd->msd); // send pet data
+ }
+ break;
+ case BL_MER:
+ {
+ struct mercenary_data *mc = BL_UCAST(BL_MER, bl);
+
+ nullpo_retr(false, mc);
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ mc->base_status.size = (unsigned char) val;
+ break;
+ case UDT_HP:
+ status->set_hp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXHP:
+ mc->base_status.max_hp = (unsigned int) val;
+ break;
+ case UDT_SP:
+ status->set_sp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXSP:
+ mc->base_status.max_sp = (unsigned int) val;
+ break;
+ case UDT_MASTERCID:
+ mc->mercenary.char_id = val;
+ break;
+ case UDT_MAPIDXY:
+ unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
+ break;
+ case UDT_WALKTOXY:
+ if (!unit->walktoxy(bl, (short) val, (short) val2, 2))
+ unit->movepos(bl, (short) val, (short) val2, 0, 0);
+ break;
+ case UDT_SPEED:
+ mc->base_status.size = (unsigned char) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_LOOKDIR:
+ unit->setdir(bl, (unsigned char) val);
+ break;
+ case UDT_CANMOVETICK:
+ mc->ud.canmove_tick = val;
+ break;
+ case UDT_STR:
+ mc->base_status.str = (unsigned short) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_AGI:
+ mc->base_status.agi = (unsigned short) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_VIT:
+ mc->base_status.vit = (unsigned short) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_INT:
+ mc->base_status.int_ = (unsigned short) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_DEX:
+ mc->base_status.dex = (unsigned short) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_LUK:
+ mc->base_status.luk = (unsigned short) val;
+ status->calc_misc(bl, &mc->base_status, mc->db->lv);
+ break;
+ case UDT_ATKRANGE:
+ mc->base_status.rhw.range = (unsigned short) val;
+ break;
+ case UDT_ATKMIN:
+ mc->base_status.rhw.atk = (unsigned short) val;
+ break;
+ case UDT_ATKMAX:
+ mc->base_status.rhw.atk2 = (unsigned short) val;
+ break;
+ case UDT_MATKMIN:
+ mc->base_status.matk_min = (unsigned short) val;
+ break;
+ case UDT_MATKMAX:
+ mc->base_status.matk_max = (unsigned short) val;
+ break;
+ case UDT_DEF:
+ mc->base_status.def = (defType) val;
+ break;
+ case UDT_MDEF:
+ mc->base_status.mdef = (defType) val;
+ break;
+ case UDT_HIT:
+ mc->base_status.hit = (short) val;
+ break;
+ case UDT_FLEE:
+ mc->base_status.flee = (short) val;
+ break;
+ case UDT_PDODGE:
+ mc->base_status.flee2 = (short) val;
+ break;
+ case UDT_CRIT:
+ mc->base_status.cri = (short) val;
+ break;
+ case UDT_RACE:
+ mc->base_status.race = (unsigned char) val;
+ break;
+ case UDT_ELETYPE:
+ mc->base_status.def_ele = (unsigned char) val;
+ break;
+ case UDT_ELELEVEL:
+ mc->base_status.ele_lv = (unsigned char) val;
+ break;
+ case UDT_AMOTION:
+ mc->base_status.amotion = (unsigned short) val;
+ break;
+ case UDT_ADELAY:
+ mc->base_status.adelay = (unsigned short) val;
+ break;
+ case UDT_DMOTION:
+ mc->base_status.dmotion = (unsigned short) val;
+ break;
+ case UDT_MERC_KILLCOUNT:
+ mc->mercenary.kill_count = (unsigned int) val;
+ break;
+ case UDT_LIFETIME:
+ mc->mercenary.life_time = (unsigned int) val;
+ break;
+ default:
+ ShowWarning("buildin_setunitdata: Invalid data type '%s' for mercenary unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ clif->mercenary_info(map->charid2sd(mc->mercenary.char_id));
+ clif->mercenary_skillblock(map->charid2sd(mc->mercenary.char_id));
+ }
+ break;
+ case BL_ELEM:
+ {
+ struct elemental_data *ed = BL_UCAST(BL_ELEM, bl);
+
+ nullpo_retr(false, ed);
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ ed->base_status.size = (unsigned char) val;
+ break;
+ case UDT_HP:
+ status->set_hp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXHP:
+ ed->base_status.max_hp = (unsigned int) val;
+ break;
+ case UDT_SP:
+ status->set_sp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXSP:
+ ed->base_status.max_sp = (unsigned int) val;
+ break;
+ case UDT_MASTERCID:
+ ed->elemental.char_id = val;
+ break;
+ case UDT_MAPIDXY:
+ unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
+ break;
+ case UDT_WALKTOXY:
+ if (!unit->walktoxy(bl, (short) val, (short) val2, 2))
+ unit->movepos(bl, (short) val, (short) val2, 0, 0);
+ break;
+ case UDT_SPEED:
+ ed->base_status.speed = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_LOOKDIR:
+ unit->setdir(bl, (unsigned char) val);
+ break;
+ case UDT_CANMOVETICK:
+ ed->ud.canmove_tick = val;
+ break;
+ case UDT_STR:
+ ed->base_status.str = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_AGI:
+ ed->base_status.agi = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_VIT:
+ ed->base_status.vit = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_INT:
+ ed->base_status.int_ = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_DEX:
+ ed->base_status.dex = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_LUK:
+ ed->base_status.luk = (unsigned short) val;
+ status->calc_misc(bl, &ed->base_status, ed->db->lv);
+ break;
+ case UDT_ATKRANGE:
+ ed->base_status.rhw.range = (unsigned short) val;
+ break;
+ case UDT_ATKMIN:
+ ed->base_status.rhw.atk = (unsigned short) val;
+ break;
+ case UDT_ATKMAX:
+ ed->base_status.rhw.atk2 = (unsigned short) val;
+ break;
+ case UDT_MATKMIN:
+ ed->base_status.matk_min = (unsigned short) val;
+ break;
+ case UDT_MATKMAX:
+ ed->base_status.matk_max = (unsigned short) val;
+ break;
+ case UDT_DEF:
+ ed->base_status.def = (defType) val;
+ break;
+ case UDT_MDEF:
+ ed->base_status.mdef = (defType) val;
+ break;
+ case UDT_HIT:
+ ed->base_status.hit = (short) val;
+ break;
+ case UDT_FLEE:
+ ed->base_status.flee = (short) val;
+ break;
+ case UDT_PDODGE:
+ ed->base_status.flee2 = (short) val;
+ break;
+ case UDT_CRIT:
+ ed->base_status.cri = (short) val;
+ break;
+ case UDT_RACE:
+ ed->base_status.race = (unsigned char) val;
+ break;
+ case UDT_ELETYPE:
+ ed->base_status.def_ele = (unsigned char) val;
+ break;
+ case UDT_ELELEVEL:
+ ed->base_status.ele_lv = (unsigned char) val;
+ break;
+ case UDT_AMOTION:
+ ed->base_status.amotion = (unsigned short) val;
+ break;
+ case UDT_ADELAY:
+ ed->base_status.adelay = (unsigned short) val;
+ break;
+ case UDT_DMOTION:
+ ed->base_status.dmotion = (unsigned short) val;
+ break;
+ case UDT_LIFETIME:
+ ed->elemental.life_time = val;
+ break;
+ default:
+ ShowWarning("buildin_setunitdata: Invalid data type '%s' for elemental unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ clif->elemental_info(ed->master);
+ }
+ break;
+ case BL_NPC:
+ {
+ struct npc_data *nd = BL_UCAST(BL_NPC, bl);
+
+ nullpo_retr(false, nd);
+
+ switch (type)
+ {
+ case UDT_SIZE:
+ nd->status.size = (unsigned char) val;
+ break;
+ case UDT_LEVEL:
+ nd->level = (unsigned short) val;
+ break;
+ case UDT_HP:
+ status->set_hp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXHP:
+ nd->status.max_hp = (unsigned int) val;
+ break;
+ case UDT_SP:
+ status->set_sp(bl, (unsigned int) val, 0);
+ break;
+ case UDT_MAXSP:
+ nd->status.max_sp = (unsigned int) val;
+ break;
+ case UDT_MAPIDXY:
+ unit->warp(bl, (short) val, (short) val2, (short) val3, CLR_TELEPORT);
+ break;
+ case UDT_WALKTOXY:
+ if (!unit->walktoxy(bl, (short) val, (short) val2, 2))
+ unit->movepos(bl, (short) val, (short) val2, 0, 0);
+ break;
+ case UDT_CLASS:
+ npc->setclass(nd, (short) val);
+ break;
+ case UDT_SPEED:
+ nd->speed = (short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_LOOKDIR:
+ unit->setdir(bl, (unsigned char) val);
+ break;
+ case UDT_STR:
+ nd->status.str = (unsigned short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_AGI:
+ nd->status.agi = (unsigned short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_VIT:
+ nd->status.vit = (unsigned short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_INT:
+ nd->status.int_ = (unsigned short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_DEX:
+ nd->status.dex = (unsigned short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_LUK:
+ nd->status.luk = (unsigned short) val;
+ status->calc_misc(bl, &nd->status, nd->level);
+ break;
+ case UDT_STATPOINT:
+ nd->stat_point = (unsigned short) val;
+ break;
+ case UDT_ATKRANGE:
+ nd->status.rhw.range = (unsigned short) val;
+ break;
+ case UDT_ATKMIN:
+ nd->status.rhw.atk = (unsigned short) val;
+ break;
+ case UDT_ATKMAX:
+ nd->status.rhw.atk2 = (unsigned short) val;
+ break;
+ case UDT_MATKMIN:
+ nd->status.matk_min = (unsigned short) val;
+ break;
+ case UDT_MATKMAX:
+ nd->status.matk_max = (unsigned short) val;
+ break;
+ case UDT_DEF:
+ nd->status.def = (defType) val;
+ break;
+ case UDT_MDEF:
+ nd->status.mdef = (defType) val;
+ break;
+ case UDT_HIT:
+ nd->status.hit = (short) val;
+ break;
+ case UDT_FLEE:
+ nd->status.flee = (short) val;
+ break;
+ case UDT_PDODGE:
+ nd->status.flee2 = (short) val;
+ break;
+ case UDT_CRIT:
+ nd->status.cri = (short) val;
+ break;
+ case UDT_RACE:
+ nd->status.race = (unsigned char) val;
+ break;
+ case UDT_ELETYPE:
+ nd->status.def_ele = (unsigned char) val;
+ break;
+ case UDT_ELELEVEL:
+ nd->status.ele_lv = (unsigned char) val;
+ break;
+ case UDT_AMOTION:
+ nd->status.amotion = (unsigned short) val;
+ break;
+ case UDT_ADELAY:
+ nd->status.adelay = (unsigned short) val;
+ break;
+ case UDT_DMOTION:
+ nd->status.dmotion = (unsigned short) val;
+ break;
+ default:
+ ShowWarning("buildin_setunitdata: Invalid data type '%s' for NPC unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ default:
+ ShowError("buildin_setunitdata: Unknown object!\n");
+ script_pushint(st, 0);
+ return false;
+ } // end of bl->type switch
+
+ script_pushint(st, 1);
+ return true;
+}
+
+/**
+ * Retrieves real-time data for a game object.
+ * Getunitdata <GUID>,<DataType>{,<Variable>}
+ * @param1 GUID Game object unique Id.
+ * @param2 DataType Type of Data to be set for the unit.
+ * @param3 Variable array reference to store data into. (used for UDT_MAPIDXY)
+ * @return 0 on failure, <value> on success
+ */
+BUILDIN(getunitdata)
+{
+ struct block_list *bl;
+ const char *udtype = NULL;
+ const struct map_session_data *sd = NULL;
+ int type = 0;
+ char* name = NULL;
+ struct script_data *data = script_hasdata(st,4)?script_getdata(st, 4):NULL;
+
+ bl = map->id2bl(script_getnum(st, 2));
+
+ if (bl == NULL) {
+ ShowWarning("buildin_getunitdata: Error in finding object with given GID %d!\n", script_getnum(st, 2));
+ script_pushint(st, 0);
+ return false;
+ }
+
+ type = script_getnum(st, 3);
+
+ /* Type check */
+ if (type < UDT_TYPE || type >= UDT_MAX) {
+ ShowError("buildin_getunitdata: Invalid unit data type %d provided.\n", type);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ /* Argument checks */
+ if (type == UDT_MAPIDXY) {
+ if (data == NULL || !data_isreference(data)) {
+ ShowWarning("buildin_getunitdata: Error in argument 3. Please provide a reference variable to store values in.\n");
+ script_pushint(st, 0);
+ return false;
+ }
+
+ name = reference_getname(data);
+
+ if (not_server_variable(*name)) {
+ sd = script->rid2sd(st);
+ if (sd == NULL) {
+ ShowWarning("buildin_getunitdata: Player not attached! Cannot use player variable %s.\n",name);
+ script_pushint(st, 0);
+ return true;// no player attached
+ }
+ }
+ }
+
+#define getunitdata_sub(idx__,var__) script->setd_sub(st,NULL,name,(idx__),(void *)h64BPTRSIZE((int)(var__)),data->ref);
+
+ switch (bl->type) {
+ case BL_MOB:
+ {
+ const struct mob_data *md = BL_UCAST(BL_MOB, bl);
+
+ nullpo_retr(false, md);
+
+ switch (type)
+ {
+ case UDT_TYPE: script_pushint(st, BL_MOB); break;
+ case UDT_SIZE: script_pushint(st, md->status.size); break;
+ case UDT_LEVEL: script_pushint(st, md->level); break;
+ case UDT_HP: script_pushint(st, md->status.hp); break;
+ case UDT_MAXHP: script_pushint(st, md->status.max_hp); break;
+ case UDT_SP: script_pushint(st, md->status.sp); break;
+ case UDT_MAXSP: script_pushint(st, md->status.max_sp); break;
+ case UDT_MAPIDXY:
+ getunitdata_sub(0, md->bl.m);
+ getunitdata_sub(1, md->bl.x);
+ getunitdata_sub(2, md->bl.y);
+ break;
+ case UDT_SPEED: script_pushint(st, md->status.speed); break;
+ case UDT_MODE: script_pushint(st, md->status.mode); break;
+ case UDT_AI: script_pushint(st, md->special_state.ai); break;
+ case UDT_SCOPTION: script_pushint(st, md->sc.option); break;
+ case UDT_SEX: script_pushint(st, md->vd->sex); break;
+ case UDT_CLASS: script_pushint(st, md->vd->class); break;
+ case UDT_HAIRSTYLE: script_pushint(st, md->vd->hair_style); break;
+ case UDT_HAIRCOLOR: script_pushint(st, md->vd->hair_color); break;
+ case UDT_HEADBOTTOM: script_pushint(st, md->vd->head_bottom); break;
+ case UDT_HEADMIDDLE: script_pushint(st, md->vd->head_mid); break;
+ case UDT_HEADTOP: script_pushint(st, md->vd->head_top); break;
+ case UDT_CLOTHCOLOR: script_pushint(st, md->vd->cloth_color); break;
+ case UDT_SHIELD: script_pushint(st, md->vd->shield); break;
+ case UDT_WEAPON: script_pushint(st, md->vd->weapon); break;
+ case UDT_LOOKDIR: script_pushint(st, md->ud.dir); break;
+ case UDT_CANMOVETICK: script_pushint(st, md->ud.canmove_tick); break;
+ case UDT_STR: script_pushint(st, md->status.str); break;
+ case UDT_AGI: script_pushint(st, md->status.agi); break;
+ case UDT_VIT: script_pushint(st, md->status.vit); break;
+ case UDT_INT: script_pushint(st, md->status.int_); break;
+ case UDT_DEX: script_pushint(st, md->status.dex); break;
+ case UDT_LUK: script_pushint(st, md->status.luk); break;
+ case UDT_ATKRANGE: script_pushint(st, md->status.rhw.range); break;
+ case UDT_ATKMIN: script_pushint(st, md->status.rhw.atk); break;
+ case UDT_ATKMAX: script_pushint(st, md->status.rhw.atk2); break;
+ case UDT_MATKMIN: script_pushint(st, md->status.matk_min); break;
+ case UDT_MATKMAX: script_pushint(st, md->status.matk_max); break;
+ case UDT_DEF: script_pushint(st, md->status.def); break;
+ case UDT_MDEF: script_pushint(st, md->status.mdef); break;
+ case UDT_HIT: script_pushint(st, md->status.hit); break;
+ case UDT_FLEE: script_pushint(st, md->status.flee); break;
+ case UDT_PDODGE: script_pushint(st, md->status.flee2); break;
+ case UDT_CRIT: script_pushint(st, md->status.cri); break;
+ case UDT_RACE: script_pushint(st, md->status.race); break;
+ case UDT_ELETYPE: script_pushint(st, md->status.def_ele); break;
+ case UDT_ELELEVEL: script_pushint(st, md->status.ele_lv); break;
+ case UDT_AMOTION: script_pushint(st, md->status.amotion); break;
+ case UDT_ADELAY: script_pushint(st, md->status.adelay); break;
+ case UDT_DMOTION: script_pushint(st, md->status.dmotion); break;
+ default:
+ ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mob unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ case BL_HOM:
+ {
+ const struct homun_data *hd = BL_UCAST(BL_HOM, bl);
+
+ nullpo_retr(false, hd);
+
+ switch (type)
+ {
+ case UDT_TYPE: script_pushint(st, BL_HOM); break;
+ case UDT_SIZE: script_pushint(st, hd->base_status.size); break;
+ case UDT_LEVEL: script_pushint(st, hd->homunculus.level); break;
+ case UDT_HP: script_pushint(st, hd->base_status.hp); break;
+ case UDT_MAXHP: script_pushint(st, hd->base_status.max_hp); break;
+ case UDT_SP: script_pushint(st, hd->base_status.sp); break;
+ case UDT_MAXSP: script_pushint(st, hd->base_status.max_sp); break;
+ case UDT_MAPIDXY:
+ getunitdata_sub(0, hd->bl.m);
+ getunitdata_sub(1, hd->bl.x);
+ getunitdata_sub(2, hd->bl.y);
+ break;
+ case UDT_SPEED: script_pushint(st, hd->base_status.speed); break;
+ case UDT_LOOKDIR: script_pushint(st, hd->ud.dir); break;
+ case UDT_CANMOVETICK: script_pushint(st, hd->ud.canmove_tick); break;
+ case UDT_MODE: script_pushint(st, hd->base_status.mode); break;
+ case UDT_STR: script_pushint(st, hd->base_status.str); break;
+ case UDT_AGI: script_pushint(st, hd->base_status.agi); break;
+ case UDT_VIT: script_pushint(st, hd->base_status.vit); break;
+ case UDT_INT: script_pushint(st, hd->base_status.int_); break;
+ case UDT_DEX: script_pushint(st, hd->base_status.dex); break;
+ case UDT_LUK: script_pushint(st, hd->base_status.luk); break;
+ case UDT_ATKRANGE: script_pushint(st, hd->base_status.rhw.range); break;
+ case UDT_ATKMIN: script_pushint(st, hd->base_status.rhw.atk); break;
+ case UDT_ATKMAX: script_pushint(st, hd->base_status.rhw.atk2); break;
+ case UDT_MATKMIN: script_pushint(st, hd->base_status.matk_min); break;
+ case UDT_MATKMAX: script_pushint(st, hd->base_status.matk_max); break;
+ case UDT_DEF: script_pushint(st, hd->base_status.def); break;
+ case UDT_MDEF: script_pushint(st, hd->base_status.mdef); break;
+ case UDT_HIT: script_pushint(st, hd->base_status.hit); break;
+ case UDT_FLEE: script_pushint(st, hd->base_status.flee); break;
+ case UDT_PDODGE: script_pushint(st, hd->base_status.flee2); break;
+ case UDT_CRIT: script_pushint(st, hd->base_status.cri); break;
+ case UDT_RACE: script_pushint(st, hd->base_status.race); break;
+ case UDT_ELETYPE: script_pushint(st, hd->base_status.def_ele); break;
+ case UDT_ELELEVEL: script_pushint(st, hd->base_status.ele_lv); break;
+ case UDT_AMOTION: script_pushint(st, hd->base_status.amotion); break;
+ case UDT_ADELAY: script_pushint(st, hd->base_status.adelay); break;
+ case UDT_DMOTION: script_pushint(st, hd->base_status.dmotion); break;
+ case UDT_MASTERCID: script_pushint(st, hd->homunculus.char_id); break;
+ case UDT_HUNGER: script_pushint(st, hd->homunculus.hunger); break;
+ case UDT_INTIMACY: script_pushint(st, hd->homunculus.intimacy); break;
+ default:
+ ShowWarning("buildin_getunitdata: Invalid data type '%s' for Homunculus unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ case BL_PET:
+ {
+ const struct pet_data *pd = BL_UCAST(BL_PET, bl);
+
+ nullpo_retr(false, pd);
+
+ switch (type)
+ {
+ case UDT_TYPE: script_pushint(st, BL_PET); break;
+ case UDT_SIZE: script_pushint(st, pd->status.size); break;
+ case UDT_LEVEL: script_pushint(st, pd->pet.level); break;
+ case UDT_HP: script_pushint(st, pd->status.hp); break;
+ case UDT_MAXHP: script_pushint(st, pd->status.max_hp); break;
+ case UDT_SP: script_pushint(st, pd->status.sp); break;
+ case UDT_MAXSP: script_pushint(st, pd->status.max_sp); break;
+ case UDT_MAPIDXY:
+ getunitdata_sub(0, pd->bl.m);
+ getunitdata_sub(1, pd->bl.x);
+ getunitdata_sub(2, pd->bl.y);
+ break;
+ case UDT_SPEED: script_pushint(st, pd->status.speed); break;
+ case UDT_LOOKDIR: script_pushint(st, pd->ud.dir); break;
+ case UDT_CANMOVETICK: script_pushint(st, pd->ud.canmove_tick); break;
+ case UDT_MODE: script_pushint(st, pd->status.mode); break;
+ case UDT_STR: script_pushint(st, pd->status.str); break;
+ case UDT_AGI: script_pushint(st, pd->status.agi); break;
+ case UDT_VIT: script_pushint(st, pd->status.vit); break;
+ case UDT_INT: script_pushint(st, pd->status.int_); break;
+ case UDT_DEX: script_pushint(st, pd->status.dex); break;
+ case UDT_LUK: script_pushint(st, pd->status.luk); break;
+ case UDT_ATKRANGE: script_pushint(st, pd->status.rhw.range); break;
+ case UDT_ATKMIN: script_pushint(st, pd->status.rhw.atk); break;
+ case UDT_ATKMAX: script_pushint(st, pd->status.rhw.atk2); break;
+ case UDT_MATKMIN: script_pushint(st, pd->status.matk_min); break;
+ case UDT_MATKMAX: script_pushint(st, pd->status.matk_max); break;
+ case UDT_DEF: script_pushint(st, pd->status.def); break;
+ case UDT_MDEF: script_pushint(st, pd->status.mdef); break;
+ case UDT_HIT: script_pushint(st, pd->status.hit); break;
+ case UDT_FLEE: script_pushint(st, pd->status.flee); break;
+ case UDT_PDODGE: script_pushint(st, pd->status.flee2); break;
+ case UDT_CRIT: script_pushint(st, pd->status.cri); break;
+ case UDT_RACE: script_pushint(st, pd->status.race); break;
+ case UDT_ELETYPE: script_pushint(st, pd->status.def_ele); break;
+ case UDT_ELELEVEL: script_pushint(st, pd->status.ele_lv); break;
+ case UDT_AMOTION: script_pushint(st, pd->status.amotion); break;
+ case UDT_ADELAY: script_pushint(st, pd->status.adelay); break;
+ case UDT_DMOTION: script_pushint(st, pd->status.dmotion); break;
+ case UDT_MASTERAID: script_pushint(st, pd->pet.account_id); break;
+ case UDT_HUNGER: script_pushint(st, pd->pet.hungry); break;
+ case UDT_INTIMACY: script_pushint(st, pd->pet.intimate); break;
+ default:
+ ShowWarning("buildin_getunitdata: Invalid data type '%s' for Pet unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ case BL_MER:
+ {
+ const struct mercenary_data *mc = BL_UCAST(BL_MER, bl);
+
+ nullpo_retr(false, mc);
+
+ switch (type)
+ {
+ case UDT_TYPE: script_pushint(st, BL_MER); break;
+ case UDT_SIZE: script_pushint(st, mc->base_status.size); break;
+ case UDT_HP: script_pushint(st, mc->base_status.hp); break;
+ case UDT_MAXHP: script_pushint(st, mc->base_status.max_hp); break;
+ case UDT_SP: script_pushint(st, mc->base_status.sp); break;
+ case UDT_MAXSP: script_pushint(st, mc->base_status.max_sp); break;
+ case UDT_MAPIDXY:
+ getunitdata_sub(0, mc->bl.m);
+ getunitdata_sub(1, mc->bl.x);
+ getunitdata_sub(2, mc->bl.y);
+ break;
+ case UDT_SPEED: script_pushint(st, mc->base_status.speed); break;
+ case UDT_LOOKDIR: script_pushint(st, mc->ud.dir); break;
+ case UDT_CANMOVETICK: script_pushint(st, mc->ud.canmove_tick); break;
+ case UDT_MODE: script_pushint(st, mc->base_status.mode); break;
+ case UDT_STR: script_pushint(st, mc->base_status.str); break;
+ case UDT_AGI: script_pushint(st, mc->base_status.agi); break;
+ case UDT_VIT: script_pushint(st, mc->base_status.vit); break;
+ case UDT_INT: script_pushint(st, mc->base_status.int_); break;
+ case UDT_DEX: script_pushint(st, mc->base_status.dex); break;
+ case UDT_LUK: script_pushint(st, mc->base_status.luk); break;
+ case UDT_ATKRANGE: script_pushint(st, mc->base_status.rhw.range); break;
+ case UDT_ATKMIN: script_pushint(st, mc->base_status.rhw.atk); break;
+ case UDT_ATKMAX: script_pushint(st, mc->base_status.rhw.atk2); break;
+ case UDT_MATKMIN: script_pushint(st, mc->base_status.matk_min); break;
+ case UDT_MATKMAX: script_pushint(st, mc->base_status.matk_max); break;
+ case UDT_DEF: script_pushint(st, mc->base_status.def); break;
+ case UDT_MDEF: script_pushint(st, mc->base_status.mdef); break;
+ case UDT_HIT: script_pushint(st, mc->base_status.hit); break;
+ case UDT_FLEE: script_pushint(st, mc->base_status.flee); break;
+ case UDT_PDODGE: script_pushint(st, mc->base_status.flee2); break;
+ case UDT_CRIT: script_pushint(st, mc->base_status.cri); break;
+ case UDT_RACE: script_pushint(st, mc->base_status.race); break;
+ case UDT_ELETYPE: script_pushint(st, mc->base_status.def_ele); break;
+ case UDT_ELELEVEL: script_pushint(st, mc->base_status.ele_lv); break;
+ case UDT_AMOTION: script_pushint(st, mc->base_status.amotion); break;
+ case UDT_ADELAY: script_pushint(st, mc->base_status.adelay); break;
+ case UDT_DMOTION: script_pushint(st, mc->base_status.dmotion); break;
+ case UDT_MASTERCID: script_pushint(st, mc->mercenary.char_id); break;
+ case UDT_MERC_KILLCOUNT: script_pushint(st, mc->mercenary.kill_count); break;
+ case UDT_LIFETIME: script_pushint(st, mc->mercenary.life_time); break;
+ default:
+ ShowWarning("buildin_getunitdata: Invalid data type '%s' for Mercenary unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ case BL_ELEM:
+ {
+ const struct elemental_data *ed = BL_UCAST(BL_ELEM, bl);
+
+ nullpo_retr(false, ed);
+
+ switch (type)
+ {
+ case UDT_TYPE: script_pushint(st, BL_ELEM); break;
+ case UDT_SIZE: script_pushint(st, ed->base_status.size); break;
+ case UDT_HP: script_pushint(st, ed->base_status.hp); break;
+ case UDT_MAXHP: script_pushint(st, ed->base_status.max_hp); break;
+ case UDT_SP: script_pushint(st, ed->base_status.sp); break;
+ case UDT_MAXSP: script_pushint(st, ed->base_status.max_sp); break;
+ case UDT_MAPIDXY:
+ getunitdata_sub(0, ed->bl.m);
+ getunitdata_sub(1, ed->bl.x);
+ getunitdata_sub(2, ed->bl.y);
+ break;
+ case UDT_SPEED: script_pushint(st, ed->base_status.speed); break;
+ case UDT_LOOKDIR: script_pushint(st, ed->ud.dir); break;
+ case UDT_CANMOVETICK: script_pushint(st, ed->ud.canmove_tick); break;
+ case UDT_MODE: script_pushint(st, ed->base_status.mode); break;
+ case UDT_STR: script_pushint(st, ed->base_status.str); break;
+ case UDT_AGI: script_pushint(st, ed->base_status.agi); break;
+ case UDT_VIT: script_pushint(st, ed->base_status.vit); break;
+ case UDT_INT: script_pushint(st, ed->base_status.int_); break;
+ case UDT_DEX: script_pushint(st, ed->base_status.dex); break;
+ case UDT_LUK: script_pushint(st, ed->base_status.luk); break;
+ case UDT_ATKRANGE: script_pushint(st, ed->base_status.rhw.range); break;
+ case UDT_ATKMIN: script_pushint(st, ed->base_status.rhw.atk); break;
+ case UDT_ATKMAX: script_pushint(st, ed->base_status.rhw.atk2); break;
+ case UDT_MATKMIN: script_pushint(st, ed->base_status.matk_min); break;
+ case UDT_MATKMAX: script_pushint(st, ed->base_status.matk_max); break;
+ case UDT_DEF: script_pushint(st, ed->base_status.def); break;
+ case UDT_MDEF: script_pushint(st, ed->base_status.mdef); break;
+ case UDT_HIT: script_pushint(st, ed->base_status.hit); break;
+ case UDT_FLEE: script_pushint(st, ed->base_status.flee); break;
+ case UDT_PDODGE: script_pushint(st, ed->base_status.flee2); break;
+ case UDT_CRIT: script_pushint(st, ed->base_status.cri); break;
+ case UDT_RACE: script_pushint(st, ed->base_status.race); break;
+ case UDT_ELETYPE: script_pushint(st, ed->base_status.def_ele); break;
+ case UDT_ELELEVEL: script_pushint(st, ed->base_status.ele_lv); break;
+ case UDT_AMOTION: script_pushint(st, ed->base_status.amotion); break;
+ case UDT_ADELAY: script_pushint(st, ed->base_status.adelay); break;
+ case UDT_DMOTION: script_pushint(st, ed->base_status.dmotion); break;
+ case UDT_MASTERCID: script_pushint(st, ed->elemental.char_id); break;
+ default:
+ ShowWarning("buildin_getunitdata: Invalid data type '%s' for Elemental unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ case BL_NPC:
+ {
+ const struct npc_data *nd = BL_UCAST(BL_NPC, bl);
+
+ nullpo_retr(false, nd);
+
+ switch (type)
+ {
+ case UDT_TYPE: script_pushint(st, BL_NPC); break;
+ case UDT_SIZE: script_pushint(st, nd->status.size); break;
+ case UDT_HP: script_pushint(st, nd->status.hp); break;
+ case UDT_MAXHP: script_pushint(st, nd->status.max_hp); break;
+ case UDT_SP: script_pushint(st, nd->status.sp); break;
+ case UDT_MAXSP: script_pushint(st, nd->status.max_sp); break;
+ case UDT_MAPIDXY:
+ getunitdata_sub(0, bl->m);
+ getunitdata_sub(1, bl->x);
+ getunitdata_sub(2, bl->y);
+ break;
+ case UDT_SPEED: script_pushint(st, nd->status.speed); break;
+ case UDT_LOOKDIR: script_pushint(st, nd->ud->dir); break;
+ case UDT_CANMOVETICK: script_pushint(st, nd->ud->canmove_tick); break;
+ case UDT_MODE: script_pushint(st, nd->status.mode); break;
+ case UDT_STR: script_pushint(st, nd->status.str); break;
+ case UDT_AGI: script_pushint(st, nd->status.agi); break;
+ case UDT_VIT: script_pushint(st, nd->status.vit); break;
+ case UDT_INT: script_pushint(st, nd->status.int_); break;
+ case UDT_DEX: script_pushint(st, nd->status.dex); break;
+ case UDT_LUK: script_pushint(st, nd->status.luk); break;
+ case UDT_ATKRANGE: script_pushint(st, nd->status.rhw.range); break;
+ case UDT_ATKMIN: script_pushint(st, nd->status.rhw.atk); break;
+ case UDT_ATKMAX: script_pushint(st, nd->status.rhw.atk2); break;
+ case UDT_MATKMIN: script_pushint(st, nd->status.matk_min); break;
+ case UDT_MATKMAX: script_pushint(st, nd->status.matk_max); break;
+ case UDT_DEF: script_pushint(st, nd->status.def); break;
+ case UDT_MDEF: script_pushint(st, nd->status.mdef); break;
+ case UDT_HIT: script_pushint(st, nd->status.hit); break;
+ case UDT_FLEE: script_pushint(st, nd->status.flee); break;
+ case UDT_PDODGE: script_pushint(st, nd->status.flee2); break;
+ case UDT_CRIT: script_pushint(st, nd->status.cri); break;
+ case UDT_RACE: script_pushint(st, nd->status.race); break;
+ case UDT_ELETYPE: script_pushint(st, nd->status.def_ele); break;
+ case UDT_ELELEVEL: script_pushint(st, nd->status.ele_lv); break;
+ case UDT_AMOTION: script_pushint(st, nd->status.amotion); break;
+ case UDT_ADELAY: script_pushint(st, nd->status.adelay); break;
+ case UDT_DMOTION: script_pushint(st, nd->status.dmotion); break;
+ default:
+ ShowWarning("buildin_getunitdata: Invalid data type '%s' for NPC unit.\n", udtype);
+ script_pushint(st, 0);
+ return false;
+ }
+ }
+ break;
+ default:
+ ShowError("buildin_getunitdata: Unknown object!\n");
+ script_pushint(st, 0);
+ return false;
+ } // end of bl->type switch
+
+#undef getunitdata_sub
+
+ return false;
+}
+
+/**
+ * Gets the name of a Unit.
+ * Supported types are [MOB|HOM|PET|NPC].
+ * MER and ELEM don't support custom names.
+ *
+ * @command getunitname <GUID>;
+ * @param GUID Game Object Unique ID.
+ * @return boolean or Name of the game object.
+ */
+BUILDIN(getunitname)
+{
+ const struct block_list* bl = NULL;
+
+ bl = map->id2bl(script_getnum(st, 2));
+
+ if (bl == NULL) {
+ ShowWarning("buildin_getunitname: Error in finding object with given game ID %d!\n", script_getnum(st, 2));
+ script_pushconststr(st, "Unknown");
+ return false;
+ }
+
+ script_pushstrcopy(st, status->get_name(bl));
+
+ return true;
+}
+
+/**
+ * Changes the name of a bl.
+ * Supported types are [MOB|HOM|PET].
+ * For NPC see 'setnpcdisplay', MER and ELEM don't support custom names.
+ *
+ * @command setunitname <GUID>,<name>;
+ * @param GUID Game object unique ID.
+ * @param Name as string.
+ * @return boolean.
+ */
+BUILDIN(setunitname)
+{
+ struct block_list* bl = map->id2bl(script_getnum(st, 2));
+
+ if (bl == NULL) {
+ ShowWarning("buildin_setunitname: Game object with ID %d was not found!\n", script_getnum(st, 2));
+ script_pushint(st, 0);
+ return false;
+ }
+
+ switch (bl->type) {
+ case BL_MOB:
+ {
+ struct mob_data *md = BL_UCAST(BL_MOB, bl);
+ if (md == NULL) {
+ ShowWarning("buildin_setunitname: Error in finding object BL_MOB!\n");
+ script_pushint(st, 0);
+ return false;
+ }
+ safestrncpy(md->name, script_getstr(st, 3), NAME_LENGTH);
+ }
+ break;
+ case BL_HOM:
+ {
+ struct homun_data *hd = BL_UCAST(BL_HOM, bl);
+ if (hd == NULL) {
+ ShowWarning("buildin_setunitname: Error in finding object BL_HOM!\n");
+ script_pushint(st, 0);
+ return false;
+ }
+ safestrncpy(hd->homunculus.name, script_getstr(st, 3), NAME_LENGTH);
+ }
+ break;
+ case BL_PET:
+ {
+ struct pet_data *pd = BL_UCAST(BL_PET, bl);
+ if (pd == NULL) {
+ ShowWarning("buildin_setunitname: Error in finding object BL_PET!\n");
+ script_pushint(st, 0);
+ return false;
+ }
+ safestrncpy(pd->pet.name, script_getstr(st, 3), NAME_LENGTH);
+ }
+ break;
+ default:
+ script_pushint(st, 0);
+ ShowWarning("buildin_setunitname: Unknown object type!\n");
+ return false;
+ }
+
+ script_pushint(st, 1);
+ clif->charnameack(0, bl); // Send update to client.
+
+ return true;
+}
+
/// Makes the unit walk to target position or target id
/// Returns if it was successfull
///
@@ -16724,7 +19578,7 @@ BUILDIN(unitattack) {
BL_UCAST(BL_PET, unit_bl)->target_id = target_bl->id;
break;
default:
- ShowError("script:unitattack: unsupported source unit type %d\n", unit_bl->type);
+ ShowError("script:unitattack: unsupported source unit type %u\n", unit_bl->type);
script_pushint(st, 0);
return false;
}
@@ -16767,8 +19621,12 @@ BUILDIN(unittalk) {
bl = map->id2bl(unit_id);
if( bl != NULL ) {
struct StringBuf sbuf;
+ char blname[NAME_LENGTH];
StrBuf->Init(&sbuf);
- StrBuf->Printf(&sbuf, "%s : %s", status->get_name(bl), message);
+ safestrncpy(blname, clif->get_bl_name(bl), sizeof(blname));
+ if(bl->type == BL_NPC)
+ strtok(blname, "#");
+ StrBuf->Printf(&sbuf, "%s : %s", blname, message);
clif->disp_overhead(bl, StrBuf->Value(&sbuf));
StrBuf->Destroy(&sbuf);
}
@@ -16921,8 +19779,9 @@ BUILDIN(sleep2) {
/// Awakes all the sleep timers of the target npc
///
/// awake "<npc name>";
-BUILDIN(awake) {
- DBIterator *iter;
+BUILDIN(awake)
+{
+ struct DBIterator *iter;
struct script_state *tst;
struct npc_data* nd;
@@ -17005,6 +19864,54 @@ BUILDIN(getvariableofnpc)
return true;
}
+BUILDIN(getvariableofpc)
+{
+ const char* name;
+ struct script_data* data = script_getdata(st, 2);
+ struct map_session_data *sd = map->id2sd(script_getnum(st, 3));
+
+ if (!data_isreference(data)) {
+ ShowError("script:getvariableofpc: not a variable\n");
+ script->reportdata(data);
+ script_pushnil(st);
+ st->state = END;
+ return false;
+ }
+
+ name = reference_getname(data);
+
+ switch (*name)
+ {
+ case '$':
+ case '.':
+ case '\'':
+ ShowError("script:getvariableofpc: illegal scope (not pc variable)\n");
+ script->reportdata(data);
+ script_pushnil(st);
+ st->state = END;
+ return false;
+ }
+
+ if (sd == NULL)
+ {
+ // player not found, return default value
+ if (script_hasdata(st, 4)) {
+ script_pushcopy(st, 4);
+ } else if (is_string_variable(name)) {
+ script_pushconststr(st, "");
+ } else {
+ script_pushint(st, 0);
+ }
+ return true;
+ }
+
+ if (!sd->regs.vars)
+ sd->regs.vars = i64db_alloc(DB_OPT_RELEASE_DATA);
+
+ script->push_val(st->stack, C_NAME, reference_getuid(data), &sd->regs);
+ return true;
+}
+
/// Opens a warp portal.
/// Has no "portal opening" effect/sound, it opens the portal immediately.
///
@@ -17082,7 +19989,7 @@ BUILDIN(checkcell) {
cell_chk type = (cell_chk)script_getnum(st,5);
if ( m == -1 ) {
- ShowWarning("checkcell: Attempted to run on unexsitent map '%s', type %d, x/y %d,%d\n",script_getstr(st,2),type,x,y);
+ ShowWarning("checkcell: Attempted to run on unexsitent map '%s', type %u, x/y %d,%d\n", script_getstr(st,2), type, x, y);
return true;
}
@@ -17108,7 +20015,7 @@ BUILDIN(setcell) {
int x,y;
if ( m == -1 ) {
- ShowWarning("setcell: Attempted to run on unexistent map '%s', type %d, x1/y1 - %d,%d | x2/y2 - %d,%d\n",script_getstr(st, 2),type,x1,y1,x2,y2);
+ ShowWarning("setcell: Attempted to run on unexistent map '%s', type %u, x1/y1 - %d,%d | x2/y2 - %d,%d\n", script_getstr(st, 2), type, x1, y1, x2, y2);
return true;
}
@@ -17740,7 +20647,8 @@ BUILDIN(bg_getareausers)
return true;
}
-BUILDIN(bg_updatescore) {
+BUILDIN(bg_updatescore)
+{
const char *str;
int16 m;
@@ -17782,7 +20690,8 @@ BUILDIN(bg_get_data)
* Instancing Script Commands
*------------------------------------------*/
-BUILDIN(instance_create) {
+BUILDIN(instance_create)
+{
const char *name;
int owner_id, res;
int type = IOT_PARTY;
@@ -17818,7 +20727,8 @@ BUILDIN(instance_create) {
return true;
}
-BUILDIN(instance_destroy) {
+BUILDIN(instance_destroy)
+{
int instance_id = -1;
if( script_hasdata(st, 2) )
@@ -17917,7 +20827,8 @@ BUILDIN(instance_set_timeout)
return true;
}
-BUILDIN(instance_init) {
+BUILDIN(instance_init)
+{
int instance_id = script_getnum(st, 2);
if( !instance->valid(instance_id) ) {
@@ -17934,7 +20845,8 @@ BUILDIN(instance_init) {
return true;
}
-BUILDIN(instance_announce) {
+BUILDIN(instance_announce)
+{
int instance_id = script_getnum(st,2);
const char *mes = script_getstr(st,3);
int flag = script_getnum(st,4);
@@ -17943,8 +20855,9 @@ BUILDIN(instance_announce) {
int fontSize = script_hasdata(st,7) ? script_getnum(st,7) : 12; // default fontSize
int fontAlign = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontAlign
int fontY = script_hasdata(st,9) ? script_getnum(st,9) : 0; // default fontY
-
int i;
+ size_t len = strlen(mes);
+ Assert_retr(false, len < INT_MAX);
if( instance_id == -1 ) {
if( st->instance_id >= 0 )
@@ -17958,12 +20871,13 @@ BUILDIN(instance_announce) {
for( i = 0; i < instance->list[instance_id].num_map; i++ )
map->foreachinmap(script->buildin_announce_sub, instance->list[instance_id].map[i], BL_PC,
- mes, strlen(mes)+1, flag&BC_COLOR_MASK, fontColor, fontType, fontSize, fontAlign, fontY);
+ mes, (int)len+1, flag&BC_COLOR_MASK, fontColor, fontType, fontSize, fontAlign, fontY);
return true;
}
-BUILDIN(instance_npcname) {
+BUILDIN(instance_npcname)
+{
const char *str;
int instance_id = -1;
struct npc_data *nd;
@@ -17987,7 +20901,8 @@ BUILDIN(instance_npcname) {
return true;
}
-BUILDIN(has_instance) {
+BUILDIN(has_instance)
+{
struct map_session_data *sd;
const char *str;
int16 m;
@@ -18076,7 +20991,9 @@ int buildin_instance_warpall_sub(struct block_list *bl, va_list ap)
return 0;
}
-BUILDIN(instance_warpall) {
+
+BUILDIN(instance_warpall)
+{
int16 m;
int instance_id = -1;
const char *mapn;
@@ -18284,10 +21201,12 @@ int buildin_mobuseskill_sub(struct block_list *bl, va_list ap)
return 0;
}
+
/*==========================================
* areamobuseskill "Map Name",<x>,<y>,<range>,<Mob ID>,"Skill Name"/<Skill ID>,<Skill Lv>,<Cast Time>,<Cancelable>,<Emotion>,<Target Type>;
*------------------------------------------*/
-BUILDIN(areamobuseskill) {
+BUILDIN(areamobuseskill)
+{
struct block_list center;
int16 m;
int range,mobid,skill_id,skill_lv,casttime,emotion,target,cancel;
@@ -18352,8 +21271,7 @@ BUILDIN(pushpc)
dir = script_getnum(st,2);
cells = script_getnum(st,3);
- if(dir>7)
- {
+ if (dir > 7) {
ShowWarning("buildin_pushpc: Invalid direction %d specified.\n", dir);
script->reportsrc(st);
@@ -18470,12 +21388,16 @@ BUILDIN(makerune)
BUILDIN(hascashmount)
{
struct map_session_data *sd = script->rid2sd(st);
+
if (sd == NULL)
return true;
- if( sd->sc.data[SC_ALL_RIDING] )
- script_pushint(st,1);
- else
- script_pushint(st,0);
+
+ if (sd->sc.data[SC_ALL_RIDING]) {
+ script_pushint(st, 1);
+ } else {
+ script_pushint(st, 0);
+ }
+
return true;
}
@@ -18489,18 +21411,22 @@ BUILDIN(hascashmount)
BUILDIN(setcashmount)
{
struct map_session_data *sd = script->rid2sd(st);
+
if (sd == NULL)
return true;
+
if (pc_hasmount(sd)) {
clif->msgtable(sd, MSG_REINS_CANT_USE_MOUNTED);
- script_pushint(st,0);//can't mount with one of these
+ script_pushint(st, 0); // Can't mount with one of these
} else {
- if (sd->sc.data[SC_ALL_RIDING])
+ if (sd->sc.data[SC_ALL_RIDING]) {
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
- else
- sc_start(NULL,&sd->bl, SC_ALL_RIDING, 100, 25, -1);
- script_pushint(st,1);//in both cases, return 1.
+ } else {
+ sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION);
+ }
+ script_pushint(st, 1); // In both cases, return 1.
}
+
return true;
}
@@ -18508,7 +21434,8 @@ BUILDIN(setcashmount)
* Retrieves quantity of arguments provided to callfunc/callsub.
* getargcount() -> amount of arguments received in a function
**/
-BUILDIN(getargcount) {
+BUILDIN(getargcount)
+{
struct script_retinfo* ri;
if( st->stack->defsp < 1 || st->stack->stack_data[st->stack->defsp - 1].type != C_RETINFO ) {
@@ -18522,10 +21449,12 @@ BUILDIN(getargcount) {
return true;
}
+
/**
* getcharip(<account ID>/<character ID>/<character name>)
**/
-BUILDIN(getcharip) {
+BUILDIN(getcharip)
+{
struct map_session_data* sd = NULL;
/* check if a character name is specified */
@@ -18548,31 +21477,22 @@ BUILDIN(getcharip) {
return false;
}
- /* check for IP */
- if (!sockt->session[sd->fd]->client_addr) {
+ if (sd->fd <= 0 || sockt->session[sd->fd] == NULL || sockt->session[sd->fd]->client_addr == 0) {
script_pushconststr(st, "");
- return true;
- }
-
- /* return the client ip_addr converted for output */
- if (sd && sd->fd && sockt->session[sd->fd])
- {
- /* initiliaze */
- const char *ip_addr = NULL;
- uint32 ip;
-
- /* set ip, ip_addr and convert to ip and push str */
- ip = sockt->session[sd->fd]->client_addr;
- ip_addr = sockt->ip2str(ip, NULL);
+ } else {
+ uint32 ip = sockt->session[sd->fd]->client_addr;
+ const char *ip_addr = sockt->ip2str(ip, NULL);
script_pushstrcopy(st, ip_addr);
}
return true;
}
+
/**
* is_function(<function name>) -> 1 if function exists, 0 otherwise
**/
-BUILDIN(is_function) {
+BUILDIN(is_function)
+{
const char* str = script_getstr(st,2);
if( strdb_exists(script->userfunc_db, str) )
@@ -18582,11 +21502,12 @@ BUILDIN(is_function) {
return true;
}
+
/**
* freeloop(<toggle>) -> toggles this script instance's looping-check ability
**/
-BUILDIN(freeloop) {
-
+BUILDIN(freeloop)
+{
if( script_getnum(st,2) )
st->freeloop = 1;
else
@@ -18597,7 +21518,8 @@ BUILDIN(freeloop) {
return true;
}
-BUILDIN(sit) {
+BUILDIN(sit)
+{
struct map_session_data *sd = NULL;
if (script_hasdata(st, 2))
@@ -18617,7 +21539,8 @@ BUILDIN(sit) {
return true;
}
-BUILDIN(stand) {
+BUILDIN(stand)
+{
struct map_session_data *sd = NULL;
if (script_hasdata(st, 2))
@@ -18637,7 +21560,8 @@ BUILDIN(stand) {
return true;
}
-BUILDIN(issit) {
+BUILDIN(issit)
+{
struct map_session_data *sd = NULL;
if (script_hasdata(st, 2))
@@ -18655,10 +21579,48 @@ BUILDIN(issit) {
return true;
}
+BUILDIN(add_group_command)
+{
+ AtCommandInfo *acmd_d;
+ struct atcmd_binding_data *bcmd_d;
+ GroupSettings *group;
+ int group_index;
+ const char *atcmd = script_getstr(st, 2);
+ int group_id = script_getnum(st, 3);
+ bool self_perm = (script_getnum(st, 4) == 1);
+ bool char_perm = (script_getnum(st, 5) == 1);
+
+ if (!pcg->exists(group_id)) {
+ ShowWarning("script:add_group_command: group does not exist: %i\n", group_id);
+ script_pushint(st, 0);
+ return false;
+ }
+
+ group = pcg->id2group(group_id);
+ group_index = pcg->get_idx(group);
+
+ if ((bcmd_d = atcommand->get_bind_byname(atcmd)) != NULL) {
+ bcmd_d->at_groups[group_index] = self_perm;
+ bcmd_d->char_groups[group_index] = char_perm;
+ script_pushint(st, 1);
+ return true;
+ } else if ((acmd_d = atcommand->get_info_byname(atcmd)) != NULL) {
+ acmd_d->at_groups[group_index] = self_perm;
+ acmd_d->char_groups[group_index] = char_perm;
+ script_pushint(st, 1);
+ return true;
+ }
+
+ ShowWarning("script:add_group_command: command does not exist: %s\n", atcmd);
+ script_pushint(st, 0);
+ return false;
+}
+
/**
* @commands (script based)
**/
-BUILDIN(bindatcmd) {
+BUILDIN(bindatcmd)
+{
const char* atcmd;
const char* eventName;
int i, group_lv = 0, group_lv_char = 99;
@@ -18703,12 +21665,15 @@ BUILDIN(bindatcmd) {
atcommand->binding[i]->group_lv = group_lv;
atcommand->binding[i]->group_lv_char = group_lv_char;
atcommand->binding[i]->log = log;
+ CREATE(atcommand->binding[i]->at_groups, char, db_size(pcg->db));
+ CREATE(atcommand->binding[i]->char_groups, char, db_size(pcg->db));
}
return true;
}
-BUILDIN(unbindatcmd) {
+BUILDIN(unbindatcmd)
+{
const char* atcmd;
int i = 0;
@@ -18749,7 +21714,8 @@ BUILDIN(unbindatcmd) {
return true;
}
-BUILDIN(useatcmd) {
+BUILDIN(useatcmd)
+{
struct map_session_data *sd, *dummy_sd = NULL;
int fd;
const char* cmd;
@@ -18786,70 +21752,70 @@ BUILDIN(useatcmd) {
return true;
}
-BUILDIN(checkre)
+BUILDIN(has_permission)
{
- int num;
+ struct map_session_data *sd;
+ enum e_pc_permission perm;
- num=script_getnum(st,2);
- switch(num) {
- case 0:
-#ifdef RENEWAL
- script_pushint(st, 1);
-#else
- script_pushint(st, 0);
-#endif
- break;
- case 1:
-#ifdef RENEWAL_CAST
- script_pushint(st, 1);
-#else
- script_pushint(st, 0);
-#endif
- break;
- case 2:
-#ifdef RENEWAL_DROP
- script_pushint(st, 1);
-#else
- script_pushint(st, 0);
-#endif
- break;
- case 3:
-#ifdef RENEWAL_EXP
- script_pushint(st, 1);
-#else
- script_pushint(st, 0);
-#endif
- break;
- case 4:
-#ifdef RENEWAL_LVDMG
- script_pushint(st, 1);
-#else
- script_pushint(st, 0);
-#endif
- break;
- case 5:
-#ifdef RENEWAL_EDP
- script_pushint(st, 1);
-#else
- script_pushint(st, 0);
-#endif
- break;
- case 6:
-#ifdef RENEWAL_ASPD
- script_pushint(st, 1);
-#else
+ if (script_hasdata(st, 3)) {
+ sd = map->id2sd(script_getnum(st, 3));
+ } else {
+ sd = script->rid2sd(st);
+ }
+
+ if (sd == NULL) {
+ script_pushint(st, 0);
+ return false;
+ }
+
+ if (script_isstringtype(st, 2)) {
+ // to check for plugin permissions
+ int i = 0, j = -1;
+ const char *name = script_getstr(st, 2);
+ for (; i < pcg->permission_count; ++i) {
+ if (strcmp(pcg->permissions[i].name, name) == 0) {
+ j = i;
+ break;
+ }
+ }
+ if (j < 0) {
+ ShowError("script:has_permission: unknown permission: %s\n", name);
script_pushint(st, 0);
-#endif
- break;
- default:
- ShowWarning("buildin_checkre: unknown parameter.\n");
- break;
+ return false;
+ }
+ script_pushint(st, pc_has_permission(sd, pcg->permissions[j].permission));
+ return true;
+ }
+
+ // to ckeck for built-in permission
+ perm = script_getnum(st, 2);
+ script_pushint(st, pc_has_permission(sd, perm));
+ return true;
+}
+
+BUILDIN(can_use_command)
+{
+ struct map_session_data *sd;
+ const char *cmd = script_getstr(st, 2);
+
+ if (script_hasdata(st, 3)) {
+ sd = map->id2sd(script_getnum(st, 3));
+ } else {
+ sd = script->rid2sd(st);
+ }
+
+ if (sd == NULL) {
+ script_pushint(st, 0);
+ return false;
}
+
+ script_pushint(st, pc->can_use_command(sd, cmd));
return true;
}
/* getrandgroupitem <container_item_id>,<quantity> */
-BUILDIN(getrandgroupitem) {
+BUILDIN(getrandgroupitem)
+{
struct item_data *data = NULL;
struct map_session_data *sd = NULL;
int nameid = script_getnum(st, 2);
@@ -18902,8 +21868,8 @@ BUILDIN(getrandgroupitem) {
/* cleanmap <map_name>;
* cleanarea <map_name>, <x0>, <y0>, <x1>, <y1>; */
-int script_cleanfloor_sub(struct block_list *bl, va_list ap) {
- nullpo_ret(bl);
+int script_cleanfloor_sub(struct block_list *bl, va_list ap)
+{
map->clearflooritem(bl);
return 0;
@@ -18934,6 +21900,7 @@ BUILDIN(cleanmap)
return true;
}
+
/* Cast a skill on the attached player.
* npcskill <skill id>, <skill lvl>, <stat point>, <NPC level>;
* npcskill "<skill name>", <skill lvl>, <stat point>, <NPC level>; */
@@ -18983,7 +21950,8 @@ BUILDIN(npcskill)
/* Turns a player into a monster and grants SC attribute effect. [malufett/Hercules]
* montransform <monster name/id>, <duration>, <sc type>, <val1>, <val2>, <val3>, <val4>; */
-BUILDIN(montransform) {
+BUILDIN(montransform)
+{
int tick;
enum sc_type type;
struct block_list* bl;
@@ -19638,7 +22606,7 @@ BUILDIN(countbound)
}
script_pushint(st,j);
- return 0;
+ return true;
}
/*==========================================
@@ -19692,9 +22660,10 @@ BUILDIN(checkbound)
/* bg_match_over( arena_name {, optional canceled } ) */
/* returns 0 when successful, 1 otherwise */
-BUILDIN(bg_match_over) {
+BUILDIN(bg_match_over)
+{
bool canceled = script_hasdata(st,3) ? true : false;
- struct bg_arena *arena = bg->name2arena((char*)script_getstr(st, 2));
+ struct bg_arena *arena = bg->name2arena(script_getstr(st, 2));
if( arena ) {
bg->match_over(arena,canceled);
@@ -19705,7 +22674,8 @@ BUILDIN(bg_match_over) {
return true;
}
-BUILDIN(instance_mapname) {
+BUILDIN(instance_mapname)
+{
const char *map_name;
int m;
short instance_id = -1;
@@ -19725,10 +22695,12 @@ BUILDIN(instance_mapname) {
return true;
}
+
/* modify an instances' reload-spawn point */
/* instance_set_respawn <map_name>,<x>,<y>{,<instance_id>} */
/* returns 1 when successful, 0 otherwise. */
-BUILDIN(instance_set_respawn) {
+BUILDIN(instance_set_respawn)
+{
const char *map_name;
short instance_id = -1;
short mid;
@@ -19769,6 +22741,7 @@ BUILDIN(instance_set_respawn) {
}
return true;
}
+
/**
* @call openshop({NPC Name});
*
@@ -19804,13 +22777,15 @@ BUILDIN(openshop)
return true;
}
+
/**
* @call sellitem <Item_ID>,{,price{,qty}};
*
* adds <Item_ID> (or modifies if present) to shop
* if price not provided (or -1) uses the item's value_sell
**/
-BUILDIN(sellitem) {
+BUILDIN(sellitem)
+{
struct npc_data *nd;
struct item_data *it;
int i = 0, id = script_getnum(st,2);
@@ -19877,6 +22852,7 @@ BUILDIN(sellitem) {
return true;
}
+
/**
* @call stopselling <Item_ID>;
*
@@ -19884,7 +22860,8 @@ BUILDIN(sellitem) {
*
* @return 1 on success, 0 otherwise
**/
-BUILDIN(stopselling) {
+BUILDIN(stopselling)
+{
struct npc_data *nd;
int i, id = script_getnum(st,2);
@@ -19927,6 +22904,7 @@ BUILDIN(stopselling) {
return true;
}
+
/**
* @call setcurrency <Val1>{,<Val2>};
*
@@ -19949,6 +22927,7 @@ BUILDIN(setcurrency)
return true;
}
+
/**
* @call tradertype(<type>);
*
@@ -19956,7 +22935,8 @@ BUILDIN(setcurrency)
* check enum npc_shop_types for list
* cleans shop list on use
**/
-BUILDIN(tradertype) {
+BUILDIN(tradertype)
+{
int type = script_getnum(st, 2);
struct npc_data *nd;
@@ -19992,12 +22972,14 @@ BUILDIN(tradertype) {
return true;
}
+
/**
* @call purchaseok();
*
* signs the transaction can proceed
**/
-BUILDIN(purchaseok) {
+BUILDIN(purchaseok)
+{
struct npc_data *nd;
if( !(nd = map->id2nd(st->oid)) || !nd->u.scr.shop ) {
@@ -20009,12 +22991,14 @@ BUILDIN(purchaseok) {
return true;
}
+
/**
* @call shopcount(<Item_ID>);
*
* @return number of available items in the script's attached shop
**/
-BUILDIN(shopcount) {
+BUILDIN(shopcount)
+{
struct npc_data *nd;
int id = script_getnum(st, 2);
unsigned short i;
@@ -20068,11 +23052,61 @@ BUILDIN(channelmes)
return true;
}
+BUILDIN(addchannelhandler)
+{
+ int i;
+ const char *channelname = script_getstr(st, 2);
+ const char *eventname = script_getstr(st, 3);
+ struct channel_data *chan = channel->search(channelname, NULL);
+
+ if (!chan) {
+ script_pushint(st, 0);
+ return true;
+ }
+
+ ARR_FIND(0, MAX_EVENTQUEUE, i, chan->handlers[i][0] == '\0');
+
+ if (i < MAX_EVENTQUEUE) {
+ safestrncpy(chan->handlers[i], eventname, EVENT_NAME_LENGTH); //Event enqueued.
+ script_pushint(st, 1);
+ return true;
+ }
+
+ ShowWarning("script:addchannelhandler: too many handlers for channel %s.\n", channelname);
+ script_pushint(st, 0);
+ return true;
+}
+
+BUILDIN(removechannelhandler)
+{
+ int i;
+ const char *channelname = script_getstr(st, 2);
+ const char *eventname = script_getstr(st, 3);
+ struct channel_data *chan = channel->search(channelname, NULL);
+
+ if (!chan) {
+ script_pushint(st, 0);
+ return true;
+ }
+
+ for (i = 0; i < MAX_EVENTQUEUE; i++) {
+ if (strcmp(chan->handlers[i], eventname) == 0) {
+ chan->handlers[i][0] = '\0';
+ script_pushint(st, 1);
+ return true;
+ }
+ }
+
+ script_pushint(st, 0);
+ return true;
+}
+
/** By Cydh
Display script message
showscript "<message>"{,<GID>};
*/
-BUILDIN(showscript) {
+BUILDIN(showscript)
+{
struct block_list *bl = NULL;
const char *msg = script_getstr(st, 2);
int id = 0;
@@ -20109,8 +23143,10 @@ BUILDIN(mergeitem)
return true;
}
+
/** place holder for the translation macro **/
-BUILDIN(_) {
+BUILDIN(_)
+{
return true;
}
@@ -20120,7 +23156,8 @@ BUILDIN(activatepset);
BUILDIN(deactivatepset);
BUILDIN(deletepset);
-BUILDIN(pcre_match) {
+BUILDIN(pcre_match)
+{
const char *input = script_getstr(st, 2);
const char *regex = script_getstr(st, 3);
@@ -20129,6 +23166,48 @@ BUILDIN(pcre_match) {
}
/**
+ * navigateto("<map>"{,<x>,<y>,<flag>,<hide_window>,<monster_id>,<char_id>});
+ */
+BUILDIN(navigateto)
+{
+#if PACKETVER >= 20111010
+ struct map_session_data* sd;
+ const char *mapname;
+ uint16 x = 0;
+ uint16 y = 0;
+ uint16 monster_id = 0;
+ uint8 flag = NAV_KAFRA_AND_AIRSHIP;
+ bool hideWindow = true;
+
+ mapname = script_getstr(st, 2);
+
+ if (script_hasdata(st, 3))
+ x = script_getnum(st, 3);
+ if (script_hasdata(st, 4))
+ y = script_getnum(st, 4);
+ if (script_hasdata(st, 5))
+ flag = (uint8)script_getnum(st, 5);
+ if (script_hasdata(st, 6))
+ hideWindow = script_getnum(st, 6) ? true : false;
+ if (script_hasdata(st, 7))
+ monster_id = script_getnum(st, 7);
+
+ if (script_hasdata(st, 8)) {
+ sd = map->charid2sd(script_getnum(st, 8));
+ } else {
+ sd = script->rid2sd(st);
+ }
+
+ clif->navigate_to(sd, mapname, x, y, flag, hideWindow, monster_id);
+
+ return true;
+#else
+ ShowError("Navigation system works only with packet version >= 20111010");
+ return false;
+#endif
+}
+
+/**
* Adds a built-in script function.
*
* @param buildin Script function data
@@ -20136,7 +23215,8 @@ BUILDIN(pcre_match) {
* (i.e. a plugin overriding a built-in function)
* @return Whether the function was successfully added.
*/
-bool script_add_builtin(const struct script_function *buildin, bool override) {
+bool script_add_builtin(const struct script_function *buildin, bool override)
+{
int n = 0, offset = 0;
size_t slen;
if( !buildin ) {
@@ -20188,8 +23268,10 @@ bool script_add_builtin(const struct script_function *buildin, bool override) {
else if( strcmp(buildin->name, "callfunc") == 0 ) script->buildin_callfunc_ref = n;
else if( strcmp(buildin->name, "getelementofarray") == 0 ) script->buildin_getelementofarray_ref = n;
else if( strcmp(buildin->name, "mes") == 0 ) script->buildin_mes_offset = script->buildin_count;
+ else if( strcmp(buildin->name, "mesf") == 0 ) script->buildin_mesf_offset = script->buildin_count;
else if( strcmp(buildin->name, "select") == 0 ) script->buildin_select_offset = script->buildin_count;
else if( strcmp(buildin->name, "_") == 0 ) script->buildin_lang_macro_offset = script->buildin_count;
+ else if( strcmp(buildin->name, "_$") == 0 ) script->buildin_lang_macro_fmtstring_offset = script->buildin_count;
offset = script->buildin_count;
@@ -20215,7 +23297,8 @@ bool script_add_builtin(const struct script_function *buildin, bool override) {
return true;
}
-bool script_hp_add(char *name, char *args, bool (*func)(struct script_state *st), bool isDeprecated) {
+bool script_hp_add(char *name, char *args, bool (*func)(struct script_state *st), bool isDeprecated)
+{
struct script_function buildin;
buildin.name = name;
buildin.arg = args;
@@ -20235,6 +23318,7 @@ void script_run_use_script(struct map_session_data *sd, struct item_data *data,
*/
void script_run_use_script(struct map_session_data *sd, struct item_data *data, int oid)
{
+ nullpo_retv(data);
script->current_item_id = data->nameid;
script->run(data->script, 0, sd->bl.id, oid);
script->current_item_id = 0;
@@ -20283,7 +23367,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(__setr,"rv?"),
// NPC interaction
- BUILDIN_DEF(mes,"s*"),
+ BUILDIN_DEF(mes,"s"),
+ BUILDIN_DEF(mesf,"s*"),
BUILDIN_DEF(next,""),
BUILDIN_DEF(close,""),
BUILDIN_DEF(close2,""),
@@ -20302,8 +23387,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(warp,"sii?"),
BUILDIN_DEF(areawarp,"siiiisii??"),
BUILDIN_DEF(warpchar,"siii"), // [LuzZza]
- BUILDIN_DEF(warpparty,"siii?"), // [Fredzilla] [Paradox924X]
- BUILDIN_DEF(warpguild,"siii"), // [Fredzilla]
+ BUILDIN_DEF(warpparty,"siii??"), // [Fredzilla] [Paradox924X] [Jedzkie] [Dastgir]
+ BUILDIN_DEF(warpguild,"siii?"), // [Fredzilla]
BUILDIN_DEF(setlook,"ii"),
BUILDIN_DEF(changelook,"ii"), // Simulates but don't Store it
BUILDIN_DEF2(__setr,"set","rv"),
@@ -20311,6 +23396,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(cleararray,"rvi"),
BUILDIN_DEF(copyarray,"rri"),
BUILDIN_DEF(getarraysize,"r"),
+ BUILDIN_DEF(getarrayindex,"r"),
BUILDIN_DEF(deletearray,"r?"),
BUILDIN_DEF(getelementofarray,"ri"),
BUILDIN_DEF(getitem,"vi?"),
@@ -20319,6 +23405,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getnameditem,"vv"),
BUILDIN_DEF2(grouprandomitem,"groupranditem","i"),
BUILDIN_DEF(makeitem,"visii"),
+ BUILDIN_DEF(makeitem2,"viiiiiiii????"),
BUILDIN_DEF(delitem,"vi?"),
BUILDIN_DEF(delitem2,"viiiiiiii?"),
BUILDIN_DEF2(enableitemuse,"enable_items",""),
@@ -20343,8 +23430,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getguildmaster,"i"),
BUILDIN_DEF(getguildmasterid,"i"),
BUILDIN_DEF(getguildmember,"i?"),
- BUILDIN_DEF(strcharinfo,"i"),
- BUILDIN_DEF(strnpcinfo,"i"),
+ BUILDIN_DEF(strcharinfo,"i??"),
+ BUILDIN_DEF(strnpcinfo,"i??"),
BUILDIN_DEF(charid2rid,"i"),
BUILDIN_DEF(getequipid,"i"),
BUILDIN_DEF(getequipname,"i"),
@@ -20357,7 +23444,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getequipisidentify,"i"),
BUILDIN_DEF(getequiprefinerycnt,"i"),
BUILDIN_DEF(getequipweaponlv,"i"),
- BUILDIN_DEF(getequippercentrefinery,"i"),
+ BUILDIN_DEF(getequippercentrefinery,"i?"),
BUILDIN_DEF(successrefitem,"i?"),
BUILDIN_DEF(failedrefitem,"i"),
BUILDIN_DEF(downrefitem,"i?"),
@@ -20381,8 +23468,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(setgroupid, "i?"),
BUILDIN_DEF(getgroupid,""),
BUILDIN_DEF(end,""),
- BUILDIN_DEF(checkoption,"i"),
- BUILDIN_DEF(setoption,"i?"),
+ BUILDIN_DEF(checkoption,"i?"),
+ BUILDIN_DEF(setoption,"i??"),
BUILDIN_DEF(setcart,"?"),
BUILDIN_DEF(checkcart,""),
BUILDIN_DEF(setfalcon,"?"),
@@ -20407,9 +23494,11 @@ void script_parse_builtin(void) {
BUILDIN_DEF(clone,"siisi????"),
BUILDIN_DEF(doevent,"s"),
BUILDIN_DEF(donpcevent,"s"),
- BUILDIN_DEF(addtimer,"is"),
- BUILDIN_DEF(deltimer,"s"),
- BUILDIN_DEF(addtimercount,"si"),
+ BUILDIN_DEF(addtimer,"is?"),
+ BUILDIN_DEF(deltimer,"s?"),
+ BUILDIN_DEF(addtimercount,"si?"),
+ BUILDIN_DEF(gettimer,"i??"),
+ BUILDIN_DEF(getunits,"iris????"),
BUILDIN_DEF(initnpctimer,"??"),
BUILDIN_DEF(stopnpctimer,"??"),
BUILDIN_DEF(startnpctimer,"??"),
@@ -20494,8 +23583,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getcartinventorylist,""),
BUILDIN_DEF(getskilllist,""),
BUILDIN_DEF(clearitem,""),
- BUILDIN_DEF(classchange,"ii"),
- BUILDIN_DEF(misceffect,"i"),
+ BUILDIN_DEF(classchange,"ii?"),
+ BUILDIN_DEF_DEPRECATED(misceffect,"i"),
BUILDIN_DEF(playbgm,"s"),
BUILDIN_DEF(playbgmall,"s?????"),
BUILDIN_DEF(soundeffect,"si"),
@@ -20510,8 +23599,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(petskillsupport,"viiii"), // [Skotlex]
BUILDIN_DEF(skilleffect,"vi"), // skill effect [Celest]
BUILDIN_DEF(npcskilleffect,"viii"), // npc skill effect [Valaris]
- BUILDIN_DEF(specialeffect,"i??"), // npc skill effect [Valaris]
- BUILDIN_DEF(specialeffect2,"i??"), // skill effect on players[Valaris]
+ BUILDIN_DEF(specialeffect,"i???"), // npc skill effect [Valaris]
+ BUILDIN_DEF_DEPRECATED(specialeffect2,"i??"), // skill effect on players[Valaris]
BUILDIN_DEF(nude,""), // nude command [Valaris]
BUILDIN_DEF(mapwarp,"ssii??"), // Added by RoVeRT
BUILDIN_DEF(atcommand,"s"), // [MouseJstr]
@@ -20530,8 +23619,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(setnpcdir,"*"), // [4144]
BUILDIN_DEF(getnpcclass,"?"), // [4144]
BUILDIN_DEF(getmapxy,"rrri?"), //by Lorky [Lupus]
- BUILDIN_DEF(checkoption1,"i"),
- BUILDIN_DEF(checkoption2,"i"),
+ BUILDIN_DEF(checkoption1,"i?"),
+ BUILDIN_DEF(checkoption2,"i?"),
BUILDIN_DEF(guildgetexp,"i"),
BUILDIN_DEF(guildchangegm,"is"),
BUILDIN_DEF(logmes,"s"), //this command actls as MES but rints info into LOG file either SQL/TXT [Lupus]
@@ -20560,6 +23649,9 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris]
BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris]
BUILDIN_DEF(charat,"si"),
+ BUILDIN_DEF(isstr,"v"),
+ BUILDIN_DEF(chr,"i"),
+ BUILDIN_DEF(ord,"s"),
BUILDIN_DEF(setchar,"ssi"),
BUILDIN_DEF(insertchar,"ssi"),
BUILDIN_DEF(delchar,"si"),
@@ -20581,10 +23673,14 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info
BUILDIN_DEF(setiteminfo,"iii"), //[Lupus] set Items Buy / sell Price, etc info
BUILDIN_DEF(getequipcardid,"ii"), //[Lupus] returns CARD ID or other info from CARD slot N of equipped item
+ BUILDIN_DEF(getequippedoptioninfo, "i"),
+ BUILDIN_DEF(getequipoption, "iii"),
+ BUILDIN_DEF(setequipoption, "iiii"),
+ BUILDIN_DEF(getequipisenableopt, "i"),
// List of mathematics commands --->
BUILDIN_DEF(log10,"i"),
BUILDIN_DEF(sqrt,"i"), //[zBuffer]
- BUILDIN_DEF(pow,"ii"), //[zBuffer]
+ BUILDIN_DEF_DEPRECATED(pow,"ii"), //[zBuffer]
BUILDIN_DEF(distance,"iiii"), //[zBuffer]
// <--- List of mathematics commands
BUILDIN_DEF(min, "i*"),
@@ -20626,6 +23722,11 @@ void script_parse_builtin(void) {
// <--- [zBuffer] List of player cont commands
// [zBuffer] List of mob control commands --->
BUILDIN_DEF(getunittype,"i"),
+ /* Unit Data */
+ BUILDIN_DEF(setunitdata,"iiv??"),
+ BUILDIN_DEF(getunitdata,"ii?"),
+ BUILDIN_DEF(getunitname,"i"),
+ BUILDIN_DEF(setunitname,"is"),
BUILDIN_DEF(unitwalk,"ii?"),
BUILDIN_DEF(unitkill,"i"),
BUILDIN_DEF(unitwarp,"isii"),
@@ -20640,6 +23741,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(sleep2,"i"),
BUILDIN_DEF(awake,"s"),
BUILDIN_DEF(getvariableofnpc,"rs"),
+ BUILDIN_DEF(getvariableofpc,"ri?"),
BUILDIN_DEF(warpportal,"iisii"),
BUILDIN_DEF2(homunculus_evolution,"homevolution",""), //[orn]
BUILDIN_DEF2(homunculus_mutate,"hommutate","?"),
@@ -20736,6 +23838,9 @@ void script_parse_builtin(void) {
BUILDIN_DEF(bindatcmd, "ss???"),
BUILDIN_DEF(unbindatcmd, "s"),
BUILDIN_DEF(useatcmd, "s"),
+ BUILDIN_DEF(has_permission, "v?"),
+ BUILDIN_DEF(can_use_command, "s?"),
+ BUILDIN_DEF(add_group_command, "siii"),
/**
* Item bound [Xantara] [Akinari] [Mhalicot/Hercules]
@@ -20791,10 +23896,16 @@ void script_parse_builtin(void) {
BUILDIN_DEF(purchaseok,""),
BUILDIN_DEF(shopcount, "i"),
+ /* Navigation */
+ BUILDIN_DEF(navigateto, "s??????"),
+
BUILDIN_DEF(channelmes, "ss"),
+ BUILDIN_DEF(addchannelhandler, "ss"),
+ BUILDIN_DEF(removechannelhandler, "ss"),
BUILDIN_DEF(showscript, "s?"),
BUILDIN_DEF(mergeitem,""),
BUILDIN_DEF(_,"s"),
+ BUILDIN_DEF2(_, "_$", "s"),
};
int i, len = ARRAYLENGTH(BUILDIN);
RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up
@@ -20806,7 +23917,8 @@ void script_parse_builtin(void) {
#undef BUILDIN_DEF
#undef BUILDIN_DEF2
-void script_label_add(int key, int pos) {
+void script_label_add(int key, int pos)
+{
int idx = script->label_count;
if( script->labels_size == script->label_count ) {
@@ -20836,6 +23948,7 @@ void script_hardcoded_constants(void)
script->set_constant("MAX_CART",MAX_INVENTORY,false, false);
script->set_constant("MAX_INVENTORY",MAX_INVENTORY,false, false);
script->set_constant("MAX_ZENY",MAX_ZENY,false, false);
+ script->set_constant("MAX_BANK_ZENY", MAX_BANK_ZENY, false, false);
script->set_constant("MAX_BG_MEMBERS",MAX_BG_MEMBERS,false, false);
script->set_constant("MAX_CHAT_USERS",MAX_CHAT_USERS,false, false);
script->set_constant("MAX_REFINE",MAX_REFINE,false, false);
@@ -20865,6 +23978,7 @@ void script_hardcoded_constants(void)
script->set_constant("Option_Dragon5",OPTION_DRAGON5,false, false);
script->set_constant("Option_Hanbok",OPTION_HANBOK,false, false);
script->set_constant("Option_Oktoberfest",OPTION_OKTOBERFEST,false, false);
+ script->set_constant("Option_Summer2", OPTION_SUMMER2, false, false);
script->constdb_comment("status option compounds");
script->set_constant("Option_Dragon",OPTION_DRAGON,false, false);
@@ -20943,6 +24057,72 @@ void script_hardcoded_constants(void)
script->set_constant("EQP_SHADOW_ACC_R", EQP_SHADOW_ACC_R, false, false);
script->set_constant("EQP_SHADOW_ACC_L", EQP_SHADOW_ACC_L, false, false);
+ script->constdb_comment("Item Option Types");
+ script->set_constant("IT_OPT_INDEX", IT_OPT_INDEX, false, false);
+ script->set_constant("IT_OPT_VALUE", IT_OPT_VALUE, false, false);
+ script->set_constant("IT_OPT_PARAM", IT_OPT_PARAM, false, false);
+
+ script->constdb_comment("Maximum Item Options");
+ script->set_constant("MAX_ITEM_OPTIONS", MAX_ITEM_OPTIONS, false, false);
+
+ script->constdb_comment("Navigation constants, use with *navigateto*");
+ script->set_constant("NAV_NONE", NAV_NONE, false, false);
+ script->set_constant("NAV_AIRSHIP_ONLY", NAV_AIRSHIP_ONLY, false, false);
+ script->set_constant("NAV_SCROLL_ONLY", NAV_SCROLL_ONLY, false, false);
+ script->set_constant("NAV_AIRSHIP_AND_SCROLL", NAV_AIRSHIP_AND_SCROLL, false, false);
+ script->set_constant("NAV_KAFRA_ONLY", NAV_KAFRA_ONLY, false, false);
+ script->set_constant("NAV_KAFRA_AND_AIRSHIP", NAV_KAFRA_AND_AIRSHIP, false, false);
+ script->set_constant("NAV_KAFRA_AND_SCROLL", NAV_KAFRA_AND_SCROLL, false, false);
+ script->set_constant("NAV_ALL", NAV_ALL, false, false);
+
+ script->constdb_comment("BL types");
+ script->set_constant("BL_PC",BL_PC,false, false);
+ script->set_constant("BL_MOB",BL_MOB,false, false);
+ script->set_constant("BL_PET",BL_PET,false, false);
+ script->set_constant("BL_HOM",BL_HOM,false, false);
+ script->set_constant("BL_MER",BL_MER,false, false);
+ script->set_constant("BL_ITEM",BL_ITEM,false, false);
+ script->set_constant("BL_SKILL",BL_SKILL,false, false);
+ script->set_constant("BL_NPC",BL_NPC,false, false);
+ script->set_constant("BL_CHAT",BL_CHAT,false, false);
+ script->set_constant("BL_ELEM",BL_ELEM,false, false);
+ script->set_constant("BL_CHAR",BL_CHAR,false, false);
+ script->set_constant("BL_ALL",BL_ALL,false, false);
+
+ script->constdb_comment("Refine Chance Types");
+ script->set_constant("REFINE_CHANCE_TYPE_NORMAL", REFINE_CHANCE_TYPE_NORMAL, false, false);
+ script->set_constant("REFINE_CHANCE_TYPE_ENRICHED", REFINE_CHANCE_TYPE_ENRICHED, false, false);
+ script->set_constant("REFINE_CHANCE_TYPE_E_NORMAL", REFINE_CHANCE_TYPE_E_NORMAL, false, false);
+ script->set_constant("REFINE_CHANCE_TYPE_E_ENRICHED", REFINE_CHANCE_TYPE_E_ENRICHED, false, false);
+
+ script->constdb_comment("Player permissions");
+ script->set_constant("PERM_TRADE", PC_PERM_TRADE, false, false);
+ script->set_constant("PERM_PARTY", PC_PERM_PARTY, false, false);
+ script->set_constant("PERM_ALL_SKILL", PC_PERM_ALL_SKILL, false, false);
+ script->set_constant("PERM_USE_ALL_EQUIPMENT", PC_PERM_USE_ALL_EQUIPMENT, false, false);
+ script->set_constant("PERM_SKILL_UNCONDITIONAL", PC_PERM_SKILL_UNCONDITIONAL, false, false);
+ script->set_constant("PERM_JOIN_ALL_CHAT", PC_PERM_JOIN_ALL_CHAT, false, false);
+ script->set_constant("PERM_NO_CHAT_KICK", PC_PERM_NO_CHAT_KICK, false, false);
+ script->set_constant("PERM_HIDE_SESSION", PC_PERM_HIDE_SESSION, false, false);
+ script->set_constant("PERM_RECEIVE_HACK_INFO", PC_PERM_RECEIVE_HACK_INFO, false, false);
+ script->set_constant("PERM_WARP_ANYWHERE", PC_PERM_WARP_ANYWHERE, false, false);
+ script->set_constant("PERM_VIEW_HPMETER", PC_PERM_VIEW_HPMETER, false, false);
+ script->set_constant("PERM_VIEW_EQUIPMENT", PC_PERM_VIEW_EQUIPMENT, false, false);
+ script->set_constant("PERM_USE_CHECK", PC_PERM_USE_CHECK, false, false);
+ script->set_constant("PERM_USE_CHANGEMAPTYPE", PC_PERM_USE_CHANGEMAPTYPE, false, false);
+ script->set_constant("PERM_USE_ALL_COMMANDS", PC_PERM_USE_ALL_COMMANDS, false, false);
+ script->set_constant("PERM_RECEIVE_REQUESTS", PC_PERM_RECEIVE_REQUESTS, false, false);
+ script->set_constant("PERM_SHOW_BOSS", PC_PERM_SHOW_BOSS, false, false);
+ script->set_constant("PERM_DISABLE_PVM", PC_PERM_DISABLE_PVM, false, false);
+ script->set_constant("PERM_DISABLE_PVP", PC_PERM_DISABLE_PVP, false, false);
+ script->set_constant("PERM_DISABLE_CMD_DEAD", PC_PERM_DISABLE_CMD_DEAD, false, false);
+ script->set_constant("PERM_HCHSYS_ADMIN", PC_PERM_HCHSYS_ADMIN, false, false);
+ script->set_constant("PERM_TRADE_BOUND", PC_PERM_TRADE_BOUND, false, false);
+ script->set_constant("PERM_DISABLE_PICK_UP", PC_PERM_DISABLE_PICK_UP, false, false);
+ script->set_constant("PERM_DISABLE_STORE", PC_PERM_DISABLE_STORE, false, false);
+ script->set_constant("PERM_DISABLE_EXP", PC_PERM_DISABLE_EXP, false, false);
+ script->set_constant("PERM_DISABLE_SKILL_USAGE", PC_PERM_DISABLE_SKILL_USAGE, false, false);
+
script->constdb_comment("Renewal");
#ifdef RENEWAL
script->set_constant("RENEWAL", 1, false, false);
@@ -20985,7 +24165,8 @@ void script_hardcoded_constants(void)
/**
* a mapindex_name2id wrapper meant to help with invalid name handling
**/
-unsigned short script_mapindexname2id (struct script_state *st, const char* name) {
+unsigned short script_mapindexname2id (struct script_state *st, const char* name)
+{
unsigned short index;
if( !(index=mapindex->name2id(name)) ) {
@@ -20995,7 +24176,8 @@ unsigned short script_mapindexname2id (struct script_state *st, const char* name
return index;
}
-void script_defaults(void) {
+void script_defaults(void)
+{
// aegis->athena slot position conversion table
unsigned int equip[SCRIPT_EQUIP_TABLE_SIZE] = {EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_GARMENT,EQP_SHOES,EQP_ACC_L,EQP_ACC_R,EQP_HEAD_MID,EQP_HEAD_LOW,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_GARMENT,EQP_SHADOW_ARMOR, EQP_SHADOW_WEAPON, EQP_SHADOW_SHIELD, EQP_SHADOW_SHOES, EQP_SHADOW_ACC_R, EQP_SHADOW_ACC_L};
@@ -21028,8 +24210,8 @@ void script_defaults(void) {
script->label_count = 0;
script->labels_size = 0;
- script->buf = NULL;
- script->pos = 0, script->size = 0;
+ VECTOR_INIT(script->buf);
+ VECTOR_INIT(script->translation_buf);
script->parse_options = 0;
script->buildin_set_ref = 0;
@@ -21087,14 +24269,17 @@ void script_defaults(void) {
script->get_val = get_val;
script->get_val2 = get_val2;
script->get_val_ref_str = get_val_npcscope_str;
+ script->get_val_pc_ref_str = get_val_pc_ref_str;
script->get_val_scope_str = get_val_npcscope_str;
script->get_val_npc_str = get_val_npcscope_str;
script->get_val_instance_str = get_val_instance_str;
script->get_val_ref_num = get_val_npcscope_num;
+ script->get_val_pc_ref_num = get_val_pc_ref_num;
script->get_val_scope_num = get_val_npcscope_num;
script->get_val_npc_num = get_val_npcscope_num;
script->get_val_instance_num = get_val_instance_num;
script->push_str = push_str;
+ script->push_conststr = push_conststr;
script->push_copy = push_copy;
script->pop_stack = pop_stack;
script->set_constant = script_set_constant;
@@ -21154,18 +24339,26 @@ void script_defaults(void) {
script->parse_nextline = parse_nextline;
script->parse_variable = parse_variable;
script->parse_simpleexpr = parse_simpleexpr;
+ script->parse_simpleexpr_paren = parse_simpleexpr_paren;
+ script->parse_simpleexpr_number = parse_simpleexpr_number;
+ script->parse_simpleexpr_string = parse_simpleexpr_string;
+ script->parse_simpleexpr_name = parse_simpleexpr_name;
+ script->add_translatable_string = script_add_translatable_string;
script->parse_expr = parse_expr;
script->parse_line = parse_line;
script->read_constdb = read_constdb;
script->constdb_comment = script_constdb_comment;
+ script->load_parameters = script_load_parameters;
script->print_line = script_print_line;
script->errorwarning_sub = script_errorwarning_sub;
script->set_reg = set_reg;
script->set_reg_ref_str = set_reg_npcscope_str;
+ script->set_reg_pc_ref_str = set_reg_pc_ref_str;
script->set_reg_scope_str = set_reg_npcscope_str;
script->set_reg_npc_str = set_reg_npcscope_str;
script->set_reg_instance_str = set_reg_instance_str;
script->set_reg_ref_num = set_reg_npcscope_num;
+ script->set_reg_pc_ref_num = set_reg_pc_ref_num;
script->set_reg_scope_num = set_reg_npcscope_num;
script->set_reg_npc_num = set_reg_npcscope_num;
script->set_reg_instance_num = set_reg_instance_num;
@@ -21209,8 +24402,8 @@ void script_defaults(void) {
script->getfuncname = script_getfuncname;
/* script_config base */
- script->config.warn_func_mismatch_argtypes = 1;
- script->config.warn_func_mismatch_paramnum = 1;
+ script->config.warn_func_mismatch_argtypes = true;
+ script->config.warn_func_mismatch_paramnum = true;
script->config.check_cmdcount = 65535;
script->config.check_gotocount = 2048;
script->config.input_min_value = 0;
@@ -21272,6 +24465,7 @@ void script_defaults(void) {
script->mapindexname2id = script_mapindexname2id;
script->string_dup = script_string_dup;
script->load_translations = script_load_translations;
+ script->load_translation_addstring = script_load_translation_addstring;
script->load_translation = script_load_translation;
script->translation_db_destroyer = script_translation_db_destroyer;
script->clear_translations = script_clear_translations;
diff --git a/src/map/script.h b/src/map/script.h
index 351ccd02a..fddcf4908 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -25,7 +25,6 @@
#include "common/hercules.h"
#include "common/db.h"
#include "common/mmo.h" // struct item
-#include "common/sql.h" // Sql
#include "common/strlib.h" //StringBuf
#include <errno.h>
@@ -34,6 +33,7 @@
/**
* Declarations
**/
+struct Sql; // common/sql.h
struct eri;
struct item_data;
@@ -94,11 +94,11 @@ struct item_data;
/// Pushes an int into the stack
#define script_pushint(st,val) (script->push_val((st)->stack, C_INT, (val),NULL))
/// Pushes a string into the stack (script engine frees it automatically)
-#define script_pushstr(st,val) (script->push_str((st)->stack, C_STR, (val)))
+#define script_pushstr(st,val) (script->push_str((st)->stack, (val)))
/// Pushes a copy of a string into the stack
-#define script_pushstrcopy(st,val) (script->push_str((st)->stack, C_STR, aStrdup(val)))
+#define script_pushstrcopy(st,val) (script->push_str((st)->stack, aStrdup(val)))
/// Pushes a constant string into the stack (must never change or be freed)
-#define script_pushconststr(st,val) (script->push_str((st)->stack, C_CONSTSTR, (val)))
+#define script_pushconststr(st,val) (script->push_conststr((st)->stack, (val)))
/// Pushes a nil into the stack
#define script_pushnil(st) (script->push_val((st)->stack, C_NOP, 0,NULL))
/// Pushes a copy of the data in the target index
@@ -235,6 +235,7 @@ typedef enum c_op {
C_SUB_PRE, // --a
C_RE_EQ, // ~=
C_RE_NE, // ~!
+ C_POW, // **
} c_op;
/// Script queue options
@@ -338,13 +339,99 @@ enum {
MF_NOVIEWID
};
+enum navigation_service {
+ NAV_NONE = 0,
+ NAV_AIRSHIP_ONLY = 1,
+ NAV_SCROLL_ONLY = 10,
+ NAV_AIRSHIP_AND_SCROLL = NAV_AIRSHIP_ONLY + NAV_SCROLL_ONLY, //11
+ NAV_KAFRA_ONLY = 100,
+ NAV_KAFRA_AND_AIRSHIP = NAV_KAFRA_ONLY + NAV_AIRSHIP_ONLY, // 101
+ NAV_KAFRA_AND_SCROLL = NAV_KAFRA_ONLY + NAV_SCROLL_ONLY, // 110
+ NAV_ALL = NAV_AIRSHIP_ONLY + NAV_SCROLL_ONLY + NAV_KAFRA_ONLY // 111-255
+};
+
+/**
+ * Unit Types for script handling.
+ */
+enum script_unit_types {
+ UNIT_PC = 0,
+ UNIT_NPC,
+ UNIT_PET,
+ UNIT_MOB,
+ UNIT_HOM,
+ UNIT_MER,
+ UNIT_ELEM,
+};
+
+/**
+ * Unit Data Types for script handling.
+ */
+enum script_unit_data_types {
+ UDT_TYPE = 0,
+ UDT_SIZE,
+ UDT_LEVEL,
+ UDT_HP,
+ UDT_MAXHP,
+ UDT_SP,
+ UDT_MAXSP,
+ UDT_MASTERAID,
+ UDT_MASTERCID,
+ UDT_MAPIDXY,
+ UDT_WALKTOXY,
+ UDT_SPEED,
+ UDT_MODE,
+ UDT_AI,
+ UDT_SCOPTION,
+ UDT_SEX,
+ UDT_CLASS,
+ UDT_HAIRSTYLE,
+ UDT_HAIRCOLOR,
+ UDT_HEADBOTTOM,
+ UDT_HEADMIDDLE,
+ UDT_HEADTOP,
+ UDT_CLOTHCOLOR,
+ UDT_SHIELD,
+ UDT_WEAPON,
+ UDT_LOOKDIR,
+ UDT_CANMOVETICK,
+ UDT_STR,
+ UDT_AGI,
+ UDT_VIT,
+ UDT_INT,
+ UDT_DEX,
+ UDT_LUK,
+ UDT_ATKRANGE,
+ UDT_ATKMIN,
+ UDT_ATKMAX,
+ UDT_MATKMIN,
+ UDT_MATKMAX,
+ UDT_DEF,
+ UDT_MDEF,
+ UDT_HIT,
+ UDT_FLEE,
+ UDT_PDODGE,
+ UDT_CRIT,
+ UDT_RACE,
+ UDT_ELETYPE,
+ UDT_ELELEVEL,
+ UDT_AMOTION,
+ UDT_ADELAY,
+ UDT_DMOTION,
+ UDT_HUNGER,
+ UDT_INTIMACY,
+ UDT_LIFETIME,
+ UDT_MERC_KILLCOUNT,
+ UDT_STATPOINT,
+ UDT_MAX
+};
+
/**
* Structures
**/
struct Script_Config {
- unsigned warn_func_mismatch_argtypes : 1;
- unsigned warn_func_mismatch_paramnum : 1;
+ bool warn_func_mismatch_argtypes;
+ bool warn_func_mismatch_paramnum;
int check_cmdcount;
int check_gotocount;
int input_min_value;
@@ -380,21 +467,34 @@ struct script_retinfo {
int defsp; ///< default stack pointer
};
+/**
+ * Represents a variable in the script stack.
+ */
struct script_data {
- enum c_op type;
+ enum c_op type; ///< Data type
union script_data_val {
- int64 num;
- char *str;
- struct script_retinfo* ri;
- } u;
- struct reg_db *ref;
+ int64 num; ///< Numeric data
+ char *mutstr; ///< Mutable string
+ const char *str; ///< Constant string
+ struct script_retinfo *ri; ///< Function return information
+ } u; ///< Data (field depends on `type`)
+ struct reg_db *ref; ///< Reference to the scope's variables
};
+/**
+ * A script string buffer, used to hold strings used by the script engine.
+ */
+VECTOR_STRUCT_DECL(script_string_buf, char);
+
+/**
+ * Script buffer, used to hold parsed script data.
+ */
+VECTOR_STRUCT_DECL(script_buf, unsigned char);
+
// Moved defsp from script_state to script_stack since
// it must be saved when script state is RERUNLINE. [Eoe / jA 1094]
struct script_code {
- int script_size;
- unsigned char *script_buf;
+ struct script_buf script_buf;
struct reg_db local; ///< Local (npc) vars
unsigned short instances;
};
@@ -489,9 +589,9 @@ struct script_syntax_data {
int index; // Number of the syntax used in the script
int last_func; // buildin index of the last parsed function
unsigned int nested_call; //Dont really know what to call this
- bool lang_macro_active;
- DBMap *strings; // string map parsed (used when exporting strings only)
- DBMap *translation_db; //non-null if this npc has any translated strings to be linked
+ bool lang_macro_active; // Used to generate translation strings
+ bool lang_macro_fmtstring_active; // Used to generate translation strings
+ struct DBMap *translation_db; //non-null if this npc has any translated strings to be linked
};
struct casecheck_data {
@@ -513,16 +613,16 @@ struct script_array {
unsigned int *members;/* member list */
};
-struct script_string_buf {
- char *ptr;
- size_t pos,size;
+struct string_translation_entry {
+ uint8 lang_id;
+ char string[];
};
struct string_translation {
int string_id;
uint8 translations;
- unsigned int len;
- char *buf;
+ int len;
+ uint8 *buf; // Array of struct string_translation_entry
};
/**
@@ -530,7 +630,7 @@ struct string_translation {
**/
struct script_interface {
/* */
- DBMap *st_db;
+ struct DBMap *st_db;
unsigned int active_scripts;
unsigned int next_id;
struct eri *st_ers;
@@ -572,8 +672,7 @@ struct script_interface {
/* */
/// temporary buffer for passing around compiled bytecode
/// @see add_scriptb, set_label, parse_script
- unsigned char* buf;
- int pos, size;
+ struct script_buf buf;
/* */
struct script_syntax_data syntax;
/* */
@@ -598,8 +697,8 @@ struct script_interface {
/* */
/* Caches compiled autoscript item code. */
/* Note: This is not cleared when reloading itemdb. */
- DBMap* autobonus_db; // char* script -> char* bytecode
- DBMap* userfunc_db; // const char* func_name -> struct script_code*
+ struct DBMap *autobonus_db; // char* script -> char* bytecode
+ struct DBMap *userfunc_db; // const char* func_name -> struct script_code*
/* */
int potion_flag; //For use on Alchemist improved potions/Potion Pitcher. [Skotlex]
int potion_hp, potion_per_hp, potion_sp, potion_per_sp;
@@ -607,26 +706,22 @@ struct script_interface {
/* */
unsigned int *generic_ui_array;
unsigned int generic_ui_array_size;
- /* Set during startup when attempting to export the lang, unset after server initialization is over */
- FILE *lang_export_fp;
- char *lang_export_file;/* for lang_export_fp */
/* set and unset on npc_parse_script */
const char *parser_current_npc_name;
/* */
int buildin_mes_offset;
+ int buildin_mesf_offset;
int buildin_select_offset;
int buildin_lang_macro_offset;
+ int buildin_lang_macro_fmtstring_offset;
/* */
- DBMap *translation_db;/* npc_name => DBMap (strings) */
- char **translation_buf;/* */
- uint32 translation_buf_size;
+ struct DBMap *translation_db;/* npc_name => DBMap (strings) */
+ VECTOR_DECL(uint8 *) translation_buf;
/* */
char **languages;
uint8 max_lang_id;
/* */
- struct script_string_buf parse_simpleexpr_str;
- struct script_string_buf lang_export_line_buf;
- struct script_string_buf lang_export_unescaped_buf;
+ struct script_string_buf parse_simpleexpr_strbuf;
/* */
int parse_cleanup_timer_id;
/* */
@@ -653,16 +748,19 @@ struct script_interface {
struct script_data* (*push_val)(struct script_stack* stack, enum c_op type, int64 val, struct reg_db *ref);
struct script_data *(*get_val) (struct script_state* st, struct script_data* data);
char* (*get_val_ref_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ char* (*get_val_pc_ref_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
char* (*get_val_scope_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
char* (*get_val_npc_str) (struct script_state* st, struct reg_db *n, struct script_data* data);
char* (*get_val_instance_str) (struct script_state* st, const char* name, struct script_data* data);
int (*get_val_ref_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
+ int (*get_val_pc_ref_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
int (*get_val_scope_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
int (*get_val_npc_num) (struct script_state* st, struct reg_db *n, struct script_data* data);
int (*get_val_instance_num) (struct script_state* st, const char* name, struct script_data* data);
- void* (*get_val2) (struct script_state* st, int64 uid, struct reg_db *ref);
- struct script_data* (*push_str) (struct script_stack* stack, enum c_op type, char* str);
- struct script_data* (*push_copy) (struct script_stack* stack, int pos);
+ const void *(*get_val2) (struct script_state *st, int64 uid, struct reg_db *ref);
+ struct script_data *(*push_str) (struct script_stack *stack, char *str);
+ struct script_data *(*push_conststr) (struct script_stack *stack, const char *str);
+ struct script_data *(*push_copy) (struct script_stack *stack, int pos);
void (*pop_stack) (struct script_state* st, int start, int end);
void (*set_constant) (const char *name, int value, bool is_parameter, bool is_deprecated);
void (*set_constant2) (const char *name, int value, bool is_parameter, bool is_deprecated);
@@ -683,11 +781,11 @@ struct script_interface {
void (*run_autobonus) (const char *autobonus,int id, int pos);
void (*cleararray_pc) (struct map_session_data* sd, const char* varname, void* value);
void (*setarray_pc) (struct map_session_data* sd, const char* varname, uint32 idx, void* value, int* refcache);
- int (*config_read) (char *cfgName);
+ bool (*config_read) (const char *filename, bool imported);
int (*add_str) (const char* p);
const char* (*get_str) (int id);
int (*search_str) (const char* p);
- void (*setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, void *value, struct reg_db *ref);
+ void (*setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref);
void (*attach_state) (struct script_state* st);
/* */
struct script_queue *(*queue) (int idx);
@@ -701,8 +799,8 @@ struct script_interface {
const char * (*parse_syntax_close) (const char *p);
const char * (*parse_syntax_close_sub) (const char *p, int *flag);
const char * (*parse_syntax) (const char *p);
- c_op (*get_com) (unsigned char *scriptbuf, int *pos);
- int (*get_num) (unsigned char *scriptbuf, int *pos);
+ c_op (*get_com) (const struct script_buf *scriptbuf, int *pos);
+ int (*get_num) (const struct script_buf *scriptbuf, int *pos);
const char* (*op2name) (int op);
void (*reportsrc) (struct script_state *st);
void (*reportdata) (struct script_data *data);
@@ -719,20 +817,28 @@ struct script_interface {
int (*add_word) (const char *p);
const char* (*parse_callfunc) (const char *p, int require_paren, int is_custom);
void (*parse_nextline) (bool first, const char *p);
- const char* (*parse_variable) (const char *p);
- const char* (*parse_simpleexpr) (const char *p);
- const char* (*parse_expr) (const char *p);
- const char* (*parse_line) (const char *p);
+ const char *(*parse_variable) (const char *p);
+ const char *(*parse_simpleexpr) (const char *p);
+ const char *(*parse_simpleexpr_paren) (const char *p);
+ const char *(*parse_simpleexpr_number) (const char *p);
+ const char *(*parse_simpleexpr_string) (const char *p);
+ const char *(*parse_simpleexpr_name) (const char *p);
+ void (*add_translatable_string) (const struct script_string_buf *string, const char *start_point);
+ const char *(*parse_expr) (const char *p);
+ const char *(*parse_line) (const char *p);
void (*read_constdb) (void);
void (*constdb_comment) (const char *comment);
+ void (*load_parameters) (void);
const char* (*print_line) (StringBuf *buf, const char *p, const char *mark, int line);
void (*errorwarning_sub) (StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
int (*set_reg) (struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref);
void (*set_reg_ref_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
+ void (*set_reg_pc_ref_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
void (*set_reg_scope_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
void (*set_reg_npc_str) (struct script_state* st, struct reg_db *n, int64 num, const char* name, const char *str);
void (*set_reg_instance_str) (struct script_state* st, int64 num, const char* name, const char *str);
void (*set_reg_ref_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
+ void (*set_reg_pc_ref_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
void (*set_reg_scope_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
void (*set_reg_npc_num) (struct script_state* st, struct reg_db *n, int64 num, const char* name, int val);
void (*set_reg_instance_num) (struct script_state* st, int64 num, const char* name, int val);
@@ -743,9 +849,9 @@ struct script_interface {
void (*op_2num) (struct script_state *st, int op, int i1, int i2);
void (*op_2) (struct script_state *st, int op);
void (*op_1) (struct script_state *st, int op);
- void (*check_buildin_argtype) (struct script_state *st, int func);
+ bool (*check_buildin_argtype) (struct script_state *st, int func);
void (*detach_state) (struct script_state *st, bool dequeue_event);
- int (*db_free_code_sub) (DBKey key, DBData *data, va_list ap);
+ int (*db_free_code_sub) (union DBKey key, struct DBData *data, va_list ap);
void (*add_autobonus) (const char *autobonus);
int (*menu_countoptions) (const char *str, int max_count, int *total);
int (*buildin_areawarp_sub) (struct block_list *bl, va_list ap);
@@ -767,7 +873,7 @@ struct script_interface {
int (*playbgm_sub) (struct block_list *bl, va_list ap);
int (*playbgm_foreachpc_sub) (struct map_session_data *sd, va_list args);
int (*soundeffect_sub) (struct block_list *bl, va_list ap);
- int (*buildin_query_sql_sub) (struct script_state *st, Sql *handle);
+ int (*buildin_query_sql_sub) (struct script_state *st, struct Sql *handle);
int (*buildin_instance_warpall_sub) (struct block_list *bl, va_list ap);
int (*buildin_mobuseskill_sub) (struct block_list *bl, va_list ap);
int (*cleanfloor_sub) (struct block_list *bl, va_list ap);
@@ -788,11 +894,11 @@ struct script_interface {
void (*array_add_member) (struct script_array *sa, unsigned int idx);
unsigned int (*array_size) (struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
unsigned int (*array_highest_key) (struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
- int (*array_free_db) (DBKey key, DBData *data, va_list ap);
+ int (*array_free_db) (union DBKey key, struct DBData *data, va_list ap);
void (*array_ensure_zero) (struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref);
/* */
void (*reg_destroy_single) (struct map_session_data *sd, int64 reg, struct script_reg_state *data);
- int (*reg_destroy) (DBKey key, DBData *data, va_list ap);
+ int (*reg_destroy) (union DBKey key, struct DBData *data, va_list ap);
/* */
void (*generic_ui_array_expand) (unsigned int plus);
unsigned int *(*array_cpy_list) (struct script_array *sa);
@@ -801,8 +907,9 @@ struct script_interface {
unsigned short (*mapindexname2id) (struct script_state *st, const char* name);
int (*string_dup) (char *str);
void (*load_translations) (void);
- void (*load_translation) (const char *file, uint8 lang_id, uint32 *total);
- int (*translation_db_destroyer) (DBKey key, DBData *data, va_list ap);
+ bool (*load_translation_addstring) (const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr);
+ int (*load_translation) (const char *file, uint8 lang_id);
+ int (*translation_db_destroyer) (union DBKey key, struct DBData *data, va_list ap);
void (*clear_translations) (bool reload);
int (*parse_cleanup_timer) (int tid, int64 tick, int id, intptr_t data);
uint8 (*add_language) (const char *name);
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index 560063e8b..16d8ce130 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -27,6 +27,7 @@
#include "map/pc.h" // struct map_session_data
#include "common/cbasetypes.h"
#include "common/memmgr.h" // aMalloc, aRealloc, aFree
+#include "common/nullpo.h" // nullpo_*
#include "common/showmsg.h" // ShowError, ShowWarning
#include "common/strlib.h" // safestrncpy
@@ -34,7 +35,8 @@ struct searchstore_interface searchstore_s;
struct searchstore_interface *searchstore;
/// retrieves search function by type
-static inline searchstore_search_t searchstore_getsearchfunc(unsigned char type) {
+static inline searchstore_search_t searchstore_getsearchfunc(unsigned char type)
+{
switch( type ) {
case SEARCHTYPE_VENDING: return vending->search;
case SEARCHTYPE_BUYING_STORE: return buyingstore->search;
@@ -42,9 +44,9 @@ static inline searchstore_search_t searchstore_getsearchfunc(unsigned char type)
return NULL;
}
-
/// retrieves search-all function by type
-static inline searchstore_searchall_t searchstore_getsearchallfunc(unsigned char type) {
+static inline searchstore_searchall_t searchstore_getsearchallfunc(unsigned char type)
+{
switch( type ) {
case SEARCHTYPE_VENDING: return vending->searchall;
case SEARCHTYPE_BUYING_STORE: return buyingstore->searchall;
@@ -52,9 +54,10 @@ static inline searchstore_searchall_t searchstore_getsearchallfunc(unsigned char
return NULL;
}
-
/// checks if the player has a store by type
-static inline bool searchstore_hasstore(struct map_session_data* sd, unsigned char type) {
+static inline bool searchstore_hasstore(struct map_session_data* sd, unsigned char type)
+{
+ nullpo_retr(false, sd);
switch( type ) {
case SEARCHTYPE_VENDING: return sd->state.vending;
case SEARCHTYPE_BUYING_STORE: return sd->state.buyingstore;
@@ -62,9 +65,10 @@ static inline bool searchstore_hasstore(struct map_session_data* sd, unsigned ch
return false;
}
-
/// returns player's store id by type
-static inline unsigned int searchstore_getstoreid(struct map_session_data* sd, unsigned char type) {
+static inline unsigned int searchstore_getstoreid(struct map_session_data* sd, unsigned char type)
+{
+ nullpo_retr(false, sd);
switch( type ) {
case SEARCHTYPE_VENDING: return sd->vender_id;
case SEARCHTYPE_BUYING_STORE: return sd->buyer_id;
@@ -72,8 +76,9 @@ static inline unsigned int searchstore_getstoreid(struct map_session_data* sd, u
return 0;
}
-
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect) {
+bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect)
+{
+ nullpo_retr(false, sd);
if( !battle_config.feature_search_stores || sd->searchstore.open ) {
return false;
}
@@ -91,7 +96,6 @@ bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned s
return true;
}
-
void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short* itemlist, unsigned int item_count, const unsigned short* cardlist, unsigned int card_count)
{
unsigned int i;
@@ -105,6 +109,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
return;
}
+ nullpo_retv(sd);
if( !sd->searchstore.open ) {
return;
}
@@ -126,6 +131,9 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
return;
}
+ nullpo_retv(itemlist);
+ nullpo_retv(cardlist);
+
// validate lists
for( i = 0; i < item_count; i++ ) {
if( !itemdb->exists(itemlist[i]) ) {
@@ -200,9 +208,10 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
}
}
-
/// checks whether or not more results are available for the client
-bool searchstore_querynext(struct map_session_data* sd) {
+bool searchstore_querynext(struct map_session_data* sd)
+{
+ nullpo_retr(false, sd);
if( sd->searchstore.count && ( sd->searchstore.count-1 )/SEARCHSTORE_RESULTS_PER_PAGE < sd->searchstore.pages ) {
return true;
}
@@ -210,8 +219,9 @@ bool searchstore_querynext(struct map_session_data* sd) {
return false;
}
-
-void searchstore_next(struct map_session_data* sd) {
+void searchstore_next(struct map_session_data* sd)
+{
+ nullpo_retv(sd);
if( !battle_config.feature_search_stores || !sd->searchstore.open || sd->searchstore.count <= sd->searchstore.pages*SEARCHSTORE_RESULTS_PER_PAGE )
{// nothing (more) to display
return;
@@ -224,8 +234,9 @@ void searchstore_next(struct map_session_data* sd) {
sd->searchstore.pages++;
}
-
-void searchstore_clear(struct map_session_data* sd) {
+void searchstore_clear(struct map_session_data* sd)
+{
+ nullpo_retv(sd);
searchstore->clearremote(sd);
if( sd->searchstore.items ) {// release results
@@ -237,8 +248,9 @@ void searchstore_clear(struct map_session_data* sd) {
sd->searchstore.pages = 0;
}
-
-void searchstore_close(struct map_session_data* sd) {
+void searchstore_close(struct map_session_data* sd)
+{
+ nullpo_retv(sd);
if( sd->searchstore.open ) {
searchstore->clear(sd);
@@ -247,12 +259,13 @@ void searchstore_close(struct map_session_data* sd) {
}
}
-
-void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid) {
+void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid)
+{
unsigned int i;
struct map_session_data* pl_sd;
searchstore_search_t store_search;
+ nullpo_retv(sd);
if( !battle_config.feature_search_stores || !sd->searchstore.open || !sd->searchstore.count ) {
return;
}
@@ -313,27 +326,30 @@ void searchstore_click(struct map_session_data* sd, int account_id, int store_id
}
}
-
/// checks whether or not sd has opened account_id's shop remotely
-bool searchstore_queryremote(struct map_session_data* sd, int account_id) {
+bool searchstore_queryremote(struct map_session_data* sd, int account_id)
+{
+ nullpo_retr(false, sd);
return (bool)( sd->searchstore.open && sd->searchstore.count && sd->searchstore.remote_id == account_id );
}
-
/// removes range-check bypassing for remotely opened stores
void searchstore_clearremote(struct map_session_data* sd) {
+ nullpo_retv(sd);
sd->searchstore.remote_id = 0;
}
-
/// receives results from a store-specific callback
bool searchstore_result(struct map_session_data* sd, unsigned int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine)
{
struct s_search_store_info_item* ssitem;
+ nullpo_retr(false, sd);
if( sd->searchstore.count >= (unsigned int)battle_config.searchstore_maxresults ) {// no more
return false;
}
+ nullpo_retr(false, store_name);
+ nullpo_retr(false, card);
ssitem = &sd->searchstore.items[sd->searchstore.count++];
ssitem->store_id = store_id;
@@ -348,7 +364,8 @@ bool searchstore_result(struct map_session_data* sd, unsigned int store_id, int
return true;
}
-void searchstore_defaults (void) {
+void searchstore_defaults (void)
+{
searchstore = &searchstore_s;
searchstore->open = searchstore_open;
diff --git a/src/map/searchstore.h b/src/map/searchstore.h
index 8edfcd2a8..2d1de7e55 100644
--- a/src/map/searchstore.h
+++ b/src/map/searchstore.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/skill.c b/src/map/skill.c
index b4ce4e227..e187b7e8b 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2016 Hercules Dev Team
+ * Copyright (C) 2012-2017 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -54,6 +54,7 @@
#include "common/strlib.h"
#include "common/timer.h"
#include "common/utils.h"
+#include "common/conf.h"
#include <math.h>
#include <stdio.h>
@@ -83,7 +84,9 @@ struct s_skill_dbs skilldbs;
struct skill_interface *skill;
//Since only mob-casted splash skills can hit ice-walls
-static inline int splash_target(struct block_list* bl) {
+int skill_splash_target(struct block_list* bl)
+{
+ nullpo_retr(BL_CHAR, bl);
#ifndef RENEWAL
return ( bl->type == BL_MOB ) ? BL_SKILL|BL_CHAR : BL_CHAR;
#else // Some skills can now hit ground skills(traps, ice wall & etc.)
@@ -92,7 +95,8 @@ static inline int splash_target(struct block_list* bl) {
}
/// Returns the id of the skill, or 0 if not found.
-int skill_name2id(const char* name) {
+int skill_name2id(const char* name)
+{
if( name == NULL )
return 0;
@@ -101,7 +105,8 @@ int skill_name2id(const char* name) {
/// Maps skill ids to skill db offsets.
/// Returns the skill's array index, or 0 (Unknown Skill).
-int skill_get_index( uint16 skill_id ) {
+int skill_get_index (uint16 skill_id)
+{
// avoid ranges reserved for mapping guild/homun/mercenary skills
if( (skill_id >= GD_SKILLRANGEMIN && skill_id <= GD_SKILLRANGEMAX)
|| (skill_id >= HM_SKILLRANGEMIN && skill_id <= HM_SKILLRANGEMAX)
@@ -126,7 +131,7 @@ int skill_get_index( uint16 skill_id ) {
skill_id = (1077) + skill_id - 2201;
else if ( skill_id < 3036 ) // 2549 - 3000 are empty - 1020+57+348
skill_id = (1425) + skill_id - 3001;
- else if ( skill_id < 5019 ) // 3036 - 5000 are empty - 1020+57+348+35
+ else if ( skill_id < 5044 ) // 3036 - 5000 are empty - 1020+57+348+35
skill_id = (1460) + skill_id - 5001;
else
ShowWarning("skill_get_index: skill id '%d' is not being handled!\n",skill_id);
@@ -213,19 +218,21 @@ int skill_get_fixed_cast( uint16 skill_id ,uint16 skill_lv ) {
return 0;
#endif
}
-int skill_tree_get_max(uint16 skill_id, int b_class)
+
+int skill_tree_get_max(uint16 skill_id, int class)
{
int i;
- b_class = pc->class2idx(b_class);
+ int class_idx = pc->class2idx(class);
- ARR_FIND( 0, MAX_SKILL_TREE, i, pc->skill_tree[b_class][i].id == 0 || pc->skill_tree[b_class][i].id == skill_id );
- if( i < MAX_SKILL_TREE && pc->skill_tree[b_class][i].id == skill_id )
- return pc->skill_tree[b_class][i].max;
+ ARR_FIND( 0, MAX_SKILL_TREE, i, pc->skill_tree[class_idx][i].id == 0 || pc->skill_tree[class_idx][i].id == skill_id );
+ if( i < MAX_SKILL_TREE && pc->skill_tree[class_idx][i].id == skill_id )
+ return pc->skill_tree[class_idx][i].max;
else
return skill->get_max(skill_id);
}
-int skill_get_casttype (uint16 skill_id) {
+int skill_get_casttype(uint16 skill_id)
+{
int inf = skill->get_inf(skill_id);
if (inf&(INF_GROUND_SKILL))
return CAST_GROUND;
@@ -241,8 +248,11 @@ int skill_get_casttype (uint16 skill_id) {
return CAST_DAMAGE;
}
-int skill_get_casttype2 (uint16 index) {
- int inf = skill->dbs->db[index].inf;
+int skill_get_casttype2(uint16 index)
+{
+ int inf;
+ Assert_retr(CAST_NODAMAGE, index < MAX_SKILL_DB);
+ inf = skill->dbs->db[index].inf;
if (inf&(INF_GROUND_SKILL))
return CAST_GROUND;
if (inf&INF_SUPPORT_SKILL)
@@ -258,7 +268,8 @@ int skill_get_casttype2 (uint16 index) {
}
//Returns actual skill range taking into account attack range and AC_OWL [Skotlex]
-int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
+int skill_get_range2(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
+{
int range;
struct map_session_data *sd = BL_CAST(BL_PC, bl);
if( bl->type == BL_MOB && battle_config.mob_ai&0x400 )
@@ -292,7 +303,7 @@ int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
if (sd != NULL)
range += pc->checkskill(sd, AC_VULTURE);
else
- range += 10; //Assume level 10?
+ range += battle->bc->mob_eye_range_bonus;
break;
// added to allow GS skills to be effected by the range of Snake Eyes [Reddozen]
case GS_RAPIDSHOWER:
@@ -303,7 +314,7 @@ int skill_get_range2 (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
if (sd != NULL)
range += pc->checkskill(sd, GS_SNAKEEYE);
else
- range += 10; //Assume level 10?
+ range += battle->bc->mob_eye_range_bonus;
break;
case NJ_KIRIKAGE:
if (sd != NULL)
@@ -354,7 +365,10 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
nullpo_ret(src);
- switch( skill_id ) {
+ switch (skill_id) {
+ case SU_TUNABELLY:
+ hp = status_get_max_hp(target) * ((20 * skill_lv) - 10) / 100;
+ break;
case BA_APPLEIDUN:
#ifdef RENEWAL
hp = 100+5*skill_lv+5*(status_get_vit(src)/10); // HP recovery
@@ -386,6 +400,11 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
hp += hp * skill2_lv * 2 / 100;
else if (src->type == BL_HOM && (skill2_lv = homun->checkskill(BL_UCAST(BL_HOM, src), HLIF_BRAIN)) > 0)
hp += hp * skill2_lv * 2 / 100;
+ if (sd != NULL && ((skill2_lv = pc->checkskill(sd, SU_POWEROFSEA)) > 0)) {
+ hp += hp * 10 / 100;
+ if (pc->checkskill(sd, SU_TUNABELLY) == 5 && pc->checkskill(sd, SU_TUNAPARTY) == 5 && pc->checkskill(sd, SU_BUNCHOFSHRIMP) == 5 && pc->checkskill(sd, SU_FRESHSHRIMP) == 5)
+ hp += hp * 20 / 100;
+ }
break;
}
@@ -435,17 +454,19 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
// Making plagiarize check its own function [Aru]
int can_copy (struct map_session_data *sd, uint16 skill_id, struct block_list* bl)
{
+ nullpo_ret(sd);
// Never copy NPC/Wedding Skills
if (skill->get_inf2(skill_id)&(INF2_NPC_SKILL|INF2_WEDDING_SKILL))
return 0;
- // High-class skills
- if((skill_id >= LK_AURABLADE && skill_id <= ASC_CDP) || (skill_id >= ST_PRESERVE && skill_id <= CR_CULTIVATION))
- {
- if(battle_config.copyskill_restrict == 2)
+ // Transcendent-class skills
+ if((skill_id >= LK_AURABLADE && skill_id <= ASC_CDP) || (skill_id >= ST_PRESERVE && skill_id <= CR_CULTIVATION)) {
+ if (battle_config.copyskill_restrict == 2) {
return 0;
- else if(battle_config.copyskill_restrict)
- return (sd->status.class_ == JOB_STALKER);
+ } else if (battle_config.copyskill_restrict == 1) {
+ if ((sd->job & (MAPID_UPPERMASK | JOBL_UPPER)) != MAPID_STALKER)
+ return 0;
+ }
}
//Added so plagarize can't copy agi/bless if you're undead since it damages you
@@ -454,8 +475,11 @@ int can_copy (struct map_session_data *sd, uint16 skill_id, struct block_list* b
skill_id == MER_INCAGI || skill_id == MER_BLESSING))
return 0;
- // Couldn't preserve 3rd Class skills except only when using Reproduce skill. [Jobbie]
- if( !(sd->sc.data[SC__REPRODUCE]) && ((skill_id >= RK_ENCHANTBLADE && skill_id <= LG_OVERBRAND_PLUSATK) || (skill_id >= RL_GLITTERING_GREED && skill_id <= OB_AKAITSUKI) || (skill_id >= GC_DARKCROW && skill_id <= NC_MAGMA_ERUPTION_DOTDAMAGE)))
+ // Couldn't preserve 3rd Class/Summoner skills except only when using Reproduce skill. [Jobbie]
+ if (!(sd->sc.data[SC__REPRODUCE]) &&
+ ((skill_id >= RK_ENCHANTBLADE && skill_id <= LG_OVERBRAND_PLUSATK) ||
+ (skill_id >= RL_GLITTERING_GREED && skill_id <= OB_AKAITSUKI) ||
+ (skill_id >= GC_DARKCROW && skill_id <= SU_FRESHSHRIMP)))
return 0;
// Reproduce will only copy skills according on the list. [Jobbie]
else if( sd->sc.data[SC__REPRODUCE] && !skill->dbs->reproduce_db[skill->get_index(skill_id)] )
@@ -545,6 +569,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
clif->skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
return 1;
}
+ FALLTHROUGH
case MC_IDENTIFY:
return 0; // always allowed
case WZ_ICEWALL:
@@ -579,11 +604,20 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
return 1;
}
break;
-
+ default:
+ return skill->not_ok_unknown(skill_id, sd);
}
return (map->list[m].flag.noskill);
}
+int skill_notok_unknown(uint16 skill_id, struct map_session_data *sd)
+{
+ int16 m;
+ nullpo_retr (1, sd);
+ m = sd->bl.m;
+ return (map->list[m].flag.noskill);
+}
+
int skillnotok_hom(uint16 skill_id, struct homun_data *hd)
{
uint16 idx = skill->get_index(skill_id);
@@ -610,12 +644,21 @@ int skillnotok_hom(uint16 skill_id, struct homun_data *hd)
if(hd->sc.data[SC_GOLDENE_FERSE])
return 1;
break;
+ default:
+ return skill->not_ok_hom_unknown(skill_id, hd);
}
//Use master's criteria.
return skill->not_ok(skill_id, hd->master);
}
+int skillnotok_hom_unknown(uint16 skill_id, struct homun_data *hd)
+{
+ nullpo_retr(1, hd);
+ //Use master's criteria.
+ return skill->not_ok(skill_id, hd->master);
+}
+
int skillnotok_mercenary(uint16 skill_id, struct mercenary_data *md)
{
uint16 idx = skill->get_index(skill_id);
@@ -629,10 +672,12 @@ int skillnotok_mercenary(uint16 skill_id, struct mercenary_data *md)
return skill->not_ok(skill_id, md->master);
}
-struct s_skill_unit_layout* skill_get_unit_layout (uint16 skill_id, uint16 skill_lv, struct block_list* src, int x, int y) {
+struct s_skill_unit_layout* skill_get_unit_layout(uint16 skill_id, uint16 skill_lv, struct block_list* src, int x, int y)
+{
int pos = skill->get_unit_layout_type(skill_id,skill_lv);
uint8 dir;
+ nullpo_retr(&skill->dbs->unit_layout[0], src);
if (pos < -1 || pos >= MAX_SKILL_UNIT_LAYOUT) {
ShowError("skill_get_unit_layout: unsupported layout type %d for skill %d (level %d)\n", pos, skill_id, skill_lv);
pos = cap_value(pos, 0, MAX_SQUARE_LAYOUT); // cap to nearest square layout
@@ -869,6 +914,10 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
break;
#endif
+ case WZ_HEAVENDRIVE:
+ status_change_end(bl, SC_SV_ROOTTWIST, INVALID_TIMER);
+ break;
+
case WZ_STORMGUST:
/**
* Storm Gust counter was dropped in renewal
@@ -1102,8 +1151,8 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
break;
case TK_JUMPKICK:
- if( dstsd && dstsd->class_ != MAPID_SOUL_LINKER && !tsc->data[SC_PRESERVE] )
- {// debuff the following statuses
+ if (dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) != MAPID_SOUL_LINKER && tsc->data[SC_PRESERVE] == NULL) {
+ // debuff the following statuses
status_change_end(bl, SC_SOULLINK, INVALID_TIMER);
status_change_end(bl, SC_ADRENALINE2, INVALID_TIMER);
status_change_end(bl, SC_KAITE, INVALID_TIMER);
@@ -1382,6 +1431,25 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
case MH_XENO_SLASHER:
sc_start2(src, bl, SC_BLOODING, 10 * skill_lv, skill_lv, src->id, skill->get_time(skill_id,skill_lv));
break;
+ /**
+ * Summoner
+ */
+ case SU_SCRATCH:
+ sc_start2(src, bl, SC_BLOODING, (skill_lv * 3), skill_lv, src->id, skill->get_time(skill_id, skill_lv)); // TODO: What's the chance/time?
+ break;
+ case SU_SV_STEMSPEAR:
+ sc_start2(src, bl, SC_BLOODING, 10, skill_lv, src->id, skill->get_time(skill_id, skill_lv));
+ break;
+ case SU_CN_METEOR:
+ sc_start(src, bl, SC_CURSE, 10, skill_lv, skill->get_time2(skill_id, skill_lv)); // TODO: What's the chance/time?
+ break;
+ case SU_SCAROFTAROU:
+ sc_start(src, bl, SC_STUN, 10, skill_lv, skill->get_time2(skill_id, skill_lv)); // TODO: What's the chance/time?
+ break;
+ case SU_LUNATICCARROTBEAT:
+ if (skill->area_temp[3] == 1)
+ sc_start(src, bl, SC_STUN, 10, skill_lv, skill_get_time(skill_id, skill_lv)); // TODO: What's the chance/time?
+ break;
default:
skill->additional_effect_unknown(src, bl, &skill_id, &skill_lv, &attack_type, &dmg_lv, &tick);
break;
@@ -1546,17 +1614,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
sd->state.autocast = 1;
skill->consume_requirement(sd,temp,auto_skill_lv,1);
skill->toggle_magicpower(src, temp);
- switch (type) {
- case CAST_GROUND:
- skill->castend_pos2(src, tbl->x, tbl->y, temp, auto_skill_lv, tick, 0);
- break;
- case CAST_NODAMAGE:
- skill->castend_nodamage_id(src, tbl, temp, auto_skill_lv, tick, 0);
- break;
- case CAST_DAMAGE:
- skill->castend_damage_id(src, tbl, temp, auto_skill_lv, tick, 0);
- break;
- }
+ skill->castend_type(type, src, tbl, temp, auto_skill_lv, tick, 0);
sd->state.autocast = 0;
//Set canact delay. [Skotlex]
ud = unit->bl2ud(src);
@@ -1684,11 +1742,7 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1
sd->state.autocast = 1;
sd->autospell3[i].lock = true;
skill->consume_requirement(sd,temp,skill_lv,1);
- switch( type ) {
- case CAST_GROUND: skill->castend_pos2(&sd->bl, tbl->x, tbl->y, temp, skill_lv, tick, 0); break;
- case CAST_NODAMAGE: skill->castend_nodamage_id(&sd->bl, tbl, temp, skill_lv, tick, 0); break;
- case CAST_DAMAGE: skill->castend_damage_id(&sd->bl, tbl, temp, skill_lv, tick, 0); break;
- }
+ skill->castend_type(type, &sd->bl, tbl, temp, skill_lv, tick, 0);
sd->autospell3[i].lock = false;
sd->state.autocast = 0;
}
@@ -1789,7 +1843,7 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b
break;
}
- if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
+ if (sd != NULL && (sd->job & MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
&& rnd()%10000 < battle_config.sg_miracle_skill_ratio) // SG_MIRACLE [Komurka]
sc_start(src,src,SC_MIRACLE,100,1,battle_config.sg_miracle_skill_duration);
@@ -1898,17 +1952,7 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b
dstsd->state.autocast = 1;
skill->consume_requirement(dstsd,auto_skill_id,auto_skill_lv,1);
- switch (type) {
- case CAST_GROUND:
- skill->castend_pos2(bl, tbl->x, tbl->y, auto_skill_id, auto_skill_lv, tick, 0);
- break;
- case CAST_NODAMAGE:
- skill->castend_nodamage_id(bl, tbl, auto_skill_id, auto_skill_lv, tick, 0);
- break;
- case CAST_DAMAGE:
- skill->castend_damage_id(bl, tbl, auto_skill_id, auto_skill_lv, tick, 0);
- break;
- }
+ skill->castend_type(type, bl, tbl, auto_skill_id, auto_skill_lv, tick, 0);
dstsd->state.autocast = 0;
// Set canact delay. [Skotlex]
ud = unit->bl2ud(bl);
@@ -2005,7 +2049,7 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
if (sd) {
for (i = 0; i < EQI_MAX; i++) {
int j = sd->equip_index[i];
- if (j < 0 || sd->status.inventory[j].attribute == 1 || !sd->inventory_data[j])
+ if (j < 0 || (sd->status.inventory[j].attribute & ATTR_BROKEN) != 0 || !sd->inventory_data[j])
continue;
switch(i) {
@@ -2031,7 +2075,7 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
continue;
}
if (flag) {
- sd->status.inventory[j].attribute = 1;
+ sd->status.inventory[j].attribute |= ATTR_BROKEN;
pc->unequipitem(sd, j, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
}
}
@@ -2041,7 +2085,8 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
return where; //Return list of pieces broken.
}
-int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time) {
+int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time)
+{
struct status_change *sc;
const int pos[5] = {EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HELM, EQP_ACC};
const enum sc_type sc_atk[5] = {SC_NOEQUIPWEAPON, SC_NOEQUIPSHIELD, SC_NOEQUIPARMOR, SC_NOEQUIPHELM, SC__STRIPACCESSARY};
@@ -2067,21 +2112,25 @@ int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int
}
return where?1:0;
}
+
/*=========================================================================
- Used to knock back players, monsters, traps, etc
- - 'count' is the number of squares to knock back
- - 'direction' indicates the way OPPOSITE to the knockback direction (or -1 for default behavior)
- - if 'flag&0x1', position update packets must not be sent.
- - if 'flag&0x2', skill blown ignores players' special_state.no_knockback
- -------------------------------------------------------------------------*/
+ * Used to knock back players, monsters, traps, etc
+ * 'count' is the number of squares to knock back
+ * 'direction' indicates the way OPPOSITE to the knockback direction (or -1 for default behavior)
+ * if 'flag&0x1', position update packets must not be sent.
+ * if 'flag&0x2', skill blown ignores players' special_state.no_knockback
+ */
int skill_blown(struct block_list* src, struct block_list* target, int count, int8 dir, int flag)
{
int dx = 0, dy = 0;
+ struct status_change *tsc = status->get_sc(target);
nullpo_ret(src);
if (src != target && map->list[src->m].flag.noknockback)
return 0; // No knocking
+
+ nullpo_ret(target);
if (count == 0)
return 0; // Actual knockback distance is 0.
@@ -2089,7 +2138,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
case BL_MOB:
{
const struct mob_data *md = BL_UCCAST(BL_MOB, target);
- if (md->class_ == MOBID_EMPELIUM)
+ if (md->status.mode&MD_NOKNOCKBACK)
return 0;
if (src != target && is_boss(target)) // Bosses can't be knocked-back
return 0;
@@ -2122,6 +2171,9 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
dy = -diry[dir];
}
+ if (tsc != NULL && tsc->data[SC_SU_STOOP]) // Any knockback will cancel it.
+ status_change_end(target, SC_SU_STOOP, INVALID_TIMER);
+
return unit->blown(target, dx, dy, count, flag); // send over the proper flag
}
@@ -2132,10 +2184,12 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
1 - Regular reflection (Maya)
2 - SL_KAITE reflection
*/
-int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type) {
+int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type)
+{
struct status_change *sc = status->get_sc(bl);
struct map_session_data* sd = BL_CAST(BL_PC, bl);
+ nullpo_ret(src);
if( sc && sc->data[SC_KYOMU] ) // Nullify reflecting ability
return 0;
@@ -2179,7 +2233,8 @@ int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type)
* client (causes player characters to not scream skill name)
* flag&0x4000 - Return 0 if damage was reflected
*-------------------------------------------------------------------------*/
-int skill_attack(int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
+int skill_attack(int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag)
+{
struct Damage dmg;
struct status_data *sstatus, *tstatus;
struct status_change *sc;
@@ -2375,7 +2430,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
case TK_STORMKICK:
case TK_DOWNKICK:
case TK_COUNTER:
- if (pc->famerank(sd->status.char_id,MAPID_TAEKWON)) {//Extend combo time.
+ if (pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON) > 0) { //Extend combo time.
sce->val1 = skill_id; //Update combo-skill
sce->val3 = skill_id;
if( sce->timer != INVALID_TIMER )
@@ -2493,6 +2548,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
case KO_MUCHANAGE:
if( dmg.dmg_lv == ATK_FLEE )
break;
+ FALLTHROUGH
case WL_SOULEXPANSION:
case WL_COMET:
case NJ_HUUMA:
@@ -2505,6 +2561,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
case LG_OVERBRAND:
/* Fall through */
dmg.amotion = status_get_amotion(src) * 2;
+ FALLTHROUGH
case LG_OVERBRAND_PLUSATK:
dmg.dmotion = clif->skill_damage(dsrc,bl,tick,status_get_amotion(src),dmg.dmotion,damage,dmg.div_,skill_id,-1,BDT_SPLASH);
break;
@@ -2563,6 +2620,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
dmg.dmotion = clif->skill_damage(src,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, (flag&SD_LEVEL) ? -1 : skill_lv, BDT_SPLASH);
if( dsrc != src ) // avoid damage display redundancy
break;
+ FALLTHROUGH
case HT_LANDMINE:
dmg.dmotion = clif->skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, -1, type);
break;
@@ -2575,6 +2633,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
case AB_DUPLELIGHT_MELEE:
case AB_DUPLELIGHT_MAGIC:
dmg.amotion = 300;/* makes the damage value not overlap with previous damage (when displayed by the client) */
+ FALLTHROUGH
default:
skill->attack_display_unknown(&attack_type, src, dsrc, bl, &skill_id, &skill_lv, &tick, &flag, &type, &dmg, &damage);
break;
@@ -2833,7 +2892,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
if ( ssc->data[SC_POISONINGWEAPON]->val1 == 9 )// Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech]
rate = 100 - tstatus->int_ * 4 / 5;
sc_start(src, bl,ssc->data[SC_POISONINGWEAPON]->val2,rate,ssc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON,1) - (tstatus->vit + tstatus->luk) / 2 * 1000);
- status_change_end(src,SC_POISONINGWEAPON,-1);
+ status_change_end(src, SC_POISONINGWEAPON, INVALID_TIMER);
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
}
}
@@ -2870,15 +2929,27 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr
return (int)cap_value(damage,INT_MIN,INT_MAX);
}
-void skill_attack_combo1_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo) {
+void skill_attack_combo1_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo)
+{
if (src == dsrc) // Ground skills are exceptions. [Inkfish]
status_change_end(src, SC_COMBOATTACK, INVALID_TIMER);
}
-void skill_attack_combo2_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo) {
+void skill_attack_combo2_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo)
+{
}
-void skill_attack_display_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage) {
+void skill_attack_display_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage)
+{
+ nullpo_retv(bl);
+ nullpo_retv(dmg);
+ nullpo_retv(tick);
+ nullpo_retv(flag);
+ nullpo_retv(damage);
+ nullpo_retv(skill_id);
+ nullpo_retv(skill_lv);
+ nullpo_retv(type);
+
if (*flag & SD_ANIMATION && dmg->div_ < 2) //Disabling skill animation doesn't works on multi-hit.
*type = BDT_SPLASH;
if (bl->type == BL_SKILL) {
@@ -2889,15 +2960,24 @@ void skill_attack_display_unknown(int *attack_type, struct block_list* src, stru
dmg->dmotion = clif->skill_damage(dsrc, bl, *tick, dmg->amotion, dmg->dmotion, *damage, dmg->div_, *skill_id, (*flag & SD_LEVEL) ? -1 : *skill_lv, *type);
}
-int skill_attack_copy_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
- return *skill_id;
+int skill_attack_copy_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
+{
+ nullpo_ret(skill_id);
+ return *skill_id;
}
-int skill_attack_dir_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
- return -1;
+int skill_attack_dir_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
+{
+ return -1;
}
-void skill_attack_blow_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir) {
+void skill_attack_blow_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir)
+{
+ nullpo_retv(bl);
+ nullpo_retv(dmg);
+ nullpo_retv(dir);
+ nullpo_retv(damage);
+
skill->blown(dsrc, bl, dmg->blewcount, *dir, 0x0);
if (!dmg->blewcount && bl->type == BL_SKILL && *damage > 0){
struct skill_unit *su = BL_UCAST(BL_SKILL, bl);
@@ -2906,7 +2986,8 @@ void skill_attack_blow_unknown(int *attack_type, struct block_list* src, struct
}
}
-void skill_attack_post_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
+void skill_attack_post_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
+{
}
/*==========================================
@@ -2914,7 +2995,8 @@ void skill_attack_post_unknown(int *attack_type, struct block_list* src, struct
* Checking bl battle flag and display damage
* then call func with source,target,skill_id,skill_lv,tick,flag
*------------------------------------------*/
-int skill_area_sub(struct block_list *bl, va_list ap) {
+int skill_area_sub(struct block_list *bl, va_list ap)
+{
struct block_list *src;
uint16 skill_id,skill_lv;
int flag;
@@ -2965,6 +3047,7 @@ int skill_check_unit_range_sub(struct block_list *bl, va_list ap)
case AL_PNEUMA:
if(g_skill_id == SA_LANDPROTECTOR)
break;
+ FALLTHROUGH
case MG_SAFETYWALL:
case MH_STEINWAND:
case SC_MAELSTROM:
@@ -3387,6 +3470,7 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
skill->blown(src,target,skill->get_blewcount(skl->skill_id, skl->skill_lv), -1, 0x0 );
break;
}
+ FALLTHROUGH
}
default:
skill->timerskill_target_unknown(tid, tick, src, target, ud, skl);
@@ -3397,7 +3481,8 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
break;
switch( skl->skill_id ) {
case WZ_METEOR:
- if( skl->type >= 0 ) {
+ case SU_CN_METEOR:
+ if (skl->type >= 0) {
int x = skl->type>>16, y = skl->type&0xFFFF;
if( path->search_long(NULL, src, src->m, src->x, src->y, x, y, CELL_CHKWALL) )
skill->unitsetting(src,skl->skill_id,skl->skill_lv,x,y,skl->flag);
@@ -3413,6 +3498,7 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
map->foreachinarea(skill->cell_overlap,src->m,skl->x-i,skl->y-i,skl->x+i,skl->y+i,BL_SKILL,skl->skill_id,&dummy,src);
}
+ FALLTHROUGH
// fall through ...
case WL_EARTHSTRAIN:
skill->unitsetting(src,skl->skill_id,skl->skill_lv,skl->x,skl->y,(skl->type<<16)|skl->flag);
@@ -3440,6 +3526,7 @@ bool skill_timerskill_dead_unknown(struct block_list *src, struct unit_data *ud,
void skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl)
{
+ nullpo_retv(skl);
skill->attack(skl->type, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag);
}
@@ -3450,7 +3537,8 @@ void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *s
/*==========================================
*
*------------------------------------------*/
-int skill_addtimerskill(struct block_list *src, int64 tick, int target, int x,int y, uint16 skill_id, uint16 skill_lv, int type, int flag) {
+int skill_addtimerskill(struct block_list *src, int64 tick, int target, int x,int y, uint16 skill_id, uint16 skill_lv, int type, int flag)
+{
int i;
struct unit_data *ud;
nullpo_retr(1, src);
@@ -3554,11 +3642,28 @@ int skill_reveal_trap(struct block_list *bl, va_list ap)
return 0;
}
+void skill_castend_type(int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag)
+{
+ switch (type) {
+ case CAST_GROUND:
+ nullpo_retv(bl);
+ skill->castend_pos2(src, bl->x, bl->y, skill_id, skill_lv, tick, flag);
+ break;
+ case CAST_NODAMAGE:
+ skill->castend_nodamage_id(src, bl, skill_id, skill_lv, tick, flag);
+ break;
+ case CAST_DAMAGE:
+ skill->castend_damage_id(src, bl, skill_id, skill_lv, tick, flag);
+ break;
+ }
+}
+
/*==========================================
*
*
*------------------------------------------*/
-int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
+int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag)
+{
struct map_session_data *sd = NULL;
struct status_data *tstatus;
struct status_change *sc;
@@ -3744,7 +3849,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
if (!(flag&1) && sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_MONK) {
//Becomes a splash attack when Soul Linked.
map->foreachinrange(skill->area_sub, bl,
- skill->get_splash(skill_id, skill_lv),splash_target(src),
+ skill->get_splash(skill_id, skill_lv),skill->splash_target(src),
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|1,
skill->castend_damage_id);
} else
@@ -3755,7 +3860,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->area_temp[1] = 0;
map->foreachinrange(skill->attack_area, src,
- skill->get_splash(skill_id, skill_lv), splash_target(src),
+ skill->get_splash(skill_id, skill_lv), skill->splash_target(src),
BF_WEAPON, src, src, skill_id, skill_lv, tick, flag, BCT_ENEMY);
break;
@@ -3791,7 +3896,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
//line of sight between caster and target.
skill->area_temp[1] = bl->id;
map->foreachinpath(skill->attack_area,src->m,src->x,src->y,bl->x,bl->y,
- skill->get_splash(skill_id, skill_lv),skill->get_maxcount(skill_id,skill_lv), splash_target(src),
+ skill->get_splash(skill_id, skill_lv),skill->get_maxcount(skill_id,skill_lv), skill->splash_target(src),
skill->get_type(skill_id),src,src,skill_id,skill_lv,tick,flag,BCT_ENEMY);
break;
@@ -3802,7 +3907,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case NPC_THUNDERBREATH:
skill->area_temp[1] = bl->id;
map->foreachinpath(skill->attack_area,src->m,src->x,src->y,bl->x,bl->y,
- skill->get_splash(skill_id, skill_lv),skill->get_maxcount(skill_id,skill_lv), splash_target(src),
+ skill->get_splash(skill_id, skill_lv),skill->get_maxcount(skill_id,skill_lv), skill->splash_target(src),
skill->get_type(skill_id),src,src,skill_id,skill_lv,tick,flag,BCT_ENEMY);
break;
@@ -3896,11 +4001,22 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
break;
- //Splash attack skills.
+ case SU_BITE:
+ skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
+ if (status->get_lv(src) >= 30 && (rnd() % 100 < (int)(status->get_lv(src) / 30) + 10)) // TODO: Need activation chance.
+ skill->addtimerskill(src, tick + skill->get_delay(skill_id, skill_lv), bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag);
+ break;
+
+ case SU_PICKYPECK:
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ break;
+
+ // Splash attack skills.
case AS_GRIMTOOTH:
case MC_CARTREVOLUTION:
case NPC_SPLASHATTACK:
flag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
+ FALLTHROUGH
case AS_SPLASHER:
case HT_BLITZBEAT:
case AC_SHOWER:
@@ -3948,7 +4064,9 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
case KO_BAKURETSU:
case GN_ILLUSIONDOPING:
case MH_XENO_SLASHER:
- if( flag&1 ) {//Recursive invocation
+ case SU_SCRATCH:
+ case SU_LUNATICCARROTBEAT:
+ if (flag&1) { //Recursive invocation
// skill->area_temp[0] holds number of targets in area
// skill->area_temp[1] holds the id of the original target
// skill->area_temp[2] counts how many targets have already been processed
@@ -3963,15 +4081,19 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
break;
heal = skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, sflag);
- if( skill_id == NPC_VAMPIRE_GIFT && heal > 0 ) {
+ if (skill_id == NPC_VAMPIRE_GIFT && heal > 0) {
clif->skill_nodamage(NULL, src, AL_HEAL, heal, 1);
status->heal(src,heal,0,0);
}
+ if (skill_id == SU_SCRATCH && status->get_lv(src) >= 30 && (rnd() % 100 < (int)(status->get_lv(src) / 30) + 10)) // TODO: Need activation chance.
+ skill->addtimerskill(src, tick + skill->get_delay(skill_id, skill_lv), bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag);
} else {
switch ( skill_id ) {
case NJ_BAKUENRYU:
case LG_EARTHDRIVE:
case GN_CARTCANNON:
+ case SU_SCRATCH:
+ case SU_LUNATICCARROTBEAT:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
break;
case SR_TIGERCANNON:
@@ -3990,13 +4112,19 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
skill->area_temp[0] = 0;
skill->area_temp[1] = bl->id;
skill->area_temp[2] = 0;
- if( skill_id == WL_CRIMSONROCK ) {
+ if (skill_id == WL_CRIMSONROCK) {
skill->area_temp[4] = bl->x;
skill->area_temp[5] = bl->y;
}
+ if (skill_id == SU_LUNATICCARROTBEAT) {
+ skill->area_temp[3] = 0;
+ }
- if( skill_id == NC_VULCANARM )
- if (sd) pc->overheat(sd,1);
+ if (skill_id == NC_VULCANARM) {
+ if (sd != NULL) {
+ pc->overheat(sd,1);
+ }
+ }
// if skill damage should be split among targets, count them
//SD_LEVEL -> Forced splash damage for Auto Blitz-Beat -> count targets
@@ -4005,7 +4133,16 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
skill->area_temp[0] = map->foreachinrange(skill->area_sub, bl, (skill_id == AS_SPLASHER)?1:skill->get_splash(skill_id, skill_lv), BL_CHAR, src, skill_id, skill_lv, tick, BCT_ENEMY, skill->area_sub_count);
// recursive invocation of skill->castend_damage_id() with flag|1
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
+
+ if (sd && skill_id == SU_LUNATICCARROTBEAT) {
+ short item_idx = pc->search_inventory(sd, ITEMID_CARROT);
+
+ if (item_idx >= 0) {
+ pc->delitem(sd, item_idx, 1, 0, 1, LOG_TYPE_CONSUME);
+ skill->area_temp[3] = 1;
+ }
+ }
}
break;
@@ -4086,9 +4223,9 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
// Splash around target cell, but only cells inside area; we first have to check the area is not negative
if((max(min_x,tx-1) <= min(max_x,tx+1)) &&
(max(min_y,ty-1) <= min(max_y,ty+1)) &&
- (map->foreachinarea(skill->area_sub, bl->m, max(min_x,tx-1), max(min_y,ty-1), min(max_x,tx+1), min(max_y,ty+1), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY, skill->area_sub_count))) {
+ (map->foreachinarea(skill->area_sub, bl->m, max(min_x,tx-1), max(min_y,ty-1), min(max_x,tx+1), min(max_y,ty+1), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY, skill->area_sub_count))) {
// Recursive call
- map->foreachinarea(skill->area_sub, bl->m, max(min_x,tx-1), max(min_y,ty-1), min(max_x,tx+1), min(max_y,ty+1), splash_target(src), src, skill_id, skill_lv, tick, (flag|BCT_ENEMY)+1, skill->castend_damage_id);
+ map->foreachinarea(skill->area_sub, bl->m, max(min_x,tx-1), max(min_y,ty-1), min(max_x,tx+1), min(max_y,ty+1), skill->splash_target(src), src, skill_id, skill_lv, tick, (flag|BCT_ENEMY)+1, skill->castend_damage_id);
// Self-collision
if(bl->x >= min_x && bl->x <= max_x && bl->y >= min_y && bl->y <= max_y)
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,(flag&0xFFF)>0?SD_ANIMATION:0);
@@ -4281,6 +4418,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
if( (tsc = status->get_sc(bl)) && tsc->data[SC_HIDING] )
break;
}
+ FALLTHROUGH
case HVAN_EXPLOSION:
if (src != bl)
skill->attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag);
@@ -4489,18 +4627,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
if( !skill->check_condition_castbegin(sd, spell_skill_id, spell_skill_lv) )
break;
- switch( skill->get_casttype(spell_skill_id) ) {
- case CAST_GROUND:
- skill->castend_pos2(src, bl->x, bl->y, spell_skill_id, spell_skill_lv, tick, 0);
- break;
- case CAST_NODAMAGE:
- skill->castend_nodamage_id(src, bl, spell_skill_id, spell_skill_lv, tick, 0);
- break;
- case CAST_DAMAGE:
- skill->castend_damage_id(src, bl, spell_skill_id, spell_skill_lv, tick, 0);
- break;
- }
-
+ skill->castend_type(skill->get_casttype(spell_skill_id), src, bl, spell_skill_id, spell_skill_lv, tick, 0);
sd->ud.canact_tick = tick + skill->delay_fix(src, spell_skill_id, spell_skill_lv);
clif->status_change(src, SI_POSTDELAY, 1, skill->delay_fix(src, spell_skill_id, spell_skill_lv), 0, 0, 0);
@@ -4549,6 +4676,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
}
break;
}
+ FALLTHROUGH
case RA_WUGBITE:
if( path->search(NULL,src,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKNOREACH) ) {
skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
@@ -4572,7 +4700,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
if( !(sg->unit_id == UNT_USED_TRAPS || (sg->unit_id == UNT_ANKLESNARE && sg->val2 != 0 )) ) {
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid = sg->item_id?sg->item_id:ITEMID_TRAP;
+ item_tmp.nameid = sg->item_id ? sg->item_id : ITEMID_BOOBY_TRAP;
item_tmp.identify = 1;
if( item_tmp.nameid )
map->addflooritem(bl, &item_tmp, 1, bl->m, bl->x, bl->y, 0, 0, 0, 0);
@@ -4589,7 +4717,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
status_change_end(bl, SC_CLOAKING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); // Need confirm it.
} else {
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
if( sd ) pc->overheat(sd,1);
}
@@ -4607,7 +4735,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
// Destination area
skill->area_temp[4] = x;
skill->area_temp[5] = y;
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_damage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_damage_id);
skill->addtimerskill(src,tick + 800,src->id,x,y,skill_id,skill_lv,0,flag); // To teleport Self
clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,BDT_SKILL);
}
@@ -4666,7 +4794,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
status_change_end(bl, SC_HIDING, INVALID_TIMER);
status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER);
} else{
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
clif->skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
}
break;
@@ -4803,7 +4931,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
if(flag & 1)
skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag);
else {
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag | BCT_ENEMY | SD_SPLASH | 1, skill->castend_damage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag | BCT_ENEMY | SD_SPLASH | 1, skill->castend_damage_id);
}
break;
@@ -4824,6 +4952,15 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
break;
+ case SU_SV_STEMSPEAR:
+ skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag);
+ if (status->get_lv(src) >= 30 && (rnd() % 100 < (int)(status->get_lv(src) / 30) + 10)) // TODO: Need activation chance.
+ skill->addtimerskill(src, tick + skill->get_delay(skill_id, skill_lv), bl->id, 0, 0, skill_id, skill_lv, (skill_id == SU_SV_STEMSPEAR) ? BF_MAGIC : BF_WEAPON, flag);
+ break;
+ case SU_SCAROFTAROU:
+ sc_start(src, bl, status->skill2sc(skill_id), 10, skill_lv, skill->get_time(skill_id, skill_lv)); // TODO: What's the activation chance for the effect?
+ break;
+
case 0:/* no skill - basic/normal attack */
if(sd) {
if (flag & 3){
@@ -4869,6 +5006,10 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1
bool skill_castend_damage_id_unknown(struct block_list* src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc)
{
+ nullpo_retr(true, skill_id);
+ nullpo_retr(true, skill_lv);
+ nullpo_retr(true, tick);
+ nullpo_retr(true, tstatus);
ShowWarning("skill_castend_damage_id: Unknown skill used:%d\n", *skill_id);
clif->skill_damage(src, bl, *tick, status_get_amotion(src), tstatus->dmotion,
0, abs(skill->get_num(*skill_id, *skill_lv)),
@@ -4880,7 +5021,8 @@ bool skill_castend_damage_id_unknown(struct block_list* src, struct block_list *
/*==========================================
*
*------------------------------------------*/
-int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
+int skill_castend_id(int tid, int64 tick, int id, intptr_t data)
+{
struct block_list *target, *src;
struct map_session_data *sd;
struct mob_data *md;
@@ -4917,12 +5059,11 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
- if( sd && ud->skilltimer != INVALID_TIMER && (pc->checkskill(sd,SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK) )
+ if (sd && ud->skilltimer != INVALID_TIMER && (pc->checkskill(sd, SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0))
{// restore original walk speed
ud->skilltimer = INVALID_TIMER;
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
}
-
ud->skilltimer = INVALID_TIMER;
}
@@ -4957,6 +5098,8 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
ud->skilltimer=tid;
return skill->castend_pos(tid,tick,id,data);
case GN_WALLOFTHORN:
+ case SU_CN_POWDERING:
+ case SU_SV_ROOTTWIST:
ud->skillx = target->x;
ud->skilly = target->y;
ud->skilltimer = tid;
@@ -5123,7 +5266,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
unit->set_walkdelay(src, tick, battle_config.default_walk_delay+skill->get_walkdelay(ud->skill_id, ud->skill_lv), 1);
if(battle_config.skill_log && battle_config.skill_log&src->type)
- ShowInfo("Type %d, ID %d skill castend id [id =%d, lv=%d, target ID %d]\n",
+ ShowInfo("Type %u, ID %d skill castend id [id =%d, lv=%d, target ID %d]\n",
src->type, src->id, ud->skill_id, ud->skill_lv, target->id);
map->freeblock_lock();
@@ -5219,13 +5362,14 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
bool skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, struct block_list *target)
{
- return false;
+ return false;
}
/*==========================================
*
*------------------------------------------*/
-int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
+int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag)
+{
struct map_session_data *sd, *dstsd;
struct mob_data *md, *dstmd;
struct homun_data *hd;
@@ -5302,6 +5446,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0) ;
break ;
}
+ FALLTHROUGH
case AL_HEAL:
/**
@@ -5401,12 +5546,12 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
type = status->skill2sc(skill_id);
tsc = status->get_sc(bl);
- tsce = (tsc && type != -1)?tsc->data[type]:NULL;
+ tsce = (tsc != NULL && type != SC_NONE) ? tsc->data[type] : NULL;
- if (src!=bl && type > -1 &&
- (element = skill->get_ele(skill_id, skill_lv)) > ELE_NEUTRAL &&
- skill->get_inf(skill_id) != INF_SUPPORT_SKILL &&
- battle->attr_fix(NULL, NULL, 100, element, tstatus->def_ele, tstatus->ele_lv) <= 0)
+ if (src != bl && type > SC_NONE
+ && (element = skill->get_ele(skill_id, skill_lv)) > ELE_NEUTRAL
+ && skill->get_inf(skill_id) != INF_SUPPORT_SKILL
+ && battle->attr_fix(NULL, NULL, 100, element, tstatus->def_ele, tstatus->ele_lv) <= 0)
return 1; //Skills that cause an status should be blocked if the target element blocks its element.
map->freeblock_lock();
@@ -5417,6 +5562,10 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
* Arch Bishop
**/
case AB_HIGHNESSHEAL:
+ /**
+ * Summoner
+ */
+ case SU_TUNABELLY:
{
int heal = skill->calc_heal(src, bl, (skill_id == AB_HIGHNESSHEAL)?AL_HEAL:skill_id, (skill_id == AB_HIGHNESSHEAL)?10:skill_lv, true);
int heal_get_jobexp;
@@ -5427,7 +5576,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if (status->isimmune(bl) || (dstmd != NULL && (dstmd->class_ == MOBID_EMPELIUM || mob_is_battleground(dstmd))))
heal = 0;
- if (sd && dstsd && sd->status.partner_id == dstsd->status.char_id && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0)
+ if (sd != NULL && dstsd != NULL && sd->status.partner_id == dstsd->status.char_id && (sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0)
heal = heal * 2;
if (tsc && tsc->count)
@@ -5446,6 +5595,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
else if (tsc->data[SC_BERSERK])
heal = 0; //Needed so that it actually displays 0 when healing.
}
+ if (skill_id == AL_HEAL) {
+ status_change_end(bl, SC_BITESCAR, INVALID_TIMER);
+ }
clif->skill_nodamage (src, bl, skill_id, heal, 1);
if( tsc && tsc->data[SC_AKAITSUKI] && heal && skill_id != HLIF_HEAL )
heal = ~heal + 1;
@@ -5455,7 +5607,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
heal_get_jobexp = heal_get_jobexp * battle_config.heal_exp / 100;
if (heal_get_jobexp <= 0)
heal_get_jobexp = 1;
- pc->gainexp (sd, bl, 0, heal_get_jobexp, false);
+ pc->gainexp(sd, bl, 0, heal_get_jobexp, false);
}
}
break;
@@ -5531,7 +5683,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if (jexp < 1) jexp = 1;
}
if(exp > 0 || jexp > 0)
- pc->gainexp (sd, bl, exp, jexp, false);
+ pc->gainexp(sd, bl, exp, jexp, false);
}
}
}
@@ -5715,7 +5867,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case CR_PROVIDENCE:
if(sd && dstsd){ //Check they are not another crusader [Skotlex]
- if ((dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER) {
+ if ((dstsd->job & MAPID_UPPERMASK) == MAPID_CRUSADER) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map->freeblock_unlock();
return 1;
@@ -5729,7 +5881,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
{
struct status_change* sc = status->get_sc(src);
- if( sd && dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_BARDDANCER && dstsd->status.sex == sd->status.sex ) {
+ if (sd != NULL && dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == MAPID_BARDDANCER && dstsd->status.sex == sd->status.sex) {
// Cannot cast on another bard/dancer-type class of the same gender as caster
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map->freeblock_unlock();
@@ -5825,6 +5977,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case PR_KYRIE:
case MER_KYRIE:
+ case SU_TUNAPARTY:
clif->skill_nodamage(bl, bl, skill_id, -1,
sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
break;
@@ -5941,9 +6094,18 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case RK_ABUNDANCE:
case RK_CRUSHSTRIKE:
case ALL_ODINS_POWER:
+ case SU_FRESHSHRIMP:
+ case SU_ARCLOUSEDASH:
clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
break;
+ // Works just like the above list of skills, except animation caused by
+ // status must trigger AFTER the skill cast animation or it will cancel
+ // out the status's animation.
+ case SU_STOOP:
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
+ break;
case KN_AUTOCOUNTER:
sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
skill->addtimerskill(src, tick + 100, bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag);
@@ -6141,7 +6303,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( lv > battle_config.devotion_level_difference || // Level difference requeriments
(dstsd->sc.data[type] && dstsd->sc.data[type]->val1 != src->id) || // Cannot Devote a player devoted from another source
(skill_id == ML_DEVOTION && (!mer || mer != dstsd->md)) || // Mercenary only can devote owner
- (dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER || // Crusader Cannot be devoted
+ (dstsd->job & MAPID_UPPERMASK) == MAPID_CRUSADER || // Crusader Cannot be devoted
(dstsd->sc.data[SC_HELLPOWER])) // Players affected by SC_HELLPOWERR cannot be devoted.
{
if( sd )
@@ -6168,7 +6330,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
sd->devotion[i] = bl->id;
}
- else
+ else if (mer != NULL)
mer->devotion_flag = 1; // Mercenary Devoting Owner
clif->skill_nodamage(src, bl, skill_id, skill_lv,
@@ -6194,7 +6356,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
case MO_KITRANSLATION:
- if(dstsd && ((dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER || (dstsd->class_&MAPID_UPPERMASK)!=MAPID_REBELLION)) {
+ if (dstsd != NULL && (dstsd->job & MAPID_BASEMASK) != MAPID_GUNSLINGER) {
pc->addspiritball(dstsd,skill->get_time(skill_id,skill_lv),5);
}
break;
@@ -6210,10 +6372,10 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case MO_ABSORBSPIRITS:
{
int sp = 0;
- if ( dstsd && dstsd->spiritball
- && (sd == dstsd || map_flag_vs(src->m) || (sd && sd->duel_group && sd->duel_group == dstsd->duel_group))
- && ((dstsd->class_&MAPID_BASEMASK) != MAPID_GUNSLINGER || (dstsd->class_&MAPID_UPPERMASK) != MAPID_REBELLION)
- ) {
+ if (dstsd != NULL && dstsd->spiritball != 0
+ && (sd == dstsd || map_flag_vs(src->m) || (sd && sd->duel_group && sd->duel_group == dstsd->duel_group))
+ && (dstsd->job & MAPID_BASEMASK) != MAPID_GUNSLINGER
+ ) {
// split the if for readability, and included gunslingers in the check so that their coins cannot be removed [Reddozen]
sp = dstsd->spiritball * 7;
pc->delspiritball(dstsd, dstsd->spiritball, 0);
@@ -6259,7 +6421,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
skill->area_temp[1] = 0;
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
map->foreachinrange(skill->area_sub, bl,
- skill->get_splash(skill_id, skill_lv), splash_target(src),
+ skill->get_splash(skill_id, skill_lv), skill->splash_target(src),
src,skill_id,skill_lv,tick, flag|BCT_ENEMY|1,
skill->castend_damage_id);
status_change_end(src, SC_HIDING, INVALID_TIMER);
@@ -6278,7 +6440,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
int count = 0;
skill->area_temp[1] = 0;
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- count = map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src),
+ count = map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src),
src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_damage_id);
if( !count && ( skill_id == NC_AXETORNADO || skill_id == SR_SKYNETBLOW || skill_id == KO_HAPPOKUNAI ) )
clif->skill_damage(src,src,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
@@ -6324,7 +6486,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
skill->area_temp[1] = 0;
map->foreachinrange(skill->attack_area, src,
- skill->get_splash(skill_id, skill_lv), splash_target(src),
+ skill->get_splash(skill_id, skill_lv), skill->splash_target(src),
BF_MAGIC, src, src, skill_id, skill_lv, tick, flag, BCT_ENEMY);
break;
@@ -6338,7 +6500,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_nodamage(src, src, skill_id, -1, 1);
map->delblock(src); //Required to prevent chain-self-destructions hitting back.
map->foreachinrange(skill->area_sub, bl,
- skill->get_splash(skill_id, skill_lv), splash_target(src),
+ skill->get_splash(skill_id, skill_lv), skill->splash_target(src),
src, skill_id, skill_lv, tick, flag|targetmask,
skill->castend_damage_id);
map->addblock(src);
@@ -6414,7 +6576,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if (sd) {
if (!dstsd || !(
(sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_SOULLINKER)
- || (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER
+ || (dstsd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER
|| dstsd->status.char_id == sd->status.char_id
|| dstsd->status.char_id == sd->status.partner_id
|| dstsd->status.char_id == sd->status.child
@@ -6540,8 +6702,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case RG_STEALCOIN:
if(sd) {
- int amount = pc->steal_coin(sd, bl);
- if( amount > 0 ) {
+ int amount = pc->steal_coin(sd, bl, skill_lv);
+ if (amount > 0 && dstmd != NULL) {
dstmd->state.provoke_flag = src->id;
mob->target(dstmd, src, skill->get_range2(src, skill_id, skill_lv));
clif->skill_nodamage(src, bl, skill_id, amount, 1);
@@ -6598,7 +6760,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
status_change_end(bl, SC_SILENCE, INVALID_TIMER);
status_change_end(bl, SC_BLIND, INVALID_TIMER);
status_change_end(bl, SC_CONFUSION, INVALID_TIMER);
- clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ status_change_end(bl, SC_BITESCAR, INVALID_TIMER);
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
break;
case TF_DETOXIFY:
@@ -6892,7 +7055,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
return 1;
}
if( skill_id == AM_BERSERKPITCHER ) {
- if( dstsd && dstsd->status.base_level < (unsigned int)sd->inventory_data[i]->elv ) {
+ if (dstsd && dstsd->status.base_level < sd->inventory_data[i]->elv) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
map->freeblock_unlock();
return 1;
@@ -7048,7 +7211,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
}
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
+ if ((dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
|| (tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_ROGUE) //Rogue's spirit defends against dispel.
|| (dstsd && pc_ismadogear(dstsd))
|| rnd()%100 >= 50+10*skill_lv )
@@ -7297,7 +7460,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case NPC_REBIRTH:
if( md && md->state.rebirth )
break; // only works once
- sc_start(src,bl,type,100,skill_lv,-1);
+ sc_start(src, bl, type, 100, skill_lv, INFINITE_DURATION);
break;
case NPC_DARKBLESSING:
@@ -7307,8 +7470,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case NPC_LICK:
status_zap(bl, 0, 100);
- clif->skill_nodamage(src,bl,skill_id,skill_lv,
- sc_start(src,bl,type,(skill_lv*5),skill_lv,skill->get_time2(skill_id,skill_lv)));
+ clif->skill_nodamage(src, bl, skill_id, skill_lv,
+ sc_start(src, bl, type, (skill_lv * 20), skill_lv, skill->get_time2(skill_id, skill_lv)));
break;
case NPC_SUICIDE:
@@ -7505,7 +7668,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = skill->dbs->db[su->group->skill_id].itemid[i];
item_tmp.identify = 1;
- if (item_tmp.nameid && (success=pc->additem(sd,&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) != 0) {
+ if (item_tmp.nameid && (success=pc->additem(sd,&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],LOG_TYPE_SKILL)) != 0) {
clif->additem(sd,0,0,success);
map->addflooritem(&sd->bl, &item_tmp, skill->dbs->db[su->group->skill_id].amount[i], sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
@@ -7515,9 +7678,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
// get back 1 trap
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid = su->group->item_id?su->group->item_id:ITEMID_TRAP;
+ item_tmp.nameid = su->group->item_id ? su->group->item_id : ITEMID_BOOBY_TRAP;
item_tmp.identify = 1;
- if (item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) != 0) {
+ if (item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SKILL)) != 0) {
clif->additem(sd,0,0,flag);
map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0);
}
@@ -7541,6 +7704,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
// remove trap should be used instead
break;
// otherwise fall through to below
+ FALLTHROUGH
case UNT_BLASTMINE:
case UNT_SKIDTRAP:
case UNT_LANDMINE:
@@ -7578,7 +7742,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(src,bl,type,100,skill_lv,skill_id,src->id,skill->get_time(skill_id,skill_lv),1000));
#ifndef RENEWAL
- if (sd) skill->blockpc_start (sd, skill_id, skill->get_time(skill_id, skill_lv)+3000);
+ if (sd)
+ skill->blockpc_start(sd, skill_id, skill->get_time(skill_id, skill_lv) + 3000);
#endif
break;
@@ -7839,7 +8004,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case SL_SUPERNOVICE:
case SL_WIZARD:
//NOTE: here, 'type' has the value of the associated MAPID, not of the SC_SOULLINK constant.
- if (sd && !(dstsd && (dstsd->class_&MAPID_UPPERMASK) == type)) {
+ if (sd != NULL && !(dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == type)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -7855,7 +8020,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
sc_start(src,src,SC_SMA_READY,100,skill_lv,skill->get_time(SL_SMA,skill_lv));
break;
case SL_HIGH:
- if (sd && !(dstsd && (dstsd->class_&JOBL_UPPER) && !(dstsd->class_&JOBL_2) && dstsd->status.base_level < 70)) {
+ if (sd != NULL && !(dstsd != NULL && (dstsd->job & JOBL_UPPER) != 0 && (dstsd->job & JOBL_2) == 0 && dstsd->status.base_level < 70)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -8016,8 +8181,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
int x,y;
x = src->x;
y = src->y;
- if (hd)
- skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id,skill_lv));
+ if (hd) {
+#ifdef RENEWAL
+ skill->blockhomun_start(hd, skill_id, skill->get_cooldown(skill_id, skill_lv));
+#else
+ skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id, skill_lv));
+#endif
+ }
+
if (unit->movepos(src,bl->x,bl->y,0,0)) {
clif->skill_nodamage(src,src,skill_id,skill_lv,1); // Homun
@@ -8390,7 +8561,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case AB_ANCILLA:
if( sd ) {
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- skill->produce_mix(sd, skill_id, ITEMID_ANCILLA, 0, 0, 0, 1);
+ skill->produce_mix(sd, skill_id, ITEMID_ANSILA, 0, 0, 0, 1);
}
break;
@@ -8508,7 +8679,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
- if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER) || rnd()%100 >= 60 + 8 * skill_lv) {
+ if ((dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER) || rnd()%100 >= 60 + 8 * skill_lv) {
if (sd)
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
@@ -8518,9 +8689,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
for(i = 0; i < SC_MAX; i++) {
if ( !tsc->data[i] )
continue;
- if( SC_COMMON_MAX > i )
- if ( status->get_sc_type(i)&SC_NO_CLEARANCE )
- continue;
+ if (status->get_sc_type(i)&SC_NO_CLEARANCE)
+ continue;
switch (i) {
case SC_ASSUMPTIO:
if( bl->type == BL_MOB )
@@ -8648,7 +8818,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
}
- sc_start(src, bl, SC_STOP, 100, skill_lv, INVALID_TIMER); //Can't move while selecting a spellbook.
+ sc_start(src, bl, SC_STOP, 100, skill_lv, INFINITE_DURATION); //Can't move while selecting a spellbook.
clif->spellbook_list(sd);
clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
}
@@ -8736,7 +8906,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
int failure;
if( (failure = sc_start2(src,bl,type,100,skill_lv,src->id,skill->get_time(skill_id,skill_lv))) )
{
- map->foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),splash_target(src),src,skill_id,skill_lv,tick,flag|BCT_ENEMY|SD_SPLASH|1,skill->castend_damage_id);;
+ map->foreachinrange(skill->area_sub,src,skill->get_splash(skill_id,skill_lv),skill->splash_target(src),src,skill_id,skill_lv,tick,flag|BCT_ENEMY|SD_SPLASH|1,skill->castend_damage_id);;
clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,BDT_SKILL);
if (sd) pc->overheat(sd,1);
}
@@ -8777,7 +8947,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if( sd ) {
int idx1 = skill->get_index(sd->reproduceskill_id), idx2 = skill->get_index(sd->cloneskill_id);
if( sd->status.skill[idx1].id || sd->status.skill[idx2].id ) {
- sc_start(src,src,SC_STOP,100,skill_lv,-1);// The skill_lv is stored in val1 used in skill_select_menu to determine the used skill lvl [Xazax]
+ sc_start(src, src, SC_STOP, 100, skill_lv, INFINITE_DURATION); // The skill_lv is stored in val1 used in skill_select_menu to determine the used skill lvl [Xazax]
clif->autoshadowspell_list(sd);
clif->skill_nodamage(src,bl,skill_id,1,1);
}
@@ -8826,9 +8996,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if (is_boss(bl)) break;
joblvbonus = ( sd ? sd->status.job_level : 50 );
//First we set the success chance based on the caster's build which increases the chance.
- rate = 10 * skill_lv + rnd_value( sstatus->dex / 12, sstatus->dex / 4 ) + joblvbonus + status->get_lv(src) / 10;
+ rate = 10 * skill_lv + rnd->value( sstatus->dex / 12, sstatus->dex / 4 ) + joblvbonus + status->get_lv(src) / 10;
// We then reduce the success chance based on the target's build.
- rate -= rnd_value( tstatus->agi / 6, tstatus->agi / 3 ) + tstatus->luk / 10 + ( dstsd ? (dstsd->max_weight / 10 - dstsd->weight / 10 ) / 100 : 0 ) + status->get_lv(bl) / 10;
+ rate -= rnd->value( tstatus->agi / 6, tstatus->agi / 3 ) + tstatus->luk / 10 + ( dstsd ? (dstsd->max_weight / 10 - dstsd->weight / 10 ) / 100 : 0 ) + status->get_lv(bl) / 10;
//Finally we set the minimum success chance cap based on the caster's skill level and DEX.
rate = cap_value( rate, skill_lv + sstatus->dex / 20, 100);
clif->skill_nodamage(src,bl,skill_id,0,sc_start(src,bl,type,rate,skill_lv,skill->get_time(skill_id,skill_lv)));
@@ -8859,6 +9029,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case LG_TRAMPLE:
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
map->foreachinrange(skill->destroy_trap,bl,skill->get_splash(skill_id,skill_lv),BL_SKILL,tick);
+ status_change_end(bl, SC_SV_ROOTTWIST, INVALID_TIMER);
break;
case LG_REFLECTDAMAGE:
@@ -8894,7 +9065,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
splashrange = 3;
switch( opt ) {
case 1:
- sc_start(src,bl,SC_SHIELDSPELL_DEF,100,opt,INVALID_TIMER); //Splash AoE ATK
+ sc_start(src, bl, SC_SHIELDSPELL_DEF, 100, opt, INFINITE_DURATION); // Splash AoE ATK
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
map->foreachinrange(skill->area_sub,src,splashrange,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
status_change_end(bl,SC_SHIELDSPELL_DEF,INVALID_TIMER);
@@ -8921,7 +9092,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
splashrange = 3;
switch( opt ) {
case 1:
- sc_start(src,bl,SC_SHIELDSPELL_MDEF,100,opt,INVALID_TIMER); //Splash AoE MATK
+ sc_start(src, bl, SC_SHIELDSPELL_MDEF, 100, opt, INFINITE_DURATION); // Splash AoE MATK
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
map->foreachinrange(skill->area_sub,src,splashrange,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
status_change_end(bl,SC_SHIELDSPELL_MDEF,INVALID_TIMER);
@@ -8958,7 +9129,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
sc_start(src,bl,SC_SCRESIST,100,rate,shield->refine * 30000));
break;
case 3:
- sc_start(src,bl,SC_SHIELDSPELL_REF,100,opt,INVALID_TIMER); //HP Recovery
+ sc_start(src, bl, SC_SHIELDSPELL_REF, 100, opt, INFINITE_DURATION); // HP Recovery
val = sstatus->max_hp * ((status->get_lv(src) / 10) + (shield->refine + 1)) / 100;
status->heal(bl, val, 0, 2);
status_change_end(bl,SC_SHIELDSPELL_REF,INVALID_TIMER);
@@ -9065,8 +9236,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case SR_ASSIMILATEPOWER:
if( flag&1 ) {
int sp = 0;
- if( dstsd && dstsd->spiritball && (sd == dstsd || map_flag_vs(src->m)) && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER )
- {
+ if (dstsd != NULL && dstsd->spiritball != 0 && (sd == dstsd || map_flag_vs(src->m)) && (dstsd->job & MAPID_BASEMASK) != MAPID_GUNSLINGER) {
sp = dstsd->spiritball; //1%sp per spiritball.
pc->delspiritball(dstsd, dstsd->spiritball, 0);
status_percent_heal(src, 0, sp);
@@ -9077,14 +9247,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_nodamage(src, bl, skill_id, skill_lv, sp ? 1:0);
} else {
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, BDT_SKILL);
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|BCT_SELF|SD_SPLASH|1, skill->castend_nodamage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|BCT_SELF|SD_SPLASH|1, skill->castend_nodamage_id);
}
break;
case SR_POWERVELOCITY:
if( !dstsd )
break;
- if ( sd && (dstsd->class_&MAPID_BASEMASK) != MAPID_GUNSLINGER ) {
+ if (sd != NULL && (dstsd->job & MAPID_BASEMASK) != MAPID_GUNSLINGER) {
int i, max = pc->getmaxspiritball(dstsd, 5);
for ( i = 0; i < max; i++ ) {
pc->addspiritball(dstsd, skill->get_time(MO_CALLSPIRITS, 1), max);
@@ -9281,7 +9451,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
improv_skill_lv = 4 + skill_lv;
clif->skill_nodamage (src, bl, skill_id, skill_lv, 1);
- if (sd == NULL) {
+ if (sd != NULL) {
sd->state.abra_flag = 2;
sd->skillitem = improv_skill_id;
sd->skillitemlv = improv_skill_lv;
@@ -9388,6 +9558,25 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, 0, 1, skill_id, -2, BDT_SKILL);
break;
+ case SU_HIDE:
+ if (tsce != NULL) {
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ status_change_end(bl, type, INVALID_TIMER);
+ map->freeblock_unlock();
+ return 0;
+ }
+ clif->skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv));
+ break;
+
+ case SU_BUNCHOFSHRIMP:
+ if (sd == NULL || sd->status.party_id == 0 || flag&1) {
+ clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
+ } else if (sd != NULL) {
+ party->foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id);
+ }
+ break;
+
case GM_SANDMAN:
if( tsc ) {
if( tsc->opt1 == OPT1_SLEEP )
@@ -9431,7 +9620,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case SO_EL_CONTROL:
if( sd ) {
- int mode = EL_MODE_PASSIVE; // Standard mode.
+ uint32 mode = EL_MODE_PASSIVE; // Standard mode.
if( !sd->ed ) break;
@@ -9443,7 +9632,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case 2: mode = EL_MODE_ASSIST; break;
case 3: mode = EL_MODE_AGGRESSIVE; break;
}
- if( !elemental->change_mode(sd->ed,mode) ) {
+ if (!elemental->change_mode(sd->ed, mode)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
@@ -9668,7 +9857,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if(sd) {
struct mob_data *summon_md;
- summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), MOBID_KO_KAGE, "", SZ_SMALL, AI_NONE);
+ summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, clif->get_bl_name(src), MOBID_KO_KAGE, "", SZ_SMALL, AI_NONE);
if( summon_md ) {
summon_md->master_id = src->id;
summon_md->special_state.ai = AI_ZANZOU;
@@ -9769,7 +9958,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
}
} else {
skill->area_temp[2] = 0;
- map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_nodamage_id);
+ map->foreachinrange(skill->area_sub, bl, skill->get_splash(skill_id, skill_lv), skill->splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill->castend_nodamage_id);
}
break;
@@ -9794,6 +9983,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
SC_MANDRAGORA, SC_HARMONIZE, SC_DEEP_SLEEP, SC_SIREN, SC_SLEEP, SC_CONFUSION, SC_ILLUSION
};
int heal;
+ if (hd == NULL)
+ break;
if(tsc){
int i;
for (i = 0; i < ARRAYLENGTH(scs); i++) {
@@ -9848,7 +10039,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
for (i = 0; i < summons[skill_lv-1].quantity; i++) {
- struct mob_data *summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src),
+ struct mob_data *summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, clif->get_bl_name(src),
summons[skill_lv-1].mob_id, "", SZ_SMALL, AI_ATTACK);
if (summon_md != NULL) {
summon_md->master_id = src->id;
@@ -9900,21 +10091,23 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
bool skill_castend_nodamage_id_dead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
{
- return true;
+ return true;
}
bool skill_castend_nodamage_id_undead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
{
- return true;
+ return true;
}
bool skill_castend_nodamage_id_mado_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
{
- return false;
+ return false;
}
bool skill_castend_nodamage_id_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag)
{
+ nullpo_retr(true, skill_id);
+ nullpo_retr(true, skill_lv);
ShowWarning("skill_castend_nodamage_id: Unknown skill used:%d\n", *skill_id);
clif->skill_nodamage(src, bl, *skill_id, *skill_lv, 1);
map->freeblock_unlock();
@@ -9931,6 +10124,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
struct unit_data *ud = unit->bl2ud(src);
struct mob_data *md;
+ nullpo_ret(src);
nullpo_ret(ud);
sd = BL_CAST(BL_PC , src);
@@ -9948,7 +10142,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
return 0;
}
- if( sd && ud->skilltimer != INVALID_TIMER && ( pc->checkskill(sd,SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK ) )
+ if (sd && ud->skilltimer != INVALID_TIMER && (pc->checkskill(sd, SA_FREECAST) > 0 || ud->skill_id == LG_EXEEDBREAK || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0))
{// restore original walk speed
ud->skilltimer = INVALID_TIMER;
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
@@ -10023,7 +10217,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
}
if(battle_config.skill_log && battle_config.skill_log&src->type)
- ShowInfo("Type %d, ID %d skill castend pos [id =%d, lv=%d, (%d,%d)]\n",
+ ShowInfo("Type %u, ID %d skill castend pos [id =%d, lv=%d, (%d,%d)]\n",
src->type, src->id, ud->skill_id, ud->skill_lv, ud->skillx, ud->skilly);
if (ud->walktimer != INVALID_TIMER)
@@ -10084,7 +10278,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
}
-static int check_npc_chaospanic(struct block_list *bl, va_list args)
+int skill_check_npc_chaospanic(struct block_list *bl, va_list args)
{
const struct npc_data *nd = NULL;
@@ -10097,9 +10291,13 @@ static int check_npc_chaospanic(struct block_list *bl, va_list args)
return 1;
}
+
/* skill count without self */
-static int skill_count_wos(struct block_list *bl,va_list ap) {
+int skill_count_wos(struct block_list *bl, va_list ap)
+{
struct block_list* src = va_arg(ap, struct block_list*);
+ nullpo_retr(1, bl);
+ nullpo_retr(1, src);
if( src->id != bl->id ) {
return 1;
}
@@ -10109,8 +10307,10 @@ static int skill_count_wos(struct block_list *bl,va_list ap) {
/*==========================================
*
*------------------------------------------*/
-int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char *mapname) {
+int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char *mapname)
+{
nullpo_ret(sd);
+ nullpo_ret(mapname);
//Simplify skill_failed code.
#define skill_failed(sd) ( (sd)->menuskill_id = (sd)->menuskill_val = 0 )
@@ -10247,7 +10447,8 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
/*==========================================
*
*------------------------------------------*/
-int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
+int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag)
+{
struct map_session_data* sd;
struct status_change* sc;
struct status_change_entry *sce;
@@ -10267,7 +10468,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
sc = status->get_sc(src);
type = status->skill2sc(skill_id);
- sce = (sc && type != -1)?sc->data[type]:NULL;
+ sce = (sc != NULL && type != SC_NONE) ? sc->data[type] : NULL;
switch (skill_id) { //Skill effect.
case WZ_METEOR:
@@ -10276,6 +10477,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case HW_GANBANTEIN:
case LG_EARTHDRIVE:
case SC_ESCAPE:
+ case SU_CN_METEOR:
break; //Effect is displayed on respective switch case.
default:
skill->castend_pos2_effect_unknown(src, &x, &y, &skill_id, &skill_lv, &tick, &flag);
@@ -10340,10 +10542,11 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case SC_CHAOSPANIC:
case SC_MAELSTROM:
- if (sd && map->foreachinarea(&check_npc_chaospanic,src->m, x-3, y-3, x+3, y+3, BL_NPC) > 0 ) {
+ if (sd && map->foreachinarea(skill->check_npc_chaospanic, src->m, x-3, y-3, x+3, y+3, BL_NPC) > 0 ) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
+ FALLTHROUGH
case MG_SAFETYWALL:
{
@@ -10353,6 +10556,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
return 0; // Don't consume gems if cast on LP
}
}
+ FALLTHROUGH
case MG_FIREWALL:
case MG_THUNDERSTORM:
@@ -10462,7 +10666,10 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case SO_ELEMENTAL_SHIELD:
case RL_B_TRAP:
case MH_XENO_SLASHER:
- flag|=1;//Set flag to 1 to prevent deleting ammo (it will be deleted on group-delete).
+ case SU_CN_POWDERING:
+ case SU_SV_ROOTTWIST:
+ flag |= 1; // Set flag to 1 to prevent deleting ammo (it will be deleted on group-delete).
+ FALLTHROUGH
case GS_GROUNDDRIFT: //Ammo should be deleted right away.
if ( skill_id == WM_SEVERE_RAINSTORM )
sc_start(src,src,SC_NO_SWITCH_EQUIP,100,0,skill->get_time(skill_id,skill_lv));
@@ -10482,7 +10689,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
if( sc && sc->data[SC_BASILICA] )
status_change_end(src, SC_BASILICA, INVALID_TIMER); // Cancel Basilica
else { // Create Basilica. Start SC on caster. Unit timer start SC on others.
- if( map->foreachinrange(skill_count_wos, src, 2, BL_MOB|BL_PC, src) ) {
+ if( map->foreachinrange(skill->count_wos, src, 2, BL_MOB|BL_PC, src) ) {
if( sd )
clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
return 1;
@@ -10514,11 +10721,24 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
break;
case WZ_METEOR:
+ case SU_CN_METEOR:
{
int area = skill->get_splash(skill_id, skill_lv);
short tmpx = 0, tmpy = 0, x1 = 0, y1 = 0;
int i;
+#if 0
+ // The Meteor should inflict curse if Catnip fruit is consumed.
+ // Currently Catnip fruit is added as requirement.
+ if (sd && skill_id == SU_CN_METEOR) {
+ short item_idx = pc->search_inventory(sd, ITEMID_CATNIP_FRUIT);
+ if (item_idx >= 0) {
+ pc->delitem(sd, item_idx, 1, 0, 1, LOG_TYPE_SKILL);
+ flag |= 1;
+ }
+ }
+#endif
+
for( i = 0; i < 2 + (skill_lv>>1); i++ ) {
// Creates a random Cell in the Splash Area
tmpx = x - area + rnd()%(area * 2 + 1);
@@ -10570,6 +10790,19 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
}
status_change_end(src, SC_HIDING, INVALID_TIMER);
break;
+ case SU_LOPE:
+ {
+ if (map->list[src->m].flag.noteleport && !(map->list[src->m].flag.battleground || map_flag_gvg2(src->m))) {
+ x = src->x;
+ y = src->y;
+ }
+ clif->skill_nodamage(src, src, SU_LOPE, skill_lv, 1);
+ if(!map->count_oncell(src->m, x, y, BL_PC | BL_NPC | BL_MOB, 0) && map->getcell(src->m, src, x, y, CELL_CHKREACH)) {
+ clif->slide(src, x, y);
+ unit->movepos(src, x, y, 1, 0);
+ }
+ }
+ break;
case AM_SPHEREMINE:
case AM_CANNIBALIZE:
{
@@ -10589,7 +10822,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
}
// Correct info, don't change any of this! [Celest]
- md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_SMALL, AI_NONE);
+ md = mob->once_spawn_sub(src, src->m, x, y, clif->get_bl_name(src), class_, "", SZ_SMALL, AI_NONE);
if (md) {
md->master_id = src->id;
md->special_state.ai = (skill_id == AM_SPHEREMINE) ? AI_SPHERE : AI_FLORA;
@@ -10747,7 +10980,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case RK_DRAGONBREATH:
case RK_DRAGONBREATH_WATER:
r = skill->get_splash(skill_id,skill_lv);
- map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,splash_target(src),
+ map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,skill->splash_target(src),
src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
break;
case WM_GREAT_ECHO:
@@ -10769,7 +11002,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
break;
case SO_ARRULLO:
r = skill->get_splash(skill_id,skill_lv);
- map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,splash_target(src),
+ map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,skill->splash_target(src),
src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id);
break;
/**
@@ -10834,7 +11067,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case NC_SILVERSNIPER:
{
- struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), MOBID_SILVERSNIPER, "", SZ_SMALL, AI_NONE);
+ struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, clif->get_bl_name(src), MOBID_SILVERSNIPER, "", SZ_SMALL, AI_NONE);
if (md) {
md->master_id = src->id;
md->special_state.ai = AI_FLORA;
@@ -10884,7 +11117,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case LG_RAYOFGENESIS:
if( status->charge(src,status_get_max_hp(src)*3*skill_lv / 100,0) ) {
r = skill->get_splash(skill_id,skill_lv);
- map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,splash_target(src),
+ map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,skill->splash_target(src),
src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id);
} else if( sd )
clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
@@ -11039,7 +11272,8 @@ int skill_dance_overlap_sub(struct block_list *bl, va_list ap)
//Does the song/dance overlapping -> dissonance check. [Skotlex]
//When flag is 0, this unit is about to be removed, cancel the dissonance effect
//When 1, this unit has been positioned, so start the cancel effect.
-int skill_dance_overlap(struct skill_unit* su, int flag) {
+int skill_dance_overlap(struct skill_unit* su, int flag)
+{
if (!su || !su->group || !(su->group->state.song_dance&0x1))
return 0;
@@ -11061,7 +11295,8 @@ int skill_dance_overlap(struct skill_unit* su, int flag) {
* @param flag 1 Revert
* @retval true success
**/
-bool skill_dance_switch(struct skill_unit* su, int flag) {
+bool skill_dance_switch(struct skill_unit* su, int flag)
+{
static int prevflag = 1; // by default the backup is empty
static struct skill_unit_group backup;
struct skill_unit_group* group;
@@ -11117,7 +11352,8 @@ bool skill_dance_switch(struct skill_unit* su, int flag) {
* Initializes and sets a ground skill.
* flag&1 is used to determine when the skill 'morphs' (Warp portal becomes active, or Fire Pillar becomes active)
*------------------------------------------*/
-struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, int16 x, int16 y, int flag) {
+struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, int16 x, int16 y, int flag)
+{
struct skill_unit_group *group;
int i,limit,val1=0,val2=0,val3=0;
int target,interval,range,unit_flag,req_item=0;
@@ -11147,9 +11383,10 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
sd = BL_CAST(BL_PC, src);
st = status->get_status_data(src);
+ nullpo_retr(NULL, st);
sc = status->get_sc(src); // for traps, firewall and fogwall - celest
- switch( skill_id ) {
+ switch (skill_id) {
case SO_ELEMENTAL_SHIELD:
val2 = 300 * skill_lv + 65 * (st->int_ + status->get_lv(src)) + st->max_sp;
break;
@@ -11218,8 +11455,10 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
case HT_ANKLESNARE:
if( flag&2 )
val3 = SC_ESCAPE;
+ FALLTHROUGH
case HT_SHOCKWAVE:
val1=skill_lv*15+10;
+ FALLTHROUGH
case HT_SANDMAN:
case MA_SANDMAN:
case HT_CLAYMORETRAP:
@@ -11244,7 +11483,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
case RA_ICEBOUNDTRAP:
{
struct skill_condition req = skill->get_requirement(sd,skill_id,skill_lv);
- ARR_FIND(0, MAX_SKILL_ITEM_REQUIRE, i, req.itemid[i] && (req.itemid[i] == ITEMID_TRAP || req.itemid[i] == ITEMID_TRAP_ALLOY));
+ ARR_FIND(0, MAX_SKILL_ITEM_REQUIRE, i, req.itemid[i] && (req.itemid[i] == ITEMID_BOOBY_TRAP || req.itemid[i] == ITEMID_SPECIAL_ALLOY_TRAP));
if( i != MAX_SKILL_ITEM_REQUIRE && req.itemid[i] )
req_item = req.itemid[i];
if( map_flag_gvg2(src->m) || map->list[src->m].flag.battleground )
@@ -11404,12 +11643,16 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
{
case ELE_FIRE:
subunt++;
+ FALLTHROUGH
case ELE_WATER:
subunt++;
+ FALLTHROUGH
case ELE_POISON:
subunt++;
+ FALLTHROUGH
case ELE_DARK:
subunt++;
+ FALLTHROUGH
case ELE_WIND:
break;
default:
@@ -11446,6 +11689,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
target = BCT_ALL;
val1 = skill_lv + 1;
val2 = 1;
+ FALLTHROUGH
case WM_POEMOFNETHERWORLD: // Can't be placed on top of Land Protector.
case SO_WATER_INSIGNIA:
case SO_FIRE_INSIGNIA:
@@ -11488,6 +11732,7 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
break;
}
+ nullpo_retr(NULL, layout);
nullpo_retr(NULL, group=skill->init_unitgroup(src,layout->count,skill_id,skill_lv,skill->get_unit_id(skill_id,flag&1)+subunt, limit, interval));
group->val1=val1;
group->val2=val2;
@@ -11628,10 +11873,15 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
return group;
}
-void skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3) {
+void skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3)
+{
}
-void skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group) {
+void skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group)
+{
+ nullpo_retv(group);
+ nullpo_retv(val2);
+ nullpo_retv(unit_flag);
if (group->state.song_dance & 0x1)
*val2 = *unit_flag & (UF_DANCE | UF_SONG); //Store whether this is a song/dance
}
@@ -11639,7 +11889,8 @@ void skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16
/*==========================================
*
*------------------------------------------*/
-int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick) {
+int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick)
+{
struct skill_unit_group *sg;
struct block_list *ss;
struct status_change *sc;
@@ -11670,7 +11921,7 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
return 0;
type = status->skill2sc(sg->skill_id);
- sce = (sc && type != -1)?sc->data[type]:NULL;
+ sce = (sc != NULL && type != SC_NONE) ? sc->data[type] : NULL;
skill_id = sg->skill_id; //In case the group is deleted, we need to return the correct skill id, still.
switch (sg->unit_id) {
case UNT_SPIDERWEB:
@@ -11717,7 +11968,7 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
if (bl->type == BL_PC && !working) {
struct map_session_data *sd = BL_UCAST(BL_PC, bl);
- if ((!sd->chatID || battle_config.chat_warpportal) && sd->ud.to_x == src->bl.x && sd->ud.to_y == src->bl.y) {
+ if ((sd->chat_id == 0 || battle_config.chat_warpportal) && sd->ud.to_x == src->bl.x && sd->ud.to_y == src->bl.y) {
int x = sg->val2>>16;
int y = sg->val2&0xffff;
int count = sg->val1>>16;
@@ -11763,6 +12014,7 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
case UNT_HERMODE:
if (sg->src_id!=bl->id && battle->check_target(&src->bl,bl,BCT_PARTY|BCT_GUILD) > 0)
status->change_clear_buffs(bl,1); //Should dispell only allies.
+ FALLTHROUGH
case UNT_RICHMANKIM:
case UNT_ETERNALCHAOS:
case UNT_DRUMBATTLEFIELD:
@@ -11777,6 +12029,11 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
sc_start4(ss,bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);
break;
case UNT_APPLEIDUN:
+ // If Aegis, apple of idun doesn't update its effect
+ if (!battle_config.song_timer_reset && sc && sce)
+ return 0;
+ // Let it fall through
+ FALLTHROUGH
case UNT_WHISTLE:
case UNT_ASSASSINCROSS:
case UNT_POEMBRAGI:
@@ -11784,19 +12041,34 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
case UNT_DONTFORGETME:
case UNT_FORTUNEKISS:
case UNT_SERVICEFORYOU:
+ // Don't buff themselves without link!
if (sg->src_id==bl->id && !(sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_BARDDANCER))
return 0;
if (!sc) return 0;
if (!sce)
sc_start4(ss,bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);
+ // From here songs are already active
else if (battle_config.song_timer_reset && sce->val4 == 1) {
- //Readjust timers since the effect will not last long.
+ // eA style:
+ // Readjust timers since the effect will not last long.
sce->val4 = 0;
timer->delete(sce->timer, status->change_timer);
sce->timer = timer->add(tick+sg->limit, status->change_timer, bl->id, type);
+ } else if (!battle_config.song_timer_reset) {
+ // Aegis style:
+ // Songs won't renew unless finished
+ const struct TimerData *td = timer->get(sce->timer);
+ if (DIFF_TICK32(td->tick, timer->gettick()) < sg->interval) {
+ // Update with new values as the current one will vanish soon
+ timer->delete(sce->timer, status->change_timer);
+ sce->timer = timer->add(tick+sg->limit, status->change_timer, bl->id, type);
+ sce->val1 = sg->skill_lv; // Why are we storing skill_lv as val1?
+ sce->val2 = sg->val1;
+ sce->val3 = sg->val2;
+ sce->val4 = 0;
+ }
}
-
break;
case UNT_FOGWALL:
@@ -11851,6 +12123,13 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
sc_start(ss, bl, SC_VOLCANIC_ASH, 100, sg->skill_lv, skill->get_time(MH_VOLCANIC_ASH, sg->skill_lv));
break;
+ case UNT_CATNIPPOWDER:
+ if (sg->src_id == bl->id || (status_get_mode(bl)&MD_BOSS))
+ break; // Does not affect the caster or Boss.
+ if (sce == NULL && battle->check_target(&src->bl, bl, BCT_ENEMY) > 0)
+ sc_start(ss, bl, type, 100, sg->skill_lv, skill->get_time(sg->skill_id, sg->skill_lv));
+ break;
+
case UNT_GD_LEADERSHIP:
case UNT_GD_GLORYWOUNDS:
case UNT_GD_SOULCOLD:
@@ -11865,17 +12144,19 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick
return skill_id;
}
-void skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) {
+void skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick)
+{
}
/*==========================================
*
*------------------------------------------*/
-int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int64 tick) {
+int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int64 tick)
+{
struct skill_unit_group *sg;
struct block_list *ss;
struct map_session_data *tsd;
- struct status_data *tstatus, *bst;
+ struct status_data *tstatus;
struct status_change *tsc, *ssc;
struct skill_unit_group_tickset *ts;
enum sc_type type;
@@ -11899,7 +12180,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
return 0;
tstatus = status->get_status_data(bl);
- bst = status->get_base_status(bl);
+ nullpo_ret(tstatus);
type = status->skill2sc(sg->skill_id);
skill_id = sg->skill_id;
@@ -11931,7 +12212,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_MANHOLE:
return 0;
default:
- ShowError("skill_unit_onplace_timer: interval error (unit id %x)\n", sg->unit_id);
+ ShowError("skill_unit_onplace_timer: interval error (unit id %x)\n", (unsigned int)sg->unit_id);
return 0;
}
}
@@ -12056,12 +12337,12 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
tsc->sg_counter++; //SG hit counter.
if (skill->attack(skill->get_type(sg->skill_id),ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0) <= 0 && tsc)
tsc->sg_counter=0; //Attack absorbed.
- break;
+ break;
#endif
case GS_DESPERADO:
if (rnd()%100 < src->val1)
skill->attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
- break;
+ break;
default:
skill->attack(skill->get_type(sg->skill_id),ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
}
@@ -12142,11 +12423,13 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_VERDURETRAP:
if( bl->type == BL_PC )// it won't work on players
break;
+ FALLTHROUGH
case UNT_FIRINGTRAP:
case UNT_ICEBOUNDTRAP:
case UNT_CLUSTERBOMB:
if( bl->id == ss->id )// it won't trigger on caster
break;
+ FALLTHROUGH
case UNT_LANDMINE:
case UNT_BLASTMINE:
case UNT_SHOCKWAVE:
@@ -12201,18 +12484,25 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
if (md && md->class_ == MOBID_EMPELIUM)
break;
#endif
- if ((sg->src_id == bl->id && !(tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_BARDDANCER))
- || (!(battle_config.song_timer_reset) && tsc && tsc->data[type] && tsc->data[type]->val4 == 1))
+ // Don't buff themselves!
+ if ((sg->src_id == bl->id && !(tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_BARDDANCER)))
break;
- heal = skill->calc_heal(ss,bl,sg->skill_id, sg->skill_lv, true);
- if( tsc && tsc->data[SC_AKAITSUKI] && heal )
- heal = ~heal + 1;
- clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
- status->heal(bl, heal, 0, 0);
-
- if (!battle_config.song_timer_reset)
+ // Aegis style
+ // Check if the remaining time is enough to survive the next update
+ if (!battle_config.song_timer_reset
+ && !(tsc && tsc->data[type] && tsc->data[type]->val4 == 1)) {
+ // Apple of Idun is not active. Start it now
sc_start4(ss, bl, type, 100, sg->skill_lv, sg->val1, sg->val2, 0, sg->limit);
+ }
+
+ if (tstatus->hp < tstatus->max_hp) {
+ heal = skill->calc_heal(ss,bl,sg->skill_id, sg->skill_lv, true);
+ if( tsc && tsc->data[SC_AKAITSUKI] && heal )
+ heal = ~heal + 1;
+ clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
+ status->heal(bl, heal, 0, 0);
+ }
}
break;
case UNT_POEMBRAGI:
@@ -12222,12 +12512,30 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_DONTFORGETME:
case UNT_FORTUNEKISS:
case UNT_SERVICEFORYOU:
- if (battle_config.song_timer_reset
- || (!(battle_config.song_timer_reset) && tsc && tsc->data[type] && tsc->data[type]->val4 == 1)
- || (sg->src_id == bl->id && !(tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_BARDDANCER))
- )
+ // eA style: doesn't need this
+ if (battle_config.song_timer_reset)
+ break;
+ // Don't let buff themselves!
+ if (sg->src_id == bl->id && !(tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_BARDDANCER))
break;
+ // Aegis style
+ // Check if song has enough time to survive the next check
+ if (!(battle_config.song_timer_reset) && tsc && tsc->data[type] && tsc->data[type]->val4 == 1) {
+ const struct TimerData *td = timer->get(tsc->data[type]->timer);
+ if (DIFF_TICK32(td->tick, timer->gettick()) < sg->interval) {
+ // Update with new values as the current one will vanish
+ timer->delete(tsc->data[type]->timer, status->change_timer);
+ tsc->data[type]->timer = timer->add(tick+sg->limit, status->change_timer, bl->id, type);
+ tsc->data[type]->val1 = sg->skill_lv;
+ tsc->data[type]->val2 = sg->val1;
+ tsc->data[type]->val3 = sg->val2;
+ tsc->data[type]->val4 = 0;
+ }
+ break; // Had enough time or not, it now has. Exit
+ }
+
+ // Song was not active. Start it now
sc_start4(ss, bl, type, 100, sg->skill_lv, sg->val1, sg->val2, 0, sg->limit);
break;
case UNT_TATAMIGAESHI:
@@ -12413,6 +12721,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
case UNT_STEALTHFIELD:
if( bl->id == sg->src_id )
break; // Don't work on Self (video shows that)
+ FALLTHROUGH
case UNT_NEUTRALBARRIER:
sc_start(ss,bl,type,100,sg->skill_lv,sg->interval + 100);
break;
@@ -12547,6 +12856,8 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
if (tsc && (tsc->data[SC_HALLUCINATIONWALK] || tsc->data[SC_VACUUM_EXTREME])) {
return 0;
} else {
+ struct status_data *bst = status->get_base_status(bl);
+ nullpo_ret(bst);
sg->limit -= 1000 * bst->str/20;
sc_start(ss, bl, SC_VACUUM_EXTREME, 100, sg->skill_lv, sg->limit);
@@ -12603,6 +12914,33 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
status->change_start(ss, bl, SC_BLIND, rnd() % 100 > sg->skill_lv * 10, sg->skill_lv, sg->skill_id, 0, 0,
skill->get_time2(sg->skill_id, sg->skill_lv), SCFLAG_FIXEDTICK|SCFLAG_FIXEDRATE);
break;
+ case UNT_SV_ROOTTWIST:
+ if (status_get_mode(bl)&MD_BOSS) {
+ break;
+ }
+ if (tsc) {
+ if (!sg->val2) {
+ int sec = skill->get_time(sg->skill_id, sg->skill_lv);
+
+ if (sc_start2(ss, bl, type, 100, sg->skill_lv, sg->group_id, sec)) {
+ const struct TimerData* td = ((tsc->data[type])? timer->get(tsc->data[type]->timer) : NULL);
+
+ if (td != NULL)
+ sec = DIFF_TICK32(td->tick, tick);
+ clif->fixpos(bl);
+ sg->val2 = bl->id;
+ } else { // Couldn't trap it?
+ sec = 7000;
+ }
+ sg->limit = DIFF_TICK32(tick, sg->tick) + sec;
+ } else if (tsc->data[type] && bl->id == sg->val2) {
+ skill->attack(skill->get_type(SU_SV_ROOTTWIST_ATK), ss, &src->bl, bl, SU_SV_ROOTTWIST_ATK, sg->skill_lv, tick, SD_LEVEL|SD_ANIMATION);
+ }
+ }
+ break;
+ default:
+ skill->unit_onplace_timer_unknown(src, bl, &tick);
+ break;
}
if (bl->type == BL_MOB && ss != bl)
@@ -12610,10 +12948,16 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6
return skill_id;
}
+
+void skill_unit_onplace_timer_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick)
+{
+}
+
/*==========================================
* Triggered when a char steps out of a skill cell
*------------------------------------------*/
-int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick) {
+int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick)
+{
struct skill_unit_group *sg;
struct status_change *sc;
struct status_change_entry *sce;
@@ -12624,7 +12968,7 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick)
nullpo_ret(sg=src->group);
sc = status->get_sc(bl);
type = status->skill2sc(sg->skill_id);
- sce = (sc && type != -1)?sc->data[type]:NULL;
+ sce = (sc != NULL && type != SC_NONE) ? sc->data[type] : NULL;
if( bl->prev == NULL
|| (status->isdead(bl) && sg->unit_id != UNT_ANKLESNARE && sg->unit_id != UNT_SPIDERWEB && sg->unit_id != UNT_THORNS_TRAP)
@@ -12678,7 +13022,8 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick)
/*==========================================
* Triggered when a char steps out of a skill group (entirely) [Skotlex]
*------------------------------------------*/
-int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
+int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick)
+{
struct status_change *sc;
struct status_change_entry *sce;
enum sc_type type;
@@ -12688,7 +13033,7 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
sc = NULL;
type = status->skill2sc(skill_id);
- sce = (sc && type != -1)?sc->data[type]:NULL;
+ sce = (sc != NULL && type != SC_NONE) ? sc->data[type] : NULL;
switch (skill_id) {
case WZ_QUAGMIRE:
@@ -12749,8 +13094,9 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
case DC_DONTFORGETME:
case DC_FORTUNEKISS:
case DC_SERVICEFORYOU:
- if ((battle_config.song_timer_reset && sce) // athena style
- || (!battle_config.song_timer_reset && sce && sce->val4 != 1)
+
+ if ((battle_config.song_timer_reset && sce) // eAthena style: update everytime
+ || (!battle_config.song_timer_reset && sce && sce->val4 != 1) // Aegis style: update only when it was not a reduced effect
) {
timer->delete(sce->timer, status->change_timer);
//NOTE: It'd be nice if we could get the skill_lv for a more accurate extra time, but alas...
@@ -12762,7 +13108,8 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
case PF_FOGWALL:
if (sce) {
status_change_end(bl, type, INVALID_TIMER);
- if ((sce=sc->data[SC_BLIND])) {
+ nullpo_retb(sc);
+ if ((sce = sc->data[SC_BLIND])) {
if (bl->type == BL_PC) //Players get blind ended immediately, others have it still for 30 secs. [Skotlex]
status_change_end(bl, SC_BLIND, INVALID_TIMER);
else {
@@ -12790,14 +13137,19 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
* flag&1: Invoke onplace function (otherwise invoke onout)
* flag&4: Invoke a onleft call (the unit might be scheduled for deletion)
*------------------------------------------*/
-int skill_unit_effect(struct block_list* bl, va_list ap) {
+int skill_unit_effect(struct block_list* bl, va_list ap)
+{
struct skill_unit* su = va_arg(ap,struct skill_unit*);
- struct skill_unit_group* group = su->group;
+ struct skill_unit_group* group;
int64 tick = va_arg(ap,int64);
unsigned int flag = va_arg(ap,unsigned int);
uint16 skill_id;
bool dissonance;
+ nullpo_ret(bl);
+ nullpo_ret(su);
+ group = su->group;
+
if( (!su->alive && !(flag&4)) || bl->prev == NULL )
return 0;
@@ -12829,7 +13181,8 @@ int skill_unit_effect(struct block_list* bl, va_list ap) {
/*==========================================
*
*------------------------------------------*/
-int skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick) {
+int skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick)
+{
struct skill_unit_group *sg;
nullpo_ret(src);
@@ -12892,7 +13245,7 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
return 0;
if( skill->get_inf2(skill_id)&INF2_CHORUS_SKILL ) {
- if( tsd->status.party_id == sd->status.party_id && (tsd->class_&MAPID_THIRDMASK) == MAPID_MINSTRELWANDERER )
+ if (tsd->status.party_id == sd->status.party_id && (tsd->job & MAPID_THIRDMASK) == MAPID_MINSTRELWANDERER)
p_sd[(*c)++] = tsd->bl.id;
return 1;
} else {
@@ -12901,24 +13254,23 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
case PR_BENEDICTIO: {
uint8 dir = map->calc_dir(&sd->bl,tsd->bl.x,tsd->bl.y);
dir = (unit->getdir(&sd->bl) + dir)%8; //This adjusts dir to account for the direction the sd is facing.
- if ((tsd->class_&MAPID_BASEMASK) == MAPID_ACOLYTE && (dir == 2 || dir == 6) //Must be standing to the left/right of Priest.
+ if ((tsd->job & MAPID_BASEMASK) == MAPID_ACOLYTE && (dir == 2 || dir == 6) //Must be standing to the left/right of Priest.
&& sd->status.sp >= 10)
p_sd[(*c)++]=tsd->bl.id;
return 1;
}
case AB_ADORAMUS:
// Adoramus does not consume Blue Gemstone when there is at least 1 Priest class next to the caster
- if( (tsd->class_&MAPID_UPPERMASK) == MAPID_PRIEST )
+ if ((tsd->job & MAPID_UPPERMASK) == MAPID_PRIEST)
p_sd[(*c)++] = tsd->bl.id;
return 1;
case WL_COMET:
// Comet does not consume Red Gemstones when there is at least 1 Warlock class next to the caster
- if( ( tsd->class_&MAPID_THIRDMASK ) == MAPID_WARLOCK )
+ if ((tsd->job & MAPID_THIRDMASK) == MAPID_WARLOCK)
p_sd[(*c)++] = tsd->bl.id;
return 1;
case LG_RAYOFGENESIS:
- if( tsd->status.party_id == sd->status.party_id && (tsd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD &&
- tsd->sc.data[SC_BANDING] )
+ if (tsd->status.party_id == sd->status.party_id && (tsd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD && tsd->sc.data[SC_BANDING])
p_sd[(*c)++] = tsd->bl.id;
return 1;
default: //Warning: Assuming Ensemble Dance/Songs for code speed. [Skotlex]
@@ -12927,7 +13279,7 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
if(pc_issit(tsd) || !unit->can_move(&tsd->bl))
return 0;
if (sd->status.sex != tsd->status.sex &&
- (tsd->class_&MAPID_UPPERMASK) == MAPID_BARDDANCER &&
+ (tsd->job & MAPID_UPPERMASK) == MAPID_BARDDANCER &&
(skill_lv = pc->checkskill(tsd, skill_id)) > 0 &&
(tsd->weapontype1==W_MUSICAL || tsd->weapontype1==W_WHIP) &&
sd->status.party_id && tsd->status.party_id &&
@@ -12950,12 +13302,16 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap)
/*==========================================
* Checks and stores partners for ensemble skills [Skotlex]
*------------------------------------------*/
-int skill_check_pc_partner (struct map_session_data *sd, uint16 skill_id, uint16* skill_lv, int range, int cast_flag) {
+int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16* skill_lv, int range, int cast_flag)
+{
static int c=0;
static int p_sd[2] = { 0, 0 };
int i;
bool is_chorus = ( skill->get_inf2(skill_id)&INF2_CHORUS_SKILL );
+ nullpo_ret(sd);
+ nullpo_ret(skill_lv);
+
if (!battle_config.player_skill_partner_check || pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL))
return is_chorus ? MAX_PARTY : 99; //As if there were infinite partners.
@@ -13032,6 +13388,7 @@ int skill_check_condition_mob_master_sub (struct block_list *bl, va_list ap)
*------------------------------------------*/
int skill_isammotype (struct map_session_data *sd, int skill_id)
{
+ nullpo_ret(sd);
return (
battle_config.arrow_decrement==2 &&
(sd->status.weapon == W_BOW || (sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE)) &&
@@ -13071,14 +13428,16 @@ bool skill_is_combo( int skill_id )
return false;
}
-int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) {
+int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv)
+{
struct status_data *st;
struct status_change *sc;
struct skill_condition require;
nullpo_ret(sd);
- if (sd->chatID) return 0;
+ if (sd->chat_id != 0)
+ return 0;
if (pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL) && sd->skillitem != skill_id) {
//GMs don't override the skillItem check, otherwise they can use items without them being consumed! [Skotlex]
@@ -13167,8 +13526,10 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case SG_FUSION:
case RA_WUGDASH:
case KO_YAMIKUMO:
- if( sc && sc->data[status->skill2sc(skill_id)] )
+ case SU_HIDE:
+ if (sc && sc->data[status->skill2sc(skill_id)])
return 1;
+ FALLTHROUGH
default:
{
int ret = skill->check_condition_castbegin_off_unknown(sc, &skill_id);
@@ -13275,6 +13636,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
+ FALLTHROUGH
case SA_CASTCANCEL:
if(sd->ud.skilltimer == INVALID_TIMER) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -13367,7 +13729,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
break;
case TK_MISSION:
- if( (sd->class_&MAPID_UPPERMASK) != MAPID_TAEKWON ) {
+ if ((sd->job & MAPID_UPPERMASK) != MAPID_TAEKWON) {
// Cannot be used by Non-Taekwon classes
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
@@ -13379,7 +13741,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case TK_READYSTORM:
case TK_READYTURN:
case TK_JUMPKICK:
- if( (sd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER ) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER) {
// Soul Linkers cannot use this skill
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
@@ -13390,7 +13752,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
case TK_STORMKICK:
case TK_DOWNKICK:
case TK_COUNTER:
- if ((sd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
return 0; //Anti-Soul Linker check in case you job-changed with Stances active.
if(!(sc && sc->data[SC_COMBOATTACK]) || sc->data[SC_COMBOATTACK]->val1 == TK_JUMPKICK)
return 0; //Combo needs to be ready
@@ -13402,7 +13764,8 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
status_change_end(&sd->bl, SC_COMBOATTACK, INVALID_TIMER);
return 0;
}
- if(sc->data[SC_COMBOATTACK]->val1 != skill_id && !( sd && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )) {
+ if (sc->data[SC_COMBOATTACK]->val1 != skill_id
+ && !(sd != NULL && sd->status.base_level >= 90 && pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON) > 0)) {
//Cancel combo wait.
unit->cancel_combo(&sd->bl);
return 0;
@@ -13524,6 +13887,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
+ FALLTHROUGH
case GD_EMERGENCYCALL:
// other checks were already done in skillnotok()
if (!sd->status.guild_id || !sd->state.gmaster_flag)
@@ -13546,6 +13910,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
+ FALLTHROUGH
case NJ_BUNSINJYUTSU:
if (!(sc && sc->data[SC_NJ_NEN])) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -13584,7 +13949,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
{
int count = 0, i;
for( i = 0; i < MAX_INVENTORY; i ++ )
- if( sd->status.inventory[i].nameid == ITEMID_ANCILLA )
+ if (sd->status.inventory[i].nameid == ITEMID_ANSILA)
count += sd->status.inventory[i].amount;
if( count >= 3 ) {
clif->skill_fail(sd, skill_id, USESKILL_FAIL_ANCILLA_NUMOVER, 0);
@@ -13872,6 +14237,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
+ FALLTHROUGH
case ST_CART:
if(!pc_iscarton(sd)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_CART,0);
@@ -13965,11 +14331,13 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
+ FALLTHROUGH
case ST_MH_GRAPPLING:
if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_GRAPPLING)){
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
return 0;
}
+ FALLTHROUGH
case ST_PECO:
if (!pc_isridingpeco(sd)) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
@@ -14018,25 +14386,26 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
int skill_check_condition_castbegin_off_unknown(struct status_change *sc, uint16 *skill_id)
{
- return -1;
+ return -1;
}
int skill_check_condition_castbegin_mount_unknown(struct status_change *sc, uint16 *skill_id)
{
- return 0;
+ return 0;
}
int skill_check_condition_castbegin_madogear_unknown(struct status_change *sc, uint16 *skill_id)
{
- return 0;
+ return 0;
}
int skill_check_condition_castbegin_unknown(struct status_change *sc, uint16 *skill_id)
{
- return -1;
+ return -1;
}
-int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) {
+int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv)
+{
struct skill_condition require;
struct status_data *st;
int i;
@@ -14044,7 +14413,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
nullpo_ret(sd);
- if( sd->chatID )
+ if (sd->chat_id != 0)
return 0;
if( pc_has_permission(sd, PC_PERM_SKILL_UNCONDITIONAL) && sd->skillitem != skill_id ) {
@@ -14213,7 +14582,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
cause = USESKILL_FAIL_BLUEJAMSTONE; break;
case ITEMID_HOLY_WATER:
cause = USESKILL_FAIL_HOLYWATER; break;
- case ITEMID_ANCILLA:
+ case ITEMID_ANSILA:
cause = USESKILL_FAIL_ANCILLA; break;
case ITEMID_ACCELERATOR:
case ITEMID_HOVERING_BOOSTER:
@@ -14240,12 +14609,14 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
return 1;
}
-void skill_check_condition_castend_unknown(struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv) {
+void skill_check_condition_castend_unknown(struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv)
+{
}
// type&2: consume items (after skill was used)
// type&1: consume the others (before skill was used)
-int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type) {
+int skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type)
+{
struct skill_condition req;
nullpo_ret(sd);
@@ -14326,7 +14697,8 @@ int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uin
return 1;
}
-struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) {
+struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv)
+{
struct skill_condition req;
struct status_data *st;
struct status_change *sc;
@@ -14368,7 +14740,8 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
case TK_READYTURN:
case SG_FUSION:
case KO_YAMIKUMO:
- if( sc && sc->data[status->skill2sc(skill_id)] )
+ case SU_HIDE:
+ if (sc && sc->data[status->skill2sc(skill_id)])
return req;
/* Fall through */
default:
@@ -14524,7 +14897,7 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
if ((item_index = pc->search_inventory(sd, req.itemid[i])) == INDEX_NOT_FOUND
|| sd->status.inventory[item_index].amount < req.amount[i]
) {
- req.itemid[i] = ITEMID_TRAP_ALLOY;
+ req.itemid[i] = ITEMID_SPECIAL_ALLOY_TRAP;
req.amount[i] = 1;
}
break;
@@ -14551,14 +14924,14 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
switch(skill_lv) {
case 1:
case 2:
- req.itemid[1] = ITEMID_REPAIR_A;
+ req.itemid[1] = ITEMID_REPAIRA;
break;
case 3:
case 4:
- req.itemid[1] = ITEMID_REPAIR_B;
+ req.itemid[1] = ITEMID_REPAIRB;
break;
case 5:
- req.itemid[1] = ITEMID_REPAIR_C;
+ req.itemid[1] = ITEMID_REPAIRC;
break;
}
req.amount[1] = 1;
@@ -14656,12 +15029,12 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
bool skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skill_id)
{
- return false;
+ return false;
}
bool skill_get_requirement_item_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i)
{
- return false;
+ return false;
}
void skill_get_requirement_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req)
@@ -14671,7 +15044,8 @@ void skill_get_requirement_unknown(struct status_change *sc, struct map_session_
/*==========================================
* Does cast-time reductions based on dex, item bonuses and config setting
*------------------------------------------*/
-int skill_castfix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
+int skill_castfix (struct block_list *bl, uint16 skill_id, uint16 skill_lv)
+{
int time = skill->get_cast(skill_id, skill_lv);
nullpo_ret(bl);
@@ -14721,11 +15095,13 @@ int skill_castfix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
/*==========================================
* Does cast-time reductions based on sc data.
*------------------------------------------*/
-int skill_castfix_sc (struct block_list *bl, int time) {
+int skill_castfix_sc (struct block_list *bl, int time)
+{
struct status_change *sc = status->get_sc(bl);
if( time < 0 )
return 0;
+ nullpo_ret(bl);
if( bl->type == BL_MOB ) // mobs casttime is fixed nothing to alter.
return time;
@@ -14754,7 +15130,9 @@ int skill_castfix_sc (struct block_list *bl, int time) {
//ShowInfo("Castime castfix_sc = %d\n",time);
return time;
}
-int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv) {
+
+int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv)
+{
#ifdef RENEWAL_CAST
struct status_change *sc = status->get_sc(bl);
struct map_session_data *sd = BL_CAST(BL_PC,bl);
@@ -14762,6 +15140,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
if( time < 0 )
return 0;
+ nullpo_ret(bl);
if( bl->type == BL_MOB ) // mobs casttime is fixed nothing to alter.
return (int)time;
@@ -14833,6 +15212,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
case WZ_FIREPILLAR:
if(skill_lv < 5)
break;
+ FALLTHROUGH
case HW_GRAVITATION:
case MG_SAFETYWALL:
case MG_STONECURSE:
@@ -14894,7 +15274,8 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
/*==========================================
* Does delay reductions based on dex/agi, sc data, item bonuses, ...
*------------------------------------------*/
-int skill_delay_fix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
+int skill_delay_fix (struct block_list *bl, uint16 skill_id, uint16 skill_lv)
+{
int delaynodex = skill->get_delaynodex(skill_id, skill_lv);
int time = skill->get_delay(skill_id, skill_lv);
struct map_session_data *sd;
@@ -14993,7 +15374,8 @@ struct square {
int val2[5];
};
-void skill_brandishspear_first (struct square *tc, uint8 dir, int16 x, int16 y) {
+void skill_brandishspear_first (struct square *tc, uint8 dir, int16 x, int16 y)
+{
nullpo_retv(tc);
if(dir == 0){
@@ -15088,7 +15470,8 @@ void skill_brandishspear_first (struct square *tc, uint8 dir, int16 x, int16 y)
}
-void skill_brandishspear_dir (struct square* tc, uint8 dir, int are) {
+void skill_brandishspear_dir (struct square* tc, uint8 dir, int are)
+{
int c;
nullpo_retv(tc);
@@ -15106,11 +15489,17 @@ void skill_brandishspear_dir (struct square* tc, uint8 dir, int are) {
}
}
-void skill_brandishspear(struct block_list* src, struct block_list* bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
+void skill_brandishspear(struct block_list* src, struct block_list* bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag)
+{
int c,n=4;
- uint8 dir = map->calc_dir(src,bl->x,bl->y);
+ uint8 dir;
struct square tc;
- int x=bl->x,y=bl->y;
+ int x, y;
+
+ nullpo_retv(bl);
+ x = bl->x;
+ y = bl->y;
+ dir = map->calc_dir(src, x, y);
skill->brandishspear_first(&tc,dir,x,y);
skill->brandishspear_dir(&tc,dir,4);
skill->area_temp[1] = bl->id;
@@ -15155,7 +15544,8 @@ void skill_brandishspear(struct block_list* src, struct block_list* bl, uint16 s
/*==========================================
* Weapon Repair [Celest/DracoRPG]
*------------------------------------------*/
-void skill_repairweapon (struct map_session_data *sd, int idx) {
+void skill_repairweapon (struct map_session_data *sd, int idx)
+{
int material;
int materials[4] = {
ITEMID_IRON_ORE,
@@ -15177,7 +15567,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) {
return; //Invalid index??
item = &target_sd->status.inventory[idx];
- if( item->nameid <= 0 || item->attribute == 0 )
+ if( item->nameid <= 0 || (item->attribute & ATTR_BROKEN) == 0 )
return; //Again invalid item....
if( sd != target_sd && !battle->check_range(&sd->bl,&target_sd->bl, skill->get_range2(&sd->bl, sd->menuskill_id,sd->menuskill_val2) ) ){
@@ -15196,7 +15586,8 @@ void skill_repairweapon (struct map_session_data *sd, int idx) {
clif->skill_nodamage(&sd->bl,&target_sd->bl,sd->menuskill_id,1,1);
- item->attribute = 0;/* clear broken state */
+ item->attribute |= ATTR_BROKEN;
+ item->attribute ^= ATTR_BROKEN; /* clear broken state */
clif->equiplist(target_sd);
@@ -15261,20 +15652,20 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
return;
}
- per = status->get_refine_chance(ditem->wlv, (int)item->refine) * 10;
+ per = status->get_refine_chance(ditem->wlv, (int)item->refine, REFINE_CHANCE_TYPE_NORMAL) * 10;
// Aegis leaked formula. [malufett]
- if( sd->status.class_ == JOB_MECHANIC_T )
+ if (sd->status.class == JOB_MECHANIC_T)
per += 100;
else
- per += 5 * ((signed int)sd->status.job_level - 50);
+ per += 5 * (sd->status.job_level - 50);
- pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); // FIXME: is this the correct reason flag?
+ pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_REFINE); // FIXME: is this the correct reason flag?
if (per > rnd() % 1000) {
int ep = 0;
- logs->pick_pc(sd, LOG_TYPE_OTHER, -1, item, ditem);
+ logs->pick_pc(sd, LOG_TYPE_REFINE, -1, item, ditem);
item->refine++;
- logs->pick_pc(sd, LOG_TYPE_OTHER, 1, item, ditem);
+ logs->pick_pc(sd, LOG_TYPE_REFINE, 1, item, ditem);
if(item->equip) {
ep = item->equip;
pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
@@ -15290,16 +15681,16 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
item->card[0] == CARD0_FORGE &&
(int)MakeDWord(item->card[2],item->card[3]) == sd->status.char_id)
{ // Fame point system [DracoRPG]
- switch(ditem->wlv){
- case 1:
- pc->addfame(sd,1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
- break;
- case 2:
- pc->addfame(sd,25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
- break;
- case 3:
- pc->addfame(sd,1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
- break;
+ switch (ditem->wlv) {
+ case 1:
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 1); // Success to refine to +10 a lv1 weapon you forged = +1 fame point
+ break;
+ case 2:
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 25); // Success to refine to +10 a lv2 weapon you forged = +25 fame point
+ break;
+ case 3:
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 1000); // Success to refine to +10 a lv3 weapon you forged = +1000 fame point
+ break;
}
}
} else {
@@ -15307,7 +15698,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
if(item->equip)
pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
clif->refine(sd->fd,1,idx,item->refine);
- pc->delitem(sd, idx, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER);
+ pc->delitem(sd, idx, 1, 0, DELITEM_NORMAL, LOG_TYPE_REFINE);
clif->misceffect(&sd->bl,2);
clif->emotion(&sd->bl, E_OMG);
}
@@ -15498,10 +15889,12 @@ int skill_frostjoke_scream(struct block_list *bl, va_list ap)
/*==========================================
*
*------------------------------------------*/
-void skill_unitsetmapcell (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag) {
+void skill_unitsetmapcell (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag)
+{
int range = skill->get_unit_range(skill_id,skill_lv);
int x,y;
+ nullpo_retv(src);
for( y = src->bl.y - range; y <= src->bl.y + range; ++y )
for( x = src->bl.x - range; x <= src->bl.x + range; ++x )
map->list[src->bl.m].setcell(src->bl.m, x, y, cell, flag);
@@ -15510,11 +15903,14 @@ void skill_unitsetmapcell (struct skill_unit *src, uint16 skill_id, uint16 skill
/*==========================================
*
*------------------------------------------*/
-int skill_attack_area(struct block_list *bl, va_list ap) {
+int skill_attack_area(struct block_list *bl, va_list ap)
+{
struct block_list *src,*dsrc;
int atk_type,skill_id,skill_lv,flag,type;
int64 tick;
+ nullpo_ret(bl);
+
if(status->isdead(bl))
return 0;
@@ -15594,7 +15990,8 @@ int skill_clear_group (struct block_list *bl, int flag)
/*==========================================
* Returns the first element field found [Skotlex]
*------------------------------------------*/
-struct skill_unit_group *skill_locate_element_field(struct block_list *bl) {
+struct skill_unit_group *skill_locate_element_field(struct block_list *bl)
+{
struct unit_data *ud = unit->bl2ud(bl);
int i;
nullpo_ret(bl);
@@ -15932,7 +16329,8 @@ int skill_trap_splash(struct block_list *bl, va_list ap)
/*==========================================
*
*------------------------------------------*/
-int skill_enchant_elemental_end (struct block_list *bl, int type) {
+int skill_enchant_elemental_end(struct block_list *bl, int type)
+{
struct status_change *sc;
const enum sc_type scs[] = { SC_ENCHANTPOISON, SC_ASPERSIO, SC_PROPERTYFIRE, SC_PROPERTYWATER, SC_PROPERTYWIND, SC_PROPERTYGROUND, SC_PROPERTYDARK, SC_PROPERTYTELEKINESIS, SC_ENCHANTARMS };
int i;
@@ -15950,14 +16348,15 @@ int skill_enchant_elemental_end (struct block_list *bl, int type) {
bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce)
{
- static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
- static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
bool wall = true;
+ nullpo_retr(false, bl);
if( (bl->type == BL_PC && battle_config.pc_cloak_check_type&1)
|| (bl->type != BL_PC && battle_config.monster_cloak_check_type&1)
) {
//Check for walls.
+ static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
+ static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
int i;
ARR_FIND( 0, 8, i, map->getcell(bl->m, bl, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
if( i == 8 )
@@ -15986,7 +16385,8 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce
/**
* Verifies if an user can use SC_CLOAKING
**/
-bool skill_can_cloak(struct map_session_data *sd) {
+bool skill_can_cloak(struct map_session_data *sd)
+{
nullpo_retr(false, sd);
//Avoid cloaking with no wall and low skill level. [Skotlex]
@@ -16015,11 +16415,12 @@ int skill_check_cloaking_end(struct block_list *bl, va_list ap)
bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *sce)
{
- static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
- static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
bool wall = true;
+ nullpo_retr(false, bl);
if( bl->type == BL_PC ) { //Check for walls.
+ static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
+ static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
int i;
ARR_FIND( 0, 8, i, map->getcell(bl->m, bl, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
if( i == 8 )
@@ -16079,7 +16480,8 @@ bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit)
/*==========================================
*
*------------------------------------------*/
-struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2) {
+struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2)
+{
struct skill_unit *su;
nullpo_retr(NULL, group);
@@ -16131,7 +16533,8 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int
/*==========================================
*
*------------------------------------------*/
-int skill_delunit (struct skill_unit* su) {
+int skill_delunit (struct skill_unit* su)
+{
struct skill_unit_group *group;
nullpo_ret(su);
@@ -16452,6 +16855,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list
struct skill_unit_group_tickset *set;
nullpo_ret(bl);
+ nullpo_ret(group);
if (group->interval==-1)
return NULL;
@@ -16474,7 +16878,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list
}
if (j == -1) {
- ShowWarning ("skill_unitgrouptickset_search: tickset is full. ( failed for skill '%s' on unit %d )\n",skill->get_name(group->skill_id),bl->type);
+ ShowWarning ("skill_unitgrouptickset_search: tickset is full. ( failed for skill '%s' on unit %u )\n", skill->get_name(group->skill_id), bl->type);
j = id % MAX_SKILLUNITGROUPTICKSET;
}
@@ -16486,10 +16890,16 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list
/*==========================================
*
*------------------------------------------*/
-int skill_unit_timer_sub_onplace(struct block_list* bl, va_list ap) {
- struct skill_unit* su = va_arg(ap,struct skill_unit *);
- struct skill_unit_group* group = su->group;
- int64 tick = va_arg(ap,int64);
+int skill_unit_timer_sub_onplace(struct block_list* bl, va_list ap)
+{
+ struct skill_unit* su;
+ struct skill_unit_group* group;
+ int64 tick;
+
+ su = va_arg(ap,struct skill_unit *);
+ nullpo_ret(su);
+ group = su->group;
+ tick = va_arg(ap,int64);
if( !su->alive || bl->prev == NULL )
return 0;
@@ -16510,12 +16920,18 @@ int skill_unit_timer_sub_onplace(struct block_list* bl, va_list ap) {
/**
* @see DBApply
*/
-int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
- struct skill_unit* su = DB->data2ptr(data);
- struct skill_unit_group* group = su->group;
+int skill_unit_timer_sub(union DBKey key, struct DBData *data, va_list ap)
+{
+ struct skill_unit* su;
+ struct skill_unit_group* group;
int64 tick = va_arg(ap,int64);
bool dissonance;
- struct block_list* bl = &su->bl;
+ struct block_list* bl;
+
+ su = DB->data2ptr(data);
+ nullpo_ret(su);
+ group = su->group;
+ bl = &su->bl;
if( !su->alive )
return 0;
@@ -16548,6 +16964,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
skill->delunit(su);
break;
}
+ FALLTHROUGH
case UNT_SKIDTRAP:
case UNT_LANDMINE:
case UNT_SHOCKWAVE:
@@ -16572,7 +16989,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
// revert unit back into a trap
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
- item_tmp.nameid = group->item_id?group->item_id:ITEMID_TRAP;
+ item_tmp.nameid = group->item_id ? group->item_id : ITEMID_BOOBY_TRAP;
item_tmp.identify = 1;
map->addflooritem(bl, &item_tmp, 1, bl->m, bl->x, bl->y, 0, 0, 0, 0);
}
@@ -16625,7 +17042,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
case UNT_FEINTBOMB: {
struct block_list *src = map->id2bl(group->src_id);
if( src ) {
- map->foreachinrange(skill->area_sub, &su->bl, su->range, splash_target(src), src, SC_FEINTBOMB, group->skill_lv, tick, BCT_ENEMY|SD_ANIMATION|1, skill->castend_damage_id);
+ map->foreachinrange(skill->area_sub, &su->bl, su->range, skill->splash_target(src), src, SC_FEINTBOMB, group->skill_lv, tick, BCT_ENEMY|SD_ANIMATION|1, skill->castend_damage_id);
status_change_end(src, SC__FEINTBOMB_MASTER, INVALID_TIMER);
}
skill->delunit(su);
@@ -16723,7 +17140,8 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
/*==========================================
* Executes on all skill units every SKILLUNITTIMER_INTERVAL milliseconds.
*------------------------------------------*/
-int skill_unit_timer(int tid, int64 tick, int id, intptr_t data) {
+int skill_unit_timer(int tid, int64 tick, int id, intptr_t data)
+{
map->freeblock_lock();
skill->unit_db->foreach(skill->unit_db, skill->unit_timer_sub, tick);
@@ -16749,6 +17167,7 @@ int skill_unit_move_sub(struct block_list* bl, va_list ap)
uint16 skill_id;
int i;
+ nullpo_ret(target);
nullpo_ret(bl);
Assert_ret(bl->type == BL_SKILL);
su = BL_UCAST(BL_SKILL, bl);
@@ -16835,7 +17254,8 @@ int skill_unit_move_sub(struct block_list* bl, va_list ap)
* units to figure out when they have left a group.
* flag&4: Force a onleft event (triggered when the bl is killed, for example)
*------------------------------------------*/
-int skill_unit_move(struct block_list *bl, int64 tick, int flag) {
+int skill_unit_move(struct block_list *bl, int64 tick, int flag)
+{
nullpo_ret(bl);
if( bl->prev == NULL )
@@ -16860,7 +17280,8 @@ int skill_unit_move(struct block_list *bl, int64 tick, int flag) {
/*==========================================
*
*------------------------------------------*/
-int skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16 dx, int16 dy) {
+int skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16 dx, int16 dy)
+{
int i,j;
int64 tick = timer->gettick();
int *m_flag;
@@ -17012,7 +17433,8 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
/*==========================================
*
*------------------------------------------*/
-int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty) {
+int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty)
+{
int slot[3];
int i,sc,ele,idx,equip,wlv,make_per = 0,flag = 0,skill_lv = 0;
int num = -1; // exclude the recipe
@@ -17207,12 +17629,15 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
case ITEMID_HAGALAZ:
case ITEMID_OTHILA:
D -= 500; //Rank C
+ FALLTHROUGH
case ITEMID_ISA:
case ITEMID_WYRD:
D -= 500; //Rank B
+ FALLTHROUGH
case ITEMID_NAUTHIZ:
case ITEMID_URUZ:
D -= 500; //Rank A
+ FALLTHROUGH
case ITEMID_BERKANA:
case ITEMID_LUX_ANIMA:
D -= 500; //Rank S
@@ -17373,7 +17798,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
make_per = make_per * battle_config.wp_rate / 100;
}
- if (sd->class_&JOBL_BABY) //if it's a Baby Class
+ if ((sd->job & JOBL_BABY) != 0) //if it's a Baby Class
make_per = (make_per * 50) / 100; //Baby penalty is 50% (bugreport:4847)
if(make_per < 1) make_per = 1;
@@ -17437,8 +17862,8 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
if(equip){
clif->produce_effect(sd,0,nameid);
clif->misceffect(&sd->bl,3);
- if(itemdb_wlv(nameid) >= 3 && ((ele? 1 : 0) + sc) >= 3) // Fame point system [DracoRPG]
- pc->addfame(sd,10); // Success to forge a lv3 weapon with 3 additional ingredients = +10 fame point
+ if (itemdb_wlv(nameid) >= 3 && ((ele? 1 : 0) + sc) >= 3) // Fame point system [DracoRPG]
+ pc->addfame(sd, RANKTYPE_BLACKSMITH, 10); // Success to forge a lv3 weapon with 3 additional ingredients = +10 fame point
} else {
int fame = 0;
tmp_item.amount = 0;
@@ -17478,8 +17903,9 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid,
sd->potion_success_counter = 0;
}
- if (fame)
- pc->addfame(sd,fame);
+ if (fame != 0 && (skill_id == AM_PHARMACY || skill_id == AM_TWILIGHT1 || skill_id == AM_TWILIGHT2 || skill_id == AM_TWILIGHT3)) {
+ pc->addfame(sd, RANKTYPE_ALCHEMIST, fame);
+ }
//Visual effects and the like.
switch (skill_id) {
case AM_PHARMACY:
@@ -17657,7 +18083,9 @@ int skill_arrow_create (struct map_session_data *sd, int nameid)
return 0;
}
-int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
+
+int skill_poisoningweapon(struct map_session_data *sd, int nameid)
+{
sc_type type;
int chance, i;
nullpo_ret(sd);
@@ -17680,7 +18108,7 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
return 0;
}
- status_change_end(&sd->bl, SC_POISONINGWEAPON, -1);//Status must be forced to end so that a new poison will be applied if a player decides to change poisons. [Rytech]
+ status_change_end(&sd->bl, SC_POISONINGWEAPON, INVALID_TIMER); // Status must be forced to end so that a new poison will be applied if a player decides to change poisons. [Rytech]
chance = 2 + 2 * sd->menuskill_val; // 2 + 2 * skill_lv
sc_start4(&sd->bl, &sd->bl, SC_POISONINGWEAPON, 100, pc->checkskill(sd, GC_RESEARCHNEWPOISON), //in Aegis it store the level of GC_RESEARCHNEWPOISON in val1
type, chance, 0, skill->get_time(GC_POISONINGWEAPON, sd->menuskill_val));
@@ -17688,7 +18116,8 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) {
return 0;
}
-void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
+void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id)
+{
struct status_change *sc = status->get_sc(bl);
// non-offensive and non-magic skills do not affect the status
@@ -17712,7 +18141,8 @@ void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
}
}
-int skill_magicdecoy(struct map_session_data *sd, int nameid) {
+int skill_magicdecoy(struct map_session_data *sd, int nameid)
+{
int x, y, i, class_ = 0, skill_id;
struct mob_data *md;
nullpo_ret(sd);
@@ -17734,16 +18164,16 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
sd->menuskill_val = 0;
switch (nameid) {
- case ITEMID_SCARLET_POINT:
+ case ITEMID_SCARLET_PTS:
class_ = MOBID_MAGICDECOY_FIRE;
break;
- case ITEMID_INDIGO_POINT:
+ case ITEMID_INDIGO_PTS:
class_ = MOBID_MAGICDECOY_WATER;
break;
- case ITEMID_LIME_GREEN_POINT:
+ case ITEMID_LIME_GREEN_PTS:
class_ = MOBID_MAGICDECOY_WIND;
break;
- case ITEMID_YELLOW_WISH_POINT:
+ case ITEMID_YELLOW_WISH_PTS:
class_ = MOBID_MAGICDECOY_EARTH;
break;
}
@@ -17763,7 +18193,8 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
}
// Warlock Spellbooks. [LimitLine/3CeAM]
-int skill_spellbook (struct map_session_data *sd, int nameid) {
+int skill_spellbook(struct map_session_data *sd, int nameid)
+{
int i, max_preserve, skill_id, point;
struct status_change *sc;
@@ -17800,18 +18231,20 @@ int skill_spellbook (struct map_session_data *sd, int nameid) {
for(i = SC_SPELLBOOK7; i >= SC_SPELLBOOK1; i--){ // This is how official saves spellbook. [malufett]
if( !sc->data[i] ){
sc->data[SC_READING_SB]->val2 += point; // increase points
- sc_start4(&sd->bl,&sd->bl, (sc_type)i, 100, skill_id, pc->checkskill(sd,skill_id), point, 0, INVALID_TIMER);
+ sc_start4(&sd->bl, &sd->bl, (sc_type)i, 100, skill_id, pc->checkskill(sd, skill_id), point, 0, INFINITE_DURATION);
break;
}
}
- }else{
- sc_start2(&sd->bl,&sd->bl, SC_READING_SB, 100, 0, point, INVALID_TIMER);
- sc_start4(&sd->bl,&sd->bl, SC_SPELLBOOK7, 100, skill_id, pc->checkskill(sd,skill_id), point, 0, INVALID_TIMER);
+ } else {
+ sc_start2(&sd->bl, &sd->bl, SC_READING_SB, 100, 0, point, INFINITE_DURATION);
+ sc_start4(&sd->bl, &sd->bl, SC_SPELLBOOK7, 100, skill_id, pc->checkskill(sd, skill_id), point, 0, INFINITE_DURATION);
}
return 1;
}
-int skill_select_menu(struct map_session_data *sd,uint16 skill_id) {
+
+int skill_select_menu(struct map_session_data *sd,uint16 skill_id)
+{
int id, lv, prob, aslvl = 0, idx = 0;
nullpo_ret(sd);
@@ -17834,27 +18267,31 @@ int skill_select_menu(struct map_session_data *sd,uint16 skill_id) {
sc_start4(&sd->bl,&sd->bl,SC__AUTOSHADOWSPELL,100,id,lv,prob,0,skill->get_time(SC_AUTOSHADOWSPELL,aslvl));
return 0;
}
-int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv, unsigned short* item_list) {
+
+int skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list)
+{
int i;
nullpo_ret(sd);
nullpo_ret(item_list);
- if( n <= 0 )
+ if (VECTOR_LENGTH(*item_list) <= 0)
return 1;
- for (i = 0; i < n; i++) {
- int nameid, add_amount, del_amount, idx, product;
+ for (i = 0; i < VECTOR_LENGTH(*item_list); i++) {
struct item tmp_item;
-
- idx = item_list[i*2+0]-2;
- del_amount = item_list[i*2+1];
+ const struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i);
+ int nameid, add_amount, product;
+ int del_amount = entry->amount;
+ int idx = entry->id;
if( skill_lv == 2 )
del_amount -= (del_amount % 10);
add_amount = (skill_lv == 1) ? del_amount * (5 + rnd()%5) : del_amount / 10 ;
- if( (nameid = sd->status.inventory[idx].nameid) <= 0 || del_amount > sd->status.inventory[idx].amount ) {
+ if (idx < 0 || idx >= MAX_INVENTORY
+ || (nameid = sd->status.inventory[idx].nameid) <= 0
+ || del_amount < 0 || del_amount > sd->status.inventory[idx].amount) {
clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0);
return 1;
}
@@ -17904,7 +18341,8 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
return 0;
}
-int skill_changematerial(struct map_session_data *sd, int n, unsigned short *item_list) {
+int skill_changematerial(struct map_session_data *sd, const struct itemlist *item_list)
+{
int i, j, k, c, p = 0, nameid, amount;
nullpo_ret(sd);
@@ -17919,11 +18357,13 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
// Verification of overlap between the objects required and the list submitted.
for( j = 0; j < MAX_PRODUCE_RESOURCE; j++ ) {
if( skill->dbs->produce_db[i].mat_id[j] > 0 ) {
- for( k = 0; k < n; k++ ) {
- int idx = item_list[k*2+0]-2;
+ for (k = 0; k < VECTOR_LENGTH(*item_list); k++) {
+ const struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, k);
+ int idx = entry->id;
+ Assert_ret(idx >= 0 && idx < MAX_INVENTORY);
+ amount = entry->amount;
nameid = sd->status.inventory[idx].nameid;
- amount = item_list[k*2+1];
- if( nameid > 0 && sd->status.inventory[idx].identify == 0 ){
+ if (nameid > 0 && sd->status.inventory[idx].identify == 0) {
clif->msgtable_skill(sd, GN_CHANGEMATERIAL, MSG_SKILL_ITEM_NEED_IDENTIFY);
return 0;
}
@@ -17936,7 +18376,7 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
break; // No more items required
}
p++;
- } while(n == j && c == n);
+ } while (c == j && VECTOR_LENGTH(*item_list) == c);
p--;
if ( p > 0 ) {
skill->produce_mix(sd,GN_CHANGEMATERIAL,skill->dbs->produce_db[i].nameid,0,0,0,p);
@@ -17950,6 +18390,7 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
return 0;
}
+
/**
* for Royal Guard's LG_TRAMPLE
**/
@@ -17985,10 +18426,12 @@ int skill_destroy_trap(struct block_list *bl, va_list ap)
}
return 0;
}
+
/*==========================================
*
*------------------------------------------*/
-int skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) {
+int skill_blockpc_end(int tid, int64 tick, int id, intptr_t data)
+{
struct map_session_data *sd = map->id2sd(id);
struct skill_cd * cd = NULL;
@@ -18040,7 +18483,8 @@ int skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) {
* @param tick the length of time the delay should last
* @return 0 if successful, -1 otherwise
*/
-int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) {
+int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick)
+{
struct skill_cd* cd = NULL;
uint16 idx = skill->get_index(skill_id);
int64 now = timer->gettick();
@@ -18135,7 +18579,9 @@ int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data)
return 1;
}
-int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { // [orn]
+// [orn]
+int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick)
+{
uint16 idx = skill->get_index(skill_id);
nullpo_retr (-1, hd);
@@ -18177,12 +18623,15 @@ int skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tick)
md->blockskill[idx] = 1;
return timer->add(timer->gettick() + tick, skill->blockmerc_end, md->bl.id, idx);
}
+
/**
* Adds a new skill unit entry for this player to recast after map load
**/
-void skill_usave_add(struct map_session_data * sd, uint16 skill_id, uint16 skill_lv) {
+void skill_usave_add(struct map_session_data * sd, uint16 skill_id, uint16 skill_lv)
+{
struct skill_unit_save * sus = NULL;
+ nullpo_retv(sd);
if( idb_exists(skill->usave_db,sd->status.char_id) ) {
idb_remove(skill->usave_db,sd->status.char_id);
}
@@ -18195,9 +18644,12 @@ void skill_usave_add(struct map_session_data * sd, uint16 skill_id, uint16 skill
return;
}
-void skill_usave_trigger(struct map_session_data *sd) {
+
+void skill_usave_trigger(struct map_session_data *sd)
+{
struct skill_unit_save * sus = NULL;
+ nullpo_retv(sd);
if( ! (sus = idb_get(skill->usave_db,sd->status.char_id)) ) {
return;
}
@@ -18215,6 +18667,8 @@ int skill_split_atoi(char *str, int *val)
{
int i, j, step = 1;
+ nullpo_ret(val);
+
for (i=0; i<MAX_SKILL_LEVEL; i++) {
if (!str) break;
val[i] = atoi(str);
@@ -18427,7 +18881,7 @@ void skill_init_unit_layout (void)
}
break;
default:
- ShowError("unknown unit layout at skill %d\n",i);
+ skill->init_unit_layout_unknown(i);
break;
}
if (!skill->dbs->unit_layout[pos].count)
@@ -18528,7 +18982,13 @@ void skill_init_unit_layout (void)
}
-int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) {
+void skill_init_unit_layout_unknown(int skill_idx)
+{
+ ShowError("unknown unit layout at skill %d\n", skill_idx);
+}
+
+int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id)
+{
int inf = 0;
struct status_change *sc = status->get_sc(bl);
@@ -18675,7 +19135,8 @@ int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) {
return 0;
}
-int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) {
+int skill_get_elemental_type(uint16 skill_id , uint16 skill_lv)
+{
int type = 0;
switch (skill_id) {
@@ -18694,7 +19155,8 @@ int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) {
* update stored skill cooldowns for player logout
* @param sd the affected player structure
*/
-void skill_cooldown_save(struct map_session_data * sd) {
+void skill_cooldown_save(struct map_session_data * sd)
+{
int i;
struct skill_cd* cd = NULL;
int64 now = 0;
@@ -18722,7 +19184,8 @@ void skill_cooldown_save(struct map_session_data * sd) {
* reload stored skill cooldowns when a player logs in.
* @param sd the affected player structure
*/
-void skill_cooldown_load(struct map_session_data * sd) {
+void skill_cooldown_load(struct map_session_data * sd)
+{
int i;
struct skill_cd* cd = NULL;
int64 now = 0;
@@ -18746,225 +19209,14 @@ void skill_cooldown_load(struct map_session_data * sd) {
}
}
-/*==========================================
- * sub-function of DB reading.
- * skill_db.txt
- *------------------------------------------*/
-bool skill_parse_row_skilldb(char* split[], int columns, int current) {
-// id,range,hit,inf,element,nk,splash,max,list_num,castcancel,cast_defence_rate,inf2,maxcount,skill_type,blow_count,name,description
- uint16 skill_id = atoi(split[0]);
- uint16 idx;
- if( (skill_id >= GD_SKILLRANGEMIN && skill_id <= GD_SKILLRANGEMAX)
- || (skill_id >= HM_SKILLRANGEMIN && skill_id <= HM_SKILLRANGEMAX)
- || (skill_id >= MC_SKILLRANGEMIN && skill_id <= MC_SKILLRANGEMAX)
- || (skill_id >= EL_SKILLRANGEMIN && skill_id <= EL_SKILLRANGEMAX) ) {
- ShowWarning("skill_parse_row_skilldb: Skill id %d is forbidden (interferes with guild/homun/mercenary skill mapping)!\n", skill_id);
- return false;
- }
-
- idx = skill->get_index(skill_id);
- if( !idx ) // invalid skill id
- return false;
-
- skill->dbs->db[idx].nameid = skill_id;
- skill->split_atoi(split[1],skill->dbs->db[idx].range);
- skill->dbs->db[idx].hit = atoi(split[2]);
- skill->dbs->db[idx].inf = atoi(split[3]);
- skill->split_atoi(split[4],skill->dbs->db[idx].element);
- skill->dbs->db[idx].nk = (int)strtol(split[5], NULL, 0);
- skill->split_atoi(split[6],skill->dbs->db[idx].splash);
- skill->dbs->db[idx].max = atoi(split[7]);
- skill->split_atoi(split[8],skill->dbs->db[idx].num);
-
- if( strcmpi(split[9],"yes") == 0 )
- skill->dbs->db[idx].castcancel = 1;
- else
- skill->dbs->db[idx].castcancel = 0;
- skill->dbs->db[idx].cast_def_rate = atoi(split[10]);
- skill->dbs->db[idx].inf2 = (int)strtol(split[11], NULL, 0);
- skill->split_atoi(split[12],skill->dbs->db[idx].maxcount);
- if( strcmpi(split[13],"weapon") == 0 )
- skill->dbs->db[idx].skill_type = BF_WEAPON;
- else if( strcmpi(split[13],"magic") == 0 )
- skill->dbs->db[idx].skill_type = BF_MAGIC;
- else if( strcmpi(split[13],"misc") == 0 )
- skill->dbs->db[idx].skill_type = BF_MISC;
- else
- skill->dbs->db[idx].skill_type = 0;
- skill->split_atoi(split[14],skill->dbs->db[idx].blewcount);
- safestrncpy(skill->dbs->db[idx].name, trim(split[15]), sizeof(skill->dbs->db[idx].name));
- safestrncpy(skill->dbs->db[idx].desc, trim(split[16]), sizeof(skill->dbs->db[idx].desc));
- strdb_iput(skill->name2id_db, skill->dbs->db[idx].name, skill_id);
- script->set_constant2(skill->dbs->db[idx].name, (int)skill_id, false, false);
-
- return true;
-}
-
-bool skill_parse_row_requiredb(char* split[], int columns, int current) {
-// skill_id,HPCost,MaxHPTrigger,SPCost,HPRateCost,SPRateCost,ZenyCost,RequiredWeapons,RequiredAmmoTypes,RequiredAmmoAmount,RequiredState,SpiritSphereCost,RequiredItemID1,RequiredItemAmount1,RequiredItemID2,RequiredItemAmount2,RequiredItemID3,RequiredItemAmount3,RequiredItemID4,RequiredItemAmount4,RequiredItemID5,RequiredItemAmount5,RequiredItemID6,RequiredItemAmount6,RequiredItemID7,RequiredItemAmount7,RequiredItemID8,RequiredItemAmount8,RequiredItemID9,RequiredItemAmount9,RequiredItemID10,RequiredItemAmount10
- char* p;
- int j;
-
- uint16 skill_id = atoi(split[0]);
- uint16 idx = skill->get_index(skill_id);
- if( !idx ) // invalid skill id
- return false;
-
- skill->split_atoi(split[1],skill->dbs->db[idx].hp);
- skill->split_atoi(split[2],skill->dbs->db[idx].mhp);
- skill->split_atoi(split[3],skill->dbs->db[idx].sp);
- skill->split_atoi(split[4],skill->dbs->db[idx].hp_rate);
- skill->split_atoi(split[5],skill->dbs->db[idx].sp_rate);
- skill->split_atoi(split[6],skill->dbs->db[idx].zeny);
-
- //Which weapon type are required, see doc/item_db for types
- p = split[7];
- for( j = 0; j < 32; j++ ) {
- int l = atoi(p);
- if( l == 99 ) { // Any weapon
- skill->dbs->db[idx].weapon = 0;
- break;
- } else
- skill->dbs->db[idx].weapon |= 1<<l;
- p = strchr(p,':');
- if(!p)
- break;
- p++;
- }
-
- //FIXME: document this
- p = split[8];
- for( j = 0; j < 32; j++ ) {
- int l = atoi(p);
- if( l == 99 ) { // Any ammo type
- skill->dbs->db[idx].ammo = 0xFFFFFFFF;
- break;
- } else if( l ) // 0 stands for no requirement
- skill->dbs->db[idx].ammo |= 1<<l;
- p = strchr(p,':');
- if( !p )
- break;
- p++;
- }
- skill->split_atoi(split[9],skill->dbs->db[idx].ammo_qty);
-
- if( strcmpi(split[10],"hiding") == 0 ) skill->dbs->db[idx].state = ST_HIDING;
- else if( strcmpi(split[10],"cloaking") == 0 ) skill->dbs->db[idx].state = ST_CLOAKING;
- else if( strcmpi(split[10],"hidden") == 0 ) skill->dbs->db[idx].state = ST_HIDDEN;
- else if( strcmpi(split[10],"riding") == 0 ) skill->dbs->db[idx].state = ST_RIDING;
- else if( strcmpi(split[10],"falcon") == 0 ) skill->dbs->db[idx].state = ST_FALCON;
- else if( strcmpi(split[10],"cart") == 0 ) skill->dbs->db[idx].state = ST_CART;
- else if( strcmpi(split[10],"shield") == 0 ) skill->dbs->db[idx].state = ST_SHIELD;
- else if( strcmpi(split[10],"sight") == 0 ) skill->dbs->db[idx].state = ST_SIGHT;
- else if( strcmpi(split[10],"explosionspirits") == 0 ) skill->dbs->db[idx].state = ST_EXPLOSIONSPIRITS;
- else if( strcmpi(split[10],"cartboost") == 0 ) skill->dbs->db[idx].state = ST_CARTBOOST;
- else if( strcmpi(split[10],"recover_weight_rate") == 0 ) skill->dbs->db[idx].state = ST_RECOV_WEIGHT_RATE;
- else if( strcmpi(split[10],"move_enable") == 0 ) skill->dbs->db[idx].state = ST_MOVE_ENABLE;
- else if( strcmpi(split[10],"water") == 0 ) skill->dbs->db[idx].state = ST_WATER;
- else if( strcmpi(split[10],"dragon") == 0 ) skill->dbs->db[idx].state = ST_RIDINGDRAGON;
- else if( strcmpi(split[10],"warg") == 0 ) skill->dbs->db[idx].state = ST_WUG;
- else if( strcmpi(split[10],"ridingwarg") == 0 ) skill->dbs->db[idx].state = ST_RIDINGWUG;
- else if( strcmpi(split[10],"mado") == 0 ) skill->dbs->db[idx].state = ST_MADO;
- else if( strcmpi(split[10],"elementalspirit") == 0 ) skill->dbs->db[idx].state = ST_ELEMENTALSPIRIT;
- else if( strcmpi(split[10],"poisonweapon") == 0 ) skill->dbs->db[idx].state = ST_POISONINGWEAPON;
- else if( strcmpi(split[10],"rollingcutter") == 0 ) skill->dbs->db[idx].state = ST_ROLLINGCUTTER;
- else if( strcmpi(split[10],"mh_fighting") == 0 ) skill->dbs->db[idx].state = ST_MH_FIGHTING;
- else if( strcmpi(split[10],"mh_grappling") == 0 ) skill->dbs->db[idx].state = ST_MH_GRAPPLING;
- else if( strcmpi(split[10],"peco") == 0 ) skill->dbs->db[idx].state = ST_PECO;
- /**
- * Unknown or no state
- **/
- else skill->dbs->db[idx].state = ST_NONE;
-
- skill->split_atoi(split[11],skill->dbs->db[idx].spiritball);
- for( j = 0; j < MAX_SKILL_ITEM_REQUIRE; j++ ) {
- skill->dbs->db[idx].itemid[j] = atoi(split[12+ 2*j]);
- skill->dbs->db[idx].amount[j] = atoi(split[13+ 2*j]);
- }
-
- return true;
-}
-
-bool skill_parse_row_castdb(char* split[], int columns, int current) {
-// skill_id,CastingTime,AfterCastActDelay,AfterCastWalkDelay,Duration1,Duration2
- uint16 skill_id = atoi(split[0]);
- uint16 idx = skill->get_index(skill_id);
- if( !idx ) // invalid skill id
- return false;
-
- skill->split_atoi(split[1],skill->dbs->db[idx].cast);
- skill->split_atoi(split[2],skill->dbs->db[idx].delay);
- skill->split_atoi(split[3],skill->dbs->db[idx].walkdelay);
- skill->split_atoi(split[4],skill->dbs->db[idx].upkeep_time);
- skill->split_atoi(split[5],skill->dbs->db[idx].upkeep_time2);
- skill->split_atoi(split[6],skill->dbs->db[idx].cooldown);
-#ifdef RENEWAL_CAST
- skill->split_atoi(split[7],skill->dbs->db[idx].fixed_cast);
-#endif
- return true;
-}
-
-bool skill_parse_row_castnodexdb(char* split[], int columns, int current) {
-// Skill id,Cast,Delay (optional)
- uint16 skill_id = atoi(split[0]);
- uint16 idx = skill->get_index(skill_id);
- if( !idx ) // invalid skill id
- return false;
-
- skill->split_atoi(split[1],skill->dbs->db[idx].castnodex);
- if( split[2] ) // optional column
- skill->split_atoi(split[2],skill->dbs->db[idx].delaynodex);
-
- return true;
-}
-
-bool skill_parse_row_unitdb(char* split[], int columns, int current) {
-// ID,unit ID,unit ID 2,layout,range,interval,target,flag
- uint16 skill_id = atoi(split[0]);
- uint16 idx = skill->get_index(skill_id);
- if( !idx ) // invalid skill id
- return false;
-
- skill->dbs->db[idx].unit_id[0] = (int)strtol(split[1],NULL,16);
- skill->dbs->db[idx].unit_id[1] = (int)strtol(split[2],NULL,16);
- skill->split_atoi(split[3],skill->dbs->db[idx].unit_layout_type);
- skill->split_atoi(split[4],skill->dbs->db[idx].unit_range);
- skill->dbs->db[idx].unit_interval = atoi(split[5]);
-
- if( strcmpi(split[6],"noenemy")==0 ) skill->dbs->db[idx].unit_target = BCT_NOENEMY;
- else if( strcmpi(split[6],"friend")==0 ) skill->dbs->db[idx].unit_target = BCT_NOENEMY;
- else if( strcmpi(split[6],"party")==0 ) skill->dbs->db[idx].unit_target = BCT_PARTY;
- else if( strcmpi(split[6],"ally")==0 ) skill->dbs->db[idx].unit_target = BCT_PARTY|BCT_GUILD;
- else if( strcmpi(split[6],"guild")==0 ) skill->dbs->db[idx].unit_target = BCT_GUILD;
- else if( strcmpi(split[6],"all")==0 ) skill->dbs->db[idx].unit_target = BCT_ALL;
- else if( strcmpi(split[6],"enemy")==0 ) skill->dbs->db[idx].unit_target = BCT_ENEMY;
- else if( strcmpi(split[6],"self")==0 ) skill->dbs->db[idx].unit_target = BCT_SELF;
- else if( strcmpi(split[6],"sameguild")==0 ) skill->dbs->db[idx].unit_target = BCT_GUILD|BCT_SAMEGUILD;
- else if( strcmpi(split[6],"noone")==0 ) skill->dbs->db[idx].unit_target = BCT_NOONE;
- else skill->dbs->db[idx].unit_target = (int)strtol(split[6],NULL,16);
-
- skill->dbs->db[idx].unit_flag = (int)strtol(split[7],NULL,16);
-
- if (skill->dbs->db[idx].unit_flag&UF_DEFNOTENEMY && battle_config.defnotenemy)
- skill->dbs->db[idx].unit_target = BCT_NOENEMY;
-
- //By default, target just characters.
- skill->dbs->db[idx].unit_target |= BL_CHAR;
- if (skill->dbs->db[idx].unit_flag&UF_NOPC)
- skill->dbs->db[idx].unit_target &= ~BL_PC;
- if (skill->dbs->db[idx].unit_flag&UF_NOMOB)
- skill->dbs->db[idx].unit_target &= ~BL_MOB;
- if (skill->dbs->db[idx].unit_flag&UF_SKILL)
- skill->dbs->db[idx].unit_target |= BL_SKILL;
-
- return true;
-}
-
-bool skill_parse_row_producedb(char* split[], int columns, int current) {
+bool skill_parse_row_producedb(char* split[], int columns, int current)
+{
// ProduceItemID,ItemLV,RequireSkill,Requireskill_lv,MaterialID1,MaterialAmount1,......
int x,y;
+ int i;
- int i = atoi(split[0]);
+ nullpo_retr(false, split);
+ i = atoi(split[0]);
if( !i )
return false;
@@ -18981,11 +19233,14 @@ bool skill_parse_row_producedb(char* split[], int columns, int current) {
return true;
}
-bool skill_parse_row_createarrowdb(char* split[], int columns, int current) {
+bool skill_parse_row_createarrowdb(char* split[], int columns, int current)
+{
// SourceID,MakeID1,MakeAmount1,...,MakeID5,MakeAmount5
int x,y;
- int i = atoi(split[0]);
+ int i;
+ nullpo_retr(false, split);
+ i = atoi(split[0]);
if( !i )
return false;
@@ -18998,12 +19253,19 @@ bool skill_parse_row_createarrowdb(char* split[], int columns, int current) {
return true;
}
-bool skill_parse_row_spellbookdb(char* split[], int columns, int current) {
+
+bool skill_parse_row_spellbookdb(char* split[], int columns, int current)
+{
// skill_id,PreservePoints
- uint16 skill_id = atoi(split[0]);
- int points = atoi(split[1]);
- int nameid = atoi(split[2]);
+ uint16 skill_id;
+ int points;
+ int nameid;
+
+ nullpo_retr(false, split);
+ skill_id = atoi(split[0]);
+ points = atoi(split[1]);
+ nameid = atoi(split[2]);
if( !skill->get_index(skill_id) || !skill->get_max(skill_id) )
ShowError("spellbook_db: Invalid skill ID %d\n", skill_id);
@@ -19021,10 +19283,16 @@ bool skill_parse_row_spellbookdb(char* split[], int columns, int current) {
return false;
}
-bool skill_parse_row_improvisedb(char* split[], int columns, int current) {
+
+bool skill_parse_row_improvisedb(char* split[], int columns, int current)
+{
// SkillID,Rate
- uint16 skill_id = atoi(split[0]);
- short j = atoi(split[1]);
+ uint16 skill_id;
+ short j;
+
+ nullpo_retr(false, split);
+ skill_id = atoi(split[0]);
+ j = atoi(split[1]);
if( !skill->get_index(skill_id) || !skill->get_max(skill_id) ) {
ShowError("skill_improvise_db: Invalid skill ID %d\n", skill_id);
@@ -19047,10 +19315,14 @@ bool skill_parse_row_improvisedb(char* split[], int columns, int current) {
return true;
}
-bool skill_parse_row_magicmushroomdb(char* split[], int column, int current) {
+
+bool skill_parse_row_magicmushroomdb(char* split[], int column, int current)
+{
// SkillID
- uint16 skill_id = atoi(split[0]);
+ uint16 skill_id;
+ nullpo_retr(false, split);
+ skill_id = atoi(split[0]);
if( !skill->get_index(skill_id) || !skill->get_max(skill_id) ) {
ShowError("magicmushroom_db: Invalid skill ID %d\n", skill_id);
return false;
@@ -19065,9 +19337,13 @@ bool skill_parse_row_magicmushroomdb(char* split[], int column, int current) {
return true;
}
-bool skill_parse_row_reproducedb(char* split[], int column, int current) {
- uint16 skill_id = atoi(split[0]);
- uint16 idx = skill->get_index(skill_id);
+bool skill_parse_row_reproducedb(char* split[], int column, int current)
+{
+ uint16 skill_id;
+ uint16 idx;
+ nullpo_retr(false, split);
+ skill_id = atoi(split[0]);
+ idx = skill->get_index(skill_id);
if( !idx )
return false;
@@ -19076,9 +19352,12 @@ bool skill_parse_row_reproducedb(char* split[], int column, int current) {
return true;
}
-bool skill_parse_row_abradb(char* split[], int columns, int current) {
+bool skill_parse_row_abradb(char* split[], int columns, int current)
+{
// skill_id,DummyName,RequiredHocusPocusLevel,Rate
- uint16 skill_id = atoi(split[0]);
+ uint16 skill_id;
+ nullpo_retr(false, split);
+ skill_id = atoi(split[0]);
if( !skill->get_index(skill_id) || !skill->get_max(skill_id) ) {
ShowError("abra_db: Invalid skill ID %d\n", skill_id);
return false;
@@ -19095,12 +19374,16 @@ bool skill_parse_row_abradb(char* split[], int columns, int current) {
return true;
}
-bool skill_parse_row_changematerialdb(char* split[], int columns, int current) {
+bool skill_parse_row_changematerialdb(char* split[], int columns, int current)
+{
// ProductID,BaseRate,MakeAmount1,MakeAmountRate1...,MakeAmount5,MakeAmountRate5
- uint16 skill_id = atoi(split[0]);
- short j = atoi(split[1]);
+ uint16 skill_id;
+ short j;
int x,y;
+ nullpo_retr(false, split);
+ skill_id = atoi(split[0]);
+ j = atoi(split[1]);
for(x=0; x<MAX_SKILL_PRODUCE_DB; x++){
if( skill->dbs->produce_db[x].nameid == skill_id )
if( skill->dbs->produce_db[x].req_skill == GN_CHANGEMATERIAL )
@@ -19128,19 +19411,1324 @@ bool skill_parse_row_changematerialdb(char* split[], int columns, int current) {
return true;
}
+#define skilldb_duplicate_warning(name, setting, skill) (ShowError("skill_read_skilldb: Duplicate entry '%s' in setting '%s' for Skill Id %d in '%s', skipping...\n", name, setting, skill, "db/"DBPATH"skill_db.conf"))
+#define skilldb_invalid_error(name, setting, skill) (ShowError("skill_read_skilldb: Invalid entry '%s' in setting '%s' for Skill Id %d in '%s', skipping...\n", name, setting, skill, "db/"DBPATH"skill_db.conf"))
+
+/**
+ * Sets Level based configuration for skill groups from skill_db.conf [ Smokexyz/Hercules ]
+ * @param *conf pointer to config setting.
+ * @param *arr pointer to array to be set.
+ */
+void skill_config_set_level(struct config_setting_t *conf, int *arr)
+{
+ int i=0;
+
+ nullpo_retv(arr);
+ if (config_setting_is_group(conf)) {
+ for (i=0; i<MAX_SKILL_LEVEL; i++) {
+ char level[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL
+ sprintf(level, "Lv%d", i+1);
+ libconfig->setting_lookup_int(conf, level, &arr[i]);
+ }
+ } else if (config_setting_is_array(conf)) {
+ for (i=0; i<config_setting_length(conf) && i < MAX_SKILL_LEVEL; i++) {
+ arr[i] = libconfig->setting_get_int_elem(conf, i);
+ }
+ } else {
+ int val=libconfig->setting_get_int(conf);
+ for(i=0; i<MAX_SKILL_LEVEL; i++) {
+ arr[i] = val;
+ }
+ }
+}
+
+/**
+ * Sets all values in a skill level array to a specified value [ Smokexyz/Hercules ]
+ * @param *arr pointer to array being parsed.
+ * @param value value being set for the array.
+ * @return (void)
+ */
+void skill_level_set_value(int *arr, int value)
+{
+ int i=0;
+
+ nullpo_retv(arr);
+ for(i=0; i<MAX_SKILL_LEVEL; i++) {
+ arr[i] = value;
+ }
+}
+
+void skill_validate_hittype(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ const char *type = NULL;
+
+ nullpo_retv(sk);
+ if (libconfig->setting_lookup_string(conf, "Hit", &type)) {
+ if (strcmpi(type, "BDT_SKILL") == 0) {
+ sk->hit = BDT_SKILL;
+ } else if (strcmpi(type, "BDT_MULTIHIT") == 0) {
+ sk->hit = BDT_MULTIHIT;
+ } else if (strcmpi(type, "BDT_NORMAL") == 0) {
+ sk->hit = BDT_NORMAL;
+ } else {
+ skilldb_invalid_error(type, "Hit", sk->nameid);
+ return;
+ }
+ }
+}
+
+/**
+ * Validates "SkillType" when reading skill_db.conf
+ * @param conf struct, pointer to skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_skilltype(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *t = NULL, *tt = NULL;
+
+ nullpo_retv(sk);
+ if((t=libconfig->setting_get_member(conf, "SkillType")) && config_setting_is_group(t)) {
+ int j=0;
+ while ((tt = libconfig->setting_get_elem(t, j++))) {
+ const char *type = config_setting_name(tt);
+ bool on = libconfig->setting_get_bool_real(tt);
+
+ if (strcmpi(type, "Enemy") == 0) {
+ if (on) {
+ sk->inf |= INF_ATTACK_SKILL;
+ } else {
+ sk->inf &= ~INF_ATTACK_SKILL;
+ }
+ } else if (strcmpi(type, "Place") == 0) {
+ if (on) {
+ sk->inf |= INF_GROUND_SKILL;
+ } else {
+ sk->inf &= ~INF_GROUND_SKILL;
+ }
+ } else if (strcmpi(type, "Self") == 0) {
+ if (on) {
+ sk->inf |= INF_SELF_SKILL;
+ } else {
+ sk->inf &= ~INF_SELF_SKILL;
+ }
+ } else if (strcmpi(type, "Friend") == 0) {
+ if (on) {
+ sk->inf |= INF_SUPPORT_SKILL;
+ } else {
+ sk->inf &= ~INF_SUPPORT_SKILL;
+ }
+ } else if (strcmpi(type, "Trap") == 0) {
+ if (on) {
+ sk->inf |= INF_TARGET_TRAP;
+ } else {
+ sk->inf &= ~INF_TARGET_TRAP;
+ }
+ } else if (strcmpi(type, "Passive") != 0) {
+ skilldb_invalid_error(type, config_setting_name(t), sk->nameid);
+ }
+ }
+ }
+}
+
+/**
+ * Validates "SkillInfo" when reading skill_db.conf
+ * @param conf struct, pointer to skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *t = NULL, *tt = NULL;
+
+ nullpo_retv(sk);
+ if ((t=libconfig->setting_get_member(conf, "SkillInfo")) && config_setting_is_group(t)) {
+ int j=0;
+ while ((tt = libconfig->setting_get_elem(t, j++))) {
+ const char *type = config_setting_name(tt);
+ bool on = libconfig->setting_get_bool_real(tt);
+
+ if (strcmpi(type, "Quest") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_QUEST_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_QUEST_SKILL;
+ }
+ } else if (strcmpi(type, "NPC") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_NPC_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_NPC_SKILL;
+ }
+ } else if (strcmpi(type, "Wedding") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_WEDDING_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_WEDDING_SKILL;
+ }
+ } else if (strcmpi(type, "Spirit") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_SPIRIT_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_SPIRIT_SKILL;
+ }
+ } else if (strcmpi(type, "Guild") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_GUILD_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_GUILD_SKILL;
+ }
+ } else if (strcmpi(type, "Song") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_SONG_DANCE;
+ } else {
+ sk->inf2 &= ~INF2_SONG_DANCE;
+ }
+ } else if (strcmpi(type, "Ensemble") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_ENSEMBLE_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_ENSEMBLE_SKILL;
+ }
+ } else if (strcmpi(type, "Trap") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_TRAP;
+ } else {
+ sk->inf2 &= ~INF2_TRAP;
+ }
+ } else if (strcmpi(type, "TargetSelf") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_TARGET_SELF;
+ } else {
+ sk->inf2 &= ~INF2_TARGET_SELF;
+ }
+ } else if (strcmpi(type, "NoCastSelf") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_NO_TARGET_SELF;
+ } else {
+ sk->inf2 &= ~INF2_NO_TARGET_SELF;
+ }
+ } else if (strcmpi(type, "PartyOnly") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_PARTY_ONLY;
+ } else {
+ sk->inf2 &= ~INF2_PARTY_ONLY;
+ }
+ } else if (strcmpi(type, "GuildOnly") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_GUILD_ONLY;
+ } else {
+ sk->inf2 &= ~INF2_GUILD_ONLY;
+ }
+ } else if (strcmpi(type, "NoEnemy") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_NO_ENEMY;
+ } else {
+ sk->inf2 &= ~INF2_NO_ENEMY;
+ }
+ } else if (strcmpi(type, "IgnoreLandProtector") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_NOLP;
+ } else {
+ sk->inf2 &= ~INF2_NOLP;
+ }
+ } else if (strcmpi(type, "Chorus") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_CHORUS_SKILL;
+ } else {
+ sk->inf2 &= ~INF2_CHORUS_SKILL;
+ }
+ } else if (strcmpi(type, "FreeCastNormal") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_FREE_CAST_NORMAL;
+ } else {
+ sk->inf2 &= ~INF2_FREE_CAST_NORMAL;
+ }
+ } else if (strcmpi(type, "FreeCastReduced") == 0) {
+ if (on) {
+ sk->inf2 |= INF2_FREE_CAST_REDUCED;
+ } else {
+ sk->inf2 &= ~INF2_FREE_CAST_REDUCED;
+ }
+ } else if (strcmpi(type, "None") != 0) {
+ skilldb_invalid_error(type, config_setting_name(t), sk->nameid);
+ }
+ }
+ }
+}
+
+/**
+ * Validates "AttackType" when reading skill_db.conf
+ * @param conf struct, pointer to skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_attacktype(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ const char *type = NULL;
+
+ nullpo_retv(sk);
+ if (libconfig->setting_lookup_string(conf, "AttackType", &type)) {
+ if (!strcmpi(type, "Weapon")) {
+ sk->skill_type = BF_WEAPON;
+ } else if (!strcmpi(type, "Magic")) {
+ sk->skill_type = BF_MAGIC;
+ } else if (!strcmpi(type, "Misc")) {
+ sk->skill_type = BF_MISC;
+ } else {
+ skilldb_invalid_error(type, "AttackType", sk->nameid);
+ return;
+ }
+ }
+}
+
+/**
+ * Validates "Element" when reading skill_db.conf
+ * @param ele_t struct, pointer to skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ const char *type = NULL;
+ struct config_setting_t *t = NULL;
+
+ nullpo_retv(sk);
+ if ((t=libconfig->setting_get_member(conf, "Element")) && config_setting_is_group(t)) {
+ int j = 0;
+ char lv[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL
+
+ for (j=0; j < MAX_SKILL_LEVEL; j++) {
+ sprintf(lv, "Lv%d",j+1);
+ if (libconfig->setting_lookup_string(t, lv, &type)) {
+ if (strcmpi(type,"Ele_Weapon") == 0)
+ sk->element[j] = -1;
+ else if (strcmpi(type,"Ele_Endowed") == 0)
+ sk->element[j] = -2;
+ else if (strcmpi(type,"Ele_Random") == 0)
+ sk->element[j] = -3;
+ else if (!script->get_constant(type,&sk->element[j]))
+ skilldb_invalid_error(type, config_setting_name(conf), sk->nameid);
+ }
+ }
+
+ } else if (libconfig->setting_lookup_string(conf, "Element", &type)) {
+ int ele = 0;
+
+ if (strcmpi(type,"Ele_Weapon") == 0)
+ ele = -1;
+ else if (strcmpi(type,"Ele_Endowed") == 0)
+ ele = -2;
+ else if (strcmpi(type,"Ele_Random") == 0)
+ ele = -3;
+ else if (!script->get_constant(type, &ele)) {
+ skilldb_invalid_error(type, config_setting_name(conf), sk->nameid);
+ return;
+ }
+
+ skill->level_set_value(sk->element, ele);
+ }
+}
+
+/**
+ * Validates "DamageType" when reading skill_db.conf
+ * @param conf struct, pointer to skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_damagetype(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *t = NULL, *tt = NULL;
+
+ nullpo_retv(sk);
+ if ((t=libconfig->setting_get_member(conf, "DamageType")) && config_setting_is_group(t)) {
+ int j=0;
+ while ((tt = libconfig->setting_get_elem(t, j++))) {
+ const char *type = config_setting_name(tt);
+ bool on = libconfig->setting_get_bool_real(tt);
+
+ if (strcmpi(type, "NoDamage") == 0) {
+ if (on) {
+ sk->nk |= NK_NO_DAMAGE;
+ } else {
+ sk->nk &= ~NK_NO_DAMAGE;
+ }
+ } else if (strcmpi(type, "SplashArea") == 0) {
+ if (on) {
+ sk->nk |= NK_SPLASH_ONLY;
+ } else {
+ sk->nk &= ~NK_SPLASH_ONLY;
+ }
+ } else if (strcmpi(type, "SplitDamage") == 0) {
+ if (on) {
+ sk->nk |= NK_SPLASHSPLIT;
+ } else {
+ sk->nk &= ~NK_SPLASHSPLIT;
+ }
+ } else if (strcmpi(type, "IgnoreCards") == 0) {
+ if (on) {
+ sk->nk |= NK_NO_CARDFIX_ATK;
+ } else {
+ sk->nk &= ~NK_NO_CARDFIX_ATK;
+ }
+ } else if (strcmpi(type, "IgnoreElement") == 0) {
+ if (on) {
+ sk->nk |= NK_NO_ELEFIX;
+ } else {
+ sk->nk &= ~NK_NO_ELEFIX;
+ }
+ } else if (strcmpi(type, "IgnoreDefense") == 0) {
+ if (on) {
+ sk->nk |= NK_IGNORE_DEF;
+ } else {
+ sk->nk &= ~NK_IGNORE_DEF;
+ }
+ } else if (strcmpi(type, "IgnoreFlee") == 0) {
+ if (on) {
+ sk->nk |= NK_IGNORE_FLEE;
+ } else {
+ sk->nk &= ~NK_IGNORE_FLEE;
+ }
+ } else if (strcmpi(type, "IgnoreDefCards") == 0) {
+ if (on) {
+ sk->nk |= NK_NO_CARDFIX_DEF;
+ } else {
+ sk->nk &= ~NK_NO_CARDFIX_DEF;
+ }
+ } else {
+ skilldb_invalid_error(type, config_setting_name(t), sk->nameid);
+ }
+ }
+ }
+}
+
+/**
+ * Validates "SkillCast/DelayOptions" when reading skill_db.conf
+ * @param conf struct, pointer to skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @param delay boolean, switch for cast/delay setting
+ * @return (void)
+ */
+void skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db *sk, bool delay)
+{
+ struct config_setting_t *t = NULL, *tt = NULL;
+
+ nullpo_retv(sk);
+ if ((t=libconfig->setting_get_member(conf, delay?"SkillDelayOptions":"CastTimeOptions")) && config_setting_is_group(t)) {
+ int j = 0, tmpopt = 0;
+ while ((tt = libconfig->setting_get_elem(t, j++)) && j < 4) {
+ const char *type = config_setting_name(tt);
+ bool on = libconfig->setting_get_bool_real(tt);
+
+ if (strcmpi(type, "IgnoreDex") == 0) {
+ if (on) {
+ tmpopt |= 1<<0;
+ } else {
+ tmpopt &= ~(1<<0);
+ }
+ } else if (strcmpi(type, "IgnoreStatusEffect") == 0) {
+ if (on) {
+ tmpopt |= 1<<1;
+ } else {
+ tmpopt &= ~(1<<1);
+ }
+ } else if (strcmpi(type, "IgnoreItemBonus") == 0) {
+ if (on) {
+ tmpopt |= 1<<2;
+ } else {
+ tmpopt &= ~(1<<2);
+ }
+ } else {
+ skilldb_invalid_error(type, config_setting_name(t), sk->nameid);
+ return;
+ }
+
+ }
+ skill->level_set_value(delay?sk->delaynodex:sk->castnodex, tmpopt);
+ }
+}
+
+/**
+ * Validates the "WeaponTypes" flag
+ * when parsing skill_db.conf
+ * @param *type const char, weapon type flag
+ * @param on boolean, switch for the flag
+ * @param *sk struct, pointer to s_skill_db
+ * @return void
+ */
+int skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk)
+{
+ nullpo_ret(sk);
+ if (strcmpi(type, "NoWeapon") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_FIST;
+ } else {
+ sk->weapon &= ~(1<<W_FIST);
+ }
+ } else if (strcmpi(type, "Daggers") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DAGGER;
+ } else {
+ sk->weapon &= ~(1<<W_DAGGER);
+ }
+ } else if (strcmpi(type, "1HSwords") == 0) {
+
+ if (on) {
+ sk->weapon |= 1<<W_1HSWORD;
+ } else {
+ sk->weapon &= ~(1<<W_1HSWORD);
+ }
+ } else if (strcmpi(type, "2HSwords") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_2HSWORD;
+ } else {
+ sk->weapon &= ~(1<<W_2HSWORD);
+ }
+ } else if (strcmpi(type, "1HSpears") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_1HSPEAR;
+ } else {
+ sk->weapon &= ~(1<<W_1HSPEAR);
+ }
+ } else if (strcmpi(type, "2HSpears") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_2HSPEAR;
+ } else {
+ sk->weapon &= ~(1<<W_2HSPEAR);
+ }
+ } else if (strcmpi(type, "1HAxes") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_1HAXE;
+ } else {
+ sk->weapon &= ~(1<<W_1HAXE);
+ }
+ } else if (strcmpi(type, "2HAxes") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_2HAXE;
+ } else {
+ sk->weapon &= ~(1<<W_2HAXE);
+ }
+ } else if (strcmpi(type, "Maces") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_MACE;
+ } else {
+ sk->weapon &= ~(1<<W_MACE);
+ }
+ } else if (strcmpi(type, "2HMaces") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_2HMACE;
+ } else {
+ sk->weapon &= ~(1<<W_2HMACE);
+ }
+ } else if (strcmpi(type, "Staves") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_STAFF;
+ } else {
+ sk->weapon &= ~(1<<W_STAFF);
+ }
+ } else if (strcmpi(type, "Bows") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_BOW;
+ } else {
+ sk->weapon &= ~(1<<W_BOW);
+ }
+ } else if (strcmpi(type, "Knuckles") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_KNUCKLE;
+ } else {
+ sk->weapon &= ~(1<<W_KNUCKLE);
+ }
+ } else if (strcmpi(type, "Instruments") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_MUSICAL;
+ } else {
+ sk->weapon &= ~(1<<W_MUSICAL);
+ }
+ } else if (strcmpi(type, "Whips") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_WHIP;
+ } else {
+ sk->weapon &= ~(1<<W_WHIP);
+ }
+ } else if (strcmpi(type, "Books") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_BOOK;
+ } else {
+ sk->weapon &= ~(1<<W_BOOK);
+ }
+ } else if (strcmpi(type, "Katars") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_KATAR;
+ } else {
+ sk->weapon &= ~(1<<W_KATAR);
+ }
+ } else if (strcmpi(type, "Revolvers") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_REVOLVER;
+ } else {
+ sk->weapon &= ~(1<<W_REVOLVER);
+ }
+ } else if (strcmpi(type, "Rifles") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_RIFLE;
+ } else {
+ sk->weapon &= ~(1<<W_RIFLE);
+ }
+ } else if (strcmpi(type, "GatlingGuns") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_GATLING;
+ } else {
+ sk->weapon &= ~(1<<W_GATLING);
+ }
+ } else if (strcmpi(type, "Shotguns") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_SHOTGUN;
+ } else {
+ sk->weapon &= ~(1<<W_SHOTGUN);
+ }
+ } else if (strcmpi(type, "GrenadeLaunchers") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_GRENADE;
+ } else {
+ sk->weapon &= ~(1<<W_GRENADE);
+ }
+ } else if (strcmpi(type, "FuumaShurikens") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_HUUMA;
+ } else {
+ sk->weapon &= ~(1<<W_HUUMA);
+ }
+ } else if (strcmpi(type, "2HStaves") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_2HSTAFF;
+ } else {
+ sk->weapon &= ~(1<<W_2HSTAFF);
+ }
+ }
+ /* MAX_SINGLE_WEAPON_TYPE excluded */
+ else if (strcmpi(type, "DWDaggers") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DOUBLE_DD;
+ } else {
+ sk->weapon &= ~(1<<W_DOUBLE_DD);
+ }
+ } else if (strcmpi(type, "DWSwords") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DOUBLE_SS;
+ } else {
+ sk->weapon &= ~(1<<W_DOUBLE_SS);
+ }
+ } else if (strcmpi(type, "DWAxes") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DOUBLE_AA;
+ } else {
+ sk->weapon &= ~(1<<W_DOUBLE_AA);
+ }
+ } else if (strcmpi(type, "DWDaggerSword") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DOUBLE_DS;
+ } else {
+ sk->weapon &= ~(1<<W_DOUBLE_DS);
+ }
+ } else if (strcmpi(type, "DWDaggerAxe") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DOUBLE_DA;
+ } else {
+ sk->weapon &= ~(1<<W_DOUBLE_DA);
+ }
+ } else if (strcmpi(type, "DWSwordAxe") == 0) {
+ if (on) {
+ sk->weapon |= 1<<W_DOUBLE_SA;
+ } else {
+ sk->weapon &= ~(1<<W_DOUBLE_SA);
+ }
+ } else if (strcmpi(type, "All") == 0) {
+ sk->weapon = 0;
+ } else {
+ ShowError("Item %d. Unknown weapon type %s\n", sk->nameid, type);
+ return 1; // invalid type
+ }
+
+ return 0;
+}
+
+/**
+ * Validates "WeaponTypes"
+ * when parsing skill_db.conf
+ * @param conf struct, pointer to the skill configuration
+ * @param sk struct, struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *tt = NULL;
+ const char *type = NULL;
+
+ nullpo_retv(sk);
+ if ((tt = libconfig->setting_get_member(conf, "WeaponTypes")) && config_setting_is_group(tt)) {
+ int j = 0;
+ struct config_setting_t *wpt = NULL;
+ while ((wpt = libconfig->setting_get_elem(tt, j++)) != NULL) {
+ if (skill->validate_weapontype_sub(config_setting_name(wpt), libconfig->setting_get_bool_real(wpt), sk))
+ skilldb_invalid_error(config_setting_name(wpt), config_setting_name(tt), sk->nameid);
+ }
+ } else if (libconfig->setting_lookup_string(conf, "WeaponTypes", &type)) {
+ if (skill->validate_weapontype_sub(type, true, sk))
+ skilldb_invalid_error(type, "WeaponTypes", sk->nameid);
+ }
+}
+
+/**
+ * Validates the "AmmoTypes" flag
+ * when parsing skill_db.conf
+ * @param type string, ammo type flag
+ * @param on boolean, switch for the flag
+ * @param sk struct, pointer to s_skill_db
+ * @return void
+ */
+int skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk)
+{
+ nullpo_ret(sk);
+ if (strcmpi(type, "A_ARROW") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_ARROW;
+ } else {
+ sk->ammo &= ~(1<<A_ARROW);
+ }
+ } else if (strcmpi(type, "A_DAGGER") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_DAGGER;
+ } else {
+ sk->ammo &= ~(1<<A_DAGGER);
+ }
+ } else if (strcmpi(type, "A_BULLET") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_BULLET;
+ } else {
+ sk->ammo &= ~(1<<A_BULLET);
+ }
+ } else if (strcmpi(type, "A_SHELL") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_SHELL;
+ } else {
+ sk->ammo &= ~(1<<A_SHELL);
+ }
+ } else if (strcmpi(type, "A_GRENADE") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_GRENADE;
+ } else {
+ sk->ammo &= ~(1<<A_GRENADE);
+ }
+ } else if (strcmpi(type, "A_SHURIKEN") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_SHURIKEN;
+ } else {
+ sk->ammo &= ~(1<<A_SHURIKEN);
+ }
+ } else if (strcmpi(type, "A_KUNAI") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_KUNAI;
+ } else {
+ sk->ammo &= ~(1<<A_KUNAI);
+ }
+ } else if (strcmpi(type, "A_CANNONBALL") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_CANNONBALL;
+ } else {
+ sk->ammo &= ~(1<<A_CANNONBALL);
+ }
+ } else if (strcmpi(type, "A_THROWWEAPON") == 0) {
+ if (on) {
+ sk->ammo |= 1<<A_THROWWEAPON;
+ } else {
+ sk->ammo &= ~(1<<A_THROWWEAPON);
+ }
+ } else if (strcmpi(type, "All") == 0) {
+ if (on) {
+ sk->ammo = 0xFFFFFFFF;
+ } else {
+ sk->ammo = 0;
+ }
+ } else {
+ return 1; // Invalid Entry
+ }
+
+ return 0;
+}
+
+/**
+ * Validates the "AmmoTypes" flag
+ * when parsing skill_db.conf
+ * @param conf pointer to the skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return void
+ */
+void skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *tt = NULL;
+ const char *tstr = NULL;
+
+ nullpo_retv(sk);
+ if ((tt = libconfig->setting_get_member(conf, "AmmoTypes")) && config_setting_is_group(tt)) {
+ int j = 0;
+ struct config_setting_t *amt = { 0 };
+ while ((amt = libconfig->setting_get_elem(tt, j++))) {
+ if (skill->validate_ammotype_sub(config_setting_name(amt), libconfig->setting_get_bool_real(amt), sk))
+ skilldb_invalid_error(config_setting_name(amt), config_setting_name(tt), sk->nameid);
+ }
+ } else if( libconfig->setting_lookup_string(conf, "AmmoTypes", &tstr)) {
+ if (skill->validate_ammotype_sub(tstr, true, sk))
+ skilldb_invalid_error(tstr, "AmmoTypes", sk->nameid);
+ }
+}
+
+/**
+ * Validates the "State" flag
+ * when parsing skill_db.conf
+ * @param conf struct, pointer to the skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return void
+ */
+void skill_validate_state(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ const char *type = NULL;
+
+ nullpo_retv(sk);
+ if (libconfig->setting_lookup_string(conf, "State", &type) && strcmpi(type,"None") != ST_NONE) {
+ if ( strcmpi(type,"Hiding") == 0 ) sk->state = ST_HIDING;
+ else if (strcmpi(type,"Cloaking") == 0 ) sk->state = ST_CLOAKING;
+ else if (strcmpi(type,"Hidden") == 0 ) sk->state = ST_HIDDEN;
+ else if (strcmpi(type,"Riding") == 0 ) sk->state = ST_RIDING;
+ else if (strcmpi(type,"Falcon") == 0 ) sk->state = ST_FALCON;
+ else if (strcmpi(type,"Cart") == 0 ) sk->state = ST_CART;
+ else if (strcmpi(type,"Shield") == 0 ) sk->state = ST_SHIELD;
+ else if (strcmpi(type,"Sight") == 0 ) sk->state = ST_SIGHT;
+ else if (strcmpi(type,"ExplosionSpirits") == 0 ) sk->state = ST_EXPLOSIONSPIRITS;
+ else if (strcmpi(type,"CartBoost") == 0 ) sk->state = ST_CARTBOOST;
+ else if (strcmpi(type,"NotOverWeight") == 0 ) sk->state = ST_RECOV_WEIGHT_RATE;
+ else if (strcmpi(type,"Moveable") == 0 ) sk->state = ST_MOVE_ENABLE;
+ else if (strcmpi(type,"InWater") == 0 ) sk->state = ST_WATER;
+ else if (strcmpi(type,"Dragon") == 0 ) sk->state = ST_RIDINGDRAGON;
+ else if (strcmpi(type,"Warg") == 0 ) sk->state = ST_WUG;
+ else if (strcmpi(type,"RidingWarg") == 0 ) sk->state = ST_RIDINGWUG;
+ else if (strcmpi(type,"MadoGear") == 0 ) sk->state = ST_MADO;
+ else if (strcmpi(type,"ElementalSpirit") == 0 ) sk->state = ST_ELEMENTALSPIRIT;
+ else if (strcmpi(type,"PoisonWeapon") == 0 ) sk->state = ST_POISONINGWEAPON;
+ else if (strcmpi(type,"RollingCutter") == 0 ) sk->state = ST_ROLLINGCUTTER;
+ else if (strcmpi(type,"MH_Fighting") == 0 ) sk->state = ST_MH_FIGHTING;
+ else if (strcmpi(type,"MH_Grappling") == 0 ) sk->state = ST_MH_GRAPPLING;
+ else if (strcmpi(type,"Peco") == 0 ) sk->state = ST_PECO;
+ else
+ skilldb_invalid_error(type, "State", sk->nameid);
+ }
+}
+
+/**
+ * Validates the "Items" flag
+ * when parsing skill_db.conf
+ * @param conf struct, pointer to the skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return void
+ */
+void skill_validate_item_requirements(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *tt = NULL;
+
+ nullpo_retv(sk);
+ if ((tt=libconfig->setting_get_member(conf, "Items")) && config_setting_is_group(conf)) {
+ int itx=-1;
+ struct config_setting_t *it;
+
+ while((it=libconfig->setting_get_elem(tt, ++itx)) && itx < MAX_SKILL_ITEM_REQUIRE) {
+ const char *type = config_setting_name(it);
+
+ if( type[0] == 'I' && type[1] == 'D' && itemdb->exists(atoi(type+2)) )
+ sk->itemid[itx] = atoi(type+2);
+ else if(!script->get_constant(type, &sk->itemid[itx])) {
+ ShowWarning("skill_read_skilldb: Invalid required Item '%s' given for skill Id %d in '%s', skipping...\n",type, sk->nameid, DBPATH"skill_db.conf");
+ continue;
+ }
+
+ if (config_setting_is_group(it)) {
+ // TODO: Per-level item requirements are not implemented yet!
+ // We just take the first level for the time being (old txt behavior)
+ sk->amount[itx] = libconfig->setting_get_int_elem(it, 0);
+ } else {
+ sk->amount[itx] = libconfig->setting_get_int(it);
+ }
+ }
+ }
+}
+
+/**
+ * Validates the "Unit > Target" flag
+ * when parsing skill_db.conf
+ * @param conf struct, pointer to the skill configuration
+ * @param sk struct, pointer to s_skill_db
+ * @return void
+ */
+void skill_validate_unit_target(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ const char *type = NULL;
+
+ nullpo_retv(sk);
+ if(libconfig->setting_lookup_string(conf, "Target", &type)) {
+
+ if(!strcmpi(type,"NotEnemy")) sk->unit_target = BCT_NOENEMY;
+ else if(!strcmpi(type,"NotParty")) sk->unit_target = BCT_NOPARTY;
+ else if (!strcmpi(type,"NotGuild")) sk->unit_target = BCT_NOGUILD;
+ else if(!strcmpi(type,"Friend")) sk->unit_target = BCT_NOENEMY;
+ else if(!strcmpi(type,"Party")) sk->unit_target = BCT_PARTY;
+ else if(!strcmpi(type,"Ally")) sk->unit_target = BCT_PARTY|BCT_GUILD;
+ else if(!strcmpi(type,"Guild")) sk->unit_target = BCT_GUILD;
+ else if(!strcmpi(type,"All")) sk->unit_target = BCT_ALL;
+ else if(!strcmpi(type,"Enemy")) sk->unit_target = BCT_ENEMY;
+ else if(!strcmpi(type,"Self")) sk->unit_target = BCT_SELF;
+ else if(!strcmpi(type,"SameGuild")) sk->unit_target = BCT_GUILD|BCT_SAMEGUILD;
+ }
+
+ if (sk->unit_flag & UF_DEFNOTENEMY && battle_config.defnotenemy)
+ sk->unit_target = BCT_NOENEMY;
+
+ //By default, target just characters.
+ sk->unit_target |= BL_CHAR;
+
+ if (sk->unit_flag & UF_NOPC)
+ sk->unit_target &= ~BL_PC;
+ if (sk->unit_flag & UF_NOMOB)
+ sk->unit_target &= ~BL_MOB;
+ if (sk->unit_flag & UF_SKILL)
+ sk->unit_target |= BL_SKILL;
+}
+
+/**
+ * Validates the "Unit > Flag" setting
+ * when parsing skill_db.conf
+ * @param type const char, name of the flag being parsed.
+ * @param on boolean, switch for flag setting
+ * @param sk struct, pointer to s_skill_db.
+ * @return (void)
+ */
+int skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *sk)
+{
+ nullpo_ret(type);
+ nullpo_ret(sk);
+ if (strcmpi(type, "UF_DEFNOTENEMY") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_DEFNOTENEMY;
+ } else {
+ sk->unit_flag &= ~UF_DEFNOTENEMY;
+ }
+ } else if (strcmpi(type, "UF_NOREITERATION") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_NOREITERATION;
+ } else {
+ sk->unit_flag &= ~UF_NOREITERATION;
+ }
+ } else if (strcmpi(type, "UF_NOFOOTSET") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_NOFOOTSET;
+ } else {
+ sk->unit_flag &= ~UF_NOFOOTSET;
+ }
+ } else if (strcmpi(type, "UF_NOOVERLAP") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_NOOVERLAP;
+ } else {
+ sk->unit_flag &= ~UF_NOOVERLAP;
+ }
+ } else if (strcmpi(type, "UF_PATHCHECK") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_PATHCHECK;
+ } else {
+ sk->unit_flag &= ~UF_PATHCHECK;
+ }
+ } else if (strcmpi(type, "UF_NOPC") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_NOPC;
+ } else {
+ sk->unit_flag &= ~UF_NOPC;
+ }
+ } else if (strcmpi(type, "UF_NOMOB") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_NOMOB;
+ } else {
+ sk->unit_flag &= ~UF_NOMOB;
+ }
+ } else if (strcmpi(type, "UF_SKILL") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_SKILL;
+ } else {
+ sk->unit_flag &= ~UF_SKILL;
+ }
+ } else if (strcmpi(type, "UF_DANCE") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_DANCE;
+ } else {
+ sk->unit_flag &= ~UF_DANCE;
+ }
+ } else if (strcmpi(type, "UF_ENSEMBLE") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_ENSEMBLE;
+ } else {
+ sk->unit_flag &= ~UF_ENSEMBLE;
+ }
+ } else if (strcmpi(type, "UF_SONG") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_SONG;
+ } else {
+ sk->unit_flag &= ~UF_SONG;
+ }
+ } else if (strcmpi(type, "UF_DUALMODE") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_DUALMODE;
+ } else {
+ sk->unit_flag &= ~UF_DUALMODE;
+ }
+ } else if (strcmpi(type, "UF_RANGEDSINGLEUNIT") == 0) {
+ if (on) {
+ sk->unit_flag |= UF_RANGEDSINGLEUNIT;
+ } else {
+ sk->unit_flag &= ~UF_RANGEDSINGLEUNIT;
+ }
+ } else {
+ return 1; // Invalid Type
+ }
+
+ return 0;
+}
+
+/**
+ * Validate "Unit > Flag" setting
+ * when parsing skill_db.conf
+ * @param conf struct, pointer to the skill configuration
+ * @param sk struct, struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ struct config_setting_t *t = NULL;
+
+ nullpo_retv(sk);
+ if ((t=libconfig->setting_get_member(conf, "Flag")) && config_setting_is_group(t)) {
+ int j=0;
+ struct config_setting_t *tt = NULL;
+ while ((tt = libconfig->setting_get_elem(t, j++))) {
+ const char *name = config_setting_name(tt);
+
+ if (skill->validate_unit_flag_sub(name, libconfig->setting_get_bool_real(tt), sk))
+ skilldb_invalid_error(name, config_setting_name(t), sk->nameid);
+ }
+ }
+}
+/**
+ * Validate additional field settings via plugins
+ * when parsing skill_db.conf
+ * @param conf struct, pointer to the skill configuration
+ * @param sk struct, struct, pointer to s_skill_db
+ * @return (void)
+ */
+void skill_validate_additional_fields(struct config_setting_t *conf, struct s_skill_db *sk)
+{
+ // Does nothing like a boss. *cough* plugins *cough*
+}
+
+/**
+ * Validates a skill entry and adds it to the database. [ Smokexyz/Hercules ]
+ * @param sk contains skill data to be checked.
+ * @param *source filepath constant.
+ * @return boolean true on success.
+ */
+bool skill_validate_skilldb(struct s_skill_db *sk, const char *source)
+{
+ int idx;
+
+ nullpo_retr(false, sk);
+ idx = skill->get_index(sk->nameid);
+ if (idx == 0) {
+ ShowWarning("skill_validate_skilldb: Invalid skill Id %d provided in '%s'! ... skipping\n", sk->nameid, source);
+ ShowInfo("It is possible that the skill Id is 0 or unavailable (interferes with guild/homun/mercenary skill mapping).\n");
+ return false;
+ } else if (sk->max <= 0) {
+ ShowError("skill_validate_skilldb: Invalid Max Level %d specified for skill Id %d in '%s', skipping...\n", sk->max, sk->nameid, source);
+ return false;
+ }
+
+ /* Direct assignment of temporary skill storage to skill db */
+ skill->dbs->db[idx] = *sk;
+ /* Put skill name in name2id DB */
+ strdb_iput(skill->name2id_db, skill->dbs->db[idx].name, skill->dbs->db[idx].nameid);
+ /* Set Name to Id script constants */
+ script->set_constant2(skill->dbs->db[idx].name, (int)skill->dbs->db[idx].nameid, false, false);
+
+ return true;
+}
+
+/**
+ * Reads skill_db.conf from relative filepath and processes [ Smokexyz/Hercules ]
+ * entries into the skill database.
+ * @param filename contains the file path and name.
+ * @return boolean true on success
+ */
+bool skill_read_skilldb(const char *filename)
+{
+ struct config_t skilldb;
+ struct config_setting_t *sk, *conf;
+ char filepath[256];
+ int count=0, index=0;
+ bool duplicate[MAX_SKILL] = {0};
+
+ nullpo_retr(false, filename);
+
+ sprintf(filepath,"db/%s",filename);
+
+ if (!libconfig->load_file(&skilldb, filepath)) {
+ return false; // Libconfig error report.
+ }
+
+ // Possible Syntax error.
+ if ((sk=libconfig->setting_get_member(skilldb.root, "skill_db")) == NULL) {
+ ShowError("skill_read_skilldb: Skill DB could not be loaded, please check '%s'.\n", filepath);
+ libconfig->destroy(&skilldb);
+ return false;
+ }
+
+ while ((conf = libconfig->setting_get_elem(sk,index++))) {
+ int idx=0, skill_id=0, temp=0;
+ struct config_setting_t *t = NULL, *tt = NULL;
+ struct s_skill_db tmp_db = { 0 };
+
+ /* Skill ID */
+ if (!libconfig->setting_lookup_int(conf, "Id", &skill_id)) {
+ ShowError("skill_read_skilldb: Skill Id not specified for entry %d in '%s', skipping...\n", index, filepath );
+ continue;
+ }
+
+ tmp_db.nameid = skill_id;
+
+ if((idx = skill->get_index(skill_id)) == 0) {
+ ShowError("skill_read_skilldb: Skill Id %d is out of range, or within a reserved range (for guild, homunculus, mercenary or elemental skills). skipping...\n", idx);
+ continue;
+ }
+
+ if (duplicate[idx]) {
+ ShowWarning("skill_read_skilldb: Duplicate Skill Id %d in entry %d in '%s', skipping...\n", skill_id, index, filepath);
+ continue;
+ }
+
+ /* Skill Name Constant */
+ if (!libconfig->setting_lookup_mutable_string(conf, "Name", tmp_db.name, sizeof(tmp_db.name))) {
+ ShowError("skill_read_skilldb: Name not specified for skill Id %d in '%s', skipping...\n", skill_id, filepath);
+ continue;
+ }
+
+ /* Skill Description */
+ libconfig->setting_lookup_mutable_string(conf, "Description", tmp_db.desc, sizeof(tmp_db.desc));
+
+ /* Max Level */
+ if (!libconfig->setting_lookup_int(conf, "MaxLevel", &temp)) {
+ ShowError("skill_read_skilldb: MaxLevel not specified for skill Id %d in '%s', skipping...\n", skill_id, filepath);
+ continue;
+ } else {
+ tmp_db.max = temp;
+ }
+
+ /* Range */
+ if ((t=libconfig->setting_get_member(conf, "Range")))
+ skill->config_set_level(t, tmp_db.range);
+
+ /* Hit Type */
+ skill->validate_hittype(conf, &tmp_db);
+
+ /* Skill Type */
+ skill->validate_skilltype(conf, &tmp_db);
+
+ /* Skill Info */
+ skill->validate_skillinfo(conf, &tmp_db);
+
+ /* Skill Attack Type */
+ skill->validate_attacktype(conf, &tmp_db);
+
+ /* Skill Element */
+ skill->validate_element(conf, &tmp_db);
+
+ /* Damage Type */
+ skill->validate_damagetype(conf, &tmp_db);
+
+ /* Splash Range */
+ if ((t = libconfig->setting_get_member(conf, "SplashRange")))
+ skill->config_set_level(t, tmp_db.splash);
+
+ /* Number of Hits */
+ if ((t = libconfig->setting_get_member(conf, "NumberOfHits")) && config_setting_is_group(t))
+ skill->config_set_level(t, tmp_db.num);
+ else if ((libconfig->setting_lookup_int(conf, "NumberOfHits", &temp)))
+ skill->level_set_value(tmp_db.num, temp);
+ else
+ skill->level_set_value(tmp_db.num, 1); // Default 1
+
+ /* Interrupt Cast */
+ if (libconfig->setting_lookup_bool(conf, "InterruptCast", &tmp_db.castcancel) == CONFIG_FALSE)
+ tmp_db.castcancel = 0;
+
+ /* Cast Defense Rate */
+ libconfig->setting_lookup_int(conf, "CastDefRate", &tmp_db.cast_def_rate);
+
+ /* Skill Instances */
+ if ((t = libconfig->setting_get_member(conf, "SkillInstances")))
+ skill->config_set_level(t, tmp_db.maxcount);
+
+ /* Knock-Back Tiles */
+ if ((t = libconfig->setting_get_member(conf, "KnockBackTiles")))
+ skill->config_set_level(t, tmp_db.blewcount);
+ /**
+ * Skill Cast / Delay data handling
+ */
+ /* Cast Time */
+ if ((t=libconfig->setting_get_member(conf, "CastTime")))
+ skill->config_set_level(t, tmp_db.cast);
+
+ /* After Cast Act Delay */
+ if ((t=libconfig->setting_get_member(conf, "AfterCastActDelay")))
+ skill->config_set_level(t, tmp_db.delay);
+
+ /* After Cast Walk Delay */
+ if ((t=libconfig->setting_get_member(conf, "AfterCastWalkDelay")))
+ skill->config_set_level(t, tmp_db.walkdelay);
+
+ /* Skill Data/Duration */
+ if ((t=libconfig->setting_get_member(conf, "SkillData1")))
+ skill->config_set_level(t, tmp_db.upkeep_time);
+
+ /* Skill Data/Duration 2 */
+ if ((t=libconfig->setting_get_member(conf, "SkillData2")))
+ skill->config_set_level(t, tmp_db.upkeep_time2);
+
+ /* Skill Cool Down */
+ if ((t=libconfig->setting_get_member(conf, "CoolDown")))
+ skill->config_set_level(t, tmp_db.cooldown);
+
+#ifdef RENEWAL_CAST
+ /* Fixed Casting Time */
+ if ((t=libconfig->setting_get_member(conf, "FixedCastTime")))
+ skill->config_set_level(t, tmp_db.fixed_cast);
+#endif
+ /* Cast Time Options */
+ skill->validate_castnodex(conf, &tmp_db, false);
+ skill->validate_castnodex(conf, &tmp_db, true);
+
+ /**
+ * Skill Requirements data handling
+ */
+ if ((t=libconfig->setting_get_member(conf, "Requirements")) && config_setting_is_group(t)) {
+
+ /* HP Costs */
+ if ((tt = libconfig->setting_get_member(t, "HPCost")))
+ skill->config_set_level(tt, tmp_db.hp);
+
+ /* Max HP Trigger */
+ if ((tt = libconfig->setting_get_member(t, "MaxHPTrigger")))
+ skill->config_set_level(tt, tmp_db.mhp);
+
+ /* SP Cost */
+ if ((tt = libconfig->setting_get_member(t, "SPCost")))
+ skill->config_set_level(tt, tmp_db.sp);
+
+ /* HP Rate */
+ if ((tt = libconfig->setting_get_member(t, "HPRateCost")))
+ skill->config_set_level(tt, tmp_db.hp_rate);
+
+ /* SP Rate */
+ if ((tt = libconfig->setting_get_member(t, "SPRateCost")))
+ skill->config_set_level(tt, tmp_db.sp_rate);
+
+ /* Zeny Cost */
+ if ((tt = libconfig->setting_get_member(t, "ZenyCost")))
+ skill->config_set_level(tt, tmp_db.zeny);
+
+ /* Spirit Sphere Cost */
+ if ((tt = libconfig->setting_get_member(t, "SpiritSphereCost")))
+ skill->config_set_level(tt, tmp_db.spiritball);
+
+ /* Weapon Types */
+ skill->validate_weapontype(t, &tmp_db);
+
+ /* Ammunition Types */
+ skill->validate_ammotype(t, &tmp_db);
+
+ /* Ammunition Amount */
+ if ((tt = libconfig->setting_get_member(t, "AmmoAmount")))
+ skill->config_set_level(tt, tmp_db.ammo_qty);
+
+ /* State */
+ skill->validate_state(t, &tmp_db);
+
+ /* Spirit Sphere Cost */
+ if ((tt = libconfig->setting_get_member(t, "SpiritSphereCost")))
+ skill->config_set_level(tt, tmp_db.spiritball);
+
+ /* Item Requirements and Amounts */
+ skill->validate_item_requirements(t, &tmp_db);
+ }
+
+ /**
+ * Skill Unit data handling
+ */
+ if ((t=libconfig->setting_get_member(conf, "Unit")) && config_setting_is_group(t)) {
+
+ /* Unit IDs [1,2] */
+ if ((tt=libconfig->setting_get_member(t, "Id")) && config_setting_is_array(tt)) {
+ tmp_db.unit_id[0] = libconfig->setting_get_int_elem(tt, 0);
+ tmp_db.unit_id[1] = libconfig->setting_get_int_elem(tt, 1);
+ } else {
+ libconfig->setting_lookup_int(t, "Id", &tmp_db.unit_id[0]);
+ }
+
+ /* Layout */
+ if((tt=libconfig->setting_get_member(t, "Layout")))
+ skill->config_set_level(tt, tmp_db.unit_layout_type);
+
+ /* Range */
+ if((tt=libconfig->setting_get_member(t, "Range")))
+ skill->config_set_level(tt, tmp_db.unit_range);
+
+ /* Interval */
+ if(libconfig->setting_lookup_int(t, "Interval", &temp))
+ tmp_db.unit_interval = temp;
+
+ /* Flag */
+ skill->validate_unit_flag(t, &tmp_db);
+
+ /* Target */
+ skill->validate_unit_target(t, &tmp_db);
+ }
+
+ /* Additional Fields for Plugins */
+ skill->validate_additional_fields(conf, &tmp_db);
+
+ // Validate the skill entry, add it to the duplicate array and increment count on success.
+ if ((duplicate[idx] = skill->validate_skilldb(&tmp_db, filepath)))
+ count++;
+ }
+
+ libconfig->destroy(&skilldb);
+
+ ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, filepath);
+
+ return true;
+}
+
+#undef skilldb_duplicate_warning
+#undef skilldb_invalid_error
+
/*===============================
* DB reading.
- * skill_db.txt
- * skill_require_db.txt
- * skill_cast_db.txt
- * skill_castnodex_db.txt
- * skill_nocast_db.txt
- * skill_unit_db.txt
* produce_db.txt
* create_arrow_db.txt
* abra_db.txt
*------------------------------*/
-void skill_readdb(bool minimal) {
+void skill_readdb(bool minimal)
+{
// init skill db structures
db_clear(skill->name2id_db);
@@ -19153,26 +20741,19 @@ void skill_readdb(bool minimal) {
safestrncpy(skill->dbs->db[0].name, "UNKNOWN_SKILL", sizeof(skill->dbs->db[0].name));
safestrncpy(skill->dbs->db[0].desc, "Unknown Skill", sizeof(skill->dbs->db[0].desc));
+ itemdb->name_constants(); // refresh ItemDB constants before loading of skills
+
#ifdef ENABLE_CASE_CHECK
- script->parser_current_file = DBPATH"skill_db.txt";
+ script->parser_current_file = DBPATH"skill_db.conf";
#endif // ENABLE_CASE_CHECK
- sv->readdb(map->db_path, DBPATH"skill_db.txt", ',', 17, 17, MAX_SKILL_DB, skill->parse_row_skilldb);
+ skill->read_skilldb(DBPATH"skill_db.conf");
#ifdef ENABLE_CASE_CHECK
script->parser_current_file = NULL;
#endif // ENABLE_CASE_CHECK
if (minimal)
return;
-
- sv->readdb(map->db_path, DBPATH"skill_require_db.txt", ',', 32, 32, MAX_SKILL_DB, skill->parse_row_requiredb);
-#ifdef RENEWAL_CAST
- sv->readdb(map->db_path, "re/skill_cast_db.txt", ',', 8, 8, MAX_SKILL_DB, skill->parse_row_castdb);
-#else
- sv->readdb(map->db_path, "pre-re/skill_cast_db.txt", ',', 7, 7, MAX_SKILL_DB, skill->parse_row_castdb);
-#endif
- sv->readdb(map->db_path, DBPATH"skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill->parse_row_castnodexdb);
- sv->readdb(map->db_path, DBPATH"skill_unit_db.txt", ',', 8, 8, MAX_SKILL_DB, skill->parse_row_unitdb);
-
+
skill->init_unit_layout();
sv->readdb(map->db_path, "produce_db.txt", ',', 4, 4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill->parse_row_producedb);
sv->readdb(map->db_path, "create_arrow_db.txt", ',', 1+2, 1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill->parse_row_createarrowdb);
@@ -19219,7 +20800,8 @@ void skill_reload(void)
/*==========================================
*
*------------------------------------------*/
-int do_init_skill(bool minimal) {
+int do_init_skill(bool minimal)
+{
skill->name2id_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, MAX_SKILL_NAME_LENGTH);
skill->read_db(minimal);
@@ -19252,7 +20834,8 @@ int do_init_skill(bool minimal) {
return 0;
}
-int do_final_skill(void) {
+int do_final_skill(void)
+{
db_destroy(skill->name2id_db);
db_destroy(skill->group_db);
db_destroy(skill->unit_db);
@@ -19265,8 +20848,10 @@ int do_final_skill(void) {
ers_destroy(skill->cd_entry_ers);
return 0;
}
+
/* initialize the interface */
-void skill_defaults(void) {
+void skill_defaults(void)
+{
const int skill_enchant_eff[5] = { 10, 14, 17, 19, 20 };
const int skill_deluge_eff[5] = { 5, 9, 12, 14, 15 };
@@ -19352,6 +20937,7 @@ void skill_defaults(void) {
skill->is_combo = skill_is_combo;
skill->name2id = skill_name2id;
skill->isammotype = skill_isammotype;
+ skill->castend_type = skill_castend_type;
skill->castend_id = skill_castend_id;
skill->castend_pos = skill_castend_pos;
skill->castend_map = skill_castend_map;
@@ -19397,7 +20983,9 @@ void skill_defaults(void) {
skill->can_cloak = skill_can_cloak;
skill->enchant_elemental_end = skill_enchant_elemental_end;
skill->not_ok = skillnotok;
+ skill->not_ok_unknown = skill_notok_unknown;
skill->not_ok_hom = skillnotok_hom;
+ skill->not_ok_hom_unknown = skillnotok_hom_unknown;
skill->not_ok_mercenary = skillnotok_mercenary;
skill->chastle_mob_changetarget = skill_chastle_mob_changetarget;
skill->can_produce_mix = skill_can_produce_mix;
@@ -19445,6 +21033,7 @@ void skill_defaults(void) {
skill->sit_out = skill_sit_out;
skill->unitsetmapcell = skill_unitsetmapcell;
skill->unit_onplace_timer = skill_unit_onplace_timer;
+ skill->unit_onplace_timer_unknown = skill_unit_onplace_timer_unknown;
skill->unit_effect = skill_unit_effect;
skill->unit_timer_sub_onplace = skill_unit_timer_sub_onplace;
skill->unit_move_sub = skill_unit_move_sub;
@@ -19455,11 +21044,30 @@ void skill_defaults(void) {
skill->unit_timer = skill_unit_timer;
skill->unit_timer_sub = skill_unit_timer_sub;
skill->init_unit_layout = skill_init_unit_layout;
- skill->parse_row_skilldb = skill_parse_row_skilldb;
- skill->parse_row_requiredb = skill_parse_row_requiredb;
- skill->parse_row_castdb = skill_parse_row_castdb;
- skill->parse_row_castnodexdb = skill_parse_row_castnodexdb;
- skill->parse_row_unitdb = skill_parse_row_unitdb;
+ skill->init_unit_layout_unknown = skill_init_unit_layout_unknown;
+ /* Skill DB Libconfig */
+ skill->validate_hittype = skill_validate_hittype;
+ skill->validate_attacktype = skill_validate_attacktype;
+ skill->validate_element = skill_validate_element;
+ skill->validate_skilltype = skill_validate_skilltype;
+ skill->validate_skillinfo = skill_validate_skillinfo;
+ skill->validate_damagetype = skill_validate_damagetype;
+ skill->validate_castnodex = skill_validate_castnodex;
+ skill->validate_weapontype = skill_validate_weapontype;
+ skill->validate_ammotype = skill_validate_ammotype;
+ skill->validate_state = skill_validate_state;
+ skill->validate_item_requirements = skill_validate_item_requirements;
+ skill->validate_unit_target = skill_validate_unit_target;
+ skill->validate_unit_flag = skill_validate_unit_flag;
+ skill->validate_additional_fields = skill_validate_additional_fields;
+ skill->validate_skilldb = skill_validate_skilldb;
+ skill->validate_weapontype_sub = skill_validate_weapontype_sub;
+ skill->validate_ammotype_sub = skill_validate_ammotype_sub;
+ skill->validate_unit_flag_sub = skill_validate_unit_flag_sub;
+ skill->read_skilldb = skill_read_skilldb;
+ skill->config_set_level = skill_config_set_level;
+ skill->level_set_value = skill_level_set_value;
+ /* */
skill->parse_row_producedb = skill_parse_row_producedb;
skill->parse_row_createarrowdb = skill_parse_row_createarrowdb;
skill->parse_row_abradb = skill_parse_row_abradb;
@@ -19516,4 +21124,7 @@ void skill_defaults(void) {
skill->get_requirement_off_unknown = skill_get_requirement_off_unknown;
skill->get_requirement_item_unknown = skill_get_requirement_item_unknown;
skill->get_requirement_unknown = skill_get_requirement_unknown;
+ skill->splash_target = skill_splash_target;
+ skill->check_npc_chaospanic = skill_check_npc_chaospanic;
+ skill->count_wos = skill_count_wos;
}
diff --git a/src/map/skill.h b/src/map/skill.h
index 96bef090a..bba440107 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -32,6 +32,7 @@
**/
struct Damage;
struct homun_data;
+struct itemlist; // map/itemdb.h
struct map_session_data;
struct mercenary_data;
struct unit_data;
@@ -57,7 +58,7 @@ struct status_change_entry;
#define MAX_SKILLUNITGROUP 25
#define MAX_SKILL_ITEM_REQUIRE 10
#define MAX_SKILLUNITGROUPTICKSET 25
-#define MAX_SKILL_NAME_LENGTH 30
+#define MAX_SKILL_NAME_LENGTH 32
// (Epoque:) To-do: replace this macro with some sort of skill tree check (rather than hard-coded skill names)
#define skill_ischangesex(id) ( \
@@ -90,6 +91,7 @@ enum e_skill_inf {
enum e_skill_nk {
NK_NO_DAMAGE = 0x01,
NK_SPLASH = 0x02|0x04, // 0x4 = splash & split
+ NK_SPLASH_ONLY = 0x02,
NK_SPLASHSPLIT = 0x04,
NK_NO_CARDFIX_ATK = 0x08,
NK_NO_ELEFIX = 0x10,
@@ -101,21 +103,23 @@ enum e_skill_nk {
//A skill with 3 would be no damage + splash: area of effect.
//Constants to identify a skill's inf2 value.
enum e_skill_inf2 {
- INF2_QUEST_SKILL = 0x0001,
- INF2_NPC_SKILL = 0x0002, // NPC skills are those that players can't have in their skill tree.
- INF2_WEDDING_SKILL = 0x0004,
- INF2_SPIRIT_SKILL = 0x0008,
- INF2_GUILD_SKILL = 0x0010,
- INF2_SONG_DANCE = 0x0020,
- INF2_ENSEMBLE_SKILL = 0x0040,
- INF2_TRAP = 0x0080,
- INF2_TARGET_SELF = 0x0100, // Refers to ground placed skills that will target the caster as well (like Grandcross)
- INF2_NO_TARGET_SELF = 0x0200,
- INF2_PARTY_ONLY = 0x0400,
- INF2_GUILD_ONLY = 0x0800,
- INF2_NO_ENEMY = 0x1000,
- INF2_NOLP = 0x2000, // Spells that can ignore Land Protector
- INF2_CHORUS_SKILL = 0x4000, // Chorus skill
+ INF2_QUEST_SKILL = 0x00001,
+ INF2_NPC_SKILL = 0x00002, // NPC skills are those that players can't have in their skill tree.
+ INF2_WEDDING_SKILL = 0x00004,
+ INF2_SPIRIT_SKILL = 0x00008,
+ INF2_GUILD_SKILL = 0x00010,
+ INF2_SONG_DANCE = 0x00020,
+ INF2_ENSEMBLE_SKILL = 0x00040,
+ INF2_TRAP = 0x00080,
+ INF2_TARGET_SELF = 0x00100, // Refers to ground placed skills that will target the caster as well (like Grandcross)
+ INF2_NO_TARGET_SELF = 0x00200,
+ INF2_PARTY_ONLY = 0x00400,
+ INF2_GUILD_ONLY = 0x00800,
+ INF2_NO_ENEMY = 0x01000,
+ INF2_NOLP = 0x02000, // Spells that can ignore Land Protector
+ INF2_CHORUS_SKILL = 0x04000, // Chorus skill
+ INF2_FREE_CAST_NORMAL = 0x08000,
+ INF2_FREE_CAST_REDUCED = 0x10000,
};
@@ -1361,6 +1365,10 @@ enum e_skill {
ITEM_OPTION_SPLASH_ATTACK,
GM_FORCE_TRANSFER,
GM_WIDE_RESURRECTION,
+ ALL_NIFLHEIM_RECALL,
+ ALL_PRONTERA_RECALL,
+ ALL_GLASTHEIM_RECALL,
+ ALL_THANATOS_RECALL,
GC_DARKCROW = 5001,
RA_UNLIMIT,
@@ -1378,6 +1386,47 @@ enum e_skill {
ALL_FULL_THROTTLE,
NC_MAGMA_ERUPTION_DOTDAMAGE,
+ /** Summoner */
+ SU_BASIC_SKILL = 5018,
+ SU_BITE,
+ SU_HIDE,
+ SU_SCRATCH,
+ SU_STOOP,
+ SU_LOPE,
+ SU_SPRITEMABLE,
+ SU_POWEROFLAND,
+ SU_SV_STEMSPEAR,
+ SU_CN_POWDERING,
+ SU_CN_METEOR,
+ SU_SV_ROOTTWIST,
+ SU_SV_ROOTTWIST_ATK,
+ SU_POWEROFLIFE,
+ SU_SCAROFTAROU,
+ SU_PICKYPECK,
+ SU_PICKYPECK_DOUBLE_ATK,
+ SU_ARCLOUSEDASH,
+ SU_LUNATICCARROTBEAT,
+ SU_POWEROFSEA,
+ SU_TUNABELLY,
+ SU_TUNAPARTY,
+ SU_BUNCHOFSHRIMP,
+ SU_FRESHSHRIMP,
+ SU_CN_METEOR2,
+ SU_LUNATICCARROTBEAT2,
+ SU_SOULATTACK,
+ SU_POWEROFFLOCK,
+ SU_SVG_SPIRIT,
+ SU_HISS,
+ SU_NYANGGRASS,
+ SU_GROOMING,
+ SU_PURRING,
+ SU_SHRIMPARTY,
+ SU_SPIRITOFLIFE,
+ SU_MEOWMEOW,
+ SU_SPIRITOFLAND,
+ SU_CHATTERING,
+ SU_SPIRITOFSEA,
+
HLIF_HEAL = 8001,
HLIF_AVOID,
HLIF_BRAIN,
@@ -1647,6 +1696,9 @@ enum {
UNT_B_TRAP,
UNT_FIRE_RAIN,
+ UNT_CATNIPPOWDER,
+ UNT_SV_ROOTTWIST,
+
/**
* Guild Auras
**/
@@ -1855,12 +1907,12 @@ struct skill_interface {
void (*reload) (void);
void (*read_db) (bool minimal);
/* */
- DBMap* cd_db; // char_id -> struct skill_cd
- DBMap* name2id_db;
- DBMap* unit_db; // int id -> struct skill_unit*
- DBMap* usave_db; // char_id -> struct skill_unit_save
- DBMap* group_db;// int group_id -> struct skill_unit_group*
- DBMap* bowling_db;// int mob_id -> struct mob_data*s
+ struct DBMap *cd_db; // char_id -> struct skill_cd
+ struct DBMap *name2id_db;
+ struct DBMap *unit_db; // int id -> struct skill_unit*
+ struct DBMap *usave_db; // char_id -> struct skill_unit_save
+ struct DBMap *group_db;// int group_id -> struct skill_unit_group*
+ struct DBMap *bowling_db;// int mob_id -> struct mob_data*s
/* */
struct eri *unit_ers; //For handling skill_unit's [Skotlex]
struct eri *timer_ers; //For handling skill_timerskills [Skotlex]
@@ -1918,7 +1970,7 @@ struct skill_interface {
int (*get_unit_layout_type) ( uint16 skill_id ,uint16 skill_lv );
int (*get_unit_range) ( uint16 skill_id, uint16 skill_lv );
int (*get_cooldown) ( uint16 skill_id, uint16 skill_lv );
- int (*tree_get_max) ( uint16 skill_id, int b_class );
+ int (*tree_get_max) (uint16 skill_id, int class);
const char *(*get_name) ( uint16 skill_id );
const char *(*get_desc) ( uint16 skill_id );
/* check */
@@ -1974,12 +2026,15 @@ struct skill_interface {
bool (*can_cloak) (struct map_session_data *sd);
int (*enchant_elemental_end) (struct block_list *bl, int type);
int (*not_ok) (uint16 skill_id, struct map_session_data *sd);
+ int (*not_ok_unknown) (uint16 skill_id, struct map_session_data *sd);
int (*not_ok_hom) (uint16 skill_id, struct homun_data *hd);
+ int (*not_ok_hom_unknown) (uint16 skill_id, struct homun_data *hd);
int (*not_ok_mercenary) (uint16 skill_id, struct mercenary_data *md);
int (*chastle_mob_changetarget) (struct block_list *bl,va_list ap);
int (*can_produce_mix) ( struct map_session_data *sd, int nameid, int trigger, int qty);
int (*produce_mix) ( struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty );
int (*arrow_create) ( struct map_session_data *sd,int nameid);
+ void (*castend_type) (int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
int (*castend_nodamage_id) (struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
int (*castend_damage_id) (struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick,int flag);
int (*castend_pos2) (struct block_list *src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
@@ -2022,6 +2077,7 @@ struct skill_interface {
int (*sit_out) (struct block_list *bl, va_list ap);
void (*unitsetmapcell) (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag);
int (*unit_onplace_timer) (struct skill_unit *src, struct block_list *bl, int64 tick);
+ void (*unit_onplace_timer_unknown) (struct skill_unit *src, struct block_list *bl, int64 *tick);
int (*unit_effect) (struct block_list* bl, va_list ap);
int (*unit_timer_sub_onplace) (struct block_list* bl, va_list ap);
int (*unit_move_sub) (struct block_list* bl, va_list ap);
@@ -2030,13 +2086,30 @@ struct skill_interface {
int (*blockmerc_end) (int tid, int64 tick, int id, intptr_t data);
int (*split_atoi) (char *str, int *val);
int (*unit_timer) (int tid, int64 tick, int id, intptr_t data);
- int (*unit_timer_sub) (DBKey key, DBData *data, va_list ap);
+ int (*unit_timer_sub) (union DBKey key, struct DBData *data, va_list ap);
void (*init_unit_layout) (void);
- bool (*parse_row_skilldb) (char* split[], int columns, int current);
- bool (*parse_row_requiredb) (char* split[], int columns, int current);
- bool (*parse_row_castdb) (char* split[], int columns, int current);
- bool (*parse_row_castnodexdb) (char* split[], int columns, int current);
- bool (*parse_row_unitdb) (char* split[], int columns, int current);
+ void (*init_unit_layout_unknown) (int skill_idx);
+ void (*validate_hittype) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_skilltype) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_attacktype) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_element) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_skillinfo) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_damagetype) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_castnodex) (struct config_setting_t *conf, struct s_skill_db *sk, bool delay);
+ void (*validate_weapontype) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_ammotype) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_state) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_item_requirements) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_unit_target) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_unit_flag) (struct config_setting_t *conf, struct s_skill_db *sk);
+ void (*validate_additional_fields) (struct config_setting_t *conf, struct s_skill_db *sk);
+ bool (*validate_skilldb) (struct s_skill_db *skt, const char *source);
+ int (*validate_weapontype_sub) (const char *type, bool on, struct s_skill_db *sk);
+ int (*validate_ammotype_sub) (const char *type, bool on, struct s_skill_db *sk);
+ int (*validate_unit_flag_sub) (const char *type, bool on, struct s_skill_db *sk);
+ bool (*read_skilldb) (const char *filename);
+ void (*config_set_level) (struct config_setting_t *conf, int *arr);
+ void (*level_set_value) (int *arr, int value);
bool (*parse_row_producedb) (char* split[], int columns, int current);
bool (*parse_row_createarrowdb) (char* split[], int columns, int current);
bool (*parse_row_abradb) (char* split[], int columns, int current);
@@ -2060,8 +2133,8 @@ struct skill_interface {
int (*magicdecoy) (struct map_session_data *sd, int nameid);
int (*poisoningweapon) ( struct map_session_data *sd, int nameid);
int (*select_menu) (struct map_session_data *sd,uint16 skill_id);
- int (*elementalanalysis) (struct map_session_data *sd, int n, uint16 skill_lv, unsigned short *item_list);
- int (*changematerial) (struct map_session_data *sd, int n, unsigned short *item_list);
+ int (*elementalanalysis) (struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list);
+ int (*changematerial) (struct map_session_data *sd, const struct itemlist *item_list);
int (*get_elemental_type) (uint16 skill_id, uint16 skill_lv);
void (*cooldown_save) (struct map_session_data * sd);
int (*get_new_group_id) (void);
@@ -2099,6 +2172,9 @@ struct skill_interface {
bool (*get_requirement_off_unknown) (struct status_change *sc, uint16 *skill_id);
bool (*get_requirement_item_unknown) (struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i);
void (*get_requirement_unknown) (struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req);
+ int (*splash_target) (struct block_list* bl);
+ int (*check_npc_chaospanic) (struct block_list *bl, va_list args);
+ int (*count_wos) (struct block_list *bl, va_list ap);
};
#ifdef HERCULES_CORE
diff --git a/src/map/status.c b/src/map/status.c
index 879f10efb..7982b15eb 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -70,7 +70,8 @@ struct status_interface *status;
* @param skill The skill to look up
* @return The status registered for this skill
**/
-sc_type status_skill2sc(int skill_id) {
+sc_type status_skill2sc(int skill_id)
+{
int idx;
if( (idx = skill->get_index(skill_id)) == 0 ) {
ShowError("status_skill2sc: Unsupported skill id %d\n", skill_id);
@@ -125,7 +126,8 @@ int status_type2relevant_bl_types(int type)
return status->dbs->RelevantBLTypes[type];
}
-static void set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag) {
+void status_set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag)
+{
uint16 idx;
if( (idx = skill->get_index(skill_id)) == 0 ) {
ShowError("set_sc: Unsupported skill id %d\n", skill_id);
@@ -146,10 +148,11 @@ static void set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag) {
status->dbs->Skill2SCTable[idx] = sc;
}
-void initChangeTables(void) {
-#define add_sc(skill,sc) set_sc((skill),(sc),SI_BLANK,SCB_NONE)
+void initChangeTables(void)
+{
+#define add_sc(skill,sc) status->set_sc((skill),(sc),SI_BLANK,SCB_NONE)
// indicates that the status displays a visual effect for the affected unit, and should be sent to the client for all supported units
-#define set_sc_with_vfx(skill, sc, icon, flag) do { set_sc((skill), (sc), (icon), (flag)); if((icon) < SI_MAX) status->dbs->RelevantBLTypes[(icon)] |= BL_SCEFFECT; } while(0)
+#define set_sc_with_vfx(skill, sc, icon, flag) do { status->set_sc((skill), (sc), (icon), (flag)); if((icon) < SI_MAX) status->dbs->RelevantBLTypes[(icon)] |= BL_SCEFFECT; } while(0)
int i;
@@ -167,83 +170,83 @@ void initChangeTables(void) {
memset(status->dbs->DisplayType, 0, sizeof(status->dbs->DisplayType));
//First we define the skill for common ailments. These are used in skill_additional_effect through sc cards. [Skotlex]
- set_sc( NPC_PETRIFYATTACK , SC_STONE , SI_BLANK , SCB_DEF_ELE|SCB_DEF|SCB_MDEF );
- set_sc( NPC_WIDEFREEZE , SC_FREEZE , SI_BLANK , SCB_DEF_ELE|SCB_DEF|SCB_MDEF );
- set_sc( NPC_STUNATTACK , SC_STUN , SI_BLANK , SCB_NONE );
- set_sc( NPC_SLEEPATTACK , SC_SLEEP , SI_BLANK , SCB_NONE );
- set_sc( NPC_POISON , SC_POISON , SI_BLANK , SCB_DEF2|SCB_REGEN );
- set_sc( NPC_CURSEATTACK , SC_CURSE , SI_BLANK , SCB_LUK|SCB_BATK|SCB_WATK|SCB_SPEED );
- set_sc( NPC_SILENCEATTACK , SC_SILENCE , SI_BLANK , SCB_NONE );
- set_sc( NPC_WIDECONFUSE , SC_CONFUSION , SI_BLANK , SCB_NONE );
- set_sc( NPC_BLINDATTACK , SC_BLIND , SI_BLANK , SCB_HIT|SCB_FLEE );
- set_sc( NPC_BLEEDING , SC_BLOODING , SI_BLOODING , SCB_REGEN );
- set_sc( NPC_POISON , SC_DPOISON , SI_BLANK , SCB_DEF2|SCB_REGEN );
+ status->set_sc( NPC_PETRIFYATTACK , SC_STONE , SI_BLANK , SCB_DEF_ELE|SCB_DEF|SCB_MDEF );
+ status->set_sc( NPC_WIDEFREEZE , SC_FREEZE , SI_BLANK , SCB_DEF_ELE|SCB_DEF|SCB_MDEF );
+ status->set_sc( NPC_STUNATTACK , SC_STUN , SI_BLANK , SCB_NONE );
+ status->set_sc( NPC_SLEEPATTACK , SC_SLEEP , SI_BLANK , SCB_NONE );
+ status->set_sc( NPC_POISON , SC_POISON , SI_BLANK , SCB_DEF2|SCB_REGEN );
+ status->set_sc( NPC_CURSEATTACK , SC_CURSE , SI_BLANK , SCB_LUK|SCB_BATK|SCB_WATK|SCB_SPEED );
+ status->set_sc( NPC_SILENCEATTACK , SC_SILENCE , SI_BLANK , SCB_NONE );
+ status->set_sc( NPC_WIDECONFUSE , SC_CONFUSION , SI_BLANK , SCB_NONE );
+ status->set_sc( NPC_BLINDATTACK , SC_BLIND , SI_BLANK , SCB_HIT|SCB_FLEE );
+ status->set_sc( NPC_BLEEDING , SC_BLOODING , SI_BLOODING , SCB_REGEN );
+ status->set_sc( NPC_POISON , SC_DPOISON , SI_BLANK , SCB_DEF2|SCB_REGEN );
//The main status definitions
add_sc( SM_BASH , SC_STUN );
- set_sc( SM_PROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
+ status->set_sc( SM_PROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
add_sc( SM_MAGNUM , SC_SUB_WEAPONPROPERTY );
- set_sc( SM_ENDURE , SC_ENDURE , SI_ENDURE , SCB_MDEF|SCB_DSPD );
+ status->set_sc( SM_ENDURE , SC_ENDURE , SI_ENDURE , SCB_MDEF|SCB_DSPD );
add_sc( MG_SIGHT , SC_SIGHT );
add_sc( MG_SAFETYWALL , SC_SAFETYWALL );
add_sc( MG_FROSTDIVER , SC_FREEZE );
add_sc( MG_STONECURSE , SC_STONE );
add_sc( AL_RUWACH , SC_RUWACH );
add_sc( AL_PNEUMA , SC_PNEUMA );
- set_sc( AL_INCAGI , SC_INC_AGI , SI_INC_AGI , SCB_AGI|SCB_SPEED );
- set_sc( AL_DECAGI , SC_DEC_AGI , SI_DEC_AGI , SCB_AGI|SCB_SPEED );
- set_sc( AL_CRUCIS , SC_CRUCIS , SI_CRUCIS , SCB_DEF );
- set_sc( AL_ANGELUS , SC_ANGELUS , SI_ANGELUS , SCB_DEF2 );
- set_sc( AL_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
- set_sc( AC_CONCENTRATION , SC_CONCENTRATION , SI_CONCENTRATION , SCB_AGI|SCB_DEX );
- set_sc( TF_HIDING , SC_HIDING , SI_HIDING , SCB_SPEED );
+ status->set_sc( AL_INCAGI , SC_INC_AGI , SI_INC_AGI , SCB_AGI|SCB_SPEED );
+ status->set_sc( AL_DECAGI , SC_DEC_AGI , SI_DEC_AGI , SCB_AGI|SCB_SPEED );
+ status->set_sc( AL_CRUCIS , SC_CRUCIS , SI_CRUCIS , SCB_DEF );
+ status->set_sc( AL_ANGELUS , SC_ANGELUS , SI_ANGELUS , SCB_DEF2 );
+ status->set_sc( AL_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
+ status->set_sc( AC_CONCENTRATION , SC_CONCENTRATION , SI_CONCENTRATION , SCB_AGI|SCB_DEX );
+ status->set_sc( TF_HIDING , SC_HIDING , SI_HIDING , SCB_SPEED );
add_sc( TF_POISON , SC_POISON );
- set_sc( KN_TWOHANDQUICKEN , SC_TWOHANDQUICKEN , SI_TWOHANDQUICKEN , SCB_ASPD );
+ status->set_sc( KN_TWOHANDQUICKEN , SC_TWOHANDQUICKEN , SI_TWOHANDQUICKEN , SCB_ASPD );
add_sc( KN_AUTOCOUNTER , SC_AUTOCOUNTER );
- set_sc( PR_IMPOSITIO , SC_IMPOSITIO , SI_IMPOSITIO ,
+ status->set_sc( PR_IMPOSITIO , SC_IMPOSITIO , SI_IMPOSITIO ,
#ifdef RENEWAL
SCB_NONE );
#else
SCB_WATK );
#endif
- set_sc( PR_SUFFRAGIUM , SC_SUFFRAGIUM , SI_SUFFRAGIUM , SCB_NONE );
- set_sc( PR_ASPERSIO , SC_ASPERSIO , SI_ASPERSIO , SCB_ATK_ELE );
- set_sc( PR_BENEDICTIO , SC_BENEDICTIO , SI_BENEDICTIO , SCB_DEF_ELE );
- set_sc( PR_SLOWPOISON , SC_SLOWPOISON , SI_SLOWPOISON , SCB_REGEN );
- set_sc( PR_KYRIE , SC_KYRIE , SI_KYRIE , SCB_NONE );
- set_sc( PR_MAGNIFICAT , SC_MAGNIFICAT , SI_MAGNIFICAT , SCB_REGEN );
- set_sc( PR_GLORIA , SC_GLORIA , SI_GLORIA , SCB_LUK );
+ status->set_sc( PR_SUFFRAGIUM , SC_SUFFRAGIUM , SI_SUFFRAGIUM , SCB_NONE );
+ status->set_sc( PR_ASPERSIO , SC_ASPERSIO , SI_ASPERSIO , SCB_ATK_ELE );
+ status->set_sc( PR_BENEDICTIO , SC_BENEDICTIO , SI_BENEDICTIO , SCB_DEF_ELE );
+ status->set_sc( PR_SLOWPOISON , SC_SLOWPOISON , SI_SLOWPOISON , SCB_REGEN );
+ status->set_sc( PR_KYRIE , SC_KYRIE , SI_KYRIE , SCB_NONE );
+ status->set_sc( PR_MAGNIFICAT , SC_MAGNIFICAT , SI_MAGNIFICAT , SCB_REGEN );
+ status->set_sc( PR_GLORIA , SC_GLORIA , SI_GLORIA , SCB_LUK );
add_sc( PR_LEXDIVINA , SC_SILENCE );
- set_sc( PR_LEXAETERNA , SC_LEXAETERNA , SI_LEXAETERNA , SCB_NONE );
+ status->set_sc( PR_LEXAETERNA , SC_LEXAETERNA , SI_LEXAETERNA , SCB_NONE );
add_sc( WZ_METEOR , SC_STUN );
add_sc( WZ_VERMILION , SC_BLIND );
add_sc( WZ_FROSTNOVA , SC_FREEZE );
add_sc( WZ_STORMGUST , SC_FREEZE );
- set_sc( WZ_QUAGMIRE , SC_QUAGMIRE , SI_QUAGMIRE , SCB_AGI|SCB_DEX|SCB_ASPD|SCB_SPEED );
- set_sc( BS_ADRENALINE , SC_ADRENALINE , SI_ADRENALINE , SCB_ASPD );
- set_sc( BS_WEAPONPERFECT , SC_WEAPONPERFECT , SI_WEAPONPERFECT, SCB_NONE );
- set_sc( BS_OVERTHRUST , SC_OVERTHRUST , SI_OVERTHRUST , SCB_NONE );
- set_sc( BS_MAXIMIZE , SC_MAXIMIZEPOWER , SI_MAXIMIZE , SCB_REGEN );
+ status->set_sc( WZ_QUAGMIRE , SC_QUAGMIRE , SI_QUAGMIRE , SCB_AGI|SCB_DEX|SCB_ASPD|SCB_SPEED );
+ status->set_sc( BS_ADRENALINE , SC_ADRENALINE , SI_ADRENALINE , SCB_ASPD );
+ status->set_sc( BS_WEAPONPERFECT , SC_WEAPONPERFECT , SI_WEAPONPERFECT, SCB_NONE );
+ status->set_sc( BS_OVERTHRUST , SC_OVERTHRUST , SI_OVERTHRUST , SCB_NONE );
+ status->set_sc( BS_MAXIMIZE , SC_MAXIMIZEPOWER , SI_MAXIMIZE , SCB_REGEN );
add_sc( HT_LANDMINE , SC_STUN );
- set_sc( HT_ANKLESNARE , SC_ANKLESNARE , SI_ANKLESNARE , SCB_NONE );
+ status->set_sc( HT_ANKLESNARE , SC_ANKLESNARE , SI_ANKLESNARE , SCB_NONE );
add_sc( HT_SANDMAN , SC_SLEEP );
add_sc( HT_FLASHER , SC_BLIND );
add_sc( HT_FREEZINGTRAP , SC_FREEZE );
- set_sc( AS_CLOAKING , SC_CLOAKING , SI_CLOAKING , SCB_CRI|SCB_SPEED );
+ status->set_sc( AS_CLOAKING , SC_CLOAKING , SI_CLOAKING , SCB_CRI|SCB_SPEED );
add_sc( AS_SONICBLOW , SC_STUN );
- set_sc( AS_ENCHANTPOISON , SC_ENCHANTPOISON , SI_ENCHANTPOISON, SCB_ATK_ELE );
- set_sc( AS_POISONREACT , SC_POISONREACT , SI_POISONREACT , SCB_NONE );
+ status->set_sc( AS_ENCHANTPOISON , SC_ENCHANTPOISON , SI_ENCHANTPOISON, SCB_ATK_ELE );
+ status->set_sc( AS_POISONREACT , SC_POISONREACT , SI_POISONREACT , SCB_NONE );
add_sc( AS_VENOMDUST , SC_POISON );
add_sc( AS_SPLASHER , SC_SPLASHER );
- set_sc( NV_TRICKDEAD , SC_TRICKDEAD , SI_TRICKDEAD , SCB_REGEN );
- set_sc( SM_AUTOBERSERK , SC_AUTOBERSERK , SI_AUTOBERSERK , SCB_NONE );
+ status->set_sc( NV_TRICKDEAD , SC_TRICKDEAD , SI_TRICKDEAD , SCB_REGEN );
+ status->set_sc( SM_AUTOBERSERK , SC_AUTOBERSERK , SI_AUTOBERSERK , SCB_NONE );
add_sc( TF_SPRINKLESAND , SC_BLIND );
add_sc( TF_THROWSTONE , SC_STUN );
- set_sc( MC_LOUD , SC_SHOUT , SI_SHOUT , SCB_STR );
- set_sc( MG_ENERGYCOAT , SC_ENERGYCOAT , SI_ENERGYCOAT , SCB_NONE );
- set_sc( NPC_EMOTION , SC_MODECHANGE , SI_BLANK , SCB_MODE );
+ status->set_sc( MC_LOUD , SC_SHOUT , SI_SHOUT , SCB_STR );
+ status->set_sc( MG_ENERGYCOAT , SC_ENERGYCOAT , SI_ENERGYCOAT , SCB_NONE );
+ status->set_sc( NPC_EMOTION , SC_MODECHANGE , SI_BLANK , SCB_MODE );
add_sc( NPC_EMOTION_ON , SC_MODECHANGE );
- set_sc( NPC_ATTRICHANGE , SC_ARMOR_PROPERTY , SI_ARMOR_PROPERTY , SCB_DEF_ELE );
+ status->set_sc( NPC_ATTRICHANGE , SC_ARMOR_PROPERTY , SI_ARMOR_PROPERTY , SCB_DEF_ELE );
add_sc( NPC_CHANGEWATER , SC_ARMOR_PROPERTY );
add_sc( NPC_CHANGEGROUND , SC_ARMOR_PROPERTY );
add_sc( NPC_CHANGEFIRE , SC_ARMOR_PROPERTY );
@@ -260,184 +263,184 @@ void initChangeTables(void) {
add_sc( NPC_CURSEATTACK , SC_CURSE );
add_sc( NPC_SLEEPATTACK , SC_SLEEP );
add_sc( NPC_MAGICALATTACK , SC_MAGICALATTACK );
- set_sc( NPC_KEEPING , SC_KEEPING , SI_BLANK , SCB_DEF );
+ status->set_sc( NPC_KEEPING , SC_KEEPING , SI_BLANK , SCB_DEF );
add_sc( NPC_DARKBLESSING , SC_COMA );
- set_sc( NPC_BARRIER , SC_BARRIER , SI_BLANK , SCB_MDEF|SCB_DEF );
+ status->set_sc( NPC_BARRIER , SC_BARRIER , SI_BLANK , SCB_MDEF|SCB_DEF );
add_sc( NPC_DEFENDER , SC_ARMOR );
add_sc( NPC_LICK , SC_STUN );
- set_sc( NPC_HALLUCINATION , SC_ILLUSION , SI_ILLUSION , SCB_NONE );
+ status->set_sc( NPC_HALLUCINATION , SC_ILLUSION , SI_ILLUSION , SCB_NONE );
add_sc( NPC_REBIRTH , SC_REBIRTH );
add_sc( RG_RAID , SC_STUN );
#ifdef RENEWAL
add_sc( RG_RAID , SC_RAID );
add_sc( RG_BACKSTAP , SC_STUN );
#endif
- set_sc( RG_STRIPWEAPON , SC_NOEQUIPWEAPON , SI_NOEQUIPWEAPON , SCB_WATK );
- set_sc( RG_STRIPSHIELD , SC_NOEQUIPSHIELD , SI_NOEQUIPSHIELD , SCB_DEF );
- set_sc( RG_STRIPARMOR , SC_NOEQUIPARMOR , SI_NOEQUIPARMOR , SCB_VIT );
- set_sc( RG_STRIPHELM , SC_NOEQUIPHELM , SI_NOEQUIPHELM , SCB_INT );
+ status->set_sc( RG_STRIPWEAPON , SC_NOEQUIPWEAPON , SI_NOEQUIPWEAPON , SCB_WATK );
+ status->set_sc( RG_STRIPSHIELD , SC_NOEQUIPSHIELD , SI_NOEQUIPSHIELD , SCB_DEF );
+ status->set_sc( RG_STRIPARMOR , SC_NOEQUIPARMOR , SI_NOEQUIPARMOR , SCB_VIT );
+ status->set_sc( RG_STRIPHELM , SC_NOEQUIPHELM , SI_NOEQUIPHELM , SCB_INT );
add_sc( AM_ACIDTERROR , SC_BLOODING );
- set_sc( AM_CP_WEAPON , SC_PROTECTWEAPON , SI_PROTECTWEAPON , SCB_NONE );
- set_sc( AM_CP_SHIELD , SC_PROTECTSHIELD , SI_PROTECTSHIELD , SCB_NONE );
- set_sc( AM_CP_ARMOR , SC_PROTECTARMOR , SI_PROTECTARMOR , SCB_NONE );
- set_sc( AM_CP_HELM , SC_PROTECTHELM , SI_PROTECTHELM , SCB_NONE );
- set_sc( CR_AUTOGUARD , SC_AUTOGUARD , SI_AUTOGUARD , SCB_NONE );
+ status->set_sc( AM_CP_WEAPON , SC_PROTECTWEAPON , SI_PROTECTWEAPON , SCB_NONE );
+ status->set_sc( AM_CP_SHIELD , SC_PROTECTSHIELD , SI_PROTECTSHIELD , SCB_NONE );
+ status->set_sc( AM_CP_ARMOR , SC_PROTECTARMOR , SI_PROTECTARMOR , SCB_NONE );
+ status->set_sc( AM_CP_HELM , SC_PROTECTHELM , SI_PROTECTHELM , SCB_NONE );
+ status->set_sc( CR_AUTOGUARD , SC_AUTOGUARD , SI_AUTOGUARD , SCB_NONE );
add_sc( CR_SHIELDCHARGE , SC_STUN );
- set_sc( CR_REFLECTSHIELD , SC_REFLECTSHIELD , SI_REFLECTSHIELD , SCB_NONE );
+ status->set_sc( CR_REFLECTSHIELD , SC_REFLECTSHIELD , SI_REFLECTSHIELD , SCB_NONE );
add_sc( CR_HOLYCROSS , SC_BLIND );
add_sc( CR_GRANDCROSS , SC_BLIND );
add_sc( CR_DEVOTION , SC_DEVOTION );
- set_sc( CR_PROVIDENCE , SC_PROVIDENCE , SI_PROVIDENCE , SCB_ALL );
- set_sc( CR_DEFENDER , SC_DEFENDER , SI_DEFENDER , SCB_SPEED|SCB_ASPD );
- set_sc( CR_SPEARQUICKEN , SC_SPEARQUICKEN , SI_SPEARQUICKEN , SCB_ASPD|SCB_CRI|SCB_FLEE );
- set_sc( MO_STEELBODY , SC_STEELBODY , SI_STEELBODY , SCB_DEF|SCB_MDEF|SCB_ASPD|SCB_SPEED );
+ status->set_sc( CR_PROVIDENCE , SC_PROVIDENCE , SI_PROVIDENCE , SCB_ALL );
+ status->set_sc( CR_DEFENDER , SC_DEFENDER , SI_DEFENDER , SCB_SPEED|SCB_ASPD );
+ status->set_sc( CR_SPEARQUICKEN , SC_SPEARQUICKEN , SI_SPEARQUICKEN , SCB_ASPD|SCB_CRI|SCB_FLEE );
+ status->set_sc( MO_STEELBODY , SC_STEELBODY , SI_STEELBODY , SCB_DEF|SCB_MDEF|SCB_ASPD|SCB_SPEED );
add_sc( MO_BLADESTOP , SC_BLADESTOP_WAIT );
add_sc( MO_BLADESTOP , SC_BLADESTOP );
- set_sc( MO_EXPLOSIONSPIRITS , SC_EXPLOSIONSPIRITS, SI_EXPLOSIONSPIRITS, SCB_CRI|SCB_REGEN );
- set_sc( MO_EXTREMITYFIST , SC_EXTREMITYFIST , SI_BLANK , SCB_REGEN );
+ status->set_sc( MO_EXPLOSIONSPIRITS , SC_EXPLOSIONSPIRITS, SI_EXPLOSIONSPIRITS, SCB_CRI|SCB_REGEN );
+ status->set_sc( MO_EXTREMITYFIST , SC_EXTREMITYFIST , SI_BLANK , SCB_REGEN );
#ifdef RENEWAL
- set_sc( MO_EXTREMITYFIST , SC_EXTREMITYFIST2 , SI_EXTREMITYFIST , SCB_NONE );
+ status->set_sc( MO_EXTREMITYFIST , SC_EXTREMITYFIST2 , SI_EXTREMITYFIST , SCB_NONE );
#endif
add_sc( SA_MAGICROD , SC_MAGICROD );
- set_sc( SA_AUTOSPELL , SC_AUTOSPELL , SI_AUTOSPELL , SCB_NONE );
- set_sc( SA_FLAMELAUNCHER , SC_PROPERTYFIRE , SI_PROPERTYFIRE , SCB_ATK_ELE );
- set_sc( SA_FROSTWEAPON , SC_PROPERTYWATER , SI_PROPERTYWATER , SCB_ATK_ELE );
- set_sc( SA_LIGHTNINGLOADER , SC_PROPERTYWIND , SI_PROPERTYWIND , SCB_ATK_ELE );
- set_sc( SA_SEISMICWEAPON , SC_PROPERTYGROUND , SI_PROPERTYGROUND , SCB_ATK_ELE );
- set_sc( SA_VOLCANO , SC_VOLCANO , SI_GROUNDMAGIC , SCB_WATK );
- set_sc( SA_DELUGE , SC_DELUGE , SI_GROUNDMAGIC , SCB_MAXHP );
- set_sc( SA_VIOLENTGALE , SC_VIOLENTGALE , SI_GROUNDMAGIC , SCB_FLEE );
+ status->set_sc( SA_AUTOSPELL , SC_AUTOSPELL , SI_AUTOSPELL , SCB_NONE );
+ status->set_sc( SA_FLAMELAUNCHER , SC_PROPERTYFIRE , SI_PROPERTYFIRE , SCB_ATK_ELE );
+ status->set_sc( SA_FROSTWEAPON , SC_PROPERTYWATER , SI_PROPERTYWATER , SCB_ATK_ELE );
+ status->set_sc( SA_LIGHTNINGLOADER , SC_PROPERTYWIND , SI_PROPERTYWIND , SCB_ATK_ELE );
+ status->set_sc( SA_SEISMICWEAPON , SC_PROPERTYGROUND , SI_PROPERTYGROUND , SCB_ATK_ELE );
+ status->set_sc( SA_VOLCANO , SC_VOLCANO , SI_GROUNDMAGIC , SCB_WATK );
+ status->set_sc( SA_DELUGE , SC_DELUGE , SI_GROUNDMAGIC , SCB_MAXHP );
+ status->set_sc( SA_VIOLENTGALE , SC_VIOLENTGALE , SI_GROUNDMAGIC , SCB_FLEE );
add_sc( SA_REVERSEORCISH , SC_ORCISH );
add_sc( SA_COMA , SC_COMA );
- set_sc( BD_ENCORE , SC_DANCING , SI_BLANK , SCB_SPEED|SCB_REGEN );
+ status->set_sc( BD_ENCORE , SC_DANCING , SI_BLANK , SCB_SPEED|SCB_REGEN );
add_sc( BD_RICHMANKIM , SC_RICHMANKIM );
- set_sc( BD_ETERNALCHAOS , SC_ETERNALCHAOS , SI_BLANK , SCB_DEF2 );
- set_sc( BD_DRUMBATTLEFIELD , SC_DRUMBATTLE , SI_BLANK , SCB_WATK|SCB_DEF );
- set_sc( BD_RINGNIBELUNGEN , SC_NIBELUNGEN , SI_BLANK , SCB_WATK );
+ status->set_sc( BD_ETERNALCHAOS , SC_ETERNALCHAOS , SI_BLANK , SCB_DEF2 );
+ status->set_sc( BD_DRUMBATTLEFIELD , SC_DRUMBATTLE , SI_BLANK , SCB_WATK|SCB_DEF );
+ status->set_sc( BD_RINGNIBELUNGEN , SC_NIBELUNGEN , SI_BLANK , SCB_WATK );
add_sc( BD_ROKISWEIL , SC_ROKISWEIL );
add_sc( BD_INTOABYSS , SC_INTOABYSS );
- set_sc( BD_SIEGFRIED , SC_SIEGFRIED , SI_BLANK , SCB_ALL );
+ status->set_sc( BD_SIEGFRIED , SC_SIEGFRIED , SI_BLANK , SCB_ALL );
add_sc( BA_FROSTJOKER , SC_FREEZE );
- set_sc( BA_WHISTLE , SC_WHISTLE , SI_BLANK , SCB_FLEE|SCB_FLEE2 );
- set_sc( BA_ASSASSINCROSS , SC_ASSNCROS , SI_BLANK , SCB_ASPD );
+ status->set_sc( BA_WHISTLE , SC_WHISTLE , SI_BLANK , SCB_FLEE|SCB_FLEE2 );
+ status->set_sc( BA_ASSASSINCROSS , SC_ASSNCROS , SI_BLANK , SCB_ASPD );
add_sc( BA_POEMBRAGI , SC_POEMBRAGI );
- set_sc( BA_APPLEIDUN , SC_APPLEIDUN , SI_BLANK , SCB_MAXHP );
+ status->set_sc( BA_APPLEIDUN , SC_APPLEIDUN , SI_BLANK , SCB_MAXHP );
add_sc( DC_SCREAM , SC_STUN );
- set_sc( DC_HUMMING , SC_HUMMING , SI_BLANK , SCB_HIT );
- set_sc( DC_DONTFORGETME , SC_DONTFORGETME , SI_BLANK , SCB_SPEED|SCB_ASPD );
- set_sc( DC_FORTUNEKISS , SC_FORTUNE , SI_BLANK , SCB_CRI );
- set_sc( DC_SERVICEFORYOU , SC_SERVICEFORYOU , SI_BLANK , SCB_ALL );
+ status->set_sc( DC_HUMMING , SC_HUMMING , SI_BLANK , SCB_HIT );
+ status->set_sc( DC_DONTFORGETME , SC_DONTFORGETME , SI_BLANK , SCB_SPEED|SCB_ASPD );
+ status->set_sc( DC_FORTUNEKISS , SC_FORTUNE , SI_BLANK , SCB_CRI );
+ status->set_sc( DC_SERVICEFORYOU , SC_SERVICEFORYOU , SI_BLANK , SCB_ALL );
add_sc( NPC_DARKCROSS , SC_BLIND );
add_sc( NPC_GRANDDARKNESS , SC_BLIND );
- set_sc( NPC_STOP , SC_STOP , SI_STOP , SCB_NONE );
- set_sc( NPC_WEAPONBRAKER , SC_BROKENWEAPON , SI_BROKENWEAPON , SCB_NONE );
- set_sc( NPC_ARMORBRAKE , SC_BROKENARMOR , SI_BROKENARMOR , SCB_NONE );
- set_sc( NPC_CHANGEUNDEAD , SC_PROPERTYUNDEAD , SI_PROPERTYUNDEAD , SCB_DEF_ELE );
- set_sc( NPC_POWERUP , SC_INCHITRATE , SI_BLANK , SCB_HIT );
- set_sc( NPC_AGIUP , SC_INCFLEERATE , SI_BLANK , SCB_FLEE );
+ status->set_sc( NPC_STOP , SC_STOP , SI_STOP , SCB_NONE );
+ status->set_sc( NPC_WEAPONBRAKER , SC_BROKENWEAPON , SI_BROKENWEAPON , SCB_NONE );
+ status->set_sc( NPC_ARMORBRAKE , SC_BROKENARMOR , SI_BROKENARMOR , SCB_NONE );
+ status->set_sc( NPC_CHANGEUNDEAD , SC_PROPERTYUNDEAD , SI_PROPERTYUNDEAD , SCB_DEF_ELE );
+ status->set_sc( NPC_POWERUP , SC_INCHITRATE , SI_BLANK , SCB_HIT );
+ status->set_sc( NPC_AGIUP , SC_INCFLEERATE , SI_BLANK , SCB_FLEE );
add_sc( NPC_INVISIBLE , SC_CLOAKING );
- set_sc( LK_AURABLADE , SC_AURABLADE , SI_AURABLADE , SCB_NONE );
- set_sc( LK_PARRYING , SC_PARRYING , SI_PARRYING , SCB_NONE );
+ status->set_sc( LK_AURABLADE , SC_AURABLADE , SI_AURABLADE , SCB_NONE );
+ status->set_sc( LK_PARRYING , SC_PARRYING , SI_PARRYING , SCB_NONE );
#ifndef RENEWAL
- set_sc( LK_CONCENTRATION , SC_LKCONCENTRATION , SI_LKCONCENTRATION , SCB_BATK|SCB_WATK|SCB_HIT|SCB_DEF|SCB_DEF2);
+ status->set_sc( LK_CONCENTRATION , SC_LKCONCENTRATION , SI_LKCONCENTRATION , SCB_BATK|SCB_WATK|SCB_HIT|SCB_DEF|SCB_DEF2);
#else
- set_sc( LK_CONCENTRATION , SC_LKCONCENTRATION , SI_LKCONCENTRATION , SCB_HIT|SCB_DEF);
+ status->set_sc( LK_CONCENTRATION , SC_LKCONCENTRATION , SI_LKCONCENTRATION , SCB_HIT|SCB_DEF);
#endif
- set_sc( LK_TENSIONRELAX , SC_TENSIONRELAX , SI_TENSIONRELAX , SCB_REGEN );
- set_sc( LK_BERSERK , SC_BERSERK , SI_BERSERK , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2|SCB_FLEE|SCB_SPEED|SCB_ASPD|SCB_MAXHP|SCB_REGEN );
- set_sc( HP_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE );
+ status->set_sc( LK_TENSIONRELAX , SC_TENSIONRELAX , SI_TENSIONRELAX , SCB_REGEN );
+ status->set_sc( LK_BERSERK , SC_BERSERK , SI_BERSERK , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2|SCB_FLEE|SCB_SPEED|SCB_ASPD|SCB_MAXHP|SCB_REGEN );
+ status->set_sc( HP_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE );
add_sc( HP_BASILICA , SC_BASILICA );
- set_sc( HW_MAGICPOWER , SC_MAGICPOWER , SI_MAGICPOWER , SCB_MATK );
+ status->set_sc( HW_MAGICPOWER , SC_MAGICPOWER , SI_MAGICPOWER , SCB_MATK );
add_sc( PA_SACRIFICE , SC_SACRIFICE );
- set_sc( PA_GOSPEL , SC_GOSPEL , SI_BLANK , SCB_SPEED|SCB_ASPD );
+ status->set_sc( PA_GOSPEL , SC_GOSPEL , SI_BLANK , SCB_SPEED|SCB_ASPD );
add_sc( PA_GOSPEL , SC_SCRESIST );
add_sc( CH_TIGERFIST , SC_STOP );
- set_sc( ASC_EDP , SC_EDP , SI_EDP , SCB_NONE );
- set_sc( SN_SIGHT , SC_TRUESIGHT , SI_TRUESIGHT , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK|SCB_CRI|SCB_HIT );
- set_sc( SN_WINDWALK , SC_WINDWALK , SI_WINDWALK , SCB_FLEE|SCB_SPEED );
- set_sc( WS_MELTDOWN , SC_MELTDOWN , SI_MELTDOWN , SCB_NONE );
- set_sc( WS_CARTBOOST , SC_CARTBOOST , SI_CARTBOOST , SCB_SPEED );
- set_sc( ST_CHASEWALK , SC_CHASEWALK , SI_BLANK , SCB_SPEED );
- set_sc( ST_REJECTSWORD , SC_SWORDREJECT , SI_SWORDREJECT , SCB_NONE );
+ status->set_sc( ASC_EDP , SC_EDP , SI_EDP , SCB_NONE );
+ status->set_sc( SN_SIGHT , SC_TRUESIGHT , SI_TRUESIGHT , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK|SCB_CRI|SCB_HIT );
+ status->set_sc( SN_WINDWALK , SC_WINDWALK , SI_WINDWALK , SCB_FLEE|SCB_SPEED );
+ status->set_sc( WS_MELTDOWN , SC_MELTDOWN , SI_MELTDOWN , SCB_NONE );
+ status->set_sc( WS_CARTBOOST , SC_CARTBOOST , SI_CARTBOOST , SCB_SPEED );
+ status->set_sc( ST_CHASEWALK , SC_CHASEWALK , SI_BLANK , SCB_SPEED );
+ status->set_sc( ST_REJECTSWORD , SC_SWORDREJECT , SI_SWORDREJECT , SCB_NONE );
add_sc( ST_REJECTSWORD , SC_AUTOCOUNTER );
- set_sc( CG_MARIONETTE , SC_MARIONETTE_MASTER , SI_MARIONETTE_MASTER , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
- set_sc( CG_MARIONETTE , SC_MARIONETTE , SI_MARIONETTE , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
+ status->set_sc( CG_MARIONETTE , SC_MARIONETTE_MASTER , SI_MARIONETTE_MASTER , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
+ status->set_sc( CG_MARIONETTE , SC_MARIONETTE , SI_MARIONETTE , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
add_sc( LK_SPIRALPIERCE , SC_STOP );
add_sc( LK_HEADCRUSH , SC_BLOODING );
- set_sc( LK_JOINTBEAT , SC_JOINTBEAT , SI_JOINTBEAT , SCB_BATK|SCB_DEF2|SCB_SPEED|SCB_ASPD );
+ status->set_sc( LK_JOINTBEAT , SC_JOINTBEAT , SI_JOINTBEAT , SCB_BATK|SCB_DEF2|SCB_SPEED|SCB_ASPD );
add_sc( HW_NAPALMVULCAN , SC_CURSE );
- set_sc( PF_MINDBREAKER , SC_MINDBREAKER , SI_BLANK , SCB_MATK|SCB_MDEF2 );
+ status->set_sc( PF_MINDBREAKER , SC_MINDBREAKER , SI_BLANK , SCB_MATK|SCB_MDEF2 );
add_sc( PF_MEMORIZE , SC_MEMORIZE );
add_sc( PF_FOGWALL , SC_FOGWALL );
- set_sc( PF_SPIDERWEB , SC_SPIDERWEB , SI_BLANK , SCB_FLEE );
- set_sc( WE_BABY , SC_BABY , SI_PROTECTEXP , SCB_NONE );
- set_sc( TK_RUN , SC_RUN , SI_RUN , SCB_SPEED|SCB_DSPD );
- set_sc( TK_RUN , SC_STRUP , SI_STRUP , SCB_STR );
- set_sc( TK_READYSTORM , SC_STORMKICK_READY , SI_STORMKICK_ON , SCB_NONE );
- set_sc( TK_READYDOWN , SC_DOWNKICK_READY , SI_DOWNKICK_ON , SCB_NONE );
+ status->set_sc( PF_SPIDERWEB , SC_SPIDERWEB , SI_BLANK , SCB_FLEE );
+ status->set_sc( WE_BABY , SC_BABY , SI_PROTECTEXP , SCB_NONE );
+ status->set_sc( TK_RUN , SC_RUN , SI_RUN , SCB_SPEED|SCB_DSPD );
+ status->set_sc( TK_RUN , SC_STRUP , SI_STRUP , SCB_STR );
+ status->set_sc( TK_READYSTORM , SC_STORMKICK_READY , SI_STORMKICK_ON , SCB_NONE );
+ status->set_sc( TK_READYDOWN , SC_DOWNKICK_READY , SI_DOWNKICK_ON , SCB_NONE );
add_sc( TK_DOWNKICK , SC_STUN );
- set_sc( TK_READYTURN , SC_TURNKICK_READY , SI_TURNKICK_ON , SCB_NONE );
- set_sc( TK_READYCOUNTER , SC_COUNTERKICK_READY , SI_COUNTER_ON , SCB_NONE );
- set_sc( TK_DODGE , SC_DODGE_READY , SI_DODGE_ON , SCB_NONE );
- set_sc( TK_SPTIME , SC_EARTHSCROLL , SI_EARTHSCROLL , SCB_NONE );
+ status->set_sc( TK_READYTURN , SC_TURNKICK_READY , SI_TURNKICK_ON , SCB_NONE );
+ status->set_sc( TK_READYCOUNTER , SC_COUNTERKICK_READY , SI_COUNTER_ON , SCB_NONE );
+ status->set_sc( TK_DODGE , SC_DODGE_READY , SI_DODGE_ON , SCB_NONE );
+ status->set_sc( TK_SPTIME , SC_EARTHSCROLL , SI_EARTHSCROLL , SCB_NONE );
add_sc( TK_SEVENWIND , SC_TK_SEVENWIND );
- set_sc( TK_SEVENWIND , SC_PROPERTYTELEKINESIS , SI_PROPERTYTELEKINESIS , SCB_ATK_ELE );
- set_sc( TK_SEVENWIND , SC_PROPERTYDARK , SI_PROPERTYDARK , SCB_ATK_ELE );
- set_sc( SG_SUN_WARM , SC_WARM , SI_SG_SUN_WARM , SCB_NONE );
+ status->set_sc( TK_SEVENWIND , SC_PROPERTYTELEKINESIS , SI_PROPERTYTELEKINESIS , SCB_ATK_ELE );
+ status->set_sc( TK_SEVENWIND , SC_PROPERTYDARK , SI_PROPERTYDARK , SCB_ATK_ELE );
+ status->set_sc( SG_SUN_WARM , SC_WARM , SI_SG_SUN_WARM , SCB_NONE );
add_sc( SG_MOON_WARM , SC_WARM );
add_sc( SG_STAR_WARM , SC_WARM );
- set_sc( SG_SUN_COMFORT , SC_SUN_COMFORT , SI_SUN_COMFORT , SCB_DEF2 );
- set_sc( SG_MOON_COMFORT , SC_MOON_COMFORT , SI_MOON_COMFORT , SCB_FLEE );
- set_sc( SG_STAR_COMFORT , SC_STAR_COMFORT , SI_STAR_COMFORT , SCB_ASPD );
+ status->set_sc( SG_SUN_COMFORT , SC_SUN_COMFORT , SI_SUN_COMFORT , SCB_DEF2 );
+ status->set_sc( SG_MOON_COMFORT , SC_MOON_COMFORT , SI_MOON_COMFORT , SCB_FLEE );
+ status->set_sc( SG_STAR_COMFORT , SC_STAR_COMFORT , SI_STAR_COMFORT , SCB_ASPD );
add_sc( SG_FRIEND , SC_SKILLRATE_UP );
- set_sc( SG_KNOWLEDGE , SC_KNOWLEDGE , SI_BLANK , SCB_ALL );
- set_sc( SG_FUSION , SC_FUSION , SI_BLANK , SCB_SPEED );
- set_sc( BS_ADRENALINE2 , SC_ADRENALINE2 , SI_ADRENALINE2 , SCB_ASPD );
- set_sc( SL_KAIZEL , SC_KAIZEL , SI_KAIZEL , SCB_NONE );
- set_sc( SL_KAAHI , SC_KAAHI , SI_KAAHI , SCB_NONE );
- set_sc( SL_KAUPE , SC_KAUPE , SI_KAUPE , SCB_NONE );
- set_sc( SL_KAITE , SC_KAITE , SI_KAITE , SCB_NONE );
+ status->set_sc( SG_KNOWLEDGE , SC_KNOWLEDGE , SI_BLANK , SCB_ALL );
+ status->set_sc( SG_FUSION , SC_FUSION , SI_BLANK , SCB_SPEED );
+ status->set_sc( BS_ADRENALINE2 , SC_ADRENALINE2 , SI_ADRENALINE2 , SCB_ASPD );
+ status->set_sc( SL_KAIZEL , SC_KAIZEL , SI_KAIZEL , SCB_NONE );
+ status->set_sc( SL_KAAHI , SC_KAAHI , SI_KAAHI , SCB_NONE );
+ status->set_sc( SL_KAUPE , SC_KAUPE , SI_KAUPE , SCB_NONE );
+ status->set_sc( SL_KAITE , SC_KAITE , SI_KAITE , SCB_NONE );
add_sc( SL_STUN , SC_STUN );
- set_sc( SL_SWOO , SC_SWOO , SI_BLANK , SCB_SPEED );
- set_sc( SL_SKE , SC_SKE , SI_BLANK , SCB_BATK|SCB_WATK|SCB_DEF|SCB_DEF2 );
- set_sc( SL_SKA , SC_SKA , SI_BLANK , SCB_DEF|SCB_MDEF|SCB_ASPD );
- set_sc( SL_SMA , SC_SMA_READY , SI_SMA_READY , SCB_NONE );
- set_sc( SM_SELFPROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
- set_sc( ST_PRESERVE , SC_PRESERVE , SI_PRESERVE , SCB_NONE );
- set_sc( PF_DOUBLECASTING , SC_DOUBLECASTING , SI_DOUBLECASTING , SCB_NONE );
- set_sc( HW_GRAVITATION , SC_GRAVITATION , SI_BLANK , SCB_ASPD );
+ status->set_sc( SL_SWOO , SC_SWOO , SI_BLANK , SCB_SPEED );
+ status->set_sc( SL_SKE , SC_SKE , SI_BLANK , SCB_BATK|SCB_WATK|SCB_DEF|SCB_DEF2 );
+ status->set_sc( SL_SKA , SC_SKA , SI_BLANK , SCB_DEF|SCB_MDEF|SCB_ASPD );
+ status->set_sc( SL_SMA , SC_SMA_READY , SI_SMA_READY , SCB_NONE );
+ status->set_sc( SM_SELFPROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
+ status->set_sc( ST_PRESERVE , SC_PRESERVE , SI_PRESERVE , SCB_NONE );
+ status->set_sc( PF_DOUBLECASTING , SC_DOUBLECASTING , SI_DOUBLECASTING , SCB_NONE );
+ status->set_sc( HW_GRAVITATION , SC_GRAVITATION , SI_BLANK , SCB_ASPD );
add_sc( WS_CARTTERMINATION , SC_STUN );
- set_sc( WS_OVERTHRUSTMAX , SC_OVERTHRUSTMAX , SI_OVERTHRUSTMAX , SCB_NONE );
- set_sc( CG_LONGINGFREEDOM , SC_LONGING , SI_BLANK , SCB_SPEED|SCB_ASPD );
+ status->set_sc( WS_OVERTHRUSTMAX , SC_OVERTHRUSTMAX , SI_OVERTHRUSTMAX , SCB_NONE );
+ status->set_sc( CG_LONGINGFREEDOM , SC_LONGING , SI_BLANK , SCB_SPEED|SCB_ASPD );
add_sc( CG_HERMODE , SC_HERMODE );
- set_sc( CG_TAROTCARD , SC_TAROTCARD , SI_TAROTCARD , SCB_NONE );
- set_sc( ITEM_ENCHANTARMS , SC_ENCHANTARMS , SI_BLANK , SCB_ATK_ELE );
- set_sc( SL_HIGH , SC_SOULLINK , SI_SOULLINK , SCB_ALL );
- set_sc( KN_ONEHAND , SC_ONEHANDQUICKEN , SI_ONEHANDQUICKEN , SCB_ASPD );
- set_sc( GS_FLING , SC_FLING , SI_BLANK , SCB_DEF|SCB_DEF2 );
+ status->set_sc( CG_TAROTCARD , SC_TAROTCARD , SI_TAROTCARD , SCB_NONE );
+ status->set_sc( ITEM_ENCHANTARMS , SC_ENCHANTARMS , SI_BLANK , SCB_ATK_ELE );
+ status->set_sc( SL_HIGH , SC_SOULLINK , SI_SOULLINK , SCB_ALL );
+ status->set_sc( KN_ONEHAND , SC_ONEHANDQUICKEN , SI_ONEHANDQUICKEN , SCB_ASPD );
+ status->set_sc( GS_FLING , SC_FLING , SI_BLANK , SCB_DEF|SCB_DEF2 );
add_sc( GS_CRACKER , SC_STUN );
add_sc( GS_DISARM , SC_NOEQUIPWEAPON );
add_sc( GS_PIERCINGSHOT , SC_BLOODING );
- set_sc( GS_MADNESSCANCEL , SC_GS_MADNESSCANCEL , SI_GS_MADNESSCANCEL , SCB_ASPD
+ status->set_sc( GS_MADNESSCANCEL , SC_GS_MADNESSCANCEL , SI_GS_MADNESSCANCEL , SCB_ASPD
#ifndef RENEWAL
|SCB_BATK );
#else
);
#endif
- set_sc( GS_ADJUSTMENT , SC_GS_ADJUSTMENT , SI_GS_ADJUSTMENT , SCB_HIT|SCB_FLEE );
- set_sc( GS_INCREASING , SC_GS_ACCURACY , SI_GS_ACCURACY , SCB_AGI|SCB_DEX|SCB_HIT );
- set_sc( GS_GATLINGFEVER , SC_GS_GATLINGFEVER , SI_GS_GATLINGFEVER , SCB_FLEE|SCB_SPEED|SCB_ASPD
+ status->set_sc( GS_ADJUSTMENT , SC_GS_ADJUSTMENT , SI_GS_ADJUSTMENT , SCB_HIT|SCB_FLEE );
+ status->set_sc( GS_INCREASING , SC_GS_ACCURACY , SI_GS_ACCURACY , SCB_AGI|SCB_DEX|SCB_HIT );
+ status->set_sc( GS_GATLINGFEVER , SC_GS_GATLINGFEVER , SI_GS_GATLINGFEVER , SCB_FLEE|SCB_SPEED|SCB_ASPD
#ifndef RENEWAL
|SCB_BATK );
#else
);
#endif
- set_sc( NJ_TATAMIGAESHI , SC_NJ_TATAMIGAESHI , SI_BLANK , SCB_NONE );
- set_sc( NJ_SUITON , SC_NJ_SUITON , SI_NJ_SUITON , SCB_AGI|SCB_SPEED );
+ status->set_sc( NJ_TATAMIGAESHI , SC_NJ_TATAMIGAESHI , SI_BLANK , SCB_NONE );
+ status->set_sc( NJ_SUITON , SC_NJ_SUITON , SI_NJ_SUITON , SCB_AGI|SCB_SPEED );
add_sc( NJ_HYOUSYOURAKU , SC_FREEZE );
- set_sc( NJ_NEN , SC_NJ_NEN , SI_NJ_NEN , SCB_STR|SCB_INT );
- set_sc( NJ_UTSUSEMI , SC_NJ_UTSUSEMI , SI_NJ_UTSUSEMI , SCB_NONE );
- set_sc( NJ_BUNSINJYUTSU , SC_NJ_BUNSINJYUTSU , SI_NJ_BUNSINJYUTSU , SCB_DYE );
+ status->set_sc( NJ_NEN , SC_NJ_NEN , SI_NJ_NEN , SCB_STR|SCB_INT );
+ status->set_sc( NJ_UTSUSEMI , SC_NJ_UTSUSEMI , SI_NJ_UTSUSEMI , SCB_NONE );
+ status->set_sc( NJ_BUNSINJYUTSU , SC_NJ_BUNSINJYUTSU , SI_NJ_BUNSINJYUTSU , SCB_DYE );
add_sc( NPC_ICEBREATH , SC_FREEZE );
add_sc( NPC_ACIDBREATH , SC_POISON );
@@ -451,201 +454,201 @@ void initChangeTables(void) {
add_sc( NPC_WIDESIGHT , SC_SIGHT );
add_sc( NPC_EVILLAND , SC_BLIND );
add_sc( NPC_MAGICMIRROR , SC_MAGICMIRROR );
- set_sc( NPC_SLOWCAST , SC_SLOWCAST , SI_SLOWCAST , SCB_NONE );
- set_sc( NPC_CRITICALWOUND , SC_CRITICALWOUND , SI_CRITICALWOUND , SCB_NONE );
- set_sc( NPC_STONESKIN , SC_STONESKIN , SI_BLANK , SCB_DEF|SCB_MDEF );
+ status->set_sc( NPC_SLOWCAST , SC_SLOWCAST , SI_SLOWCAST , SCB_NONE );
+ status->set_sc( NPC_CRITICALWOUND , SC_CRITICALWOUND , SI_CRITICALWOUND , SCB_NONE );
+ status->set_sc( NPC_STONESKIN , SC_STONESKIN , SI_BLANK , SCB_DEF|SCB_MDEF );
add_sc( NPC_ANTIMAGIC , SC_STONESKIN );
add_sc( NPC_WIDECURSE , SC_CURSE );
add_sc( NPC_WIDESTUN , SC_STUN );
- set_sc( NPC_HELLPOWER , SC_HELLPOWER , SI_HELLPOWER , SCB_NONE );
- set_sc( NPC_WIDEHELLDIGNITY , SC_HELLPOWER , SI_HELLPOWER , SCB_NONE );
- set_sc( NPC_INVINCIBLE , SC_INVINCIBLE , SI_INVINCIBLE , SCB_SPEED );
- set_sc( NPC_INVINCIBLEOFF , SC_INVINCIBLEOFF , SI_BLANK , SCB_SPEED );
+ status->set_sc( NPC_HELLPOWER , SC_HELLPOWER , SI_HELLPOWER , SCB_NONE );
+ status->set_sc( NPC_WIDEHELLDIGNITY , SC_HELLPOWER , SI_HELLPOWER , SCB_NONE );
+ status->set_sc( NPC_INVINCIBLE , SC_INVINCIBLE , SI_INVINCIBLE , SCB_SPEED );
+ status->set_sc( NPC_INVINCIBLEOFF , SC_INVINCIBLEOFF , SI_BLANK , SCB_SPEED );
- set_sc( CASH_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
- set_sc( CASH_INCAGI , SC_INC_AGI , SI_INC_AGI , SCB_AGI|SCB_SPEED );
- set_sc( CASH_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE );
+ status->set_sc( CASH_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
+ status->set_sc( CASH_INCAGI , SC_INC_AGI , SI_INC_AGI , SCB_AGI|SCB_SPEED );
+ status->set_sc( CASH_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE );
- set_sc( ALL_PARTYFLEE , SC_PARTYFLEE , SI_PARTYFLEE , SCB_NONE );
- set_sc( ALL_ODINS_POWER , SC_ODINS_POWER , SI_ODINS_POWER , SCB_WATK | SCB_MATK | SCB_MDEF | SCB_DEF);
+ status->set_sc( ALL_PARTYFLEE , SC_PARTYFLEE , SI_PARTYFLEE , SCB_NONE );
+ status->set_sc( ALL_ODINS_POWER , SC_ODINS_POWER , SI_ODINS_POWER , SCB_WATK | SCB_MATK | SCB_MDEF | SCB_DEF);
- set_sc( CR_SHRINK , SC_CR_SHRINK , SI_CR_SHRINK , SCB_NONE );
- set_sc( RG_CLOSECONFINE , SC_RG_CCONFINE_S , SI_RG_CCONFINE_S , SCB_NONE );
- set_sc( RG_CLOSECONFINE , SC_RG_CCONFINE_M , SI_RG_CCONFINE_M , SCB_FLEE );
- set_sc( WZ_SIGHTBLASTER , SC_WZ_SIGHTBLASTER , SI_WZ_SIGHTBLASTER , SCB_NONE );
- set_sc( DC_WINKCHARM , SC_DC_WINKCHARM , SI_DC_WINKCHARM , SCB_NONE );
+ status->set_sc( CR_SHRINK , SC_CR_SHRINK , SI_CR_SHRINK , SCB_NONE );
+ status->set_sc( RG_CLOSECONFINE , SC_RG_CCONFINE_S , SI_RG_CCONFINE_S , SCB_NONE );
+ status->set_sc( RG_CLOSECONFINE , SC_RG_CCONFINE_M , SI_RG_CCONFINE_M , SCB_FLEE );
+ status->set_sc( WZ_SIGHTBLASTER , SC_WZ_SIGHTBLASTER , SI_WZ_SIGHTBLASTER , SCB_NONE );
+ status->set_sc( DC_WINKCHARM , SC_DC_WINKCHARM , SI_DC_WINKCHARM , SCB_NONE );
add_sc( MO_BALKYOUNG , SC_STUN );
add_sc( SA_ELEMENTWATER , SC_ARMOR_PROPERTY );
add_sc( SA_ELEMENTFIRE , SC_ARMOR_PROPERTY );
add_sc( SA_ELEMENTGROUND , SC_ARMOR_PROPERTY );
add_sc( SA_ELEMENTWIND , SC_ARMOR_PROPERTY );
- set_sc( HLIF_AVOID , SC_HLIF_AVOID , SI_BLANK , SCB_SPEED );
- set_sc( HLIF_CHANGE , SC_HLIF_CHANGE , SI_BLANK , SCB_VIT|SCB_INT );
- set_sc( HFLI_FLEET , SC_HLIF_FLEET , SI_BLANK , SCB_ASPD|SCB_BATK|SCB_WATK );
- set_sc( HFLI_SPEED , SC_HLIF_SPEED , SI_BLANK , SCB_FLEE );
- set_sc( HAMI_DEFENCE , SC_HAMI_DEFENCE , SI_BLANK , SCB_DEF );
- set_sc( HAMI_BLOODLUST , SC_HAMI_BLOODLUST , SI_BLANK , SCB_BATK|SCB_WATK );
+ status->set_sc( HLIF_AVOID , SC_HLIF_AVOID , SI_BLANK , SCB_SPEED );
+ status->set_sc( HLIF_CHANGE , SC_HLIF_CHANGE , SI_BLANK , SCB_VIT|SCB_INT );
+ status->set_sc( HFLI_FLEET , SC_HLIF_FLEET , SI_BLANK , SCB_ASPD|SCB_BATK|SCB_WATK );
+ status->set_sc( HFLI_SPEED , SC_HLIF_SPEED , SI_BLANK , SCB_FLEE );
+ status->set_sc( HAMI_DEFENCE , SC_HAMI_DEFENCE , SI_BLANK , SCB_DEF );
+ status->set_sc( HAMI_BLOODLUST , SC_HAMI_BLOODLUST , SI_BLANK , SCB_BATK|SCB_WATK );
// Homunculus S
- set_sc( MH_LIGHT_OF_REGENE , SC_LIGHT_OF_REGENE , SI_LIGHT_OF_REGENE , SCB_NONE );
- set_sc( MH_OVERED_BOOST , SC_OVERED_BOOST , SI_OVERED_BOOST , SCB_FLEE|SCB_ASPD|SCB_DEF );
+ status->set_sc( MH_LIGHT_OF_REGENE , SC_LIGHT_OF_REGENE , SI_LIGHT_OF_REGENE , SCB_NONE );
+ status->set_sc( MH_OVERED_BOOST , SC_OVERED_BOOST , SI_OVERED_BOOST , SCB_FLEE|SCB_ASPD|SCB_DEF );
add_sc(MH_STAHL_HORN, SC_STUN);
- set_sc(MH_ANGRIFFS_MODUS, SC_ANGRIFFS_MODUS, SI_ANGRIFFS_MODUS, SCB_BATK | SCB_DEF | SCB_FLEE | SCB_MAXHP);
- set_sc(MH_GOLDENE_FERSE, SC_GOLDENE_FERSE, SI_GOLDENE_FERSE, SCB_ASPD|SCB_MAXHP);
+ status->set_sc(MH_ANGRIFFS_MODUS, SC_ANGRIFFS_MODUS, SI_ANGRIFFS_MODUS, SCB_BATK | SCB_DEF | SCB_FLEE | SCB_MAXHP);
+ status->set_sc(MH_GOLDENE_FERSE, SC_GOLDENE_FERSE, SI_GOLDENE_FERSE, SCB_ASPD|SCB_MAXHP);
add_sc( MH_STEINWAND, SC_SAFETYWALL );
- set_sc(MH_VOLCANIC_ASH, SC_VOLCANIC_ASH, SI_VOLCANIC_ASH, SCB_DEF|SCB_DEF2|SCB_HIT|SCB_BATK|SCB_FLEE);
- set_sc(MH_GRANITIC_ARMOR, SC_GRANITIC_ARMOR, SI_GRANITIC_ARMOR, SCB_NONE);
- set_sc(MH_MAGMA_FLOW, SC_MAGMA_FLOW, SI_MAGMA_FLOW, SCB_NONE);
- set_sc(MH_PYROCLASTIC, SC_PYROCLASTIC, SI_PYROCLASTIC, SCB_BATK|SCB_ATK_ELE);
+ status->set_sc(MH_VOLCANIC_ASH, SC_VOLCANIC_ASH, SI_VOLCANIC_ASH, SCB_DEF|SCB_DEF2|SCB_HIT|SCB_BATK|SCB_FLEE);
+ status->set_sc(MH_GRANITIC_ARMOR, SC_GRANITIC_ARMOR, SI_GRANITIC_ARMOR, SCB_NONE);
+ status->set_sc(MH_MAGMA_FLOW, SC_MAGMA_FLOW, SI_MAGMA_FLOW, SCB_NONE);
+ status->set_sc(MH_PYROCLASTIC, SC_PYROCLASTIC, SI_PYROCLASTIC, SCB_BATK|SCB_ATK_ELE);
add_sc(MH_LAVA_SLIDE, SC_BURNING);
- set_sc(MH_NEEDLE_OF_PARALYZE, SC_NEEDLE_OF_PARALYZE, SI_NEEDLE_OF_PARALYZE, SCB_DEF2);
+ status->set_sc(MH_NEEDLE_OF_PARALYZE, SC_NEEDLE_OF_PARALYZE, SI_NEEDLE_OF_PARALYZE, SCB_DEF2);
add_sc(MH_POISON_MIST, SC_BLIND);
- set_sc(MH_PAIN_KILLER, SC_PAIN_KILLER, SI_PAIN_KILLER, SCB_ASPD);
+ status->set_sc(MH_PAIN_KILLER, SC_PAIN_KILLER, SI_PAIN_KILLER, SCB_ASPD);
- set_sc( MH_SILENT_BREEZE , SC_SILENCE , SI_SILENT_BREEZE , SCB_NONE );
+ status->set_sc( MH_SILENT_BREEZE , SC_SILENCE , SI_SILENT_BREEZE , SCB_NONE );
add_sc( MH_STYLE_CHANGE , SC_STYLE_CHANGE);
- set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_S , SI_RG_CCONFINE_S , SCB_NONE );
- set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_M , SI_RG_CCONFINE_M , SCB_FLEE );
+ status->set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_S , SI_RG_CCONFINE_S , SCB_NONE );
+ status->set_sc( MH_TINDER_BREAKER , SC_RG_CCONFINE_M , SI_RG_CCONFINE_M , SCB_FLEE );
add_sc( MER_CRASH , SC_STUN );
- set_sc( MER_PROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
+ status->set_sc( MER_PROVOKE , SC_PROVOKE , SI_PROVOKE , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK );
add_sc( MS_MAGNUM , SC_SUB_WEAPONPROPERTY );
add_sc( MER_SIGHT , SC_SIGHT );
- set_sc( MER_DECAGI , SC_DEC_AGI , SI_DEC_AGI , SCB_AGI|SCB_SPEED );
- set_sc( MER_MAGNIFICAT , SC_MAGNIFICAT , SI_MAGNIFICAT , SCB_REGEN );
+ status->set_sc( MER_DECAGI , SC_DEC_AGI , SI_DEC_AGI , SCB_AGI|SCB_SPEED );
+ status->set_sc( MER_MAGNIFICAT , SC_MAGNIFICAT , SI_MAGNIFICAT , SCB_REGEN );
add_sc( MER_LEXDIVINA , SC_SILENCE );
add_sc( MA_LANDMINE , SC_STUN );
add_sc( MA_SANDMAN , SC_SLEEP );
add_sc( MA_FREEZINGTRAP , SC_FREEZE );
- set_sc( MER_AUTOBERSERK , SC_AUTOBERSERK , SI_AUTOBERSERK , SCB_NONE );
- set_sc( ML_AUTOGUARD , SC_AUTOGUARD , SI_AUTOGUARD , SCB_NONE );
- set_sc( MS_REFLECTSHIELD , SC_REFLECTSHIELD , SI_REFLECTSHIELD , SCB_NONE );
- set_sc( ML_DEFENDER , SC_DEFENDER , SI_DEFENDER , SCB_SPEED|SCB_ASPD );
- set_sc( MS_PARRYING , SC_PARRYING , SI_PARRYING , SCB_NONE );
- set_sc( MS_BERSERK , SC_BERSERK , SI_BERSERK , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2|SCB_FLEE|SCB_SPEED|SCB_ASPD|SCB_MAXHP|SCB_REGEN );
+ status->set_sc( MER_AUTOBERSERK , SC_AUTOBERSERK , SI_AUTOBERSERK , SCB_NONE );
+ status->set_sc( ML_AUTOGUARD , SC_AUTOGUARD , SI_AUTOGUARD , SCB_NONE );
+ status->set_sc( MS_REFLECTSHIELD , SC_REFLECTSHIELD , SI_REFLECTSHIELD , SCB_NONE );
+ status->set_sc( ML_DEFENDER , SC_DEFENDER , SI_DEFENDER , SCB_SPEED|SCB_ASPD );
+ status->set_sc( MS_PARRYING , SC_PARRYING , SI_PARRYING , SCB_NONE );
+ status->set_sc( MS_BERSERK , SC_BERSERK , SI_BERSERK , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2|SCB_FLEE|SCB_SPEED|SCB_ASPD|SCB_MAXHP|SCB_REGEN );
add_sc( ML_SPIRALPIERCE , SC_STOP );
- set_sc( MER_QUICKEN , SC_MER_QUICKEN , SI_BLANK , SCB_ASPD );
+ status->set_sc( MER_QUICKEN , SC_MER_QUICKEN , SI_BLANK , SCB_ASPD );
add_sc( ML_DEVOTION , SC_DEVOTION );
- set_sc( MER_KYRIE , SC_KYRIE , SI_KYRIE , SCB_NONE );
- set_sc( MER_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
- set_sc( MER_INCAGI , SC_INC_AGI , SI_INC_AGI , SCB_AGI|SCB_SPEED );
+ status->set_sc( MER_KYRIE , SC_KYRIE , SI_KYRIE , SCB_NONE );
+ status->set_sc( MER_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX );
+ status->set_sc( MER_INCAGI , SC_INC_AGI , SI_INC_AGI , SCB_AGI|SCB_SPEED );
- set_sc( GD_LEADERSHIP , SC_LEADERSHIP , SI_BLANK , SCB_STR );
- set_sc( GD_GLORYWOUNDS , SC_GLORYWOUNDS , SI_BLANK , SCB_VIT );
- set_sc( GD_SOULCOLD , SC_SOULCOLD , SI_BLANK , SCB_AGI );
- set_sc( GD_HAWKEYES , SC_HAWKEYES , SI_BLANK , SCB_DEX );
+ status->set_sc( GD_LEADERSHIP , SC_LEADERSHIP , SI_BLANK , SCB_STR );
+ status->set_sc( GD_GLORYWOUNDS , SC_GLORYWOUNDS , SI_BLANK , SCB_VIT );
+ status->set_sc( GD_SOULCOLD , SC_SOULCOLD , SI_BLANK , SCB_AGI );
+ status->set_sc( GD_HAWKEYES , SC_HAWKEYES , SI_BLANK , SCB_DEX );
- set_sc( GD_BATTLEORDER , SC_GDSKILL_BATTLEORDER , SI_BLANK , SCB_STR|SCB_INT|SCB_DEX );
- set_sc( GD_REGENERATION , SC_GDSKILL_REGENERATION , SI_BLANK , SCB_REGEN );
+ status->set_sc( GD_BATTLEORDER , SC_GDSKILL_BATTLEORDER , SI_BLANK , SCB_STR|SCB_INT|SCB_DEX );
+ status->set_sc( GD_REGENERATION , SC_GDSKILL_REGENERATION , SI_BLANK , SCB_REGEN );
/**
* Rune Knight
**/
- set_sc( RK_ENCHANTBLADE , SC_ENCHANTBLADE , SI_ENCHANTBLADE , SCB_NONE );
- set_sc( RK_DRAGONHOWLING , SC_FEAR , SI_BLANK , SCB_FLEE|SCB_HIT );
- set_sc( RK_DEATHBOUND , SC_DEATHBOUND , SI_DEATHBOUND , SCB_NONE );
- set_sc( RK_WINDCUTTER , SC_FEAR , SI_BLANK , SCB_FLEE|SCB_HIT );
+ status->set_sc( RK_ENCHANTBLADE , SC_ENCHANTBLADE , SI_ENCHANTBLADE , SCB_NONE );
+ status->set_sc( RK_DRAGONHOWLING , SC_FEAR , SI_BLANK , SCB_FLEE|SCB_HIT );
+ status->set_sc( RK_DEATHBOUND , SC_DEATHBOUND , SI_DEATHBOUND , SCB_NONE );
+ status->set_sc( RK_WINDCUTTER , SC_FEAR , SI_BLANK , SCB_FLEE|SCB_HIT );
add_sc( RK_DRAGONBREATH , SC_BURNING );
- set_sc( RK_MILLENNIUMSHIELD , SC_MILLENNIUMSHIELD , SI_BLANK , SCB_NONE );
- set_sc( RK_REFRESH , SC_REFRESH , SI_REFRESH , SCB_NONE );
- set_sc( RK_GIANTGROWTH , SC_GIANTGROWTH , SI_GIANTGROWTH , SCB_STR );
- set_sc( RK_STONEHARDSKIN , SC_STONEHARDSKIN , SI_STONEHARDSKIN , SCB_NONE );
- set_sc( RK_VITALITYACTIVATION, SC_VITALITYACTIVATION, SI_VITALITYACTIVATION, SCB_REGEN );
- set_sc( RK_FIGHTINGSPIRIT , SC_FIGHTINGSPIRIT , SI_FIGHTINGSPIRIT , SCB_WATK|SCB_ASPD );
- set_sc( RK_ABUNDANCE , SC_ABUNDANCE , SI_ABUNDANCE , SCB_NONE );
- set_sc( RK_CRUSHSTRIKE , SC_CRUSHSTRIKE , SI_CRUSHSTRIKE , SCB_NONE );
+ status->set_sc( RK_MILLENNIUMSHIELD , SC_MILLENNIUMSHIELD , SI_BLANK , SCB_NONE );
+ status->set_sc( RK_REFRESH , SC_REFRESH , SI_REFRESH , SCB_NONE );
+ status->set_sc( RK_GIANTGROWTH , SC_GIANTGROWTH , SI_GIANTGROWTH , SCB_STR );
+ status->set_sc( RK_STONEHARDSKIN , SC_STONEHARDSKIN , SI_STONEHARDSKIN , SCB_NONE );
+ status->set_sc( RK_VITALITYACTIVATION, SC_VITALITYACTIVATION, SI_VITALITYACTIVATION, SCB_REGEN );
+ status->set_sc( RK_FIGHTINGSPIRIT , SC_FIGHTINGSPIRIT , SI_FIGHTINGSPIRIT , SCB_WATK|SCB_ASPD );
+ status->set_sc( RK_ABUNDANCE , SC_ABUNDANCE , SI_ABUNDANCE , SCB_NONE );
+ status->set_sc( RK_CRUSHSTRIKE , SC_CRUSHSTRIKE , SI_CRUSHSTRIKE , SCB_NONE );
add_sc( RK_DRAGONBREATH_WATER, SC_FROSTMISTY );
/**
* GC Guillotine Cross
**/
set_sc_with_vfx( GC_VENOMIMPRESS , SC_VENOMIMPRESS , SI_VENOMIMPRESS , SCB_NONE );
- set_sc( GC_POISONINGWEAPON , SC_POISONINGWEAPON , SI_POISONINGWEAPON , SCB_NONE );
- set_sc( GC_WEAPONBLOCKING , SC_WEAPONBLOCKING , SI_WEAPONBLOCKING , SCB_NONE );
- set_sc( GC_CLOAKINGEXCEED , SC_CLOAKINGEXCEED , SI_CLOAKINGEXCEED , SCB_SPEED );
- set_sc( GC_HALLUCINATIONWALK , SC_HALLUCINATIONWALK, SI_HALLUCINATIONWALK, SCB_FLEE );
- set_sc( GC_ROLLINGCUTTER , SC_ROLLINGCUTTER , SI_ROLLINGCUTTER , SCB_NONE );
+ status->set_sc( GC_POISONINGWEAPON , SC_POISONINGWEAPON , SI_POISONINGWEAPON , SCB_NONE );
+ status->set_sc( GC_WEAPONBLOCKING , SC_WEAPONBLOCKING , SI_WEAPONBLOCKING , SCB_NONE );
+ status->set_sc( GC_CLOAKINGEXCEED , SC_CLOAKINGEXCEED , SI_CLOAKINGEXCEED , SCB_SPEED );
+ status->set_sc( GC_HALLUCINATIONWALK , SC_HALLUCINATIONWALK, SI_HALLUCINATIONWALK, SCB_FLEE );
+ status->set_sc( GC_ROLLINGCUTTER , SC_ROLLINGCUTTER , SI_ROLLINGCUTTER , SCB_NONE );
set_sc_with_vfx( GC_DARKCROW , SC_DARKCROW , SI_DARKCROW , SCB_NONE );
/**
* Arch Bishop
**/
- set_sc( AB_ADORAMUS , SC_ADORAMUS , SI_ADORAMUS , SCB_AGI|SCB_SPEED );
+ status->set_sc( AB_ADORAMUS , SC_ADORAMUS , SI_ADORAMUS , SCB_AGI|SCB_SPEED );
add_sc( AB_CLEMENTIA , SC_BLESSING );
add_sc( AB_CANTO , SC_INC_AGI );
- set_sc( AB_EPICLESIS , SC_EPICLESIS , SI_EPICLESIS , SCB_MAXHP );
+ status->set_sc( AB_EPICLESIS , SC_EPICLESIS , SI_EPICLESIS , SCB_MAXHP );
add_sc( AB_PRAEFATIO , SC_KYRIE );
set_sc_with_vfx( AB_ORATIO , SC_ORATIO , SI_ORATIO , SCB_NONE );
- set_sc( AB_LAUDAAGNUS , SC_LAUDAAGNUS , SI_LAUDAAGNUS , SCB_VIT );
- set_sc( AB_LAUDARAMUS , SC_LAUDARAMUS , SI_LAUDARAMUS , SCB_LUK );
- set_sc( AB_RENOVATIO , SC_RENOVATIO , SI_RENOVATIO , SCB_REGEN );
- set_sc( AB_EXPIATIO , SC_EXPIATIO , SI_EXPIATIO , SCB_ATK_ELE );
- set_sc( AB_DUPLELIGHT , SC_DUPLELIGHT , SI_DUPLELIGHT , SCB_NONE );
- set_sc( AB_SECRAMENT , SC_SECRAMENT , SI_SECRAMENT , SCB_NONE );
- set_sc( AB_OFFERTORIUM , SC_OFFERTORIUM , SI_OFFERTORIUM , SCB_NONE );
+ status->set_sc( AB_LAUDAAGNUS , SC_LAUDAAGNUS , SI_LAUDAAGNUS , SCB_VIT );
+ status->set_sc( AB_LAUDARAMUS , SC_LAUDARAMUS , SI_LAUDARAMUS , SCB_LUK );
+ status->set_sc( AB_RENOVATIO , SC_RENOVATIO , SI_RENOVATIO , SCB_REGEN );
+ status->set_sc( AB_EXPIATIO , SC_EXPIATIO , SI_EXPIATIO , SCB_ATK_ELE );
+ status->set_sc( AB_DUPLELIGHT , SC_DUPLELIGHT , SI_DUPLELIGHT , SCB_NONE );
+ status->set_sc( AB_SECRAMENT , SC_SECRAMENT , SI_SECRAMENT , SCB_NONE );
+ status->set_sc( AB_OFFERTORIUM , SC_OFFERTORIUM , SI_OFFERTORIUM , SCB_NONE );
/**
* Warlock
**/
add_sc( WL_WHITEIMPRISON , SC_WHITEIMPRISON );
set_sc_with_vfx( WL_FROSTMISTY , SC_FROSTMISTY , SI_FROSTMISTY , SCB_ASPD|SCB_SPEED|SCB_DEF );
- set_sc( WL_MARSHOFABYSS , SC_MARSHOFABYSS , SI_MARSHOFABYSS , SCB_SPEED|SCB_FLEE|SCB_AGI|SCB_DEX );
- set_sc(WL_RECOGNIZEDSPELL , SC_RECOGNIZEDSPELL , SI_RECOGNIZEDSPELL , SCB_MATK);
- set_sc( WL_STASIS , SC_STASIS , SI_STASIS , SCB_NONE );
- set_sc( WL_TELEKINESIS_INTENSE, SC_TELEKINESIS_INTENSE , SI_TELEKINESIS_INTENSE , SCB_MATK );
+ status->set_sc( WL_MARSHOFABYSS , SC_MARSHOFABYSS , SI_MARSHOFABYSS , SCB_SPEED|SCB_FLEE|SCB_AGI|SCB_DEX );
+ status->set_sc(WL_RECOGNIZEDSPELL , SC_RECOGNIZEDSPELL , SI_RECOGNIZEDSPELL , SCB_MATK);
+ status->set_sc( WL_STASIS , SC_STASIS , SI_STASIS , SCB_NONE );
+ status->set_sc( WL_TELEKINESIS_INTENSE, SC_TELEKINESIS_INTENSE , SI_TELEKINESIS_INTENSE , SCB_MATK );
/**
* Ranger
**/
- set_sc( RA_FEARBREEZE , SC_FEARBREEZE , SI_FEARBREEZE , SCB_NONE );
- set_sc( RA_ELECTRICSHOCKER , SC_ELECTRICSHOCKER , SI_ELECTRICSHOCKER , SCB_NONE );
- set_sc( RA_WUGDASH , SC_WUGDASH , SI_WUGDASH , SCB_SPEED );
- set_sc( RA_CAMOUFLAGE , SC_CAMOUFLAGE , SI_CAMOUFLAGE , SCB_SPEED );
+ status->set_sc( RA_FEARBREEZE , SC_FEARBREEZE , SI_FEARBREEZE , SCB_NONE );
+ status->set_sc( RA_ELECTRICSHOCKER , SC_ELECTRICSHOCKER , SI_ELECTRICSHOCKER , SCB_NONE );
+ status->set_sc( RA_WUGDASH , SC_WUGDASH , SI_WUGDASH , SCB_SPEED );
+ status->set_sc( RA_CAMOUFLAGE , SC_CAMOUFLAGE , SI_CAMOUFLAGE , SCB_SPEED );
add_sc( RA_MAGENTATRAP , SC_ARMOR_PROPERTY );
add_sc( RA_COBALTTRAP , SC_ARMOR_PROPERTY );
add_sc( RA_MAIZETRAP , SC_ARMOR_PROPERTY );
add_sc( RA_VERDURETRAP , SC_ARMOR_PROPERTY );
add_sc( RA_FIRINGTRAP , SC_BURNING );
add_sc( RA_ICEBOUNDTRAP , SC_FROSTMISTY );
- set_sc( RA_UNLIMIT , SC_UNLIMIT , SI_UNLIMIT , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 );
+ status->set_sc( RA_UNLIMIT , SC_UNLIMIT , SI_UNLIMIT , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 );
/**
* Mechanic
**/
- set_sc( NC_ACCELERATION , SC_ACCELERATION , SI_ACCELERATION , SCB_SPEED );
- set_sc( NC_HOVERING , SC_HOVERING , SI_HOVERING , SCB_SPEED );
- set_sc( NC_SHAPESHIFT , SC_SHAPESHIFT , SI_SHAPESHIFT , SCB_DEF_ELE );
- set_sc( NC_INFRAREDSCAN , SC_INFRAREDSCAN , SI_INFRAREDSCAN , SCB_FLEE );
- set_sc( NC_ANALYZE , SC_ANALYZE , SI_ANALYZE , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 );
- set_sc( NC_MAGNETICFIELD , SC_MAGNETICFIELD , SI_MAGNETICFIELD , SCB_NONE );
- set_sc( NC_NEUTRALBARRIER , SC_NEUTRALBARRIER , SI_NEUTRALBARRIER , SCB_DEF|SCB_MDEF );
- set_sc( NC_STEALTHFIELD , SC_STEALTHFIELD , SI_STEALTHFIELD , SCB_NONE );
+ status->set_sc( NC_ACCELERATION , SC_ACCELERATION , SI_ACCELERATION , SCB_SPEED );
+ status->set_sc( NC_HOVERING , SC_HOVERING , SI_HOVERING , SCB_SPEED );
+ status->set_sc( NC_SHAPESHIFT , SC_SHAPESHIFT , SI_SHAPESHIFT , SCB_DEF_ELE );
+ status->set_sc( NC_INFRAREDSCAN , SC_INFRAREDSCAN , SI_INFRAREDSCAN , SCB_FLEE );
+ status->set_sc( NC_ANALYZE , SC_ANALYZE , SI_ANALYZE , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 );
+ status->set_sc( NC_MAGNETICFIELD , SC_MAGNETICFIELD , SI_MAGNETICFIELD , SCB_NONE );
+ status->set_sc( NC_NEUTRALBARRIER , SC_NEUTRALBARRIER , SI_NEUTRALBARRIER , SCB_DEF|SCB_MDEF );
+ status->set_sc( NC_STEALTHFIELD , SC_STEALTHFIELD , SI_STEALTHFIELD , SCB_NONE );
/**
* Royal Guard
**/
- set_sc( LG_REFLECTDAMAGE , SC_LG_REFLECTDAMAGE , SI_LG_REFLECTDAMAGE, SCB_NONE );
- set_sc( LG_FORCEOFVANGUARD , SC_FORCEOFVANGUARD , SI_FORCEOFVANGUARD , SCB_MAXHP );
- set_sc( LG_EXEEDBREAK , SC_EXEEDBREAK , SI_EXEEDBREAK , SCB_NONE );
- set_sc( LG_PRESTIGE , SC_PRESTIGE , SI_PRESTIGE , SCB_DEF );
- set_sc( LG_BANDING , SC_BANDING , SI_BANDING , SCB_DEF2|SCB_WATK );// Renewal: atk2 & def2
- set_sc( LG_PIETY , SC_BENEDICTIO , SI_BENEDICTIO , SCB_DEF_ELE );
- set_sc( LG_EARTHDRIVE , SC_EARTHDRIVE , SI_EARTHDRIVE , SCB_DEF|SCB_ASPD );
- set_sc( LG_INSPIRATION , SC_INSPIRATION , SI_INSPIRATION , SCB_MAXHP|SCB_WATK|SCB_HIT|SCB_VIT|SCB_AGI|SCB_STR|SCB_DEX|SCB_INT|SCB_LUK);
- set_sc( LG_KINGS_GRACE , SC_KINGS_GRACE , SI_KINGS_GRACE , SCB_NONE );
+ status->set_sc( LG_REFLECTDAMAGE , SC_LG_REFLECTDAMAGE , SI_LG_REFLECTDAMAGE, SCB_NONE );
+ status->set_sc( LG_FORCEOFVANGUARD , SC_FORCEOFVANGUARD , SI_FORCEOFVANGUARD , SCB_MAXHP );
+ status->set_sc( LG_EXEEDBREAK , SC_EXEEDBREAK , SI_EXEEDBREAK , SCB_NONE );
+ status->set_sc( LG_PRESTIGE , SC_PRESTIGE , SI_PRESTIGE , SCB_DEF );
+ status->set_sc( LG_BANDING , SC_BANDING , SI_BANDING , SCB_DEF2|SCB_WATK );// Renewal: atk2 & def2
+ status->set_sc( LG_PIETY , SC_BENEDICTIO , SI_BENEDICTIO , SCB_DEF_ELE );
+ status->set_sc( LG_EARTHDRIVE , SC_EARTHDRIVE , SI_EARTHDRIVE , SCB_DEF|SCB_ASPD );
+ status->set_sc( LG_INSPIRATION , SC_INSPIRATION , SI_INSPIRATION , SCB_MAXHP|SCB_WATK|SCB_HIT|SCB_VIT|SCB_AGI|SCB_STR|SCB_DEX|SCB_INT|SCB_LUK);
+ status->set_sc( LG_KINGS_GRACE , SC_KINGS_GRACE , SI_KINGS_GRACE , SCB_NONE );
/**
* Shadow Chaser
**/
- set_sc( SC_REPRODUCE , SC__REPRODUCE , SI_REPRODUCE , SCB_NONE );
- set_sc( SC_AUTOSHADOWSPELL , SC__AUTOSHADOWSPELL, SI_AUTOSHADOWSPELL , SCB_NONE );
- set_sc( SC_SHADOWFORM , SC__SHADOWFORM , SI_SHADOWFORM , SCB_NONE );
- set_sc( SC_BODYPAINT , SC__BODYPAINT , SI_BODYPAINT , SCB_ASPD );
- set_sc( SC_INVISIBILITY , SC__INVISIBILITY , SI_INVISIBILITY , SCB_ASPD|SCB_CRI|SCB_ATK_ELE );
- set_sc( SC_DEADLYINFECT , SC__DEADLYINFECT , SI_DEADLYINFECT , SCB_NONE );
- set_sc( SC_ENERVATION , SC__ENERVATION , SI_ENERVATION , SCB_BATK );
- set_sc( SC_GROOMY , SC__GROOMY , SI_GROOMY , SCB_ASPD|SCB_HIT|SCB_SPEED );
- set_sc( SC_IGNORANCE , SC__IGNORANCE , SI_IGNORANCE , SCB_NONE );
- set_sc( SC_LAZINESS , SC__LAZINESS , SI_LAZINESS , SCB_FLEE );
- set_sc( SC_UNLUCKY , SC__UNLUCKY , SI_UNLUCKY , SCB_CRI|SCB_FLEE2 );
- set_sc( SC_WEAKNESS , SC__WEAKNESS , SI_WEAKNESS , SCB_FLEE2|SCB_MAXHP );
- set_sc( SC_STRIPACCESSARY , SC__STRIPACCESSARY , SI_STRIPACCESSARY , SCB_DEX|SCB_INT|SCB_LUK );
+ status->set_sc( SC_REPRODUCE , SC__REPRODUCE , SI_REPRODUCE , SCB_NONE );
+ status->set_sc( SC_AUTOSHADOWSPELL , SC__AUTOSHADOWSPELL, SI_AUTOSHADOWSPELL , SCB_NONE );
+ status->set_sc( SC_SHADOWFORM , SC__SHADOWFORM , SI_SHADOWFORM , SCB_NONE );
+ status->set_sc( SC_BODYPAINT , SC__BODYPAINT , SI_BODYPAINT , SCB_ASPD );
+ status->set_sc( SC_INVISIBILITY , SC__INVISIBILITY , SI_INVISIBILITY , SCB_ASPD|SCB_CRI|SCB_ATK_ELE );
+ status->set_sc( SC_DEADLYINFECT , SC__DEADLYINFECT , SI_DEADLYINFECT , SCB_NONE );
+ status->set_sc( SC_ENERVATION , SC__ENERVATION , SI_ENERVATION , SCB_BATK );
+ status->set_sc( SC_GROOMY , SC__GROOMY , SI_GROOMY , SCB_ASPD|SCB_HIT|SCB_SPEED );
+ status->set_sc( SC_IGNORANCE , SC__IGNORANCE , SI_IGNORANCE , SCB_NONE );
+ status->set_sc( SC_LAZINESS , SC__LAZINESS , SI_LAZINESS , SCB_FLEE );
+ status->set_sc( SC_UNLUCKY , SC__UNLUCKY , SI_UNLUCKY , SCB_CRI|SCB_FLEE2 );
+ status->set_sc( SC_WEAKNESS , SC__WEAKNESS , SI_WEAKNESS , SCB_FLEE2|SCB_MAXHP );
+ status->set_sc( SC_STRIPACCESSARY , SC__STRIPACCESSARY , SI_STRIPACCESSARY , SCB_DEX|SCB_INT|SCB_LUK );
set_sc_with_vfx( SC_MANHOLE , SC__MANHOLE , SI_MANHOLE , SCB_NONE );
add_sc( SC_CHAOSPANIC , SC__CHAOS );
add_sc( SC_MAELSTROM , SC__MAELSTROM );
@@ -656,113 +659,131 @@ void initChangeTables(void) {
**/
add_sc( SR_DRAGONCOMBO , SC_STUN );
add_sc( SR_EARTHSHAKER , SC_STUN );
- set_sc( SR_FALLENEMPIRE , SC_FALLENEMPIRE , SI_FALLENEMPIRE , SCB_NONE );
- set_sc( SR_CRESCENTELBOW , SC_CRESCENTELBOW , SI_CRESCENTELBOW , SCB_NONE );
+ status->set_sc( SR_FALLENEMPIRE , SC_FALLENEMPIRE , SI_FALLENEMPIRE , SCB_NONE );
+ status->set_sc( SR_CRESCENTELBOW , SC_CRESCENTELBOW , SI_CRESCENTELBOW , SCB_NONE );
set_sc_with_vfx( SR_CURSEDCIRCLE , SC_CURSEDCIRCLE_TARGET, SI_CURSEDCIRCLE_TARGET , SCB_NONE );
- set_sc( SR_LIGHTNINGWALK , SC_LIGHTNINGWALK , SI_LIGHTNINGWALK , SCB_NONE );
- set_sc( SR_RAISINGDRAGON , SC_RAISINGDRAGON , SI_RAISINGDRAGON , SCB_REGEN|SCB_MAXHP|SCB_MAXSP );
- set_sc( SR_GENTLETOUCH_ENERGYGAIN, SC_GENTLETOUCH_ENERGYGAIN , SI_GENTLETOUCH_ENERGYGAIN, SCB_NONE );
- set_sc( SR_GENTLETOUCH_CHANGE , SC_GENTLETOUCH_CHANGE , SI_GENTLETOUCH_CHANGE , SCB_ASPD|SCB_MDEF|SCB_MAXHP );
- set_sc( SR_GENTLETOUCH_REVITALIZE, SC_GENTLETOUCH_REVITALIZE , SI_GENTLETOUCH_REVITALIZE, SCB_MAXHP|SCB_DEF2|SCB_REGEN );
- set_sc( SR_FLASHCOMBO , SC_FLASHCOMBO , SI_FLASHCOMBO , SCB_WATK );
+ status->set_sc( SR_LIGHTNINGWALK , SC_LIGHTNINGWALK , SI_LIGHTNINGWALK , SCB_NONE );
+ status->set_sc( SR_RAISINGDRAGON , SC_RAISINGDRAGON , SI_RAISINGDRAGON , SCB_REGEN|SCB_MAXHP|SCB_MAXSP );
+ status->set_sc( SR_GENTLETOUCH_ENERGYGAIN, SC_GENTLETOUCH_ENERGYGAIN , SI_GENTLETOUCH_ENERGYGAIN, SCB_NONE );
+ status->set_sc( SR_GENTLETOUCH_CHANGE , SC_GENTLETOUCH_CHANGE , SI_GENTLETOUCH_CHANGE , SCB_ASPD|SCB_MDEF|SCB_MAXHP );
+ status->set_sc( SR_GENTLETOUCH_REVITALIZE, SC_GENTLETOUCH_REVITALIZE , SI_GENTLETOUCH_REVITALIZE, SCB_MAXHP|SCB_DEF2|SCB_REGEN );
+ status->set_sc( SR_FLASHCOMBO , SC_FLASHCOMBO , SI_FLASHCOMBO , SCB_WATK );
/**
* Wanderer / Minstrel
**/
- set_sc( WA_SWING_DANCE , SC_SWING , SI_SWINGDANCE , SCB_SPEED|SCB_ASPD );
- set_sc( WA_SYMPHONY_OF_LOVER , SC_SYMPHONY_LOVE , SI_SYMPHONYOFLOVERS , SCB_MDEF );
- set_sc( WA_MOONLIT_SERENADE , SC_MOONLIT_SERENADE , SI_MOONLITSERENADE , SCB_MATK );
- set_sc( MI_RUSH_WINDMILL , SC_RUSH_WINDMILL , SI_RUSHWINDMILL , SCB_WATK );
- set_sc( MI_ECHOSONG , SC_ECHOSONG , SI_ECHOSONG , SCB_DEF2 );
- set_sc( MI_HARMONIZE , SC_HARMONIZE , SI_HARMONIZE , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
+ status->set_sc( WA_SWING_DANCE , SC_SWING , SI_SWINGDANCE , SCB_SPEED|SCB_ASPD );
+ status->set_sc( WA_SYMPHONY_OF_LOVER , SC_SYMPHONY_LOVE , SI_SYMPHONYOFLOVERS , SCB_MDEF );
+ status->set_sc( WA_MOONLIT_SERENADE , SC_MOONLIT_SERENADE , SI_MOONLITSERENADE , SCB_MATK );
+ status->set_sc( MI_RUSH_WINDMILL , SC_RUSH_WINDMILL , SI_RUSHWINDMILL , SCB_WATK );
+ status->set_sc( MI_ECHOSONG , SC_ECHOSONG , SI_ECHOSONG , SCB_DEF2 );
+ status->set_sc( MI_HARMONIZE , SC_HARMONIZE , SI_HARMONIZE , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
set_sc_with_vfx(WM_POEMOFNETHERWORLD, SC_NETHERWORLD , SI_NETHERWORLD , SCB_NONE);
set_sc_with_vfx( WM_VOICEOFSIREN , SC_SIREN , SI_SIREN , SCB_NONE );
set_sc_with_vfx( WM_LULLABY_DEEPSLEEP , SC_DEEP_SLEEP , SI_DEEPSLEEP , SCB_NONE );
- set_sc( WM_SIRCLEOFNATURE , SC_SIRCLEOFNATURE , SI_SIRCLEOFNATURE , SCB_NONE );
- set_sc( WM_GLOOMYDAY , SC_GLOOMYDAY , SI_GLOOMYDAY , SCB_FLEE|SCB_ASPD );
- set_sc( WM_SONG_OF_MANA , SC_SONG_OF_MANA , SI_SONG_OF_MANA , SCB_NONE );
- set_sc( WM_DANCE_WITH_WUG , SC_DANCE_WITH_WUG , SI_DANCEWITHWUG , SCB_ASPD );
- set_sc( WM_SATURDAY_NIGHT_FEVER , SC_SATURDAY_NIGHT_FEVER , SI_SATURDAYNIGHTFEVER , SCB_BATK|SCB_DEF|SCB_FLEE|SCB_REGEN );
- set_sc( WM_LERADS_DEW , SC_LERADS_DEW , SI_LERADSDEW , SCB_MAXHP );
- set_sc( WM_MELODYOFSINK , SC_MELODYOFSINK , SI_MELODYOFSINK , SCB_INT );
- set_sc( WM_BEYOND_OF_WARCRY , SC_BEYOND_OF_WARCRY , SI_WARCRYOFBEYOND , SCB_STR|SCB_CRI|SCB_MAXHP );
- set_sc( WM_UNLIMITED_HUMMING_VOICE, SC_UNLIMITED_HUMMING_VOICE, SI_UNLIMITEDHUMMINGVOICE, SCB_NONE );
- set_sc( WM_FRIGG_SONG , SC_FRIGG_SONG , SI_FRIGG_SONG , SCB_MAXHP );
+ status->set_sc( WM_SIRCLEOFNATURE , SC_SIRCLEOFNATURE , SI_SIRCLEOFNATURE , SCB_NONE );
+ status->set_sc( WM_GLOOMYDAY , SC_GLOOMYDAY , SI_GLOOMYDAY , SCB_FLEE|SCB_ASPD );
+ status->set_sc( WM_SONG_OF_MANA , SC_SONG_OF_MANA , SI_SONG_OF_MANA , SCB_NONE );
+ status->set_sc( WM_DANCE_WITH_WUG , SC_DANCE_WITH_WUG , SI_DANCEWITHWUG , SCB_ASPD );
+ status->set_sc( WM_SATURDAY_NIGHT_FEVER , SC_SATURDAY_NIGHT_FEVER , SI_SATURDAYNIGHTFEVER , SCB_BATK|SCB_DEF|SCB_FLEE|SCB_REGEN );
+ status->set_sc( WM_LERADS_DEW , SC_LERADS_DEW , SI_LERADSDEW , SCB_MAXHP );
+ status->set_sc( WM_MELODYOFSINK , SC_MELODYOFSINK , SI_MELODYOFSINK , SCB_INT );
+ status->set_sc( WM_BEYOND_OF_WARCRY , SC_BEYOND_OF_WARCRY , SI_WARCRYOFBEYOND , SCB_STR|SCB_CRI|SCB_MAXHP );
+ status->set_sc( WM_UNLIMITED_HUMMING_VOICE, SC_UNLIMITED_HUMMING_VOICE, SI_UNLIMITEDHUMMINGVOICE, SCB_NONE );
+ status->set_sc( WM_FRIGG_SONG , SC_FRIGG_SONG , SI_FRIGG_SONG , SCB_MAXHP );
/**
* Sorcerer
**/
- set_sc( SO_FIREWALK , SC_PROPERTYWALK , SI_PROPERTYWALK , SCB_NONE );
- set_sc( SO_ELECTRICWALK , SC_PROPERTYWALK , SI_PROPERTYWALK , SCB_NONE );
- set_sc( SO_SPELLFIST , SC_SPELLFIST , SI_SPELLFIST , SCB_NONE );
+ status->set_sc( SO_FIREWALK , SC_PROPERTYWALK , SI_PROPERTYWALK , SCB_NONE );
+ status->set_sc( SO_ELECTRICWALK , SC_PROPERTYWALK , SI_PROPERTYWALK , SCB_NONE );
+ status->set_sc( SO_SPELLFIST , SC_SPELLFIST , SI_SPELLFIST , SCB_NONE );
set_sc_with_vfx( SO_DIAMONDDUST , SC_COLD , SI_COLD , SCB_NONE ); // it does show the snow icon on mobs but doesn't affect it.
- set_sc( SO_CLOUD_KILL , SC_POISON , SI_CLOUDKILL , SCB_NONE );
- set_sc( SO_STRIKING , SC_STRIKING , SI_STRIKING , SCB_WATK|SCB_CRI );
+ status->set_sc( SO_CLOUD_KILL , SC_POISON , SI_CLOUDKILL , SCB_NONE );
+ status->set_sc( SO_STRIKING , SC_STRIKING , SI_STRIKING , SCB_WATK|SCB_CRI );
add_sc( SO_WARMER , SC_WARMER ); // At the moment, no icon on officials
- set_sc( SO_VACUUM_EXTREME , SC_VACUUM_EXTREME , SI_VACUUM_EXTREME , SCB_NONE );
- set_sc( SO_ARRULLO , SC_DEEP_SLEEP , SI_DEEPSLEEP , SCB_NONE );
- set_sc( SO_FIRE_INSIGNIA , SC_FIRE_INSIGNIA , SI_FIRE_INSIGNIA , SCB_MATK | SCB_BATK | SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
- set_sc( SO_WATER_INSIGNIA , SC_WATER_INSIGNIA , SI_WATER_INSIGNIA , SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
- set_sc( SO_WIND_INSIGNIA , SC_WIND_INSIGNIA , SI_WIND_INSIGNIA , SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
- set_sc( SO_EARTH_INSIGNIA , SC_EARTH_INSIGNIA , SI_EARTH_INSIGNIA , SCB_MDEF|SCB_DEF|SCB_MAXHP|SCB_MAXSP|SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
+ status->set_sc( SO_VACUUM_EXTREME , SC_VACUUM_EXTREME , SI_VACUUM_EXTREME , SCB_NONE );
+ status->set_sc( SO_ARRULLO , SC_DEEP_SLEEP , SI_DEEPSLEEP , SCB_NONE );
+ status->set_sc( SO_FIRE_INSIGNIA , SC_FIRE_INSIGNIA , SI_FIRE_INSIGNIA , SCB_MATK | SCB_BATK | SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
+ status->set_sc( SO_WATER_INSIGNIA , SC_WATER_INSIGNIA , SI_WATER_INSIGNIA , SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
+ status->set_sc( SO_WIND_INSIGNIA , SC_WIND_INSIGNIA , SI_WIND_INSIGNIA , SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
+ status->set_sc( SO_EARTH_INSIGNIA , SC_EARTH_INSIGNIA , SI_EARTH_INSIGNIA , SCB_MDEF|SCB_DEF|SCB_MAXHP|SCB_MAXSP|SCB_WATK | SCB_ATK_ELE | SCB_REGEN );
add_sc( SO_ELEMENTAL_SHIELD , SC_SAFETYWALL );
/**
* Genetic
**/
- set_sc( GN_CARTBOOST , SC_GN_CARTBOOST, SI_CARTSBOOST , SCB_SPEED );
- set_sc( GN_THORNS_TRAP , SC_THORNS_TRAP , SI_THORNTRAP , SCB_NONE );
+ status->set_sc( GN_CARTBOOST , SC_GN_CARTBOOST, SI_CARTSBOOST , SCB_SPEED );
+ status->set_sc( GN_THORNS_TRAP , SC_THORNS_TRAP , SI_THORNTRAP , SCB_NONE );
set_sc_with_vfx( GN_BLOOD_SUCKER , SC_BLOOD_SUCKER , SI_BLOODSUCKER , SCB_NONE );
- set_sc( GN_WALLOFTHORN , SC_STOP , SI_BLANK , SCB_NONE );
- set_sc( GN_FIRE_EXPANSION_SMOKE_POWDER, SC_FIRE_EXPANSION_SMOKE_POWDER , SI_FIRE_EXPANSION_SMOKE_POWDER, SCB_NONE );
- set_sc( GN_FIRE_EXPANSION_TEAR_GAS , SC_FIRE_EXPANSION_TEAR_GAS , SI_FIRE_EXPANSION_TEAR_GAS , SCB_NONE );
- set_sc( GN_MANDRAGORA , SC_MANDRAGORA , SI_MANDRAGORA , SCB_INT );
+ status->set_sc( GN_WALLOFTHORN , SC_STOP , SI_BLANK , SCB_NONE );
+ status->set_sc( GN_FIRE_EXPANSION_SMOKE_POWDER, SC_FIRE_EXPANSION_SMOKE_POWDER , SI_FIRE_EXPANSION_SMOKE_POWDER, SCB_NONE );
+ status->set_sc( GN_FIRE_EXPANSION_TEAR_GAS , SC_FIRE_EXPANSION_TEAR_GAS , SI_FIRE_EXPANSION_TEAR_GAS , SCB_NONE );
+ status->set_sc( GN_MANDRAGORA , SC_MANDRAGORA , SI_MANDRAGORA , SCB_INT );
+
+ /**
+ * Summoner
+ */
+ status->set_sc(SU_HIDE, SC_SUHIDE, SI_SUHIDE, SCB_SPEED);
+ add_sc(SU_SCRATCH, SC_BLOODING);
+ status->set_sc(SU_STOOP, SC_SU_STOOP, SI_SU_STOOP, SCB_NONE);
+ status->set_sc(SU_FRESHSHRIMP, SC_FRESHSHRIMP, SI_FRESHSHRIMP, SCB_NONE);
+ add_sc(SU_SV_STEMSPEAR, SC_BLOODING);
+ status->set_sc(SU_CN_POWDERING, SC_CATNIPPOWDER, SI_CATNIPPOWDER, SCB_WATK | SCB_SPEED | SCB_REGEN);
+ add_sc(SU_CN_METEOR, SC_CURSE);
+ set_sc_with_vfx(SU_SV_ROOTTWIST, SC_SV_ROOTTWIST, SI_SV_ROOTTWIST, SCB_NONE);
+ add_sc(SU_SCAROFTAROU, SC_STUN );
+ status->set_sc(SU_SCAROFTAROU, SC_BITESCAR, SI_BITESCAR, SCB_NONE);
+ status->set_sc(SU_ARCLOUSEDASH, SC_ARCLOUSEDASH, SI_ARCLOUSEDASH, SCB_AGI | SCB_SPEED);
+ add_sc(SU_LUNATICCARROTBEAT, SC_STUN);
+ status->set_sc(SU_TUNAPARTY, SC_TUNAPARTY, SI_TUNAPARTY, SCB_NONE);
+ status->set_sc(SU_BUNCHOFSHRIMP, SC_SHRIMP, SI_SHRIMP, SCB_BATK | SCB_MATK);
// Elemental Spirit summoner's 'side' status changes.
- set_sc( EL_CIRCLE_OF_FIRE , SC_CIRCLE_OF_FIRE_OPTION, SI_CIRCLE_OF_FIRE_OPTION, SCB_NONE );
- set_sc( EL_FIRE_CLOAK , SC_FIRE_CLOAK_OPTION , SI_FIRE_CLOAK_OPTION , SCB_ALL );
- set_sc( EL_WATER_SCREEN , SC_WATER_SCREEN_OPTION , SI_WATER_SCREEN_OPTION , SCB_NONE );
- set_sc( EL_WATER_DROP , SC_WATER_DROP_OPTION , SI_WATER_DROP_OPTION , SCB_ALL );
- set_sc( EL_WATER_BARRIER , SC_WATER_BARRIER , SI_WATER_BARRIER , SCB_WATK|SCB_FLEE );
- set_sc( EL_WIND_STEP , SC_WIND_STEP_OPTION , SI_WIND_STEP_OPTION , SCB_SPEED|SCB_FLEE );
- set_sc( EL_WIND_CURTAIN , SC_WIND_CURTAIN_OPTION , SI_WIND_CURTAIN_OPTION , SCB_ALL );
- set_sc( EL_ZEPHYR , SC_ZEPHYR , SI_ZEPHYR , SCB_FLEE );
- set_sc( EL_SOLID_SKIN , SC_SOLID_SKIN_OPTION , SI_SOLID_SKIN_OPTION , SCB_DEF|SCB_MAXHP );
- set_sc( EL_STONE_SHIELD , SC_STONE_SHIELD_OPTION , SI_STONE_SHIELD_OPTION , SCB_ALL );
- set_sc( EL_POWER_OF_GAIA , SC_POWER_OF_GAIA , SI_POWER_OF_GAIA , SCB_MAXHP|SCB_DEF|SCB_SPEED );
- set_sc( EL_PYROTECHNIC , SC_PYROTECHNIC_OPTION , SI_PYROTECHNIC_OPTION , SCB_WATK );
- set_sc( EL_HEATER , SC_HEATER_OPTION , SI_HEATER_OPTION , SCB_WATK );
- set_sc( EL_TROPIC , SC_TROPIC_OPTION , SI_TROPIC_OPTION , SCB_WATK );
- set_sc( EL_AQUAPLAY , SC_AQUAPLAY_OPTION , SI_AQUAPLAY_OPTION , SCB_MATK );
- set_sc( EL_COOLER , SC_COOLER_OPTION , SI_COOLER_OPTION , SCB_MATK );
- set_sc( EL_CHILLY_AIR , SC_CHILLY_AIR_OPTION , SI_CHILLY_AIR_OPTION , SCB_MATK );
- set_sc( EL_GUST , SC_GUST_OPTION , SI_GUST_OPTION , SCB_ASPD );
- set_sc( EL_BLAST , SC_BLAST_OPTION , SI_BLAST_OPTION , SCB_ASPD );
- set_sc( EL_WILD_STORM , SC_WILD_STORM_OPTION , SI_WILD_STORM_OPTION , SCB_ASPD );
- set_sc( EL_PETROLOGY , SC_PETROLOGY_OPTION , SI_PETROLOGY_OPTION , SCB_MAXHP );
- set_sc( EL_CURSED_SOIL , SC_CURSED_SOIL_OPTION , SI_CURSED_SOIL_OPTION , SCB_MAXHP );
- set_sc( EL_UPHEAVAL , SC_UPHEAVAL_OPTION , SI_UPHEAVAL_OPTION , SCB_MAXHP );
- set_sc( EL_TIDAL_WEAPON , SC_TIDAL_WEAPON_OPTION , SI_TIDAL_WEAPON_OPTION , SCB_ALL );
- set_sc( EL_ROCK_CRUSHER , SC_ROCK_CRUSHER , SI_ROCK_CRUSHER , SCB_DEF );
- set_sc( EL_ROCK_CRUSHER_ATK, SC_ROCK_CRUSHER_ATK , SI_ROCK_CRUSHER_ATK , SCB_SPEED );
+ status->set_sc( EL_CIRCLE_OF_FIRE , SC_CIRCLE_OF_FIRE_OPTION, SI_CIRCLE_OF_FIRE_OPTION, SCB_NONE );
+ status->set_sc( EL_FIRE_CLOAK , SC_FIRE_CLOAK_OPTION , SI_FIRE_CLOAK_OPTION , SCB_ALL );
+ status->set_sc( EL_WATER_SCREEN , SC_WATER_SCREEN_OPTION , SI_WATER_SCREEN_OPTION , SCB_NONE );
+ status->set_sc( EL_WATER_DROP , SC_WATER_DROP_OPTION , SI_WATER_DROP_OPTION , SCB_ALL );
+ status->set_sc( EL_WATER_BARRIER , SC_WATER_BARRIER , SI_WATER_BARRIER , SCB_WATK|SCB_FLEE );
+ status->set_sc( EL_WIND_STEP , SC_WIND_STEP_OPTION , SI_WIND_STEP_OPTION , SCB_SPEED|SCB_FLEE );
+ status->set_sc( EL_WIND_CURTAIN , SC_WIND_CURTAIN_OPTION , SI_WIND_CURTAIN_OPTION , SCB_ALL );
+ status->set_sc( EL_ZEPHYR , SC_ZEPHYR , SI_ZEPHYR , SCB_FLEE );
+ status->set_sc( EL_SOLID_SKIN , SC_SOLID_SKIN_OPTION , SI_SOLID_SKIN_OPTION , SCB_DEF|SCB_MAXHP );
+ status->set_sc( EL_STONE_SHIELD , SC_STONE_SHIELD_OPTION , SI_STONE_SHIELD_OPTION , SCB_ALL );
+ status->set_sc( EL_POWER_OF_GAIA , SC_POWER_OF_GAIA , SI_POWER_OF_GAIA , SCB_MAXHP|SCB_DEF|SCB_SPEED );
+ status->set_sc( EL_PYROTECHNIC , SC_PYROTECHNIC_OPTION , SI_PYROTECHNIC_OPTION , SCB_WATK );
+ status->set_sc( EL_HEATER , SC_HEATER_OPTION , SI_HEATER_OPTION , SCB_WATK );
+ status->set_sc( EL_TROPIC , SC_TROPIC_OPTION , SI_TROPIC_OPTION , SCB_WATK );
+ status->set_sc( EL_AQUAPLAY , SC_AQUAPLAY_OPTION , SI_AQUAPLAY_OPTION , SCB_MATK );
+ status->set_sc( EL_COOLER , SC_COOLER_OPTION , SI_COOLER_OPTION , SCB_MATK );
+ status->set_sc( EL_CHILLY_AIR , SC_CHILLY_AIR_OPTION , SI_CHILLY_AIR_OPTION , SCB_MATK );
+ status->set_sc( EL_GUST , SC_GUST_OPTION , SI_GUST_OPTION , SCB_ASPD );
+ status->set_sc( EL_BLAST , SC_BLAST_OPTION , SI_BLAST_OPTION , SCB_ASPD );
+ status->set_sc( EL_WILD_STORM , SC_WILD_STORM_OPTION , SI_WILD_STORM_OPTION , SCB_ASPD );
+ status->set_sc( EL_PETROLOGY , SC_PETROLOGY_OPTION , SI_PETROLOGY_OPTION , SCB_MAXHP );
+ status->set_sc( EL_CURSED_SOIL , SC_CURSED_SOIL_OPTION , SI_CURSED_SOIL_OPTION , SCB_MAXHP );
+ status->set_sc( EL_UPHEAVAL , SC_UPHEAVAL_OPTION , SI_UPHEAVAL_OPTION , SCB_MAXHP );
+ status->set_sc( EL_TIDAL_WEAPON , SC_TIDAL_WEAPON_OPTION , SI_TIDAL_WEAPON_OPTION , SCB_ALL );
+ status->set_sc( EL_ROCK_CRUSHER , SC_ROCK_CRUSHER , SI_ROCK_CRUSHER , SCB_DEF );
+ status->set_sc( EL_ROCK_CRUSHER_ATK, SC_ROCK_CRUSHER_ATK , SI_ROCK_CRUSHER_ATK , SCB_SPEED );
add_sc( KO_YAMIKUMO , SC_HIDING );
set_sc_with_vfx( KO_JYUMONJIKIRI , SC_KO_JYUMONJIKIRI , SI_KO_JYUMONJIKIRI , SCB_NONE );
add_sc( KO_MAKIBISHI , SC_STUN );
- set_sc( KO_MEIKYOUSISUI , SC_MEIKYOUSISUI , SI_MEIKYOUSISUI , SCB_NONE );
- set_sc( KO_KYOUGAKU , SC_KYOUGAKU , SI_KYOUGAKU , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
+ status->set_sc( KO_MEIKYOUSISUI , SC_MEIKYOUSISUI , SI_MEIKYOUSISUI , SCB_NONE );
+ status->set_sc( KO_KYOUGAKU , SC_KYOUGAKU , SI_KYOUGAKU , SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
add_sc( KO_JYUSATSU , SC_CURSE );
- set_sc( KO_ZENKAI , SC_ZENKAI , SI_ZENKAI , SCB_NONE );
- set_sc( KO_IZAYOI , SC_IZAYOI , SI_IZAYOI , SCB_MATK );
- set_sc( KG_KYOMU , SC_KYOMU , SI_KYOMU , SCB_NONE );
- set_sc( KG_KAGEMUSYA , SC_KAGEMUSYA , SI_KAGEMUSYA , SCB_NONE );
- set_sc( KG_KAGEHUMI , SC_KG_KAGEHUMI , SI_KG_KAGEHUMI , SCB_NONE );
- set_sc( OB_ZANGETSU , SC_ZANGETSU , SI_ZANGETSU , SCB_MATK|SCB_BATK );
+ status->set_sc( KO_ZENKAI , SC_ZENKAI , SI_ZENKAI , SCB_NONE );
+ status->set_sc( KO_IZAYOI , SC_IZAYOI , SI_IZAYOI , SCB_MATK );
+ status->set_sc( KG_KYOMU , SC_KYOMU , SI_KYOMU , SCB_NONE );
+ status->set_sc( KG_KAGEMUSYA , SC_KAGEMUSYA , SI_KAGEMUSYA , SCB_NONE );
+ status->set_sc( KG_KAGEHUMI , SC_KG_KAGEHUMI , SI_KG_KAGEHUMI , SCB_NONE );
+ status->set_sc( OB_ZANGETSU , SC_ZANGETSU , SI_ZANGETSU , SCB_MATK|SCB_BATK );
set_sc_with_vfx( OB_AKAITSUKI, SC_AKAITSUKI , SI_AKAITSUKI , SCB_NONE );
- set_sc( OB_OBOROGENSOU , SC_GENSOU , SI_GENSOU , SCB_NONE );
+ status->set_sc( OB_OBOROGENSOU , SC_GENSOU , SI_GENSOU , SCB_NONE );
- set_sc( ALL_FULL_THROTTLE , SC_FULL_THROTTLE , SI_FULL_THROTTLE , SCB_SPEED|SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
+ status->set_sc( ALL_FULL_THROTTLE , SC_FULL_THROTTLE , SI_FULL_THROTTLE , SCB_SPEED|SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK );
add_sc( ALL_REVERSEORCISH , SC_ORCISH );
- set_sc( ALL_ANGEL_PROTECT , SC_ANGEL_PROTECT , SI_ANGEL_PROTECT , SCB_REGEN );
+ status->set_sc( ALL_ANGEL_PROTECT , SC_ANGEL_PROTECT , SI_ANGEL_PROTECT , SCB_REGEN );
add_sc( NPC_WIDEHEALTHFEAR , SC_FEAR );
add_sc( NPC_WIDEBODYBURNNING , SC_BURNING );
@@ -979,6 +1000,7 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_MONSTER_TRANSFORM] = SI_MONSTER_TRANSFORM;
// Costumes
+ status->dbs->IconChangeTable[SC_DRESS_UP] = SI_DRESS_UP;
status->dbs->IconChangeTable[SC_MOONSTAR] = SI_MOONSTAR;
status->dbs->IconChangeTable[SC_SUPER_STAR] = SI_SUPER_STAR;
status->dbs->IconChangeTable[SC_STRANGELIGHTS] = SI_STRANGELIGHTS;
@@ -994,6 +1016,9 @@ void initChangeTables(void) {
status->dbs->IconChangeTable[SC_MAGICAL_FEATHER] = SI_MAGICAL_FEATHER;
status->dbs->IconChangeTable[SC_BLOSSOM_FLUTTERING] = SI_BLOSSOM_FLUTTERING;
+ // Summoner
+ status->dbs->IconChangeTable[SC_SPRITEMABLE] = SI_SPRITEMABLE;
+
// Other SC which are not necessarily associated to skills.
status->dbs->ChangeFlagTable[SC_ATTHASTE_POTION1] |= SCB_ASPD;
status->dbs->ChangeFlagTable[SC_ATTHASTE_POTION2] |= SCB_ASPD;
@@ -1154,6 +1179,7 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_MVPCARD_ORCLORD] |= SCB_ALL;
// Costumes
+ status->dbs->ChangeFlagTable[SC_DRESS_UP] |= SCB_NONE;
status->dbs->ChangeFlagTable[SC_MOONSTAR] |= SCB_NONE;
status->dbs->ChangeFlagTable[SC_SUPER_STAR] |= SCB_NONE;
status->dbs->ChangeFlagTable[SC_STRANGELIGHTS] |= SCB_NONE;
@@ -1169,46 +1195,6 @@ void initChangeTables(void) {
status->dbs->ChangeFlagTable[SC_MAGICAL_FEATHER] |= SCB_NONE;
status->dbs->ChangeFlagTable[SC_BLOSSOM_FLUTTERING] |= SCB_NONE;
- /* status->dbs->DisplayType Table [Ind/Hercules] */
- status->dbs->DisplayType[SC_ALL_RIDING] = true;
- status->dbs->DisplayType[SC_PUSH_CART] = true;
- status->dbs->DisplayType[SC_SUMMON1] = true;
- status->dbs->DisplayType[SC_SUMMON2] = true;
- status->dbs->DisplayType[SC_SUMMON3] = true;
- status->dbs->DisplayType[SC_SUMMON4] = true;
- status->dbs->DisplayType[SC_SUMMON5] = true;
- status->dbs->DisplayType[SC_CAMOUFLAGE] = true;
- status->dbs->DisplayType[SC_DUPLELIGHT] = true;
- status->dbs->DisplayType[SC_ORATIO] = true;
- status->dbs->DisplayType[SC_FROSTMISTY] = true;
- status->dbs->DisplayType[SC_VENOMIMPRESS] = true;
- status->dbs->DisplayType[SC_HALLUCINATIONWALK] = true;
- status->dbs->DisplayType[SC_ROLLINGCUTTER] = true;
- status->dbs->DisplayType[SC_BANDING] = true;
- status->dbs->DisplayType[SC_COLD] = true;
- status->dbs->DisplayType[SC_DEEP_SLEEP] = true;
- status->dbs->DisplayType[SC_CURSEDCIRCLE_ATKER] = true;
- status->dbs->DisplayType[SC_CURSEDCIRCLE_TARGET] = true;
- status->dbs->DisplayType[SC_BLOOD_SUCKER] = true;
- status->dbs->DisplayType[SC__SHADOWFORM] = true;
- status->dbs->DisplayType[SC_MONSTER_TRANSFORM] = true;
-
- // Costumes
- status->dbs->DisplayType[SC_MOONSTAR] = true;
- status->dbs->DisplayType[SC_SUPER_STAR] = true;
- status->dbs->DisplayType[SC_STRANGELIGHTS] = true;
- status->dbs->DisplayType[SC_DECORATION_OF_MUSIC] = true;
- status->dbs->DisplayType[SC_LJOSALFAR] = true;
- status->dbs->DisplayType[SC_MERMAID_LONGING] = true;
- status->dbs->DisplayType[SC_HAT_EFFECT] = true;
- status->dbs->DisplayType[SC_FLOWERSMOKE] = true;
- status->dbs->DisplayType[SC_FSTONE] = true;
- status->dbs->DisplayType[SC_HAPPINESS_STAR] = true;
- status->dbs->DisplayType[SC_MAPLE_FALLS] = true;
- status->dbs->DisplayType[SC_TIME_ACCESSORY] = true;
- status->dbs->DisplayType[SC_MAGICAL_FEATHER] = true;
- status->dbs->DisplayType[SC_BLOSSOM_FLUTTERING] = true;
-
if( !battle_config.display_hallucination ) //Disable Hallucination.
status->dbs->IconChangeTable[SC_ILLUSION] = SI_BLANK;
#undef add_sc
@@ -1237,15 +1223,18 @@ void initDummyData(void)
}
//For copying a status_data structure from b to a, without overwriting current Hp and Sp
-static inline void status_cpy(struct status_data* a, const struct status_data* b)
+void status_copy(struct status_data *a, const struct status_data *b)
{
+ nullpo_retv(a);
+ nullpo_retv(b);
memcpy((void*)&a->max_hp, (const void*)&b->max_hp, sizeof(struct status_data)-(sizeof(a->hp)+sizeof(a->sp)));
}
//Sets HP to given value. Flag is the flag passed to status->heal in case
//final value is higher than current (use 2 to make a healing effect display
//on players) It will always succeed (overrides Berserk block), but it can't kill.
-int status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
+int status_set_hp(struct block_list *bl, unsigned int hp, int flag)
+{
struct status_data *st;
if (hp < 1) return 0;
st = status->get_status_data(bl);
@@ -1262,7 +1251,8 @@ int status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
//Sets SP to given value. Flag is the flag passed to status->heal in case
//final value is higher than current (use 2 to make a healing effect display
//on players)
-int status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
+int status_set_sp(struct block_list *bl, unsigned int sp, int flag)
+{
struct status_data *st;
st = status->get_status_data(bl);
@@ -1276,7 +1266,9 @@ int status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
return status_zap(bl, 0, st->sp - sp);
}
-int status_charge(struct block_list* bl, int64 hp, int64 sp) {
+int status_charge(struct block_list* bl, int64 hp, int64 sp)
+{
+ nullpo_retr((int)(hp + sp), bl);
if(!(bl->type&BL_CONSUME))
return (int)(hp+sp); //Assume all was charged so there are no 'not enough' fails.
return status->damage(NULL, bl, hp, sp, 0, 3);
@@ -1287,11 +1279,13 @@ int status_charge(struct block_list* bl, int64 hp, int64 sp) {
//If flag&2, fail if target does not has enough to subtract.
//If flag&4, if killed, mob must not give exp/loot.
//flag will be set to &8 when damaging sp of a dead character
-int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, int64 in_sp, int walkdelay, int flag) {
+int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, int64 in_sp, int walkdelay, int flag)
+{
struct status_data *st;
struct status_change *sc;
int hp,sp;
+ nullpo_ret(target);
/* From here onwards, we consider it a 32-type as the client does not support higher and the value doesn't get through percentage modifiers */
hp = (int)cap_value(in_hp,INT_MIN,INT_MAX);
sp = (int)cap_value(in_sp,INT_MIN,INT_MAX);
@@ -1376,6 +1370,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
status_change_end(target, SC_CLOAKING, INVALID_TIMER);
status_change_end(target, SC_CHASEWALK, INVALID_TIMER);
status_change_end(target, SC_CAMOUFLAGE, INVALID_TIMER);
+ status_change_end(target, SC_SUHIDE, INVALID_TIMER);
if ((sce=sc->data[SC_ENDURE]) && !sce->val4 && !sc->data[SC_LKCONCENTRATION]) {
//Endure count is only reduced by non-players on non-gvg maps.
//val4 signals infinite endure. [Skotlex]
@@ -1524,11 +1519,13 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp,
//Heals a character. If flag&1, this is forced healing (otherwise stuff like Berserk can block it)
//If flag&2, when the player is healed, show the HP/SP heal effect.
-int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) {
+int status_heal(struct block_list *bl, int64 in_hp, int64 in_sp, int flag)
+{
struct status_data *st;
struct status_change *sc;
int hp,sp;
+ nullpo_ret(bl);
st = status->get_status_data(bl);
if (st == &status->dummy || !st->hp)
@@ -1602,7 +1599,8 @@ int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) {
//If rates are < 0, percent is of max HP/SP
//If !flag, this is heal, otherwise it is damage.
//Furthermore, if flag==2, then the target must not die from the subtraction.
-int status_percent_change(struct block_list *src,struct block_list *target,signed char hp_rate, signed char sp_rate, int flag) {
+int status_percent_change(struct block_list *src, struct block_list *target, signed char hp_rate, signed char sp_rate, int flag)
+{
struct status_data *st;
unsigned int hp = 0, sp = 0;
@@ -1654,9 +1652,12 @@ int status_percent_change(struct block_list *src,struct block_list *target,signe
return status->heal(target, hp, sp, 0);
}
-int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp) {
+int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp)
+{
struct status_data *st;
unsigned int hp, sp;
+
+ nullpo_ret(bl);
if (!status->isdead(bl)) return 0;
st = status->get_status_data(bl);
@@ -1690,11 +1691,13 @@ int status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per
return 1;
}
-int status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned int per_sp) {
+int status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned int per_sp)
+{
struct status_data *st;
unsigned int hp, sp;
if (!status->isdead(bl)) return 0;
+ nullpo_ret(bl);
st = status->get_status_data(bl);
if (st == &status->dummy)
return 0; //Invalid target.
@@ -1736,7 +1739,8 @@ int status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned int
* target MAY Be null, in which case the checks are only to see
* whether the source can cast or not the skill on the ground.
*------------------------------------------*/
-int status_check_skilluse(struct block_list *src, struct block_list *target, uint16 skill_id, int flag) {
+int status_check_skilluse(struct block_list *src, struct block_list *target, uint16 skill_id, int flag)
+{
struct status_data *st;
struct status_change *sc=NULL, *tsc;
int hide_flag;
@@ -1822,6 +1826,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
(sc->data[SC_TRICKDEAD] && skill_id != NV_TRICKDEAD)
|| (sc->data[SC_AUTOCOUNTER] && !flag && skill_id)
|| (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF && skill_id != PA_GOSPEL)
+ || (sc->data[SC_SUHIDE] && skill_id != SU_HIDE)
)
return 0;
@@ -1841,9 +1846,13 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
switch (sc->data[SC_BLADESTOP]->val1)
{
case 5: if (skill_id == MO_EXTREMITYFIST) break;
+ FALLTHROUGH
case 4: if (skill_id == MO_CHAINCOMBO) break;
+ FALLTHROUGH
case 3: if (skill_id == MO_INVESTIGATE) break;
+ FALLTHROUGH
case 2: if (skill_id == MO_FINGEROFFENSIVE) break;
+ FALLTHROUGH
default: return 0;
}
}
@@ -1985,7 +1994,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
|| (tsc->data[SC_CLOAKINGEXCEED] != NULL && is_detect)
))
return 0;
- if (tsc->data[SC_CAMOUFLAGE] && !(is_boss || is_detect) && (!skill_id || (flag == 0 && src && src->type != BL_PC)))
+ if (tsc->data[SC_CAMOUFLAGE] && !(is_boss || is_detect) && flag == 0)
return 0;
if (tsc->data[SC_STEALTHFIELD] && !is_boss)
return 0;
@@ -2007,6 +2016,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
return 0; // Can't use Weapon endow skills on Mercenary (only Master)
if( skill_id == AM_POTIONPITCHER && ( target->type == BL_MER || target->type == BL_ELEM) )
return 0; // Can't use Potion Pitcher on Mercenaries
+ FALLTHROUGH
default:
//Check for chase-walk/hiding/cloaking opponents.
if( tsc ) {
@@ -2022,12 +2032,14 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin
//Skotlex: Calculates the initial status for the given mob
//first will only be false when the mob leveled up or got a GuardUp level.
-int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
+int status_calc_mob_(struct mob_data *md, enum e_status_calc_opt opt)
+{
struct status_data *mstatus;
struct block_list *mbl = NULL;
int flag=0;
int guardup_lv = 0;
+ nullpo_retr(1, md);
if(opt&SCO_FIRST) { //Set basic level on respawn.
if (md->level > 0 && md->level <= MAX_LEVEL && md->level != md->db->lv)
;
@@ -2095,7 +2107,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {
mstatus->max_hp = 3000 + 3000 * ud->skill_lv + status_get_max_sp(battle->get_master(mbl));
} else { //AM_CANNIBALIZE
mstatus->max_hp = 1500 + 200*ud->skill_lv + 10*status->get_lv(mbl);
- mstatus->mode|= MD_CANATTACK|MD_AGGRESSIVE;
+ mstatus->mode |= MD_CANATTACK|MD_AGGRESSIVE;
}
mstatus->hp = mstatus->max_hp;
if( ud->skill_id == NC_SILVERSNIPER )
@@ -2200,17 +2212,15 @@ int status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt)
pd->status.mode = MD_CANMOVE; // pets discard all modes, except walking
pd->status.speed = pd->petDB->speed;
- if(battle_config.pet_attack_support || battle_config.pet_damage_support)
- {// attack support requires the pet to be able to attack
- pd->status.mode|= MD_CANATTACK;
+ if(battle_config.pet_attack_support || battle_config.pet_damage_support) {
+ // attack support requires the pet to be able to attack
+ pd->status.mode |= MD_CANATTACK;
}
}
if (battle_config.pet_lv_rate && pd->msd) {
struct map_session_data *sd = pd->msd;
- int lv;
-
- lv =sd->status.base_level*battle_config.pet_lv_rate/100;
+ int lv = sd->status.base_level * battle_config.pet_lv_rate / 100;
if (lv < 0)
lv = 1;
if (lv != pd->pet.level || opt&SCO_FIRST) {
@@ -2255,16 +2265,20 @@ int status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt)
return 1;
}
-unsigned int status_get_base_maxsp(struct map_session_data* sd, struct status_data *st) {
- uint64 val = pc->class2idx(sd->status.class_);
+unsigned int status_get_base_maxsp(const struct map_session_data *sd, const struct status_data *st)
+{
+ uint64 val;
+ nullpo_ret(sd);
+ nullpo_ret(st);
+ val = pc->class2idx(sd->status.class);
val = status->dbs->SP_table[val][sd->status.base_level];
- if ( sd->class_&JOBL_UPPER )
+ if ((sd->job & JOBL_UPPER) != 0)
val += val * 25 / 100;
- else if ( sd->class_&JOBL_BABY )
+ else if ((sd->job & JOBL_BABY) != 0)
val = val * 70 / 100;
- if ( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON) > 0)
val *= 3; //Triple max SP for top ranking Taekwons over level 90.
val += val * st->int_ / 100;
@@ -2272,22 +2286,26 @@ unsigned int status_get_base_maxsp(struct map_session_data* sd, struct status_da
return (unsigned int)cap_value(val, 0, UINT_MAX);
}
-unsigned int status_get_base_maxhp(struct map_session_data *sd, struct status_data *st) {
- uint64 val = pc->class2idx(sd->status.class_);
+unsigned int status_get_base_maxhp(const struct map_session_data *sd, const struct status_data *st)
+{
+ uint64 val;
+ nullpo_ret(sd);
+ nullpo_ret(st);
+ val = pc->class2idx(sd->status.class);
val = status->dbs->HP_table[val][sd->status.base_level];
- if ( (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_level >= 99 )
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_level >= 99)
val += 2000; //Supernovice lvl99 hp bonus.
- if ( (sd->class_&MAPID_THIRDMASK) == MAPID_SUPER_NOVICE_E && sd->status.base_level >= 150 )
+ if ((sd->job & MAPID_THIRDMASK) == MAPID_SUPER_NOVICE_E && sd->status.base_level >= 150)
val += 2000; //Extented Supernovice lvl150 hp bonus.
- if ( sd->class_&JOBL_UPPER )
+ if ((sd->job & JOBL_UPPER) != 0)
val += val * 25 / 100; //Trans classes get a 25% hp bonus
- else if ( sd->class_&JOBL_BABY )
+ else if ((sd->job & JOBL_BABY) != 0)
val = val * 70 / 100; //Baby classes get a 30% hp penalty
- if ( (sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->famerank(sd->status.char_id, MAPID_TAEKWON) )
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc->fame_rank(sd->status.char_id, RANKTYPE_TAEKWON))
val *= 3; //Triple max HP for top ranking Taekwons over level 90.
val += val * st->vit / 100; // +1% per each point of VIT
@@ -2295,22 +2313,26 @@ unsigned int status_get_base_maxhp(struct map_session_data *sd, struct status_da
return (unsigned int)cap_value(val,0,UINT_MAX);
}
-void status_calc_pc_additional(struct map_session_data* sd, enum e_status_calc_opt opt) {
+void status_calc_pc_additional(struct map_session_data* sd, enum e_status_calc_opt opt)
+{
/* Just used for Plugin to give bonuses. */
return;
}
//Calculates player data from scratch without counting SC adjustments.
//Should be invoked whenever players raise stats, learn passive skills or change equipment.
-int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
+int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt)
+{
static int calculating = 0; //Check for recursive call preemption. [Skotlex]
struct status_data *bstatus; // pointer to the player's base status
- const struct status_change *sc = &sd->sc;
+ const struct status_change *sc;
struct s_skill b_skill[MAX_SKILL]; // previous skill tree
int b_weight, b_max_weight, b_cart_weight_max, // previous weight
i, k, index, skill_lv,refinedef=0;
int64 i64;
+ nullpo_retr(-1, sd);
+ sc = &sd->sc;
if (++calculating > 10) //Too many recursive calls!
return -1;
@@ -2322,7 +2344,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
pc->calc_skilltree(sd); // SkillTree calculation
- sd->max_weight = status->dbs->max_weight_base[pc->class2idx(sd->status.class_)]+sd->status.str*300;
+ sd->max_weight = status->dbs->max_weight_base[pc->class2idx(sd->status.class)]+sd->status.str*300;
if(opt&SCO_FIRST) {
//Load Hp/SP from char-received data.
@@ -2380,13 +2402,13 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
bstatus->speed = pSpeed;
}
- //FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
- //Give them all modes except these (useful for clones)
+ // FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
+ // Give them all modes except these (useful for clones)
bstatus->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK);
- bstatus->size = (sd->class_&JOBL_BABY)?SZ_SMALL:SZ_MEDIUM;
+ bstatus->size = ((sd->job & JOBL_BABY) != 0 || (sd->job & MAPID_BASEMASK) == MAPID_SUMMONER)?SZ_SMALL:SZ_MEDIUM;
if (battle_config.character_size && (pc_isridingpeco(sd) || pc_isridingdragon(sd))) { //[Lupus]
- if (sd->class_&JOBL_BABY) {
+ if ((sd->job & JOBL_BABY) != 0) {
if (battle_config.character_size&SZ_BIG)
bstatus->size++;
} else {
@@ -2396,7 +2418,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
bstatus->aspd_rate = 1000;
bstatus->ele_lv = 1;
- bstatus->race = RC_PLAYER;
+ bstatus->race = ((sd->job & MAPID_BASEMASK) == MAPID_SUMMONER)?RC_BRUTE:RC_PLAYER;
// Autobonus
pc->delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),true);
@@ -2490,8 +2512,9 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
if (sd->status.inventory[index].card[0]==CARD0_FORGE) {
// Forged weapon
wd->star += (sd->status.inventory[index].card[1]>>8);
- if(wd->star >= 15) wd->star = 40; // 3 Star Crumbs now give +40 dmg
- if(pc->famerank(MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) ,MAPID_BLACKSMITH))
+ if (wd->star >= 15)
+ wd->star = 40; // 3 Star Crumbs now give +40 dmg
+ if (pc->fame_rank(MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]), RANKTYPE_BLACKSMITH) > 0)
wd->star += 10;
if (!wa->ele) //Do not overwrite element from previous bonuses.
@@ -2625,6 +2648,39 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
}
}
+
+ /* parse item options [Smokexyz] */
+ for (i = 0; i < EQI_MAX; i++) {
+ status->current_equip_item_index = index = sd->equip_index[i];
+ status->current_equip_option_index = -1;
+
+ if (i == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index)
+ continue;
+ else if (i == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index)
+ continue;
+ else if (i == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index))
+ continue;
+
+ if (index >= 0 && sd->inventory_data[index]) {
+ int j = 0;
+ for (j = 0; j < MAX_ITEM_OPTIONS; j++) {
+ int16 option_index = sd->status.inventory[index].option[j].index;
+ struct item_option *ito = NULL;
+
+ if (option_index == 0 || (ito = itemdb->option_exists(option_index)) == NULL || ito->script == NULL)
+ continue;
+
+ status->current_equip_option_index = j;
+ script->run(ito->script, 0, sd->bl.id, 0);
+
+ if (calculating == 0) //Abort, script->run his function. [Skotlex]
+ return 1;
+ }
+ }
+ }
+
+ status->current_equip_option_index = -1;
+ status->current_equip_item_index = -1;
status->calc_pc_additional(sd, opt);
@@ -2666,8 +2722,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
// ----- STATS CALCULATION -----
// Job bonuses
- index = pc->class2idx(sd->status.class_);
- for(i=0;i<(int)sd->status.job_level && i<MAX_LEVEL;i++){
+ index = pc->class2idx(sd->status.class);
+ for (i = 0; i < sd->status.job_level && i < MAX_LEVEL; i++) {
if(!status->dbs->job_bonus[index][i])
continue;
switch(status->dbs->job_bonus[index][i]) {
@@ -2681,7 +2737,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
// If a Super Novice has never died and is at least joblv 70, he gets all stats +10
- if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->die_counter == 0 && sd->status.job_level >= 70) {
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->die_counter == 0 && sd->status.job_level >= 70) {
bstatus->str += 10;
bstatus->agi += 10;
bstatus->vit += 10;
@@ -2699,6 +2755,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
bstatus->dex += skill_lv;
if((skill_lv = pc->checkskill(sd,RA_RESEARCHTRAP))>0)
bstatus->int_ += skill_lv;
+ if ((pc->checkskill(sd,SU_POWEROFLAND)) > 0)
+ bstatus->int_ += 20;
// Bonuses from cards and equipment as well as base stat, remember to avoid overflows.
i = bstatus->str + sd->status.str + sd->param_bonus[0] + sd->param_equip[0];
@@ -2718,7 +2776,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
// Base batk value is set on status->calc_misc
// weapon-type bonus (FIXME: Why is the weapon_atk bonus applied to base attack?)
- if (sd->status.weapon < MAX_WEAPON_TYPE && sd->weapon_atk[sd->status.weapon])
+ if (sd->status.weapon < MAX_SINGLE_WEAPON_TYPE && sd->weapon_atk[sd->status.weapon])
bstatus->batk += sd->weapon_atk[sd->status.weapon];
// Absolute modifiers from passive skills
#ifndef RENEWAL
@@ -2736,9 +2794,12 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
bstatus->max_hp = (unsigned int)cap_value(i64, 0, INT_MAX);
// Absolute modifiers from passive skills
- if((skill_lv=pc->checkskill(sd,CR_TRUST))>0)
+ if ((skill_lv=pc->checkskill(sd,CR_TRUST)) > 0)
bstatus->max_hp += skill_lv*200;
+ if ((pc->checkskill(sd,SU_SPRITEMABLE)) > 0)
+ bstatus->max_hp += 1000;
+
// Apply relative modifiers from equipment
if(sd->hprate < 0)
sd->hprate = 0;
@@ -2771,6 +2832,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
bstatus->max_sp += 200 + 20 * skill_lv;
if( (skill_lv = pc->checkskill(sd,WM_LESSON)) > 0 )
bstatus->max_sp += 30 * skill_lv;
+ if ((pc->checkskill(sd,SU_SPRITEMABLE)) > 0)
+ bstatus->max_sp += 100;
// Apply relative modifiers from equipment
if(sd->sprate < 0)
@@ -2793,7 +2856,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
bstatus->hp = bstatus->max_hp;
bstatus->sp = bstatus->max_sp;
} else {
- if((sd->class_&MAPID_BASEMASK) == MAPID_NOVICE && !(sd->class_&JOBL_2)
+ if ((sd->job & MAPID_BASEMASK) == MAPID_NOVICE && (sd->job & JOBL_2) == 0
&& battle_config.restart_hp_rate < 50)
bstatus->hp = bstatus->max_hp>>1;
else
@@ -2843,6 +2906,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
sd->critical_rate = 0;
if(sd->critical_rate != 100)
bstatus->cri = bstatus->cri * sd->critical_rate/100;
+ if (pc->checkskill(sd, SU_POWEROFLIFE) > 0)
+ bstatus->cri += 20;
if(sd->flee2_rate < 0)
sd->flee2_rate = 0;
@@ -2875,14 +2940,18 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
bstatus->hit += 3*skill_lv;
if((sd->status.weapon == W_MACE || sd->status.weapon == W_2HMACE) && (skill_lv = pc->checkskill(sd,NC_TRAININGAXE)) > 0)
bstatus->hit += 2*skill_lv;
+ if (pc->checkskill(sd, SU_POWEROFLIFE) > 0)
+ bstatus->hit += 20;
// ----- FLEE CALCULATION -----
// Absolute modifiers from passive skills
if((skill_lv=pc->checkskill(sd,TF_MISS))>0)
- bstatus->flee += skill_lv*(sd->class_&JOBL_2 && (sd->class_&MAPID_BASEMASK) == MAPID_THIEF? 4 : 3);
+ bstatus->flee += skill_lv*((sd->job & JOBL_2) != 0 && (sd->job & MAPID_BASEMASK) == MAPID_THIEF? 4 : 3);
if((skill_lv=pc->checkskill(sd,MO_DODGE))>0)
bstatus->flee += (skill_lv*3)>>1;
+ if (pc->checkskill(sd, SU_POWEROFLIFE) > 0)
+ bstatus->flee += 20;
// ----- EQUIPMENT-DEF CALCULATION -----
// Apply relative modifiers from equipment
@@ -2925,7 +2994,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
// Basic ASPD value
i = status->base_amotion_pc(sd,bstatus);
- bstatus->amotion = cap_value(i,((sd->class_&JOBL_THIRD) ? battle_config.max_third_aspd : battle_config.max_aspd),2000);
+ bstatus->amotion = cap_value(i,((sd->job & JOBL_THIRD) != 0 ? battle_config.max_third_aspd : battle_config.max_aspd),2000);
// Relative modifiers from passive skills
#ifndef RENEWAL_ASPD
@@ -3158,7 +3227,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
sd->left_weapon.addrace[RC_DEMON] += sc->data[SC_PHI_DEMON]->val1;
}
}
- status_cpy(&sd->battle_status, bstatus);
+ status->copy(&sd->battle_status, bstatus);
// ----- CLIENT-SIDE REFRESH -----
if(!sd->bl.prev) {
@@ -3178,15 +3247,25 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
clif->updatestatus(sd,SP_CARTINFO);
}
+ // Spirit Marble status activates automatically for a infinite
+ // amount of time when the skill is learned. Felt this was the
+ // best place to put this. [Rytech]
+ if (pc->checkskill(sd, SU_SPRITEMABLE))
+ sc_start(&sd->bl, &sd->bl, SC_SPRITEMABLE, 100, 1, INFINITE_DURATION);
+
calculating = 0;
return 0;
}
-int status_calc_mercenary_(struct mercenary_data *md, enum e_status_calc_opt opt) {
- struct status_data *mstatus = &md->base_status;
- struct s_mercenary *merc = &md->mercenary;
+int status_calc_mercenary_(struct mercenary_data *md, enum e_status_calc_opt opt)
+{
+ struct status_data *mstatus;
+ struct s_mercenary *merc;
+ nullpo_ret(md);
+ mstatus = &md->base_status;
+ merc = &md->mercenary;
if( opt&SCO_FIRST ) {
memcpy(mstatus, &md->db->status, sizeof(struct status_data));
mstatus->mode = MD_CANMOVE|MD_CANATTACK;
@@ -3197,22 +3276,27 @@ int status_calc_mercenary_(struct mercenary_data *md, enum e_status_calc_opt opt
}
status->calc_misc(&md->bl, mstatus, md->db->lv);
- status_cpy(&md->battle_status, mstatus);
+ status->copy(&md->battle_status, mstatus);
return 0;
}
-int status_calc_elemental_(struct elemental_data *ed, enum e_status_calc_opt opt) {
- struct status_data *estatus = &ed->base_status;
- struct s_elemental *ele = &ed->elemental;
- struct map_session_data *sd = ed->master;
+int status_calc_elemental_(struct elemental_data *ed, enum e_status_calc_opt opt)
+{
+ struct status_data *estatus;
+ struct s_elemental *ele;
+ struct map_session_data *sd;
- if ( !sd )
+ nullpo_ret(ed);
+ estatus = &ed->base_status;
+ ele = &ed->elemental;
+ sd = ed->master;
+ if (sd == NULL)
return 0;
if ( opt&SCO_FIRST ) {
memcpy(estatus, &ed->db->status, sizeof(struct status_data));
- if ( !ele->mode )
+ if (ele->mode == MD_NONE)
estatus->mode = EL_MODE_PASSIVE;
else
estatus->mode = ele->mode;
@@ -3235,13 +3319,14 @@ int status_calc_elemental_(struct elemental_data *ed, enum e_status_calc_opt opt
memcpy(&ed->battle_status, estatus, sizeof(struct status_data));
} else {
status->calc_misc(&ed->bl, estatus, 0);
- status_cpy(&ed->battle_status, estatus);
+ status->copy(&ed->battle_status, estatus);
}
return 0;
}
-int status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
+int status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt)
+{
struct status_data *nstatus;
if (!nd)
@@ -3272,17 +3357,21 @@ int status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
nstatus->luk = nd->stat_point;
status->calc_misc(&nd->bl, nstatus, nd->level);
- status_cpy(&nd->status, nstatus);
+ status->copy(&nd->status, nstatus);
return 0;
}
-int status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt) {
- struct status_data *hstatus = &hd->base_status;
- struct s_homunculus *hom = &hd->homunculus;
+int status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt)
+{
+ struct status_data *hstatus;
+ struct s_homunculus *hom;
int skill_lv;
int amotion;
+ nullpo_retr(1, hd);
+ hstatus = &hd->base_status;
+ hom = &hd->homunculus;
hstatus->str = hom->str / 10;
hstatus->agi = hom->agi / 10;
hstatus->vit = hom->vit / 10;
@@ -3358,12 +3447,13 @@ int status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt) {
status->calc_misc(&hd->bl, hstatus, hom->level);
- status_cpy(&hd->battle_status, hstatus);
+ status->copy(&hd->battle_status, hstatus);
return 1;
}
//Calculates base regen values.
-void status_calc_regen(struct block_list *bl, struct status_data *st, struct regen_data *regen) {
+void status_calc_regen(struct block_list *bl, struct status_data *st, struct regen_data *regen)
+{
struct map_session_data *sd;
int val, skill_lv, reg_flag;
nullpo_retv(bl);
@@ -3465,6 +3555,7 @@ void status_calc_regen(struct block_list *bl, struct status_data *st, struct reg
//Calculates SC related regen rates.
void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, struct status_change *sc)
{
+ nullpo_retv(bl);
if (!(bl->type&BL_REGEN) || !regen)
return;
@@ -3507,7 +3598,7 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
|| sc->data[SC_OBLIVIONCURSE] != NULL
|| sc->data[SC_MAXIMIZEPOWER] != NULL
|| sc->data[SC_REBOUND] != NULL
- || (bl->type == BL_PC && (BL_UCAST(BL_PC, bl)->class_&MAPID_UPPERMASK) == MAPID_MONK
+ || (bl->type == BL_PC && (BL_UCAST(BL_PC, bl)->job & MAPID_UPPERMASK) == MAPID_MONK
&& (sc->data[SC_EXTREMITYFIST] != NULL
|| (sc->data[SC_EXPLOSIONSPIRITS] != NULL
&& (sc->data[SC_SOULLINK] == NULL || sc->data[SC_SOULLINK]->val2 != SL_MONK)
@@ -3518,15 +3609,27 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
regen->flag &=~RGN_SP; //No natural SP regen
}
+
+ // Tension relax allows the user to recover HP while overweight
+ // at 1x speed. Other SC ignored? [csnv]
if (sc->data[SC_TENSIONRELAX]) {
- regen->rate.hp += 2;
- if (regen->sregen)
- regen->sregen->rate.hp += 3;
+ if (sc->data[SC_WEIGHTOVER50] || sc->data[SC_WEIGHTOVER90]) {
+ regen->flag &= ~RGN_SP;
+ regen->rate.hp = 1;
+ } else {
+ regen->rate.hp += 2;
+ if (regen->sregen)
+ regen->sregen->rate.hp += 3;
+ }
}
+
if (sc->data[SC_MAGNIFICAT]) {
+#ifndef RENEWAL // HP Regen applies only in Pre-renewal
regen->rate.hp += 1;
+#endif
regen->rate.sp += 1;
}
+
if (sc->data[SC_GDSKILL_REGENERATION]) {
const struct status_change_entry *sce = sc->data[SC_GDSKILL_REGENERATION];
if (!sce->val4) {
@@ -3559,6 +3662,10 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
regen->rate.hp += regen->rate.hp * sc->data[SC_BUCHEDENOEL]->val1 / 100;
regen->rate.sp += regen->rate.sp * sc->data[SC_BUCHEDENOEL]->val2 / 100;
}
+ if (sc->data[SC_CATNIPPOWDER]) {
+ regen->rate.hp *= 2;
+ regen->rate.sp *= 2;
+ }
}
#define status_get_homstr(st, hd) ((st)->str + (hd)->homunculus.str_value)
@@ -3570,13 +3677,16 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
/// Recalculates parts of an object's battle status according to the specified flags.
/// @param flag bitfield of values from enum scb_flag
-void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
+void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
+{
const struct status_data *bst = status->get_base_status(bl);
struct status_data *st = status->get_status_data(bl);
struct status_change *sc = status->get_sc(bl);
struct map_session_data *sd = BL_CAST(BL_PC,bl);
int temp;
+ nullpo_retv(bl);
+
if (!bst || !st)
return;
@@ -3596,7 +3706,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
}
if((!(bl->type&BL_REGEN)) && (!sc || !sc->count)) { //No difference.
- status_cpy(st, bst);
+ status->copy(st, bst);
return;
}
@@ -3778,13 +3888,15 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
}
if(flag&SCB_CRI && bst->cri) {
- if (st->luk == bst->luk)
+ if (st->luk == bst->luk) {
st->cri = status->calc_critical(bl, sc, bst->cri, true);
- else
+ } else {
st->cri = status->calc_critical(bl, sc, bst->cri + 3*(st->luk - bst->luk), true);
+ }
+ if (battle_config.show_katar_crit_bonus && bl->type == BL_PC && BL_UCAST(BL_PC, bl)->status.weapon == W_KATAR) {
+ st->cri *= 2;
+ }
}
- if (battle_config.show_katar_crit_bonus && bl->type == BL_PC && BL_UCAST(BL_PC, bl)->status.weapon == W_KATAR)
- st->cri <<= 1;
if(flag&SCB_FLEE2 && bst->flee2) {
if (st->luk == bst->luk)
@@ -3843,10 +3955,10 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
if(flag&SCB_MAXSP) {
if( bl->type&BL_PC ) {
st->max_sp = status->get_base_maxsp(sd,st);
- if (sd)
+ if (sd != NULL) {
st->max_sp += bst->max_sp - sd->status.max_sp;
-
- st->max_sp = status->calc_maxsp(&sd->bl, &sd->sc, st->max_sp);
+ st->max_sp = status->calc_maxsp(&sd->bl, &sd->sc, st->max_sp);
+ }
if( st->max_sp > (unsigned int)battle_config.max_sp )
st->max_sp = (unsigned int)battle_config.max_sp;
@@ -3913,14 +4025,29 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
#endif
if ( st->aspd_rate != 1000 ) // absolute percentage modifier
amotion = amotion * st->aspd_rate / 1000;
- if ( sd && sd->ud.skilltimer != INVALID_TIMER && pc->checkskill(sd, SA_FREECAST) > 0 )
- amotion = amotion * 5 * (pc->checkskill(sd, SA_FREECAST) + 10) / 100;
+ if (sd && sd->ud.skilltimer != INVALID_TIMER) {
+ if (pc->checkskill(sd, SA_FREECAST) > 0) {
+ amotion = amotion * 5 * (pc->checkskill(sd, SA_FREECAST) + 10) / 100;
+ } else {
+ struct unit_data *ud = unit->bl2ud(bl);
+ if (ud && (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0) {
+ amotion = amotion * 5 * (ud->skill_lv + 10) / 100;
+ }
+ }
+ }
#ifdef RENEWAL_ASPD
amotion += (max(0xc3 - amotion, 2) * (st->aspd_rate2 + status->calc_aspd(bl, sc, 2))) / 100;
- amotion = 10 * (200 - amotion) + sd->bonus.aspd_add;
+ amotion = 10 * (200 - amotion);
+ if (sd != NULL) {
+ amotion += sd->bonus.aspd_add;
+ }
#endif
amotion = status->calc_fix_aspd(bl, sc, amotion);
- st->amotion = cap_value(amotion, ((sd->class_&JOBL_THIRD) ? battle_config.max_third_aspd : battle_config.max_aspd), 2000);
+ if (sd != NULL) {
+ st->amotion = cap_value(amotion, ((sd->job & JOBL_THIRD) != 0 ? battle_config.max_third_aspd : battle_config.max_aspd), 2000);
+ } else {
+ st->amotion = cap_value(amotion, battle_config.max_aspd, 2000);
+ }
st->adelay = 2 * st->amotion;
} else { // mercenary and mobs
@@ -3944,6 +4071,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) {
if(flag&SCB_REGEN && bl->type&BL_REGEN)
status->calc_regen_rate(bl, status->get_regen_data(bl), sc);
}
+
/// Recalculates parts of an object's base status and battle status according to the specified flags.
/// Also sends updates to the client wherever applicable.
/// @param flag bitfield of values from enum scb_flag
@@ -3953,6 +4081,7 @@ void status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status_ca
struct status_data bst; // previous battle status
struct status_data *st; // pointer to current battle status
+ nullpo_retv(bl);
if (bl->type == BL_PC) {
struct map_session_data *sd = BL_UCAST(BL_PC, bl);
if (sd->delayed_damage != 0) {
@@ -4130,11 +4259,16 @@ void status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status_ca
clif->mercenary_updatestatus(ed->master, SP_SP);
}
}
+
//Checks whether the source can see and chase target.
-int status_check_visibility(struct block_list *src, struct block_list *target) {
+int status_check_visibility(struct block_list *src, struct block_list *target)
+{
int view_range;
struct status_change *tsc = NULL;
+ nullpo_ret(src);
+ nullpo_ret(target);
+
switch ( src->type ) {
case BL_MOB:
view_range = BL_UCCAST(BL_MOB, src)->min_chase;
@@ -4179,16 +4313,21 @@ int status_check_visibility(struct block_list *src, struct block_list *target) {
}
// Basic ASPD value
-int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) {
+int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st)
+{
int amotion;
#ifdef RENEWAL_ASPD /* [malufett/Hercules] */
float temp;
int skill_lv, val = 0;
- amotion = status->dbs->aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype1];
- if ( sd->status.weapon > MAX_WEAPON_TYPE )
- amotion += status->dbs->aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype2] / 4;
+
+ nullpo_ret(sd);
+ nullpo_ret(st);
+
+ amotion = status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype1];
+ if ( sd->status.weapon > MAX_SINGLE_WEAPON_TYPE)
+ amotion += status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype2] / 4;
if ( sd->status.shield )
- amotion += status->dbs->aspd_base[pc->class2idx(sd->status.class_)][MAX_WEAPON_TYPE];
+ amotion += status->dbs->aspd_base[pc->class2idx(sd->status.class)][MAX_SINGLE_WEAPON_TYPE];
switch ( sd->status.weapon ) {
case W_BOW:
case W_MUSICAL:
@@ -4211,9 +4350,9 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st)
amotion = ((int)(temp + ((float)(status->calc_aspd(&sd->bl, &sd->sc, 1) + val) * st->agi / 200)) - min(amotion, 200));
#else
// base weapon delay
- amotion = (sd->status.weapon < MAX_WEAPON_TYPE)
- ? (status->dbs->aspd_base[pc->class2idx(sd->status.class_)][sd->status.weapon]) // single weapon
- : (status->dbs->aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype1] + status->dbs->aspd_base[pc->class2idx(sd->status.class_)][sd->weapontype2]) * 7 / 10; // dual-wield
+ amotion = (sd->status.weapon < MAX_SINGLE_WEAPON_TYPE)
+ ? (status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->status.weapon]) // single weapon
+ : (status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype1] + status->dbs->aspd_base[pc->class2idx(sd->status.class)][sd->weapontype2]) * 7 / 10; // dual-wield
// percentual delay reduction from stats
amotion -= amotion * (4 * st->agi + st->dex) / 1000;
@@ -4229,9 +4368,12 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st)
return amotion;
}
-unsigned short status_base_atk(const struct block_list *bl, const struct status_data *st) {
+unsigned short status_base_atk(const struct block_list *bl, const struct status_data *st)
+{
int flag = 0, str, dex, dstr;
+ nullpo_ret(bl);
+ nullpo_ret(st);
if ( !(bl->type&battle_config.enable_baseatk) )
return 0;
@@ -4286,13 +4428,23 @@ unsigned short status_base_atk(const struct block_list *bl, const struct status_
return cap_value(str, 0, USHRT_MAX);
}
-#ifndef RENEWAL
-static inline unsigned short status_base_matk_min(const struct status_data *st) { return st->int_ + (st->int_ / 7)*(st->int_ / 7); }
-#endif // not RENEWAL
-static inline unsigned short status_base_matk_max(const struct status_data *st) { return st->int_ + (st->int_ / 5)*(st->int_ / 5); }
+unsigned short status_base_matk_min(const struct status_data *st)
+{
+ nullpo_ret(st);
+ return st->int_ + (st->int_ / 7) * (st->int_ / 7);
+}
+
+unsigned short status_base_matk_max(const struct status_data *st)
+{
+ nullpo_ret(st);
+ return st->int_ + (st->int_ / 5)*(st->int_ / 5);
+}
-unsigned short status_base_matk(struct block_list *bl, const struct status_data *st, int level) {
+unsigned short status_base_matk(struct block_list *bl, const struct status_data *st, int level)
+{
#ifdef RENEWAL
+ nullpo_ret(bl);
+ nullpo_ret(st);
switch ( bl->type ) {
case BL_MOB:
return st->int_ + level;
@@ -4310,7 +4462,10 @@ unsigned short status_base_matk(struct block_list *bl, const struct status_data
}
//Fills in the misc data that can be calculated from the other status info (except for level)
-void status_calc_misc(struct block_list *bl, struct status_data *st, int level) {
+void status_calc_misc(struct block_list *bl, struct status_data *st, int level)
+{
+ nullpo_retv(bl);
+ nullpo_retv(st);
//Non players get the value set, players need to stack with previous bonuses.
if ( bl->type != BL_PC )
st->batk =
@@ -4336,8 +4491,8 @@ void status_calc_misc(struct block_list *bl, struct status_data *st, int level)
st->mdef2 += (int)(bl->type == BL_PC ? (st->int_ + ((float)level / 4) + ((float)(st->dex + st->vit) / 5)) : ((float)(st->int_ + level) / 4)); //(every 4 base level = +1 mdef) + (every 1 int = +1 mdef) + (every 5 dex = +1 mdef) + (every 5 vit = +1 mdef)
}
#else // not RENEWAL
- st->matk_min = status_base_matk_min(st);
- st->matk_max = status_base_matk_max(st);
+ st->matk_min = status->base_matk_min(st);
+ st->matk_max = status->base_matk_max(st);
st->hit += level + st->dex;
st->flee += level + st->agi;
st->def2 += st->vit;
@@ -4372,7 +4527,7 @@ void status_calc_misc(struct block_list *bl, struct status_data *st, int level)
break;
case BL_MER:
#ifdef RENEWAL
- st->matk_min = st->matk_max = status_base_matk_max(st);
+ st->matk_min = st->matk_max = status->base_matk_max(st);
st->def2 = st->vit + level / 10 + st->vit / 5;
st->mdef2 = level / 10 + st->int_ / 5;
#endif
@@ -4508,9 +4663,12 @@ unsigned short status_calc_agi(struct block_list *bl, struct status_change *sc,
if (sc->data[SC_2011RWC])
agi += sc->data[SC_2011RWC]->val1;
- if(sc->data[SC_MARSHOFABYSS])
+ if (sc->data[SC_MARSHOFABYSS])
agi -= agi * sc->data[SC_MARSHOFABYSS]->val2 / 100;
+ if (sc->data[SC_ARCLOUSEDASH])
+ agi += sc->data[SC_ARCLOUSEDASH]->val2;
+
return (unsigned short)cap_value(agi,0,USHRT_MAX);
}
@@ -4567,6 +4725,7 @@ unsigned short status_calc_vit(struct block_list *bl, struct status_change *sc,
unsigned short status_calc_int(struct block_list *bl, struct status_change *sc, int int_)
{
+ nullpo_ret(bl);
if(!sc || !sc->count)
return cap_value(int_,0,USHRT_MAX);
@@ -4633,6 +4792,7 @@ unsigned short status_calc_int(struct block_list *bl, struct status_change *sc,
unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc, int dex)
{
+ nullpo_ret(bl);
if(!sc || !sc->count)
return cap_value(dex,0,USHRT_MAX);
@@ -4693,7 +4853,9 @@ unsigned short status_calc_dex(struct block_list *bl, struct status_change *sc,
return (unsigned short)cap_value(dex,0,USHRT_MAX);
}
-unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, int luk) {
+unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc, int luk)
+{
+ nullpo_ret(bl);
if (!sc || !sc->count)
return cap_value(luk, 0, USHRT_MAX);
@@ -4745,8 +4907,10 @@ unsigned short status_calc_luk(struct block_list *bl, struct status_change *sc,
return (unsigned short)cap_value(luk, 0, USHRT_MAX);
}
+
unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable)
{
+ nullpo_ret(bl);
if(!sc || !sc->count)
return cap_value(batk,0,USHRT_MAX);
@@ -4837,11 +5001,15 @@ unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc,
if (sc->data[SC_STEAMPACK])
batk += sc->data[SC_STEAMPACK]->val1;
+ if (sc->data[SC_SHRIMP])
+ batk += batk * sc->data[SC_SHRIMP]->val2 / 100;
+
return (unsigned short)cap_value(batk,0,USHRT_MAX);
}
unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable)
{
+ nullpo_ret(bl);
if(!sc || !sc->count)
return cap_value(watk,0,USHRT_MAX);
@@ -4928,12 +5096,15 @@ unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc,
watk += watk * sc->data[SC_ANGRIFFS_MODUS]->val2/100;
if( sc->data[SC_FLASHCOMBO] )
watk += sc->data[SC_FLASHCOMBO]->val2;
+ if (sc->data[SC_CATNIPPOWDER])
+ watk -= watk * sc->data[SC_CATNIPPOWDER]->val2 / 100;
return (unsigned short)cap_value(watk,0,USHRT_MAX);
}
-unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) {
-#ifdef RENEWAL
+unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk)
+{
+#ifdef RENEWAL
if (!sc || !sc->count)
return cap_value(matk,0,USHRT_MAX);
if (sc->data[SC_PLUSMAGICPOWER])
@@ -4954,13 +5125,16 @@ unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc
matk += 40 + 30 * sc->data[SC_ODINS_POWER]->val1; //70 lvl1, 100lvl2
if(sc->data[SC_IZAYOI])
matk += 25 * sc->data[SC_IZAYOI]->val1;
+ if (sc->data[SC_SHRIMP])
+ matk += matk * sc->data[SC_SHRIMP]->val2 / 100;
return (unsigned short)cap_value(matk,0,USHRT_MAX);
#else
return 0;
#endif
}
-unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) {
+unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable)
+{
if (!sc || !sc->count)
return cap_value(matk,0,USHRT_MAX);
@@ -5029,8 +5203,8 @@ unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc,
return (unsigned short)cap_value(matk, 0, USHRT_MAX);
}
-signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) {
-
+signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable)
+{
if (!sc || !sc->count)
return cap_value(critical, 10, SHRT_MAX);
@@ -5125,7 +5299,9 @@ signed short status_calc_hit(struct block_list *bl, struct status_change *sc, in
return (short)cap_value(hit, 1, SHRT_MAX);
}
-signed short status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) {
+signed short status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable)
+{
+ nullpo_retr(1, bl);
if (bl->type == BL_PC) {
if (map_flag_gvg2(bl->m))
@@ -5241,8 +5417,10 @@ signed short status_calc_flee2(struct block_list *bl, struct status_change *sc,
return (short)cap_value(flee2,10,SHRT_MAX);
}
+
defType status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool viewable)
{
+ nullpo_retr(DEFTYPE_MIN, bl);
if (!sc || !sc->count)
return (defType)cap_value(def,DEFTYPE_MIN,DEFTYPE_MAX);
@@ -5347,6 +5525,7 @@ defType status_calc_def(struct block_list *bl, struct status_change *sc, int def
signed short status_calc_def2(struct block_list *bl, struct status_change *sc, int def2, bool viewable)
{
+ nullpo_retr(1, bl);
if(!sc || !sc->count)
#ifdef RENEWAL
return (short)cap_value(def2,SHRT_MIN,SHRT_MAX);
@@ -5421,7 +5600,8 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i
#endif
}
-defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef, bool viewable) {
+defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef, bool viewable)
+{
if(!sc || !sc->count)
return (defType)cap_value(mdef,DEFTYPE_MIN,DEFTYPE_MAX);
@@ -5519,19 +5699,22 @@ signed short status_calc_mdef2(struct block_list *bl, struct status_change *sc,
unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed)
{
struct map_session_data *sd = BL_CAST(BL_PC, bl);
- int speed_rate;
+ int speed_rate = -1;
if( sc == NULL || ( sd && sd->state.permanent_speed ) )
return (unsigned short)cap_value(speed,MIN_WALK_SPEED,MAX_WALK_SPEED);
- if( sd && sd->ud.skilltimer != INVALID_TIMER && (pc->checkskill(sd,SA_FREECAST) > 0 || sd->ud.skill_id == LG_EXEEDBREAK) )
+ if (sd && sd->ud.skilltimer != INVALID_TIMER)
{
- if( sd->ud.skill_id == LG_EXEEDBREAK )
+ if (sd->ud.skill_id == LG_EXEEDBREAK) {
speed_rate = 160 - 10 * sd->ud.skill_lv;
- else
+ } else if ((skill->get_inf2(sd->ud.skill_id) & INF2_FREE_CAST_REDUCED) != 0) {
+ speed_rate = 175 - 5 * sd->ud.skill_lv;
+ } else if (pc->checkskill(sd, SA_FREECAST) > 0) {
speed_rate = 175 - 5 * pc->checkskill(sd,SA_FREECAST);
+ }
}
- else
+ if (speed_rate == -1)
{
speed_rate = 100;
@@ -5562,9 +5745,9 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
{
int val = 0;
- if( sd && sc->data[SC_HIDING] && pc->checkskill(sd,RG_TUNNELDRIVE) > 0 )
+ if ( sd && sc->data[SC_HIDING] && pc->checkskill(sd,RG_TUNNELDRIVE) > 0 ) {
val = 120 - 6 * pc->checkskill(sd,RG_TUNNELDRIVE);
- else
+ } else {
if( sd && sc->data[SC_CHASEWALK] && sc->data[SC_CHASEWALK]->val3 < 0 )
val = sc->data[SC_CHASEWALK]->val3;
else
@@ -5630,12 +5813,14 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
if (sc->data[SC_DEC_AGI] || sc->data[SC_QUAGMIRE] || sc->data[SC_DONTFORGETME])
return 0;
}
+ if (sc->data[SC_CATNIPPOWDER])
+ val = max(val, sc->data[SC_CATNIPPOWDER]->val3);
if( sd && sd->bonus.speed_rate + sd->bonus.speed_add_rate > 0 ) // permanent item-based speedup
val = max( val, sd->bonus.speed_rate + sd->bonus.speed_add_rate );
}
-
- speed_rate += val;
+ }
+ speed_rate += val;
}
//GetMoveHasteValue1()
@@ -5652,7 +5837,7 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
val = max( val, 2 * sc->data[SC_WINDWALK]->val1 );
if( sc->data[SC_CARTBOOST] )
val = max( val, 20 );
- if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN && pc->checkskill(sd,TF_MISS) > 0 )
+ if (sd != NULL && (sd->job & MAPID_UPPERMASK) == MAPID_ASSASSIN && pc->checkskill(sd,TF_MISS) > 0)
val = max( val, 1 * pc->checkskill(sd,TF_MISS) );
if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 1 )
val = max( val, sc->data[SC_CLOAKING]->val1 >= 10 ? 25 : 3 * sc->data[SC_CLOAKING]->val1 - 3 );
@@ -5680,6 +5865,8 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
val = max(val, sc->data[SC_MOVHASTE_HORSE]->val1);
if( sd && sd->bonus.speed_rate + sd->bonus.speed_add_rate < 0 ) // permanent item-based speedup
val = max( val, -(sd->bonus.speed_rate + sd->bonus.speed_add_rate) );
+ if (sc->data[SC_ARCLOUSEDASH])
+ val = max(val, sc->data[SC_ARCLOUSEDASH]->val3);
speed_rate -= val;
}
@@ -5712,10 +5899,12 @@ unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc
// flag&1 - fixed value [malufett]
// flag&2 - percentage value
-short status_calc_aspd(struct block_list *bl, struct status_change *sc, short flag) {
+short status_calc_aspd(struct block_list *bl, struct status_change *sc, short flag)
+{
#ifdef RENEWAL_ASPD
int pots = 0, bonus = 0;
+ nullpo_ret(bl);
if (!sc || !sc->count)
return 0;
@@ -5842,7 +6031,9 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl
#endif
}
-short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int aspd) {
+short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int aspd)
+{
+ nullpo_ret(bl);
if (!sc || !sc->count)
return cap_value(aspd, 0, 2000);
@@ -5864,6 +6055,7 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int
{
int i;
+ nullpo_ret(bl);
if(!sc || !sc->count)
return cap_value(aspd_rate,0,SHRT_MAX);
@@ -6004,6 +6196,7 @@ short status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int
unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion)
{
+ nullpo_ret(bl);
// It has been confirmed on official servers that MvP mobs have no dmotion even without endure
if (bl->type == BL_MOB && (BL_UCCAST(BL_MOB, bl)->status.mode&MD_BOSS))
return 0;
@@ -6019,7 +6212,8 @@ unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *
return (unsigned short)cap_value(dmotion,0,USHRT_MAX);
}
-unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, uint64 maxhp) {
+unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, uint64 maxhp)
+{
if (!sc || !sc->count)
return (unsigned int)cap_value(maxhp, 1, UINT_MAX);
@@ -6098,8 +6292,8 @@ unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc,
return (unsigned int)cap_value(maxhp, 1, UINT_MAX);
}
-unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc, unsigned int maxsp) {
-
+unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc, unsigned int maxsp)
+{
if (!sc || !sc->count)
return cap_value(maxsp, 1, UINT_MAX);
@@ -6214,22 +6408,36 @@ unsigned char status_calc_attack_element(struct block_list *bl, struct status_ch
return (unsigned char)cap_value(element,0,UCHAR_MAX);
}
-unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, int mode)
+/**
+ * Calculates the new mode, based on status changes.
+ *
+ * @param bl The current unit.
+ * @param sc The current status change list.
+ * @param mode The starting mode.
+ * @return The calculated mode.
+ */
+uint32 status_calc_mode(const struct block_list *bl, const struct status_change *sc, uint32 mode)
{
- if(!sc || !sc->count)
- return mode;
- if(sc->data[SC_MODECHANGE]) {
- if (sc->data[SC_MODECHANGE]->val2)
+ if (sc == NULL || sc->count == 0)
+ return mode & MD_MASK;
+ if (sc->data[SC_MODECHANGE] != NULL) {
+ if (sc->data[SC_MODECHANGE]->val2 != 0)
mode = sc->data[SC_MODECHANGE]->val2; //Set mode
if (sc->data[SC_MODECHANGE]->val3)
- mode|= sc->data[SC_MODECHANGE]->val3; //Add mode
+ mode |= sc->data[SC_MODECHANGE]->val3; //Add mode
if (sc->data[SC_MODECHANGE]->val4)
- mode&=~sc->data[SC_MODECHANGE]->val4; //Del mode
+ mode &= ~sc->data[SC_MODECHANGE]->val4; //Del mode
}
- return cap_value(mode,0,USHRT_MAX);
+ return mode & MD_MASK;
}
-const char *status_get_name(struct block_list *bl)
+/**
+ * Returns the name of the given bl.
+ *
+ * @param bl The requested bl.
+ * @return The bl's name or NULL if not available.
+ */
+const char *status_get_name(const struct block_list *bl)
{
nullpo_ret(bl);
switch (bl->type) {
@@ -6245,7 +6453,7 @@ const char *status_get_name(struct block_list *bl)
case BL_HOM: return BL_UCCAST(BL_HOM, bl)->homunculus.name;
case BL_NPC: return BL_UCCAST(BL_NPC, bl)->name;
}
- return "Unknown";
+ return NULL;
}
/*==========================================
@@ -6254,12 +6462,12 @@ const char *status_get_name(struct block_list *bl)
* 0 = fail
* class_id = success
*------------------------------------------*/
-int status_get_class(struct block_list *bl)
+int status_get_class(const struct block_list *bl)
{
nullpo_ret(bl);
switch (bl->type) {
- case BL_PC: return BL_UCCAST(BL_PC, bl)->status.class_;
- case BL_MOB: return BL_UCCAST(BL_MOB, bl)->vd->class_; //Class used on all code should be the view class of the mob.
+ case BL_PC: return BL_UCCAST(BL_PC, bl)->status.class;
+ case BL_MOB: return BL_UCCAST(BL_MOB, bl)->vd->class; //Class used on all code should be the view class of the mob.
case BL_PET: return BL_UCCAST(BL_PET, bl)->pet.class_;
case BL_HOM: return BL_UCCAST(BL_HOM, bl)->homunculus.class_;
case BL_MER: return BL_UCCAST(BL_MER, bl)->mercenary.class_;
@@ -6274,7 +6482,7 @@ int status_get_class(struct block_list *bl)
* 1 = fail
* level = success
*------------------------------------------*/
-int status_get_lv(struct block_list *bl)
+int status_get_lv(const struct block_list *bl)
{
nullpo_ret(bl);
switch (bl->type) {
@@ -6346,7 +6554,9 @@ struct status_data *status_get_base_status(struct block_list *bl)
return NULL;
}
}
-defType status_get_def(struct block_list *bl) {
+
+defType status_get_def(struct block_list *bl)
+{
struct unit_data *ud;
struct status_data *st = status->get_status_data(bl);
int def = st ? st->def : 0;
@@ -6359,12 +6569,14 @@ defType status_get_def(struct block_list *bl) {
unsigned short status_get_speed(struct block_list *bl)
{
+ nullpo_ret(bl);
if (bl->type == BL_NPC) //Only BL with speed data but no status_data [Skotlex]
return BL_UCCAST(BL_NPC, bl)->speed;
return status->get_status_data(bl)->speed;
}
-int status_get_party_id(struct block_list *bl) {
+int status_get_party_id(const struct block_list *bl)
+{
nullpo_ret(bl);
switch (bl->type) {
case BL_PC:
@@ -6419,7 +6631,7 @@ int status_get_party_id(struct block_list *bl) {
return 0;
}
-int status_get_guild_id(struct block_list *bl)
+int status_get_guild_id(const struct block_list *bl)
{
nullpo_ret(bl);
switch (bl->type) {
@@ -6485,7 +6697,8 @@ int status_get_guild_id(struct block_list *bl)
return 0;
}
-int status_get_emblem_id(struct block_list *bl) {
+int status_get_emblem_id(const struct block_list *bl)
+{
nullpo_ret(bl);
switch (bl->type) {
case BL_PC:
@@ -6546,7 +6759,7 @@ int status_get_emblem_id(struct block_list *bl) {
return 0;
}
-int status_get_mexp(struct block_list *bl)
+int status_get_mexp(const struct block_list *bl)
{
nullpo_ret(bl);
if (bl->type == BL_MOB)
@@ -6556,7 +6769,7 @@ int status_get_mexp(struct block_list *bl)
return 0;
}
-int status_get_race2(struct block_list *bl)
+int status_get_race2(const struct block_list *bl)
{
nullpo_ret(bl);
if (bl->type == BL_MOB)
@@ -6566,7 +6779,8 @@ int status_get_race2(struct block_list *bl)
return 0;
}
-int status_isdead(struct block_list *bl) {
+int status_isdead(struct block_list *bl)
+{
nullpo_ret(bl);
return status->get_status_data(bl)->hp == 0;
}
@@ -6648,7 +6862,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
break;
}
}
- sd->vd.class_ = class_;
+ sd->vd.class = class_;
clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
sd->vd.head_top = sd->status.head_top;
sd->vd.head_mid = sd->status.head_mid;
@@ -6661,23 +6875,20 @@ void status_set_viewdata(struct block_list *bl, int class_)
sd->vd.sex = sd->status.sex;
if (sd->vd.cloth_color) {
- if (sd->sc.option&OPTION_WEDDING && battle_config.wedding_ignorepalette)
- sd->vd.cloth_color = 0;
- if (sd->sc.option&OPTION_XMAS && battle_config.xmas_ignorepalette)
- sd->vd.cloth_color = 0;
- if (sd->sc.option&OPTION_SUMMER && battle_config.summer_ignorepalette)
- sd->vd.cloth_color = 0;
- if (sd->sc.option&OPTION_HANBOK && battle_config.hanbok_ignorepalette)
- sd->vd.cloth_color = 0;
- if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */)
+ if ((sd->sc.option & OPTION_WEDDING) != 0 && battle_config.wedding_ignorepalette == true)
+ sd->vd.cloth_color = 0;
+ if ((sd->sc.option & OPTION_XMAS) != 0 && battle_config.xmas_ignorepalette == true)
+ sd->vd.cloth_color = 0;
+ if ((sd->sc.option & OPTION_SUMMER) != 0 && battle_config.summer_ignorepalette == true)
+ sd->vd.cloth_color = 0;
+ if ((sd->sc.option & OPTION_HANBOK) != 0 && battle_config.hanbok_ignorepalette == true)
+ sd->vd.cloth_color = 0;
+ if ((sd->sc.option & OPTION_OKTOBERFEST) != 0 && battle_config.oktoberfest_ignorepalette == true)
+ sd->vd.cloth_color = 0;
+ if ((sd->sc.option & OPTION_SUMMER2) != 0 && battle_config.summer2_ignorepalette == true)
sd->vd.cloth_color = 0;
}
- if (sd->vd.body_style
- && (sd->sc.option&OPTION_WEDDING
- || sd->sc.option&OPTION_XMAS
- || sd->sc.option&OPTION_SUMMER
- || sd->sc.option&OPTION_HANBOK
- || sd->sc.option&OPTION_OKTOBERFEST))
+ if (sd->vd.body_style != 0 && (sd->sc.option & OPTION_COSTUME) != 0)
sd->vd.body_style = 0;
} else if (vd != NULL) {
memcpy(&sd->vd, vd, sizeof(struct view_data));
@@ -6700,7 +6911,7 @@ void status_set_viewdata(struct block_list *bl, int class_)
struct pet_data *pd = BL_UCAST(BL_PET, bl);
if (vd != NULL) {
memcpy(&pd->vd, vd, sizeof(struct view_data));
- if (!pc->db_checkid(vd->class_)) {
+ if (!pc->db_checkid(vd->class)) {
pd->vd.hair_style = battle_config.pet_hair_style;
if(pd->pet.equip) {
pd->vd.head_bottom = itemdb_viewid(pd->pet.equip);
@@ -6768,7 +6979,8 @@ struct status_change *status_get_sc(struct block_list *bl)
return NULL;
}
-void status_change_init(struct block_list *bl) {
+void status_change_init(struct block_list *bl)
+{
struct status_change *sc = status->get_sc(bl);
nullpo_retv(sc);
memset(sc, 0, sizeof (struct status_change));
@@ -6780,7 +6992,8 @@ void status_change_init(struct block_list *bl) {
* @see status_change_start for the expected parameters.
* @return the adjusted duration based on flag values.
*/
-int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag) {
+int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag)
+{
//Percentual resistance: 10000 = 100% Resist
//Example: 50% -> sc_def=5000 -> 25%; 5000ms -> tick_def=5000 -> 2500ms
int sc_def = 0, tick_def = -1; //-1 = use sc_def
@@ -6834,6 +7047,7 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
sd = BL_CAST(BL_PC,bl);
st = status->get_status_data(bl);
bst = status->get_base_status(bl);
+ nullpo_ret(bst);
sc = status->get_sc(bl);
if( sc && !sc->count )
sc = NULL;
@@ -7137,11 +7351,14 @@ int status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_typ
#undef SCDEF_LVL_CAP
#undef SCDEF_LVL_DIFF
}
+
/* [Ind/Hercules] fast-checkin sc-display array */
-void status_display_add(struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3) {
+void status_display_add(struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3)
+{
struct sc_display_entry *entry;
int i;
+ nullpo_retv(sd);
for( i = 0; i < sd->sc_display_count; i++ ) {
if( sd->sc_display[i]->type == type )
break;
@@ -7164,9 +7381,12 @@ void status_display_add(struct map_session_data *sd, enum sc_type type, int dval
RECREATE(sd->sc_display, struct sc_display_entry *, ++sd->sc_display_count);
sd->sc_display[ sd->sc_display_count - 1 ] = entry;
}
-void status_display_remove(struct map_session_data *sd, enum sc_type type) {
+
+void status_display_remove(struct map_session_data *sd, enum sc_type type)
+{
int i;
+ nullpo_retv(sd);
for( i = 0; i < sd->sc_display_count; i++ ) {
if( sd->sc_display[i]->type == type )
break;
@@ -7213,7 +7433,8 @@ void status_display_remove(struct map_session_data *sd, enum sc_type type) {
* @retval 0 if no status change happened.
* @retval 1 if the status change was successfully applied.
*/
-int status_change_start(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag) {
+int status_change_start(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag)
+{
struct map_session_data *sd = NULL;
struct status_change* sc;
struct status_change_entry* sce;
@@ -7336,8 +7557,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_GOLDENE_FERSE:
if ((type==SC_GOLDENE_FERSE && sc->data[SC_ANGRIFFS_MODUS])
|| (type==SC_ANGRIFFS_MODUS && sc->data[SC_GOLDENE_FERSE])
- )
+ ) {
return 0;
+ }
+ FALLTHROUGH
case SC_VACUUM_EXTREME:
if(sc->data[SC_HALLUCINATIONWALK])
return 0;
@@ -7345,10 +7568,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_STONE:
if(sc->data[SC_POWER_OF_GAIA])
return 0;
+ FALLTHROUGH
case SC_FREEZE:
//Undead are immune to Freeze/Stone
if (undead_flag && !(flag&SCFLAG_NOAVOID))
return 0;
+ FALLTHROUGH
case SC_SLEEP:
case SC_STUN:
case SC_FROSTMISTY:
@@ -7375,12 +7600,14 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 0;
break;
case SC_KYRIE:
+ case SC_TUNAPARTY:
if (bl->type == BL_MOB)
return 0;
break;
case SC_OVERTHRUST:
if (sc->data[SC_OVERTHRUSTMAX])
return 0; // Overthrust can't take effect if under Max Overthrust. [Skotlex]
+ FALLTHROUGH
case SC_OVERTHRUSTMAX:
if (sc->option&OPTION_MADOGEAR)
return 0; // Overthrust and Overthrust Max cannot be used on Mado Gear [Ind]
@@ -7398,7 +7625,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 0;
break;
case SC_MAGNIFICAT:
- if (sc->data[SC_OFFERTORIUM] || sc->option&OPTION_MADOGEAR) // Mado is immune to magnificat
+ if (sc->option&OPTION_MADOGEAR) // Mado is immune to magnificat
return 0;
break;
case SC_ONEHANDQUICKEN:
@@ -7406,6 +7633,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_TWOHANDQUICKEN:
if (sc->data[SC_DEC_AGI])
return 0;
+ FALLTHROUGH
case SC_CONCENTRATION:
case SC_SPEARQUICKEN:
case SC_TRUESIGHT:
@@ -7414,6 +7642,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_ASSNCROS:
if (sc->option&OPTION_MADOGEAR)
return 0; // Mado is immune to wind walk, cart boost, etc (others above) [Ind]
+ FALLTHROUGH
case SC_INC_AGI:
if (sc->data[SC_QUAGMIRE])
return 0;
@@ -7424,20 +7653,24 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_MODECHANGE:
{
- int mode;
- struct status_data *bst = status->get_base_status(bl);
- if (!bst) return 0;
- if (sc->data[type]) {
- //Pile up with previous values.
- if(!val2) val2 = sc->data[type]->val2;
+ uint32 mode = MD_NONE;
+ const struct status_data *bst = status->get_base_status(bl);
+ if (bst == NULL)
+ return 0;
+ if (sc->data[type] != NULL) {
+ // Pile up with previous values.
+ if (val2 == 0)
+ val2 = sc->data[type]->val2;
val3 |= sc->data[type]->val3;
val4 |= sc->data[type]->val4;
}
- mode = val2 ? val2 : bst->mode; //Base mode
- if (val4) mode&=~val4; //Del mode
- if (val3) mode|= val3; //Add mode
+ mode = val2 != 0 ? val2 : bst->mode; // Base mode
+ if (val4 != 0)
+ mode &= ~val4; //Del mode
+ if (val3 != 0)
+ mode |= val3; //Add mode
if (mode == bst->mode) { //No change.
- if (sc->data[type]) //Abort previous status
+ if (sc->data[type] != NULL) //Abort previous status
return status_change_end(bl, type, INVALID_TIMER);
return 0;
}
@@ -7461,8 +7694,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
break;
case SC_NOEQUIPSHIELD:
- if( val2 == 1 ) val2 = 0; //GX effect. Do not take shield off..
- else
+ if (val2 == 1) {
+ val2 = 0; //GX effect. Do not take shield off..
+ } else {
if (sd && !(flag&SCFLAG_LOADED)) {
int i;
if(sd->bonus.unstripable_equip&EQP_SHIELD)
@@ -7472,8 +7706,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 0;
pc->unequipitem(sd, i, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
}
- if (tick == 1) return 1; //Minimal duration: Only strip without causing the SC
- break;
+ }
+ if (tick == 1)
+ return 1; //Minimal duration: Only strip without causing the SC
+ break;
case SC_NOEQUIPARMOR:
if (sd && !(flag&SCFLAG_LOADED)) {
int i;
@@ -7530,30 +7766,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (sc->data[SC_FOOD_LUK_CASH] && sc->data[SC_FOOD_LUK_CASH]->val1 > val1)
return 0;
break;
- case SC_FOOD_STR_CASH:
- if (sc->data[SC_FOOD_STR] && sc->data[SC_FOOD_STR]->val1 > val1)
- return 0;
- break;
- case SC_FOOD_AGI_CASH:
- if (sc->data[SC_FOOD_AGI] && sc->data[SC_FOOD_AGI]->val1 > val1)
- return 0;
- break;
- case SC_FOOD_VIT_CASH:
- if (sc->data[SC_FOOD_VIT] && sc->data[SC_FOOD_VIT]->val1 > val1)
- return 0;
- break;
- case SC_FOOD_INT_CASH:
- if (sc->data[SC_FOOD_INT] && sc->data[SC_FOOD_INT]->val1 > val1)
- return 0;
- break;
- case SC_FOOD_DEX_CASH:
- if (sc->data[SC_FOOD_DEX] && sc->data[SC_FOOD_DEX]->val1 > val1)
- return 0;
- break;
- case SC_FOOD_LUK_CASH:
- if (sc->data[SC_FOOD_LUK] && sc->data[SC_FOOD_LUK]->val1 > val1)
- return 0;
- break;
case SC_CAMOUFLAGE:
if( sd && pc->checkskill(sd, RA_CAMOUFLAGE) < 3 && !skill->check_camouflage(bl,NULL) )
return 0;
@@ -7594,10 +7806,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if(sc->data[SC_HOVERING])
return 0;
break;
- case SC_OFFERTORIUM:
- if (sc->data[SC_MAGNIFICAT])
- return 0;
- break;
}
//Check for BOSS resistances
@@ -7632,12 +7840,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_OBLIVIONCURSE:
case SC_LEECHESEND:
- // Ranger Effects
+ // Ranger Effects
case SC_WUGBITE:
case SC_ELECTRICSHOCKER:
case SC_MAGNETICFIELD:
- // Masquerades
+ // Masquerades
case SC__ENERVATION:
case SC__GROOMY:
case SC__LAZINESS:
@@ -7648,7 +7856,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
// Other Effects
case SC_VACUUM_EXTREME:
case SC_NETHERWORLD:
-
+ case SC_FRESHSHRIMP:
+ case SC_SV_ROOTTWIST:
+ case SC_BITESCAR:
return 0;
}
}
@@ -7675,11 +7885,13 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
status_change_end(bl, SC_CONCENTRATION, INVALID_TIMER);
status_change_end(bl, SC_TRUESIGHT, INVALID_TIMER);
status_change_end(bl, SC_WINDWALK, INVALID_TIMER);
+ FALLTHROUGH
//Also blocks the ones below...
case SC_DEC_AGI:
case SC_ADORAMUS:
status_change_end(bl, SC_CARTBOOST, INVALID_TIMER);
//Also blocks the ones below...
+ FALLTHROUGH
case SC_DONTFORGETME:
status_change_end(bl, SC_INC_AGI, INVALID_TIMER);
status_change_end(bl, SC_ADRENALINE, INVALID_TIMER);
@@ -7705,6 +7917,14 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
//Cancels Assumptio
status_change_end(bl, SC_ASSUMPTIO, INVALID_TIMER);
break;
+ case SC_MAGNIFICAT:
+ //Cancels Offertorium
+ status_change_end(bl, SC_OFFERTORIUM, INVALID_TIMER);
+ break;
+ case SC_OFFERTORIUM:
+ //Cancels Magnificat
+ status_change_end(bl, SC_MAGNIFICAT, INVALID_TIMER);
+ break;
case SC_DELUGE:
if (sc->data[SC_FOGWALL] && sc->data[SC_BLIND])
status_change_end(bl, SC_BLIND, INVALID_TIMER);
@@ -7764,40 +7984,46 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
status_change_end(bl, SC_INC_AGI, INVALID_TIMER);
break;
case SC_FOOD_STR:
- status_change_end(bl, SC_FOOD_STR_CASH, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_STR, INVALID_TIMER);
break;
case SC_FOOD_AGI:
- status_change_end(bl, SC_FOOD_AGI_CASH, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_AGI, INVALID_TIMER);
break;
case SC_FOOD_VIT:
- status_change_end(bl, SC_FOOD_VIT_CASH, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_VIT, INVALID_TIMER);
break;
case SC_FOOD_INT:
- status_change_end(bl, SC_FOOD_INT_CASH, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_INT, INVALID_TIMER);
break;
case SC_FOOD_DEX:
- status_change_end(bl, SC_FOOD_DEX_CASH, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_DEX, INVALID_TIMER);
break;
case SC_FOOD_LUK:
- status_change_end(bl, SC_FOOD_LUK_CASH, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_LUK, INVALID_TIMER);
break;
case SC_FOOD_STR_CASH:
status_change_end(bl, SC_FOOD_STR, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_STR_CASH, INVALID_TIMER);
break;
case SC_FOOD_AGI_CASH:
status_change_end(bl, SC_FOOD_AGI, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_AGI_CASH, INVALID_TIMER);
break;
case SC_FOOD_VIT_CASH:
status_change_end(bl, SC_FOOD_VIT, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_VIT_CASH, INVALID_TIMER);
break;
case SC_FOOD_INT_CASH:
status_change_end(bl, SC_FOOD_INT, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_INT_CASH, INVALID_TIMER);
break;
case SC_FOOD_DEX_CASH:
status_change_end(bl, SC_FOOD_DEX, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_DEX_CASH, INVALID_TIMER);
break;
case SC_FOOD_LUK_CASH:
status_change_end(bl, SC_FOOD_LUK, INVALID_TIMER);
+ status_change_end(bl, SC_FOOD_LUK_CASH, INVALID_TIMER);
break;
case SC_GM_BATTLE:
status_change_end(bl, SC_GM_BATTLE2, INVALID_TIMER);
@@ -7992,6 +8218,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_LERADS_DEW:
if (sc && sc->data[SC_BERSERK])
return 0;
+ FALLTHROUGH
case SC_SHAPESHIFT:
case SC_PROPERTYWALK:
break;
@@ -8004,6 +8231,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_JOINTBEAT:
val2 |= sce->val2; // stackable ailments
+ FALLTHROUGH
default:
if(sce->val1 > val1)
return 1; //Return true to not mess up skill animations. [Skotlex]
@@ -8017,6 +8245,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_ADORAMUS:
sc_start(src,bl,SC_BLIND,100,val1,skill->get_time(status->sc2skill(type),val1));
// Fall through to SC_INC_AGI
+ FALLTHROUGH
case SC_DEC_AGI:
case SC_INC_AGI:
val2 = 2 + val1; //Agi change
@@ -8029,33 +8258,33 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
int i;
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_NOAVOID|SCFLAG_NOICON);
}
} else if (bl->type == BL_MER) {
struct mercenary_data *mc = BL_UCAST(BL_MER, bl);
if (mc->devotion_flag && (tsd = mc->master) != NULL) {
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_NOAVOID|SCFLAG_NOICON);
}
}
}
//val4 signals infinite endure (if val4 == 2 it is infinite endure from Berserk)
- if( val4 )
- tick = -1;
+ if (val4)
+ tick = INFINITE_DURATION;
break;
case SC_AUTOBERSERK:
if (st->hp < st->max_hp>>2 &&
(!sc->data[SC_PROVOKE] || sc->data[SC_PROVOKE]->val2==0))
sc_start4(src,bl,SC_PROVOKE,100,10,1,0,0,60000);
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_CRUCIS:
val2 = 10 + 4*val1; //Def reduction
- tick = -1;
+ tick = INFINITE_DURATION;
clif->emotion(bl,E_SWT);
break;
case SC_MAXIMIZEPOWER:
tick_time = val2 = tick>0?tick:60000;
- tick = -1; // duration sent to the client should be infinite
+ tick = INFINITE_DURATION; // duration sent to the client should be infinite
break;
case SC_EDP: // [Celest]
//Chance to Poison enemies.
@@ -8096,10 +8325,11 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_SACRIFICE:
val2 = 5; //Lasts 5 hits
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_ENCHANTPOISON:
val2= 250+50*val1; //Poisoning Chance (2.5+0.5%) in 1/10000 rate
+ FALLTHROUGH
case SC_ASPERSIO:
case SC_PROPERTYFIRE:
case SC_PROPERTYWATER:
@@ -8132,12 +8362,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
int i;
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID|SCFLAG_NOICON);
}
} else if (bl->type == BL_MER) {
struct mercenary_data *mc = BL_UCAST(BL_MER, bl);
if (mc->devotion_flag && (tsd = mc->master) != NULL) {
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID|SCFLAG_NOICON);
}
}
}
@@ -8186,7 +8416,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
#endif
break;
case SC_NJ_SUITON:
- if (!val2 || (sd && (sd->class_&MAPID_BASEMASK) == MAPID_NINJA)) {
+ if (val2 == 0 || (sd != NULL && (sd->job & MAPID_BASEMASK) == MAPID_NINJA)) {
//No penalties.
val2 = 0; //Agi penalty
val3 = 0; //Walk speed penalty
@@ -8244,8 +8474,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_SUMMER:
case SC_HANBOK:
case SC_OKTOBERFEST:
- if (!vd) return 0;
- //Store previous values as they could be removed.
+ case SC_DRESS_UP:
+ if (vd == NULL)
+ return 0;
+ // Store previous values as they could be removed.
unit->stop_attack(bl);
break;
case SC_NOCHAT:
@@ -8349,7 +8581,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (!sd) //Monsters should be able to walk with no penalties. [Skotlex]
val1 = 10;
tick_time = val2 = tick>0?tick:60000; //SP consumption rate.
- tick = -1; // duration sent to the client should be infinite
+ tick = INFINITE_DURATION; // duration sent to the client should be infinite
val3 = 0; // unused, previously walk speed adjustment
//val4&1 signals the presence of a wall.
//val4&2 makes cloak not end on normal attacks [Skotlex]
@@ -8380,7 +8612,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_TURNKICK_READY:
case SC_DODGE_READY:
case SC_PUSH_CART:
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_AUTOGUARD:
@@ -8396,12 +8628,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if( sd ) {
for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL)
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID|SCFLAG_NOICON);
}
} else if (bl->type == BL_MER) {
struct mercenary_data *mc = BL_UCAST(BL_MER, bl);
if (mc->devotion_flag && (tsd = mc->master) != NULL) {
- status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
+ status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID|SCFLAG_NOICON);
}
}
}
@@ -8434,7 +8666,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
val2 = 12; //SP cost
val4 = 10000; //Decrease at 10secs intervals.
val3 = tick/val4;
- tick = -1; // duration sent to the client should be infinite
+ tick = INFINITE_DURATION; // duration sent to the client should be infinite
tick_time = val4; // [GodLesZ] tick time
break;
case SC_PARRYING:
@@ -8530,12 +8762,12 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_SWORDREJECT:
val2 = 15*val1; //Reflect chance
val3 = 3; //Reflections
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_MEMORIZE:
val2 = 5; //Memorized casts.
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_GRAVITATION:
@@ -8606,6 +8838,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
switch (val1) {
case 3: //33*3 + 1 -> 100%
val2++;
+ FALLTHROUGH
case 1:
case 2: //33, 66%
val2 += 33*val1;
@@ -8648,7 +8881,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
val3 = (int)(currenttick&0x00000000ffffffffLL);
val4 = (int)((currenttick&0xffffffff00000000LL)>>32);
}
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_KAAHI:
val2 = 200*val1; //HP heal
@@ -8663,7 +8896,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_TRICKDEAD:
if (vd) vd->dead_sit = 1;
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_CONCENTRATION:
val2 = 2 + val1;
@@ -8686,6 +8919,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_ADRENALINE2:
case SC_ADRENALINE:
val3 = (val2) ? 300 : 200; // aspd increase
+ FALLTHROUGH
case SC_WEAPONPERFECT:
if(sd && pc->checkskill(sd,BS_HILTBINDING)>0)
tick += tick / 10;
@@ -9056,7 +9290,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
val3 = (int)(currenttick&0x00000000ffffffffLL);
val4 = (int)((currenttick&0xffffffff00000000LL)>>32);
}
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC__REPRODUCE:
val4 = tick / 1000;
@@ -9253,7 +9487,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_FORCEOFVANGUARD:
val2 = 8 + 12 * val1; // Chance
val3 = 5 + 2 * val1; // Max rage counters
- tick = -1; //endless duration in the client
+ tick = INFINITE_DURATION; //endless duration in the client
break;
case SC_EXEEDBREAK:
if( sd ){
@@ -9381,17 +9615,20 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_WILD_STORM:
case SC_UPHEAVAL:
val2 += 10;
+ FALLTHROUGH
case SC_HEATER:
case SC_COOLER:
case SC_BLAST:
case SC_CURSED_SOIL:
val2 += 10;
+ FALLTHROUGH
case SC_PYROTECHNIC:
case SC_AQUAPLAY:
case SC_GUST:
case SC_PETROLOGY:
val2 += 5;
val3 += 9000;
+ FALLTHROUGH
case SC_CIRCLE_OF_FIRE:
case SC_WATER_SCREEN:
case SC_WIND_STEP:
@@ -9473,6 +9710,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_KAGEMUSYA:
val3 = val1 * 2;
+ FALLTHROUGH
case SC_IZAYOI:
val2 = tick/1000;
tick_time = 1000;
@@ -9519,7 +9757,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
break;
case SC_NEUTRALBARRIER:
tick_time = tick;
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_GOLDENE_FERSE:
val2 = 10 + 10*val1; //max hp bonus
@@ -9551,7 +9789,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
sc_start(src, bl, SC_ENDURE, 100, val1, tick); //start endure for same duration
break;
case SC_STYLE_CHANGE: //[Lighta] need real info
- tick = -1;
+ tick = INFINITE_DURATION;
if(val2 == MH_MD_FIGHTING) val2 = MH_MD_GRAPPLING;
else val2 = MH_MD_FIGHTING;
break;
@@ -9586,8 +9824,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
if (!mob->db_checkid(val1))
val1 = MOBID_PORING;
break;
+ case SC_SPRITEMABLE:
case SC_ALL_RIDING:
- tick = -1;
+ tick = INFINITE_DURATION;
break;
case SC_FLASHCOMBO:
/**
@@ -9596,6 +9835,36 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
**/
val2 = 20+(20*val1);
break;
+ /**
+ * Summoner
+ */
+ case SC_FRESHSHRIMP:
+ val4 = tick / (10000 - ((val1 - 1) * 1000));
+ tick_time = 10000 - ((val1 - 1) * 1000);
+ if (val4 <= 0) // Prevents a negeative value from happening
+ val4 = 0;
+ break;
+ case SC_ARCLOUSEDASH:
+ val2 = 15 + 5 * val1; // AGI
+ val3 = 25; // Move speed increase
+ if (sd != NULL && (sd->job & MAPID_BASEMASK) == MAPID_SUMMONER)
+ val4 = 10; // Ranged ATK increase
+ break;
+ case SC_TUNAPARTY:
+ val2 = (st->max_hp * (val1 * 10) / 100); // %Max HP to absorb
+ break;
+ case SC_BITESCAR:
+ val2 = 2 * val1; // MHP% damage
+ val4 = tick / 1000;
+ tick_time = 1000;
+ break;
+ case SC_SHRIMP:
+ val2 = 10; // BATK%, MATK%
+ break;
+ case SC_CATNIPPOWDER:
+ val2 = 50; // WATK%, MATK%
+ val3 = 25 * val1; // Move speed reduction
+ break;
default:
if (calc_flag == SCB_NONE && status->dbs->SkillChangeTable[type] == 0 && status->dbs->IconChangeTable[type] == 0) {
//Status change with no calc, no icon, and no skill associated...?
@@ -9603,19 +9872,21 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 0;
}
}
- } else { //Special considerations when loading SC data.
- switch( type ) {
+ } else { // Special considerations when loading SC data.
+ switch (type) {
case SC_WEDDING:
case SC_XMAS:
case SC_SUMMER:
case SC_HANBOK:
case SC_OKTOBERFEST:
- if( !vd ) break;
- clif->changelook(bl,LOOK_BASE,vd->class_);
- clif->changelook(bl,LOOK_WEAPON,0);
- clif->changelook(bl,LOOK_SHIELD,0);
- clif->changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
- clif->changelook(bl,LOOK_BODY2,0);
+ case SC_DRESS_UP:
+ if (vd == NULL)
+ break;
+ clif->changelook(bl, LOOK_BASE, vd->class);
+ clif->changelook(bl, LOOK_WEAPON, 0);
+ clif->changelook(bl, LOOK_SHIELD, 0);
+ clif->changelook(bl, LOOK_CLOTHES_COLOR, vd->cloth_color);
+ clif->changelook(bl, LOOK_BODY2, 0);
break;
case SC_KAAHI:
val4 = INVALID_TIMER;
@@ -9779,14 +10050,17 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_DEEP_SLEEP:
if (sd && pc_issit(sd)) //Avoid sprite sync problems.
pc->setstand(sd);
+ FALLTHROUGH
case SC_TRICKDEAD:
status_change_end(bl, SC_DANCING, INVALID_TIMER);
// Cancel cast when get status [LuzZza]
if (battle_config.sc_castcancel&bl->type)
unit->skillcastcancel(bl, 0);
+ FALLTHROUGH
case SC_FALLENEMPIRE:
case SC_WHITEIMPRISON:
unit->stop_attack(bl);
+ FALLTHROUGH
case SC_STOP:
case SC_CONFUSION:
case SC_RG_CCONFINE_M:
@@ -9805,6 +10079,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_NEEDLE_OF_PARALYZE:
case SC_DEATHBOUND:
case SC_NETHERWORLD:
+ case SC_SV_ROOTTWIST:
unit->stop_walking(bl, STOPWALKING_FLAG_FIXPOS);
break;
case SC_ANKLESNARE:
@@ -9819,6 +10094,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
case SC_CAMOUFLAGE:
case SC_SIREN:
case SC_ALL_RIDING:
+ case SC_SUHIDE:
unit->stop_attack(bl);
break;
case SC_SILENCE:
@@ -9878,6 +10154,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
opt_flag = 0;
break;
}
+ FALLTHROUGH
case SC_EXPLOSIONSPIRITS:
sc->opt3 |= OPT3_EXPLOSIONSPIRITS;
opt_flag = 0;
@@ -9992,6 +10269,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
sc->option |= OPTION_OKTOBERFEST;
opt_flag |= 0x4;
break;
+ case SC_DRESS_UP:
+ sc->option |= OPTION_SUMMER2;
+ opt_flag |= 0x4;
+ break;
case SC__FEINTBOMB_MASTER:
sc->option |= OPTION_INVISIBLE;
opt_flag |= 0x4;
@@ -10005,7 +10286,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
clif->changeoption(bl);
if( sd && opt_flag&0x4 ) {
if (vd)
- clif->changelook(bl,LOOK_BASE,vd->class_);
+ clif->changelook(bl, LOOK_BASE, vd->class);
clif->changelook(bl,LOOK_WEAPON,0);
clif->changelook(bl,LOOK_SHIELD,0);
if (vd)
@@ -10161,6 +10442,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
return 1;
}
+
/*==========================================
* Ending all status except those listed.
* @TODO maybe usefull for dispel instead reseting a liste there.
@@ -10170,7 +10452,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
* 2 - Do clif
* 3 - Do not remove some permanent/time-independent effects
*------------------------------------------*/
-int status_change_clear(struct block_list* bl, int type) {
+int status_change_clear(struct block_list* bl, int type)
+{
struct status_change* sc;
int i;
@@ -10189,6 +10472,7 @@ int status_change_clear(struct block_list* bl, int type) {
case SC_ARMOR_PROPERTY://Only when its Holy or Dark that it doesn't dispell on death
if( sc->data[i]->val2 != ELE_HOLY && sc->data[i]->val2 != ELE_DARK )
break;
+ FALLTHROUGH
default:
continue;
}
@@ -10227,7 +10511,8 @@ int status_change_clear(struct block_list* bl, int type) {
/*==========================================
* Special condition we want to effectuate, check before ending a status.
*------------------------------------------*/
-int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line) {
+int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line)
+{
struct map_session_data *sd;
struct status_change *sc;
struct status_change_entry *sce;
@@ -10268,6 +10553,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
//trigger when it also removed one
case SC_STONE:
sce->val3 = 0; //Petrify time counter.
+ FALLTHROUGH
case SC_FREEZE:
case SC_STUN:
case SC_SLEEP:
@@ -10345,10 +10631,12 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
struct map_session_data *tsd;
if( bl->type == BL_PC ) {
// Clear Status from others
- int i;
- for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
- if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL && tsd->sc.data[type])
- status_change_end(&tsd->bl, type, INVALID_TIMER);
+ if (sd != NULL ) {
+ int i;
+ for( i = 0; i < MAX_PC_DEVOTION; i++ ) {
+ if (sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) != NULL && tsd->sc.data[type])
+ status_change_end(&tsd->bl, type, INVALID_TIMER);
+ }
}
} else if (bl->type == BL_MER) {
struct mercenary_data *mc = BL_UCAST(BL_MER, bl);
@@ -10590,7 +10878,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
// need to do it here.
if( sd ) {
map->quit(sd);
- // Because map->quit calls status_change_end with tid -1
+ // Because map->quit calls status_change_end with tid INVALID_TIMER
// from here it's not neccesary to continue
return 1;
}
@@ -10620,7 +10908,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case SC_WHITEIMPRISON:
{
struct block_list* src = map->id2bl(sce->val2);
- if( tid == -1 || !src)
+ if (tid == INVALID_TIMER || src == NULL)
break; // Terminated by Damage
status_fix_damage(src,bl,400*sce->val1,clif->damage(bl,bl,0,0,400*sce->val1,0,BDT_NORMAL,0));
}
@@ -10630,7 +10918,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
struct unit_data *ud = unit->bl2ud(bl);
if (ud) {
ud->state.running = 0;
- if (ud->walktimer != -1)
+ if (ud->walktimer != INVALID_TIMER)
unit->stop_walking(bl, STOPWALKING_FLAG_FIXPOS);
}
}
@@ -10654,10 +10942,11 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
break;
case SC_NEUTRALBARRIER_MASTER:
case SC_STEALTHFIELD_MASTER:
- if( sce->val2 ) {
+ case SC_SV_ROOTTWIST:
+ if (sce->val2) {
struct skill_unit_group* group = skill->id2group(sce->val2);
sce->val2 = 0;
- if( group ) /* might have been cleared before status ended, e.g. land protector */
+ if (group) /* might have been cleared before status ended, e.g. land protector */
skill->del_unitgroup(group,ALC_MARK);
}
break;
@@ -10792,6 +11081,10 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
sc->option &= ~OPTION_OKTOBERFEST;
opt_flag |= 0x4;
break;
+ case SC_DRESS_UP:
+ sc->option &= ~OPTION_SUMMER2;
+ opt_flag |= 0x4;
+ break;
case SC__FEINTBOMB_MASTER:
sc->option &= ~OPTION_INVISIBLE;
opt_flag |= 0x4;
@@ -10834,6 +11127,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
opt_flag = 0;
break;
}
+ FALLTHROUGH
case SC_EXPLOSIONSPIRITS:
sc->opt3 &= ~OPT3_EXPLOSIONSPIRITS;
opt_flag = 0;
@@ -10934,7 +11228,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
else if(opt_flag) {
clif->changeoption(bl);
if( sd && opt_flag&0x4 ) {
- clif->changelook(bl,LOOK_BASE,sd->vd.class_);
+ clif->changelook(bl, LOOK_BASE, sd->vd.class);
clif->get_weapon_view(sd, &sd->vd.weapon, &sd->vd.shield);
clif->changelook(bl,LOOK_WEAPON,sd->vd.weapon);
clif->changelook(bl,LOOK_SHIELD,sd->vd.shield);
@@ -10995,7 +11289,8 @@ int kaahi_heal_timer(int tid, int64 tick, int id, intptr_t data) {
* For recusive status, like for each 5s we drop sp etc.
* Reseting the end timer.
*------------------------------------------*/
-int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
+int status_change_timer(int tid, int64 tick, int id, intptr_t data)
+{
enum sc_type type = (sc_type)data;
struct block_list *bl;
struct map_session_data *sd;
@@ -11012,7 +11307,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
st = status->get_status_data(bl);
if (!sc || (sce = sc->data[type]) == NULL) {
- ShowDebug("status_change_timer: Null pointer id: %d data: %"PRIdPTR" bl-type: %d\n", id, data, bl->type);
+ ShowDebug("status_change_timer: Null pointer id: %d data: %"PRIdPTR" bl-type: %u\n", id, data, bl->type);
return 0;
}
@@ -11118,6 +11413,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
case SC_POISON:
if(st->hp <= max(st->max_hp>>2, sce->val4)) //Stop damaging after 25% HP left.
break;
+ FALLTHROUGH
case SC_DPOISON:
if (--(sce->val3) > 0) {
if (!sc->data[SC_SLOWPOISON]) {
@@ -11248,6 +11544,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
//Moonlit's cost is 4sp*skill_lv [Skotlex]
sp= 4*(sce->val1>>16);
//Upkeep is also every 10 secs.
+ FALLTHROUGH
case DC_DONTFORGETME:
s=10;
break;
@@ -11395,17 +11692,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
mushroom_skill_id = skill->dbs->magicmushroom_db[i].skill_id;
} while (mushroom_skill_id == 0);
- switch( skill->get_casttype(mushroom_skill_id) ) { // Magic Mushroom skills are buffs or area damage
- case CAST_GROUND:
- skill->castend_pos2(bl,bl->x,bl->y,mushroom_skill_id,1,tick,0);
- break;
- case CAST_NODAMAGE:
- skill->castend_nodamage_id(bl,bl,mushroom_skill_id,1,tick,0);
- break;
- case CAST_DAMAGE:
- skill->castend_damage_id(bl,bl,mushroom_skill_id,1,tick,0);
- break;
- }
+ skill->castend_type(skill->get_casttype(mushroom_skill_id), bl, bl, mushroom_skill_id, 1, tick, 0);
}
clif->emotion(bl,E_HEH);
@@ -11576,7 +11863,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
if( --(sce->val4) > 0 ) {
struct block_list *src = map->id2bl(sce->val2);
int damage;
- if( !src || (src && (status->isdead(src) || src->m != bl->m || distance_bl(src, bl) >= 12)) )
+ if (src == NULL || (status->isdead(src) || src->m != bl->m || distance_bl(src, bl) >= 12))
break;
map->freeblock_lock();
damage = sce->val3;
@@ -11855,6 +12142,19 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
break;
+ case SC_FRESHSHRIMP:
+ if (--(sce->val4) >= 0) {
+ status_heal(bl, st->max_hp / 100, 0, 2);
+ sc_timer_next((10000 - ((sce->val1 - 1) * 1000)) + tick, status->change_timer, bl->id, data);
+ }
+ break;
+ case SC_BITESCAR:
+ if (--(sce->val4) >= 0) {
+ status_percent_damage(bl, bl, -(sce->val2), 0, 0);
+ sc_timer_next(1000 + tick, status->change_timer, bl->id, data);
+ return 0;
+ }
+ break;
}
// default for all non-handled control paths is to end the status
@@ -11865,7 +12165,8 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
/*==========================================
* Foreach iteration of repetitive status
*------------------------------------------*/
-int status_change_timer_sub(struct block_list* bl, va_list ap) {
+int status_change_timer_sub(struct block_list* bl, va_list ap)
+{
struct status_change* tsc;
struct block_list* src = va_arg(ap,struct block_list*);
@@ -11873,6 +12174,8 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) {
enum sc_type type = (sc_type)va_arg(ap,int); //gcc: enum args get promoted to int
int64 tick = va_arg(ap, int64);
+ nullpo_ret(bl);
+
if (status->isdead(bl))
return 0;
@@ -11923,13 +12226,13 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) {
break;
case SC_RG_CCONFINE_M:
//Lock char has released the hold on everyone...
- if (tsc && tsc->data[SC_RG_CCONFINE_S] && tsc->data[SC_RG_CCONFINE_S]->val2 == src->id) {
+ if (tsc != NULL && src != NULL && tsc->data[SC_RG_CCONFINE_S] && tsc->data[SC_RG_CCONFINE_S]->val2 == src->id) {
tsc->data[SC_RG_CCONFINE_S]->val2 = 0;
status_change_end(bl, SC_RG_CCONFINE_S, INVALID_TIMER);
}
break;
case SC_CURSEDCIRCLE_TARGET:
- if( tsc && tsc->data[SC_CURSEDCIRCLE_TARGET] && tsc->data[SC_CURSEDCIRCLE_TARGET]->val2 == src->id ) {
+ if (tsc != NULL && src != NULL && tsc->data[SC_CURSEDCIRCLE_TARGET] && tsc->data[SC_CURSEDCIRCLE_TARGET]->val2 == src->id) {
clif->bladestop(bl, tsc->data[SC_CURSEDCIRCLE_TARGET]->val2, 0);
status_change_end(bl, type, INVALID_TIMER);
}
@@ -11940,12 +12243,15 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) {
int status_get_total_def(struct block_list *src) { return status->get_status_data(src)->def2 + (short)status->get_def(src); }
int status_get_total_mdef(struct block_list *src) { return status->get_status_data(src)->mdef2 + (short)status_get_mdef(src); }
+
int status_get_weapon_atk(struct block_list *bl, struct weapon_atk *watk, int flag)
{
#ifdef RENEWAL
int min = 0, max = 0;
struct status_change *sc = status->get_sc(bl);
+ nullpo_ret(bl);
+ nullpo_ret(watk);
if (bl->type == BL_PC && watk->atk) {
float strdex_bonus, variance;
int dstr;
@@ -12007,7 +12313,8 @@ int status_get_weapon_atk(struct block_list *bl, struct weapon_atk *watk, int fl
* 1 - Get MATK w/o SC bonuses
* 3 - Get MATK w/o EATK & SC bonuses
**/
-void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_max, unsigned short *matk_min) {
+void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_max, unsigned short *matk_min)
+{
struct status_data *st;
struct status_change *sc;
struct map_session_data *sd;
@@ -12034,6 +12341,10 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
// Any +MATK you get from skills and cards, including cards in weapon, is added here.
if ( sd && sd->bonus.ematk > 0 && flag != 3 )
*matk_min += sd->bonus.ematk;
+ if (sd && pc->checkskill(sd, SU_POWEROFLAND) > 0) {
+ if (pc->checkskill(sd, SU_SV_STEMSPEAR) == 5 && pc->checkskill(sd, SU_CN_POWDERING) == 5 && pc->checkskill(sd, SU_CN_METEOR) == 5 && pc->checkskill(sd, SU_SV_ROOTTWIST) == 5)
+ *matk_min += *matk_min * 20 / 100;
+ }
if ( flag != 3 )
*matk_min = status->calc_ematk(bl, sc, *matk_min);
@@ -12045,6 +12356,8 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
if ( (st->rhw.matk + st->lhw.matk) > 0 ) {
int wMatk = st->rhw.matk + st->lhw.matk; // Left and right matk stacks
int variance = wMatk * st->rhw.wlv / 10; // Only use right hand weapon level
+ if (sc != NULL && sc->data[SC_CATNIPPOWDER])
+ wMatk -= wMatk * sc->data[SC_CATNIPPOWDER]->val2 / 100;
*matk_min += wMatk - variance;
*matk_max += wMatk + variance;
}
@@ -12073,8 +12386,8 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
}
#else // not RENEWAL
- *matk_min = status_base_matk_min(st) + (sd ? sd->bonus.ematk : 0);
- *matk_max = status_base_matk_max(st) + (sd ? sd->bonus.ematk : 0);
+ *matk_min = status->base_matk_min(st) + (sd ? sd->bonus.ematk : 0);
+ *matk_max = status->base_matk_max(st) + (sd ? sd->bonus.ematk : 0);
#endif
if ( sd && sd->matk_rate != 100 ) {
@@ -12114,7 +12427,8 @@ void status_get_matk_sub(struct block_list *bl, int flag, unsigned short *matk_m
/**
* Gets a random matk value depending on min matk and max matk
**/
-unsigned short status_get_rand_matk(unsigned short matk_max, unsigned short matk_min) {
+unsigned short status_get_rand_matk(unsigned short matk_max, unsigned short matk_min)
+{
if ( matk_max > matk_min )
return matk_min + rnd() % (matk_max - matk_min);
else
@@ -12132,7 +12446,8 @@ unsigned short status_get_rand_matk(unsigned short matk_max, unsigned short matk
*
* Shouldn't change _any_ value! [Panikon]
**/
-int status_get_matk(struct block_list *bl, int flag) {
+int status_get_matk(struct block_list *bl, int flag)
+{
struct status_data *st;
unsigned short matk_max, matk_min;
@@ -12160,7 +12475,8 @@ int status_get_matk(struct block_list *bl, int flag) {
/**
* Updates bl's MATK values
**/
-void status_update_matk(struct block_list *bl) {
+void status_update_matk(struct block_list *bl)
+{
struct status_data *st;
struct status_change *sc;
unsigned short matk_max, matk_min;
@@ -12188,7 +12504,8 @@ void status_update_matk(struct block_list *bl) {
* type&1 -> buffs, type&2 -> debuffs
* type&4 -> especific debuffs(implemented with refresh)
*------------------------------------------*/
-int status_change_clear_buffs (struct block_list* bl, int type) {
+int status_change_clear_buffs (struct block_list* bl, int type)
+{
int i;
struct status_change *sc= status->get_sc(bl);
@@ -12249,7 +12566,8 @@ int status_change_clear_buffs (struct block_list* bl, int type) {
return 0;
}
-int status_change_spread( struct block_list *src, struct block_list *bl ) {
+int status_change_spread(struct block_list *src, struct block_list *bl)
+{
int i, flag = 0;
struct status_change *sc = status->get_sc(src);
int64 tick;
@@ -12295,8 +12613,9 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) {
if (td == NULL || td->func != status->change_timer || DIFF_TICK(td->tick,tick) < 0)
continue;
data.tick = DIFF_TICK32(td->tick,tick);
- } else
- data.tick = INVALID_TIMER;
+ } else {
+ data.tick = INFINITE_DURATION;
+ }
break;
// Special cases
case SC_POISON:
@@ -12338,7 +12657,8 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) {
}
//Natural regen related stuff.
-int status_natural_heal(struct block_list* bl, va_list args) {
+int status_natural_heal(struct block_list* bl, va_list args)
+{
struct regen_data *regen;
struct status_data *st;
struct status_change *sc;
@@ -12348,6 +12668,7 @@ int status_natural_heal(struct block_list* bl, va_list args) {
struct map_session_data *sd;
int val,rate,bonus = 0,flag;
+ nullpo_ret(bl);
regen = status->get_regen_data(bl);
if (!regen) return 0;
st = status->get_status_data(bl);
@@ -12415,8 +12736,10 @@ int status_natural_heal(struct block_list* bl, va_list args) {
}
}
- if (flag && regen->state.overweight)
- flag=0;
+ // SC_TENSIONRELAX allows HP to be recovered even when overweight. [csnv]
+ if (flag && regen->state.overweight && (sc == NULL || sc->data[SC_TENSIONRELAX] == NULL)) {
+ flag = 0;
+ }
ud = unit->bl2ud(bl);
@@ -12504,7 +12827,7 @@ int status_natural_heal(struct block_list* bl, va_list args) {
if ((rate = pc->checkskill(sd,TK_SPTIME)))
sc_start(bl,bl,status->skill2sc(TK_SPTIME),
100,rate,skill->get_time(TK_SPTIME, rate));
- if ((sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
+ if ((sd->job & MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR
&&rnd()%10000 < battle_config.sg_angel_skill_ratio
) {
//Angel of the Sun/Moon/Star
@@ -12522,7 +12845,8 @@ int status_natural_heal(struct block_list* bl, va_list args) {
}
//Natural heal main timer.
-int status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) {
+int status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data)
+{
// This difference is always positive and lower than UINT_MAX (~24 days)
status->natural_heal_diff_tick = (unsigned int)cap_value(DIFF_TICK(tick,status->natural_heal_prev_tick), 0, UINT_MAX);
map->foreachregen(status->natural_heal);
@@ -12536,15 +12860,21 @@ int status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) {
* @param refine The target refine level
* @return The chance to refine the item, in percent (0~100)
**/
-int status_get_refine_chance(enum refine_type wlv, int refine) {
+int status_get_refine_chance(enum refine_type wlv, int refine, enum refine_chance_type type)
+{
+ Assert_ret((int)wlv >= REFINE_TYPE_ARMOR && wlv < REFINE_TYPE_MAX);
- if ( refine < 0 || refine >= MAX_REFINE)
- return 0;
+ if (refine < 0 || refine >= MAX_REFINE)
+ return 0;
- return status->dbs->refine_info[wlv].chance[refine];
+ if (type >= REFINE_CHANCE_TYPE_MAX)
+ return 0;
+
+ return status->dbs->refine_info[wlv].chance[type][refine];
}
-int status_get_sc_type(sc_type type) {
+int status_get_sc_type(sc_type type)
+{
if( type <= SC_NONE || type >= SC_MAX )
return 0;
@@ -12552,9 +12882,9 @@ int status_get_sc_type(sc_type type) {
return status->dbs->sc_conf[type];
}
-void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
+void status_read_job_db_sub(int idx, const char *name, struct config_setting_t *jdb)
{
- config_setting_t *temp = NULL;
+ struct config_setting_t *temp = NULL;
int i32 = 0;
struct {
@@ -12586,7 +12916,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
{ "FuumaShuriken", W_HUUMA },
{ "TwoHandRod", W_2HSTAFF },
#ifdef RENEWAL_ASPD
- { "Shield", MAX_WEAPON_TYPE }
+ { "Shield", MAX_SINGLE_WEAPON_TYPE }
#endif
};
@@ -12694,7 +13024,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
if ((temp = libconfig->setting_get_member(jdb, "BaseASPD"))) {
int widx = 0;
- config_setting_t *wpn = NULL;
+ struct config_setting_t *wpn = NULL;
while ((wpn = libconfig->setting_get_elem(temp, widx++))) {
int w, wlen = ARRAYLENGTH(wnames);
const char *wname = config_setting_name(wpn);
@@ -12710,7 +13040,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
if ((temp = libconfig->setting_get_member(jdb, "HPTable"))) {
int level = 0, avg_increment, base;
- config_setting_t *hp = NULL;
+ struct config_setting_t *hp = NULL;
while (level <= MAX_LEVEL && (hp = libconfig->setting_get_elem(temp, level)) != NULL) {
i32 = libconfig->setting_get_int(hp);
status->dbs->HP_table[idx][++level] = min(i32, battle_config.max_hp);
@@ -12730,7 +13060,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
if ((temp = libconfig->setting_get_member(jdb, "SPTable"))) {
int level = 0, avg_increment, base;
- config_setting_t *sp = NULL;
+ struct config_setting_t *sp = NULL;
while (level <= MAX_LEVEL && (sp = libconfig->setting_get_elem(temp, level)) != NULL) {
i32 = libconfig->setting_get_int(sp);
status->dbs->SP_table[idx][++level] = min(i32, battle_config.max_sp);
@@ -12756,30 +13086,30 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
* size_fix.txt - size adjustment table for weapons
* refine_db.txt - refining data table
*------------------------------------------*/
-void status_read_job_db(void) { /* [malufett/Hercules] */
+void status_read_job_db(void) /* [malufett/Hercules] */
+{
int i = 0;
- config_t job_db_conf;
- config_setting_t *jdb = NULL;
+ struct config_t job_db_conf;
+ struct config_setting_t *jdb = NULL;
#ifdef RENEWAL_ASPD
const char *config_filename = "db/re/job_db.conf";
#else
const char *config_filename = "db/pre-re/job_db.conf";
#endif
- if ( libconfig->read_file(&job_db_conf, config_filename) ) {
- ShowError("can't read %s\n", config_filename);
+ if (!libconfig->load_file(&job_db_conf, config_filename))
return;
- }
+
while ( (jdb = libconfig->setting_get_elem(job_db_conf.root, i++)) ) {
- int class_, idx;
+ int class, idx;
const char *name = config_setting_name(jdb);
- if ( (class_ = pc->check_job_name(name)) == -1 ) {
+ if ((class = pc->check_job_name(name)) == -1) {
ShowWarning("pc_read_job_db: '%s' unknown job name!\n", name);
continue;
}
- idx = pc->class2idx(class_);
+ idx = pc->class2idx(class);
status->read_job_db_sub(idx, name, jdb);
}
ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", i, config_filename);
@@ -12788,16 +13118,16 @@ void status_read_job_db(void) { /* [malufett/Hercules] */
bool status_readdb_job2(char* fields[], int columns, int current)
{
- int idx, class_, i;
+ int idx, class, i;
- class_ = atoi(fields[0]);
+ nullpo_retr(false, fields);
+ class = atoi(fields[0]);
- if(!pc->db_checkid(class_))
- {
- ShowWarning("status_readdb_job2: Invalid job class %d specified.\n", class_);
+ if (!pc->db_checkid(class)) {
+ ShowWarning("status_readdb_job2: Invalid job class %d specified.\n", class);
return false;
}
- idx = pc->class2idx(class_);
+ idx = pc->class2idx(class);
for(i = 1; i < columns; i++)
{
@@ -12810,7 +13140,8 @@ bool status_readdb_sizefix(char* fields[], int columns, int current)
{
unsigned int i;
- for(i = 0; i < MAX_WEAPON_TYPE; i++)
+ nullpo_retr(false, fields);
+ for(i = 0; i < MAX_SINGLE_WEAPON_TYPE; i++)
{
status->dbs->atkmods[current][i] = atoi(fields[i]);
}
@@ -12829,9 +13160,9 @@ bool status_readdb_sizefix(char* fields[], int columns, int current)
* validation errors.
* @return # of the validated entry, or 0 in case of failure.
*/
-int status_readdb_refine_libconfig_sub(config_setting_t *r, const char *name, const char *source)
+int status_readdb_refine_libconfig_sub(struct config_setting_t *r, const char *name, const char *source)
{
- config_setting_t *rate = NULL;
+ struct config_setting_t *rate = NULL;
int type = REFINE_TYPE_ARMOR, bonus_per_level = 0, rnd_bonus_v = 0, rnd_bonus_lv = 0;
char lv[4];
nullpo_ret(r);
@@ -12862,56 +13193,86 @@ int status_readdb_refine_libconfig_sub(config_setting_t *r, const char *name, co
}
if ((rate=libconfig->setting_get_member(r, "Rates")) != NULL && config_setting_is_group(rate)) {
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
bool duplicate[MAX_REFINE];
- int bonus[MAX_REFINE], rnd_bonus[MAX_REFINE], chance[MAX_REFINE];
- int i;
+ int bonus[MAX_REFINE], rnd_bonus[MAX_REFINE];
+ int chance[REFINE_CHANCE_TYPE_MAX][MAX_REFINE];
+ int i, j;
+
memset(&duplicate, 0, sizeof(duplicate));
memset(&bonus, 0, sizeof(bonus));
memset(&rnd_bonus, 0, sizeof(rnd_bonus));
- for (i = 0; i < MAX_REFINE; i++) {
- chance[i] = 100;
- }
+ for (i = 0; i < REFINE_CHANCE_TYPE_MAX; i++)
+ for (j = 0; j < MAX_REFINE; j++)
+ chance[i][j] = 100; // default value for all rates.
+
i = 0;
+ j = 0;
while ((t = libconfig->setting_get_elem(rate,i++)) != NULL && config_setting_is_group(t)) {
int level = 0, i32;
char *rlvl = config_setting_name(t);
memset(&lv, 0, sizeof(lv));
- if (!strspn(&rlvl[strlen(rlvl)-1], "0123456789") || (level = atoi(strncpy(lv, rlvl+2, 3))) <= 0) {
+
+ if (!strspn(&rlvl[strlen(rlvl) - 1], "0123456789") || (level = atoi(strncpy(lv, rlvl + 2, 3))) <= 0) {
ShowError("status_readdb_refine_libconfig_sub: Invalid refine level format '%s' for entry %s in \"%s\"... skipping.\n", rlvl, name, source);
continue;
}
+
if (level <= 0 || level > MAX_REFINE) {
ShowError("status_readdb_refine_libconfig_sub: Out of range refine level '%s' for entry %s in \"%s\"... skipping.\n", rlvl, name, source);
continue;
}
+
level--;
+
if (duplicate[level]) {
ShowWarning("status_readdb_refine_libconfig_sub: duplicate rate '%s' for entry %s in \"%s\", overwriting previous entry...\n", rlvl, name, source);
} else {
duplicate[level] = true;
}
- if (libconfig->setting_lookup_int(t, "Chance", &i32))
- chance[level] = i32;
+
+ if (libconfig->setting_lookup_int(t, "NormalChance", &i32) != 0)
+ chance[REFINE_CHANCE_TYPE_NORMAL][level] = i32;
+ else
+ chance[REFINE_CHANCE_TYPE_NORMAL][level] = 100;
+
+ if (libconfig->setting_lookup_int(t, "EnrichedChance", &i32) != 0)
+ chance[REFINE_CHANCE_TYPE_ENRICHED][level] = i32;
else
- chance[level] = 100;
- if (libconfig->setting_lookup_int(t, "Bonus", &i32))
+ chance[REFINE_CHANCE_TYPE_ENRICHED][level] = level > 10 ? 0 : 100; // enriched ores up to +10 only.
+
+ if (libconfig->setting_lookup_int(t, "EventNormalChance", &i32) != 0)
+ chance[REFINE_CHANCE_TYPE_E_NORMAL][level] = i32;
+ else
+ chance[REFINE_CHANCE_TYPE_E_NORMAL][level] = 100;
+
+ if (libconfig->setting_lookup_int(t, "EventEnrichedChance", &i32) != 0)
+ chance[REFINE_CHANCE_TYPE_E_ENRICHED][level] = i32;
+ else
+ chance[REFINE_CHANCE_TYPE_E_ENRICHED][level] = level > 10 ? 0 : 100; // enriched ores up to +10 only.
+
+ if (libconfig->setting_lookup_int(t, "Bonus", &i32) != 0)
bonus[level] += i32;
+
if (level >= rnd_bonus_lv - 1)
rnd_bonus[level] = rnd_bonus_v * (level - rnd_bonus_lv + 2);
}
for (i = 0; i < MAX_REFINE; i++) {
- status->dbs->refine_info[type].chance[i] = chance[i];
+ status->dbs->refine_info[type].chance[REFINE_CHANCE_TYPE_NORMAL][i] = chance[REFINE_CHANCE_TYPE_NORMAL][i];
+ status->dbs->refine_info[type].chance[REFINE_CHANCE_TYPE_E_NORMAL][i] = chance[REFINE_CHANCE_TYPE_E_NORMAL][i];
+ status->dbs->refine_info[type].chance[REFINE_CHANCE_TYPE_ENRICHED][i] = chance[REFINE_CHANCE_TYPE_ENRICHED][i];
+ status->dbs->refine_info[type].chance[REFINE_CHANCE_TYPE_E_ENRICHED][i] = chance[REFINE_CHANCE_TYPE_E_ENRICHED][i];
status->dbs->refine_info[type].randombonus_max[i] = rnd_bonus[i];
- bonus[i] += bonus_per_level + (i > 0 ? bonus[i-1] : 0);
+ bonus[i] += bonus_per_level + (i > 0 ? bonus[i - 1] : 0);
status->dbs->refine_info[type].bonus[i] = bonus[i];
}
} else {
ShowWarning("status_readdb_refine_libconfig_sub: Missing refine rates for entry '%s' in \"%s\", skipping.\n", name, source);
return 0;
}
- return type+1;
+
+ return type + 1;
}
/**
@@ -12920,26 +13281,29 @@ int status_readdb_refine_libconfig_sub(config_setting_t *r, const char *name, co
* @param *filename File name, relative to the database path.
* @return The number of found entries.
*/
-int status_readdb_refine_libconfig(const char *filename) {
+int status_readdb_refine_libconfig(const char *filename)
+{
bool duplicate[REFINE_TYPE_MAX];
- config_t refine_db_conf;
- config_setting_t *r;
+ struct config_t refine_db_conf;
+ struct config_setting_t *r;
char filepath[256];
- int i = 0, count = 0,type = 0;
+ int i = 0, count = 0;
sprintf(filepath, "%s/%s", map->db_path, filename);
- memset(&duplicate,0,sizeof(duplicate));
- if( libconfig->read_file(&refine_db_conf, filepath) ) {
- ShowError("can't read %s\n", filepath);
+ if (!libconfig->load_file(&refine_db_conf, filepath))
return 0;
- }
+
+ memset(&duplicate,0,sizeof(duplicate));
while((r = libconfig->setting_get_elem(refine_db_conf.root,i++))) {
char *name = config_setting_name(r);
- if((type=status->readdb_refine_libconfig_sub(r, name, filename))) {
- if( duplicate[type-1] ) {
+ int type = status->readdb_refine_libconfig_sub(r, name, filename);
+ if (type != 0) {
+ if (duplicate[type-1]) {
ShowWarning("status_readdb_refine_libconfig: duplicate entry for %s in \"%s\", overwriting previous entry...\n", name, filename);
- } else duplicate[type-1] = true;
+ } else {
+ duplicate[type-1] = true;
+ }
count++;
}
}
@@ -12949,16 +13313,22 @@ int status_readdb_refine_libconfig(const char *filename) {
return count;
}
-bool status_readdb_scconfig(char* fields[], int columns, int current) {
+bool status_readdb_scconfig(char* fields[], int columns, int current)
+{
int val = 0;
char* type = fields[0];
+ nullpo_retr(false, fields);
if( !script->get_constant(type, &val) ){
ShowWarning("status_readdb_sc_conf: Invalid status type %s specified.\n", type);
return false;
}
status->dbs->sc_conf[val] = (int)strtol(fields[1], NULL, 0);
+ if (status->dbs->sc_conf[val] & SC_VISIBLE)
+ {
+ status->dbs->DisplayType[val] = true;
+ }
return true;
}
@@ -12984,31 +13354,22 @@ int status_readdb(void)
memset(status->dbs->job_bonus,0,sizeof(status->dbs->job_bonus)); // Job-specific stats bonus
}
for ( i = 0; i < CLASS_COUNT; i++ ) {
- for ( j = 0; j < MAX_WEAPON_TYPE; j++ )
+ for ( j = 0; j < MAX_SINGLE_WEAPON_TYPE; j++ )
status->dbs->aspd_base[i][j] = 2000;
#ifdef RENEWAL_ASPD
- status->dbs->aspd_base[i][MAX_WEAPON_TYPE] = 0;
+ status->dbs->aspd_base[i][MAX_SINGLE_WEAPON_TYPE] = 0;
#endif
}
// size_fix.txt
for(i = 0; i < ARRAYLENGTH(status->dbs->atkmods); i++)
- for(j = 0; j < MAX_WEAPON_TYPE; j++)
+ for(j = 0; j < MAX_SINGLE_WEAPON_TYPE; j++)
status->dbs->atkmods[i][j] = 100;
- // refine_db.txt
- for(i=0;i<ARRAYLENGTH(status->dbs->refine_info);i++) {
- for(j=0;j<MAX_REFINE; j++) {
- status->dbs->refine_info[i].chance[j] = 100;
- status->dbs->refine_info[i].bonus[j] = 0;
- status->dbs->refine_info[i].randombonus_max[j] = 0;
- }
- }
-
// read databases
//
sv->readdb(map->db_path, "job_db2.txt", ',', 1, 1+MAX_LEVEL, -1, status->readdb_job2);
- sv->readdb(map->db_path, DBPATH"size_fix.txt", ',', MAX_WEAPON_TYPE, MAX_WEAPON_TYPE, ARRAYLENGTH(status->dbs->atkmods), status->readdb_sizefix);
+ sv->readdb(map->db_path, DBPATH"size_fix.txt", ',', MAX_SINGLE_WEAPON_TYPE, MAX_SINGLE_WEAPON_TYPE, ARRAYLENGTH(status->dbs->atkmods), status->readdb_sizefix);
status->readdb_refine_libconfig(DBPATH"refine_db.conf");
sv->readdb(map->db_path, "sc_config.txt", ',', 2, 2, SC_MAX, status->readdb_scconfig);
status->read_job_db();
@@ -13019,7 +13380,8 @@ int status_readdb(void)
/*==========================================
* Status db init and destroy.
*------------------------------------------*/
-int do_init_status(bool minimal) {
+int do_init_status(bool minimal)
+{
if (minimal)
return 0;
@@ -13034,7 +13396,9 @@ int do_init_status(bool minimal) {
timer->add_interval(status->natural_heal_prev_tick + NATURAL_HEAL_INTERVAL, status->natural_heal_timer, 0, 0, NATURAL_HEAL_INTERVAL);
return 0;
}
-void do_final_status(void) {
+
+void do_final_status(void)
+{
ers_destroy(status->data_ers);
}
@@ -13043,7 +13407,8 @@ void do_final_status(void) {
* Generated by HerculesInterfaceMaker
* created by Susu
*-------------------------------------*/
-void status_defaults(void) {
+void status_defaults(void)
+{
status = &status_s;
status->dbs = &statusdbs;
@@ -13189,4 +13554,10 @@ void status_defaults(void) {
status->readdb_scconfig = status_readdb_scconfig;
status->read_job_db = status_read_job_db;
status->read_job_db_sub = status_read_job_db_sub;
+ status->set_sc = status_set_sc;
+ status->copy = status_copy;
+#ifndef RENEWAL
+ status->base_matk_min = status_base_matk_min;
+#endif // RENEWAL
+ status->base_matk_max = status_base_matk_max;
}
diff --git a/src/map/status.h b/src/map/status.h
index be6d4c209..de21fa16c 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -21,11 +21,11 @@
#ifndef MAP_STATUS_H
#define MAP_STATUS_H
-#include "common/conf.h"
#include "common/hercules.h"
#include "common/mmo.h" // NEW_CARTS
struct block_list;
+struct config_setting_t;
struct elemental_data;
struct homun_data;
struct mercenary_data;
@@ -64,7 +64,9 @@ enum refine_type {
REFINE_TYPE_WEAPON2 = 2,
REFINE_TYPE_WEAPON3 = 3,
REFINE_TYPE_WEAPON4 = 4,
+#ifndef REFINE_TYPE_MAX
REFINE_TYPE_MAX = 5
+#endif
};
/**
@@ -72,14 +74,15 @@ enum refine_type {
* @see db/sc_config.txt for more information
**/
typedef enum sc_conf_type {
- SC_NO_REM_DEATH = 0x01,
- SC_NO_SAVE = 0x02,
- SC_NO_DISPELL = 0x04,
- SC_NO_CLEARANCE = 0x08,
- SC_BUFF = 0x10,
- SC_DEBUFF = 0x20,
- SC_MADO_NO_RESET = 0x40,
- SC_NO_CLEAR = 0x80,
+ SC_NO_REM_DEATH = 0x001,
+ SC_NO_SAVE = 0x002,
+ SC_NO_DISPELL = 0x004,
+ SC_NO_CLEARANCE = 0x008,
+ SC_BUFF = 0x010,
+ SC_DEBUFF = 0x020,
+ SC_MADO_NO_RESET = 0x040,
+ SC_NO_CLEAR = 0x080,
+ SC_VISIBLE = 0x100
} sc_conf_type;
/**
@@ -826,7 +829,22 @@ typedef enum sc_type {
SC_G_LIFEPOTION, // 640
SC_MYSTICPOWDER,
+ // Summoner
+ SC_SUHIDE,
+ SC_SU_STOOP,
+ SC_SPRITEMABLE,
+ SC_CATNIPPOWDER,
+ SC_SV_ROOTTWIST,
+ SC_BITESCAR,
+ SC_ARCLOUSEDASH,
+ SC_TUNAPARTY,
+ SC_SHRIMP, // 650
+ SC_FRESHSHRIMP,
+
+ SC_DRESS_UP,
+#ifndef SC_MAX
SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
+#endif
} sc_type;
/// Official status change ids, used to display status icons in the client.
@@ -1706,7 +1724,7 @@ enum si_type {
//SI_SUMMEREVENT04 = 853,
//SI_SUMMEREVENT05 = 854,
//SI_MINIGAME_ROULETTE_BONUS_ITEM = 855,
- //SI_DRESS_UP = 856,
+ SI_DRESS_UP = 856,
SI_MAPLE_FALLS = 857,
//SI_ALL_NIFLHEIM_RECALL = 858,
//SI_ = 859,
@@ -1743,10 +1761,10 @@ enum si_type {
//SI_HEALTHSTATE_HEAVYPOISON = 890,
//SI_HEALTHSTATE_FEAR = 891,
//SI_CHERRY_BLOSSOM_CAKE = 892,
- //SI_SU_STOOP = 893,
- //SI_CATNIPPOWDER = 894,
+ SI_SU_STOOP = 893,
+ SI_CATNIPPOWDER = 894,
SI_BLOSSOM_FLUTTERING = 895,
- //SI_SV_ROOTTWIST = 896,
+ SI_SV_ROOTTWIST = 896,
//SI_ATTACK_PROPERTY_NOTHING = 897,
//SI_ATTACK_PROPERTY_WATER = 898,
//SI_ATTACK_PROPERTY_GROUND = 899,
@@ -1768,11 +1786,11 @@ enum si_type {
//SI_RESIST_PROPERTY_DARKNESS = 914,
//SI_RESIST_PROPERTY_TELEKINESIS = 915,
//SI_RESIST_PROPERTY_UNDEAD = 916,
- //SI_BITESCAR = 917,
- //SI_ARCLOUSEDASH = 918,
- //SI_TUNAPARTY = 919,
- //SI_SHRIMP = 920,
- //SI_FRESHSHRIMP = 921,
+ SI_BITESCAR = 917,
+ SI_ARCLOUSEDASH = 918,
+ SI_TUNAPARTY = 919,
+ SI_SHRIMP = 920,
+ SI_FRESHSHRIMP = 921,
//SI_PERIOD_RECEIVEITEM = 922,
//SI_PERIOD_PLUSEXP = 923,
//SI_PERIOD_PLUSJOBEXP = 924,
@@ -1784,14 +1802,83 @@ enum si_type {
//SI_HELM_ISIA = 930,
//SI_HELM_ASIR = 931,
//SI_HELM_URJ = 932,
- //SI_SUHIDE = 933,
+ SI_SUHIDE = 933,
//SI_ = 934,
//SI_DORAM_BUF_01 = 935,
//SI_DORAM_BUF_02 = 936,
- //SI_SPRITEMABLE = 937,
-
+ SI_SPRITEMABLE = 937,
+ //SI_AID_PERIOD_RECEIVEITEM = 938,
+ //SI_AID_PERIOD_PLUSEXP = 939,
+ //SI_AID_PERIOD_PLUSJOBEXP = 940,
+ //SI_AID_PERIOD_DEADPENALTY = 941,
+ //SI_AID_PERIOD_ADDSTOREITEMCOUNT = 942,
+ //SI_ = 943,
+ //SI_ = 944,
+ //SI_ = 945,
+ //SI_ = 946,
+ //SI_ = 947,
+ //SI_ = 948,
+ //SI_ = 949,
+ //SI_HISS = 950,
+ //SI_ = 951,
+ //SI_NYANGGRASS = 952,
+ //SI_CHATTERING = 953,
+ //SI_ = 954,
+ //SI_ = 955,
+ //SI_ = 956,
+ //SI_ = 957,
+ //SI_ = 958,
+ //SI_ = 959,
+ //SI_ = 960,
+ //SI_GROOMING = 961,
+ //SI_PROTECTIONOFSHRIMP = 962,
+ //SI_EP16_2_BUFF_SS = 963,
+ //SI_EP16_2_BUFF_SC = 964,
+ //SI_EP16_2_BUFF_AC = 965,
+ //SI_GS_MAGICAL_BULLET = 966,
+ //SI_ = 967,
+ //SI_ = 968,
+ //SI_ = 969,
+ //SI_ = 970,
+ //SI_ = 971,
+ //SI_ = 972,
+ //SI_ = 973,
+ //SI_ = 974,
+ //SI_ = 975,
+ //SI_FALLEN_ANGEL = 976,
+ //SI_ = 977,
+ //SI_ = 978,
+ //SI_BLAZE_BEAD = 979,
+ //SI_FROZEN_BEAD = 980,
+ //SI_BREEZE_BEAD = 981,
+ //SI_ = 982,
+ //SI_AID_PERIOD_RECEIVEITEM_2ND = 983,
+ //SI_AID_PERIOD_PLUSEXP_2ND = 984,
+ //SI_AID_PERIOD_PLUSJOBEXP_2ND = 985,
+ //SI_PRONTERA_JP = 986,
+ //SI_ = 987,
+ //SI_GLOOM_CARD = 988,
+ //SI_PHARAOH_CARD = 989,
+ //SI_KIEL_CARD = 990,
+ //SI_ = 991,
+ //SI_CHEERUP = 992,
+ //SI_ = 993,
+ //SI_ = 994,
+ //SI_S_MANAPOTION = 995,
+ //SI_M_DEFSCROLL = 996,
+ //SI_ = 997,
+ //SI_ = 998,
+ //SI_ = 999,
+ //SI_AS_RAGGED_GOLEM_CARD = 1000,
+ //SI_LHZ_DUN_N1 = 1001,
+ //SI_LHZ_DUN_N2 = 1002,
+ //SI_LHZ_DUN_N3 = 1003,
+ //SI_LHZ_DUN_N4 = 1004,
+#ifndef SI_MAX
SI_MAX,
+#endif
};
+
// JOINTBEAT stackable ailments
enum e_joint_break
{
@@ -1804,26 +1891,33 @@ enum e_joint_break
BREAK_FLAGS = BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK,
};
-
-//Mode definitions to clear up code reading. [Skotlex]
+/**
+ * Mob mode definitions. [Skotlex]
+ *
+ * @see doc/mob_db_mode_list.txt for a description of each mode.
+ */
enum e_mode
{
- MD_CANMOVE = 0x0001,
- MD_LOOTER = 0x0002,
- MD_AGGRESSIVE = 0x0004,
- MD_ASSIST = 0x0008,
- MD_CASTSENSOR_IDLE = 0x0010,
- MD_BOSS = 0x0020,
- MD_PLANT = 0x0040,
- MD_CANATTACK = 0x0080,
- MD_DETECTOR = 0x0100,
- MD_CASTSENSOR_CHASE = 0x0200,
- MD_CHANGECHASE = 0x0400,
- MD_ANGRY = 0x0800,
- MD_CHANGETARGET_MELEE = 0x1000,
- MD_CHANGETARGET_CHASE = 0x2000,
- MD_TARGETWEAK = 0x4000,
- MD_MASK = 0xFFFF,
+ MD_NONE = 0x00000000,
+ MD_CANMOVE = 0x00000001,
+ MD_LOOTER = 0x00000002,
+ MD_AGGRESSIVE = 0x00000004,
+ MD_ASSIST = 0x00000008,
+ MD_CASTSENSOR_IDLE = 0x00000010,
+ MD_BOSS = 0x00000020,
+ MD_PLANT = 0x00000040,
+ MD_CANATTACK = 0x00000080,
+ MD_DETECTOR = 0x00000100,
+ MD_CASTSENSOR_CHASE = 0x00000200,
+ MD_CHANGECHASE = 0x00000400,
+ MD_ANGRY = 0x00000800,
+ MD_CHANGETARGET_MELEE = 0x00001000,
+ MD_CHANGETARGET_CHASE = 0x00002000,
+ MD_TARGETWEAK = 0x00004000,
+ MD_NOKNOCKBACK = 0x00008000,
+ //MD_RANDOMTARGET = 0x00010000, // Not implemented
+ // Note: This should be kept within INT_MAX, since it's often cast to int.
+ MD_MASK = 0x7FFFFFFF,
};
//Status change option definitions (options are what makes status changes visible to chars
@@ -1975,8 +2069,8 @@ struct status_data {
batk,
matk_min, matk_max,
speed,
- amotion, adelay, dmotion,
- mode;
+ amotion, adelay, dmotion;
+ uint32 mode;
short
hit, flee, cri, flee2,
def2, mdef2,
@@ -2139,9 +2233,17 @@ struct status_change {
#define status_calc_elemental(ed, opt) (status->calc_bl_(&(ed)->bl, SCB_ALL, (opt)))
#define status_calc_npc(nd, opt) (status->calc_bl_(&(nd)->bl, SCB_ALL, (opt)))
+enum refine_chance_type {
+ REFINE_CHANCE_TYPE_NORMAL = 0, // Normal Chance
+ REFINE_CHANCE_TYPE_ENRICHED = 1, // Enriched Ore Chance
+ REFINE_CHANCE_TYPE_E_NORMAL = 2, // Event Normal Ore Chance
+ REFINE_CHANCE_TYPE_E_ENRICHED = 3, // Event Enriched Ore Chance
+ REFINE_CHANCE_TYPE_MAX
+};
+
// bonus values and upgrade chances for refining equipment
struct s_refine_info {
- int chance[MAX_REFINE]; // success chance
+ int chance[REFINE_CHANCE_TYPE_MAX][MAX_REFINE]; // success chance
int bonus[MAX_REFINE]; // cumulative fixed bonus damage
int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage
};
@@ -2151,7 +2253,7 @@ BEGIN_ZEROED_BLOCK; /* Everything within this block will be memset to 0 when sta
int max_weight_base[CLASS_COUNT];
int HP_table[CLASS_COUNT][MAX_LEVEL + 1];
int SP_table[CLASS_COUNT][MAX_LEVEL + 1];
- int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD
+ int aspd_base[CLASS_COUNT][MAX_SINGLE_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD
sc_type Skill2SCTable[MAX_SKILL]; // skill -> status
int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated)
unsigned int ChangeFlagTable[SC_MAX]; // status -> flags
@@ -2161,7 +2263,7 @@ BEGIN_ZEROED_BLOCK; /* Everything within this block will be memset to 0 when sta
/* */
struct s_refine_info refine_info[REFINE_TYPE_MAX];
/* */
- int atkmods[3][MAX_WEAPON_TYPE];//ATK weapon modification for size (size_fix.txt)
+ int atkmods[3][MAX_SINGLE_WEAPON_TYPE];//ATK weapon modification for size (size_fix.txt)
char job_bonus[CLASS_COUNT][MAX_LEVEL];
sc_conf_type sc_conf[SC_MAX];
END_ZEROED_BLOCK; /* End */
@@ -2177,6 +2279,7 @@ struct status_interface {
/* vars */
int current_equip_item_index;
int current_equip_card_id;
+ int current_equip_option_index;
struct s_status_dbs *dbs;
@@ -2188,7 +2291,7 @@ struct status_interface {
int (*init) (bool minimal);
void (*final) (void);
/* funcs */
- int (*get_refine_chance) (enum refine_type wlv, int refine);
+ int (*get_refine_chance) (enum refine_type wlv, int refine, enum refine_chance_type type);
// for looking up associated data
sc_type (*skill2sc) (int skill_id);
int (*sc2skill) (sc_type sc);
@@ -2208,17 +2311,17 @@ struct status_interface {
struct regen_data * (*get_regen_data) (struct block_list *bl);
struct status_data * (*get_status_data) (struct block_list *bl);
struct status_data * (*get_base_status) (struct block_list *bl);
- const char * (*get_name) (struct block_list *bl);
- int (*get_class) (struct block_list *bl);
- int (*get_lv) (struct block_list *bl);
+ const char *(*get_name) (const struct block_list *bl);
+ int (*get_class) (const struct block_list *bl);
+ int (*get_lv) (const struct block_list *bl);
defType (*get_def) (struct block_list *bl);
unsigned short (*get_speed) (struct block_list *bl);
unsigned char (*calc_attack_element) (struct block_list *bl, struct status_change *sc, int element);
- int (*get_party_id) (struct block_list *bl);
- int (*get_guild_id) (struct block_list *bl);
- int (*get_emblem_id) (struct block_list *bl);
- int (*get_mexp) (struct block_list *bl);
- int (*get_race2) (struct block_list *bl);
+ int (*get_party_id) (const struct block_list *bl);
+ int (*get_guild_id) (const struct block_list *bl);
+ int (*get_emblem_id) (const struct block_list *bl);
+ int (*get_mexp) (const struct block_list *bl);
+ int (*get_race2) (const struct block_list *bl);
struct view_data * (*get_viewdata) (struct block_list *bl);
void (*set_viewdata) (struct block_list *bl, int class_);
void (*change_init) (struct block_list *bl);
@@ -2264,8 +2367,8 @@ struct status_interface {
void (*initDummyData) (void);
int (*base_amotion_pc) (struct map_session_data *sd, struct status_data *st);
unsigned short (*base_atk) (const struct block_list *bl, const struct status_data *st);
- unsigned int (*get_base_maxhp) (struct map_session_data *sd, struct status_data *st);
- unsigned int (*get_base_maxsp) (struct map_session_data *sd, struct status_data *st);
+ unsigned int (*get_base_maxhp) (const struct map_session_data *sd, const struct status_data *st);
+ unsigned int (*get_base_maxsp) (const struct map_session_data *sd, const struct status_data *st);
int (*calc_npc_) (struct npc_data *nd, enum e_status_calc_opt opt);
unsigned short (*calc_str) (struct block_list *bl, struct status_change *sc, int str);
unsigned short (*calc_agi) (struct block_list *bl, struct status_change *sc, int agi);
@@ -2288,7 +2391,7 @@ struct status_interface {
unsigned int (*calc_maxsp) (struct block_list *bl, struct status_change *sc, unsigned int maxsp);
unsigned char (*calc_element) (struct block_list *bl, struct status_change *sc, int element);
unsigned char (*calc_element_lv) (struct block_list *bl, struct status_change *sc, int lv);
- unsigned short (*calc_mode) (struct block_list *bl, struct status_change *sc, int mode);
+ uint32 (*calc_mode) (const struct block_list *bl, const struct status_change *sc, uint32 mode);
unsigned short (*calc_ematk) (struct block_list *bl, struct status_change *sc, int matk);
void (*calc_bl_main) (struct block_list *bl, int flag);
void (*display_add) (struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3);
@@ -2298,10 +2401,14 @@ struct status_interface {
bool (*readdb_job2) (char *fields[], int columns, int current);
bool (*readdb_sizefix) (char *fields[], int columns, int current);
int (*readdb_refine_libconfig) (const char *filename);
- int (*readdb_refine_libconfig_sub) (config_setting_t *r, const char *name, const char *source);
+ int (*readdb_refine_libconfig_sub) (struct config_setting_t *r, const char *name, const char *source);
bool (*readdb_scconfig) (char *fields[], int columns, int current);
void (*read_job_db) (void);
- void (*read_job_db_sub) (int idx, const char *name, config_setting_t *jdb);
+ void (*read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb);
+ void (*set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag);
+ void (*copy) (struct status_data *a, const struct status_data *b);
+ unsigned short (*base_matk_min) (const struct status_data *st);
+ unsigned short (*base_matk_max) (const struct status_data *st);
};
#ifdef HERCULES_CORE
diff --git a/src/map/storage.c b/src/map/storage.c
index f938a41ad..01e7c7c27 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -52,8 +52,8 @@ struct guild_storage_interface *gstorage;
*------------------------------------------*/
int storage_comp_item(const void *i1_, const void *i2_)
{
- struct item *i1 = (struct item *)i1_;
- struct item *i2 = (struct item *)i2_;
+ const struct item *i1 = i1_;
+ const struct item *i2 = i2_;
if (i1->nameid == i2->nameid)
return 0;
@@ -79,9 +79,10 @@ void storage_sortitem(struct item* items, unsigned int size)
* Parses storage and saves 'dirty' ones upon reconnect. [Skotlex]
* @see DBApply
*/
-int storage_reconnect_sub(DBKey key, DBData *data, va_list ap)
+int storage_reconnect_sub(union DBKey key, struct DBData *data, va_list ap)
{
struct guild_storage *stor = DB->data2ptr(data);
+ nullpo_ret(stor);
if (stor->dirty && stor->storage_status == 0) //Save closed storages.
gstorage->save(0, stor->guild_id,0);
@@ -89,7 +90,8 @@ int storage_reconnect_sub(DBKey key, DBData *data, va_list ap)
}
//Function to be invoked upon server reconnection to char. To save all 'dirty' storages [Skotlex]
-void do_reconnect_storage(void) {
+void do_reconnect_storage(void)
+{
gstorage->db->foreach(gstorage->db, storage->reconnect_sub);
}
@@ -105,16 +107,25 @@ int storage_storageopen(struct map_session_data *sd)
if (sd->state.storage_flag != STORAGE_FLAG_CLOSED)
return 1; //Already open?
+ if (sd->storage.received == false) {
+ clif->message(sd->fd, msg_sd(sd, 27)); // Storage has not been loaded yet.
+ return 1;
+ }
+
if( !pc_can_give_items(sd) ) {
//check is this GM level is allowed to put items to storage
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
return 1;
}
sd->state.storage_flag = STORAGE_FLAG_NORMAL;
- storage->sortitem(sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
- clif->storagelist(sd, sd->status.storage.items, ARRAYLENGTH(sd->status.storage.items));
- clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
+
+ if (sd->storage.aggregate > 0) {
+ storage->sortitem(VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item));
+ clif->storagelist(sd, VECTOR_DATA(sd->storage.item), VECTOR_LENGTH(sd->storage.item));
+ }
+
+ clif->updatestorageamount(sd, sd->storage.aggregate, MAX_STORAGE);
return 0;
}
@@ -131,9 +142,12 @@ int compare_item(struct item *a, struct item *b)
a->bound == b->bound &&
a->unique_id == b->unique_id)
{
- int i;
- for (i = 0; i < MAX_SLOTS && (a->card[i] == b->card[i]); i++);
- return (i == MAX_SLOTS);
+ int i = 0, k = 0;
+ ARR_FIND(0, MAX_SLOTS, i, a->card[i] != b->card[i]);
+ ARR_FIND(0, MAX_ITEM_OPTIONS, k, a->option[k].index != b->option[k].index || a->option[k].value != b->option[k].value);
+
+ if (i == MAX_SLOTS && k == MAX_ITEM_OPTIONS)
+ return 1;
}
return 0;
}
@@ -141,59 +155,82 @@ int compare_item(struct item *a, struct item *b)
/*==========================================
* Internal add-item function.
*------------------------------------------*/
-int storage_additem(struct map_session_data* sd, struct item* item_data, int amount) {
- struct storage_data* stor = &sd->status.storage;
- struct item_data *data;
+int storage_additem(struct map_session_data* sd, struct item* item_data, int amount)
+{
+ struct item_data *data = NULL;
+ struct item *it = NULL;
int i;
- if( item_data->nameid <= 0 || amount <= 0 )
- return 1;
+ nullpo_retr(1, sd);
+ Assert_retr(1, sd->storage.received == true);
+
+ nullpo_retr(1, item_data);
+ Assert_retr(1, item_data->nameid > 0);
+
+ Assert_retr(1, amount > 0);
data = itemdb->search(item_data->nameid);
- if( data->stack.storage && amount > data->stack.amount )
- {// item stack limitation
+ if (data->stack.storage && amount > data->stack.amount) // item stack limitation
return 1;
- }
if (!itemdb_canstore(item_data, pc_get_group_level(sd))) {
//Check if item is storable. [Skotlex]
- clif->message (sd->fd, msg_sd(sd,264));
+ clif->message (sd->fd, msg_sd(sd, 264)); // This item cannot be stored.
return 1;
}
- if( item_data->bound > IBT_ACCOUNT && !pc_can_give_bound_items(sd) ) {
- clif->message(sd->fd, msg_sd(sd,294));
+ if (item_data->bound > IBT_ACCOUNT && !pc_can_give_bound_items(sd)) {
+ clif->message(sd->fd, msg_sd(sd, 294)); // This bound item cannot be stored there.
return 1;
}
- if( itemdb->isstackable2(data) )
- {//Stackable
- for( i = 0; i < MAX_STORAGE; i++ )
- {
- if( compare_item(&stor->items[i], item_data) )
- {// existing items found, stack them
- if( amount > MAX_AMOUNT - stor->items[i].amount || ( data->stack.storage && amount > data->stack.amount - stor->items[i].amount ) )
+ if (itemdb->isstackable2(data)) {//Stackable
+ for (i = 0; i < VECTOR_LENGTH(sd->storage.item); i++) {
+ it = &VECTOR_INDEX(sd->storage.item, i);
+
+ if (it->nameid == 0)
+ continue;
+
+ if (compare_item(it, item_data)) { // existing items found, stack them
+ if (amount > MAX_AMOUNT - it->amount || (data->stack.storage && amount > data->stack.amount - it->amount))
return 1;
- stor->items[i].amount += amount;
- clif->storageitemadded(sd,&stor->items[i],i,amount);
+ it->amount += amount;
+
+ clif->storageitemadded(sd, it, i, amount);
+
+ sd->storage.save = true; // set a save flag.
+
return 0;
}
}
}
- // find free slot
- ARR_FIND( 0, MAX_STORAGE, i, stor->items[i].nameid == 0 );
- if( i >= MAX_STORAGE )
+ // Check if storage exceeds limit.
+ if (sd->storage.aggregate >= MAX_STORAGE)
return 1;
- // add item to slot
- memcpy(&stor->items[i],item_data,sizeof(stor->items[0]));
- stor->storage_amount++;
- stor->items[i].amount = amount;
- clif->storageitemadded(sd,&stor->items[i],i,amount);
- clif->updatestorageamount(sd, stor->storage_amount, MAX_STORAGE);
+ ARR_FIND(0, VECTOR_LENGTH(sd->storage.item), i, VECTOR_INDEX(sd->storage.item, i).nameid == 0);
+
+ if (i == VECTOR_LENGTH(sd->storage.item)) {
+ VECTOR_ENSURE(sd->storage.item, 1, 1);
+ VECTOR_PUSH(sd->storage.item, *item_data);
+ it = &VECTOR_LAST(sd->storage.item);
+ } else {
+ it = &VECTOR_INDEX(sd->storage.item, i);
+ *it = *item_data;
+ }
+
+ it->amount = amount;
+
+ sd->storage.aggregate++;
+
+ clif->storageitemadded(sd, it, i, amount);
+
+ clif->updatestorageamount(sd, sd->storage.aggregate, MAX_STORAGE);
+
+ sd->storage.save = true; // set a save flag.
return 0;
}
@@ -203,19 +240,32 @@ int storage_additem(struct map_session_data* sd, struct item* item_data, int amo
*------------------------------------------*/
int storage_delitem(struct map_session_data* sd, int n, int amount)
{
- if( sd->status.storage.items[n].nameid == 0 || sd->status.storage.items[n].amount < amount )
- return 1;
+ struct item *it = NULL;
- sd->status.storage.items[n].amount -= amount;
- if( sd->status.storage.items[n].amount == 0 )
- {
- memset(&sd->status.storage.items[n],0,sizeof(sd->status.storage.items[0]));
- sd->status.storage.storage_amount--;
- if( sd->state.storage_flag == STORAGE_FLAG_NORMAL )
- clif->updatestorageamount(sd, sd->status.storage.storage_amount, MAX_STORAGE);
+ nullpo_retr(1, sd);
+
+ Assert_retr(1, sd->storage.received == true);
+
+ Assert_retr(1, n >= 0 && n < VECTOR_LENGTH(sd->storage.item));
+
+ it = &VECTOR_INDEX(sd->storage.item, n);
+
+ Assert_retr(1, amount <= it->amount);
+
+ Assert_retr(1, it->nameid > 0);
+
+ it->amount -= amount;
+
+ if (it->amount == 0) {
+ memset(it, 0, sizeof(struct item));
+ clif->updatestorageamount(sd, --sd->storage.aggregate, MAX_STORAGE);
}
- if( sd->state.storage_flag == STORAGE_FLAG_NORMAL )
- clif->storageitemremoved(sd,n,amount);
+
+ sd->storage.save = true;
+
+ if (sd->state.storage_flag == STORAGE_FLAG_NORMAL)
+ clif->storageitemremoved(sd, n, amount);
+
return 0;
}
@@ -226,22 +276,25 @@ int storage_delitem(struct map_session_data* sd, int n, int amount)
* 0 : fail
* 1 : success
*------------------------------------------*/
-int storage_storageadd(struct map_session_data* sd, int index, int amount) {
+int storage_add_from_inventory(struct map_session_data* sd, int index, int amount)
+{
nullpo_ret(sd);
- if( sd->status.storage.storage_amount > MAX_STORAGE )
+ Assert_ret(sd->storage.received == true);
+
+ if (sd->storage.aggregate > MAX_STORAGE)
return 0; // storage full
- if( index < 0 || index >= MAX_INVENTORY )
+ if (index < 0 || index >= MAX_INVENTORY)
return 0;
- if( sd->status.inventory[index].nameid <= 0 )
+ if (sd->status.inventory[index].nameid <= 0)
return 0; // No item on that spot
- if( amount < 1 || amount > sd->status.inventory[index].amount )
+ if (amount < 1 || amount > sd->status.inventory[index].amount)
return 0;
- if( storage->additem(sd,&sd->status.inventory[index],amount) == 0 )
+ if (storage->additem(sd, &sd->status.inventory[index], amount) == 0)
pc->delitem(sd, index, amount, 0, DELITEM_TOSTORAGE, LOG_TYPE_STORAGE);
else
clif->dropitem(sd, index, 0);
@@ -256,23 +309,30 @@ int storage_storageadd(struct map_session_data* sd, int index, int amount) {
* 0 : fail
* 1 : success
*------------------------------------------*/
-int storage_storageget(struct map_session_data* sd, int index, int amount)
+int storage_add_to_inventory(struct map_session_data* sd, int index, int amount)
{
int flag;
+ struct item *it = NULL;
+
+ nullpo_ret(sd);
+
+ Assert_ret(sd->storage.received == true);
- if( index < 0 || index >= MAX_STORAGE )
+ if (index < 0 || index >= VECTOR_LENGTH(sd->storage.item))
return 0;
- if( sd->status.storage.items[index].nameid <= 0 )
+ it = &VECTOR_INDEX(sd->storage.item, index);
+
+ if (it->nameid <= 0)
return 0; //Nothing there
- if( amount < 1 || amount > sd->status.storage.items[index].amount )
+ if (amount < 1 || amount > it->amount)
return 0;
- if( (flag = pc->additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
- storage->delitem(sd,index,amount);
+ if ((flag = pc->additem(sd, it, amount, LOG_TYPE_STORAGE)) == 0)
+ storage->delitem(sd, index, amount);
else
- clif->additem(sd,0,0,flag);
+ clif->additem(sd, 0, 0, flag);
return 1;
}
@@ -288,19 +348,21 @@ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amoun
{
nullpo_ret(sd);
- if( sd->status.storage.storage_amount > MAX_STORAGE )
+ Assert_ret(sd->storage.received == true);
+
+ if (sd->storage.aggregate > MAX_STORAGE)
return 0; // storage full / storage closed
- if( index < 0 || index >= MAX_CART )
+ if (index < 0 || index >= MAX_CART)
return 0;
if( sd->status.cart[index].nameid <= 0 )
return 0; //No item there.
- if( amount < 1 || amount > sd->status.cart[index].amount )
+ if (amount < 1 || amount > sd->status.cart[index].amount)
return 0;
- if( storage->additem(sd,&sd->status.cart[index],amount) == 0 )
+ if (storage->additem(sd,&sd->status.cart[index],amount) == 0)
pc->cart_delitem(sd,index,amount,0,LOG_TYPE_STORAGE);
return 1;
@@ -313,24 +375,31 @@ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amoun
* 0 : fail
* 1 : success
*------------------------------------------*/
-int storage_storagegettocart(struct map_session_data* sd, int index, int amount) {
+int storage_storagegettocart(struct map_session_data* sd, int index, int amount)
+{
int flag = 0;
+ struct item *it = NULL;
+
nullpo_ret(sd);
- if( index < 0 || index >= MAX_STORAGE )
+ Assert_ret(sd->storage.received == true);
+
+ if (index < 0 || index >= VECTOR_LENGTH(sd->storage.item))
return 0;
- if( sd->status.storage.items[index].nameid <= 0 )
+ it = &VECTOR_INDEX(sd->storage.item, index);
+
+ if (it->nameid <= 0)
return 0; //Nothing there.
- if( amount < 1 || amount > sd->status.storage.items[index].amount )
+ if (amount < 1 || amount > it->amount)
return 0;
- if( (flag = pc->cart_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
- storage->delitem(sd,index,amount);
+ if ((flag = pc->cart_additem(sd, it, amount, LOG_TYPE_STORAGE)) == 0)
+ storage->delitem(sd, index, amount);
else {
clif->dropitem(sd, index,0);
- clif->cart_additem_ack(sd,flag == 1?0x0:0x1);
+ clif->cart_additem_ack(sd, flag == 1?0x0:0x1);
}
return 1;
@@ -340,13 +409,28 @@ int storage_storagegettocart(struct map_session_data* sd, int index, int amount)
/*==========================================
* Modified By Valaris to save upon closing [massdriller]
*------------------------------------------*/
-void storage_storageclose(struct map_session_data* sd) {
+void storage_storageclose(struct map_session_data* sd)
+{
+ int i = 0;
+
nullpo_retv(sd);
+ Assert_retv(sd->storage.received == true);
+
clif->storageclose(sd);
- if( map->save_settings&4 )
- chrif->save(sd,0); //Invokes the storage saving as well.
+ if (map->save_settings & 4)
+ chrif->save(sd, 0); //Invokes the storage saving as well.
+
+ /* Erase deleted account storage items from memory
+ * and resize the vector. */
+ while (i < VECTOR_LENGTH(sd->storage.item)) {
+ if (VECTOR_INDEX(sd->storage.item, i).nameid == 0) {
+ VECTOR_ERASE(sd->storage.item, i);
+ } else {
+ i++;
+ }
+ }
sd->state.storage_flag = STORAGE_FLAG_CLOSED;
}
@@ -354,7 +438,8 @@ void storage_storageclose(struct map_session_data* sd) {
/*==========================================
* When quitting the game.
*------------------------------------------*/
-void storage_storage_quit(struct map_session_data* sd, int flag) {
+void storage_storage_quit(struct map_session_data* sd, int flag)
+{
nullpo_retv(sd);
if (map->save_settings&4)
@@ -366,7 +451,7 @@ void storage_storage_quit(struct map_session_data* sd, int flag) {
/**
* @see DBCreateData
*/
-DBData create_guildstorage(DBKey key, va_list args)
+struct DBData create_guildstorage(union DBKey key, va_list args)
{
struct guild_storage *gs = NULL;
gs = (struct guild_storage *) aCalloc(sizeof(struct guild_storage), 1);
@@ -382,7 +467,8 @@ struct guild_storage *guild2storage_ensure(int guild_id)
return gs;
}
-int guild_storage_delete(int guild_id) {
+int guild_storage_delete(int guild_id)
+{
idb_remove(gstorage->db,guild_id);
return 0;
}
@@ -407,7 +493,7 @@ int storage_guild_storageopen(struct map_session_data* sd)
return 1; //Can't open both storages at a time.
if( !pc_can_give_items(sd) ) { //check is this GM level can open guild storage and store items [Lupus]
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
return 1;
}
@@ -456,12 +542,12 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
if (!itemdb_canguildstore(item_data, pc_get_group_level(sd)) || item_data->expire_time) {
//Check if item is storable. [Skotlex]
- clif->message (sd->fd, msg_sd(sd,264));
+ clif->message (sd->fd, msg_sd(sd,264)); // This item cannot be stored.
return 1;
}
if( item_data->bound && item_data->bound != IBT_GUILD && !pc_can_give_bound_items(sd) ) {
- clif->message(sd->fd, msg_sd(sd,294));
+ clif->message(sd->fd, msg_sd(sd,294)); // This bound item cannot be stored there.
return 1;
}
@@ -503,6 +589,7 @@ int guild_storage_delitem(struct map_session_data* sd, struct guild_storage* sto
nullpo_retr(1, sd);
nullpo_retr(1, stor);
+ Assert_retr(1, n >= 0 && n < MAX_GUILD_STORAGE);
if(stor->items[n].nameid==0 || stor->items[n].amount<amount)
return 1;
@@ -703,7 +790,8 @@ int storage_guild_storagesaved(int guild_id)
}
//Close storage for sd and save it
-int storage_guild_storageclose(struct map_session_data* sd) {
+int storage_guild_storageclose(struct map_session_data* sd)
+{
struct guild_storage *stor;
nullpo_ret(sd);
@@ -722,7 +810,8 @@ int storage_guild_storageclose(struct map_session_data* sd) {
return 0;
}
-int storage_guild_storage_quit(struct map_session_data* sd, int flag) {
+int storage_guild_storage_quit(struct map_session_data* sd, int flag)
+{
struct guild_storage *stor;
nullpo_ret(sd);
@@ -749,15 +838,21 @@ int storage_guild_storage_quit(struct map_session_data* sd, int flag) {
return 0;
}
-void do_init_gstorage(bool minimal) {
+
+void do_init_gstorage(bool minimal)
+{
if (minimal)
return;
gstorage->db = idb_alloc(DB_OPT_RELEASE_DATA);
}
-void do_final_gstorage(void) {
+
+void do_final_gstorage(void)
+{
db_destroy(gstorage->db);
}
-void storage_defaults(void) {
+
+void storage_defaults(void)
+{
storage = &storage_s;
/* */
@@ -765,8 +860,8 @@ void storage_defaults(void) {
/* */
storage->delitem = storage_delitem;
storage->open = storage_storageopen;
- storage->add = storage_storageadd;
- storage->get = storage_storageget;
+ storage->add = storage_add_from_inventory;
+ storage->get = storage_add_to_inventory;
storage->additem = storage_additem;
storage->addfromcart = storage_storageaddfromcart;
storage->gettocart = storage_storagegettocart;
@@ -776,7 +871,9 @@ void storage_defaults(void) {
storage->sortitem = storage_sortitem;
storage->reconnect_sub = storage_reconnect_sub;
}
-void gstorage_defaults(void) {
+
+void gstorage_defaults(void)
+{
gstorage = &gstorage_s;
/* */
diff --git a/src/map/storage.h b/src/map/storage.h
index bddd03770..509862db7 100644
--- a/src/map/storage.h
+++ b/src/map/storage.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -52,11 +52,11 @@ struct storage_interface {
void (*pc_quit) (struct map_session_data *sd, int flag);
int (*comp_item) (const void *i1_, const void *i2_);
void (*sortitem) (struct item* items, unsigned int size);
- int (*reconnect_sub) (DBKey key, DBData *data, va_list ap);
+ int (*reconnect_sub) (union DBKey key, struct DBData *data, va_list ap);
};
struct guild_storage_interface {
- struct DBMap* db; // int guild_id -> struct guild_storage*
+ struct DBMap *db; // int guild_id -> struct guild_storage*
/* */
struct guild_storage *(*ensure) (int guild_id);
/* */
@@ -75,7 +75,7 @@ struct guild_storage_interface {
int (*pc_quit) (struct map_session_data *sd,int flag);
int (*save) (int account_id, int guild_id, int flag);
int (*saved) (int guild_id); //Ack from char server that guild store was saved.
- DBData (*create) (DBKey key, va_list args);
+ struct DBData (*create) (union DBKey key, va_list args);
};
#ifdef HERCULES_CORE
diff --git a/src/map/trade.c b/src/map/trade.c
index 6352c3a4d..252dff709 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -51,8 +51,8 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
nullpo_retv(sd);
if (map->list[sd->bl.m].flag.notrade) {
- clif->message (sd->fd, msg_sd(sd,272));
- return; //Can't trade in notrade mapflag maps.
+ clif->message (sd->fd, msg_sd(sd,272)); // You can't trade in this map
+ return;
}
if (target_sd == NULL || sd == target_sd) {
@@ -90,7 +90,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
if (!pc_can_give_items(sd) || !pc_can_give_items(target_sd)) //check if both GMs are allowed to trade
{
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
clif->tradestart(sd, 2); // GM is not allowed to trade
return;
}
@@ -118,7 +118,8 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
* Weird enough, the client should only send 3/4
* and the server is the one that can reply 0~2
*------------------------------------------*/
-void trade_tradeack(struct map_session_data *sd, int type) {
+void trade_tradeack(struct map_session_data *sd, int type)
+{
struct map_session_data *tsd;
nullpo_retv(sd);
@@ -217,6 +218,8 @@ int impossible_trade_check(struct map_session_data *sd)
if (!sd->deal.item[i].amount)
continue;
index = sd->deal.item[i].index;
+ if (index < 0 || index >= MAX_INVENTORY)
+ return 1;
if (inventory[index].amount < sd->deal.item[i].amount) {
// if more than the player have -> hack
snprintf(message_to_gm, sizeof(message_to_gm), msg_txt(538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has.
@@ -257,6 +260,8 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd)
struct item_data *data;
int trade_i, i, n;
+ nullpo_ret(sd);
+ nullpo_ret(tsd);
// check zenys value against hackers (Zeny was already checked on time of adding, but you never know when you lost some zeny since then.
if(sd->deal.zeny > sd->status.zeny || (tsd->status.zeny > MAX_ZENY - sd->deal.zeny))
return 0;
@@ -303,6 +308,8 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd)
if (!amount)
continue;
n = tsd->deal.item[trade_i].index;
+ if (n < 0 || n >= MAX_INVENTORY)
+ return 0;
if (amount > inventory2[n].amount)
return 0;
// search if it's possible to add item (for full inventory)
@@ -336,7 +343,8 @@ int trade_check(struct map_session_data *sd, struct map_session_data *tsd)
/*==========================================
* Adds an item/qty to the trade window
*------------------------------------------*/
-void trade_tradeadditem(struct map_session_data *sd, short index, short amount) {
+void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
+{
struct map_session_data *target_sd;
struct item *item;
int trade_i, trade_weight;
@@ -372,14 +380,14 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
if( !itemdb_cantrade(item, src_lv, dst_lv) && //Can't trade
(pc->get_partner(sd) != target_sd || !itemdb_canpartnertrade(item, src_lv, dst_lv)) ) //Can't partner-trade
{
- clif->message (sd->fd, msg_sd(sd,260));
+ clif->message (sd->fd, msg_sd(sd,260)); // This item cannot be traded.
clif->tradeitemok(sd, index+2, TIO_INDROCKS);
return;
}
if( item->expire_time )
{ // Rental System
- clif->message (sd->fd, msg_sd(sd,260));
+ clif->message (sd->fd, msg_sd(sd,260)); // This item cannot be traded.
clif->tradeitemok(sd, index+2, TIO_INDROCKS);
return;
}
@@ -388,7 +396,7 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
!( item->bound == IBT_GUILD && sd->status.guild_id == target_sd->status.guild_id ) &&
!( item->bound == IBT_PARTY && sd->status.party_id == target_sd->status.party_id )
&& !pc_can_give_bound_items(sd) ) {
- clif->message(sd->fd, msg_sd(sd,293));
+ clif->message(sd->fd, msg_sd(sd,293)); // This bound item cannot be traded to that character.
clif->tradeitemok(sd, index+2, TIO_INDROCKS);
return;
}
@@ -456,9 +464,11 @@ void trade_tradeaddzeny(struct map_session_data* sd, int amount)
/*==========================================
* 'Ok' button on the trade window is pressed.
*------------------------------------------*/
-void trade_tradeok(struct map_session_data *sd) {
+void trade_tradeok(struct map_session_data *sd)
+{
struct map_session_data *target_sd;
+ nullpo_retv(sd);
if(sd->state.deal_locked || !sd->state.trading)
return;
@@ -475,10 +485,12 @@ void trade_tradeok(struct map_session_data *sd) {
/*==========================================
* 'Cancel' is pressed. (or trade was force-canceled by the code)
*------------------------------------------*/
-void trade_tradecancel(struct map_session_data *sd) {
+void trade_tradecancel(struct map_session_data *sd)
+{
struct map_session_data *target_sd;
int trade_i;
+ nullpo_retv(sd);
target_sd = map->id2sd(sd->trade_partner);
if(!sd->state.trading)
@@ -533,11 +545,13 @@ void trade_tradecancel(struct map_session_data *sd) {
/*==========================================
* lock sd and tsd trade data, execute the trade, clear, then save players
*------------------------------------------*/
-void trade_tradecommit(struct map_session_data *sd) {
+void trade_tradecommit(struct map_session_data *sd)
+{
struct map_session_data *tsd;
int trade_i;
int flag;
+ nullpo_retv(sd);
if (!sd->state.trading || !sd->state.deal_locked) //Locked should be 1 (pressed ok) before you can press trade.
return;
diff --git a/src/map/trade.h b/src/map/trade.h
index eba91a1d9..55ff31ed2 100644
--- a/src/map/trade.h
+++ b/src/map/trade.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
diff --git a/src/map/unit.c b/src/map/unit.c
index bea0913d2..00c78054b 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -235,8 +235,8 @@ int unit_step_timer(int tid, int64 tick, int id, intptr_t data)
return 1;
}
-
-int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
+int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
+{
int i;
int x,y,dx,dy;
unsigned char icewall_walk_block;
@@ -487,7 +487,8 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
return 0;
}
-int unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
+int unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
+{
struct block_list *bl = map->id2bl(id);
if (!bl || bl->prev == NULL)
@@ -570,7 +571,8 @@ static inline void set_mobstate(struct block_list* bl, int flag)
md->state.skillstate = md->state.aggressive ? MSS_FOLLOW : MSS_RUSH;
}
-int unit_walktobl_sub(int tid, int64 tick, int id, intptr_t data) {
+int unit_walktobl_sub(int tid, int64 tick, int id, intptr_t data)
+{
struct block_list *bl = map->id2bl(id);
struct unit_data *ud = bl?unit->bl2ud(bl):NULL;
@@ -649,22 +651,29 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
* Called by unit_run when an object was hit
* @param sd Required only when using SC_WUGDASH
**/
-void unit_run_hit( struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type ) {
- int lv = sc->data[type]->val1;
+void unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type)
+{
+ int lv;
+ struct unit_data *ud;
+ Assert_retv(type >= 0 && type < SC_MAX);
+ lv = sc->data[type]->val1;
//If you can't run forward, you must be next to a wall, so bounce back. [Skotlex]
if( type == SC_RUN )
clif->sc_load(bl,bl->id,AREA,SI_TING,0,0,0);
+ ud = unit->bl2ud(bl);
+ nullpo_retv(ud);
//Set running to 0 beforehand so status_change_end knows not to enable spurt [Kevin]
- unit->bl2ud(bl)->state.running = 0;
+ ud->state.running = 0;
status_change_end(bl, type, INVALID_TIMER);
- if( type == SC_RUN ) {
- skill->blown(bl,bl,skill->get_blewcount(TK_RUN,lv),unit->getdir(bl),0);
+ if (type == SC_RUN) {
+ if (lv > 0)
+ skill->blown(bl, bl, skill->get_blewcount(TK_RUN, lv), unit->getdir(bl), 0);
clif->fixpos(bl); //Why is a clif->slide (skill->blown) AND a fixpos needed? Ask Aegis.
- clif->sc_end(bl,bl->id,AREA,SI_TING);
- } else if( sd ) {
+ clif->sc_end(bl, bl->id, AREA, SI_TING);
+ } else if (sd) {
clif->fixpos(bl);
skill->castend_damage_id(bl, &sd->bl, RA_WUGDASH, lv, timer->gettick(), SD_LEVEL);
}
@@ -677,7 +686,8 @@ void unit_run_hit( struct block_list *bl, struct status_change *sc, struct map_s
* @retval true Finished running
* @retval false Hit an object/Couldn't run
**/
-bool unit_run( struct block_list *bl, struct map_session_data *sd, enum sc_type type ) {
+bool unit_run(struct block_list *bl, struct map_session_data *sd, enum sc_type type)
+{
struct status_change *sc;
short to_x,to_y,dir_x,dir_y;
int i;
@@ -737,15 +747,19 @@ bool unit_run( struct block_list *bl, struct map_session_data *sd, enum sc_type
}
//Makes bl attempt to run dist cells away from target. Uses hard-paths.
-int unit_escape(struct block_list *bl, struct block_list *target, short dist) {
- uint8 dir = map->calc_dir(target, bl->x, bl->y);
+int unit_escape(struct block_list *bl, struct block_list *target, short dist)
+{
+ uint8 dir;
+ nullpo_ret(bl);
+ dir = map->calc_dir(target, bl->x, bl->y);
while (dist > 0 && map->getcell(bl->m, bl, bl->x + dist * dirx[dir], bl->y + dist * diry[dir], CELL_CHKNOREACH))
dist--;
return ( dist > 0 && unit->walktoxy(bl, bl->x + dist*dirx[dir], bl->y + dist*diry[dir], 0) );
}
//Instant warp function.
-int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath) {
+int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath)
+{
short dx,dy;
uint8 dir;
struct unit_data *ud = NULL;
@@ -821,7 +835,8 @@ int unit_setdir(struct block_list *bl,unsigned char dir)
return 0;
}
-uint8 unit_getdir(struct block_list *bl) {
+uint8 unit_getdir(struct block_list *bl)
+{
struct unit_data *ud;
nullpo_ret(bl);
@@ -937,7 +952,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
if (x<0 || y<0) {
//Random map position.
if (!map->search_freecell(NULL, m, &x, &y, -1, -1, 1)) {
- ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map->list[m].name, x, y);
+ ShowWarning("unit_warp failed. Unit Id:%d/Type:%u, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map->list[m].name, x, y);
return 2;
}
@@ -947,7 +962,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
if (!map->search_freecell(NULL, m, &x, &y, 4, 4, 1)) {
//Can't find a nearby cell
- ShowWarning("unit_warp failed. Unit Id:%d/Type:%d, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map->list[m].name, x, y);
+ ShowWarning("unit_warp failed. Unit Id:%d/Type:%u, target position map %d (%s) at [%d,%d]\n", bl->id, bl->type, m, map->list[m].name, x, y);
return 2;
}
}
@@ -978,7 +993,8 @@ int unit_warp(struct block_list *bl,short m,short x,short y,clr_type type)
* Flag values: @see unit_stopwalking_flag.
* Upper bytes may be used for other purposes depending on the unit type.
*------------------------------------------*/
-int unit_stop_walking(struct block_list *bl, int flag) {
+int unit_stop_walking(struct block_list *bl, int flag)
+{
struct unit_data *ud;
const struct TimerData* td;
int64 tick;
@@ -1040,7 +1056,8 @@ int unit_is_walking(struct block_list *bl)
/*==========================================
* Determines if the bl can move based on status changes. [Skotlex]
*------------------------------------------*/
-int unit_can_move(struct block_list *bl) {
+int unit_can_move(struct block_list *bl)
+{
struct map_session_data *sd;
struct unit_data *ud;
struct status_change *sc;
@@ -1053,8 +1070,18 @@ int unit_can_move(struct block_list *bl) {
if (!ud)
return 0;
- if (ud->skilltimer != INVALID_TIMER && ud->skill_id != LG_EXEEDBREAK && (!sd || !pc->checkskill(sd, SA_FREECAST) || skill->get_inf2(ud->skill_id)&INF2_GUILD_SKILL))
- return 0; // prevent moving while casting
+ if (ud->skilltimer != INVALID_TIMER && ud->skill_id != LG_EXEEDBREAK) {
+ // Prevent moving while casting
+ if (sd == NULL)
+ return 0; // Only players are affected by SA_FREECAST and similar
+ if ((skill->get_inf2(ud->skill_id) & (INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) == 0) {
+ // Skills with an explicit free cast setting always allow walking regardless of SA_FREECAST
+ if ((skill->get_inf2(ud->skill_id) & INF2_GUILD_SKILL) != 0)
+ return 0; // SA_FREECAST doesn't affect guild skills
+ if (pc->checkskill(sd, SA_FREECAST) == 0)
+ return 0; // SA_FREECAST not available
+ }
+ }
if (DIFF_TICK(ud->canmove_tick, timer->gettick()) > 0)
return 0;
@@ -1101,6 +1128,7 @@ int unit_can_move(struct block_list *bl) {
|| sc->data[SC_VACUUM_EXTREME]
|| (sc->data[SC_FEAR] && sc->data[SC_FEAR]->val2 > 0)
|| sc->data[SC_NETHERWORLD]
+ || sc->data[SC_SUHIDE]
|| (sc->data[SC_SPIDERWEB] && sc->data[SC_SPIDERWEB]->val1)
|| (sc->data[SC_CLOAKING] && sc->data[SC_CLOAKING]->val1 < 3 && !(sc->data[SC_CLOAKING]->val4&1)) //Need wall at level 1-2
|| (
@@ -1140,11 +1168,12 @@ int unit_can_move(struct block_list *bl) {
* Resume running after a walk delay
*------------------------------------------*/
-int unit_resume_running(int tid, int64 tick, int id, intptr_t data) {
-
+int unit_resume_running(int tid, int64 tick, int id, intptr_t data)
+{
struct unit_data *ud = (struct unit_data *)data;
struct map_session_data *sd = map->id2sd(id);
+ nullpo_ret(ud);
if(sd && pc_isridingwug(sd))
clif->skill_nodamage(ud->bl,ud->bl,RA_WUGDASH,ud->skill_lv,
sc_start4(ud->bl,ud->bl,status->skill2sc(RA_WUGDASH),100,ud->skill_lv,unit->getdir(ud->bl),0,0,1));
@@ -1164,10 +1193,12 @@ int unit_resume_running(int tid, int64 tick, int id, intptr_t data) {
* if type is 0, this is a damage induced delay: if previous delay is active, do not change it.
* if type is 1, this is a skill induced delay: walk-delay may only be increased, not decreased.
*------------------------------------------*/
-int unit_set_walkdelay(struct block_list *bl, int64 tick, int delay, int type) {
+int unit_set_walkdelay(struct block_list *bl, int64 tick, int delay, int type)
+{
struct unit_data *ud = unit->bl2ud(bl);
if (delay <= 0 || !ud) return 0;
+ nullpo_ret(bl);
if (type) {
//Bosses can ignore skill induced walkdelay (but not damage induced)
if (bl->type == BL_MOB && (BL_UCCAST(BL_MOB, bl)->status.mode&MD_BOSS))
@@ -1203,7 +1234,9 @@ int unit_set_walkdelay(struct block_list *bl, int64 tick, int delay, int type) {
return 1;
}
-int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel) {
+//-------------- stop here
+int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel)
+{
struct unit_data *ud;
struct status_data *tstatus;
struct status_change *sc;
@@ -1220,6 +1253,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
ud = unit->bl2ud(src);
if(ud == NULL) return 0;
+
sc = status->get_sc(src);
if (sc && !sc->count)
sc = NULL; //Unneeded
@@ -1346,7 +1380,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
switch (skill_id){
case SA_CASTCANCEL:
- if (ud->skill_id != skill_id){
+ if (ud->skill_id != skill_id) {
sd->skill_id_old = ud->skill_id;
sd->skill_lv_old = ud->skill_lv;
}
@@ -1428,7 +1462,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
} else if( src->type == BL_MER && skill_id == MA_REMOVETRAP ) {
if( !battle->check_range(battle->get_master(src), target, range + 1) )
return 0; // Aegis calc remove trap based on Master position, ignoring mercenary O.O
- } else if( !battle->check_range(src, target, range + (skill_id == RG_CLOSECONFINE?0:2)) ) {
+ } else if (!battle->check_range(src, target, range)) {
return 0; // Arrow-path check failed.
}
}
@@ -1476,7 +1510,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
}
break;
case AB_CLEARANCE:
- if( target->type != BL_MOB && battle->check_target(src,target,BCT_PARTY) <= 0 && sd ) {
+ if (target->type != BL_MOB && battle->check_target(src, target, BCT_PARTY) <= 0 && sd) {
clif->skill_fail(sd, skill_id, USESKILL_FAIL_TOTARGET, 0);
return 0;
}
@@ -1511,7 +1545,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
}
break;
case GD_EMERGENCYCALL: //Emergency Call double cast when the user has learned Leap [Daegaladh]
- if( sd && pc->checkskill(sd,TK_HIGHJUMP) )
+ if (sd && (pc->checkskill(sd,TK_HIGHJUMP) || pc->checkskill(sd,SU_LOPE) >= 3))
casttime *= 2;
break;
case RA_WUGDASH:
@@ -1536,7 +1570,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
}
break;
case NC_DISJOINT:
- if( target->type == BL_PC ){
+ if (target->type == BL_PC) {
struct mob_data *md;
if( (md = map->id2md(target->id)) && md->master_id != src->id )
casttime <<= 1;
@@ -1573,7 +1607,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
unit->stop_walking(src, STOPWALKING_FLAG_FIXPOS);// even though this is not how official works but this will do the trick. bugreport:6829
// in official this is triggered even if no cast time.
- clif->skillcasting(src, src->id, target_id, 0,0, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
+ clif->useskill(src, src->id, target_id, 0,0, skill_id, skill_lv, casttime);
if( casttime > 0 || temp )
{
if (sd != NULL && target->type == BL_MOB) {
@@ -1628,11 +1662,14 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
if (src->id != target->id) // self-targeted skills shouldn't show different direction
unit->setdir(src, map->calc_dir(src, target->x, target->y));
ud->skilltimer = timer->add( tick+casttime, skill->castend_id, src->id, 0 );
- if( sd && (pc->checkskill(sd,SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK) )
+ if (sd && (pc->checkskill(sd, SA_FREECAST) > 0 || skill_id == LG_EXEEDBREAK || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0))
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
} else
skill->castend_id(ud->skilltimer,tick,src->id,0);
+ if (sd != NULL && battle_config.prevent_logout_trigger & PLT_SKILL)
+ sd->canlog_tick = timer->gettick();
+
return 1;
}
@@ -1768,17 +1805,21 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
unit->stop_walking(src, STOPWALKING_FLAG_FIXPOS);
// in official this is triggered even if no cast time.
- clif->skillcasting(src, src->id, 0, skill_x, skill_y, skill_id, skill->get_ele(skill_id, skill_lv), casttime);
+ clif->useskill(src, src->id, 0, skill_x, skill_y, skill_id, skill_lv, casttime);
if( casttime > 0 ) {
unit->setdir(src, map->calc_dir(src, skill_x, skill_y));
ud->skilltimer = timer->add( tick+casttime, skill->castend_pos, src->id, 0 );
- if ( (sd && pc->checkskill(sd, SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK ) {
+ if ((sd && pc->checkskill(sd, SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0) {
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
}
} else {
ud->skilltimer = INVALID_TIMER;
skill->castend_pos(ud->skilltimer,tick,src->id,0);
}
+
+ if (sd != NULL && battle_config.prevent_logout_trigger & PLT_SKILL)
+ sd->canlog_tick = timer->gettick();
+
return 1;
}
@@ -1853,6 +1894,7 @@ void unit_stop_stepaction(struct block_list *bl)
int unit_unattackable(struct block_list *bl)
{
struct unit_data *ud = unit->bl2ud(bl);
+ nullpo_ret(bl);
if (ud) {
ud->state.attack_continue = 0;
ud->state.step_attack = 0;
@@ -1870,11 +1912,13 @@ int unit_unattackable(struct block_list *bl)
* Attack request
* If type is an ongoing attack
*------------------------------------------*/
-int unit_attack(struct block_list *src,int target_id,int continuous) {
+int unit_attack(struct block_list *src, int target_id, int continuous)
+{
struct block_list *target;
struct unit_data *ud;
int range;
+ nullpo_ret(src);
nullpo_ret(ud = unit->bl2ud(src));
target = map->id2bl(target_id);
@@ -1942,6 +1986,7 @@ int unit_cancel_combo(struct block_list *bl)
{
struct unit_data *ud;
+ nullpo_ret(bl);
if (!status_change_end(bl, SC_COMBOATTACK, INVALID_TIMER))
return 0; //Combo wasn't active.
@@ -2078,7 +2123,8 @@ int unit_calc_pos(struct block_list *bl, int tx, int ty, uint8 dir)
/*==========================================
* Continuous Attack (function timer)
*------------------------------------------*/
-int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) {
+int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick)
+{
struct block_list *target;
struct unit_data *ud;
struct status_data *sstatus;
@@ -2117,10 +2163,10 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) {
return 0;
}
- if( ud->skilltimer != INVALID_TIMER && !(sd && pc->checkskill(sd,SA_FREECAST) > 0) )
+ if (ud->skilltimer != INVALID_TIMER && !(sd && (pc->checkskill(sd, SA_FREECAST) > 0 || (skill->get_inf2(ud->skill_id) & (INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) != 0)))
return 0; // can't attack while casting
- if( !battle_config.sdelay_attack_enable && DIFF_TICK(ud->canact_tick,tick) > 0 && !(sd && pc->checkskill(sd,SA_FREECAST) > 0) )
+ if (!battle_config.sdelay_attack_enable && DIFF_TICK(ud->canact_tick, tick) > 0 && !(sd && (pc->checkskill(sd, SA_FREECAST) > 0 || (skill->get_inf2(ud->skill_id) & (INF2_FREE_CAST_REDUCED | INF2_FREE_CAST_NORMAL)) != 0)))
{ // attacking when under cast delay has restrictions:
if( tid == INVALID_TIMER ) { //requested attack.
if(sd) clif->skill_fail(sd,1,USESKILL_FAIL_SKILLINTERVAL,0);
@@ -2214,10 +2260,14 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) {
ud->attacktimer = timer->add(ud->attackabletime,unit->attack_timer,src->id,0);
}
+ if (sd != NULL && battle_config.prevent_logout_trigger & PLT_ATTACK)
+ sd->canlog_tick = timer->gettick();
+
return 1;
}
-int unit_attack_timer(int tid, int64 tick, int id, intptr_t data) {
+int unit_attack_timer(int tid, int64 tick, int id, intptr_t data)
+{
struct block_list *bl;
bl = map->id2bl(id);
if(bl && unit->attack_timer_sub(bl, tid, tick) == 0)
@@ -2269,7 +2319,7 @@ int unit_skillcastcancel(struct block_list *bl,int type)
ud->skilltimer = INVALID_TIMER;
- if( sd && pc->checkskill(sd,SA_FREECAST) > 0 )
+ if (sd && (pc->checkskill(sd, SA_FREECAST) > 0 || (skill->get_inf2(ud->skill_id) & INF2_FREE_CAST_REDUCED) != 0))
status_calc_bl(&sd->bl, SCB_SPEED|SCB_ASPD);
if( sd ) {
@@ -2288,12 +2338,20 @@ int unit_skillcastcancel(struct block_list *bl,int type)
}
// unit_data initialization process
-void unit_dataset(struct block_list *bl) {
- struct unit_data *ud;
- nullpo_retv(ud = unit->bl2ud(bl));
+void unit_dataset(struct block_list *bl)
+{
+ struct unit_data *ud = unit->bl2ud(bl);
+ nullpo_retv(ud);
- memset( ud, 0, sizeof( struct unit_data) );
- ud->bl = bl;
+ unit->init_ud(ud);
+ ud->bl = bl;
+}
+
+void unit_init_ud(struct unit_data *ud)
+{
+ nullpo_retv(ud);
+
+ memset (ud, 0, sizeof(struct unit_data));
ud->walktimer = INVALID_TIMER;
ud->skilltimer = INVALID_TIMER;
ud->attacktimer = INVALID_TIMER;
@@ -2317,7 +2375,8 @@ int unit_counttargeted(struct block_list* bl)
/*==========================================
*
*------------------------------------------*/
-int unit_fixdamage(struct block_list *src, struct block_list *target, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2) {
+int unit_fixdamage(struct block_list *src, struct block_list *target, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2)
+{
nullpo_ret(target);
if(damage+damage2 <= 0)
@@ -2353,9 +2412,11 @@ int unit_changeviewsize(struct block_list *bl,short size)
* Otherwise it is assumed bl is being warped.
* On-Kill specific stuff is not performed here, look at status->damage for that.
*------------------------------------------*/
-int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func) {
+int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, int line, const char* func)
+{
struct unit_data *ud = unit->bl2ud(bl);
struct status_change *sc = status->get_sc(bl);
+ nullpo_ret(bl);
nullpo_ret(ud);
if(bl->prev == NULL)
@@ -2415,6 +2476,8 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i
status_change_end(bl, SC_VACUUM_EXTREME, INVALID_TIMER);
status_change_end(bl, SC_CURSEDCIRCLE_ATKER, INVALID_TIMER); //callme before warp
status_change_end(bl, SC_NETHERWORLD, INVALID_TIMER);
+ status_change_end(bl, SC_SUHIDE, INVALID_TIMER);
+ status_change_end(bl, SC_SV_ROOTTWIST, INVALID_TIMER);
}
if (bl->type&(BL_CHAR|BL_PET)) {
@@ -2433,7 +2496,7 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i
status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
}
//Leave/reject all invitations.
- if(sd->chatID)
+ if (sd->chat_id != 0)
chat->leave(sd, false);
if(sd->trade_partner)
trade->cancel(sd);
@@ -2597,6 +2660,7 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i
void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype)
{
+ nullpo_retv(sd);
unit->remove_map(&sd->bl,clrtype,ALC_MARK);
//CLR_RESPAWN is the warp from logging out, CLR_TELEPORT is the warp from teleporting, but pets/homunc need to just 'vanish' instead of showing the warping animation.
@@ -2614,6 +2678,7 @@ void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype)
void unit_free_pc(struct map_session_data *sd)
{
+ nullpo_retv(sd);
if (sd->pd) unit->free(&sd->pd->bl,CLR_OUTSIGHT);
if (sd->hd) unit->free(&sd->hd->bl,CLR_OUTSIGHT);
if (sd->md) unit->free(&sd->md->bl,CLR_OUTSIGHT);
@@ -2625,8 +2690,10 @@ void unit_free_pc(struct map_session_data *sd)
* Function to free all related resources to the bl
* if unit is on map, it is removed using the clrtype specified
*------------------------------------------*/
-int unit_free(struct block_list *bl, clr_type clrtype) {
+int unit_free(struct block_list *bl, clr_type clrtype)
+{
struct unit_data *ud = unit->bl2ud( bl );
+ nullpo_ret(bl);
nullpo_ret(ud);
map->freeblock_lock();
@@ -2690,6 +2757,8 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
sd->instance = NULL;
}
VECTOR_CLEAR(sd->script_queues);
+ VECTOR_CLEAR(sd->storage.item);
+ sd->storage.received = false;
if( sd->quest_log != NULL ) {
aFree(sd->quest_log);
sd->quest_log = NULL;
@@ -2870,7 +2939,8 @@ int unit_free(struct block_list *bl, clr_type clrtype) {
return 0;
}
-int do_init_unit(bool minimal) {
+int do_init_unit(bool minimal)
+{
if (minimal)
return 0;
@@ -2882,12 +2952,14 @@ int do_init_unit(bool minimal) {
return 0;
}
-int do_final_unit(void) {
+int do_final_unit(void)
+{
// nothing to do
return 0;
}
-void unit_defaults(void) {
+void unit_defaults(void)
+{
unit = &unit_s;
unit->init = do_init_unit;
@@ -2895,6 +2967,7 @@ void unit_defaults(void) {
/* */
unit->bl2ud = unit_bl2ud;
unit->bl2ud2 = unit_bl2ud2;
+ unit->init_ud = unit_init_ud;
unit->attack_timer = unit_attack_timer;
unit->walktoxy_timer = unit_walktoxy_timer;
unit->walktoxy_sub = unit_walktoxy_sub;
diff --git a/src/map/unit.h b/src/map/unit.h
index 0279d73c1..d065b3d57 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -80,11 +80,7 @@ struct unit_data {
};
struct view_data {
-#ifdef __64BIT__
- uint32 class_; // FIXME: This shouldn't really depend on the architecture.
-#else // not __64BIT__
- uint16 class_;
-#endif // __64BIT__
+ int16 class;
uint16 weapon,
shield, //Or left-hand weapon.
robe,
@@ -105,6 +101,7 @@ struct unit_interface {
/* */
struct unit_data* (*bl2ud) (struct block_list *bl);
struct unit_data* (*bl2ud2) (struct block_list *bl);
+ void (*init_ud) (struct unit_data *ud);
int (*attack_timer) (int tid, int64 tick, int id, intptr_t data);
int (*walktoxy_timer) (int tid, int64 tick, int id, intptr_t data);
int (*walktoxy_sub) (struct block_list *bl);
diff --git a/src/map/vending.c b/src/map/vending.c
index 6e74e6c3e..9a9585d2f 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -44,14 +44,16 @@ struct vending_interface vending_s;
struct vending_interface *vending;
/// Returns an unique vending shop id.
-static inline unsigned int getid(void) {
+static inline unsigned int getid(void)
+{
return vending->next_id++;
}
/*==========================================
* Close shop
*------------------------------------------*/
-void vending_closevending(struct map_session_data* sd) {
+void vending_closevending(struct map_session_data* sd)
+{
nullpo_retv(sd);
if( sd->state.vending ) {
@@ -64,7 +66,8 @@ void vending_closevending(struct map_session_data* sd) {
/*==========================================
* Request a shop's item list
*------------------------------------------*/
-void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) {
+void vending_vendinglistreq(struct map_session_data* sd, unsigned int id)
+{
struct map_session_data* vsd;
nullpo_retv(sd);
@@ -74,8 +77,7 @@ void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) {
return; // not vending
if (!pc_can_give_items(sd) || !pc_can_give_items(vsd)) { //check if both GMs are allowed to trade
- // GM is not allowed to trade
- clif->message(sd->fd, msg_sd(sd,246));
+ clif->message(sd->fd, msg_sd(sd,246)); // Your GM level doesn't authorize you to perform this action.
return;
}
@@ -87,13 +89,15 @@ void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) {
/*==========================================
* Purchase item(s) from a shop
*------------------------------------------*/
-void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, const uint8* data, int count) {
+void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, const uint8* data, int count)
+{
int i, j, cursor, w, new_ = 0, blank, vend_list[MAX_VENDING];
int64 z;
struct s_vending vend[MAX_VENDING]; // against duplicate packets
struct map_session_data* vsd = map->id2sd(aid);
nullpo_retv(sd);
+ nullpo_retv(data);
if( vsd == NULL || !vsd->state.vending || vsd->bl.id == sd->bl.id )
return; // invalid shop
@@ -118,9 +122,9 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
// some checks
z = 0; // zeny counter
w = 0; // weight counter
- for( i = 0; i < count; i++ ) {
- short amount = *(uint16*)(data + 4*i + 0);
- short idx = *(uint16*)(data + 4*i + 2);
+ for (i = 0; i < count; i++) {
+ short amount = *(const uint16*)(data + 4*i + 0);
+ short idx = *(const uint16*)(data + 4*i + 2);
idx -= 2;
if( amount <= 0 )
@@ -184,22 +188,22 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
z -= apply_percentrate64(z, battle_config.vending_tax, 10000);
pc->getzeny(vsd, (int)z, LOG_TYPE_VENDING, sd);
- for( i = 0; i < count; i++ ) {
- short amount = *(uint16*)(data + 4*i + 0);
- short idx = *(uint16*)(data + 4*i + 2);
+ for (i = 0; i < count; i++) {
+ short amount = *(const uint16*)(data + 4*i + 0);
+ short idx = *(const uint16*)(data + 4*i + 2);
idx -= 2;
// vending item
pc->additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
vsd->vending[vend_list[i]].amount -= amount;
+ clif->vendingreport(vsd, idx, amount, sd->status.char_id, (int)z);
pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
- clif->vendingreport(vsd, idx, amount);
//print buyer's name
if( battle_config.buyer_name ) {
char temp[256];
sprintf(temp, msg_sd(vsd,265), sd->status.name);
- clif_disp_onlyself(vsd,temp,strlen(temp));
+ clif_disp_onlyself(vsd, temp);
}
}
@@ -241,7 +245,8 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid,
* Open shop
* data := {<index>.w <amount>.w <value>.l}[count]
*------------------------------------------*/
-void vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count) {
+void vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count)
+{
int i, j;
int vending_skill_lvl;
nullpo_retv(sd);
@@ -265,10 +270,10 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
// filter out invalid items
i = 0;
- for( j = 0; j < count; j++ ) {
- short index = *(uint16*)(data + 8*j + 0);
- short amount = *(uint16*)(data + 8*j + 2);
- unsigned int value = *(uint32*)(data + 8*j + 4);
+ for (j = 0; j < count; j++) {
+ short index = *(const uint16*)(data + 8*j + 0);
+ short amount = *(const uint16*)(data + 8*j + 2);
+ unsigned int value = *(const uint32*)(data + 8*j + 4);
index -= 2; // offset adjustment (client says that the first cart position is 2)
@@ -276,7 +281,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
|| pc->cartitem_amount(sd, index, amount) < 0 // invalid item or insufficient quantity
//NOTE: official server does not do any of the following checks!
|| !sd->status.cart[index].identify // unidentified item
- || sd->status.cart[index].attribute == 1 // broken item
+ || (sd->status.cart[index].attribute & ATTR_BROKEN) != 0 // broken item
|| sd->status.cart[index].expire_time // It should not be in the cart but just in case
|| (sd->status.cart[index].bound && !pc_can_give_bound_items(sd)) // can't trade bound items w/o permission
|| !itemdb_cantrade(&sd->status.cart[index], pc_get_group_level(sd), pc_get_group_level(sd)) ) // untradeable item
@@ -310,9 +315,11 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
/// Checks if an item is being sold in given player's vending.
-bool vending_search(struct map_session_data* sd, unsigned short nameid) {
+bool vending_search(struct map_session_data* sd, unsigned short nameid)
+{
int i;
+ nullpo_retr(false, sd);
if( !sd->state.vending ) { // not vending
return false;
}
@@ -328,11 +335,14 @@ bool vending_search(struct map_session_data* sd, unsigned short nameid) {
/// Searches for all items in a vending, that match given ids, price and possible cards.
/// @return Whether or not the search should be continued.
-bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s) {
+bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s)
+{
int i, c, slot;
unsigned int idx, cidx;
struct item* it;
+ nullpo_retr(false, sd);
+ nullpo_retr(false, s);
if( !sd->state.vending ) // not vending
return true;
@@ -378,16 +388,20 @@ bool vending_searchall(struct map_session_data* sd, const struct s_search_store_
return true;
}
-void final(void) {
+
+void final(void)
+{
db_destroy(vending->db);
}
-void init(bool minimal) {
+void init(bool minimal)
+{
vending->db = idb_alloc(DB_OPT_BASE);
vending->next_id = 0;
}
-void vending_defaults(void) {
+void vending_defaults(void)
+{
vending = &vending_s;
vending->init = init;
diff --git a/src/map/vending.h b/src/map/vending.h
index 6684ed256..9a236f75b 100644
--- a/src/map/vending.h
+++ b/src/map/vending.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -22,8 +22,9 @@
#define MAP_VENDING_H
#include "common/hercules.h"
-#include "common/db.h"
+/* Forward Declarations */
+struct DBMap; // common/db.h
struct map_session_data;
struct s_search_store_search;
@@ -35,7 +36,7 @@ struct s_vending {
struct vending_interface {
unsigned int next_id;/* next vender id */
- DBMap *db;
+ struct DBMap *db;
/* */
void (*init) (bool minimal);
void (*final) (void);
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c
index 18bfaf220..0b98ea99f 100644
--- a/src/plugins/HPMHooking.c
+++ b/src/plugins/HPMHooking.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-2016 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
@@ -17,6 +17,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
+#include "HPMHooking.h"
+
#include "common/hercules.h"
#include "common/db.h"
#include "common/memmgr.h"
@@ -29,6 +32,8 @@
#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_login.Hooks.inc"
#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_login.HookingPoints.inc"
#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_login.sources.inc"
+#include "login/lclif.h"
+#include "login/lclif.p.h"
#include "login/login.h"
#elif defined (HPMHOOKING_CHAR)
#define HPM_SERVER_TYPE SERVER_TYPE_CHAR
@@ -92,6 +97,7 @@
#include "map/storage.h"
#include "map/trade.h"
#include "map/unit.h"
+#include "common/grfio.h"
#include "common/mapindex.h"
#else
#define HPM_SERVER_TYPE SERVER_TYPE_UNKNOWN
@@ -104,13 +110,18 @@
#include "common/conf.h"
#include "common/console.h"
#include "common/db.h"
+#include "common/des.h"
+#include "common/md5calc.h"
#include "common/memmgr.h"
+#include "common/mutex.h"
#include "common/nullpo.h"
+#include "common/random.h"
#include "common/showmsg.h"
#include "common/socket.h"
#include "common/sql.h"
#include "common/strlib.h"
#include "common/sysinfo.h"
+#include "common/thread.h"
#include "common/timer.h"
#include "common/utils.h"
@@ -128,7 +139,7 @@ HPExport struct hplugin_info pinfo = {
};
#define HP_POP(x,y) #x , (void**)(&x) , (void*)y , 0
-DBMap *hp_db;/* hooking points db -- for quick lookup */
+struct DBMap *hp_db;/* hooking points db -- for quick lookup */
struct HookingPointData {
char* name;
diff --git a/src/plugins/HPMHooking.h b/src/plugins/HPMHooking.h
new file mode 100644
index 000000000..44970863c
--- /dev/null
+++ b/src/plugins/HPMHooking.h
@@ -0,0 +1,65 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2016 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef PLUGINS_HPMHOOKING_H
+#define PLUGINS_HPMHOOKING_H
+
+#include "common/hercules.h"
+
+enum HPluginHookType {
+ HOOK_TYPE_PRE,
+ HOOK_TYPE_POST,
+};
+
+struct HPMHooking_interface {
+ bool (*AddHook) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
+ void (*HookStop) (const char *func, unsigned int pID);
+ bool (*HookStopped) (void);
+};
+
+#ifdef HERCULES_CORE
+struct HPMHooking_core_interface {
+ bool enabled;
+ bool force_return;
+ bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID);
+ const char *(*Hooked)(bool *fr);
+};
+#else // ! HERCULES_CORE
+HPExport struct HPMHooking_interface HPMHooking_s;
+
+#include "HPMHooking/HPMHooking.Defs.inc"
+
+#define addHookPre(ifname, funcname, hook) ( \
+ (void)((HPMHOOK_pre_ ## ifname ## _ ## funcname)0 == (hook)), \
+ HPMi->hooking->AddHook(HOOK_TYPE_PRE, #ifname "->" #funcname, (hook), HPMi->pid) \
+ )
+
+#define addHookPost(ifname, funcname, hook) ( \
+ (void)((HPMHOOK_post_ ## ifname ## _ ## funcname)0 == (hook)), \
+ HPMi->hooking->AddHook(HOOK_TYPE_POST, #ifname "->" #funcname, (hook), HPMi->pid) \
+ )
+
+/* need better names ;/ */
+/* will not run the original function after pre-hook processing is complete (other hooks will run) */
+#define hookStop() (HPMi->hooking->HookStop(__func__,HPMi->pid))
+#define hookStopped() (HPMi->hooking->HookStopped())
+
+#endif // ! HERCULES_CORE
+
+#endif // PLUGINS_HPMHOOKING_H
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
new file mode 100644
index 000000000..847edbbd8
--- /dev/null
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -0,0 +1,7333 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2013-2017 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * NOTE: This file was auto-generated and should never be manually edited,
+ * as it will get overwritten.
+ */
+
+/* GENERATED FILE DO NOT EDIT */
+
+#ifdef COMMON_UTILS_H /* HCache */
+typedef void (*HPMHOOK_pre_HCache_init) (void);
+typedef void (*HPMHOOK_post_HCache_init) (void);
+typedef bool (*HPMHOOK_pre_HCache_check) (const char **file);
+typedef bool (*HPMHOOK_post_HCache_check) (bool retVal___, const char *file);
+typedef FILE* (*HPMHOOK_pre_HCache_open) (const char **file, const char **opt);
+typedef FILE* (*HPMHOOK_post_HCache_open) (FILE* retVal___, const char *file, const char *opt);
+#endif // COMMON_UTILS_H
+#ifdef MAP_ATCOMMAND_H /* atcommand */
+typedef void (*HPMHOOK_pre_atcommand_init) (bool *minimal);
+typedef void (*HPMHOOK_post_atcommand_init) (bool minimal);
+typedef void (*HPMHOOK_pre_atcommand_final) (void);
+typedef void (*HPMHOOK_post_atcommand_final) (void);
+typedef bool (*HPMHOOK_pre_atcommand_exec) (const int *fd, struct map_session_data **sd, const char **message, bool *player_invoked);
+typedef bool (*HPMHOOK_post_atcommand_exec) (bool retVal___, const int fd, struct map_session_data *sd, const char *message, bool player_invoked);
+typedef bool (*HPMHOOK_pre_atcommand_create) (char **name, AtCommandFunc *func);
+typedef bool (*HPMHOOK_post_atcommand_create) (bool retVal___, char *name, AtCommandFunc func);
+typedef bool (*HPMHOOK_pre_atcommand_can_use) (struct map_session_data **sd, const char **command);
+typedef bool (*HPMHOOK_post_atcommand_can_use) (bool retVal___, struct map_session_data *sd, const char *command);
+typedef bool (*HPMHOOK_pre_atcommand_can_use2) (struct map_session_data **sd, const char **command, AtCommandType *type);
+typedef bool (*HPMHOOK_post_atcommand_can_use2) (bool retVal___, struct map_session_data *sd, const char *command, AtCommandType type);
+typedef void (*HPMHOOK_pre_atcommand_load_groups) (GroupSettings ***groups, struct config_setting_t ***commands_, size_t *sz);
+typedef void (*HPMHOOK_post_atcommand_load_groups) (GroupSettings **groups, struct config_setting_t **commands_, size_t sz);
+typedef AtCommandInfo* (*HPMHOOK_pre_atcommand_exists) (const char **name);
+typedef AtCommandInfo* (*HPMHOOK_post_atcommand_exists) (AtCommandInfo* retVal___, const char *name);
+typedef bool (*HPMHOOK_pre_atcommand_msg_read) (const char **cfg_name, bool *allow_override);
+typedef bool (*HPMHOOK_post_atcommand_msg_read) (bool retVal___, const char *cfg_name, bool allow_override);
+typedef void (*HPMHOOK_pre_atcommand_final_msg) (void);
+typedef void (*HPMHOOK_post_atcommand_final_msg) (void);
+typedef struct atcmd_binding_data* (*HPMHOOK_pre_atcommand_get_bind_byname) (const char **name);
+typedef struct atcmd_binding_data* (*HPMHOOK_post_atcommand_get_bind_byname) (struct atcmd_binding_data* retVal___, const char *name);
+typedef AtCommandInfo* (*HPMHOOK_pre_atcommand_get_info_byname) (const char **name);
+typedef AtCommandInfo* (*HPMHOOK_post_atcommand_get_info_byname) (AtCommandInfo* retVal___, const char *name);
+typedef const char* (*HPMHOOK_pre_atcommand_check_alias) (const char **aliasname);
+typedef const char* (*HPMHOOK_post_atcommand_check_alias) (const char* retVal___, const char *aliasname);
+typedef void (*HPMHOOK_pre_atcommand_get_suggestions) (struct map_session_data **sd, const char **name, bool *is_atcmd_cmd);
+typedef void (*HPMHOOK_post_atcommand_get_suggestions) (struct map_session_data *sd, const char *name, bool is_atcmd_cmd);
+typedef void (*HPMHOOK_pre_atcommand_config_read) (const char **config_filename);
+typedef void (*HPMHOOK_post_atcommand_config_read) (const char *config_filename);
+typedef int (*HPMHOOK_pre_atcommand_stopattack) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_atcommand_stopattack) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_atcommand_pvpoff_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_atcommand_pvpoff_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_atcommand_pvpon_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_atcommand_pvpon_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_atcommand_atkillmonster_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_atcommand_atkillmonster_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_atcommand_raise_sub) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_atcommand_raise_sub) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_atcommand_get_jail_time) (int *jailtime, int **year, int **month, int **day, int **hour, int **minute);
+typedef void (*HPMHOOK_post_atcommand_get_jail_time) (int jailtime, int *year, int *month, int *day, int *hour, int *minute);
+typedef int (*HPMHOOK_pre_atcommand_cleanfloor_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_atcommand_cleanfloor_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_atcommand_mutearea_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_atcommand_mutearea_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_atcommand_getring) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_atcommand_getring) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_atcommand_channel_help) (int *fd, const char **command, bool *can_create);
+typedef void (*HPMHOOK_post_atcommand_channel_help) (int fd, const char *command, bool can_create);
+typedef void (*HPMHOOK_pre_atcommand_commands_sub) (struct map_session_data **sd, const int *fd, AtCommandType *type);
+typedef void (*HPMHOOK_post_atcommand_commands_sub) (struct map_session_data *sd, const int fd, AtCommandType type);
+typedef void (*HPMHOOK_pre_atcommand_cmd_db_clear) (void);
+typedef void (*HPMHOOK_post_atcommand_cmd_db_clear) (void);
+typedef int (*HPMHOOK_pre_atcommand_cmd_db_clear_sub) (union DBKey *key, struct DBData **data, va_list args);
+typedef int (*HPMHOOK_post_atcommand_cmd_db_clear_sub) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+typedef void (*HPMHOOK_pre_atcommand_doload) (void);
+typedef void (*HPMHOOK_post_atcommand_doload) (void);
+typedef void (*HPMHOOK_pre_atcommand_base_commands) (void);
+typedef void (*HPMHOOK_post_atcommand_base_commands) (void);
+typedef bool (*HPMHOOK_pre_atcommand_add) (char **name, AtCommandFunc *func, bool *replace);
+typedef bool (*HPMHOOK_post_atcommand_add) (bool retVal___, char *name, AtCommandFunc func, bool replace);
+typedef const char* (*HPMHOOK_pre_atcommand_msg) (int *msg_number);
+typedef const char* (*HPMHOOK_post_atcommand_msg) (const char* retVal___, int msg_number);
+typedef void (*HPMHOOK_pre_atcommand_expand_message_table) (void);
+typedef void (*HPMHOOK_post_atcommand_expand_message_table) (void);
+typedef const char* (*HPMHOOK_pre_atcommand_msgfd) (int *fd, int *msg_number);
+typedef const char* (*HPMHOOK_post_atcommand_msgfd) (const char* retVal___, int fd, int msg_number);
+typedef const char* (*HPMHOOK_pre_atcommand_msgsd) (struct map_session_data **sd, int *msg_number);
+typedef const char* (*HPMHOOK_post_atcommand_msgsd) (const char* retVal___, struct map_session_data *sd, int msg_number);
+#endif // MAP_ATCOMMAND_H
+#ifdef MAP_BATTLE_H /* battle */
+typedef void (*HPMHOOK_pre_battle_init) (bool *minimal);
+typedef void (*HPMHOOK_post_battle_init) (bool minimal);
+typedef void (*HPMHOOK_pre_battle_final) (void);
+typedef void (*HPMHOOK_post_battle_final) (void);
+typedef struct Damage (*HPMHOOK_pre_battle_calc_attack) (int *attack_type, struct block_list **bl, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *count);
+typedef struct Damage (*HPMHOOK_post_battle_calc_attack) (struct Damage retVal___, int attack_type, struct block_list *bl, struct block_list *target, uint16 skill_id, uint16 skill_lv, int count);
+typedef int64 (*HPMHOOK_pre_battle_calc_damage) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv);
+typedef int64 (*HPMHOOK_post_battle_calc_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv);
+typedef int64 (*HPMHOOK_pre_battle_calc_pc_damage) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv);
+typedef int64 (*HPMHOOK_post_battle_calc_pc_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv);
+typedef int64 (*HPMHOOK_pre_battle_calc_gvg_damage) (struct block_list **src, struct block_list **bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
+typedef int64 (*HPMHOOK_post_battle_calc_gvg_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag);
+typedef int64 (*HPMHOOK_pre_battle_calc_bg_damage) (struct block_list **src, struct block_list **bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
+typedef int64 (*HPMHOOK_post_battle_calc_bg_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag);
+typedef enum damage_lv (*HPMHOOK_pre_battle_weapon_attack) (struct block_list **bl, struct block_list **target, int64 *tick, int *flag);
+typedef enum damage_lv (*HPMHOOK_post_battle_weapon_attack) (enum damage_lv retVal___, struct block_list *bl, struct block_list *target, int64 tick, int flag);
+typedef bool (*HPMHOOK_pre_battle_check_arrows) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_battle_check_arrows) (bool retVal___, struct map_session_data *sd);
+typedef struct Damage (*HPMHOOK_pre_battle_calc_weapon_attack) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *wflag);
+typedef struct Damage (*HPMHOOK_post_battle_calc_weapon_attack) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int wflag);
+typedef int (*HPMHOOK_pre_battle_delay_damage) (int64 *tick, int *amotion, struct block_list **src, struct block_list **target, int *attack_type, uint16 *skill_id, uint16 *skill_lv, int64 *damage, enum damage_lv *dmg_lv, int *ddelay, bool *additional_effects);
+typedef int (*HPMHOOK_post_battle_delay_damage) (int retVal___, int64 tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects);
+typedef void (*HPMHOOK_pre_battle_drain) (struct map_session_data **sd, struct block_list **tbl, int64 *rdamage, int64 *ldamage, int *race, int *boss);
+typedef void (*HPMHOOK_post_battle_drain) (struct map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int boss);
+typedef void (*HPMHOOK_pre_battle_reflect_damage) (struct block_list **target, struct block_list **src, struct Damage **wd, uint16 *skill_id);
+typedef void (*HPMHOOK_post_battle_reflect_damage) (struct block_list *target, struct block_list *src, struct Damage *wd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_battle_attr_ratio) (int *atk_elem, int *def_type, int *def_lv);
+typedef int (*HPMHOOK_post_battle_attr_ratio) (int retVal___, int atk_elem, int def_type, int def_lv);
+typedef int64 (*HPMHOOK_pre_battle_attr_fix) (struct block_list **src, struct block_list **target, int64 *damage, int *atk_elem, int *def_type, int *def_lv);
+typedef int64 (*HPMHOOK_post_battle_attr_fix) (int64 retVal___, struct block_list *src, struct block_list *target, int64 damage, int atk_elem, int def_type, int def_lv);
+typedef int64 (*HPMHOOK_pre_battle_calc_cardfix) (int *attack_type, struct block_list **src, struct block_list **target, int *nk, int *s_ele, int *s_ele_, int64 *damage, int *left, int *flag);
+typedef int64 (*HPMHOOK_post_battle_calc_cardfix) (int64 retVal___, int attack_type, struct block_list *src, struct block_list *target, int nk, int s_ele, int s_ele_, int64 damage, int left, int flag);
+typedef int64 (*HPMHOOK_pre_battle_calc_cardfix2) (struct block_list **src, struct block_list **bl, int64 *damage, int *s_ele, int *nk, int *flag);
+typedef int64 (*HPMHOOK_post_battle_calc_cardfix2) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int s_ele, int nk, int flag);
+typedef int64 (*HPMHOOK_pre_battle_calc_elefix) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *nk, int *n_ele, int *s_ele, int *s_ele_, bool *left, int *flag);
+typedef int64 (*HPMHOOK_post_battle_calc_elefix) (int64 retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int nk, int n_ele, int s_ele, int s_ele_, bool left, int flag);
+typedef int64 (*HPMHOOK_pre_battle_calc_masteryfix) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
+typedef int64 (*HPMHOOK_post_battle_calc_masteryfix) (int64 retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int div, bool left, bool weapon);
+typedef int (*HPMHOOK_pre_battle_calc_chorusbonus) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_battle_calc_chorusbonus) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_battle_calc_skillratio) (int *attack_type, struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
+typedef int (*HPMHOOK_post_battle_calc_skillratio) (int retVal___, int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int skillratio, int flag);
+typedef int64 (*HPMHOOK_pre_battle_calc_sizefix) (struct map_session_data **sd, int64 *damage, int *type, int *size, bool *ignore);
+typedef int64 (*HPMHOOK_post_battle_calc_sizefix) (int64 retVal___, struct map_session_data *sd, int64 damage, int type, int size, bool ignore);
+typedef int64 (*HPMHOOK_pre_battle_calc_weapon_damage) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, struct weapon_atk **watk, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *size, int *type, int *flag, int *flag2);
+typedef int64 (*HPMHOOK_post_battle_calc_weapon_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, struct weapon_atk *watk, int nk, bool n_ele, short s_ele, short s_ele_, int size, int type, int flag, int flag2);
+typedef int64 (*HPMHOOK_pre_battle_calc_defense) (int *attack_type, struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *flag, int *pdef);
+typedef int64 (*HPMHOOK_post_battle_calc_defense) (int64 retVal___, int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int flag, int pdef);
+typedef struct block_list* (*HPMHOOK_pre_battle_get_master) (struct block_list **src);
+typedef struct block_list* (*HPMHOOK_post_battle_get_master) (struct block_list* retVal___, struct block_list *src);
+typedef struct block_list* (*HPMHOOK_pre_battle_get_targeted) (struct block_list **target);
+typedef struct block_list* (*HPMHOOK_post_battle_get_targeted) (struct block_list* retVal___, struct block_list *target);
+typedef struct block_list* (*HPMHOOK_pre_battle_get_enemy) (struct block_list **target, int *type, int *range);
+typedef struct block_list* (*HPMHOOK_post_battle_get_enemy) (struct block_list* retVal___, struct block_list *target, int type, int range);
+typedef int (*HPMHOOK_pre_battle_get_target) (struct block_list **bl);
+typedef int (*HPMHOOK_post_battle_get_target) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_battle_get_current_skill) (struct block_list **bl);
+typedef int (*HPMHOOK_post_battle_get_current_skill) (int retVal___, struct block_list *bl);
+typedef bool (*HPMHOOK_pre_battle_check_undead) (int *race, int *element);
+typedef bool (*HPMHOOK_post_battle_check_undead) (bool retVal___, int race, int element);
+typedef int (*HPMHOOK_pre_battle_check_target) (struct block_list **src, struct block_list **target, int *flag);
+typedef int (*HPMHOOK_post_battle_check_target) (int retVal___, struct block_list *src, struct block_list *target, int flag);
+typedef bool (*HPMHOOK_pre_battle_check_range) (struct block_list **src, struct block_list **bl, int *range);
+typedef bool (*HPMHOOK_post_battle_check_range) (bool retVal___, struct block_list *src, struct block_list *bl, int range);
+typedef void (*HPMHOOK_pre_battle_consume_ammo) (struct map_session_data **sd, int *skill_id, int *lv);
+typedef void (*HPMHOOK_post_battle_consume_ammo) (struct map_session_data *sd, int skill_id, int lv);
+typedef int (*HPMHOOK_pre_battle_get_targeted_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_battle_get_targeted_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_battle_get_enemy_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_battle_get_enemy_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_battle_get_enemy_area_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_battle_get_enemy_area_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_battle_delay_damage_sub) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_battle_delay_damage_sub) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_battle_blewcount_bonus) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_battle_blewcount_bonus) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_battle_range_type) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_battle_range_type) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv);
+typedef int64 (*HPMHOOK_pre_battle_calc_base_damage) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *type, int *flag, int *flag2);
+typedef int64 (*HPMHOOK_post_battle_calc_base_damage) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2);
+typedef int64 (*HPMHOOK_pre_battle_calc_base_damage2) (struct status_data **st, struct weapon_atk **wa, struct status_change **sc, unsigned short *t_size, struct map_session_data **sd, int *flag);
+typedef int64 (*HPMHOOK_post_battle_calc_base_damage2) (int64 retVal___, struct status_data *st, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, struct map_session_data *sd, int flag);
+typedef struct Damage (*HPMHOOK_pre_battle_calc_misc_attack) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
+typedef struct Damage (*HPMHOOK_post_battle_calc_misc_attack) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int mflag);
+typedef struct Damage (*HPMHOOK_pre_battle_calc_magic_attack) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
+typedef struct Damage (*HPMHOOK_post_battle_calc_magic_attack) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int mflag);
+typedef int (*HPMHOOK_pre_battle_adjust_skill_damage) (int *m, unsigned short *skill_id);
+typedef int (*HPMHOOK_post_battle_adjust_skill_damage) (int retVal___, int m, unsigned short skill_id);
+typedef int64 (*HPMHOOK_pre_battle_add_mastery) (struct map_session_data **sd, struct block_list **target, int64 *dmg, int *type);
+typedef int64 (*HPMHOOK_post_battle_add_mastery) (int64 retVal___, struct map_session_data *sd, struct block_list *target, int64 dmg, int type);
+typedef int (*HPMHOOK_pre_battle_calc_drain) (int64 *damage, int *rate, int *per);
+typedef int (*HPMHOOK_post_battle_calc_drain) (int retVal___, int64 damage, int rate, int per);
+typedef bool (*HPMHOOK_pre_battle_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_battle_config_read) (bool retVal___, const char *filename, bool imported);
+typedef void (*HPMHOOK_pre_battle_config_set_defaults) (void);
+typedef void (*HPMHOOK_post_battle_config_set_defaults) (void);
+typedef bool (*HPMHOOK_pre_battle_config_set_value_sub) (int *index, int *value);
+typedef bool (*HPMHOOK_post_battle_config_set_value_sub) (bool retVal___, int index, int value);
+typedef bool (*HPMHOOK_pre_battle_config_set_value) (const char **param, const char **value);
+typedef bool (*HPMHOOK_post_battle_config_set_value) (bool retVal___, const char *param, const char *value);
+typedef bool (*HPMHOOK_pre_battle_config_get_value) (const char **w1, int **value);
+typedef bool (*HPMHOOK_post_battle_config_get_value) (bool retVal___, const char *w1, int *value);
+typedef void (*HPMHOOK_pre_battle_config_adjust) (void);
+typedef void (*HPMHOOK_post_battle_config_adjust) (void);
+typedef struct block_list* (*HPMHOOK_pre_battle_get_enemy_area) (struct block_list **src, int *x, int *y, int *range, int *type, int *ignore_id);
+typedef struct block_list* (*HPMHOOK_post_battle_get_enemy_area) (struct block_list* retVal___, struct block_list *src, int x, int y, int range, int type, int ignore_id);
+typedef int (*HPMHOOK_pre_battle_damage_area) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_battle_damage_area) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_battle_calc_masteryfix_unknown) (struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int64 **damage, int **div, bool **left, bool **weapon);
+typedef void (*HPMHOOK_post_battle_calc_masteryfix_unknown) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
+typedef void (*HPMHOOK_pre_battle_calc_skillratio_magic_unknown) (int **attack_type, struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int **skillratio, int **flag);
+typedef void (*HPMHOOK_post_battle_calc_skillratio_magic_unknown) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
+typedef void (*HPMHOOK_pre_battle_calc_skillratio_weapon_unknown) (int **attack_type, struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int **skillratio, int **flag);
+typedef void (*HPMHOOK_post_battle_calc_skillratio_weapon_unknown) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
+typedef void (*HPMHOOK_pre_battle_calc_misc_attack_unknown) (struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int **mflag, struct Damage **md);
+typedef void (*HPMHOOK_post_battle_calc_misc_attack_unknown) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag, struct Damage *md);
+#endif // MAP_BATTLE_H
+#ifdef MAP_BATTLEGROUND_H /* bg */
+typedef void (*HPMHOOK_pre_bg_init) (bool *minimal);
+typedef void (*HPMHOOK_post_bg_init) (bool minimal);
+typedef void (*HPMHOOK_pre_bg_final) (void);
+typedef void (*HPMHOOK_post_bg_final) (void);
+typedef struct bg_arena* (*HPMHOOK_pre_bg_name2arena) (const char **name);
+typedef struct bg_arena* (*HPMHOOK_post_bg_name2arena) (struct bg_arena* retVal___, const char *name);
+typedef void (*HPMHOOK_pre_bg_queue_add) (struct map_session_data **sd, struct bg_arena **arena, enum bg_queue_types *type);
+typedef void (*HPMHOOK_post_bg_queue_add) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
+typedef enum BATTLEGROUNDS_QUEUE_ACK (*HPMHOOK_pre_bg_can_queue) (struct map_session_data **sd, struct bg_arena **arena, enum bg_queue_types *type);
+typedef enum BATTLEGROUNDS_QUEUE_ACK (*HPMHOOK_post_bg_can_queue) (enum BATTLEGROUNDS_QUEUE_ACK retVal___, struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
+typedef int (*HPMHOOK_pre_bg_id2pos) (int *queue_id, int *account_id);
+typedef int (*HPMHOOK_post_bg_id2pos) (int retVal___, int queue_id, int account_id);
+typedef void (*HPMHOOK_pre_bg_queue_pc_cleanup) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_bg_queue_pc_cleanup) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_bg_begin) (struct bg_arena **arena);
+typedef void (*HPMHOOK_post_bg_begin) (struct bg_arena *arena);
+typedef int (*HPMHOOK_pre_bg_begin_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_bg_begin_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_bg_queue_pregame) (struct bg_arena **arena);
+typedef void (*HPMHOOK_post_bg_queue_pregame) (struct bg_arena *arena);
+typedef int (*HPMHOOK_pre_bg_fillup_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_bg_fillup_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_bg_queue_ready_ack) (struct bg_arena **arena, struct map_session_data **sd, bool *response);
+typedef void (*HPMHOOK_post_bg_queue_ready_ack) (struct bg_arena *arena, struct map_session_data *sd, bool response);
+typedef void (*HPMHOOK_pre_bg_match_over) (struct bg_arena **arena, bool *canceled);
+typedef void (*HPMHOOK_post_bg_match_over) (struct bg_arena *arena, bool canceled);
+typedef void (*HPMHOOK_pre_bg_queue_check) (struct bg_arena **arena);
+typedef void (*HPMHOOK_post_bg_queue_check) (struct bg_arena *arena);
+typedef struct battleground_data* (*HPMHOOK_pre_bg_team_search) (int *bg_id);
+typedef struct battleground_data* (*HPMHOOK_post_bg_team_search) (struct battleground_data* retVal___, int bg_id);
+typedef struct map_session_data* (*HPMHOOK_pre_bg_getavailablesd) (struct battleground_data **bgd);
+typedef struct map_session_data* (*HPMHOOK_post_bg_getavailablesd) (struct map_session_data* retVal___, struct battleground_data *bgd);
+typedef bool (*HPMHOOK_pre_bg_team_delete) (int *bg_id);
+typedef bool (*HPMHOOK_post_bg_team_delete) (bool retVal___, int bg_id);
+typedef bool (*HPMHOOK_pre_bg_team_warp) (int *bg_id, unsigned short *map_index, short *x, short *y);
+typedef bool (*HPMHOOK_post_bg_team_warp) (bool retVal___, int bg_id, unsigned short map_index, short x, short y);
+typedef void (*HPMHOOK_pre_bg_send_dot_remove) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_bg_send_dot_remove) (struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_bg_team_join) (int *bg_id, struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_bg_team_join) (bool retVal___, int bg_id, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_bg_team_leave) (struct map_session_data **sd, enum bg_team_leave_type *flag);
+typedef int (*HPMHOOK_post_bg_team_leave) (int retVal___, struct map_session_data *sd, enum bg_team_leave_type flag);
+typedef bool (*HPMHOOK_pre_bg_member_respawn) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_bg_member_respawn) (bool retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_bg_create) (unsigned short *map_index, short *rx, short *ry, const char **ev, const char **dev);
+typedef int (*HPMHOOK_post_bg_create) (int retVal___, unsigned short map_index, short rx, short ry, const char *ev, const char *dev);
+typedef int (*HPMHOOK_pre_bg_team_get_id) (struct block_list **bl);
+typedef int (*HPMHOOK_post_bg_team_get_id) (int retVal___, struct block_list *bl);
+typedef bool (*HPMHOOK_pre_bg_send_message) (struct map_session_data **sd, const char **mes);
+typedef bool (*HPMHOOK_post_bg_send_message) (bool retVal___, struct map_session_data *sd, const char *mes);
+typedef int (*HPMHOOK_pre_bg_send_xy_timer_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_bg_send_xy_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_bg_send_xy_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_bg_send_xy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_bg_afk_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_bg_afk_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_bg_team_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_bg_team_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef enum bg_queue_types (*HPMHOOK_pre_bg_str2teamtype) (const char **str);
+typedef enum bg_queue_types (*HPMHOOK_post_bg_str2teamtype) (enum bg_queue_types retVal___, const char *str);
+typedef void (*HPMHOOK_pre_bg_config_read) (void);
+typedef void (*HPMHOOK_post_bg_config_read) (void);
+#endif // MAP_BATTLEGROUND_H
+#ifdef MAP_BUYINGSTORE_H /* buyingstore */
+typedef bool (*HPMHOOK_pre_buyingstore_setup) (struct map_session_data **sd, unsigned char *slots);
+typedef bool (*HPMHOOK_post_buyingstore_setup) (bool retVal___, struct map_session_data *sd, unsigned char slots);
+typedef void (*HPMHOOK_pre_buyingstore_create) (struct map_session_data **sd, int *zenylimit, unsigned char *result, const char **storename, const uint8 **itemlist, unsigned int *count);
+typedef void (*HPMHOOK_post_buyingstore_create) (struct map_session_data *sd, int zenylimit, unsigned char result, const char *storename, const uint8 *itemlist, unsigned int count);
+typedef void (*HPMHOOK_pre_buyingstore_close) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_buyingstore_close) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_buyingstore_open) (struct map_session_data **sd, int *account_id);
+typedef void (*HPMHOOK_post_buyingstore_open) (struct map_session_data *sd, int account_id);
+typedef void (*HPMHOOK_pre_buyingstore_trade) (struct map_session_data **sd, int *account_id, unsigned int *buyer_id, const uint8 **itemlist, unsigned int *count);
+typedef void (*HPMHOOK_post_buyingstore_trade) (struct map_session_data *sd, int account_id, unsigned int buyer_id, const uint8 *itemlist, unsigned int count);
+typedef bool (*HPMHOOK_pre_buyingstore_search) (struct map_session_data **sd, unsigned short *nameid);
+typedef bool (*HPMHOOK_post_buyingstore_search) (bool retVal___, struct map_session_data *sd, unsigned short nameid);
+typedef bool (*HPMHOOK_pre_buyingstore_searchall) (struct map_session_data **sd, const struct s_search_store_search **s);
+typedef bool (*HPMHOOK_post_buyingstore_searchall) (bool retVal___, struct map_session_data *sd, const struct s_search_store_search *s);
+typedef unsigned int (*HPMHOOK_pre_buyingstore_getuid) (void);
+typedef unsigned int (*HPMHOOK_post_buyingstore_getuid) (unsigned int retVal___);
+#endif // MAP_BUYINGSTORE_H
+#ifdef MAP_CHANNEL_H /* channel */
+typedef int (*HPMHOOK_pre_channel_init) (bool *minimal);
+typedef int (*HPMHOOK_post_channel_init) (int retVal___, bool minimal);
+typedef void (*HPMHOOK_pre_channel_final) (void);
+typedef void (*HPMHOOK_post_channel_final) (void);
+typedef struct channel_data* (*HPMHOOK_pre_channel_search) (const char **name, struct map_session_data **sd);
+typedef struct channel_data* (*HPMHOOK_post_channel_search) (struct channel_data* retVal___, const char *name, struct map_session_data *sd);
+typedef struct channel_data* (*HPMHOOK_pre_channel_create) (enum channel_types *type, const char **name, unsigned char *color);
+typedef struct channel_data* (*HPMHOOK_post_channel_create) (struct channel_data* retVal___, enum channel_types type, const char *name, unsigned char color);
+typedef void (*HPMHOOK_pre_channel_delete) (struct channel_data **chan);
+typedef void (*HPMHOOK_post_channel_delete) (struct channel_data *chan);
+typedef void (*HPMHOOK_pre_channel_set_password) (struct channel_data **chan, const char **password);
+typedef void (*HPMHOOK_post_channel_set_password) (struct channel_data *chan, const char *password);
+typedef enum channel_operation_status (*HPMHOOK_pre_channel_ban) (struct channel_data **chan, const struct map_session_data **ssd, struct map_session_data **tsd);
+typedef enum channel_operation_status (*HPMHOOK_post_channel_ban) (enum channel_operation_status retVal___, struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd);
+typedef enum channel_operation_status (*HPMHOOK_pre_channel_unban) (struct channel_data **chan, const struct map_session_data **ssd, struct map_session_data **tsd);
+typedef enum channel_operation_status (*HPMHOOK_post_channel_unban) (enum channel_operation_status retVal___, struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_channel_set_options) (struct channel_data **chan, unsigned int *options);
+typedef void (*HPMHOOK_post_channel_set_options) (struct channel_data *chan, unsigned int options);
+typedef void (*HPMHOOK_pre_channel_send) (struct channel_data **chan, struct map_session_data **sd, const char **msg);
+typedef void (*HPMHOOK_post_channel_send) (struct channel_data *chan, struct map_session_data *sd, const char *msg);
+typedef void (*HPMHOOK_pre_channel_join_sub) (struct channel_data **chan, struct map_session_data **sd, bool *stealth);
+typedef void (*HPMHOOK_post_channel_join_sub) (struct channel_data *chan, struct map_session_data *sd, bool stealth);
+typedef enum channel_operation_status (*HPMHOOK_pre_channel_join) (struct channel_data **chan, struct map_session_data **sd, const char **password, bool *silent);
+typedef enum channel_operation_status (*HPMHOOK_post_channel_join) (enum channel_operation_status retVal___, struct channel_data *chan, struct map_session_data *sd, const char *password, bool silent);
+typedef void (*HPMHOOK_pre_channel_leave) (struct channel_data **chan, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_channel_leave) (struct channel_data *chan, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_channel_leave_sub) (struct channel_data **chan, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_channel_leave_sub) (struct channel_data *chan, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_channel_quit) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_channel_quit) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_channel_map_join) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_channel_map_join) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_channel_guild_join_alliance) (const struct guild **g_source, const struct guild **g_ally);
+typedef void (*HPMHOOK_post_channel_guild_join_alliance) (const struct guild *g_source, const struct guild *g_ally);
+typedef void (*HPMHOOK_pre_channel_guild_leave_alliance) (const struct guild **g_source, const struct guild **g_ally);
+typedef void (*HPMHOOK_post_channel_guild_leave_alliance) (const struct guild *g_source, const struct guild *g_ally);
+typedef void (*HPMHOOK_pre_channel_quit_guild) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_channel_quit_guild) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_channel_irc_join) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_channel_irc_join) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_channel_config_read) (void);
+typedef void (*HPMHOOK_post_channel_config_read) (void);
+#endif // MAP_CHANNEL_H
+#ifdef CHAR_CHAR_H /* chr */
+typedef int (*HPMHOOK_pre_chr_waiting_disconnect) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chr_waiting_disconnect) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_chr_delete_char_sql) (int *char_id);
+typedef int (*HPMHOOK_post_chr_delete_char_sql) (int retVal___, int char_id);
+typedef struct DBData (*HPMHOOK_pre_chr_create_online_char_data) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_chr_create_online_char_data) (struct DBData retVal___, union DBKey key, va_list args);
+typedef void (*HPMHOOK_pre_chr_set_account_online) (int *account_id);
+typedef void (*HPMHOOK_post_chr_set_account_online) (int account_id);
+typedef void (*HPMHOOK_pre_chr_set_account_offline) (int *account_id);
+typedef void (*HPMHOOK_post_chr_set_account_offline) (int account_id);
+typedef void (*HPMHOOK_pre_chr_set_char_charselect) (int *account_id);
+typedef void (*HPMHOOK_post_chr_set_char_charselect) (int account_id);
+typedef void (*HPMHOOK_pre_chr_set_char_online) (int *map_id, int *char_id, int *account_id);
+typedef void (*HPMHOOK_post_chr_set_char_online) (int map_id, int char_id, int account_id);
+typedef void (*HPMHOOK_pre_chr_set_char_offline) (int *char_id, int *account_id);
+typedef void (*HPMHOOK_post_chr_set_char_offline) (int char_id, int account_id);
+typedef int (*HPMHOOK_pre_chr_db_setoffline) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chr_db_setoffline) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_chr_db_kickoffline) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chr_db_kickoffline) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_chr_set_login_all_offline) (void);
+typedef void (*HPMHOOK_post_chr_set_login_all_offline) (void);
+typedef void (*HPMHOOK_pre_chr_set_all_offline) (int *id);
+typedef void (*HPMHOOK_post_chr_set_all_offline) (int id);
+typedef void (*HPMHOOK_pre_chr_set_all_offline_sql) (void);
+typedef void (*HPMHOOK_post_chr_set_all_offline_sql) (void);
+typedef struct DBData (*HPMHOOK_pre_chr_create_charstatus) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_chr_create_charstatus) (struct DBData retVal___, union DBKey key, va_list args);
+typedef int (*HPMHOOK_pre_chr_mmo_char_tosql) (int *char_id, struct mmo_charstatus **p);
+typedef int (*HPMHOOK_post_chr_mmo_char_tosql) (int retVal___, int char_id, struct mmo_charstatus *p);
+typedef int (*HPMHOOK_pre_chr_memitemdata_to_sql) (const struct item *items[], int *max, int *id, int *tableswitch);
+typedef int (*HPMHOOK_post_chr_memitemdata_to_sql) (int retVal___, const struct item items[], int max, int id, int tableswitch);
+typedef int (*HPMHOOK_pre_chr_mmo_gender) (const struct char_session_data **sd, const struct mmo_charstatus **p, char *sex);
+typedef int (*HPMHOOK_post_chr_mmo_gender) (int retVal___, const struct char_session_data *sd, const struct mmo_charstatus *p, char sex);
+typedef int (*HPMHOOK_pre_chr_mmo_chars_fromsql) (struct char_session_data **sd, uint8 **buf);
+typedef int (*HPMHOOK_post_chr_mmo_chars_fromsql) (int retVal___, struct char_session_data *sd, uint8 *buf);
+typedef int (*HPMHOOK_pre_chr_mmo_char_fromsql) (int *char_id, struct mmo_charstatus **p, bool *load_everything);
+typedef int (*HPMHOOK_post_chr_mmo_char_fromsql) (int retVal___, int char_id, struct mmo_charstatus *p, bool load_everything);
+typedef int (*HPMHOOK_pre_chr_mmo_char_sql_init) (void);
+typedef int (*HPMHOOK_post_chr_mmo_char_sql_init) (int retVal___);
+typedef bool (*HPMHOOK_pre_chr_char_slotchange) (struct char_session_data **sd, int *fd, unsigned short *from, unsigned short *to);
+typedef bool (*HPMHOOK_post_chr_char_slotchange) (bool retVal___, struct char_session_data *sd, int fd, unsigned short from, unsigned short to);
+typedef int (*HPMHOOK_pre_chr_rename_char_sql) (struct char_session_data **sd, int *char_id);
+typedef int (*HPMHOOK_post_chr_rename_char_sql) (int retVal___, struct char_session_data *sd, int char_id);
+typedef int (*HPMHOOK_pre_chr_check_char_name) (char **name, char **esc_name);
+typedef int (*HPMHOOK_post_chr_check_char_name) (int retVal___, char *name, char *esc_name);
+typedef int (*HPMHOOK_pre_chr_make_new_char_sql) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job, uint8 *sex);
+typedef int (*HPMHOOK_post_chr_make_new_char_sql) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex);
+typedef int (*HPMHOOK_pre_chr_divorce_char_sql) (int *partner_id1, int *partner_id2);
+typedef int (*HPMHOOK_post_chr_divorce_char_sql) (int retVal___, int partner_id1, int partner_id2);
+typedef int (*HPMHOOK_pre_chr_count_users) (void);
+typedef int (*HPMHOOK_post_chr_count_users) (int retVal___);
+typedef int (*HPMHOOK_pre_chr_mmo_char_tobuf) (uint8 **buffer, struct mmo_charstatus **p);
+typedef int (*HPMHOOK_post_chr_mmo_char_tobuf) (int retVal___, uint8 *buffer, struct mmo_charstatus *p);
+typedef void (*HPMHOOK_pre_chr_mmo_char_send099d) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_mmo_char_send099d) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_mmo_char_send_ban_list) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_mmo_char_send_ban_list) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_mmo_char_send_slots_info) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_mmo_char_send_slots_info) (int fd, struct char_session_data *sd);
+typedef int (*HPMHOOK_pre_chr_mmo_char_send_characters) (int *fd, struct char_session_data **sd);
+typedef int (*HPMHOOK_post_chr_mmo_char_send_characters) (int retVal___, int fd, struct char_session_data *sd);
+typedef int (*HPMHOOK_pre_chr_char_married) (int *pl1, int *pl2);
+typedef int (*HPMHOOK_post_chr_char_married) (int retVal___, int pl1, int pl2);
+typedef int (*HPMHOOK_pre_chr_char_child) (int *parent_id, int *child_id);
+typedef int (*HPMHOOK_post_chr_char_child) (int retVal___, int parent_id, int child_id);
+typedef int (*HPMHOOK_pre_chr_char_family) (int *cid1, int *cid2, int *cid3);
+typedef int (*HPMHOOK_post_chr_char_family) (int retVal___, int cid1, int cid2, int cid3);
+typedef void (*HPMHOOK_pre_chr_disconnect_player) (int *account_id);
+typedef void (*HPMHOOK_post_chr_disconnect_player) (int account_id);
+typedef void (*HPMHOOK_pre_chr_authfail_fd) (int *fd, int *type);
+typedef void (*HPMHOOK_post_chr_authfail_fd) (int fd, int type);
+typedef void (*HPMHOOK_pre_chr_request_account_data) (int *account_id);
+typedef void (*HPMHOOK_post_chr_request_account_data) (int account_id);
+typedef void (*HPMHOOK_pre_chr_auth_ok) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_auth_ok) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_ping_login_server) (int *fd);
+typedef void (*HPMHOOK_post_chr_ping_login_server) (int fd);
+typedef int (*HPMHOOK_pre_chr_parse_fromlogin_connection_state) (int *fd);
+typedef int (*HPMHOOK_post_chr_parse_fromlogin_connection_state) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_chr_auth_error) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_chr_auth_error) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_auth_state) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_auth_state) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_account_data) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_account_data) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_login_pong) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_login_pong) (int fd);
+typedef void (*HPMHOOK_pre_chr_changesex) (int *account_id, int *sex);
+typedef void (*HPMHOOK_post_chr_changesex) (int account_id, int sex);
+typedef int (*HPMHOOK_pre_chr_parse_fromlogin_changesex_reply) (int *fd);
+typedef int (*HPMHOOK_post_chr_parse_fromlogin_changesex_reply) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_account_reg2) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_account_reg2) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_ban) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_ban) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_kick) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_kick) (int fd);
+typedef void (*HPMHOOK_pre_chr_update_ip) (int *fd);
+typedef void (*HPMHOOK_post_chr_update_ip) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_update_ip) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_update_ip) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_accinfo2_failed) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_accinfo2_failed) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_fromlogin_accinfo2_ok) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_fromlogin_accinfo2_ok) (int fd);
+typedef int (*HPMHOOK_pre_chr_parse_fromlogin) (int *fd);
+typedef int (*HPMHOOK_post_chr_parse_fromlogin) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_chr_request_accreg2) (int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_chr_request_accreg2) (int retVal___, int account_id, int char_id);
+typedef void (*HPMHOOK_pre_chr_global_accreg_to_login_start) (int *account_id, int *char_id);
+typedef void (*HPMHOOK_post_chr_global_accreg_to_login_start) (int account_id, int char_id);
+typedef void (*HPMHOOK_pre_chr_global_accreg_to_login_send) (void);
+typedef void (*HPMHOOK_post_chr_global_accreg_to_login_send) (void);
+typedef void (*HPMHOOK_pre_chr_global_accreg_to_login_add) (const char **key, unsigned int *index, intptr_t *val, bool *is_string);
+typedef void (*HPMHOOK_post_chr_global_accreg_to_login_add) (const char *key, unsigned int index, intptr_t val, bool is_string);
+typedef void (*HPMHOOK_pre_chr_read_fame_list) (void);
+typedef void (*HPMHOOK_post_chr_read_fame_list) (void);
+typedef int (*HPMHOOK_pre_chr_send_fame_list) (int *fd);
+typedef int (*HPMHOOK_post_chr_send_fame_list) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_chr_update_fame_list) (int *type, int *index, int *fame);
+typedef void (*HPMHOOK_post_chr_update_fame_list) (int type, int index, int fame);
+typedef int (*HPMHOOK_pre_chr_loadName) (int *char_id, char **name);
+typedef int (*HPMHOOK_post_chr_loadName) (int retVal___, int char_id, char *name);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_datasync) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_datasync) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_skillid2idx) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_skillid2idx) (int fd);
+typedef void (*HPMHOOK_pre_chr_map_received_ok) (int *fd);
+typedef void (*HPMHOOK_post_chr_map_received_ok) (int fd);
+typedef void (*HPMHOOK_pre_chr_send_maps) (int *fd, int *id, int *j);
+typedef void (*HPMHOOK_post_chr_send_maps) (int fd, int id, int j);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_map_names) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_map_names) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_send_scdata) (int *fd, int *aid, int *cid);
+typedef void (*HPMHOOK_post_chr_send_scdata) (int fd, int aid, int cid);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_request_scdata) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_request_scdata) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_set_users_count) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_set_users_count) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_set_users) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_set_users) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_save_character_ack) (int *fd, int *aid, int *cid);
+typedef void (*HPMHOOK_post_chr_save_character_ack) (int fd, int aid, int cid);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_save_character) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_save_character) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_select_ack) (int *fd, int *account_id, uint8 *flag);
+typedef void (*HPMHOOK_post_chr_select_ack) (int fd, int account_id, uint8 flag);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_char_select_req) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_char_select_req) (int fd);
+typedef void (*HPMHOOK_pre_chr_change_map_server_ack) (int *fd, const uint8 **data, bool *ok);
+typedef void (*HPMHOOK_post_chr_change_map_server_ack) (int fd, const uint8 *data, bool ok);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_change_map_server) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_change_map_server) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_remove_friend) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_remove_friend) (int fd);
+typedef void (*HPMHOOK_pre_chr_char_name_ack) (int *fd, int *char_id);
+typedef void (*HPMHOOK_post_chr_char_name_ack) (int fd, int char_id);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_char_name_request) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_char_name_request) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_change_email) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_change_email) (int fd);
+typedef void (*HPMHOOK_pre_chr_ban) (int *account_id, int *char_id, time_t **unban_time, short *year, short *month, short *day, short *hour, short *minute, short *second);
+typedef void (*HPMHOOK_post_chr_ban) (int account_id, int char_id, time_t *unban_time, short year, short month, short day, short hour, short minute, short second);
+typedef void (*HPMHOOK_pre_chr_unban) (int *char_id, int **result);
+typedef void (*HPMHOOK_post_chr_unban) (int char_id, int *result);
+typedef void (*HPMHOOK_pre_chr_ask_name_ack) (int *fd, int *acc, const char **name, int *type, int *result);
+typedef void (*HPMHOOK_post_chr_ask_name_ack) (int fd, int acc, const char *name, int type, int result);
+typedef int (*HPMHOOK_pre_chr_changecharsex) (int *char_id, int *sex);
+typedef int (*HPMHOOK_post_chr_changecharsex) (int retVal___, int char_id, int sex);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_change_account) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_change_account) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_fame_list) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_fame_list) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_divorce_char) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_divorce_char) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_ragsrvinfo) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_ragsrvinfo) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_set_char_offline) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_set_char_offline) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_set_all_offline) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_set_all_offline) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_set_char_online) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_set_char_online) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_build_fame_list) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_build_fame_list) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_save_status_change_data) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_save_status_change_data) (int fd);
+typedef void (*HPMHOOK_pre_chr_send_pong) (int *fd);
+typedef void (*HPMHOOK_post_chr_send_pong) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_ping) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_ping) (int fd);
+typedef void (*HPMHOOK_pre_chr_map_auth_ok) (int *fd, int *account_id, struct char_auth_node **node, struct mmo_charstatus **cd);
+typedef void (*HPMHOOK_post_chr_map_auth_ok) (int fd, int account_id, struct char_auth_node *node, struct mmo_charstatus *cd);
+typedef void (*HPMHOOK_pre_chr_map_auth_failed) (int *fd, int *account_id, int *char_id, int *login_id1, char *sex, uint32 *ip);
+typedef void (*HPMHOOK_post_chr_map_auth_failed) (int fd, int account_id, int char_id, int login_id1, char sex, uint32 ip);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_auth_request) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_auth_request) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_update_ip) (int *fd, int *id);
+typedef void (*HPMHOOK_post_chr_parse_frommap_update_ip) (int fd, int id);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_request_stats_report) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_request_stats_report) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_scdata_update) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_scdata_update) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_frommap_scdata_delete) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_frommap_scdata_delete) (int fd);
+typedef int (*HPMHOOK_pre_chr_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_chr_parse_frommap) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_chr_search_mapserver) (unsigned short *map, uint32 *ip, uint16 *port);
+typedef int (*HPMHOOK_post_chr_search_mapserver) (int retVal___, unsigned short map, uint32 ip, uint16 port);
+typedef int (*HPMHOOK_pre_chr_mapif_init) (int *fd);
+typedef int (*HPMHOOK_post_chr_mapif_init) (int retVal___, int fd);
+typedef uint32 (*HPMHOOK_pre_chr_lan_subnet_check) (uint32 *ip);
+typedef uint32 (*HPMHOOK_post_chr_lan_subnet_check) (uint32 retVal___, uint32 ip);
+typedef void (*HPMHOOK_pre_chr_delete2_ack) (int *fd, int *char_id, uint32 *result, time_t *delete_date);
+typedef void (*HPMHOOK_post_chr_delete2_ack) (int fd, int char_id, uint32 result, time_t delete_date);
+typedef void (*HPMHOOK_pre_chr_delete2_accept_actual_ack) (int *fd, int *char_id, uint32 *result);
+typedef void (*HPMHOOK_post_chr_delete2_accept_actual_ack) (int fd, int char_id, uint32 result);
+typedef void (*HPMHOOK_pre_chr_delete2_accept_ack) (int *fd, int *char_id, uint32 *result);
+typedef void (*HPMHOOK_post_chr_delete2_accept_ack) (int fd, int char_id, uint32 result);
+typedef void (*HPMHOOK_pre_chr_delete2_cancel_ack) (int *fd, int *char_id, uint32 *result);
+typedef void (*HPMHOOK_post_chr_delete2_cancel_ack) (int fd, int char_id, uint32 result);
+typedef void (*HPMHOOK_pre_chr_delete2_req) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_delete2_req) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_delete2_accept) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_delete2_accept) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_delete2_cancel) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_delete2_cancel) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_send_account_id) (int *fd, int *account_id);
+typedef void (*HPMHOOK_post_chr_send_account_id) (int fd, int account_id);
+typedef void (*HPMHOOK_pre_chr_parse_char_connect) (int *fd, struct char_session_data **sd, uint32 *ipl);
+typedef void (*HPMHOOK_post_chr_parse_char_connect) (int fd, struct char_session_data *sd, uint32 ipl);
+typedef void (*HPMHOOK_pre_chr_send_map_info) (int *fd, int *i, uint32 *subnet_map_ip, struct mmo_charstatus **cd);
+typedef void (*HPMHOOK_post_chr_send_map_info) (int fd, int i, uint32 subnet_map_ip, struct mmo_charstatus *cd);
+typedef void (*HPMHOOK_pre_chr_send_wait_char_server) (int *fd);
+typedef void (*HPMHOOK_post_chr_send_wait_char_server) (int fd);
+typedef int (*HPMHOOK_pre_chr_search_default_maps_mapserver) (struct mmo_charstatus **cd);
+typedef int (*HPMHOOK_post_chr_search_default_maps_mapserver) (int retVal___, struct mmo_charstatus *cd);
+typedef void (*HPMHOOK_pre_chr_parse_char_select) (int *fd, struct char_session_data **sd, uint32 *ipl);
+typedef void (*HPMHOOK_post_chr_parse_char_select) (int fd, struct char_session_data *sd, uint32 ipl);
+typedef void (*HPMHOOK_pre_chr_creation_failed) (int *fd, int *result);
+typedef void (*HPMHOOK_post_chr_creation_failed) (int fd, int result);
+typedef void (*HPMHOOK_pre_chr_creation_ok) (int *fd, struct mmo_charstatus **char_dat);
+typedef void (*HPMHOOK_post_chr_creation_ok) (int fd, struct mmo_charstatus *char_dat);
+typedef void (*HPMHOOK_pre_chr_parse_char_create_new_char) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_create_new_char) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_delete_char_failed) (int *fd, int *flag);
+typedef void (*HPMHOOK_post_chr_delete_char_failed) (int fd, int flag);
+typedef void (*HPMHOOK_pre_chr_delete_char_ok) (int *fd);
+typedef void (*HPMHOOK_post_chr_delete_char_ok) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_char_delete_char) (int *fd, struct char_session_data **sd, unsigned short *cmd);
+typedef void (*HPMHOOK_post_chr_parse_char_delete_char) (int fd, struct char_session_data *sd, unsigned short cmd);
+typedef void (*HPMHOOK_pre_chr_parse_char_ping) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_char_ping) (int fd);
+typedef void (*HPMHOOK_pre_chr_allow_rename) (int *fd, int *flag);
+typedef void (*HPMHOOK_post_chr_allow_rename) (int fd, int flag);
+typedef void (*HPMHOOK_pre_chr_parse_char_rename_char) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_rename_char) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_rename_char2) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_rename_char2) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_rename_char_ack) (int *fd, int *flag);
+typedef void (*HPMHOOK_post_chr_rename_char_ack) (int fd, int flag);
+typedef void (*HPMHOOK_pre_chr_parse_char_rename_char_confirm) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_rename_char_confirm) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_captcha_notsupported) (int *fd);
+typedef void (*HPMHOOK_post_chr_captcha_notsupported) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_char_request_captcha) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_char_request_captcha) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_char_check_captcha) (int *fd);
+typedef void (*HPMHOOK_post_chr_parse_char_check_captcha) (int fd);
+typedef void (*HPMHOOK_pre_chr_parse_char_delete2_req) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_delete2_req) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_delete2_accept) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_delete2_accept) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_delete2_cancel) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_delete2_cancel) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_login_map_server_ack) (int *fd, uint8 *flag);
+typedef void (*HPMHOOK_post_chr_login_map_server_ack) (int fd, uint8 flag);
+typedef void (*HPMHOOK_pre_chr_parse_char_login_map_server) (int *fd, uint32 *ipl);
+typedef void (*HPMHOOK_post_chr_parse_char_login_map_server) (int fd, uint32 ipl);
+typedef void (*HPMHOOK_pre_chr_parse_char_pincode_check) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_pincode_check) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_pincode_window) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_pincode_window) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_pincode_change) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_pincode_change) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_pincode_first_pin) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_pincode_first_pin) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_parse_char_request_chars) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_request_chars) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_chr_change_character_slot_ack) (int *fd, bool *ret);
+typedef void (*HPMHOOK_post_chr_change_character_slot_ack) (int fd, bool ret);
+typedef void (*HPMHOOK_pre_chr_parse_char_move_character) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_chr_parse_char_move_character) (int fd, struct char_session_data *sd);
+typedef int (*HPMHOOK_pre_chr_parse_char_unknown_packet) (int *fd, uint32 *ipl);
+typedef int (*HPMHOOK_post_chr_parse_char_unknown_packet) (int retVal___, int fd, uint32 ipl);
+typedef int (*HPMHOOK_pre_chr_parse_char) (int *fd);
+typedef int (*HPMHOOK_post_chr_parse_char) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_chr_broadcast_user_count) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chr_broadcast_user_count) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_chr_send_accounts_tologin_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chr_send_accounts_tologin_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_chr_send_accounts_tologin) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chr_send_accounts_tologin) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_chr_check_connect_login_server) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chr_check_connect_login_server) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_chr_online_data_cleanup_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chr_online_data_cleanup_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_chr_online_data_cleanup) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chr_online_data_cleanup) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef bool (*HPMHOOK_pre_chr_sql_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_chr_sql_config_read) (bool retVal___, const char *filename, bool imported);
+typedef bool (*HPMHOOK_pre_chr_sql_config_read_registry) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_sql_config_read_registry) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_sql_config_read_pc) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_sql_config_read_pc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_sql_config_read_guild) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_sql_config_read_guild) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read) (bool retVal___, const char *filename, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_database) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_database) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_console) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_console) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_player_fame) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_player_fame) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_player_deletion) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_player_deletion) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_player_name) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_player_name) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef void (*HPMHOOK_pre_chr_config_set_start_item) (const struct config_setting_t **setting);
+typedef void (*HPMHOOK_post_chr_config_set_start_item) (const struct config_setting_t *setting);
+typedef bool (*HPMHOOK_pre_chr_config_read_player_new) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_player_new) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_player) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_player) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_permission) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_permission) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_set_ip) (const char **type, const char **value, uint32 **out_ip, char **out_ip_str);
+typedef bool (*HPMHOOK_post_chr_config_set_ip) (bool retVal___, const char *type, const char *value, uint32 *out_ip, char *out_ip_str);
+typedef bool (*HPMHOOK_pre_chr_config_read_inter) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_inter) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_chr_config_read_top) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_chr_config_read_top) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+#endif // CHAR_CHAR_H
+#ifdef MAP_CHAT_H /* chat */
+typedef bool (*HPMHOOK_pre_chat_create_pc_chat) (struct map_session_data **sd, const char **title, const char **pass, int *limit, bool *pub);
+typedef bool (*HPMHOOK_post_chat_create_pc_chat) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub);
+typedef bool (*HPMHOOK_pre_chat_join) (struct map_session_data **sd, int *chatid, const char **pass);
+typedef bool (*HPMHOOK_post_chat_join) (bool retVal___, struct map_session_data *sd, int chatid, const char *pass);
+typedef int (*HPMHOOK_pre_chat_leave) (struct map_session_data **sd, bool *kicked);
+typedef int (*HPMHOOK_post_chat_leave) (int retVal___, struct map_session_data *sd, bool kicked);
+typedef bool (*HPMHOOK_pre_chat_change_owner) (struct map_session_data **sd, const char **nextownername);
+typedef bool (*HPMHOOK_post_chat_change_owner) (bool retVal___, struct map_session_data *sd, const char *nextownername);
+typedef bool (*HPMHOOK_pre_chat_change_status) (struct map_session_data **sd, const char **title, const char **pass, int *limit, bool *pub);
+typedef bool (*HPMHOOK_post_chat_change_status) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub);
+typedef bool (*HPMHOOK_pre_chat_kick) (struct map_session_data **sd, const char **kickusername);
+typedef bool (*HPMHOOK_post_chat_kick) (bool retVal___, struct map_session_data *sd, const char *kickusername);
+typedef bool (*HPMHOOK_pre_chat_create_npc_chat) (struct npc_data **nd, const char **title, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level);
+typedef bool (*HPMHOOK_post_chat_create_npc_chat) (bool retVal___, struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level);
+typedef bool (*HPMHOOK_pre_chat_delete_npc_chat) (struct npc_data **nd);
+typedef bool (*HPMHOOK_post_chat_delete_npc_chat) (bool retVal___, struct npc_data *nd);
+typedef bool (*HPMHOOK_pre_chat_enable_event) (struct chat_data **cd);
+typedef bool (*HPMHOOK_post_chat_enable_event) (bool retVal___, struct chat_data *cd);
+typedef bool (*HPMHOOK_pre_chat_disable_event) (struct chat_data **cd);
+typedef bool (*HPMHOOK_post_chat_disable_event) (bool retVal___, struct chat_data *cd);
+typedef bool (*HPMHOOK_pre_chat_npc_kick_all) (struct chat_data **cd);
+typedef bool (*HPMHOOK_post_chat_npc_kick_all) (bool retVal___, struct chat_data *cd);
+typedef bool (*HPMHOOK_pre_chat_trigger_event) (struct chat_data **cd);
+typedef bool (*HPMHOOK_post_chat_trigger_event) (bool retVal___, struct chat_data *cd);
+typedef struct chat_data* (*HPMHOOK_pre_chat_create) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level);
+typedef struct chat_data* (*HPMHOOK_post_chat_create) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level);
+#endif // MAP_CHAT_H
+#ifdef MAP_CHRIF_H /* chrif */
+typedef void (*HPMHOOK_pre_chrif_init) (bool *minimal);
+typedef void (*HPMHOOK_post_chrif_init) (bool minimal);
+typedef void (*HPMHOOK_pre_chrif_final) (void);
+typedef void (*HPMHOOK_post_chrif_final) (void);
+typedef void (*HPMHOOK_pre_chrif_setuserid) (char **id);
+typedef void (*HPMHOOK_post_chrif_setuserid) (char *id);
+typedef void (*HPMHOOK_pre_chrif_setpasswd) (char **pwd);
+typedef void (*HPMHOOK_post_chrif_setpasswd) (char *pwd);
+typedef void (*HPMHOOK_pre_chrif_checkdefaultlogin) (void);
+typedef void (*HPMHOOK_post_chrif_checkdefaultlogin) (void);
+typedef bool (*HPMHOOK_pre_chrif_setip) (const char **ip);
+typedef bool (*HPMHOOK_post_chrif_setip) (bool retVal___, const char *ip);
+typedef void (*HPMHOOK_pre_chrif_setport) (uint16 *port);
+typedef void (*HPMHOOK_post_chrif_setport) (uint16 port);
+typedef int (*HPMHOOK_pre_chrif_isconnected) (void);
+typedef int (*HPMHOOK_post_chrif_isconnected) (int retVal___);
+typedef void (*HPMHOOK_pre_chrif_check_shutdown) (void);
+typedef void (*HPMHOOK_post_chrif_check_shutdown) (void);
+typedef struct auth_node* (*HPMHOOK_pre_chrif_search) (int *account_id);
+typedef struct auth_node* (*HPMHOOK_post_chrif_search) (struct auth_node* retVal___, int account_id);
+typedef struct auth_node* (*HPMHOOK_pre_chrif_auth_check) (int *account_id, int *char_id, enum sd_state *state);
+typedef struct auth_node* (*HPMHOOK_post_chrif_auth_check) (struct auth_node* retVal___, int account_id, int char_id, enum sd_state state);
+typedef bool (*HPMHOOK_pre_chrif_auth_delete) (int *account_id, int *char_id, enum sd_state *state);
+typedef bool (*HPMHOOK_post_chrif_auth_delete) (bool retVal___, int account_id, int char_id, enum sd_state state);
+typedef bool (*HPMHOOK_pre_chrif_auth_finished) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_chrif_auth_finished) (bool retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_chrif_authreq) (struct map_session_data **sd, bool *hstandalone);
+typedef void (*HPMHOOK_post_chrif_authreq) (struct map_session_data *sd, bool hstandalone);
+typedef void (*HPMHOOK_pre_chrif_authok) (int *fd);
+typedef void (*HPMHOOK_post_chrif_authok) (int fd);
+typedef bool (*HPMHOOK_pre_chrif_scdata_request) (int *account_id, int *char_id);
+typedef bool (*HPMHOOK_post_chrif_scdata_request) (bool retVal___, int account_id, int char_id);
+typedef bool (*HPMHOOK_pre_chrif_save) (struct map_session_data **sd, int *flag);
+typedef bool (*HPMHOOK_post_chrif_save) (bool retVal___, struct map_session_data *sd, int flag);
+typedef bool (*HPMHOOK_pre_chrif_charselectreq) (struct map_session_data **sd, uint32 *s_ip);
+typedef bool (*HPMHOOK_post_chrif_charselectreq) (bool retVal___, struct map_session_data *sd, uint32 s_ip);
+typedef bool (*HPMHOOK_pre_chrif_changemapserver) (struct map_session_data **sd, uint32 *ip, uint16 *port);
+typedef bool (*HPMHOOK_post_chrif_changemapserver) (bool retVal___, struct map_session_data *sd, uint32 ip, uint16 port);
+typedef bool (*HPMHOOK_pre_chrif_searchcharid) (int *char_id);
+typedef bool (*HPMHOOK_post_chrif_searchcharid) (bool retVal___, int char_id);
+typedef bool (*HPMHOOK_pre_chrif_changeemail) (int *id, const char **actual_email, const char **new_email);
+typedef bool (*HPMHOOK_post_chrif_changeemail) (bool retVal___, int id, const char *actual_email, const char *new_email);
+typedef bool (*HPMHOOK_pre_chrif_char_ask_name) (int *acc, const char **character_name, unsigned short *operation_type, int *year, int *month, int *day, int *hour, int *minute, int *second);
+typedef bool (*HPMHOOK_post_chrif_char_ask_name) (bool retVal___, int acc, const char *character_name, unsigned short operation_type, int year, int month, int day, int hour, int minute, int second);
+typedef int (*HPMHOOK_pre_chrif_updatefamelist) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_chrif_updatefamelist) (int retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_chrif_buildfamelist) (void);
+typedef bool (*HPMHOOK_post_chrif_buildfamelist) (bool retVal___);
+typedef bool (*HPMHOOK_pre_chrif_save_scdata) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_chrif_save_scdata) (bool retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_chrif_ragsrvinfo) (int *base_rate, int *job_rate, int *drop_rate);
+typedef bool (*HPMHOOK_post_chrif_ragsrvinfo) (bool retVal___, int base_rate, int job_rate, int drop_rate);
+typedef bool (*HPMHOOK_pre_chrif_char_offline_nsd) (int *account_id, int *char_id);
+typedef bool (*HPMHOOK_post_chrif_char_offline_nsd) (bool retVal___, int account_id, int char_id);
+typedef bool (*HPMHOOK_pre_chrif_char_reset_offline) (void);
+typedef bool (*HPMHOOK_post_chrif_char_reset_offline) (bool retVal___);
+typedef bool (*HPMHOOK_pre_chrif_send_users_tochar) (void);
+typedef bool (*HPMHOOK_post_chrif_send_users_tochar) (bool retVal___);
+typedef bool (*HPMHOOK_pre_chrif_char_online) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_chrif_char_online) (bool retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_chrif_changesex) (struct map_session_data **sd, bool *change_account);
+typedef bool (*HPMHOOK_post_chrif_changesex) (bool retVal___, struct map_session_data *sd, bool change_account);
+typedef bool (*HPMHOOK_pre_chrif_divorce) (int *partner_id1, int *partner_id2);
+typedef bool (*HPMHOOK_post_chrif_divorce) (bool retVal___, int partner_id1, int partner_id2);
+typedef bool (*HPMHOOK_pre_chrif_removefriend) (int *char_id, int *friend_id);
+typedef bool (*HPMHOOK_post_chrif_removefriend) (bool retVal___, int char_id, int friend_id);
+typedef void (*HPMHOOK_pre_chrif_send_report) (char **buf, int *len);
+typedef void (*HPMHOOK_post_chrif_send_report) (char *buf, int len);
+typedef bool (*HPMHOOK_pre_chrif_flush) (void);
+typedef bool (*HPMHOOK_post_chrif_flush) (bool retVal___);
+typedef void (*HPMHOOK_pre_chrif_skillid2idx) (int *fd);
+typedef void (*HPMHOOK_post_chrif_skillid2idx) (int fd);
+typedef bool (*HPMHOOK_pre_chrif_sd_to_auth) (struct map_session_data **sd, enum sd_state *state);
+typedef bool (*HPMHOOK_post_chrif_sd_to_auth) (bool retVal___, struct map_session_data *sd, enum sd_state state);
+typedef int (*HPMHOOK_pre_chrif_check_connect_char_server) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chrif_check_connect_char_server) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef bool (*HPMHOOK_pre_chrif_auth_logout) (struct map_session_data **sd, enum sd_state *state);
+typedef bool (*HPMHOOK_post_chrif_auth_logout) (bool retVal___, struct map_session_data *sd, enum sd_state state);
+typedef void (*HPMHOOK_pre_chrif_save_ack) (int *fd);
+typedef void (*HPMHOOK_post_chrif_save_ack) (int fd);
+typedef int (*HPMHOOK_pre_chrif_reconnect) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chrif_reconnect) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_chrif_auth_db_cleanup_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chrif_auth_db_cleanup_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef bool (*HPMHOOK_pre_chrif_char_ask_name_answer) (int *acc, const char **player_name, uint16 *type, uint16 *answer);
+typedef bool (*HPMHOOK_post_chrif_char_ask_name_answer) (bool retVal___, int acc, const char *player_name, uint16 type, uint16 answer);
+typedef int (*HPMHOOK_pre_chrif_auth_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_chrif_auth_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_chrif_send_usercount_tochar) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chrif_send_usercount_tochar) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_chrif_auth_db_cleanup) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_chrif_auth_db_cleanup) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_chrif_connect) (int *fd);
+typedef void (*HPMHOOK_post_chrif_connect) (int fd);
+typedef void (*HPMHOOK_pre_chrif_connectack) (int *fd);
+typedef void (*HPMHOOK_post_chrif_connectack) (int fd);
+typedef void (*HPMHOOK_pre_chrif_sendmap) (int *fd);
+typedef void (*HPMHOOK_post_chrif_sendmap) (int fd);
+typedef void (*HPMHOOK_pre_chrif_sendmapack) (int *fd);
+typedef void (*HPMHOOK_post_chrif_sendmapack) (int fd);
+typedef void (*HPMHOOK_pre_chrif_recvmap) (int *fd);
+typedef void (*HPMHOOK_post_chrif_recvmap) (int fd);
+typedef bool (*HPMHOOK_pre_chrif_changemapserverack) (int *account_id, int *login_id1, int *login_id2, int *char_id, short *map_index, short *x, short *y, uint32 *ip, uint16 *port);
+typedef bool (*HPMHOOK_post_chrif_changemapserverack) (bool retVal___, int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port);
+typedef void (*HPMHOOK_pre_chrif_changedsex) (int *fd);
+typedef void (*HPMHOOK_post_chrif_changedsex) (int fd);
+typedef bool (*HPMHOOK_pre_chrif_divorceack) (int *char_id, int *partner_id);
+typedef bool (*HPMHOOK_post_chrif_divorceack) (bool retVal___, int char_id, int partner_id);
+typedef void (*HPMHOOK_pre_chrif_idbanned) (int *fd);
+typedef void (*HPMHOOK_post_chrif_idbanned) (int fd);
+typedef void (*HPMHOOK_pre_chrif_recvfamelist) (int *fd);
+typedef void (*HPMHOOK_post_chrif_recvfamelist) (int fd);
+typedef bool (*HPMHOOK_pre_chrif_load_scdata) (int *fd);
+typedef bool (*HPMHOOK_post_chrif_load_scdata) (bool retVal___, int fd);
+typedef void (*HPMHOOK_pre_chrif_update_ip) (int *fd);
+typedef void (*HPMHOOK_post_chrif_update_ip) (int fd);
+typedef int (*HPMHOOK_pre_chrif_disconnectplayer) (int *fd);
+typedef int (*HPMHOOK_post_chrif_disconnectplayer) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_chrif_removemap) (int *fd);
+typedef void (*HPMHOOK_post_chrif_removemap) (int fd);
+typedef int (*HPMHOOK_pre_chrif_updatefamelist_ack) (int *fd);
+typedef int (*HPMHOOK_post_chrif_updatefamelist_ack) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_chrif_keepalive) (int *fd);
+typedef void (*HPMHOOK_post_chrif_keepalive) (int fd);
+typedef void (*HPMHOOK_pre_chrif_keepalive_ack) (int *fd);
+typedef void (*HPMHOOK_post_chrif_keepalive_ack) (int fd);
+typedef void (*HPMHOOK_pre_chrif_deadopt) (int *father_id, int *mother_id, int *child_id);
+typedef void (*HPMHOOK_post_chrif_deadopt) (int father_id, int mother_id, int child_id);
+typedef void (*HPMHOOK_pre_chrif_authfail) (int *fd);
+typedef void (*HPMHOOK_post_chrif_authfail) (int fd);
+typedef void (*HPMHOOK_pre_chrif_on_ready) (void);
+typedef void (*HPMHOOK_post_chrif_on_ready) (void);
+typedef void (*HPMHOOK_pre_chrif_on_disconnect) (void);
+typedef void (*HPMHOOK_post_chrif_on_disconnect) (void);
+typedef int (*HPMHOOK_pre_chrif_parse) (int *fd);
+typedef int (*HPMHOOK_post_chrif_parse) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_chrif_save_scdata_single) (int *account_id, int *char_id, short *type, struct status_change_entry **sce);
+typedef void (*HPMHOOK_post_chrif_save_scdata_single) (int account_id, int char_id, short type, struct status_change_entry *sce);
+typedef void (*HPMHOOK_pre_chrif_del_scdata_single) (int *account_id, int *char_id, short *type);
+typedef void (*HPMHOOK_post_chrif_del_scdata_single) (int account_id, int char_id, short type);
+#endif // MAP_CHRIF_H
+#ifdef MAP_CLIF_H /* clif */
+typedef int (*HPMHOOK_pre_clif_init) (bool *minimal);
+typedef int (*HPMHOOK_post_clif_init) (int retVal___, bool minimal);
+typedef void (*HPMHOOK_pre_clif_final) (void);
+typedef void (*HPMHOOK_post_clif_final) (void);
+typedef bool (*HPMHOOK_pre_clif_setip) (const char **ip);
+typedef bool (*HPMHOOK_post_clif_setip) (bool retVal___, const char *ip);
+typedef bool (*HPMHOOK_pre_clif_setbindip) (const char **ip);
+typedef bool (*HPMHOOK_post_clif_setbindip) (bool retVal___, const char *ip);
+typedef void (*HPMHOOK_pre_clif_setport) (uint16 *port);
+typedef void (*HPMHOOK_post_clif_setport) (uint16 port);
+typedef uint32 (*HPMHOOK_pre_clif_refresh_ip) (void);
+typedef uint32 (*HPMHOOK_post_clif_refresh_ip) (uint32 retVal___);
+typedef bool (*HPMHOOK_pre_clif_send) (const void **buf, int *len, struct block_list **bl, enum send_target *type);
+typedef bool (*HPMHOOK_post_clif_send) (bool retVal___, const void *buf, int len, struct block_list *bl, enum send_target type);
+typedef int (*HPMHOOK_pre_clif_send_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_clif_send_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_clif_send_actual) (int *fd, void **buf, int *len);
+typedef int (*HPMHOOK_post_clif_send_actual) (int retVal___, int fd, void *buf, int len);
+typedef int (*HPMHOOK_pre_clif_parse) (int *fd);
+typedef int (*HPMHOOK_post_clif_parse) (int retVal___, int fd);
+typedef const struct s_packet_db* (*HPMHOOK_pre_clif_packet) (int *packet_id);
+typedef const struct s_packet_db* (*HPMHOOK_post_clif_packet) (const struct s_packet_db* retVal___, int packet_id);
+typedef unsigned short (*HPMHOOK_pre_clif_parse_cmd) (int *fd, struct map_session_data **sd);
+typedef unsigned short (*HPMHOOK_post_clif_parse_cmd) (unsigned short retVal___, int fd, struct map_session_data *sd);
+typedef unsigned short (*HPMHOOK_pre_clif_decrypt_cmd) (int *cmd, struct map_session_data **sd);
+typedef unsigned short (*HPMHOOK_post_clif_decrypt_cmd) (unsigned short retVal___, int cmd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_authok) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_authok) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_authrefuse) (int *fd, uint8 *error_code);
+typedef void (*HPMHOOK_post_clif_authrefuse) (int fd, uint8 error_code);
+typedef void (*HPMHOOK_pre_clif_authfail_fd) (int *fd, int *type);
+typedef void (*HPMHOOK_post_clif_authfail_fd) (int fd, int type);
+typedef void (*HPMHOOK_pre_clif_charselectok) (int *id, uint8 *ok);
+typedef void (*HPMHOOK_post_clif_charselectok) (int id, uint8 ok);
+typedef void (*HPMHOOK_pre_clif_dropflooritem) (struct flooritem_data **fitem);
+typedef void (*HPMHOOK_post_clif_dropflooritem) (struct flooritem_data *fitem);
+typedef void (*HPMHOOK_pre_clif_clearflooritem) (struct flooritem_data **fitem, int *fd);
+typedef void (*HPMHOOK_post_clif_clearflooritem) (struct flooritem_data *fitem, int fd);
+typedef void (*HPMHOOK_pre_clif_additem) (struct map_session_data **sd, int *n, int *amount, int *fail);
+typedef void (*HPMHOOK_post_clif_additem) (struct map_session_data *sd, int n, int amount, int fail);
+typedef void (*HPMHOOK_pre_clif_dropitem) (struct map_session_data **sd, int *n, int *amount);
+typedef void (*HPMHOOK_post_clif_dropitem) (struct map_session_data *sd, int n, int amount);
+typedef void (*HPMHOOK_pre_clif_delitem) (struct map_session_data **sd, int *n, int *amount, short *reason);
+typedef void (*HPMHOOK_post_clif_delitem) (struct map_session_data *sd, int n, int amount, short reason);
+typedef void (*HPMHOOK_pre_clif_takeitem) (struct block_list **src, struct block_list **dst);
+typedef void (*HPMHOOK_post_clif_takeitem) (struct block_list *src, struct block_list *dst);
+typedef void (*HPMHOOK_pre_clif_item_equip) (short *idx, struct EQUIPITEM_INFO **p, struct item **i, struct item_data **id, int *eqp_pos);
+typedef void (*HPMHOOK_post_clif_item_equip) (short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos);
+typedef void (*HPMHOOK_pre_clif_item_normal) (short *idx, struct NORMALITEM_INFO **p, struct item **i, struct item_data **id);
+typedef void (*HPMHOOK_post_clif_item_normal) (short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
+typedef void (*HPMHOOK_pre_clif_arrowequip) (struct map_session_data **sd, int *val);
+typedef void (*HPMHOOK_post_clif_arrowequip) (struct map_session_data *sd, int val);
+typedef void (*HPMHOOK_pre_clif_arrow_fail) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_arrow_fail) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_use_card) (struct map_session_data **sd, int *idx);
+typedef void (*HPMHOOK_post_clif_use_card) (struct map_session_data *sd, int idx);
+typedef void (*HPMHOOK_pre_clif_cart_additem) (struct map_session_data **sd, int *n, int *amount, int *fail);
+typedef void (*HPMHOOK_post_clif_cart_additem) (struct map_session_data *sd, int n, int amount, int fail);
+typedef void (*HPMHOOK_pre_clif_cart_delitem) (struct map_session_data **sd, int *n, int *amount);
+typedef void (*HPMHOOK_post_clif_cart_delitem) (struct map_session_data *sd, int n, int amount);
+typedef void (*HPMHOOK_pre_clif_equipitemack) (struct map_session_data **sd, int *n, int *pos, enum e_EQUIP_ITEM_ACK *result);
+typedef void (*HPMHOOK_post_clif_equipitemack) (struct map_session_data *sd, int n, int pos, enum e_EQUIP_ITEM_ACK result);
+typedef void (*HPMHOOK_pre_clif_unequipitemack) (struct map_session_data **sd, int *n, int *pos, enum e_UNEQUIP_ITEM_ACK *result);
+typedef void (*HPMHOOK_post_clif_unequipitemack) (struct map_session_data *sd, int n, int pos, enum e_UNEQUIP_ITEM_ACK result);
+typedef void (*HPMHOOK_pre_clif_useitemack) (struct map_session_data **sd, int *index, int *amount, bool *ok);
+typedef void (*HPMHOOK_post_clif_useitemack) (struct map_session_data *sd, int index, int amount, bool ok);
+typedef void (*HPMHOOK_pre_clif_addcards) (unsigned char **buf, struct item **item);
+typedef void (*HPMHOOK_post_clif_addcards) (unsigned char *buf, struct item *item);
+typedef void (*HPMHOOK_pre_clif_addcards2) (unsigned short **cards, struct item **item);
+typedef void (*HPMHOOK_post_clif_addcards2) (unsigned short *cards, struct item *item);
+typedef void (*HPMHOOK_pre_clif_item_sub) (unsigned char **buf, int *n, struct item **i, struct item_data **id, int *equip);
+typedef void (*HPMHOOK_post_clif_item_sub) (unsigned char *buf, int n, struct item *i, struct item_data *id, int equip);
+typedef void (*HPMHOOK_pre_clif_getareachar_item) (struct map_session_data **sd, struct flooritem_data **fitem);
+typedef void (*HPMHOOK_post_clif_getareachar_item) (struct map_session_data *sd, struct flooritem_data *fitem);
+typedef void (*HPMHOOK_pre_clif_cart_additem_ack) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_cart_additem_ack) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_cashshop_load) (void);
+typedef void (*HPMHOOK_post_clif_cashshop_load) (void);
+typedef void (*HPMHOOK_pre_clif_package_announce) (struct map_session_data **sd, unsigned short *nameid, unsigned short *containerid);
+typedef void (*HPMHOOK_post_clif_package_announce) (struct map_session_data *sd, unsigned short nameid, unsigned short containerid);
+typedef void (*HPMHOOK_pre_clif_item_drop_announce) (struct map_session_data **sd, unsigned short *nameid, char **monsterName);
+typedef void (*HPMHOOK_post_clif_item_drop_announce) (struct map_session_data *sd, unsigned short nameid, char *monsterName);
+typedef void (*HPMHOOK_pre_clif_clearunit_single) (int *id, clr_type *type, int *fd);
+typedef void (*HPMHOOK_post_clif_clearunit_single) (int id, clr_type type, int fd);
+typedef void (*HPMHOOK_pre_clif_clearunit_area) (struct block_list **bl, clr_type *type);
+typedef void (*HPMHOOK_post_clif_clearunit_area) (struct block_list *bl, clr_type type);
+typedef void (*HPMHOOK_pre_clif_clearunit_delayed) (struct block_list **bl, clr_type *type, int64 *tick);
+typedef void (*HPMHOOK_post_clif_clearunit_delayed) (struct block_list *bl, clr_type type, int64 tick);
+typedef void (*HPMHOOK_pre_clif_walkok) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_walkok) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_move) (struct unit_data **ud);
+typedef void (*HPMHOOK_post_clif_move) (struct unit_data *ud);
+typedef void (*HPMHOOK_pre_clif_move2) (struct block_list **bl, struct view_data **vd, struct unit_data **ud);
+typedef void (*HPMHOOK_post_clif_move2) (struct block_list *bl, struct view_data *vd, struct unit_data *ud);
+typedef void (*HPMHOOK_pre_clif_blown) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_blown) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_slide) (struct block_list **bl, int *x, int *y);
+typedef void (*HPMHOOK_post_clif_slide) (struct block_list *bl, int x, int y);
+typedef void (*HPMHOOK_pre_clif_fixpos) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_fixpos) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_changelook) (struct block_list **bl, int *type, int *val);
+typedef void (*HPMHOOK_post_clif_changelook) (struct block_list *bl, int type, int val);
+typedef void (*HPMHOOK_pre_clif_changetraplook) (struct block_list **bl, int *val);
+typedef void (*HPMHOOK_post_clif_changetraplook) (struct block_list *bl, int val);
+typedef void (*HPMHOOK_pre_clif_refreshlook) (struct block_list **bl, int *id, int *type, int *val, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_refreshlook) (struct block_list *bl, int id, int type, int val, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_sendlook) (struct block_list **bl, int *id, int *type, int *val, int *val2, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_class_change) (struct block_list **bl, int *class_, int *type, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_class_change) (struct block_list *bl, int class_, int type, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_skill_delunit) (struct skill_unit **su);
+typedef void (*HPMHOOK_post_clif_skill_delunit) (struct skill_unit *su);
+typedef void (*HPMHOOK_pre_clif_skillunit_update) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_skillunit_update) (struct block_list *bl);
+typedef int (*HPMHOOK_pre_clif_clearunit_delayed_sub) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_clif_clearunit_delayed_sub) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_clif_set_unit_idle) (struct block_list **bl, struct map_session_data **tsd, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_set_unit_idle) (struct block_list *bl, struct map_session_data *tsd, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_spawn_unit) (struct block_list **bl, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_spawn_unit) (struct block_list *bl, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_spawn_unit2) (struct block_list **bl, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_spawn_unit2) (struct block_list *bl, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_set_unit_idle2) (struct block_list **bl, struct map_session_data **tsd, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_set_unit_idle2) (struct block_list *bl, struct map_session_data *tsd, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_set_unit_walking) (struct block_list **bl, struct map_session_data **tsd, struct unit_data **ud, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_set_unit_walking) (struct block_list *bl, struct map_session_data *tsd, struct unit_data *ud, enum send_target target);
+typedef int (*HPMHOOK_pre_clif_calc_walkdelay) (struct block_list **bl, int *delay, int *type, int *damage, int *div_);
+typedef int (*HPMHOOK_post_clif_calc_walkdelay) (int retVal___, struct block_list *bl, int delay, int type, int damage, int div_);
+typedef void (*HPMHOOK_pre_clif_getareachar_skillunit) (struct block_list **bl, struct skill_unit **su, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_getareachar_skillunit) (struct block_list *bl, struct skill_unit *su, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_getareachar_unit) (struct map_session_data **sd, struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_getareachar_unit) (struct map_session_data *sd, struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_clearchar_skillunit) (struct skill_unit **su, int *fd);
+typedef void (*HPMHOOK_post_clif_clearchar_skillunit) (struct skill_unit *su, int fd);
+typedef int (*HPMHOOK_pre_clif_getareachar) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_clif_getareachar) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_clif_graffiti_entry) (struct block_list **bl, struct skill_unit **su, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_graffiti_entry) (struct block_list *bl, struct skill_unit *su, enum send_target target);
+typedef bool (*HPMHOOK_pre_clif_spawn) (struct block_list **bl);
+typedef bool (*HPMHOOK_post_clif_spawn) (bool retVal___, struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_changemap) (struct map_session_data **sd, short *m, int *x, int *y);
+typedef void (*HPMHOOK_post_clif_changemap) (struct map_session_data *sd, short m, int x, int y);
+typedef void (*HPMHOOK_pre_clif_changemapcell) (int *fd, int16 *m, int *x, int *y, int *type, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_changemapcell) (int fd, int16 m, int x, int y, int type, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_map_property) (struct map_session_data **sd, enum map_property *property);
+typedef void (*HPMHOOK_post_clif_map_property) (struct map_session_data *sd, enum map_property property);
+typedef void (*HPMHOOK_pre_clif_pvpset) (struct map_session_data **sd, int *pvprank, int *pvpnum, int *type);
+typedef void (*HPMHOOK_post_clif_pvpset) (struct map_session_data *sd, int pvprank, int pvpnum, int type);
+typedef void (*HPMHOOK_pre_clif_map_property_mapall) (int *mapid, enum map_property *property);
+typedef void (*HPMHOOK_post_clif_map_property_mapall) (int mapid, enum map_property property);
+typedef void (*HPMHOOK_pre_clif_bossmapinfo) (int *fd, struct mob_data **md, short *flag);
+typedef void (*HPMHOOK_post_clif_bossmapinfo) (int fd, struct mob_data *md, short flag);
+typedef void (*HPMHOOK_pre_clif_map_type) (struct map_session_data **sd, enum map_type *type);
+typedef void (*HPMHOOK_post_clif_map_type) (struct map_session_data *sd, enum map_type type);
+typedef void (*HPMHOOK_pre_clif_maptypeproperty2) (struct block_list **bl, enum send_target *t);
+typedef void (*HPMHOOK_post_clif_maptypeproperty2) (struct block_list *bl, enum send_target t);
+typedef void (*HPMHOOK_pre_clif_changemapserver) (struct map_session_data **sd, unsigned short *map_index, int *x, int *y, uint32 *ip, uint16 *port);
+typedef void (*HPMHOOK_post_clif_changemapserver) (struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
+typedef void (*HPMHOOK_pre_clif_npcbuysell) (struct map_session_data **sd, int *id);
+typedef void (*HPMHOOK_post_clif_npcbuysell) (struct map_session_data *sd, int id);
+typedef void (*HPMHOOK_pre_clif_buylist) (struct map_session_data **sd, struct npc_data **nd);
+typedef void (*HPMHOOK_post_clif_buylist) (struct map_session_data *sd, struct npc_data *nd);
+typedef void (*HPMHOOK_pre_clif_selllist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_selllist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_cashshop_show) (struct map_session_data **sd, struct npc_data **nd);
+typedef void (*HPMHOOK_post_clif_cashshop_show) (struct map_session_data *sd, struct npc_data *nd);
+typedef void (*HPMHOOK_pre_clif_npc_buy_result) (struct map_session_data **sd, unsigned char *result);
+typedef void (*HPMHOOK_post_clif_npc_buy_result) (struct map_session_data *sd, unsigned char result);
+typedef void (*HPMHOOK_pre_clif_npc_sell_result) (struct map_session_data **sd, unsigned char *result);
+typedef void (*HPMHOOK_post_clif_npc_sell_result) (struct map_session_data *sd, unsigned char result);
+typedef void (*HPMHOOK_pre_clif_cashshop_ack) (struct map_session_data **sd, int *error);
+typedef void (*HPMHOOK_post_clif_cashshop_ack) (struct map_session_data *sd, int error);
+typedef void (*HPMHOOK_pre_clif_scriptmes) (struct map_session_data **sd, int *npcid, const char **mes);
+typedef void (*HPMHOOK_post_clif_scriptmes) (struct map_session_data *sd, int npcid, const char *mes);
+typedef void (*HPMHOOK_pre_clif_scriptnext) (struct map_session_data **sd, int *npcid);
+typedef void (*HPMHOOK_post_clif_scriptnext) (struct map_session_data *sd, int npcid);
+typedef void (*HPMHOOK_pre_clif_scriptclose) (struct map_session_data **sd, int *npcid);
+typedef void (*HPMHOOK_post_clif_scriptclose) (struct map_session_data *sd, int npcid);
+typedef void (*HPMHOOK_pre_clif_scriptmenu) (struct map_session_data **sd, int *npcid, const char **mes);
+typedef void (*HPMHOOK_post_clif_scriptmenu) (struct map_session_data *sd, int npcid, const char *mes);
+typedef void (*HPMHOOK_pre_clif_scriptinput) (struct map_session_data **sd, int *npcid);
+typedef void (*HPMHOOK_post_clif_scriptinput) (struct map_session_data *sd, int npcid);
+typedef void (*HPMHOOK_pre_clif_scriptinputstr) (struct map_session_data **sd, int *npcid);
+typedef void (*HPMHOOK_post_clif_scriptinputstr) (struct map_session_data *sd, int npcid);
+typedef void (*HPMHOOK_pre_clif_cutin) (struct map_session_data **sd, const char **image, int *type);
+typedef void (*HPMHOOK_post_clif_cutin) (struct map_session_data *sd, const char *image, int type);
+typedef void (*HPMHOOK_pre_clif_sendfakenpc) (struct map_session_data **sd, int *npcid);
+typedef void (*HPMHOOK_post_clif_sendfakenpc) (struct map_session_data *sd, int npcid);
+typedef void (*HPMHOOK_pre_clif_scriptclear) (struct map_session_data **sd, int *npcid);
+typedef void (*HPMHOOK_post_clif_scriptclear) (struct map_session_data *sd, int npcid);
+typedef void (*HPMHOOK_pre_clif_viewpoint) (struct map_session_data **sd, int *npc_id, int *type, int *x, int *y, int *id, int *color);
+typedef void (*HPMHOOK_post_clif_viewpoint) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color);
+typedef int (*HPMHOOK_pre_clif_damage) (struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
+typedef int (*HPMHOOK_post_clif_damage) (int retVal___, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2);
+typedef void (*HPMHOOK_pre_clif_sitting) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_sitting) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_standing) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_standing) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_arrow_create_list) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_arrow_create_list) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_refresh_storagewindow) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_refresh_storagewindow) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_refresh) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_refresh) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_fame_blacksmith) (struct map_session_data **sd, int *points);
+typedef void (*HPMHOOK_post_clif_fame_blacksmith) (struct map_session_data *sd, int points);
+typedef void (*HPMHOOK_pre_clif_fame_alchemist) (struct map_session_data **sd, int *points);
+typedef void (*HPMHOOK_post_clif_fame_alchemist) (struct map_session_data *sd, int points);
+typedef void (*HPMHOOK_pre_clif_fame_taekwon) (struct map_session_data **sd, int *points);
+typedef void (*HPMHOOK_post_clif_fame_taekwon) (struct map_session_data *sd, int points);
+typedef void (*HPMHOOK_pre_clif_ranklist) (struct map_session_data **sd, enum fame_list_type *type);
+typedef void (*HPMHOOK_post_clif_ranklist) (struct map_session_data *sd, enum fame_list_type type);
+typedef void (*HPMHOOK_pre_clif_update_rankingpoint) (struct map_session_data **sd, enum fame_list_type *type, int *points);
+typedef void (*HPMHOOK_post_clif_update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points);
+typedef void (*HPMHOOK_pre_clif_pRanklist) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRanklist) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_hotkeys) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_hotkeys) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_insight) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_clif_insight) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_clif_outsight) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_clif_outsight) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_clif_skillcastcancel) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_skillcastcancel) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_skill_fail) (struct map_session_data **sd, uint16 *skill_id, enum useskill_fail_cause *cause, int *btype);
+typedef void (*HPMHOOK_post_clif_skill_fail) (struct map_session_data *sd, uint16 skill_id, enum useskill_fail_cause cause, int btype);
+typedef void (*HPMHOOK_pre_clif_skill_cooldown) (struct map_session_data **sd, uint16 *skill_id, unsigned int *duration);
+typedef void (*HPMHOOK_post_clif_skill_cooldown) (struct map_session_data *sd, uint16 skill_id, unsigned int duration);
+typedef void (*HPMHOOK_pre_clif_skill_memomessage) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_skill_memomessage) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_skill_mapinfomessage) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_skill_mapinfomessage) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_skill_produce_mix_list) (struct map_session_data **sd, int *skill_id, int *trigger);
+typedef void (*HPMHOOK_post_clif_skill_produce_mix_list) (struct map_session_data *sd, int skill_id, int trigger);
+typedef void (*HPMHOOK_pre_clif_cooking_list) (struct map_session_data **sd, int *trigger, uint16 *skill_id, int *qty, int *list_type);
+typedef void (*HPMHOOK_post_clif_cooking_list) (struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
+typedef void (*HPMHOOK_pre_clif_autospell) (struct map_session_data **sd, uint16 *skill_lv);
+typedef void (*HPMHOOK_post_clif_autospell) (struct map_session_data *sd, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_clif_combo_delay) (struct block_list **bl, int *wait);
+typedef void (*HPMHOOK_post_clif_combo_delay) (struct block_list *bl, int wait);
+typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *type, int *flag, int *tick, int *val1, int *val2, int *val3);
+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_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);
+typedef void (*HPMHOOK_post_clif_clearcart) (int fd);
+typedef void (*HPMHOOK_pre_clif_item_identify_list) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_item_identify_list) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_item_identified) (struct map_session_data **sd, int *idx, int *flag);
+typedef void (*HPMHOOK_post_clif_item_identified) (struct map_session_data *sd, int idx, int flag);
+typedef void (*HPMHOOK_pre_clif_item_repair_list) (struct map_session_data **sd, struct map_session_data **dstsd, int *lv);
+typedef void (*HPMHOOK_post_clif_item_repair_list) (struct map_session_data *sd, struct map_session_data *dstsd, int lv);
+typedef void (*HPMHOOK_pre_clif_item_repaireffect) (struct map_session_data **sd, int *idx, int *flag);
+typedef void (*HPMHOOK_post_clif_item_repaireffect) (struct map_session_data *sd, int idx, int flag);
+typedef void (*HPMHOOK_pre_clif_item_damaged) (struct map_session_data **sd, unsigned short *position);
+typedef void (*HPMHOOK_post_clif_item_damaged) (struct map_session_data *sd, unsigned short position);
+typedef void (*HPMHOOK_pre_clif_item_refine_list) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_item_refine_list) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_item_skill) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef void (*HPMHOOK_post_clif_item_skill) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_clif_mvp_item) (struct map_session_data **sd, int *nameid);
+typedef void (*HPMHOOK_post_clif_mvp_item) (struct map_session_data *sd, int nameid);
+typedef void (*HPMHOOK_pre_clif_mvp_exp) (struct map_session_data **sd, unsigned int *exp);
+typedef void (*HPMHOOK_post_clif_mvp_exp) (struct map_session_data *sd, unsigned int exp);
+typedef void (*HPMHOOK_pre_clif_mvp_noitem) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_mvp_noitem) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_changed_dir) (struct block_list **bl, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_changed_dir) (struct block_list *bl, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_charnameack) (int *fd, struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_charnameack) (int fd, struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_monster_hp_bar) (struct mob_data **md, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_monster_hp_bar) (struct mob_data *md, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_hpmeter) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_clif_hpmeter) (int retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_hpmeter_single) (int *fd, int *id, unsigned int *hp, unsigned int *maxhp);
+typedef void (*HPMHOOK_post_clif_hpmeter_single) (int fd, int id, unsigned int hp, unsigned int maxhp);
+typedef int (*HPMHOOK_pre_clif_hpmeter_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_clif_hpmeter_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_clif_upgrademessage) (int *fd, int *result, int *item_id);
+typedef void (*HPMHOOK_post_clif_upgrademessage) (int fd, int result, int item_id);
+typedef void (*HPMHOOK_pre_clif_get_weapon_view) (struct map_session_data **sd, unsigned short **rhand, unsigned short **lhand);
+typedef void (*HPMHOOK_post_clif_get_weapon_view) (struct map_session_data *sd, unsigned short *rhand, unsigned short *lhand);
+typedef void (*HPMHOOK_pre_clif_gospel_info) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_gospel_info) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_feel_req) (int *fd, struct map_session_data **sd, uint16 *skill_lv);
+typedef void (*HPMHOOK_post_clif_feel_req) (int fd, struct map_session_data *sd, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_clif_starskill) (struct map_session_data **sd, const char **mapname, int *monster_id, unsigned char *star, unsigned char *result);
+typedef void (*HPMHOOK_post_clif_starskill) (struct map_session_data *sd, const char *mapname, int monster_id, unsigned char star, unsigned char result);
+typedef void (*HPMHOOK_pre_clif_feel_info) (struct map_session_data **sd, unsigned char *feel_level, unsigned char *type);
+typedef void (*HPMHOOK_post_clif_feel_info) (struct map_session_data *sd, unsigned char feel_level, unsigned char type);
+typedef void (*HPMHOOK_pre_clif_hate_info) (struct map_session_data **sd, unsigned char *hate_level, int *class_, unsigned char *type);
+typedef void (*HPMHOOK_post_clif_hate_info) (struct map_session_data *sd, unsigned char hate_level, int class_, unsigned char type);
+typedef void (*HPMHOOK_pre_clif_mission_info) (struct map_session_data **sd, int *mob_id, unsigned char *progress);
+typedef void (*HPMHOOK_post_clif_mission_info) (struct map_session_data *sd, int mob_id, unsigned char progress);
+typedef void (*HPMHOOK_pre_clif_feel_hate_reset) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_feel_hate_reset) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_partytickack) (struct map_session_data **sd, bool *flag);
+typedef void (*HPMHOOK_post_clif_partytickack) (struct map_session_data *sd, bool flag);
+typedef void (*HPMHOOK_pre_clif_equiptickack) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_equiptickack) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_viewequip_ack) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef void (*HPMHOOK_post_clif_viewequip_ack) (struct map_session_data *sd, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_clif_equpcheckbox) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_equpcheckbox) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_displayexp) (struct map_session_data **sd, unsigned int *exp, char *type, bool *is_quest);
+typedef void (*HPMHOOK_post_clif_displayexp) (struct map_session_data *sd, unsigned int exp, char type, bool is_quest);
+typedef void (*HPMHOOK_pre_clif_font) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_font) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_progressbar) (struct map_session_data **sd, unsigned int *color, unsigned int *second);
+typedef void (*HPMHOOK_post_clif_progressbar) (struct map_session_data *sd, unsigned int color, unsigned int second);
+typedef void (*HPMHOOK_pre_clif_progressbar_abort) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_progressbar_abort) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_showdigit) (struct map_session_data **sd, unsigned char *type, int *value);
+typedef void (*HPMHOOK_post_clif_showdigit) (struct map_session_data *sd, unsigned char type, int value);
+typedef int (*HPMHOOK_pre_clif_elementalconverter_list) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_clif_elementalconverter_list) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_spellbook_list) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_clif_spellbook_list) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_magicdecoy_list) (struct map_session_data **sd, uint16 *skill_lv, short *x, short *y);
+typedef int (*HPMHOOK_post_clif_magicdecoy_list) (int retVal___, struct map_session_data *sd, uint16 skill_lv, short x, short y);
+typedef int (*HPMHOOK_pre_clif_poison_list) (struct map_session_data **sd, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_clif_poison_list) (int retVal___, struct map_session_data *sd, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_clif_autoshadowspell_list) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_clif_autoshadowspell_list) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_skill_itemlistwindow) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_clif_skill_itemlistwindow) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_clif_sc_load) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3);
+typedef void (*HPMHOOK_post_clif_sc_load) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3);
+typedef void (*HPMHOOK_pre_clif_sc_continue) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3);
+typedef void (*HPMHOOK_post_clif_sc_continue) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3);
+typedef void (*HPMHOOK_pre_clif_sc_end) (struct block_list **bl, int *tid, enum send_target *target, int *type);
+typedef void (*HPMHOOK_post_clif_sc_end) (struct block_list *bl, int tid, enum send_target target, int type);
+typedef void (*HPMHOOK_pre_clif_initialstatus) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_initialstatus) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_cooldown_list) (int *fd, struct skill_cd **cd);
+typedef void (*HPMHOOK_post_clif_cooldown_list) (int fd, struct skill_cd *cd);
+typedef void (*HPMHOOK_pre_clif_updatestatus) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_updatestatus) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_changestatus) (struct map_session_data **sd, int *type, int *val);
+typedef void (*HPMHOOK_post_clif_changestatus) (struct map_session_data *sd, int type, int val);
+typedef void (*HPMHOOK_pre_clif_statusupack) (struct map_session_data **sd, int *type, int *ok, int *val);
+typedef void (*HPMHOOK_post_clif_statusupack) (struct map_session_data *sd, int type, int ok, int val);
+typedef void (*HPMHOOK_pre_clif_movetoattack) (struct map_session_data **sd, struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_movetoattack) (struct map_session_data *sd, struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_solved_charname) (int *fd, int *charid, const char **name);
+typedef void (*HPMHOOK_post_clif_solved_charname) (int fd, int charid, const char *name);
+typedef void (*HPMHOOK_pre_clif_charnameupdate) (struct map_session_data **ssd);
+typedef void (*HPMHOOK_post_clif_charnameupdate) (struct map_session_data *ssd);
+typedef int (*HPMHOOK_pre_clif_delayquit) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_clif_delayquit) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_clif_getareachar_pc) (struct map_session_data **sd, struct map_session_data **dstsd);
+typedef void (*HPMHOOK_post_clif_getareachar_pc) (struct map_session_data *sd, struct map_session_data *dstsd);
+typedef void (*HPMHOOK_pre_clif_disconnect_ack) (struct map_session_data **sd, short *result);
+typedef void (*HPMHOOK_post_clif_disconnect_ack) (struct map_session_data *sd, short result);
+typedef void (*HPMHOOK_pre_clif_PVPInfo) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PVPInfo) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_blacksmith) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_blacksmith) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_alchemist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_alchemist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_taekwon) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_taekwon) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_ranking_pk) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_ranking_pk) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_quitsave) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_quitsave) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_misceffect) (struct block_list **bl, int *type);
+typedef void (*HPMHOOK_post_clif_misceffect) (struct block_list *bl, int type);
+typedef void (*HPMHOOK_pre_clif_changeoption) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_changeoption) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_changeoption2) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_changeoption2) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_emotion) (struct block_list **bl, int *type);
+typedef void (*HPMHOOK_post_clif_emotion) (struct block_list *bl, int type);
+typedef void (*HPMHOOK_pre_clif_talkiebox) (struct block_list **bl, const char **talkie);
+typedef void (*HPMHOOK_post_clif_talkiebox) (struct block_list *bl, const char *talkie);
+typedef void (*HPMHOOK_pre_clif_wedding_effect) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_wedding_effect) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_divorced) (struct map_session_data **sd, const char **name);
+typedef void (*HPMHOOK_post_clif_divorced) (struct map_session_data *sd, const char *name);
+typedef void (*HPMHOOK_pre_clif_callpartner) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_callpartner) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_skill_damage) (struct block_list **src, struct block_list **dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, int *type);
+typedef int (*HPMHOOK_post_clif_skill_damage) (int retVal___, struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type);
+typedef int (*HPMHOOK_pre_clif_skill_nodamage) (struct block_list **src, struct block_list **dst, uint16 *skill_id, int *heal, int *fail);
+typedef int (*HPMHOOK_post_clif_skill_nodamage) (int retVal___, struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail);
+typedef void (*HPMHOOK_pre_clif_skill_poseffect) (struct block_list **src, uint16 *skill_id, int *val, int *x, int *y, int64 *tick);
+typedef void (*HPMHOOK_post_clif_skill_poseffect) (struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick);
+typedef void (*HPMHOOK_pre_clif_skill_estimation) (struct map_session_data **sd, struct block_list **dst);
+typedef void (*HPMHOOK_post_clif_skill_estimation) (struct map_session_data *sd, struct block_list *dst);
+typedef void (*HPMHOOK_pre_clif_skill_warppoint) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv, unsigned short *map1, unsigned short *map2, unsigned short *map3, unsigned short *map4);
+typedef void (*HPMHOOK_post_clif_skill_warppoint) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
+typedef void (*HPMHOOK_pre_clif_useskill) (struct block_list **bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, uint16 *skill_lv, int *casttime);
+typedef void (*HPMHOOK_post_clif_useskill) (struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime);
+typedef void (*HPMHOOK_pre_clif_produce_effect) (struct map_session_data **sd, int *flag, int *nameid);
+typedef void (*HPMHOOK_post_clif_produce_effect) (struct map_session_data *sd, int flag, int nameid);
+typedef void (*HPMHOOK_pre_clif_devotion) (struct block_list **src, struct map_session_data **tsd);
+typedef void (*HPMHOOK_post_clif_devotion) (struct block_list *src, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_clif_spiritball) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_spiritball) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_spiritball_single) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_spiritball_single) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_bladestop) (struct block_list **src, int *dst_id, int *active);
+typedef void (*HPMHOOK_post_clif_bladestop) (struct block_list *src, int dst_id, int active);
+typedef void (*HPMHOOK_pre_clif_mvp_effect) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_mvp_effect) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_heal) (int *fd, int *type, int *val);
+typedef void (*HPMHOOK_post_clif_heal) (int fd, int type, int val);
+typedef void (*HPMHOOK_pre_clif_resurrection) (struct block_list **bl, int *type);
+typedef void (*HPMHOOK_post_clif_resurrection) (struct block_list *bl, int type);
+typedef void (*HPMHOOK_pre_clif_refine) (int *fd, int *fail, int *index, int *val);
+typedef void (*HPMHOOK_post_clif_refine) (int fd, int fail, int index, int val);
+typedef void (*HPMHOOK_pre_clif_weather) (int16 *m);
+typedef void (*HPMHOOK_post_clif_weather) (int16 m);
+typedef void (*HPMHOOK_pre_clif_specialeffect) (struct block_list **bl, int *type, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_specialeffect) (struct block_list *bl, int type, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_specialeffect_single) (struct block_list **bl, int *type, int *fd);
+typedef void (*HPMHOOK_post_clif_specialeffect_single) (struct block_list *bl, int type, int fd);
+typedef void (*HPMHOOK_pre_clif_specialeffect_value) (struct block_list **bl, int *effect_id, int *num, send_target *target);
+typedef void (*HPMHOOK_post_clif_specialeffect_value) (struct block_list *bl, int effect_id, int num, send_target target);
+typedef void (*HPMHOOK_pre_clif_millenniumshield) (struct block_list **bl, short *shields);
+typedef void (*HPMHOOK_post_clif_millenniumshield) (struct block_list *bl, short shields);
+typedef void (*HPMHOOK_pre_clif_spiritcharm) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_spiritcharm) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_charm_single) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_charm_single) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_snap) (struct block_list **bl, short *x, short *y);
+typedef void (*HPMHOOK_post_clif_snap) (struct block_list *bl, short x, short y);
+typedef void (*HPMHOOK_pre_clif_weather_check) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_weather_check) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_playBGM) (struct map_session_data **sd, const char **name);
+typedef void (*HPMHOOK_post_clif_playBGM) (struct map_session_data *sd, const char *name);
+typedef void (*HPMHOOK_pre_clif_soundeffect) (struct map_session_data **sd, struct block_list **bl, const char **name, int *type);
+typedef void (*HPMHOOK_post_clif_soundeffect) (struct map_session_data *sd, struct block_list *bl, const char *name, int type);
+typedef void (*HPMHOOK_pre_clif_soundeffectall) (struct block_list **bl, const char **name, int *type, enum send_target *coverage);
+typedef void (*HPMHOOK_post_clif_soundeffectall) (struct block_list *bl, const char *name, int type, enum send_target coverage);
+typedef void (*HPMHOOK_pre_clif_GlobalMessage) (struct block_list **bl, const char **message);
+typedef void (*HPMHOOK_post_clif_GlobalMessage) (struct block_list *bl, const char *message);
+typedef void (*HPMHOOK_pre_clif_createchat) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_createchat) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_dispchat) (struct chat_data **cd, int *fd);
+typedef void (*HPMHOOK_post_clif_dispchat) (struct chat_data *cd, int fd);
+typedef void (*HPMHOOK_pre_clif_joinchatfail) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_joinchatfail) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_joinchatok) (struct map_session_data **sd, struct chat_data **cd);
+typedef void (*HPMHOOK_post_clif_joinchatok) (struct map_session_data *sd, struct chat_data *cd);
+typedef void (*HPMHOOK_pre_clif_addchat) (struct chat_data **cd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_addchat) (struct chat_data *cd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_changechatowner) (struct chat_data **cd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_changechatowner) (struct chat_data *cd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_clearchat) (struct chat_data **cd, int *fd);
+typedef void (*HPMHOOK_post_clif_clearchat) (struct chat_data *cd, int fd);
+typedef void (*HPMHOOK_pre_clif_leavechat) (struct chat_data **cd, struct map_session_data **sd, bool *flag);
+typedef void (*HPMHOOK_post_clif_leavechat) (struct chat_data *cd, struct map_session_data *sd, bool flag);
+typedef void (*HPMHOOK_pre_clif_changechatstatus) (struct chat_data **cd);
+typedef void (*HPMHOOK_post_clif_changechatstatus) (struct chat_data *cd);
+typedef void (*HPMHOOK_pre_clif_wis_message) (int *fd, const char **nick, const char **mes, int *mes_len);
+typedef void (*HPMHOOK_post_clif_wis_message) (int fd, const char *nick, const char *mes, int mes_len);
+typedef void (*HPMHOOK_pre_clif_wis_end) (int *fd, int *flag);
+typedef void (*HPMHOOK_post_clif_wis_end) (int fd, int flag);
+typedef void (*HPMHOOK_pre_clif_disp_message) (struct block_list **src, const char **mes, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_disp_message) (struct block_list *src, const char *mes, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_broadcast) (struct block_list **bl, const char **mes, int *len, int *type, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_broadcast) (struct block_list *bl, const char *mes, int len, int type, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_broadcast2) (struct block_list **bl, const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_broadcast2) (struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_messagecolor_self) (int *fd, uint32 *color, const char **msg);
+typedef void (*HPMHOOK_post_clif_messagecolor_self) (int fd, uint32 color, const char *msg);
+typedef void (*HPMHOOK_pre_clif_messagecolor) (struct block_list **bl, uint32 *color, const char **msg);
+typedef void (*HPMHOOK_post_clif_messagecolor) (struct block_list *bl, uint32 color, const char *msg);
+typedef void (*HPMHOOK_pre_clif_disp_overhead) (struct block_list **bl, const char **mes);
+typedef void (*HPMHOOK_post_clif_disp_overhead) (struct block_list *bl, const char *mes);
+typedef void (*HPMHOOK_pre_clif_msgtable) (struct map_session_data **sd, unsigned short *msg_id);
+typedef void (*HPMHOOK_post_clif_msgtable) (struct map_session_data *sd, unsigned short msg_id);
+typedef void (*HPMHOOK_pre_clif_msgtable_num) (struct map_session_data **sd, unsigned short *msg_id, int *value);
+typedef void (*HPMHOOK_post_clif_msgtable_num) (struct map_session_data *sd, unsigned short msg_id, int value);
+typedef void (*HPMHOOK_pre_clif_msgtable_skill) (struct map_session_data **sd, uint16 *skill_id, int *msg_id);
+typedef void (*HPMHOOK_post_clif_msgtable_skill) (struct map_session_data *sd, uint16 skill_id, int msg_id);
+typedef void (*HPMHOOK_pre_clif_message) (const int *fd, const char **mes);
+typedef void (*HPMHOOK_post_clif_message) (const int fd, const char *mes);
+typedef void (*HPMHOOK_pre_clif_messageln) (const int *fd, const char **mes);
+typedef void (*HPMHOOK_post_clif_messageln) (const int fd, const char *mes);
+typedef const char* (*HPMHOOK_pre_clif_process_chat_message) (struct map_session_data **sd, const struct packet_chat_message **packet, char **out_buf, int *out_buflen);
+typedef const char* (*HPMHOOK_post_clif_process_chat_message) (const char* retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen);
+typedef bool (*HPMHOOK_pre_clif_process_whisper_message) (struct map_session_data **sd, const struct packet_whisper_message **packet, char **out_name, char **out_message, int *out_messagelen);
+typedef bool (*HPMHOOK_post_clif_process_whisper_message) (bool retVal___, struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen);
+typedef void (*HPMHOOK_pre_clif_wisexin) (struct map_session_data **sd, int *type, int *flag);
+typedef void (*HPMHOOK_post_clif_wisexin) (struct map_session_data *sd, int type, int flag);
+typedef void (*HPMHOOK_pre_clif_wisall) (struct map_session_data **sd, int *type, int *flag);
+typedef void (*HPMHOOK_post_clif_wisall) (struct map_session_data *sd, int type, int flag);
+typedef void (*HPMHOOK_pre_clif_PMIgnoreList) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PMIgnoreList) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_ShowScript) (struct block_list **bl, const char **message);
+typedef void (*HPMHOOK_post_clif_ShowScript) (struct block_list *bl, const char *message);
+typedef void (*HPMHOOK_pre_clif_traderequest) (struct map_session_data **sd, const char **name);
+typedef void (*HPMHOOK_post_clif_traderequest) (struct map_session_data *sd, const char *name);
+typedef void (*HPMHOOK_pre_clif_tradestart) (struct map_session_data **sd, uint8 *type);
+typedef void (*HPMHOOK_post_clif_tradestart) (struct map_session_data *sd, uint8 type);
+typedef void (*HPMHOOK_pre_clif_tradeadditem) (struct map_session_data **sd, struct map_session_data **tsd, int *index, int *amount);
+typedef void (*HPMHOOK_post_clif_tradeadditem) (struct map_session_data *sd, struct map_session_data *tsd, int index, int amount);
+typedef void (*HPMHOOK_pre_clif_tradeitemok) (struct map_session_data **sd, int *index, int *fail);
+typedef void (*HPMHOOK_post_clif_tradeitemok) (struct map_session_data *sd, int index, int fail);
+typedef void (*HPMHOOK_pre_clif_tradedeal_lock) (struct map_session_data **sd, int *fail);
+typedef void (*HPMHOOK_post_clif_tradedeal_lock) (struct map_session_data *sd, int fail);
+typedef void (*HPMHOOK_pre_clif_tradecancelled) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_tradecancelled) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_tradecompleted) (struct map_session_data **sd, int *fail);
+typedef void (*HPMHOOK_post_clif_tradecompleted) (struct map_session_data *sd, int fail);
+typedef void (*HPMHOOK_pre_clif_tradeundo) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_tradeundo) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_openvendingreq) (struct map_session_data **sd, int *num);
+typedef void (*HPMHOOK_post_clif_openvendingreq) (struct map_session_data *sd, int num);
+typedef void (*HPMHOOK_pre_clif_showvendingboard) (struct block_list **bl, const char **message, int *fd);
+typedef void (*HPMHOOK_post_clif_showvendingboard) (struct block_list *bl, const char *message, int fd);
+typedef void (*HPMHOOK_pre_clif_closevendingboard) (struct block_list **bl, int *fd);
+typedef void (*HPMHOOK_post_clif_closevendingboard) (struct block_list *bl, int fd);
+typedef void (*HPMHOOK_pre_clif_vendinglist) (struct map_session_data **sd, unsigned int *id, struct s_vending **vending_list);
+typedef void (*HPMHOOK_post_clif_vendinglist) (struct map_session_data *sd, unsigned int id, struct s_vending *vending_list);
+typedef void (*HPMHOOK_pre_clif_buyvending) (struct map_session_data **sd, int *index, int *amount, int *fail);
+typedef void (*HPMHOOK_post_clif_buyvending) (struct map_session_data *sd, int index, int amount, int fail);
+typedef void (*HPMHOOK_pre_clif_openvending) (struct map_session_data **sd, int *id, struct s_vending **vending_list);
+typedef void (*HPMHOOK_post_clif_openvending) (struct map_session_data *sd, int id, struct s_vending *vending_list);
+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_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);
+typedef void (*HPMHOOK_post_clif_storageitemadded) (struct map_session_data *sd, struct item *i, int index, int amount);
+typedef void (*HPMHOOK_pre_clif_storageitemremoved) (struct map_session_data **sd, int *index, int *amount);
+typedef void (*HPMHOOK_post_clif_storageitemremoved) (struct map_session_data *sd, int index, int amount);
+typedef void (*HPMHOOK_pre_clif_storageclose) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_storageclose) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_skillinfoblock) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_skillinfoblock) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_skillup) (struct map_session_data **sd, uint16 *skill_id, int *skill_lv, int *flag);
+typedef void (*HPMHOOK_post_clif_skillup) (struct map_session_data *sd, uint16 skill_id, int skill_lv, int flag);
+typedef void (*HPMHOOK_pre_clif_skillinfo) (struct map_session_data **sd, int *skill_id, int *inf);
+typedef void (*HPMHOOK_post_clif_skillinfo) (struct map_session_data *sd, int skill_id, int inf);
+typedef void (*HPMHOOK_pre_clif_addskill) (struct map_session_data **sd, int *id);
+typedef void (*HPMHOOK_post_clif_addskill) (struct map_session_data *sd, int id);
+typedef void (*HPMHOOK_pre_clif_deleteskill) (struct map_session_data **sd, int *id);
+typedef void (*HPMHOOK_post_clif_deleteskill) (struct map_session_data *sd, int id);
+typedef void (*HPMHOOK_pre_clif_party_created) (struct map_session_data **sd, int *result);
+typedef void (*HPMHOOK_post_clif_party_created) (struct map_session_data *sd, int result);
+typedef void (*HPMHOOK_pre_clif_party_member_info) (struct party_data **p, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_member_info) (struct party_data *p, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_info) (struct party_data **p, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_info) (struct party_data *p, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_invite) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef void (*HPMHOOK_post_clif_party_invite) (struct map_session_data *sd, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_clif_party_inviteack) (struct map_session_data **sd, const char **nick, int *result);
+typedef void (*HPMHOOK_post_clif_party_inviteack) (struct map_session_data *sd, const char *nick, int result);
+typedef void (*HPMHOOK_pre_clif_party_option) (struct party_data **p, struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_party_option) (struct party_data *p, struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_party_withdraw) (struct party_data **p, struct map_session_data **sd, int *account_id, const char **name, int *flag);
+typedef void (*HPMHOOK_post_clif_party_withdraw) (struct party_data *p, struct map_session_data *sd, int account_id, const char *name, int flag);
+typedef void (*HPMHOOK_pre_clif_party_message) (struct party_data **p, int *account_id, const char **mes, int *len);
+typedef void (*HPMHOOK_post_clif_party_message) (struct party_data *p, int account_id, const char *mes, int len);
+typedef void (*HPMHOOK_pre_clif_party_xy) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_xy) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_xy_single) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_xy_single) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_hp) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_hp) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_xy_remove) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_xy_remove) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_show_picker) (struct map_session_data **sd, struct item **item_data);
+typedef void (*HPMHOOK_post_clif_party_show_picker) (struct map_session_data *sd, struct item *item_data);
+typedef void (*HPMHOOK_pre_clif_partyinvitationstate) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_partyinvitationstate) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_PartyLeaderChanged) (struct map_session_data **sd, int *prev_leader_aid, int *new_leader_aid);
+typedef void (*HPMHOOK_post_clif_PartyLeaderChanged) (struct map_session_data *sd, int prev_leader_aid, int new_leader_aid);
+typedef void (*HPMHOOK_pre_clif_guild_created) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_created) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_belonginfo) (struct map_session_data **sd, struct guild **g);
+typedef void (*HPMHOOK_post_clif_guild_belonginfo) (struct map_session_data *sd, struct guild *g);
+typedef void (*HPMHOOK_pre_clif_guild_masterormember) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_masterormember) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_basicinfo) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_basicinfo) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_allianceinfo) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_allianceinfo) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_memberlist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_memberlist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_skillinfo) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_skillinfo) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_send_onlineinfo) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_send_onlineinfo) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_memberlogin_notice) (struct guild **g, int *idx, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_memberlogin_notice) (struct guild *g, int idx, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_invite) (struct map_session_data **sd, struct guild **g);
+typedef void (*HPMHOOK_post_clif_guild_invite) (struct map_session_data *sd, struct guild *g);
+typedef void (*HPMHOOK_pre_clif_guild_inviteack) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_inviteack) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_leave) (struct map_session_data **sd, const char **name, const char **mes);
+typedef void (*HPMHOOK_post_clif_guild_leave) (struct map_session_data *sd, const char *name, const char *mes);
+typedef void (*HPMHOOK_pre_clif_guild_expulsion) (struct map_session_data **sd, const char **name, const char **mes, int *account_id);
+typedef void (*HPMHOOK_post_clif_guild_expulsion) (struct map_session_data *sd, const char *name, const char *mes, int account_id);
+typedef void (*HPMHOOK_pre_clif_guild_positionchanged) (struct guild **g, int *idx);
+typedef void (*HPMHOOK_post_clif_guild_positionchanged) (struct guild *g, int idx);
+typedef void (*HPMHOOK_pre_clif_guild_memberpositionchanged) (struct guild **g, int *idx);
+typedef void (*HPMHOOK_post_clif_guild_memberpositionchanged) (struct guild *g, int idx);
+typedef void (*HPMHOOK_pre_clif_guild_emblem) (struct map_session_data **sd, struct guild **g);
+typedef void (*HPMHOOK_post_clif_guild_emblem) (struct map_session_data *sd, struct guild *g);
+typedef void (*HPMHOOK_pre_clif_guild_emblem_area) (struct block_list **bl);
+typedef void (*HPMHOOK_post_clif_guild_emblem_area) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_guild_notice) (struct map_session_data **sd, struct guild **g);
+typedef void (*HPMHOOK_post_clif_guild_notice) (struct map_session_data *sd, struct guild *g);
+typedef void (*HPMHOOK_pre_clif_guild_message) (struct guild **g, int *account_id, const char **mes, int *len);
+typedef void (*HPMHOOK_post_clif_guild_message) (struct guild *g, int account_id, const char *mes, int len);
+typedef void (*HPMHOOK_pre_clif_guild_reqalliance) (struct map_session_data **sd, int *account_id, const char **name);
+typedef void (*HPMHOOK_post_clif_guild_reqalliance) (struct map_session_data *sd, int account_id, const char *name);
+typedef void (*HPMHOOK_pre_clif_guild_allianceack) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_allianceack) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_delalliance) (struct map_session_data **sd, int *guild_id, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_delalliance) (struct map_session_data *sd, int guild_id, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_oppositionack) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_oppositionack) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_broken) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_guild_broken) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_guild_xy) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_xy) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_xy_single) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_xy_single) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_xy_remove) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_xy_remove) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_positionnamelist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_positionnamelist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_positioninfolist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_positioninfolist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_guild_expulsionlist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_guild_expulsionlist) (struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_clif_validate_emblem) (const uint8 **emblem, unsigned long *emblem_len);
+typedef bool (*HPMHOOK_post_clif_validate_emblem) (bool retVal___, const uint8 *emblem, unsigned long emblem_len);
+typedef void (*HPMHOOK_pre_clif_bg_hp) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_bg_hp) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_bg_xy) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_bg_xy) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_bg_xy_remove) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_bg_xy_remove) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_bg_message) (struct battleground_data **bgd, int *src_id, const char **name, const char **mes);
+typedef void (*HPMHOOK_post_clif_bg_message) (struct battleground_data *bgd, int src_id, const char *name, const char *mes);
+typedef void (*HPMHOOK_pre_clif_bg_updatescore) (int16 *m);
+typedef void (*HPMHOOK_post_clif_bg_updatescore) (int16 m);
+typedef void (*HPMHOOK_pre_clif_bg_updatescore_single) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_bg_updatescore_single) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_sendbgemblem_area) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_sendbgemblem_area) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_sendbgemblem_single) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_sendbgemblem_single) (int fd, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_instance) (int *instance_id, int *type, int *flag);
+typedef int (*HPMHOOK_post_clif_instance) (int retVal___, int instance_id, int type, int flag);
+typedef void (*HPMHOOK_pre_clif_instance_join) (int *fd, int *instance_id);
+typedef void (*HPMHOOK_post_clif_instance_join) (int fd, int instance_id);
+typedef void (*HPMHOOK_pre_clif_instance_leave) (int *fd);
+typedef void (*HPMHOOK_post_clif_instance_leave) (int fd);
+typedef void (*HPMHOOK_pre_clif_catch_process) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_catch_process) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pet_roulette) (struct map_session_data **sd, int *data);
+typedef void (*HPMHOOK_post_clif_pet_roulette) (struct map_session_data *sd, int data);
+typedef void (*HPMHOOK_pre_clif_sendegg) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_sendegg) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_send_petstatus) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_send_petstatus) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_send_petdata) (struct map_session_data **sd, struct pet_data **pd, int *type, int *param);
+typedef void (*HPMHOOK_post_clif_send_petdata) (struct map_session_data *sd, struct pet_data *pd, int type, int param);
+typedef void (*HPMHOOK_pre_clif_pet_emotion) (struct pet_data **pd, int *param);
+typedef void (*HPMHOOK_post_clif_pet_emotion) (struct pet_data *pd, int param);
+typedef void (*HPMHOOK_pre_clif_pet_food) (struct map_session_data **sd, int *foodid, int *fail);
+typedef void (*HPMHOOK_post_clif_pet_food) (struct map_session_data *sd, int foodid, int fail);
+typedef int (*HPMHOOK_pre_clif_friendslist_toggle_sub) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_clif_friendslist_toggle_sub) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef void (*HPMHOOK_pre_clif_friendslist_send) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_friendslist_send) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_friendslist_reqack) (struct map_session_data **sd, struct map_session_data **f_sd, int *type);
+typedef void (*HPMHOOK_post_clif_friendslist_reqack) (struct map_session_data *sd, struct map_session_data *f_sd, int type);
+typedef void (*HPMHOOK_pre_clif_friendslist_toggle) (struct map_session_data **sd, int *account_id, int *char_id, int *online);
+typedef void (*HPMHOOK_post_clif_friendslist_toggle) (struct map_session_data *sd, int account_id, int char_id, int online);
+typedef void (*HPMHOOK_pre_clif_friendlist_req) (struct map_session_data **sd, int *account_id, int *char_id, const char **name);
+typedef void (*HPMHOOK_post_clif_friendlist_req) (struct map_session_data *sd, int account_id, int char_id, const char *name);
+typedef void (*HPMHOOK_pre_clif_GM_kickack) (struct map_session_data **sd, int *result);
+typedef void (*HPMHOOK_post_clif_GM_kickack) (struct map_session_data *sd, int result);
+typedef void (*HPMHOOK_pre_clif_GM_kick) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef void (*HPMHOOK_post_clif_GM_kick) (struct map_session_data *sd, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_clif_manner_message) (struct map_session_data **sd, uint32 *type);
+typedef void (*HPMHOOK_post_clif_manner_message) (struct map_session_data *sd, uint32 type);
+typedef void (*HPMHOOK_pre_clif_GM_silence) (struct map_session_data **sd, struct map_session_data **tsd, uint8 *type);
+typedef void (*HPMHOOK_post_clif_GM_silence) (struct map_session_data *sd, struct map_session_data *tsd, uint8 type);
+typedef void (*HPMHOOK_pre_clif_account_name) (struct map_session_data **sd, int *account_id, const char **accname);
+typedef void (*HPMHOOK_post_clif_account_name) (struct map_session_data *sd, int account_id, const char *accname);
+typedef void (*HPMHOOK_pre_clif_check) (int *fd, struct map_session_data **pl_sd);
+typedef void (*HPMHOOK_post_clif_check) (int fd, struct map_session_data *pl_sd);
+typedef void (*HPMHOOK_pre_clif_hominfo) (struct map_session_data **sd, struct homun_data **hd, int *flag);
+typedef void (*HPMHOOK_post_clif_hominfo) (struct map_session_data *sd, struct homun_data *hd, int flag);
+typedef void (*HPMHOOK_pre_clif_homskillinfoblock) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_homskillinfoblock) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_homskillup) (struct map_session_data **sd, uint16 *skill_id);
+typedef void (*HPMHOOK_post_clif_homskillup) (struct map_session_data *sd, uint16 skill_id);
+typedef void (*HPMHOOK_pre_clif_hom_food) (struct map_session_data **sd, int *foodid, int *fail);
+typedef void (*HPMHOOK_post_clif_hom_food) (struct map_session_data *sd, int foodid, int fail);
+typedef void (*HPMHOOK_pre_clif_send_homdata) (struct map_session_data **sd, int *state, int *param);
+typedef void (*HPMHOOK_post_clif_send_homdata) (struct map_session_data *sd, int state, int param);
+typedef void (*HPMHOOK_pre_clif_quest_send_list) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_quest_send_list) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_quest_send_mission) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_quest_send_mission) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_quest_add) (struct map_session_data **sd, struct quest **qd);
+typedef void (*HPMHOOK_post_clif_quest_add) (struct map_session_data *sd, struct quest *qd);
+typedef void (*HPMHOOK_pre_clif_quest_delete) (struct map_session_data **sd, int *quest_id);
+typedef void (*HPMHOOK_post_clif_quest_delete) (struct map_session_data *sd, int quest_id);
+typedef void (*HPMHOOK_pre_clif_quest_update_status) (struct map_session_data **sd, int *quest_id, bool *active);
+typedef void (*HPMHOOK_post_clif_quest_update_status) (struct map_session_data *sd, int quest_id, bool active);
+typedef void (*HPMHOOK_pre_clif_quest_update_objective) (struct map_session_data **sd, struct quest **qd);
+typedef void (*HPMHOOK_post_clif_quest_update_objective) (struct map_session_data *sd, struct quest *qd);
+typedef void (*HPMHOOK_pre_clif_quest_show_event) (struct map_session_data **sd, struct block_list **bl, short *state, short *color);
+typedef void (*HPMHOOK_post_clif_quest_show_event) (struct map_session_data *sd, struct block_list *bl, short state, short color);
+typedef void (*HPMHOOK_pre_clif_mail_window) (int *fd, int *flag);
+typedef void (*HPMHOOK_post_clif_mail_window) (int fd, int flag);
+typedef void (*HPMHOOK_pre_clif_mail_read) (struct map_session_data **sd, int *mail_id);
+typedef void (*HPMHOOK_post_clif_mail_read) (struct map_session_data *sd, int mail_id);
+typedef void (*HPMHOOK_pre_clif_mail_delete) (int *fd, int *mail_id, short *fail);
+typedef void (*HPMHOOK_post_clif_mail_delete) (int fd, int mail_id, short fail);
+typedef void (*HPMHOOK_pre_clif_mail_return) (int *fd, int *mail_id, short *fail);
+typedef void (*HPMHOOK_post_clif_mail_return) (int fd, int mail_id, short fail);
+typedef void (*HPMHOOK_pre_clif_mail_send) (int *fd, bool *fail);
+typedef void (*HPMHOOK_post_clif_mail_send) (int fd, bool fail);
+typedef void (*HPMHOOK_pre_clif_mail_new) (int *fd, int *mail_id, const char **sender, const char **title);
+typedef void (*HPMHOOK_post_clif_mail_new) (int fd, int mail_id, const char *sender, const char *title);
+typedef void (*HPMHOOK_pre_clif_mail_refreshinbox) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_mail_refreshinbox) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_mail_getattachment) (int *fd, uint8 *flag);
+typedef void (*HPMHOOK_post_clif_mail_getattachment) (int fd, uint8 flag);
+typedef void (*HPMHOOK_pre_clif_mail_setattachment) (int *fd, int *index, uint8 *flag);
+typedef void (*HPMHOOK_post_clif_mail_setattachment) (int fd, int index, uint8 flag);
+typedef void (*HPMHOOK_pre_clif_auction_openwindow) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_auction_openwindow) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_auction_results) (struct map_session_data **sd, short *count, short *pages, const uint8 **buf);
+typedef void (*HPMHOOK_post_clif_auction_results) (struct map_session_data *sd, short count, short pages, const uint8 *buf);
+typedef void (*HPMHOOK_pre_clif_auction_message) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_clif_auction_message) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_clif_auction_close) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_clif_auction_close) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_clif_auction_setitem) (int *fd, int *index, bool *fail);
+typedef void (*HPMHOOK_post_clif_auction_setitem) (int fd, int index, bool fail);
+typedef void (*HPMHOOK_pre_clif_mercenary_info) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_mercenary_info) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_mercenary_skillblock) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_mercenary_skillblock) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_mercenary_message) (struct map_session_data **sd, int *message);
+typedef void (*HPMHOOK_post_clif_mercenary_message) (struct map_session_data *sd, int message);
+typedef void (*HPMHOOK_pre_clif_mercenary_updatestatus) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_mercenary_updatestatus) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_rental_time) (int *fd, int *nameid, int *seconds);
+typedef void (*HPMHOOK_post_clif_rental_time) (int fd, int nameid, int seconds);
+typedef void (*HPMHOOK_pre_clif_rental_expired) (int *fd, int *index, int *nameid);
+typedef void (*HPMHOOK_post_clif_rental_expired) (int fd, int index, int nameid);
+typedef void (*HPMHOOK_pre_clif_PartyBookingRegisterAck) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_PartyBookingRegisterAck) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_PartyBookingDeleteAck) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_PartyBookingDeleteAck) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_PartyBookingSearchAck) (int *fd, struct party_booking_ad_info ***results, int *count, bool *more_result);
+typedef void (*HPMHOOK_post_clif_PartyBookingSearchAck) (int fd, struct party_booking_ad_info **results, int count, bool more_result);
+typedef void (*HPMHOOK_pre_clif_PartyBookingUpdateNotify) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
+typedef void (*HPMHOOK_post_clif_PartyBookingUpdateNotify) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+typedef void (*HPMHOOK_pre_clif_PartyBookingDeleteNotify) (struct map_session_data **sd, int *index);
+typedef void (*HPMHOOK_post_clif_PartyBookingDeleteNotify) (struct map_session_data *sd, int index);
+typedef void (*HPMHOOK_pre_clif_PartyBookingInsertNotify) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
+typedef void (*HPMHOOK_post_clif_PartyBookingInsertNotify) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+typedef void (*HPMHOOK_pre_clif_PartyRecruitRegisterAck) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_PartyRecruitRegisterAck) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_PartyRecruitDeleteAck) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_clif_PartyRecruitDeleteAck) (struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_clif_PartyRecruitSearchAck) (int *fd, struct party_booking_ad_info ***results, int *count, bool *more_result);
+typedef void (*HPMHOOK_post_clif_PartyRecruitSearchAck) (int fd, struct party_booking_ad_info **results, int count, bool more_result);
+typedef void (*HPMHOOK_pre_clif_PartyRecruitUpdateNotify) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
+typedef void (*HPMHOOK_post_clif_PartyRecruitUpdateNotify) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+typedef void (*HPMHOOK_pre_clif_PartyRecruitDeleteNotify) (struct map_session_data **sd, int *index);
+typedef void (*HPMHOOK_post_clif_PartyRecruitDeleteNotify) (struct map_session_data *sd, int index);
+typedef void (*HPMHOOK_pre_clif_PartyRecruitInsertNotify) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
+typedef void (*HPMHOOK_post_clif_PartyRecruitInsertNotify) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+typedef void (*HPMHOOK_pre_clif_PartyBookingVolunteerInfo) (int *index, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PartyBookingVolunteerInfo) (int index, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_PartyBookingRefuseVolunteer) (unsigned int *aid, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PartyBookingRefuseVolunteer) (unsigned int aid, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_PartyBookingCancelVolunteer) (int *index, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PartyBookingCancelVolunteer) (int index, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_PartyBookingAddFilteringList) (int *index, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PartyBookingAddFilteringList) (int index, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_PartyBookingSubFilteringList) (int *gid, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_PartyBookingSubFilteringList) (int gid, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_open) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_open) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_open_failed) (struct map_session_data **sd, unsigned short *result, unsigned int *weight);
+typedef void (*HPMHOOK_post_clif_buyingstore_open_failed) (struct map_session_data *sd, unsigned short result, unsigned int weight);
+typedef void (*HPMHOOK_pre_clif_buyingstore_myitemlist) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_myitemlist) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_entry) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_entry) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_entry_single) (struct map_session_data **sd, struct map_session_data **pl_sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_entry_single) (struct map_session_data *sd, struct map_session_data *pl_sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_disappear_entry) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_disappear_entry) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_disappear_entry_single) (struct map_session_data **sd, struct map_session_data **pl_sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_disappear_entry_single) (struct map_session_data *sd, struct map_session_data *pl_sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_itemlist) (struct map_session_data **sd, struct map_session_data **pl_sd);
+typedef void (*HPMHOOK_post_clif_buyingstore_itemlist) (struct map_session_data *sd, struct map_session_data *pl_sd);
+typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_buyer) (struct map_session_data **sd, short *result);
+typedef void (*HPMHOOK_post_clif_buyingstore_trade_failed_buyer) (struct map_session_data *sd, short result);
+typedef void (*HPMHOOK_pre_clif_buyingstore_update_item) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny);
+typedef void (*HPMHOOK_post_clif_buyingstore_update_item) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny);
+typedef void (*HPMHOOK_pre_clif_buyingstore_delete_item) (struct map_session_data **sd, short *index, unsigned short *amount, int *price);
+typedef void (*HPMHOOK_post_clif_buyingstore_delete_item) (struct map_session_data *sd, short index, unsigned short amount, int price);
+typedef void (*HPMHOOK_pre_clif_buyingstore_trade_failed_seller) (struct map_session_data **sd, short *result, unsigned short *nameid);
+typedef void (*HPMHOOK_post_clif_buyingstore_trade_failed_seller) (struct map_session_data *sd, short result, unsigned short nameid);
+typedef void (*HPMHOOK_pre_clif_search_store_info_ack) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_search_store_info_ack) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_search_store_info_failed) (struct map_session_data **sd, unsigned char *reason);
+typedef void (*HPMHOOK_post_clif_search_store_info_failed) (struct map_session_data *sd, unsigned char reason);
+typedef void (*HPMHOOK_pre_clif_open_search_store_info) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_open_search_store_info) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_search_store_info_click_ack) (struct map_session_data **sd, short *x, short *y);
+typedef void (*HPMHOOK_post_clif_search_store_info_click_ack) (struct map_session_data *sd, short x, short y);
+typedef void (*HPMHOOK_pre_clif_elemental_info) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_elemental_info) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_elemental_updatestatus) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_elemental_updatestatus) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_bgqueue_ack) (struct map_session_data **sd, enum BATTLEGROUNDS_QUEUE_ACK *response, unsigned char *arena_id);
+typedef void (*HPMHOOK_post_clif_bgqueue_ack) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id);
+typedef void (*HPMHOOK_pre_clif_bgqueue_notice_delete) (struct map_session_data **sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED *response, const char **name);
+typedef void (*HPMHOOK_post_clif_bgqueue_notice_delete) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, const char *name);
+typedef void (*HPMHOOK_pre_clif_bgqueue_update_info) (struct map_session_data **sd, unsigned char *arena_id, int *position);
+typedef void (*HPMHOOK_post_clif_bgqueue_update_info) (struct map_session_data *sd, unsigned char arena_id, int position);
+typedef void (*HPMHOOK_pre_clif_bgqueue_joined) (struct map_session_data **sd, int *pos);
+typedef void (*HPMHOOK_post_clif_bgqueue_joined) (struct map_session_data *sd, int pos);
+typedef void (*HPMHOOK_pre_clif_bgqueue_pcleft) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_bgqueue_pcleft) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_bgqueue_battlebegins) (struct map_session_data **sd, unsigned char *arena_id, enum send_target *target);
+typedef void (*HPMHOOK_post_clif_bgqueue_battlebegins) (struct map_session_data *sd, unsigned char arena_id, enum send_target target);
+typedef void (*HPMHOOK_pre_clif_adopt_reply) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_clif_adopt_reply) (struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_clif_adopt_request) (struct map_session_data **sd, struct map_session_data **src, int *p_id);
+typedef void (*HPMHOOK_post_clif_adopt_request) (struct map_session_data *sd, struct map_session_data *src, int p_id);
+typedef void (*HPMHOOK_pre_clif_readbook) (int *fd, int *book_id, int *page);
+typedef void (*HPMHOOK_post_clif_readbook) (int fd, int book_id, int page);
+typedef void (*HPMHOOK_pre_clif_notify_time) (struct map_session_data **sd, int64 *time);
+typedef void (*HPMHOOK_post_clif_notify_time) (struct map_session_data *sd, int64 time);
+typedef void (*HPMHOOK_pre_clif_user_count) (struct map_session_data **sd, int *count);
+typedef void (*HPMHOOK_post_clif_user_count) (struct map_session_data *sd, int count);
+typedef void (*HPMHOOK_pre_clif_noask_sub) (struct map_session_data **src, struct map_session_data **target, int *type);
+typedef void (*HPMHOOK_post_clif_noask_sub) (struct map_session_data *src, struct map_session_data *target, int type);
+typedef void (*HPMHOOK_pre_clif_bc_ready) (void);
+typedef void (*HPMHOOK_post_clif_bc_ready) (void);
+typedef void (*HPMHOOK_pre_clif_channel_msg) (struct channel_data **chan, struct map_session_data **sd, char **msg);
+typedef void (*HPMHOOK_post_clif_channel_msg) (struct channel_data *chan, struct map_session_data *sd, char *msg);
+typedef void (*HPMHOOK_pre_clif_channel_msg2) (struct channel_data **chan, char **msg);
+typedef void (*HPMHOOK_post_clif_channel_msg2) (struct channel_data *chan, char *msg);
+typedef int (*HPMHOOK_pre_clif_undisguise_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_clif_undisguise_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_clif_bank_deposit) (struct map_session_data **sd, enum e_BANKING_DEPOSIT_ACK *reason);
+typedef void (*HPMHOOK_post_clif_bank_deposit) (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason);
+typedef void (*HPMHOOK_pre_clif_bank_withdraw) (struct map_session_data **sd, enum e_BANKING_WITHDRAW_ACK *reason);
+typedef void (*HPMHOOK_post_clif_bank_withdraw) (struct map_session_data *sd, enum e_BANKING_WITHDRAW_ACK reason);
+typedef void (*HPMHOOK_pre_clif_show_modifiers) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_show_modifiers) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_notify_bounditem) (struct map_session_data **sd, unsigned short *index);
+typedef void (*HPMHOOK_post_clif_notify_bounditem) (struct map_session_data *sd, unsigned short index);
+typedef int (*HPMHOOK_pre_clif_delay_damage) (int64 *tick, struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, unsigned char *type);
+typedef int (*HPMHOOK_post_clif_delay_damage) (int retVal___, int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type);
+typedef int (*HPMHOOK_pre_clif_delay_damage_sub) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_clif_delay_damage_sub) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_clif_npc_market_open) (struct map_session_data **sd, struct npc_data **nd);
+typedef void (*HPMHOOK_post_clif_npc_market_open) (struct map_session_data *sd, struct npc_data *nd);
+typedef void (*HPMHOOK_pre_clif_npc_market_purchase_ack) (struct map_session_data **sd, const struct itemlist **item_list, unsigned char *response);
+typedef void (*HPMHOOK_post_clif_npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response);
+typedef bool (*HPMHOOK_pre_clif_parse_roulette_db) (void);
+typedef bool (*HPMHOOK_post_clif_parse_roulette_db) (bool retVal___);
+typedef void (*HPMHOOK_pre_clif_roulette_generate_ack) (struct map_session_data **sd, unsigned char *result, short *stage, short *prizeIdx, short *bonusItemID);
+typedef void (*HPMHOOK_post_clif_roulette_generate_ack) (struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID);
+typedef void (*HPMHOOK_pre_clif_openmergeitem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_openmergeitem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_cancelmergeitem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_cancelmergeitem) (int fd, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_clif_comparemergeitem) (const void **a, const void **b);
+typedef int (*HPMHOOK_post_clif_comparemergeitem) (int retVal___, const void *a, const void *b);
+typedef void (*HPMHOOK_pre_clif_ackmergeitems) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_ackmergeitems) (int fd, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_clif_isdisguised) (struct block_list **bl);
+typedef bool (*HPMHOOK_post_clif_isdisguised) (bool retVal___, struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_navigate_to) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id);
+typedef void (*HPMHOOK_post_clif_navigate_to) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id);
+typedef unsigned char (*HPMHOOK_pre_clif_bl_type) (struct block_list **bl);
+typedef unsigned char (*HPMHOOK_post_clif_bl_type) (unsigned char retVal___, struct block_list *bl);
+typedef void (*HPMHOOK_pre_clif_pWantToConnection) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pWantToConnection) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pLoadEndAck) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pLoadEndAck) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTickSend) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTickSend) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pHotkey) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pHotkey) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pProgressbar) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pProgressbar) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pWalkToXY) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pWalkToXY) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pQuitGame) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pQuitGame) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGetCharNameRequest) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGetCharNameRequest) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGlobalMessage) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGlobalMessage) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMapMove) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMapMove) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChangeDir) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChangeDir) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pEmotion) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pEmotion) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pHowManyConnections) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pHowManyConnections) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pActionRequest) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pActionRequest) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pActionRequest_sub) (struct map_session_data **sd, int *action_type, int *target_id, int64 *tick);
+typedef void (*HPMHOOK_post_clif_pActionRequest_sub) (struct map_session_data *sd, int action_type, int target_id, int64 tick);
+typedef void (*HPMHOOK_pre_clif_pRestart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRestart) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pWisMessage) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pWisMessage) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBroadcast) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBroadcast) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTakeItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTakeItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pDropItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pDropItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUseItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUseItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pEquipItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pEquipItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUnequipItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUnequipItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcClicked) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcClicked) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcBuySellSelected) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcBuySellSelected) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcBuyListSend) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcBuyListSend) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcSellListSend) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcSellListSend) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCreateChatRoom) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCreateChatRoom) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChatAddMember) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChatAddMember) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChatRoomStatusChange) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChatRoomStatusChange) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChangeChatOwner) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChangeChatOwner) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pKickFromChat) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pKickFromChat) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChatLeave) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChatLeave) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTradeRequest) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTradeRequest) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTradeAck) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTradeAck) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTradeAddItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTradeAddItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTradeOk) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTradeOk) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTradeCancel) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTradeCancel) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTradeCommit) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTradeCommit) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pStopAttack) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pStopAttack) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPutItemToCart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPutItemToCart) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGetItemFromCart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGetItemFromCart) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRemoveOption) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRemoveOption) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChangeCart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChangeCart) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pStatusUp) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pStatusUp) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSkillUp) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSkillUp) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToId) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUseSkillToId) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToId_homun) (struct homun_data **hd, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
+typedef void (*HPMHOOK_post_clif_pUseSkillToId_homun) (struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToId_mercenary) (struct mercenary_data **md, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
+typedef void (*HPMHOOK_post_clif_pUseSkillToId_mercenary) (struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToPos) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUseSkillToPos) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToPosSub) (int *fd, struct map_session_data **sd, uint16 *skill_lv, uint16 *skill_id, short *x, short *y, int *skillmoreinfo);
+typedef void (*HPMHOOK_post_clif_pUseSkillToPosSub) (int fd, struct map_session_data *sd, uint16 skill_lv, uint16 skill_id, short x, short y, int skillmoreinfo);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToPos_homun) (struct homun_data **hd, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
+typedef void (*HPMHOOK_post_clif_pUseSkillToPos_homun) (struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToPos_mercenary) (struct mercenary_data **md, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
+typedef void (*HPMHOOK_post_clif_pUseSkillToPos_mercenary) (struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo);
+typedef void (*HPMHOOK_pre_clif_pUseSkillToPosMoreInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUseSkillToPosMoreInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUseSkillMap) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUseSkillMap) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRequestMemo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRequestMemo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pProduceMix) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pProduceMix) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCooking) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCooking) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRepairItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRepairItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pWeaponRefine) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pWeaponRefine) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcSelectMenu) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcSelectMenu) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcNextClicked) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcNextClicked) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcAmountInput) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcAmountInput) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcStringInput) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcStringInput) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNpcCloseClicked) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNpcCloseClicked) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pItemIdentify) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pItemIdentify) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSelectArrow) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSelectArrow) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAutoSpell) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAutoSpell) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pUseCard) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pUseCard) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pInsertCard) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pInsertCard) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSolveCharName) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSolveCharName) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pResetChar) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pResetChar) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pLocalBroadcast) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pLocalBroadcast) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMoveToKafra) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMoveToKafra) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMoveFromKafra) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMoveFromKafra) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMoveToKafraFromCart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMoveToKafraFromCart) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMoveFromKafraToCart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMoveFromKafraToCart) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCloseKafra) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCloseKafra) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pStoragePassword) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pStoragePassword) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCreateParty) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCreateParty) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCreateParty2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCreateParty2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyInvite) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyInvite) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyInvite2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyInvite2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pReplyPartyInvite) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pReplyPartyInvite) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pReplyPartyInvite2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pReplyPartyInvite2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pLeaveParty) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pLeaveParty) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRemovePartyMember) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRemovePartyMember) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyChangeOption) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyChangeOption) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyMessage) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyMessage) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyChangeLeader) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyChangeLeader) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingRegisterReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingRegisterReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingSearchReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingSearchReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingDeleteReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingDeleteReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingUpdateReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingUpdateReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyRecruitRegisterReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyRecruitRegisterReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyRecruitSearchReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyRecruitSearchReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyRecruitDeleteReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyRecruitDeleteReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyRecruitUpdateReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyRecruitUpdateReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCloseVending) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCloseVending) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pVendingListReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pVendingListReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPurchaseReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPurchaseReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPurchaseReq2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPurchaseReq2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pOpenVending) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pOpenVending) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCreateGuild) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCreateGuild) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildCheckMaster) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildCheckMaster) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildRequestInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildRequestInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildChangePositionInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildChangePositionInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildChangeMemberPosition) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildChangeMemberPosition) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildRequestEmblem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildRequestEmblem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildChangeEmblem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildChangeEmblem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildChangeNotice) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildChangeNotice) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildInvite) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildInvite) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildReplyInvite) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildReplyInvite) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildLeave) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildLeave) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildExpulsion) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildExpulsion) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildMessage) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildMessage) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildRequestAlliance) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildRequestAlliance) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildReplyAlliance) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildReplyAlliance) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildDelAlliance) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildDelAlliance) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildOpposition) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildOpposition) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildBreak) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildBreak) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPetMenu) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPetMenu) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCatchPet) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCatchPet) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSelectEgg) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSelectEgg) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSendEmotion) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSendEmotion) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChangePetName) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChangePetName) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMKick) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMKick) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMKickAll) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMKickAll) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMShift) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMShift) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMRemove2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMRemove2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMRecall) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMRecall) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMRecall2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMRecall2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGM_Monster_Item) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGM_Monster_Item) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMHide) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMHide) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMReqNoChat) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMReqNoChat) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMRc) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMRc) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMReqAccountName) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMReqAccountName) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMChangeMapType) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMChangeMapType) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGMFullStrip) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGMFullStrip) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPMIgnore) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPMIgnore) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPMIgnoreAll) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPMIgnoreAll) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPMIgnoreList) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPMIgnoreList) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNoviceDoriDori) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNoviceDoriDori) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNoviceExplosionSpirits) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNoviceExplosionSpirits) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pFriendsListAdd) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pFriendsListAdd) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pFriendsListReply) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pFriendsListReply) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pFriendsListRemove) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pFriendsListRemove) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPVPInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPVPInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBlacksmith) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBlacksmith) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAlchemist) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAlchemist) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pTaekwon) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pTaekwon) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRankingPk) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRankingPk) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pFeelSaveOk) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pFeelSaveOk) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pChangeHomunculusName) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pChangeHomunculusName) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pHomMoveToMaster) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pHomMoveToMaster) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pHomMoveTo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pHomMoveTo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pHomAttack) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pHomAttack) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pHomMenu) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pHomMenu) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAutoRevive) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAutoRevive) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCheck) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCheck) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_refreshinbox) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_refreshinbox) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_read) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_read) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_getattach) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_getattach) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_delete) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_delete) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_return) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_return) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_setattach) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_setattach) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_winopen) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_winopen) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMail_send) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMail_send) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_cancelreg) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_cancelreg) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_setitem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_setitem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_register) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_register) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_cancel) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_cancel) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_close) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_close) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_bid) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_bid) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_search) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_search) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAuction_buysell) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAuction_buysell) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pcashshop_buy) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pcashshop_buy) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAdopt_request) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAdopt_request) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pAdopt_reply) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pAdopt_reply) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pViewPlayerEquip) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pViewPlayerEquip) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pEquipTick) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pEquipTick) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pquestStateAck) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pquestStateAck) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pmercenary_action) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pmercenary_action) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBattleChat) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBattleChat) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pLessEffect) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pLessEffect) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pItemListWindowSelected) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pItemListWindowSelected) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pReqOpenBuyingStore) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pReqOpenBuyingStore) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pReqCloseBuyingStore) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pReqCloseBuyingStore) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pReqClickBuyingStore) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pReqClickBuyingStore) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pReqTradeBuyingStore) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pReqTradeBuyingStore) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSearchStoreInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSearchStoreInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSearchStoreInfoNextPage) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSearchStoreInfoNextPage) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCloseSearchStoreInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCloseSearchStoreInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSearchStoreInfoListItemClick) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSearchStoreInfoListItemClick) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pDebug) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pDebug) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSkillSelectMenu) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSkillSelectMenu) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pMoveItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pMoveItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pDull) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pDull) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBGQueueRegister) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBGQueueRegister) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBGQueueCheckState) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBGQueueCheckState) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBGQueueRevokeReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBGQueueRevokeReq) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBGQueueBattleBeginAck) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBGQueueBattleBeginAck) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopOpen) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopOpen) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopClose) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopClose) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopReqTab) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopReqTab) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopSchedule) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopSchedule) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopBuy) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopBuy) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyTick) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyTick) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pGuildInvite2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pGuildInvite2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingAddFilter) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingAddFilter) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingSubFilter) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingSubFilter) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingReqVolunteer) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingReqVolunteer) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingRefuseVolunteer) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingRefuseVolunteer) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pPartyBookingCancelVolunteer) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pPartyBookingCancelVolunteer) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBankDeposit) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBankDeposit) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBankWithdraw) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBankWithdraw) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBankCheck) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBankCheck) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBankOpen) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBankOpen) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pBankClose) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pBankClose) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRouletteOpen) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRouletteOpen) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRouletteInfo) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRouletteInfo) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRouletteClose) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRouletteClose) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRouletteGenerate) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRouletteGenerate) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pRouletteRecvItem) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pRouletteRecvItem) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNPCShopClosed) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNPCShopClosed) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNPCMarketClosed) (int *fd, struct map_session_data **sd);
+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 int (*HPMHOOK_pre_clif_add_item_options) (struct ItemOptions **buf, const struct item **it);
+typedef int (*HPMHOOK_post_clif_add_item_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);
+typedef void (*HPMHOOK_post_clif_dressroom_open) (struct map_session_data *sd, int view);
+typedef void (*HPMHOOK_pre_clif_pOneClick_ItemIdentify) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pOneClick_ItemIdentify) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_selectcart) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_selectcart) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pSelectCart) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pSelectCart) (int fd, struct map_session_data *sd);
+typedef const char* (*HPMHOOK_pre_clif_get_bl_name) (const struct block_list **bl);
+typedef const char* (*HPMHOOK_post_clif_get_bl_name) (const char* retVal___, const struct block_list *bl);
+#endif // MAP_CLIF_H
+#ifdef COMMON_CORE_H /* cmdline */
+typedef void (*HPMHOOK_pre_cmdline_init) (void);
+typedef void (*HPMHOOK_post_cmdline_init) (void);
+typedef void (*HPMHOOK_pre_cmdline_final) (void);
+typedef void (*HPMHOOK_post_cmdline_final) (void);
+typedef bool (*HPMHOOK_pre_cmdline_arg_add) (unsigned int *pluginID, const char **name, char *shortname, CmdlineExecFunc *func, const char **help, unsigned int *options);
+typedef bool (*HPMHOOK_post_cmdline_arg_add) (bool retVal___, unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options);
+typedef int (*HPMHOOK_pre_cmdline_exec) (int *argc, char ***argv, unsigned int *options);
+typedef int (*HPMHOOK_post_cmdline_exec) (int retVal___, int argc, char **argv, unsigned int options);
+typedef bool (*HPMHOOK_pre_cmdline_arg_next_value) (const char **name, int *current_arg, int *argc);
+typedef bool (*HPMHOOK_post_cmdline_arg_next_value) (bool retVal___, const char *name, int current_arg, int argc);
+typedef const char* (*HPMHOOK_pre_cmdline_arg_source) (struct CmdlineArgData **arg);
+typedef const char* (*HPMHOOK_post_cmdline_arg_source) (const char* retVal___, struct CmdlineArgData *arg);
+#endif // COMMON_CORE_H
+#ifdef COMMON_CONSOLE_H /* console */
+typedef void (*HPMHOOK_pre_console_init) (void);
+typedef void (*HPMHOOK_post_console_init) (void);
+typedef void (*HPMHOOK_pre_console_final) (void);
+typedef void (*HPMHOOK_post_console_final) (void);
+typedef void (*HPMHOOK_pre_console_display_title) (void);
+typedef void (*HPMHOOK_post_console_display_title) (void);
+typedef void (*HPMHOOK_pre_console_display_gplnotice) (void);
+typedef void (*HPMHOOK_post_console_display_gplnotice) (void);
+#endif // COMMON_CONSOLE_H
+#ifdef COMMON_CORE_H /* core */
+typedef void (*HPMHOOK_pre_core_shutdown_callback) (void);
+typedef void (*HPMHOOK_post_core_shutdown_callback) (void);
+#endif // COMMON_CORE_H
+#ifdef COMMON_DB_H /* DB */
+typedef enum DBOptions (*HPMHOOK_pre_DB_fix_options) (enum DBType *type, enum DBOptions *options);
+typedef enum DBOptions (*HPMHOOK_post_DB_fix_options) (enum DBOptions retVal___, enum DBType type, enum DBOptions options);
+typedef DBComparator (*HPMHOOK_pre_DB_default_cmp) (enum DBType *type);
+typedef DBComparator (*HPMHOOK_post_DB_default_cmp) (DBComparator retVal___, enum DBType type);
+typedef DBHasher (*HPMHOOK_pre_DB_default_hash) (enum DBType *type);
+typedef DBHasher (*HPMHOOK_post_DB_default_hash) (DBHasher retVal___, enum DBType type);
+typedef DBReleaser (*HPMHOOK_pre_DB_default_release) (enum DBType *type, enum DBOptions *options);
+typedef DBReleaser (*HPMHOOK_post_DB_default_release) (DBReleaser retVal___, enum DBType type, enum DBOptions options);
+typedef DBReleaser (*HPMHOOK_pre_DB_custom_release) (enum DBReleaseOption *which);
+typedef DBReleaser (*HPMHOOK_post_DB_custom_release) (DBReleaser retVal___, enum DBReleaseOption which);
+typedef struct DBMap* (*HPMHOOK_pre_DB_alloc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen);
+typedef struct DBMap* (*HPMHOOK_post_DB_alloc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen);
+typedef union DBKey (*HPMHOOK_pre_DB_i2key) (int *key);
+typedef union DBKey (*HPMHOOK_post_DB_i2key) (union DBKey retVal___, int key);
+typedef union DBKey (*HPMHOOK_pre_DB_ui2key) (unsigned int *key);
+typedef union DBKey (*HPMHOOK_post_DB_ui2key) (union DBKey retVal___, unsigned int key);
+typedef union DBKey (*HPMHOOK_pre_DB_str2key) (const char **key);
+typedef union DBKey (*HPMHOOK_post_DB_str2key) (union DBKey retVal___, const char *key);
+typedef union DBKey (*HPMHOOK_pre_DB_i642key) (int64 *key);
+typedef union DBKey (*HPMHOOK_post_DB_i642key) (union DBKey retVal___, int64 key);
+typedef union DBKey (*HPMHOOK_pre_DB_ui642key) (uint64 *key);
+typedef union DBKey (*HPMHOOK_post_DB_ui642key) (union DBKey retVal___, uint64 key);
+typedef struct DBData (*HPMHOOK_pre_DB_i2data) (int *data);
+typedef struct DBData (*HPMHOOK_post_DB_i2data) (struct DBData retVal___, int data);
+typedef struct DBData (*HPMHOOK_pre_DB_ui2data) (unsigned int *data);
+typedef struct DBData (*HPMHOOK_post_DB_ui2data) (struct DBData retVal___, unsigned int data);
+typedef struct DBData (*HPMHOOK_pre_DB_ptr2data) (void **data);
+typedef struct DBData (*HPMHOOK_post_DB_ptr2data) (struct DBData retVal___, void *data);
+typedef int (*HPMHOOK_pre_DB_data2i) (struct DBData **data);
+typedef int (*HPMHOOK_post_DB_data2i) (int retVal___, struct DBData *data);
+typedef unsigned int (*HPMHOOK_pre_DB_data2ui) (struct DBData **data);
+typedef unsigned int (*HPMHOOK_post_DB_data2ui) (unsigned int retVal___, struct DBData *data);
+typedef void* (*HPMHOOK_pre_DB_data2ptr) (struct DBData **data);
+typedef void* (*HPMHOOK_post_DB_data2ptr) (void* retVal___, struct DBData *data);
+typedef void (*HPMHOOK_pre_DB_init) (void);
+typedef void (*HPMHOOK_post_DB_init) (void);
+typedef void (*HPMHOOK_pre_DB_final) (void);
+typedef void (*HPMHOOK_post_DB_final) (void);
+#endif // COMMON_DB_H
+#ifdef COMMON_DES_H /* des */
+typedef void (*HPMHOOK_pre_des_decrypt_block) (struct des_bit64 **block);
+typedef void (*HPMHOOK_post_des_decrypt_block) (struct des_bit64 *block);
+typedef void (*HPMHOOK_pre_des_decrypt) (unsigned char **data, size_t *size);
+typedef void (*HPMHOOK_post_des_decrypt) (unsigned char *data, size_t size);
+#endif // COMMON_DES_H
+#ifdef MAP_DUEL_H /* duel */
+typedef int (*HPMHOOK_pre_duel_create) (struct map_session_data **sd, const unsigned int *maxpl);
+typedef int (*HPMHOOK_post_duel_create) (int retVal___, struct map_session_data *sd, const unsigned int maxpl);
+typedef void (*HPMHOOK_pre_duel_invite) (const unsigned int *did, struct map_session_data **sd, struct map_session_data **target_sd);
+typedef void (*HPMHOOK_post_duel_invite) (const unsigned int did, struct map_session_data *sd, struct map_session_data *target_sd);
+typedef void (*HPMHOOK_pre_duel_accept) (const unsigned int *did, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_duel_accept) (const unsigned int did, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_duel_reject) (const unsigned int *did, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_duel_reject) (const unsigned int did, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_duel_leave) (const unsigned int *did, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_duel_leave) (const unsigned int did, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_duel_showinfo) (const unsigned int *did, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_duel_showinfo) (const unsigned int did, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_duel_checktime) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_duel_checktime) (int retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_duel_init) (bool *minimal);
+typedef void (*HPMHOOK_post_duel_init) (bool minimal);
+typedef void (*HPMHOOK_pre_duel_final) (void);
+typedef void (*HPMHOOK_post_duel_final) (void);
+#endif // MAP_DUEL_H
+#ifdef MAP_ELEMENTAL_H /* elemental */
+typedef int (*HPMHOOK_pre_elemental_init) (bool *minimal);
+typedef int (*HPMHOOK_post_elemental_init) (int retVal___, bool minimal);
+typedef void (*HPMHOOK_pre_elemental_final) (void);
+typedef void (*HPMHOOK_post_elemental_final) (void);
+typedef bool (*HPMHOOK_pre_elemental_class) (int *class_);
+typedef bool (*HPMHOOK_post_elemental_class) (bool retVal___, int class_);
+typedef struct view_data* (*HPMHOOK_pre_elemental_get_viewdata) (int *class_);
+typedef struct view_data* (*HPMHOOK_post_elemental_get_viewdata) (struct view_data* retVal___, int class_);
+typedef int (*HPMHOOK_pre_elemental_create) (struct map_session_data **sd, int *class_, unsigned int *lifetime);
+typedef int (*HPMHOOK_post_elemental_create) (int retVal___, struct map_session_data *sd, int class_, unsigned int lifetime);
+typedef int (*HPMHOOK_pre_elemental_data_received) (const struct s_elemental **ele, bool *flag);
+typedef int (*HPMHOOK_post_elemental_data_received) (int retVal___, const struct s_elemental *ele, bool flag);
+typedef int (*HPMHOOK_pre_elemental_save) (struct elemental_data **ed);
+typedef int (*HPMHOOK_post_elemental_save) (int retVal___, struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_change_mode_ack) (struct elemental_data **ed, int *mode);
+typedef int (*HPMHOOK_post_elemental_change_mode_ack) (int retVal___, struct elemental_data *ed, int mode);
+typedef int (*HPMHOOK_pre_elemental_change_mode) (struct elemental_data **ed, uint32 *mode);
+typedef int (*HPMHOOK_post_elemental_change_mode) (int retVal___, struct elemental_data *ed, uint32 mode);
+typedef void (*HPMHOOK_pre_elemental_heal) (struct elemental_data **ed, int *hp, int *sp);
+typedef void (*HPMHOOK_post_elemental_heal) (struct elemental_data *ed, int hp, int sp);
+typedef int (*HPMHOOK_pre_elemental_dead) (struct elemental_data **ed);
+typedef int (*HPMHOOK_post_elemental_dead) (int retVal___, struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_delete) (struct elemental_data **ed, int *reply);
+typedef int (*HPMHOOK_post_elemental_delete) (int retVal___, struct elemental_data *ed, int reply);
+typedef void (*HPMHOOK_pre_elemental_summon_stop) (struct elemental_data **ed);
+typedef void (*HPMHOOK_post_elemental_summon_stop) (struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_get_lifetime) (struct elemental_data **ed);
+typedef int (*HPMHOOK_post_elemental_get_lifetime) (int retVal___, struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_unlocktarget) (struct elemental_data **ed);
+typedef int (*HPMHOOK_post_elemental_unlocktarget) (int retVal___, struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_skillnotok) (uint16 *skill_id, struct elemental_data **ed);
+typedef int (*HPMHOOK_post_elemental_skillnotok) (int retVal___, uint16 skill_id, struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_set_target) (struct map_session_data **sd, struct block_list **bl);
+typedef int (*HPMHOOK_post_elemental_set_target) (int retVal___, struct map_session_data *sd, struct block_list *bl);
+typedef int (*HPMHOOK_pre_elemental_clean_single_effect) (struct elemental_data **ed, uint16 *skill_id);
+typedef int (*HPMHOOK_post_elemental_clean_single_effect) (int retVal___, struct elemental_data *ed, uint16 skill_id);
+typedef int (*HPMHOOK_pre_elemental_clean_effect) (struct elemental_data **ed);
+typedef int (*HPMHOOK_post_elemental_clean_effect) (int retVal___, struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_action) (struct elemental_data **ed, struct block_list **bl, int64 *tick);
+typedef int (*HPMHOOK_post_elemental_action) (int retVal___, struct elemental_data *ed, struct block_list *bl, int64 tick);
+typedef struct skill_condition (*HPMHOOK_pre_elemental_skill_get_requirements) (uint16 *skill_id, uint16 *skill_lv);
+typedef struct skill_condition (*HPMHOOK_post_elemental_skill_get_requirements) (struct skill_condition retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_elemental_read_skilldb) (void);
+typedef int (*HPMHOOK_post_elemental_read_skilldb) (int retVal___);
+typedef void (*HPMHOOK_pre_elemental_reload_db) (void);
+typedef void (*HPMHOOK_post_elemental_reload_db) (void);
+typedef void (*HPMHOOK_pre_elemental_reload_skilldb) (void);
+typedef void (*HPMHOOK_post_elemental_reload_skilldb) (void);
+typedef int (*HPMHOOK_pre_elemental_search_index) (int *class_);
+typedef int (*HPMHOOK_post_elemental_search_index) (int retVal___, int class_);
+typedef void (*HPMHOOK_pre_elemental_summon_init) (struct elemental_data **ed);
+typedef void (*HPMHOOK_post_elemental_summon_init) (struct elemental_data *ed);
+typedef int (*HPMHOOK_pre_elemental_summon_end_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_elemental_summon_end_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_elemental_ai_sub_timer_activesearch) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_elemental_ai_sub_timer_activesearch) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_elemental_ai_sub_timer) (struct elemental_data **ed, struct map_session_data **sd, int64 *tick);
+typedef int (*HPMHOOK_post_elemental_ai_sub_timer) (int retVal___, struct elemental_data *ed, struct map_session_data *sd, int64 tick);
+typedef int (*HPMHOOK_pre_elemental_ai_sub_foreachclient) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_elemental_ai_sub_foreachclient) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef int (*HPMHOOK_pre_elemental_ai_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_elemental_ai_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_elemental_read_db) (void);
+typedef int (*HPMHOOK_post_elemental_read_db) (int retVal___);
+#endif // MAP_ELEMENTAL_H
+#ifdef CHAR_GEOIP_H /* geoip */
+typedef const char* (*HPMHOOK_pre_geoip_getcountry) (uint32 *ipnum);
+typedef const char* (*HPMHOOK_post_geoip_getcountry) (const char* retVal___, uint32 ipnum);
+typedef void (*HPMHOOK_pre_geoip_final) (bool *shutdown);
+typedef void (*HPMHOOK_post_geoip_final) (bool shutdown);
+typedef void (*HPMHOOK_pre_geoip_init) (void);
+typedef void (*HPMHOOK_post_geoip_init) (void);
+#endif // CHAR_GEOIP_H
+#ifdef COMMON_GRFIO_H /* grfio */
+typedef void (*HPMHOOK_pre_grfio_init) (const char **fname);
+typedef void (*HPMHOOK_post_grfio_init) (const char *fname);
+typedef void (*HPMHOOK_pre_grfio_final) (void);
+typedef void (*HPMHOOK_post_grfio_final) (void);
+typedef void* (*HPMHOOK_pre_grfio_reads) (const char **fname, int **size);
+typedef void* (*HPMHOOK_post_grfio_reads) (void* retVal___, const char *fname, int *size);
+typedef const char* (*HPMHOOK_pre_grfio_find_file) (const char **fname);
+typedef const char* (*HPMHOOK_post_grfio_find_file) (const char* retVal___, const char *fname);
+typedef unsigned long (*HPMHOOK_pre_grfio_crc32) (const unsigned char **buf, unsigned int *len);
+typedef unsigned long (*HPMHOOK_post_grfio_crc32) (unsigned long retVal___, const unsigned char *buf, unsigned int len);
+typedef int (*HPMHOOK_pre_grfio_decode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len);
+typedef int (*HPMHOOK_post_grfio_decode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len);
+typedef int (*HPMHOOK_pre_grfio_encode_zip) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len);
+typedef int (*HPMHOOK_post_grfio_encode_zip) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len);
+#endif // COMMON_GRFIO_H
+#ifdef MAP_GUILD_H /* guild */
+typedef void (*HPMHOOK_pre_guild_init) (bool *minimal);
+typedef void (*HPMHOOK_post_guild_init) (bool minimal);
+typedef void (*HPMHOOK_pre_guild_final) (void);
+typedef void (*HPMHOOK_post_guild_final) (void);
+typedef int (*HPMHOOK_pre_guild_skill_get_max) (int *id);
+typedef int (*HPMHOOK_post_guild_skill_get_max) (int retVal___, int id);
+typedef int (*HPMHOOK_pre_guild_checkskill) (struct guild **g, int *id);
+typedef int (*HPMHOOK_post_guild_checkskill) (int retVal___, struct guild *g, int id);
+typedef int (*HPMHOOK_pre_guild_check_skill_require) (struct guild **g, int *id);
+typedef int (*HPMHOOK_post_guild_check_skill_require) (int retVal___, struct guild *g, int id);
+typedef int (*HPMHOOK_pre_guild_checkcastles) (struct guild **g);
+typedef int (*HPMHOOK_post_guild_checkcastles) (int retVal___, struct guild *g);
+typedef bool (*HPMHOOK_pre_guild_isallied) (int *guild_id, int *guild_id2);
+typedef bool (*HPMHOOK_post_guild_isallied) (bool retVal___, int guild_id, int guild_id2);
+typedef struct guild* (*HPMHOOK_pre_guild_search) (int *guild_id);
+typedef struct guild* (*HPMHOOK_post_guild_search) (struct guild* retVal___, int guild_id);
+typedef struct guild* (*HPMHOOK_pre_guild_searchname) (char **str);
+typedef struct guild* (*HPMHOOK_post_guild_searchname) (struct guild* retVal___, char *str);
+typedef struct guild_castle* (*HPMHOOK_pre_guild_castle_search) (int *gcid);
+typedef struct guild_castle* (*HPMHOOK_post_guild_castle_search) (struct guild_castle* retVal___, int gcid);
+typedef struct guild_castle* (*HPMHOOK_pre_guild_mapname2gc) (const char **mapname);
+typedef struct guild_castle* (*HPMHOOK_post_guild_mapname2gc) (struct guild_castle* retVal___, const char *mapname);
+typedef struct guild_castle* (*HPMHOOK_pre_guild_mapindex2gc) (short *map_index);
+typedef struct guild_castle* (*HPMHOOK_post_guild_mapindex2gc) (struct guild_castle* retVal___, short map_index);
+typedef struct map_session_data* (*HPMHOOK_pre_guild_getavailablesd) (struct guild **g);
+typedef struct map_session_data* (*HPMHOOK_post_guild_getavailablesd) (struct map_session_data* retVal___, struct guild *g);
+typedef int (*HPMHOOK_pre_guild_getindex) (const struct guild **g, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_guild_getindex) (int retVal___, const struct guild *g, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_guild_getposition) (struct guild **g, struct map_session_data **sd);
+typedef int (*HPMHOOK_post_guild_getposition) (int retVal___, struct guild *g, struct map_session_data *sd);
+typedef unsigned int (*HPMHOOK_pre_guild_payexp) (struct map_session_data **sd, unsigned int *exp);
+typedef unsigned int (*HPMHOOK_post_guild_payexp) (unsigned int retVal___, struct map_session_data *sd, unsigned int exp);
+typedef int (*HPMHOOK_pre_guild_getexp) (struct map_session_data **sd, int *exp);
+typedef int (*HPMHOOK_post_guild_getexp) (int retVal___, struct map_session_data *sd, int exp);
+typedef int (*HPMHOOK_pre_guild_create) (struct map_session_data **sd, const char **name);
+typedef int (*HPMHOOK_post_guild_create) (int retVal___, struct map_session_data *sd, const char *name);
+typedef int (*HPMHOOK_pre_guild_created) (int *account_id, int *guild_id);
+typedef int (*HPMHOOK_post_guild_created) (int retVal___, int account_id, int guild_id);
+typedef int (*HPMHOOK_pre_guild_request_info) (int *guild_id);
+typedef int (*HPMHOOK_post_guild_request_info) (int retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_guild_recv_noinfo) (int *guild_id);
+typedef int (*HPMHOOK_post_guild_recv_noinfo) (int retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_guild_recv_info) (const struct guild **sg);
+typedef int (*HPMHOOK_post_guild_recv_info) (int retVal___, const struct guild *sg);
+typedef int (*HPMHOOK_pre_guild_npc_request_info) (int *guild_id, const char **ev);
+typedef int (*HPMHOOK_post_guild_npc_request_info) (int retVal___, int guild_id, const char *ev);
+typedef int (*HPMHOOK_pre_guild_invite) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_guild_invite) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
+typedef int (*HPMHOOK_pre_guild_reply_invite) (struct map_session_data **sd, int *guild_id, int *flag);
+typedef int (*HPMHOOK_post_guild_reply_invite) (int retVal___, struct map_session_data *sd, int guild_id, int flag);
+typedef void (*HPMHOOK_pre_guild_member_joined) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_guild_member_joined) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_guild_member_added) (int *guild_id, int *account_id, int *char_id, int *flag);
+typedef int (*HPMHOOK_post_guild_member_added) (int retVal___, int guild_id, int account_id, int char_id, int flag);
+typedef int (*HPMHOOK_pre_guild_leave) (struct map_session_data **sd, int *guild_id, int *account_id, int *char_id, const char **mes);
+typedef int (*HPMHOOK_post_guild_leave) (int retVal___, struct map_session_data *sd, int guild_id, int account_id, int char_id, const char *mes);
+typedef int (*HPMHOOK_pre_guild_member_withdraw) (int *guild_id, int *account_id, int *char_id, int *flag, const char **name, const char **mes);
+typedef int (*HPMHOOK_post_guild_member_withdraw) (int retVal___, int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
+typedef int (*HPMHOOK_pre_guild_expulsion) (struct map_session_data **sd, int *guild_id, int *account_id, int *char_id, const char **mes);
+typedef int (*HPMHOOK_post_guild_expulsion) (int retVal___, struct map_session_data *sd, int guild_id, int account_id, int char_id, const char *mes);
+typedef int (*HPMHOOK_pre_guild_skillup) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_guild_skillup) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef void (*HPMHOOK_pre_guild_block_skill) (struct map_session_data **sd, int *time);
+typedef void (*HPMHOOK_post_guild_block_skill) (struct map_session_data *sd, int time);
+typedef int (*HPMHOOK_pre_guild_reqalliance) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_guild_reqalliance) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
+typedef int (*HPMHOOK_pre_guild_reply_reqalliance) (struct map_session_data **sd, int *account_id, int *flag);
+typedef int (*HPMHOOK_post_guild_reply_reqalliance) (int retVal___, struct map_session_data *sd, int account_id, int flag);
+typedef int (*HPMHOOK_pre_guild_allianceack) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char **name1, const char **name2);
+typedef int (*HPMHOOK_post_guild_allianceack) (int retVal___, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2);
+typedef int (*HPMHOOK_pre_guild_delalliance) (struct map_session_data **sd, int *guild_id, int *flag);
+typedef int (*HPMHOOK_post_guild_delalliance) (int retVal___, struct map_session_data *sd, int guild_id, int flag);
+typedef int (*HPMHOOK_pre_guild_opposition) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_guild_opposition) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
+typedef int (*HPMHOOK_pre_guild_check_alliance) (int *guild_id1, int *guild_id2, int *flag);
+typedef int (*HPMHOOK_post_guild_check_alliance) (int retVal___, int guild_id1, int guild_id2, int flag);
+typedef int (*HPMHOOK_pre_guild_send_memberinfoshort) (struct map_session_data **sd, int *online);
+typedef int (*HPMHOOK_post_guild_send_memberinfoshort) (int retVal___, struct map_session_data *sd, int online);
+typedef int (*HPMHOOK_pre_guild_recv_memberinfoshort) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
+typedef int (*HPMHOOK_post_guild_recv_memberinfoshort) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+typedef int (*HPMHOOK_pre_guild_change_memberposition) (int *guild_id, int *account_id, int *char_id, short *idx);
+typedef int (*HPMHOOK_post_guild_change_memberposition) (int retVal___, int guild_id, int account_id, int char_id, short idx);
+typedef int (*HPMHOOK_pre_guild_memberposition_changed) (struct guild **g, int *idx, int *pos);
+typedef int (*HPMHOOK_post_guild_memberposition_changed) (int retVal___, struct guild *g, int idx, int pos);
+typedef int (*HPMHOOK_pre_guild_change_position) (int *guild_id, int *idx, int *mode, int *exp_mode, const char **name);
+typedef int (*HPMHOOK_post_guild_change_position) (int retVal___, int guild_id, int idx, int mode, int exp_mode, const char *name);
+typedef int (*HPMHOOK_pre_guild_position_changed) (int *guild_id, int *idx, const struct guild_position **p);
+typedef int (*HPMHOOK_post_guild_position_changed) (int retVal___, int guild_id, int idx, const struct guild_position *p);
+typedef int (*HPMHOOK_pre_guild_change_notice) (struct map_session_data **sd, int *guild_id, const char **mes1, const char **mes2);
+typedef int (*HPMHOOK_post_guild_change_notice) (int retVal___, struct map_session_data *sd, int guild_id, const char *mes1, const char *mes2);
+typedef int (*HPMHOOK_pre_guild_notice_changed) (int *guild_id, const char **mes1, const char **mes2);
+typedef int (*HPMHOOK_post_guild_notice_changed) (int retVal___, int guild_id, const char *mes1, const char *mes2);
+typedef int (*HPMHOOK_pre_guild_change_emblem) (struct map_session_data **sd, int *len, const char **data);
+typedef int (*HPMHOOK_post_guild_change_emblem) (int retVal___, struct map_session_data *sd, int len, const char *data);
+typedef int (*HPMHOOK_pre_guild_emblem_changed) (int *len, int *guild_id, int *emblem_id, const char **data);
+typedef int (*HPMHOOK_post_guild_emblem_changed) (int retVal___, int len, int guild_id, int emblem_id, const char *data);
+typedef int (*HPMHOOK_pre_guild_send_message) (struct map_session_data **sd, const char **mes);
+typedef int (*HPMHOOK_post_guild_send_message) (int retVal___, struct map_session_data *sd, const char *mes);
+typedef int (*HPMHOOK_pre_guild_recv_message) (int *guild_id, int *account_id, const char **mes, int *len);
+typedef int (*HPMHOOK_post_guild_recv_message) (int retVal___, int guild_id, int account_id, const char *mes, int len);
+typedef int (*HPMHOOK_pre_guild_send_dot_remove) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_guild_send_dot_remove) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_guild_skillupack) (int *guild_id, uint16 *skill_id, int *account_id);
+typedef int (*HPMHOOK_post_guild_skillupack) (int retVal___, int guild_id, uint16 skill_id, int account_id);
+typedef int (*HPMHOOK_pre_guild_dobreak) (struct map_session_data **sd, const char **name);
+typedef int (*HPMHOOK_post_guild_dobreak) (int retVal___, struct map_session_data *sd, const char *name);
+typedef int (*HPMHOOK_pre_guild_broken) (int *guild_id, int *flag);
+typedef int (*HPMHOOK_post_guild_broken) (int retVal___, int guild_id, int flag);
+typedef int (*HPMHOOK_pre_guild_gm_change) (int *guild_id, struct map_session_data **sd);
+typedef int (*HPMHOOK_post_guild_gm_change) (int retVal___, int guild_id, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_guild_gm_changed) (int *guild_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_guild_gm_changed) (int retVal___, int guild_id, int account_id, int char_id);
+typedef void (*HPMHOOK_pre_guild_castle_map_init) (void);
+typedef void (*HPMHOOK_post_guild_castle_map_init) (void);
+typedef int (*HPMHOOK_pre_guild_castledatasave) (int *castle_id, int *index, int *value);
+typedef int (*HPMHOOK_post_guild_castledatasave) (int retVal___, int castle_id, int index, int value);
+typedef int (*HPMHOOK_pre_guild_castledataloadack) (int *len, const struct guild_castle **gc);
+typedef int (*HPMHOOK_post_guild_castledataloadack) (int retVal___, int len, const struct guild_castle *gc);
+typedef void (*HPMHOOK_pre_guild_castle_reconnect) (int *castle_id, int *index, int *value);
+typedef void (*HPMHOOK_post_guild_castle_reconnect) (int castle_id, int index, int value);
+typedef void (*HPMHOOK_pre_guild_agit_start) (void);
+typedef void (*HPMHOOK_post_guild_agit_start) (void);
+typedef void (*HPMHOOK_pre_guild_agit_end) (void);
+typedef void (*HPMHOOK_post_guild_agit_end) (void);
+typedef void (*HPMHOOK_pre_guild_agit2_start) (void);
+typedef void (*HPMHOOK_post_guild_agit2_start) (void);
+typedef void (*HPMHOOK_pre_guild_agit2_end) (void);
+typedef void (*HPMHOOK_post_guild_agit2_end) (void);
+typedef void (*HPMHOOK_pre_guild_flag_add) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_guild_flag_add) (struct npc_data *nd);
+typedef void (*HPMHOOK_pre_guild_flag_remove) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_guild_flag_remove) (struct npc_data *nd);
+typedef void (*HPMHOOK_pre_guild_flags_clear) (void);
+typedef void (*HPMHOOK_post_guild_flags_clear) (void);
+typedef void (*HPMHOOK_pre_guild_aura_refresh) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef void (*HPMHOOK_post_guild_aura_refresh) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_guild_retrieveitembound) (int *char_id, int *aid, int *guild_id);
+typedef void (*HPMHOOK_post_guild_retrieveitembound) (int char_id, int aid, int guild_id);
+typedef int (*HPMHOOK_pre_guild_payexp_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_guild_payexp_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef struct map_session_data* (*HPMHOOK_pre_guild_sd_check) (int *guild_id, int *account_id, int *char_id);
+typedef struct map_session_data* (*HPMHOOK_post_guild_sd_check) (struct map_session_data* retVal___, int guild_id, int account_id, int char_id);
+typedef bool (*HPMHOOK_pre_guild_read_guildskill_tree_db) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_guild_read_guildskill_tree_db) (bool retVal___, char *split[], int columns, int current);
+typedef bool (*HPMHOOK_pre_guild_read_castledb) (char **str[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_guild_read_castledb) (bool retVal___, char *str[], int columns, int current);
+typedef int (*HPMHOOK_pre_guild_payexp_timer_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_payexp_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_guild_send_xy_timer_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_send_xy_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_guild_send_xy_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_guild_send_xy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef struct DBData (*HPMHOOK_pre_guild_create_expcache) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_guild_create_expcache) (struct DBData retVal___, union DBKey key, va_list args);
+typedef int (*HPMHOOK_pre_guild_eventlist_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_eventlist_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_guild_expcache_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_expcache_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_guild_castle_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_castle_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_guild_broken_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_broken_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_guild_castle_broken_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_guild_castle_broken_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_guild_makemember) (struct guild_member **m, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_guild_makemember) (struct guild_member *m, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_guild_check_member) (const struct guild **g);
+typedef int (*HPMHOOK_post_guild_check_member) (int retVal___, const struct guild *g);
+typedef int (*HPMHOOK_pre_guild_get_alliance_count) (struct guild **g, int *flag);
+typedef int (*HPMHOOK_post_guild_get_alliance_count) (int retVal___, struct guild *g, int flag);
+typedef void (*HPMHOOK_pre_guild_castle_reconnect_sub) (void **key, void **data, va_list ap);
+typedef void (*HPMHOOK_post_guild_castle_reconnect_sub) (void *key, void *data, va_list ap);
+#endif // MAP_GUILD_H
+#ifdef MAP_STORAGE_H /* gstorage */
+typedef struct guild_storage* (*HPMHOOK_pre_gstorage_ensure) (int *guild_id);
+typedef struct guild_storage* (*HPMHOOK_post_gstorage_ensure) (struct guild_storage* retVal___, int guild_id);
+typedef void (*HPMHOOK_pre_gstorage_init) (bool *minimal);
+typedef void (*HPMHOOK_post_gstorage_init) (bool minimal);
+typedef void (*HPMHOOK_pre_gstorage_final) (void);
+typedef void (*HPMHOOK_post_gstorage_final) (void);
+typedef int (*HPMHOOK_pre_gstorage_delete) (int *guild_id);
+typedef int (*HPMHOOK_post_gstorage_delete) (int retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_gstorage_open) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_gstorage_open) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_gstorage_additem) (struct map_session_data **sd, struct guild_storage **stor, struct item **item_data, int *amount);
+typedef int (*HPMHOOK_post_gstorage_additem) (int retVal___, struct map_session_data *sd, struct guild_storage *stor, struct item *item_data, int amount);
+typedef int (*HPMHOOK_pre_gstorage_delitem) (struct map_session_data **sd, struct guild_storage **stor, int *n, int *amount);
+typedef int (*HPMHOOK_post_gstorage_delitem) (int retVal___, struct map_session_data *sd, struct guild_storage *stor, int n, int amount);
+typedef int (*HPMHOOK_pre_gstorage_add) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_gstorage_add) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_gstorage_get) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_gstorage_get) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_gstorage_addfromcart) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_gstorage_addfromcart) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_gstorage_gettocart) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_gstorage_gettocart) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_gstorage_close) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_gstorage_close) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_gstorage_pc_quit) (struct map_session_data **sd, int *flag);
+typedef int (*HPMHOOK_post_gstorage_pc_quit) (int retVal___, struct map_session_data *sd, int flag);
+typedef int (*HPMHOOK_pre_gstorage_save) (int *account_id, int *guild_id, int *flag);
+typedef int (*HPMHOOK_post_gstorage_save) (int retVal___, int account_id, int guild_id, int flag);
+typedef int (*HPMHOOK_pre_gstorage_saved) (int *guild_id);
+typedef int (*HPMHOOK_post_gstorage_saved) (int retVal___, int guild_id);
+typedef struct DBData (*HPMHOOK_pre_gstorage_create) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_gstorage_create) (struct DBData retVal___, union DBKey key, va_list args);
+#endif // MAP_STORAGE_H
+#ifdef MAP_HOMUNCULUS_H /* homun */
+typedef void (*HPMHOOK_pre_homun_init) (bool *minimal);
+typedef void (*HPMHOOK_post_homun_init) (bool minimal);
+typedef void (*HPMHOOK_pre_homun_final) (void);
+typedef void (*HPMHOOK_post_homun_final) (void);
+typedef void (*HPMHOOK_pre_homun_reload) (void);
+typedef void (*HPMHOOK_post_homun_reload) (void);
+typedef void (*HPMHOOK_pre_homun_reload_skill) (void);
+typedef void (*HPMHOOK_post_homun_reload_skill) (void);
+typedef struct view_data* (*HPMHOOK_pre_homun_get_viewdata) (int *class_);
+typedef struct view_data* (*HPMHOOK_post_homun_get_viewdata) (struct view_data* retVal___, int class_);
+typedef enum homun_type (*HPMHOOK_pre_homun_class2type) (int *class_);
+typedef enum homun_type (*HPMHOOK_post_homun_class2type) (enum homun_type retVal___, int class_);
+typedef void (*HPMHOOK_pre_homun_damaged) (struct homun_data **hd);
+typedef void (*HPMHOOK_post_homun_damaged) (struct homun_data *hd);
+typedef int (*HPMHOOK_pre_homun_dead) (struct homun_data **hd);
+typedef int (*HPMHOOK_post_homun_dead) (int retVal___, struct homun_data *hd);
+typedef int (*HPMHOOK_pre_homun_vaporize) (struct map_session_data **sd, enum homun_state *flag);
+typedef int (*HPMHOOK_post_homun_vaporize) (int retVal___, struct map_session_data *sd, enum homun_state flag);
+typedef int (*HPMHOOK_pre_homun_delete) (struct homun_data **hd, int *emote);
+typedef int (*HPMHOOK_post_homun_delete) (int retVal___, struct homun_data *hd, int emote);
+typedef int (*HPMHOOK_pre_homun_checkskill) (struct homun_data **hd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_homun_checkskill) (int retVal___, struct homun_data *hd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_homun_calc_skilltree) (struct homun_data **hd, int *flag_evolve);
+typedef int (*HPMHOOK_post_homun_calc_skilltree) (int retVal___, struct homun_data *hd, int flag_evolve);
+typedef int (*HPMHOOK_pre_homun_skill_tree_get_max) (int *id, int *b_class);
+typedef int (*HPMHOOK_post_homun_skill_tree_get_max) (int retVal___, int id, int b_class);
+typedef void (*HPMHOOK_pre_homun_skillup) (struct homun_data **hd, uint16 *skill_id);
+typedef void (*HPMHOOK_post_homun_skillup) (struct homun_data *hd, uint16 skill_id);
+typedef bool (*HPMHOOK_pre_homun_levelup) (struct homun_data **hd);
+typedef bool (*HPMHOOK_post_homun_levelup) (bool retVal___, struct homun_data *hd);
+typedef int (*HPMHOOK_pre_homun_change_class) (struct homun_data **hd, short *class_);
+typedef int (*HPMHOOK_post_homun_change_class) (int retVal___, struct homun_data *hd, short class_);
+typedef bool (*HPMHOOK_pre_homun_evolve) (struct homun_data **hd);
+typedef bool (*HPMHOOK_post_homun_evolve) (bool retVal___, struct homun_data *hd);
+typedef bool (*HPMHOOK_pre_homun_mutate) (struct homun_data **hd, int *homun_id);
+typedef bool (*HPMHOOK_post_homun_mutate) (bool retVal___, struct homun_data *hd, int homun_id);
+typedef int (*HPMHOOK_pre_homun_gainexp) (struct homun_data **hd, unsigned int *exp);
+typedef int (*HPMHOOK_post_homun_gainexp) (int retVal___, struct homun_data *hd, unsigned int exp);
+typedef unsigned int (*HPMHOOK_pre_homun_add_intimacy) (struct homun_data **hd, unsigned int *value);
+typedef unsigned int (*HPMHOOK_post_homun_add_intimacy) (unsigned int retVal___, struct homun_data *hd, unsigned int value);
+typedef unsigned int (*HPMHOOK_pre_homun_consume_intimacy) (struct homun_data **hd, unsigned int *value);
+typedef unsigned int (*HPMHOOK_post_homun_consume_intimacy) (unsigned int retVal___, struct homun_data *hd, unsigned int value);
+typedef void (*HPMHOOK_pre_homun_healed) (struct homun_data **hd);
+typedef void (*HPMHOOK_post_homun_healed) (struct homun_data *hd);
+typedef void (*HPMHOOK_pre_homun_save) (struct homun_data **hd);
+typedef void (*HPMHOOK_post_homun_save) (struct homun_data *hd);
+typedef unsigned char (*HPMHOOK_pre_homun_menu) (struct map_session_data **sd, unsigned char *menu_num);
+typedef unsigned char (*HPMHOOK_post_homun_menu) (unsigned char retVal___, struct map_session_data *sd, unsigned char menu_num);
+typedef bool (*HPMHOOK_pre_homun_feed) (struct map_session_data **sd, struct homun_data **hd);
+typedef bool (*HPMHOOK_post_homun_feed) (bool retVal___, struct map_session_data *sd, struct homun_data *hd);
+typedef int (*HPMHOOK_pre_homun_hunger_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_homun_hunger_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_homun_hunger_timer_delete) (struct homun_data **hd);
+typedef void (*HPMHOOK_post_homun_hunger_timer_delete) (struct homun_data *hd);
+typedef int (*HPMHOOK_pre_homun_change_name) (struct map_session_data **sd, const char **name);
+typedef int (*HPMHOOK_post_homun_change_name) (int retVal___, struct map_session_data *sd, const char *name);
+typedef bool (*HPMHOOK_pre_homun_change_name_ack) (struct map_session_data **sd, const char **name, int *flag);
+typedef bool (*HPMHOOK_post_homun_change_name_ack) (bool retVal___, struct map_session_data *sd, const char *name, int flag);
+typedef int (*HPMHOOK_pre_homun_db_search) (int *key, int *type);
+typedef int (*HPMHOOK_post_homun_db_search) (int retVal___, int key, int type);
+typedef bool (*HPMHOOK_pre_homun_create) (struct map_session_data **sd, const struct s_homunculus **hom);
+typedef bool (*HPMHOOK_post_homun_create) (bool retVal___, struct map_session_data *sd, const struct s_homunculus *hom);
+typedef void (*HPMHOOK_pre_homun_init_timers) (struct homun_data **hd);
+typedef void (*HPMHOOK_post_homun_init_timers) (struct homun_data *hd);
+typedef bool (*HPMHOOK_pre_homun_call) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_homun_call) (bool retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_homun_recv_data) (int *account_id, const struct s_homunculus **sh, int *flag);
+typedef bool (*HPMHOOK_post_homun_recv_data) (bool retVal___, int account_id, const struct s_homunculus *sh, int flag);
+typedef bool (*HPMHOOK_pre_homun_creation_request) (struct map_session_data **sd, int *class_);
+typedef bool (*HPMHOOK_post_homun_creation_request) (bool retVal___, struct map_session_data *sd, int class_);
+typedef bool (*HPMHOOK_pre_homun_ressurect) (struct map_session_data **sd, unsigned char *per, short *x, short *y);
+typedef bool (*HPMHOOK_post_homun_ressurect) (bool retVal___, struct map_session_data *sd, unsigned char per, short x, short y);
+typedef void (*HPMHOOK_pre_homun_revive) (struct homun_data **hd, unsigned int *hp, unsigned int *sp);
+typedef void (*HPMHOOK_post_homun_revive) (struct homun_data *hd, unsigned int hp, unsigned int sp);
+typedef void (*HPMHOOK_pre_homun_stat_reset) (struct homun_data **hd);
+typedef void (*HPMHOOK_post_homun_stat_reset) (struct homun_data *hd);
+typedef bool (*HPMHOOK_pre_homun_shuffle) (struct homun_data **hd);
+typedef bool (*HPMHOOK_post_homun_shuffle) (bool retVal___, struct homun_data *hd);
+typedef bool (*HPMHOOK_pre_homun_read_db_sub) (char **str[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_homun_read_db_sub) (bool retVal___, char *str[], int columns, int current);
+typedef void (*HPMHOOK_pre_homun_read_db) (void);
+typedef void (*HPMHOOK_post_homun_read_db) (void);
+typedef bool (*HPMHOOK_pre_homun_read_skill_db_sub) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_homun_read_skill_db_sub) (bool retVal___, char *split[], int columns, int current);
+typedef void (*HPMHOOK_pre_homun_skill_db_read) (void);
+typedef void (*HPMHOOK_post_homun_skill_db_read) (void);
+typedef void (*HPMHOOK_pre_homun_exp_db_read) (void);
+typedef void (*HPMHOOK_post_homun_exp_db_read) (void);
+typedef void (*HPMHOOK_pre_homun_addspiritball) (struct homun_data **hd, int *max);
+typedef void (*HPMHOOK_post_homun_addspiritball) (struct homun_data *hd, int max);
+typedef void (*HPMHOOK_pre_homun_delspiritball) (struct homun_data **hd, int *count, int *type);
+typedef void (*HPMHOOK_post_homun_delspiritball) (struct homun_data *hd, int count, int type);
+typedef int8 (*HPMHOOK_pre_homun_get_intimacy_grade) (struct homun_data **hd);
+typedef int8 (*HPMHOOK_post_homun_get_intimacy_grade) (int8 retVal___, struct homun_data *hd);
+#endif // MAP_HOMUNCULUS_H
+#ifdef MAP_INSTANCE_H /* instance */
+typedef void (*HPMHOOK_pre_instance_init) (bool *minimal);
+typedef void (*HPMHOOK_post_instance_init) (bool minimal);
+typedef void (*HPMHOOK_pre_instance_final) (void);
+typedef void (*HPMHOOK_post_instance_final) (void);
+typedef void (*HPMHOOK_pre_instance_reload) (void);
+typedef void (*HPMHOOK_post_instance_reload) (void);
+typedef int (*HPMHOOK_pre_instance_create) (int *party_id, const char **name, enum instance_owner_type *type);
+typedef int (*HPMHOOK_post_instance_create) (int retVal___, int party_id, const char *name, enum instance_owner_type type);
+typedef int (*HPMHOOK_pre_instance_add_map) (const char **name, int *instance_id, bool *usebasename, const char **map_name);
+typedef int (*HPMHOOK_post_instance_add_map) (int retVal___, const char *name, int instance_id, bool usebasename, const char *map_name);
+typedef void (*HPMHOOK_pre_instance_del_map) (int16 *m);
+typedef void (*HPMHOOK_post_instance_del_map) (int16 m);
+typedef int (*HPMHOOK_pre_instance_map2imap) (int16 *m, int *instance_id);
+typedef int (*HPMHOOK_post_instance_map2imap) (int retVal___, int16 m, int instance_id);
+typedef int (*HPMHOOK_pre_instance_mapid2imapid) (int16 *m, int *instance_id);
+typedef int (*HPMHOOK_post_instance_mapid2imapid) (int retVal___, int16 m, int instance_id);
+typedef int (*HPMHOOK_pre_instance_mapname2imap) (const char **map_name, int *instance_id);
+typedef int (*HPMHOOK_post_instance_mapname2imap) (int retVal___, const char *map_name, int instance_id);
+typedef int (*HPMHOOK_pre_instance_map_npcsub) (struct block_list **bl, va_list args);
+typedef int (*HPMHOOK_post_instance_map_npcsub) (int retVal___, struct block_list *bl, va_list args);
+typedef int (*HPMHOOK_pre_instance_init_npc) (struct block_list **bl, va_list args);
+typedef int (*HPMHOOK_post_instance_init_npc) (int retVal___, struct block_list *bl, va_list args);
+typedef void (*HPMHOOK_pre_instance_destroy) (int *instance_id);
+typedef void (*HPMHOOK_post_instance_destroy) (int instance_id);
+typedef void (*HPMHOOK_pre_instance_start) (int *instance_id);
+typedef void (*HPMHOOK_post_instance_start) (int instance_id);
+typedef void (*HPMHOOK_pre_instance_check_idle) (int *instance_id);
+typedef void (*HPMHOOK_post_instance_check_idle) (int instance_id);
+typedef void (*HPMHOOK_pre_instance_check_kick) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_instance_check_kick) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_instance_set_timeout) (int *instance_id, unsigned int *progress_timeout, unsigned int *idle_timeout);
+typedef void (*HPMHOOK_post_instance_set_timeout) (int instance_id, unsigned int progress_timeout, unsigned int idle_timeout);
+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);
+#endif // MAP_INSTANCE_H
+#ifdef CHAR_INT_AUCTION_H /* inter_auction */
+typedef int (*HPMHOOK_pre_inter_auction_count) (int *char_id, bool *buy);
+typedef int (*HPMHOOK_post_inter_auction_count) (int retVal___, int char_id, bool buy);
+typedef void (*HPMHOOK_pre_inter_auction_save) (struct auction_data **auction);
+typedef void (*HPMHOOK_post_inter_auction_save) (struct auction_data *auction);
+typedef unsigned int (*HPMHOOK_pre_inter_auction_create) (struct auction_data **auction);
+typedef unsigned int (*HPMHOOK_post_inter_auction_create) (unsigned int retVal___, struct auction_data *auction);
+typedef int (*HPMHOOK_pre_inter_auction_end_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_inter_auction_end_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_inter_auction_delete_) (struct auction_data **auction);
+typedef void (*HPMHOOK_post_inter_auction_delete_) (struct auction_data *auction);
+typedef void (*HPMHOOK_pre_inter_auction_fromsql) (void);
+typedef void (*HPMHOOK_post_inter_auction_fromsql) (void);
+typedef int (*HPMHOOK_pre_inter_auction_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_auction_parse_frommap) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_inter_auction_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_auction_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_auction_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_auction_sql_final) (void);
+#endif // CHAR_INT_AUCTION_H
+#ifdef CHAR_INT_ELEMENTAL_H /* inter_elemental */
+typedef void (*HPMHOOK_pre_inter_elemental_sql_init) (void);
+typedef void (*HPMHOOK_post_inter_elemental_sql_init) (void);
+typedef void (*HPMHOOK_pre_inter_elemental_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_elemental_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_elemental_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_elemental_parse_frommap) (int retVal___, int fd);
+#endif // CHAR_INT_ELEMENTAL_H
+#ifdef CHAR_INT_GUILD_H /* inter_guild */
+typedef int (*HPMHOOK_pre_inter_guild_save_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_inter_guild_save_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_inter_guild_removemember_tosql) (int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_inter_guild_removemember_tosql) (int retVal___, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_inter_guild_tosql) (struct guild **g, int *flag);
+typedef int (*HPMHOOK_post_inter_guild_tosql) (int retVal___, struct guild *g, int flag);
+typedef struct guild* (*HPMHOOK_pre_inter_guild_fromsql) (int *guild_id);
+typedef struct guild* (*HPMHOOK_post_inter_guild_fromsql) (struct guild* retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_inter_guild_castle_tosql) (struct guild_castle **gc);
+typedef int (*HPMHOOK_post_inter_guild_castle_tosql) (int retVal___, struct guild_castle *gc);
+typedef struct guild_castle* (*HPMHOOK_pre_inter_guild_castle_fromsql) (int *castle_id);
+typedef struct guild_castle* (*HPMHOOK_post_inter_guild_castle_fromsql) (struct guild_castle* retVal___, int castle_id);
+typedef bool (*HPMHOOK_pre_inter_guild_exp_parse_row) (char **split[], int *column, int *current);
+typedef bool (*HPMHOOK_post_inter_guild_exp_parse_row) (bool retVal___, char *split[], int column, int current);
+typedef int (*HPMHOOK_pre_inter_guild_CharOnline) (int *char_id, int *guild_id);
+typedef int (*HPMHOOK_post_inter_guild_CharOnline) (int retVal___, int char_id, int guild_id);
+typedef int (*HPMHOOK_pre_inter_guild_CharOffline) (int *char_id, int *guild_id);
+typedef int (*HPMHOOK_post_inter_guild_CharOffline) (int retVal___, int char_id, int guild_id);
+typedef int (*HPMHOOK_pre_inter_guild_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_guild_sql_init) (int retVal___);
+typedef int (*HPMHOOK_pre_inter_guild_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_inter_guild_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_inter_guild_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_guild_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_guild_search_guildname) (const char **str);
+typedef int (*HPMHOOK_post_inter_guild_search_guildname) (int retVal___, const char *str);
+typedef bool (*HPMHOOK_pre_inter_guild_check_empty) (struct guild **g);
+typedef bool (*HPMHOOK_post_inter_guild_check_empty) (bool retVal___, struct guild *g);
+typedef unsigned int (*HPMHOOK_pre_inter_guild_nextexp) (int *level);
+typedef unsigned int (*HPMHOOK_post_inter_guild_nextexp) (unsigned int retVal___, int level);
+typedef int (*HPMHOOK_pre_inter_guild_checkskill) (struct guild **g, int *id);
+typedef int (*HPMHOOK_post_inter_guild_checkskill) (int retVal___, struct guild *g, int id);
+typedef int (*HPMHOOK_pre_inter_guild_calcinfo) (struct guild **g);
+typedef int (*HPMHOOK_post_inter_guild_calcinfo) (int retVal___, struct guild *g);
+typedef int (*HPMHOOK_pre_inter_guild_sex_changed) (int *guild_id, int *account_id, int *char_id, short *gender);
+typedef int (*HPMHOOK_post_inter_guild_sex_changed) (int retVal___, int guild_id, int account_id, int char_id, short gender);
+typedef int (*HPMHOOK_pre_inter_guild_charname_changed) (int *guild_id, int *account_id, int *char_id, char **name);
+typedef int (*HPMHOOK_post_inter_guild_charname_changed) (int retVal___, int guild_id, int account_id, int char_id, char *name);
+typedef int (*HPMHOOK_pre_inter_guild_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_guild_parse_frommap) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_inter_guild_leave) (int *guild_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_inter_guild_leave) (int retVal___, int guild_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_inter_guild_broken) (int *guild_id);
+typedef int (*HPMHOOK_post_inter_guild_broken) (int retVal___, int guild_id);
+#endif // CHAR_INT_GUILD_H
+#ifdef CHAR_INT_HOMUN_H /* inter_homunculus */
+typedef int (*HPMHOOK_pre_inter_homunculus_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_homunculus_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_homunculus_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_homunculus_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_homunculus_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_homunculus_parse_frommap) (int retVal___, int fd);
+#endif // CHAR_INT_HOMUN_H
+#ifdef CHAR_INTER_H /* inter */
+typedef const char* (*HPMHOOK_pre_inter_msg_txt) (int *msg_number);
+typedef const char* (*HPMHOOK_post_inter_msg_txt) (const char* retVal___, int msg_number);
+typedef bool (*HPMHOOK_pre_inter_msg_config_read) (const char **cfg_name, bool *allow_override);
+typedef bool (*HPMHOOK_post_inter_msg_config_read) (bool retVal___, const char *cfg_name, bool allow_override);
+typedef void (*HPMHOOK_pre_inter_do_final_msg) (void);
+typedef void (*HPMHOOK_post_inter_do_final_msg) (void);
+typedef const char* (*HPMHOOK_pre_inter_job_name) (int *class);
+typedef const char* (*HPMHOOK_post_inter_job_name) (const char* retVal___, int class);
+typedef void (*HPMHOOK_pre_inter_vmsg_to_fd) (int *fd, int *u_fd, int *aid, char **msg, va_list ap);
+typedef void (*HPMHOOK_post_inter_vmsg_to_fd) (int fd, int u_fd, int aid, char *msg, va_list ap);
+typedef void (*HPMHOOK_pre_inter_savereg) (int *account_id, int *char_id, const char **key, unsigned int *index, intptr_t *val, bool *is_string);
+typedef void (*HPMHOOK_post_inter_savereg) (int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string);
+typedef int (*HPMHOOK_pre_inter_accreg_fromsql) (int *account_id, int *char_id, int *fd, int *type);
+typedef int (*HPMHOOK_post_inter_accreg_fromsql) (int retVal___, int account_id, int char_id, int fd, int type);
+typedef int (*HPMHOOK_pre_inter_vlog) (char **fmt, va_list ap);
+typedef int (*HPMHOOK_post_inter_vlog) (int retVal___, char *fmt, va_list ap);
+typedef int (*HPMHOOK_pre_inter_init_sql) (const char **file);
+typedef int (*HPMHOOK_post_inter_init_sql) (int retVal___, const char *file);
+typedef int (*HPMHOOK_pre_inter_mapif_init) (int *fd);
+typedef int (*HPMHOOK_post_inter_mapif_init) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_inter_check_ttl_wisdata_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_inter_check_ttl_wisdata_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_inter_check_ttl_wisdata) (void);
+typedef int (*HPMHOOK_post_inter_check_ttl_wisdata) (int retVal___);
+typedef int (*HPMHOOK_pre_inter_check_length) (int *fd, int *length);
+typedef int (*HPMHOOK_post_inter_check_length) (int retVal___, int fd, int length);
+typedef int (*HPMHOOK_pre_inter_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_parse_frommap) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_inter_final) (void);
+typedef void (*HPMHOOK_post_inter_final) (void);
+typedef bool (*HPMHOOK_pre_inter_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_inter_config_read) (bool retVal___, const char *filename, bool imported);
+typedef bool (*HPMHOOK_pre_inter_config_read_log) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_inter_config_read_log) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_inter_config_read_connection) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_inter_config_read_connection) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+#endif // CHAR_INTER_H
+#ifdef CHAR_INT_MAIL_H /* inter_mail */
+typedef int (*HPMHOOK_pre_inter_mail_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_mail_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_mail_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_mail_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_mail_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_mail_parse_frommap) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_inter_mail_fromsql) (int *char_id, struct mail_data **md);
+typedef int (*HPMHOOK_post_inter_mail_fromsql) (int retVal___, int char_id, struct mail_data *md);
+typedef int (*HPMHOOK_pre_inter_mail_savemessage) (struct mail_message **msg);
+typedef int (*HPMHOOK_post_inter_mail_savemessage) (int retVal___, struct mail_message *msg);
+typedef bool (*HPMHOOK_pre_inter_mail_loadmessage) (int *mail_id, struct mail_message **msg);
+typedef bool (*HPMHOOK_post_inter_mail_loadmessage) (bool retVal___, int mail_id, struct mail_message *msg);
+typedef bool (*HPMHOOK_pre_inter_mail_DeleteAttach) (int *mail_id);
+typedef bool (*HPMHOOK_post_inter_mail_DeleteAttach) (bool retVal___, int mail_id);
+typedef void (*HPMHOOK_pre_inter_mail_sendmail) (int *send_id, const char **send_name, int *dest_id, const char **dest_name, const char **title, const char **body, int *zeny, struct item **item);
+typedef void (*HPMHOOK_post_inter_mail_sendmail) (int send_id, const char *send_name, int dest_id, const char *dest_name, const char *title, const char *body, int zeny, struct item *item);
+#endif // CHAR_INT_MAIL_H
+#ifdef CHAR_INT_MERCENARY_H /* inter_mercenary */
+typedef bool (*HPMHOOK_pre_inter_mercenary_owner_fromsql) (int *char_id, struct mmo_charstatus **status);
+typedef bool (*HPMHOOK_post_inter_mercenary_owner_fromsql) (bool retVal___, int char_id, struct mmo_charstatus *status);
+typedef bool (*HPMHOOK_pre_inter_mercenary_owner_tosql) (int *char_id, struct mmo_charstatus **status);
+typedef bool (*HPMHOOK_post_inter_mercenary_owner_tosql) (bool retVal___, int char_id, struct mmo_charstatus *status);
+typedef bool (*HPMHOOK_pre_inter_mercenary_owner_delete) (int *char_id);
+typedef bool (*HPMHOOK_post_inter_mercenary_owner_delete) (bool retVal___, int char_id);
+typedef int (*HPMHOOK_pre_inter_mercenary_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_mercenary_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_mercenary_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_mercenary_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_mercenary_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_mercenary_parse_frommap) (int retVal___, int fd);
+#endif // CHAR_INT_MERCENARY_H
+#ifdef CHAR_INT_PARTY_H /* inter_party */
+typedef int (*HPMHOOK_pre_inter_party_check_lv) (struct party_data **p);
+typedef int (*HPMHOOK_post_inter_party_check_lv) (int retVal___, struct party_data *p);
+typedef void (*HPMHOOK_pre_inter_party_calc_state) (struct party_data **p);
+typedef void (*HPMHOOK_post_inter_party_calc_state) (struct party_data *p);
+typedef int (*HPMHOOK_pre_inter_party_tosql) (struct party **p, int *flag, int *index);
+typedef int (*HPMHOOK_post_inter_party_tosql) (int retVal___, struct party *p, int flag, int index);
+typedef struct party_data* (*HPMHOOK_pre_inter_party_fromsql) (int *party_id);
+typedef struct party_data* (*HPMHOOK_post_inter_party_fromsql) (struct party_data* retVal___, int party_id);
+typedef int (*HPMHOOK_pre_inter_party_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_party_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_party_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_party_sql_final) (void);
+typedef struct party_data* (*HPMHOOK_pre_inter_party_search_partyname) (const char **str);
+typedef struct party_data* (*HPMHOOK_post_inter_party_search_partyname) (struct party_data* retVal___, const char *str);
+typedef int (*HPMHOOK_pre_inter_party_check_exp_share) (struct party_data **p);
+typedef int (*HPMHOOK_post_inter_party_check_exp_share) (int retVal___, struct party_data *p);
+typedef int (*HPMHOOK_pre_inter_party_check_empty) (struct party_data **p);
+typedef int (*HPMHOOK_post_inter_party_check_empty) (int retVal___, struct party_data *p);
+typedef int (*HPMHOOK_pre_inter_party_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_party_parse_frommap) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_inter_party_leave) (int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_inter_party_leave) (int retVal___, int party_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_inter_party_CharOnline) (int *char_id, int *party_id);
+typedef int (*HPMHOOK_post_inter_party_CharOnline) (int retVal___, int char_id, int party_id);
+typedef int (*HPMHOOK_pre_inter_party_CharOffline) (int *char_id, int *party_id);
+typedef int (*HPMHOOK_post_inter_party_CharOffline) (int retVal___, int char_id, int party_id);
+#endif // CHAR_INT_PARTY_H
+#ifdef CHAR_INT_PET_H /* inter_pet */
+typedef int (*HPMHOOK_pre_inter_pet_tosql) (const struct s_pet **p);
+typedef int (*HPMHOOK_post_inter_pet_tosql) (int retVal___, const struct s_pet *p);
+typedef int (*HPMHOOK_pre_inter_pet_fromsql) (int *pet_id, struct s_pet **p);
+typedef int (*HPMHOOK_post_inter_pet_fromsql) (int retVal___, int pet_id, struct s_pet *p);
+typedef int (*HPMHOOK_pre_inter_pet_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_pet_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_pet_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_pet_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_pet_delete_) (int *pet_id);
+typedef int (*HPMHOOK_post_inter_pet_delete_) (int retVal___, int pet_id);
+typedef int (*HPMHOOK_pre_inter_pet_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_pet_parse_frommap) (int retVal___, int fd);
+#endif // CHAR_INT_PET_H
+#ifdef CHAR_INT_QUEST_H /* inter_quest */
+typedef int (*HPMHOOK_pre_inter_quest_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_quest_parse_frommap) (int retVal___, int fd);
+#endif // CHAR_INT_QUEST_H
+#ifdef CHAR_INT_STORAGE_H /* inter_storage */
+typedef int (*HPMHOOK_pre_inter_storage_tosql) (int *account_id, const struct storage_data **p);
+typedef int (*HPMHOOK_post_inter_storage_tosql) (int retVal___, int account_id, const struct storage_data *p);
+typedef int (*HPMHOOK_pre_inter_storage_fromsql) (int *account_id, struct storage_data **p);
+typedef int (*HPMHOOK_post_inter_storage_fromsql) (int retVal___, int account_id, struct storage_data *p);
+typedef int (*HPMHOOK_pre_inter_storage_guild_storage_tosql) (int *guild_id, const struct guild_storage **p);
+typedef int (*HPMHOOK_post_inter_storage_guild_storage_tosql) (int retVal___, int guild_id, const struct guild_storage *p);
+typedef int (*HPMHOOK_pre_inter_storage_guild_storage_fromsql) (int *guild_id, struct guild_storage **p);
+typedef int (*HPMHOOK_post_inter_storage_guild_storage_fromsql) (int retVal___, int guild_id, struct guild_storage *p);
+typedef int (*HPMHOOK_pre_inter_storage_sql_init) (void);
+typedef int (*HPMHOOK_post_inter_storage_sql_init) (int retVal___);
+typedef void (*HPMHOOK_pre_inter_storage_sql_final) (void);
+typedef void (*HPMHOOK_post_inter_storage_sql_final) (void);
+typedef int (*HPMHOOK_pre_inter_storage_delete_) (int *account_id);
+typedef int (*HPMHOOK_post_inter_storage_delete_) (int retVal___, int account_id);
+typedef int (*HPMHOOK_pre_inter_storage_guild_storage_delete) (int *guild_id);
+typedef int (*HPMHOOK_post_inter_storage_guild_storage_delete) (int retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_inter_storage_parse_frommap) (int *fd);
+typedef int (*HPMHOOK_post_inter_storage_parse_frommap) (int retVal___, int fd);
+#endif // CHAR_INT_STORAGE_H
+#ifdef MAP_INTIF_H /* intif */
+typedef int (*HPMHOOK_pre_intif_parse) (int *fd);
+typedef int (*HPMHOOK_post_intif_parse) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_intif_create_pet) (int *account_id, int *char_id, short *pet_type, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char **pet_name);
+typedef int (*HPMHOOK_post_intif_create_pet) (int retVal___, int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name);
+typedef int (*HPMHOOK_pre_intif_broadcast) (const char **mes, int *len, int *type);
+typedef int (*HPMHOOK_post_intif_broadcast) (int retVal___, const char *mes, int len, int type);
+typedef int (*HPMHOOK_pre_intif_broadcast2) (const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY);
+typedef int (*HPMHOOK_post_intif_broadcast2) (int retVal___, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY);
+typedef int (*HPMHOOK_pre_intif_main_message) (struct map_session_data **sd, const char **message);
+typedef int (*HPMHOOK_post_intif_main_message) (int retVal___, struct map_session_data *sd, const char *message);
+typedef int (*HPMHOOK_pre_intif_wis_message) (struct map_session_data **sd, const char **nick, const char **mes, int *mes_len);
+typedef int (*HPMHOOK_post_intif_wis_message) (int retVal___, struct map_session_data *sd, const char *nick, const char *mes, int mes_len);
+typedef int (*HPMHOOK_pre_intif_wis_message_to_gm) (char **Wisp_name, int *permission, char **mes);
+typedef int (*HPMHOOK_post_intif_wis_message_to_gm) (int retVal___, char *Wisp_name, int permission, char *mes);
+typedef int (*HPMHOOK_pre_intif_saveregistry) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_intif_saveregistry) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_intif_request_registry) (struct map_session_data **sd, int *flag);
+typedef int (*HPMHOOK_post_intif_request_registry) (int retVal___, struct map_session_data *sd, int flag);
+typedef void (*HPMHOOK_pre_intif_request_account_storage) (const struct map_session_data **sd);
+typedef void (*HPMHOOK_post_intif_request_account_storage) (const struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_intif_send_account_storage) (const struct map_session_data **sd);
+typedef void (*HPMHOOK_post_intif_send_account_storage) (const struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_intif_request_guild_storage) (int *account_id, int *guild_id);
+typedef int (*HPMHOOK_post_intif_request_guild_storage) (int retVal___, int account_id, int guild_id);
+typedef int (*HPMHOOK_pre_intif_send_guild_storage) (int *account_id, struct guild_storage **gstor);
+typedef int (*HPMHOOK_post_intif_send_guild_storage) (int retVal___, int account_id, struct guild_storage *gstor);
+typedef int (*HPMHOOK_pre_intif_create_party) (struct party_member **member, const char **name, int *item, int *item2);
+typedef int (*HPMHOOK_post_intif_create_party) (int retVal___, struct party_member *member, const char *name, int item, int item2);
+typedef int (*HPMHOOK_pre_intif_request_partyinfo) (int *party_id, int *char_id);
+typedef int (*HPMHOOK_post_intif_request_partyinfo) (int retVal___, int party_id, int char_id);
+typedef int (*HPMHOOK_pre_intif_party_addmember) (int *party_id, struct party_member **member);
+typedef int (*HPMHOOK_post_intif_party_addmember) (int retVal___, int party_id, struct party_member *member);
+typedef int (*HPMHOOK_pre_intif_party_changeoption) (int *party_id, int *account_id, int *exp, int *item);
+typedef int (*HPMHOOK_post_intif_party_changeoption) (int retVal___, int party_id, int account_id, int exp, int item);
+typedef int (*HPMHOOK_pre_intif_party_leave) (int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_intif_party_leave) (int retVal___, int party_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_intif_party_changemap) (struct map_session_data **sd, int *online);
+typedef int (*HPMHOOK_post_intif_party_changemap) (int retVal___, struct map_session_data *sd, int online);
+typedef int (*HPMHOOK_pre_intif_break_party) (int *party_id);
+typedef int (*HPMHOOK_post_intif_break_party) (int retVal___, int party_id);
+typedef int (*HPMHOOK_pre_intif_party_message) (int *party_id, int *account_id, const char **mes, int *len);
+typedef int (*HPMHOOK_post_intif_party_message) (int retVal___, int party_id, int account_id, const char *mes, int len);
+typedef int (*HPMHOOK_pre_intif_party_leaderchange) (int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_intif_party_leaderchange) (int retVal___, int party_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_intif_guild_create) (const char **name, const struct guild_member **master);
+typedef int (*HPMHOOK_post_intif_guild_create) (int retVal___, const char *name, const struct guild_member *master);
+typedef int (*HPMHOOK_pre_intif_guild_request_info) (int *guild_id);
+typedef int (*HPMHOOK_post_intif_guild_request_info) (int retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_intif_guild_addmember) (int *guild_id, struct guild_member **m);
+typedef int (*HPMHOOK_post_intif_guild_addmember) (int retVal___, int guild_id, struct guild_member *m);
+typedef int (*HPMHOOK_pre_intif_guild_leave) (int *guild_id, int *account_id, int *char_id, int *flag, const char **mes);
+typedef int (*HPMHOOK_post_intif_guild_leave) (int retVal___, int guild_id, int account_id, int char_id, int flag, const char *mes);
+typedef int (*HPMHOOK_pre_intif_guild_memberinfoshort) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
+typedef int (*HPMHOOK_post_intif_guild_memberinfoshort) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+typedef int (*HPMHOOK_pre_intif_guild_break) (int *guild_id);
+typedef int (*HPMHOOK_post_intif_guild_break) (int retVal___, int guild_id);
+typedef int (*HPMHOOK_pre_intif_guild_message) (int *guild_id, int *account_id, const char **mes, int *len);
+typedef int (*HPMHOOK_post_intif_guild_message) (int retVal___, int guild_id, int account_id, const char *mes, int len);
+typedef int (*HPMHOOK_pre_intif_guild_change_gm) (int *guild_id, const char **name, int *len);
+typedef int (*HPMHOOK_post_intif_guild_change_gm) (int retVal___, int guild_id, const char *name, int len);
+typedef int (*HPMHOOK_pre_intif_guild_change_basicinfo) (int *guild_id, int *type, const void **data, int *len);
+typedef int (*HPMHOOK_post_intif_guild_change_basicinfo) (int retVal___, int guild_id, int type, const void *data, int len);
+typedef int (*HPMHOOK_pre_intif_guild_change_memberinfo) (int *guild_id, int *account_id, int *char_id, int *type, const void **data, int *len);
+typedef int (*HPMHOOK_post_intif_guild_change_memberinfo) (int retVal___, int guild_id, int account_id, int char_id, int type, const void *data, int len);
+typedef int (*HPMHOOK_pre_intif_guild_position) (int *guild_id, int *idx, struct guild_position **p);
+typedef int (*HPMHOOK_post_intif_guild_position) (int retVal___, int guild_id, int idx, struct guild_position *p);
+typedef int (*HPMHOOK_pre_intif_guild_skillup) (int *guild_id, uint16 *skill_id, int *account_id, int *max);
+typedef int (*HPMHOOK_post_intif_guild_skillup) (int retVal___, int guild_id, uint16 skill_id, int account_id, int max);
+typedef int (*HPMHOOK_pre_intif_guild_alliance) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag);
+typedef int (*HPMHOOK_post_intif_guild_alliance) (int retVal___, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
+typedef int (*HPMHOOK_pre_intif_guild_notice) (int *guild_id, const char **mes1, const char **mes2);
+typedef int (*HPMHOOK_post_intif_guild_notice) (int retVal___, int guild_id, const char *mes1, const char *mes2);
+typedef int (*HPMHOOK_pre_intif_guild_emblem) (int *guild_id, int *len, const char **data);
+typedef int (*HPMHOOK_post_intif_guild_emblem) (int retVal___, int guild_id, int len, const char *data);
+typedef int (*HPMHOOK_pre_intif_guild_castle_dataload) (int *num, int **castle_ids);
+typedef int (*HPMHOOK_post_intif_guild_castle_dataload) (int retVal___, int num, int *castle_ids);
+typedef int (*HPMHOOK_pre_intif_guild_castle_datasave) (int *castle_id, int *index, int *value);
+typedef int (*HPMHOOK_post_intif_guild_castle_datasave) (int retVal___, int castle_id, int index, int value);
+typedef void (*HPMHOOK_pre_intif_itembound_req) (int *char_id, int *aid, int *guild_id);
+typedef void (*HPMHOOK_post_intif_itembound_req) (int char_id, int aid, int guild_id);
+typedef int (*HPMHOOK_pre_intif_request_petdata) (int *account_id, int *char_id, int *pet_id);
+typedef int (*HPMHOOK_post_intif_request_petdata) (int retVal___, int account_id, int char_id, int pet_id);
+typedef int (*HPMHOOK_pre_intif_save_petdata) (int *account_id, struct s_pet **p);
+typedef int (*HPMHOOK_post_intif_save_petdata) (int retVal___, int account_id, struct s_pet *p);
+typedef int (*HPMHOOK_pre_intif_delete_petdata) (int *pet_id);
+typedef int (*HPMHOOK_post_intif_delete_petdata) (int retVal___, int pet_id);
+typedef int (*HPMHOOK_pre_intif_rename) (struct map_session_data **sd, int *type, const char **name);
+typedef int (*HPMHOOK_post_intif_rename) (int retVal___, struct map_session_data *sd, int type, const char *name);
+typedef int (*HPMHOOK_pre_intif_homunculus_create) (int *account_id, struct s_homunculus **sh);
+typedef int (*HPMHOOK_post_intif_homunculus_create) (int retVal___, int account_id, struct s_homunculus *sh);
+typedef bool (*HPMHOOK_pre_intif_homunculus_requestload) (int *account_id, int *homun_id);
+typedef bool (*HPMHOOK_post_intif_homunculus_requestload) (bool retVal___, int account_id, int homun_id);
+typedef int (*HPMHOOK_pre_intif_homunculus_requestsave) (int *account_id, struct s_homunculus **sh);
+typedef int (*HPMHOOK_post_intif_homunculus_requestsave) (int retVal___, int account_id, struct s_homunculus *sh);
+typedef int (*HPMHOOK_pre_intif_homunculus_requestdelete) (int *homun_id);
+typedef int (*HPMHOOK_post_intif_homunculus_requestdelete) (int retVal___, int homun_id);
+typedef void (*HPMHOOK_pre_intif_request_questlog) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_intif_request_questlog) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_intif_quest_save) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_intif_quest_save) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_intif_mercenary_create) (struct s_mercenary **merc);
+typedef int (*HPMHOOK_post_intif_mercenary_create) (int retVal___, struct s_mercenary *merc);
+typedef int (*HPMHOOK_pre_intif_mercenary_request) (int *merc_id, int *char_id);
+typedef int (*HPMHOOK_post_intif_mercenary_request) (int retVal___, int merc_id, int char_id);
+typedef int (*HPMHOOK_pre_intif_mercenary_delete) (int *merc_id);
+typedef int (*HPMHOOK_post_intif_mercenary_delete) (int retVal___, int merc_id);
+typedef int (*HPMHOOK_pre_intif_mercenary_save) (struct s_mercenary **merc);
+typedef int (*HPMHOOK_post_intif_mercenary_save) (int retVal___, struct s_mercenary *merc);
+typedef int (*HPMHOOK_pre_intif_Mail_requestinbox) (int *char_id, unsigned char *flag);
+typedef int (*HPMHOOK_post_intif_Mail_requestinbox) (int retVal___, int char_id, unsigned char flag);
+typedef int (*HPMHOOK_pre_intif_Mail_read) (int *mail_id);
+typedef int (*HPMHOOK_post_intif_Mail_read) (int retVal___, int mail_id);
+typedef int (*HPMHOOK_pre_intif_Mail_getattach) (int *char_id, int *mail_id);
+typedef int (*HPMHOOK_post_intif_Mail_getattach) (int retVal___, int char_id, int mail_id);
+typedef int (*HPMHOOK_pre_intif_Mail_delete) (int *char_id, int *mail_id);
+typedef int (*HPMHOOK_post_intif_Mail_delete) (int retVal___, int char_id, int mail_id);
+typedef int (*HPMHOOK_pre_intif_Mail_return) (int *char_id, int *mail_id);
+typedef int (*HPMHOOK_post_intif_Mail_return) (int retVal___, int char_id, int mail_id);
+typedef int (*HPMHOOK_pre_intif_Mail_send) (int *account_id, struct mail_message **msg);
+typedef int (*HPMHOOK_post_intif_Mail_send) (int retVal___, int account_id, struct mail_message *msg);
+typedef int (*HPMHOOK_pre_intif_Auction_requestlist) (int *char_id, short *type, int *price, const char **searchtext, short *page);
+typedef int (*HPMHOOK_post_intif_Auction_requestlist) (int retVal___, int char_id, short type, int price, const char *searchtext, short page);
+typedef int (*HPMHOOK_pre_intif_Auction_register) (struct auction_data **auction);
+typedef int (*HPMHOOK_post_intif_Auction_register) (int retVal___, struct auction_data *auction);
+typedef int (*HPMHOOK_pre_intif_Auction_cancel) (int *char_id, unsigned int *auction_id);
+typedef int (*HPMHOOK_post_intif_Auction_cancel) (int retVal___, int char_id, unsigned int auction_id);
+typedef int (*HPMHOOK_pre_intif_Auction_close) (int *char_id, unsigned int *auction_id);
+typedef int (*HPMHOOK_post_intif_Auction_close) (int retVal___, int char_id, unsigned int auction_id);
+typedef int (*HPMHOOK_pre_intif_Auction_bid) (int *char_id, const char **name, unsigned int *auction_id, int *bid);
+typedef int (*HPMHOOK_post_intif_Auction_bid) (int retVal___, int char_id, const char *name, unsigned int auction_id, int bid);
+typedef int (*HPMHOOK_pre_intif_elemental_create) (struct s_elemental **ele);
+typedef int (*HPMHOOK_post_intif_elemental_create) (int retVal___, struct s_elemental *ele);
+typedef int (*HPMHOOK_pre_intif_elemental_request) (int *ele_id, int *char_id);
+typedef int (*HPMHOOK_post_intif_elemental_request) (int retVal___, int ele_id, int char_id);
+typedef int (*HPMHOOK_pre_intif_elemental_delete) (int *ele_id);
+typedef int (*HPMHOOK_post_intif_elemental_delete) (int retVal___, int ele_id);
+typedef int (*HPMHOOK_pre_intif_elemental_save) (struct s_elemental **ele);
+typedef int (*HPMHOOK_post_intif_elemental_save) (int retVal___, struct s_elemental *ele);
+typedef void (*HPMHOOK_pre_intif_request_accinfo) (int *u_fd, int *aid, int *group_lv, char **query);
+typedef void (*HPMHOOK_post_intif_request_accinfo) (int u_fd, int aid, int group_lv, char *query);
+typedef int (*HPMHOOK_pre_intif_CheckForCharServer) (void);
+typedef int (*HPMHOOK_post_intif_CheckForCharServer) (int retVal___);
+typedef void (*HPMHOOK_pre_intif_pWisMessage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pWisMessage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pWisEnd) (int *fd);
+typedef void (*HPMHOOK_post_intif_pWisEnd) (int fd);
+typedef int (*HPMHOOK_pre_intif_pWisToGM_sub) (struct map_session_data **sd, va_list va);
+typedef int (*HPMHOOK_post_intif_pWisToGM_sub) (int retVal___, struct map_session_data *sd, va_list va);
+typedef void (*HPMHOOK_pre_intif_pWisToGM) (int *fd);
+typedef void (*HPMHOOK_post_intif_pWisToGM) (int fd);
+typedef void (*HPMHOOK_pre_intif_pRegisters) (int *fd);
+typedef void (*HPMHOOK_post_intif_pRegisters) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAccountStorage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAccountStorage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pChangeNameOk) (int *fd);
+typedef void (*HPMHOOK_post_intif_pChangeNameOk) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMessageToFD) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMessageToFD) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAccountStorageSaveAck) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAccountStorageSaveAck) (int fd);
+typedef void (*HPMHOOK_pre_intif_pLoadGuildStorage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pLoadGuildStorage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pSaveGuildStorage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pSaveGuildStorage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyCreated) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyCreated) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyInfo) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyInfo) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyMemberAdded) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyMemberAdded) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyOptionChanged) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyOptionChanged) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyMemberWithdraw) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyMemberWithdraw) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyMove) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyMove) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyBroken) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyBroken) (int fd);
+typedef void (*HPMHOOK_pre_intif_pPartyMessage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pPartyMessage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildCreated) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildCreated) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildInfo) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildInfo) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildMemberAdded) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildMemberAdded) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildMemberWithdraw) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildMemberWithdraw) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildMemberInfoShort) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildMemberInfoShort) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildBroken) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildBroken) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildMessage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildMessage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildBasicInfoChanged) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildBasicInfoChanged) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildMemberInfoChanged) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildMemberInfoChanged) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildPosition) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildPosition) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildSkillUp) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildSkillUp) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildAlliance) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildAlliance) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildNotice) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildNotice) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildEmblem) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildEmblem) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildCastleDataLoad) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildCastleDataLoad) (int fd);
+typedef void (*HPMHOOK_pre_intif_pGuildMasterChanged) (int *fd);
+typedef void (*HPMHOOK_post_intif_pGuildMasterChanged) (int fd);
+typedef void (*HPMHOOK_pre_intif_pQuestLog) (int *fd);
+typedef void (*HPMHOOK_post_intif_pQuestLog) (int fd);
+typedef void (*HPMHOOK_pre_intif_pQuestSave) (int *fd);
+typedef void (*HPMHOOK_post_intif_pQuestSave) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMailInboxReceived) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMailInboxReceived) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMailNew) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMailNew) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMailGetAttach) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMailGetAttach) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMailDelete) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMailDelete) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMailReturn) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMailReturn) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMailSend) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMailSend) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAuctionResults) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAuctionResults) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAuctionRegister) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAuctionRegister) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAuctionCancel) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAuctionCancel) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAuctionClose) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAuctionClose) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAuctionMessage) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAuctionMessage) (int fd);
+typedef void (*HPMHOOK_pre_intif_pAuctionBid) (int *fd);
+typedef void (*HPMHOOK_post_intif_pAuctionBid) (int fd);
+typedef void (*HPMHOOK_pre_intif_pItembound_ack) (int *fd);
+typedef void (*HPMHOOK_post_intif_pItembound_ack) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMercenaryReceived) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMercenaryReceived) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMercenaryDeleted) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMercenaryDeleted) (int fd);
+typedef void (*HPMHOOK_pre_intif_pMercenarySaved) (int *fd);
+typedef void (*HPMHOOK_post_intif_pMercenarySaved) (int fd);
+typedef void (*HPMHOOK_pre_intif_pElementalReceived) (int *fd);
+typedef void (*HPMHOOK_post_intif_pElementalReceived) (int fd);
+typedef void (*HPMHOOK_pre_intif_pElementalDeleted) (int *fd);
+typedef void (*HPMHOOK_post_intif_pElementalDeleted) (int fd);
+typedef void (*HPMHOOK_pre_intif_pElementalSaved) (int *fd);
+typedef void (*HPMHOOK_post_intif_pElementalSaved) (int fd);
+typedef void (*HPMHOOK_pre_intif_pCreatePet) (int *fd);
+typedef void (*HPMHOOK_post_intif_pCreatePet) (int fd);
+typedef void (*HPMHOOK_pre_intif_pRecvPetData) (int *fd);
+typedef void (*HPMHOOK_post_intif_pRecvPetData) (int fd);
+typedef void (*HPMHOOK_pre_intif_pSavePetOk) (int *fd);
+typedef void (*HPMHOOK_post_intif_pSavePetOk) (int fd);
+typedef void (*HPMHOOK_pre_intif_pDeletePetOk) (int *fd);
+typedef void (*HPMHOOK_post_intif_pDeletePetOk) (int fd);
+typedef void (*HPMHOOK_pre_intif_pCreateHomunculus) (int *fd);
+typedef void (*HPMHOOK_post_intif_pCreateHomunculus) (int fd);
+typedef void (*HPMHOOK_pre_intif_pRecvHomunculusData) (int *fd);
+typedef void (*HPMHOOK_post_intif_pRecvHomunculusData) (int fd);
+typedef void (*HPMHOOK_pre_intif_pSaveHomunculusOk) (int *fd);
+typedef void (*HPMHOOK_post_intif_pSaveHomunculusOk) (int fd);
+typedef void (*HPMHOOK_pre_intif_pDeleteHomunculusOk) (int *fd);
+typedef void (*HPMHOOK_post_intif_pDeleteHomunculusOk) (int fd);
+#endif // MAP_INTIF_H
+#ifdef MAP_IRC_BOT_H /* ircbot */
+typedef void (*HPMHOOK_pre_ircbot_init) (bool *minimal);
+typedef void (*HPMHOOK_post_ircbot_init) (bool minimal);
+typedef void (*HPMHOOK_pre_ircbot_final) (void);
+typedef void (*HPMHOOK_post_ircbot_final) (void);
+typedef int (*HPMHOOK_pre_ircbot_parse) (int *fd);
+typedef int (*HPMHOOK_post_ircbot_parse) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_ircbot_parse_sub) (int *fd, char **str);
+typedef void (*HPMHOOK_post_ircbot_parse_sub) (int fd, char *str);
+typedef void (*HPMHOOK_pre_ircbot_parse_source) (char **source, char **nick, char **ident, char **host);
+typedef void (*HPMHOOK_post_ircbot_parse_source) (char *source, char *nick, char *ident, char *host);
+typedef struct irc_func* (*HPMHOOK_pre_ircbot_func_search) (char **function_name);
+typedef struct irc_func* (*HPMHOOK_post_ircbot_func_search) (struct irc_func* retVal___, char *function_name);
+typedef int (*HPMHOOK_pre_ircbot_connect_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_ircbot_connect_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_ircbot_identify_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_ircbot_identify_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_ircbot_join_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_ircbot_join_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_ircbot_queue_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_ircbot_queue_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_ircbot_queue) (char **str);
+typedef void (*HPMHOOK_post_ircbot_queue) (char *str);
+typedef void (*HPMHOOK_pre_ircbot_send) (char **str, bool *force);
+typedef void (*HPMHOOK_post_ircbot_send) (char *str, bool force);
+typedef void (*HPMHOOK_pre_ircbot_relay) (const char **name, const char **msg);
+typedef void (*HPMHOOK_post_ircbot_relay) (const char *name, const char *msg);
+typedef void (*HPMHOOK_pre_ircbot_pong) (int *fd, char **cmd, char **source, char **target, char **msg);
+typedef void (*HPMHOOK_post_ircbot_pong) (int fd, char *cmd, char *source, char *target, char *msg);
+typedef void (*HPMHOOK_pre_ircbot_privmsg) (int *fd, char **cmd, char **source, char **target, char **msg);
+typedef void (*HPMHOOK_post_ircbot_privmsg) (int fd, char *cmd, char *source, char *target, char *msg);
+typedef void (*HPMHOOK_pre_ircbot_privmsg_ctcp) (int *fd, char **cmd, char **source, char **target, char **msg);
+typedef void (*HPMHOOK_post_ircbot_privmsg_ctcp) (int fd, char *cmd, char *source, char *target, char *msg);
+typedef void (*HPMHOOK_pre_ircbot_userjoin) (int *fd, char **cmd, char **source, char **target, char **msg);
+typedef void (*HPMHOOK_post_ircbot_userjoin) (int fd, char *cmd, char *source, char *target, char *msg);
+typedef void (*HPMHOOK_pre_ircbot_userleave) (int *fd, char **cmd, char **source, char **target, char **msg);
+typedef void (*HPMHOOK_post_ircbot_userleave) (int fd, char *cmd, char *source, char *target, char *msg);
+typedef void (*HPMHOOK_pre_ircbot_usernick) (int *fd, char **cmd, char **source, char **target, char **msg);
+typedef void (*HPMHOOK_post_ircbot_usernick) (int fd, char *cmd, char *source, char *target, char *msg);
+#endif // MAP_IRC_BOT_H
+#ifdef MAP_ITEMDB_H /* itemdb */
+typedef void (*HPMHOOK_pre_itemdb_init) (bool *minimal);
+typedef void (*HPMHOOK_post_itemdb_init) (bool minimal);
+typedef void (*HPMHOOK_pre_itemdb_final) (void);
+typedef void (*HPMHOOK_post_itemdb_final) (void);
+typedef void (*HPMHOOK_pre_itemdb_reload) (void);
+typedef void (*HPMHOOK_post_itemdb_reload) (void);
+typedef void (*HPMHOOK_pre_itemdb_name_constants) (void);
+typedef void (*HPMHOOK_post_itemdb_name_constants) (void);
+typedef void (*HPMHOOK_pre_itemdb_read_groups) (void);
+typedef void (*HPMHOOK_post_itemdb_read_groups) (void);
+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);
+typedef bool (*HPMHOOK_post_itemdb_read_cached_packages) (bool retVal___, const char *config_filename);
+typedef struct item_data* (*HPMHOOK_pre_itemdb_name2id) (const char **str);
+typedef struct item_data* (*HPMHOOK_post_itemdb_name2id) (struct item_data* retVal___, const char *str);
+typedef struct item_data* (*HPMHOOK_pre_itemdb_search_name) (const char **name);
+typedef struct item_data* (*HPMHOOK_post_itemdb_search_name) (struct item_data* retVal___, const char *name);
+typedef int (*HPMHOOK_pre_itemdb_search_name_array) (struct item_data ***data, int *size, const char **str, int *flag);
+typedef int (*HPMHOOK_post_itemdb_search_name_array) (int retVal___, struct item_data **data, int size, const char *str, int flag);
+typedef struct item_data* (*HPMHOOK_pre_itemdb_load) (int *nameid);
+typedef struct item_data* (*HPMHOOK_post_itemdb_load) (struct item_data* retVal___, int nameid);
+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);
+typedef int (*HPMHOOK_post_itemdb_group_item) (int retVal___, struct item_group *group);
+typedef int (*HPMHOOK_pre_itemdb_chain_item) (unsigned short *chain_id, int **rate);
+typedef int (*HPMHOOK_post_itemdb_chain_item) (int retVal___, unsigned short chain_id, int *rate);
+typedef void (*HPMHOOK_pre_itemdb_package_item) (struct map_session_data **sd, struct item_package **package);
+typedef void (*HPMHOOK_post_itemdb_package_item) (struct map_session_data *sd, struct item_package *package);
+typedef int (*HPMHOOK_pre_itemdb_searchname_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_itemdb_searchname_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_itemdb_searchname_array_sub) (union DBKey *key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_post_itemdb_searchname_array_sub) (int retVal___, union DBKey key, struct DBData data, va_list ap);
+typedef int (*HPMHOOK_pre_itemdb_searchrandomid) (struct item_group **group);
+typedef int (*HPMHOOK_post_itemdb_searchrandomid) (int retVal___, struct item_group *group);
+typedef const char* (*HPMHOOK_pre_itemdb_typename) (int *type);
+typedef const char* (*HPMHOOK_post_itemdb_typename) (const char* retVal___, int type);
+typedef void (*HPMHOOK_pre_itemdb_jobmask2mapid) (uint64 **bclass, uint64 *jobmask);
+typedef void (*HPMHOOK_post_itemdb_jobmask2mapid) (uint64 *bclass, uint64 jobmask);
+typedef void (*HPMHOOK_pre_itemdb_jobid2mapid) (uint64 **bclass, int *job_class, bool *enable);
+typedef void (*HPMHOOK_post_itemdb_jobid2mapid) (uint64 *bclass, int job_class, bool enable);
+typedef void (*HPMHOOK_pre_itemdb_create_dummy_data) (void);
+typedef void (*HPMHOOK_post_itemdb_create_dummy_data) (void);
+typedef struct item_data* (*HPMHOOK_pre_itemdb_create_item_data) (int *nameid);
+typedef struct item_data* (*HPMHOOK_post_itemdb_create_item_data) (struct item_data* retVal___, int nameid);
+typedef int (*HPMHOOK_pre_itemdb_isequip) (int *nameid);
+typedef int (*HPMHOOK_post_itemdb_isequip) (int retVal___, int nameid);
+typedef int (*HPMHOOK_pre_itemdb_isequip2) (struct item_data **data);
+typedef int (*HPMHOOK_post_itemdb_isequip2) (int retVal___, struct item_data *data);
+typedef int (*HPMHOOK_pre_itemdb_isstackable) (int *nameid);
+typedef int (*HPMHOOK_post_itemdb_isstackable) (int retVal___, int nameid);
+typedef int (*HPMHOOK_pre_itemdb_isstackable2) (struct item_data **data);
+typedef int (*HPMHOOK_post_itemdb_isstackable2) (int retVal___, struct item_data *data);
+typedef int (*HPMHOOK_pre_itemdb_isdropable_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_isdropable_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_cantrade_sub) (struct item_data **item, int *gmlv, int *gmlv2);
+typedef int (*HPMHOOK_post_itemdb_cantrade_sub) (int retVal___, struct item_data *item, int gmlv, int gmlv2);
+typedef int (*HPMHOOK_pre_itemdb_canpartnertrade_sub) (struct item_data **item, int *gmlv, int *gmlv2);
+typedef int (*HPMHOOK_post_itemdb_canpartnertrade_sub) (int retVal___, struct item_data *item, int gmlv, int gmlv2);
+typedef int (*HPMHOOK_pre_itemdb_cansell_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_cansell_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_cancartstore_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_cancartstore_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_canstore_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_canstore_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_canguildstore_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_canguildstore_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_canmail_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_canmail_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_canauction_sub) (struct item_data **item, int *gmlv, int *unused);
+typedef int (*HPMHOOK_post_itemdb_canauction_sub) (int retVal___, struct item_data *item, int gmlv, int unused);
+typedef int (*HPMHOOK_pre_itemdb_isrestricted) (struct item **item, int *gmlv, int *gmlv2, int ( **func ) (struct item_data *, int, int));
+typedef int (*HPMHOOK_post_itemdb_isrestricted) (int retVal___, struct item *item, int gmlv, int gmlv2, int ( *func ) (struct item_data *, int, int));
+typedef int (*HPMHOOK_pre_itemdb_isidentified) (int *nameid);
+typedef int (*HPMHOOK_post_itemdb_isidentified) (int retVal___, int nameid);
+typedef int (*HPMHOOK_pre_itemdb_isidentified2) (struct item_data **data);
+typedef int (*HPMHOOK_post_itemdb_isidentified2) (int retVal___, struct item_data *data);
+typedef int (*HPMHOOK_pre_itemdb_combo_split_atoi) (char **str, int **val);
+typedef int (*HPMHOOK_post_itemdb_combo_split_atoi) (int retVal___, char *str, int *val);
+typedef void (*HPMHOOK_pre_itemdb_read_combos) (void);
+typedef void (*HPMHOOK_post_itemdb_read_combos) (void);
+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, const char **source);
+typedef void (*HPMHOOK_post_itemdb_readdb_options_additional_fields) (struct item_option *ito, struct config_setting_t *t, 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);
+typedef void (*HPMHOOK_post_itemdb_readdb_job_sub) (struct item_data *id, struct config_setting_t *t);
+typedef int (*HPMHOOK_pre_itemdb_readdb_libconfig_sub) (struct config_setting_t **it, int *n, const char **source);
+typedef int (*HPMHOOK_post_itemdb_readdb_libconfig_sub) (int retVal___, struct config_setting_t *it, int n, const char *source);
+typedef int (*HPMHOOK_pre_itemdb_readdb_libconfig) (const char **filename);
+typedef int (*HPMHOOK_post_itemdb_readdb_libconfig) (int retVal___, const char *filename);
+typedef uint64 (*HPMHOOK_pre_itemdb_unique_id) (struct map_session_data **sd);
+typedef uint64 (*HPMHOOK_post_itemdb_unique_id) (uint64 retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_itemdb_read) (bool *minimal);
+typedef void (*HPMHOOK_post_itemdb_read) (bool minimal);
+typedef void (*HPMHOOK_pre_itemdb_destroy_item_data) (struct item_data **self, int *free_self);
+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);
+typedef struct item_combo* (*HPMHOOK_post_itemdb_id2combo) (struct item_combo* retVal___, unsigned short id);
+typedef bool (*HPMHOOK_pre_itemdb_is_item_usable) (struct item_data **item);
+typedef bool (*HPMHOOK_post_itemdb_is_item_usable) (bool retVal___, struct item_data *item);
+typedef bool (*HPMHOOK_pre_itemdb_lookup_const) (const struct config_setting_t **it, const char **name, int **value);
+typedef bool (*HPMHOOK_post_itemdb_lookup_const) (bool retVal___, const struct config_setting_t *it, const char *name, int *value);
+#endif // MAP_ITEMDB_H
+#ifdef LOGIN_LCLIF_H /* lclif */
+typedef void (*HPMHOOK_pre_lclif_init) (void);
+typedef void (*HPMHOOK_post_lclif_init) (void);
+typedef void (*HPMHOOK_pre_lclif_final) (void);
+typedef void (*HPMHOOK_post_lclif_final) (void);
+typedef void (*HPMHOOK_pre_lclif_connection_error) (int *fd, uint8 *error);
+typedef void (*HPMHOOK_post_lclif_connection_error) (int fd, uint8 error);
+typedef bool (*HPMHOOK_pre_lclif_server_list) (struct login_session_data **sd);
+typedef bool (*HPMHOOK_post_lclif_server_list) (bool retVal___, struct login_session_data *sd);
+typedef void (*HPMHOOK_pre_lclif_auth_failed) (int *fd, time_t *ban, uint32 *error);
+typedef void (*HPMHOOK_post_lclif_auth_failed) (int fd, time_t ban, uint32 error);
+typedef void (*HPMHOOK_pre_lclif_login_error) (int *fd, uint8 *error);
+typedef void (*HPMHOOK_post_lclif_login_error) (int fd, uint8 error);
+typedef void (*HPMHOOK_pre_lclif_coding_key) (int *fd, struct login_session_data **sd);
+typedef void (*HPMHOOK_post_lclif_coding_key) (int fd, struct login_session_data *sd);
+typedef const struct login_packet_db* (*HPMHOOK_pre_lclif_packet) (int16 *packet_id);
+typedef const struct login_packet_db* (*HPMHOOK_post_lclif_packet) (const struct login_packet_db* retVal___, int16 packet_id);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_lclif_parse_packet) (const struct login_packet_db **lpd, int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_lclif_parse_packet) (enum parsefunc_rcode retVal___, const struct login_packet_db *lpd, int fd, struct login_session_data *sd);
+typedef int (*HPMHOOK_pre_lclif_parse) (int *fd);
+typedef int (*HPMHOOK_post_lclif_parse) (int retVal___, int fd);
+#endif // LOGIN_LCLIF_H
+#ifdef LOGIN_LCLIF_P_H /* PRIV__lclif */
+typedef void (*HPMHOOK_pre_PRIV__lclif_packetdb_loaddb) (void);
+typedef void (*HPMHOOK_post_PRIV__lclif_packetdb_loaddb) (void);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_sub) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_sub) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_EXE_HASHCHECK) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_EXE_HASHCHECK) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN2) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN2) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN3) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN3) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN4) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN4) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN_PCBANG) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN_PCBANG) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_LOGIN_HAN) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_LOGIN_HAN) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_SSO_LOGIN_REQ) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_SSO_LOGIN_REQ) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_REQ_HASH) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_REQ_HASH) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+typedef enum parsefunc_rcode (*HPMHOOK_pre_PRIV__lclif_parse_CA_CHARSERVERCONNECT) (int *fd, struct login_session_data **sd);
+typedef enum parsefunc_rcode (*HPMHOOK_post_PRIV__lclif_parse_CA_CHARSERVERCONNECT) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+#endif // LOGIN_LCLIF_P_H
+#ifdef COMMON_CONF_H /* libconfig */
+typedef int (*HPMHOOK_pre_libconfig_read) (struct config_t **config, FILE **stream);
+typedef int (*HPMHOOK_post_libconfig_read) (int retVal___, struct config_t *config, FILE *stream);
+typedef void (*HPMHOOK_pre_libconfig_write) (const struct config_t **config, FILE **stream);
+typedef void (*HPMHOOK_post_libconfig_write) (const struct config_t *config, FILE *stream);
+typedef void (*HPMHOOK_pre_libconfig_set_options) (struct config_t **config, int *options);
+typedef void (*HPMHOOK_post_libconfig_set_options) (struct config_t *config, int options);
+typedef int (*HPMHOOK_pre_libconfig_get_options) (const struct config_t **config);
+typedef int (*HPMHOOK_post_libconfig_get_options) (int retVal___, const struct config_t *config);
+typedef int (*HPMHOOK_pre_libconfig_read_string) (struct config_t **config, const char **str);
+typedef int (*HPMHOOK_post_libconfig_read_string) (int retVal___, struct config_t *config, const char *str);
+typedef int (*HPMHOOK_pre_libconfig_read_file_src) (struct config_t **config, const char **filename);
+typedef int (*HPMHOOK_post_libconfig_read_file_src) (int retVal___, struct config_t *config, const char *filename);
+typedef int (*HPMHOOK_pre_libconfig_write_file) (struct config_t **config, const char **filename);
+typedef int (*HPMHOOK_post_libconfig_write_file) (int retVal___, struct config_t *config, const char *filename);
+typedef void (*HPMHOOK_pre_libconfig_set_destructor) (struct config_t **config, void ( **destructor ) (void *));
+typedef void (*HPMHOOK_post_libconfig_set_destructor) (struct config_t *config, void ( *destructor ) (void *));
+typedef void (*HPMHOOK_pre_libconfig_set_include_dir) (struct config_t **config, const char **include_dir);
+typedef void (*HPMHOOK_post_libconfig_set_include_dir) (struct config_t *config, const char *include_dir);
+typedef void (*HPMHOOK_pre_libconfig_init) (struct config_t **config);
+typedef void (*HPMHOOK_post_libconfig_init) (struct config_t *config);
+typedef void (*HPMHOOK_pre_libconfig_destroy) (struct config_t **config);
+typedef void (*HPMHOOK_post_libconfig_destroy) (struct config_t *config);
+typedef int (*HPMHOOK_pre_libconfig_setting_get_int) (const struct config_setting_t **setting);
+typedef int (*HPMHOOK_post_libconfig_setting_get_int) (int retVal___, const struct config_setting_t *setting);
+typedef int64 (*HPMHOOK_pre_libconfig_setting_get_int64) (const struct config_setting_t **setting);
+typedef int64 (*HPMHOOK_post_libconfig_setting_get_int64) (int64 retVal___, const struct config_setting_t *setting);
+typedef double (*HPMHOOK_pre_libconfig_setting_get_float) (const struct config_setting_t **setting);
+typedef double (*HPMHOOK_post_libconfig_setting_get_float) (double retVal___, const struct config_setting_t *setting);
+typedef int (*HPMHOOK_pre_libconfig_setting_get_bool) (const struct config_setting_t **setting);
+typedef int (*HPMHOOK_post_libconfig_setting_get_bool) (int retVal___, const struct config_setting_t *setting);
+typedef const char* (*HPMHOOK_pre_libconfig_setting_get_string) (const struct config_setting_t **setting);
+typedef const char* (*HPMHOOK_post_libconfig_setting_get_string) (const char* retVal___, const struct config_setting_t *setting);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_lookup) (struct config_setting_t **setting, const char **name);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_lookup) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int) (const struct config_setting_t **setting, const char **name, int **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_int) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int64) (const struct config_setting_t **setting, const char **name, int64 **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_int64) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_float) (const struct config_setting_t **setting, const char **name, double **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_float) (int retVal___, const struct config_setting_t *setting, const char *name, double *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_bool) (const struct config_setting_t **setting, const char **name, int **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_bool) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_string) (const struct config_setting_t **setting, const char **name, const char ***value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_string) (int retVal___, const struct config_setting_t *setting, const char *name, const char **value);
+typedef int (*HPMHOOK_pre_libconfig_setting_set_int) (struct config_setting_t **setting, int *value);
+typedef int (*HPMHOOK_post_libconfig_setting_set_int) (int retVal___, struct config_setting_t *setting, int value);
+typedef int (*HPMHOOK_pre_libconfig_setting_set_int64) (struct config_setting_t **setting, int64 *value);
+typedef int (*HPMHOOK_post_libconfig_setting_set_int64) (int retVal___, struct config_setting_t *setting, int64 value);
+typedef int (*HPMHOOK_pre_libconfig_setting_set_float) (struct config_setting_t **setting, double *value);
+typedef int (*HPMHOOK_post_libconfig_setting_set_float) (int retVal___, struct config_setting_t *setting, double value);
+typedef int (*HPMHOOK_pre_libconfig_setting_set_bool) (struct config_setting_t **setting, int *value);
+typedef int (*HPMHOOK_post_libconfig_setting_set_bool) (int retVal___, struct config_setting_t *setting, int value);
+typedef int (*HPMHOOK_pre_libconfig_setting_set_string) (struct config_setting_t **setting, const char **value);
+typedef int (*HPMHOOK_post_libconfig_setting_set_string) (int retVal___, struct config_setting_t *setting, const char *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_set_format) (struct config_setting_t **setting, short *format);
+typedef int (*HPMHOOK_post_libconfig_setting_set_format) (int retVal___, struct config_setting_t *setting, short format);
+typedef short (*HPMHOOK_pre_libconfig_setting_get_format) (const struct config_setting_t **setting);
+typedef short (*HPMHOOK_post_libconfig_setting_get_format) (short retVal___, const struct config_setting_t *setting);
+typedef int (*HPMHOOK_pre_libconfig_setting_get_int_elem) (const struct config_setting_t **setting, int *idx);
+typedef int (*HPMHOOK_post_libconfig_setting_get_int_elem) (int retVal___, const struct config_setting_t *setting, int idx);
+typedef int64 (*HPMHOOK_pre_libconfig_setting_get_int64_elem) (const struct config_setting_t **setting, int *idx);
+typedef int64 (*HPMHOOK_post_libconfig_setting_get_int64_elem) (int64 retVal___, const struct config_setting_t *setting, int idx);
+typedef double (*HPMHOOK_pre_libconfig_setting_get_float_elem) (const struct config_setting_t **setting, int *idx);
+typedef double (*HPMHOOK_post_libconfig_setting_get_float_elem) (double retVal___, const struct config_setting_t *setting, int idx);
+typedef int (*HPMHOOK_pre_libconfig_setting_get_bool_elem) (const struct config_setting_t **setting, int *idx);
+typedef int (*HPMHOOK_post_libconfig_setting_get_bool_elem) (int retVal___, const struct config_setting_t *setting, int idx);
+typedef const char* (*HPMHOOK_pre_libconfig_setting_get_string_elem) (const struct config_setting_t **setting, int *idx);
+typedef const char* (*HPMHOOK_post_libconfig_setting_get_string_elem) (const char* retVal___, const struct config_setting_t *setting, int idx);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int_elem) (struct config_setting_t **setting, int *idx, int *value);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_int64_elem) (struct config_setting_t **setting, int *idx, int64 *value);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_int64_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_float_elem) (struct config_setting_t **setting, int *idx, double *value);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_float_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_bool_elem) (struct config_setting_t **setting, int *idx, int *value);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_bool_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_set_string_elem) (struct config_setting_t **setting, int *idx, const char **value);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_set_string_elem) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_index) (const struct config_setting_t **setting);
+typedef int (*HPMHOOK_post_libconfig_setting_index) (int retVal___, const struct config_setting_t *setting);
+typedef int (*HPMHOOK_pre_libconfig_setting_length) (const struct config_setting_t **setting);
+typedef int (*HPMHOOK_post_libconfig_setting_length) (int retVal___, const struct config_setting_t *setting);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_get_elem) (const struct config_setting_t **setting, unsigned int *idx);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_get_elem) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_get_member) (const struct config_setting_t **setting, const char **name);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_get_member) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_setting_add) (struct config_setting_t **parent, const char **name, int *type);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_setting_add) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type);
+typedef int (*HPMHOOK_pre_libconfig_setting_remove) (struct config_setting_t **parent, const char **name);
+typedef int (*HPMHOOK_post_libconfig_setting_remove) (int retVal___, struct config_setting_t *parent, const char *name);
+typedef int (*HPMHOOK_pre_libconfig_setting_remove_elem) (struct config_setting_t **parent, unsigned int *idx);
+typedef int (*HPMHOOK_post_libconfig_setting_remove_elem) (int retVal___, struct config_setting_t *parent, unsigned int idx);
+typedef void (*HPMHOOK_pre_libconfig_setting_set_hook) (struct config_setting_t **setting, void **hook);
+typedef void (*HPMHOOK_post_libconfig_setting_set_hook) (struct config_setting_t *setting, void *hook);
+typedef struct config_setting_t* (*HPMHOOK_pre_libconfig_lookup) (const struct config_t **config, const char **filepath);
+typedef struct config_setting_t* (*HPMHOOK_post_libconfig_lookup) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath);
+typedef int (*HPMHOOK_pre_libconfig_lookup_int) (const struct config_t **config, const char **filepath, int **value);
+typedef int (*HPMHOOK_post_libconfig_lookup_int) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+typedef int (*HPMHOOK_pre_libconfig_lookup_int64) (const struct config_t **config, const char **filepath, int64 **value);
+typedef int (*HPMHOOK_post_libconfig_lookup_int64) (int retVal___, const struct config_t *config, const char *filepath, int64 *value);
+typedef int (*HPMHOOK_pre_libconfig_lookup_float) (const struct config_t **config, const char **filepath, double **value);
+typedef int (*HPMHOOK_post_libconfig_lookup_float) (int retVal___, const struct config_t *config, const char *filepath, double *value);
+typedef int (*HPMHOOK_pre_libconfig_lookup_bool) (const struct config_t **config, const char **filepath, int **value);
+typedef int (*HPMHOOK_post_libconfig_lookup_bool) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+typedef int (*HPMHOOK_pre_libconfig_lookup_string) (const struct config_t **config, const char **filepath, const char ***value);
+typedef int (*HPMHOOK_post_libconfig_lookup_string) (int retVal___, const struct config_t *config, const char *filepath, const char **value);
+typedef int (*HPMHOOK_pre_libconfig_load_file) (struct config_t **config, const char **config_filename);
+typedef int (*HPMHOOK_post_libconfig_load_file) (int retVal___, struct config_t *config, const char *config_filename);
+typedef void (*HPMHOOK_pre_libconfig_setting_copy_simple) (struct config_setting_t **parent, const struct config_setting_t **src);
+typedef void (*HPMHOOK_post_libconfig_setting_copy_simple) (struct config_setting_t *parent, const struct config_setting_t *src);
+typedef void (*HPMHOOK_pre_libconfig_setting_copy_elem) (struct config_setting_t **parent, const struct config_setting_t **src);
+typedef void (*HPMHOOK_post_libconfig_setting_copy_elem) (struct config_setting_t *parent, const struct config_setting_t *src);
+typedef void (*HPMHOOK_pre_libconfig_setting_copy_aggregate) (struct config_setting_t **parent, const struct config_setting_t **src);
+typedef void (*HPMHOOK_post_libconfig_setting_copy_aggregate) (struct config_setting_t *parent, const struct config_setting_t *src);
+typedef int (*HPMHOOK_pre_libconfig_setting_copy) (struct config_setting_t **parent, const struct config_setting_t **src);
+typedef int (*HPMHOOK_post_libconfig_setting_copy) (int retVal___, struct config_setting_t *parent, const struct config_setting_t *src);
+typedef bool (*HPMHOOK_pre_libconfig_setting_get_bool_real) (const struct config_setting_t **setting);
+typedef bool (*HPMHOOK_post_libconfig_setting_get_bool_real) (bool retVal___, const struct config_setting_t *setting);
+typedef uint32 (*HPMHOOK_pre_libconfig_setting_get_uint32) (const struct config_setting_t **setting);
+typedef uint32 (*HPMHOOK_post_libconfig_setting_get_uint32) (uint32 retVal___, const struct config_setting_t *setting);
+typedef uint16 (*HPMHOOK_pre_libconfig_setting_get_uint16) (const struct config_setting_t **setting);
+typedef uint16 (*HPMHOOK_post_libconfig_setting_get_uint16) (uint16 retVal___, const struct config_setting_t *setting);
+typedef int16 (*HPMHOOK_pre_libconfig_setting_get_int16) (const struct config_setting_t **setting);
+typedef int16 (*HPMHOOK_post_libconfig_setting_get_int16) (int16 retVal___, const struct config_setting_t *setting);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_bool_real) (const struct config_setting_t **setting, const char **name, bool **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_bool_real) (int retVal___, const struct config_setting_t *setting, const char *name, bool *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_uint32) (const struct config_setting_t **setting, const char **name, uint32 **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_uint32) (int retVal___, const struct config_setting_t *setting, const char *name, uint32 *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_uint16) (const struct config_setting_t **setting, const char **name, uint16 **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_uint16) (int retVal___, const struct config_setting_t *setting, const char *name, uint16 *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_int16) (const struct config_setting_t **setting, const char **name, int16 **value);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_int16) (int retVal___, const struct config_setting_t *setting, const char *name, int16 *value);
+typedef int (*HPMHOOK_pre_libconfig_setting_lookup_mutable_string) (const struct config_setting_t **setting, const char **name, char **out, size_t *out_size);
+typedef int (*HPMHOOK_post_libconfig_setting_lookup_mutable_string) (int retVal___, const struct config_setting_t *setting, const char *name, char *out, size_t out_size);
+typedef int (*HPMHOOK_pre_libconfig_lookup_mutable_string) (const struct config_t **config, const char **name, char **out, size_t *out_size);
+typedef int (*HPMHOOK_post_libconfig_lookup_mutable_string) (int retVal___, const struct config_t *config, const char *name, char *out, size_t out_size);
+#endif // COMMON_CONF_H
+#ifdef MAP_LOG_H /* logs */
+typedef void (*HPMHOOK_pre_logs_pick_pc) (struct map_session_data **sd, e_log_pick_type *type, int *amount, struct item **itm, struct item_data **data);
+typedef void (*HPMHOOK_post_logs_pick_pc) (struct map_session_data *sd, e_log_pick_type type, int amount, struct item *itm, struct item_data *data);
+typedef void (*HPMHOOK_pre_logs_pick_mob) (struct mob_data **md, e_log_pick_type *type, int *amount, struct item **itm, struct item_data **data);
+typedef void (*HPMHOOK_post_logs_pick_mob) (struct mob_data *md, e_log_pick_type type, int amount, struct item *itm, struct item_data *data);
+typedef void (*HPMHOOK_pre_logs_zeny) (struct map_session_data **sd, e_log_pick_type *type, struct map_session_data **src_sd, int *amount);
+typedef void (*HPMHOOK_post_logs_zeny) (struct map_session_data *sd, e_log_pick_type type, struct map_session_data *src_sd, int amount);
+typedef void (*HPMHOOK_pre_logs_npc) (struct map_session_data **sd, const char **message);
+typedef void (*HPMHOOK_post_logs_npc) (struct map_session_data *sd, const char *message);
+typedef void (*HPMHOOK_pre_logs_chat) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char **mapname, int *x, int *y, const char **dst_charname, const char **message);
+typedef void (*HPMHOOK_post_logs_chat) (e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message);
+typedef void (*HPMHOOK_pre_logs_atcommand) (struct map_session_data **sd, const char **message);
+typedef void (*HPMHOOK_post_logs_atcommand) (struct map_session_data *sd, const char *message);
+typedef void (*HPMHOOK_pre_logs_branch) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_logs_branch) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_logs_mvpdrop) (struct map_session_data **sd, int *monster_id, int **log_mvp);
+typedef void (*HPMHOOK_post_logs_mvpdrop) (struct map_session_data *sd, int monster_id, int *log_mvp);
+typedef void (*HPMHOOK_pre_logs_pick_sub) (int *id, int16 *m, e_log_pick_type *type, int *amount, struct item **itm, struct item_data **data);
+typedef void (*HPMHOOK_post_logs_pick_sub) (int id, int16 m, e_log_pick_type type, int amount, struct item *itm, struct item_data *data);
+typedef void (*HPMHOOK_pre_logs_zeny_sub) (struct map_session_data **sd, e_log_pick_type *type, struct map_session_data **src_sd, int *amount);
+typedef void (*HPMHOOK_post_logs_zeny_sub) (struct map_session_data *sd, e_log_pick_type type, struct map_session_data *src_sd, int amount);
+typedef void (*HPMHOOK_pre_logs_npc_sub) (struct map_session_data **sd, const char **message);
+typedef void (*HPMHOOK_post_logs_npc_sub) (struct map_session_data *sd, const char *message);
+typedef void (*HPMHOOK_pre_logs_chat_sub) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char **mapname, int *x, int *y, const char **dst_charname, const char **message);
+typedef void (*HPMHOOK_post_logs_chat_sub) (e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message);
+typedef void (*HPMHOOK_pre_logs_atcommand_sub) (struct map_session_data **sd, const char **message);
+typedef void (*HPMHOOK_post_logs_atcommand_sub) (struct map_session_data *sd, const char *message);
+typedef void (*HPMHOOK_pre_logs_branch_sub) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_logs_branch_sub) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_logs_mvpdrop_sub) (struct map_session_data **sd, int *monster_id, int **log_mvp);
+typedef void (*HPMHOOK_post_logs_mvpdrop_sub) (struct map_session_data *sd, int monster_id, int *log_mvp);
+typedef bool (*HPMHOOK_pre_logs_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_logs_config_read) (bool retVal___, const char *filename, bool imported);
+typedef void (*HPMHOOK_pre_logs_config_done) (void);
+typedef void (*HPMHOOK_post_logs_config_done) (void);
+typedef void (*HPMHOOK_pre_logs_sql_init) (void);
+typedef void (*HPMHOOK_post_logs_sql_init) (void);
+typedef void (*HPMHOOK_pre_logs_sql_final) (void);
+typedef void (*HPMHOOK_post_logs_sql_final) (void);
+typedef char (*HPMHOOK_pre_logs_picktype2char) (e_log_pick_type *type);
+typedef char (*HPMHOOK_post_logs_picktype2char) (char retVal___, e_log_pick_type type);
+typedef char (*HPMHOOK_pre_logs_chattype2char) (e_log_chat_type *type);
+typedef char (*HPMHOOK_post_logs_chattype2char) (char retVal___, e_log_chat_type type);
+typedef bool (*HPMHOOK_pre_logs_should_log_item) (int *nameid, int *amount, int *refine, struct item_data **id);
+typedef bool (*HPMHOOK_post_logs_should_log_item) (bool retVal___, int nameid, int amount, int refine, struct item_data *id);
+#endif // MAP_LOG_H
+#ifdef LOGIN_LOGIN_H /* login */
+typedef int (*HPMHOOK_pre_login_mmo_auth) (struct login_session_data **sd, bool *isServer);
+typedef int (*HPMHOOK_post_login_mmo_auth) (int retVal___, struct login_session_data *sd, bool isServer);
+typedef int (*HPMHOOK_pre_login_mmo_auth_new) (const char **userid, const char **pass, const char *sex, const char **last_ip);
+typedef int (*HPMHOOK_post_login_mmo_auth_new) (int retVal___, const char *userid, const char *pass, const char sex, const char *last_ip);
+typedef int (*HPMHOOK_pre_login_waiting_disconnect_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_login_waiting_disconnect_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef struct DBData (*HPMHOOK_pre_login_create_online_user) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_login_create_online_user) (struct DBData retVal___, union DBKey key, va_list args);
+typedef struct online_login_data* (*HPMHOOK_pre_login_add_online_user) (int *char_server, int *account_id);
+typedef struct online_login_data* (*HPMHOOK_post_login_add_online_user) (struct online_login_data* retVal___, int char_server, int account_id);
+typedef void (*HPMHOOK_pre_login_remove_online_user) (int *account_id);
+typedef void (*HPMHOOK_post_login_remove_online_user) (int account_id);
+typedef int (*HPMHOOK_pre_login_online_db_setoffline) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_login_online_db_setoffline) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_login_online_data_cleanup_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_login_online_data_cleanup_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_login_online_data_cleanup) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_login_online_data_cleanup) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_login_sync_ip_addresses) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_login_sync_ip_addresses) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef bool (*HPMHOOK_pre_login_check_encrypted) (const char **str1, const char **str2, const char **passwd);
+typedef bool (*HPMHOOK_post_login_check_encrypted) (bool retVal___, const char *str1, const char *str2, const char *passwd);
+typedef bool (*HPMHOOK_pre_login_check_password) (const char **md5key, int *passwdenc, const char **passwd, const char **refpass);
+typedef bool (*HPMHOOK_post_login_check_password) (bool retVal___, const char *md5key, int passwdenc, const char *passwd, const char *refpass);
+typedef uint32 (*HPMHOOK_pre_login_lan_subnet_check) (uint32 *ip);
+typedef uint32 (*HPMHOOK_post_login_lan_subnet_check) (uint32 retVal___, uint32 ip);
+typedef void (*HPMHOOK_pre_login_fromchar_accinfo) (int *fd, int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd, struct mmo_account **acc);
+typedef void (*HPMHOOK_post_login_fromchar_accinfo) (int fd, int account_id, int u_fd, int u_aid, int u_group, int map_fd, struct mmo_account *acc);
+typedef void (*HPMHOOK_pre_login_fromchar_account) (int *fd, int *account_id, struct mmo_account **acc);
+typedef void (*HPMHOOK_post_login_fromchar_account) (int fd, int account_id, struct mmo_account *acc);
+typedef void (*HPMHOOK_pre_login_fromchar_account_update_other) (int *account_id, unsigned int *state);
+typedef void (*HPMHOOK_post_login_fromchar_account_update_other) (int account_id, unsigned int state);
+typedef void (*HPMHOOK_pre_login_fromchar_auth_ack) (int *fd, int *account_id, uint32 *login_id1, uint32 *login_id2, uint8 *sex, int *request_id, struct login_auth_node **node);
+typedef void (*HPMHOOK_post_login_fromchar_auth_ack) (int fd, int account_id, uint32 login_id1, uint32 login_id2, uint8 sex, int request_id, struct login_auth_node *node);
+typedef void (*HPMHOOK_pre_login_fromchar_ban) (int *account_id, time_t *timestamp);
+typedef void (*HPMHOOK_post_login_fromchar_ban) (int account_id, time_t timestamp);
+typedef void (*HPMHOOK_pre_login_fromchar_change_sex_other) (int *account_id, char *sex);
+typedef void (*HPMHOOK_post_login_fromchar_change_sex_other) (int account_id, char sex);
+typedef void (*HPMHOOK_pre_login_fromchar_pong) (int *fd);
+typedef void (*HPMHOOK_post_login_fromchar_pong) (int fd);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_auth) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_auth) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_update_users) (int *fd, int *id);
+typedef void (*HPMHOOK_post_login_fromchar_parse_update_users) (int fd, int id);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_request_change_email) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_request_change_email) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_account_data) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_account_data) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_ping) (int *fd);
+typedef void (*HPMHOOK_post_login_fromchar_parse_ping) (int fd);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_change_email) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_change_email) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_account_update) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_account_update) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_ban) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_ban) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_change_sex) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_change_sex) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_account_reg2) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_account_reg2) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_unban) (int *fd, int *id, const char **ip);
+typedef void (*HPMHOOK_post_login_fromchar_parse_unban) (int fd, int id, const char *ip);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_account_online) (int *fd, int *id);
+typedef void (*HPMHOOK_post_login_fromchar_parse_account_online) (int fd, int id);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_account_offline) (int *fd);
+typedef void (*HPMHOOK_post_login_fromchar_parse_account_offline) (int fd);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_online_accounts) (int *fd, int *id);
+typedef void (*HPMHOOK_post_login_fromchar_parse_online_accounts) (int fd, int id);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_request_account_reg2) (int *fd);
+typedef void (*HPMHOOK_post_login_fromchar_parse_request_account_reg2) (int fd);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_update_wan_ip) (int *fd, int *id);
+typedef void (*HPMHOOK_post_login_fromchar_parse_update_wan_ip) (int fd, int id);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_all_offline) (int *fd, int *id);
+typedef void (*HPMHOOK_post_login_fromchar_parse_all_offline) (int fd, int id);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_change_pincode) (int *fd);
+typedef void (*HPMHOOK_post_login_fromchar_parse_change_pincode) (int fd);
+typedef bool (*HPMHOOK_pre_login_fromchar_parse_wrong_pincode) (int *fd);
+typedef bool (*HPMHOOK_post_login_fromchar_parse_wrong_pincode) (bool retVal___, int fd);
+typedef void (*HPMHOOK_pre_login_fromchar_parse_accinfo) (int *fd);
+typedef void (*HPMHOOK_post_login_fromchar_parse_accinfo) (int fd);
+typedef int (*HPMHOOK_pre_login_parse_fromchar) (int *fd);
+typedef int (*HPMHOOK_post_login_parse_fromchar) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_login_kick) (struct login_session_data **sd);
+typedef void (*HPMHOOK_post_login_kick) (struct login_session_data *sd);
+typedef void (*HPMHOOK_pre_login_auth_ok) (struct login_session_data **sd);
+typedef void (*HPMHOOK_post_login_auth_ok) (struct login_session_data *sd);
+typedef void (*HPMHOOK_pre_login_auth_failed) (struct login_session_data **sd, int *result);
+typedef void (*HPMHOOK_post_login_auth_failed) (struct login_session_data *sd, int result);
+typedef bool (*HPMHOOK_pre_login_client_login) (int *fd, struct login_session_data **sd);
+typedef bool (*HPMHOOK_post_login_client_login) (bool retVal___, int fd, struct login_session_data *sd);
+typedef void (*HPMHOOK_pre_login_char_server_connection_status) (int *fd, struct login_session_data **sd, uint8 *status);
+typedef void (*HPMHOOK_post_login_char_server_connection_status) (int fd, struct login_session_data *sd, uint8 status);
+typedef void (*HPMHOOK_pre_login_parse_request_connection) (int *fd, struct login_session_data **sd, const char **ip, uint32 *ipl);
+typedef void (*HPMHOOK_post_login_parse_request_connection) (int fd, struct login_session_data *sd, const char *ip, uint32 ipl);
+typedef void (*HPMHOOK_pre_login_config_set_defaults) (void);
+typedef void (*HPMHOOK_post_login_config_set_defaults) (void);
+typedef bool (*HPMHOOK_pre_login_config_read) (const char **filename, bool *included);
+typedef bool (*HPMHOOK_post_login_config_read) (bool retVal___, const char *filename, bool included);
+#endif // LOGIN_LOGIN_H
+#ifdef CHAR_LOGINIF_H /* loginif */
+typedef void (*HPMHOOK_pre_loginif_init) (void);
+typedef void (*HPMHOOK_post_loginif_init) (void);
+typedef void (*HPMHOOK_pre_loginif_final) (void);
+typedef void (*HPMHOOK_post_loginif_final) (void);
+typedef void (*HPMHOOK_pre_loginif_reset) (void);
+typedef void (*HPMHOOK_post_loginif_reset) (void);
+typedef void (*HPMHOOK_pre_loginif_check_shutdown) (void);
+typedef void (*HPMHOOK_post_loginif_check_shutdown) (void);
+typedef void (*HPMHOOK_pre_loginif_on_disconnect) (void);
+typedef void (*HPMHOOK_post_loginif_on_disconnect) (void);
+typedef void (*HPMHOOK_pre_loginif_on_ready) (void);
+typedef void (*HPMHOOK_post_loginif_on_ready) (void);
+typedef void (*HPMHOOK_pre_loginif_block_account) (int *account_id, int *flag);
+typedef void (*HPMHOOK_post_loginif_block_account) (int account_id, int flag);
+typedef void (*HPMHOOK_pre_loginif_ban_account) (int *account_id, short *year, short *month, short *day, short *hour, short *minute, short *second);
+typedef void (*HPMHOOK_post_loginif_ban_account) (int account_id, short year, short month, short day, short hour, short minute, short second);
+typedef void (*HPMHOOK_pre_loginif_unban_account) (int *account_id);
+typedef void (*HPMHOOK_post_loginif_unban_account) (int account_id);
+typedef void (*HPMHOOK_pre_loginif_changesex) (int *account_id);
+typedef void (*HPMHOOK_post_loginif_changesex) (int account_id);
+typedef void (*HPMHOOK_pre_loginif_auth) (int *fd, struct char_session_data **sd, uint32 *ipl);
+typedef void (*HPMHOOK_post_loginif_auth) (int fd, struct char_session_data *sd, uint32 ipl);
+typedef void (*HPMHOOK_pre_loginif_send_users_count) (int *users);
+typedef void (*HPMHOOK_post_loginif_send_users_count) (int users);
+typedef void (*HPMHOOK_pre_loginif_connect_to_server) (void);
+typedef void (*HPMHOOK_post_loginif_connect_to_server) (void);
+#endif // CHAR_LOGINIF_H
+#ifdef MAP_MAIL_H /* mail */
+typedef void (*HPMHOOK_pre_mail_clear) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_mail_clear) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_mail_removeitem) (struct map_session_data **sd, short *flag);
+typedef int (*HPMHOOK_post_mail_removeitem) (int retVal___, struct map_session_data *sd, short flag);
+typedef int (*HPMHOOK_pre_mail_removezeny) (struct map_session_data **sd, short *flag);
+typedef int (*HPMHOOK_post_mail_removezeny) (int retVal___, struct map_session_data *sd, short flag);
+typedef unsigned char (*HPMHOOK_pre_mail_setitem) (struct map_session_data **sd, int *idx, int *amount);
+typedef unsigned char (*HPMHOOK_post_mail_setitem) (unsigned char retVal___, struct map_session_data *sd, int idx, int amount);
+typedef bool (*HPMHOOK_pre_mail_setattachment) (struct map_session_data **sd, struct mail_message **msg);
+typedef bool (*HPMHOOK_post_mail_setattachment) (bool retVal___, struct map_session_data *sd, struct mail_message *msg);
+typedef void (*HPMHOOK_pre_mail_getattachment) (struct map_session_data **sd, int *zeny, struct item **item);
+typedef void (*HPMHOOK_post_mail_getattachment) (struct map_session_data *sd, int zeny, struct item *item);
+typedef int (*HPMHOOK_pre_mail_openmail) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_mail_openmail) (int retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_mail_deliveryfail) (struct map_session_data **sd, struct mail_message **msg);
+typedef void (*HPMHOOK_post_mail_deliveryfail) (struct map_session_data *sd, struct mail_message *msg);
+typedef bool (*HPMHOOK_pre_mail_invalid_operation) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_mail_invalid_operation) (bool retVal___, struct map_session_data *sd);
+#endif // MAP_MAIL_H
+#ifdef MAP_MAP_H /* map */
+typedef void (*HPMHOOK_pre_map_zone_init) (void);
+typedef void (*HPMHOOK_post_map_zone_init) (void);
+typedef void (*HPMHOOK_pre_map_zone_remove) (int *m);
+typedef void (*HPMHOOK_post_map_zone_remove) (int m);
+typedef void (*HPMHOOK_pre_map_zone_apply) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath);
+typedef void (*HPMHOOK_post_map_zone_apply) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
+typedef void (*HPMHOOK_pre_map_zone_change) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath);
+typedef void (*HPMHOOK_post_map_zone_change) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
+typedef void (*HPMHOOK_pre_map_zone_change2) (int *m, struct map_zone_data **zone);
+typedef void (*HPMHOOK_post_map_zone_change2) (int m, struct map_zone_data *zone);
+typedef int (*HPMHOOK_pre_map_getcell) (int16 *m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk);
+typedef int (*HPMHOOK_post_map_getcell) (int retVal___, int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
+typedef void (*HPMHOOK_pre_map_setgatcell) (int16 *m, int16 *x, int16 *y, int *gat);
+typedef void (*HPMHOOK_post_map_setgatcell) (int16 m, int16 x, int16 y, int gat);
+typedef void (*HPMHOOK_pre_map_cellfromcache) (struct map_data **m);
+typedef void (*HPMHOOK_post_map_cellfromcache) (struct map_data *m);
+typedef void (*HPMHOOK_pre_map_setusers) (int *p1);
+typedef void (*HPMHOOK_post_map_setusers) (int p1);
+typedef int (*HPMHOOK_pre_map_getusers) (void);
+typedef int (*HPMHOOK_post_map_getusers) (int retVal___);
+typedef int (*HPMHOOK_pre_map_usercount) (void);
+typedef int (*HPMHOOK_post_map_usercount) (int retVal___);
+typedef int (*HPMHOOK_pre_map_freeblock) (struct block_list **bl);
+typedef int (*HPMHOOK_post_map_freeblock) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_map_freeblock_lock) (void);
+typedef int (*HPMHOOK_post_map_freeblock_lock) (int retVal___);
+typedef int (*HPMHOOK_pre_map_freeblock_unlock) (void);
+typedef int (*HPMHOOK_post_map_freeblock_unlock) (int retVal___);
+typedef int (*HPMHOOK_pre_map_addblock) (struct block_list **bl);
+typedef int (*HPMHOOK_post_map_addblock) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_map_delblock) (struct block_list **bl);
+typedef int (*HPMHOOK_post_map_delblock) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_map_moveblock) (struct block_list **bl, int *x1, int *y1, int64 *tick);
+typedef int (*HPMHOOK_post_map_moveblock) (int retVal___, struct block_list *bl, int x1, int y1, int64 tick);
+typedef int (*HPMHOOK_pre_map_count_oncell) (int16 *m, int16 *x, int16 *y, int *type, int *flag);
+typedef int (*HPMHOOK_post_map_count_oncell) (int retVal___, int16 m, int16 x, int16 y, int type, int flag);
+typedef struct skill_unit* (*HPMHOOK_pre_map_find_skill_unit_oncell) (struct block_list **target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit **out_unit, int *flag);
+typedef struct skill_unit* (*HPMHOOK_post_map_find_skill_unit_oncell) (struct skill_unit* retVal___, struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag);
+typedef int (*HPMHOOK_pre_map_get_new_object_id) (void);
+typedef int (*HPMHOOK_post_map_get_new_object_id) (int retVal___);
+typedef int (*HPMHOOK_pre_map_search_freecell) (struct block_list **src, int16 *m, int16 **x, int16 **y, int16 *rx, int16 *ry, int *flag);
+typedef int (*HPMHOOK_post_map_search_freecell) (int retVal___, struct block_list *src, int16 m, int16 *x, int16 *y, int16 rx, int16 ry, int flag);
+typedef bool (*HPMHOOK_pre_map_closest_freecell) (int16 *m, const struct block_list **bl, int16 **x, int16 **y, int *type, int *flag);
+typedef bool (*HPMHOOK_post_map_closest_freecell) (bool retVal___, int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag);
+typedef int (*HPMHOOK_pre_map_quit) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_map_quit) (int retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_map_addnpc) (int16 *m, struct npc_data **nd);
+typedef bool (*HPMHOOK_post_map_addnpc) (bool retVal___, int16 m, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_map_clearflooritem_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_map_clearflooritem_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_map_removemobs_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_map_removemobs_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_map_clearflooritem) (struct block_list **bl);
+typedef void (*HPMHOOK_post_map_clearflooritem) (struct block_list *bl);
+typedef int (*HPMHOOK_pre_map_addflooritem) (const struct block_list **bl, struct item **item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
+typedef int (*HPMHOOK_post_map_addflooritem) (int retVal___, const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags);
+typedef void (*HPMHOOK_pre_map_addnickdb) (int *charid, const char **nick);
+typedef void (*HPMHOOK_post_map_addnickdb) (int charid, const char *nick);
+typedef void (*HPMHOOK_pre_map_delnickdb) (int *charid, const char **nick);
+typedef void (*HPMHOOK_post_map_delnickdb) (int charid, const char *nick);
+typedef void (*HPMHOOK_pre_map_reqnickdb) (struct map_session_data **sd, int *charid);
+typedef void (*HPMHOOK_post_map_reqnickdb) (struct map_session_data *sd, int charid);
+typedef const char* (*HPMHOOK_pre_map_charid2nick) (int *charid);
+typedef const char* (*HPMHOOK_post_map_charid2nick) (const char* retVal___, int charid);
+typedef struct map_session_data* (*HPMHOOK_pre_map_charid2sd) (int *charid);
+typedef struct map_session_data* (*HPMHOOK_post_map_charid2sd) (struct map_session_data* retVal___, int charid);
+typedef void (*HPMHOOK_pre_map_vforeachpc) (int ( **func ) (struct map_session_data *sd, va_list args), va_list args);
+typedef void (*HPMHOOK_post_map_vforeachpc) (int ( *func ) (struct map_session_data *sd, va_list args), va_list args);
+typedef void (*HPMHOOK_pre_map_vforeachmob) (int ( **func ) (struct mob_data *md, va_list args), va_list args);
+typedef void (*HPMHOOK_post_map_vforeachmob) (int ( *func ) (struct mob_data *md, va_list args), va_list args);
+typedef void (*HPMHOOK_pre_map_vforeachnpc) (int ( **func ) (struct npc_data *nd, va_list args), va_list args);
+typedef void (*HPMHOOK_post_map_vforeachnpc) (int ( *func ) (struct npc_data *nd, va_list args), va_list args);
+typedef void (*HPMHOOK_pre_map_vforeachregen) (int ( **func ) (struct block_list *bl, va_list args), va_list args);
+typedef void (*HPMHOOK_post_map_vforeachregen) (int ( *func ) (struct block_list *bl, va_list args), va_list args);
+typedef void (*HPMHOOK_pre_map_vforeachiddb) (int ( **func ) (struct block_list *bl, va_list args), va_list args);
+typedef void (*HPMHOOK_post_map_vforeachiddb) (int ( *func ) (struct block_list *bl, va_list args), va_list args);
+typedef int (*HPMHOOK_pre_map_vforeachinrange) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachinrange) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforeachinshootrange) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachinshootrange) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforeachinarea) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachinarea) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforcountinrange) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int *count, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforcountinrange) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int count, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforcountinarea) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *count, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforcountinarea) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int count, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforeachinmovearea) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int16 *dx, int16 *dy, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachinmovearea) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int16 dx, int16 dy, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforeachincell) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x, int16 *y, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachincell) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x, int16 y, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforeachinpath) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int16 *range, int *length, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachinpath) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int16 range, int length, int type, va_list ap);
+typedef int (*HPMHOOK_pre_map_vforeachinmap) (int ( **func ) (struct block_list *, va_list), int16 *m, int *type, va_list args);
+typedef int (*HPMHOOK_post_map_vforeachinmap) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int type, va_list args);
+typedef int (*HPMHOOK_pre_map_vforeachininstance) (int ( **func ) (struct block_list *, va_list), int16 *instance_id, int *type, va_list ap);
+typedef int (*HPMHOOK_post_map_vforeachininstance) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 instance_id, int type, va_list ap);
+typedef struct map_session_data* (*HPMHOOK_pre_map_id2sd) (int *id);
+typedef struct map_session_data* (*HPMHOOK_post_map_id2sd) (struct map_session_data* retVal___, int id);
+typedef struct npc_data* (*HPMHOOK_pre_map_id2nd) (int *id);
+typedef struct npc_data* (*HPMHOOK_post_map_id2nd) (struct npc_data* retVal___, int id);
+typedef struct mob_data* (*HPMHOOK_pre_map_id2md) (int *id);
+typedef struct mob_data* (*HPMHOOK_post_map_id2md) (struct mob_data* retVal___, int id);
+typedef struct flooritem_data* (*HPMHOOK_pre_map_id2fi) (int *id);
+typedef struct flooritem_data* (*HPMHOOK_post_map_id2fi) (struct flooritem_data* retVal___, int id);
+typedef struct chat_data* (*HPMHOOK_pre_map_id2cd) (int *id);
+typedef struct chat_data* (*HPMHOOK_post_map_id2cd) (struct chat_data* retVal___, int id);
+typedef struct skill_unit* (*HPMHOOK_pre_map_id2su) (int *id);
+typedef struct skill_unit* (*HPMHOOK_post_map_id2su) (struct skill_unit* retVal___, int id);
+typedef struct pet_data* (*HPMHOOK_pre_map_id2pd) (int *id);
+typedef struct pet_data* (*HPMHOOK_post_map_id2pd) (struct pet_data* retVal___, int id);
+typedef struct homun_data* (*HPMHOOK_pre_map_id2hd) (int *id);
+typedef struct homun_data* (*HPMHOOK_post_map_id2hd) (struct homun_data* retVal___, int id);
+typedef struct mercenary_data* (*HPMHOOK_pre_map_id2mc) (int *id);
+typedef struct mercenary_data* (*HPMHOOK_post_map_id2mc) (struct mercenary_data* retVal___, int id);
+typedef struct elemental_data* (*HPMHOOK_pre_map_id2ed) (int *id);
+typedef struct elemental_data* (*HPMHOOK_post_map_id2ed) (struct elemental_data* retVal___, int id);
+typedef struct block_list* (*HPMHOOK_pre_map_id2bl) (int *id);
+typedef struct block_list* (*HPMHOOK_post_map_id2bl) (struct block_list* retVal___, int id);
+typedef bool (*HPMHOOK_pre_map_blid_exists) (int *id);
+typedef bool (*HPMHOOK_post_map_blid_exists) (bool retVal___, int id);
+typedef int16 (*HPMHOOK_pre_map_mapindex2mapid) (unsigned short *map_index);
+typedef int16 (*HPMHOOK_post_map_mapindex2mapid) (int16 retVal___, unsigned short map_index);
+typedef int16 (*HPMHOOK_pre_map_mapname2mapid) (const char **name);
+typedef int16 (*HPMHOOK_post_map_mapname2mapid) (int16 retVal___, const char *name);
+typedef int (*HPMHOOK_pre_map_mapname2ipport) (unsigned short *name, uint32 **ip, uint16 **port);
+typedef int (*HPMHOOK_post_map_mapname2ipport) (int retVal___, unsigned short name, uint32 *ip, uint16 *port);
+typedef int (*HPMHOOK_pre_map_setipport) (unsigned short *map_index, uint32 *ip, uint16 *port);
+typedef int (*HPMHOOK_post_map_setipport) (int retVal___, unsigned short map_index, uint32 ip, uint16 port);
+typedef int (*HPMHOOK_pre_map_eraseipport) (unsigned short *map_index, uint32 *ip, uint16 *port);
+typedef int (*HPMHOOK_post_map_eraseipport) (int retVal___, unsigned short map_index, uint32 ip, uint16 port);
+typedef int (*HPMHOOK_pre_map_eraseallipport) (void);
+typedef int (*HPMHOOK_post_map_eraseallipport) (int retVal___);
+typedef void (*HPMHOOK_pre_map_addiddb) (struct block_list **bl);
+typedef void (*HPMHOOK_post_map_addiddb) (struct block_list *bl);
+typedef void (*HPMHOOK_pre_map_deliddb) (struct block_list **bl);
+typedef void (*HPMHOOK_post_map_deliddb) (struct block_list *bl);
+typedef struct map_session_data* (*HPMHOOK_pre_map_nick2sd) (const char **nick);
+typedef struct map_session_data* (*HPMHOOK_post_map_nick2sd) (struct map_session_data* retVal___, const char *nick);
+typedef struct mob_data* (*HPMHOOK_pre_map_getmob_boss) (int16 *m);
+typedef struct mob_data* (*HPMHOOK_post_map_getmob_boss) (struct mob_data* retVal___, int16 m);
+typedef struct mob_data* (*HPMHOOK_pre_map_id2boss) (int *id);
+typedef struct mob_data* (*HPMHOOK_post_map_id2boss) (struct mob_data* retVal___, int id);
+typedef uint32 (*HPMHOOK_pre_map_race_id2mask) (int *race);
+typedef uint32 (*HPMHOOK_post_map_race_id2mask) (uint32 retVal___, int race);
+typedef void (*HPMHOOK_pre_map_reloadnpc) (bool *clear);
+typedef void (*HPMHOOK_post_map_reloadnpc) (bool clear);
+typedef int (*HPMHOOK_pre_map_check_dir) (int *s_dir, int *t_dir);
+typedef int (*HPMHOOK_post_map_check_dir) (int retVal___, int s_dir, int t_dir);
+typedef uint8 (*HPMHOOK_pre_map_calc_dir) (struct block_list **src, int16 *x, int16 *y);
+typedef uint8 (*HPMHOOK_post_map_calc_dir) (uint8 retVal___, struct block_list *src, int16 x, int16 y);
+typedef int (*HPMHOOK_pre_map_random_dir) (struct block_list **bl, short **x, short **y);
+typedef int (*HPMHOOK_post_map_random_dir) (int retVal___, struct block_list *bl, short *x, short *y);
+typedef int (*HPMHOOK_pre_map_cleanup_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_map_cleanup_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_map_delmap) (const char **mapname);
+typedef int (*HPMHOOK_post_map_delmap) (int retVal___, const char *mapname);
+typedef void (*HPMHOOK_pre_map_flags_init) (void);
+typedef void (*HPMHOOK_post_map_flags_init) (void);
+typedef bool (*HPMHOOK_pre_map_iwall_set) (int16 *m, int16 *x, int16 *y, int *size, int8 *dir, bool *shootable, const char **wall_name);
+typedef bool (*HPMHOOK_post_map_iwall_set) (bool retVal___, int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char *wall_name);
+typedef void (*HPMHOOK_pre_map_iwall_get) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_map_iwall_get) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_map_iwall_remove) (const char **wall_name);
+typedef void (*HPMHOOK_post_map_iwall_remove) (const char *wall_name);
+typedef int (*HPMHOOK_pre_map_addmobtolist) (unsigned short *m, struct spawn_data **spawn);
+typedef int (*HPMHOOK_post_map_addmobtolist) (int retVal___, unsigned short m, struct spawn_data *spawn);
+typedef void (*HPMHOOK_pre_map_spawnmobs) (int16 *m);
+typedef void (*HPMHOOK_post_map_spawnmobs) (int16 m);
+typedef void (*HPMHOOK_pre_map_removemobs) (int16 *m);
+typedef void (*HPMHOOK_post_map_removemobs) (int16 m);
+typedef void (*HPMHOOK_pre_map_addmap2db) (struct map_data **m);
+typedef void (*HPMHOOK_post_map_addmap2db) (struct map_data *m);
+typedef void (*HPMHOOK_pre_map_removemapdb) (struct map_data **m);
+typedef void (*HPMHOOK_post_map_removemapdb) (struct map_data *m);
+typedef void (*HPMHOOK_pre_map_clean) (int *i);
+typedef void (*HPMHOOK_post_map_clean) (int i);
+typedef void (*HPMHOOK_pre_map_do_shutdown) (void);
+typedef void (*HPMHOOK_post_map_do_shutdown) (void);
+typedef int (*HPMHOOK_pre_map_freeblock_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_map_freeblock_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_map_searchrandfreecell) (int16 *m, const struct block_list **bl, int16 **x, int16 **y, int *stack);
+typedef int (*HPMHOOK_post_map_searchrandfreecell) (int retVal___, int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack);
+typedef int (*HPMHOOK_pre_map_count_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_map_count_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef struct DBData (*HPMHOOK_pre_map_create_charid2nick) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_map_create_charid2nick) (struct DBData retVal___, union DBKey key, va_list args);
+typedef int (*HPMHOOK_pre_map_removemobs_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_map_removemobs_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef struct mapcell (*HPMHOOK_pre_map_gat2cell) (int *gat);
+typedef struct mapcell (*HPMHOOK_post_map_gat2cell) (struct mapcell retVal___, int gat);
+typedef int (*HPMHOOK_pre_map_cell2gat) (struct mapcell *cell);
+typedef int (*HPMHOOK_post_map_cell2gat) (int retVal___, struct mapcell cell);
+typedef int (*HPMHOOK_pre_map_getcellp) (struct map_data **m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk);
+typedef int (*HPMHOOK_post_map_getcellp) (int retVal___, struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
+typedef void (*HPMHOOK_pre_map_setcell) (int16 *m, int16 *x, int16 *y, cell_t *cell, bool *flag);
+typedef void (*HPMHOOK_post_map_setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
+typedef int (*HPMHOOK_pre_map_sub_getcellp) (struct map_data **m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk);
+typedef int (*HPMHOOK_post_map_sub_getcellp) (int retVal___, struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
+typedef void (*HPMHOOK_pre_map_sub_setcell) (int16 *m, int16 *x, int16 *y, cell_t *cell, bool *flag);
+typedef void (*HPMHOOK_post_map_sub_setcell) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
+typedef void (*HPMHOOK_pre_map_iwall_nextxy) (int16 *x, int16 *y, int8 *dir, int *pos, int16 **x1, int16 **y1);
+typedef void (*HPMHOOK_post_map_iwall_nextxy) (int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1);
+typedef struct DBData (*HPMHOOK_pre_map_create_map_data_other_server) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_map_create_map_data_other_server) (struct DBData retVal___, union DBKey key, va_list args);
+typedef int (*HPMHOOK_pre_map_eraseallipport_sub) (union DBKey *key, struct DBData **data, va_list va);
+typedef int (*HPMHOOK_post_map_eraseallipport_sub) (int retVal___, union DBKey key, struct DBData *data, va_list va);
+typedef char* (*HPMHOOK_pre_map_init_mapcache) (FILE **fp);
+typedef char* (*HPMHOOK_post_map_init_mapcache) (char* retVal___, FILE *fp);
+typedef int (*HPMHOOK_pre_map_readfromcache) (struct map_data **m, char **buffer);
+typedef int (*HPMHOOK_post_map_readfromcache) (int retVal___, struct map_data *m, char *buffer);
+typedef int (*HPMHOOK_pre_map_addmap) (const char **mapname);
+typedef int (*HPMHOOK_post_map_addmap) (int retVal___, const char *mapname);
+typedef void (*HPMHOOK_pre_map_delmapid) (int *id);
+typedef void (*HPMHOOK_post_map_delmapid) (int id);
+typedef void (*HPMHOOK_pre_map_zone_db_clear) (void);
+typedef void (*HPMHOOK_post_map_zone_db_clear) (void);
+typedef void (*HPMHOOK_pre_map_list_final) (void);
+typedef void (*HPMHOOK_post_map_list_final) (void);
+typedef int (*HPMHOOK_pre_map_waterheight) (char **mapname);
+typedef int (*HPMHOOK_post_map_waterheight) (int retVal___, char *mapname);
+typedef int (*HPMHOOK_pre_map_readgat) (struct map_data **m);
+typedef int (*HPMHOOK_post_map_readgat) (int retVal___, struct map_data *m);
+typedef int (*HPMHOOK_pre_map_readallmaps) (void);
+typedef int (*HPMHOOK_post_map_readallmaps) (int retVal___);
+typedef bool (*HPMHOOK_pre_map_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_map_config_read) (bool retVal___, const char *filename, bool imported);
+typedef bool (*HPMHOOK_pre_map_read_npclist) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_map_read_npclist) (bool retVal___, const char *filename, bool imported);
+typedef bool (*HPMHOOK_pre_map_inter_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_map_inter_config_read) (bool retVal___, const char *filename, bool imported);
+typedef bool (*HPMHOOK_pre_map_inter_config_read_database_names) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_map_inter_config_read_database_names) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef bool (*HPMHOOK_pre_map_inter_config_read_connection) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_map_inter_config_read_connection) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+typedef int (*HPMHOOK_pre_map_sql_init) (void);
+typedef int (*HPMHOOK_post_map_sql_init) (int retVal___);
+typedef int (*HPMHOOK_pre_map_sql_close) (void);
+typedef int (*HPMHOOK_post_map_sql_close) (int retVal___);
+typedef bool (*HPMHOOK_pre_map_zone_mf_cache) (int *m, char **flag, char **params);
+typedef bool (*HPMHOOK_post_map_zone_mf_cache) (bool retVal___, int m, char *flag, char *params);
+typedef unsigned short (*HPMHOOK_pre_map_zone_str2itemid) (const char **name);
+typedef unsigned short (*HPMHOOK_post_map_zone_str2itemid) (unsigned short retVal___, const char *name);
+typedef unsigned short (*HPMHOOK_pre_map_zone_str2skillid) (const char **name);
+typedef unsigned short (*HPMHOOK_post_map_zone_str2skillid) (unsigned short retVal___, const char *name);
+typedef enum bl_type (*HPMHOOK_pre_map_zone_bl_type) (const char **entry, enum map_zone_skill_subtype **subtype);
+typedef enum bl_type (*HPMHOOK_post_map_zone_bl_type) (enum bl_type retVal___, const char *entry, enum map_zone_skill_subtype *subtype);
+typedef void (*HPMHOOK_pre_map_read_zone_db) (void);
+typedef void (*HPMHOOK_post_map_read_zone_db) (void);
+typedef int (*HPMHOOK_pre_map_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_map_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_map_nick_db_final) (union DBKey *key, struct DBData **data, va_list args);
+typedef int (*HPMHOOK_post_map_nick_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+typedef int (*HPMHOOK_pre_map_cleanup_db_sub) (union DBKey *key, struct DBData **data, va_list va);
+typedef int (*HPMHOOK_post_map_cleanup_db_sub) (int retVal___, union DBKey key, struct DBData *data, va_list va);
+typedef int (*HPMHOOK_pre_map_abort_sub) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_map_abort_sub) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef void (*HPMHOOK_pre_map_update_cell_bl) (struct block_list **bl, bool *increase);
+typedef void (*HPMHOOK_post_map_update_cell_bl) (struct block_list *bl, bool increase);
+typedef int (*HPMHOOK_pre_map_get_new_bonus_id) (void);
+typedef int (*HPMHOOK_post_map_get_new_bonus_id) (int retVal___);
+typedef void (*HPMHOOK_pre_map_add_questinfo) (int *m, struct questinfo **qi);
+typedef void (*HPMHOOK_post_map_add_questinfo) (int m, struct questinfo *qi);
+typedef bool (*HPMHOOK_pre_map_remove_questinfo) (int *m, struct npc_data **nd);
+typedef bool (*HPMHOOK_post_map_remove_questinfo) (bool retVal___, int m, struct npc_data *nd);
+typedef struct map_zone_data* (*HPMHOOK_pre_map_merge_zone) (struct map_zone_data **main, struct map_zone_data **other);
+typedef struct map_zone_data* (*HPMHOOK_post_map_merge_zone) (struct map_zone_data* retVal___, struct map_zone_data *main, struct map_zone_data *other);
+typedef void (*HPMHOOK_pre_map_zone_clear_single) (struct map_zone_data **zone);
+typedef void (*HPMHOOK_post_map_zone_clear_single) (struct map_zone_data *zone);
+#endif // MAP_MAP_H
+#ifdef CHAR_MAPIF_H /* mapif */
+typedef void (*HPMHOOK_pre_mapif_ban) (int *id, unsigned int *flag, int *status);
+typedef void (*HPMHOOK_post_mapif_ban) (int id, unsigned int flag, int status);
+typedef void (*HPMHOOK_pre_mapif_server_init) (int *id);
+typedef void (*HPMHOOK_post_mapif_server_init) (int id);
+typedef void (*HPMHOOK_pre_mapif_server_destroy) (int *id);
+typedef void (*HPMHOOK_post_mapif_server_destroy) (int id);
+typedef void (*HPMHOOK_pre_mapif_server_reset) (int *id);
+typedef void (*HPMHOOK_post_mapif_server_reset) (int id);
+typedef void (*HPMHOOK_pre_mapif_on_disconnect) (int *id);
+typedef void (*HPMHOOK_post_mapif_on_disconnect) (int id);
+typedef void (*HPMHOOK_pre_mapif_on_parse_accinfo) (int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd);
+typedef void (*HPMHOOK_post_mapif_on_parse_accinfo) (int account_id, int u_fd, int u_aid, int u_group, int map_fd);
+typedef void (*HPMHOOK_pre_mapif_char_ban) (int *char_id, time_t *timestamp);
+typedef void (*HPMHOOK_post_mapif_char_ban) (int char_id, time_t timestamp);
+typedef int (*HPMHOOK_pre_mapif_sendall) (const unsigned char **buf, unsigned int *len);
+typedef int (*HPMHOOK_post_mapif_sendall) (int retVal___, const unsigned char *buf, unsigned int len);
+typedef int (*HPMHOOK_pre_mapif_sendallwos) (int *sfd, unsigned char **buf, unsigned int *len);
+typedef int (*HPMHOOK_post_mapif_sendallwos) (int retVal___, int sfd, unsigned char *buf, unsigned int len);
+typedef int (*HPMHOOK_pre_mapif_send) (int *fd, unsigned char **buf, unsigned int *len);
+typedef int (*HPMHOOK_post_mapif_send) (int retVal___, int fd, unsigned char *buf, unsigned int len);
+typedef void (*HPMHOOK_pre_mapif_send_users_count) (int *users);
+typedef void (*HPMHOOK_post_mapif_send_users_count) (int users);
+typedef void (*HPMHOOK_pre_mapif_auction_message) (int *char_id, unsigned char *result);
+typedef void (*HPMHOOK_post_mapif_auction_message) (int char_id, unsigned char result);
+typedef void (*HPMHOOK_pre_mapif_auction_sendlist) (int *fd, int *char_id, short *count, short *pages, unsigned char **buf);
+typedef void (*HPMHOOK_post_mapif_auction_sendlist) (int fd, int char_id, short count, short pages, unsigned char *buf);
+typedef void (*HPMHOOK_pre_mapif_parse_auction_requestlist) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_auction_requestlist) (int fd);
+typedef void (*HPMHOOK_pre_mapif_auction_register) (int *fd, struct auction_data **auction);
+typedef void (*HPMHOOK_post_mapif_auction_register) (int fd, struct auction_data *auction);
+typedef void (*HPMHOOK_pre_mapif_parse_auction_register) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_auction_register) (int fd);
+typedef void (*HPMHOOK_pre_mapif_auction_cancel) (int *fd, int *char_id, unsigned char *result);
+typedef void (*HPMHOOK_post_mapif_auction_cancel) (int fd, int char_id, unsigned char result);
+typedef void (*HPMHOOK_pre_mapif_parse_auction_cancel) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_auction_cancel) (int fd);
+typedef void (*HPMHOOK_pre_mapif_auction_close) (int *fd, int *char_id, unsigned char *result);
+typedef void (*HPMHOOK_post_mapif_auction_close) (int fd, int char_id, unsigned char result);
+typedef void (*HPMHOOK_pre_mapif_parse_auction_close) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_auction_close) (int fd);
+typedef void (*HPMHOOK_pre_mapif_auction_bid) (int *fd, int *char_id, int *bid, unsigned char *result);
+typedef void (*HPMHOOK_post_mapif_auction_bid) (int fd, int char_id, int bid, unsigned char result);
+typedef void (*HPMHOOK_pre_mapif_parse_auction_bid) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_auction_bid) (int fd);
+typedef bool (*HPMHOOK_pre_mapif_elemental_create) (struct s_elemental **ele);
+typedef bool (*HPMHOOK_post_mapif_elemental_create) (bool retVal___, struct s_elemental *ele);
+typedef bool (*HPMHOOK_pre_mapif_elemental_save) (const struct s_elemental **ele);
+typedef bool (*HPMHOOK_post_mapif_elemental_save) (bool retVal___, const struct s_elemental *ele);
+typedef bool (*HPMHOOK_pre_mapif_elemental_load) (int *ele_id, int *char_id, struct s_elemental **ele);
+typedef bool (*HPMHOOK_post_mapif_elemental_load) (bool retVal___, int ele_id, int char_id, struct s_elemental *ele);
+typedef bool (*HPMHOOK_pre_mapif_elemental_delete) (int *ele_id);
+typedef bool (*HPMHOOK_post_mapif_elemental_delete) (bool retVal___, int ele_id);
+typedef void (*HPMHOOK_pre_mapif_elemental_send) (int *fd, struct s_elemental **ele, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_elemental_send) (int fd, struct s_elemental *ele, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_parse_elemental_create) (int *fd, const struct s_elemental **ele);
+typedef void (*HPMHOOK_post_mapif_parse_elemental_create) (int fd, const struct s_elemental *ele);
+typedef void (*HPMHOOK_pre_mapif_parse_elemental_load) (int *fd, int *ele_id, int *char_id);
+typedef void (*HPMHOOK_post_mapif_parse_elemental_load) (int fd, int ele_id, int char_id);
+typedef void (*HPMHOOK_pre_mapif_elemental_deleted) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_elemental_deleted) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_parse_elemental_delete) (int *fd, int *ele_id);
+typedef void (*HPMHOOK_post_mapif_parse_elemental_delete) (int fd, int ele_id);
+typedef void (*HPMHOOK_pre_mapif_elemental_saved) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_elemental_saved) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_parse_elemental_save) (int *fd, const struct s_elemental **ele);
+typedef void (*HPMHOOK_post_mapif_parse_elemental_save) (int fd, const struct s_elemental *ele);
+typedef int (*HPMHOOK_pre_mapif_guild_created) (int *fd, int *account_id, struct guild **g);
+typedef int (*HPMHOOK_post_mapif_guild_created) (int retVal___, int fd, int account_id, struct guild *g);
+typedef int (*HPMHOOK_pre_mapif_guild_noinfo) (int *fd, int *guild_id);
+typedef int (*HPMHOOK_post_mapif_guild_noinfo) (int retVal___, int fd, int guild_id);
+typedef int (*HPMHOOK_pre_mapif_guild_info) (int *fd, struct guild **g);
+typedef int (*HPMHOOK_post_mapif_guild_info) (int retVal___, int fd, struct guild *g);
+typedef int (*HPMHOOK_pre_mapif_guild_memberadded) (int *fd, int *guild_id, int *account_id, int *char_id, int *flag);
+typedef int (*HPMHOOK_post_mapif_guild_memberadded) (int retVal___, int fd, int guild_id, int account_id, int char_id, int flag);
+typedef int (*HPMHOOK_pre_mapif_guild_withdraw) (int *guild_id, int *account_id, int *char_id, int *flag, const char **name, const char **mes);
+typedef int (*HPMHOOK_post_mapif_guild_withdraw) (int retVal___, int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
+typedef int (*HPMHOOK_pre_mapif_guild_memberinfoshort) (struct guild **g, int *idx);
+typedef int (*HPMHOOK_post_mapif_guild_memberinfoshort) (int retVal___, struct guild *g, int idx);
+typedef int (*HPMHOOK_pre_mapif_guild_broken) (int *guild_id, int *flag);
+typedef int (*HPMHOOK_post_mapif_guild_broken) (int retVal___, int guild_id, int flag);
+typedef int (*HPMHOOK_pre_mapif_guild_message) (int *guild_id, int *account_id, const char **mes, int *len, int *sfd);
+typedef int (*HPMHOOK_post_mapif_guild_message) (int retVal___, int guild_id, int account_id, const char *mes, int len, int sfd);
+typedef int (*HPMHOOK_pre_mapif_guild_basicinfochanged) (int *guild_id, int *type, const void **data, int *len);
+typedef int (*HPMHOOK_post_mapif_guild_basicinfochanged) (int retVal___, int guild_id, int type, const void *data, int len);
+typedef int (*HPMHOOK_pre_mapif_guild_memberinfochanged) (int *guild_id, int *account_id, int *char_id, int *type, const void **data, int *len);
+typedef int (*HPMHOOK_post_mapif_guild_memberinfochanged) (int retVal___, int guild_id, int account_id, int char_id, int type, const void *data, int len);
+typedef int (*HPMHOOK_pre_mapif_guild_skillupack) (int *guild_id, uint16 *skill_id, int *account_id);
+typedef int (*HPMHOOK_post_mapif_guild_skillupack) (int retVal___, int guild_id, uint16 skill_id, int account_id);
+typedef int (*HPMHOOK_pre_mapif_guild_alliance) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char **name1, const char **name2);
+typedef int (*HPMHOOK_post_mapif_guild_alliance) (int retVal___, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2);
+typedef int (*HPMHOOK_pre_mapif_guild_position) (struct guild **g, int *idx);
+typedef int (*HPMHOOK_post_mapif_guild_position) (int retVal___, struct guild *g, int idx);
+typedef int (*HPMHOOK_pre_mapif_guild_notice) (struct guild **g);
+typedef int (*HPMHOOK_post_mapif_guild_notice) (int retVal___, struct guild *g);
+typedef int (*HPMHOOK_pre_mapif_guild_emblem) (struct guild **g);
+typedef int (*HPMHOOK_post_mapif_guild_emblem) (int retVal___, struct guild *g);
+typedef int (*HPMHOOK_pre_mapif_guild_master_changed) (struct guild **g, int *aid, int *cid);
+typedef int (*HPMHOOK_post_mapif_guild_master_changed) (int retVal___, struct guild *g, int aid, int cid);
+typedef int (*HPMHOOK_pre_mapif_guild_castle_dataload) (int *fd, int *sz, const int **castle_ids);
+typedef int (*HPMHOOK_post_mapif_guild_castle_dataload) (int retVal___, int fd, int sz, const int *castle_ids);
+typedef int (*HPMHOOK_pre_mapif_parse_CreateGuild) (int *fd, int *account_id, const char **name, const struct guild_member **master);
+typedef int (*HPMHOOK_post_mapif_parse_CreateGuild) (int retVal___, int fd, int account_id, const char *name, const struct guild_member *master);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildInfo) (int *fd, int *guild_id);
+typedef int (*HPMHOOK_post_mapif_parse_GuildInfo) (int retVal___, int fd, int guild_id);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildAddMember) (int *fd, int *guild_id, const struct guild_member **m);
+typedef int (*HPMHOOK_post_mapif_parse_GuildAddMember) (int retVal___, int fd, int guild_id, const struct guild_member *m);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildLeave) (int *fd, int *guild_id, int *account_id, int *char_id, int *flag, const char **mes);
+typedef int (*HPMHOOK_post_mapif_parse_GuildLeave) (int retVal___, int fd, int guild_id, int account_id, int char_id, int flag, const char *mes);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildChangeMemberInfoShort) (int *fd, int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
+typedef int (*HPMHOOK_post_mapif_parse_GuildChangeMemberInfoShort) (int retVal___, int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+typedef int (*HPMHOOK_pre_mapif_parse_BreakGuild) (int *fd, int *guild_id);
+typedef int (*HPMHOOK_post_mapif_parse_BreakGuild) (int retVal___, int fd, int guild_id);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildMessage) (int *fd, int *guild_id, int *account_id, const char **mes, int *len);
+typedef int (*HPMHOOK_post_mapif_parse_GuildMessage) (int retVal___, int fd, int guild_id, int account_id, const char *mes, int len);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildBasicInfoChange) (int *fd, int *guild_id, int *type, const void **data, int *len);
+typedef int (*HPMHOOK_post_mapif_parse_GuildBasicInfoChange) (int retVal___, int fd, int guild_id, int type, const void *data, int len);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildMemberInfoChange) (int *fd, int *guild_id, int *account_id, int *char_id, int *type, const char **data, int *len);
+typedef int (*HPMHOOK_post_mapif_parse_GuildMemberInfoChange) (int retVal___, int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildPosition) (int *fd, int *guild_id, int *idx, const struct guild_position **p);
+typedef int (*HPMHOOK_post_mapif_parse_GuildPosition) (int retVal___, int fd, int guild_id, int idx, const struct guild_position *p);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildSkillUp) (int *fd, int *guild_id, uint16 *skill_id, int *account_id, int *max);
+typedef int (*HPMHOOK_post_mapif_parse_GuildSkillUp) (int retVal___, int fd, int guild_id, uint16 skill_id, int account_id, int max);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildDeleteAlliance) (struct guild **g, int *guild_id, int *account_id1, int *account_id2, int *flag);
+typedef int (*HPMHOOK_post_mapif_parse_GuildDeleteAlliance) (int retVal___, struct guild *g, int guild_id, int account_id1, int account_id2, int flag);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildAlliance) (int *fd, int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag);
+typedef int (*HPMHOOK_post_mapif_parse_GuildAlliance) (int retVal___, int fd, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildNotice) (int *fd, int *guild_id, const char **mes1, const char **mes2);
+typedef int (*HPMHOOK_post_mapif_parse_GuildNotice) (int retVal___, int fd, int guild_id, const char *mes1, const char *mes2);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildEmblem) (int *fd, int *len, int *guild_id, int *dummy, const char **data);
+typedef int (*HPMHOOK_post_mapif_parse_GuildEmblem) (int retVal___, int fd, int len, int guild_id, int dummy, const char *data);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildCastleDataLoad) (int *fd, int *len, const int **castle_ids);
+typedef int (*HPMHOOK_post_mapif_parse_GuildCastleDataLoad) (int retVal___, int fd, int len, const int *castle_ids);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildCastleDataSave) (int *fd, int *castle_id, int *index, int *value);
+typedef int (*HPMHOOK_post_mapif_parse_GuildCastleDataSave) (int retVal___, int fd, int castle_id, int index, int value);
+typedef int (*HPMHOOK_pre_mapif_parse_GuildMasterChange) (int *fd, int *guild_id, const char **name, int *len);
+typedef int (*HPMHOOK_post_mapif_parse_GuildMasterChange) (int retVal___, int fd, int guild_id, const char *name, int len);
+typedef void (*HPMHOOK_pre_mapif_homunculus_created) (int *fd, int *account_id, const struct s_homunculus **sh, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_homunculus_created) (int fd, int account_id, const struct s_homunculus *sh, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_homunculus_deleted) (int *fd, int *flag);
+typedef void (*HPMHOOK_post_mapif_homunculus_deleted) (int fd, int flag);
+typedef void (*HPMHOOK_pre_mapif_homunculus_loaded) (int *fd, int *account_id, struct s_homunculus **hd);
+typedef void (*HPMHOOK_post_mapif_homunculus_loaded) (int fd, int account_id, struct s_homunculus *hd);
+typedef void (*HPMHOOK_pre_mapif_homunculus_saved) (int *fd, int *account_id, bool *flag);
+typedef void (*HPMHOOK_post_mapif_homunculus_saved) (int fd, int account_id, bool flag);
+typedef void (*HPMHOOK_pre_mapif_homunculus_renamed) (int *fd, int *account_id, int *char_id, unsigned char *flag, const char **name);
+typedef void (*HPMHOOK_post_mapif_homunculus_renamed) (int fd, int account_id, int char_id, unsigned char flag, const char *name);
+typedef bool (*HPMHOOK_pre_mapif_homunculus_create) (struct s_homunculus **hd);
+typedef bool (*HPMHOOK_post_mapif_homunculus_create) (bool retVal___, struct s_homunculus *hd);
+typedef bool (*HPMHOOK_pre_mapif_homunculus_save) (const struct s_homunculus **hd);
+typedef bool (*HPMHOOK_post_mapif_homunculus_save) (bool retVal___, const struct s_homunculus *hd);
+typedef bool (*HPMHOOK_pre_mapif_homunculus_load) (int *homun_id, struct s_homunculus **hd);
+typedef bool (*HPMHOOK_post_mapif_homunculus_load) (bool retVal___, int homun_id, struct s_homunculus *hd);
+typedef bool (*HPMHOOK_pre_mapif_homunculus_delete) (int *homun_id);
+typedef bool (*HPMHOOK_post_mapif_homunculus_delete) (bool retVal___, int homun_id);
+typedef bool (*HPMHOOK_pre_mapif_homunculus_rename) (const char **name);
+typedef bool (*HPMHOOK_post_mapif_homunculus_rename) (bool retVal___, const char *name);
+typedef void (*HPMHOOK_pre_mapif_parse_homunculus_create) (int *fd, int *len, int *account_id, const struct s_homunculus **phd);
+typedef void (*HPMHOOK_post_mapif_parse_homunculus_create) (int fd, int len, int account_id, const struct s_homunculus *phd);
+typedef void (*HPMHOOK_pre_mapif_parse_homunculus_delete) (int *fd, int *homun_id);
+typedef void (*HPMHOOK_post_mapif_parse_homunculus_delete) (int fd, int homun_id);
+typedef void (*HPMHOOK_pre_mapif_parse_homunculus_load) (int *fd, int *account_id, int *homun_id);
+typedef void (*HPMHOOK_post_mapif_parse_homunculus_load) (int fd, int account_id, int homun_id);
+typedef void (*HPMHOOK_pre_mapif_parse_homunculus_save) (int *fd, int *len, int *account_id, const struct s_homunculus **phd);
+typedef void (*HPMHOOK_post_mapif_parse_homunculus_save) (int fd, int len, int account_id, const struct s_homunculus *phd);
+typedef void (*HPMHOOK_pre_mapif_parse_homunculus_rename) (int *fd, int *account_id, int *char_id, const char **name);
+typedef void (*HPMHOOK_post_mapif_parse_homunculus_rename) (int fd, int account_id, int char_id, const char *name);
+typedef void (*HPMHOOK_pre_mapif_mail_sendinbox) (int *fd, int *char_id, unsigned char *flag, struct mail_data **md);
+typedef void (*HPMHOOK_post_mapif_mail_sendinbox) (int fd, int char_id, unsigned char flag, struct mail_data *md);
+typedef void (*HPMHOOK_pre_mapif_parse_mail_requestinbox) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_mail_requestinbox) (int fd);
+typedef void (*HPMHOOK_pre_mapif_parse_mail_read) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_mail_read) (int fd);
+typedef void (*HPMHOOK_pre_mapif_mail_sendattach) (int *fd, int *char_id, struct mail_message **msg);
+typedef void (*HPMHOOK_post_mapif_mail_sendattach) (int fd, int char_id, struct mail_message *msg);
+typedef void (*HPMHOOK_pre_mapif_mail_getattach) (int *fd, int *char_id, int *mail_id);
+typedef void (*HPMHOOK_post_mapif_mail_getattach) (int fd, int char_id, int mail_id);
+typedef void (*HPMHOOK_pre_mapif_parse_mail_getattach) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_mail_getattach) (int fd);
+typedef void (*HPMHOOK_pre_mapif_mail_delete) (int *fd, int *char_id, int *mail_id, bool *failed);
+typedef void (*HPMHOOK_post_mapif_mail_delete) (int fd, int char_id, int mail_id, bool failed);
+typedef void (*HPMHOOK_pre_mapif_parse_mail_delete) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_mail_delete) (int fd);
+typedef void (*HPMHOOK_pre_mapif_mail_new) (struct mail_message **msg);
+typedef void (*HPMHOOK_post_mapif_mail_new) (struct mail_message *msg);
+typedef void (*HPMHOOK_pre_mapif_mail_return) (int *fd, int *char_id, int *mail_id, int *new_mail);
+typedef void (*HPMHOOK_post_mapif_mail_return) (int fd, int char_id, int mail_id, int new_mail);
+typedef void (*HPMHOOK_pre_mapif_parse_mail_return) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_mail_return) (int fd);
+typedef void (*HPMHOOK_pre_mapif_mail_send) (int *fd, struct mail_message **msg);
+typedef void (*HPMHOOK_post_mapif_mail_send) (int fd, struct mail_message *msg);
+typedef void (*HPMHOOK_pre_mapif_parse_mail_send) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_mail_send) (int fd);
+typedef bool (*HPMHOOK_pre_mapif_mercenary_create) (struct s_mercenary **merc);
+typedef bool (*HPMHOOK_post_mapif_mercenary_create) (bool retVal___, struct s_mercenary *merc);
+typedef bool (*HPMHOOK_pre_mapif_mercenary_save) (const struct s_mercenary **merc);
+typedef bool (*HPMHOOK_post_mapif_mercenary_save) (bool retVal___, const struct s_mercenary *merc);
+typedef bool (*HPMHOOK_pre_mapif_mercenary_load) (int *merc_id, int *char_id, struct s_mercenary **merc);
+typedef bool (*HPMHOOK_post_mapif_mercenary_load) (bool retVal___, int merc_id, int char_id, struct s_mercenary *merc);
+typedef bool (*HPMHOOK_pre_mapif_mercenary_delete) (int *merc_id);
+typedef bool (*HPMHOOK_post_mapif_mercenary_delete) (bool retVal___, int merc_id);
+typedef void (*HPMHOOK_pre_mapif_mercenary_send) (int *fd, struct s_mercenary **merc, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_mercenary_send) (int fd, struct s_mercenary *merc, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_parse_mercenary_create) (int *fd, const struct s_mercenary **merc);
+typedef void (*HPMHOOK_post_mapif_parse_mercenary_create) (int fd, const struct s_mercenary *merc);
+typedef void (*HPMHOOK_pre_mapif_parse_mercenary_load) (int *fd, int *merc_id, int *char_id);
+typedef void (*HPMHOOK_post_mapif_parse_mercenary_load) (int fd, int merc_id, int char_id);
+typedef void (*HPMHOOK_pre_mapif_mercenary_deleted) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_mercenary_deleted) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_parse_mercenary_delete) (int *fd, int *merc_id);
+typedef void (*HPMHOOK_post_mapif_parse_mercenary_delete) (int fd, int merc_id);
+typedef void (*HPMHOOK_pre_mapif_mercenary_saved) (int *fd, unsigned char *flag);
+typedef void (*HPMHOOK_post_mapif_mercenary_saved) (int fd, unsigned char flag);
+typedef void (*HPMHOOK_pre_mapif_parse_mercenary_save) (int *fd, const struct s_mercenary **merc);
+typedef void (*HPMHOOK_post_mapif_parse_mercenary_save) (int fd, const struct s_mercenary *merc);
+typedef int (*HPMHOOK_pre_mapif_party_created) (int *fd, int *account_id, int *char_id, struct party **p);
+typedef int (*HPMHOOK_post_mapif_party_created) (int retVal___, int fd, int account_id, int char_id, struct party *p);
+typedef void (*HPMHOOK_pre_mapif_party_noinfo) (int *fd, int *party_id, int *char_id);
+typedef void (*HPMHOOK_post_mapif_party_noinfo) (int fd, int party_id, int char_id);
+typedef void (*HPMHOOK_pre_mapif_party_info) (int *fd, struct party **p, int *char_id);
+typedef void (*HPMHOOK_post_mapif_party_info) (int fd, struct party *p, int char_id);
+typedef int (*HPMHOOK_pre_mapif_party_memberadded) (int *fd, int *party_id, int *account_id, int *char_id, int *flag);
+typedef int (*HPMHOOK_post_mapif_party_memberadded) (int retVal___, int fd, int party_id, int account_id, int char_id, int flag);
+typedef int (*HPMHOOK_pre_mapif_party_optionchanged) (int *fd, struct party **p, int *account_id, int *flag);
+typedef int (*HPMHOOK_post_mapif_party_optionchanged) (int retVal___, int fd, struct party *p, int account_id, int flag);
+typedef int (*HPMHOOK_pre_mapif_party_withdraw) (int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_mapif_party_withdraw) (int retVal___, int party_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_mapif_party_membermoved) (struct party **p, int *idx);
+typedef int (*HPMHOOK_post_mapif_party_membermoved) (int retVal___, struct party *p, int idx);
+typedef int (*HPMHOOK_pre_mapif_party_broken) (int *party_id, int *flag);
+typedef int (*HPMHOOK_post_mapif_party_broken) (int retVal___, int party_id, int flag);
+typedef int (*HPMHOOK_pre_mapif_party_message) (int *party_id, int *account_id, const char **mes, int *len, int *sfd);
+typedef int (*HPMHOOK_post_mapif_party_message) (int retVal___, int party_id, int account_id, const char *mes, int len, int sfd);
+typedef int (*HPMHOOK_pre_mapif_parse_CreateParty) (int *fd, const char **name, int *item, int *item2, const struct party_member **leader);
+typedef int (*HPMHOOK_post_mapif_parse_CreateParty) (int retVal___, int fd, const char *name, int item, int item2, const struct party_member *leader);
+typedef void (*HPMHOOK_pre_mapif_parse_PartyInfo) (int *fd, int *party_id, int *char_id);
+typedef void (*HPMHOOK_post_mapif_parse_PartyInfo) (int fd, int party_id, int char_id);
+typedef int (*HPMHOOK_pre_mapif_parse_PartyAddMember) (int *fd, int *party_id, const struct party_member **member);
+typedef int (*HPMHOOK_post_mapif_parse_PartyAddMember) (int retVal___, int fd, int party_id, const struct party_member *member);
+typedef int (*HPMHOOK_pre_mapif_parse_PartyChangeOption) (int *fd, int *party_id, int *account_id, int *exp, int *item);
+typedef int (*HPMHOOK_post_mapif_parse_PartyChangeOption) (int retVal___, int fd, int party_id, int account_id, int exp, int item);
+typedef int (*HPMHOOK_pre_mapif_parse_PartyLeave) (int *fd, int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_mapif_parse_PartyLeave) (int retVal___, int fd, int party_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_mapif_parse_PartyChangeMap) (int *fd, int *party_id, int *account_id, int *char_id, unsigned short *map, int *online, unsigned int *lv);
+typedef int (*HPMHOOK_post_mapif_parse_PartyChangeMap) (int retVal___, int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv);
+typedef int (*HPMHOOK_pre_mapif_parse_BreakParty) (int *fd, int *party_id);
+typedef int (*HPMHOOK_post_mapif_parse_BreakParty) (int retVal___, int fd, int party_id);
+typedef int (*HPMHOOK_pre_mapif_parse_PartyMessage) (int *fd, int *party_id, int *account_id, const char **mes, int *len);
+typedef int (*HPMHOOK_post_mapif_parse_PartyMessage) (int retVal___, int fd, int party_id, int account_id, const char *mes, int len);
+typedef int (*HPMHOOK_pre_mapif_parse_PartyLeaderChange) (int *fd, int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_mapif_parse_PartyLeaderChange) (int retVal___, int fd, int party_id, int account_id, int char_id);
+typedef int (*HPMHOOK_pre_mapif_pet_created) (int *fd, int *account_id, struct s_pet **p);
+typedef int (*HPMHOOK_post_mapif_pet_created) (int retVal___, int fd, int account_id, struct s_pet *p);
+typedef int (*HPMHOOK_pre_mapif_pet_info) (int *fd, int *account_id, struct s_pet **p);
+typedef int (*HPMHOOK_post_mapif_pet_info) (int retVal___, int fd, int account_id, struct s_pet *p);
+typedef int (*HPMHOOK_pre_mapif_pet_noinfo) (int *fd, int *account_id);
+typedef int (*HPMHOOK_post_mapif_pet_noinfo) (int retVal___, int fd, int account_id);
+typedef int (*HPMHOOK_pre_mapif_save_pet_ack) (int *fd, int *account_id, int *flag);
+typedef int (*HPMHOOK_post_mapif_save_pet_ack) (int retVal___, int fd, int account_id, int flag);
+typedef int (*HPMHOOK_pre_mapif_delete_pet_ack) (int *fd, int *flag);
+typedef int (*HPMHOOK_post_mapif_delete_pet_ack) (int retVal___, int fd, int flag);
+typedef int (*HPMHOOK_pre_mapif_create_pet) (int *fd, int *account_id, int *char_id, short *pet_class, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, const char **pet_name);
+typedef int (*HPMHOOK_post_mapif_create_pet) (int retVal___, int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name);
+typedef int (*HPMHOOK_pre_mapif_load_pet) (int *fd, int *account_id, int *char_id, int *pet_id);
+typedef int (*HPMHOOK_post_mapif_load_pet) (int retVal___, int fd, int account_id, int char_id, int pet_id);
+typedef int (*HPMHOOK_pre_mapif_save_pet) (int *fd, int *account_id, const struct s_pet **data);
+typedef int (*HPMHOOK_post_mapif_save_pet) (int retVal___, int fd, int account_id, const struct s_pet *data);
+typedef int (*HPMHOOK_pre_mapif_delete_pet) (int *fd, int *pet_id);
+typedef int (*HPMHOOK_post_mapif_delete_pet) (int retVal___, int fd, int pet_id);
+typedef int (*HPMHOOK_pre_mapif_parse_CreatePet) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_CreatePet) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_LoadPet) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_LoadPet) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_SavePet) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_SavePet) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_DeletePet) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_DeletePet) (int retVal___, int fd);
+typedef struct quest* (*HPMHOOK_pre_mapif_quests_fromsql) (int *char_id, int **count);
+typedef struct quest* (*HPMHOOK_post_mapif_quests_fromsql) (struct quest* retVal___, int char_id, int *count);
+typedef bool (*HPMHOOK_pre_mapif_quest_delete) (int *char_id, int *quest_id);
+typedef bool (*HPMHOOK_post_mapif_quest_delete) (bool retVal___, int char_id, int quest_id);
+typedef bool (*HPMHOOK_pre_mapif_quest_add) (int *char_id, struct quest *qd);
+typedef bool (*HPMHOOK_post_mapif_quest_add) (bool retVal___, int char_id, struct quest qd);
+typedef bool (*HPMHOOK_pre_mapif_quest_update) (int *char_id, struct quest *qd);
+typedef bool (*HPMHOOK_post_mapif_quest_update) (bool retVal___, int char_id, struct quest qd);
+typedef void (*HPMHOOK_pre_mapif_quest_save_ack) (int *fd, int *char_id, bool *success);
+typedef void (*HPMHOOK_post_mapif_quest_save_ack) (int fd, int char_id, bool success);
+typedef int (*HPMHOOK_pre_mapif_parse_quest_save) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_quest_save) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_mapif_send_quests) (int *fd, int *char_id, struct quest **tmp_questlog, int *num_quests);
+typedef void (*HPMHOOK_post_mapif_send_quests) (int fd, int char_id, struct quest *tmp_questlog, int num_quests);
+typedef int (*HPMHOOK_pre_mapif_parse_quest_load) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_quest_load) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_load_guild_storage) (int *fd, int *account_id, int *guild_id, char *flag);
+typedef int (*HPMHOOK_post_mapif_load_guild_storage) (int retVal___, int fd, int account_id, int guild_id, char flag);
+typedef int (*HPMHOOK_pre_mapif_save_guild_storage_ack) (int *fd, int *account_id, int *guild_id, int *fail);
+typedef int (*HPMHOOK_post_mapif_save_guild_storage_ack) (int retVal___, int fd, int account_id, int guild_id, int fail);
+typedef int (*HPMHOOK_pre_mapif_parse_LoadGuildStorage) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_LoadGuildStorage) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_SaveGuildStorage) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_SaveGuildStorage) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_account_storage_load) (int *fd, int *account_id);
+typedef int (*HPMHOOK_post_mapif_account_storage_load) (int retVal___, int fd, int account_id);
+typedef int (*HPMHOOK_pre_mapif_pAccountStorageLoad) (int *fd);
+typedef int (*HPMHOOK_post_mapif_pAccountStorageLoad) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_pAccountStorageSave) (int *fd);
+typedef int (*HPMHOOK_post_mapif_pAccountStorageSave) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_mapif_sAccountStorageSaveAck) (int *fd, int *account_id, bool *save);
+typedef void (*HPMHOOK_post_mapif_sAccountStorageSaveAck) (int fd, int account_id, bool save);
+typedef int (*HPMHOOK_pre_mapif_itembound_ack) (int *fd, int *aid, int *guild_id);
+typedef int (*HPMHOOK_post_mapif_itembound_ack) (int retVal___, int fd, int aid, int guild_id);
+typedef int (*HPMHOOK_pre_mapif_parse_ItemBoundRetrieve_sub) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_ItemBoundRetrieve_sub) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_mapif_parse_ItemBoundRetrieve) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_ItemBoundRetrieve) (int fd);
+typedef void (*HPMHOOK_pre_mapif_parse_accinfo) (int *fd);
+typedef void (*HPMHOOK_post_mapif_parse_accinfo) (int fd);
+typedef void (*HPMHOOK_pre_mapif_parse_accinfo2) (bool *success, int *map_fd, int *u_fd, int *u_aid, int *account_id, const char **userid, const char **user_pass, const char **email, const char **last_ip, const char **lastlogin, const char **pin_code, const char **birthdate, int *group_id, int *logincount, int *state);
+typedef void (*HPMHOOK_post_mapif_parse_accinfo2) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state);
+typedef int (*HPMHOOK_pre_mapif_broadcast) (const unsigned char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd);
+typedef int (*HPMHOOK_post_mapif_broadcast) (int retVal___, const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd);
+typedef int (*HPMHOOK_pre_mapif_wis_message) (struct WisData **wd);
+typedef int (*HPMHOOK_post_mapif_wis_message) (int retVal___, struct WisData *wd);
+typedef void (*HPMHOOK_pre_mapif_wis_response) (int *fd, const unsigned char **src, int *flag);
+typedef void (*HPMHOOK_post_mapif_wis_response) (int fd, const unsigned char *src, int flag);
+typedef int (*HPMHOOK_pre_mapif_wis_end) (struct WisData **wd, int *flag);
+typedef int (*HPMHOOK_post_mapif_wis_end) (int retVal___, struct WisData *wd, int flag);
+typedef int (*HPMHOOK_pre_mapif_account_reg_reply) (int *fd, int *account_id, int *char_id, int *type);
+typedef int (*HPMHOOK_post_mapif_account_reg_reply) (int retVal___, int fd, int account_id, int char_id, int type);
+typedef int (*HPMHOOK_pre_mapif_disconnectplayer) (int *fd, int *account_id, int *char_id, int *reason);
+typedef int (*HPMHOOK_post_mapif_disconnectplayer) (int retVal___, int fd, int account_id, int char_id, int reason);
+typedef int (*HPMHOOK_pre_mapif_parse_broadcast) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_broadcast) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_WisRequest) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_WisRequest) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_WisReply) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_WisReply) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_WisToGM) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_WisToGM) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_Registry) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_Registry) (int retVal___, int fd);
+typedef int (*HPMHOOK_pre_mapif_parse_RegistryRequest) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_RegistryRequest) (int retVal___, int fd);
+typedef void (*HPMHOOK_pre_mapif_namechange_ack) (int *fd, int *account_id, int *char_id, int *type, int *flag, const char **name);
+typedef void (*HPMHOOK_post_mapif_namechange_ack) (int fd, int account_id, int char_id, int type, int flag, const char *name);
+typedef int (*HPMHOOK_pre_mapif_parse_NameChangeRequest) (int *fd);
+typedef int (*HPMHOOK_post_mapif_parse_NameChangeRequest) (int retVal___, int fd);
+#endif // CHAR_MAPIF_H
+#ifdef COMMON_MAPINDEX_H /* mapindex */
+typedef int (*HPMHOOK_pre_mapindex_init) (void);
+typedef int (*HPMHOOK_post_mapindex_init) (int retVal___);
+typedef void (*HPMHOOK_pre_mapindex_final) (void);
+typedef void (*HPMHOOK_post_mapindex_final) (void);
+typedef int (*HPMHOOK_pre_mapindex_addmap) (int *index, const char **name);
+typedef int (*HPMHOOK_post_mapindex_addmap) (int retVal___, int index, const char *name);
+typedef void (*HPMHOOK_pre_mapindex_removemap) (int *index);
+typedef void (*HPMHOOK_post_mapindex_removemap) (int index);
+typedef const char* (*HPMHOOK_pre_mapindex_getmapname) (const char **string, char **output);
+typedef const char* (*HPMHOOK_post_mapindex_getmapname) (const char* retVal___, const char *string, char *output);
+typedef const char* (*HPMHOOK_pre_mapindex_getmapname_ext) (const char **string, char **output);
+typedef const char* (*HPMHOOK_post_mapindex_getmapname_ext) (const char* retVal___, const char *string, char *output);
+typedef unsigned short (*HPMHOOK_pre_mapindex_name2id) (const char **p1);
+typedef unsigned short (*HPMHOOK_post_mapindex_name2id) (unsigned short retVal___, const char *p1);
+typedef const char* (*HPMHOOK_pre_mapindex_id2name) (uint16 *id, const char **file, int *line, const char **func);
+typedef const char* (*HPMHOOK_post_mapindex_id2name) (const char* retVal___, uint16 id, const char *file, int line, const char *func);
+typedef bool (*HPMHOOK_pre_mapindex_check_default) (void);
+typedef bool (*HPMHOOK_post_mapindex_check_default) (bool retVal___);
+#endif // COMMON_MAPINDEX_H
+#ifdef MAP_MAP_H /* mapit */
+typedef struct s_mapiterator* (*HPMHOOK_pre_mapit_alloc) (enum e_mapitflags *flags, enum bl_type *types);
+typedef struct s_mapiterator* (*HPMHOOK_post_mapit_alloc) (struct s_mapiterator* retVal___, enum e_mapitflags flags, enum bl_type types);
+typedef void (*HPMHOOK_pre_mapit_free) (struct s_mapiterator **iter);
+typedef void (*HPMHOOK_post_mapit_free) (struct s_mapiterator *iter);
+typedef struct block_list* (*HPMHOOK_pre_mapit_first) (struct s_mapiterator **iter);
+typedef struct block_list* (*HPMHOOK_post_mapit_first) (struct block_list* retVal___, struct s_mapiterator *iter);
+typedef struct block_list* (*HPMHOOK_pre_mapit_last) (struct s_mapiterator **iter);
+typedef struct block_list* (*HPMHOOK_post_mapit_last) (struct block_list* retVal___, struct s_mapiterator *iter);
+typedef struct block_list* (*HPMHOOK_pre_mapit_next) (struct s_mapiterator **iter);
+typedef struct block_list* (*HPMHOOK_post_mapit_next) (struct block_list* retVal___, struct s_mapiterator *iter);
+typedef struct block_list* (*HPMHOOK_pre_mapit_prev) (struct s_mapiterator **iter);
+typedef struct block_list* (*HPMHOOK_post_mapit_prev) (struct block_list* retVal___, struct s_mapiterator *iter);
+typedef bool (*HPMHOOK_pre_mapit_exists) (struct s_mapiterator **iter);
+typedef bool (*HPMHOOK_post_mapit_exists) (bool retVal___, struct s_mapiterator *iter);
+#endif // MAP_MAP_H
+#ifdef MAP_MAPREG_H /* mapreg */
+typedef void (*HPMHOOK_pre_mapreg_init) (void);
+typedef void (*HPMHOOK_post_mapreg_init) (void);
+typedef void (*HPMHOOK_pre_mapreg_final) (void);
+typedef void (*HPMHOOK_post_mapreg_final) (void);
+typedef int (*HPMHOOK_pre_mapreg_readreg) (int64 *uid);
+typedef int (*HPMHOOK_post_mapreg_readreg) (int retVal___, int64 uid);
+typedef char* (*HPMHOOK_pre_mapreg_readregstr) (int64 *uid);
+typedef char* (*HPMHOOK_post_mapreg_readregstr) (char* retVal___, int64 uid);
+typedef bool (*HPMHOOK_pre_mapreg_setreg) (int64 *uid, int *val);
+typedef bool (*HPMHOOK_post_mapreg_setreg) (bool retVal___, int64 uid, int val);
+typedef bool (*HPMHOOK_pre_mapreg_setregstr) (int64 *uid, const char **str);
+typedef bool (*HPMHOOK_post_mapreg_setregstr) (bool retVal___, int64 uid, const char *str);
+typedef void (*HPMHOOK_pre_mapreg_load) (void);
+typedef void (*HPMHOOK_post_mapreg_load) (void);
+typedef void (*HPMHOOK_pre_mapreg_save) (void);
+typedef void (*HPMHOOK_post_mapreg_save) (void);
+typedef int (*HPMHOOK_pre_mapreg_save_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mapreg_save_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_mapreg_destroyreg) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_mapreg_destroyreg) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_mapreg_reload) (void);
+typedef void (*HPMHOOK_post_mapreg_reload) (void);
+typedef bool (*HPMHOOK_pre_mapreg_config_read) (const char **filename, const struct config_setting_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_mapreg_config_read) (bool retVal___, const char *filename, const struct config_setting_t *config, bool imported);
+#endif // MAP_MAPREG_H
+#ifdef COMMON_MD5CALC_H /* md5 */
+typedef void (*HPMHOOK_pre_md5_string) (const char **string, char **output);
+typedef void (*HPMHOOK_post_md5_string) (const char *string, char *output);
+typedef void (*HPMHOOK_pre_md5_binary) (const uint8 **buf, const int *buf_size, uint8 **output);
+typedef void (*HPMHOOK_post_md5_binary) (const uint8 *buf, const int buf_size, uint8 *output);
+typedef void (*HPMHOOK_pre_md5_salt) (int *len, char **output);
+typedef void (*HPMHOOK_post_md5_salt) (int len, char *output);
+#endif // COMMON_MD5CALC_H
+#ifdef MAP_MERCENARY_H /* mercenary */
+typedef void (*HPMHOOK_pre_mercenary_init) (bool *minimal);
+typedef void (*HPMHOOK_post_mercenary_init) (bool minimal);
+typedef bool (*HPMHOOK_pre_mercenary_class) (int *class_);
+typedef bool (*HPMHOOK_post_mercenary_class) (bool retVal___, int class_);
+typedef struct view_data* (*HPMHOOK_pre_mercenary_get_viewdata) (int *class_);
+typedef struct view_data* (*HPMHOOK_post_mercenary_get_viewdata) (struct view_data* retVal___, int class_);
+typedef int (*HPMHOOK_pre_mercenary_create) (struct map_session_data **sd, int *class_, unsigned int *lifetime);
+typedef int (*HPMHOOK_post_mercenary_create) (int retVal___, struct map_session_data *sd, int class_, unsigned int lifetime);
+typedef int (*HPMHOOK_pre_mercenary_data_received) (const struct s_mercenary **merc, bool *flag);
+typedef int (*HPMHOOK_post_mercenary_data_received) (int retVal___, const struct s_mercenary *merc, bool flag);
+typedef int (*HPMHOOK_pre_mercenary_save) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_save) (int retVal___, struct mercenary_data *md);
+typedef void (*HPMHOOK_pre_mercenary_heal) (struct mercenary_data **md, int *hp, int *sp);
+typedef void (*HPMHOOK_post_mercenary_heal) (struct mercenary_data *md, int hp, int sp);
+typedef int (*HPMHOOK_pre_mercenary_dead) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_dead) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_delete) (struct mercenary_data **md, int *reply);
+typedef int (*HPMHOOK_post_mercenary_delete) (int retVal___, struct mercenary_data *md, int reply);
+typedef void (*HPMHOOK_pre_mercenary_contract_stop) (struct mercenary_data **md);
+typedef void (*HPMHOOK_post_mercenary_contract_stop) (struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_get_lifetime) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_get_lifetime) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_get_guild) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_get_guild) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_get_faith) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_get_faith) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_set_faith) (struct mercenary_data **md, int *value);
+typedef int (*HPMHOOK_post_mercenary_set_faith) (int retVal___, struct mercenary_data *md, int value);
+typedef int (*HPMHOOK_pre_mercenary_get_calls) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_get_calls) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_set_calls) (struct mercenary_data **md, int *value);
+typedef int (*HPMHOOK_post_mercenary_set_calls) (int retVal___, struct mercenary_data *md, int value);
+typedef int (*HPMHOOK_pre_mercenary_kills) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_kills) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_checkskill) (struct mercenary_data **md, uint16 *skill_id);
+typedef int (*HPMHOOK_post_mercenary_checkskill) (int retVal___, struct mercenary_data *md, uint16 skill_id);
+typedef int (*HPMHOOK_pre_mercenary_read_db) (void);
+typedef int (*HPMHOOK_post_mercenary_read_db) (int retVal___);
+typedef int (*HPMHOOK_pre_mercenary_read_skilldb) (void);
+typedef int (*HPMHOOK_post_mercenary_read_skilldb) (int retVal___);
+typedef int (*HPMHOOK_pre_mercenary_killbonus) (struct mercenary_data **md);
+typedef int (*HPMHOOK_post_mercenary_killbonus) (int retVal___, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_mercenary_search_index) (int *class_);
+typedef int (*HPMHOOK_post_mercenary_search_index) (int retVal___, int class_);
+typedef int (*HPMHOOK_pre_mercenary_contract_end_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mercenary_contract_end_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef bool (*HPMHOOK_pre_mercenary_read_db_sub) (char **str[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_mercenary_read_db_sub) (bool retVal___, char *str[], int columns, int current);
+typedef bool (*HPMHOOK_pre_mercenary_read_skill_db_sub) (char **str[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_mercenary_read_skill_db_sub) (bool retVal___, char *str[], int columns, int current);
+#endif // MAP_MERCENARY_H
+#ifdef MAP_MOB_H /* mob */
+typedef int (*HPMHOOK_pre_mob_init) (bool *mimimal);
+typedef int (*HPMHOOK_post_mob_init) (int retVal___, bool mimimal);
+typedef int (*HPMHOOK_pre_mob_final) (void);
+typedef int (*HPMHOOK_post_mob_final) (int retVal___);
+typedef void (*HPMHOOK_pre_mob_reload) (void);
+typedef void (*HPMHOOK_post_mob_reload) (void);
+typedef struct mob_db* (*HPMHOOK_pre_mob_db) (int *index);
+typedef struct mob_db* (*HPMHOOK_post_mob_db) (struct mob_db* retVal___, int index);
+typedef struct mob_chat* (*HPMHOOK_pre_mob_chat) (short *id);
+typedef struct mob_chat* (*HPMHOOK_post_mob_chat) (struct mob_chat* retVal___, short id);
+typedef int (*HPMHOOK_pre_mob_makedummymobdb) (int *p1);
+typedef int (*HPMHOOK_post_mob_makedummymobdb) (int retVal___, int p1);
+typedef int (*HPMHOOK_pre_mob_spawn_guardian_sub) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_spawn_guardian_sub) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_mob_skill_id2skill_idx) (int *class_, uint16 *skill_id);
+typedef int (*HPMHOOK_post_mob_skill_id2skill_idx) (int retVal___, int class_, uint16 skill_id);
+typedef int (*HPMHOOK_pre_mob_db_searchname) (const char **str);
+typedef int (*HPMHOOK_post_mob_db_searchname) (int retVal___, const char *str);
+typedef int (*HPMHOOK_pre_mob_db_searchname_array_sub) (struct mob_db **monster, const char **str, int *flag);
+typedef int (*HPMHOOK_post_mob_db_searchname_array_sub) (int retVal___, struct mob_db *monster, const char *str, int flag);
+typedef void (*HPMHOOK_pre_mob_mvptomb_create) (struct mob_data **md, char **killer, time_t *time);
+typedef void (*HPMHOOK_post_mob_mvptomb_create) (struct mob_data *md, char *killer, time_t time);
+typedef void (*HPMHOOK_pre_mob_mvptomb_destroy) (struct mob_data **md);
+typedef void (*HPMHOOK_post_mob_mvptomb_destroy) (struct mob_data *md);
+typedef int (*HPMHOOK_pre_mob_db_searchname_array) (struct mob_db ***data, int *size, const char **str, int *flag);
+typedef int (*HPMHOOK_post_mob_db_searchname_array) (int retVal___, struct mob_db **data, int size, const char *str, int flag);
+typedef int (*HPMHOOK_pre_mob_db_checkid) (const int *id);
+typedef int (*HPMHOOK_post_mob_db_checkid) (int retVal___, const int id);
+typedef struct view_data* (*HPMHOOK_pre_mob_get_viewdata) (int *class_);
+typedef struct view_data* (*HPMHOOK_post_mob_get_viewdata) (struct view_data* retVal___, int class_);
+typedef int (*HPMHOOK_pre_mob_parse_dataset) (struct spawn_data **data);
+typedef int (*HPMHOOK_post_mob_parse_dataset) (int retVal___, struct spawn_data *data);
+typedef struct mob_data* (*HPMHOOK_pre_mob_spawn_dataset) (struct spawn_data **data);
+typedef struct mob_data* (*HPMHOOK_post_mob_spawn_dataset) (struct mob_data* retVal___, struct spawn_data *data);
+typedef int (*HPMHOOK_pre_mob_get_random_id) (int *type, int *flag, int *lv);
+typedef int (*HPMHOOK_post_mob_get_random_id) (int retVal___, int type, int flag, int lv);
+typedef bool (*HPMHOOK_pre_mob_ksprotected) (struct block_list **src, struct block_list **target);
+typedef bool (*HPMHOOK_post_mob_ksprotected) (bool retVal___, struct block_list *src, struct block_list *target);
+typedef struct mob_data* (*HPMHOOK_pre_mob_once_spawn_sub) (struct block_list **bl, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, const char **event, unsigned int *size, unsigned int *ai);
+typedef struct mob_data* (*HPMHOOK_post_mob_once_spawn_sub) (struct mob_data* retVal___, struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai);
+typedef int (*HPMHOOK_pre_mob_once_spawn) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, int *amount, const char **event, unsigned int *size, unsigned int *ai);
+typedef int (*HPMHOOK_post_mob_once_spawn) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai);
+typedef int (*HPMHOOK_pre_mob_once_spawn_area) (struct map_session_data **sd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, const char **mobname, int *class_, int *amount, const char **event, unsigned int *size, unsigned int *ai);
+typedef int (*HPMHOOK_post_mob_once_spawn_area) (int retVal___, struct map_session_data *sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai);
+typedef int (*HPMHOOK_pre_mob_spawn_guardian) (const char **mapname, short *x, short *y, const char **mobname, int *class_, const char **event, int *guardian, bool *has_index);
+typedef int (*HPMHOOK_post_mob_spawn_guardian) (int retVal___, const char *mapname, short x, short y, const char *mobname, int class_, const char *event, int guardian, bool has_index);
+typedef int (*HPMHOOK_pre_mob_spawn_bg) (const char **mapname, short *x, short *y, const char **mobname, int *class_, const char **event, unsigned int *bg_id);
+typedef int (*HPMHOOK_post_mob_spawn_bg) (int retVal___, const char *mapname, short x, short y, const char *mobname, int class_, const char *event, unsigned int bg_id);
+typedef int (*HPMHOOK_pre_mob_can_reach) (struct mob_data **md, struct block_list **bl, int *range, int *state);
+typedef int (*HPMHOOK_post_mob_can_reach) (int retVal___, struct mob_data *md, struct block_list *bl, int range, int state);
+typedef int (*HPMHOOK_pre_mob_linksearch) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_linksearch) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_delayspawn) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_delayspawn) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_mob_setdelayspawn) (struct mob_data **md);
+typedef int (*HPMHOOK_post_mob_setdelayspawn) (int retVal___, struct mob_data *md);
+typedef int (*HPMHOOK_pre_mob_count_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_count_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_spawn) (struct mob_data **md);
+typedef int (*HPMHOOK_post_mob_spawn) (int retVal___, struct mob_data *md);
+typedef int (*HPMHOOK_pre_mob_can_changetarget) (const struct mob_data **md, const struct block_list **target, uint32 *mode);
+typedef int (*HPMHOOK_post_mob_can_changetarget) (int retVal___, const struct mob_data *md, const struct block_list *target, uint32 mode);
+typedef int (*HPMHOOK_pre_mob_target) (struct mob_data **md, struct block_list **bl, int *dist);
+typedef int (*HPMHOOK_post_mob_target) (int retVal___, struct mob_data *md, struct block_list *bl, int dist);
+typedef int (*HPMHOOK_pre_mob_ai_sub_hard_activesearch) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_ai_sub_hard_activesearch) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_ai_sub_hard_changechase) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_ai_sub_hard_changechase) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_ai_sub_hard_bg_ally) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_ai_sub_hard_bg_ally) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_ai_sub_hard_lootsearch) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_ai_sub_hard_lootsearch) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_warpchase_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_warpchase_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_ai_sub_hard_slavemob) (struct mob_data **md, int64 *tick);
+typedef int (*HPMHOOK_post_mob_ai_sub_hard_slavemob) (int retVal___, struct mob_data *md, int64 tick);
+typedef int (*HPMHOOK_pre_mob_unlocktarget) (struct mob_data **md, int64 *tick);
+typedef int (*HPMHOOK_post_mob_unlocktarget) (int retVal___, struct mob_data *md, int64 tick);
+typedef int (*HPMHOOK_pre_mob_randomwalk) (struct mob_data **md, int64 *tick);
+typedef int (*HPMHOOK_post_mob_randomwalk) (int retVal___, struct mob_data *md, int64 tick);
+typedef int (*HPMHOOK_pre_mob_warpchase) (struct mob_data **md, struct block_list **target);
+typedef int (*HPMHOOK_post_mob_warpchase) (int retVal___, struct mob_data *md, struct block_list *target);
+typedef bool (*HPMHOOK_pre_mob_ai_sub_hard) (struct mob_data **md, int64 *tick);
+typedef bool (*HPMHOOK_post_mob_ai_sub_hard) (bool retVal___, struct mob_data *md, int64 tick);
+typedef int (*HPMHOOK_pre_mob_ai_sub_hard_timer) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_ai_sub_hard_timer) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_ai_sub_foreachclient) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_mob_ai_sub_foreachclient) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef int (*HPMHOOK_pre_mob_ai_sub_lazy) (struct mob_data **md, va_list args);
+typedef int (*HPMHOOK_post_mob_ai_sub_lazy) (int retVal___, struct mob_data *md, va_list args);
+typedef int (*HPMHOOK_pre_mob_ai_lazy) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_ai_lazy) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_mob_ai_hard) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_ai_hard) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef struct item_drop* (*HPMHOOK_pre_mob_setdropitem) (int *nameid, int *qty, struct item_data **data);
+typedef struct item_drop* (*HPMHOOK_post_mob_setdropitem) (struct item_drop* retVal___, int nameid, int qty, struct item_data *data);
+typedef struct item_drop* (*HPMHOOK_pre_mob_setlootitem) (struct item **item);
+typedef struct item_drop* (*HPMHOOK_post_mob_setlootitem) (struct item_drop* retVal___, struct item *item);
+typedef int (*HPMHOOK_pre_mob_delay_item_drop) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_delay_item_drop) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_mob_item_drop) (struct mob_data **md, struct item_drop_list **dlist, struct item_drop **ditem, int *loot, int *drop_rate, unsigned short *flag);
+typedef void (*HPMHOOK_post_mob_item_drop) (struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int loot, int drop_rate, unsigned short flag);
+typedef int (*HPMHOOK_pre_mob_timer_delete) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_timer_delete) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_mob_deleteslave_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_deleteslave_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_deleteslave) (struct mob_data **md);
+typedef int (*HPMHOOK_post_mob_deleteslave) (int retVal___, struct mob_data *md);
+typedef int (*HPMHOOK_pre_mob_respawn) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_mob_respawn) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_mob_log_damage) (struct mob_data **md, struct block_list **src, int *damage);
+typedef void (*HPMHOOK_post_mob_log_damage) (struct mob_data *md, struct block_list *src, int damage);
+typedef void (*HPMHOOK_pre_mob_damage) (struct mob_data **md, struct block_list **src, int *damage);
+typedef void (*HPMHOOK_post_mob_damage) (struct mob_data *md, struct block_list *src, int damage);
+typedef int (*HPMHOOK_pre_mob_dead) (struct mob_data **md, struct block_list **src, int *type);
+typedef int (*HPMHOOK_post_mob_dead) (int retVal___, struct mob_data *md, struct block_list *src, int type);
+typedef void (*HPMHOOK_pre_mob_revive) (struct mob_data **md, unsigned int *hp);
+typedef void (*HPMHOOK_post_mob_revive) (struct mob_data *md, unsigned int hp);
+typedef int (*HPMHOOK_pre_mob_guardian_guildchange) (struct mob_data **md);
+typedef int (*HPMHOOK_post_mob_guardian_guildchange) (int retVal___, struct mob_data *md);
+typedef int (*HPMHOOK_pre_mob_random_class) (int **value, size_t *count);
+typedef int (*HPMHOOK_post_mob_random_class) (int retVal___, int *value, size_t count);
+typedef int (*HPMHOOK_pre_mob_class_change) (struct mob_data **md, int *class_);
+typedef int (*HPMHOOK_post_mob_class_change) (int retVal___, struct mob_data *md, int class_);
+typedef void (*HPMHOOK_pre_mob_heal) (struct mob_data **md, unsigned int *heal);
+typedef void (*HPMHOOK_post_mob_heal) (struct mob_data *md, unsigned int heal);
+typedef int (*HPMHOOK_pre_mob_warpslave_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_warpslave_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_warpslave) (struct block_list **bl, int *range);
+typedef int (*HPMHOOK_post_mob_warpslave) (int retVal___, struct block_list *bl, int range);
+typedef int (*HPMHOOK_pre_mob_countslave_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_countslave_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_mob_countslave) (struct block_list **bl);
+typedef int (*HPMHOOK_post_mob_countslave) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_mob_summonslave) (struct mob_data **md2, int **value, int *amount, uint16 *skill_id);
+typedef int (*HPMHOOK_post_mob_summonslave) (int retVal___, struct mob_data *md2, int *value, int amount, uint16 skill_id);
+typedef int (*HPMHOOK_pre_mob_getfriendhprate_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_getfriendhprate_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef struct block_list* (*HPMHOOK_pre_mob_getfriendhprate) (struct mob_data **md, int *min_rate, int *max_rate);
+typedef struct block_list* (*HPMHOOK_post_mob_getfriendhprate) (struct block_list* retVal___, struct mob_data *md, int min_rate, int max_rate);
+typedef struct block_list* (*HPMHOOK_pre_mob_getmasterhpltmaxrate) (struct mob_data **md, int *rate);
+typedef struct block_list* (*HPMHOOK_post_mob_getmasterhpltmaxrate) (struct block_list* retVal___, struct mob_data *md, int rate);
+typedef int (*HPMHOOK_pre_mob_getfriendstatus_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_mob_getfriendstatus_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef struct mob_data* (*HPMHOOK_pre_mob_getfriendstatus) (struct mob_data **md, int *cond1, int *cond2);
+typedef struct mob_data* (*HPMHOOK_post_mob_getfriendstatus) (struct mob_data* retVal___, struct mob_data *md, int cond1, int cond2);
+typedef int (*HPMHOOK_pre_mob_skill_use) (struct mob_data **md, int64 *tick, int *event);
+typedef int (*HPMHOOK_post_mob_skill_use) (int retVal___, struct mob_data *md, int64 tick, int event);
+typedef int (*HPMHOOK_pre_mob_skill_event) (struct mob_data **md, struct block_list **src, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_mob_skill_event) (int retVal___, struct mob_data *md, struct block_list *src, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_mob_is_clone) (int *class_);
+typedef int (*HPMHOOK_post_mob_is_clone) (int retVal___, int class_);
+typedef int (*HPMHOOK_pre_mob_clone_spawn) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y, const char **event, int *master_id, uint32 *mode, int *flag, unsigned int *duration);
+typedef int (*HPMHOOK_post_mob_clone_spawn) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, uint32 mode, int flag, unsigned int duration);
+typedef int (*HPMHOOK_pre_mob_clone_delete) (struct mob_data **md);
+typedef int (*HPMHOOK_post_mob_clone_delete) (int retVal___, struct mob_data *md);
+typedef unsigned int (*HPMHOOK_pre_mob_drop_adjust) (int *baserate, int *rate_adjust, unsigned short *rate_min, unsigned short *rate_max);
+typedef unsigned int (*HPMHOOK_post_mob_drop_adjust) (unsigned int retVal___, int baserate, int rate_adjust, unsigned short rate_min, unsigned short rate_max);
+typedef void (*HPMHOOK_pre_mob_item_dropratio_adjust) (int *nameid, int *mob_id, int **rate_adjust);
+typedef void (*HPMHOOK_post_mob_item_dropratio_adjust) (int nameid, int mob_id, int *rate_adjust);
+typedef void (*HPMHOOK_pre_mob_readdb) (void);
+typedef void (*HPMHOOK_post_mob_readdb) (void);
+typedef bool (*HPMHOOK_pre_mob_lookup_const) (const struct config_setting_t **it, const char **name, int **value);
+typedef bool (*HPMHOOK_post_mob_lookup_const) (bool retVal___, const struct config_setting_t *it, const char *name, int *value);
+typedef bool (*HPMHOOK_pre_mob_get_const) (const struct config_setting_t **it, int **value);
+typedef bool (*HPMHOOK_post_mob_get_const) (bool retVal___, const struct config_setting_t *it, int *value);
+typedef int (*HPMHOOK_pre_mob_db_validate_entry) (struct mob_db **entry, int *n, const char **source);
+typedef int (*HPMHOOK_post_mob_db_validate_entry) (int retVal___, struct mob_db *entry, int n, const char *source);
+typedef int (*HPMHOOK_pre_mob_read_libconfig) (const char **filename, bool *ignore_missing);
+typedef int (*HPMHOOK_post_mob_read_libconfig) (int retVal___, const char *filename, bool ignore_missing);
+typedef void (*HPMHOOK_pre_mob_read_db_additional_fields) (struct mob_db **entry, struct config_setting_t **it, int *n, const char **source);
+typedef void (*HPMHOOK_post_mob_read_db_additional_fields) (struct mob_db *entry, struct config_setting_t *it, int n, const char *source);
+typedef int (*HPMHOOK_pre_mob_read_db_sub) (struct config_setting_t **mobt, int *id, const char **source);
+typedef int (*HPMHOOK_post_mob_read_db_sub) (int retVal___, struct config_setting_t *mobt, int id, const char *source);
+typedef void (*HPMHOOK_pre_mob_read_db_drops_sub) (struct mob_db **entry, struct config_setting_t **t);
+typedef void (*HPMHOOK_post_mob_read_db_drops_sub) (struct mob_db *entry, struct config_setting_t *t);
+typedef void (*HPMHOOK_pre_mob_read_db_mvpdrops_sub) (struct mob_db **entry, struct config_setting_t **t);
+typedef void (*HPMHOOK_post_mob_read_db_mvpdrops_sub) (struct mob_db *entry, struct config_setting_t *t);
+typedef uint32 (*HPMHOOK_pre_mob_read_db_mode_sub) (struct mob_db **entry, struct config_setting_t **t);
+typedef uint32 (*HPMHOOK_post_mob_read_db_mode_sub) (uint32 retVal___, struct mob_db *entry, struct config_setting_t *t);
+typedef void (*HPMHOOK_pre_mob_read_db_stats_sub) (struct mob_db **entry, struct config_setting_t **t);
+typedef void (*HPMHOOK_post_mob_read_db_stats_sub) (struct mob_db *entry, struct config_setting_t *t);
+typedef void (*HPMHOOK_pre_mob_name_constants) (void);
+typedef void (*HPMHOOK_post_mob_name_constants) (void);
+typedef bool (*HPMHOOK_pre_mob_readdb_mobavail) (char **str[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_mob_readdb_mobavail) (bool retVal___, char *str[], int columns, int current);
+typedef int (*HPMHOOK_pre_mob_read_randommonster) (void);
+typedef int (*HPMHOOK_post_mob_read_randommonster) (int retVal___);
+typedef bool (*HPMHOOK_pre_mob_parse_row_chatdb) (char ***str, const char **source, int *line, int **last_msg_id);
+typedef bool (*HPMHOOK_post_mob_parse_row_chatdb) (bool retVal___, char **str, const char *source, int line, int *last_msg_id);
+typedef void (*HPMHOOK_pre_mob_readchatdb) (void);
+typedef void (*HPMHOOK_post_mob_readchatdb) (void);
+typedef bool (*HPMHOOK_pre_mob_parse_row_mobskilldb) (char ***str, int *columns, int *current);
+typedef bool (*HPMHOOK_post_mob_parse_row_mobskilldb) (bool retVal___, char **str, int columns, int current);
+typedef void (*HPMHOOK_pre_mob_readskilldb) (void);
+typedef void (*HPMHOOK_post_mob_readskilldb) (void);
+typedef bool (*HPMHOOK_pre_mob_readdb_race2) (char **fields[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_mob_readdb_race2) (bool retVal___, char *fields[], int columns, int current);
+typedef bool (*HPMHOOK_pre_mob_readdb_itemratio) (char **str[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_mob_readdb_itemratio) (bool retVal___, char *str[], int columns, int current);
+typedef void (*HPMHOOK_pre_mob_load) (bool *minimal);
+typedef void (*HPMHOOK_post_mob_load) (bool minimal);
+typedef void (*HPMHOOK_pre_mob_clear_spawninfo) (void);
+typedef void (*HPMHOOK_post_mob_clear_spawninfo) (void);
+typedef void (*HPMHOOK_pre_mob_destroy_mob_db) (int *index);
+typedef void (*HPMHOOK_post_mob_destroy_mob_db) (int index);
+#endif // MAP_MOB_H
+#ifdef COMMON_MUTEX_H /* mutex */
+typedef struct mutex_data* (*HPMHOOK_pre_mutex_create) (void);
+typedef struct mutex_data* (*HPMHOOK_post_mutex_create) (struct mutex_data* retVal___);
+typedef void (*HPMHOOK_pre_mutex_destroy) (struct mutex_data **m);
+typedef void (*HPMHOOK_post_mutex_destroy) (struct mutex_data *m);
+typedef void (*HPMHOOK_pre_mutex_lock) (struct mutex_data **m);
+typedef void (*HPMHOOK_post_mutex_lock) (struct mutex_data *m);
+typedef bool (*HPMHOOK_pre_mutex_trylock) (struct mutex_data **m);
+typedef bool (*HPMHOOK_post_mutex_trylock) (bool retVal___, struct mutex_data *m);
+typedef void (*HPMHOOK_pre_mutex_unlock) (struct mutex_data **m);
+typedef void (*HPMHOOK_post_mutex_unlock) (struct mutex_data *m);
+typedef struct cond_data* (*HPMHOOK_pre_mutex_cond_create) (void);
+typedef struct cond_data* (*HPMHOOK_post_mutex_cond_create) (struct cond_data* retVal___);
+typedef void (*HPMHOOK_pre_mutex_cond_destroy) (struct cond_data **c);
+typedef void (*HPMHOOK_post_mutex_cond_destroy) (struct cond_data *c);
+typedef void (*HPMHOOK_pre_mutex_cond_wait) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks);
+typedef void (*HPMHOOK_post_mutex_cond_wait) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks);
+typedef void (*HPMHOOK_pre_mutex_cond_signal) (struct cond_data **c);
+typedef void (*HPMHOOK_post_mutex_cond_signal) (struct cond_data *c);
+typedef void (*HPMHOOK_pre_mutex_cond_broadcast) (struct cond_data **c);
+typedef void (*HPMHOOK_post_mutex_cond_broadcast) (struct cond_data *c);
+#endif // COMMON_MUTEX_H
+#ifdef MAP_NPC_H /* npc_chat */
+typedef int (*HPMHOOK_pre_npc_chat_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_npc_chat_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_npc_chat_finalize) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_chat_finalize) (struct npc_data *nd);
+typedef void (*HPMHOOK_pre_npc_chat_def_pattern) (struct npc_data **nd, int *setid, const char **pattern, const char **label);
+typedef void (*HPMHOOK_post_npc_chat_def_pattern) (struct npc_data *nd, int setid, const char *pattern, const char *label);
+typedef struct pcrematch_entry* (*HPMHOOK_pre_npc_chat_create_pcrematch_entry) (struct pcrematch_set **set);
+typedef struct pcrematch_entry* (*HPMHOOK_post_npc_chat_create_pcrematch_entry) (struct pcrematch_entry* retVal___, struct pcrematch_set *set);
+typedef void (*HPMHOOK_pre_npc_chat_delete_pcreset) (struct npc_data **nd, int *setid);
+typedef void (*HPMHOOK_post_npc_chat_delete_pcreset) (struct npc_data *nd, int setid);
+typedef void (*HPMHOOK_pre_npc_chat_deactivate_pcreset) (struct npc_data **nd, int *setid);
+typedef void (*HPMHOOK_post_npc_chat_deactivate_pcreset) (struct npc_data *nd, int setid);
+typedef void (*HPMHOOK_pre_npc_chat_activate_pcreset) (struct npc_data **nd, int *setid);
+typedef void (*HPMHOOK_post_npc_chat_activate_pcreset) (struct npc_data *nd, int setid);
+typedef struct pcrematch_set* (*HPMHOOK_pre_npc_chat_lookup_pcreset) (struct npc_data **nd, int *setid);
+typedef struct pcrematch_set* (*HPMHOOK_post_npc_chat_lookup_pcreset) (struct pcrematch_set* retVal___, struct npc_data *nd, int setid);
+typedef void (*HPMHOOK_pre_npc_chat_finalize_pcrematch_entry) (struct pcrematch_entry **e);
+typedef void (*HPMHOOK_post_npc_chat_finalize_pcrematch_entry) (struct pcrematch_entry *e);
+#endif // MAP_NPC_H
+#ifdef MAP_NPC_H /* npc */
+typedef int (*HPMHOOK_pre_npc_init) (bool *minimal);
+typedef int (*HPMHOOK_post_npc_init) (int retVal___, bool minimal);
+typedef int (*HPMHOOK_pre_npc_final) (void);
+typedef int (*HPMHOOK_post_npc_final) (int retVal___);
+typedef int (*HPMHOOK_pre_npc_get_new_npc_id) (void);
+typedef int (*HPMHOOK_post_npc_get_new_npc_id) (int retVal___);
+typedef struct view_data* (*HPMHOOK_pre_npc_get_viewdata) (int *class_);
+typedef struct view_data* (*HPMHOOK_post_npc_get_viewdata) (struct view_data* retVal___, int class_);
+typedef int (*HPMHOOK_pre_npc_isnear_sub) (struct block_list **bl, va_list args);
+typedef int (*HPMHOOK_post_npc_isnear_sub) (int retVal___, struct block_list *bl, va_list args);
+typedef bool (*HPMHOOK_pre_npc_isnear) (struct block_list **bl);
+typedef bool (*HPMHOOK_post_npc_isnear) (bool retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_npc_ontouch_event) (struct map_session_data **sd, struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_ontouch_event) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_ontouch2_event) (struct map_session_data **sd, struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_ontouch2_event) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_onuntouch_event) (struct map_session_data **sd, struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_onuntouch_event) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_enable_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_npc_enable_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_npc_enable) (const char **name, int *flag);
+typedef int (*HPMHOOK_post_npc_enable) (int retVal___, const char *name, int flag);
+typedef struct npc_data* (*HPMHOOK_pre_npc_name2id) (const char **name);
+typedef struct npc_data* (*HPMHOOK_post_npc_name2id) (struct npc_data* retVal___, const char *name);
+typedef int (*HPMHOOK_pre_npc_event_dequeue) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_npc_event_dequeue) (int retVal___, struct map_session_data *sd);
+typedef struct DBData (*HPMHOOK_pre_npc_event_export_create) (union DBKey *key, va_list args);
+typedef struct DBData (*HPMHOOK_post_npc_event_export_create) (struct DBData retVal___, union DBKey key, va_list args);
+typedef int (*HPMHOOK_pre_npc_event_export) (struct npc_data **nd, int *i);
+typedef int (*HPMHOOK_post_npc_event_export) (int retVal___, struct npc_data *nd, int i);
+typedef int (*HPMHOOK_pre_npc_event_sub) (struct map_session_data **sd, struct event_data **ev, const char **eventname);
+typedef int (*HPMHOOK_post_npc_event_sub) (int retVal___, struct map_session_data *sd, struct event_data *ev, const char *eventname);
+typedef void (*HPMHOOK_pre_npc_event_doall_sub) (void **key, void **data, va_list ap);
+typedef void (*HPMHOOK_post_npc_event_doall_sub) (void *key, void *data, va_list ap);
+typedef int (*HPMHOOK_pre_npc_event_do) (const char **name);
+typedef int (*HPMHOOK_post_npc_event_do) (int retVal___, const char *name);
+typedef int (*HPMHOOK_pre_npc_event_doall_id) (const char **name, int *rid);
+typedef int (*HPMHOOK_post_npc_event_doall_id) (int retVal___, const char *name, int rid);
+typedef int (*HPMHOOK_pre_npc_event_doall) (const char **name);
+typedef int (*HPMHOOK_post_npc_event_doall) (int retVal___, const char *name);
+typedef int (*HPMHOOK_pre_npc_event_do_clock) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_npc_event_do_clock) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_npc_event_do_oninit) (bool *reload);
+typedef void (*HPMHOOK_post_npc_event_do_oninit) (bool reload);
+typedef int (*HPMHOOK_pre_npc_timerevent_export) (struct npc_data **nd, int *i);
+typedef int (*HPMHOOK_post_npc_timerevent_export) (int retVal___, struct npc_data *nd, int i);
+typedef int (*HPMHOOK_pre_npc_timerevent) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_npc_timerevent) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_npc_timerevent_start) (struct npc_data **nd, int *rid);
+typedef int (*HPMHOOK_post_npc_timerevent_start) (int retVal___, struct npc_data *nd, int rid);
+typedef int (*HPMHOOK_pre_npc_timerevent_stop) (struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_timerevent_stop) (int retVal___, struct npc_data *nd);
+typedef void (*HPMHOOK_pre_npc_timerevent_quit) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_npc_timerevent_quit) (struct map_session_data *sd);
+typedef int64 (*HPMHOOK_pre_npc_gettimerevent_tick) (struct npc_data **nd);
+typedef int64 (*HPMHOOK_post_npc_gettimerevent_tick) (int64 retVal___, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_settimerevent_tick) (struct npc_data **nd, int *newtimer);
+typedef int (*HPMHOOK_post_npc_settimerevent_tick) (int retVal___, struct npc_data *nd, int newtimer);
+typedef int (*HPMHOOK_pre_npc_event) (struct map_session_data **sd, const char **eventname, int *ontouch);
+typedef int (*HPMHOOK_post_npc_event) (int retVal___, struct map_session_data *sd, const char *eventname, int ontouch);
+typedef int (*HPMHOOK_pre_npc_touch_areanpc_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_npc_touch_areanpc_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_npc_touchnext_areanpc) (struct map_session_data **sd, bool *leavemap);
+typedef int (*HPMHOOK_post_npc_touchnext_areanpc) (int retVal___, struct map_session_data *sd, bool leavemap);
+typedef int (*HPMHOOK_pre_npc_touch_areanpc) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y);
+typedef int (*HPMHOOK_post_npc_touch_areanpc) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y);
+typedef int (*HPMHOOK_pre_npc_untouch_areanpc) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y);
+typedef int (*HPMHOOK_post_npc_untouch_areanpc) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y);
+typedef int (*HPMHOOK_pre_npc_touch_areanpc2) (struct mob_data **md);
+typedef int (*HPMHOOK_post_npc_touch_areanpc2) (int retVal___, struct mob_data *md);
+typedef int (*HPMHOOK_pre_npc_check_areanpc) (int *flag, int16 *m, int16 *x, int16 *y, int16 *range);
+typedef int (*HPMHOOK_post_npc_check_areanpc) (int retVal___, int flag, int16 m, int16 x, int16 y, int16 range);
+typedef struct npc_data* (*HPMHOOK_pre_npc_checknear) (struct map_session_data **sd, struct block_list **bl);
+typedef struct npc_data* (*HPMHOOK_post_npc_checknear) (struct npc_data* retVal___, struct map_session_data *sd, struct block_list *bl);
+typedef int (*HPMHOOK_pre_npc_globalmessage) (const char **name, const char **mes);
+typedef int (*HPMHOOK_post_npc_globalmessage) (int retVal___, const char *name, const char *mes);
+typedef void (*HPMHOOK_pre_npc_run_tomb) (struct map_session_data **sd, struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_run_tomb) (struct map_session_data *sd, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_click) (struct map_session_data **sd, struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_click) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_scriptcont) (struct map_session_data **sd, int *id, bool *closing);
+typedef int (*HPMHOOK_post_npc_scriptcont) (int retVal___, struct map_session_data *sd, int id, bool closing);
+typedef int (*HPMHOOK_pre_npc_buysellsel) (struct map_session_data **sd, int *id, int *type);
+typedef int (*HPMHOOK_post_npc_buysellsel) (int retVal___, struct map_session_data *sd, int id, int type);
+typedef int (*HPMHOOK_pre_npc_cashshop_buylist) (struct map_session_data **sd, int *points, struct itemlist **item_list);
+typedef int (*HPMHOOK_post_npc_cashshop_buylist) (int retVal___, struct map_session_data *sd, int points, struct itemlist *item_list);
+typedef int (*HPMHOOK_pre_npc_buylist_sub) (struct map_session_data **sd, struct itemlist **item_list, struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_buylist_sub) (int retVal___, struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_cashshop_buy) (struct map_session_data **sd, int *nameid, int *amount, int *points);
+typedef int (*HPMHOOK_post_npc_cashshop_buy) (int retVal___, struct map_session_data *sd, int nameid, int amount, int points);
+typedef int (*HPMHOOK_pre_npc_buylist) (struct map_session_data **sd, struct itemlist **item_list);
+typedef int (*HPMHOOK_post_npc_buylist) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+typedef int (*HPMHOOK_pre_npc_selllist_sub) (struct map_session_data **sd, struct itemlist **item_list, struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_selllist_sub) (int retVal___, struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_selllist) (struct map_session_data **sd, struct itemlist **item_list);
+typedef int (*HPMHOOK_post_npc_selllist) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+typedef int (*HPMHOOK_pre_npc_remove_map) (struct npc_data **nd);
+typedef int (*HPMHOOK_post_npc_remove_map) (int retVal___, struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_unload_ev) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_npc_unload_ev) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_npc_unload_ev_label) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_npc_unload_ev_label) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_npc_unload_dup_sub) (struct npc_data **nd, va_list args);
+typedef int (*HPMHOOK_post_npc_unload_dup_sub) (int retVal___, struct npc_data *nd, va_list args);
+typedef void (*HPMHOOK_pre_npc_unload_duplicates) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_unload_duplicates) (struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_unload) (struct npc_data **nd, bool *single);
+typedef int (*HPMHOOK_post_npc_unload) (int retVal___, struct npc_data *nd, bool single);
+typedef void (*HPMHOOK_pre_npc_clearsrcfile) (void);
+typedef void (*HPMHOOK_post_npc_clearsrcfile) (void);
+typedef void (*HPMHOOK_pre_npc_addsrcfile) (const char **name);
+typedef void (*HPMHOOK_post_npc_addsrcfile) (const char *name);
+typedef void (*HPMHOOK_pre_npc_delsrcfile) (const char **name);
+typedef void (*HPMHOOK_post_npc_delsrcfile) (const char *name);
+typedef const char* (*HPMHOOK_pre_npc_retainpathreference) (const char **filepath);
+typedef const char* (*HPMHOOK_post_npc_retainpathreference) (const char* retVal___, const char *filepath);
+typedef void (*HPMHOOK_pre_npc_releasepathreference) (const char **filepath);
+typedef void (*HPMHOOK_post_npc_releasepathreference) (const char *filepath);
+typedef void (*HPMHOOK_pre_npc_parsename) (struct npc_data **nd, const char **name, const char **start, const char **buffer, const char **filepath);
+typedef void (*HPMHOOK_post_npc_parsename) (struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath);
+typedef int (*HPMHOOK_pre_npc_parseview) (const char **w4, const char **start, const char **buffer, const char **filepath);
+typedef int (*HPMHOOK_post_npc_parseview) (int retVal___, const char *w4, const char *start, const char *buffer, const char *filepath);
+typedef bool (*HPMHOOK_pre_npc_viewisid) (const char **viewid);
+typedef bool (*HPMHOOK_post_npc_viewisid) (bool retVal___, const char *viewid);
+typedef struct npc_data* (*HPMHOOK_pre_npc_create_npc) (enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_);
+typedef struct npc_data* (*HPMHOOK_post_npc_create_npc) (struct npc_data* retVal___, enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_);
+typedef struct npc_data* (*HPMHOOK_pre_npc_add_warp) (char **name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y);
+typedef struct npc_data* (*HPMHOOK_post_npc_add_warp) (struct npc_data* retVal___, char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y);
+typedef const char* (*HPMHOOK_pre_npc_parse_warp) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_warp) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef const char* (*HPMHOOK_pre_npc_parse_shop) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_shop) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef const char* (*HPMHOOK_pre_npc_parse_unknown_object) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_unknown_object) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef void (*HPMHOOK_pre_npc_convertlabel_db) (struct npc_label_list **label_list, const char **filepath);
+typedef void (*HPMHOOK_post_npc_convertlabel_db) (struct npc_label_list *label_list, const char *filepath);
+typedef const char* (*HPMHOOK_pre_npc_skip_script) (const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_skip_script) (const char* retVal___, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef const char* (*HPMHOOK_pre_npc_parse_script) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_script) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval);
+typedef void (*HPMHOOK_pre_npc_add_to_location) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_add_to_location) (struct npc_data *nd);
+typedef bool (*HPMHOOK_pre_npc_duplicate_script_sub) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
+typedef bool (*HPMHOOK_post_npc_duplicate_script_sub) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+typedef bool (*HPMHOOK_pre_npc_duplicate_shop_sub) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
+typedef bool (*HPMHOOK_post_npc_duplicate_shop_sub) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+typedef bool (*HPMHOOK_pre_npc_duplicate_warp_sub) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
+typedef bool (*HPMHOOK_post_npc_duplicate_warp_sub) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+typedef bool (*HPMHOOK_pre_npc_duplicate_sub) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
+typedef bool (*HPMHOOK_post_npc_duplicate_sub) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+typedef const char* (*HPMHOOK_pre_npc_parse_duplicate) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_duplicate) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval);
+typedef int (*HPMHOOK_pre_npc_duplicate4instance) (struct npc_data **snd, int16 *m);
+typedef int (*HPMHOOK_post_npc_duplicate4instance) (int retVal___, struct npc_data *snd, int16 m);
+typedef void (*HPMHOOK_pre_npc_setcells) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_setcells) (struct npc_data *nd);
+typedef int (*HPMHOOK_pre_npc_unsetcells_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_npc_unsetcells_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_npc_unsetcells) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_unsetcells) (struct npc_data *nd);
+typedef void (*HPMHOOK_pre_npc_movenpc) (struct npc_data **nd, int16 *x, int16 *y);
+typedef void (*HPMHOOK_post_npc_movenpc) (struct npc_data *nd, int16 x, int16 y);
+typedef void (*HPMHOOK_pre_npc_setdisplayname) (struct npc_data **nd, const char **newname);
+typedef void (*HPMHOOK_post_npc_setdisplayname) (struct npc_data *nd, const char *newname);
+typedef void (*HPMHOOK_pre_npc_setclass) (struct npc_data **nd, short *class_);
+typedef void (*HPMHOOK_post_npc_setclass) (struct npc_data *nd, short class_);
+typedef int (*HPMHOOK_pre_npc_do_atcmd_event) (struct map_session_data **sd, const char **command, const char **message, const char **eventname);
+typedef int (*HPMHOOK_post_npc_do_atcmd_event) (int retVal___, struct map_session_data *sd, const char *command, const char *message, const char *eventname);
+typedef const char* (*HPMHOOK_pre_npc_parse_function) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_function) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef void (*HPMHOOK_pre_npc_parse_mob2) (struct spawn_data **mobspawn);
+typedef void (*HPMHOOK_post_npc_parse_mob2) (struct spawn_data *mobspawn);
+typedef const char* (*HPMHOOK_pre_npc_parse_mob) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_mob) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef const char* (*HPMHOOK_pre_npc_parse_mapflag) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef const char* (*HPMHOOK_post_npc_parse_mapflag) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef void (*HPMHOOK_pre_npc_parse_unknown_mapflag) (const char **name, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
+typedef void (*HPMHOOK_post_npc_parse_unknown_mapflag) (const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+typedef int (*HPMHOOK_pre_npc_parsesrcfile) (const char **filepath, bool *runOnInit);
+typedef int (*HPMHOOK_post_npc_parsesrcfile) (int retVal___, const char *filepath, bool runOnInit);
+typedef int (*HPMHOOK_pre_npc_script_event) (struct map_session_data **sd, enum npce_event *type);
+typedef int (*HPMHOOK_post_npc_script_event) (int retVal___, struct map_session_data *sd, enum npce_event type);
+typedef void (*HPMHOOK_pre_npc_read_event_script) (void);
+typedef void (*HPMHOOK_post_npc_read_event_script) (void);
+typedef int (*HPMHOOK_pre_npc_path_db_clear_sub) (union DBKey *key, struct DBData **data, va_list args);
+typedef int (*HPMHOOK_post_npc_path_db_clear_sub) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+typedef int (*HPMHOOK_pre_npc_ev_label_db_clear_sub) (union DBKey *key, struct DBData **data, va_list args);
+typedef int (*HPMHOOK_post_npc_ev_label_db_clear_sub) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+typedef int (*HPMHOOK_pre_npc_reload) (void);
+typedef int (*HPMHOOK_post_npc_reload) (int retVal___);
+typedef bool (*HPMHOOK_pre_npc_unloadfile) (const char **filepath);
+typedef bool (*HPMHOOK_post_npc_unloadfile) (bool retVal___, const char *filepath);
+typedef void (*HPMHOOK_pre_npc_do_clear_npc) (void);
+typedef void (*HPMHOOK_post_npc_do_clear_npc) (void);
+typedef void (*HPMHOOK_pre_npc_debug_warps_sub) (struct npc_data **nd);
+typedef void (*HPMHOOK_post_npc_debug_warps_sub) (struct npc_data *nd);
+typedef void (*HPMHOOK_pre_npc_debug_warps) (void);
+typedef void (*HPMHOOK_post_npc_debug_warps) (void);
+typedef void (*HPMHOOK_pre_npc_trader_count_funds) (struct npc_data **nd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_npc_trader_count_funds) (struct npc_data *nd, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_npc_trader_pay) (struct npc_data **nd, struct map_session_data **sd, int *price, int *points);
+typedef bool (*HPMHOOK_post_npc_trader_pay) (bool retVal___, struct npc_data *nd, struct map_session_data *sd, int price, int points);
+typedef void (*HPMHOOK_pre_npc_trader_update) (int *master);
+typedef void (*HPMHOOK_post_npc_trader_update) (int master);
+typedef int (*HPMHOOK_pre_npc_market_buylist) (struct map_session_data **sd, struct itemlist **item_list);
+typedef int (*HPMHOOK_post_npc_market_buylist) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+typedef bool (*HPMHOOK_pre_npc_trader_open) (struct map_session_data **sd, struct npc_data **nd);
+typedef bool (*HPMHOOK_post_npc_trader_open) (bool retVal___, struct map_session_data *sd, struct npc_data *nd);
+typedef void (*HPMHOOK_pre_npc_market_fromsql) (void);
+typedef void (*HPMHOOK_post_npc_market_fromsql) (void);
+typedef void (*HPMHOOK_pre_npc_market_tosql) (struct npc_data **nd, unsigned short *index);
+typedef void (*HPMHOOK_post_npc_market_tosql) (struct npc_data *nd, unsigned short index);
+typedef void (*HPMHOOK_pre_npc_market_delfromsql) (struct npc_data **nd, unsigned short *index);
+typedef void (*HPMHOOK_post_npc_market_delfromsql) (struct npc_data *nd, unsigned short index);
+typedef void (*HPMHOOK_pre_npc_market_delfromsql_sub) (const char **npcname, unsigned short *index);
+typedef void (*HPMHOOK_post_npc_market_delfromsql_sub) (const char *npcname, unsigned short index);
+typedef bool (*HPMHOOK_pre_npc_db_checkid) (const int *id);
+typedef bool (*HPMHOOK_post_npc_db_checkid) (bool retVal___, const int id);
+typedef int (*HPMHOOK_pre_npc_secure_timeout_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_npc_secure_timeout_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+#endif // MAP_NPC_H
+#ifdef COMMON_NULLPO_H /* nullpo */
+typedef void (*HPMHOOK_pre_nullpo_assert_report) (const char **file, int *line, const char **func, const char **targetname, const char **title);
+typedef void (*HPMHOOK_post_nullpo_assert_report) (const char *file, int line, const char *func, const char *targetname, const char *title);
+#endif // COMMON_NULLPO_H
+#ifdef MAP_PARTY_H /* party */
+typedef void (*HPMHOOK_pre_party_init) (bool *minimal);
+typedef void (*HPMHOOK_post_party_init) (bool minimal);
+typedef void (*HPMHOOK_pre_party_final) (void);
+typedef void (*HPMHOOK_post_party_final) (void);
+typedef struct party_data* (*HPMHOOK_pre_party_search) (int *party_id);
+typedef struct party_data* (*HPMHOOK_post_party_search) (struct party_data* retVal___, int party_id);
+typedef struct party_data* (*HPMHOOK_pre_party_searchname) (const char **str);
+typedef struct party_data* (*HPMHOOK_post_party_searchname) (struct party_data* retVal___, const char *str);
+typedef int (*HPMHOOK_pre_party_getmemberid) (struct party_data **p, struct map_session_data **sd);
+typedef int (*HPMHOOK_post_party_getmemberid) (int retVal___, struct party_data *p, struct map_session_data *sd);
+typedef struct map_session_data* (*HPMHOOK_pre_party_getavailablesd) (struct party_data **p);
+typedef struct map_session_data* (*HPMHOOK_post_party_getavailablesd) (struct map_session_data* retVal___, struct party_data *p);
+typedef int (*HPMHOOK_pre_party_create) (struct map_session_data **sd, const char **name, int *item, int *item2);
+typedef int (*HPMHOOK_post_party_create) (int retVal___, struct map_session_data *sd, const char *name, int item, int item2);
+typedef void (*HPMHOOK_pre_party_created) (int *account_id, int *char_id, int *fail, int *party_id, const char **name);
+typedef void (*HPMHOOK_post_party_created) (int account_id, int char_id, int fail, int party_id, const char *name);
+typedef int (*HPMHOOK_pre_party_request_info) (int *party_id, int *char_id);
+typedef int (*HPMHOOK_post_party_request_info) (int retVal___, int party_id, int char_id);
+typedef int (*HPMHOOK_pre_party_invite) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_party_invite) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_party_member_joined) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_party_member_joined) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_party_member_added) (int *party_id, int *account_id, int *char_id, int *flag);
+typedef int (*HPMHOOK_post_party_member_added) (int retVal___, int party_id, int account_id, int char_id, int flag);
+typedef int (*HPMHOOK_pre_party_leave) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_party_leave) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_party_removemember) (struct map_session_data **sd, int *account_id, const char **name);
+typedef int (*HPMHOOK_post_party_removemember) (int retVal___, struct map_session_data *sd, int account_id, const char *name);
+typedef int (*HPMHOOK_pre_party_member_withdraw) (int *party_id, int *account_id, int *char_id);
+typedef int (*HPMHOOK_post_party_member_withdraw) (int retVal___, int party_id, int account_id, int char_id);
+typedef void (*HPMHOOK_pre_party_reply_invite) (struct map_session_data **sd, int *party_id, int *flag);
+typedef void (*HPMHOOK_post_party_reply_invite) (struct map_session_data *sd, int party_id, int flag);
+typedef int (*HPMHOOK_pre_party_recv_noinfo) (int *party_id, int *char_id);
+typedef int (*HPMHOOK_post_party_recv_noinfo) (int retVal___, int party_id, int char_id);
+typedef int (*HPMHOOK_pre_party_recv_info) (const struct party **sp, int *char_id);
+typedef int (*HPMHOOK_post_party_recv_info) (int retVal___, const struct party *sp, int char_id);
+typedef int (*HPMHOOK_pre_party_recv_movemap) (int *party_id, int *account_id, int *char_id, unsigned short *mapid, int *online, int *lv);
+typedef int (*HPMHOOK_post_party_recv_movemap) (int retVal___, int party_id, int account_id, int char_id, unsigned short mapid, int online, int lv);
+typedef int (*HPMHOOK_pre_party_broken) (int *party_id);
+typedef int (*HPMHOOK_post_party_broken) (int retVal___, int party_id);
+typedef int (*HPMHOOK_pre_party_optionchanged) (int *party_id, int *account_id, int *exp, int *item, int *flag);
+typedef int (*HPMHOOK_post_party_optionchanged) (int retVal___, int party_id, int account_id, int exp, int item, int flag);
+typedef int (*HPMHOOK_pre_party_changeoption) (struct map_session_data **sd, int *exp, int *item);
+typedef int (*HPMHOOK_post_party_changeoption) (int retVal___, struct map_session_data *sd, int exp, int item);
+typedef bool (*HPMHOOK_pre_party_changeleader) (struct map_session_data **sd, struct map_session_data **t_sd);
+typedef bool (*HPMHOOK_post_party_changeleader) (bool retVal___, struct map_session_data *sd, struct map_session_data *t_sd);
+typedef void (*HPMHOOK_pre_party_send_movemap) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_party_send_movemap) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_party_send_levelup) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_party_send_levelup) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_party_send_logout) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_party_send_logout) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_party_send_message) (struct map_session_data **sd, const char **mes);
+typedef int (*HPMHOOK_post_party_send_message) (int retVal___, struct map_session_data *sd, const char *mes);
+typedef int (*HPMHOOK_pre_party_recv_message) (int *party_id, int *account_id, const char **mes, int *len);
+typedef int (*HPMHOOK_post_party_recv_message) (int retVal___, int party_id, int account_id, const char *mes, int len);
+typedef int (*HPMHOOK_pre_party_skill_check) (struct map_session_data **sd, int *party_id, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_party_skill_check) (int retVal___, struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_party_send_xy_clear) (struct party_data **p);
+typedef int (*HPMHOOK_post_party_send_xy_clear) (int retVal___, struct party_data *p);
+typedef int (*HPMHOOK_pre_party_exp_share) (struct party_data **p, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, int *zeny);
+typedef int (*HPMHOOK_post_party_exp_share) (int retVal___, struct party_data *p, struct block_list *src, unsigned int base_exp, unsigned int job_exp, int zeny);
+typedef int (*HPMHOOK_pre_party_share_loot) (struct party_data **p, struct map_session_data **sd, struct item **item_data, int *first_charid);
+typedef int (*HPMHOOK_post_party_share_loot) (int retVal___, struct party_data *p, struct map_session_data *sd, struct item *item_data, int first_charid);
+typedef int (*HPMHOOK_pre_party_send_dot_remove) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_party_send_dot_remove) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_party_sub_count) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_party_sub_count) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_party_sub_count_chorus) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_party_sub_count_chorus) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_party_booking_register) (struct map_session_data **sd, short *level, short *mapid, short **job);
+typedef void (*HPMHOOK_post_party_booking_register) (struct map_session_data *sd, short level, short mapid, short *job);
+typedef void (*HPMHOOK_pre_party_booking_update) (struct map_session_data **sd, short **job);
+typedef void (*HPMHOOK_post_party_booking_update) (struct map_session_data *sd, short *job);
+typedef void (*HPMHOOK_pre_party_booking_search) (struct map_session_data **sd, short *level, short *mapid, short *job, unsigned long *lastindex, short *resultcount);
+typedef void (*HPMHOOK_post_party_booking_search) (struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount);
+typedef void (*HPMHOOK_pre_party_recruit_register) (struct map_session_data **sd, short *level, const char **notice);
+typedef void (*HPMHOOK_post_party_recruit_register) (struct map_session_data *sd, short level, const char *notice);
+typedef void (*HPMHOOK_pre_party_recruit_update) (struct map_session_data **sd, const char **notice);
+typedef void (*HPMHOOK_post_party_recruit_update) (struct map_session_data *sd, const char *notice);
+typedef void (*HPMHOOK_pre_party_recruit_search) (struct map_session_data **sd, short *level, short *mapid, unsigned long *lastindex, short *resultcount);
+typedef void (*HPMHOOK_post_party_recruit_search) (struct map_session_data *sd, short level, short mapid, unsigned long lastindex, short resultcount);
+typedef bool (*HPMHOOK_pre_party_booking_delete) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_party_booking_delete) (bool retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_party_vforeachsamemap) (int ( **func ) (struct block_list *, va_list), struct map_session_data **sd, int *range, va_list ap);
+typedef int (*HPMHOOK_post_party_vforeachsamemap) (int retVal___, int ( *func ) (struct block_list *, va_list), struct map_session_data *sd, int range, va_list ap);
+typedef int (*HPMHOOK_pre_party_send_xy_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_party_send_xy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_party_fill_member) (struct party_member **member, struct map_session_data **sd, unsigned int *leader);
+typedef void (*HPMHOOK_post_party_fill_member) (struct party_member *member, struct map_session_data *sd, unsigned int leader);
+typedef struct map_session_data* (*HPMHOOK_pre_party_sd_check) (int *party_id, int *account_id, int *char_id);
+typedef struct map_session_data* (*HPMHOOK_post_party_sd_check) (struct map_session_data* retVal___, int party_id, int account_id, int char_id);
+typedef void (*HPMHOOK_pre_party_check_state) (struct party_data **p);
+typedef void (*HPMHOOK_post_party_check_state) (struct party_data *p);
+typedef struct party_booking_ad_info* (*HPMHOOK_pre_party_create_booking_data) (void);
+typedef struct party_booking_ad_info* (*HPMHOOK_post_party_create_booking_data) (struct party_booking_ad_info* retVal___);
+typedef int (*HPMHOOK_pre_party_db_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_party_db_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+#endif // MAP_PARTY_H
+#ifdef MAP_PATH_H /* path */
+typedef int (*HPMHOOK_pre_path_blownpos) (struct block_list **bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
+typedef int (*HPMHOOK_post_path_blownpos) (int retVal___, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count);
+typedef bool (*HPMHOOK_pre_path_search) (struct walkpath_data **wpd, struct block_list **bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
+typedef bool (*HPMHOOK_post_path_search) (bool retVal___, struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell);
+typedef bool (*HPMHOOK_pre_path_search_long) (struct shootpath_data **spd, struct block_list **bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
+typedef bool (*HPMHOOK_post_path_search_long) (bool retVal___, struct shootpath_data *spd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell);
+typedef bool (*HPMHOOK_pre_path_check_distance) (int *dx, int *dy, int *distance);
+typedef bool (*HPMHOOK_post_path_check_distance) (bool retVal___, int dx, int dy, int distance);
+typedef unsigned int (*HPMHOOK_pre_path_distance) (int *dx, int *dy);
+typedef unsigned int (*HPMHOOK_post_path_distance) (unsigned int retVal___, int dx, int dy);
+typedef bool (*HPMHOOK_pre_path_check_distance_client) (int *dx, int *dy, int *distance);
+typedef bool (*HPMHOOK_post_path_check_distance_client) (bool retVal___, int dx, int dy, int distance);
+typedef int (*HPMHOOK_pre_path_distance_client) (int *dx, int *dy);
+typedef int (*HPMHOOK_post_path_distance_client) (int retVal___, int dx, int dy);
+#endif // MAP_PATH_H
+#ifdef MAP_PC_GROUPS_H /* pcg */
+typedef void (*HPMHOOK_pre_pcg_init) (void);
+typedef void (*HPMHOOK_post_pcg_init) (void);
+typedef void (*HPMHOOK_pre_pcg_final) (void);
+typedef void (*HPMHOOK_post_pcg_final) (void);
+typedef void (*HPMHOOK_pre_pcg_reload) (void);
+typedef void (*HPMHOOK_post_pcg_reload) (void);
+typedef GroupSettings* (*HPMHOOK_pre_pcg_get_dummy_group) (void);
+typedef GroupSettings* (*HPMHOOK_post_pcg_get_dummy_group) (GroupSettings* retVal___);
+typedef bool (*HPMHOOK_pre_pcg_exists) (int *group_id);
+typedef bool (*HPMHOOK_post_pcg_exists) (bool retVal___, int group_id);
+typedef GroupSettings* (*HPMHOOK_pre_pcg_id2group) (int *group_id);
+typedef GroupSettings* (*HPMHOOK_post_pcg_id2group) (GroupSettings* retVal___, int group_id);
+typedef bool (*HPMHOOK_pre_pcg_has_permission) (GroupSettings **group, unsigned int *permission);
+typedef bool (*HPMHOOK_post_pcg_has_permission) (bool retVal___, GroupSettings *group, unsigned int permission);
+typedef bool (*HPMHOOK_pre_pcg_should_log_commands) (GroupSettings **group);
+typedef bool (*HPMHOOK_post_pcg_should_log_commands) (bool retVal___, GroupSettings *group);
+typedef const char* (*HPMHOOK_pre_pcg_get_name) (GroupSettings **group);
+typedef const char* (*HPMHOOK_post_pcg_get_name) (const char* retVal___, GroupSettings *group);
+typedef int (*HPMHOOK_pre_pcg_get_level) (GroupSettings **group);
+typedef int (*HPMHOOK_post_pcg_get_level) (int retVal___, GroupSettings *group);
+typedef int (*HPMHOOK_pre_pcg_get_idx) (GroupSettings **group);
+typedef int (*HPMHOOK_post_pcg_get_idx) (int retVal___, GroupSettings *group);
+#endif // MAP_PC_GROUPS_H
+#ifdef MAP_PC_H /* pc */
+typedef void (*HPMHOOK_pre_pc_init) (bool *minimal);
+typedef void (*HPMHOOK_post_pc_init) (bool minimal);
+typedef void (*HPMHOOK_pre_pc_final) (void);
+typedef void (*HPMHOOK_post_pc_final) (void);
+typedef struct map_session_data* (*HPMHOOK_pre_pc_get_dummy_sd) (void);
+typedef struct map_session_data* (*HPMHOOK_post_pc_get_dummy_sd) (struct map_session_data* retVal___);
+typedef int (*HPMHOOK_pre_pc_class2idx) (int *class);
+typedef int (*HPMHOOK_post_pc_class2idx) (int retVal___, int class);
+typedef bool (*HPMHOOK_pre_pc_can_talk) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_pc_can_talk) (bool retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_pc_can_attack) (struct map_session_data **sd, int *target_id);
+typedef bool (*HPMHOOK_post_pc_can_attack) (bool retVal___, struct map_session_data *sd, int target_id);
+typedef bool (*HPMHOOK_pre_pc_can_use_command) (struct map_session_data **sd, const char **command);
+typedef bool (*HPMHOOK_post_pc_can_use_command) (bool retVal___, struct map_session_data *sd, const char *command);
+typedef int (*HPMHOOK_pre_pc_set_group) (struct map_session_data **sd, int *group_id);
+typedef int (*HPMHOOK_post_pc_set_group) (int retVal___, struct map_session_data *sd, int group_id);
+typedef bool (*HPMHOOK_pre_pc_should_log_commands) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_pc_should_log_commands) (bool retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_setrestartvalue) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_setrestartvalue) (int retVal___, struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_pc_makesavestatus) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_makesavestatus) (int retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_respawn) (struct map_session_data **sd, clr_type *clrtype);
+typedef void (*HPMHOOK_post_pc_respawn) (struct map_session_data *sd, clr_type clrtype);
+typedef int (*HPMHOOK_pre_pc_setnewpc) (struct map_session_data **sd, int *account_id, int *char_id, int *login_id1, unsigned int *client_tick, int *sex, int *fd);
+typedef int (*HPMHOOK_post_pc_setnewpc) (int retVal___, struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd);
+typedef bool (*HPMHOOK_pre_pc_authok) (struct map_session_data **sd, int *login_id2, time_t *expiration_time, int *group_id, const struct mmo_charstatus **st, bool *changing_mapservers);
+typedef bool (*HPMHOOK_post_pc_authok) (bool retVal___, struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers);
+typedef void (*HPMHOOK_pre_pc_authfail) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_authfail) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_reg_received) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_reg_received) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_isequip) (struct map_session_data **sd, int *n);
+typedef int (*HPMHOOK_post_pc_isequip) (int retVal___, struct map_session_data *sd, int n);
+typedef int (*HPMHOOK_pre_pc_equippoint) (struct map_session_data **sd, int *n);
+typedef int (*HPMHOOK_post_pc_equippoint) (int retVal___, struct map_session_data *sd, int n);
+typedef int (*HPMHOOK_pre_pc_setinventorydata) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_setinventorydata) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_checkskill) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_pc_checkskill) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_pc_checkskill2) (struct map_session_data **sd, uint16 *index);
+typedef int (*HPMHOOK_post_pc_checkskill2) (int retVal___, struct map_session_data *sd, uint16 index);
+typedef int (*HPMHOOK_pre_pc_checkallowskill) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_checkallowskill) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_checkequip) (struct map_session_data **sd, int *pos);
+typedef int (*HPMHOOK_post_pc_checkequip) (int retVal___, struct map_session_data *sd, int pos);
+typedef int (*HPMHOOK_pre_pc_calc_skilltree) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_calc_skilltree) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_calc_skilltree_normalize_job) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_calc_skilltree_normalize_job) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_clean_skilltree) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_clean_skilltree) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_setpos) (struct map_session_data **sd, unsigned short *map_index, int *x, int *y, clr_type *clrtype);
+typedef int (*HPMHOOK_post_pc_setpos) (int retVal___, struct map_session_data *sd, unsigned short map_index, int x, int y, clr_type clrtype);
+typedef int (*HPMHOOK_pre_pc_setsavepoint) (struct map_session_data **sd, short *map_index, int *x, int *y);
+typedef int (*HPMHOOK_post_pc_setsavepoint) (int retVal___, struct map_session_data *sd, short map_index, int x, int y);
+typedef int (*HPMHOOK_pre_pc_randomwarp) (struct map_session_data **sd, clr_type *type);
+typedef int (*HPMHOOK_post_pc_randomwarp) (int retVal___, struct map_session_data *sd, clr_type type);
+typedef int (*HPMHOOK_pre_pc_memo) (struct map_session_data **sd, int *pos);
+typedef int (*HPMHOOK_post_pc_memo) (int retVal___, struct map_session_data *sd, int pos);
+typedef int (*HPMHOOK_pre_pc_checkadditem) (struct map_session_data **sd, int *nameid, int *amount);
+typedef int (*HPMHOOK_post_pc_checkadditem) (int retVal___, struct map_session_data *sd, int nameid, int amount);
+typedef int (*HPMHOOK_pre_pc_inventoryblank) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_inventoryblank) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_search_inventory) (struct map_session_data **sd, int *item_id);
+typedef int (*HPMHOOK_post_pc_search_inventory) (int retVal___, struct map_session_data *sd, int item_id);
+typedef int (*HPMHOOK_pre_pc_payzeny) (struct map_session_data **sd, int *zeny, enum e_log_pick_type *type, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_pc_payzeny) (int retVal___, struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd);
+typedef int (*HPMHOOK_pre_pc_additem) (struct map_session_data **sd, struct item **item_data, int *amount, e_log_pick_type *log_type);
+typedef int (*HPMHOOK_post_pc_additem) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type);
+typedef int (*HPMHOOK_pre_pc_getzeny) (struct map_session_data **sd, int *zeny, enum e_log_pick_type *type, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_pc_getzeny) (int retVal___, struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd);
+typedef int (*HPMHOOK_pre_pc_delitem) (struct map_session_data **sd, int *n, int *amount, int *type, short *reason, e_log_pick_type *log_type);
+typedef int (*HPMHOOK_post_pc_delitem) (int retVal___, struct map_session_data *sd, int n, int amount, int type, short reason, e_log_pick_type log_type);
+typedef int (*HPMHOOK_pre_pc_paycash) (struct map_session_data **sd, int *price, int *points);
+typedef int (*HPMHOOK_post_pc_paycash) (int retVal___, struct map_session_data *sd, int price, int points);
+typedef int (*HPMHOOK_pre_pc_getcash) (struct map_session_data **sd, int *cash, int *points);
+typedef int (*HPMHOOK_post_pc_getcash) (int retVal___, struct map_session_data *sd, int cash, int points);
+typedef int (*HPMHOOK_pre_pc_cart_additem) (struct map_session_data **sd, struct item **item_data, int *amount, e_log_pick_type *log_type);
+typedef int (*HPMHOOK_post_pc_cart_additem) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type);
+typedef int (*HPMHOOK_pre_pc_cart_delitem) (struct map_session_data **sd, int *n, int *amount, int *type, e_log_pick_type *log_type);
+typedef int (*HPMHOOK_post_pc_cart_delitem) (int retVal___, struct map_session_data *sd, int n, int amount, int type, e_log_pick_type log_type);
+typedef int (*HPMHOOK_pre_pc_putitemtocart) (struct map_session_data **sd, int *idx, int *amount);
+typedef int (*HPMHOOK_post_pc_putitemtocart) (int retVal___, struct map_session_data *sd, int idx, int amount);
+typedef int (*HPMHOOK_pre_pc_getitemfromcart) (struct map_session_data **sd, int *idx, int *amount);
+typedef int (*HPMHOOK_post_pc_getitemfromcart) (int retVal___, struct map_session_data *sd, int idx, int amount);
+typedef int (*HPMHOOK_pre_pc_cartitem_amount) (struct map_session_data **sd, int *idx, int *amount);
+typedef int (*HPMHOOK_post_pc_cartitem_amount) (int retVal___, struct map_session_data *sd, int idx, int amount);
+typedef int (*HPMHOOK_pre_pc_takeitem) (struct map_session_data **sd, struct flooritem_data **fitem);
+typedef int (*HPMHOOK_post_pc_takeitem) (int retVal___, struct map_session_data *sd, struct flooritem_data *fitem);
+typedef int (*HPMHOOK_pre_pc_dropitem) (struct map_session_data **sd, int *n, int *amount);
+typedef int (*HPMHOOK_post_pc_dropitem) (int retVal___, struct map_session_data *sd, int n, int amount);
+typedef bool (*HPMHOOK_pre_pc_isequipped) (struct map_session_data **sd, int *nameid);
+typedef bool (*HPMHOOK_post_pc_isequipped) (bool retVal___, struct map_session_data *sd, int nameid);
+typedef bool (*HPMHOOK_pre_pc_can_Adopt) (struct map_session_data **p1_sd, struct map_session_data **p2_sd, struct map_session_data **b_sd);
+typedef bool (*HPMHOOK_post_pc_can_Adopt) (bool retVal___, struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
+typedef bool (*HPMHOOK_pre_pc_adoption) (struct map_session_data **p1_sd, struct map_session_data **p2_sd, struct map_session_data **b_sd);
+typedef bool (*HPMHOOK_post_pc_adoption) (bool retVal___, struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
+typedef int (*HPMHOOK_pre_pc_updateweightstatus) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_updateweightstatus) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_addautobonus) (struct s_autobonus **bonus, char *max, const char **bonus_script, short *rate, unsigned int *dur, short *atk_type, const char **o_script, unsigned short *pos, bool *onskill);
+typedef int (*HPMHOOK_post_pc_addautobonus) (int retVal___, struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned short pos, bool onskill);
+typedef int (*HPMHOOK_pre_pc_exeautobonus) (struct map_session_data **sd, struct s_autobonus **bonus);
+typedef int (*HPMHOOK_post_pc_exeautobonus) (int retVal___, struct map_session_data *sd, struct s_autobonus *bonus);
+typedef int (*HPMHOOK_pre_pc_endautobonus) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_endautobonus) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_delautobonus) (struct map_session_data **sd, struct s_autobonus **bonus, char *max, bool *restore);
+typedef int (*HPMHOOK_post_pc_delautobonus) (int retVal___, struct map_session_data *sd, struct s_autobonus *bonus, char max, bool restore);
+typedef int (*HPMHOOK_pre_pc_bonus) (struct map_session_data **sd, int *type, int *val);
+typedef int (*HPMHOOK_post_pc_bonus) (int retVal___, struct map_session_data *sd, int type, int val);
+typedef int (*HPMHOOK_pre_pc_bonus2) (struct map_session_data **sd, int *type, int *type2, int *val);
+typedef int (*HPMHOOK_post_pc_bonus2) (int retVal___, struct map_session_data *sd, int type, int type2, int val);
+typedef int (*HPMHOOK_pre_pc_bonus3) (struct map_session_data **sd, int *type, int *type2, int *type3, int *val);
+typedef int (*HPMHOOK_post_pc_bonus3) (int retVal___, struct map_session_data *sd, int type, int type2, int type3, int val);
+typedef int (*HPMHOOK_pre_pc_bonus4) (struct map_session_data **sd, int *type, int *type2, int *type3, int *type4, int *val);
+typedef int (*HPMHOOK_post_pc_bonus4) (int retVal___, struct map_session_data *sd, int type, int type2, int type3, int type4, int val);
+typedef int (*HPMHOOK_pre_pc_bonus5) (struct map_session_data **sd, int *type, int *type2, int *type3, int *type4, int *type5, int *val);
+typedef int (*HPMHOOK_post_pc_bonus5) (int retVal___, struct map_session_data *sd, int type, int type2, int type3, int type4, int type5, int val);
+typedef int (*HPMHOOK_pre_pc_skill) (struct map_session_data **sd, int *id, int *level, int *flag);
+typedef int (*HPMHOOK_post_pc_skill) (int retVal___, struct map_session_data *sd, int id, int level, int flag);
+typedef int (*HPMHOOK_pre_pc_insert_card) (struct map_session_data **sd, int *idx_card, int *idx_equip);
+typedef int (*HPMHOOK_post_pc_insert_card) (int retVal___, struct map_session_data *sd, int idx_card, int idx_equip);
+typedef bool (*HPMHOOK_pre_pc_can_insert_card) (struct map_session_data **sd, int *idx_card);
+typedef bool (*HPMHOOK_post_pc_can_insert_card) (bool retVal___, struct map_session_data *sd, int idx_card);
+typedef bool (*HPMHOOK_pre_pc_can_insert_card_into) (struct map_session_data **sd, int *idx_card, int *idx_equip);
+typedef bool (*HPMHOOK_post_pc_can_insert_card_into) (bool retVal___, struct map_session_data *sd, int idx_card, int idx_equip);
+typedef int (*HPMHOOK_pre_pc_steal_item) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_pc_steal_item) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_pc_steal_coin) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_pc_steal_coin) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_pc_modifybuyvalue) (struct map_session_data **sd, int *orig_value);
+typedef int (*HPMHOOK_post_pc_modifybuyvalue) (int retVal___, struct map_session_data *sd, int orig_value);
+typedef int (*HPMHOOK_pre_pc_modifysellvalue) (struct map_session_data **sd, int *orig_value);
+typedef int (*HPMHOOK_post_pc_modifysellvalue) (int retVal___, struct map_session_data *sd, int orig_value);
+typedef int (*HPMHOOK_pre_pc_follow) (struct map_session_data **sd, int *target_id);
+typedef int (*HPMHOOK_post_pc_follow) (int retVal___, struct map_session_data *sd, int target_id);
+typedef int (*HPMHOOK_pre_pc_stop_following) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_stop_following) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_maxbaselv) (const struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_maxbaselv) (int retVal___, const struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_maxjoblv) (const struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_maxjoblv) (int retVal___, const struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_checkbaselevelup) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_checkbaselevelup) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_checkjoblevelup) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_checkjoblevelup) (int retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_pc_gainexp) (struct map_session_data **sd, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest);
+typedef bool (*HPMHOOK_post_pc_gainexp) (bool retVal___, struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest);
+typedef unsigned int (*HPMHOOK_pre_pc_nextbaseexp) (const struct map_session_data **sd);
+typedef unsigned int (*HPMHOOK_post_pc_nextbaseexp) (unsigned int retVal___, const struct map_session_data *sd);
+typedef unsigned int (*HPMHOOK_pre_pc_thisbaseexp) (const struct map_session_data **sd);
+typedef unsigned int (*HPMHOOK_post_pc_thisbaseexp) (unsigned int retVal___, const struct map_session_data *sd);
+typedef unsigned int (*HPMHOOK_pre_pc_nextjobexp) (const struct map_session_data **sd);
+typedef unsigned int (*HPMHOOK_post_pc_nextjobexp) (unsigned int retVal___, const struct map_session_data *sd);
+typedef unsigned int (*HPMHOOK_pre_pc_thisjobexp) (const struct map_session_data **sd);
+typedef unsigned int (*HPMHOOK_post_pc_thisjobexp) (unsigned int retVal___, const struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_gets_status_point) (int *level);
+typedef int (*HPMHOOK_post_pc_gets_status_point) (int retVal___, int level);
+typedef int (*HPMHOOK_pre_pc_need_status_point) (struct map_session_data **sd, int *type, int *val);
+typedef int (*HPMHOOK_post_pc_need_status_point) (int retVal___, struct map_session_data *sd, int type, int val);
+typedef int (*HPMHOOK_pre_pc_maxparameterincrease) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_maxparameterincrease) (int retVal___, struct map_session_data *sd, int type);
+typedef bool (*HPMHOOK_pre_pc_statusup) (struct map_session_data **sd, int *type, int *increase);
+typedef bool (*HPMHOOK_post_pc_statusup) (bool retVal___, struct map_session_data *sd, int type, int increase);
+typedef int (*HPMHOOK_pre_pc_statusup2) (struct map_session_data **sd, int *type, int *val);
+typedef int (*HPMHOOK_post_pc_statusup2) (int retVal___, struct map_session_data *sd, int type, int val);
+typedef int (*HPMHOOK_pre_pc_skillup) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_pc_skillup) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_pc_allskillup) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_allskillup) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_resetlvl) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_resetlvl) (int retVal___, struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_pc_resetstate) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_resetstate) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_resetskill) (struct map_session_data **sd, int *flag);
+typedef int (*HPMHOOK_post_pc_resetskill) (int retVal___, struct map_session_data *sd, int flag);
+typedef int (*HPMHOOK_pre_pc_resetfeel) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_resetfeel) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_resethate) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_resethate) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_equipitem) (struct map_session_data **sd, int *n, int *req_pos);
+typedef int (*HPMHOOK_post_pc_equipitem) (int retVal___, struct map_session_data *sd, int n, int req_pos);
+typedef void (*HPMHOOK_pre_pc_equipitem_pos) (struct map_session_data **sd, struct item_data **id, int *n, int *pos);
+typedef void (*HPMHOOK_post_pc_equipitem_pos) (struct map_session_data *sd, struct item_data *id, int n, int pos);
+typedef int (*HPMHOOK_pre_pc_unequipitem) (struct map_session_data **sd, int *n, int *flag);
+typedef int (*HPMHOOK_post_pc_unequipitem) (int retVal___, struct map_session_data *sd, int n, int flag);
+typedef void (*HPMHOOK_pre_pc_unequipitem_pos) (struct map_session_data **sd, int *n, int *pos);
+typedef void (*HPMHOOK_post_pc_unequipitem_pos) (struct map_session_data *sd, int n, int pos);
+typedef int (*HPMHOOK_pre_pc_checkitem) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_checkitem) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_useitem) (struct map_session_data **sd, int *n);
+typedef int (*HPMHOOK_post_pc_useitem) (int retVal___, struct map_session_data *sd, int n);
+typedef int (*HPMHOOK_pre_pc_skillatk_bonus) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_pc_skillatk_bonus) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_pc_skillheal_bonus) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_pc_skillheal_bonus) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_pc_skillheal2_bonus) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_pc_skillheal2_bonus) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef void (*HPMHOOK_pre_pc_damage) (struct map_session_data **sd, struct block_list **src, unsigned int *hp, unsigned int *sp);
+typedef void (*HPMHOOK_post_pc_damage) (struct map_session_data *sd, struct block_list *src, unsigned int hp, unsigned int sp);
+typedef int (*HPMHOOK_pre_pc_dead) (struct map_session_data **sd, struct block_list **src);
+typedef int (*HPMHOOK_post_pc_dead) (int retVal___, struct map_session_data *sd, struct block_list *src);
+typedef void (*HPMHOOK_pre_pc_revive) (struct map_session_data **sd, unsigned int *hp, unsigned int *sp);
+typedef void (*HPMHOOK_post_pc_revive) (struct map_session_data *sd, unsigned int hp, unsigned int sp);
+typedef void (*HPMHOOK_pre_pc_heal) (struct map_session_data **sd, unsigned int *hp, unsigned int *sp, int *type);
+typedef void (*HPMHOOK_post_pc_heal) (struct map_session_data *sd, unsigned int hp, unsigned int sp, int type);
+typedef int (*HPMHOOK_pre_pc_itemheal) (struct map_session_data **sd, int *itemid, int *hp, int *sp);
+typedef int (*HPMHOOK_post_pc_itemheal) (int retVal___, struct map_session_data *sd, int itemid, int hp, int sp);
+typedef int (*HPMHOOK_pre_pc_percentheal) (struct map_session_data **sd, int *hp, int *sp);
+typedef int (*HPMHOOK_post_pc_percentheal) (int retVal___, struct map_session_data *sd, int hp, int sp);
+typedef int (*HPMHOOK_pre_pc_jobchange) (struct map_session_data **sd, int *class, int *upper);
+typedef int (*HPMHOOK_post_pc_jobchange) (int retVal___, struct map_session_data *sd, int class, int upper);
+typedef int (*HPMHOOK_pre_pc_setoption) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_setoption) (int retVal___, struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_pc_setcart) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_setcart) (int retVal___, struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_pc_setfalcon) (struct map_session_data **sd, bool *flag);
+typedef void (*HPMHOOK_post_pc_setfalcon) (struct map_session_data *sd, bool flag);
+typedef void (*HPMHOOK_pre_pc_setridingpeco) (struct map_session_data **sd, bool *flag);
+typedef void (*HPMHOOK_post_pc_setridingpeco) (struct map_session_data *sd, bool flag);
+typedef void (*HPMHOOK_pre_pc_setmadogear) (struct map_session_data **sd, bool *flag);
+typedef void (*HPMHOOK_post_pc_setmadogear) (struct map_session_data *sd, bool flag);
+typedef void (*HPMHOOK_pre_pc_setridingdragon) (struct map_session_data **sd, unsigned int *type);
+typedef void (*HPMHOOK_post_pc_setridingdragon) (struct map_session_data *sd, unsigned int type);
+typedef void (*HPMHOOK_pre_pc_setridingwug) (struct map_session_data **sd, bool *flag);
+typedef void (*HPMHOOK_post_pc_setridingwug) (struct map_session_data *sd, bool flag);
+typedef int (*HPMHOOK_pre_pc_changelook) (struct map_session_data **sd, int *type, int *val);
+typedef int (*HPMHOOK_post_pc_changelook) (int retVal___, struct map_session_data *sd, int type, int val);
+typedef int (*HPMHOOK_pre_pc_equiplookall) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_equiplookall) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_readparam) (const struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_readparam) (int retVal___, const struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_pc_setparam) (struct map_session_data **sd, int *type, int *val);
+typedef int (*HPMHOOK_post_pc_setparam) (int retVal___, struct map_session_data *sd, int type, int val);
+typedef int (*HPMHOOK_pre_pc_readreg) (struct map_session_data **sd, int64 *reg);
+typedef int (*HPMHOOK_post_pc_readreg) (int retVal___, struct map_session_data *sd, int64 reg);
+typedef void (*HPMHOOK_pre_pc_setreg) (struct map_session_data **sd, int64 *reg, int *val);
+typedef void (*HPMHOOK_post_pc_setreg) (struct map_session_data *sd, int64 reg, int val);
+typedef char* (*HPMHOOK_pre_pc_readregstr) (struct map_session_data **sd, int64 *reg);
+typedef char* (*HPMHOOK_post_pc_readregstr) (char* retVal___, struct map_session_data *sd, int64 reg);
+typedef void (*HPMHOOK_pre_pc_setregstr) (struct map_session_data **sd, int64 *reg, const char **str);
+typedef void (*HPMHOOK_post_pc_setregstr) (struct map_session_data *sd, int64 reg, const char *str);
+typedef int (*HPMHOOK_pre_pc_readregistry) (struct map_session_data **sd, int64 *reg);
+typedef int (*HPMHOOK_post_pc_readregistry) (int retVal___, struct map_session_data *sd, int64 reg);
+typedef int (*HPMHOOK_pre_pc_setregistry) (struct map_session_data **sd, int64 *reg, int *val);
+typedef int (*HPMHOOK_post_pc_setregistry) (int retVal___, struct map_session_data *sd, int64 reg, int val);
+typedef char* (*HPMHOOK_pre_pc_readregistry_str) (struct map_session_data **sd, int64 *reg);
+typedef char* (*HPMHOOK_post_pc_readregistry_str) (char* retVal___, struct map_session_data *sd, int64 reg);
+typedef int (*HPMHOOK_pre_pc_setregistry_str) (struct map_session_data **sd, int64 *reg, const char **val);
+typedef int (*HPMHOOK_post_pc_setregistry_str) (int retVal___, struct map_session_data *sd, int64 reg, const char *val);
+typedef int (*HPMHOOK_pre_pc_addeventtimer) (struct map_session_data **sd, int *tick, const char **name);
+typedef int (*HPMHOOK_post_pc_addeventtimer) (int retVal___, struct map_session_data *sd, int tick, const char *name);
+typedef int (*HPMHOOK_pre_pc_deleventtimer) (struct map_session_data **sd, const char **name);
+typedef int (*HPMHOOK_post_pc_deleventtimer) (int retVal___, struct map_session_data *sd, const char *name);
+typedef int (*HPMHOOK_pre_pc_cleareventtimer) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_cleareventtimer) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_addeventtimercount) (struct map_session_data **sd, const char **name, int *tick);
+typedef int (*HPMHOOK_post_pc_addeventtimercount) (int retVal___, struct map_session_data *sd, const char *name, int tick);
+typedef int (*HPMHOOK_pre_pc_calc_pvprank) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_calc_pvprank) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_calc_pvprank_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_calc_pvprank_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_ismarried) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_ismarried) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_marriage) (struct map_session_data **sd, struct map_session_data **dstsd);
+typedef int (*HPMHOOK_post_pc_marriage) (int retVal___, struct map_session_data *sd, struct map_session_data *dstsd);
+typedef int (*HPMHOOK_pre_pc_divorce) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_divorce) (int retVal___, struct map_session_data *sd);
+typedef struct map_session_data* (*HPMHOOK_pre_pc_get_partner) (struct map_session_data **sd);
+typedef struct map_session_data* (*HPMHOOK_post_pc_get_partner) (struct map_session_data* retVal___, struct map_session_data *sd);
+typedef struct map_session_data* (*HPMHOOK_pre_pc_get_father) (struct map_session_data **sd);
+typedef struct map_session_data* (*HPMHOOK_post_pc_get_father) (struct map_session_data* retVal___, struct map_session_data *sd);
+typedef struct map_session_data* (*HPMHOOK_pre_pc_get_mother) (struct map_session_data **sd);
+typedef struct map_session_data* (*HPMHOOK_post_pc_get_mother) (struct map_session_data* retVal___, struct map_session_data *sd);
+typedef struct map_session_data* (*HPMHOOK_pre_pc_get_child) (struct map_session_data **sd);
+typedef struct map_session_data* (*HPMHOOK_post_pc_get_child) (struct map_session_data* retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_bleeding) (struct map_session_data **sd, unsigned int *diff_tick);
+typedef void (*HPMHOOK_post_pc_bleeding) (struct map_session_data *sd, unsigned int diff_tick);
+typedef void (*HPMHOOK_pre_pc_regen) (struct map_session_data **sd, unsigned int *diff_tick);
+typedef void (*HPMHOOK_post_pc_regen) (struct map_session_data *sd, unsigned int diff_tick);
+typedef void (*HPMHOOK_pre_pc_setstand) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_setstand) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_candrop) (struct map_session_data **sd, struct item **item);
+typedef int (*HPMHOOK_post_pc_candrop) (int retVal___, struct map_session_data *sd, struct item *item);
+typedef int (*HPMHOOK_pre_pc_jobid2mapid) (int16 *class);
+typedef int (*HPMHOOK_post_pc_jobid2mapid) (int retVal___, int16 class);
+typedef int (*HPMHOOK_pre_pc_mapid2jobid) (unsigned short *class_, int *sex);
+typedef int (*HPMHOOK_post_pc_mapid2jobid) (int retVal___, unsigned short class_, int sex);
+typedef const char* (*HPMHOOK_pre_pc_job_name) (int *class);
+typedef const char* (*HPMHOOK_post_pc_job_name) (const char* retVal___, int class);
+typedef void (*HPMHOOK_pre_pc_setinvincibletimer) (struct map_session_data **sd, int *val);
+typedef void (*HPMHOOK_post_pc_setinvincibletimer) (struct map_session_data *sd, int val);
+typedef void (*HPMHOOK_pre_pc_delinvincibletimer) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_delinvincibletimer) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_addspiritball) (struct map_session_data **sd, int *interval, int *max);
+typedef int (*HPMHOOK_post_pc_addspiritball) (int retVal___, struct map_session_data *sd, int interval, int max);
+typedef int (*HPMHOOK_pre_pc_delspiritball) (struct map_session_data **sd, int *count, int *type);
+typedef int (*HPMHOOK_post_pc_delspiritball) (int retVal___, struct map_session_data *sd, int count, int type);
+typedef int (*HPMHOOK_pre_pc_getmaxspiritball) (struct map_session_data **sd, int *min);
+typedef int (*HPMHOOK_post_pc_getmaxspiritball) (int retVal___, struct map_session_data *sd, int min);
+typedef void (*HPMHOOK_pre_pc_addfame) (struct map_session_data **sd, int *ranktype, int *count);
+typedef void (*HPMHOOK_post_pc_addfame) (struct map_session_data *sd, int ranktype, int count);
+typedef int (*HPMHOOK_pre_pc_fame_rank) (int *char_id, int *ranktype);
+typedef int (*HPMHOOK_post_pc_fame_rank) (int retVal___, int char_id, int ranktype);
+typedef int (*HPMHOOK_pre_pc_famelist_type) (uint16 *job_mapid);
+typedef int (*HPMHOOK_post_pc_famelist_type) (int retVal___, uint16 job_mapid);
+typedef int (*HPMHOOK_pre_pc_set_hate_mob) (struct map_session_data **sd, int *pos, struct block_list **bl);
+typedef int (*HPMHOOK_post_pc_set_hate_mob) (int retVal___, struct map_session_data *sd, int pos, struct block_list *bl);
+typedef int (*HPMHOOK_pre_pc_readdb) (void);
+typedef int (*HPMHOOK_post_pc_readdb) (int retVal___);
+typedef int (*HPMHOOK_pre_pc_map_day_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_map_day_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_map_night_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_map_night_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_pc_inventory_rentals) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_inventory_rentals) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_inventory_rental_clear) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_inventory_rental_clear) (int retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_inventory_rental_add) (struct map_session_data **sd, int *seconds);
+typedef void (*HPMHOOK_post_pc_inventory_rental_add) (struct map_session_data *sd, int seconds);
+typedef int (*HPMHOOK_pre_pc_disguise) (struct map_session_data **sd, int *class);
+typedef int (*HPMHOOK_post_pc_disguise) (int retVal___, struct map_session_data *sd, int class);
+typedef bool (*HPMHOOK_pre_pc_isautolooting) (struct map_session_data **sd, int *nameid);
+typedef bool (*HPMHOOK_post_pc_isautolooting) (bool retVal___, struct map_session_data *sd, int nameid);
+typedef void (*HPMHOOK_pre_pc_overheat) (struct map_session_data **sd, int *val);
+typedef void (*HPMHOOK_post_pc_overheat) (struct map_session_data *sd, int val);
+typedef int (*HPMHOOK_pre_pc_banding) (struct map_session_data **sd, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_pc_banding) (int retVal___, struct map_session_data *sd, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_pc_itemcd_do) (struct map_session_data **sd, bool *load);
+typedef void (*HPMHOOK_post_pc_itemcd_do) (struct map_session_data *sd, bool load);
+typedef int (*HPMHOOK_pre_pc_load_combo) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_load_combo) (int retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_add_charm) (struct map_session_data **sd, int *interval, int *max, int *type);
+typedef void (*HPMHOOK_post_pc_add_charm) (struct map_session_data *sd, int interval, int max, int type);
+typedef void (*HPMHOOK_pre_pc_del_charm) (struct map_session_data **sd, int *count, int *type);
+typedef void (*HPMHOOK_post_pc_del_charm) (struct map_session_data *sd, int count, int type);
+typedef void (*HPMHOOK_pre_pc_baselevelchanged) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_baselevelchanged) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_level_penalty_mod) (int *diff, unsigned char *race, uint32 *mode, int *type);
+typedef int (*HPMHOOK_post_pc_level_penalty_mod) (int retVal___, int diff, unsigned char race, uint32 mode, int type);
+typedef int (*HPMHOOK_pre_pc_calc_skillpoint) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_calc_skillpoint) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_invincible_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_invincible_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_spiritball_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_spiritball_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_check_banding) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_pc_check_banding) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_pc_inventory_rental_end) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_inventory_rental_end) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_pc_check_skilltree) (struct map_session_data **sd, int *skill_id);
+typedef void (*HPMHOOK_post_pc_check_skilltree) (struct map_session_data *sd, int skill_id);
+typedef int (*HPMHOOK_pre_pc_bonus_autospell) (struct s_autospell **spell, int *max, short *id, short *lv, short *rate, short *flag, short *card_id);
+typedef int (*HPMHOOK_post_pc_bonus_autospell) (int retVal___, struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id);
+typedef int (*HPMHOOK_pre_pc_bonus_autospell_onskill) (struct s_autospell **spell, int *max, short *src_skill, short *id, short *lv, short *rate, short *card_id);
+typedef int (*HPMHOOK_post_pc_bonus_autospell_onskill) (int retVal___, struct s_autospell *spell, int max, short src_skill, short id, short lv, short rate, short card_id);
+typedef int (*HPMHOOK_pre_pc_bonus_addeff) (struct s_addeffect **effect, int *max, enum sc_type *id, int16 *rate, int16 *arrow_rate, uint8 *flag, uint16 *duration);
+typedef int (*HPMHOOK_post_pc_bonus_addeff) (int retVal___, struct s_addeffect *effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration);
+typedef int (*HPMHOOK_pre_pc_bonus_addeff_onskill) (struct s_addeffectonskill **effect, int *max, enum sc_type *id, short *rate, short *skill_id, unsigned char *target);
+typedef int (*HPMHOOK_post_pc_bonus_addeff_onskill) (int retVal___, struct s_addeffectonskill *effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target);
+typedef int (*HPMHOOK_pre_pc_bonus_item_drop) (struct s_add_drop **drop, const short *max, short *id, short *group, int *race, int *rate);
+typedef int (*HPMHOOK_post_pc_bonus_item_drop) (int retVal___, struct s_add_drop *drop, const short max, short id, short group, int race, int rate);
+typedef void (*HPMHOOK_pre_pc_calcexp) (struct map_session_data **sd, unsigned int **base_exp, unsigned int **job_exp, struct block_list **src);
+typedef void (*HPMHOOK_post_pc_calcexp) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src);
+typedef int (*HPMHOOK_pre_pc_respawn_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_respawn_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_jobchange_killclone) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_pc_jobchange_killclone) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_pc_getstat) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pc_getstat) (int retVal___, struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_pc_setstat) (struct map_session_data **sd, int *type, int *val);
+typedef int (*HPMHOOK_post_pc_setstat) (int retVal___, struct map_session_data *sd, int type, int val);
+typedef int (*HPMHOOK_pre_pc_eventtimer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_eventtimer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_daynight_timer_sub) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_pc_daynight_timer_sub) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef int (*HPMHOOK_pre_pc_charm_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_charm_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef bool (*HPMHOOK_pre_pc_readdb_levelpenalty) (char **fields[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_pc_readdb_levelpenalty) (bool retVal___, char *fields[], int columns, int current);
+typedef int (*HPMHOOK_pre_pc_autosave) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_autosave) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_follow_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_follow_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_pc_read_skill_tree) (void);
+typedef void (*HPMHOOK_post_pc_read_skill_tree) (void);
+typedef void (*HPMHOOK_pre_pc_clear_skill_tree) (void);
+typedef void (*HPMHOOK_post_pc_clear_skill_tree) (void);
+typedef int (*HPMHOOK_pre_pc_isUseitem) (struct map_session_data **sd, int *n);
+typedef int (*HPMHOOK_post_pc_isUseitem) (int retVal___, struct map_session_data *sd, int n);
+typedef int (*HPMHOOK_pre_pc_show_steal) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_pc_show_steal) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_pc_checkcombo) (struct map_session_data **sd, struct item_data **data);
+typedef int (*HPMHOOK_post_pc_checkcombo) (int retVal___, struct map_session_data *sd, struct item_data *data);
+typedef int (*HPMHOOK_pre_pc_calcweapontype) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_calcweapontype) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_removecombo) (struct map_session_data **sd, struct item_data **data);
+typedef int (*HPMHOOK_post_pc_removecombo) (int retVal___, struct map_session_data *sd, struct item_data *data);
+typedef void (*HPMHOOK_pre_pc_bank_deposit) (struct map_session_data **sd, int *money);
+typedef void (*HPMHOOK_post_pc_bank_deposit) (struct map_session_data *sd, int money);
+typedef void (*HPMHOOK_pre_pc_bank_withdraw) (struct map_session_data **sd, int *money);
+typedef void (*HPMHOOK_post_pc_bank_withdraw) (struct map_session_data *sd, int money);
+typedef void (*HPMHOOK_pre_pc_rental_expire) (struct map_session_data **sd, int *i);
+typedef void (*HPMHOOK_post_pc_rental_expire) (struct map_session_data *sd, int i);
+typedef void (*HPMHOOK_pre_pc_scdata_received) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_scdata_received) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_bound_clear) (struct map_session_data **sd, enum e_item_bound_type *type);
+typedef void (*HPMHOOK_post_pc_bound_clear) (struct map_session_data *sd, enum e_item_bound_type type);
+typedef int (*HPMHOOK_pre_pc_expiration_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_expiration_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pc_global_expiration_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pc_global_expiration_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_pc_expire_check) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_expire_check) (struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_pc_db_checkid) (int *class);
+typedef bool (*HPMHOOK_post_pc_db_checkid) (bool retVal___, int class);
+typedef void (*HPMHOOK_pre_pc_validate_levels) (void);
+typedef void (*HPMHOOK_post_pc_validate_levels) (void);
+typedef void (*HPMHOOK_pre_pc_autotrade_load) (void);
+typedef void (*HPMHOOK_post_pc_autotrade_load) (void);
+typedef void (*HPMHOOK_pre_pc_autotrade_update) (struct map_session_data **sd, enum e_pc_autotrade_update_action *action);
+typedef void (*HPMHOOK_post_pc_autotrade_update) (struct map_session_data *sd, enum e_pc_autotrade_update_action action);
+typedef void (*HPMHOOK_pre_pc_autotrade_start) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_autotrade_start) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_autotrade_prepare) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_autotrade_prepare) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_autotrade_populate) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_pc_autotrade_populate) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pc_autotrade_final) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_pc_autotrade_final) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef int (*HPMHOOK_pre_pc_check_job_name) (const char **name);
+typedef int (*HPMHOOK_post_pc_check_job_name) (int retVal___, const char *name);
+typedef void (*HPMHOOK_pre_pc_update_idle_time) (struct map_session_data **sd, enum e_battle_config_idletime *type);
+typedef void (*HPMHOOK_post_pc_update_idle_time) (struct map_session_data *sd, enum e_battle_config_idletime type);
+typedef int (*HPMHOOK_pre_pc_have_magnifier) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pc_have_magnifier) (int retVal___, struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **sd, const char **message);
+typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message);
+typedef void (*HPMHOOK_pre_pc_check_supernovice_call) (struct map_session_data **sd, const char **message);
+typedef void (*HPMHOOK_post_pc_check_supernovice_call) (struct map_session_data *sd, const char *message);
+typedef bool (*HPMHOOK_pre_pc_check_basicskill) (struct map_session_data **sd, int *level);
+typedef bool (*HPMHOOK_post_pc_check_basicskill) (bool retVal___, struct map_session_data *sd, int level);
+#endif // MAP_PC_H
+#ifdef MAP_NPC_H /* libpcre */
+typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr);
+typedef pcre* (*HPMHOOK_post_libpcre_compile) (pcre* retVal___, const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);
+typedef pcre_extra* (*HPMHOOK_pre_libpcre_study) (const pcre **code, int *options, const char ***errptr);
+typedef pcre_extra* (*HPMHOOK_post_libpcre_study) (pcre_extra* retVal___, const pcre *code, int options, const char **errptr);
+typedef int (*HPMHOOK_pre_libpcre_exec) (const pcre **code, const pcre_extra **extra, PCRE_SPTR *subject, int *length, int *startoffset, int *options, int **ovector, int *ovecsize);
+typedef int (*HPMHOOK_post_libpcre_exec) (int retVal___, const pcre *code, const pcre_extra *extra, PCRE_SPTR subject, int length, int startoffset, int options, int *ovector, int ovecsize);
+typedef void (*HPMHOOK_pre_libpcre_free) (void **ptr);
+typedef void (*HPMHOOK_post_libpcre_free) (void *ptr);
+typedef int (*HPMHOOK_pre_libpcre_copy_substring) (const char **subject, int **ovector, int *stringcount, int *stringnumber, char **buffer, int *buffersize);
+typedef int (*HPMHOOK_post_libpcre_copy_substring) (int retVal___, const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize);
+typedef void (*HPMHOOK_pre_libpcre_free_substring) (const char **stringptr);
+typedef void (*HPMHOOK_post_libpcre_free_substring) (const char *stringptr);
+typedef int (*HPMHOOK_pre_libpcre_copy_named_substring) (const pcre **code, const char **subject, int **ovector, int *stringcount, const char **stringname, char **buffer, int *buffersize);
+typedef int (*HPMHOOK_post_libpcre_copy_named_substring) (int retVal___, const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);
+typedef int (*HPMHOOK_pre_libpcre_get_substring) (const char **subject, int **ovector, int *stringcount, int *stringnumber, const char ***stringptr);
+typedef int (*HPMHOOK_post_libpcre_get_substring) (int retVal___, const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);
+#endif // MAP_NPC_H
+#ifdef MAP_PET_H /* pet */
+typedef int (*HPMHOOK_pre_pet_init) (bool *minimal);
+typedef int (*HPMHOOK_post_pet_init) (int retVal___, bool minimal);
+typedef int (*HPMHOOK_pre_pet_final) (void);
+typedef int (*HPMHOOK_post_pet_final) (int retVal___);
+typedef int (*HPMHOOK_pre_pet_hungry_val) (struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_hungry_val) (int retVal___, struct pet_data *pd);
+typedef void (*HPMHOOK_pre_pet_set_intimate) (struct pet_data **pd, int *value);
+typedef void (*HPMHOOK_post_pet_set_intimate) (struct pet_data *pd, int value);
+typedef int (*HPMHOOK_pre_pet_create_egg) (struct map_session_data **sd, int *item_id);
+typedef int (*HPMHOOK_post_pet_create_egg) (int retVal___, struct map_session_data *sd, int item_id);
+typedef int (*HPMHOOK_pre_pet_unlocktarget) (struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_unlocktarget) (int retVal___, struct pet_data *pd);
+typedef int (*HPMHOOK_pre_pet_attackskill) (struct pet_data **pd, int *target_id);
+typedef int (*HPMHOOK_post_pet_attackskill) (int retVal___, struct pet_data *pd, int target_id);
+typedef int (*HPMHOOK_pre_pet_target_check) (struct map_session_data **sd, struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_pet_target_check) (int retVal___, struct map_session_data *sd, struct block_list *bl, int type);
+typedef int (*HPMHOOK_pre_pet_sc_check) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_pet_sc_check) (int retVal___, struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_pet_hungry) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pet_hungry) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pet_search_petDB_index) (int *key, int *type);
+typedef int (*HPMHOOK_post_pet_search_petDB_index) (int retVal___, int key, int type);
+typedef int (*HPMHOOK_pre_pet_hungry_timer_delete) (struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_hungry_timer_delete) (int retVal___, struct pet_data *pd);
+typedef int (*HPMHOOK_pre_pet_performance) (struct map_session_data **sd, struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_performance) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
+typedef int (*HPMHOOK_pre_pet_return_egg) (struct map_session_data **sd, struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_return_egg) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
+typedef int (*HPMHOOK_pre_pet_data_init) (struct map_session_data **sd, struct s_pet **petinfo);
+typedef int (*HPMHOOK_post_pet_data_init) (int retVal___, struct map_session_data *sd, struct s_pet *petinfo);
+typedef int (*HPMHOOK_pre_pet_birth_process) (struct map_session_data **sd, struct s_pet **petinfo);
+typedef int (*HPMHOOK_post_pet_birth_process) (int retVal___, struct map_session_data *sd, struct s_pet *petinfo);
+typedef int (*HPMHOOK_pre_pet_recv_petdata) (int *account_id, struct s_pet **p, int *flag);
+typedef int (*HPMHOOK_post_pet_recv_petdata) (int retVal___, int account_id, struct s_pet *p, int flag);
+typedef int (*HPMHOOK_pre_pet_select_egg) (struct map_session_data **sd, short *egg_index);
+typedef int (*HPMHOOK_post_pet_select_egg) (int retVal___, struct map_session_data *sd, short egg_index);
+typedef int (*HPMHOOK_pre_pet_catch_process1) (struct map_session_data **sd, int *target_class);
+typedef int (*HPMHOOK_post_pet_catch_process1) (int retVal___, struct map_session_data *sd, int target_class);
+typedef int (*HPMHOOK_pre_pet_catch_process2) (struct map_session_data **sd, int *target_id);
+typedef int (*HPMHOOK_post_pet_catch_process2) (int retVal___, struct map_session_data *sd, int target_id);
+typedef bool (*HPMHOOK_pre_pet_get_egg) (int *account_id, short *pet_class, int *pet_id);
+typedef bool (*HPMHOOK_post_pet_get_egg) (bool retVal___, int account_id, short pet_class, int pet_id);
+typedef int (*HPMHOOK_pre_pet_unequipitem) (struct map_session_data **sd, struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_unequipitem) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
+typedef int (*HPMHOOK_pre_pet_food) (struct map_session_data **sd, struct pet_data **pd);
+typedef int (*HPMHOOK_post_pet_food) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
+typedef int (*HPMHOOK_pre_pet_ai_sub_hard_lootsearch) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_pet_ai_sub_hard_lootsearch) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_pet_menu) (struct map_session_data **sd, int *menunum);
+typedef int (*HPMHOOK_post_pet_menu) (int retVal___, struct map_session_data *sd, int menunum);
+typedef int (*HPMHOOK_pre_pet_change_name) (struct map_session_data **sd, const char **name);
+typedef int (*HPMHOOK_post_pet_change_name) (int retVal___, struct map_session_data *sd, const char *name);
+typedef int (*HPMHOOK_pre_pet_change_name_ack) (struct map_session_data **sd, const char **name, int *flag);
+typedef int (*HPMHOOK_post_pet_change_name_ack) (int retVal___, struct map_session_data *sd, const char *name, int flag);
+typedef int (*HPMHOOK_pre_pet_equipitem) (struct map_session_data **sd, int *index);
+typedef int (*HPMHOOK_post_pet_equipitem) (int retVal___, struct map_session_data *sd, int index);
+typedef int (*HPMHOOK_pre_pet_randomwalk) (struct pet_data **pd, int64 *tick);
+typedef int (*HPMHOOK_post_pet_randomwalk) (int retVal___, struct pet_data *pd, int64 tick);
+typedef int (*HPMHOOK_pre_pet_ai_sub_hard) (struct pet_data **pd, struct map_session_data **sd, int64 *tick);
+typedef int (*HPMHOOK_post_pet_ai_sub_hard) (int retVal___, struct pet_data *pd, struct map_session_data *sd, int64 tick);
+typedef int (*HPMHOOK_pre_pet_ai_sub_foreachclient) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_pet_ai_sub_foreachclient) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef int (*HPMHOOK_pre_pet_ai_hard) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pet_ai_hard) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pet_delay_item_drop) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pet_delay_item_drop) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pet_lootitem_drop) (struct pet_data **pd, struct map_session_data **sd);
+typedef int (*HPMHOOK_post_pet_lootitem_drop) (int retVal___, struct pet_data *pd, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_pet_skill_bonus_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pet_skill_bonus_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pet_recovery_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pet_recovery_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pet_skill_support_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_pet_skill_support_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_pet_read_db) (void);
+typedef int (*HPMHOOK_post_pet_read_db) (int retVal___);
+#endif // MAP_PET_H
+#ifdef CHAR_PINCODE_H /* pincode */
+typedef void (*HPMHOOK_pre_pincode_handle) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_pincode_handle) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_pincode_decrypt) (unsigned int *userSeed, char **pin);
+typedef void (*HPMHOOK_post_pincode_decrypt) (unsigned int userSeed, char *pin);
+typedef void (*HPMHOOK_pre_pincode_error) (int *account_id);
+typedef void (*HPMHOOK_post_pincode_error) (int account_id);
+typedef void (*HPMHOOK_pre_pincode_update) (int *account_id, char **pin);
+typedef void (*HPMHOOK_post_pincode_update) (int account_id, char *pin);
+typedef void (*HPMHOOK_pre_pincode_sendstate) (int *fd, struct char_session_data **sd, uint16 *state);
+typedef void (*HPMHOOK_post_pincode_sendstate) (int fd, struct char_session_data *sd, uint16 state);
+typedef void (*HPMHOOK_pre_pincode_setnew) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_pincode_setnew) (int fd, struct char_session_data *sd);
+typedef void (*HPMHOOK_pre_pincode_change) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_pincode_change) (int fd, struct char_session_data *sd);
+typedef int (*HPMHOOK_pre_pincode_compare) (int *fd, struct char_session_data **sd, char **pin);
+typedef int (*HPMHOOK_post_pincode_compare) (int retVal___, int fd, struct char_session_data *sd, char *pin);
+typedef void (*HPMHOOK_pre_pincode_check) (int *fd, struct char_session_data **sd);
+typedef void (*HPMHOOK_post_pincode_check) (int fd, struct char_session_data *sd);
+typedef bool (*HPMHOOK_pre_pincode_config_read) (const char **filename, const struct config_t **config, bool *imported);
+typedef bool (*HPMHOOK_post_pincode_config_read) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+#endif // CHAR_PINCODE_H
+#ifdef MAP_QUEST_H /* quest */
+typedef void (*HPMHOOK_pre_quest_init) (bool *minimal);
+typedef void (*HPMHOOK_post_quest_init) (bool minimal);
+typedef void (*HPMHOOK_pre_quest_final) (void);
+typedef void (*HPMHOOK_post_quest_final) (void);
+typedef void (*HPMHOOK_pre_quest_reload) (void);
+typedef void (*HPMHOOK_post_quest_reload) (void);
+typedef struct quest_db* (*HPMHOOK_pre_quest_db) (int *quest_id);
+typedef struct quest_db* (*HPMHOOK_post_quest_db) (struct quest_db* retVal___, int quest_id);
+typedef int (*HPMHOOK_pre_quest_pc_login) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_quest_pc_login) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_quest_add) (struct map_session_data **sd, int *quest_id);
+typedef int (*HPMHOOK_post_quest_add) (int retVal___, struct map_session_data *sd, int quest_id);
+typedef int (*HPMHOOK_pre_quest_change) (struct map_session_data **sd, int *qid1, int *qid2);
+typedef int (*HPMHOOK_post_quest_change) (int retVal___, struct map_session_data *sd, int qid1, int qid2);
+typedef int (*HPMHOOK_pre_quest_delete) (struct map_session_data **sd, int *quest_id);
+typedef int (*HPMHOOK_post_quest_delete) (int retVal___, struct map_session_data *sd, int quest_id);
+typedef int (*HPMHOOK_pre_quest_update_objective_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_quest_update_objective_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_quest_update_objective) (struct map_session_data **sd, int *mob_id);
+typedef void (*HPMHOOK_post_quest_update_objective) (struct map_session_data *sd, int mob_id);
+typedef int (*HPMHOOK_pre_quest_update_status) (struct map_session_data **sd, int *quest_id, enum quest_state *qs);
+typedef int (*HPMHOOK_post_quest_update_status) (int retVal___, struct map_session_data *sd, int quest_id, enum quest_state qs);
+typedef int (*HPMHOOK_pre_quest_check) (struct map_session_data **sd, int *quest_id, enum quest_check_type *type);
+typedef int (*HPMHOOK_post_quest_check) (int retVal___, struct map_session_data *sd, int quest_id, enum quest_check_type type);
+typedef void (*HPMHOOK_pre_quest_clear) (void);
+typedef void (*HPMHOOK_post_quest_clear) (void);
+typedef int (*HPMHOOK_pre_quest_read_db) (void);
+typedef int (*HPMHOOK_post_quest_read_db) (int retVal___);
+typedef struct quest_db* (*HPMHOOK_pre_quest_read_db_sub) (struct config_setting_t **cs, int *n, const char **source);
+typedef struct quest_db* (*HPMHOOK_post_quest_read_db_sub) (struct quest_db* retVal___, struct config_setting_t *cs, int n, const char *source);
+#endif // MAP_QUEST_H
+#ifdef COMMON_RANDOM_H /* rnd */
+typedef void (*HPMHOOK_pre_rnd_init) (void);
+typedef void (*HPMHOOK_post_rnd_init) (void);
+typedef void (*HPMHOOK_pre_rnd_final) (void);
+typedef void (*HPMHOOK_post_rnd_final) (void);
+typedef void (*HPMHOOK_pre_rnd_seed) (uint32 *seed);
+typedef void (*HPMHOOK_post_rnd_seed) (uint32 seed);
+typedef int32 (*HPMHOOK_pre_rnd_random) (void);
+typedef int32 (*HPMHOOK_post_rnd_random) (int32 retVal___);
+typedef uint32 (*HPMHOOK_pre_rnd_roll) (uint32 *dice_faces);
+typedef uint32 (*HPMHOOK_post_rnd_roll) (uint32 retVal___, uint32 dice_faces);
+typedef int32 (*HPMHOOK_pre_rnd_value) (int32 *min, int32 *max);
+typedef int32 (*HPMHOOK_post_rnd_value) (int32 retVal___, int32 min, int32 max);
+typedef double (*HPMHOOK_pre_rnd_uniform) (void);
+typedef double (*HPMHOOK_post_rnd_uniform) (double retVal___);
+typedef double (*HPMHOOK_pre_rnd_uniform53) (void);
+typedef double (*HPMHOOK_post_rnd_uniform53) (double retVal___);
+#endif // COMMON_RANDOM_H
+#ifdef MAP_SCRIPT_H /* script */
+typedef void (*HPMHOOK_pre_script_init) (bool *minimal);
+typedef void (*HPMHOOK_post_script_init) (bool minimal);
+typedef void (*HPMHOOK_pre_script_final) (void);
+typedef void (*HPMHOOK_post_script_final) (void);
+typedef int (*HPMHOOK_pre_script_reload) (void);
+typedef int (*HPMHOOK_post_script_reload) (int retVal___);
+typedef struct script_code* (*HPMHOOK_pre_script_parse) (const char **src, const char **file, int *line, int *options, int **retval);
+typedef struct script_code* (*HPMHOOK_post_script_parse) (struct script_code* retVal___, const char *src, const char *file, int line, int options, int *retval);
+typedef bool (*HPMHOOK_pre_script_add_builtin) (const struct script_function **buildin, bool *override);
+typedef bool (*HPMHOOK_post_script_add_builtin) (bool retVal___, const struct script_function *buildin, bool override);
+typedef void (*HPMHOOK_pre_script_parse_builtin) (void);
+typedef void (*HPMHOOK_post_script_parse_builtin) (void);
+typedef const char* (*HPMHOOK_pre_script_parse_subexpr) (const char **p, int *limit);
+typedef const char* (*HPMHOOK_post_script_parse_subexpr) (const char* retVal___, const char *p, int limit);
+typedef const char* (*HPMHOOK_pre_script_skip_space) (const char **p);
+typedef const char* (*HPMHOOK_post_script_skip_space) (const char* retVal___, const char *p);
+typedef void (*HPMHOOK_pre_script_error) (const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos);
+typedef void (*HPMHOOK_post_script_error) (const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
+typedef void (*HPMHOOK_pre_script_warning) (const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos);
+typedef void (*HPMHOOK_post_script_warning) (const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
+typedef bool (*HPMHOOK_pre_script_addScript) (char **name, char **args, bool ( **func ) (struct script_state *st), bool *isDeprecated);
+typedef bool (*HPMHOOK_post_script_addScript) (bool retVal___, char *name, char *args, bool ( *func ) (struct script_state *st), bool isDeprecated);
+typedef int (*HPMHOOK_pre_script_conv_num) (struct script_state **st, struct script_data **data);
+typedef int (*HPMHOOK_post_script_conv_num) (int retVal___, struct script_state *st, struct script_data *data);
+typedef const char* (*HPMHOOK_pre_script_conv_str) (struct script_state **st, struct script_data **data);
+typedef const char* (*HPMHOOK_post_script_conv_str) (const char* retVal___, struct script_state *st, struct script_data *data);
+typedef struct map_session_data* (*HPMHOOK_pre_script_rid2sd) (struct script_state **st);
+typedef struct map_session_data* (*HPMHOOK_post_script_rid2sd) (struct map_session_data* retVal___, struct script_state *st);
+typedef struct map_session_data* (*HPMHOOK_pre_script_id2sd) (struct script_state **st, int *account_id);
+typedef struct map_session_data* (*HPMHOOK_post_script_id2sd) (struct map_session_data* retVal___, struct script_state *st, int account_id);
+typedef struct map_session_data* (*HPMHOOK_pre_script_charid2sd) (struct script_state **st, int *char_id);
+typedef struct map_session_data* (*HPMHOOK_post_script_charid2sd) (struct map_session_data* retVal___, struct script_state *st, int char_id);
+typedef struct map_session_data* (*HPMHOOK_pre_script_nick2sd) (struct script_state **st, const char **name);
+typedef struct map_session_data* (*HPMHOOK_post_script_nick2sd) (struct map_session_data* retVal___, struct script_state *st, const char *name);
+typedef void (*HPMHOOK_pre_script_detach_rid) (struct script_state **st);
+typedef void (*HPMHOOK_post_script_detach_rid) (struct script_state *st);
+typedef struct script_data* (*HPMHOOK_pre_script_push_val) (struct script_stack **stack, enum c_op *type, int64 *val, struct reg_db **ref);
+typedef struct script_data* (*HPMHOOK_post_script_push_val) (struct script_data* retVal___, struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref);
+typedef struct script_data* (*HPMHOOK_pre_script_get_val) (struct script_state **st, struct script_data **data);
+typedef struct script_data* (*HPMHOOK_post_script_get_val) (struct script_data* retVal___, struct script_state *st, struct script_data *data);
+typedef char* (*HPMHOOK_pre_script_get_val_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef char* (*HPMHOOK_post_script_get_val_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef char* (*HPMHOOK_pre_script_get_val_pc_ref_str) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef char* (*HPMHOOK_post_script_get_val_pc_ref_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef char* (*HPMHOOK_pre_script_get_val_scope_str) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef char* (*HPMHOOK_post_script_get_val_scope_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef char* (*HPMHOOK_pre_script_get_val_npc_str) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef char* (*HPMHOOK_post_script_get_val_npc_str) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef char* (*HPMHOOK_pre_script_get_val_instance_str) (struct script_state **st, const char **name, struct script_data **data);
+typedef char* (*HPMHOOK_post_script_get_val_instance_str) (char* retVal___, struct script_state *st, const char *name, struct script_data *data);
+typedef int (*HPMHOOK_pre_script_get_val_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef int (*HPMHOOK_post_script_get_val_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef int (*HPMHOOK_pre_script_get_val_pc_ref_num) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef int (*HPMHOOK_post_script_get_val_pc_ref_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef int (*HPMHOOK_pre_script_get_val_scope_num) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef int (*HPMHOOK_post_script_get_val_scope_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef int (*HPMHOOK_pre_script_get_val_npc_num) (struct script_state **st, struct reg_db **n, struct script_data **data);
+typedef int (*HPMHOOK_post_script_get_val_npc_num) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+typedef int (*HPMHOOK_pre_script_get_val_instance_num) (struct script_state **st, const char **name, struct script_data **data);
+typedef int (*HPMHOOK_post_script_get_val_instance_num) (int retVal___, struct script_state *st, const char *name, struct script_data *data);
+typedef const void* (*HPMHOOK_pre_script_get_val2) (struct script_state **st, int64 *uid, struct reg_db **ref);
+typedef const void* (*HPMHOOK_post_script_get_val2) (const void* retVal___, struct script_state *st, int64 uid, struct reg_db *ref);
+typedef struct script_data* (*HPMHOOK_pre_script_push_str) (struct script_stack **stack, char **str);
+typedef struct script_data* (*HPMHOOK_post_script_push_str) (struct script_data* retVal___, struct script_stack *stack, char *str);
+typedef struct script_data* (*HPMHOOK_pre_script_push_conststr) (struct script_stack **stack, const char **str);
+typedef struct script_data* (*HPMHOOK_post_script_push_conststr) (struct script_data* retVal___, struct script_stack *stack, const char *str);
+typedef struct script_data* (*HPMHOOK_pre_script_push_copy) (struct script_stack **stack, int *pos);
+typedef struct script_data* (*HPMHOOK_post_script_push_copy) (struct script_data* retVal___, struct script_stack *stack, int pos);
+typedef void (*HPMHOOK_pre_script_pop_stack) (struct script_state **st, int *start, int *end);
+typedef void (*HPMHOOK_post_script_pop_stack) (struct script_state *st, int start, int end);
+typedef void (*HPMHOOK_pre_script_set_constant) (const char **name, int *value, bool *is_parameter, bool *is_deprecated);
+typedef void (*HPMHOOK_post_script_set_constant) (const char *name, int value, bool is_parameter, bool is_deprecated);
+typedef void (*HPMHOOK_pre_script_set_constant2) (const char **name, int *value, bool *is_parameter, bool *is_deprecated);
+typedef void (*HPMHOOK_post_script_set_constant2) (const char *name, int value, bool is_parameter, bool is_deprecated);
+typedef bool (*HPMHOOK_pre_script_get_constant) (const char **name, int **value);
+typedef bool (*HPMHOOK_post_script_get_constant) (bool retVal___, const char *name, int *value);
+typedef void (*HPMHOOK_pre_script_label_add) (int *key, int *pos);
+typedef void (*HPMHOOK_post_script_label_add) (int key, int pos);
+typedef void (*HPMHOOK_pre_script_run) (struct script_code **rootscript, int *pos, int *rid, int *oid);
+typedef void (*HPMHOOK_post_script_run) (struct script_code *rootscript, int pos, int rid, int oid);
+typedef void (*HPMHOOK_pre_script_run_npc) (struct script_code **rootscript, int *pos, int *rid, int *oid);
+typedef void (*HPMHOOK_post_script_run_npc) (struct script_code *rootscript, int pos, int rid, int oid);
+typedef void (*HPMHOOK_pre_script_run_pet) (struct script_code **rootscript, int *pos, int *rid, int *oid);
+typedef void (*HPMHOOK_post_script_run_pet) (struct script_code *rootscript, int pos, int rid, int oid);
+typedef void (*HPMHOOK_pre_script_run_main) (struct script_state **st);
+typedef void (*HPMHOOK_post_script_run_main) (struct script_state *st);
+typedef int (*HPMHOOK_pre_script_run_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_script_run_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_script_set_var) (struct map_session_data **sd, char **name, void **val);
+typedef int (*HPMHOOK_post_script_set_var) (int retVal___, struct map_session_data *sd, char *name, void *val);
+typedef void (*HPMHOOK_pre_script_stop_instances) (struct script_code **code);
+typedef void (*HPMHOOK_post_script_stop_instances) (struct script_code *code);
+typedef void (*HPMHOOK_pre_script_free_code) (struct script_code **code);
+typedef void (*HPMHOOK_post_script_free_code) (struct script_code *code);
+typedef void (*HPMHOOK_pre_script_free_vars) (struct DBMap **var_storage);
+typedef void (*HPMHOOK_post_script_free_vars) (struct DBMap *var_storage);
+typedef struct script_state* (*HPMHOOK_pre_script_alloc_state) (struct script_code **rootscript, int *pos, int *rid, int *oid);
+typedef struct script_state* (*HPMHOOK_post_script_alloc_state) (struct script_state* retVal___, struct script_code *rootscript, int pos, int rid, int oid);
+typedef void (*HPMHOOK_pre_script_free_state) (struct script_state **st);
+typedef void (*HPMHOOK_post_script_free_state) (struct script_state *st);
+typedef void (*HPMHOOK_pre_script_add_pending_ref) (struct script_state **st, struct reg_db **ref);
+typedef void (*HPMHOOK_post_script_add_pending_ref) (struct script_state *st, struct reg_db *ref);
+typedef void (*HPMHOOK_pre_script_run_autobonus) (const char **autobonus, int *id, int *pos);
+typedef void (*HPMHOOK_post_script_run_autobonus) (const char *autobonus, int id, int pos);
+typedef void (*HPMHOOK_pre_script_cleararray_pc) (struct map_session_data **sd, const char **varname, void **value);
+typedef void (*HPMHOOK_post_script_cleararray_pc) (struct map_session_data *sd, const char *varname, void *value);
+typedef void (*HPMHOOK_pre_script_setarray_pc) (struct map_session_data **sd, const char **varname, uint32 *idx, void **value, int **refcache);
+typedef void (*HPMHOOK_post_script_setarray_pc) (struct map_session_data *sd, const char *varname, uint32 idx, void *value, int *refcache);
+typedef bool (*HPMHOOK_pre_script_config_read) (const char **filename, bool *imported);
+typedef bool (*HPMHOOK_post_script_config_read) (bool retVal___, const char *filename, bool imported);
+typedef int (*HPMHOOK_pre_script_add_str) (const char **p);
+typedef int (*HPMHOOK_post_script_add_str) (int retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_get_str) (int *id);
+typedef const char* (*HPMHOOK_post_script_get_str) (const char* retVal___, int id);
+typedef int (*HPMHOOK_pre_script_search_str) (const char **p);
+typedef int (*HPMHOOK_post_script_search_str) (int retVal___, const char *p);
+typedef void (*HPMHOOK_pre_script_setd_sub) (struct script_state **st, struct map_session_data **sd, const char **varname, int *elem, const void **value, struct reg_db **ref);
+typedef void (*HPMHOOK_post_script_setd_sub) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref);
+typedef void (*HPMHOOK_pre_script_attach_state) (struct script_state **st);
+typedef void (*HPMHOOK_post_script_attach_state) (struct script_state *st);
+typedef struct script_queue* (*HPMHOOK_pre_script_queue) (int *idx);
+typedef struct script_queue* (*HPMHOOK_post_script_queue) (struct script_queue* retVal___, int idx);
+typedef bool (*HPMHOOK_pre_script_queue_add) (int *idx, int *var);
+typedef bool (*HPMHOOK_post_script_queue_add) (bool retVal___, int idx, int var);
+typedef bool (*HPMHOOK_pre_script_queue_del) (int *idx);
+typedef bool (*HPMHOOK_post_script_queue_del) (bool retVal___, int idx);
+typedef bool (*HPMHOOK_pre_script_queue_remove) (int *idx, int *var);
+typedef bool (*HPMHOOK_post_script_queue_remove) (bool retVal___, int idx, int var);
+typedef int (*HPMHOOK_pre_script_queue_create) (void);
+typedef int (*HPMHOOK_post_script_queue_create) (int retVal___);
+typedef bool (*HPMHOOK_pre_script_queue_clear) (int *idx);
+typedef bool (*HPMHOOK_post_script_queue_clear) (bool retVal___, int idx);
+typedef const char* (*HPMHOOK_pre_script_parse_curly_close) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_curly_close) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_syntax_close) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_syntax_close) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_syntax_close_sub) (const char **p, int **flag);
+typedef const char* (*HPMHOOK_post_script_parse_syntax_close_sub) (const char* retVal___, const char *p, int *flag);
+typedef const char* (*HPMHOOK_pre_script_parse_syntax) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_syntax) (const char* retVal___, const char *p);
+typedef c_op (*HPMHOOK_pre_script_get_com) (const struct script_buf **scriptbuf, int **pos);
+typedef c_op (*HPMHOOK_post_script_get_com) (c_op retVal___, const struct script_buf *scriptbuf, int *pos);
+typedef int (*HPMHOOK_pre_script_get_num) (const struct script_buf **scriptbuf, int **pos);
+typedef int (*HPMHOOK_post_script_get_num) (int retVal___, const struct script_buf *scriptbuf, int *pos);
+typedef const char* (*HPMHOOK_pre_script_op2name) (int *op);
+typedef const char* (*HPMHOOK_post_script_op2name) (const char* retVal___, int op);
+typedef void (*HPMHOOK_pre_script_reportsrc) (struct script_state **st);
+typedef void (*HPMHOOK_post_script_reportsrc) (struct script_state *st);
+typedef void (*HPMHOOK_pre_script_reportdata) (struct script_data **data);
+typedef void (*HPMHOOK_post_script_reportdata) (struct script_data *data);
+typedef void (*HPMHOOK_pre_script_reportfunc) (struct script_state **st);
+typedef void (*HPMHOOK_post_script_reportfunc) (struct script_state *st);
+typedef void (*HPMHOOK_pre_script_disp_warning_message) (const char **mes, const char **pos);
+typedef void (*HPMHOOK_post_script_disp_warning_message) (const char *mes, const char *pos);
+typedef void (*HPMHOOK_pre_script_check_event) (struct script_state **st, const char **evt);
+typedef void (*HPMHOOK_post_script_check_event) (struct script_state *st, const char *evt);
+typedef unsigned int (*HPMHOOK_pre_script_calc_hash) (const char **p);
+typedef unsigned int (*HPMHOOK_post_script_calc_hash) (unsigned int retVal___, const char *p);
+typedef void (*HPMHOOK_pre_script_addb) (int *a);
+typedef void (*HPMHOOK_post_script_addb) (int a);
+typedef void (*HPMHOOK_pre_script_addc) (int *a);
+typedef void (*HPMHOOK_post_script_addc) (int a);
+typedef void (*HPMHOOK_pre_script_addi) (int *a);
+typedef void (*HPMHOOK_post_script_addi) (int a);
+typedef void (*HPMHOOK_pre_script_addl) (int *l);
+typedef void (*HPMHOOK_post_script_addl) (int l);
+typedef void (*HPMHOOK_pre_script_set_label) (int *l, int *pos, const char **script_pos);
+typedef void (*HPMHOOK_post_script_set_label) (int l, int pos, const char *script_pos);
+typedef const char* (*HPMHOOK_pre_script_skip_word) (const char **p);
+typedef const char* (*HPMHOOK_post_script_skip_word) (const char* retVal___, const char *p);
+typedef int (*HPMHOOK_pre_script_add_word) (const char **p);
+typedef int (*HPMHOOK_post_script_add_word) (int retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_callfunc) (const char **p, int *require_paren, int *is_custom);
+typedef const char* (*HPMHOOK_post_script_parse_callfunc) (const char* retVal___, const char *p, int require_paren, int is_custom);
+typedef void (*HPMHOOK_pre_script_parse_nextline) (bool *first, const char **p);
+typedef void (*HPMHOOK_post_script_parse_nextline) (bool first, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_variable) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_variable) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_simpleexpr) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_paren) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_paren) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_number) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_number) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_string) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_string) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_simpleexpr_name) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_simpleexpr_name) (const char* retVal___, const char *p);
+typedef void (*HPMHOOK_pre_script_add_translatable_string) (const struct script_string_buf **string, const char **start_point);
+typedef void (*HPMHOOK_post_script_add_translatable_string) (const struct script_string_buf *string, const char *start_point);
+typedef const char* (*HPMHOOK_pre_script_parse_expr) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_expr) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_line) (const char **p);
+typedef const char* (*HPMHOOK_post_script_parse_line) (const char* retVal___, const char *p);
+typedef void (*HPMHOOK_pre_script_read_constdb) (void);
+typedef void (*HPMHOOK_post_script_read_constdb) (void);
+typedef void (*HPMHOOK_pre_script_constdb_comment) (const char **comment);
+typedef void (*HPMHOOK_post_script_constdb_comment) (const char *comment);
+typedef void (*HPMHOOK_pre_script_load_parameters) (void);
+typedef void (*HPMHOOK_post_script_load_parameters) (void);
+typedef const char* (*HPMHOOK_pre_script_print_line) (StringBuf **buf, const char **p, const char **mark, int *line);
+typedef const char* (*HPMHOOK_post_script_print_line) (const char* retVal___, StringBuf *buf, const char *p, const char *mark, int line);
+typedef void (*HPMHOOK_pre_script_errorwarning_sub) (StringBuf **buf, const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos);
+typedef void (*HPMHOOK_post_script_errorwarning_sub) (StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
+typedef int (*HPMHOOK_pre_script_set_reg) (struct script_state **st, struct map_session_data **sd, int64 *num, const char **name, const void **value, struct reg_db **ref);
+typedef int (*HPMHOOK_post_script_set_reg) (int retVal___, struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref);
+typedef void (*HPMHOOK_pre_script_set_reg_ref_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
+typedef void (*HPMHOOK_post_script_set_reg_ref_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+typedef void (*HPMHOOK_pre_script_set_reg_pc_ref_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
+typedef void (*HPMHOOK_post_script_set_reg_pc_ref_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+typedef void (*HPMHOOK_pre_script_set_reg_scope_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
+typedef void (*HPMHOOK_post_script_set_reg_scope_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+typedef void (*HPMHOOK_pre_script_set_reg_npc_str) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
+typedef void (*HPMHOOK_post_script_set_reg_npc_str) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+typedef void (*HPMHOOK_pre_script_set_reg_instance_str) (struct script_state **st, int64 *num, const char **name, const char **str);
+typedef void (*HPMHOOK_post_script_set_reg_instance_str) (struct script_state *st, int64 num, const char *name, const char *str);
+typedef void (*HPMHOOK_pre_script_set_reg_ref_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
+typedef void (*HPMHOOK_post_script_set_reg_ref_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+typedef void (*HPMHOOK_pre_script_set_reg_pc_ref_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
+typedef void (*HPMHOOK_post_script_set_reg_pc_ref_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+typedef void (*HPMHOOK_pre_script_set_reg_scope_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
+typedef void (*HPMHOOK_post_script_set_reg_scope_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+typedef void (*HPMHOOK_pre_script_set_reg_npc_num) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
+typedef void (*HPMHOOK_post_script_set_reg_npc_num) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+typedef void (*HPMHOOK_pre_script_set_reg_instance_num) (struct script_state **st, int64 *num, const char **name, int *val);
+typedef void (*HPMHOOK_post_script_set_reg_instance_num) (struct script_state *st, int64 num, const char *name, int val);
+typedef void (*HPMHOOK_pre_script_stack_expand) (struct script_stack **stack);
+typedef void (*HPMHOOK_post_script_stack_expand) (struct script_stack *stack);
+typedef struct script_data* (*HPMHOOK_pre_script_push_retinfo) (struct script_stack **stack, struct script_retinfo **ri, struct reg_db **ref);
+typedef struct script_data* (*HPMHOOK_post_script_push_retinfo) (struct script_data* retVal___, struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref);
+typedef void (*HPMHOOK_pre_script_op_3) (struct script_state **st, int *op);
+typedef void (*HPMHOOK_post_script_op_3) (struct script_state *st, int op);
+typedef void (*HPMHOOK_pre_script_op_2str) (struct script_state **st, int *op, const char **s1, const char **s2);
+typedef void (*HPMHOOK_post_script_op_2str) (struct script_state *st, int op, const char *s1, const char *s2);
+typedef void (*HPMHOOK_pre_script_op_2num) (struct script_state **st, int *op, int *i1, int *i2);
+typedef void (*HPMHOOK_post_script_op_2num) (struct script_state *st, int op, int i1, int i2);
+typedef void (*HPMHOOK_pre_script_op_2) (struct script_state **st, int *op);
+typedef void (*HPMHOOK_post_script_op_2) (struct script_state *st, int op);
+typedef void (*HPMHOOK_pre_script_op_1) (struct script_state **st, int *op);
+typedef void (*HPMHOOK_post_script_op_1) (struct script_state *st, int op);
+typedef bool (*HPMHOOK_pre_script_check_buildin_argtype) (struct script_state **st, int *func);
+typedef bool (*HPMHOOK_post_script_check_buildin_argtype) (bool retVal___, struct script_state *st, int func);
+typedef void (*HPMHOOK_pre_script_detach_state) (struct script_state **st, bool *dequeue_event);
+typedef void (*HPMHOOK_post_script_detach_state) (struct script_state *st, bool dequeue_event);
+typedef int (*HPMHOOK_pre_script_db_free_code_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_script_db_free_code_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_script_add_autobonus) (const char **autobonus);
+typedef void (*HPMHOOK_post_script_add_autobonus) (const char *autobonus);
+typedef int (*HPMHOOK_pre_script_menu_countoptions) (const char **str, int *max_count, int **total);
+typedef int (*HPMHOOK_post_script_menu_countoptions) (int retVal___, const char *str, int max_count, int *total);
+typedef int (*HPMHOOK_pre_script_buildin_areawarp_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_areawarp_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_areapercentheal_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_areapercentheal_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_script_buildin_delitem_delete) (struct map_session_data **sd, int *idx, int **amount, bool *delete_items);
+typedef void (*HPMHOOK_post_script_buildin_delitem_delete) (struct map_session_data *sd, int idx, int *amount, bool delete_items);
+typedef bool (*HPMHOOK_pre_script_buildin_delitem_search) (struct map_session_data **sd, struct item **it, bool *exact_match);
+typedef bool (*HPMHOOK_post_script_buildin_delitem_search) (bool retVal___, struct map_session_data *sd, struct item *it, bool exact_match);
+typedef int (*HPMHOOK_pre_script_buildin_killmonster_sub_strip) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_killmonster_sub_strip) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_killmonster_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_killmonster_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_killmonsterall_sub_strip) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_killmonsterall_sub_strip) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_killmonsterall_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_killmonsterall_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_announce_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_announce_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_getareausers_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_getareausers_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_getareadropitem_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_getareadropitem_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_mapflag_pvp_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_mapflag_pvp_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_pvpoff_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_pvpoff_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_maprespawnguildid_sub_pc) (struct map_session_data **sd, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_maprespawnguildid_sub_pc) (int retVal___, struct map_session_data *sd, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_maprespawnguildid_sub_mob) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_maprespawnguildid_sub_mob) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_mobcount_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_mobcount_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_playbgm_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_playbgm_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_playbgm_foreachpc_sub) (struct map_session_data **sd, va_list args);
+typedef int (*HPMHOOK_post_script_playbgm_foreachpc_sub) (int retVal___, struct map_session_data *sd, va_list args);
+typedef int (*HPMHOOK_pre_script_soundeffect_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_soundeffect_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_query_sql_sub) (struct script_state **st, struct Sql **handle);
+typedef int (*HPMHOOK_post_script_buildin_query_sql_sub) (int retVal___, struct script_state *st, struct Sql *handle);
+typedef int (*HPMHOOK_pre_script_buildin_instance_warpall_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_instance_warpall_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_buildin_mobuseskill_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_buildin_mobuseskill_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_cleanfloor_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_script_cleanfloor_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_script_run_func) (struct script_state **st);
+typedef int (*HPMHOOK_post_script_run_func) (int retVal___, struct script_state *st);
+typedef const char* (*HPMHOOK_pre_script_getfuncname) (struct script_state **st);
+typedef const char* (*HPMHOOK_post_script_getfuncname) (const char* retVal___, struct script_state *st);
+typedef unsigned int (*HPMHOOK_pre_script_calc_hash_ci) (const char **p);
+typedef unsigned int (*HPMHOOK_post_script_calc_hash_ci) (unsigned int retVal___, const char *p);
+typedef struct reg_db* (*HPMHOOK_pre_script_array_src) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref);
+typedef struct reg_db* (*HPMHOOK_post_script_array_src) (struct reg_db* retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+typedef void (*HPMHOOK_pre_script_array_update) (struct reg_db **src, int64 *num, bool *empty);
+typedef void (*HPMHOOK_post_script_array_update) (struct reg_db *src, int64 num, bool empty);
+typedef void (*HPMHOOK_pre_script_array_delete) (struct reg_db **src, struct script_array **sa);
+typedef void (*HPMHOOK_post_script_array_delete) (struct reg_db *src, struct script_array *sa);
+typedef void (*HPMHOOK_pre_script_array_remove_member) (struct reg_db **src, struct script_array **sa, unsigned int *idx);
+typedef void (*HPMHOOK_post_script_array_remove_member) (struct reg_db *src, struct script_array *sa, unsigned int idx);
+typedef void (*HPMHOOK_pre_script_array_add_member) (struct script_array **sa, unsigned int *idx);
+typedef void (*HPMHOOK_post_script_array_add_member) (struct script_array *sa, unsigned int idx);
+typedef unsigned int (*HPMHOOK_pre_script_array_size) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref);
+typedef unsigned int (*HPMHOOK_post_script_array_size) (unsigned int retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+typedef unsigned int (*HPMHOOK_pre_script_array_highest_key) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref);
+typedef unsigned int (*HPMHOOK_post_script_array_highest_key) (unsigned int retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+typedef int (*HPMHOOK_pre_script_array_free_db) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_script_array_free_db) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_script_array_ensure_zero) (struct script_state **st, struct map_session_data **sd, int64 *uid, struct reg_db **ref);
+typedef void (*HPMHOOK_post_script_array_ensure_zero) (struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref);
+typedef void (*HPMHOOK_pre_script_reg_destroy_single) (struct map_session_data **sd, int64 *reg, struct script_reg_state **data);
+typedef void (*HPMHOOK_post_script_reg_destroy_single) (struct map_session_data *sd, int64 reg, struct script_reg_state *data);
+typedef int (*HPMHOOK_pre_script_reg_destroy) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_script_reg_destroy) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_script_generic_ui_array_expand) (unsigned int *plus);
+typedef void (*HPMHOOK_post_script_generic_ui_array_expand) (unsigned int plus);
+typedef unsigned int* (*HPMHOOK_pre_script_array_cpy_list) (struct script_array **sa);
+typedef unsigned int* (*HPMHOOK_post_script_array_cpy_list) (unsigned int* retVal___, struct script_array *sa);
+typedef void (*HPMHOOK_pre_script_hardcoded_constants) (void);
+typedef void (*HPMHOOK_post_script_hardcoded_constants) (void);
+typedef unsigned short (*HPMHOOK_pre_script_mapindexname2id) (struct script_state **st, const char **name);
+typedef unsigned short (*HPMHOOK_post_script_mapindexname2id) (unsigned short retVal___, struct script_state *st, const char *name);
+typedef int (*HPMHOOK_pre_script_string_dup) (char **str);
+typedef int (*HPMHOOK_post_script_string_dup) (int retVal___, char *str);
+typedef void (*HPMHOOK_pre_script_load_translations) (void);
+typedef void (*HPMHOOK_post_script_load_translations) (void);
+typedef bool (*HPMHOOK_pre_script_load_translation_addstring) (const char **file, uint8 *lang_id, const char **msgctxt, const struct script_string_buf **msgid, const struct script_string_buf **msgstr);
+typedef bool (*HPMHOOK_post_script_load_translation_addstring) (bool retVal___, const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr);
+typedef int (*HPMHOOK_pre_script_load_translation) (const char **file, uint8 *lang_id);
+typedef int (*HPMHOOK_post_script_load_translation) (int retVal___, const char *file, uint8 lang_id);
+typedef int (*HPMHOOK_pre_script_translation_db_destroyer) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_script_translation_db_destroyer) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_script_clear_translations) (bool *reload);
+typedef void (*HPMHOOK_post_script_clear_translations) (bool reload);
+typedef int (*HPMHOOK_pre_script_parse_cleanup_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_script_parse_cleanup_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef uint8 (*HPMHOOK_pre_script_add_language) (const char **name);
+typedef uint8 (*HPMHOOK_post_script_add_language) (uint8 retVal___, const char *name);
+typedef const char* (*HPMHOOK_pre_script_get_translation_file_name) (const char **file);
+typedef const char* (*HPMHOOK_post_script_get_translation_file_name) (const char* retVal___, const char *file);
+typedef void (*HPMHOOK_pre_script_parser_clean_leftovers) (void);
+typedef void (*HPMHOOK_post_script_parser_clean_leftovers) (void);
+typedef void (*HPMHOOK_pre_script_run_use_script) (struct map_session_data **sd, struct item_data **data, int *oid);
+typedef void (*HPMHOOK_post_script_run_use_script) (struct map_session_data *sd, struct item_data *data, int oid);
+typedef void (*HPMHOOK_pre_script_run_item_equip_script) (struct map_session_data **sd, struct item_data **data, int *oid);
+typedef void (*HPMHOOK_post_script_run_item_equip_script) (struct map_session_data *sd, struct item_data *data, int oid);
+typedef void (*HPMHOOK_pre_script_run_item_unequip_script) (struct map_session_data **sd, struct item_data **data, int *oid);
+typedef void (*HPMHOOK_post_script_run_item_unequip_script) (struct map_session_data *sd, struct item_data *data, int oid);
+#endif // MAP_SCRIPT_H
+#ifdef MAP_SEARCHSTORE_H /* searchstore */
+typedef bool (*HPMHOOK_pre_searchstore_open) (struct map_session_data **sd, unsigned int *uses, unsigned short *effect);
+typedef bool (*HPMHOOK_post_searchstore_open) (bool retVal___, struct map_session_data *sd, unsigned int uses, unsigned short effect);
+typedef void (*HPMHOOK_pre_searchstore_query) (struct map_session_data **sd, unsigned char *type, unsigned int *min_price, unsigned int *max_price, const unsigned short **itemlist, unsigned int *item_count, const unsigned short **cardlist, unsigned int *card_count);
+typedef void (*HPMHOOK_post_searchstore_query) (struct map_session_data *sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short *itemlist, unsigned int item_count, const unsigned short *cardlist, unsigned int card_count);
+typedef bool (*HPMHOOK_pre_searchstore_querynext) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_searchstore_querynext) (bool retVal___, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_searchstore_next) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_searchstore_next) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_searchstore_clear) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_searchstore_clear) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_searchstore_close) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_searchstore_close) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_searchstore_click) (struct map_session_data **sd, int *account_id, int *store_id, unsigned short *nameid);
+typedef void (*HPMHOOK_post_searchstore_click) (struct map_session_data *sd, int account_id, int store_id, unsigned short nameid);
+typedef bool (*HPMHOOK_pre_searchstore_queryremote) (struct map_session_data **sd, int *account_id);
+typedef bool (*HPMHOOK_post_searchstore_queryremote) (bool retVal___, struct map_session_data *sd, int account_id);
+typedef void (*HPMHOOK_pre_searchstore_clearremote) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_searchstore_clearremote) (struct map_session_data *sd);
+typedef bool (*HPMHOOK_pre_searchstore_result) (struct map_session_data **sd, unsigned int *store_id, int *account_id, const char **store_name, unsigned short *nameid, unsigned short *amount, unsigned int *price, const short **card, unsigned char *refine);
+typedef bool (*HPMHOOK_post_searchstore_result) (bool retVal___, struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short *card, unsigned char refine);
+#endif // MAP_SEARCHSTORE_H
+#ifdef COMMON_SHOWMSG_H /* showmsg */
+typedef void (*HPMHOOK_pre_showmsg_init) (void);
+typedef void (*HPMHOOK_post_showmsg_init) (void);
+typedef void (*HPMHOOK_pre_showmsg_final) (void);
+typedef void (*HPMHOOK_post_showmsg_final) (void);
+typedef void (*HPMHOOK_pre_showmsg_clearScreen) (void);
+typedef void (*HPMHOOK_post_showmsg_clearScreen) (void);
+typedef int (*HPMHOOK_pre_showmsg_showMessageV) (const char **string, va_list ap);
+typedef int (*HPMHOOK_post_showmsg_showMessageV) (int retVal___, const char *string, va_list ap);
+#endif // COMMON_SHOWMSG_H
+#ifdef MAP_SKILL_H /* skill */
+typedef int (*HPMHOOK_pre_skill_init) (bool *minimal);
+typedef int (*HPMHOOK_post_skill_init) (int retVal___, bool minimal);
+typedef int (*HPMHOOK_pre_skill_final) (void);
+typedef int (*HPMHOOK_post_skill_final) (int retVal___);
+typedef void (*HPMHOOK_pre_skill_reload) (void);
+typedef void (*HPMHOOK_post_skill_reload) (void);
+typedef void (*HPMHOOK_pre_skill_read_db) (bool *minimal);
+typedef void (*HPMHOOK_post_skill_read_db) (bool minimal);
+typedef int (*HPMHOOK_pre_skill_get_index) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_index) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_type) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_type) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_hit) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_hit) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_inf) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_inf) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_ele) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_ele) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_nk) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_nk) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_max) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_max) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_range) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_range) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_range2) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_range2) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_splash) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_splash) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_hp) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_hp) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_mhp) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_mhp) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_sp) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_sp) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_state) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_state) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_spiritball) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_spiritball) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_zeny) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_zeny) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_num) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_num) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_cast) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_cast) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_delay) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_delay) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_walkdelay) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_walkdelay) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_time) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_time) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_time2) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_time2) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_castnodex) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_castnodex) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_delaynodex) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_delaynodex) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_castdef) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_castdef) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_weapontype) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_weapontype) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_ammotype) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_ammotype) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_ammo_qty) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_ammo_qty) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_unit_id) (uint16 *skill_id, int *flag);
+typedef int (*HPMHOOK_post_skill_get_unit_id) (int retVal___, uint16 skill_id, int flag);
+typedef int (*HPMHOOK_pre_skill_get_inf2) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_inf2) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_castcancel) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_castcancel) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_maxcount) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_maxcount) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_blewcount) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_blewcount) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_unit_flag) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_unit_flag) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_unit_target) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_unit_target) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_unit_interval) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_unit_interval) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_unit_bl_target) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_unit_bl_target) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_unit_layout_type) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_unit_layout_type) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_unit_range) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_unit_range) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_get_cooldown) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_cooldown) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_tree_get_max) (uint16 *skill_id, int *class);
+typedef int (*HPMHOOK_post_skill_tree_get_max) (int retVal___, uint16 skill_id, int class);
+typedef const char* (*HPMHOOK_pre_skill_get_name) (uint16 *skill_id);
+typedef const char* (*HPMHOOK_post_skill_get_name) (const char* retVal___, uint16 skill_id);
+typedef const char* (*HPMHOOK_pre_skill_get_desc) (uint16 *skill_id);
+typedef const char* (*HPMHOOK_post_skill_get_desc) (const char* retVal___, uint16 skill_id);
+typedef void (*HPMHOOK_pre_skill_chk) (uint16 **skill_id);
+typedef void (*HPMHOOK_post_skill_chk) (uint16 *skill_id);
+typedef int (*HPMHOOK_pre_skill_get_casttype) (uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_get_casttype) (int retVal___, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_get_casttype2) (uint16 *index);
+typedef int (*HPMHOOK_post_skill_get_casttype2) (int retVal___, uint16 index);
+typedef bool (*HPMHOOK_pre_skill_is_combo) (int *skill_id);
+typedef bool (*HPMHOOK_post_skill_is_combo) (bool retVal___, int skill_id);
+typedef int (*HPMHOOK_pre_skill_name2id) (const char **name);
+typedef int (*HPMHOOK_post_skill_name2id) (int retVal___, const char *name);
+typedef int (*HPMHOOK_pre_skill_isammotype) (struct map_session_data **sd, int *skill_id);
+typedef int (*HPMHOOK_post_skill_isammotype) (int retVal___, struct map_session_data *sd, int skill_id);
+typedef int (*HPMHOOK_pre_skill_castend_id) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_castend_id) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_castend_pos) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_castend_pos) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_castend_map) (struct map_session_data **sd, uint16 *skill_id, const char **mapname);
+typedef int (*HPMHOOK_post_skill_castend_map) (int retVal___, struct map_session_data *sd, uint16 skill_id, const char *mapname);
+typedef int (*HPMHOOK_pre_skill_cleartimerskill) (struct block_list **src);
+typedef int (*HPMHOOK_post_skill_cleartimerskill) (int retVal___, struct block_list *src);
+typedef int (*HPMHOOK_pre_skill_addtimerskill) (struct block_list **src, int64 *tick, int *target, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int *type, int *flag);
+typedef int (*HPMHOOK_post_skill_addtimerskill) (int retVal___, struct block_list *src, int64 tick, int target, int x, int y, uint16 skill_id, uint16 skill_lv, int type, int flag);
+typedef int (*HPMHOOK_pre_skill_additional_effect) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
+typedef int (*HPMHOOK_post_skill_additional_effect) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int dmg_lv, int64 tick);
+typedef int (*HPMHOOK_pre_skill_counter_additional_effect) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
+typedef int (*HPMHOOK_post_skill_counter_additional_effect) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int64 tick);
+typedef int (*HPMHOOK_pre_skill_blown) (struct block_list **src, struct block_list **target, int *count, int8 *dir, int *flag);
+typedef int (*HPMHOOK_post_skill_blown) (int retVal___, struct block_list *src, struct block_list *target, int count, int8 dir, int flag);
+typedef int (*HPMHOOK_pre_skill_break_equip) (struct block_list **bl, unsigned short *where, int *rate, int *flag);
+typedef int (*HPMHOOK_post_skill_break_equip) (int retVal___, struct block_list *bl, unsigned short where, int rate, int flag);
+typedef int (*HPMHOOK_pre_skill_strip_equip) (struct block_list **bl, unsigned short *where, int *rate, int *lv, int *time);
+typedef int (*HPMHOOK_post_skill_strip_equip) (int retVal___, struct block_list *bl, unsigned short where, int rate, int lv, int time);
+typedef struct skill_unit_group* (*HPMHOOK_pre_skill_id2group) (int *group_id);
+typedef struct skill_unit_group* (*HPMHOOK_post_skill_id2group) (struct skill_unit_group* retVal___, int group_id);
+typedef struct skill_unit_group* (*HPMHOOK_pre_skill_unitsetting) (struct block_list **src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag);
+typedef struct skill_unit_group* (*HPMHOOK_post_skill_unitsetting) (struct skill_unit_group* retVal___, struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag);
+typedef struct skill_unit* (*HPMHOOK_pre_skill_initunit) (struct skill_unit_group **group, int *idx, int *x, int *y, int *val1, int *val2);
+typedef struct skill_unit* (*HPMHOOK_post_skill_initunit) (struct skill_unit* retVal___, struct skill_unit_group *group, int idx, int x, int y, int val1, int val2);
+typedef int (*HPMHOOK_pre_skill_delunit) (struct skill_unit **su);
+typedef int (*HPMHOOK_post_skill_delunit) (int retVal___, struct skill_unit *su);
+typedef struct skill_unit_group* (*HPMHOOK_pre_skill_init_unitgroup) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval);
+typedef struct skill_unit_group* (*HPMHOOK_post_skill_init_unitgroup) (struct skill_unit_group* retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval);
+typedef int (*HPMHOOK_pre_skill_del_unitgroup) (struct skill_unit_group **group, const char **file, int *line, const char **func);
+typedef int (*HPMHOOK_post_skill_del_unitgroup) (int retVal___, struct skill_unit_group *group, const char *file, int line, const char *func);
+typedef int (*HPMHOOK_pre_skill_clear_unitgroup) (struct block_list **src);
+typedef int (*HPMHOOK_post_skill_clear_unitgroup) (int retVal___, struct block_list *src);
+typedef int (*HPMHOOK_pre_skill_clear_group) (struct block_list **bl, int *flag);
+typedef int (*HPMHOOK_post_skill_clear_group) (int retVal___, struct block_list *bl, int flag);
+typedef int (*HPMHOOK_pre_skill_unit_onplace) (struct skill_unit **src, struct block_list **bl, int64 *tick);
+typedef int (*HPMHOOK_post_skill_unit_onplace) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick);
+typedef int (*HPMHOOK_pre_skill_unit_ondamaged) (struct skill_unit **src, struct block_list **bl, int64 *damage, int64 *tick);
+typedef int (*HPMHOOK_post_skill_unit_ondamaged) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick);
+typedef int (*HPMHOOK_pre_skill_cast_fix) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_cast_fix) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_cast_fix_sc) (struct block_list **bl, int *time);
+typedef int (*HPMHOOK_post_skill_cast_fix_sc) (int retVal___, struct block_list *bl, int time);
+typedef int (*HPMHOOK_pre_skill_vf_cast_fix) (struct block_list **bl, double *time, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_vf_cast_fix) (int retVal___, struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_delay_fix) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_delay_fix) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_check_condition_castbegin) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_check_condition_castbegin) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_check_condition_castend) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_check_condition_castend) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_consume_requirement) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv, short *type);
+typedef int (*HPMHOOK_post_skill_consume_requirement) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type);
+typedef struct skill_condition (*HPMHOOK_pre_skill_get_requirement) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef struct skill_condition (*HPMHOOK_post_skill_get_requirement) (struct skill_condition retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_check_pc_partner) (struct map_session_data **sd, uint16 *skill_id, uint16 **skill_lv, int *range, int *cast_flag);
+typedef int (*HPMHOOK_post_skill_check_pc_partner) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag);
+typedef int (*HPMHOOK_pre_skill_unit_move) (struct block_list **bl, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_skill_unit_move) (int retVal___, struct block_list *bl, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_unit_onleft) (uint16 *skill_id, struct block_list **bl, int64 *tick);
+typedef int (*HPMHOOK_post_skill_unit_onleft) (int retVal___, uint16 skill_id, struct block_list *bl, int64 tick);
+typedef int (*HPMHOOK_pre_skill_unit_onout) (struct skill_unit **src, struct block_list **bl, int64 *tick);
+typedef int (*HPMHOOK_post_skill_unit_onout) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick);
+typedef int (*HPMHOOK_pre_skill_unit_move_unit_group) (struct skill_unit_group **group, int16 *m, int16 *dx, int16 *dy);
+typedef int (*HPMHOOK_post_skill_unit_move_unit_group) (int retVal___, struct skill_unit_group *group, int16 m, int16 dx, int16 dy);
+typedef int (*HPMHOOK_pre_skill_sit) (struct map_session_data **sd, int *type);
+typedef int (*HPMHOOK_post_skill_sit) (int retVal___, struct map_session_data *sd, int type);
+typedef void (*HPMHOOK_pre_skill_brandishspear) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef void (*HPMHOOK_post_skill_brandishspear) (struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef void (*HPMHOOK_pre_skill_repairweapon) (struct map_session_data **sd, int *idx);
+typedef void (*HPMHOOK_post_skill_repairweapon) (struct map_session_data *sd, int idx);
+typedef void (*HPMHOOK_pre_skill_identify) (struct map_session_data **sd, int *idx);
+typedef void (*HPMHOOK_post_skill_identify) (struct map_session_data *sd, int idx);
+typedef void (*HPMHOOK_pre_skill_weaponrefine) (struct map_session_data **sd, int *idx);
+typedef void (*HPMHOOK_post_skill_weaponrefine) (struct map_session_data *sd, int idx);
+typedef int (*HPMHOOK_pre_skill_autospell) (struct map_session_data **md, uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_autospell) (int retVal___, struct map_session_data *md, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_calc_heal) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, bool *heal);
+typedef int (*HPMHOOK_post_skill_calc_heal) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal);
+typedef bool (*HPMHOOK_pre_skill_check_cloaking) (struct block_list **bl, struct status_change_entry **sce);
+typedef bool (*HPMHOOK_post_skill_check_cloaking) (bool retVal___, struct block_list *bl, struct status_change_entry *sce);
+typedef int (*HPMHOOK_pre_skill_check_cloaking_end) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_check_cloaking_end) (int retVal___, struct block_list *bl, va_list ap);
+typedef bool (*HPMHOOK_pre_skill_can_cloak) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_skill_can_cloak) (bool retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_skill_enchant_elemental_end) (struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_skill_enchant_elemental_end) (int retVal___, struct block_list *bl, int type);
+typedef int (*HPMHOOK_pre_skill_not_ok) (uint16 *skill_id, struct map_session_data **sd);
+typedef int (*HPMHOOK_post_skill_not_ok) (int retVal___, uint16 skill_id, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_skill_not_ok_unknown) (uint16 *skill_id, struct map_session_data **sd);
+typedef int (*HPMHOOK_post_skill_not_ok_unknown) (int retVal___, uint16 skill_id, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_skill_not_ok_hom) (uint16 *skill_id, struct homun_data **hd);
+typedef int (*HPMHOOK_post_skill_not_ok_hom) (int retVal___, uint16 skill_id, struct homun_data *hd);
+typedef int (*HPMHOOK_pre_skill_not_ok_hom_unknown) (uint16 *skill_id, struct homun_data **hd);
+typedef int (*HPMHOOK_post_skill_not_ok_hom_unknown) (int retVal___, uint16 skill_id, struct homun_data *hd);
+typedef int (*HPMHOOK_pre_skill_not_ok_mercenary) (uint16 *skill_id, struct mercenary_data **md);
+typedef int (*HPMHOOK_post_skill_not_ok_mercenary) (int retVal___, uint16 skill_id, struct mercenary_data *md);
+typedef int (*HPMHOOK_pre_skill_chastle_mob_changetarget) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_chastle_mob_changetarget) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_can_produce_mix) (struct map_session_data **sd, int *nameid, int *trigger, int *qty);
+typedef int (*HPMHOOK_post_skill_can_produce_mix) (int retVal___, struct map_session_data *sd, int nameid, int trigger, int qty);
+typedef int (*HPMHOOK_pre_skill_produce_mix) (struct map_session_data **sd, uint16 *skill_id, int *nameid, int *slot1, int *slot2, int *slot3, int *qty);
+typedef int (*HPMHOOK_post_skill_produce_mix) (int retVal___, struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty);
+typedef int (*HPMHOOK_pre_skill_arrow_create) (struct map_session_data **sd, int *nameid);
+typedef int (*HPMHOOK_post_skill_arrow_create) (int retVal___, struct map_session_data *sd, int nameid);
+typedef void (*HPMHOOK_pre_skill_castend_type) (int *type, struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef void (*HPMHOOK_post_skill_castend_type) (int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_castend_nodamage_id) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_skill_castend_nodamage_id) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_castend_damage_id) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_skill_castend_damage_id) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_castend_pos2) (struct block_list **src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_skill_castend_pos2) (int retVal___, struct block_list *src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_blockpc_start) (struct map_session_data **sd, uint16 *skill_id, int *tick);
+typedef int (*HPMHOOK_post_skill_blockpc_start) (int retVal___, struct map_session_data *sd, uint16 skill_id, int tick);
+typedef int (*HPMHOOK_pre_skill_blockhomun_start) (struct homun_data **hd, uint16 *skill_id, int *tick);
+typedef int (*HPMHOOK_post_skill_blockhomun_start) (int retVal___, struct homun_data *hd, uint16 skill_id, int tick);
+typedef int (*HPMHOOK_pre_skill_blockmerc_start) (struct mercenary_data **md, uint16 *skill_id, int *tick);
+typedef int (*HPMHOOK_post_skill_blockmerc_start) (int retVal___, struct mercenary_data *md, uint16 skill_id, int tick);
+typedef int (*HPMHOOK_pre_skill_attack) (int *attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_skill_attack) (int retVal___, int attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_attack_area) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_attack_area) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_area_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_area_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_area_sub_count) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef int (*HPMHOOK_post_skill_area_sub_count) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+typedef int (*HPMHOOK_pre_skill_check_unit_range) (struct block_list **bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_check_unit_range) (int retVal___, struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_check_unit_range_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_check_unit_range_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_check_unit_range2) (struct block_list **bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_check_unit_range2) (int retVal___, struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_check_unit_range2_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_check_unit_range2_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_skill_toggle_magicpower) (struct block_list **bl, uint16 *skill_id);
+typedef void (*HPMHOOK_post_skill_toggle_magicpower) (struct block_list *bl, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_magic_reflect) (struct block_list **src, struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_skill_magic_reflect) (int retVal___, struct block_list *src, struct block_list *bl, int type);
+typedef int (*HPMHOOK_pre_skill_onskillusage) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_id, int64 *tick);
+typedef int (*HPMHOOK_post_skill_onskillusage) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_id, int64 tick);
+typedef int (*HPMHOOK_pre_skill_cell_overlap) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_cell_overlap) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_timerskill) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_timerskill) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_trap_splash) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_trap_splash) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_check_condition_mercenary) (struct block_list **bl, int *skill_id, int *lv, int *type);
+typedef int (*HPMHOOK_post_skill_check_condition_mercenary) (int retVal___, struct block_list *bl, int skill_id, int lv, int type);
+typedef struct skill_unit_group* (*HPMHOOK_pre_skill_locate_element_field) (struct block_list **bl);
+typedef struct skill_unit_group* (*HPMHOOK_post_skill_locate_element_field) (struct skill_unit_group* retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_skill_graffitiremover) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_graffitiremover) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_activate_reverberation) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_activate_reverberation) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_dance_overlap_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_dance_overlap_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_dance_overlap) (struct skill_unit **su, int *flag);
+typedef int (*HPMHOOK_post_skill_dance_overlap) (int retVal___, struct skill_unit *su, int flag);
+typedef struct s_skill_unit_layout* (*HPMHOOK_pre_skill_get_unit_layout) (uint16 *skill_id, uint16 *skill_lv, struct block_list **src, int *x, int *y);
+typedef struct s_skill_unit_layout* (*HPMHOOK_post_skill_get_unit_layout) (struct s_skill_unit_layout* retVal___, uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y);
+typedef int (*HPMHOOK_pre_skill_frostjoke_scream) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_frostjoke_scream) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_greed) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_greed) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_destroy_trap) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_destroy_trap) (int retVal___, struct block_list *bl, va_list ap);
+typedef struct skill_unit_group_tickset* (*HPMHOOK_pre_skill_unitgrouptickset_search) (struct block_list **bl, struct skill_unit_group **group, int64 *tick);
+typedef struct skill_unit_group_tickset* (*HPMHOOK_post_skill_unitgrouptickset_search) (struct skill_unit_group_tickset* retVal___, struct block_list *bl, struct skill_unit_group *group, int64 tick);
+typedef bool (*HPMHOOK_pre_skill_dance_switch) (struct skill_unit **su, int *flag);
+typedef bool (*HPMHOOK_post_skill_dance_switch) (bool retVal___, struct skill_unit *su, int flag);
+typedef int (*HPMHOOK_pre_skill_check_condition_char_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_check_condition_char_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_check_condition_mob_master_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_check_condition_mob_master_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_skill_brandishspear_first) (struct square **tc, uint8 *dir, int16 *x, int16 *y);
+typedef void (*HPMHOOK_post_skill_brandishspear_first) (struct square *tc, uint8 dir, int16 x, int16 y);
+typedef void (*HPMHOOK_pre_skill_brandishspear_dir) (struct square **tc, uint8 *dir, int *are);
+typedef void (*HPMHOOK_post_skill_brandishspear_dir) (struct square *tc, uint8 dir, int are);
+typedef int (*HPMHOOK_pre_skill_get_fixed_cast) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_fixed_cast) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_skill_sit_count) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_sit_count) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_sit_in) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_sit_in) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_sit_out) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_sit_out) (int retVal___, struct block_list *bl, va_list ap);
+typedef void (*HPMHOOK_pre_skill_unitsetmapcell) (struct skill_unit **src, uint16 *skill_id, uint16 *skill_lv, cell_t *cell, bool *flag);
+typedef void (*HPMHOOK_post_skill_unitsetmapcell) (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag);
+typedef int (*HPMHOOK_pre_skill_unit_onplace_timer) (struct skill_unit **src, struct block_list **bl, int64 *tick);
+typedef int (*HPMHOOK_post_skill_unit_onplace_timer) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick);
+typedef void (*HPMHOOK_pre_skill_unit_onplace_timer_unknown) (struct skill_unit **src, struct block_list **bl, int64 **tick);
+typedef void (*HPMHOOK_post_skill_unit_onplace_timer_unknown) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+typedef int (*HPMHOOK_pre_skill_unit_effect) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_unit_effect) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_unit_timer_sub_onplace) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_unit_timer_sub_onplace) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_unit_move_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_unit_move_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_skill_blockpc_end) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_blockpc_end) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_blockhomun_end) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_blockhomun_end) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_blockmerc_end) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_blockmerc_end) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_split_atoi) (char **str, int **val);
+typedef int (*HPMHOOK_post_skill_split_atoi) (int retVal___, char *str, int *val);
+typedef int (*HPMHOOK_pre_skill_unit_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_skill_unit_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_skill_unit_timer_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_skill_unit_timer_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+typedef void (*HPMHOOK_pre_skill_init_unit_layout) (void);
+typedef void (*HPMHOOK_post_skill_init_unit_layout) (void);
+typedef void (*HPMHOOK_pre_skill_init_unit_layout_unknown) (int *skill_idx);
+typedef void (*HPMHOOK_post_skill_init_unit_layout_unknown) (int skill_idx);
+typedef void (*HPMHOOK_pre_skill_validate_hittype) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_hittype) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_skilltype) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_skilltype) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_attacktype) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_attacktype) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_element) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_element) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_skillinfo) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_skillinfo) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_damagetype) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_damagetype) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_castnodex) (struct config_setting_t **conf, struct s_skill_db **sk, bool *delay);
+typedef void (*HPMHOOK_post_skill_validate_castnodex) (struct config_setting_t *conf, struct s_skill_db *sk, bool delay);
+typedef void (*HPMHOOK_pre_skill_validate_weapontype) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_weapontype) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_ammotype) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_ammotype) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_state) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_state) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_item_requirements) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_item_requirements) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_unit_target) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_unit_target) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_unit_flag) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_unit_flag) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef void (*HPMHOOK_pre_skill_validate_additional_fields) (struct config_setting_t **conf, struct s_skill_db **sk);
+typedef void (*HPMHOOK_post_skill_validate_additional_fields) (struct config_setting_t *conf, struct s_skill_db *sk);
+typedef bool (*HPMHOOK_pre_skill_validate_skilldb) (struct s_skill_db **skt, const char **source);
+typedef bool (*HPMHOOK_post_skill_validate_skilldb) (bool retVal___, struct s_skill_db *skt, const char *source);
+typedef int (*HPMHOOK_pre_skill_validate_weapontype_sub) (const char **type, bool *on, struct s_skill_db **sk);
+typedef int (*HPMHOOK_post_skill_validate_weapontype_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk);
+typedef int (*HPMHOOK_pre_skill_validate_ammotype_sub) (const char **type, bool *on, struct s_skill_db **sk);
+typedef int (*HPMHOOK_post_skill_validate_ammotype_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk);
+typedef int (*HPMHOOK_pre_skill_validate_unit_flag_sub) (const char **type, bool *on, struct s_skill_db **sk);
+typedef int (*HPMHOOK_post_skill_validate_unit_flag_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk);
+typedef bool (*HPMHOOK_pre_skill_read_skilldb) (const char **filename);
+typedef bool (*HPMHOOK_post_skill_read_skilldb) (bool retVal___, const char *filename);
+typedef void (*HPMHOOK_pre_skill_config_set_level) (struct config_setting_t **conf, int **arr);
+typedef void (*HPMHOOK_post_skill_config_set_level) (struct config_setting_t *conf, int *arr);
+typedef void (*HPMHOOK_pre_skill_level_set_value) (int **arr, int *value);
+typedef void (*HPMHOOK_post_skill_level_set_value) (int *arr, int value);
+typedef bool (*HPMHOOK_pre_skill_parse_row_producedb) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_producedb) (bool retVal___, char *split[], int columns, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_createarrowdb) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_createarrowdb) (bool retVal___, char *split[], int columns, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_abradb) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_abradb) (bool retVal___, char *split[], int columns, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_spellbookdb) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_spellbookdb) (bool retVal___, char *split[], int columns, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_magicmushroomdb) (char **split[], int *column, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_magicmushroomdb) (bool retVal___, char *split[], int column, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_reproducedb) (char **split[], int *column, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_reproducedb) (bool retVal___, char *split[], int column, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_improvisedb) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_improvisedb) (bool retVal___, char *split[], int columns, int current);
+typedef bool (*HPMHOOK_pre_skill_parse_row_changematerialdb) (char **split[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_skill_parse_row_changematerialdb) (bool retVal___, char *split[], int columns, int current);
+typedef void (*HPMHOOK_pre_skill_usave_add) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
+typedef void (*HPMHOOK_post_skill_usave_add) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_skill_usave_trigger) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_skill_usave_trigger) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_skill_cooldown_load) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_skill_cooldown_load) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_skill_spellbook) (struct map_session_data **sd, int *nameid);
+typedef int (*HPMHOOK_post_skill_spellbook) (int retVal___, struct map_session_data *sd, int nameid);
+typedef int (*HPMHOOK_pre_skill_block_check) (struct block_list **bl, enum sc_type *type, uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_block_check) (int retVal___, struct block_list *bl, enum sc_type type, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_detonator) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_detonator) (int retVal___, struct block_list *bl, va_list ap);
+typedef bool (*HPMHOOK_pre_skill_check_camouflage) (struct block_list **bl, struct status_change_entry **sce);
+typedef bool (*HPMHOOK_post_skill_check_camouflage) (bool retVal___, struct block_list *bl, struct status_change_entry *sce);
+typedef int (*HPMHOOK_pre_skill_magicdecoy) (struct map_session_data **sd, int *nameid);
+typedef int (*HPMHOOK_post_skill_magicdecoy) (int retVal___, struct map_session_data *sd, int nameid);
+typedef int (*HPMHOOK_pre_skill_poisoningweapon) (struct map_session_data **sd, int *nameid);
+typedef int (*HPMHOOK_post_skill_poisoningweapon) (int retVal___, struct map_session_data *sd, int nameid);
+typedef int (*HPMHOOK_pre_skill_select_menu) (struct map_session_data **sd, uint16 *skill_id);
+typedef int (*HPMHOOK_post_skill_select_menu) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+typedef int (*HPMHOOK_pre_skill_elementalanalysis) (struct map_session_data **sd, uint16 *skill_lv, const struct itemlist **item_list);
+typedef int (*HPMHOOK_post_skill_elementalanalysis) (int retVal___, struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list);
+typedef int (*HPMHOOK_pre_skill_changematerial) (struct map_session_data **sd, const struct itemlist **item_list);
+typedef int (*HPMHOOK_post_skill_changematerial) (int retVal___, struct map_session_data *sd, const struct itemlist *item_list);
+typedef int (*HPMHOOK_pre_skill_get_elemental_type) (uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_skill_get_elemental_type) (int retVal___, uint16 skill_id, uint16 skill_lv);
+typedef void (*HPMHOOK_pre_skill_cooldown_save) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_skill_cooldown_save) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_skill_get_new_group_id) (void);
+typedef int (*HPMHOOK_post_skill_get_new_group_id) (int retVal___);
+typedef bool (*HPMHOOK_pre_skill_check_shadowform) (struct block_list **bl, int64 *damage, int *hit);
+typedef bool (*HPMHOOK_post_skill_check_shadowform) (bool retVal___, struct block_list *bl, int64 damage, int hit);
+typedef bool (*HPMHOOK_pre_skill_castend_damage_id_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, struct status_data **tstatus, struct status_change **sc);
+typedef bool (*HPMHOOK_post_skill_castend_damage_id_unknown) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc);
+typedef void (*HPMHOOK_pre_skill_additional_effect_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int **attack_type, int **dmg_lv, int64 **tick);
+typedef void (*HPMHOOK_post_skill_additional_effect_unknown) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
+typedef void (*HPMHOOK_pre_skill_counter_additional_effect_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int **attack_type, int64 **tick);
+typedef void (*HPMHOOK_post_skill_counter_additional_effect_unknown) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
+typedef void (*HPMHOOK_pre_skill_attack_combo1_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, struct status_change_entry **sce, int **combo);
+typedef void (*HPMHOOK_post_skill_attack_combo1_unknown) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo);
+typedef void (*HPMHOOK_pre_skill_attack_combo2_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, int **combo);
+typedef void (*HPMHOOK_post_skill_attack_combo2_unknown) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo);
+typedef void (*HPMHOOK_pre_skill_attack_display_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, int **type, struct Damage **dmg, int64 **damage);
+typedef void (*HPMHOOK_post_skill_attack_display_unknown) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage);
+typedef int (*HPMHOOK_pre_skill_attack_copy_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef int (*HPMHOOK_post_skill_attack_copy_unknown) (int retVal___, int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef int (*HPMHOOK_pre_skill_attack_dir_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef int (*HPMHOOK_post_skill_attack_dir_unknown) (int retVal___, int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef void (*HPMHOOK_pre_skill_attack_blow_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, int **type, struct Damage **dmg, int64 **damage, int8 **dir);
+typedef void (*HPMHOOK_post_skill_attack_blow_unknown) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir);
+typedef void (*HPMHOOK_pre_skill_attack_post_unknown) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef void (*HPMHOOK_post_skill_attack_post_unknown) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef bool (*HPMHOOK_pre_skill_timerskill_dead_unknown) (struct block_list **src, struct unit_data **ud, struct skill_timerskill **skl);
+typedef bool (*HPMHOOK_post_skill_timerskill_dead_unknown) (bool retVal___, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
+typedef void (*HPMHOOK_pre_skill_timerskill_target_unknown) (int *tid, int64 *tick, struct block_list **src, struct block_list **target, struct unit_data **ud, struct skill_timerskill **skl);
+typedef void (*HPMHOOK_post_skill_timerskill_target_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl);
+typedef void (*HPMHOOK_pre_skill_timerskill_notarget_unknown) (int *tid, int64 *tick, struct block_list **src, struct unit_data **ud, struct skill_timerskill **skl);
+typedef void (*HPMHOOK_post_skill_timerskill_notarget_unknown) (int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
+typedef bool (*HPMHOOK_pre_skill_cleartimerskill_exception) (int *skill_id);
+typedef bool (*HPMHOOK_post_skill_cleartimerskill_exception) (bool retVal___, int skill_id);
+typedef bool (*HPMHOOK_pre_skill_castend_id_unknown) (struct unit_data **ud, struct block_list **src, struct block_list **target);
+typedef bool (*HPMHOOK_post_skill_castend_id_unknown) (bool retVal___, struct unit_data *ud, struct block_list *src, struct block_list *target);
+typedef bool (*HPMHOOK_pre_skill_castend_nodamage_id_dead_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef bool (*HPMHOOK_post_skill_castend_nodamage_id_dead_unknown) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef bool (*HPMHOOK_pre_skill_castend_nodamage_id_undead_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef bool (*HPMHOOK_post_skill_castend_nodamage_id_undead_unknown) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef bool (*HPMHOOK_pre_skill_castend_nodamage_id_mado_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef bool (*HPMHOOK_post_skill_castend_nodamage_id_mado_unknown) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef bool (*HPMHOOK_pre_skill_castend_nodamage_id_unknown) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef bool (*HPMHOOK_post_skill_castend_nodamage_id_unknown) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef void (*HPMHOOK_pre_skill_castend_pos2_effect_unknown) (struct block_list **src, int **x, int **y, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef void (*HPMHOOK_post_skill_castend_pos2_effect_unknown) (struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef bool (*HPMHOOK_pre_skill_castend_pos2_unknown) (struct block_list **src, int **x, int **y, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
+typedef bool (*HPMHOOK_post_skill_castend_pos2_unknown) (bool retVal___, struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+typedef void (*HPMHOOK_pre_skill_unitsetting1_unknown) (struct block_list **src, uint16 **skill_id, uint16 **skill_lv, int16 **x, int16 **y, int **flag, int **val1, int **val2, int **val3);
+typedef void (*HPMHOOK_post_skill_unitsetting1_unknown) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3);
+typedef void (*HPMHOOK_pre_skill_unitsetting2_unknown) (struct block_list **src, uint16 **skill_id, uint16 **skill_lv, int16 **x, int16 **y, int **flag, int **unit_flag, int **val1, int **val2, int **val3, struct skill_unit_group **group);
+typedef void (*HPMHOOK_post_skill_unitsetting2_unknown) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group);
+typedef void (*HPMHOOK_pre_skill_unit_onplace_unknown) (struct skill_unit **src, struct block_list **bl, int64 **tick);
+typedef void (*HPMHOOK_post_skill_unit_onplace_unknown) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+typedef int (*HPMHOOK_pre_skill_check_condition_castbegin_off_unknown) (struct status_change **sc, uint16 **skill_id);
+typedef int (*HPMHOOK_post_skill_check_condition_castbegin_off_unknown) (int retVal___, struct status_change *sc, uint16 *skill_id);
+typedef int (*HPMHOOK_pre_skill_check_condition_castbegin_mount_unknown) (struct status_change **sc, uint16 **skill_id);
+typedef int (*HPMHOOK_post_skill_check_condition_castbegin_mount_unknown) (int retVal___, struct status_change *sc, uint16 *skill_id);
+typedef int (*HPMHOOK_pre_skill_check_condition_castbegin_madogear_unknown) (struct status_change **sc, uint16 **skill_id);
+typedef int (*HPMHOOK_post_skill_check_condition_castbegin_madogear_unknown) (int retVal___, struct status_change *sc, uint16 *skill_id);
+typedef int (*HPMHOOK_pre_skill_check_condition_castbegin_unknown) (struct status_change **sc, uint16 **skill_id);
+typedef int (*HPMHOOK_post_skill_check_condition_castbegin_unknown) (int retVal___, struct status_change *sc, uint16 *skill_id);
+typedef void (*HPMHOOK_pre_skill_check_condition_castend_unknown) (struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv);
+typedef void (*HPMHOOK_post_skill_check_condition_castend_unknown) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+typedef bool (*HPMHOOK_pre_skill_get_requirement_off_unknown) (struct status_change **sc, uint16 **skill_id);
+typedef bool (*HPMHOOK_post_skill_get_requirement_off_unknown) (bool retVal___, struct status_change *sc, uint16 *skill_id);
+typedef bool (*HPMHOOK_pre_skill_get_requirement_item_unknown) (struct status_change **sc, struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv, uint16 **idx, int **i);
+typedef bool (*HPMHOOK_post_skill_get_requirement_item_unknown) (bool retVal___, struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i);
+typedef void (*HPMHOOK_pre_skill_get_requirement_unknown) (struct status_change **sc, struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv, struct skill_condition **req);
+typedef void (*HPMHOOK_post_skill_get_requirement_unknown) (struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req);
+typedef int (*HPMHOOK_pre_skill_splash_target) (struct block_list **bl);
+typedef int (*HPMHOOK_post_skill_splash_target) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_skill_check_npc_chaospanic) (struct block_list **bl, va_list args);
+typedef int (*HPMHOOK_post_skill_check_npc_chaospanic) (int retVal___, struct block_list *bl, va_list args);
+typedef int (*HPMHOOK_pre_skill_count_wos) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_skill_count_wos) (int retVal___, struct block_list *bl, va_list ap);
+#endif // MAP_SKILL_H
+#ifdef COMMON_SOCKET_H /* sockt */
+typedef void (*HPMHOOK_pre_sockt_init) (void);
+typedef void (*HPMHOOK_post_sockt_init) (void);
+typedef void (*HPMHOOK_pre_sockt_final) (void);
+typedef void (*HPMHOOK_post_sockt_final) (void);
+typedef int (*HPMHOOK_pre_sockt_perform) (int *next);
+typedef int (*HPMHOOK_post_sockt_perform) (int retVal___, int next);
+typedef void (*HPMHOOK_pre_sockt_datasync) (int *fd, bool *send);
+typedef void (*HPMHOOK_post_sockt_datasync) (int fd, bool send);
+typedef int (*HPMHOOK_pre_sockt_make_listen_bind) (uint32 *ip, uint16 *port);
+typedef int (*HPMHOOK_post_sockt_make_listen_bind) (int retVal___, uint32 ip, uint16 port);
+typedef int (*HPMHOOK_pre_sockt_make_connection) (uint32 *ip, uint16 *port, struct hSockOpt **opt);
+typedef int (*HPMHOOK_post_sockt_make_connection) (int retVal___, uint32 ip, uint16 port, struct hSockOpt *opt);
+typedef int (*HPMHOOK_pre_sockt_realloc_fifo) (int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
+typedef int (*HPMHOOK_post_sockt_realloc_fifo) (int retVal___, int fd, unsigned int rfifo_size, unsigned int wfifo_size);
+typedef int (*HPMHOOK_pre_sockt_realloc_writefifo) (int *fd, size_t *addition);
+typedef int (*HPMHOOK_post_sockt_realloc_writefifo) (int retVal___, int fd, size_t addition);
+typedef int (*HPMHOOK_pre_sockt_wfifoset) (int *fd, size_t *len);
+typedef int (*HPMHOOK_post_sockt_wfifoset) (int retVal___, int fd, size_t len);
+typedef int (*HPMHOOK_pre_sockt_rfifoskip) (int *fd, size_t *len);
+typedef int (*HPMHOOK_post_sockt_rfifoskip) (int retVal___, int fd, size_t len);
+typedef void (*HPMHOOK_pre_sockt_close) (int *fd);
+typedef void (*HPMHOOK_post_sockt_close) (int fd);
+typedef bool (*HPMHOOK_pre_sockt_session_is_valid) (int *fd);
+typedef bool (*HPMHOOK_post_sockt_session_is_valid) (bool retVal___, int fd);
+typedef bool (*HPMHOOK_pre_sockt_session_is_active) (int *fd);
+typedef bool (*HPMHOOK_post_sockt_session_is_active) (bool retVal___, int fd);
+typedef void (*HPMHOOK_pre_sockt_flush) (int *fd);
+typedef void (*HPMHOOK_post_sockt_flush) (int fd);
+typedef void (*HPMHOOK_pre_sockt_flush_fifos) (void);
+typedef void (*HPMHOOK_post_sockt_flush_fifos) (void);
+typedef void (*HPMHOOK_pre_sockt_set_nonblocking) (int *fd, unsigned long *yes);
+typedef void (*HPMHOOK_post_sockt_set_nonblocking) (int fd, unsigned long yes);
+typedef void (*HPMHOOK_pre_sockt_set_defaultparse) (ParseFunc *defaultparse);
+typedef void (*HPMHOOK_post_sockt_set_defaultparse) (ParseFunc defaultparse);
+typedef uint32 (*HPMHOOK_pre_sockt_host2ip) (const char **hostname);
+typedef uint32 (*HPMHOOK_post_sockt_host2ip) (uint32 retVal___, const char *hostname);
+typedef const char* (*HPMHOOK_pre_sockt_ip2str) (uint32 *ip, char **ip_str);
+typedef const char* (*HPMHOOK_post_sockt_ip2str) (const char* retVal___, uint32 ip, char *ip_str);
+typedef uint32 (*HPMHOOK_pre_sockt_str2ip) (const char **ip_str);
+typedef uint32 (*HPMHOOK_post_sockt_str2ip) (uint32 retVal___, const char *ip_str);
+typedef uint16 (*HPMHOOK_pre_sockt_ntows) (uint16 *netshort);
+typedef uint16 (*HPMHOOK_post_sockt_ntows) (uint16 retVal___, uint16 netshort);
+typedef int (*HPMHOOK_pre_sockt_getips) (uint32 **ips, int *max);
+typedef int (*HPMHOOK_post_sockt_getips) (int retVal___, uint32 *ips, int max);
+typedef void (*HPMHOOK_pre_sockt_eof) (int *fd);
+typedef void (*HPMHOOK_post_sockt_eof) (int fd);
+typedef uint32 (*HPMHOOK_pre_sockt_lan_subnet_check) (uint32 *ip, struct s_subnet **info);
+typedef uint32 (*HPMHOOK_post_sockt_lan_subnet_check) (uint32 retVal___, uint32 ip, struct s_subnet *info);
+typedef bool (*HPMHOOK_pre_sockt_allowed_ip_check) (uint32 *ip);
+typedef bool (*HPMHOOK_post_sockt_allowed_ip_check) (bool retVal___, uint32 ip);
+typedef bool (*HPMHOOK_pre_sockt_trusted_ip_check) (uint32 *ip);
+typedef bool (*HPMHOOK_post_sockt_trusted_ip_check) (bool retVal___, uint32 ip);
+typedef int (*HPMHOOK_pre_sockt_net_config_read_sub) (struct config_setting_t **t, struct s_subnet_vector **list, const char **filename, const char **groupname);
+typedef int (*HPMHOOK_post_sockt_net_config_read_sub) (int retVal___, struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+typedef void (*HPMHOOK_pre_sockt_net_config_read) (const char **filename);
+typedef void (*HPMHOOK_post_sockt_net_config_read) (const char *filename);
+#endif // COMMON_SOCKET_H
+#ifdef COMMON_SQL_H /* SQL */
+typedef int (*HPMHOOK_pre_SQL_Connect) (struct Sql **self, const char **user, const char **passwd, const char **host, uint16 *port, const char **db);
+typedef int (*HPMHOOK_post_SQL_Connect) (int retVal___, struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db);
+typedef int (*HPMHOOK_pre_SQL_GetTimeout) (struct Sql **self, uint32 **out_timeout);
+typedef int (*HPMHOOK_post_SQL_GetTimeout) (int retVal___, struct Sql *self, uint32 *out_timeout);
+typedef int (*HPMHOOK_pre_SQL_GetColumnNames) (struct Sql **self, const char **table, char **out_buf, size_t *buf_len, char *sep);
+typedef int (*HPMHOOK_post_SQL_GetColumnNames) (int retVal___, struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep);
+typedef int (*HPMHOOK_pre_SQL_SetEncoding) (struct Sql **self, const char **encoding);
+typedef int (*HPMHOOK_post_SQL_SetEncoding) (int retVal___, struct Sql *self, const char *encoding);
+typedef int (*HPMHOOK_pre_SQL_Ping) (struct Sql **self);
+typedef int (*HPMHOOK_post_SQL_Ping) (int retVal___, struct Sql *self);
+typedef size_t (*HPMHOOK_pre_SQL_EscapeString) (struct Sql **self, char **out_to, const char **from);
+typedef size_t (*HPMHOOK_post_SQL_EscapeString) (size_t retVal___, struct Sql *self, char *out_to, const char *from);
+typedef size_t (*HPMHOOK_pre_SQL_EscapeStringLen) (struct Sql **self, char **out_to, const char **from, size_t *from_len);
+typedef size_t (*HPMHOOK_post_SQL_EscapeStringLen) (size_t retVal___, struct Sql *self, char *out_to, const char *from, size_t from_len);
+typedef int (*HPMHOOK_pre_SQL_QueryV) (struct Sql **self, const char **query, va_list args);
+typedef int (*HPMHOOK_post_SQL_QueryV) (int retVal___, struct Sql *self, const char *query, va_list args);
+typedef int (*HPMHOOK_pre_SQL_QueryStr) (struct Sql **self, const char **query);
+typedef int (*HPMHOOK_post_SQL_QueryStr) (int retVal___, struct Sql *self, const char *query);
+typedef uint64 (*HPMHOOK_pre_SQL_LastInsertId) (struct Sql **self);
+typedef uint64 (*HPMHOOK_post_SQL_LastInsertId) (uint64 retVal___, struct Sql *self);
+typedef uint32 (*HPMHOOK_pre_SQL_NumColumns) (struct Sql **self);
+typedef uint32 (*HPMHOOK_post_SQL_NumColumns) (uint32 retVal___, struct Sql *self);
+typedef uint64 (*HPMHOOK_pre_SQL_NumRows) (struct Sql **self);
+typedef uint64 (*HPMHOOK_post_SQL_NumRows) (uint64 retVal___, struct Sql *self);
+typedef int (*HPMHOOK_pre_SQL_NextRow) (struct Sql **self);
+typedef int (*HPMHOOK_post_SQL_NextRow) (int retVal___, struct Sql *self);
+typedef int (*HPMHOOK_pre_SQL_GetData) (struct Sql **self, size_t *col, char ***out_buf, size_t **out_len);
+typedef int (*HPMHOOK_post_SQL_GetData) (int retVal___, struct Sql *self, size_t col, char **out_buf, size_t *out_len);
+typedef void (*HPMHOOK_pre_SQL_FreeResult) (struct Sql **self);
+typedef void (*HPMHOOK_post_SQL_FreeResult) (struct Sql *self);
+typedef void (*HPMHOOK_pre_SQL_ShowDebug_) (struct Sql **self, const char **debug_file, const unsigned long *debug_line);
+typedef void (*HPMHOOK_post_SQL_ShowDebug_) (struct Sql *self, const char *debug_file, const unsigned long debug_line);
+typedef void (*HPMHOOK_pre_SQL_Free) (struct Sql **self);
+typedef void (*HPMHOOK_post_SQL_Free) (struct Sql *self);
+typedef struct Sql* (*HPMHOOK_pre_SQL_Malloc) (void);
+typedef struct Sql* (*HPMHOOK_post_SQL_Malloc) (struct Sql* retVal___);
+typedef struct SqlStmt* (*HPMHOOK_pre_SQL_StmtMalloc) (struct Sql **sql);
+typedef struct SqlStmt* (*HPMHOOK_post_SQL_StmtMalloc) (struct SqlStmt* retVal___, struct Sql *sql);
+typedef int (*HPMHOOK_pre_SQL_StmtPrepareV) (struct SqlStmt **self, const char **query, va_list args);
+typedef int (*HPMHOOK_post_SQL_StmtPrepareV) (int retVal___, struct SqlStmt *self, const char *query, va_list args);
+typedef int (*HPMHOOK_pre_SQL_StmtPrepareStr) (struct SqlStmt **self, const char **query);
+typedef int (*HPMHOOK_post_SQL_StmtPrepareStr) (int retVal___, struct SqlStmt *self, const char *query);
+typedef size_t (*HPMHOOK_pre_SQL_StmtNumParams) (struct SqlStmt **self);
+typedef size_t (*HPMHOOK_post_SQL_StmtNumParams) (size_t retVal___, struct SqlStmt *self);
+typedef int (*HPMHOOK_pre_SQL_StmtBindParam) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, const void **buffer, size_t *buffer_len);
+typedef int (*HPMHOOK_post_SQL_StmtBindParam) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len);
+typedef int (*HPMHOOK_pre_SQL_StmtExecute) (struct SqlStmt **self);
+typedef int (*HPMHOOK_post_SQL_StmtExecute) (int retVal___, struct SqlStmt *self);
+typedef uint64 (*HPMHOOK_pre_SQL_StmtLastInsertId) (struct SqlStmt **self);
+typedef uint64 (*HPMHOOK_post_SQL_StmtLastInsertId) (uint64 retVal___, struct SqlStmt *self);
+typedef size_t (*HPMHOOK_pre_SQL_StmtNumColumns) (struct SqlStmt **self);
+typedef size_t (*HPMHOOK_post_SQL_StmtNumColumns) (size_t retVal___, struct SqlStmt *self);
+typedef int (*HPMHOOK_pre_SQL_StmtBindColumn) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, void **buffer, size_t *buffer_len, uint32 **out_length, int8 **out_is_null);
+typedef int (*HPMHOOK_post_SQL_StmtBindColumn) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null);
+typedef uint64 (*HPMHOOK_pre_SQL_StmtNumRows) (struct SqlStmt **self);
+typedef uint64 (*HPMHOOK_post_SQL_StmtNumRows) (uint64 retVal___, struct SqlStmt *self);
+typedef int (*HPMHOOK_pre_SQL_StmtNextRow) (struct SqlStmt **self);
+typedef int (*HPMHOOK_post_SQL_StmtNextRow) (int retVal___, struct SqlStmt *self);
+typedef void (*HPMHOOK_pre_SQL_StmtFreeResult) (struct SqlStmt **self);
+typedef void (*HPMHOOK_post_SQL_StmtFreeResult) (struct SqlStmt *self);
+typedef void (*HPMHOOK_pre_SQL_StmtFree) (struct SqlStmt **self);
+typedef void (*HPMHOOK_post_SQL_StmtFree) (struct SqlStmt *self);
+typedef void (*HPMHOOK_pre_SQL_StmtShowDebug_) (struct SqlStmt **self, const char **debug_file, const unsigned long *debug_line);
+typedef void (*HPMHOOK_post_SQL_StmtShowDebug_) (struct SqlStmt *self, const char *debug_file, const unsigned long debug_line);
+#endif // COMMON_SQL_H
+#ifdef MAP_STATUS_H /* status */
+typedef int (*HPMHOOK_pre_status_init) (bool *minimal);
+typedef int (*HPMHOOK_post_status_init) (int retVal___, bool minimal);
+typedef void (*HPMHOOK_pre_status_final) (void);
+typedef void (*HPMHOOK_post_status_final) (void);
+typedef int (*HPMHOOK_pre_status_get_refine_chance) (enum refine_type *wlv, int *refine, enum refine_chance_type *type);
+typedef int (*HPMHOOK_post_status_get_refine_chance) (int retVal___, enum refine_type wlv, int refine, enum refine_chance_type type);
+typedef sc_type (*HPMHOOK_pre_status_skill2sc) (int *skill_id);
+typedef sc_type (*HPMHOOK_post_status_skill2sc) (sc_type retVal___, int skill_id);
+typedef int (*HPMHOOK_pre_status_sc2skill) (sc_type *sc);
+typedef int (*HPMHOOK_post_status_sc2skill) (int retVal___, sc_type sc);
+typedef unsigned int (*HPMHOOK_pre_status_sc2scb_flag) (sc_type *sc);
+typedef unsigned int (*HPMHOOK_post_status_sc2scb_flag) (unsigned int retVal___, sc_type sc);
+typedef int (*HPMHOOK_pre_status_type2relevant_bl_types) (int *type);
+typedef int (*HPMHOOK_post_status_type2relevant_bl_types) (int retVal___, int type);
+typedef int (*HPMHOOK_pre_status_get_sc_type) (sc_type *idx);
+typedef int (*HPMHOOK_post_status_get_sc_type) (int retVal___, sc_type idx);
+typedef int (*HPMHOOK_pre_status_damage) (struct block_list **src, struct block_list **target, int64 *hp, int64 *sp, int *walkdelay, int *flag);
+typedef int (*HPMHOOK_post_status_damage) (int retVal___, struct block_list *src, struct block_list *target, int64 hp, int64 sp, int walkdelay, int flag);
+typedef int (*HPMHOOK_pre_status_charge) (struct block_list **bl, int64 *hp, int64 *sp);
+typedef int (*HPMHOOK_post_status_charge) (int retVal___, struct block_list *bl, int64 hp, int64 sp);
+typedef int (*HPMHOOK_pre_status_percent_change) (struct block_list **src, struct block_list **target, signed char *hp_rate, signed char *sp_rate, int *flag);
+typedef int (*HPMHOOK_post_status_percent_change) (int retVal___, struct block_list *src, struct block_list *target, signed char hp_rate, signed char sp_rate, int flag);
+typedef int (*HPMHOOK_pre_status_set_hp) (struct block_list **bl, unsigned int *hp, int *flag);
+typedef int (*HPMHOOK_post_status_set_hp) (int retVal___, struct block_list *bl, unsigned int hp, int flag);
+typedef int (*HPMHOOK_pre_status_set_sp) (struct block_list **bl, unsigned int *sp, int *flag);
+typedef int (*HPMHOOK_post_status_set_sp) (int retVal___, struct block_list *bl, unsigned int sp, int flag);
+typedef int (*HPMHOOK_pre_status_heal) (struct block_list **bl, int64 *hp, int64 *sp, int *flag);
+typedef int (*HPMHOOK_post_status_heal) (int retVal___, struct block_list *bl, int64 hp, int64 sp, int flag);
+typedef int (*HPMHOOK_pre_status_revive) (struct block_list **bl, unsigned char *per_hp, unsigned char *per_sp);
+typedef int (*HPMHOOK_post_status_revive) (int retVal___, struct block_list *bl, unsigned char per_hp, unsigned char per_sp);
+typedef int (*HPMHOOK_pre_status_fixed_revive) (struct block_list **bl, unsigned int *per_hp, unsigned int *per_sp);
+typedef int (*HPMHOOK_post_status_fixed_revive) (int retVal___, struct block_list *bl, unsigned int per_hp, unsigned int per_sp);
+typedef struct regen_data* (*HPMHOOK_pre_status_get_regen_data) (struct block_list **bl);
+typedef struct regen_data* (*HPMHOOK_post_status_get_regen_data) (struct regen_data* retVal___, struct block_list *bl);
+typedef struct status_data* (*HPMHOOK_pre_status_get_status_data) (struct block_list **bl);
+typedef struct status_data* (*HPMHOOK_post_status_get_status_data) (struct status_data* retVal___, struct block_list *bl);
+typedef struct status_data* (*HPMHOOK_pre_status_get_base_status) (struct block_list **bl);
+typedef struct status_data* (*HPMHOOK_post_status_get_base_status) (struct status_data* retVal___, struct block_list *bl);
+typedef const char* (*HPMHOOK_pre_status_get_name) (const struct block_list **bl);
+typedef const char* (*HPMHOOK_post_status_get_name) (const char* retVal___, const struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_class) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_class) (int retVal___, const struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_lv) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_lv) (int retVal___, const struct block_list *bl);
+typedef defType (*HPMHOOK_pre_status_get_def) (struct block_list **bl);
+typedef defType (*HPMHOOK_post_status_get_def) (defType retVal___, struct block_list *bl);
+typedef unsigned short (*HPMHOOK_pre_status_get_speed) (struct block_list **bl);
+typedef unsigned short (*HPMHOOK_post_status_get_speed) (unsigned short retVal___, struct block_list *bl);
+typedef unsigned char (*HPMHOOK_pre_status_calc_attack_element) (struct block_list **bl, struct status_change **sc, int *element);
+typedef unsigned char (*HPMHOOK_post_status_calc_attack_element) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int element);
+typedef int (*HPMHOOK_pre_status_get_party_id) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_party_id) (int retVal___, const struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_guild_id) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_guild_id) (int retVal___, const struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_emblem_id) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_emblem_id) (int retVal___, const struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_mexp) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_mexp) (int retVal___, const struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_race2) (const struct block_list **bl);
+typedef int (*HPMHOOK_post_status_get_race2) (int retVal___, const struct block_list *bl);
+typedef struct view_data* (*HPMHOOK_pre_status_get_viewdata) (struct block_list **bl);
+typedef struct view_data* (*HPMHOOK_post_status_get_viewdata) (struct view_data* retVal___, struct block_list *bl);
+typedef void (*HPMHOOK_pre_status_set_viewdata) (struct block_list **bl, int *class_);
+typedef void (*HPMHOOK_post_status_set_viewdata) (struct block_list *bl, int class_);
+typedef void (*HPMHOOK_pre_status_change_init) (struct block_list **bl);
+typedef void (*HPMHOOK_post_status_change_init) (struct block_list *bl);
+typedef struct status_change* (*HPMHOOK_pre_status_get_sc) (struct block_list **bl);
+typedef struct status_change* (*HPMHOOK_post_status_get_sc) (struct status_change* retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_isdead) (struct block_list **bl);
+typedef int (*HPMHOOK_post_status_isdead) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_isimmune) (struct block_list **bl);
+typedef int (*HPMHOOK_post_status_isimmune) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_get_sc_def) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *tick, int *flag);
+typedef int (*HPMHOOK_post_status_get_sc_def) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag);
+typedef int (*HPMHOOK_pre_status_change_start) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
+typedef int (*HPMHOOK_post_status_change_start) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag);
+typedef int (*HPMHOOK_pre_status_change_end_) (struct block_list **bl, enum sc_type *type, int *tid, const char **file, int *line);
+typedef int (*HPMHOOK_post_status_change_end_) (int retVal___, struct block_list *bl, enum sc_type type, int tid, const char *file, int line);
+typedef int (*HPMHOOK_pre_status_kaahi_heal_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_status_kaahi_heal_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_status_change_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_status_change_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_status_change_timer_sub) (struct block_list **bl, va_list ap);
+typedef int (*HPMHOOK_post_status_change_timer_sub) (int retVal___, struct block_list *bl, va_list ap);
+typedef int (*HPMHOOK_pre_status_change_clear) (struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_status_change_clear) (int retVal___, struct block_list *bl, int type);
+typedef int (*HPMHOOK_pre_status_change_clear_buffs) (struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_status_change_clear_buffs) (int retVal___, struct block_list *bl, int type);
+typedef void (*HPMHOOK_pre_status_calc_bl_) (struct block_list **bl, enum scb_flag *flag, enum e_status_calc_opt *opt);
+typedef void (*HPMHOOK_post_status_calc_bl_) (struct block_list *bl, enum scb_flag flag, enum e_status_calc_opt opt);
+typedef int (*HPMHOOK_pre_status_calc_mob_) (struct mob_data **md, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_mob_) (int retVal___, struct mob_data *md, enum e_status_calc_opt opt);
+typedef int (*HPMHOOK_pre_status_calc_pet_) (struct pet_data **pd, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_pet_) (int retVal___, struct pet_data *pd, enum e_status_calc_opt opt);
+typedef int (*HPMHOOK_pre_status_calc_pc_) (struct map_session_data **sd, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_pc_) (int retVal___, struct map_session_data *sd, enum e_status_calc_opt opt);
+typedef void (*HPMHOOK_pre_status_calc_pc_additional) (struct map_session_data **sd, enum e_status_calc_opt *opt);
+typedef void (*HPMHOOK_post_status_calc_pc_additional) (struct map_session_data *sd, enum e_status_calc_opt opt);
+typedef int (*HPMHOOK_pre_status_calc_homunculus_) (struct homun_data **hd, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_homunculus_) (int retVal___, struct homun_data *hd, enum e_status_calc_opt opt);
+typedef int (*HPMHOOK_pre_status_calc_mercenary_) (struct mercenary_data **md, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_mercenary_) (int retVal___, struct mercenary_data *md, enum e_status_calc_opt opt);
+typedef int (*HPMHOOK_pre_status_calc_elemental_) (struct elemental_data **ed, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_elemental_) (int retVal___, struct elemental_data *ed, enum e_status_calc_opt opt);
+typedef void (*HPMHOOK_pre_status_calc_misc) (struct block_list **bl, struct status_data **st, int *level);
+typedef void (*HPMHOOK_post_status_calc_misc) (struct block_list *bl, struct status_data *st, int level);
+typedef void (*HPMHOOK_pre_status_calc_regen) (struct block_list **bl, struct status_data **st, struct regen_data **regen);
+typedef void (*HPMHOOK_post_status_calc_regen) (struct block_list *bl, struct status_data *st, struct regen_data *regen);
+typedef void (*HPMHOOK_pre_status_calc_regen_rate) (struct block_list **bl, struct regen_data **regen, struct status_change **sc);
+typedef void (*HPMHOOK_post_status_calc_regen_rate) (struct block_list *bl, struct regen_data *regen, struct status_change *sc);
+typedef int (*HPMHOOK_pre_status_check_skilluse) (struct block_list **src, struct block_list **target, uint16 *skill_id, int *flag);
+typedef int (*HPMHOOK_post_status_check_skilluse) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, int flag);
+typedef int (*HPMHOOK_pre_status_check_visibility) (struct block_list **src, struct block_list **target);
+typedef int (*HPMHOOK_post_status_check_visibility) (int retVal___, struct block_list *src, struct block_list *target);
+typedef int (*HPMHOOK_pre_status_change_spread) (struct block_list **src, struct block_list **bl);
+typedef int (*HPMHOOK_post_status_change_spread) (int retVal___, struct block_list *src, struct block_list *bl);
+typedef defType (*HPMHOOK_pre_status_calc_def) (struct block_list **bl, struct status_change **sc, int *def, bool *viewable);
+typedef defType (*HPMHOOK_post_status_calc_def) (defType retVal___, struct block_list *bl, struct status_change *sc, int def, bool viewable);
+typedef short (*HPMHOOK_pre_status_calc_def2) (struct block_list **bl, struct status_change **sc, int *def2, bool *viewable);
+typedef short (*HPMHOOK_post_status_calc_def2) (short retVal___, struct block_list *bl, struct status_change *sc, int def2, bool viewable);
+typedef defType (*HPMHOOK_pre_status_calc_mdef) (struct block_list **bl, struct status_change **sc, int *mdef, bool *viewable);
+typedef defType (*HPMHOOK_post_status_calc_mdef) (defType retVal___, struct block_list *bl, struct status_change *sc, int mdef, bool viewable);
+typedef short (*HPMHOOK_pre_status_calc_mdef2) (struct block_list **bl, struct status_change **sc, int *mdef2, bool *viewable);
+typedef short (*HPMHOOK_post_status_calc_mdef2) (short retVal___, struct block_list *bl, struct status_change *sc, int mdef2, bool viewable);
+typedef unsigned short (*HPMHOOK_pre_status_calc_batk) (struct block_list **bl, struct status_change **sc, int *batk, bool *viewable);
+typedef unsigned short (*HPMHOOK_post_status_calc_batk) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int batk, bool viewable);
+typedef unsigned short (*HPMHOOK_pre_status_base_matk) (struct block_list **bl, const struct status_data **st, int *level);
+typedef unsigned short (*HPMHOOK_post_status_base_matk) (unsigned short retVal___, struct block_list *bl, const struct status_data *st, int level);
+typedef int (*HPMHOOK_pre_status_get_weapon_atk) (struct block_list **src, struct weapon_atk **watk, int *flag);
+typedef int (*HPMHOOK_post_status_get_weapon_atk) (int retVal___, struct block_list *src, struct weapon_atk *watk, int flag);
+typedef int (*HPMHOOK_pre_status_get_total_mdef) (struct block_list **src);
+typedef int (*HPMHOOK_post_status_get_total_mdef) (int retVal___, struct block_list *src);
+typedef int (*HPMHOOK_pre_status_get_total_def) (struct block_list **src);
+typedef int (*HPMHOOK_post_status_get_total_def) (int retVal___, struct block_list *src);
+typedef int (*HPMHOOK_pre_status_get_matk) (struct block_list **src, int *flag);
+typedef int (*HPMHOOK_post_status_get_matk) (int retVal___, struct block_list *src, int flag);
+typedef void (*HPMHOOK_pre_status_update_matk) (struct block_list **bl);
+typedef void (*HPMHOOK_post_status_update_matk) (struct block_list *bl);
+typedef int (*HPMHOOK_pre_status_readdb) (void);
+typedef int (*HPMHOOK_post_status_readdb) (int retVal___);
+typedef void (*HPMHOOK_pre_status_initChangeTables) (void);
+typedef void (*HPMHOOK_post_status_initChangeTables) (void);
+typedef void (*HPMHOOK_pre_status_initDummyData) (void);
+typedef void (*HPMHOOK_post_status_initDummyData) (void);
+typedef int (*HPMHOOK_pre_status_base_amotion_pc) (struct map_session_data **sd, struct status_data **st);
+typedef int (*HPMHOOK_post_status_base_amotion_pc) (int retVal___, struct map_session_data *sd, struct status_data *st);
+typedef unsigned short (*HPMHOOK_pre_status_base_atk) (const struct block_list **bl, const struct status_data **st);
+typedef unsigned short (*HPMHOOK_post_status_base_atk) (unsigned short retVal___, const struct block_list *bl, const struct status_data *st);
+typedef unsigned int (*HPMHOOK_pre_status_get_base_maxhp) (const struct map_session_data **sd, const struct status_data **st);
+typedef unsigned int (*HPMHOOK_post_status_get_base_maxhp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+typedef unsigned int (*HPMHOOK_pre_status_get_base_maxsp) (const struct map_session_data **sd, const struct status_data **st);
+typedef unsigned int (*HPMHOOK_post_status_get_base_maxsp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+typedef int (*HPMHOOK_pre_status_calc_npc_) (struct npc_data **nd, enum e_status_calc_opt *opt);
+typedef int (*HPMHOOK_post_status_calc_npc_) (int retVal___, struct npc_data *nd, enum e_status_calc_opt opt);
+typedef unsigned short (*HPMHOOK_pre_status_calc_str) (struct block_list **bl, struct status_change **sc, int *str);
+typedef unsigned short (*HPMHOOK_post_status_calc_str) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int str);
+typedef unsigned short (*HPMHOOK_pre_status_calc_agi) (struct block_list **bl, struct status_change **sc, int *agi);
+typedef unsigned short (*HPMHOOK_post_status_calc_agi) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int agi);
+typedef unsigned short (*HPMHOOK_pre_status_calc_vit) (struct block_list **bl, struct status_change **sc, int *vit);
+typedef unsigned short (*HPMHOOK_post_status_calc_vit) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int vit);
+typedef unsigned short (*HPMHOOK_pre_status_calc_int) (struct block_list **bl, struct status_change **sc, int *int_);
+typedef unsigned short (*HPMHOOK_post_status_calc_int) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int int_);
+typedef unsigned short (*HPMHOOK_pre_status_calc_dex) (struct block_list **bl, struct status_change **sc, int *dex);
+typedef unsigned short (*HPMHOOK_post_status_calc_dex) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int dex);
+typedef unsigned short (*HPMHOOK_pre_status_calc_luk) (struct block_list **bl, struct status_change **sc, int *luk);
+typedef unsigned short (*HPMHOOK_post_status_calc_luk) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int luk);
+typedef unsigned short (*HPMHOOK_pre_status_calc_watk) (struct block_list **bl, struct status_change **sc, int *watk, bool *viewable);
+typedef unsigned short (*HPMHOOK_post_status_calc_watk) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int watk, bool viewable);
+typedef unsigned short (*HPMHOOK_pre_status_calc_matk) (struct block_list **bl, struct status_change **sc, int *matk, bool *viewable);
+typedef unsigned short (*HPMHOOK_post_status_calc_matk) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int matk, bool viewable);
+typedef signed short (*HPMHOOK_pre_status_calc_hit) (struct block_list **bl, struct status_change **sc, int *hit, bool *viewable);
+typedef signed short (*HPMHOOK_post_status_calc_hit) (signed short retVal___, struct block_list *bl, struct status_change *sc, int hit, bool viewable);
+typedef signed short (*HPMHOOK_pre_status_calc_critical) (struct block_list **bl, struct status_change **sc, int *critical, bool *viewable);
+typedef signed short (*HPMHOOK_post_status_calc_critical) (signed short retVal___, struct block_list *bl, struct status_change *sc, int critical, bool viewable);
+typedef signed short (*HPMHOOK_pre_status_calc_flee) (struct block_list **bl, struct status_change **sc, int *flee, bool *viewable);
+typedef signed short (*HPMHOOK_post_status_calc_flee) (signed short retVal___, struct block_list *bl, struct status_change *sc, int flee, bool viewable);
+typedef signed short (*HPMHOOK_pre_status_calc_flee2) (struct block_list **bl, struct status_change **sc, int *flee2, bool *viewable);
+typedef signed short (*HPMHOOK_post_status_calc_flee2) (signed short retVal___, struct block_list *bl, struct status_change *sc, int flee2, bool viewable);
+typedef unsigned short (*HPMHOOK_pre_status_calc_speed) (struct block_list **bl, struct status_change **sc, int *speed);
+typedef unsigned short (*HPMHOOK_post_status_calc_speed) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int speed);
+typedef short (*HPMHOOK_pre_status_calc_aspd_rate) (struct block_list **bl, struct status_change **sc, int *aspd_rate);
+typedef short (*HPMHOOK_post_status_calc_aspd_rate) (short retVal___, struct block_list *bl, struct status_change *sc, int aspd_rate);
+typedef unsigned short (*HPMHOOK_pre_status_calc_dmotion) (struct block_list **bl, struct status_change **sc, int *dmotion);
+typedef unsigned short (*HPMHOOK_post_status_calc_dmotion) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int dmotion);
+typedef short (*HPMHOOK_pre_status_calc_aspd) (struct block_list **bl, struct status_change **sc, short *flag);
+typedef short (*HPMHOOK_post_status_calc_aspd) (short retVal___, struct block_list *bl, struct status_change *sc, short flag);
+typedef short (*HPMHOOK_pre_status_calc_fix_aspd) (struct block_list **bl, struct status_change **sc, int *aspd);
+typedef short (*HPMHOOK_post_status_calc_fix_aspd) (short retVal___, struct block_list *bl, struct status_change *sc, int aspd);
+typedef unsigned int (*HPMHOOK_pre_status_calc_maxhp) (struct block_list **bl, struct status_change **sc, uint64 *maxhp);
+typedef unsigned int (*HPMHOOK_post_status_calc_maxhp) (unsigned int retVal___, struct block_list *bl, struct status_change *sc, uint64 maxhp);
+typedef unsigned int (*HPMHOOK_pre_status_calc_maxsp) (struct block_list **bl, struct status_change **sc, unsigned int *maxsp);
+typedef unsigned int (*HPMHOOK_post_status_calc_maxsp) (unsigned int retVal___, struct block_list *bl, struct status_change *sc, unsigned int maxsp);
+typedef unsigned char (*HPMHOOK_pre_status_calc_element) (struct block_list **bl, struct status_change **sc, int *element);
+typedef unsigned char (*HPMHOOK_post_status_calc_element) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int element);
+typedef unsigned char (*HPMHOOK_pre_status_calc_element_lv) (struct block_list **bl, struct status_change **sc, int *lv);
+typedef unsigned char (*HPMHOOK_post_status_calc_element_lv) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int lv);
+typedef uint32 (*HPMHOOK_pre_status_calc_mode) (const struct block_list **bl, const struct status_change **sc, uint32 *mode);
+typedef uint32 (*HPMHOOK_post_status_calc_mode) (uint32 retVal___, const struct block_list *bl, const struct status_change *sc, uint32 mode);
+typedef unsigned short (*HPMHOOK_pre_status_calc_ematk) (struct block_list **bl, struct status_change **sc, int *matk);
+typedef unsigned short (*HPMHOOK_post_status_calc_ematk) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int matk);
+typedef void (*HPMHOOK_pre_status_calc_bl_main) (struct block_list **bl, int *flag);
+typedef void (*HPMHOOK_post_status_calc_bl_main) (struct block_list *bl, int flag);
+typedef void (*HPMHOOK_pre_status_display_add) (struct map_session_data **sd, enum sc_type *type, int *dval1, int *dval2, int *dval3);
+typedef void (*HPMHOOK_post_status_display_add) (struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3);
+typedef void (*HPMHOOK_pre_status_display_remove) (struct map_session_data **sd, enum sc_type *type);
+typedef void (*HPMHOOK_post_status_display_remove) (struct map_session_data *sd, enum sc_type type);
+typedef int (*HPMHOOK_pre_status_natural_heal) (struct block_list **bl, va_list args);
+typedef int (*HPMHOOK_post_status_natural_heal) (int retVal___, struct block_list *bl, va_list args);
+typedef int (*HPMHOOK_pre_status_natural_heal_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_status_natural_heal_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef bool (*HPMHOOK_pre_status_readdb_job2) (char **fields[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_status_readdb_job2) (bool retVal___, char *fields[], int columns, int current);
+typedef bool (*HPMHOOK_pre_status_readdb_sizefix) (char **fields[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_status_readdb_sizefix) (bool retVal___, char *fields[], int columns, int current);
+typedef int (*HPMHOOK_pre_status_readdb_refine_libconfig) (const char **filename);
+typedef int (*HPMHOOK_post_status_readdb_refine_libconfig) (int retVal___, const char *filename);
+typedef int (*HPMHOOK_pre_status_readdb_refine_libconfig_sub) (struct config_setting_t **r, const char **name, const char **source);
+typedef int (*HPMHOOK_post_status_readdb_refine_libconfig_sub) (int retVal___, struct config_setting_t *r, const char *name, const char *source);
+typedef bool (*HPMHOOK_pre_status_readdb_scconfig) (char **fields[], int *columns, int *current);
+typedef bool (*HPMHOOK_post_status_readdb_scconfig) (bool retVal___, char *fields[], int columns, int current);
+typedef void (*HPMHOOK_pre_status_read_job_db) (void);
+typedef void (*HPMHOOK_post_status_read_job_db) (void);
+typedef void (*HPMHOOK_pre_status_read_job_db_sub) (int *idx, const char **name, struct config_setting_t **jdb);
+typedef void (*HPMHOOK_post_status_read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb);
+typedef void (*HPMHOOK_pre_status_set_sc) (uint16 *skill_id, sc_type *sc, int *icon, unsigned int *flag);
+typedef void (*HPMHOOK_post_status_set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag);
+typedef void (*HPMHOOK_pre_status_copy) (struct status_data **a, const struct status_data **b);
+typedef void (*HPMHOOK_post_status_copy) (struct status_data *a, const struct status_data *b);
+typedef unsigned short (*HPMHOOK_pre_status_base_matk_min) (const struct status_data **st);
+typedef unsigned short (*HPMHOOK_post_status_base_matk_min) (unsigned short retVal___, const struct status_data *st);
+typedef unsigned short (*HPMHOOK_pre_status_base_matk_max) (const struct status_data **st);
+typedef unsigned short (*HPMHOOK_post_status_base_matk_max) (unsigned short retVal___, const struct status_data *st);
+#endif // MAP_STATUS_H
+#ifdef MAP_STORAGE_H /* storage */
+typedef void (*HPMHOOK_pre_storage_reconnect) (void);
+typedef void (*HPMHOOK_post_storage_reconnect) (void);
+typedef int (*HPMHOOK_pre_storage_delitem) (struct map_session_data **sd, int *n, int *amount);
+typedef int (*HPMHOOK_post_storage_delitem) (int retVal___, struct map_session_data *sd, int n, int amount);
+typedef int (*HPMHOOK_pre_storage_open) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_storage_open) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_storage_add) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_storage_add) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_storage_get) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_storage_get) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_storage_additem) (struct map_session_data **sd, struct item **item_data, int *amount);
+typedef int (*HPMHOOK_post_storage_additem) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount);
+typedef int (*HPMHOOK_pre_storage_addfromcart) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_storage_addfromcart) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef int (*HPMHOOK_pre_storage_gettocart) (struct map_session_data **sd, int *index, int *amount);
+typedef int (*HPMHOOK_post_storage_gettocart) (int retVal___, struct map_session_data *sd, int index, int amount);
+typedef void (*HPMHOOK_pre_storage_close) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_storage_close) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_storage_pc_quit) (struct map_session_data **sd, int *flag);
+typedef void (*HPMHOOK_post_storage_pc_quit) (struct map_session_data *sd, int flag);
+typedef int (*HPMHOOK_pre_storage_comp_item) (const void **i1_, const void **i2_);
+typedef int (*HPMHOOK_post_storage_comp_item) (int retVal___, const void *i1_, const void *i2_);
+typedef void (*HPMHOOK_pre_storage_sortitem) (struct item **items, unsigned int *size);
+typedef void (*HPMHOOK_post_storage_sortitem) (struct item *items, unsigned int size);
+typedef int (*HPMHOOK_pre_storage_reconnect_sub) (union DBKey *key, struct DBData **data, va_list ap);
+typedef int (*HPMHOOK_post_storage_reconnect_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+#endif // MAP_STORAGE_H
+#ifdef COMMON_STRLIB_H /* StrBuf */
+typedef StringBuf* (*HPMHOOK_pre_StrBuf_Malloc) (void);
+typedef StringBuf* (*HPMHOOK_post_StrBuf_Malloc) (StringBuf* retVal___);
+typedef void (*HPMHOOK_pre_StrBuf_Init) (StringBuf **self);
+typedef void (*HPMHOOK_post_StrBuf_Init) (StringBuf *self);
+typedef int (*HPMHOOK_pre_StrBuf_Vprintf) (StringBuf **self, const char **fmt, va_list args);
+typedef int (*HPMHOOK_post_StrBuf_Vprintf) (int retVal___, StringBuf *self, const char *fmt, va_list args);
+typedef int (*HPMHOOK_pre_StrBuf_Append) (StringBuf **self, const StringBuf **sbuf);
+typedef int (*HPMHOOK_post_StrBuf_Append) (int retVal___, StringBuf *self, const StringBuf *sbuf);
+typedef int (*HPMHOOK_pre_StrBuf_AppendStr) (StringBuf **self, const char **str);
+typedef int (*HPMHOOK_post_StrBuf_AppendStr) (int retVal___, StringBuf *self, const char *str);
+typedef int (*HPMHOOK_pre_StrBuf_Length) (StringBuf **self);
+typedef int (*HPMHOOK_post_StrBuf_Length) (int retVal___, StringBuf *self);
+typedef char* (*HPMHOOK_pre_StrBuf_Value) (StringBuf **self);
+typedef char* (*HPMHOOK_post_StrBuf_Value) (char* retVal___, StringBuf *self);
+typedef void (*HPMHOOK_pre_StrBuf_Clear) (StringBuf **self);
+typedef void (*HPMHOOK_post_StrBuf_Clear) (StringBuf *self);
+typedef void (*HPMHOOK_pre_StrBuf_Destroy) (StringBuf **self);
+typedef void (*HPMHOOK_post_StrBuf_Destroy) (StringBuf *self);
+typedef void (*HPMHOOK_pre_StrBuf_Free) (StringBuf **self);
+typedef void (*HPMHOOK_post_StrBuf_Free) (StringBuf *self);
+#endif // COMMON_STRLIB_H
+#ifdef COMMON_STRLIB_H /* strlib */
+typedef char* (*HPMHOOK_pre_strlib_jstrescape) (char **pt);
+typedef char* (*HPMHOOK_post_strlib_jstrescape) (char* retVal___, char *pt);
+typedef char* (*HPMHOOK_pre_strlib_jstrescapecpy) (char **pt, const char **spt);
+typedef char* (*HPMHOOK_post_strlib_jstrescapecpy) (char* retVal___, char *pt, const char *spt);
+typedef int (*HPMHOOK_pre_strlib_jmemescapecpy) (char **pt, const char **spt, int *size);
+typedef int (*HPMHOOK_post_strlib_jmemescapecpy) (int retVal___, char *pt, const char *spt, int size);
+typedef int (*HPMHOOK_pre_strlib_remove_control_chars_) (char **str);
+typedef int (*HPMHOOK_post_strlib_remove_control_chars_) (int retVal___, char *str);
+typedef char* (*HPMHOOK_pre_strlib_trim_) (char **str);
+typedef char* (*HPMHOOK_post_strlib_trim_) (char* retVal___, char *str);
+typedef char* (*HPMHOOK_pre_strlib_normalize_name_) (char **str, const char **delims);
+typedef char* (*HPMHOOK_post_strlib_normalize_name_) (char* retVal___, char *str, const char *delims);
+typedef const char* (*HPMHOOK_pre_strlib_stristr_) (const char **haystack, const char **needle);
+typedef const char* (*HPMHOOK_post_strlib_stristr_) (const char* retVal___, const char *haystack, const char *needle);
+typedef size_t (*HPMHOOK_pre_strlib_strnlen_) (const char **string, size_t *maxlen);
+typedef size_t (*HPMHOOK_post_strlib_strnlen_) (size_t retVal___, const char *string, size_t maxlen);
+typedef char* (*HPMHOOK_pre_strlib_strtok_r_) (char **s1, const char **s2, char ***lasts);
+typedef char* (*HPMHOOK_post_strlib_strtok_r_) (char* retVal___, char *s1, const char *s2, char **lasts);
+typedef int (*HPMHOOK_pre_strlib_e_mail_check_) (char **email);
+typedef int (*HPMHOOK_post_strlib_e_mail_check_) (int retVal___, char *email);
+typedef int (*HPMHOOK_pre_strlib_config_switch_) (const char **str);
+typedef int (*HPMHOOK_post_strlib_config_switch_) (int retVal___, const char *str);
+typedef char* (*HPMHOOK_pre_strlib_safestrncpy_) (char **dst, const char **src, size_t *n);
+typedef char* (*HPMHOOK_post_strlib_safestrncpy_) (char* retVal___, char *dst, const char *src, size_t n);
+typedef size_t (*HPMHOOK_pre_strlib_safestrnlen_) (const char **string, size_t *maxlen);
+typedef size_t (*HPMHOOK_post_strlib_safestrnlen_) (size_t retVal___, const char *string, size_t maxlen);
+typedef int (*HPMHOOK_pre_strlib_strline_) (const char **str, size_t *pos);
+typedef int (*HPMHOOK_post_strlib_strline_) (int retVal___, const char *str, size_t pos);
+typedef bool (*HPMHOOK_pre_strlib_bin2hex_) (char **output, const unsigned char **input, size_t *count);
+typedef bool (*HPMHOOK_post_strlib_bin2hex_) (bool retVal___, char *output, const unsigned char *input, size_t count);
+#endif // COMMON_STRLIB_H
+#ifdef COMMON_STRLIB_H /* sv */
+typedef int (*HPMHOOK_pre_sv_parse_next) (struct s_svstate **svstate);
+typedef int (*HPMHOOK_post_sv_parse_next) (int retVal___, struct s_svstate *svstate);
+typedef int (*HPMHOOK_pre_sv_parse) (const char **str, int *len, int *startoff, char *delim, int **out_pos, int *npos, enum e_svopt *opt);
+typedef int (*HPMHOOK_post_sv_parse) (int retVal___, const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt);
+typedef int (*HPMHOOK_pre_sv_split) (char **str, int *len, int *startoff, char *delim, char ***out_fields, int *nfields, enum e_svopt *opt);
+typedef int (*HPMHOOK_post_sv_split) (int retVal___, char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt);
+typedef size_t (*HPMHOOK_pre_sv_escape_c) (char **out_dest, const char **src, size_t *len, const char **escapes);
+typedef size_t (*HPMHOOK_post_sv_escape_c) (size_t retVal___, char *out_dest, const char *src, size_t len, const char *escapes);
+typedef size_t (*HPMHOOK_pre_sv_unescape_c) (char **out_dest, const char **src, size_t *len);
+typedef size_t (*HPMHOOK_post_sv_unescape_c) (size_t retVal___, char *out_dest, const char *src, size_t len);
+typedef const char* (*HPMHOOK_pre_sv_skip_escaped_c) (const char **p);
+typedef const char* (*HPMHOOK_post_sv_skip_escaped_c) (const char* retVal___, const char *p);
+typedef bool (*HPMHOOK_pre_sv_readdb) (const char **directory, const char **filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( **parseproc ) (char *fields[], int columns, int current));
+typedef bool (*HPMHOOK_post_sv_readdb) (bool retVal___, const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+#endif // COMMON_STRLIB_H
+#ifdef COMMON_SYSINFO_H /* sysinfo */
+typedef int (*HPMHOOK_pre_sysinfo_getpagesize) (void);
+typedef int (*HPMHOOK_post_sysinfo_getpagesize) (int retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_platform) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_platform) (const char* retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_osversion) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_osversion) (const char* retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_cpu) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_cpu) (const char* retVal___);
+typedef int (*HPMHOOK_pre_sysinfo_cpucores) (void);
+typedef int (*HPMHOOK_post_sysinfo_cpucores) (int retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_arch) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_arch) (const char* retVal___);
+typedef bool (*HPMHOOK_pre_sysinfo_is64bit) (void);
+typedef bool (*HPMHOOK_post_sysinfo_is64bit) (bool retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_compiler) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_compiler) (const char* retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_cflags) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_cflags) (const char* retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_time) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_time) (const char* retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_vcstype) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_vcstype) (const char* retVal___);
+typedef int (*HPMHOOK_pre_sysinfo_vcstypeid) (void);
+typedef int (*HPMHOOK_post_sysinfo_vcstypeid) (int retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_vcsrevision_src) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_vcsrevision_src) (const char* retVal___);
+typedef const char* (*HPMHOOK_pre_sysinfo_vcsrevision_scripts) (void);
+typedef const char* (*HPMHOOK_post_sysinfo_vcsrevision_scripts) (const char* retVal___);
+typedef void (*HPMHOOK_pre_sysinfo_vcsrevision_reload) (void);
+typedef void (*HPMHOOK_post_sysinfo_vcsrevision_reload) (void);
+typedef bool (*HPMHOOK_pre_sysinfo_is_superuser) (void);
+typedef bool (*HPMHOOK_post_sysinfo_is_superuser) (bool retVal___);
+typedef void (*HPMHOOK_pre_sysinfo_init) (void);
+typedef void (*HPMHOOK_post_sysinfo_init) (void);
+typedef void (*HPMHOOK_pre_sysinfo_final) (void);
+typedef void (*HPMHOOK_post_sysinfo_final) (void);
+#endif // COMMON_SYSINFO_H
+#ifdef COMMON_THREAD_H /* thread */
+typedef void (*HPMHOOK_pre_thread_init) (void);
+typedef void (*HPMHOOK_post_thread_init) (void);
+typedef void (*HPMHOOK_pre_thread_final) (void);
+typedef void (*HPMHOOK_post_thread_final) (void);
+typedef struct thread_handle* (*HPMHOOK_pre_thread_create) (threadFunc *entry_point, void **param);
+typedef struct thread_handle* (*HPMHOOK_post_thread_create) (struct thread_handle* retVal___, threadFunc entry_point, void *param);
+typedef struct thread_handle* (*HPMHOOK_pre_thread_create_opt) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio);
+typedef struct thread_handle* (*HPMHOOK_post_thread_create_opt) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio);
+typedef void (*HPMHOOK_pre_thread_destroy) (struct thread_handle **handle);
+typedef void (*HPMHOOK_post_thread_destroy) (struct thread_handle *handle);
+typedef struct thread_handle* (*HPMHOOK_pre_thread_self) (void);
+typedef struct thread_handle* (*HPMHOOK_post_thread_self) (struct thread_handle* retVal___);
+typedef int (*HPMHOOK_pre_thread_get_tid) (void);
+typedef int (*HPMHOOK_post_thread_get_tid) (int retVal___);
+typedef bool (*HPMHOOK_pre_thread_wait) (struct thread_handle **handle, void ***out_exit_code);
+typedef bool (*HPMHOOK_post_thread_wait) (bool retVal___, struct thread_handle *handle, void **out_exit_code);
+typedef void (*HPMHOOK_pre_thread_prio_set) (struct thread_handle **handle, enum thread_priority *prio);
+typedef void (*HPMHOOK_post_thread_prio_set) (struct thread_handle *handle, enum thread_priority prio);
+typedef enum thread_priority (*HPMHOOK_pre_thread_prio_get) (struct thread_handle **handle);
+typedef enum thread_priority (*HPMHOOK_post_thread_prio_get) (enum thread_priority retVal___, struct thread_handle *handle);
+typedef void (*HPMHOOK_pre_thread_yield) (void);
+typedef void (*HPMHOOK_post_thread_yield) (void);
+#endif // COMMON_THREAD_H
+#ifdef COMMON_TIMER_H /* timer */
+typedef int64 (*HPMHOOK_pre_timer_gettick) (void);
+typedef int64 (*HPMHOOK_post_timer_gettick) (int64 retVal___);
+typedef int64 (*HPMHOOK_pre_timer_gettick_nocache) (void);
+typedef int64 (*HPMHOOK_post_timer_gettick_nocache) (int64 retVal___);
+typedef int (*HPMHOOK_pre_timer_add) (int64 *tick, TimerFunc *func, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_timer_add) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_timer_add_interval) (int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
+typedef int (*HPMHOOK_post_timer_add_interval) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data, int interval);
+typedef const struct TimerData* (*HPMHOOK_pre_timer_get) (int *tid);
+typedef const struct TimerData* (*HPMHOOK_post_timer_get) (const struct TimerData* retVal___, int tid);
+typedef int (*HPMHOOK_pre_timer_delete) (int *tid, TimerFunc *func);
+typedef int (*HPMHOOK_post_timer_delete) (int retVal___, int tid, TimerFunc func);
+typedef int64 (*HPMHOOK_pre_timer_addtick) (int *tid, int64 *tick);
+typedef int64 (*HPMHOOK_post_timer_addtick) (int64 retVal___, int tid, int64 tick);
+typedef int64 (*HPMHOOK_pre_timer_settick) (int *tid, int64 *tick);
+typedef int64 (*HPMHOOK_post_timer_settick) (int64 retVal___, int tid, int64 tick);
+typedef int (*HPMHOOK_pre_timer_add_func_list) (TimerFunc *func, char **name);
+typedef int (*HPMHOOK_post_timer_add_func_list) (int retVal___, TimerFunc func, char *name);
+typedef unsigned long (*HPMHOOK_pre_timer_get_uptime) (void);
+typedef unsigned long (*HPMHOOK_post_timer_get_uptime) (unsigned long retVal___);
+typedef int (*HPMHOOK_pre_timer_perform) (int64 *tick);
+typedef int (*HPMHOOK_post_timer_perform) (int retVal___, int64 tick);
+typedef void (*HPMHOOK_pre_timer_init) (void);
+typedef void (*HPMHOOK_post_timer_init) (void);
+typedef void (*HPMHOOK_pre_timer_final) (void);
+typedef void (*HPMHOOK_post_timer_final) (void);
+#endif // COMMON_TIMER_H
+#ifdef MAP_TRADE_H /* trade */
+typedef void (*HPMHOOK_pre_trade_request) (struct map_session_data **sd, struct map_session_data **target_sd);
+typedef void (*HPMHOOK_post_trade_request) (struct map_session_data *sd, struct map_session_data *target_sd);
+typedef void (*HPMHOOK_pre_trade_ack) (struct map_session_data **sd, int *type);
+typedef void (*HPMHOOK_post_trade_ack) (struct map_session_data *sd, int type);
+typedef int (*HPMHOOK_pre_trade_check_impossible) (struct map_session_data **sd);
+typedef int (*HPMHOOK_post_trade_check_impossible) (int retVal___, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_trade_check) (struct map_session_data **sd, struct map_session_data **tsd);
+typedef int (*HPMHOOK_post_trade_check) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
+typedef void (*HPMHOOK_pre_trade_additem) (struct map_session_data **sd, short *index, short *amount);
+typedef void (*HPMHOOK_post_trade_additem) (struct map_session_data *sd, short index, short amount);
+typedef void (*HPMHOOK_pre_trade_addzeny) (struct map_session_data **sd, int *amount);
+typedef void (*HPMHOOK_post_trade_addzeny) (struct map_session_data *sd, int amount);
+typedef void (*HPMHOOK_pre_trade_ok) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_trade_ok) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_trade_cancel) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_trade_cancel) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_trade_commit) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_trade_commit) (struct map_session_data *sd);
+#endif // MAP_TRADE_H
+#ifdef MAP_UNIT_H /* unit */
+typedef int (*HPMHOOK_pre_unit_init) (bool *minimal);
+typedef int (*HPMHOOK_post_unit_init) (int retVal___, bool minimal);
+typedef int (*HPMHOOK_pre_unit_final) (void);
+typedef int (*HPMHOOK_post_unit_final) (int retVal___);
+typedef struct unit_data* (*HPMHOOK_pre_unit_bl2ud) (struct block_list **bl);
+typedef struct unit_data* (*HPMHOOK_post_unit_bl2ud) (struct unit_data* retVal___, struct block_list *bl);
+typedef struct unit_data* (*HPMHOOK_pre_unit_bl2ud2) (struct block_list **bl);
+typedef struct unit_data* (*HPMHOOK_post_unit_bl2ud2) (struct unit_data* retVal___, struct block_list *bl);
+typedef void (*HPMHOOK_pre_unit_init_ud) (struct unit_data **ud);
+typedef void (*HPMHOOK_post_unit_init_ud) (struct unit_data *ud);
+typedef int (*HPMHOOK_pre_unit_attack_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_unit_attack_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_unit_walktoxy_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_unit_walktoxy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_unit_walktoxy_sub) (struct block_list **bl);
+typedef int (*HPMHOOK_post_unit_walktoxy_sub) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_delay_walktoxy_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_unit_delay_walktoxy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_unit_walktoxy) (struct block_list **bl, short *x, short *y, int *flag);
+typedef int (*HPMHOOK_post_unit_walktoxy) (int retVal___, struct block_list *bl, short x, short y, int flag);
+typedef int (*HPMHOOK_pre_unit_walktobl_sub) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_unit_walktobl_sub) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_unit_walktobl) (struct block_list **bl, struct block_list **tbl, int *range, int *flag);
+typedef int (*HPMHOOK_post_unit_walktobl) (int retVal___, struct block_list *bl, struct block_list *tbl, int range, int flag);
+typedef bool (*HPMHOOK_pre_unit_run) (struct block_list **bl, struct map_session_data **sd, enum sc_type *type);
+typedef bool (*HPMHOOK_post_unit_run) (bool retVal___, struct block_list *bl, struct map_session_data *sd, enum sc_type type);
+typedef void (*HPMHOOK_pre_unit_run_hit) (struct block_list **bl, struct status_change **sc, struct map_session_data **sd, enum sc_type *type);
+typedef void (*HPMHOOK_post_unit_run_hit) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type);
+typedef int (*HPMHOOK_pre_unit_escape) (struct block_list **bl, struct block_list **target, short *dist);
+typedef int (*HPMHOOK_post_unit_escape) (int retVal___, struct block_list *bl, struct block_list *target, short dist);
+typedef int (*HPMHOOK_pre_unit_movepos) (struct block_list **bl, short *dst_x, short *dst_y, int *easy, bool *checkpath);
+typedef int (*HPMHOOK_post_unit_movepos) (int retVal___, struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
+typedef int (*HPMHOOK_pre_unit_setdir) (struct block_list **bl, unsigned char *dir);
+typedef int (*HPMHOOK_post_unit_setdir) (int retVal___, struct block_list *bl, unsigned char dir);
+typedef uint8 (*HPMHOOK_pre_unit_getdir) (struct block_list **bl);
+typedef uint8 (*HPMHOOK_post_unit_getdir) (uint8 retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_blown) (struct block_list **bl, int *dx, int *dy, int *count, int *flag);
+typedef int (*HPMHOOK_post_unit_blown) (int retVal___, struct block_list *bl, int dx, int dy, int count, int flag);
+typedef int (*HPMHOOK_pre_unit_warp) (struct block_list **bl, short *m, short *x, short *y, clr_type *type);
+typedef int (*HPMHOOK_post_unit_warp) (int retVal___, struct block_list *bl, short m, short x, short y, clr_type type);
+typedef int (*HPMHOOK_pre_unit_stop_walking) (struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_unit_stop_walking) (int retVal___, struct block_list *bl, int type);
+typedef int (*HPMHOOK_pre_unit_skilluse_id) (struct block_list **src, int *target_id, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_unit_skilluse_id) (int retVal___, struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_unit_step_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_unit_step_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef void (*HPMHOOK_pre_unit_stop_stepaction) (struct block_list **bl);
+typedef void (*HPMHOOK_post_unit_stop_stepaction) (struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_is_walking) (struct block_list **bl);
+typedef int (*HPMHOOK_post_unit_is_walking) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_can_move) (struct block_list **bl);
+typedef int (*HPMHOOK_post_unit_can_move) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_resume_running) (int *tid, int64 *tick, int *id, intptr_t *data);
+typedef int (*HPMHOOK_post_unit_resume_running) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+typedef int (*HPMHOOK_pre_unit_set_walkdelay) (struct block_list **bl, int64 *tick, int *delay, int *type);
+typedef int (*HPMHOOK_post_unit_set_walkdelay) (int retVal___, struct block_list *bl, int64 tick, int delay, int type);
+typedef int (*HPMHOOK_pre_unit_skilluse_id2) (struct block_list **src, int *target_id, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
+typedef int (*HPMHOOK_post_unit_skilluse_id2) (int retVal___, struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel);
+typedef int (*HPMHOOK_pre_unit_skilluse_pos) (struct block_list **src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv);
+typedef int (*HPMHOOK_post_unit_skilluse_pos) (int retVal___, struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv);
+typedef int (*HPMHOOK_pre_unit_skilluse_pos2) (struct block_list **src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
+typedef int (*HPMHOOK_post_unit_skilluse_pos2) (int retVal___, struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel);
+typedef int (*HPMHOOK_pre_unit_set_target) (struct unit_data **ud, int *target_id);
+typedef int (*HPMHOOK_post_unit_set_target) (int retVal___, struct unit_data *ud, int target_id);
+typedef void (*HPMHOOK_pre_unit_stop_attack) (struct block_list **bl);
+typedef void (*HPMHOOK_post_unit_stop_attack) (struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_unattackable) (struct block_list **bl);
+typedef int (*HPMHOOK_post_unit_unattackable) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_attack) (struct block_list **src, int *target_id, int *continuous);
+typedef int (*HPMHOOK_post_unit_attack) (int retVal___, struct block_list *src, int target_id, int continuous);
+typedef int (*HPMHOOK_pre_unit_cancel_combo) (struct block_list **bl);
+typedef int (*HPMHOOK_post_unit_cancel_combo) (int retVal___, struct block_list *bl);
+typedef bool (*HPMHOOK_pre_unit_can_reach_pos) (struct block_list **bl, int *x, int *y, int *easy);
+typedef bool (*HPMHOOK_post_unit_can_reach_pos) (bool retVal___, struct block_list *bl, int x, int y, int easy);
+typedef bool (*HPMHOOK_pre_unit_can_reach_bl) (struct block_list **bl, struct block_list **tbl, int *range, int *easy, short **x, short **y);
+typedef bool (*HPMHOOK_post_unit_can_reach_bl) (bool retVal___, struct block_list *bl, struct block_list *tbl, int range, int easy, short *x, short *y);
+typedef int (*HPMHOOK_pre_unit_calc_pos) (struct block_list **bl, int *tx, int *ty, uint8 *dir);
+typedef int (*HPMHOOK_post_unit_calc_pos) (int retVal___, struct block_list *bl, int tx, int ty, uint8 dir);
+typedef int (*HPMHOOK_pre_unit_attack_timer_sub) (struct block_list **src, int *tid, int64 *tick);
+typedef int (*HPMHOOK_post_unit_attack_timer_sub) (int retVal___, struct block_list *src, int tid, int64 tick);
+typedef int (*HPMHOOK_pre_unit_skillcastcancel) (struct block_list **bl, int *type);
+typedef int (*HPMHOOK_post_unit_skillcastcancel) (int retVal___, struct block_list *bl, int type);
+typedef void (*HPMHOOK_pre_unit_dataset) (struct block_list **bl);
+typedef void (*HPMHOOK_post_unit_dataset) (struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_counttargeted) (struct block_list **bl);
+typedef int (*HPMHOOK_post_unit_counttargeted) (int retVal___, struct block_list *bl);
+typedef int (*HPMHOOK_pre_unit_fixdamage) (struct block_list **src, struct block_list **target, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
+typedef int (*HPMHOOK_post_unit_fixdamage) (int retVal___, struct block_list *src, struct block_list *target, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2);
+typedef int (*HPMHOOK_pre_unit_changeviewsize) (struct block_list **bl, short *size);
+typedef int (*HPMHOOK_post_unit_changeviewsize) (int retVal___, struct block_list *bl, short size);
+typedef int (*HPMHOOK_pre_unit_remove_map) (struct block_list **bl, clr_type *clrtype, const char **file, int *line, const char **func);
+typedef int (*HPMHOOK_post_unit_remove_map) (int retVal___, struct block_list *bl, clr_type clrtype, const char *file, int line, const char *func);
+typedef void (*HPMHOOK_pre_unit_remove_map_pc) (struct map_session_data **sd, clr_type *clrtype);
+typedef void (*HPMHOOK_post_unit_remove_map_pc) (struct map_session_data *sd, clr_type clrtype);
+typedef void (*HPMHOOK_pre_unit_free_pc) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_unit_free_pc) (struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_unit_free) (struct block_list **bl, clr_type *clrtype);
+typedef int (*HPMHOOK_post_unit_free) (int retVal___, struct block_list *bl, clr_type clrtype);
+#endif // MAP_UNIT_H
+#ifdef MAP_VENDING_H /* vending */
+typedef void (*HPMHOOK_pre_vending_init) (bool *minimal);
+typedef void (*HPMHOOK_post_vending_init) (bool minimal);
+typedef void (*HPMHOOK_pre_vending_final) (void);
+typedef void (*HPMHOOK_post_vending_final) (void);
+typedef void (*HPMHOOK_pre_vending_close) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_vending_close) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_vending_open) (struct map_session_data **sd, const char **message, const uint8 **data, int *count);
+typedef void (*HPMHOOK_post_vending_open) (struct map_session_data *sd, const char *message, const uint8 *data, int count);
+typedef void (*HPMHOOK_pre_vending_list) (struct map_session_data **sd, unsigned int *id);
+typedef void (*HPMHOOK_post_vending_list) (struct map_session_data *sd, unsigned int id);
+typedef void (*HPMHOOK_pre_vending_purchase) (struct map_session_data **sd, int *aid, unsigned int *uid, const uint8 **data, int *count);
+typedef void (*HPMHOOK_post_vending_purchase) (struct map_session_data *sd, int aid, unsigned int uid, const uint8 *data, int count);
+typedef bool (*HPMHOOK_pre_vending_search) (struct map_session_data **sd, unsigned short *nameid);
+typedef bool (*HPMHOOK_post_vending_search) (bool retVal___, struct map_session_data *sd, unsigned short nameid);
+typedef bool (*HPMHOOK_pre_vending_searchall) (struct map_session_data **sd, const struct s_search_store_search **s);
+typedef bool (*HPMHOOK_post_vending_searchall) (bool retVal___, struct map_session_data *sd, const struct s_search_store_search *s);
+#endif // MAP_VENDING_H
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
index dd6b3d5d6..21e136c2f 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,6 +23,8 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
struct {
struct HPMHookPoint *HP_HCache_init_pre;
struct HPMHookPoint *HP_HCache_init_post;
@@ -62,8 +64,6 @@ struct {
struct HPMHookPoint *HP_chr_mmo_char_tosql_post;
struct HPMHookPoint *HP_chr_memitemdata_to_sql_pre;
struct HPMHookPoint *HP_chr_memitemdata_to_sql_post;
- struct HPMHookPoint *HP_chr_inventory_to_sql_pre;
- struct HPMHookPoint *HP_chr_inventory_to_sql_post;
struct HPMHookPoint *HP_chr_mmo_gender_pre;
struct HPMHookPoint *HP_chr_mmo_gender_post;
struct HPMHookPoint *HP_chr_mmo_chars_fromsql_pre;
@@ -344,10 +344,38 @@ struct {
struct HPMHookPoint *HP_chr_online_data_cleanup_post;
struct HPMHookPoint *HP_chr_sql_config_read_pre;
struct HPMHookPoint *HP_chr_sql_config_read_post;
- struct HPMHookPoint *HP_chr_config_dispatch_pre;
- struct HPMHookPoint *HP_chr_config_dispatch_post;
+ struct HPMHookPoint *HP_chr_sql_config_read_registry_pre;
+ struct HPMHookPoint *HP_chr_sql_config_read_registry_post;
+ struct HPMHookPoint *HP_chr_sql_config_read_pc_pre;
+ struct HPMHookPoint *HP_chr_sql_config_read_pc_post;
+ struct HPMHookPoint *HP_chr_sql_config_read_guild_pre;
+ struct HPMHookPoint *HP_chr_sql_config_read_guild_post;
struct HPMHookPoint *HP_chr_config_read_pre;
struct HPMHookPoint *HP_chr_config_read_post;
+ struct HPMHookPoint *HP_chr_config_read_database_pre;
+ struct HPMHookPoint *HP_chr_config_read_database_post;
+ struct HPMHookPoint *HP_chr_config_read_console_pre;
+ struct HPMHookPoint *HP_chr_config_read_console_post;
+ struct HPMHookPoint *HP_chr_config_read_player_fame_pre;
+ struct HPMHookPoint *HP_chr_config_read_player_fame_post;
+ struct HPMHookPoint *HP_chr_config_read_player_deletion_pre;
+ struct HPMHookPoint *HP_chr_config_read_player_deletion_post;
+ struct HPMHookPoint *HP_chr_config_read_player_name_pre;
+ struct HPMHookPoint *HP_chr_config_read_player_name_post;
+ struct HPMHookPoint *HP_chr_config_set_start_item_pre;
+ struct HPMHookPoint *HP_chr_config_set_start_item_post;
+ struct HPMHookPoint *HP_chr_config_read_player_new_pre;
+ struct HPMHookPoint *HP_chr_config_read_player_new_post;
+ struct HPMHookPoint *HP_chr_config_read_player_pre;
+ struct HPMHookPoint *HP_chr_config_read_player_post;
+ struct HPMHookPoint *HP_chr_config_read_permission_pre;
+ struct HPMHookPoint *HP_chr_config_read_permission_post;
+ struct HPMHookPoint *HP_chr_config_set_ip_pre;
+ struct HPMHookPoint *HP_chr_config_set_ip_post;
+ struct HPMHookPoint *HP_chr_config_read_inter_pre;
+ struct HPMHookPoint *HP_chr_config_read_inter_post;
+ struct HPMHookPoint *HP_chr_config_read_top_pre;
+ struct HPMHookPoint *HP_chr_config_read_top_post;
struct HPMHookPoint *HP_cmdline_init_pre;
struct HPMHookPoint *HP_cmdline_init_post;
struct HPMHookPoint *HP_cmdline_final_pre;
@@ -408,6 +436,10 @@ struct {
struct HPMHookPoint *HP_DB_init_post;
struct HPMHookPoint *HP_DB_final_pre;
struct HPMHookPoint *HP_DB_final_post;
+ struct HPMHookPoint *HP_des_decrypt_block_pre;
+ struct HPMHookPoint *HP_des_decrypt_block_post;
+ struct HPMHookPoint *HP_des_decrypt_pre;
+ struct HPMHookPoint *HP_des_decrypt_post;
struct HPMHookPoint *HP_geoip_getcountry_pre;
struct HPMHookPoint *HP_geoip_getcountry_post;
struct HPMHookPoint *HP_geoip_final_pre;
@@ -502,8 +534,6 @@ struct {
struct HPMHookPoint *HP_inter_savereg_post;
struct HPMHookPoint *HP_inter_accreg_fromsql_pre;
struct HPMHookPoint *HP_inter_accreg_fromsql_post;
- struct HPMHookPoint *HP_inter_config_read_pre;
- struct HPMHookPoint *HP_inter_config_read_post;
struct HPMHookPoint *HP_inter_vlog_pre;
struct HPMHookPoint *HP_inter_vlog_post;
struct HPMHookPoint *HP_inter_init_sql_pre;
@@ -520,6 +550,12 @@ struct {
struct HPMHookPoint *HP_inter_parse_frommap_post;
struct HPMHookPoint *HP_inter_final_pre;
struct HPMHookPoint *HP_inter_final_post;
+ struct HPMHookPoint *HP_inter_config_read_pre;
+ struct HPMHookPoint *HP_inter_config_read_post;
+ struct HPMHookPoint *HP_inter_config_read_log_pre;
+ struct HPMHookPoint *HP_inter_config_read_log_post;
+ struct HPMHookPoint *HP_inter_config_read_connection_pre;
+ struct HPMHookPoint *HP_inter_config_read_connection_post;
struct HPMHookPoint *HP_inter_mail_sql_init_pre;
struct HPMHookPoint *HP_inter_mail_sql_init_post;
struct HPMHookPoint *HP_inter_mail_sql_final_pre;
@@ -610,10 +646,10 @@ struct {
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
struct HPMHookPoint *HP_libconfig_write_post;
- struct HPMHookPoint *HP_libconfig_set_auto_convert_pre;
- struct HPMHookPoint *HP_libconfig_set_auto_convert_post;
- struct HPMHookPoint *HP_libconfig_get_auto_convert_pre;
- struct HPMHookPoint *HP_libconfig_get_auto_convert_post;
+ struct HPMHookPoint *HP_libconfig_set_options_pre;
+ struct HPMHookPoint *HP_libconfig_set_options_post;
+ struct HPMHookPoint *HP_libconfig_get_options_pre;
+ struct HPMHookPoint *HP_libconfig_get_options_post;
struct HPMHookPoint *HP_libconfig_read_string_pre;
struct HPMHookPoint *HP_libconfig_read_string_post;
struct HPMHookPoint *HP_libconfig_read_file_src_pre;
@@ -638,6 +674,8 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_get_bool_post;
struct HPMHookPoint *HP_libconfig_setting_get_string_pre;
struct HPMHookPoint *HP_libconfig_setting_get_string_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_post;
struct HPMHookPoint *HP_libconfig_setting_lookup_int_pre;
struct HPMHookPoint *HP_libconfig_setting_lookup_int_post;
struct HPMHookPoint *HP_libconfig_setting_lookup_int64_pre;
@@ -700,8 +738,6 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_set_hook_post;
struct HPMHookPoint *HP_libconfig_lookup_pre;
struct HPMHookPoint *HP_libconfig_lookup_post;
- struct HPMHookPoint *HP_libconfig_lookup_from_pre;
- struct HPMHookPoint *HP_libconfig_lookup_from_post;
struct HPMHookPoint *HP_libconfig_lookup_int_pre;
struct HPMHookPoint *HP_libconfig_lookup_int_post;
struct HPMHookPoint *HP_libconfig_lookup_int64_pre;
@@ -712,8 +748,8 @@ struct {
struct HPMHookPoint *HP_libconfig_lookup_bool_post;
struct HPMHookPoint *HP_libconfig_lookup_string_pre;
struct HPMHookPoint *HP_libconfig_lookup_string_post;
- struct HPMHookPoint *HP_libconfig_read_file_pre;
- struct HPMHookPoint *HP_libconfig_read_file_post;
+ struct HPMHookPoint *HP_libconfig_load_file_pre;
+ struct HPMHookPoint *HP_libconfig_load_file_post;
struct HPMHookPoint *HP_libconfig_setting_copy_simple_pre;
struct HPMHookPoint *HP_libconfig_setting_copy_simple_post;
struct HPMHookPoint *HP_libconfig_setting_copy_elem_pre;
@@ -722,6 +758,26 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_copy_aggregate_post;
struct HPMHookPoint *HP_libconfig_setting_copy_pre;
struct HPMHookPoint *HP_libconfig_setting_copy_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_bool_real_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_bool_real_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint32_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint32_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint16_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_int16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_int16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_bool_real_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_bool_real_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint32_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint32_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_int16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_int16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_mutable_string_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_mutable_string_post;
+ struct HPMHookPoint *HP_libconfig_lookup_mutable_string_pre;
+ struct HPMHookPoint *HP_libconfig_lookup_mutable_string_post;
struct HPMHookPoint *HP_loginif_init_pre;
struct HPMHookPoint *HP_loginif_init_post;
struct HPMHookPoint *HP_loginif_final_pre;
@@ -748,32 +804,6 @@ struct {
struct HPMHookPoint *HP_loginif_send_users_count_post;
struct HPMHookPoint *HP_loginif_connect_to_server_pre;
struct HPMHookPoint *HP_loginif_connect_to_server_post;
- struct HPMHookPoint *HP_iMalloc_init_pre;
- struct HPMHookPoint *HP_iMalloc_init_post;
- struct HPMHookPoint *HP_iMalloc_final_pre;
- struct HPMHookPoint *HP_iMalloc_final_post;
- struct HPMHookPoint *HP_iMalloc_malloc_pre;
- struct HPMHookPoint *HP_iMalloc_malloc_post;
- struct HPMHookPoint *HP_iMalloc_calloc_pre;
- struct HPMHookPoint *HP_iMalloc_calloc_post;
- struct HPMHookPoint *HP_iMalloc_realloc_pre;
- struct HPMHookPoint *HP_iMalloc_realloc_post;
- struct HPMHookPoint *HP_iMalloc_reallocz_pre;
- struct HPMHookPoint *HP_iMalloc_reallocz_post;
- struct HPMHookPoint *HP_iMalloc_astrdup_pre;
- struct HPMHookPoint *HP_iMalloc_astrdup_post;
- struct HPMHookPoint *HP_iMalloc_free_pre;
- struct HPMHookPoint *HP_iMalloc_free_post;
- struct HPMHookPoint *HP_iMalloc_memory_check_pre;
- struct HPMHookPoint *HP_iMalloc_memory_check_post;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_pre;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_post;
- struct HPMHookPoint *HP_iMalloc_usage_pre;
- struct HPMHookPoint *HP_iMalloc_usage_post;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_pre;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_post;
- struct HPMHookPoint *HP_iMalloc_init_messages_pre;
- struct HPMHookPoint *HP_iMalloc_init_messages_post;
struct HPMHookPoint *HP_mapif_ban_pre;
struct HPMHookPoint *HP_mapif_ban_post;
struct HPMHookPoint *HP_mapif_server_init_pre;
@@ -818,6 +848,8 @@ struct {
struct HPMHookPoint *HP_mapif_auction_bid_post;
struct HPMHookPoint *HP_mapif_parse_auction_bid_pre;
struct HPMHookPoint *HP_mapif_parse_auction_bid_post;
+ struct HPMHookPoint *HP_mapif_elemental_create_pre;
+ struct HPMHookPoint *HP_mapif_elemental_create_post;
struct HPMHookPoint *HP_mapif_elemental_save_pre;
struct HPMHookPoint *HP_mapif_elemental_save_post;
struct HPMHookPoint *HP_mapif_elemental_load_pre;
@@ -918,6 +950,8 @@ struct {
struct HPMHookPoint *HP_mapif_homunculus_saved_post;
struct HPMHookPoint *HP_mapif_homunculus_renamed_pre;
struct HPMHookPoint *HP_mapif_homunculus_renamed_post;
+ struct HPMHookPoint *HP_mapif_homunculus_create_pre;
+ struct HPMHookPoint *HP_mapif_homunculus_create_post;
struct HPMHookPoint *HP_mapif_homunculus_save_pre;
struct HPMHookPoint *HP_mapif_homunculus_save_post;
struct HPMHookPoint *HP_mapif_homunculus_load_pre;
@@ -962,6 +996,8 @@ struct {
struct HPMHookPoint *HP_mapif_mail_send_post;
struct HPMHookPoint *HP_mapif_parse_mail_send_pre;
struct HPMHookPoint *HP_mapif_parse_mail_send_post;
+ struct HPMHookPoint *HP_mapif_mercenary_create_pre;
+ struct HPMHookPoint *HP_mapif_mercenary_create_post;
struct HPMHookPoint *HP_mapif_mercenary_save_pre;
struct HPMHookPoint *HP_mapif_mercenary_save_post;
struct HPMHookPoint *HP_mapif_mercenary_load_pre;
@@ -1068,6 +1104,14 @@ struct {
struct HPMHookPoint *HP_mapif_parse_LoadGuildStorage_post;
struct HPMHookPoint *HP_mapif_parse_SaveGuildStorage_pre;
struct HPMHookPoint *HP_mapif_parse_SaveGuildStorage_post;
+ struct HPMHookPoint *HP_mapif_account_storage_load_pre;
+ struct HPMHookPoint *HP_mapif_account_storage_load_post;
+ struct HPMHookPoint *HP_mapif_pAccountStorageLoad_pre;
+ struct HPMHookPoint *HP_mapif_pAccountStorageLoad_post;
+ struct HPMHookPoint *HP_mapif_pAccountStorageSave_pre;
+ struct HPMHookPoint *HP_mapif_pAccountStorageSave_post;
+ struct HPMHookPoint *HP_mapif_sAccountStorageSaveAck_pre;
+ struct HPMHookPoint *HP_mapif_sAccountStorageSaveAck_post;
struct HPMHookPoint *HP_mapif_itembound_ack_pre;
struct HPMHookPoint *HP_mapif_itembound_ack_post;
struct HPMHookPoint *HP_mapif_parse_ItemBoundRetrieve_sub_pre;
@@ -1124,6 +1168,32 @@ struct {
struct HPMHookPoint *HP_mapindex_id2name_post;
struct HPMHookPoint *HP_mapindex_check_default_pre;
struct HPMHookPoint *HP_mapindex_check_default_post;
+ struct HPMHookPoint *HP_md5_string_pre;
+ struct HPMHookPoint *HP_md5_string_post;
+ struct HPMHookPoint *HP_md5_binary_pre;
+ struct HPMHookPoint *HP_md5_binary_post;
+ struct HPMHookPoint *HP_md5_salt_pre;
+ struct HPMHookPoint *HP_md5_salt_post;
+ struct HPMHookPoint *HP_mutex_create_pre;
+ struct HPMHookPoint *HP_mutex_create_post;
+ struct HPMHookPoint *HP_mutex_destroy_pre;
+ struct HPMHookPoint *HP_mutex_destroy_post;
+ struct HPMHookPoint *HP_mutex_lock_pre;
+ struct HPMHookPoint *HP_mutex_lock_post;
+ struct HPMHookPoint *HP_mutex_trylock_pre;
+ struct HPMHookPoint *HP_mutex_trylock_post;
+ struct HPMHookPoint *HP_mutex_unlock_pre;
+ struct HPMHookPoint *HP_mutex_unlock_post;
+ struct HPMHookPoint *HP_mutex_cond_create_pre;
+ struct HPMHookPoint *HP_mutex_cond_create_post;
+ struct HPMHookPoint *HP_mutex_cond_destroy_pre;
+ struct HPMHookPoint *HP_mutex_cond_destroy_post;
+ struct HPMHookPoint *HP_mutex_cond_wait_pre;
+ struct HPMHookPoint *HP_mutex_cond_wait_post;
+ struct HPMHookPoint *HP_mutex_cond_signal_pre;
+ struct HPMHookPoint *HP_mutex_cond_signal_post;
+ struct HPMHookPoint *HP_mutex_cond_broadcast_pre;
+ struct HPMHookPoint *HP_mutex_cond_broadcast_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
struct HPMHookPoint *HP_pincode_handle_pre;
@@ -1146,6 +1216,22 @@ struct {
struct HPMHookPoint *HP_pincode_check_post;
struct HPMHookPoint *HP_pincode_config_read_pre;
struct HPMHookPoint *HP_pincode_config_read_post;
+ struct HPMHookPoint *HP_rnd_init_pre;
+ struct HPMHookPoint *HP_rnd_init_post;
+ struct HPMHookPoint *HP_rnd_final_pre;
+ struct HPMHookPoint *HP_rnd_final_post;
+ struct HPMHookPoint *HP_rnd_seed_pre;
+ struct HPMHookPoint *HP_rnd_seed_post;
+ struct HPMHookPoint *HP_rnd_random_pre;
+ struct HPMHookPoint *HP_rnd_random_post;
+ struct HPMHookPoint *HP_rnd_roll_pre;
+ struct HPMHookPoint *HP_rnd_roll_post;
+ struct HPMHookPoint *HP_rnd_value_pre;
+ struct HPMHookPoint *HP_rnd_value_post;
+ struct HPMHookPoint *HP_rnd_uniform_pre;
+ struct HPMHookPoint *HP_rnd_uniform_post;
+ struct HPMHookPoint *HP_rnd_uniform53_pre;
+ struct HPMHookPoint *HP_rnd_uniform53_post;
struct HPMHookPoint *HP_showmsg_init_pre;
struct HPMHookPoint *HP_showmsg_init_post;
struct HPMHookPoint *HP_showmsg_final_pre;
@@ -1356,6 +1442,8 @@ struct {
struct HPMHookPoint *HP_sysinfo_compiler_post;
struct HPMHookPoint *HP_sysinfo_cflags_pre;
struct HPMHookPoint *HP_sysinfo_cflags_post;
+ struct HPMHookPoint *HP_sysinfo_time_pre;
+ struct HPMHookPoint *HP_sysinfo_time_post;
struct HPMHookPoint *HP_sysinfo_vcstype_pre;
struct HPMHookPoint *HP_sysinfo_vcstype_post;
struct HPMHookPoint *HP_sysinfo_vcstypeid_pre;
@@ -1372,6 +1460,28 @@ struct {
struct HPMHookPoint *HP_sysinfo_init_post;
struct HPMHookPoint *HP_sysinfo_final_pre;
struct HPMHookPoint *HP_sysinfo_final_post;
+ struct HPMHookPoint *HP_thread_init_pre;
+ struct HPMHookPoint *HP_thread_init_post;
+ struct HPMHookPoint *HP_thread_final_pre;
+ struct HPMHookPoint *HP_thread_final_post;
+ struct HPMHookPoint *HP_thread_create_pre;
+ struct HPMHookPoint *HP_thread_create_post;
+ struct HPMHookPoint *HP_thread_create_opt_pre;
+ struct HPMHookPoint *HP_thread_create_opt_post;
+ struct HPMHookPoint *HP_thread_destroy_pre;
+ struct HPMHookPoint *HP_thread_destroy_post;
+ struct HPMHookPoint *HP_thread_self_pre;
+ struct HPMHookPoint *HP_thread_self_post;
+ struct HPMHookPoint *HP_thread_get_tid_pre;
+ struct HPMHookPoint *HP_thread_get_tid_post;
+ struct HPMHookPoint *HP_thread_wait_pre;
+ struct HPMHookPoint *HP_thread_wait_post;
+ struct HPMHookPoint *HP_thread_prio_set_pre;
+ struct HPMHookPoint *HP_thread_prio_set_post;
+ struct HPMHookPoint *HP_thread_prio_get_pre;
+ struct HPMHookPoint *HP_thread_prio_get_post;
+ struct HPMHookPoint *HP_thread_yield_pre;
+ struct HPMHookPoint *HP_thread_yield_post;
struct HPMHookPoint *HP_timer_gettick_pre;
struct HPMHookPoint *HP_timer_gettick_post;
struct HPMHookPoint *HP_timer_gettick_nocache_pre;
@@ -1439,8 +1549,6 @@ struct {
int HP_chr_mmo_char_tosql_post;
int HP_chr_memitemdata_to_sql_pre;
int HP_chr_memitemdata_to_sql_post;
- int HP_chr_inventory_to_sql_pre;
- int HP_chr_inventory_to_sql_post;
int HP_chr_mmo_gender_pre;
int HP_chr_mmo_gender_post;
int HP_chr_mmo_chars_fromsql_pre;
@@ -1721,10 +1829,38 @@ struct {
int HP_chr_online_data_cleanup_post;
int HP_chr_sql_config_read_pre;
int HP_chr_sql_config_read_post;
- int HP_chr_config_dispatch_pre;
- int HP_chr_config_dispatch_post;
+ int HP_chr_sql_config_read_registry_pre;
+ int HP_chr_sql_config_read_registry_post;
+ int HP_chr_sql_config_read_pc_pre;
+ int HP_chr_sql_config_read_pc_post;
+ int HP_chr_sql_config_read_guild_pre;
+ int HP_chr_sql_config_read_guild_post;
int HP_chr_config_read_pre;
int HP_chr_config_read_post;
+ int HP_chr_config_read_database_pre;
+ int HP_chr_config_read_database_post;
+ int HP_chr_config_read_console_pre;
+ int HP_chr_config_read_console_post;
+ int HP_chr_config_read_player_fame_pre;
+ int HP_chr_config_read_player_fame_post;
+ int HP_chr_config_read_player_deletion_pre;
+ int HP_chr_config_read_player_deletion_post;
+ int HP_chr_config_read_player_name_pre;
+ int HP_chr_config_read_player_name_post;
+ int HP_chr_config_set_start_item_pre;
+ int HP_chr_config_set_start_item_post;
+ int HP_chr_config_read_player_new_pre;
+ int HP_chr_config_read_player_new_post;
+ int HP_chr_config_read_player_pre;
+ int HP_chr_config_read_player_post;
+ int HP_chr_config_read_permission_pre;
+ int HP_chr_config_read_permission_post;
+ int HP_chr_config_set_ip_pre;
+ int HP_chr_config_set_ip_post;
+ int HP_chr_config_read_inter_pre;
+ int HP_chr_config_read_inter_post;
+ int HP_chr_config_read_top_pre;
+ int HP_chr_config_read_top_post;
int HP_cmdline_init_pre;
int HP_cmdline_init_post;
int HP_cmdline_final_pre;
@@ -1785,6 +1921,10 @@ struct {
int HP_DB_init_post;
int HP_DB_final_pre;
int HP_DB_final_post;
+ int HP_des_decrypt_block_pre;
+ int HP_des_decrypt_block_post;
+ int HP_des_decrypt_pre;
+ int HP_des_decrypt_post;
int HP_geoip_getcountry_pre;
int HP_geoip_getcountry_post;
int HP_geoip_final_pre;
@@ -1879,8 +2019,6 @@ struct {
int HP_inter_savereg_post;
int HP_inter_accreg_fromsql_pre;
int HP_inter_accreg_fromsql_post;
- int HP_inter_config_read_pre;
- int HP_inter_config_read_post;
int HP_inter_vlog_pre;
int HP_inter_vlog_post;
int HP_inter_init_sql_pre;
@@ -1897,6 +2035,12 @@ struct {
int HP_inter_parse_frommap_post;
int HP_inter_final_pre;
int HP_inter_final_post;
+ int HP_inter_config_read_pre;
+ int HP_inter_config_read_post;
+ int HP_inter_config_read_log_pre;
+ int HP_inter_config_read_log_post;
+ int HP_inter_config_read_connection_pre;
+ int HP_inter_config_read_connection_post;
int HP_inter_mail_sql_init_pre;
int HP_inter_mail_sql_init_post;
int HP_inter_mail_sql_final_pre;
@@ -1987,10 +2131,10 @@ struct {
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
int HP_libconfig_write_post;
- int HP_libconfig_set_auto_convert_pre;
- int HP_libconfig_set_auto_convert_post;
- int HP_libconfig_get_auto_convert_pre;
- int HP_libconfig_get_auto_convert_post;
+ int HP_libconfig_set_options_pre;
+ int HP_libconfig_set_options_post;
+ int HP_libconfig_get_options_pre;
+ int HP_libconfig_get_options_post;
int HP_libconfig_read_string_pre;
int HP_libconfig_read_string_post;
int HP_libconfig_read_file_src_pre;
@@ -2015,6 +2159,8 @@ struct {
int HP_libconfig_setting_get_bool_post;
int HP_libconfig_setting_get_string_pre;
int HP_libconfig_setting_get_string_post;
+ int HP_libconfig_setting_lookup_pre;
+ int HP_libconfig_setting_lookup_post;
int HP_libconfig_setting_lookup_int_pre;
int HP_libconfig_setting_lookup_int_post;
int HP_libconfig_setting_lookup_int64_pre;
@@ -2077,8 +2223,6 @@ struct {
int HP_libconfig_setting_set_hook_post;
int HP_libconfig_lookup_pre;
int HP_libconfig_lookup_post;
- int HP_libconfig_lookup_from_pre;
- int HP_libconfig_lookup_from_post;
int HP_libconfig_lookup_int_pre;
int HP_libconfig_lookup_int_post;
int HP_libconfig_lookup_int64_pre;
@@ -2089,8 +2233,8 @@ struct {
int HP_libconfig_lookup_bool_post;
int HP_libconfig_lookup_string_pre;
int HP_libconfig_lookup_string_post;
- int HP_libconfig_read_file_pre;
- int HP_libconfig_read_file_post;
+ int HP_libconfig_load_file_pre;
+ int HP_libconfig_load_file_post;
int HP_libconfig_setting_copy_simple_pre;
int HP_libconfig_setting_copy_simple_post;
int HP_libconfig_setting_copy_elem_pre;
@@ -2099,6 +2243,26 @@ struct {
int HP_libconfig_setting_copy_aggregate_post;
int HP_libconfig_setting_copy_pre;
int HP_libconfig_setting_copy_post;
+ int HP_libconfig_setting_get_bool_real_pre;
+ int HP_libconfig_setting_get_bool_real_post;
+ int HP_libconfig_setting_get_uint32_pre;
+ int HP_libconfig_setting_get_uint32_post;
+ int HP_libconfig_setting_get_uint16_pre;
+ int HP_libconfig_setting_get_uint16_post;
+ int HP_libconfig_setting_get_int16_pre;
+ int HP_libconfig_setting_get_int16_post;
+ int HP_libconfig_setting_lookup_bool_real_pre;
+ int HP_libconfig_setting_lookup_bool_real_post;
+ int HP_libconfig_setting_lookup_uint32_pre;
+ int HP_libconfig_setting_lookup_uint32_post;
+ int HP_libconfig_setting_lookup_uint16_pre;
+ int HP_libconfig_setting_lookup_uint16_post;
+ int HP_libconfig_setting_lookup_int16_pre;
+ int HP_libconfig_setting_lookup_int16_post;
+ int HP_libconfig_setting_lookup_mutable_string_pre;
+ int HP_libconfig_setting_lookup_mutable_string_post;
+ int HP_libconfig_lookup_mutable_string_pre;
+ int HP_libconfig_lookup_mutable_string_post;
int HP_loginif_init_pre;
int HP_loginif_init_post;
int HP_loginif_final_pre;
@@ -2125,32 +2289,6 @@ struct {
int HP_loginif_send_users_count_post;
int HP_loginif_connect_to_server_pre;
int HP_loginif_connect_to_server_post;
- int HP_iMalloc_init_pre;
- int HP_iMalloc_init_post;
- int HP_iMalloc_final_pre;
- int HP_iMalloc_final_post;
- int HP_iMalloc_malloc_pre;
- int HP_iMalloc_malloc_post;
- int HP_iMalloc_calloc_pre;
- int HP_iMalloc_calloc_post;
- int HP_iMalloc_realloc_pre;
- int HP_iMalloc_realloc_post;
- int HP_iMalloc_reallocz_pre;
- int HP_iMalloc_reallocz_post;
- int HP_iMalloc_astrdup_pre;
- int HP_iMalloc_astrdup_post;
- int HP_iMalloc_free_pre;
- int HP_iMalloc_free_post;
- int HP_iMalloc_memory_check_pre;
- int HP_iMalloc_memory_check_post;
- int HP_iMalloc_verify_ptr_pre;
- int HP_iMalloc_verify_ptr_post;
- int HP_iMalloc_usage_pre;
- int HP_iMalloc_usage_post;
- int HP_iMalloc_post_shutdown_pre;
- int HP_iMalloc_post_shutdown_post;
- int HP_iMalloc_init_messages_pre;
- int HP_iMalloc_init_messages_post;
int HP_mapif_ban_pre;
int HP_mapif_ban_post;
int HP_mapif_server_init_pre;
@@ -2195,6 +2333,8 @@ struct {
int HP_mapif_auction_bid_post;
int HP_mapif_parse_auction_bid_pre;
int HP_mapif_parse_auction_bid_post;
+ int HP_mapif_elemental_create_pre;
+ int HP_mapif_elemental_create_post;
int HP_mapif_elemental_save_pre;
int HP_mapif_elemental_save_post;
int HP_mapif_elemental_load_pre;
@@ -2295,6 +2435,8 @@ struct {
int HP_mapif_homunculus_saved_post;
int HP_mapif_homunculus_renamed_pre;
int HP_mapif_homunculus_renamed_post;
+ int HP_mapif_homunculus_create_pre;
+ int HP_mapif_homunculus_create_post;
int HP_mapif_homunculus_save_pre;
int HP_mapif_homunculus_save_post;
int HP_mapif_homunculus_load_pre;
@@ -2339,6 +2481,8 @@ struct {
int HP_mapif_mail_send_post;
int HP_mapif_parse_mail_send_pre;
int HP_mapif_parse_mail_send_post;
+ int HP_mapif_mercenary_create_pre;
+ int HP_mapif_mercenary_create_post;
int HP_mapif_mercenary_save_pre;
int HP_mapif_mercenary_save_post;
int HP_mapif_mercenary_load_pre;
@@ -2445,6 +2589,14 @@ struct {
int HP_mapif_parse_LoadGuildStorage_post;
int HP_mapif_parse_SaveGuildStorage_pre;
int HP_mapif_parse_SaveGuildStorage_post;
+ int HP_mapif_account_storage_load_pre;
+ int HP_mapif_account_storage_load_post;
+ int HP_mapif_pAccountStorageLoad_pre;
+ int HP_mapif_pAccountStorageLoad_post;
+ int HP_mapif_pAccountStorageSave_pre;
+ int HP_mapif_pAccountStorageSave_post;
+ int HP_mapif_sAccountStorageSaveAck_pre;
+ int HP_mapif_sAccountStorageSaveAck_post;
int HP_mapif_itembound_ack_pre;
int HP_mapif_itembound_ack_post;
int HP_mapif_parse_ItemBoundRetrieve_sub_pre;
@@ -2501,6 +2653,32 @@ struct {
int HP_mapindex_id2name_post;
int HP_mapindex_check_default_pre;
int HP_mapindex_check_default_post;
+ int HP_md5_string_pre;
+ int HP_md5_string_post;
+ int HP_md5_binary_pre;
+ int HP_md5_binary_post;
+ int HP_md5_salt_pre;
+ int HP_md5_salt_post;
+ int HP_mutex_create_pre;
+ int HP_mutex_create_post;
+ int HP_mutex_destroy_pre;
+ int HP_mutex_destroy_post;
+ int HP_mutex_lock_pre;
+ int HP_mutex_lock_post;
+ int HP_mutex_trylock_pre;
+ int HP_mutex_trylock_post;
+ int HP_mutex_unlock_pre;
+ int HP_mutex_unlock_post;
+ int HP_mutex_cond_create_pre;
+ int HP_mutex_cond_create_post;
+ int HP_mutex_cond_destroy_pre;
+ int HP_mutex_cond_destroy_post;
+ int HP_mutex_cond_wait_pre;
+ int HP_mutex_cond_wait_post;
+ int HP_mutex_cond_signal_pre;
+ int HP_mutex_cond_signal_post;
+ int HP_mutex_cond_broadcast_pre;
+ int HP_mutex_cond_broadcast_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
int HP_pincode_handle_pre;
@@ -2523,6 +2701,22 @@ struct {
int HP_pincode_check_post;
int HP_pincode_config_read_pre;
int HP_pincode_config_read_post;
+ int HP_rnd_init_pre;
+ int HP_rnd_init_post;
+ int HP_rnd_final_pre;
+ int HP_rnd_final_post;
+ int HP_rnd_seed_pre;
+ int HP_rnd_seed_post;
+ int HP_rnd_random_pre;
+ int HP_rnd_random_post;
+ int HP_rnd_roll_pre;
+ int HP_rnd_roll_post;
+ int HP_rnd_value_pre;
+ int HP_rnd_value_post;
+ int HP_rnd_uniform_pre;
+ int HP_rnd_uniform_post;
+ int HP_rnd_uniform53_pre;
+ int HP_rnd_uniform53_post;
int HP_showmsg_init_pre;
int HP_showmsg_init_post;
int HP_showmsg_final_pre;
@@ -2733,6 +2927,8 @@ struct {
int HP_sysinfo_compiler_post;
int HP_sysinfo_cflags_pre;
int HP_sysinfo_cflags_post;
+ int HP_sysinfo_time_pre;
+ int HP_sysinfo_time_post;
int HP_sysinfo_vcstype_pre;
int HP_sysinfo_vcstype_post;
int HP_sysinfo_vcstypeid_pre;
@@ -2749,6 +2945,28 @@ struct {
int HP_sysinfo_init_post;
int HP_sysinfo_final_pre;
int HP_sysinfo_final_post;
+ int HP_thread_init_pre;
+ int HP_thread_init_post;
+ int HP_thread_final_pre;
+ int HP_thread_final_post;
+ int HP_thread_create_pre;
+ int HP_thread_create_post;
+ int HP_thread_create_opt_pre;
+ int HP_thread_create_opt_post;
+ int HP_thread_destroy_pre;
+ int HP_thread_destroy_post;
+ int HP_thread_self_pre;
+ int HP_thread_self_post;
+ int HP_thread_get_tid_pre;
+ int HP_thread_get_tid_post;
+ int HP_thread_wait_pre;
+ int HP_thread_wait_post;
+ int HP_thread_prio_set_pre;
+ int HP_thread_prio_set_post;
+ int HP_thread_prio_get_pre;
+ int HP_thread_prio_get_post;
+ int HP_thread_yield_pre;
+ int HP_thread_yield_post;
int HP_timer_gettick_pre;
int HP_timer_gettick_post;
int HP_timer_gettick_nocache_pre;
@@ -2784,6 +3002,7 @@ struct {
struct console_interface console;
struct core_interface core;
struct db_interface DB;
+ struct des_interface des;
struct geoip_interface geoip;
struct inter_auction_interface inter_auction;
struct inter_elemental_interface inter_elemental;
@@ -2798,11 +3017,13 @@ struct {
struct inter_storage_interface inter_storage;
struct libconfig_interface libconfig;
struct loginif_interface loginif;
- struct malloc_interface iMalloc;
struct mapif_interface mapif;
struct mapindex_interface mapindex;
+ struct md5_interface md5;
+ struct mutex_interface mutex;
struct nullpo_interface nullpo;
struct pincode_interface pincode;
+ struct rnd_interface rnd;
struct showmsg_interface showmsg;
struct socket_interface sockt;
struct sql_interface SQL;
@@ -2810,5 +3031,6 @@ struct {
struct strlib_interface strlib;
struct sv_interface sv;
struct sysinfo_interface sysinfo;
+ struct thread_interface thread;
struct timer_interface timer;
} source;
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
index 34a9e4005..639cdbdd2 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
@@ -1,7 +1,8 @@
/**
* This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -22,12 +23,14 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
struct HookingPointData HookingPoints[] = {
-/* HCache */
+/* HCache_interface */
{ HP_POP(HCache->init, HP_HCache_init) },
{ HP_POP(HCache->check, HP_HCache_check) },
{ HP_POP(HCache->open, HP_HCache_open) },
-/* chr */
+/* char_interface */
{ HP_POP(chr->waiting_disconnect, HP_chr_waiting_disconnect) },
{ HP_POP(chr->delete_char_sql, HP_chr_delete_char_sql) },
{ HP_POP(chr->create_online_char_data, HP_chr_create_online_char_data) },
@@ -44,7 +47,6 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(chr->create_charstatus, HP_chr_create_charstatus) },
{ HP_POP(chr->mmo_char_tosql, HP_chr_mmo_char_tosql) },
{ HP_POP(chr->memitemdata_to_sql, HP_chr_memitemdata_to_sql) },
- { HP_POP(chr->inventory_to_sql, HP_chr_inventory_to_sql) },
{ HP_POP(chr->mmo_gender, HP_chr_mmo_gender) },
{ HP_POP(chr->mmo_chars_fromsql, HP_chr_mmo_chars_fromsql) },
{ HP_POP(chr->mmo_char_fromsql, HP_chr_mmo_char_fromsql) },
@@ -185,23 +187,37 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(chr->online_data_cleanup_sub, HP_chr_online_data_cleanup_sub) },
{ HP_POP(chr->online_data_cleanup, HP_chr_online_data_cleanup) },
{ HP_POP(chr->sql_config_read, HP_chr_sql_config_read) },
- { HP_POP(chr->config_dispatch, HP_chr_config_dispatch) },
+ { HP_POP(chr->sql_config_read_registry, HP_chr_sql_config_read_registry) },
+ { HP_POP(chr->sql_config_read_pc, HP_chr_sql_config_read_pc) },
+ { HP_POP(chr->sql_config_read_guild, HP_chr_sql_config_read_guild) },
{ HP_POP(chr->config_read, HP_chr_config_read) },
-/* cmdline */
+ { HP_POP(chr->config_read_database, HP_chr_config_read_database) },
+ { HP_POP(chr->config_read_console, HP_chr_config_read_console) },
+ { HP_POP(chr->config_read_player_fame, HP_chr_config_read_player_fame) },
+ { HP_POP(chr->config_read_player_deletion, HP_chr_config_read_player_deletion) },
+ { HP_POP(chr->config_read_player_name, HP_chr_config_read_player_name) },
+ { HP_POP(chr->config_set_start_item, HP_chr_config_set_start_item) },
+ { HP_POP(chr->config_read_player_new, HP_chr_config_read_player_new) },
+ { HP_POP(chr->config_read_player, HP_chr_config_read_player) },
+ { HP_POP(chr->config_read_permission, HP_chr_config_read_permission) },
+ { HP_POP(chr->config_set_ip, HP_chr_config_set_ip) },
+ { HP_POP(chr->config_read_inter, HP_chr_config_read_inter) },
+ { HP_POP(chr->config_read_top, HP_chr_config_read_top) },
+/* cmdline_interface */
{ HP_POP(cmdline->init, HP_cmdline_init) },
{ HP_POP(cmdline->final, HP_cmdline_final) },
{ HP_POP(cmdline->arg_add, HP_cmdline_arg_add) },
{ HP_POP(cmdline->exec, HP_cmdline_exec) },
{ HP_POP(cmdline->arg_next_value, HP_cmdline_arg_next_value) },
{ HP_POP(cmdline->arg_source, HP_cmdline_arg_source) },
-/* console */
+/* console_interface */
{ HP_POP(console->init, HP_console_init) },
{ HP_POP(console->final, HP_console_final) },
{ HP_POP(console->display_title, HP_console_display_title) },
{ HP_POP(console->display_gplnotice, HP_console_display_gplnotice) },
-/* core */
+/* core_interface */
{ HP_POP(core->shutdown_callback, HP_core_shutdown_callback) },
-/* DB */
+/* db_interface */
{ HP_POP(DB->fix_options, HP_DB_fix_options) },
{ HP_POP(DB->default_cmp, HP_DB_default_cmp) },
{ HP_POP(DB->default_hash, HP_DB_default_hash) },
@@ -221,11 +237,14 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(DB->data2ptr, HP_DB_data2ptr) },
{ HP_POP(DB->init, HP_DB_init) },
{ HP_POP(DB->final, HP_DB_final) },
-/* geoip */
+/* des_interface */
+ { HP_POP(des->decrypt_block, HP_des_decrypt_block) },
+ { HP_POP(des->decrypt, HP_des_decrypt) },
+/* geoip_interface */
{ HP_POP(geoip->getcountry, HP_geoip_getcountry) },
{ HP_POP(geoip->final, HP_geoip_final) },
{ HP_POP(geoip->init, HP_geoip_init) },
-/* inter_auction */
+/* inter_auction_interface */
{ HP_POP(inter_auction->count, HP_inter_auction_count) },
{ HP_POP(inter_auction->save, HP_inter_auction_save) },
{ HP_POP(inter_auction->create, HP_inter_auction_create) },
@@ -235,11 +254,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_auction->parse_frommap, HP_inter_auction_parse_frommap) },
{ HP_POP(inter_auction->sql_init, HP_inter_auction_sql_init) },
{ HP_POP(inter_auction->sql_final, HP_inter_auction_sql_final) },
-/* inter_elemental */
+/* inter_elemental_interface */
{ HP_POP(inter_elemental->sql_init, HP_inter_elemental_sql_init) },
{ HP_POP(inter_elemental->sql_final, HP_inter_elemental_sql_final) },
{ HP_POP(inter_elemental->parse_frommap, HP_inter_elemental_parse_frommap) },
-/* inter_guild */
+/* inter_guild_interface */
{ HP_POP(inter_guild->save_timer, HP_inter_guild_save_timer) },
{ HP_POP(inter_guild->removemember_tosql, HP_inter_guild_removemember_tosql) },
{ HP_POP(inter_guild->tosql, HP_inter_guild_tosql) },
@@ -262,11 +281,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_guild->parse_frommap, HP_inter_guild_parse_frommap) },
{ HP_POP(inter_guild->leave, HP_inter_guild_leave) },
{ HP_POP(inter_guild->broken, HP_inter_guild_broken) },
-/* inter_homunculus */
+/* inter_homunculus_interface */
{ HP_POP(inter_homunculus->sql_init, HP_inter_homunculus_sql_init) },
{ HP_POP(inter_homunculus->sql_final, HP_inter_homunculus_sql_final) },
{ HP_POP(inter_homunculus->parse_frommap, HP_inter_homunculus_parse_frommap) },
-/* inter */
+/* inter_interface */
{ HP_POP(inter->msg_txt, HP_inter_msg_txt) },
{ HP_POP(inter->msg_config_read, HP_inter_msg_config_read) },
{ HP_POP(inter->do_final_msg, HP_inter_do_final_msg) },
@@ -274,7 +293,6 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter->vmsg_to_fd, HP_inter_vmsg_to_fd) },
{ HP_POP(inter->savereg, HP_inter_savereg) },
{ HP_POP(inter->accreg_fromsql, HP_inter_accreg_fromsql) },
- { HP_POP(inter->config_read, HP_inter_config_read) },
{ HP_POP(inter->vlog, HP_inter_vlog) },
{ HP_POP(inter->init_sql, HP_inter_init_sql) },
{ HP_POP(inter->mapif_init, HP_inter_mapif_init) },
@@ -283,7 +301,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter->check_length, HP_inter_check_length) },
{ HP_POP(inter->parse_frommap, HP_inter_parse_frommap) },
{ HP_POP(inter->final, HP_inter_final) },
-/* inter_mail */
+ { HP_POP(inter->config_read, HP_inter_config_read) },
+ { HP_POP(inter->config_read_log, HP_inter_config_read_log) },
+ { HP_POP(inter->config_read_connection, HP_inter_config_read_connection) },
+/* inter_mail_interface */
{ HP_POP(inter_mail->sql_init, HP_inter_mail_sql_init) },
{ HP_POP(inter_mail->sql_final, HP_inter_mail_sql_final) },
{ HP_POP(inter_mail->parse_frommap, HP_inter_mail_parse_frommap) },
@@ -292,14 +313,14 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_mail->loadmessage, HP_inter_mail_loadmessage) },
{ HP_POP(inter_mail->DeleteAttach, HP_inter_mail_DeleteAttach) },
{ HP_POP(inter_mail->sendmail, HP_inter_mail_sendmail) },
-/* inter_mercenary */
+/* inter_mercenary_interface */
{ HP_POP(inter_mercenary->owner_fromsql, HP_inter_mercenary_owner_fromsql) },
{ HP_POP(inter_mercenary->owner_tosql, HP_inter_mercenary_owner_tosql) },
{ HP_POP(inter_mercenary->owner_delete, HP_inter_mercenary_owner_delete) },
{ HP_POP(inter_mercenary->sql_init, HP_inter_mercenary_sql_init) },
{ HP_POP(inter_mercenary->sql_final, HP_inter_mercenary_sql_final) },
{ HP_POP(inter_mercenary->parse_frommap, HP_inter_mercenary_parse_frommap) },
-/* inter_party */
+/* inter_party_interface */
{ HP_POP(inter_party->check_lv, HP_inter_party_check_lv) },
{ HP_POP(inter_party->calc_state, HP_inter_party_calc_state) },
{ HP_POP(inter_party->tosql, HP_inter_party_tosql) },
@@ -313,16 +334,16 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_party->leave, HP_inter_party_leave) },
{ HP_POP(inter_party->CharOnline, HP_inter_party_CharOnline) },
{ HP_POP(inter_party->CharOffline, HP_inter_party_CharOffline) },
-/* inter_pet */
+/* inter_pet_interface */
{ HP_POP(inter_pet->tosql, HP_inter_pet_tosql) },
{ HP_POP(inter_pet->fromsql, HP_inter_pet_fromsql) },
{ HP_POP(inter_pet->sql_init, HP_inter_pet_sql_init) },
{ HP_POP(inter_pet->sql_final, HP_inter_pet_sql_final) },
{ HP_POP(inter_pet->delete_, HP_inter_pet_delete_) },
{ HP_POP(inter_pet->parse_frommap, HP_inter_pet_parse_frommap) },
-/* inter_quest */
+/* inter_quest_interface */
{ HP_POP(inter_quest->parse_frommap, HP_inter_quest_parse_frommap) },
-/* inter_storage */
+/* inter_storage_interface */
{ HP_POP(inter_storage->tosql, HP_inter_storage_tosql) },
{ HP_POP(inter_storage->fromsql, HP_inter_storage_fromsql) },
{ HP_POP(inter_storage->guild_storage_tosql, HP_inter_storage_guild_storage_tosql) },
@@ -332,11 +353,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(inter_storage->delete_, HP_inter_storage_delete_) },
{ HP_POP(inter_storage->guild_storage_delete, HP_inter_storage_guild_storage_delete) },
{ HP_POP(inter_storage->parse_frommap, HP_inter_storage_parse_frommap) },
-/* libconfig */
+/* libconfig_interface */
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
- { HP_POP(libconfig->set_auto_convert, HP_libconfig_set_auto_convert) },
- { HP_POP(libconfig->get_auto_convert, HP_libconfig_get_auto_convert) },
+ { HP_POP(libconfig->set_options, HP_libconfig_set_options) },
+ { HP_POP(libconfig->get_options, HP_libconfig_get_options) },
{ HP_POP(libconfig->read_string, HP_libconfig_read_string) },
{ HP_POP(libconfig->read_file_src, HP_libconfig_read_file_src) },
{ HP_POP(libconfig->write_file, HP_libconfig_write_file) },
@@ -349,6 +370,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libconfig->setting_get_float, HP_libconfig_setting_get_float) },
{ HP_POP(libconfig->setting_get_bool, HP_libconfig_setting_get_bool) },
{ HP_POP(libconfig->setting_get_string, HP_libconfig_setting_get_string) },
+ { HP_POP(libconfig->setting_lookup, HP_libconfig_setting_lookup) },
{ HP_POP(libconfig->setting_lookup_int, HP_libconfig_setting_lookup_int) },
{ HP_POP(libconfig->setting_lookup_int64, HP_libconfig_setting_lookup_int64) },
{ HP_POP(libconfig->setting_lookup_float, HP_libconfig_setting_lookup_float) },
@@ -380,18 +402,27 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libconfig->setting_remove_elem, HP_libconfig_setting_remove_elem) },
{ HP_POP(libconfig->setting_set_hook, HP_libconfig_setting_set_hook) },
{ HP_POP(libconfig->lookup, HP_libconfig_lookup) },
- { HP_POP(libconfig->lookup_from, HP_libconfig_lookup_from) },
{ HP_POP(libconfig->lookup_int, HP_libconfig_lookup_int) },
{ HP_POP(libconfig->lookup_int64, HP_libconfig_lookup_int64) },
{ HP_POP(libconfig->lookup_float, HP_libconfig_lookup_float) },
{ HP_POP(libconfig->lookup_bool, HP_libconfig_lookup_bool) },
{ HP_POP(libconfig->lookup_string, HP_libconfig_lookup_string) },
- { HP_POP(libconfig->read_file, HP_libconfig_read_file) },
+ { HP_POP(libconfig->load_file, HP_libconfig_load_file) },
{ HP_POP(libconfig->setting_copy_simple, HP_libconfig_setting_copy_simple) },
{ HP_POP(libconfig->setting_copy_elem, HP_libconfig_setting_copy_elem) },
{ HP_POP(libconfig->setting_copy_aggregate, HP_libconfig_setting_copy_aggregate) },
{ HP_POP(libconfig->setting_copy, HP_libconfig_setting_copy) },
-/* loginif */
+ { HP_POP(libconfig->setting_get_bool_real, HP_libconfig_setting_get_bool_real) },
+ { HP_POP(libconfig->setting_get_uint32, HP_libconfig_setting_get_uint32) },
+ { HP_POP(libconfig->setting_get_uint16, HP_libconfig_setting_get_uint16) },
+ { HP_POP(libconfig->setting_get_int16, HP_libconfig_setting_get_int16) },
+ { HP_POP(libconfig->setting_lookup_bool_real, HP_libconfig_setting_lookup_bool_real) },
+ { HP_POP(libconfig->setting_lookup_uint32, HP_libconfig_setting_lookup_uint32) },
+ { HP_POP(libconfig->setting_lookup_uint16, HP_libconfig_setting_lookup_uint16) },
+ { HP_POP(libconfig->setting_lookup_int16, HP_libconfig_setting_lookup_int16) },
+ { HP_POP(libconfig->setting_lookup_mutable_string, HP_libconfig_setting_lookup_mutable_string) },
+ { HP_POP(libconfig->lookup_mutable_string, HP_libconfig_lookup_mutable_string) },
+/* loginif_interface */
{ HP_POP(loginif->init, HP_loginif_init) },
{ HP_POP(loginif->final, HP_loginif_final) },
{ HP_POP(loginif->reset, HP_loginif_reset) },
@@ -405,21 +436,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(loginif->auth, HP_loginif_auth) },
{ HP_POP(loginif->send_users_count, HP_loginif_send_users_count) },
{ HP_POP(loginif->connect_to_server, HP_loginif_connect_to_server) },
-/* iMalloc */
- { HP_POP(iMalloc->init, HP_iMalloc_init) },
- { HP_POP(iMalloc->final, HP_iMalloc_final) },
- { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) },
- { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) },
- { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) },
- { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) },
- { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) },
- { HP_POP(iMalloc->free, HP_iMalloc_free) },
- { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) },
- { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) },
- { HP_POP(iMalloc->usage, HP_iMalloc_usage) },
- { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) },
- { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) },
-/* mapif */
+/* mapif_interface */
{ HP_POP(mapif->ban, HP_mapif_ban) },
{ HP_POP(mapif->server_init, HP_mapif_server_init) },
{ HP_POP(mapif->server_destroy, HP_mapif_server_destroy) },
@@ -442,6 +459,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->parse_auction_close, HP_mapif_parse_auction_close) },
{ HP_POP(mapif->auction_bid, HP_mapif_auction_bid) },
{ HP_POP(mapif->parse_auction_bid, HP_mapif_parse_auction_bid) },
+ { HP_POP(mapif->elemental_create, HP_mapif_elemental_create) },
{ HP_POP(mapif->elemental_save, HP_mapif_elemental_save) },
{ HP_POP(mapif->elemental_load, HP_mapif_elemental_load) },
{ HP_POP(mapif->elemental_delete, HP_mapif_elemental_delete) },
@@ -492,6 +510,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->homunculus_loaded, HP_mapif_homunculus_loaded) },
{ HP_POP(mapif->homunculus_saved, HP_mapif_homunculus_saved) },
{ HP_POP(mapif->homunculus_renamed, HP_mapif_homunculus_renamed) },
+ { HP_POP(mapif->homunculus_create, HP_mapif_homunculus_create) },
{ HP_POP(mapif->homunculus_save, HP_mapif_homunculus_save) },
{ HP_POP(mapif->homunculus_load, HP_mapif_homunculus_load) },
{ HP_POP(mapif->homunculus_delete, HP_mapif_homunculus_delete) },
@@ -514,6 +533,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->parse_mail_return, HP_mapif_parse_mail_return) },
{ HP_POP(mapif->mail_send, HP_mapif_mail_send) },
{ HP_POP(mapif->parse_mail_send, HP_mapif_parse_mail_send) },
+ { HP_POP(mapif->mercenary_create, HP_mapif_mercenary_create) },
{ HP_POP(mapif->mercenary_save, HP_mapif_mercenary_save) },
{ HP_POP(mapif->mercenary_load, HP_mapif_mercenary_load) },
{ HP_POP(mapif->mercenary_delete, HP_mapif_mercenary_delete) },
@@ -567,6 +587,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->save_guild_storage_ack, HP_mapif_save_guild_storage_ack) },
{ HP_POP(mapif->parse_LoadGuildStorage, HP_mapif_parse_LoadGuildStorage) },
{ HP_POP(mapif->parse_SaveGuildStorage, HP_mapif_parse_SaveGuildStorage) },
+ { HP_POP(mapif->account_storage_load, HP_mapif_account_storage_load) },
+ { HP_POP(mapif->pAccountStorageLoad, HP_mapif_pAccountStorageLoad) },
+ { HP_POP(mapif->pAccountStorageSave, HP_mapif_pAccountStorageSave) },
+ { HP_POP(mapif->sAccountStorageSaveAck, HP_mapif_sAccountStorageSaveAck) },
{ HP_POP(mapif->itembound_ack, HP_mapif_itembound_ack) },
{ HP_POP(mapif->parse_ItemBoundRetrieve_sub, HP_mapif_parse_ItemBoundRetrieve_sub) },
{ HP_POP(mapif->parse_ItemBoundRetrieve, HP_mapif_parse_ItemBoundRetrieve) },
@@ -586,7 +610,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapif->parse_RegistryRequest, HP_mapif_parse_RegistryRequest) },
{ HP_POP(mapif->namechange_ack, HP_mapif_namechange_ack) },
{ HP_POP(mapif->parse_NameChangeRequest, HP_mapif_parse_NameChangeRequest) },
-/* mapindex */
+/* mapindex_interface */
{ HP_POP(mapindex->init, HP_mapindex_init) },
{ HP_POP(mapindex->final, HP_mapindex_final) },
{ HP_POP(mapindex->addmap, HP_mapindex_addmap) },
@@ -596,9 +620,24 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapindex->name2id, HP_mapindex_name2id) },
{ HP_POP(mapindex->id2name, HP_mapindex_id2name) },
{ HP_POP(mapindex->check_default, HP_mapindex_check_default) },
-/* nullpo */
+/* md5_interface */
+ { HP_POP(md5->string, HP_md5_string) },
+ { HP_POP(md5->binary, HP_md5_binary) },
+ { HP_POP(md5->salt, HP_md5_salt) },
+/* mutex_interface */
+ { HP_POP(mutex->create, HP_mutex_create) },
+ { HP_POP(mutex->destroy, HP_mutex_destroy) },
+ { HP_POP(mutex->lock, HP_mutex_lock) },
+ { HP_POP(mutex->trylock, HP_mutex_trylock) },
+ { HP_POP(mutex->unlock, HP_mutex_unlock) },
+ { HP_POP(mutex->cond_create, HP_mutex_cond_create) },
+ { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) },
+ { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) },
+ { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) },
+ { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
+/* nullpo_interface */
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
-/* pincode */
+/* pincode_interface */
{ HP_POP(pincode->handle, HP_pincode_handle) },
{ HP_POP(pincode->decrypt, HP_pincode_decrypt) },
{ HP_POP(pincode->error, HP_pincode_error) },
@@ -609,12 +648,21 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pincode->compare, HP_pincode_compare) },
{ HP_POP(pincode->check, HP_pincode_check) },
{ HP_POP(pincode->config_read, HP_pincode_config_read) },
-/* showmsg */
+/* rnd_interface */
+ { HP_POP(rnd->init, HP_rnd_init) },
+ { HP_POP(rnd->final, HP_rnd_final) },
+ { HP_POP(rnd->seed, HP_rnd_seed) },
+ { HP_POP(rnd->random, HP_rnd_random) },
+ { HP_POP(rnd->roll, HP_rnd_roll) },
+ { HP_POP(rnd->value, HP_rnd_value) },
+ { HP_POP(rnd->uniform, HP_rnd_uniform) },
+ { HP_POP(rnd->uniform53, HP_rnd_uniform53) },
+/* showmsg_interface */
{ HP_POP(showmsg->init, HP_showmsg_init) },
{ HP_POP(showmsg->final, HP_showmsg_final) },
{ HP_POP(showmsg->clearScreen, HP_showmsg_clearScreen) },
{ HP_POP(showmsg->showMessageV, HP_showmsg_showMessageV) },
-/* sockt */
+/* socket_interface */
{ HP_POP(sockt->init, HP_sockt_init) },
{ HP_POP(sockt->final, HP_sockt_final) },
{ HP_POP(sockt->perform, HP_sockt_perform) },
@@ -643,7 +691,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sockt->trusted_ip_check, HP_sockt_trusted_ip_check) },
{ HP_POP(sockt->net_config_read_sub, HP_sockt_net_config_read_sub) },
{ HP_POP(sockt->net_config_read, HP_sockt_net_config_read) },
-/* SQL */
+/* sql_interface */
{ HP_POP(SQL->Connect, HP_SQL_Connect) },
{ HP_POP(SQL->GetTimeout, HP_SQL_GetTimeout) },
{ HP_POP(SQL->GetColumnNames, HP_SQL_GetColumnNames) },
@@ -676,7 +724,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(SQL->StmtFreeResult, HP_SQL_StmtFreeResult) },
{ HP_POP(SQL->StmtFree, HP_SQL_StmtFree) },
{ HP_POP(SQL->StmtShowDebug_, HP_SQL_StmtShowDebug_) },
-/* StrBuf */
+/* stringbuf_interface */
{ HP_POP(StrBuf->Malloc, HP_StrBuf_Malloc) },
{ HP_POP(StrBuf->Init, HP_StrBuf_Init) },
{ HP_POP(StrBuf->Vprintf, HP_StrBuf_Vprintf) },
@@ -687,7 +735,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(StrBuf->Clear, HP_StrBuf_Clear) },
{ HP_POP(StrBuf->Destroy, HP_StrBuf_Destroy) },
{ HP_POP(StrBuf->Free, HP_StrBuf_Free) },
-/* strlib */
+/* strlib_interface */
{ HP_POP(strlib->jstrescape, HP_strlib_jstrescape) },
{ HP_POP(strlib->jstrescapecpy, HP_strlib_jstrescapecpy) },
{ HP_POP(strlib->jmemescapecpy, HP_strlib_jmemescapecpy) },
@@ -703,7 +751,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(strlib->safestrnlen_, HP_strlib_safestrnlen_) },
{ HP_POP(strlib->strline_, HP_strlib_strline_) },
{ HP_POP(strlib->bin2hex_, HP_strlib_bin2hex_) },
-/* sv */
+/* sv_interface */
{ HP_POP(sv->parse_next, HP_sv_parse_next) },
{ HP_POP(sv->parse, HP_sv_parse) },
{ HP_POP(sv->split, HP_sv_split) },
@@ -711,7 +759,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sv->unescape_c, HP_sv_unescape_c) },
{ HP_POP(sv->skip_escaped_c, HP_sv_skip_escaped_c) },
{ HP_POP(sv->readdb, HP_sv_readdb) },
-/* sysinfo */
+/* sysinfo_interface */
{ HP_POP(sysinfo->getpagesize, HP_sysinfo_getpagesize) },
{ HP_POP(sysinfo->platform, HP_sysinfo_platform) },
{ HP_POP(sysinfo->osversion, HP_sysinfo_osversion) },
@@ -721,6 +769,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sysinfo->is64bit, HP_sysinfo_is64bit) },
{ HP_POP(sysinfo->compiler, HP_sysinfo_compiler) },
{ HP_POP(sysinfo->cflags, HP_sysinfo_cflags) },
+ { HP_POP(sysinfo->time, HP_sysinfo_time) },
{ HP_POP(sysinfo->vcstype, HP_sysinfo_vcstype) },
{ HP_POP(sysinfo->vcstypeid, HP_sysinfo_vcstypeid) },
{ HP_POP(sysinfo->vcsrevision_src, HP_sysinfo_vcsrevision_src) },
@@ -729,7 +778,19 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) },
{ HP_POP(sysinfo->init, HP_sysinfo_init) },
{ HP_POP(sysinfo->final, HP_sysinfo_final) },
-/* timer */
+/* thread_interface */
+ { HP_POP(thread->init, HP_thread_init) },
+ { HP_POP(thread->final, HP_thread_final) },
+ { HP_POP(thread->create, HP_thread_create) },
+ { HP_POP(thread->create_opt, HP_thread_create_opt) },
+ { HP_POP(thread->destroy, HP_thread_destroy) },
+ { HP_POP(thread->self, HP_thread_self) },
+ { HP_POP(thread->get_tid, HP_thread_get_tid) },
+ { HP_POP(thread->wait, HP_thread_wait) },
+ { HP_POP(thread->prio_set, HP_thread_prio_set) },
+ { HP_POP(thread->prio_get, HP_thread_prio_get) },
+ { HP_POP(thread->yield, HP_thread_yield) },
+/* timer_interface */
{ HP_POP(timer->gettick, HP_timer_gettick) },
{ HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) },
{ HP_POP(timer->add, HP_timer_add) },
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index b1554aefd..96e068903 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,17 +23,19 @@
* as it will get overwritten.
*/
-/* HCache */
+/* GENERATED FILE DO NOT EDIT */
+
+/* HCache_interface */
void HP_HCache_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_HCache_init_pre ) {
+ if (HPMHooks.count.HP_HCache_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41,9 +43,9 @@ void HP_HCache_init(void) {
{
HPMHooks.source.HCache.init();
}
- if( HPMHooks.count.HP_HCache_init_post ) {
+ if (HPMHooks.count.HP_HCache_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_init_post[hIndex].func;
postHookFunc();
}
@@ -53,14 +55,14 @@ void HP_HCache_init(void) {
bool HP_HCache_check(const char *file) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_HCache_check_pre ) {
- bool (*preHookFunc) (const char *file);
+ if (HPMHooks.count.HP_HCache_check_pre > 0) {
+ bool (*preHookFunc) (const char **file);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_check_pre[hIndex].func;
- retVal___ = preHookFunc(file);
+ retVal___ = preHookFunc(&file);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68,9 +70,9 @@ bool HP_HCache_check(const char *file) {
{
retVal___ = HPMHooks.source.HCache.check(file);
}
- if( HPMHooks.count.HP_HCache_check_post ) {
+ if (HPMHooks.count.HP_HCache_check_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *file);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_check_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file);
}
@@ -80,14 +82,14 @@ bool HP_HCache_check(const char *file) {
FILE* HP_HCache_open(const char *file, const char *opt) {
int hIndex = 0;
FILE* retVal___ = NULL;
- if( HPMHooks.count.HP_HCache_open_pre ) {
- FILE* (*preHookFunc) (const char *file, const char *opt);
+ if (HPMHooks.count.HP_HCache_open_pre > 0) {
+ FILE* (*preHookFunc) (const char **file, const char **opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_open_pre[hIndex].func;
- retVal___ = preHookFunc(file, opt);
+ retVal___ = preHookFunc(&file, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -95,27 +97,27 @@ FILE* HP_HCache_open(const char *file, const char *opt) {
{
retVal___ = HPMHooks.source.HCache.open(file, opt);
}
- if( HPMHooks.count.HP_HCache_open_post ) {
+ if (HPMHooks.count.HP_HCache_open_post > 0) {
FILE* (*postHookFunc) (FILE* retVal___, const char *file, const char *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file, opt);
}
}
return retVal___;
}
-/* chr */
+/* char_interface */
int HP_chr_waiting_disconnect(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_waiting_disconnect_pre ) {
+ if (HPMHooks.count.HP_chr_waiting_disconnect_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_waiting_disconnect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_waiting_disconnect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_waiting_disconnect_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -123,11 +125,11 @@ int HP_chr_waiting_disconnect(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.chr.waiting_disconnect(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chr_waiting_disconnect_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_waiting_disconnect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_waiting_disconnect_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_waiting_disconnect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_waiting_disconnect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -135,14 +137,14 @@ int HP_chr_waiting_disconnect(int tid, int64 tick, int id, intptr_t data) {
int HP_chr_delete_char_sql(int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_delete_char_sql_pre ) {
+ if (HPMHooks.count.HP_chr_delete_char_sql_pre > 0) {
int (*preHookFunc) (int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete_char_sql_pre[hIndex].func;
retVal___ = preHookFunc(&char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -150,29 +152,28 @@ int HP_chr_delete_char_sql(int char_id) {
{
retVal___ = HPMHooks.source.chr.delete_char_sql(char_id);
}
- if( HPMHooks.count.HP_chr_delete_char_sql_post ) {
- int (*postHookFunc) (int retVal___, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_sql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete_char_sql_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete_char_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id);
+ retVal___ = postHookFunc(retVal___, char_id);
}
}
return retVal___;
}
-DBData HP_chr_create_online_char_data(DBKey key, va_list args) {
+struct DBData HP_chr_create_online_char_data(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_chr_create_online_char_data_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_chr_create_online_char_data_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_online_char_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_online_char_data_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_chr_create_online_char_data_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -182,12 +183,12 @@ DBData HP_chr_create_online_char_data(DBKey key, va_list args) {
retVal___ = HPMHooks.source.chr.create_online_char_data(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_chr_create_online_char_data_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_online_char_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_create_online_char_data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_online_char_data_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_chr_create_online_char_data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
@@ -195,14 +196,14 @@ DBData HP_chr_create_online_char_data(DBKey key, va_list args) {
}
void HP_chr_set_account_online(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_account_online_pre ) {
+ if (HPMHooks.count.HP_chr_set_account_online_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_online_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_online_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_account_online_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -210,25 +211,25 @@ void HP_chr_set_account_online(int account_id) {
{
HPMHooks.source.chr.set_account_online(account_id);
}
- if( HPMHooks.count.HP_chr_set_account_online_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_online_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_set_account_online_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_online_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_account_online_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
void HP_chr_set_account_offline(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_account_offline_pre ) {
+ if (HPMHooks.count.HP_chr_set_account_offline_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_account_offline_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -236,25 +237,25 @@ void HP_chr_set_account_offline(int account_id) {
{
HPMHooks.source.chr.set_account_offline(account_id);
}
- if( HPMHooks.count.HP_chr_set_account_offline_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_set_account_offline_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_account_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_account_offline_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
void HP_chr_set_char_charselect(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_char_charselect_pre ) {
+ if (HPMHooks.count.HP_chr_set_char_charselect_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_charselect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_charselect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_char_charselect_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -262,25 +263,25 @@ void HP_chr_set_char_charselect(int account_id) {
{
HPMHooks.source.chr.set_char_charselect(account_id);
}
- if( HPMHooks.count.HP_chr_set_char_charselect_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_charselect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_set_char_charselect_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_charselect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_char_charselect_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
void HP_chr_set_char_online(int map_id, int char_id, int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_char_online_pre ) {
+ if (HPMHooks.count.HP_chr_set_char_online_pre > 0) {
void (*preHookFunc) (int *map_id, int *char_id, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_online_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_online_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_char_online_pre[hIndex].func;
preHookFunc(&map_id, &char_id, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -288,25 +289,25 @@ void HP_chr_set_char_online(int map_id, int char_id, int account_id) {
{
HPMHooks.source.chr.set_char_online(map_id, char_id, account_id);
}
- if( HPMHooks.count.HP_chr_set_char_online_post ) {
- void (*postHookFunc) (int *map_id, int *char_id, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_online_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_set_char_online_post > 0) {
+ void (*postHookFunc) (int map_id, int char_id, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_online_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_char_online_post[hIndex].func;
- postHookFunc(&map_id, &char_id, &account_id);
+ postHookFunc(map_id, char_id, account_id);
}
}
return;
}
void HP_chr_set_char_offline(int char_id, int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_char_offline_pre ) {
+ if (HPMHooks.count.HP_chr_set_char_offline_pre > 0) {
void (*preHookFunc) (int *char_id, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_char_offline_pre[hIndex].func;
preHookFunc(&char_id, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -314,28 +315,28 @@ void HP_chr_set_char_offline(int char_id, int account_id) {
{
HPMHooks.source.chr.set_char_offline(char_id, account_id);
}
- if( HPMHooks.count.HP_chr_set_char_offline_post ) {
- void (*postHookFunc) (int *char_id, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_set_char_offline_post > 0) {
+ void (*postHookFunc) (int char_id, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_char_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_char_offline_post[hIndex].func;
- postHookFunc(&char_id, &account_id);
+ postHookFunc(char_id, account_id);
}
}
return;
}
-int HP_chr_db_setoffline(DBKey key, DBData *data, va_list ap) {
+int HP_chr_db_setoffline(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_db_setoffline_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chr_db_setoffline_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_setoffline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_setoffline_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chr_db_setoffline_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -345,30 +346,30 @@ int HP_chr_db_setoffline(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chr.db_setoffline(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chr_db_setoffline_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_setoffline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_db_setoffline_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_setoffline_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chr_db_setoffline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_chr_db_kickoffline(DBKey key, DBData *data, va_list ap) {
+int HP_chr_db_kickoffline(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_db_kickoffline_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chr_db_kickoffline_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_kickoffline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_kickoffline_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chr_db_kickoffline_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -378,12 +379,12 @@ int HP_chr_db_kickoffline(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chr.db_kickoffline(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chr_db_kickoffline_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_kickoffline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_db_kickoffline_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_db_kickoffline_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chr_db_kickoffline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -391,14 +392,14 @@ int HP_chr_db_kickoffline(DBKey key, DBData *data, va_list ap) {
}
void HP_chr_set_login_all_offline(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_login_all_offline_pre ) {
+ if (HPMHooks.count.HP_chr_set_login_all_offline_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_login_all_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_login_all_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_login_all_offline_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -406,9 +407,9 @@ void HP_chr_set_login_all_offline(void) {
{
HPMHooks.source.chr.set_login_all_offline();
}
- if( HPMHooks.count.HP_chr_set_login_all_offline_post ) {
+ if (HPMHooks.count.HP_chr_set_login_all_offline_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_login_all_offline_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_login_all_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_login_all_offline_post[hIndex].func;
postHookFunc();
}
@@ -417,14 +418,14 @@ void HP_chr_set_login_all_offline(void) {
}
void HP_chr_set_all_offline(int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_all_offline_pre ) {
+ if (HPMHooks.count.HP_chr_set_all_offline_pre > 0) {
void (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_all_offline_pre[hIndex].func;
preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -432,25 +433,25 @@ void HP_chr_set_all_offline(int id) {
{
HPMHooks.source.chr.set_all_offline(id);
}
- if( HPMHooks.count.HP_chr_set_all_offline_post ) {
- void (*postHookFunc) (int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_set_all_offline_post > 0) {
+ void (*postHookFunc) (int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_all_offline_post[hIndex].func;
- postHookFunc(&id);
+ postHookFunc(id);
}
}
return;
}
void HP_chr_set_all_offline_sql(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_set_all_offline_sql_pre ) {
+ if (HPMHooks.count.HP_chr_set_all_offline_sql_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_set_all_offline_sql_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -458,29 +459,28 @@ void HP_chr_set_all_offline_sql(void) {
{
HPMHooks.source.chr.set_all_offline_sql();
}
- if( HPMHooks.count.HP_chr_set_all_offline_sql_post ) {
+ if (HPMHooks.count.HP_chr_set_all_offline_sql_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_sql_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_set_all_offline_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_set_all_offline_sql_post[hIndex].func;
postHookFunc();
}
}
return;
}
-DBData HP_chr_create_charstatus(DBKey key, va_list args) {
+struct DBData HP_chr_create_charstatus(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_chr_create_charstatus_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_chr_create_charstatus_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_charstatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_charstatus_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_chr_create_charstatus_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -490,12 +490,12 @@ DBData HP_chr_create_charstatus(DBKey key, va_list args) {
retVal___ = HPMHooks.source.chr.create_charstatus(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_chr_create_charstatus_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_charstatus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_create_charstatus_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_create_charstatus_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_chr_create_charstatus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
@@ -504,14 +504,14 @@ DBData HP_chr_create_charstatus(DBKey key, va_list args) {
int HP_chr_mmo_char_tosql(int char_id, struct mmo_charstatus *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_char_tosql_pre ) {
- int (*preHookFunc) (int *char_id, struct mmo_charstatus *p);
+ if (HPMHooks.count.HP_chr_mmo_char_tosql_pre > 0) {
+ int (*preHookFunc) (int *char_id, struct mmo_charstatus **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, p);
+ retVal___ = preHookFunc(&char_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -519,11 +519,11 @@ int HP_chr_mmo_char_tosql(int char_id, struct mmo_charstatus *p) {
{
retVal___ = HPMHooks.source.chr.mmo_char_tosql(char_id, p);
}
- if( HPMHooks.count.HP_chr_mmo_char_tosql_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, struct mmo_charstatus *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_char_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, struct mmo_charstatus *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, p);
+ retVal___ = postHookFunc(retVal___, char_id, p);
}
}
return retVal___;
@@ -531,14 +531,14 @@ int HP_chr_mmo_char_tosql(int char_id, struct mmo_charstatus *p) {
int HP_chr_memitemdata_to_sql(const struct item items[], int max, int id, int tableswitch) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_memitemdata_to_sql_pre ) {
+ if (HPMHooks.count.HP_chr_memitemdata_to_sql_pre > 0) {
int (*preHookFunc) (const struct item *items[], int *max, int *id, int *tableswitch);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_memitemdata_to_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_memitemdata_to_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_memitemdata_to_sql_pre[hIndex].func;
retVal___ = preHookFunc(&items, &max, &id, &tableswitch);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -546,38 +546,11 @@ int HP_chr_memitemdata_to_sql(const struct item items[], int max, int id, int ta
{
retVal___ = HPMHooks.source.chr.memitemdata_to_sql(items, max, id, tableswitch);
}
- if( HPMHooks.count.HP_chr_memitemdata_to_sql_post ) {
- int (*postHookFunc) (int retVal___, const struct item *items[], int *max, int *id, int *tableswitch);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_memitemdata_to_sql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_memitemdata_to_sql_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct item items[], int max, int id, int tableswitch);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_memitemdata_to_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_memitemdata_to_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &items, &max, &id, &tableswitch);
- }
- }
- return retVal___;
-}
-int HP_chr_inventory_to_sql(const struct item items[], int max, int id) {
- int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_chr_inventory_to_sql_pre ) {
- int (*preHookFunc) (const struct item *items[], int *max, int *id);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_inventory_to_sql_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_chr_inventory_to_sql_pre[hIndex].func;
- retVal___ = preHookFunc(&items, &max, &id);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.chr.inventory_to_sql(items, max, id);
- }
- if( HPMHooks.count.HP_chr_inventory_to_sql_post ) {
- int (*postHookFunc) (int retVal___, const struct item *items[], int *max, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_inventory_to_sql_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_chr_inventory_to_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &items, &max, &id);
+ retVal___ = postHookFunc(retVal___, items, max, id, tableswitch);
}
}
return retVal___;
@@ -585,14 +558,14 @@ int HP_chr_inventory_to_sql(const struct item items[], int max, int id) {
int HP_chr_mmo_gender(const struct char_session_data *sd, const struct mmo_charstatus *p, char sex) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_gender_pre ) {
- int (*preHookFunc) (const struct char_session_data *sd, const struct mmo_charstatus *p, char *sex);
+ if (HPMHooks.count.HP_chr_mmo_gender_pre > 0) {
+ int (*preHookFunc) (const struct char_session_data **sd, const struct mmo_charstatus **p, char *sex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_gender_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_gender_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_gender_pre[hIndex].func;
- retVal___ = preHookFunc(sd, p, &sex);
+ retVal___ = preHookFunc(&sd, &p, &sex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -600,11 +573,11 @@ int HP_chr_mmo_gender(const struct char_session_data *sd, const struct mmo_chars
{
retVal___ = HPMHooks.source.chr.mmo_gender(sd, p, sex);
}
- if( HPMHooks.count.HP_chr_mmo_gender_post ) {
- int (*postHookFunc) (int retVal___, const struct char_session_data *sd, const struct mmo_charstatus *p, char *sex);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_gender_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_gender_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct char_session_data *sd, const struct mmo_charstatus *p, char sex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_gender_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_gender_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, p, &sex);
+ retVal___ = postHookFunc(retVal___, sd, p, sex);
}
}
return retVal___;
@@ -612,14 +585,14 @@ int HP_chr_mmo_gender(const struct char_session_data *sd, const struct mmo_chars
int HP_chr_mmo_chars_fromsql(struct char_session_data *sd, uint8 *buf) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_chars_fromsql_pre ) {
- int (*preHookFunc) (struct char_session_data *sd, uint8 *buf);
+ if (HPMHooks.count.HP_chr_mmo_chars_fromsql_pre > 0) {
+ int (*preHookFunc) (struct char_session_data **sd, uint8 **buf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_chars_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_chars_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_chars_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(sd, buf);
+ retVal___ = preHookFunc(&sd, &buf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -627,9 +600,9 @@ int HP_chr_mmo_chars_fromsql(struct char_session_data *sd, uint8 *buf) {
{
retVal___ = HPMHooks.source.chr.mmo_chars_fromsql(sd, buf);
}
- if( HPMHooks.count.HP_chr_mmo_chars_fromsql_post ) {
+ if (HPMHooks.count.HP_chr_mmo_chars_fromsql_post > 0) {
int (*postHookFunc) (int retVal___, struct char_session_data *sd, uint8 *buf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_chars_fromsql_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_chars_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_chars_fromsql_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, buf);
}
@@ -639,14 +612,14 @@ int HP_chr_mmo_chars_fromsql(struct char_session_data *sd, uint8 *buf) {
int HP_chr_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool load_everything) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_char_fromsql_pre ) {
- int (*preHookFunc) (int *char_id, struct mmo_charstatus *p, bool *load_everything);
+ if (HPMHooks.count.HP_chr_mmo_char_fromsql_pre > 0) {
+ int (*preHookFunc) (int *char_id, struct mmo_charstatus **p, bool *load_everything);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, p, &load_everything);
+ retVal___ = preHookFunc(&char_id, &p, &load_everything);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -654,11 +627,11 @@ int HP_chr_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool load_eve
{
retVal___ = HPMHooks.source.chr.mmo_char_fromsql(char_id, p, load_everything);
}
- if( HPMHooks.count.HP_chr_mmo_char_fromsql_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, struct mmo_charstatus *p, bool *load_everything);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_char_fromsql_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, struct mmo_charstatus *p, bool load_everything);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, p, &load_everything);
+ retVal___ = postHookFunc(retVal___, char_id, p, load_everything);
}
}
return retVal___;
@@ -666,14 +639,14 @@ int HP_chr_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool load_eve
int HP_chr_mmo_char_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_char_sql_init_pre ) {
+ if (HPMHooks.count.HP_chr_mmo_char_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -681,9 +654,9 @@ int HP_chr_mmo_char_sql_init(void) {
{
retVal___ = HPMHooks.source.chr.mmo_char_sql_init();
}
- if( HPMHooks.count.HP_chr_mmo_char_sql_init_post ) {
+ if (HPMHooks.count.HP_chr_mmo_char_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -693,14 +666,14 @@ int HP_chr_mmo_char_sql_init(void) {
bool HP_chr_char_slotchange(struct char_session_data *sd, int fd, unsigned short from, unsigned short to) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chr_char_slotchange_pre ) {
- bool (*preHookFunc) (struct char_session_data *sd, int *fd, unsigned short *from, unsigned short *to);
+ if (HPMHooks.count.HP_chr_char_slotchange_pre > 0) {
+ bool (*preHookFunc) (struct char_session_data **sd, int *fd, unsigned short *from, unsigned short *to);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_slotchange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_slotchange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_char_slotchange_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &fd, &from, &to);
+ retVal___ = preHookFunc(&sd, &fd, &from, &to);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -708,11 +681,11 @@ bool HP_chr_char_slotchange(struct char_session_data *sd, int fd, unsigned short
{
retVal___ = HPMHooks.source.chr.char_slotchange(sd, fd, from, to);
}
- if( HPMHooks.count.HP_chr_char_slotchange_post ) {
- bool (*postHookFunc) (bool retVal___, struct char_session_data *sd, int *fd, unsigned short *from, unsigned short *to);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_slotchange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_char_slotchange_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct char_session_data *sd, int fd, unsigned short from, unsigned short to);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_slotchange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_char_slotchange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &fd, &from, &to);
+ retVal___ = postHookFunc(retVal___, sd, fd, from, to);
}
}
return retVal___;
@@ -720,14 +693,14 @@ bool HP_chr_char_slotchange(struct char_session_data *sd, int fd, unsigned short
int HP_chr_rename_char_sql(struct char_session_data *sd, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_rename_char_sql_pre ) {
- int (*preHookFunc) (struct char_session_data *sd, int *char_id);
+ if (HPMHooks.count.HP_chr_rename_char_sql_pre > 0) {
+ int (*preHookFunc) (struct char_session_data **sd, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_rename_char_sql_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &char_id);
+ retVal___ = preHookFunc(&sd, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -735,11 +708,11 @@ int HP_chr_rename_char_sql(struct char_session_data *sd, int char_id) {
{
retVal___ = HPMHooks.source.chr.rename_char_sql(sd, char_id);
}
- if( HPMHooks.count.HP_chr_rename_char_sql_post ) {
- int (*postHookFunc) (int retVal___, struct char_session_data *sd, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_sql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_rename_char_sql_post > 0) {
+ int (*postHookFunc) (int retVal___, struct char_session_data *sd, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_rename_char_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &char_id);
+ retVal___ = postHookFunc(retVal___, sd, char_id);
}
}
return retVal___;
@@ -747,14 +720,14 @@ int HP_chr_rename_char_sql(struct char_session_data *sd, int char_id) {
int HP_chr_check_char_name(char *name, char *esc_name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_check_char_name_pre ) {
- int (*preHookFunc) (char *name, char *esc_name);
+ if (HPMHooks.count.HP_chr_check_char_name_pre > 0) {
+ int (*preHookFunc) (char **name, char **esc_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_char_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_char_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_check_char_name_pre[hIndex].func;
- retVal___ = preHookFunc(name, esc_name);
+ retVal___ = preHookFunc(&name, &esc_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -762,38 +735,38 @@ int HP_chr_check_char_name(char *name, char *esc_name) {
{
retVal___ = HPMHooks.source.chr.check_char_name(name, esc_name);
}
- if( HPMHooks.count.HP_chr_check_char_name_post ) {
+ if (HPMHooks.count.HP_chr_check_char_name_post > 0) {
int (*postHookFunc) (int retVal___, char *name, char *esc_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_char_name_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_char_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_check_char_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name, esc_name);
}
}
return retVal___;
}
-int HP_chr_make_new_char_sql(struct char_session_data *sd, char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style) {
+int HP_chr_make_new_char_sql(struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_make_new_char_sql_pre ) {
- int (*preHookFunc) (struct char_session_data *sd, char *name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style);
+ if (HPMHooks.count.HP_chr_make_new_char_sql_pre > 0) {
+ int (*preHookFunc) (struct char_session_data **sd, const char **name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style, short *starting_job, uint8 *sex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_make_new_char_sql_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style);
+ retVal___ = preHookFunc(&sd, &name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style, &starting_job, &sex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.chr.make_new_char_sql(sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style);
+ retVal___ = HPMHooks.source.chr.make_new_char_sql(sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job, sex);
}
- if( HPMHooks.count.HP_chr_make_new_char_sql_post ) {
- int (*postHookFunc) (int retVal___, struct char_session_data *sd, char *name_, int *str, int *agi, int *vit, int *int_, int *dex, int *luk, int *slot, int *hair_color, int *hair_style);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_make_new_char_sql_post > 0) {
+ int (*postHookFunc) (int retVal___, struct char_session_data *sd, const char *name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style, short starting_job, uint8 sex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_make_new_char_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_make_new_char_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, name_, &str, &agi, &vit, &int_, &dex, &luk, &slot, &hair_color, &hair_style);
+ retVal___ = postHookFunc(retVal___, sd, name_, str, agi, vit, int_, dex, luk, slot, hair_color, hair_style, starting_job, sex);
}
}
return retVal___;
@@ -801,14 +774,14 @@ int HP_chr_make_new_char_sql(struct char_session_data *sd, char *name_, int str,
int HP_chr_divorce_char_sql(int partner_id1, int partner_id2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_divorce_char_sql_pre ) {
+ if (HPMHooks.count.HP_chr_divorce_char_sql_pre > 0) {
int (*preHookFunc) (int *partner_id1, int *partner_id2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_divorce_char_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_divorce_char_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_divorce_char_sql_pre[hIndex].func;
retVal___ = preHookFunc(&partner_id1, &partner_id2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -816,11 +789,11 @@ int HP_chr_divorce_char_sql(int partner_id1, int partner_id2) {
{
retVal___ = HPMHooks.source.chr.divorce_char_sql(partner_id1, partner_id2);
}
- if( HPMHooks.count.HP_chr_divorce_char_sql_post ) {
- int (*postHookFunc) (int retVal___, int *partner_id1, int *partner_id2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_divorce_char_sql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_divorce_char_sql_post > 0) {
+ int (*postHookFunc) (int retVal___, int partner_id1, int partner_id2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_divorce_char_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_divorce_char_sql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &partner_id1, &partner_id2);
+ retVal___ = postHookFunc(retVal___, partner_id1, partner_id2);
}
}
return retVal___;
@@ -828,14 +801,14 @@ int HP_chr_divorce_char_sql(int partner_id1, int partner_id2) {
int HP_chr_count_users(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_count_users_pre ) {
+ if (HPMHooks.count.HP_chr_count_users_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_count_users_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_count_users_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_count_users_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -843,9 +816,9 @@ int HP_chr_count_users(void) {
{
retVal___ = HPMHooks.source.chr.count_users();
}
- if( HPMHooks.count.HP_chr_count_users_post ) {
+ if (HPMHooks.count.HP_chr_count_users_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_count_users_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_count_users_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_count_users_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -855,14 +828,14 @@ int HP_chr_count_users(void) {
int HP_chr_mmo_char_tobuf(uint8 *buffer, struct mmo_charstatus *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_char_tobuf_pre ) {
- int (*preHookFunc) (uint8 *buffer, struct mmo_charstatus *p);
+ if (HPMHooks.count.HP_chr_mmo_char_tobuf_pre > 0) {
+ int (*preHookFunc) (uint8 **buffer, struct mmo_charstatus **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tobuf_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tobuf_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_tobuf_pre[hIndex].func;
- retVal___ = preHookFunc(buffer, p);
+ retVal___ = preHookFunc(&buffer, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -870,9 +843,9 @@ int HP_chr_mmo_char_tobuf(uint8 *buffer, struct mmo_charstatus *p) {
{
retVal___ = HPMHooks.source.chr.mmo_char_tobuf(buffer, p);
}
- if( HPMHooks.count.HP_chr_mmo_char_tobuf_post ) {
+ if (HPMHooks.count.HP_chr_mmo_char_tobuf_post > 0) {
int (*postHookFunc) (int retVal___, uint8 *buffer, struct mmo_charstatus *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tobuf_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_tobuf_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_tobuf_post[hIndex].func;
retVal___ = postHookFunc(retVal___, buffer, p);
}
@@ -881,14 +854,14 @@ int HP_chr_mmo_char_tobuf(uint8 *buffer, struct mmo_charstatus *p) {
}
void HP_chr_mmo_char_send099d(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_mmo_char_send099d_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_mmo_char_send099d_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send099d_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send099d_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_send099d_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -896,25 +869,25 @@ void HP_chr_mmo_char_send099d(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.mmo_char_send099d(fd, sd);
}
- if( HPMHooks.count.HP_chr_mmo_char_send099d_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send099d_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_char_send099d_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send099d_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_send099d_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_mmo_char_send_ban_list(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_mmo_char_send_ban_list_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_mmo_char_send_ban_list_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_ban_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_ban_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_send_ban_list_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -922,25 +895,25 @@ void HP_chr_mmo_char_send_ban_list(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.mmo_char_send_ban_list(fd, sd);
}
- if( HPMHooks.count.HP_chr_mmo_char_send_ban_list_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_ban_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_char_send_ban_list_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_ban_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_send_ban_list_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_mmo_char_send_slots_info(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_mmo_char_send_slots_info_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_mmo_char_send_slots_info_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_slots_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_slots_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_send_slots_info_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -948,11 +921,11 @@ void HP_chr_mmo_char_send_slots_info(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.mmo_char_send_slots_info(fd, sd);
}
- if( HPMHooks.count.HP_chr_mmo_char_send_slots_info_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_slots_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_char_send_slots_info_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_slots_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_send_slots_info_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
@@ -960,14 +933,14 @@ void HP_chr_mmo_char_send_slots_info(int fd, struct char_session_data *sd) {
int HP_chr_mmo_char_send_characters(int fd, struct char_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mmo_char_send_characters_pre ) {
- int (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_mmo_char_send_characters_pre > 0) {
+ int (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_characters_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_characters_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mmo_char_send_characters_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, sd);
+ retVal___ = preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -975,11 +948,11 @@ int HP_chr_mmo_char_send_characters(int fd, struct char_session_data *sd) {
{
retVal___ = HPMHooks.source.chr.mmo_char_send_characters(fd, sd);
}
- if( HPMHooks.count.HP_chr_mmo_char_send_characters_post ) {
- int (*postHookFunc) (int retVal___, int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_characters_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mmo_char_send_characters_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mmo_char_send_characters_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mmo_char_send_characters_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, sd);
+ retVal___ = postHookFunc(retVal___, fd, sd);
}
}
return retVal___;
@@ -987,14 +960,14 @@ int HP_chr_mmo_char_send_characters(int fd, struct char_session_data *sd) {
int HP_chr_char_married(int pl1, int pl2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_char_married_pre ) {
+ if (HPMHooks.count.HP_chr_char_married_pre > 0) {
int (*preHookFunc) (int *pl1, int *pl2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_married_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_married_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_char_married_pre[hIndex].func;
retVal___ = preHookFunc(&pl1, &pl2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1002,11 +975,11 @@ int HP_chr_char_married(int pl1, int pl2) {
{
retVal___ = HPMHooks.source.chr.char_married(pl1, pl2);
}
- if( HPMHooks.count.HP_chr_char_married_post ) {
- int (*postHookFunc) (int retVal___, int *pl1, int *pl2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_married_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_char_married_post > 0) {
+ int (*postHookFunc) (int retVal___, int pl1, int pl2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_married_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_char_married_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pl1, &pl2);
+ retVal___ = postHookFunc(retVal___, pl1, pl2);
}
}
return retVal___;
@@ -1014,14 +987,14 @@ int HP_chr_char_married(int pl1, int pl2) {
int HP_chr_char_child(int parent_id, int child_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_char_child_pre ) {
+ if (HPMHooks.count.HP_chr_char_child_pre > 0) {
int (*preHookFunc) (int *parent_id, int *child_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_child_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_child_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_char_child_pre[hIndex].func;
retVal___ = preHookFunc(&parent_id, &child_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1029,11 +1002,11 @@ int HP_chr_char_child(int parent_id, int child_id) {
{
retVal___ = HPMHooks.source.chr.char_child(parent_id, child_id);
}
- if( HPMHooks.count.HP_chr_char_child_post ) {
- int (*postHookFunc) (int retVal___, int *parent_id, int *child_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_child_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_char_child_post > 0) {
+ int (*postHookFunc) (int retVal___, int parent_id, int child_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_child_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_char_child_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &parent_id, &child_id);
+ retVal___ = postHookFunc(retVal___, parent_id, child_id);
}
}
return retVal___;
@@ -1041,14 +1014,14 @@ int HP_chr_char_child(int parent_id, int child_id) {
int HP_chr_char_family(int cid1, int cid2, int cid3) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_char_family_pre ) {
+ if (HPMHooks.count.HP_chr_char_family_pre > 0) {
int (*preHookFunc) (int *cid1, int *cid2, int *cid3);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_family_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_family_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_char_family_pre[hIndex].func;
retVal___ = preHookFunc(&cid1, &cid2, &cid3);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1056,25 +1029,25 @@ int HP_chr_char_family(int cid1, int cid2, int cid3) {
{
retVal___ = HPMHooks.source.chr.char_family(cid1, cid2, cid3);
}
- if( HPMHooks.count.HP_chr_char_family_post ) {
- int (*postHookFunc) (int retVal___, int *cid1, int *cid2, int *cid3);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_family_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_char_family_post > 0) {
+ int (*postHookFunc) (int retVal___, int cid1, int cid2, int cid3);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_family_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_char_family_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &cid1, &cid2, &cid3);
+ retVal___ = postHookFunc(retVal___, cid1, cid2, cid3);
}
}
return retVal___;
}
void HP_chr_disconnect_player(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_disconnect_player_pre ) {
+ if (HPMHooks.count.HP_chr_disconnect_player_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_disconnect_player_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_disconnect_player_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_disconnect_player_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1082,25 +1055,25 @@ void HP_chr_disconnect_player(int account_id) {
{
HPMHooks.source.chr.disconnect_player(account_id);
}
- if( HPMHooks.count.HP_chr_disconnect_player_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_disconnect_player_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_disconnect_player_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_disconnect_player_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_disconnect_player_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
void HP_chr_authfail_fd(int fd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_authfail_fd_pre ) {
+ if (HPMHooks.count.HP_chr_authfail_fd_pre > 0) {
void (*preHookFunc) (int *fd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_authfail_fd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_authfail_fd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_authfail_fd_pre[hIndex].func;
preHookFunc(&fd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1108,25 +1081,25 @@ void HP_chr_authfail_fd(int fd, int type) {
{
HPMHooks.source.chr.authfail_fd(fd, type);
}
- if( HPMHooks.count.HP_chr_authfail_fd_post ) {
- void (*postHookFunc) (int *fd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_authfail_fd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_authfail_fd_post > 0) {
+ void (*postHookFunc) (int fd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_authfail_fd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_authfail_fd_post[hIndex].func;
- postHookFunc(&fd, &type);
+ postHookFunc(fd, type);
}
}
return;
}
void HP_chr_request_account_data(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_request_account_data_pre ) {
+ if (HPMHooks.count.HP_chr_request_account_data_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_account_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_account_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_request_account_data_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1134,25 +1107,25 @@ void HP_chr_request_account_data(int account_id) {
{
HPMHooks.source.chr.request_account_data(account_id);
}
- if( HPMHooks.count.HP_chr_request_account_data_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_account_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_request_account_data_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_account_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_request_account_data_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
void HP_chr_auth_ok(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_auth_ok_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_auth_ok_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_auth_ok_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1160,25 +1133,25 @@ void HP_chr_auth_ok(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.auth_ok(fd, sd);
}
- if( HPMHooks.count.HP_chr_auth_ok_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_auth_ok_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_auth_ok_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_ping_login_server(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_ping_login_server_pre ) {
+ if (HPMHooks.count.HP_chr_ping_login_server_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_ping_login_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_ping_login_server_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_ping_login_server_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1186,11 +1159,11 @@ void HP_chr_ping_login_server(int fd) {
{
HPMHooks.source.chr.ping_login_server(fd);
}
- if( HPMHooks.count.HP_chr_ping_login_server_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_ping_login_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_ping_login_server_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_ping_login_server_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_ping_login_server_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -1198,14 +1171,14 @@ void HP_chr_ping_login_server(int fd) {
int HP_chr_parse_fromlogin_connection_state(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_connection_state_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_connection_state_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_connection_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_connection_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_connection_state_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1213,25 +1186,25 @@ int HP_chr_parse_fromlogin_connection_state(int fd) {
{
retVal___ = HPMHooks.source.chr.parse_fromlogin_connection_state(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_connection_state_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_connection_state_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_connection_state_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_connection_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_connection_state_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chr_auth_error(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_auth_error_pre ) {
+ if (HPMHooks.count.HP_chr_auth_error_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_error_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_error_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_auth_error_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1239,25 +1212,25 @@ void HP_chr_auth_error(int fd, unsigned char flag) {
{
HPMHooks.source.chr.auth_error(fd, flag);
}
- if( HPMHooks.count.HP_chr_auth_error_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_error_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_auth_error_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_auth_error_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_auth_error_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_chr_parse_fromlogin_auth_state(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_auth_state_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_auth_state_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_auth_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_auth_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_auth_state_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1265,25 +1238,25 @@ void HP_chr_parse_fromlogin_auth_state(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_auth_state(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_auth_state_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_auth_state_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_auth_state_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_auth_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_auth_state_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_account_data(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_account_data_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_account_data_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_account_data_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1291,25 +1264,25 @@ void HP_chr_parse_fromlogin_account_data(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_account_data(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_account_data_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_account_data_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_account_data_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_login_pong(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_login_pong_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_login_pong_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_login_pong_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_login_pong_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_login_pong_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1317,25 +1290,25 @@ void HP_chr_parse_fromlogin_login_pong(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_login_pong(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_login_pong_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_login_pong_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_login_pong_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_login_pong_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_login_pong_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_changesex(int account_id, int sex) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_changesex_pre ) {
+ if (HPMHooks.count.HP_chr_changesex_pre > 0) {
void (*preHookFunc) (int *account_id, int *sex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_changesex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_changesex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_changesex_pre[hIndex].func;
preHookFunc(&account_id, &sex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1343,11 +1316,11 @@ void HP_chr_changesex(int account_id, int sex) {
{
HPMHooks.source.chr.changesex(account_id, sex);
}
- if( HPMHooks.count.HP_chr_changesex_post ) {
- void (*postHookFunc) (int *account_id, int *sex);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_changesex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_changesex_post > 0) {
+ void (*postHookFunc) (int account_id, int sex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_changesex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_changesex_post[hIndex].func;
- postHookFunc(&account_id, &sex);
+ postHookFunc(account_id, sex);
}
}
return;
@@ -1355,14 +1328,14 @@ void HP_chr_changesex(int account_id, int sex) {
int HP_chr_parse_fromlogin_changesex_reply(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_changesex_reply_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1370,25 +1343,25 @@ int HP_chr_parse_fromlogin_changesex_reply(int fd) {
{
retVal___ = HPMHooks.source.chr.parse_fromlogin_changesex_reply(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_changesex_reply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_changesex_reply_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chr_parse_fromlogin_account_reg2(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_account_reg2_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1396,25 +1369,25 @@ void HP_chr_parse_fromlogin_account_reg2(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_account_reg2(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_account_reg2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_account_reg2_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_ban(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_ban_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_ban_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_ban_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1422,25 +1395,25 @@ void HP_chr_parse_fromlogin_ban(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_ban(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_ban_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_ban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_ban_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_ban_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_kick(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_kick_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_kick_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_kick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_kick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_kick_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1448,25 +1421,25 @@ void HP_chr_parse_fromlogin_kick(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_kick(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_kick_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_kick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_kick_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_kick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_kick_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_update_ip(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_update_ip_pre ) {
+ if (HPMHooks.count.HP_chr_update_ip_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_update_ip_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1474,25 +1447,25 @@ void HP_chr_update_ip(int fd) {
{
HPMHooks.source.chr.update_ip(fd);
}
- if( HPMHooks.count.HP_chr_update_ip_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_ip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_update_ip_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_update_ip_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_update_ip(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_update_ip_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_update_ip_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_update_ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_update_ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_update_ip_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1500,25 +1473,25 @@ void HP_chr_parse_fromlogin_update_ip(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_update_ip(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_update_ip_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_update_ip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_update_ip_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_update_ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_update_ip_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_accinfo2_failed(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_accinfo2_failed_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1526,25 +1499,25 @@ void HP_chr_parse_fromlogin_accinfo2_failed(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_accinfo2_failed(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_accinfo2_failed_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_fromlogin_accinfo2_ok(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_accinfo2_ok_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1552,11 +1525,11 @@ void HP_chr_parse_fromlogin_accinfo2_ok(int fd) {
{
HPMHooks.source.chr.parse_fromlogin_accinfo2_ok(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_accinfo2_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_accinfo2_ok_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -1564,14 +1537,14 @@ void HP_chr_parse_fromlogin_accinfo2_ok(int fd) {
int HP_chr_parse_fromlogin(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_parse_fromlogin_pre ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1579,11 +1552,11 @@ int HP_chr_parse_fromlogin(int fd) {
{
retVal___ = HPMHooks.source.chr.parse_fromlogin(fd);
}
- if( HPMHooks.count.HP_chr_parse_fromlogin_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_fromlogin_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_fromlogin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_fromlogin_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -1591,14 +1564,14 @@ int HP_chr_parse_fromlogin(int fd) {
int HP_chr_request_accreg2(int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_request_accreg2_pre ) {
+ if (HPMHooks.count.HP_chr_request_accreg2_pre > 0) {
int (*preHookFunc) (int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_accreg2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_accreg2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_request_accreg2_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1606,25 +1579,25 @@ int HP_chr_request_accreg2(int account_id, int char_id) {
{
retVal___ = HPMHooks.source.chr.request_accreg2(account_id, char_id);
}
- if( HPMHooks.count.HP_chr_request_accreg2_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_accreg2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_request_accreg2_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_request_accreg2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_request_accreg2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, account_id, char_id);
}
}
return retVal___;
}
void HP_chr_global_accreg_to_login_start(int account_id, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_global_accreg_to_login_start_pre ) {
+ if (HPMHooks.count.HP_chr_global_accreg_to_login_start_pre > 0) {
void (*preHookFunc) (int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_global_accreg_to_login_start_pre[hIndex].func;
preHookFunc(&account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1632,25 +1605,25 @@ void HP_chr_global_accreg_to_login_start(int account_id, int char_id) {
{
HPMHooks.source.chr.global_accreg_to_login_start(account_id, char_id);
}
- if( HPMHooks.count.HP_chr_global_accreg_to_login_start_post ) {
- void (*postHookFunc) (int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_global_accreg_to_login_start_post > 0) {
+ void (*postHookFunc) (int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_global_accreg_to_login_start_post[hIndex].func;
- postHookFunc(&account_id, &char_id);
+ postHookFunc(account_id, char_id);
}
}
return;
}
void HP_chr_global_accreg_to_login_send(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_global_accreg_to_login_send_pre ) {
+ if (HPMHooks.count.HP_chr_global_accreg_to_login_send_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_global_accreg_to_login_send_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1658,9 +1631,9 @@ void HP_chr_global_accreg_to_login_send(void) {
{
HPMHooks.source.chr.global_accreg_to_login_send();
}
- if( HPMHooks.count.HP_chr_global_accreg_to_login_send_post ) {
+ if (HPMHooks.count.HP_chr_global_accreg_to_login_send_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_send_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_global_accreg_to_login_send_post[hIndex].func;
postHookFunc();
}
@@ -1669,14 +1642,14 @@ void HP_chr_global_accreg_to_login_send(void) {
}
void HP_chr_global_accreg_to_login_add(const char *key, unsigned int index, intptr_t val, bool is_string) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_global_accreg_to_login_add_pre ) {
- void (*preHookFunc) (const char *key, unsigned int *index, intptr_t *val, bool *is_string);
+ if (HPMHooks.count.HP_chr_global_accreg_to_login_add_pre > 0) {
+ void (*preHookFunc) (const char **key, unsigned int *index, intptr_t *val, bool *is_string);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_global_accreg_to_login_add_pre[hIndex].func;
- preHookFunc(key, &index, &val, &is_string);
+ preHookFunc(&key, &index, &val, &is_string);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1684,25 +1657,25 @@ void HP_chr_global_accreg_to_login_add(const char *key, unsigned int index, intp
{
HPMHooks.source.chr.global_accreg_to_login_add(key, index, val, is_string);
}
- if( HPMHooks.count.HP_chr_global_accreg_to_login_add_post ) {
- void (*postHookFunc) (const char *key, unsigned int *index, intptr_t *val, bool *is_string);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_global_accreg_to_login_add_post > 0) {
+ void (*postHookFunc) (const char *key, unsigned int index, intptr_t val, bool is_string);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_global_accreg_to_login_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_global_accreg_to_login_add_post[hIndex].func;
- postHookFunc(key, &index, &val, &is_string);
+ postHookFunc(key, index, val, is_string);
}
}
return;
}
void HP_chr_read_fame_list(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_read_fame_list_pre ) {
+ if (HPMHooks.count.HP_chr_read_fame_list_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_read_fame_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_read_fame_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_read_fame_list_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1710,9 +1683,9 @@ void HP_chr_read_fame_list(void) {
{
HPMHooks.source.chr.read_fame_list();
}
- if( HPMHooks.count.HP_chr_read_fame_list_post ) {
+ if (HPMHooks.count.HP_chr_read_fame_list_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_read_fame_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_read_fame_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_read_fame_list_post[hIndex].func;
postHookFunc();
}
@@ -1722,14 +1695,14 @@ void HP_chr_read_fame_list(void) {
int HP_chr_send_fame_list(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_send_fame_list_pre ) {
+ if (HPMHooks.count.HP_chr_send_fame_list_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_fame_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_fame_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_fame_list_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1737,25 +1710,25 @@ int HP_chr_send_fame_list(int fd) {
{
retVal___ = HPMHooks.source.chr.send_fame_list(fd);
}
- if( HPMHooks.count.HP_chr_send_fame_list_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_fame_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_fame_list_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_fame_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_fame_list_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chr_update_fame_list(int type, int index, int fame) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_update_fame_list_pre ) {
+ if (HPMHooks.count.HP_chr_update_fame_list_pre > 0) {
void (*preHookFunc) (int *type, int *index, int *fame);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_fame_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_fame_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_update_fame_list_pre[hIndex].func;
preHookFunc(&type, &index, &fame);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1763,11 +1736,11 @@ void HP_chr_update_fame_list(int type, int index, int fame) {
{
HPMHooks.source.chr.update_fame_list(type, index, fame);
}
- if( HPMHooks.count.HP_chr_update_fame_list_post ) {
- void (*postHookFunc) (int *type, int *index, int *fame);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_fame_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_update_fame_list_post > 0) {
+ void (*postHookFunc) (int type, int index, int fame);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_update_fame_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_update_fame_list_post[hIndex].func;
- postHookFunc(&type, &index, &fame);
+ postHookFunc(type, index, fame);
}
}
return;
@@ -1775,14 +1748,14 @@ void HP_chr_update_fame_list(int type, int index, int fame) {
int HP_chr_loadName(int char_id, char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_loadName_pre ) {
- int (*preHookFunc) (int *char_id, char *name);
+ if (HPMHooks.count.HP_chr_loadName_pre > 0) {
+ int (*preHookFunc) (int *char_id, char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_loadName_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_loadName_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_loadName_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, name);
+ retVal___ = preHookFunc(&char_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1790,25 +1763,25 @@ int HP_chr_loadName(int char_id, char *name) {
{
retVal___ = HPMHooks.source.chr.loadName(char_id, name);
}
- if( HPMHooks.count.HP_chr_loadName_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_loadName_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_loadName_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_loadName_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_loadName_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, name);
+ retVal___ = postHookFunc(retVal___, char_id, name);
}
}
return retVal___;
}
void HP_chr_parse_frommap_datasync(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_datasync_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_datasync_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_datasync_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_datasync_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_datasync_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1816,25 +1789,25 @@ void HP_chr_parse_frommap_datasync(int fd) {
{
HPMHooks.source.chr.parse_frommap_datasync(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_datasync_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_datasync_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_datasync_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_datasync_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_datasync_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_skillid2idx(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_skillid2idx_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_skillid2idx_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_skillid2idx_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_skillid2idx_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_skillid2idx_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1842,25 +1815,25 @@ void HP_chr_parse_frommap_skillid2idx(int fd) {
{
HPMHooks.source.chr.parse_frommap_skillid2idx(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_skillid2idx_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_skillid2idx_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_skillid2idx_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_skillid2idx_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_skillid2idx_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_map_received_ok(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_map_received_ok_pre ) {
+ if (HPMHooks.count.HP_chr_map_received_ok_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_received_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_received_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_map_received_ok_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1868,25 +1841,25 @@ void HP_chr_map_received_ok(int fd) {
{
HPMHooks.source.chr.map_received_ok(fd);
}
- if( HPMHooks.count.HP_chr_map_received_ok_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_received_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_map_received_ok_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_received_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_map_received_ok_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_send_maps(int fd, int id, int j) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_send_maps_pre ) {
+ if (HPMHooks.count.HP_chr_send_maps_pre > 0) {
void (*preHookFunc) (int *fd, int *id, int *j);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_maps_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_maps_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_maps_pre[hIndex].func;
preHookFunc(&fd, &id, &j);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1894,25 +1867,25 @@ void HP_chr_send_maps(int fd, int id, int j) {
{
HPMHooks.source.chr.send_maps(fd, id, j);
}
- if( HPMHooks.count.HP_chr_send_maps_post ) {
- void (*postHookFunc) (int *fd, int *id, int *j);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_maps_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_maps_post > 0) {
+ void (*postHookFunc) (int fd, int id, int j);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_maps_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_maps_post[hIndex].func;
- postHookFunc(&fd, &id, &j);
+ postHookFunc(fd, id, j);
}
}
return;
}
void HP_chr_parse_frommap_map_names(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_map_names_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_map_names_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_map_names_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_map_names_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_map_names_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1920,25 +1893,25 @@ void HP_chr_parse_frommap_map_names(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_map_names(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_map_names_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_map_names_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_map_names_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_map_names_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_map_names_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_send_scdata(int fd, int aid, int cid) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_send_scdata_pre ) {
+ if (HPMHooks.count.HP_chr_send_scdata_pre > 0) {
void (*preHookFunc) (int *fd, int *aid, int *cid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_scdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_scdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_scdata_pre[hIndex].func;
preHookFunc(&fd, &aid, &cid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1946,25 +1919,25 @@ void HP_chr_send_scdata(int fd, int aid, int cid) {
{
HPMHooks.source.chr.send_scdata(fd, aid, cid);
}
- if( HPMHooks.count.HP_chr_send_scdata_post ) {
- void (*postHookFunc) (int *fd, int *aid, int *cid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_scdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_scdata_post > 0) {
+ void (*postHookFunc) (int fd, int aid, int cid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_scdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_scdata_post[hIndex].func;
- postHookFunc(&fd, &aid, &cid);
+ postHookFunc(fd, aid, cid);
}
}
return;
}
void HP_chr_parse_frommap_request_scdata(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_request_scdata_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_request_scdata_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_scdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_scdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_request_scdata_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1972,25 +1945,25 @@ void HP_chr_parse_frommap_request_scdata(int fd) {
{
HPMHooks.source.chr.parse_frommap_request_scdata(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_request_scdata_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_scdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_request_scdata_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_scdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_request_scdata_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_set_users_count(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_set_users_count_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_users_count_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_users_count_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1998,25 +1971,25 @@ void HP_chr_parse_frommap_set_users_count(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_set_users_count(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_set_users_count_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_users_count_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_users_count_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_parse_frommap_set_users(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_set_users_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_users_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_users_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2024,25 +1997,25 @@ void HP_chr_parse_frommap_set_users(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_set_users(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_set_users_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_users_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_users_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_users_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_save_character_ack(int fd, int aid, int cid) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_save_character_ack_pre ) {
+ if (HPMHooks.count.HP_chr_save_character_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *aid, int *cid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_save_character_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_save_character_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_save_character_ack_pre[hIndex].func;
preHookFunc(&fd, &aid, &cid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2050,25 +2023,25 @@ void HP_chr_save_character_ack(int fd, int aid, int cid) {
{
HPMHooks.source.chr.save_character_ack(fd, aid, cid);
}
- if( HPMHooks.count.HP_chr_save_character_ack_post ) {
- void (*postHookFunc) (int *fd, int *aid, int *cid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_save_character_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_save_character_ack_post > 0) {
+ void (*postHookFunc) (int fd, int aid, int cid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_save_character_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_save_character_ack_post[hIndex].func;
- postHookFunc(&fd, &aid, &cid);
+ postHookFunc(fd, aid, cid);
}
}
return;
}
void HP_chr_parse_frommap_save_character(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_save_character_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_save_character_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_character_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_character_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_save_character_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2076,25 +2049,25 @@ void HP_chr_parse_frommap_save_character(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_save_character(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_save_character_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_character_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_save_character_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_character_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_save_character_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_select_ack(int fd, int account_id, uint8 flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_select_ack_pre ) {
+ if (HPMHooks.count.HP_chr_select_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *account_id, uint8 *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_select_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_select_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_select_ack_pre[hIndex].func;
preHookFunc(&fd, &account_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2102,25 +2075,25 @@ void HP_chr_select_ack(int fd, int account_id, uint8 flag) {
{
HPMHooks.source.chr.select_ack(fd, account_id, flag);
}
- if( HPMHooks.count.HP_chr_select_ack_post ) {
- void (*postHookFunc) (int *fd, int *account_id, uint8 *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_select_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_select_ack_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, uint8 flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_select_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_select_ack_post[hIndex].func;
- postHookFunc(&fd, &account_id, &flag);
+ postHookFunc(fd, account_id, flag);
}
}
return;
}
void HP_chr_parse_frommap_char_select_req(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_char_select_req_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_char_select_req_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_select_req_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_select_req_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_char_select_req_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2128,25 +2101,25 @@ void HP_chr_parse_frommap_char_select_req(int fd) {
{
HPMHooks.source.chr.parse_frommap_char_select_req(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_char_select_req_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_select_req_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_char_select_req_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_select_req_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_char_select_req_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
-void HP_chr_change_map_server_ack(int fd, uint8 *data, bool ok) {
+void HP_chr_change_map_server_ack(int fd, const uint8 *data, bool ok) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_change_map_server_ack_pre ) {
- void (*preHookFunc) (int *fd, uint8 *data, bool *ok);
+ if (HPMHooks.count.HP_chr_change_map_server_ack_pre > 0) {
+ void (*preHookFunc) (int *fd, const uint8 **data, bool *ok);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_map_server_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_map_server_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_change_map_server_ack_pre[hIndex].func;
- preHookFunc(&fd, data, &ok);
+ preHookFunc(&fd, &data, &ok);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2154,25 +2127,25 @@ void HP_chr_change_map_server_ack(int fd, uint8 *data, bool ok) {
{
HPMHooks.source.chr.change_map_server_ack(fd, data, ok);
}
- if( HPMHooks.count.HP_chr_change_map_server_ack_post ) {
- void (*postHookFunc) (int *fd, uint8 *data, bool *ok);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_map_server_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_change_map_server_ack_post > 0) {
+ void (*postHookFunc) (int fd, const uint8 *data, bool ok);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_map_server_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_change_map_server_ack_post[hIndex].func;
- postHookFunc(&fd, data, &ok);
+ postHookFunc(fd, data, ok);
}
}
return;
}
void HP_chr_parse_frommap_change_map_server(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_change_map_server_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_change_map_server_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_map_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_map_server_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_change_map_server_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2180,25 +2153,25 @@ void HP_chr_parse_frommap_change_map_server(int fd) {
{
HPMHooks.source.chr.parse_frommap_change_map_server(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_change_map_server_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_map_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_change_map_server_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_map_server_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_change_map_server_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_remove_friend(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_remove_friend_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_remove_friend_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_remove_friend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_remove_friend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_remove_friend_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2206,25 +2179,25 @@ void HP_chr_parse_frommap_remove_friend(int fd) {
{
HPMHooks.source.chr.parse_frommap_remove_friend(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_remove_friend_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_remove_friend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_remove_friend_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_remove_friend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_remove_friend_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_char_name_ack(int fd, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_char_name_ack_pre ) {
+ if (HPMHooks.count.HP_chr_char_name_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_name_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_name_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_char_name_ack_pre[hIndex].func;
preHookFunc(&fd, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2232,25 +2205,25 @@ void HP_chr_char_name_ack(int fd, int char_id) {
{
HPMHooks.source.chr.char_name_ack(fd, char_id);
}
- if( HPMHooks.count.HP_chr_char_name_ack_post ) {
- void (*postHookFunc) (int *fd, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_name_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_char_name_ack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_char_name_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_char_name_ack_post[hIndex].func;
- postHookFunc(&fd, &char_id);
+ postHookFunc(fd, char_id);
}
}
return;
}
void HP_chr_parse_frommap_char_name_request(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_char_name_request_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_char_name_request_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_name_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_name_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_char_name_request_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2258,25 +2231,25 @@ void HP_chr_parse_frommap_char_name_request(int fd) {
{
HPMHooks.source.chr.parse_frommap_char_name_request(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_char_name_request_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_name_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_char_name_request_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_char_name_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_char_name_request_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_change_email(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_change_email_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_change_email_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_email_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_email_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_change_email_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2284,25 +2257,25 @@ void HP_chr_parse_frommap_change_email(int fd) {
{
HPMHooks.source.chr.parse_frommap_change_email(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_change_email_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_email_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_change_email_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_email_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_change_email_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_ban(int account_id, int char_id, time_t *unban_time, short year, short month, short day, short hour, short minute, short second) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_ban_pre ) {
- void (*preHookFunc) (int *account_id, int *char_id, time_t *unban_time, short *year, short *month, short *day, short *hour, short *minute, short *second);
+ if (HPMHooks.count.HP_chr_ban_pre > 0) {
+ void (*preHookFunc) (int *account_id, int *char_id, time_t **unban_time, short *year, short *month, short *day, short *hour, short *minute, short *second);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_ban_pre[hIndex].func;
- preHookFunc(&account_id, &char_id, unban_time, &year, &month, &day, &hour, &minute, &second);
+ preHookFunc(&account_id, &char_id, &unban_time, &year, &month, &day, &hour, &minute, &second);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2310,25 +2283,25 @@ void HP_chr_ban(int account_id, int char_id, time_t *unban_time, short year, sho
{
HPMHooks.source.chr.ban(account_id, char_id, unban_time, year, month, day, hour, minute, second);
}
- if( HPMHooks.count.HP_chr_ban_post ) {
- void (*postHookFunc) (int *account_id, int *char_id, time_t *unban_time, short *year, short *month, short *day, short *hour, short *minute, short *second);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_ban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_ban_post > 0) {
+ void (*postHookFunc) (int account_id, int char_id, time_t *unban_time, short year, short month, short day, short hour, short minute, short second);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_ban_post[hIndex].func;
- postHookFunc(&account_id, &char_id, unban_time, &year, &month, &day, &hour, &minute, &second);
+ postHookFunc(account_id, char_id, unban_time, year, month, day, hour, minute, second);
}
}
return;
}
void HP_chr_unban(int char_id, int *result) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_unban_pre ) {
- void (*preHookFunc) (int *char_id, int *result);
+ if (HPMHooks.count.HP_chr_unban_pre > 0) {
+ void (*preHookFunc) (int *char_id, int **result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_unban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_unban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_unban_pre[hIndex].func;
- preHookFunc(&char_id, result);
+ preHookFunc(&char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2336,25 +2309,25 @@ void HP_chr_unban(int char_id, int *result) {
{
HPMHooks.source.chr.unban(char_id, result);
}
- if( HPMHooks.count.HP_chr_unban_post ) {
- void (*postHookFunc) (int *char_id, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_unban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_unban_post > 0) {
+ void (*postHookFunc) (int char_id, int *result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_unban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_unban_post[hIndex].func;
- postHookFunc(&char_id, result);
+ postHookFunc(char_id, result);
}
}
return;
}
void HP_chr_ask_name_ack(int fd, int acc, const char *name, int type, int result) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_ask_name_ack_pre ) {
- void (*preHookFunc) (int *fd, int *acc, const char *name, int *type, int *result);
+ if (HPMHooks.count.HP_chr_ask_name_ack_pre > 0) {
+ void (*preHookFunc) (int *fd, int *acc, const char **name, int *type, int *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_ask_name_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_ask_name_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_ask_name_ack_pre[hIndex].func;
- preHookFunc(&fd, &acc, name, &type, &result);
+ preHookFunc(&fd, &acc, &name, &type, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2362,11 +2335,11 @@ void HP_chr_ask_name_ack(int fd, int acc, const char *name, int type, int result
{
HPMHooks.source.chr.ask_name_ack(fd, acc, name, type, result);
}
- if( HPMHooks.count.HP_chr_ask_name_ack_post ) {
- void (*postHookFunc) (int *fd, int *acc, const char *name, int *type, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_ask_name_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_ask_name_ack_post > 0) {
+ void (*postHookFunc) (int fd, int acc, const char *name, int type, int result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_ask_name_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_ask_name_ack_post[hIndex].func;
- postHookFunc(&fd, &acc, name, &type, &result);
+ postHookFunc(fd, acc, name, type, result);
}
}
return;
@@ -2374,14 +2347,14 @@ void HP_chr_ask_name_ack(int fd, int acc, const char *name, int type, int result
int HP_chr_changecharsex(int char_id, int sex) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_changecharsex_pre ) {
+ if (HPMHooks.count.HP_chr_changecharsex_pre > 0) {
int (*preHookFunc) (int *char_id, int *sex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_changecharsex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_changecharsex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_changecharsex_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &sex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2389,25 +2362,25 @@ int HP_chr_changecharsex(int char_id, int sex) {
{
retVal___ = HPMHooks.source.chr.changecharsex(char_id, sex);
}
- if( HPMHooks.count.HP_chr_changecharsex_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *sex);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_changecharsex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_changecharsex_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int sex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_changecharsex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_changecharsex_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &sex);
+ retVal___ = postHookFunc(retVal___, char_id, sex);
}
}
return retVal___;
}
void HP_chr_parse_frommap_change_account(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_change_account_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_change_account_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_account_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_account_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_change_account_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2415,25 +2388,25 @@ void HP_chr_parse_frommap_change_account(int fd) {
{
HPMHooks.source.chr.parse_frommap_change_account(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_change_account_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_account_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_change_account_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_change_account_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_change_account_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_fame_list(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_fame_list_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_fame_list_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_fame_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_fame_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_fame_list_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2441,25 +2414,25 @@ void HP_chr_parse_frommap_fame_list(int fd) {
{
HPMHooks.source.chr.parse_frommap_fame_list(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_fame_list_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_fame_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_fame_list_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_fame_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_fame_list_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_divorce_char(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_divorce_char_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_divorce_char_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_divorce_char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_divorce_char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_divorce_char_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2467,25 +2440,25 @@ void HP_chr_parse_frommap_divorce_char(int fd) {
{
HPMHooks.source.chr.parse_frommap_divorce_char(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_divorce_char_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_divorce_char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_divorce_char_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_divorce_char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_divorce_char_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_ragsrvinfo(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_ragsrvinfo_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2493,25 +2466,25 @@ void HP_chr_parse_frommap_ragsrvinfo(int fd) {
{
HPMHooks.source.chr.parse_frommap_ragsrvinfo(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ragsrvinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_ragsrvinfo_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_set_char_offline(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_set_char_offline_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_char_offline_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_char_offline_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2519,25 +2492,25 @@ void HP_chr_parse_frommap_set_char_offline(int fd) {
{
HPMHooks.source.chr.parse_frommap_set_char_offline(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_set_char_offline_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_char_offline_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_char_offline_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_set_all_offline(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_set_all_offline_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_all_offline_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_all_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_all_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_all_offline_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2545,25 +2518,25 @@ void HP_chr_parse_frommap_set_all_offline(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_set_all_offline(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_set_all_offline_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_all_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_all_offline_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_all_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_all_offline_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_parse_frommap_set_char_online(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_set_char_online_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_char_online_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_online_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_online_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_char_online_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2571,25 +2544,25 @@ void HP_chr_parse_frommap_set_char_online(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_set_char_online(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_set_char_online_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_online_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_set_char_online_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_set_char_online_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_set_char_online_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_parse_frommap_build_fame_list(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_build_fame_list_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_build_fame_list_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_build_fame_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_build_fame_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_build_fame_list_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2597,25 +2570,25 @@ void HP_chr_parse_frommap_build_fame_list(int fd) {
{
HPMHooks.source.chr.parse_frommap_build_fame_list(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_build_fame_list_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_build_fame_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_build_fame_list_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_build_fame_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_build_fame_list_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_save_status_change_data(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_save_status_change_data_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2623,25 +2596,25 @@ void HP_chr_parse_frommap_save_status_change_data(int fd) {
{
HPMHooks.source.chr.parse_frommap_save_status_change_data(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_save_status_change_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_save_status_change_data_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_send_pong(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_send_pong_pre ) {
+ if (HPMHooks.count.HP_chr_send_pong_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_pong_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_pong_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_pong_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2649,25 +2622,25 @@ void HP_chr_send_pong(int fd) {
{
HPMHooks.source.chr.send_pong(fd);
}
- if( HPMHooks.count.HP_chr_send_pong_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_pong_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_pong_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_pong_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_pong_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_ping(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_ping_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_ping_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ping_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ping_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_ping_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2675,25 +2648,25 @@ void HP_chr_parse_frommap_ping(int fd) {
{
HPMHooks.source.chr.parse_frommap_ping(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_ping_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ping_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_ping_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_ping_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_ping_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_map_auth_ok(int fd, int account_id, struct char_auth_node *node, struct mmo_charstatus *cd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_map_auth_ok_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, struct char_auth_node *node, struct mmo_charstatus *cd);
+ if (HPMHooks.count.HP_chr_map_auth_ok_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, struct char_auth_node **node, struct mmo_charstatus **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_map_auth_ok_pre[hIndex].func;
- preHookFunc(&fd, &account_id, node, cd);
+ preHookFunc(&fd, &account_id, &node, &cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2701,25 +2674,25 @@ void HP_chr_map_auth_ok(int fd, int account_id, struct char_auth_node *node, str
{
HPMHooks.source.chr.map_auth_ok(fd, account_id, node, cd);
}
- if( HPMHooks.count.HP_chr_map_auth_ok_post ) {
- void (*postHookFunc) (int *fd, int *account_id, struct char_auth_node *node, struct mmo_charstatus *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_map_auth_ok_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, struct char_auth_node *node, struct mmo_charstatus *cd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_map_auth_ok_post[hIndex].func;
- postHookFunc(&fd, &account_id, node, cd);
+ postHookFunc(fd, account_id, node, cd);
}
}
return;
}
void HP_chr_map_auth_failed(int fd, int account_id, int char_id, int login_id1, char sex, uint32 ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_map_auth_failed_pre ) {
+ if (HPMHooks.count.HP_chr_map_auth_failed_pre > 0) {
void (*preHookFunc) (int *fd, int *account_id, int *char_id, int *login_id1, char *sex, uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_map_auth_failed_pre[hIndex].func;
preHookFunc(&fd, &account_id, &char_id, &login_id1, &sex, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2727,25 +2700,25 @@ void HP_chr_map_auth_failed(int fd, int account_id, int char_id, int login_id1,
{
HPMHooks.source.chr.map_auth_failed(fd, account_id, char_id, login_id1, sex, ip);
}
- if( HPMHooks.count.HP_chr_map_auth_failed_post ) {
- void (*postHookFunc) (int *fd, int *account_id, int *char_id, int *login_id1, char *sex, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_map_auth_failed_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, int char_id, int login_id1, char sex, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_map_auth_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_map_auth_failed_post[hIndex].func;
- postHookFunc(&fd, &account_id, &char_id, &login_id1, &sex, &ip);
+ postHookFunc(fd, account_id, char_id, login_id1, sex, ip);
}
}
return;
}
void HP_chr_parse_frommap_auth_request(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_auth_request_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_auth_request_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_auth_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_auth_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_auth_request_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2753,25 +2726,25 @@ void HP_chr_parse_frommap_auth_request(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_auth_request(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_auth_request_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_auth_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_auth_request_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_auth_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_auth_request_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_parse_frommap_update_ip(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_update_ip_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_update_ip_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_update_ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_update_ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_update_ip_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2779,25 +2752,25 @@ void HP_chr_parse_frommap_update_ip(int fd, int id) {
{
HPMHooks.source.chr.parse_frommap_update_ip(fd, id);
}
- if( HPMHooks.count.HP_chr_parse_frommap_update_ip_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_update_ip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_update_ip_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_update_ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_update_ip_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_chr_parse_frommap_request_stats_report(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_request_stats_report_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_request_stats_report_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_stats_report_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_stats_report_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_request_stats_report_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2805,25 +2778,25 @@ void HP_chr_parse_frommap_request_stats_report(int fd) {
{
HPMHooks.source.chr.parse_frommap_request_stats_report(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_request_stats_report_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_stats_report_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_request_stats_report_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_request_stats_report_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_request_stats_report_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_scdata_update(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_scdata_update_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_scdata_update_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_scdata_update_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2831,25 +2804,25 @@ void HP_chr_parse_frommap_scdata_update(int fd) {
{
HPMHooks.source.chr.parse_frommap_scdata_update(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_scdata_update_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_scdata_update_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_scdata_update_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_frommap_scdata_delete(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_scdata_delete_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_scdata_delete_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_scdata_delete_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2857,11 +2830,11 @@ void HP_chr_parse_frommap_scdata_delete(int fd) {
{
HPMHooks.source.chr.parse_frommap_scdata_delete(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_scdata_delete_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_scdata_delete_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_scdata_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_scdata_delete_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -2869,14 +2842,14 @@ void HP_chr_parse_frommap_scdata_delete(int fd) {
int HP_chr_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2884,11 +2857,11 @@ int HP_chr_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.chr.parse_frommap(fd);
}
- if( HPMHooks.count.HP_chr_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -2896,14 +2869,14 @@ int HP_chr_parse_frommap(int fd) {
int HP_chr_search_mapserver(unsigned short map, uint32 ip, uint16 port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_search_mapserver_pre ) {
+ if (HPMHooks.count.HP_chr_search_mapserver_pre > 0) {
int (*preHookFunc) (unsigned short *map, uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_mapserver_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_mapserver_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_search_mapserver_pre[hIndex].func;
retVal___ = preHookFunc(&map, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2911,11 +2884,11 @@ int HP_chr_search_mapserver(unsigned short map, uint32 ip, uint16 port) {
{
retVal___ = HPMHooks.source.chr.search_mapserver(map, ip, port);
}
- if( HPMHooks.count.HP_chr_search_mapserver_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *map, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_mapserver_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_search_mapserver_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short map, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_mapserver_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_search_mapserver_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &map, &ip, &port);
+ retVal___ = postHookFunc(retVal___, map, ip, port);
}
}
return retVal___;
@@ -2923,14 +2896,14 @@ int HP_chr_search_mapserver(unsigned short map, uint32 ip, uint16 port) {
int HP_chr_mapif_init(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_mapif_init_pre ) {
+ if (HPMHooks.count.HP_chr_mapif_init_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mapif_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mapif_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_mapif_init_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2938,11 +2911,11 @@ int HP_chr_mapif_init(int fd) {
{
retVal___ = HPMHooks.source.chr.mapif_init(fd);
}
- if( HPMHooks.count.HP_chr_mapif_init_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_mapif_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_mapif_init_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_mapif_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_mapif_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -2950,14 +2923,14 @@ int HP_chr_mapif_init(int fd) {
uint32 HP_chr_lan_subnet_check(uint32 ip) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_chr_lan_subnet_check_pre ) {
+ if (HPMHooks.count.HP_chr_lan_subnet_check_pre > 0) {
uint32 (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnet_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnet_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_lan_subnet_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2965,25 +2938,25 @@ uint32 HP_chr_lan_subnet_check(uint32 ip) {
{
retVal___ = HPMHooks.source.chr.lan_subnet_check(ip);
}
- if( HPMHooks.count.HP_chr_lan_subnet_check_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnet_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_lan_subnet_check_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_lan_subnet_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_lan_subnet_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
}
void HP_chr_delete2_ack(int fd, int char_id, uint32 result, time_t delete_date) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_ack_pre ) {
+ if (HPMHooks.count.HP_chr_delete2_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, uint32 *result, time_t *delete_date);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_ack_pre[hIndex].func;
preHookFunc(&fd, &char_id, &result, &delete_date);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2991,25 +2964,25 @@ void HP_chr_delete2_ack(int fd, int char_id, uint32 result, time_t delete_date)
{
HPMHooks.source.chr.delete2_ack(fd, char_id, result, delete_date);
}
- if( HPMHooks.count.HP_chr_delete2_ack_post ) {
- void (*postHookFunc) (int *fd, int *char_id, uint32 *result, time_t *delete_date);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_ack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, uint32 result, time_t delete_date);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_ack_post[hIndex].func;
- postHookFunc(&fd, &char_id, &result, &delete_date);
+ postHookFunc(fd, char_id, result, delete_date);
}
}
return;
}
void HP_chr_delete2_accept_actual_ack(int fd, int char_id, uint32 result) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_accept_actual_ack_pre ) {
+ if (HPMHooks.count.HP_chr_delete2_accept_actual_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, uint32 *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_actual_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_actual_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_accept_actual_ack_pre[hIndex].func;
preHookFunc(&fd, &char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3017,25 +2990,25 @@ void HP_chr_delete2_accept_actual_ack(int fd, int char_id, uint32 result) {
{
HPMHooks.source.chr.delete2_accept_actual_ack(fd, char_id, result);
}
- if( HPMHooks.count.HP_chr_delete2_accept_actual_ack_post ) {
- void (*postHookFunc) (int *fd, int *char_id, uint32 *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_actual_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_accept_actual_ack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, uint32 result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_actual_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_accept_actual_ack_post[hIndex].func;
- postHookFunc(&fd, &char_id, &result);
+ postHookFunc(fd, char_id, result);
}
}
return;
}
void HP_chr_delete2_accept_ack(int fd, int char_id, uint32 result) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_accept_ack_pre ) {
+ if (HPMHooks.count.HP_chr_delete2_accept_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, uint32 *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_accept_ack_pre[hIndex].func;
preHookFunc(&fd, &char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3043,25 +3016,25 @@ void HP_chr_delete2_accept_ack(int fd, int char_id, uint32 result) {
{
HPMHooks.source.chr.delete2_accept_ack(fd, char_id, result);
}
- if( HPMHooks.count.HP_chr_delete2_accept_ack_post ) {
- void (*postHookFunc) (int *fd, int *char_id, uint32 *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_accept_ack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, uint32 result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_accept_ack_post[hIndex].func;
- postHookFunc(&fd, &char_id, &result);
+ postHookFunc(fd, char_id, result);
}
}
return;
}
void HP_chr_delete2_cancel_ack(int fd, int char_id, uint32 result) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_cancel_ack_pre ) {
+ if (HPMHooks.count.HP_chr_delete2_cancel_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, uint32 *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_cancel_ack_pre[hIndex].func;
preHookFunc(&fd, &char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3069,25 +3042,25 @@ void HP_chr_delete2_cancel_ack(int fd, int char_id, uint32 result) {
{
HPMHooks.source.chr.delete2_cancel_ack(fd, char_id, result);
}
- if( HPMHooks.count.HP_chr_delete2_cancel_ack_post ) {
- void (*postHookFunc) (int *fd, int *char_id, uint32 *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_cancel_ack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, uint32 result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_cancel_ack_post[hIndex].func;
- postHookFunc(&fd, &char_id, &result);
+ postHookFunc(fd, char_id, result);
}
}
return;
}
void HP_chr_delete2_req(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_req_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_delete2_req_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_req_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_req_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_req_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3095,25 +3068,25 @@ void HP_chr_delete2_req(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.delete2_req(fd, sd);
}
- if( HPMHooks.count.HP_chr_delete2_req_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_req_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_req_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_req_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_req_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_delete2_accept(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_accept_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_delete2_accept_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_accept_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3121,25 +3094,25 @@ void HP_chr_delete2_accept(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.delete2_accept(fd, sd);
}
- if( HPMHooks.count.HP_chr_delete2_accept_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_accept_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_accept_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_accept_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_delete2_cancel(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete2_cancel_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_delete2_cancel_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete2_cancel_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3147,25 +3120,25 @@ void HP_chr_delete2_cancel(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.delete2_cancel(fd, sd);
}
- if( HPMHooks.count.HP_chr_delete2_cancel_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete2_cancel_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete2_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete2_cancel_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_send_account_id(int fd, int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_send_account_id_pre ) {
+ if (HPMHooks.count.HP_chr_send_account_id_pre > 0) {
void (*preHookFunc) (int *fd, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_account_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_account_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_account_id_pre[hIndex].func;
preHookFunc(&fd, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3173,25 +3146,25 @@ void HP_chr_send_account_id(int fd, int account_id) {
{
HPMHooks.source.chr.send_account_id(fd, account_id);
}
- if( HPMHooks.count.HP_chr_send_account_id_post ) {
- void (*postHookFunc) (int *fd, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_account_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_account_id_post > 0) {
+ void (*postHookFunc) (int fd, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_account_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_account_id_post[hIndex].func;
- postHookFunc(&fd, &account_id);
+ postHookFunc(fd, account_id);
}
}
return;
}
void HP_chr_parse_char_connect(int fd, struct char_session_data *sd, uint32 ipl) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_connect_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd, uint32 *ipl);
+ if (HPMHooks.count.HP_chr_parse_char_connect_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd, uint32 *ipl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_connect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_connect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_connect_pre[hIndex].func;
- preHookFunc(&fd, sd, &ipl);
+ preHookFunc(&fd, &sd, &ipl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3199,25 +3172,25 @@ void HP_chr_parse_char_connect(int fd, struct char_session_data *sd, uint32 ipl)
{
HPMHooks.source.chr.parse_char_connect(fd, sd, ipl);
}
- if( HPMHooks.count.HP_chr_parse_char_connect_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd, uint32 *ipl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_connect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_connect_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd, uint32 ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_connect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_connect_post[hIndex].func;
- postHookFunc(&fd, sd, &ipl);
+ postHookFunc(fd, sd, ipl);
}
}
return;
}
void HP_chr_send_map_info(int fd, int i, uint32 subnet_map_ip, struct mmo_charstatus *cd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_send_map_info_pre ) {
- void (*preHookFunc) (int *fd, int *i, uint32 *subnet_map_ip, struct mmo_charstatus *cd);
+ if (HPMHooks.count.HP_chr_send_map_info_pre > 0) {
+ void (*preHookFunc) (int *fd, int *i, uint32 *subnet_map_ip, struct mmo_charstatus **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_map_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_map_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_map_info_pre[hIndex].func;
- preHookFunc(&fd, &i, &subnet_map_ip, cd);
+ preHookFunc(&fd, &i, &subnet_map_ip, &cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3225,25 +3198,25 @@ void HP_chr_send_map_info(int fd, int i, uint32 subnet_map_ip, struct mmo_charst
{
HPMHooks.source.chr.send_map_info(fd, i, subnet_map_ip, cd);
}
- if( HPMHooks.count.HP_chr_send_map_info_post ) {
- void (*postHookFunc) (int *fd, int *i, uint32 *subnet_map_ip, struct mmo_charstatus *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_map_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_map_info_post > 0) {
+ void (*postHookFunc) (int fd, int i, uint32 subnet_map_ip, struct mmo_charstatus *cd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_map_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_map_info_post[hIndex].func;
- postHookFunc(&fd, &i, &subnet_map_ip, cd);
+ postHookFunc(fd, i, subnet_map_ip, cd);
}
}
return;
}
void HP_chr_send_wait_char_server(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_send_wait_char_server_pre ) {
+ if (HPMHooks.count.HP_chr_send_wait_char_server_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_wait_char_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_wait_char_server_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_wait_char_server_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3251,11 +3224,11 @@ void HP_chr_send_wait_char_server(int fd) {
{
HPMHooks.source.chr.send_wait_char_server(fd);
}
- if( HPMHooks.count.HP_chr_send_wait_char_server_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_wait_char_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_wait_char_server_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_wait_char_server_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_wait_char_server_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -3263,14 +3236,14 @@ void HP_chr_send_wait_char_server(int fd) {
int HP_chr_search_default_maps_mapserver(struct mmo_charstatus *cd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_search_default_maps_mapserver_pre ) {
- int (*preHookFunc) (struct mmo_charstatus *cd);
+ if (HPMHooks.count.HP_chr_search_default_maps_mapserver_pre > 0) {
+ int (*preHookFunc) (struct mmo_charstatus **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_default_maps_mapserver_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_default_maps_mapserver_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_search_default_maps_mapserver_pre[hIndex].func;
- retVal___ = preHookFunc(cd);
+ retVal___ = preHookFunc(&cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3278,9 +3251,9 @@ int HP_chr_search_default_maps_mapserver(struct mmo_charstatus *cd) {
{
retVal___ = HPMHooks.source.chr.search_default_maps_mapserver(cd);
}
- if( HPMHooks.count.HP_chr_search_default_maps_mapserver_post ) {
+ if (HPMHooks.count.HP_chr_search_default_maps_mapserver_post > 0) {
int (*postHookFunc) (int retVal___, struct mmo_charstatus *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_default_maps_mapserver_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_search_default_maps_mapserver_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_search_default_maps_mapserver_post[hIndex].func;
retVal___ = postHookFunc(retVal___, cd);
}
@@ -3289,14 +3262,14 @@ int HP_chr_search_default_maps_mapserver(struct mmo_charstatus *cd) {
}
void HP_chr_parse_char_select(int fd, struct char_session_data *sd, uint32 ipl) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_select_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd, uint32 *ipl);
+ if (HPMHooks.count.HP_chr_parse_char_select_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd, uint32 *ipl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_select_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_select_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_select_pre[hIndex].func;
- preHookFunc(&fd, sd, &ipl);
+ preHookFunc(&fd, &sd, &ipl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3304,25 +3277,25 @@ void HP_chr_parse_char_select(int fd, struct char_session_data *sd, uint32 ipl)
{
HPMHooks.source.chr.parse_char_select(fd, sd, ipl);
}
- if( HPMHooks.count.HP_chr_parse_char_select_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd, uint32 *ipl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_select_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_select_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd, uint32 ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_select_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_select_post[hIndex].func;
- postHookFunc(&fd, sd, &ipl);
+ postHookFunc(fd, sd, ipl);
}
}
return;
}
void HP_chr_creation_failed(int fd, int result) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_creation_failed_pre ) {
+ if (HPMHooks.count.HP_chr_creation_failed_pre > 0) {
void (*preHookFunc) (int *fd, int *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_creation_failed_pre[hIndex].func;
preHookFunc(&fd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3330,25 +3303,25 @@ void HP_chr_creation_failed(int fd, int result) {
{
HPMHooks.source.chr.creation_failed(fd, result);
}
- if( HPMHooks.count.HP_chr_creation_failed_post ) {
- void (*postHookFunc) (int *fd, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_creation_failed_post > 0) {
+ void (*postHookFunc) (int fd, int result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_creation_failed_post[hIndex].func;
- postHookFunc(&fd, &result);
+ postHookFunc(fd, result);
}
}
return;
}
void HP_chr_creation_ok(int fd, struct mmo_charstatus *char_dat) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_creation_ok_pre ) {
- void (*preHookFunc) (int *fd, struct mmo_charstatus *char_dat);
+ if (HPMHooks.count.HP_chr_creation_ok_pre > 0) {
+ void (*preHookFunc) (int *fd, struct mmo_charstatus **char_dat);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_creation_ok_pre[hIndex].func;
- preHookFunc(&fd, char_dat);
+ preHookFunc(&fd, &char_dat);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3356,25 +3329,25 @@ void HP_chr_creation_ok(int fd, struct mmo_charstatus *char_dat) {
{
HPMHooks.source.chr.creation_ok(fd, char_dat);
}
- if( HPMHooks.count.HP_chr_creation_ok_post ) {
- void (*postHookFunc) (int *fd, struct mmo_charstatus *char_dat);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_creation_ok_post > 0) {
+ void (*postHookFunc) (int fd, struct mmo_charstatus *char_dat);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_creation_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_creation_ok_post[hIndex].func;
- postHookFunc(&fd, char_dat);
+ postHookFunc(fd, char_dat);
}
}
return;
}
void HP_chr_parse_char_create_new_char(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_create_new_char_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_create_new_char_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_create_new_char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_create_new_char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_create_new_char_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3382,25 +3355,25 @@ void HP_chr_parse_char_create_new_char(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_create_new_char(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_create_new_char_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_create_new_char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_create_new_char_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_create_new_char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_create_new_char_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_delete_char_failed(int fd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete_char_failed_pre ) {
+ if (HPMHooks.count.HP_chr_delete_char_failed_pre > 0) {
void (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete_char_failed_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3408,25 +3381,25 @@ void HP_chr_delete_char_failed(int fd, int flag) {
{
HPMHooks.source.chr.delete_char_failed(fd, flag);
}
- if( HPMHooks.count.HP_chr_delete_char_failed_post ) {
- void (*postHookFunc) (int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete_char_failed_post > 0) {
+ void (*postHookFunc) (int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete_char_failed_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_chr_delete_char_ok(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_delete_char_ok_pre ) {
+ if (HPMHooks.count.HP_chr_delete_char_ok_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_delete_char_ok_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3434,25 +3407,25 @@ void HP_chr_delete_char_ok(int fd) {
{
HPMHooks.source.chr.delete_char_ok(fd);
}
- if( HPMHooks.count.HP_chr_delete_char_ok_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_delete_char_ok_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_delete_char_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_delete_char_ok_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_char_delete_char(int fd, struct char_session_data *sd, unsigned short cmd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_delete_char_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd, unsigned short *cmd);
+ if (HPMHooks.count.HP_chr_parse_char_delete_char_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd, unsigned short *cmd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete_char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete_char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_delete_char_pre[hIndex].func;
- preHookFunc(&fd, sd, &cmd);
+ preHookFunc(&fd, &sd, &cmd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3460,25 +3433,25 @@ void HP_chr_parse_char_delete_char(int fd, struct char_session_data *sd, unsigne
{
HPMHooks.source.chr.parse_char_delete_char(fd, sd, cmd);
}
- if( HPMHooks.count.HP_chr_parse_char_delete_char_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd, unsigned short *cmd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete_char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_delete_char_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd, unsigned short cmd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete_char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_delete_char_post[hIndex].func;
- postHookFunc(&fd, sd, &cmd);
+ postHookFunc(fd, sd, cmd);
}
}
return;
}
void HP_chr_parse_char_ping(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_ping_pre ) {
+ if (HPMHooks.count.HP_chr_parse_char_ping_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_ping_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_ping_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_ping_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3486,25 +3459,25 @@ void HP_chr_parse_char_ping(int fd) {
{
HPMHooks.source.chr.parse_char_ping(fd);
}
- if( HPMHooks.count.HP_chr_parse_char_ping_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_ping_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_ping_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_ping_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_ping_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_allow_rename(int fd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_allow_rename_pre ) {
+ if (HPMHooks.count.HP_chr_allow_rename_pre > 0) {
void (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_allow_rename_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_allow_rename_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_allow_rename_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3512,25 +3485,25 @@ void HP_chr_allow_rename(int fd, int flag) {
{
HPMHooks.source.chr.allow_rename(fd, flag);
}
- if( HPMHooks.count.HP_chr_allow_rename_post ) {
- void (*postHookFunc) (int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_allow_rename_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_allow_rename_post > 0) {
+ void (*postHookFunc) (int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_allow_rename_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_allow_rename_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_chr_parse_char_rename_char(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_rename_char_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_rename_char_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_rename_char_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3538,25 +3511,25 @@ void HP_chr_parse_char_rename_char(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_rename_char(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_rename_char_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_rename_char_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_rename_char_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_rename_char2(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_rename_char2_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_rename_char2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_rename_char2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3564,25 +3537,25 @@ void HP_chr_parse_char_rename_char2(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_rename_char2(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_rename_char2_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_rename_char2_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_rename_char2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_rename_char_ack(int fd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_rename_char_ack_pre ) {
+ if (HPMHooks.count.HP_chr_rename_char_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_rename_char_ack_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3590,25 +3563,25 @@ void HP_chr_rename_char_ack(int fd, int flag) {
{
HPMHooks.source.chr.rename_char_ack(fd, flag);
}
- if( HPMHooks.count.HP_chr_rename_char_ack_post ) {
- void (*postHookFunc) (int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_rename_char_ack_post > 0) {
+ void (*postHookFunc) (int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_rename_char_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_rename_char_ack_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_chr_parse_char_rename_char_confirm(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_rename_char_confirm_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_rename_char_confirm_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_confirm_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_confirm_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_rename_char_confirm_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3616,25 +3589,25 @@ void HP_chr_parse_char_rename_char_confirm(int fd, struct char_session_data *sd)
{
HPMHooks.source.chr.parse_char_rename_char_confirm(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_rename_char_confirm_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_confirm_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_rename_char_confirm_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_rename_char_confirm_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_rename_char_confirm_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_captcha_notsupported(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_captcha_notsupported_pre ) {
+ if (HPMHooks.count.HP_chr_captcha_notsupported_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_captcha_notsupported_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_captcha_notsupported_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_captcha_notsupported_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3642,25 +3615,25 @@ void HP_chr_captcha_notsupported(int fd) {
{
HPMHooks.source.chr.captcha_notsupported(fd);
}
- if( HPMHooks.count.HP_chr_captcha_notsupported_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_captcha_notsupported_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_captcha_notsupported_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_captcha_notsupported_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_captcha_notsupported_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_char_request_captcha(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_request_captcha_pre ) {
+ if (HPMHooks.count.HP_chr_parse_char_request_captcha_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_captcha_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_captcha_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_request_captcha_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3668,25 +3641,25 @@ void HP_chr_parse_char_request_captcha(int fd) {
{
HPMHooks.source.chr.parse_char_request_captcha(fd);
}
- if( HPMHooks.count.HP_chr_parse_char_request_captcha_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_captcha_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_request_captcha_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_captcha_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_request_captcha_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_char_check_captcha(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_check_captcha_pre ) {
+ if (HPMHooks.count.HP_chr_parse_char_check_captcha_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_check_captcha_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_check_captcha_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_check_captcha_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3694,25 +3667,25 @@ void HP_chr_parse_char_check_captcha(int fd) {
{
HPMHooks.source.chr.parse_char_check_captcha(fd);
}
- if( HPMHooks.count.HP_chr_parse_char_check_captcha_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_check_captcha_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_check_captcha_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_check_captcha_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_check_captcha_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chr_parse_char_delete2_req(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_delete2_req_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_delete2_req_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_req_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_req_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_delete2_req_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3720,25 +3693,25 @@ void HP_chr_parse_char_delete2_req(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_delete2_req(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_delete2_req_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_req_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_delete2_req_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_req_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_delete2_req_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_delete2_accept(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_delete2_accept_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_delete2_accept_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_accept_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_accept_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_delete2_accept_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3746,25 +3719,25 @@ void HP_chr_parse_char_delete2_accept(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_delete2_accept(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_delete2_accept_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_accept_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_delete2_accept_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_accept_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_delete2_accept_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_delete2_cancel(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_delete2_cancel_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_delete2_cancel_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_delete2_cancel_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3772,25 +3745,25 @@ void HP_chr_parse_char_delete2_cancel(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_delete2_cancel(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_delete2_cancel_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_cancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_delete2_cancel_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_delete2_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_delete2_cancel_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_login_map_server_ack(int fd, uint8 flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_login_map_server_ack_pre ) {
+ if (HPMHooks.count.HP_chr_login_map_server_ack_pre > 0) {
void (*preHookFunc) (int *fd, uint8 *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_login_map_server_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_login_map_server_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_login_map_server_ack_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3798,25 +3771,25 @@ void HP_chr_login_map_server_ack(int fd, uint8 flag) {
{
HPMHooks.source.chr.login_map_server_ack(fd, flag);
}
- if( HPMHooks.count.HP_chr_login_map_server_ack_post ) {
- void (*postHookFunc) (int *fd, uint8 *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_login_map_server_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_login_map_server_ack_post > 0) {
+ void (*postHookFunc) (int fd, uint8 flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_login_map_server_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_login_map_server_ack_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_chr_parse_char_login_map_server(int fd, uint32 ipl) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_login_map_server_pre ) {
+ if (HPMHooks.count.HP_chr_parse_char_login_map_server_pre > 0) {
void (*preHookFunc) (int *fd, uint32 *ipl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_login_map_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_login_map_server_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_login_map_server_pre[hIndex].func;
preHookFunc(&fd, &ipl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3824,25 +3797,25 @@ void HP_chr_parse_char_login_map_server(int fd, uint32 ipl) {
{
HPMHooks.source.chr.parse_char_login_map_server(fd, ipl);
}
- if( HPMHooks.count.HP_chr_parse_char_login_map_server_post ) {
- void (*postHookFunc) (int *fd, uint32 *ipl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_login_map_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_login_map_server_post > 0) {
+ void (*postHookFunc) (int fd, uint32 ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_login_map_server_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_login_map_server_post[hIndex].func;
- postHookFunc(&fd, &ipl);
+ postHookFunc(fd, ipl);
}
}
return;
}
void HP_chr_parse_char_pincode_check(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_pincode_check_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_pincode_check_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_check_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3850,25 +3823,25 @@ void HP_chr_parse_char_pincode_check(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_pincode_check(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_pincode_check_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_pincode_check_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_check_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_pincode_window(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_pincode_window_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_pincode_window_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_window_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_window_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_window_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3876,25 +3849,25 @@ void HP_chr_parse_char_pincode_window(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_pincode_window(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_pincode_window_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_window_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_pincode_window_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_window_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_window_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_pincode_change(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_pincode_change_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_pincode_change_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_change_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3902,25 +3875,25 @@ void HP_chr_parse_char_pincode_change(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_pincode_change(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_pincode_change_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_pincode_change_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_change_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_pincode_first_pin(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_pincode_first_pin_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_pincode_first_pin_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_first_pin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_first_pin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_first_pin_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3928,25 +3901,25 @@ void HP_chr_parse_char_pincode_first_pin(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_pincode_first_pin(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_pincode_first_pin_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_first_pin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_pincode_first_pin_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pincode_first_pin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_pincode_first_pin_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_parse_char_request_chars(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_request_chars_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_request_chars_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_chars_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_chars_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_request_chars_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3954,25 +3927,25 @@ void HP_chr_parse_char_request_chars(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_request_chars(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_request_chars_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_chars_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_request_chars_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_request_chars_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_request_chars_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_chr_change_character_slot_ack(int fd, bool ret) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_change_character_slot_ack_pre ) {
+ if (HPMHooks.count.HP_chr_change_character_slot_ack_pre > 0) {
void (*preHookFunc) (int *fd, bool *ret);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_character_slot_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_character_slot_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_change_character_slot_ack_pre[hIndex].func;
preHookFunc(&fd, &ret);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3980,25 +3953,25 @@ void HP_chr_change_character_slot_ack(int fd, bool ret) {
{
HPMHooks.source.chr.change_character_slot_ack(fd, ret);
}
- if( HPMHooks.count.HP_chr_change_character_slot_ack_post ) {
- void (*postHookFunc) (int *fd, bool *ret);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_character_slot_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_change_character_slot_ack_post > 0) {
+ void (*postHookFunc) (int fd, bool ret);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_change_character_slot_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_change_character_slot_ack_post[hIndex].func;
- postHookFunc(&fd, &ret);
+ postHookFunc(fd, ret);
}
}
return;
}
void HP_chr_parse_char_move_character(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_parse_char_move_character_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_chr_parse_char_move_character_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_move_character_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_move_character_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_move_character_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4006,11 +3979,11 @@ void HP_chr_parse_char_move_character(int fd, struct char_session_data *sd) {
{
HPMHooks.source.chr.parse_char_move_character(fd, sd);
}
- if( HPMHooks.count.HP_chr_parse_char_move_character_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_move_character_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_move_character_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_move_character_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_move_character_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
@@ -4018,14 +3991,14 @@ void HP_chr_parse_char_move_character(int fd, struct char_session_data *sd) {
int HP_chr_parse_char_unknown_packet(int fd, uint32 ipl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_parse_char_unknown_packet_pre ) {
+ if (HPMHooks.count.HP_chr_parse_char_unknown_packet_pre > 0) {
int (*preHookFunc) (int *fd, uint32 *ipl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_unknown_packet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_unknown_packet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_unknown_packet_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &ipl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4033,11 +4006,11 @@ int HP_chr_parse_char_unknown_packet(int fd, uint32 ipl) {
{
retVal___ = HPMHooks.source.chr.parse_char_unknown_packet(fd, ipl);
}
- if( HPMHooks.count.HP_chr_parse_char_unknown_packet_post ) {
- int (*postHookFunc) (int retVal___, int *fd, uint32 *ipl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_unknown_packet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_unknown_packet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, uint32 ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_unknown_packet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_unknown_packet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &ipl);
+ retVal___ = postHookFunc(retVal___, fd, ipl);
}
}
return retVal___;
@@ -4045,14 +4018,14 @@ int HP_chr_parse_char_unknown_packet(int fd, uint32 ipl) {
int HP_chr_parse_char(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_parse_char_pre ) {
+ if (HPMHooks.count.HP_chr_parse_char_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_parse_char_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4060,11 +4033,11 @@ int HP_chr_parse_char(int fd) {
{
retVal___ = HPMHooks.source.chr.parse_char(fd);
}
- if( HPMHooks.count.HP_chr_parse_char_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_parse_char_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_parse_char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_parse_char_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -4072,14 +4045,14 @@ int HP_chr_parse_char(int fd) {
int HP_chr_broadcast_user_count(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_broadcast_user_count_pre ) {
+ if (HPMHooks.count.HP_chr_broadcast_user_count_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_broadcast_user_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_broadcast_user_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_broadcast_user_count_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4087,28 +4060,28 @@ int HP_chr_broadcast_user_count(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.chr.broadcast_user_count(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chr_broadcast_user_count_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_broadcast_user_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_broadcast_user_count_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_broadcast_user_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_broadcast_user_count_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-int HP_chr_send_accounts_tologin_sub(DBKey key, DBData *data, va_list ap) {
+int HP_chr_send_accounts_tologin_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_send_accounts_tologin_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chr_send_accounts_tologin_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chr_send_accounts_tologin_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4118,12 +4091,12 @@ int HP_chr_send_accounts_tologin_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chr.send_accounts_tologin_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chr_send_accounts_tologin_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_accounts_tologin_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chr_send_accounts_tologin_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -4132,14 +4105,14 @@ int HP_chr_send_accounts_tologin_sub(DBKey key, DBData *data, va_list ap) {
int HP_chr_send_accounts_tologin(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_send_accounts_tologin_pre ) {
+ if (HPMHooks.count.HP_chr_send_accounts_tologin_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_send_accounts_tologin_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4147,11 +4120,11 @@ int HP_chr_send_accounts_tologin(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.chr.send_accounts_tologin(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chr_send_accounts_tologin_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_send_accounts_tologin_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_send_accounts_tologin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_send_accounts_tologin_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -4159,14 +4132,14 @@ int HP_chr_send_accounts_tologin(int tid, int64 tick, int id, intptr_t data) {
int HP_chr_check_connect_login_server(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_check_connect_login_server_pre ) {
+ if (HPMHooks.count.HP_chr_check_connect_login_server_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_connect_login_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_connect_login_server_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_check_connect_login_server_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4174,28 +4147,28 @@ int HP_chr_check_connect_login_server(int tid, int64 tick, int id, intptr_t data
{
retVal___ = HPMHooks.source.chr.check_connect_login_server(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chr_check_connect_login_server_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_connect_login_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_check_connect_login_server_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_check_connect_login_server_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_check_connect_login_server_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-int HP_chr_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) {
+int HP_chr_online_data_cleanup_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_online_data_cleanup_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chr_online_data_cleanup_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chr_online_data_cleanup_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4205,12 +4178,12 @@ int HP_chr_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chr.online_data_cleanup_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chr_online_data_cleanup_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_online_data_cleanup_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chr_online_data_cleanup_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -4219,14 +4192,14 @@ int HP_chr_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) {
int HP_chr_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chr_online_data_cleanup_pre ) {
+ if (HPMHooks.count.HP_chr_online_data_cleanup_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_online_data_cleanup_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4234,105 +4207,484 @@ int HP_chr_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.chr.online_data_cleanup(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chr_online_data_cleanup_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_online_data_cleanup_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_online_data_cleanup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_online_data_cleanup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-void HP_chr_sql_config_read(const char *cfgName) {
+bool HP_chr_sql_config_read(const char *filename, bool imported) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_sql_config_read_pre ) {
- void (*preHookFunc) (const char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_sql_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_sql_config_read_pre[hIndex].func;
- preHookFunc(cfgName);
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.chr.sql_config_read(cfgName);
+ retVal___ = HPMHooks.source.chr.sql_config_read(filename, imported);
}
- if( HPMHooks.count.HP_chr_sql_config_read_post ) {
- void (*postHookFunc) (const char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_sql_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_sql_config_read_post[hIndex].func;
- postHookFunc(cfgName);
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
- return;
+ return retVal___;
}
-void HP_chr_config_dispatch(char *w1, char *w2) {
+bool HP_chr_sql_config_read_registry(const char *filename, const struct config_t *config, bool imported) {
int hIndex = 0;
- if( HPMHooks.count.HP_chr_config_dispatch_pre ) {
- void (*preHookFunc) (char *w1, char *w2);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_sql_config_read_registry_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_dispatch_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_chr_config_dispatch_pre[hIndex].func;
- preHookFunc(w1, w2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_registry_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_sql_config_read_registry_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.chr.config_dispatch(w1, w2);
+ retVal___ = HPMHooks.source.chr.sql_config_read_registry(filename, config, imported);
}
- if( HPMHooks.count.HP_chr_config_dispatch_post ) {
- void (*postHookFunc) (char *w1, char *w2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_dispatch_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_chr_config_dispatch_post[hIndex].func;
- postHookFunc(w1, w2);
+ if (HPMHooks.count.HP_chr_sql_config_read_registry_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_registry_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_sql_config_read_registry_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
}
}
- return;
+ return retVal___;
}
-int HP_chr_config_read(const char *cfgName) {
+bool HP_chr_sql_config_read_pc(const char *filename, const struct config_t *config, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_chr_config_read_pre ) {
- int (*preHookFunc) (const char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_sql_config_read_pc_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pc_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_sql_config_read_pc_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.sql_config_read_pc(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_sql_config_read_pc_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pc_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_sql_config_read_pc_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_sql_config_read_guild(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_sql_config_read_guild_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_guild_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_sql_config_read_guild_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.sql_config_read_guild(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_sql_config_read_guild_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_guild_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_sql_config_read_guild_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read(const char *filename, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chr_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.chr.config_read(cfgName);
+ retVal___ = HPMHooks.source.chr.config_read(filename, imported);
}
- if( HPMHooks.count.HP_chr_config_read_post ) {
- int (*postHookFunc) (int retVal___, const char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chr_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chr_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
return retVal___;
}
-/* cmdline */
+bool HP_chr_config_read_database(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_database_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_database_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_database_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_database(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_database_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_database_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_database_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_console(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_console_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_console_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_console_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_console(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_console_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_console_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_console_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_player_fame(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_player_fame_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_fame_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_player_fame_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_player_fame(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_player_fame_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_fame_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_player_fame_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_player_deletion(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_player_deletion_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_deletion_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_player_deletion_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_player_deletion(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_player_deletion_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_deletion_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_player_deletion_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_player_name(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_player_name_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_name_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_player_name_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_player_name(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_player_name_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_name_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_player_name_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+void HP_chr_config_set_start_item(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_chr_config_set_start_item_pre > 0) {
+ void (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_start_item_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_set_start_item_pre[hIndex].func;
+ preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.chr.config_set_start_item(setting);
+ }
+ if (HPMHooks.count.HP_chr_config_set_start_item_post > 0) {
+ void (*postHookFunc) (const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_start_item_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_set_start_item_post[hIndex].func;
+ postHookFunc(setting);
+ }
+ }
+ return;
+}
+bool HP_chr_config_read_player_new(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_player_new_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_new_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_player_new_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_player_new(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_player_new_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_new_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_player_new_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_player(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_player_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_player_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_player(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_player_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_player_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_permission(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_permission_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_permission_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_permission_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_permission(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_permission_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_permission_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_permission_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_set_ip(const char *type, const char *value, uint32 *out_ip, char *out_ip_str) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_set_ip_pre > 0) {
+ bool (*preHookFunc) (const char **type, const char **value, uint32 **out_ip, char **out_ip_str);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_ip_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_set_ip_pre[hIndex].func;
+ retVal___ = preHookFunc(&type, &value, &out_ip, &out_ip_str);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_set_ip(type, value, out_ip, out_ip_str);
+ }
+ if (HPMHooks.count.HP_chr_config_set_ip_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *type, const char *value, uint32 *out_ip, char *out_ip_str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_ip_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_set_ip_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, type, value, out_ip, out_ip_str);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_inter(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_inter_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_inter_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_inter_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_inter(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_inter_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_inter_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_inter_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_chr_config_read_top(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_chr_config_read_top_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_top_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_chr_config_read_top_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.chr.config_read_top(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_chr_config_read_top_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_top_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_chr_config_read_top_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+/* cmdline_interface */
void HP_cmdline_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_cmdline_init_pre ) {
+ if (HPMHooks.count.HP_cmdline_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4340,9 +4692,9 @@ void HP_cmdline_init(void) {
{
HPMHooks.source.cmdline.init();
}
- if( HPMHooks.count.HP_cmdline_init_post ) {
+ if (HPMHooks.count.HP_cmdline_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_init_post[hIndex].func;
postHookFunc();
}
@@ -4351,14 +4703,14 @@ void HP_cmdline_init(void) {
}
void HP_cmdline_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_cmdline_final_pre ) {
+ if (HPMHooks.count.HP_cmdline_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4366,9 +4718,9 @@ void HP_cmdline_final(void) {
{
HPMHooks.source.cmdline.final();
}
- if( HPMHooks.count.HP_cmdline_final_post ) {
+ if (HPMHooks.count.HP_cmdline_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_final_post[hIndex].func;
postHookFunc();
}
@@ -4378,14 +4730,14 @@ void HP_cmdline_final(void) {
bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_cmdline_arg_add_pre ) {
- bool (*preHookFunc) (unsigned int *pluginID, const char *name, char *shortname, CmdlineExecFunc *func, const char *help, unsigned int *options);
+ if (HPMHooks.count.HP_cmdline_arg_add_pre > 0) {
+ bool (*preHookFunc) (unsigned int *pluginID, const char **name, char *shortname, CmdlineExecFunc *func, const char **help, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_add_pre[hIndex].func;
- retVal___ = preHookFunc(&pluginID, name, &shortname, &func, help, &options);
+ retVal___ = preHookFunc(&pluginID, &name, &shortname, &func, &help, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4393,11 +4745,11 @@ bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname,
{
retVal___ = HPMHooks.source.cmdline.arg_add(pluginID, name, shortname, func, help, options);
}
- if( HPMHooks.count.HP_cmdline_arg_add_post ) {
- bool (*postHookFunc) (bool retVal___, unsigned int *pluginID, const char *name, char *shortname, CmdlineExecFunc *func, const char *help, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_arg_add_post > 0) {
+ bool (*postHookFunc) (bool retVal___, unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pluginID, name, &shortname, &func, help, &options);
+ retVal___ = postHookFunc(retVal___, pluginID, name, shortname, func, help, options);
}
}
return retVal___;
@@ -4405,14 +4757,14 @@ bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname,
int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_cmdline_exec_pre ) {
- int (*preHookFunc) (int *argc, char **argv, unsigned int *options);
+ if (HPMHooks.count.HP_cmdline_exec_pre > 0) {
+ int (*preHookFunc) (int *argc, char ***argv, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_exec_pre[hIndex].func;
- retVal___ = preHookFunc(&argc, argv, &options);
+ retVal___ = preHookFunc(&argc, &argv, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4420,11 +4772,11 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
{
retVal___ = HPMHooks.source.cmdline.exec(argc, argv, options);
}
- if( HPMHooks.count.HP_cmdline_exec_post ) {
- int (*postHookFunc) (int retVal___, int *argc, char **argv, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_exec_post > 0) {
+ int (*postHookFunc) (int retVal___, int argc, char **argv, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_exec_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &argc, argv, &options);
+ retVal___ = postHookFunc(retVal___, argc, argv, options);
}
}
return retVal___;
@@ -4432,14 +4784,14 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_cmdline_arg_next_value_pre ) {
- bool (*preHookFunc) (const char *name, int *current_arg, int *argc);
+ if (HPMHooks.count.HP_cmdline_arg_next_value_pre > 0) {
+ bool (*preHookFunc) (const char **name, int *current_arg, int *argc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_pre[hIndex].func;
- retVal___ = preHookFunc(name, &current_arg, &argc);
+ retVal___ = preHookFunc(&name, &current_arg, &argc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4447,11 +4799,11 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
{
retVal___ = HPMHooks.source.cmdline.arg_next_value(name, current_arg, argc);
}
- if( HPMHooks.count.HP_cmdline_arg_next_value_post ) {
- bool (*postHookFunc) (bool retVal___, const char *name, int *current_arg, int *argc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_arg_next_value_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *name, int current_arg, int argc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &current_arg, &argc);
+ retVal___ = postHookFunc(retVal___, name, current_arg, argc);
}
}
return retVal___;
@@ -4459,14 +4811,14 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_cmdline_arg_source_pre ) {
- const char* (*preHookFunc) (struct CmdlineArgData *arg);
+ if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) {
+ const char* (*preHookFunc) (struct CmdlineArgData **arg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func;
- retVal___ = preHookFunc(arg);
+ retVal___ = preHookFunc(&arg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4474,26 +4826,26 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) {
{
retVal___ = HPMHooks.source.cmdline.arg_source(arg);
}
- if( HPMHooks.count.HP_cmdline_arg_source_post ) {
+ if (HPMHooks.count.HP_cmdline_arg_source_post > 0) {
const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func;
retVal___ = postHookFunc(retVal___, arg);
}
}
return retVal___;
}
-/* console */
+/* console_interface */
void HP_console_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_init_pre ) {
+ if (HPMHooks.count.HP_console_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4501,9 +4853,9 @@ void HP_console_init(void) {
{
HPMHooks.source.console.init();
}
- if( HPMHooks.count.HP_console_init_post ) {
+ if (HPMHooks.count.HP_console_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_init_post[hIndex].func;
postHookFunc();
}
@@ -4512,14 +4864,14 @@ void HP_console_init(void) {
}
void HP_console_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_final_pre ) {
+ if (HPMHooks.count.HP_console_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4527,9 +4879,9 @@ void HP_console_final(void) {
{
HPMHooks.source.console.final();
}
- if( HPMHooks.count.HP_console_final_post ) {
+ if (HPMHooks.count.HP_console_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_final_post[hIndex].func;
postHookFunc();
}
@@ -4538,14 +4890,14 @@ void HP_console_final(void) {
}
void HP_console_display_title(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_display_title_pre ) {
+ if (HPMHooks.count.HP_console_display_title_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_display_title_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4553,9 +4905,9 @@ void HP_console_display_title(void) {
{
HPMHooks.source.console.display_title();
}
- if( HPMHooks.count.HP_console_display_title_post ) {
+ if (HPMHooks.count.HP_console_display_title_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_display_title_post[hIndex].func;
postHookFunc();
}
@@ -4564,14 +4916,14 @@ void HP_console_display_title(void) {
}
void HP_console_display_gplnotice(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_display_gplnotice_pre ) {
+ if (HPMHooks.count.HP_console_display_gplnotice_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4579,26 +4931,26 @@ void HP_console_display_gplnotice(void) {
{
HPMHooks.source.console.display_gplnotice();
}
- if( HPMHooks.count.HP_console_display_gplnotice_post ) {
+ if (HPMHooks.count.HP_console_display_gplnotice_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* core */
+/* core_interface */
void HP_core_shutdown_callback(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_core_shutdown_callback_pre ) {
+ if (HPMHooks.count.HP_core_shutdown_callback_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_core_shutdown_callback_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4606,27 +4958,27 @@ void HP_core_shutdown_callback(void) {
{
HPMHooks.source.core.shutdown_callback();
}
- if( HPMHooks.count.HP_core_shutdown_callback_post ) {
+ if (HPMHooks.count.HP_core_shutdown_callback_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_core_shutdown_callback_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* DB */
-DBOptions HP_DB_fix_options(DBType type, DBOptions options) {
+/* db_interface */
+enum DBOptions HP_DB_fix_options(enum DBType type, enum DBOptions options) {
int hIndex = 0;
- DBOptions retVal___ = DB_OPT_BASE;
- if( HPMHooks.count.HP_DB_fix_options_pre ) {
- DBOptions (*preHookFunc) (DBType *type, DBOptions *options);
+ enum DBOptions retVal___ = DB_OPT_BASE;
+ if (HPMHooks.count.HP_DB_fix_options_pre > 0) {
+ enum DBOptions (*preHookFunc) (enum DBType *type, enum DBOptions *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_fix_options_pre[hIndex].func;
retVal___ = preHookFunc(&type, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4634,26 +4986,26 @@ DBOptions HP_DB_fix_options(DBType type, DBOptions options) {
{
retVal___ = HPMHooks.source.DB.fix_options(type, options);
}
- if( HPMHooks.count.HP_DB_fix_options_post ) {
- DBOptions (*postHookFunc) (DBOptions retVal___, DBType *type, DBOptions *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_fix_options_post > 0) {
+ enum DBOptions (*postHookFunc) (enum DBOptions retVal___, enum DBType type, enum DBOptions options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_fix_options_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &options);
+ retVal___ = postHookFunc(retVal___, type, options);
}
}
return retVal___;
}
-DBComparator HP_DB_default_cmp(DBType type) {
+DBComparator HP_DB_default_cmp(enum DBType type) {
int hIndex = 0;
DBComparator retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_cmp_pre ) {
- DBComparator (*preHookFunc) (DBType *type);
+ if (HPMHooks.count.HP_DB_default_cmp_pre > 0) {
+ DBComparator (*preHookFunc) (enum DBType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_cmp_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4661,26 +5013,26 @@ DBComparator HP_DB_default_cmp(DBType type) {
{
retVal___ = HPMHooks.source.DB.default_cmp(type);
}
- if( HPMHooks.count.HP_DB_default_cmp_post ) {
- DBComparator (*postHookFunc) (DBComparator retVal___, DBType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_cmp_post > 0) {
+ DBComparator (*postHookFunc) (DBComparator retVal___, enum DBType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_cmp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-DBHasher HP_DB_default_hash(DBType type) {
+DBHasher HP_DB_default_hash(enum DBType type) {
int hIndex = 0;
DBHasher retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_hash_pre ) {
- DBHasher (*preHookFunc) (DBType *type);
+ if (HPMHooks.count.HP_DB_default_hash_pre > 0) {
+ DBHasher (*preHookFunc) (enum DBType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_hash_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4688,26 +5040,26 @@ DBHasher HP_DB_default_hash(DBType type) {
{
retVal___ = HPMHooks.source.DB.default_hash(type);
}
- if( HPMHooks.count.HP_DB_default_hash_post ) {
- DBHasher (*postHookFunc) (DBHasher retVal___, DBType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_hash_post > 0) {
+ DBHasher (*postHookFunc) (DBHasher retVal___, enum DBType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_hash_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-DBReleaser HP_DB_default_release(DBType type, DBOptions options) {
+DBReleaser HP_DB_default_release(enum DBType type, enum DBOptions options) {
int hIndex = 0;
DBReleaser retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_release_pre ) {
- DBReleaser (*preHookFunc) (DBType *type, DBOptions *options);
+ if (HPMHooks.count.HP_DB_default_release_pre > 0) {
+ DBReleaser (*preHookFunc) (enum DBType *type, enum DBOptions *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_release_pre[hIndex].func;
retVal___ = preHookFunc(&type, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4715,26 +5067,26 @@ DBReleaser HP_DB_default_release(DBType type, DBOptions options) {
{
retVal___ = HPMHooks.source.DB.default_release(type, options);
}
- if( HPMHooks.count.HP_DB_default_release_post ) {
- DBReleaser (*postHookFunc) (DBReleaser retVal___, DBType *type, DBOptions *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_release_post > 0) {
+ DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBType type, enum DBOptions options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_release_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &options);
+ retVal___ = postHookFunc(retVal___, type, options);
}
}
return retVal___;
}
-DBReleaser HP_DB_custom_release(DBRelease which) {
+DBReleaser HP_DB_custom_release(enum DBReleaseOption which) {
int hIndex = 0;
DBReleaser retVal___ = NULL;
- if( HPMHooks.count.HP_DB_custom_release_pre ) {
- DBReleaser (*preHookFunc) (DBRelease *which);
+ if (HPMHooks.count.HP_DB_custom_release_pre > 0) {
+ DBReleaser (*preHookFunc) (enum DBReleaseOption *which);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_custom_release_pre[hIndex].func;
retVal___ = preHookFunc(&which);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4742,26 +5094,26 @@ DBReleaser HP_DB_custom_release(DBRelease which) {
{
retVal___ = HPMHooks.source.DB.custom_release(which);
}
- if( HPMHooks.count.HP_DB_custom_release_post ) {
- DBReleaser (*postHookFunc) (DBReleaser retVal___, DBRelease *which);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_custom_release_post > 0) {
+ DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBReleaseOption which);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_custom_release_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &which);
+ retVal___ = postHookFunc(retVal___, which);
}
}
return retVal___;
}
-DBMap* HP_DB_alloc(const char *file, const char *func, int line, DBType type, DBOptions options, unsigned short maxlen) {
+struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) {
int hIndex = 0;
- DBMap* retVal___ = NULL;
- if( HPMHooks.count.HP_DB_alloc_pre ) {
- DBMap* (*preHookFunc) (const char *file, const char *func, int *line, DBType *type, DBOptions *options, unsigned short *maxlen);
+ struct DBMap* retVal___ = NULL;
+ if (HPMHooks.count.HP_DB_alloc_pre > 0) {
+ struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func;
- retVal___ = preHookFunc(file, func, &line, &type, &options, &maxlen);
+ retVal___ = preHookFunc(&file, &func, &line, &type, &options, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4769,27 +5121,26 @@ DBMap* HP_DB_alloc(const char *file, const char *func, int line, DBType type, DB
{
retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen);
}
- if( HPMHooks.count.HP_DB_alloc_post ) {
- DBMap* (*postHookFunc) (DBMap* retVal___, const char *file, const char *func, int *line, DBType *type, DBOptions *options, unsigned short *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_alloc_post > 0) {
+ struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, file, func, &line, &type, &options, &maxlen);
+ retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen);
}
}
return retVal___;
}
-DBKey HP_DB_i2key(int key) {
+union DBKey HP_DB_i2key(int key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_i2key_pre ) {
- DBKey (*preHookFunc) (int *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i2key_pre > 0) {
+ union DBKey (*preHookFunc) (int *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i2key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4797,27 +5148,26 @@ DBKey HP_DB_i2key(int key) {
{
retVal___ = HPMHooks.source.DB.i2key(key);
}
- if( HPMHooks.count.HP_DB_i2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, int *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, int key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i2key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_ui2key(unsigned int key) {
+union DBKey HP_DB_ui2key(unsigned int key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_ui2key_pre ) {
- DBKey (*preHookFunc) (unsigned int *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui2key_pre > 0) {
+ union DBKey (*preHookFunc) (unsigned int *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui2key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4825,27 +5175,26 @@ DBKey HP_DB_ui2key(unsigned int key) {
{
retVal___ = HPMHooks.source.DB.ui2key(key);
}
- if( HPMHooks.count.HP_DB_ui2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, unsigned int *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, unsigned int key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui2key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_str2key(const char *key) {
+union DBKey HP_DB_str2key(const char *key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_str2key_pre ) {
- DBKey (*preHookFunc) (const char *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_str2key_pre > 0) {
+ union DBKey (*preHookFunc) (const char **key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_str2key_pre[hIndex].func;
- retVal___ = preHookFunc(key);
+ retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4853,27 +5202,26 @@ DBKey HP_DB_str2key(const char *key) {
{
retVal___ = HPMHooks.source.DB.str2key(key);
}
- if( HPMHooks.count.HP_DB_str2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, const char *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_str2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, const char *key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_str2key_post[hIndex].func;
retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_i642key(int64 key) {
+union DBKey HP_DB_i642key(int64 key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_i642key_pre ) {
- DBKey (*preHookFunc) (int64 *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i642key_pre > 0) {
+ union DBKey (*preHookFunc) (int64 *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i642key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4881,27 +5229,26 @@ DBKey HP_DB_i642key(int64 key) {
{
retVal___ = HPMHooks.source.DB.i642key(key);
}
- if( HPMHooks.count.HP_DB_i642key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, int64 *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i642key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, int64 key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i642key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_ui642key(uint64 key) {
+union DBKey HP_DB_ui642key(uint64 key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_ui642key_pre ) {
- DBKey (*preHookFunc) (uint64 *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui642key_pre > 0) {
+ union DBKey (*preHookFunc) (uint64 *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui642key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4909,27 +5256,26 @@ DBKey HP_DB_ui642key(uint64 key) {
{
retVal___ = HPMHooks.source.DB.ui642key(key);
}
- if( HPMHooks.count.HP_DB_ui642key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, uint64 *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui642key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, uint64 key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui642key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBData HP_DB_i2data(int data) {
+struct DBData HP_DB_i2data(int data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_i2data_pre ) {
- DBData (*preHookFunc) (int *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i2data_pre > 0) {
+ struct DBData (*preHookFunc) (int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i2data_pre[hIndex].func;
retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4937,27 +5283,26 @@ DBData HP_DB_i2data(int data) {
{
retVal___ = HPMHooks.source.DB.i2data(data);
}
- if( HPMHooks.count.HP_DB_i2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i2data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &data);
+ retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-DBData HP_DB_ui2data(unsigned int data) {
+struct DBData HP_DB_ui2data(unsigned int data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_ui2data_pre ) {
- DBData (*preHookFunc) (unsigned int *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui2data_pre > 0) {
+ struct DBData (*preHookFunc) (unsigned int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui2data_pre[hIndex].func;
retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4965,27 +5310,26 @@ DBData HP_DB_ui2data(unsigned int data) {
{
retVal___ = HPMHooks.source.DB.ui2data(data);
}
- if( HPMHooks.count.HP_DB_ui2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, unsigned int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, unsigned int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui2data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &data);
+ retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-DBData HP_DB_ptr2data(void *data) {
+struct DBData HP_DB_ptr2data(void *data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_ptr2data_pre ) {
- DBData (*preHookFunc) (void *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ptr2data_pre > 0) {
+ struct DBData (*preHookFunc) (void **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ptr2data_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4993,26 +5337,26 @@ DBData HP_DB_ptr2data(void *data) {
{
retVal___ = HPMHooks.source.DB.ptr2data(data);
}
- if( HPMHooks.count.HP_DB_ptr2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, void *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ptr2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, void *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ptr2data_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-int HP_DB_data2i(DBData *data) {
+int HP_DB_data2i(struct DBData *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_DB_data2i_pre ) {
- int (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2i_pre > 0) {
+ int (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2i_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5020,26 +5364,26 @@ int HP_DB_data2i(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2i(data);
}
- if( HPMHooks.count.HP_DB_data2i_post ) {
- int (*postHookFunc) (int retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2i_post > 0) {
+ int (*postHookFunc) (int retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2i_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-unsigned int HP_DB_data2ui(DBData *data) {
+unsigned int HP_DB_data2ui(struct DBData *data) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_DB_data2ui_pre ) {
- unsigned int (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2ui_pre > 0) {
+ unsigned int (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2ui_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5047,26 +5391,26 @@ unsigned int HP_DB_data2ui(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2ui(data);
}
- if( HPMHooks.count.HP_DB_data2ui_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2ui_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2ui_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-void* HP_DB_data2ptr(DBData *data) {
+void* HP_DB_data2ptr(struct DBData *data) {
int hIndex = 0;
void* retVal___ = NULL;
- if( HPMHooks.count.HP_DB_data2ptr_pre ) {
- void* (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2ptr_pre > 0) {
+ void* (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5074,9 +5418,9 @@ void* HP_DB_data2ptr(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2ptr(data);
}
- if( HPMHooks.count.HP_DB_data2ptr_post ) {
- void* (*postHookFunc) (void* retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2ptr_post > 0) {
+ void* (*postHookFunc) (void* retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -5085,14 +5429,14 @@ void* HP_DB_data2ptr(DBData *data) {
}
void HP_DB_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_DB_init_pre ) {
+ if (HPMHooks.count.HP_DB_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5100,9 +5444,9 @@ void HP_DB_init(void) {
{
HPMHooks.source.DB.init();
}
- if( HPMHooks.count.HP_DB_init_post ) {
+ if (HPMHooks.count.HP_DB_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_init_post[hIndex].func;
postHookFunc();
}
@@ -5111,14 +5455,14 @@ void HP_DB_init(void) {
}
void HP_DB_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_DB_final_pre ) {
+ if (HPMHooks.count.HP_DB_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5126,27 +5470,80 @@ void HP_DB_final(void) {
{
HPMHooks.source.DB.final();
}
- if( HPMHooks.count.HP_DB_final_post ) {
+ if (HPMHooks.count.HP_DB_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* geoip */
+/* des_interface */
+void HP_des_decrypt_block(struct des_bit64 *block) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_des_decrypt_block_pre > 0) {
+ void (*preHookFunc) (struct des_bit64 **block);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func;
+ preHookFunc(&block);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.des.decrypt_block(block);
+ }
+ if (HPMHooks.count.HP_des_decrypt_block_post > 0) {
+ void (*postHookFunc) (struct des_bit64 *block);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func;
+ postHookFunc(block);
+ }
+ }
+ return;
+}
+void HP_des_decrypt(unsigned char *data, size_t size) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_des_decrypt_pre > 0) {
+ void (*preHookFunc) (unsigned char **data, size_t *size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func;
+ preHookFunc(&data, &size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.des.decrypt(data, size);
+ }
+ if (HPMHooks.count.HP_des_decrypt_post > 0) {
+ void (*postHookFunc) (unsigned char *data, size_t size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func;
+ postHookFunc(data, size);
+ }
+ }
+ return;
+}
+/* geoip_interface */
const char* HP_geoip_getcountry(uint32 ipnum) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_geoip_getcountry_pre ) {
+ if (HPMHooks.count.HP_geoip_getcountry_pre > 0) {
const char* (*preHookFunc) (uint32 *ipnum);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_geoip_getcountry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_getcountry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_geoip_getcountry_pre[hIndex].func;
retVal___ = preHookFunc(&ipnum);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5154,25 +5551,25 @@ const char* HP_geoip_getcountry(uint32 ipnum) {
{
retVal___ = HPMHooks.source.geoip.getcountry(ipnum);
}
- if( HPMHooks.count.HP_geoip_getcountry_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint32 *ipnum);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_geoip_getcountry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_geoip_getcountry_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint32 ipnum);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_getcountry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_geoip_getcountry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ipnum);
+ retVal___ = postHookFunc(retVal___, ipnum);
}
}
return retVal___;
}
void HP_geoip_final(bool shutdown) {
int hIndex = 0;
- if( HPMHooks.count.HP_geoip_final_pre ) {
+ if (HPMHooks.count.HP_geoip_final_pre > 0) {
void (*preHookFunc) (bool *shutdown);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_geoip_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_geoip_final_pre[hIndex].func;
preHookFunc(&shutdown);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5180,25 +5577,25 @@ void HP_geoip_final(bool shutdown) {
{
HPMHooks.source.geoip.final(shutdown);
}
- if( HPMHooks.count.HP_geoip_final_post ) {
- void (*postHookFunc) (bool *shutdown);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_geoip_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_geoip_final_post > 0) {
+ void (*postHookFunc) (bool shutdown);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_geoip_final_post[hIndex].func;
- postHookFunc(&shutdown);
+ postHookFunc(shutdown);
}
}
return;
}
void HP_geoip_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_geoip_init_pre ) {
+ if (HPMHooks.count.HP_geoip_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_geoip_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_geoip_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5206,27 +5603,27 @@ void HP_geoip_init(void) {
{
HPMHooks.source.geoip.init();
}
- if( HPMHooks.count.HP_geoip_init_post ) {
+ if (HPMHooks.count.HP_geoip_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_geoip_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_geoip_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_geoip_init_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* inter_auction */
+/* inter_auction_interface */
int HP_inter_auction_count(int char_id, bool buy) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_auction_count_pre ) {
+ if (HPMHooks.count.HP_inter_auction_count_pre > 0) {
int (*preHookFunc) (int *char_id, bool *buy);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_count_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &buy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5234,25 +5631,25 @@ int HP_inter_auction_count(int char_id, bool buy) {
{
retVal___ = HPMHooks.source.inter_auction.count(char_id, buy);
}
- if( HPMHooks.count.HP_inter_auction_count_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, bool *buy);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_auction_count_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, bool buy);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_count_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &buy);
+ retVal___ = postHookFunc(retVal___, char_id, buy);
}
}
return retVal___;
}
void HP_inter_auction_save(struct auction_data *auction) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_auction_save_pre ) {
- void (*preHookFunc) (struct auction_data *auction);
+ if (HPMHooks.count.HP_inter_auction_save_pre > 0) {
+ void (*preHookFunc) (struct auction_data **auction);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_save_pre[hIndex].func;
- preHookFunc(auction);
+ preHookFunc(&auction);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5260,9 +5657,9 @@ void HP_inter_auction_save(struct auction_data *auction) {
{
HPMHooks.source.inter_auction.save(auction);
}
- if( HPMHooks.count.HP_inter_auction_save_post ) {
+ if (HPMHooks.count.HP_inter_auction_save_post > 0) {
void (*postHookFunc) (struct auction_data *auction);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_save_post[hIndex].func;
postHookFunc(auction);
}
@@ -5272,14 +5669,14 @@ void HP_inter_auction_save(struct auction_data *auction) {
unsigned int HP_inter_auction_create(struct auction_data *auction) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_inter_auction_create_pre ) {
- unsigned int (*preHookFunc) (struct auction_data *auction);
+ if (HPMHooks.count.HP_inter_auction_create_pre > 0) {
+ unsigned int (*preHookFunc) (struct auction_data **auction);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_create_pre[hIndex].func;
- retVal___ = preHookFunc(auction);
+ retVal___ = preHookFunc(&auction);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5287,9 +5684,9 @@ unsigned int HP_inter_auction_create(struct auction_data *auction) {
{
retVal___ = HPMHooks.source.inter_auction.create(auction);
}
- if( HPMHooks.count.HP_inter_auction_create_post ) {
+ if (HPMHooks.count.HP_inter_auction_create_post > 0) {
unsigned int (*postHookFunc) (unsigned int retVal___, struct auction_data *auction);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_create_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___, auction);
}
@@ -5299,14 +5696,14 @@ unsigned int HP_inter_auction_create(struct auction_data *auction) {
int HP_inter_auction_end_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_auction_end_timer_pre ) {
+ if (HPMHooks.count.HP_inter_auction_end_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_end_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_end_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_end_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5314,25 +5711,25 @@ int HP_inter_auction_end_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.inter_auction.end_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_inter_auction_end_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_end_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_auction_end_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_end_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_end_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_inter_auction_delete_(struct auction_data *auction) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_auction_delete__pre ) {
- void (*preHookFunc) (struct auction_data *auction);
+ if (HPMHooks.count.HP_inter_auction_delete__pre > 0) {
+ void (*preHookFunc) (struct auction_data **auction);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_delete__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_delete__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_delete__pre[hIndex].func;
- preHookFunc(auction);
+ preHookFunc(&auction);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5340,9 +5737,9 @@ void HP_inter_auction_delete_(struct auction_data *auction) {
{
HPMHooks.source.inter_auction.delete_(auction);
}
- if( HPMHooks.count.HP_inter_auction_delete__post ) {
+ if (HPMHooks.count.HP_inter_auction_delete__post > 0) {
void (*postHookFunc) (struct auction_data *auction);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_delete__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_delete__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_delete__post[hIndex].func;
postHookFunc(auction);
}
@@ -5351,14 +5748,14 @@ void HP_inter_auction_delete_(struct auction_data *auction) {
}
void HP_inter_auction_fromsql(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_auction_fromsql_pre ) {
+ if (HPMHooks.count.HP_inter_auction_fromsql_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_fromsql_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5366,9 +5763,9 @@ void HP_inter_auction_fromsql(void) {
{
HPMHooks.source.inter_auction.fromsql();
}
- if( HPMHooks.count.HP_inter_auction_fromsql_post ) {
+ if (HPMHooks.count.HP_inter_auction_fromsql_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_fromsql_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_fromsql_post[hIndex].func;
postHookFunc();
}
@@ -5378,14 +5775,14 @@ void HP_inter_auction_fromsql(void) {
int HP_inter_auction_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_auction_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_auction_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5393,11 +5790,11 @@ int HP_inter_auction_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_auction.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_auction_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_auction_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -5405,14 +5802,14 @@ int HP_inter_auction_parse_frommap(int fd) {
int HP_inter_auction_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_auction_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_auction_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5420,9 +5817,9 @@ int HP_inter_auction_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_auction.sql_init();
}
- if( HPMHooks.count.HP_inter_auction_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_auction_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -5431,14 +5828,14 @@ int HP_inter_auction_sql_init(void) {
}
void HP_inter_auction_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_auction_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_auction_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_auction_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5446,26 +5843,26 @@ void HP_inter_auction_sql_final(void) {
{
HPMHooks.source.inter_auction.sql_final();
}
- if( HPMHooks.count.HP_inter_auction_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_auction_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_auction_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_auction_sql_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* inter_elemental */
+/* inter_elemental_interface */
void HP_inter_elemental_sql_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_elemental_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_elemental_sql_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_elemental_sql_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5473,9 +5870,9 @@ void HP_inter_elemental_sql_init(void) {
{
HPMHooks.source.inter_elemental.sql_init();
}
- if( HPMHooks.count.HP_inter_elemental_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_elemental_sql_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_elemental_sql_init_post[hIndex].func;
postHookFunc();
}
@@ -5484,14 +5881,14 @@ void HP_inter_elemental_sql_init(void) {
}
void HP_inter_elemental_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_elemental_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_elemental_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_elemental_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5499,9 +5896,9 @@ void HP_inter_elemental_sql_final(void) {
{
HPMHooks.source.inter_elemental.sql_final();
}
- if( HPMHooks.count.HP_inter_elemental_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_elemental_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_elemental_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -5511,14 +5908,14 @@ void HP_inter_elemental_sql_final(void) {
int HP_inter_elemental_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_elemental_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_elemental_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_elemental_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5526,27 +5923,27 @@ int HP_inter_elemental_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_elemental.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_elemental_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_elemental_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_elemental_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_elemental_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* inter_guild */
+/* inter_guild_interface */
int HP_inter_guild_save_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_save_timer_pre ) {
+ if (HPMHooks.count.HP_inter_guild_save_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_save_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_save_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_save_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5554,11 +5951,11 @@ int HP_inter_guild_save_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.inter_guild.save_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_inter_guild_save_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_save_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_save_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_save_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_save_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -5566,14 +5963,14 @@ int HP_inter_guild_save_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_inter_guild_removemember_tosql(int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_removemember_tosql_pre ) {
+ if (HPMHooks.count.HP_inter_guild_removemember_tosql_pre > 0) {
int (*preHookFunc) (int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_removemember_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_removemember_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_removemember_tosql_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5581,11 +5978,11 @@ int HP_inter_guild_removemember_tosql(int account_id, int char_id) {
{
retVal___ = HPMHooks.source.inter_guild.removemember_tosql(account_id, char_id);
}
- if( HPMHooks.count.HP_inter_guild_removemember_tosql_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_removemember_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_removemember_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_removemember_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_removemember_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, account_id, char_id);
}
}
return retVal___;
@@ -5593,14 +5990,14 @@ int HP_inter_guild_removemember_tosql(int account_id, int char_id) {
int HP_inter_guild_tosql(struct guild *g, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_tosql_pre ) {
- int (*preHookFunc) (struct guild *g, int *flag);
+ if (HPMHooks.count.HP_inter_guild_tosql_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(g, &flag);
+ retVal___ = preHookFunc(&g, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5608,11 +6005,11 @@ int HP_inter_guild_tosql(struct guild *g, int flag) {
{
retVal___ = HPMHooks.source.inter_guild.tosql(g, flag);
}
- if( HPMHooks.count.HP_inter_guild_tosql_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &flag);
+ retVal___ = postHookFunc(retVal___, g, flag);
}
}
return retVal___;
@@ -5620,14 +6017,14 @@ int HP_inter_guild_tosql(struct guild *g, int flag) {
struct guild* HP_inter_guild_fromsql(int guild_id) {
int hIndex = 0;
struct guild* retVal___ = NULL;
- if( HPMHooks.count.HP_inter_guild_fromsql_pre ) {
+ if (HPMHooks.count.HP_inter_guild_fromsql_pre > 0) {
struct guild* (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_fromsql_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5635,11 +6032,11 @@ struct guild* HP_inter_guild_fromsql(int guild_id) {
{
retVal___ = HPMHooks.source.inter_guild.fromsql(guild_id);
}
- if( HPMHooks.count.HP_inter_guild_fromsql_post ) {
- struct guild* (*postHookFunc) (struct guild* retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_fromsql_post > 0) {
+ struct guild* (*postHookFunc) (struct guild* retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -5647,14 +6044,14 @@ struct guild* HP_inter_guild_fromsql(int guild_id) {
int HP_inter_guild_castle_tosql(struct guild_castle *gc) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_castle_tosql_pre ) {
- int (*preHookFunc) (struct guild_castle *gc);
+ if (HPMHooks.count.HP_inter_guild_castle_tosql_pre > 0) {
+ int (*preHookFunc) (struct guild_castle **gc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_castle_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(gc);
+ retVal___ = preHookFunc(&gc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5662,9 +6059,9 @@ int HP_inter_guild_castle_tosql(struct guild_castle *gc) {
{
retVal___ = HPMHooks.source.inter_guild.castle_tosql(gc);
}
- if( HPMHooks.count.HP_inter_guild_castle_tosql_post ) {
+ if (HPMHooks.count.HP_inter_guild_castle_tosql_post > 0) {
int (*postHookFunc) (int retVal___, struct guild_castle *gc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_tosql_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_castle_tosql_post[hIndex].func;
retVal___ = postHookFunc(retVal___, gc);
}
@@ -5674,14 +6071,14 @@ int HP_inter_guild_castle_tosql(struct guild_castle *gc) {
struct guild_castle* HP_inter_guild_castle_fromsql(int castle_id) {
int hIndex = 0;
struct guild_castle* retVal___ = NULL;
- if( HPMHooks.count.HP_inter_guild_castle_fromsql_pre ) {
+ if (HPMHooks.count.HP_inter_guild_castle_fromsql_pre > 0) {
struct guild_castle* (*preHookFunc) (int *castle_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_castle_fromsql_pre[hIndex].func;
retVal___ = preHookFunc(&castle_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5689,11 +6086,11 @@ struct guild_castle* HP_inter_guild_castle_fromsql(int castle_id) {
{
retVal___ = HPMHooks.source.inter_guild.castle_fromsql(castle_id);
}
- if( HPMHooks.count.HP_inter_guild_castle_fromsql_post ) {
- struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, int *castle_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_castle_fromsql_post > 0) {
+ struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, int castle_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_castle_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_castle_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &castle_id);
+ retVal___ = postHookFunc(retVal___, castle_id);
}
}
return retVal___;
@@ -5701,14 +6098,14 @@ struct guild_castle* HP_inter_guild_castle_fromsql(int castle_id) {
bool HP_inter_guild_exp_parse_row(char *split[], int column, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_guild_exp_parse_row_pre ) {
- bool (*preHookFunc) (char *split[], int *column, int *current);
+ if (HPMHooks.count.HP_inter_guild_exp_parse_row_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *column, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_exp_parse_row_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_exp_parse_row_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_exp_parse_row_pre[hIndex].func;
- retVal___ = preHookFunc(split, &column, &current);
+ retVal___ = preHookFunc(&split, &column, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5716,11 +6113,11 @@ bool HP_inter_guild_exp_parse_row(char *split[], int column, int current) {
{
retVal___ = HPMHooks.source.inter_guild.exp_parse_row(split, column, current);
}
- if( HPMHooks.count.HP_inter_guild_exp_parse_row_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *column, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_exp_parse_row_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_exp_parse_row_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int column, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_exp_parse_row_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_exp_parse_row_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &column, &current);
+ retVal___ = postHookFunc(retVal___, split, column, current);
}
}
return retVal___;
@@ -5728,14 +6125,14 @@ bool HP_inter_guild_exp_parse_row(char *split[], int column, int current) {
int HP_inter_guild_CharOnline(int char_id, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_CharOnline_pre ) {
+ if (HPMHooks.count.HP_inter_guild_CharOnline_pre > 0) {
int (*preHookFunc) (int *char_id, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOnline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOnline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_CharOnline_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5743,11 +6140,11 @@ int HP_inter_guild_CharOnline(int char_id, int guild_id) {
{
retVal___ = HPMHooks.source.inter_guild.CharOnline(char_id, guild_id);
}
- if( HPMHooks.count.HP_inter_guild_CharOnline_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOnline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_CharOnline_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOnline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_CharOnline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &guild_id);
+ retVal___ = postHookFunc(retVal___, char_id, guild_id);
}
}
return retVal___;
@@ -5755,14 +6152,14 @@ int HP_inter_guild_CharOnline(int char_id, int guild_id) {
int HP_inter_guild_CharOffline(int char_id, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_CharOffline_pre ) {
+ if (HPMHooks.count.HP_inter_guild_CharOffline_pre > 0) {
int (*preHookFunc) (int *char_id, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOffline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOffline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_CharOffline_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5770,11 +6167,11 @@ int HP_inter_guild_CharOffline(int char_id, int guild_id) {
{
retVal___ = HPMHooks.source.inter_guild.CharOffline(char_id, guild_id);
}
- if( HPMHooks.count.HP_inter_guild_CharOffline_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOffline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_CharOffline_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_CharOffline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_CharOffline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &guild_id);
+ retVal___ = postHookFunc(retVal___, char_id, guild_id);
}
}
return retVal___;
@@ -5782,14 +6179,14 @@ int HP_inter_guild_CharOffline(int char_id, int guild_id) {
int HP_inter_guild_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_guild_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5797,28 +6194,28 @@ int HP_inter_guild_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_guild.sql_init();
}
- if( HPMHooks.count.HP_inter_guild_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_guild_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-int HP_inter_guild_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_inter_guild_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_inter_guild_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_inter_guild_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5828,12 +6225,12 @@ int HP_inter_guild_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.inter_guild.db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_inter_guild_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_inter_guild_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -5841,14 +6238,14 @@ int HP_inter_guild_db_final(DBKey key, DBData *data, va_list ap) {
}
void HP_inter_guild_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_guild_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_guild_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5856,26 +6253,26 @@ void HP_inter_guild_sql_final(void) {
{
HPMHooks.source.inter_guild.sql_final();
}
- if( HPMHooks.count.HP_inter_guild_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_guild_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_sql_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-int HP_inter_guild_search_guildname(char *str) {
+int HP_inter_guild_search_guildname(const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_search_guildname_pre ) {
- int (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_inter_guild_search_guildname_pre > 0) {
+ int (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_search_guildname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_search_guildname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_search_guildname_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5883,9 +6280,9 @@ int HP_inter_guild_search_guildname(char *str) {
{
retVal___ = HPMHooks.source.inter_guild.search_guildname(str);
}
- if( HPMHooks.count.HP_inter_guild_search_guildname_post ) {
- int (*postHookFunc) (int retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_search_guildname_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_search_guildname_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_search_guildname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_search_guildname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -5895,14 +6292,14 @@ int HP_inter_guild_search_guildname(char *str) {
bool HP_inter_guild_check_empty(struct guild *g) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_guild_check_empty_pre ) {
- bool (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_inter_guild_check_empty_pre > 0) {
+ bool (*preHookFunc) (struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_check_empty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_check_empty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_check_empty_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5910,9 +6307,9 @@ bool HP_inter_guild_check_empty(struct guild *g) {
{
retVal___ = HPMHooks.source.inter_guild.check_empty(g);
}
- if( HPMHooks.count.HP_inter_guild_check_empty_post ) {
+ if (HPMHooks.count.HP_inter_guild_check_empty_post > 0) {
bool (*postHookFunc) (bool retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_check_empty_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_check_empty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_check_empty_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
@@ -5922,14 +6319,14 @@ bool HP_inter_guild_check_empty(struct guild *g) {
unsigned int HP_inter_guild_nextexp(int level) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_nextexp_pre ) {
+ if (HPMHooks.count.HP_inter_guild_nextexp_pre > 0) {
unsigned int (*preHookFunc) (int *level);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_nextexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_nextexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_nextexp_pre[hIndex].func;
retVal___ = preHookFunc(&level);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5937,11 +6334,11 @@ unsigned int HP_inter_guild_nextexp(int level) {
{
retVal___ = HPMHooks.source.inter_guild.nextexp(level);
}
- if( HPMHooks.count.HP_inter_guild_nextexp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, int *level);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_nextexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_nextexp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, int level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_nextexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_nextexp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &level);
+ retVal___ = postHookFunc(retVal___, level);
}
}
return retVal___;
@@ -5949,14 +6346,14 @@ unsigned int HP_inter_guild_nextexp(int level) {
int HP_inter_guild_checkskill(struct guild *g, int id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_checkskill_pre ) {
- int (*preHookFunc) (struct guild *g, int *id);
+ if (HPMHooks.count.HP_inter_guild_checkskill_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_checkskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_checkskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_checkskill_pre[hIndex].func;
- retVal___ = preHookFunc(g, &id);
+ retVal___ = preHookFunc(&g, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5964,11 +6361,11 @@ int HP_inter_guild_checkskill(struct guild *g, int id) {
{
retVal___ = HPMHooks.source.inter_guild.checkskill(g, id);
}
- if( HPMHooks.count.HP_inter_guild_checkskill_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_checkskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_checkskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_checkskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_checkskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &id);
+ retVal___ = postHookFunc(retVal___, g, id);
}
}
return retVal___;
@@ -5976,14 +6373,14 @@ int HP_inter_guild_checkskill(struct guild *g, int id) {
int HP_inter_guild_calcinfo(struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_calcinfo_pre ) {
- int (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_inter_guild_calcinfo_pre > 0) {
+ int (*preHookFunc) (struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_calcinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_calcinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_calcinfo_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5991,9 +6388,9 @@ int HP_inter_guild_calcinfo(struct guild *g) {
{
retVal___ = HPMHooks.source.inter_guild.calcinfo(g);
}
- if( HPMHooks.count.HP_inter_guild_calcinfo_post ) {
+ if (HPMHooks.count.HP_inter_guild_calcinfo_post > 0) {
int (*postHookFunc) (int retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_calcinfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_calcinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_calcinfo_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
@@ -6003,14 +6400,14 @@ int HP_inter_guild_calcinfo(struct guild *g) {
int HP_inter_guild_sex_changed(int guild_id, int account_id, int char_id, short gender) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_sex_changed_pre ) {
+ if (HPMHooks.count.HP_inter_guild_sex_changed_pre > 0) {
int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, short *gender);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sex_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sex_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_sex_changed_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &gender);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6018,11 +6415,11 @@ int HP_inter_guild_sex_changed(int guild_id, int account_id, int char_id, short
{
retVal___ = HPMHooks.source.inter_guild.sex_changed(guild_id, account_id, char_id, gender);
}
- if( HPMHooks.count.HP_inter_guild_sex_changed_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, short *gender);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sex_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_sex_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, short gender);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_sex_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_sex_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &gender);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, gender);
}
}
return retVal___;
@@ -6030,14 +6427,14 @@ int HP_inter_guild_sex_changed(int guild_id, int account_id, int char_id, short
int HP_inter_guild_charname_changed(int guild_id, int account_id, int char_id, char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_charname_changed_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, char *name);
+ if (HPMHooks.count.HP_inter_guild_charname_changed_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_charname_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_charname_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_charname_changed_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, name);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6045,11 +6442,11 @@ int HP_inter_guild_charname_changed(int guild_id, int account_id, int char_id, c
{
retVal___ = HPMHooks.source.inter_guild.charname_changed(guild_id, account_id, char_id, name);
}
- if( HPMHooks.count.HP_inter_guild_charname_changed_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_charname_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_charname_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_charname_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_charname_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, name);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, name);
}
}
return retVal___;
@@ -6057,14 +6454,14 @@ int HP_inter_guild_charname_changed(int guild_id, int account_id, int char_id, c
int HP_inter_guild_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_guild_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6072,11 +6469,11 @@ int HP_inter_guild_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_guild.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_guild_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -6084,14 +6481,14 @@ int HP_inter_guild_parse_frommap(int fd) {
int HP_inter_guild_leave(int guild_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_leave_pre ) {
+ if (HPMHooks.count.HP_inter_guild_leave_pre > 0) {
int (*preHookFunc) (int *guild_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_leave_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6099,11 +6496,11 @@ int HP_inter_guild_leave(int guild_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.inter_guild.leave(guild_id, account_id, char_id);
}
- if( HPMHooks.count.HP_inter_guild_leave_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id);
}
}
return retVal___;
@@ -6111,14 +6508,14 @@ int HP_inter_guild_leave(int guild_id, int account_id, int char_id) {
int HP_inter_guild_broken(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_guild_broken_pre ) {
+ if (HPMHooks.count.HP_inter_guild_broken_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_broken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_broken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_guild_broken_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6126,27 +6523,27 @@ int HP_inter_guild_broken(int guild_id) {
{
retVal___ = HPMHooks.source.inter_guild.broken(guild_id);
}
- if( HPMHooks.count.HP_inter_guild_broken_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_broken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_guild_broken_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_guild_broken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_guild_broken_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
}
-/* inter_homunculus */
+/* inter_homunculus_interface */
int HP_inter_homunculus_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_homunculus_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_homunculus_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_homunculus_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6154,9 +6551,9 @@ int HP_inter_homunculus_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_homunculus.sql_init();
}
- if( HPMHooks.count.HP_inter_homunculus_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_homunculus_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_homunculus_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6165,14 +6562,14 @@ int HP_inter_homunculus_sql_init(void) {
}
void HP_inter_homunculus_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_homunculus_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_homunculus_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_homunculus_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6180,9 +6577,9 @@ void HP_inter_homunculus_sql_final(void) {
{
HPMHooks.source.inter_homunculus.sql_final();
}
- if( HPMHooks.count.HP_inter_homunculus_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_homunculus_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_homunculus_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -6192,14 +6589,14 @@ void HP_inter_homunculus_sql_final(void) {
int HP_inter_homunculus_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_homunculus_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_homunculus_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_homunculus_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6207,27 +6604,27 @@ int HP_inter_homunculus_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_homunculus.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_homunculus_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_homunculus_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_homunculus_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_homunculus_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* inter */
+/* inter_interface */
const char* HP_inter_msg_txt(int msg_number) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_inter_msg_txt_pre ) {
+ if (HPMHooks.count.HP_inter_msg_txt_pre > 0) {
const char* (*preHookFunc) (int *msg_number);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_txt_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_txt_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_msg_txt_pre[hIndex].func;
retVal___ = preHookFunc(&msg_number);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6235,11 +6632,11 @@ const char* HP_inter_msg_txt(int msg_number) {
{
retVal___ = HPMHooks.source.inter.msg_txt(msg_number);
}
- if( HPMHooks.count.HP_inter_msg_txt_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *msg_number);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_txt_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_msg_txt_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int msg_number);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_txt_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_msg_txt_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &msg_number);
+ retVal___ = postHookFunc(retVal___, msg_number);
}
}
return retVal___;
@@ -6247,14 +6644,14 @@ const char* HP_inter_msg_txt(int msg_number) {
bool HP_inter_msg_config_read(const char *cfg_name, bool allow_override) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_msg_config_read_pre ) {
- bool (*preHookFunc) (const char *cfg_name, bool *allow_override);
+ if (HPMHooks.count.HP_inter_msg_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **cfg_name, bool *allow_override);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_msg_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfg_name, &allow_override);
+ retVal___ = preHookFunc(&cfg_name, &allow_override);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6262,25 +6659,25 @@ bool HP_inter_msg_config_read(const char *cfg_name, bool allow_override) {
{
retVal___ = HPMHooks.source.inter.msg_config_read(cfg_name, allow_override);
}
- if( HPMHooks.count.HP_inter_msg_config_read_post ) {
- bool (*postHookFunc) (bool retVal___, const char *cfg_name, bool *allow_override);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_msg_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *cfg_name, bool allow_override);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_msg_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_msg_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfg_name, &allow_override);
+ retVal___ = postHookFunc(retVal___, cfg_name, allow_override);
}
}
return retVal___;
}
void HP_inter_do_final_msg(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_do_final_msg_pre ) {
+ if (HPMHooks.count.HP_inter_do_final_msg_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_do_final_msg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_do_final_msg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_do_final_msg_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6288,54 +6685,54 @@ void HP_inter_do_final_msg(void) {
{
HPMHooks.source.inter.do_final_msg();
}
- if( HPMHooks.count.HP_inter_do_final_msg_post ) {
+ if (HPMHooks.count.HP_inter_do_final_msg_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_do_final_msg_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_do_final_msg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_do_final_msg_post[hIndex].func;
postHookFunc();
}
}
return;
}
-const char* HP_inter_job_name(int class_) {
+const char* HP_inter_job_name(int class) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_inter_job_name_pre ) {
- const char* (*preHookFunc) (int *class_);
+ if (HPMHooks.count.HP_inter_job_name_pre > 0) {
+ const char* (*preHookFunc) (int *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_job_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_job_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_job_name_pre[hIndex].func;
- retVal___ = preHookFunc(&class_);
+ retVal___ = preHookFunc(&class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.inter.job_name(class_);
+ retVal___ = HPMHooks.source.inter.job_name(class);
}
- if( HPMHooks.count.HP_inter_job_name_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_job_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_job_name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_job_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_job_name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class);
}
}
return retVal___;
}
void HP_inter_vmsg_to_fd(int fd, int u_fd, int aid, char *msg, va_list ap) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_vmsg_to_fd_pre ) {
- void (*preHookFunc) (int *fd, int *u_fd, int *aid, char *msg, va_list ap);
+ if (HPMHooks.count.HP_inter_vmsg_to_fd_pre > 0) {
+ void (*preHookFunc) (int *fd, int *u_fd, int *aid, char **msg, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_vmsg_to_fd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_vmsg_to_fd_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_inter_vmsg_to_fd_pre[hIndex].func;
- preHookFunc(&fd, &u_fd, &aid, msg, ap___copy);
+ preHookFunc(&fd, &u_fd, &aid, &msg, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6345,12 +6742,12 @@ void HP_inter_vmsg_to_fd(int fd, int u_fd, int aid, char *msg, va_list ap) {
HPMHooks.source.inter.vmsg_to_fd(fd, u_fd, aid, msg, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_inter_vmsg_to_fd_post ) {
- void (*postHookFunc) (int *fd, int *u_fd, int *aid, char *msg, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_vmsg_to_fd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_vmsg_to_fd_post > 0) {
+ void (*postHookFunc) (int fd, int u_fd, int aid, char *msg, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_vmsg_to_fd_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_inter_vmsg_to_fd_post[hIndex].func;
- postHookFunc(&fd, &u_fd, &aid, msg, ap___copy);
+ postHookFunc(fd, u_fd, aid, msg, ap___copy);
va_end(ap___copy);
}
}
@@ -6358,14 +6755,14 @@ void HP_inter_vmsg_to_fd(int fd, int u_fd, int aid, char *msg, va_list ap) {
}
void HP_inter_savereg(int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_savereg_pre ) {
- void (*preHookFunc) (int *account_id, int *char_id, const char *key, unsigned int *index, intptr_t *val, bool *is_string);
+ if (HPMHooks.count.HP_inter_savereg_pre > 0) {
+ void (*preHookFunc) (int *account_id, int *char_id, const char **key, unsigned int *index, intptr_t *val, bool *is_string);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_savereg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_savereg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_savereg_pre[hIndex].func;
- preHookFunc(&account_id, &char_id, key, &index, &val, &is_string);
+ preHookFunc(&account_id, &char_id, &key, &index, &val, &is_string);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6373,11 +6770,11 @@ void HP_inter_savereg(int account_id, int char_id, const char *key, unsigned int
{
HPMHooks.source.inter.savereg(account_id, char_id, key, index, val, is_string);
}
- if( HPMHooks.count.HP_inter_savereg_post ) {
- void (*postHookFunc) (int *account_id, int *char_id, const char *key, unsigned int *index, intptr_t *val, bool *is_string);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_savereg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_savereg_post > 0) {
+ void (*postHookFunc) (int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_savereg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_savereg_post[hIndex].func;
- postHookFunc(&account_id, &char_id, key, &index, &val, &is_string);
+ postHookFunc(account_id, char_id, key, index, val, is_string);
}
}
return;
@@ -6385,14 +6782,14 @@ void HP_inter_savereg(int account_id, int char_id, const char *key, unsigned int
int HP_inter_accreg_fromsql(int account_id, int char_id, int fd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_accreg_fromsql_pre ) {
+ if (HPMHooks.count.HP_inter_accreg_fromsql_pre > 0) {
int (*preHookFunc) (int *account_id, int *char_id, int *fd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_accreg_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_accreg_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_accreg_fromsql_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id, &fd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6400,38 +6797,11 @@ int HP_inter_accreg_fromsql(int account_id, int char_id, int fd, int type) {
{
retVal___ = HPMHooks.source.inter.accreg_fromsql(account_id, char_id, fd, type);
}
- if( HPMHooks.count.HP_inter_accreg_fromsql_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *char_id, int *fd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_accreg_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_accreg_fromsql_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int char_id, int fd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_accreg_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_accreg_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id, &fd, &type);
- }
- }
- return retVal___;
-}
-int HP_inter_config_read(const char *cfgName) {
- int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_inter_config_read_pre ) {
- int (*preHookFunc) (const char *cfgName);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_inter_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.inter.config_read(cfgName);
- }
- if( HPMHooks.count.HP_inter_config_read_post ) {
- int (*postHookFunc) (int retVal___, const char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_inter_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ retVal___ = postHookFunc(retVal___, account_id, char_id, fd, type);
}
}
return retVal___;
@@ -6439,16 +6809,16 @@ int HP_inter_config_read(const char *cfgName) {
int HP_inter_vlog(char *fmt, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_vlog_pre ) {
- int (*preHookFunc) (char *fmt, va_list ap);
+ if (HPMHooks.count.HP_inter_vlog_pre > 0) {
+ int (*preHookFunc) (char **fmt, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_vlog_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_vlog_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_inter_vlog_pre[hIndex].func;
- retVal___ = preHookFunc(fmt, ap___copy);
+ retVal___ = preHookFunc(&fmt, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6458,9 +6828,9 @@ int HP_inter_vlog(char *fmt, va_list ap) {
retVal___ = HPMHooks.source.inter.vlog(fmt, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_inter_vlog_post ) {
+ if (HPMHooks.count.HP_inter_vlog_post > 0) {
int (*postHookFunc) (int retVal___, char *fmt, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_vlog_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_vlog_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_inter_vlog_post[hIndex].func;
retVal___ = postHookFunc(retVal___, fmt, ap___copy);
@@ -6472,14 +6842,14 @@ int HP_inter_vlog(char *fmt, va_list ap) {
int HP_inter_init_sql(const char *file) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_init_sql_pre ) {
- int (*preHookFunc) (const char *file);
+ if (HPMHooks.count.HP_inter_init_sql_pre > 0) {
+ int (*preHookFunc) (const char **file);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_init_sql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_init_sql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_init_sql_pre[hIndex].func;
- retVal___ = preHookFunc(file);
+ retVal___ = preHookFunc(&file);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6487,9 +6857,9 @@ int HP_inter_init_sql(const char *file) {
{
retVal___ = HPMHooks.source.inter.init_sql(file);
}
- if( HPMHooks.count.HP_inter_init_sql_post ) {
+ if (HPMHooks.count.HP_inter_init_sql_post > 0) {
int (*postHookFunc) (int retVal___, const char *file);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_init_sql_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_init_sql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_init_sql_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file);
}
@@ -6499,14 +6869,14 @@ int HP_inter_init_sql(const char *file) {
int HP_inter_mapif_init(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mapif_init_pre ) {
+ if (HPMHooks.count.HP_inter_mapif_init_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mapif_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mapif_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mapif_init_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6514,28 +6884,28 @@ int HP_inter_mapif_init(int fd) {
{
retVal___ = HPMHooks.source.inter.mapif_init(fd);
}
- if( HPMHooks.count.HP_inter_mapif_init_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mapif_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mapif_init_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mapif_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mapif_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-int HP_inter_check_ttl_wisdata_sub(DBKey key, DBData *data, va_list ap) {
+int HP_inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6545,12 +6915,12 @@ int HP_inter_check_ttl_wisdata_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.inter.check_ttl_wisdata_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -6559,14 +6929,14 @@ int HP_inter_check_ttl_wisdata_sub(DBKey key, DBData *data, va_list ap) {
int HP_inter_check_ttl_wisdata(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_check_ttl_wisdata_pre ) {
+ if (HPMHooks.count.HP_inter_check_ttl_wisdata_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6574,9 +6944,9 @@ int HP_inter_check_ttl_wisdata(void) {
{
retVal___ = HPMHooks.source.inter.check_ttl_wisdata();
}
- if( HPMHooks.count.HP_inter_check_ttl_wisdata_post ) {
+ if (HPMHooks.count.HP_inter_check_ttl_wisdata_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_ttl_wisdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_check_ttl_wisdata_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6586,14 +6956,14 @@ int HP_inter_check_ttl_wisdata(void) {
int HP_inter_check_length(int fd, int length) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_check_length_pre ) {
+ if (HPMHooks.count.HP_inter_check_length_pre > 0) {
int (*preHookFunc) (int *fd, int *length);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_check_length_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &length);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6601,11 +6971,11 @@ int HP_inter_check_length(int fd, int length) {
{
retVal___ = HPMHooks.source.inter.check_length(fd, length);
}
- if( HPMHooks.count.HP_inter_check_length_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *length);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_length_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_check_length_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int length);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_check_length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_check_length_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &length);
+ retVal___ = postHookFunc(retVal___, fd, length);
}
}
return retVal___;
@@ -6613,14 +6983,14 @@ int HP_inter_check_length(int fd, int length) {
int HP_inter_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6628,25 +6998,25 @@ int HP_inter_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_inter_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_final_pre ) {
+ if (HPMHooks.count.HP_inter_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6654,27 +7024,108 @@ void HP_inter_final(void) {
{
HPMHooks.source.inter.final();
}
- if( HPMHooks.count.HP_inter_final_post ) {
+ if (HPMHooks.count.HP_inter_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* inter_mail */
+bool HP_inter_config_read(const char *filename, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_inter_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_inter_config_read_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.inter.config_read(filename, imported);
+ }
+ if (HPMHooks.count.HP_inter_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_inter_config_read_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_inter_config_read_log(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_inter_config_read_log_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_log_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_inter_config_read_log_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.inter.config_read_log(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_inter_config_read_log_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_log_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_inter_config_read_log_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_inter_config_read_connection_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_connection_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_inter_config_read_connection_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.inter.config_read_connection(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_inter_config_read_connection_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_connection_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_inter_config_read_connection_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+/* inter_mail_interface */
int HP_inter_mail_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mail_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_mail_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6682,9 +7133,9 @@ int HP_inter_mail_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_mail.sql_init();
}
- if( HPMHooks.count.HP_inter_mail_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_mail_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6693,14 +7144,14 @@ int HP_inter_mail_sql_init(void) {
}
void HP_inter_mail_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_mail_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_mail_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6708,9 +7159,9 @@ void HP_inter_mail_sql_final(void) {
{
HPMHooks.source.inter_mail.sql_final();
}
- if( HPMHooks.count.HP_inter_mail_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_mail_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -6720,14 +7171,14 @@ void HP_inter_mail_sql_final(void) {
int HP_inter_mail_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mail_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_mail_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6735,11 +7186,11 @@ int HP_inter_mail_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_mail.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_mail_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mail_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -6747,14 +7198,14 @@ int HP_inter_mail_parse_frommap(int fd) {
int HP_inter_mail_fromsql(int char_id, struct mail_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mail_fromsql_pre ) {
- int (*preHookFunc) (int *char_id, struct mail_data *md);
+ if (HPMHooks.count.HP_inter_mail_fromsql_pre > 0) {
+ int (*preHookFunc) (int *char_id, struct mail_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, md);
+ retVal___ = preHookFunc(&char_id, &md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6762,11 +7213,11 @@ int HP_inter_mail_fromsql(int char_id, struct mail_data *md) {
{
retVal___ = HPMHooks.source.inter_mail.fromsql(char_id, md);
}
- if( HPMHooks.count.HP_inter_mail_fromsql_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, struct mail_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mail_fromsql_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, struct mail_data *md);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, md);
+ retVal___ = postHookFunc(retVal___, char_id, md);
}
}
return retVal___;
@@ -6774,14 +7225,14 @@ int HP_inter_mail_fromsql(int char_id, struct mail_data *md) {
int HP_inter_mail_savemessage(struct mail_message *msg) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mail_savemessage_pre ) {
- int (*preHookFunc) (struct mail_message *msg);
+ if (HPMHooks.count.HP_inter_mail_savemessage_pre > 0) {
+ int (*preHookFunc) (struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_savemessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_savemessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_savemessage_pre[hIndex].func;
- retVal___ = preHookFunc(msg);
+ retVal___ = preHookFunc(&msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6789,9 +7240,9 @@ int HP_inter_mail_savemessage(struct mail_message *msg) {
{
retVal___ = HPMHooks.source.inter_mail.savemessage(msg);
}
- if( HPMHooks.count.HP_inter_mail_savemessage_post ) {
+ if (HPMHooks.count.HP_inter_mail_savemessage_post > 0) {
int (*postHookFunc) (int retVal___, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_savemessage_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_savemessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_savemessage_post[hIndex].func;
retVal___ = postHookFunc(retVal___, msg);
}
@@ -6801,14 +7252,14 @@ int HP_inter_mail_savemessage(struct mail_message *msg) {
bool HP_inter_mail_loadmessage(int mail_id, struct mail_message *msg) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_mail_loadmessage_pre ) {
- bool (*preHookFunc) (int *mail_id, struct mail_message *msg);
+ if (HPMHooks.count.HP_inter_mail_loadmessage_pre > 0) {
+ bool (*preHookFunc) (int *mail_id, struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_loadmessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_loadmessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_loadmessage_pre[hIndex].func;
- retVal___ = preHookFunc(&mail_id, msg);
+ retVal___ = preHookFunc(&mail_id, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6816,11 +7267,11 @@ bool HP_inter_mail_loadmessage(int mail_id, struct mail_message *msg) {
{
retVal___ = HPMHooks.source.inter_mail.loadmessage(mail_id, msg);
}
- if( HPMHooks.count.HP_inter_mail_loadmessage_post ) {
- bool (*postHookFunc) (bool retVal___, int *mail_id, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_loadmessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mail_loadmessage_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int mail_id, struct mail_message *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_loadmessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_loadmessage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &mail_id, msg);
+ retVal___ = postHookFunc(retVal___, mail_id, msg);
}
}
return retVal___;
@@ -6828,14 +7279,14 @@ bool HP_inter_mail_loadmessage(int mail_id, struct mail_message *msg) {
bool HP_inter_mail_DeleteAttach(int mail_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_mail_DeleteAttach_pre ) {
+ if (HPMHooks.count.HP_inter_mail_DeleteAttach_pre > 0) {
bool (*preHookFunc) (int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_DeleteAttach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_DeleteAttach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_DeleteAttach_pre[hIndex].func;
retVal___ = preHookFunc(&mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6843,25 +7294,25 @@ bool HP_inter_mail_DeleteAttach(int mail_id) {
{
retVal___ = HPMHooks.source.inter_mail.DeleteAttach(mail_id);
}
- if( HPMHooks.count.HP_inter_mail_DeleteAttach_post ) {
- bool (*postHookFunc) (bool retVal___, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_DeleteAttach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mail_DeleteAttach_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_DeleteAttach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_DeleteAttach_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &mail_id);
+ retVal___ = postHookFunc(retVal___, mail_id);
}
}
return retVal___;
}
void HP_inter_mail_sendmail(int send_id, const char *send_name, int dest_id, const char *dest_name, const char *title, const char *body, int zeny, struct item *item) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_mail_sendmail_pre ) {
- void (*preHookFunc) (int *send_id, const char *send_name, int *dest_id, const char *dest_name, const char *title, const char *body, int *zeny, struct item *item);
+ if (HPMHooks.count.HP_inter_mail_sendmail_pre > 0) {
+ void (*preHookFunc) (int *send_id, const char **send_name, int *dest_id, const char **dest_name, const char **title, const char **body, int *zeny, struct item **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sendmail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sendmail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mail_sendmail_pre[hIndex].func;
- preHookFunc(&send_id, send_name, &dest_id, dest_name, title, body, &zeny, item);
+ preHookFunc(&send_id, &send_name, &dest_id, &dest_name, &title, &body, &zeny, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6869,27 +7320,27 @@ void HP_inter_mail_sendmail(int send_id, const char *send_name, int dest_id, con
{
HPMHooks.source.inter_mail.sendmail(send_id, send_name, dest_id, dest_name, title, body, zeny, item);
}
- if( HPMHooks.count.HP_inter_mail_sendmail_post ) {
- void (*postHookFunc) (int *send_id, const char *send_name, int *dest_id, const char *dest_name, const char *title, const char *body, int *zeny, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sendmail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mail_sendmail_post > 0) {
+ void (*postHookFunc) (int send_id, const char *send_name, int dest_id, const char *dest_name, const char *title, const char *body, int zeny, struct item *item);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mail_sendmail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mail_sendmail_post[hIndex].func;
- postHookFunc(&send_id, send_name, &dest_id, dest_name, title, body, &zeny, item);
+ postHookFunc(send_id, send_name, dest_id, dest_name, title, body, zeny, item);
}
}
return;
}
-/* inter_mercenary */
+/* inter_mercenary_interface */
bool HP_inter_mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_mercenary_owner_fromsql_pre ) {
- bool (*preHookFunc) (int *char_id, struct mmo_charstatus *status);
+ if (HPMHooks.count.HP_inter_mercenary_owner_fromsql_pre > 0) {
+ bool (*preHookFunc) (int *char_id, struct mmo_charstatus **status);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mercenary_owner_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, status);
+ retVal___ = preHookFunc(&char_id, &status);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6897,11 +7348,11 @@ bool HP_inter_mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status
{
retVal___ = HPMHooks.source.inter_mercenary.owner_fromsql(char_id, status);
}
- if( HPMHooks.count.HP_inter_mercenary_owner_fromsql_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, struct mmo_charstatus *status);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mercenary_owner_fromsql_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, struct mmo_charstatus *status);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mercenary_owner_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, status);
+ retVal___ = postHookFunc(retVal___, char_id, status);
}
}
return retVal___;
@@ -6909,14 +7360,14 @@ bool HP_inter_mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status
bool HP_inter_mercenary_owner_tosql(int char_id, struct mmo_charstatus *status) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_mercenary_owner_tosql_pre ) {
- bool (*preHookFunc) (int *char_id, struct mmo_charstatus *status);
+ if (HPMHooks.count.HP_inter_mercenary_owner_tosql_pre > 0) {
+ bool (*preHookFunc) (int *char_id, struct mmo_charstatus **status);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mercenary_owner_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, status);
+ retVal___ = preHookFunc(&char_id, &status);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6924,11 +7375,11 @@ bool HP_inter_mercenary_owner_tosql(int char_id, struct mmo_charstatus *status)
{
retVal___ = HPMHooks.source.inter_mercenary.owner_tosql(char_id, status);
}
- if( HPMHooks.count.HP_inter_mercenary_owner_tosql_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, struct mmo_charstatus *status);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mercenary_owner_tosql_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, struct mmo_charstatus *status);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mercenary_owner_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, status);
+ retVal___ = postHookFunc(retVal___, char_id, status);
}
}
return retVal___;
@@ -6936,14 +7387,14 @@ bool HP_inter_mercenary_owner_tosql(int char_id, struct mmo_charstatus *status)
bool HP_inter_mercenary_owner_delete(int char_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_inter_mercenary_owner_delete_pre ) {
+ if (HPMHooks.count.HP_inter_mercenary_owner_delete_pre > 0) {
bool (*preHookFunc) (int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mercenary_owner_delete_pre[hIndex].func;
retVal___ = preHookFunc(&char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6951,11 +7402,11 @@ bool HP_inter_mercenary_owner_delete(int char_id) {
{
retVal___ = HPMHooks.source.inter_mercenary.owner_delete(char_id);
}
- if( HPMHooks.count.HP_inter_mercenary_owner_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mercenary_owner_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_owner_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mercenary_owner_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id);
+ retVal___ = postHookFunc(retVal___, char_id);
}
}
return retVal___;
@@ -6963,14 +7414,14 @@ bool HP_inter_mercenary_owner_delete(int char_id) {
int HP_inter_mercenary_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mercenary_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_mercenary_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mercenary_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6978,9 +7429,9 @@ int HP_inter_mercenary_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_mercenary.sql_init();
}
- if( HPMHooks.count.HP_inter_mercenary_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_mercenary_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mercenary_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6989,14 +7440,14 @@ int HP_inter_mercenary_sql_init(void) {
}
void HP_inter_mercenary_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_mercenary_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_mercenary_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mercenary_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7004,9 +7455,9 @@ void HP_inter_mercenary_sql_final(void) {
{
HPMHooks.source.inter_mercenary.sql_final();
}
- if( HPMHooks.count.HP_inter_mercenary_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_mercenary_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mercenary_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -7016,14 +7467,14 @@ void HP_inter_mercenary_sql_final(void) {
int HP_inter_mercenary_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_mercenary_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_mercenary_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_mercenary_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7031,27 +7482,27 @@ int HP_inter_mercenary_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_mercenary.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_mercenary_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_mercenary_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_mercenary_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_mercenary_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* inter_party */
+/* inter_party_interface */
int HP_inter_party_check_lv(struct party_data *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_check_lv_pre ) {
- int (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_inter_party_check_lv_pre > 0) {
+ int (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_lv_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_lv_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_check_lv_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7059,9 +7510,9 @@ int HP_inter_party_check_lv(struct party_data *p) {
{
retVal___ = HPMHooks.source.inter_party.check_lv(p);
}
- if( HPMHooks.count.HP_inter_party_check_lv_post ) {
+ if (HPMHooks.count.HP_inter_party_check_lv_post > 0) {
int (*postHookFunc) (int retVal___, struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_lv_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_lv_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_check_lv_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -7070,14 +7521,14 @@ int HP_inter_party_check_lv(struct party_data *p) {
}
void HP_inter_party_calc_state(struct party_data *p) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_party_calc_state_pre ) {
- void (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_inter_party_calc_state_pre > 0) {
+ void (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_calc_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_calc_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_calc_state_pre[hIndex].func;
- preHookFunc(p);
+ preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7085,9 +7536,9 @@ void HP_inter_party_calc_state(struct party_data *p) {
{
HPMHooks.source.inter_party.calc_state(p);
}
- if( HPMHooks.count.HP_inter_party_calc_state_post ) {
+ if (HPMHooks.count.HP_inter_party_calc_state_post > 0) {
void (*postHookFunc) (struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_calc_state_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_calc_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_calc_state_post[hIndex].func;
postHookFunc(p);
}
@@ -7097,14 +7548,14 @@ void HP_inter_party_calc_state(struct party_data *p) {
int HP_inter_party_tosql(struct party *p, int flag, int index) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_tosql_pre ) {
- int (*preHookFunc) (struct party *p, int *flag, int *index);
+ if (HPMHooks.count.HP_inter_party_tosql_pre > 0) {
+ int (*preHookFunc) (struct party **p, int *flag, int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(p, &flag, &index);
+ retVal___ = preHookFunc(&p, &flag, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7112,11 +7563,11 @@ int HP_inter_party_tosql(struct party *p, int flag, int index) {
{
retVal___ = HPMHooks.source.inter_party.tosql(p, flag, index);
}
- if( HPMHooks.count.HP_inter_party_tosql_post ) {
- int (*postHookFunc) (int retVal___, struct party *p, int *flag, int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_party_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, struct party *p, int flag, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &flag, &index);
+ retVal___ = postHookFunc(retVal___, p, flag, index);
}
}
return retVal___;
@@ -7124,14 +7575,14 @@ int HP_inter_party_tosql(struct party *p, int flag, int index) {
struct party_data* HP_inter_party_fromsql(int party_id) {
int hIndex = 0;
struct party_data* retVal___ = NULL;
- if( HPMHooks.count.HP_inter_party_fromsql_pre ) {
+ if (HPMHooks.count.HP_inter_party_fromsql_pre > 0) {
struct party_data* (*preHookFunc) (int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_fromsql_pre[hIndex].func;
retVal___ = preHookFunc(&party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7139,11 +7590,11 @@ struct party_data* HP_inter_party_fromsql(int party_id) {
{
retVal___ = HPMHooks.source.inter_party.fromsql(party_id);
}
- if( HPMHooks.count.HP_inter_party_fromsql_post ) {
- struct party_data* (*postHookFunc) (struct party_data* retVal___, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_party_fromsql_post > 0) {
+ struct party_data* (*postHookFunc) (struct party_data* retVal___, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id);
+ retVal___ = postHookFunc(retVal___, party_id);
}
}
return retVal___;
@@ -7151,14 +7602,14 @@ struct party_data* HP_inter_party_fromsql(int party_id) {
int HP_inter_party_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_party_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7166,9 +7617,9 @@ int HP_inter_party_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_party.sql_init();
}
- if( HPMHooks.count.HP_inter_party_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_party_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7177,14 +7628,14 @@ int HP_inter_party_sql_init(void) {
}
void HP_inter_party_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_party_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_party_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7192,9 +7643,9 @@ void HP_inter_party_sql_final(void) {
{
HPMHooks.source.inter_party.sql_final();
}
- if( HPMHooks.count.HP_inter_party_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_party_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -7204,14 +7655,14 @@ void HP_inter_party_sql_final(void) {
struct party_data* HP_inter_party_search_partyname(const char *str) {
int hIndex = 0;
struct party_data* retVal___ = NULL;
- if( HPMHooks.count.HP_inter_party_search_partyname_pre ) {
- struct party_data* (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_inter_party_search_partyname_pre > 0) {
+ struct party_data* (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_search_partyname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_search_partyname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_search_partyname_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7219,9 +7670,9 @@ struct party_data* HP_inter_party_search_partyname(const char *str) {
{
retVal___ = HPMHooks.source.inter_party.search_partyname(str);
}
- if( HPMHooks.count.HP_inter_party_search_partyname_post ) {
+ if (HPMHooks.count.HP_inter_party_search_partyname_post > 0) {
struct party_data* (*postHookFunc) (struct party_data* retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_search_partyname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_search_partyname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_search_partyname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -7231,14 +7682,14 @@ struct party_data* HP_inter_party_search_partyname(const char *str) {
int HP_inter_party_check_exp_share(struct party_data *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_check_exp_share_pre ) {
- int (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_inter_party_check_exp_share_pre > 0) {
+ int (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_exp_share_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_exp_share_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_check_exp_share_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7246,9 +7697,9 @@ int HP_inter_party_check_exp_share(struct party_data *p) {
{
retVal___ = HPMHooks.source.inter_party.check_exp_share(p);
}
- if( HPMHooks.count.HP_inter_party_check_exp_share_post ) {
+ if (HPMHooks.count.HP_inter_party_check_exp_share_post > 0) {
int (*postHookFunc) (int retVal___, struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_exp_share_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_exp_share_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_check_exp_share_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -7258,14 +7709,14 @@ int HP_inter_party_check_exp_share(struct party_data *p) {
int HP_inter_party_check_empty(struct party_data *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_check_empty_pre ) {
- int (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_inter_party_check_empty_pre > 0) {
+ int (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_empty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_empty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_check_empty_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7273,9 +7724,9 @@ int HP_inter_party_check_empty(struct party_data *p) {
{
retVal___ = HPMHooks.source.inter_party.check_empty(p);
}
- if( HPMHooks.count.HP_inter_party_check_empty_post ) {
+ if (HPMHooks.count.HP_inter_party_check_empty_post > 0) {
int (*postHookFunc) (int retVal___, struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_empty_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_check_empty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_check_empty_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -7285,14 +7736,14 @@ int HP_inter_party_check_empty(struct party_data *p) {
int HP_inter_party_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_party_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7300,11 +7751,11 @@ int HP_inter_party_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_party.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_party_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_party_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -7312,14 +7763,14 @@ int HP_inter_party_parse_frommap(int fd) {
int HP_inter_party_leave(int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_leave_pre ) {
+ if (HPMHooks.count.HP_inter_party_leave_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_leave_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7327,11 +7778,11 @@ int HP_inter_party_leave(int party_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.inter_party.leave(party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_inter_party_leave_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_party_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id);
}
}
return retVal___;
@@ -7339,14 +7790,14 @@ int HP_inter_party_leave(int party_id, int account_id, int char_id) {
int HP_inter_party_CharOnline(int char_id, int party_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_CharOnline_pre ) {
+ if (HPMHooks.count.HP_inter_party_CharOnline_pre > 0) {
int (*preHookFunc) (int *char_id, int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOnline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOnline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_CharOnline_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7354,11 +7805,11 @@ int HP_inter_party_CharOnline(int char_id, int party_id) {
{
retVal___ = HPMHooks.source.inter_party.CharOnline(char_id, party_id);
}
- if( HPMHooks.count.HP_inter_party_CharOnline_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOnline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_party_CharOnline_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOnline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_CharOnline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &party_id);
+ retVal___ = postHookFunc(retVal___, char_id, party_id);
}
}
return retVal___;
@@ -7366,14 +7817,14 @@ int HP_inter_party_CharOnline(int char_id, int party_id) {
int HP_inter_party_CharOffline(int char_id, int party_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_party_CharOffline_pre ) {
+ if (HPMHooks.count.HP_inter_party_CharOffline_pre > 0) {
int (*preHookFunc) (int *char_id, int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOffline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOffline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_party_CharOffline_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7381,39 +7832,39 @@ int HP_inter_party_CharOffline(int char_id, int party_id) {
{
retVal___ = HPMHooks.source.inter_party.CharOffline(char_id, party_id);
}
- if( HPMHooks.count.HP_inter_party_CharOffline_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOffline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_party_CharOffline_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_party_CharOffline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_party_CharOffline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &party_id);
+ retVal___ = postHookFunc(retVal___, char_id, party_id);
}
}
return retVal___;
}
-/* inter_pet */
-int HP_inter_pet_tosql(int pet_id, struct s_pet *p) {
+/* inter_pet_interface */
+int HP_inter_pet_tosql(const struct s_pet *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_pet_tosql_pre ) {
- int (*preHookFunc) (int *pet_id, struct s_pet *p);
+ if (HPMHooks.count.HP_inter_pet_tosql_pre > 0) {
+ int (*preHookFunc) (const struct s_pet **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_pet_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(&pet_id, p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.inter_pet.tosql(pet_id, p);
+ retVal___ = HPMHooks.source.inter_pet.tosql(p);
}
- if( HPMHooks.count.HP_inter_pet_tosql_post ) {
- int (*postHookFunc) (int retVal___, int *pet_id, struct s_pet *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_pet_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct s_pet *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_pet_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pet_id, p);
+ retVal___ = postHookFunc(retVal___, p);
}
}
return retVal___;
@@ -7421,14 +7872,14 @@ int HP_inter_pet_tosql(int pet_id, struct s_pet *p) {
int HP_inter_pet_fromsql(int pet_id, struct s_pet *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_pet_fromsql_pre ) {
- int (*preHookFunc) (int *pet_id, struct s_pet *p);
+ if (HPMHooks.count.HP_inter_pet_fromsql_pre > 0) {
+ int (*preHookFunc) (int *pet_id, struct s_pet **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_pet_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&pet_id, p);
+ retVal___ = preHookFunc(&pet_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7436,11 +7887,11 @@ int HP_inter_pet_fromsql(int pet_id, struct s_pet *p) {
{
retVal___ = HPMHooks.source.inter_pet.fromsql(pet_id, p);
}
- if( HPMHooks.count.HP_inter_pet_fromsql_post ) {
- int (*postHookFunc) (int retVal___, int *pet_id, struct s_pet *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_pet_fromsql_post > 0) {
+ int (*postHookFunc) (int retVal___, int pet_id, struct s_pet *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_pet_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pet_id, p);
+ retVal___ = postHookFunc(retVal___, pet_id, p);
}
}
return retVal___;
@@ -7448,14 +7899,14 @@ int HP_inter_pet_fromsql(int pet_id, struct s_pet *p) {
int HP_inter_pet_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_pet_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_pet_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_pet_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7463,9 +7914,9 @@ int HP_inter_pet_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_pet.sql_init();
}
- if( HPMHooks.count.HP_inter_pet_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_pet_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_pet_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7474,14 +7925,14 @@ int HP_inter_pet_sql_init(void) {
}
void HP_inter_pet_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_pet_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_pet_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_pet_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7489,9 +7940,9 @@ void HP_inter_pet_sql_final(void) {
{
HPMHooks.source.inter_pet.sql_final();
}
- if( HPMHooks.count.HP_inter_pet_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_pet_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_pet_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -7501,14 +7952,14 @@ void HP_inter_pet_sql_final(void) {
int HP_inter_pet_delete_(int pet_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_pet_delete__pre ) {
+ if (HPMHooks.count.HP_inter_pet_delete__pre > 0) {
int (*preHookFunc) (int *pet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_delete__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_delete__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_pet_delete__pre[hIndex].func;
retVal___ = preHookFunc(&pet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7516,11 +7967,11 @@ int HP_inter_pet_delete_(int pet_id) {
{
retVal___ = HPMHooks.source.inter_pet.delete_(pet_id);
}
- if( HPMHooks.count.HP_inter_pet_delete__post ) {
- int (*postHookFunc) (int retVal___, int *pet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_delete__post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_pet_delete__post > 0) {
+ int (*postHookFunc) (int retVal___, int pet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_delete__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_pet_delete__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pet_id);
+ retVal___ = postHookFunc(retVal___, pet_id);
}
}
return retVal___;
@@ -7528,14 +7979,14 @@ int HP_inter_pet_delete_(int pet_id) {
int HP_inter_pet_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_pet_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_pet_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_pet_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7543,27 +7994,27 @@ int HP_inter_pet_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_pet.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_pet_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_pet_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_pet_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_pet_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* inter_quest */
+/* inter_quest_interface */
int HP_inter_quest_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_quest_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_quest_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_quest_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_quest_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_quest_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7571,27 +8022,27 @@ int HP_inter_quest_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_quest.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_quest_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_quest_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_quest_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_quest_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_quest_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* inter_storage */
-int HP_inter_storage_tosql(int account_id, struct storage_data *p) {
+/* inter_storage_interface */
+int HP_inter_storage_tosql(int account_id, const struct storage_data *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_tosql_pre ) {
- int (*preHookFunc) (int *account_id, struct storage_data *p);
+ if (HPMHooks.count.HP_inter_storage_tosql_pre > 0) {
+ int (*preHookFunc) (int *account_id, const struct storage_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, p);
+ retVal___ = preHookFunc(&account_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7599,11 +8050,11 @@ int HP_inter_storage_tosql(int account_id, struct storage_data *p) {
{
retVal___ = HPMHooks.source.inter_storage.tosql(account_id, p);
}
- if( HPMHooks.count.HP_inter_storage_tosql_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct storage_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, const struct storage_data *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, p);
+ retVal___ = postHookFunc(retVal___, account_id, p);
}
}
return retVal___;
@@ -7611,14 +8062,14 @@ int HP_inter_storage_tosql(int account_id, struct storage_data *p) {
int HP_inter_storage_fromsql(int account_id, struct storage_data *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_fromsql_pre ) {
- int (*preHookFunc) (int *account_id, struct storage_data *p);
+ if (HPMHooks.count.HP_inter_storage_fromsql_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct storage_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, p);
+ retVal___ = preHookFunc(&account_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7626,26 +8077,26 @@ int HP_inter_storage_fromsql(int account_id, struct storage_data *p) {
{
retVal___ = HPMHooks.source.inter_storage.fromsql(account_id, p);
}
- if( HPMHooks.count.HP_inter_storage_fromsql_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct storage_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_fromsql_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct storage_data *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, p);
+ retVal___ = postHookFunc(retVal___, account_id, p);
}
}
return retVal___;
}
-int HP_inter_storage_guild_storage_tosql(int guild_id, struct guild_storage *p) {
+int HP_inter_storage_guild_storage_tosql(int guild_id, const struct guild_storage *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_guild_storage_tosql_pre ) {
- int (*preHookFunc) (int *guild_id, struct guild_storage *p);
+ if (HPMHooks.count.HP_inter_storage_guild_storage_tosql_pre > 0) {
+ int (*preHookFunc) (int *guild_id, const struct guild_storage **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_guild_storage_tosql_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, p);
+ retVal___ = preHookFunc(&guild_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7653,11 +8104,11 @@ int HP_inter_storage_guild_storage_tosql(int guild_id, struct guild_storage *p)
{
retVal___ = HPMHooks.source.inter_storage.guild_storage_tosql(guild_id, p);
}
- if( HPMHooks.count.HP_inter_storage_guild_storage_tosql_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, struct guild_storage *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_guild_storage_tosql_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, const struct guild_storage *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_guild_storage_tosql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, p);
+ retVal___ = postHookFunc(retVal___, guild_id, p);
}
}
return retVal___;
@@ -7665,14 +8116,14 @@ int HP_inter_storage_guild_storage_tosql(int guild_id, struct guild_storage *p)
int HP_inter_storage_guild_storage_fromsql(int guild_id, struct guild_storage *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_guild_storage_fromsql_pre ) {
- int (*preHookFunc) (int *guild_id, struct guild_storage *p);
+ if (HPMHooks.count.HP_inter_storage_guild_storage_fromsql_pre > 0) {
+ int (*preHookFunc) (int *guild_id, struct guild_storage **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_guild_storage_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, p);
+ retVal___ = preHookFunc(&guild_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7680,11 +8131,11 @@ int HP_inter_storage_guild_storage_fromsql(int guild_id, struct guild_storage *p
{
retVal___ = HPMHooks.source.inter_storage.guild_storage_fromsql(guild_id, p);
}
- if( HPMHooks.count.HP_inter_storage_guild_storage_fromsql_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, struct guild_storage *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_guild_storage_fromsql_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, struct guild_storage *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_guild_storage_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, p);
+ retVal___ = postHookFunc(retVal___, guild_id, p);
}
}
return retVal___;
@@ -7692,14 +8143,14 @@ int HP_inter_storage_guild_storage_fromsql(int guild_id, struct guild_storage *p
int HP_inter_storage_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_sql_init_pre ) {
+ if (HPMHooks.count.HP_inter_storage_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7707,9 +8158,9 @@ int HP_inter_storage_sql_init(void) {
{
retVal___ = HPMHooks.source.inter_storage.sql_init();
}
- if( HPMHooks.count.HP_inter_storage_sql_init_post ) {
+ if (HPMHooks.count.HP_inter_storage_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7718,14 +8169,14 @@ int HP_inter_storage_sql_init(void) {
}
void HP_inter_storage_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_inter_storage_sql_final_pre ) {
+ if (HPMHooks.count.HP_inter_storage_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7733,9 +8184,9 @@ void HP_inter_storage_sql_final(void) {
{
HPMHooks.source.inter_storage.sql_final();
}
- if( HPMHooks.count.HP_inter_storage_sql_final_post ) {
+ if (HPMHooks.count.HP_inter_storage_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -7745,14 +8196,14 @@ void HP_inter_storage_sql_final(void) {
int HP_inter_storage_delete_(int account_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_delete__pre ) {
+ if (HPMHooks.count.HP_inter_storage_delete__pre > 0) {
int (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_delete__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_delete__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_delete__pre[hIndex].func;
retVal___ = preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7760,11 +8211,11 @@ int HP_inter_storage_delete_(int account_id) {
{
retVal___ = HPMHooks.source.inter_storage.delete_(account_id);
}
- if( HPMHooks.count.HP_inter_storage_delete__post ) {
- int (*postHookFunc) (int retVal___, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_delete__post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_delete__post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_delete__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_delete__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id);
+ retVal___ = postHookFunc(retVal___, account_id);
}
}
return retVal___;
@@ -7772,14 +8223,14 @@ int HP_inter_storage_delete_(int account_id) {
int HP_inter_storage_guild_storage_delete(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_guild_storage_delete_pre ) {
+ if (HPMHooks.count.HP_inter_storage_guild_storage_delete_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_guild_storage_delete_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7787,11 +8238,11 @@ int HP_inter_storage_guild_storage_delete(int guild_id) {
{
retVal___ = HPMHooks.source.inter_storage.guild_storage_delete(guild_id);
}
- if( HPMHooks.count.HP_inter_storage_guild_storage_delete_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_guild_storage_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_guild_storage_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_guild_storage_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -7799,14 +8250,14 @@ int HP_inter_storage_guild_storage_delete(int guild_id) {
int HP_inter_storage_parse_frommap(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_inter_storage_parse_frommap_pre ) {
+ if (HPMHooks.count.HP_inter_storage_parse_frommap_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_parse_frommap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_parse_frommap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_inter_storage_parse_frommap_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7814,27 +8265,27 @@ int HP_inter_storage_parse_frommap(int fd) {
{
retVal___ = HPMHooks.source.inter_storage.parse_frommap(fd);
}
- if( HPMHooks.count.HP_inter_storage_parse_frommap_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_parse_frommap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_inter_storage_parse_frommap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_inter_storage_parse_frommap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_inter_storage_parse_frommap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* libconfig */
-int HP_libconfig_read(config_t *config, FILE *stream) {
+/* libconfig_interface */
+int HP_libconfig_read(struct config_t *config, FILE *stream) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_pre ) {
- int (*preHookFunc) (config_t *config, FILE *stream);
+ if (HPMHooks.count.HP_libconfig_read_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, FILE **stream);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_pre[hIndex].func;
- retVal___ = preHookFunc(config, stream);
+ retVal___ = preHookFunc(&config, &stream);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7842,25 +8293,25 @@ int HP_libconfig_read(config_t *config, FILE *stream) {
{
retVal___ = HPMHooks.source.libconfig.read(config, stream);
}
- if( HPMHooks.count.HP_libconfig_read_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, FILE *stream);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, FILE *stream);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, stream);
}
}
return retVal___;
}
-void HP_libconfig_write(const config_t *config, FILE *stream) {
+void HP_libconfig_write(const struct config_t *config, FILE *stream) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_write_pre ) {
- void (*preHookFunc) (const config_t *config, FILE *stream);
+ if (HPMHooks.count.HP_libconfig_write_pre > 0) {
+ void (*preHookFunc) (const struct config_t **config, FILE **stream);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_write_pre[hIndex].func;
- preHookFunc(config, stream);
+ preHookFunc(&config, &stream);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7868,79 +8319,79 @@ void HP_libconfig_write(const config_t *config, FILE *stream) {
{
HPMHooks.source.libconfig.write(config, stream);
}
- if( HPMHooks.count.HP_libconfig_write_post ) {
- void (*postHookFunc) (const config_t *config, FILE *stream);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_write_post > 0) {
+ void (*postHookFunc) (const struct config_t *config, FILE *stream);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_write_post[hIndex].func;
postHookFunc(config, stream);
}
}
return;
}
-void HP_libconfig_set_auto_convert(config_t *config, int flag) {
+void HP_libconfig_set_options(struct config_t *config, int options) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_auto_convert_pre ) {
- void (*preHookFunc) (config_t *config, int *flag);
+ if (HPMHooks.count.HP_libconfig_set_options_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_auto_convert_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_set_auto_convert_pre[hIndex].func;
- preHookFunc(config, &flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_set_options_pre[hIndex].func;
+ preHookFunc(&config, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.libconfig.set_auto_convert(config, flag);
+ HPMHooks.source.libconfig.set_options(config, options);
}
- if( HPMHooks.count.HP_libconfig_set_auto_convert_post ) {
- void (*postHookFunc) (config_t *config, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_auto_convert_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_set_auto_convert_post[hIndex].func;
- postHookFunc(config, &flag);
+ if (HPMHooks.count.HP_libconfig_set_options_post > 0) {
+ void (*postHookFunc) (struct config_t *config, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_set_options_post[hIndex].func;
+ postHookFunc(config, options);
}
}
return;
}
-int HP_libconfig_get_auto_convert(const config_t *config) {
+int HP_libconfig_get_options(const struct config_t *config) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_get_auto_convert_pre ) {
- int (*preHookFunc) (const config_t *config);
+ if (HPMHooks.count.HP_libconfig_get_options_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_auto_convert_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_get_auto_convert_pre[hIndex].func;
- retVal___ = preHookFunc(config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_get_options_pre[hIndex].func;
+ retVal___ = preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.libconfig.get_auto_convert(config);
+ retVal___ = HPMHooks.source.libconfig.get_options(config);
}
- if( HPMHooks.count.HP_libconfig_get_auto_convert_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_auto_convert_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_get_auto_convert_post[hIndex].func;
+ if (HPMHooks.count.HP_libconfig_get_options_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_get_options_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config);
}
}
return retVal___;
}
-int HP_libconfig_read_string(config_t *config, const char *str) {
+int HP_libconfig_read_string(struct config_t *config, const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_string_pre ) {
- int (*preHookFunc) (config_t *config, const char *str);
+ if (HPMHooks.count.HP_libconfig_read_string_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_string_pre[hIndex].func;
- retVal___ = preHookFunc(config, str);
+ retVal___ = preHookFunc(&config, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7948,26 +8399,26 @@ int HP_libconfig_read_string(config_t *config, const char *str) {
{
retVal___ = HPMHooks.source.libconfig.read_string(config, str);
}
- if( HPMHooks.count.HP_libconfig_read_string_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_string_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, str);
}
}
return retVal___;
}
-int HP_libconfig_read_file_src(config_t *config, const char *filename) {
+int HP_libconfig_read_file_src(struct config_t *config, const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_file_src_pre ) {
- int (*preHookFunc) (config_t *config, const char *filename);
+ if (HPMHooks.count.HP_libconfig_read_file_src_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_file_src_pre[hIndex].func;
- retVal___ = preHookFunc(config, filename);
+ retVal___ = preHookFunc(&config, &filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7975,26 +8426,26 @@ int HP_libconfig_read_file_src(config_t *config, const char *filename) {
{
retVal___ = HPMHooks.source.libconfig.read_file_src(config, filename);
}
- if( HPMHooks.count.HP_libconfig_read_file_src_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_file_src_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_file_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filename);
}
}
return retVal___;
}
-int HP_libconfig_write_file(config_t *config, const char *filename) {
+int HP_libconfig_write_file(struct config_t *config, const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_write_file_pre ) {
- int (*preHookFunc) (config_t *config, const char *filename);
+ if (HPMHooks.count.HP_libconfig_write_file_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_write_file_pre[hIndex].func;
- retVal___ = preHookFunc(config, filename);
+ retVal___ = preHookFunc(&config, &filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8002,25 +8453,25 @@ int HP_libconfig_write_file(config_t *config, const char *filename) {
{
retVal___ = HPMHooks.source.libconfig.write_file(config, filename);
}
- if( HPMHooks.count.HP_libconfig_write_file_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_write_file_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_write_file_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filename);
}
}
return retVal___;
}
-void HP_libconfig_set_destructor(config_t *config, void ( *destructor ) (void *)) {
+void HP_libconfig_set_destructor(struct config_t *config, void ( *destructor ) (void *)) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_destructor_pre ) {
- void (*preHookFunc) (config_t *config, void ( *destructor ) (void *));
+ if (HPMHooks.count.HP_libconfig_set_destructor_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, void ( **destructor ) (void *));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_destructor_pre[hIndex].func;
- preHookFunc(config, destructor);
+ preHookFunc(&config, &destructor);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8028,25 +8479,25 @@ void HP_libconfig_set_destructor(config_t *config, void ( *destructor ) (void *)
{
HPMHooks.source.libconfig.set_destructor(config, destructor);
}
- if( HPMHooks.count.HP_libconfig_set_destructor_post ) {
- void (*postHookFunc) (config_t *config, void ( *destructor ) (void *));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_set_destructor_post > 0) {
+ void (*postHookFunc) (struct config_t *config, void ( *destructor ) (void *));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_destructor_post[hIndex].func;
postHookFunc(config, destructor);
}
}
return;
}
-void HP_libconfig_set_include_dir(config_t *config, const char *include_dir) {
+void HP_libconfig_set_include_dir(struct config_t *config, const char *include_dir) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_include_dir_pre ) {
- void (*preHookFunc) (config_t *config, const char *include_dir);
+ if (HPMHooks.count.HP_libconfig_set_include_dir_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, const char **include_dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_include_dir_pre[hIndex].func;
- preHookFunc(config, include_dir);
+ preHookFunc(&config, &include_dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8054,25 +8505,25 @@ void HP_libconfig_set_include_dir(config_t *config, const char *include_dir) {
{
HPMHooks.source.libconfig.set_include_dir(config, include_dir);
}
- if( HPMHooks.count.HP_libconfig_set_include_dir_post ) {
- void (*postHookFunc) (config_t *config, const char *include_dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_set_include_dir_post > 0) {
+ void (*postHookFunc) (struct config_t *config, const char *include_dir);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_include_dir_post[hIndex].func;
postHookFunc(config, include_dir);
}
}
return;
}
-void HP_libconfig_init(config_t *config) {
+void HP_libconfig_init(struct config_t *config) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_init_pre ) {
- void (*preHookFunc) (config_t *config);
+ if (HPMHooks.count.HP_libconfig_init_pre > 0) {
+ void (*preHookFunc) (struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_init_pre[hIndex].func;
- preHookFunc(config);
+ preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8080,25 +8531,25 @@ void HP_libconfig_init(config_t *config) {
{
HPMHooks.source.libconfig.init(config);
}
- if( HPMHooks.count.HP_libconfig_init_post ) {
- void (*postHookFunc) (config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_init_post > 0) {
+ void (*postHookFunc) (struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_init_post[hIndex].func;
postHookFunc(config);
}
}
return;
}
-void HP_libconfig_destroy(config_t *config) {
+void HP_libconfig_destroy(struct config_t *config) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_destroy_pre ) {
- void (*preHookFunc) (config_t *config);
+ if (HPMHooks.count.HP_libconfig_destroy_pre > 0) {
+ void (*preHookFunc) (struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_destroy_pre[hIndex].func;
- preHookFunc(config);
+ preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8106,26 +8557,26 @@ void HP_libconfig_destroy(config_t *config) {
{
HPMHooks.source.libconfig.destroy(config);
}
- if( HPMHooks.count.HP_libconfig_destroy_post ) {
- void (*postHookFunc) (config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_destroy_post > 0) {
+ void (*postHookFunc) (struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_destroy_post[hIndex].func;
postHookFunc(config);
}
}
return;
}
-int HP_libconfig_setting_get_int(const config_setting_t *setting) {
+int HP_libconfig_setting_get_int(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_int_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8133,26 +8584,26 @@ int HP_libconfig_setting_get_int(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_int(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-long long HP_libconfig_setting_get_int64(const config_setting_t *setting) {
+int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) {
int hIndex = 0;
- long long retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) {
- long long (*preHookFunc) (const config_setting_t *setting);
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_pre > 0) {
+ int64 (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8160,26 +8611,26 @@ long long HP_libconfig_setting_get_int64(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) {
- long long (*postHookFunc) (long long retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-double HP_libconfig_setting_get_float(const config_setting_t *setting) {
+double HP_libconfig_setting_get_float(const struct config_setting_t *setting) {
int hIndex = 0;
double retVal___ = 0.;
- if( HPMHooks.count.HP_libconfig_setting_get_float_pre ) {
- double (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_float_pre > 0) {
+ double (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8187,26 +8638,26 @@ double HP_libconfig_setting_get_float(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_float(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_float_post ) {
- double (*postHookFunc) (double retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_float_post > 0) {
+ double (*postHookFunc) (double retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_bool(const config_setting_t *setting) {
+int HP_libconfig_setting_get_bool(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_bool_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8214,26 +8665,26 @@ int HP_libconfig_setting_get_bool(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_bool(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-const char* HP_libconfig_setting_get_string(const config_setting_t *setting) {
+const char* HP_libconfig_setting_get_string(const struct config_setting_t *setting) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_string_pre ) {
- const char* (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_string_pre > 0) {
+ const char* (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8241,26 +8692,53 @@ const char* HP_libconfig_setting_get_string(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_string(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_string_post ) {
- const char* (*postHookFunc) (const char* retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_string_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_int(const config_setting_t *setting, const char *name, int *value) {
+struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) {
+ int hIndex = 0;
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, const char **name);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup(setting, name);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, const char *name, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_int_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8268,26 +8746,26 @@ int HP_libconfig_setting_lookup_int(const config_setting_t *setting, const char
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_int(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_int_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_int64(const config_setting_t *setting, const char *name, long long *value) {
+int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, long long *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int64_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8295,26 +8773,26 @@ int HP_libconfig_setting_lookup_int64(const config_setting_t *setting, const cha
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_float(const config_setting_t *setting, const char *name, double *value) {
+int HP_libconfig_setting_lookup_float(const struct config_setting_t *setting, const char *name, double *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_float_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, double *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_float_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, double **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8322,26 +8800,26 @@ int HP_libconfig_setting_lookup_float(const config_setting_t *setting, const cha
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_float(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_float_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_float_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, double *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_bool(const config_setting_t *setting, const char *name, int *value) {
+int HP_libconfig_setting_lookup_bool(const struct config_setting_t *setting, const char *name, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_bool_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8349,26 +8827,26 @@ int HP_libconfig_setting_lookup_bool(const config_setting_t *setting, const char
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_bool(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_string(const config_setting_t *setting, const char *name, const char **value) {
+int HP_libconfig_setting_lookup_string(const struct config_setting_t *setting, const char *name, const char **value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_string_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, const char **value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_string_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, const char ***value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8376,26 +8854,26 @@ int HP_libconfig_setting_lookup_string(const config_setting_t *setting, const ch
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_string(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_string_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, const char **value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, const char **value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_int(config_setting_t *setting, int value) {
+int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_int_pre ) {
- int (*preHookFunc) (config_setting_t *setting, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_int_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8403,26 +8881,26 @@ int HP_libconfig_setting_set_int(config_setting_t *setting, int value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_int(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_int64(config_setting_t *setting, long long value) {
+int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) {
- int (*preHookFunc) (config_setting_t *setting, long long *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int64 *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8430,26 +8908,26 @@ int HP_libconfig_setting_set_int64(config_setting_t *setting, long long value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_float(config_setting_t *setting, double value) {
+int HP_libconfig_setting_set_float(struct config_setting_t *setting, double value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_float_pre ) {
- int (*preHookFunc) (config_setting_t *setting, double *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_float_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, double *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8457,26 +8935,26 @@ int HP_libconfig_setting_set_float(config_setting_t *setting, double value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_float(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_float_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_float_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, double value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_bool(config_setting_t *setting, int value) {
+int HP_libconfig_setting_set_bool(struct config_setting_t *setting, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_bool_pre ) {
- int (*preHookFunc) (config_setting_t *setting, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8484,26 +8962,26 @@ int HP_libconfig_setting_set_bool(config_setting_t *setting, int value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_bool(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_bool_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_string(config_setting_t *setting, const char *value) {
+int HP_libconfig_setting_set_string(struct config_setting_t *setting, const char *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_string_pre ) {
- int (*preHookFunc) (config_setting_t *setting, const char *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_string_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, const char **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting, value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8511,26 +8989,26 @@ int HP_libconfig_setting_set_string(config_setting_t *setting, const char *value
{
retVal___ = HPMHooks.source.libconfig.setting_set_string(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_string_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, const char *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_string_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_format(config_setting_t *setting, short format) {
+int HP_libconfig_setting_set_format(struct config_setting_t *setting, short format) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_format_pre ) {
- int (*preHookFunc) (config_setting_t *setting, short *format);
+ if (HPMHooks.count.HP_libconfig_setting_set_format_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, short *format);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_format_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &format);
+ retVal___ = preHookFunc(&setting, &format);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8538,26 +9016,26 @@ int HP_libconfig_setting_set_format(config_setting_t *setting, short format) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_format(setting, format);
}
- if( HPMHooks.count.HP_libconfig_setting_set_format_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, short *format);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_format_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, short format);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_format_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &format);
+ retVal___ = postHookFunc(retVal___, setting, format);
}
}
return retVal___;
}
-short HP_libconfig_setting_get_format(const config_setting_t *setting) {
+short HP_libconfig_setting_get_format(const struct config_setting_t *setting) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_format_pre ) {
- short (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_format_pre > 0) {
+ short (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_format_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8565,26 +9043,26 @@ short HP_libconfig_setting_get_format(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_format(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_format_post ) {
- short (*postHookFunc) (short retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_format_post > 0) {
+ short (*postHookFunc) (short retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_format_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_int_elem(const config_setting_t *setting, int idx) {
+int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int_elem_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_int_elem_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8592,26 +9070,26 @@ int HP_libconfig_setting_get_int_elem(const config_setting_t *setting, int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_get_int_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int_elem_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-long long HP_libconfig_setting_get_int64_elem(const config_setting_t *setting, int idx) {
+int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
- long long retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) {
- long long (*preHookFunc) (const config_setting_t *setting, int *idx);
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre > 0) {
+ int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8619,26 +9097,26 @@ long long HP_libconfig_setting_get_int64_elem(const config_setting_t *setting, i
{
retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) {
- long long (*postHookFunc) (long long retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_elem_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-double HP_libconfig_setting_get_float_elem(const config_setting_t *setting, int idx) {
+double HP_libconfig_setting_get_float_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
double retVal___ = 0.;
- if( HPMHooks.count.HP_libconfig_setting_get_float_elem_pre ) {
- double (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_float_elem_pre > 0) {
+ double (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8646,26 +9124,26 @@ double HP_libconfig_setting_get_float_elem(const config_setting_t *setting, int
{
retVal___ = HPMHooks.source.libconfig.setting_get_float_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_float_elem_post ) {
- double (*postHookFunc) (double retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_float_elem_post > 0) {
+ double (*postHookFunc) (double retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_bool_elem(const config_setting_t *setting, int idx) {
+int HP_libconfig_setting_get_bool_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8673,26 +9151,26 @@ int HP_libconfig_setting_get_bool_elem(const config_setting_t *setting, int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_get_bool_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_bool_elem_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-const char* HP_libconfig_setting_get_string_elem(const config_setting_t *setting, int idx) {
+const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_string_elem_pre ) {
- const char* (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_string_elem_pre > 0) {
+ const char* (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8700,26 +9178,26 @@ const char* HP_libconfig_setting_get_string_elem(const config_setting_t *setting
{
retVal___ = HPMHooks.source.libconfig.setting_get_string_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_string_elem_post ) {
- const char* (*postHookFunc) (const char* retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_string_elem_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_int_elem(config_setting_t *setting, int idx, int value) {
+struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_int_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, int *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_int_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8727,26 +9205,26 @@ config_setting_t* HP_libconfig_setting_set_int_elem(config_setting_t *setting, i
{
retVal___ = HPMHooks.source.libconfig.setting_set_int_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_int64_elem(config_setting_t *setting, int idx, long long value) {
+struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, long long *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8754,26 +9232,26 @@ config_setting_t* HP_libconfig_setting_set_int64_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_float_elem(config_setting_t *setting, int idx, double value) {
+struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_float_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, double *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_float_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8781,26 +9259,26 @@ config_setting_t* HP_libconfig_setting_set_float_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_float_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_float_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_float_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_bool_elem(config_setting_t *setting, int idx, int value) {
+struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, int *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8808,26 +9286,26 @@ config_setting_t* HP_libconfig_setting_set_bool_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_bool_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_bool_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_string_elem(config_setting_t *setting, int idx, const char *value) {
+struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_string_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, const char *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_string_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8835,26 +9313,26 @@ config_setting_t* HP_libconfig_setting_set_string_elem(config_setting_t *setting
{
retVal___ = HPMHooks.source.libconfig.setting_set_string_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_string_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, const char *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_string_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_index(const config_setting_t *setting) {
+int HP_libconfig_setting_index(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_index_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_index_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_index_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8862,26 +9340,26 @@ int HP_libconfig_setting_index(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_index(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_index_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_index_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_index_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_length(const config_setting_t *setting) {
+int HP_libconfig_setting_length(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_length_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_length_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_length_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8889,26 +9367,26 @@ int HP_libconfig_setting_length(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_length(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_length_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_length_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_length_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_get_elem(const config_setting_t *setting, unsigned int idx) {
+struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_elem_pre ) {
- config_setting_t* (*preHookFunc) (const config_setting_t *setting, unsigned int *idx);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_get_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8916,26 +9394,26 @@ config_setting_t* HP_libconfig_setting_get_elem(const config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_get_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_setting_t *setting, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_get_member(const config_setting_t *setting, const char *name) {
+struct config_setting_t* HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_member_pre ) {
- config_setting_t* (*preHookFunc) (const config_setting_t *setting, const char *name);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_get_member_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name);
+ retVal___ = preHookFunc(&setting, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8943,26 +9421,26 @@ config_setting_t* HP_libconfig_setting_get_member(const config_setting_t *settin
{
retVal___ = HPMHooks.source.libconfig.setting_get_member(setting, name);
}
- if( HPMHooks.count.HP_libconfig_setting_get_member_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_setting_t *setting, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_member_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_add(config_setting_t *parent, const char *name, int type) {
+struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_add_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *parent, const char *name, int *type);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_add_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_add_pre[hIndex].func;
- retVal___ = preHookFunc(parent, name, &type);
+ retVal___ = preHookFunc(&parent, &name, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8970,26 +9448,26 @@ config_setting_t* HP_libconfig_setting_add(config_setting_t *parent, const char
{
retVal___ = HPMHooks.source.libconfig.setting_add(parent, name, type);
}
- if( HPMHooks.count.HP_libconfig_setting_add_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *parent, const char *name, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_add_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, parent, name, &type);
+ retVal___ = postHookFunc(retVal___, parent, name, type);
}
}
return retVal___;
}
-int HP_libconfig_setting_remove(config_setting_t *parent, const char *name) {
+int HP_libconfig_setting_remove(struct config_setting_t *parent, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_remove_pre ) {
- int (*preHookFunc) (config_setting_t *parent, const char *name);
+ if (HPMHooks.count.HP_libconfig_setting_remove_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_remove_pre[hIndex].func;
- retVal___ = preHookFunc(parent, name);
+ retVal___ = preHookFunc(&parent, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8997,26 +9475,26 @@ int HP_libconfig_setting_remove(config_setting_t *parent, const char *name) {
{
retVal___ = HPMHooks.source.libconfig.setting_remove(parent, name);
}
- if( HPMHooks.count.HP_libconfig_setting_remove_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_remove_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_remove_post[hIndex].func;
retVal___ = postHookFunc(retVal___, parent, name);
}
}
return retVal___;
}
-int HP_libconfig_setting_remove_elem(config_setting_t *parent, unsigned int idx) {
+int HP_libconfig_setting_remove_elem(struct config_setting_t *parent, unsigned int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_remove_elem_pre ) {
- int (*preHookFunc) (config_setting_t *parent, unsigned int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_remove_elem_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_remove_elem_pre[hIndex].func;
- retVal___ = preHookFunc(parent, &idx);
+ retVal___ = preHookFunc(&parent, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9024,25 +9502,25 @@ int HP_libconfig_setting_remove_elem(config_setting_t *parent, unsigned int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_remove_elem(parent, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_remove_elem_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_remove_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_remove_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, parent, &idx);
+ retVal___ = postHookFunc(retVal___, parent, idx);
}
}
return retVal___;
}
-void HP_libconfig_setting_set_hook(config_setting_t *setting, void *hook) {
+void HP_libconfig_setting_set_hook(struct config_setting_t *setting, void *hook) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_hook_pre ) {
- void (*preHookFunc) (config_setting_t *setting, void *hook);
+ if (HPMHooks.count.HP_libconfig_setting_set_hook_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **setting, void **hook);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_hook_pre[hIndex].func;
- preHookFunc(setting, hook);
+ preHookFunc(&setting, &hook);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9050,26 +9528,26 @@ void HP_libconfig_setting_set_hook(config_setting_t *setting, void *hook) {
{
HPMHooks.source.libconfig.setting_set_hook(setting, hook);
}
- if( HPMHooks.count.HP_libconfig_setting_set_hook_post ) {
- void (*postHookFunc) (config_setting_t *setting, void *hook);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_hook_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *setting, void *hook);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_hook_post[hIndex].func;
postHookFunc(setting, hook);
}
}
return;
}
-config_setting_t* HP_libconfig_lookup(const config_t *config, const char *filepath) {
+struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, const char *filepath) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_lookup_pre ) {
- config_setting_t* (*preHookFunc) (const config_t *config, const char *filepath);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_lookup_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_t **config, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath);
+ retVal___ = preHookFunc(&config, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9077,53 +9555,26 @@ config_setting_t* HP_libconfig_lookup(const config_t *config, const char *filepa
{
retVal___ = HPMHooks.source.libconfig.lookup(config, filepath);
}
- if( HPMHooks.count.HP_libconfig_lookup_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_t *config, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_lookup_from(config_setting_t *setting, const char *filepath) {
- int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_lookup_from_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, const char *filepath);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_from_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_lookup_from_pre[hIndex].func;
- retVal___ = preHookFunc(setting, filepath);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.libconfig.lookup_from(setting, filepath);
- }
- if( HPMHooks.count.HP_libconfig_lookup_from_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_from_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_lookup_from_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, filepath);
- }
- }
- return retVal___;
-}
-int HP_libconfig_lookup_int(const config_t *config, const char *filepath, int *value) {
+int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_int_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, int *value);
+ if (HPMHooks.count.HP_libconfig_lookup_int_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_int_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9131,26 +9582,26 @@ int HP_libconfig_lookup_int(const config_t *config, const char *filepath, int *v
{
retVal___ = HPMHooks.source.libconfig.lookup_int(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_int_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_int64(const config_t *config, const char *filepath, long long *value) {
+int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, long long *value);
+ if (HPMHooks.count.HP_libconfig_lookup_int64_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9158,26 +9609,26 @@ int HP_libconfig_lookup_int64(const config_t *config, const char *filepath, long
{
retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_int64_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_float(const config_t *config, const char *filepath, double *value) {
+int HP_libconfig_lookup_float(const struct config_t *config, const char *filepath, double *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_float_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, double *value);
+ if (HPMHooks.count.HP_libconfig_lookup_float_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, double **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_float_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9185,26 +9636,26 @@ int HP_libconfig_lookup_float(const config_t *config, const char *filepath, doub
{
retVal___ = HPMHooks.source.libconfig.lookup_float(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_float_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_float_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, double *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_bool(const config_t *config, const char *filepath, int *value) {
+int HP_libconfig_lookup_bool(const struct config_t *config, const char *filepath, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_bool_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, int *value);
+ if (HPMHooks.count.HP_libconfig_lookup_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_bool_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9212,26 +9663,26 @@ int HP_libconfig_lookup_bool(const config_t *config, const char *filepath, int *
{
retVal___ = HPMHooks.source.libconfig.lookup_bool(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_string(const config_t *config, const char *filepath, const char **value) {
+int HP_libconfig_lookup_string(const struct config_t *config, const char *filepath, const char **value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_string_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, const char **value);
+ if (HPMHooks.count.HP_libconfig_lookup_string_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, const char ***value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_string_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9239,52 +9690,52 @@ int HP_libconfig_lookup_string(const config_t *config, const char *filepath, con
{
retVal___ = HPMHooks.source.libconfig.lookup_string(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_string_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, const char **value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, const char **value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_read_file(config_t *config, const char *config_filename) {
+int HP_libconfig_load_file(struct config_t *config, const char *config_filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_file_pre ) {
- int (*preHookFunc) (config_t *config, const char *config_filename);
+ if (HPMHooks.count.HP_libconfig_load_file_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **config_filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_read_file_pre[hIndex].func;
- retVal___ = preHookFunc(config, config_filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_load_file_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_load_file_pre[hIndex].func;
+ retVal___ = preHookFunc(&config, &config_filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.libconfig.read_file(config, config_filename);
+ retVal___ = HPMHooks.source.libconfig.load_file(config, config_filename);
}
- if( HPMHooks.count.HP_libconfig_read_file_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *config_filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_read_file_post[hIndex].func;
+ if (HPMHooks.count.HP_libconfig_load_file_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *config_filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_load_file_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_load_file_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, config_filename);
}
}
return retVal___;
}
-void HP_libconfig_setting_copy_simple(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_simple(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_simple_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_simple_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_simple_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9292,25 +9743,25 @@ void HP_libconfig_setting_copy_simple(config_setting_t *parent, const config_set
{
HPMHooks.source.libconfig.setting_copy_simple(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_simple_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_simple_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_simple_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-void HP_libconfig_setting_copy_elem(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_elem(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_elem_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_elem_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_elem_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9318,25 +9769,25 @@ void HP_libconfig_setting_copy_elem(config_setting_t *parent, const config_setti
{
HPMHooks.source.libconfig.setting_copy_elem(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_elem_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_elem_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_elem_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-void HP_libconfig_setting_copy_aggregate(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_aggregate(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_aggregate_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9344,26 +9795,26 @@ void HP_libconfig_setting_copy_aggregate(config_setting_t *parent, const config_
{
HPMHooks.source.libconfig.setting_copy_aggregate(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_aggregate_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_aggregate_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_aggregate_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-int HP_libconfig_setting_copy(config_setting_t *parent, const config_setting_t *src) {
+int HP_libconfig_setting_copy(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_pre ) {
- int (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_pre[hIndex].func;
- retVal___ = preHookFunc(parent, src);
+ retVal___ = preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9371,711 +9822,635 @@ int HP_libconfig_setting_copy(config_setting_t *parent, const config_setting_t *
{
retVal___ = HPMHooks.source.libconfig.setting_copy(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, parent, src);
}
}
return retVal___;
}
-/* loginif */
-void HP_loginif_init(void) {
+bool HP_libconfig_setting_get_bool_real(const struct config_setting_t *setting) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_init_pre ) {
- void (*preHookFunc) (void);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_real_pre > 0) {
+ bool (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_init_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_real_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_real_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.init();
+ retVal___ = HPMHooks.source.libconfig.setting_get_bool_real(setting);
}
- if( HPMHooks.count.HP_loginif_init_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_init_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_real_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_real_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_real_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_final(void) {
+uint32 HP_libconfig_setting_get_uint32(const struct config_setting_t *setting) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_final_pre ) {
- void (*preHookFunc) (void);
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_uint32_pre > 0) {
+ uint32 (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_final_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint32_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.final();
+ retVal___ = HPMHooks.source.libconfig.setting_get_uint32(setting);
}
- if( HPMHooks.count.HP_loginif_final_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_final_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_libconfig_setting_get_uint32_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_reset(void) {
+uint16 HP_libconfig_setting_get_uint16(const struct config_setting_t *setting) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_reset_pre ) {
- void (*preHookFunc) (void);
+ uint16 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_uint16_pre > 0) {
+ uint16 (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_reset_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_reset_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.reset();
+ retVal___ = HPMHooks.source.libconfig.setting_get_uint16(setting);
}
- if( HPMHooks.count.HP_loginif_reset_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_reset_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_reset_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_libconfig_setting_get_uint16_post > 0) {
+ uint16 (*postHookFunc) (uint16 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_check_shutdown(void) {
+int16 HP_libconfig_setting_get_int16(const struct config_setting_t *setting) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_check_shutdown_pre ) {
- void (*preHookFunc) (void);
+ int16 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int16_pre > 0) {
+ int16 (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_check_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_check_shutdown_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.check_shutdown();
+ retVal___ = HPMHooks.source.libconfig.setting_get_int16(setting);
}
- if( HPMHooks.count.HP_loginif_check_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_check_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_check_shutdown_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_libconfig_setting_get_int16_post > 0) {
+ int16 (*postHookFunc) (int16 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_on_disconnect(void) {
+int HP_libconfig_setting_lookup_bool_real(const struct config_setting_t *setting, const char *name, bool *value) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_on_disconnect_pre ) {
- void (*preHookFunc) (void);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_real_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, bool **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_disconnect_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_on_disconnect_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_real_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_real_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.on_disconnect();
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_bool_real(setting, name, value);
}
- if( HPMHooks.count.HP_loginif_on_disconnect_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_disconnect_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_on_disconnect_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_real_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, bool *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_real_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_real_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_on_ready(void) {
+int HP_libconfig_setting_lookup_uint32(const struct config_setting_t *setting, const char *name, uint32 *value) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_on_ready_pre ) {
- void (*preHookFunc) (void);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint32_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, uint32 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_ready_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_on_ready_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint32_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.on_ready();
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_uint32(setting, name, value);
}
- if( HPMHooks.count.HP_loginif_on_ready_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_ready_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_on_ready_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint32_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, uint32 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_block_account(int account_id, int flag) {
+int HP_libconfig_setting_lookup_uint16(const struct config_setting_t *setting, const char *name, uint16 *value) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_block_account_pre ) {
- void (*preHookFunc) (int *account_id, int *flag);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint16_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, uint16 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_block_account_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_block_account_pre[hIndex].func;
- preHookFunc(&account_id, &flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.block_account(account_id, flag);
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_uint16(setting, name, value);
}
- if( HPMHooks.count.HP_loginif_block_account_post ) {
- void (*postHookFunc) (int *account_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_block_account_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_block_account_post[hIndex].func;
- postHookFunc(&account_id, &flag);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint16_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, uint16 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_ban_account(int account_id, short year, short month, short day, short hour, short minute, short second) {
+int HP_libconfig_setting_lookup_int16(const struct config_setting_t *setting, const char *name, int16 *value) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_ban_account_pre ) {
- void (*preHookFunc) (int *account_id, short *year, short *month, short *day, short *hour, short *minute, short *second);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int16_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int16 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_ban_account_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_ban_account_pre[hIndex].func;
- preHookFunc(&account_id, &year, &month, &day, &hour, &minute, &second);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.ban_account(account_id, year, month, day, hour, minute, second);
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_int16(setting, name, value);
}
- if( HPMHooks.count.HP_loginif_ban_account_post ) {
- void (*postHookFunc) (int *account_id, short *year, short *month, short *day, short *hour, short *minute, short *second);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_ban_account_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_ban_account_post[hIndex].func;
- postHookFunc(&account_id, &year, &month, &day, &hour, &minute, &second);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int16_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int16 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_unban_account(int account_id) {
+int HP_libconfig_setting_lookup_mutable_string(const struct config_setting_t *setting, const char *name, char *out, size_t out_size) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_unban_account_pre ) {
- void (*preHookFunc) (int *account_id);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, char **out, size_t *out_size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_unban_account_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_unban_account_pre[hIndex].func;
- preHookFunc(&account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_mutable_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &out, &out_size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.unban_account(account_id);
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_mutable_string(setting, name, out, out_size);
}
- if( HPMHooks.count.HP_loginif_unban_account_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_unban_account_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_unban_account_post[hIndex].func;
- postHookFunc(&account_id);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, char *out, size_t out_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_mutable_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, out, out_size);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_changesex(int account_id) {
+int HP_libconfig_lookup_mutable_string(const struct config_t *config, const char *name, char *out, size_t out_size) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_changesex_pre ) {
- void (*preHookFunc) (int *account_id);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_lookup_mutable_string_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **name, char **out, size_t *out_size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_changesex_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_changesex_pre[hIndex].func;
- preHookFunc(&account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_mutable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_lookup_mutable_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&config, &name, &out, &out_size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.loginif.changesex(account_id);
+ retVal___ = HPMHooks.source.libconfig.lookup_mutable_string(config, name, out, out_size);
}
- if( HPMHooks.count.HP_loginif_changesex_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_changesex_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_changesex_post[hIndex].func;
- postHookFunc(&account_id);
+ if (HPMHooks.count.HP_libconfig_lookup_mutable_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *name, char *out, size_t out_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_mutable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_lookup_mutable_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, config, name, out, out_size);
}
}
- return;
+ return retVal___;
}
-void HP_loginif_auth(int fd, struct char_session_data *sd, uint32 ipl) {
+/* loginif_interface */
+void HP_loginif_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_auth_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd, uint32 *ipl);
+ if (HPMHooks.count.HP_loginif_init_pre > 0) {
+ void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_auth_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_auth_pre[hIndex].func;
- preHookFunc(&fd, sd, &ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_init_pre[hIndex].func;
+ preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.loginif.auth(fd, sd, ipl);
+ HPMHooks.source.loginif.init();
}
- if( HPMHooks.count.HP_loginif_auth_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd, uint32 *ipl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_auth_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_auth_post[hIndex].func;
- postHookFunc(&fd, sd, &ipl);
+ if (HPMHooks.count.HP_loginif_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_init_post[hIndex].func;
+ postHookFunc();
}
}
return;
}
-void HP_loginif_send_users_count(int users) {
+void HP_loginif_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_send_users_count_pre ) {
- void (*preHookFunc) (int *users);
+ if (HPMHooks.count.HP_loginif_final_pre > 0) {
+ void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_send_users_count_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_send_users_count_pre[hIndex].func;
- preHookFunc(&users);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_final_pre[hIndex].func;
+ preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.loginif.send_users_count(users);
+ HPMHooks.source.loginif.final();
}
- if( HPMHooks.count.HP_loginif_send_users_count_post ) {
- void (*postHookFunc) (int *users);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_send_users_count_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_send_users_count_post[hIndex].func;
- postHookFunc(&users);
+ if (HPMHooks.count.HP_loginif_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_final_post[hIndex].func;
+ postHookFunc();
}
}
return;
}
-void HP_loginif_connect_to_server(void) {
+void HP_loginif_reset(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_loginif_connect_to_server_pre ) {
+ if (HPMHooks.count.HP_loginif_reset_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_connect_to_server_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_loginif_connect_to_server_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_reset_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_reset_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.loginif.connect_to_server();
+ HPMHooks.source.loginif.reset();
}
- if( HPMHooks.count.HP_loginif_connect_to_server_post ) {
+ if (HPMHooks.count.HP_loginif_reset_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_loginif_connect_to_server_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_loginif_connect_to_server_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_reset_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_reset_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* iMalloc */
-void HP_iMalloc_init(void) {
+void HP_loginif_check_shutdown(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_pre ) {
+ if (HPMHooks.count.HP_loginif_check_shutdown_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_check_shutdown_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_check_shutdown_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.init();
+ HPMHooks.source.loginif.check_shutdown();
}
- if( HPMHooks.count.HP_iMalloc_init_post ) {
+ if (HPMHooks.count.HP_loginif_check_shutdown_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_check_shutdown_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_check_shutdown_post[hIndex].func;
postHookFunc();
}
}
return;
}
-void HP_iMalloc_final(void) {
+void HP_loginif_on_disconnect(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_final_pre ) {
+ if (HPMHooks.count.HP_loginif_on_disconnect_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_disconnect_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_on_disconnect_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.final();
+ HPMHooks.source.loginif.on_disconnect();
}
- if( HPMHooks.count.HP_iMalloc_final_post ) {
+ if (HPMHooks.count.HP_loginif_on_disconnect_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_disconnect_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_on_disconnect_post[hIndex].func;
postHookFunc();
}
}
return;
}
-void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_malloc_pre ) {
- void* (*preHookFunc) (size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func;
- retVal___ = preHookFunc(&size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_malloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_calloc_pre ) {
- void* (*preHookFunc) (size_t *num, size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func;
- retVal___ = preHookFunc(&num, &size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_calloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t *num, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &num, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_realloc_pre ) {
- void* (*preHookFunc) (void *p, size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func;
- retVal___ = preHookFunc(p, &size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_realloc_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
+void HP_loginif_on_ready(void) {
int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_reallocz_pre ) {
- void* (*preHookFunc) (void *p, size_t *size, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_loginif_on_ready_pre > 0) {
+ void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func;
- retVal___ = preHookFunc(p, &size, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_ready_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_on_ready_pre[hIndex].func;
+ preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func);
+ HPMHooks.source.loginif.on_ready();
}
- if( HPMHooks.count.HP_iMalloc_reallocz_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &size, file, &line, func);
+ if (HPMHooks.count.HP_loginif_on_ready_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_on_ready_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_on_ready_post[hIndex].func;
+ postHookFunc();
}
}
- return retVal___;
+ return;
}
-char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) {
+void HP_loginif_block_account(int account_id, int flag) {
int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrdup_pre ) {
- char* (*preHookFunc) (const char *p, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_loginif_block_account_pre > 0) {
+ void (*preHookFunc) (int *account_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func;
- retVal___ = preHookFunc(p, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_block_account_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_block_account_pre[hIndex].func;
+ preHookFunc(&account_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func);
+ HPMHooks.source.loginif.block_account(account_id, flag);
}
- if( HPMHooks.count.HP_iMalloc_astrdup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, file, &line, func);
+ if (HPMHooks.count.HP_loginif_block_account_post > 0) {
+ void (*postHookFunc) (int account_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_block_account_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_block_account_post[hIndex].func;
+ postHookFunc(account_id, flag);
}
}
- return retVal___;
+ return;
}
-void HP_iMalloc_free(void *p, const char *file, int line, const char *func) {
+void HP_loginif_ban_account(int account_id, short year, short month, short day, short hour, short minute, short second) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_free_pre ) {
- void (*preHookFunc) (void *p, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_loginif_ban_account_pre > 0) {
+ void (*preHookFunc) (int *account_id, short *year, short *month, short *day, short *hour, short *minute, short *second);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func;
- preHookFunc(p, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_ban_account_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_ban_account_pre[hIndex].func;
+ preHookFunc(&account_id, &year, &month, &day, &hour, &minute, &second);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.free(p, file, line, func);
+ HPMHooks.source.loginif.ban_account(account_id, year, month, day, hour, minute, second);
}
- if( HPMHooks.count.HP_iMalloc_free_post ) {
- void (*postHookFunc) (void *p, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func;
- postHookFunc(p, file, &line, func);
+ if (HPMHooks.count.HP_loginif_ban_account_post > 0) {
+ void (*postHookFunc) (int account_id, short year, short month, short day, short hour, short minute, short second);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_ban_account_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_ban_account_post[hIndex].func;
+ postHookFunc(account_id, year, month, day, hour, minute, second);
}
}
return;
}
-void HP_iMalloc_memory_check(void) {
+void HP_loginif_unban_account(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_memory_check_pre ) {
- void (*preHookFunc) (void);
+ if (HPMHooks.count.HP_loginif_unban_account_pre > 0) {
+ void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_unban_account_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_unban_account_pre[hIndex].func;
+ preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.memory_check();
+ HPMHooks.source.loginif.unban_account(account_id);
}
- if( HPMHooks.count.HP_iMalloc_memory_check_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_loginif_unban_account_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_unban_account_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_unban_account_post[hIndex].func;
+ postHookFunc(account_id);
}
}
return;
}
-bool HP_iMalloc_verify_ptr(void *ptr) {
+void HP_loginif_changesex(int account_id) {
int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) {
- bool (*preHookFunc) (void *ptr);
+ if (HPMHooks.count.HP_loginif_changesex_pre > 0) {
+ void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func;
- retVal___ = preHookFunc(ptr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_changesex_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_changesex_pre[hIndex].func;
+ preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr);
+ HPMHooks.source.loginif.changesex(account_id);
}
- if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) {
- bool (*postHookFunc) (bool retVal___, void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ptr);
+ if (HPMHooks.count.HP_loginif_changesex_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_changesex_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_changesex_post[hIndex].func;
+ postHookFunc(account_id);
}
}
- return retVal___;
+ return;
}
-size_t HP_iMalloc_usage(void) {
+void HP_loginif_auth(int fd, struct char_session_data *sd, uint32 ipl) {
int hIndex = 0;
- size_t retVal___ = 0;
- if( HPMHooks.count.HP_iMalloc_usage_pre ) {
- size_t (*preHookFunc) (void);
+ if (HPMHooks.count.HP_loginif_auth_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd, uint32 *ipl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func;
- retVal___ = preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_auth_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_auth_pre[hIndex].func;
+ preHookFunc(&fd, &sd, &ipl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.usage();
+ HPMHooks.source.loginif.auth(fd, sd, ipl);
}
- if( HPMHooks.count.HP_iMalloc_usage_post ) {
- size_t (*postHookFunc) (size_t retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___);
+ if (HPMHooks.count.HP_loginif_auth_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd, uint32 ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_auth_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_auth_post[hIndex].func;
+ postHookFunc(fd, sd, ipl);
}
}
- return retVal___;
+ return;
}
-void HP_iMalloc_post_shutdown(void) {
+void HP_loginif_send_users_count(int users) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) {
- void (*preHookFunc) (void);
+ if (HPMHooks.count.HP_loginif_send_users_count_pre > 0) {
+ void (*preHookFunc) (int *users);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_send_users_count_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_send_users_count_pre[hIndex].func;
+ preHookFunc(&users);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.post_shutdown();
+ HPMHooks.source.loginif.send_users_count(users);
}
- if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_loginif_send_users_count_post > 0) {
+ void (*postHookFunc) (int users);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_send_users_count_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_send_users_count_post[hIndex].func;
+ postHookFunc(users);
}
}
return;
}
-void HP_iMalloc_init_messages(void) {
+void HP_loginif_connect_to_server(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_messages_pre ) {
+ if (HPMHooks.count.HP_loginif_connect_to_server_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_connect_to_server_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_loginif_connect_to_server_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.init_messages();
+ HPMHooks.source.loginif.connect_to_server();
}
- if( HPMHooks.count.HP_iMalloc_init_messages_post ) {
+ if (HPMHooks.count.HP_loginif_connect_to_server_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_loginif_connect_to_server_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_loginif_connect_to_server_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* mapif */
+/* mapif_interface */
void HP_mapif_ban(int id, unsigned int flag, int status) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_ban_pre ) {
+ if (HPMHooks.count.HP_mapif_ban_pre > 0) {
void (*preHookFunc) (int *id, unsigned int *flag, int *status);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_ban_pre[hIndex].func;
preHookFunc(&id, &flag, &status);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10083,25 +10458,25 @@ void HP_mapif_ban(int id, unsigned int flag, int status) {
{
HPMHooks.source.mapif.ban(id, flag, status);
}
- if( HPMHooks.count.HP_mapif_ban_post ) {
- void (*postHookFunc) (int *id, unsigned int *flag, int *status);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_ban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_ban_post > 0) {
+ void (*postHookFunc) (int id, unsigned int flag, int status);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_ban_post[hIndex].func;
- postHookFunc(&id, &flag, &status);
+ postHookFunc(id, flag, status);
}
}
return;
}
void HP_mapif_server_init(int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_server_init_pre ) {
+ if (HPMHooks.count.HP_mapif_server_init_pre > 0) {
void (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_server_init_pre[hIndex].func;
preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10109,25 +10484,25 @@ void HP_mapif_server_init(int id) {
{
HPMHooks.source.mapif.server_init(id);
}
- if( HPMHooks.count.HP_mapif_server_init_post ) {
- void (*postHookFunc) (int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_server_init_post > 0) {
+ void (*postHookFunc) (int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_server_init_post[hIndex].func;
- postHookFunc(&id);
+ postHookFunc(id);
}
}
return;
}
void HP_mapif_server_destroy(int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_server_destroy_pre ) {
+ if (HPMHooks.count.HP_mapif_server_destroy_pre > 0) {
void (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_server_destroy_pre[hIndex].func;
preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10135,25 +10510,25 @@ void HP_mapif_server_destroy(int id) {
{
HPMHooks.source.mapif.server_destroy(id);
}
- if( HPMHooks.count.HP_mapif_server_destroy_post ) {
- void (*postHookFunc) (int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_destroy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_server_destroy_post > 0) {
+ void (*postHookFunc) (int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_server_destroy_post[hIndex].func;
- postHookFunc(&id);
+ postHookFunc(id);
}
}
return;
}
void HP_mapif_server_reset(int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_server_reset_pre ) {
+ if (HPMHooks.count.HP_mapif_server_reset_pre > 0) {
void (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_reset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_reset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_server_reset_pre[hIndex].func;
preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10161,25 +10536,25 @@ void HP_mapif_server_reset(int id) {
{
HPMHooks.source.mapif.server_reset(id);
}
- if( HPMHooks.count.HP_mapif_server_reset_post ) {
- void (*postHookFunc) (int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_reset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_server_reset_post > 0) {
+ void (*postHookFunc) (int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_server_reset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_server_reset_post[hIndex].func;
- postHookFunc(&id);
+ postHookFunc(id);
}
}
return;
}
void HP_mapif_on_disconnect(int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_on_disconnect_pre ) {
+ if (HPMHooks.count.HP_mapif_on_disconnect_pre > 0) {
void (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_disconnect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_disconnect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_on_disconnect_pre[hIndex].func;
preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10187,25 +10562,25 @@ void HP_mapif_on_disconnect(int id) {
{
HPMHooks.source.mapif.on_disconnect(id);
}
- if( HPMHooks.count.HP_mapif_on_disconnect_post ) {
- void (*postHookFunc) (int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_disconnect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_on_disconnect_post > 0) {
+ void (*postHookFunc) (int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_disconnect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_on_disconnect_post[hIndex].func;
- postHookFunc(&id);
+ postHookFunc(id);
}
}
return;
}
void HP_mapif_on_parse_accinfo(int account_id, int u_fd, int u_aid, int u_group, int map_fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_on_parse_accinfo_pre ) {
+ if (HPMHooks.count.HP_mapif_on_parse_accinfo_pre > 0) {
void (*preHookFunc) (int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_parse_accinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_parse_accinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_on_parse_accinfo_pre[hIndex].func;
preHookFunc(&account_id, &u_fd, &u_aid, &u_group, &map_fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10213,25 +10588,25 @@ void HP_mapif_on_parse_accinfo(int account_id, int u_fd, int u_aid, int u_group,
{
HPMHooks.source.mapif.on_parse_accinfo(account_id, u_fd, u_aid, u_group, map_fd);
}
- if( HPMHooks.count.HP_mapif_on_parse_accinfo_post ) {
- void (*postHookFunc) (int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_parse_accinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_on_parse_accinfo_post > 0) {
+ void (*postHookFunc) (int account_id, int u_fd, int u_aid, int u_group, int map_fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_on_parse_accinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_on_parse_accinfo_post[hIndex].func;
- postHookFunc(&account_id, &u_fd, &u_aid, &u_group, &map_fd);
+ postHookFunc(account_id, u_fd, u_aid, u_group, map_fd);
}
}
return;
}
void HP_mapif_char_ban(int char_id, time_t timestamp) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_char_ban_pre ) {
+ if (HPMHooks.count.HP_mapif_char_ban_pre > 0) {
void (*preHookFunc) (int *char_id, time_t *timestamp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_char_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_char_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_char_ban_pre[hIndex].func;
preHookFunc(&char_id, &timestamp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10239,26 +10614,26 @@ void HP_mapif_char_ban(int char_id, time_t timestamp) {
{
HPMHooks.source.mapif.char_ban(char_id, timestamp);
}
- if( HPMHooks.count.HP_mapif_char_ban_post ) {
- void (*postHookFunc) (int *char_id, time_t *timestamp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_char_ban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_char_ban_post > 0) {
+ void (*postHookFunc) (int char_id, time_t timestamp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_char_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_char_ban_post[hIndex].func;
- postHookFunc(&char_id, &timestamp);
+ postHookFunc(char_id, timestamp);
}
}
return;
}
-int HP_mapif_sendall(unsigned char *buf, unsigned int len) {
+int HP_mapif_sendall(const unsigned char *buf, unsigned int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_sendall_pre ) {
- int (*preHookFunc) (unsigned char *buf, unsigned int *len);
+ if (HPMHooks.count.HP_mapif_sendall_pre > 0) {
+ int (*preHookFunc) (const unsigned char **buf, unsigned int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_sendall_pre[hIndex].func;
- retVal___ = preHookFunc(buf, &len);
+ retVal___ = preHookFunc(&buf, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10266,11 +10641,11 @@ int HP_mapif_sendall(unsigned char *buf, unsigned int len) {
{
retVal___ = HPMHooks.source.mapif.sendall(buf, len);
}
- if( HPMHooks.count.HP_mapif_sendall_post ) {
- int (*postHookFunc) (int retVal___, unsigned char *buf, unsigned int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendall_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_sendall_post > 0) {
+ int (*postHookFunc) (int retVal___, const unsigned char *buf, unsigned int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_sendall_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, buf, &len);
+ retVal___ = postHookFunc(retVal___, buf, len);
}
}
return retVal___;
@@ -10278,14 +10653,14 @@ int HP_mapif_sendall(unsigned char *buf, unsigned int len) {
int HP_mapif_sendallwos(int sfd, unsigned char *buf, unsigned int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_sendallwos_pre ) {
- int (*preHookFunc) (int *sfd, unsigned char *buf, unsigned int *len);
+ if (HPMHooks.count.HP_mapif_sendallwos_pre > 0) {
+ int (*preHookFunc) (int *sfd, unsigned char **buf, unsigned int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendallwos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendallwos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_sendallwos_pre[hIndex].func;
- retVal___ = preHookFunc(&sfd, buf, &len);
+ retVal___ = preHookFunc(&sfd, &buf, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10293,11 +10668,11 @@ int HP_mapif_sendallwos(int sfd, unsigned char *buf, unsigned int len) {
{
retVal___ = HPMHooks.source.mapif.sendallwos(sfd, buf, len);
}
- if( HPMHooks.count.HP_mapif_sendallwos_post ) {
- int (*postHookFunc) (int retVal___, int *sfd, unsigned char *buf, unsigned int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendallwos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_sendallwos_post > 0) {
+ int (*postHookFunc) (int retVal___, int sfd, unsigned char *buf, unsigned int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sendallwos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_sendallwos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &sfd, buf, &len);
+ retVal___ = postHookFunc(retVal___, sfd, buf, len);
}
}
return retVal___;
@@ -10305,14 +10680,14 @@ int HP_mapif_sendallwos(int sfd, unsigned char *buf, unsigned int len) {
int HP_mapif_send(int fd, unsigned char *buf, unsigned int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_send_pre ) {
- int (*preHookFunc) (int *fd, unsigned char *buf, unsigned int *len);
+ if (HPMHooks.count.HP_mapif_send_pre > 0) {
+ int (*preHookFunc) (int *fd, unsigned char **buf, unsigned int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_send_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, buf, &len);
+ retVal___ = preHookFunc(&fd, &buf, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10320,25 +10695,25 @@ int HP_mapif_send(int fd, unsigned char *buf, unsigned int len) {
{
retVal___ = HPMHooks.source.mapif.send(fd, buf, len);
}
- if( HPMHooks.count.HP_mapif_send_post ) {
- int (*postHookFunc) (int retVal___, int *fd, unsigned char *buf, unsigned int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_send_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, unsigned char *buf, unsigned int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_send_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, buf, &len);
+ retVal___ = postHookFunc(retVal___, fd, buf, len);
}
}
return retVal___;
}
void HP_mapif_send_users_count(int users) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_send_users_count_pre ) {
+ if (HPMHooks.count.HP_mapif_send_users_count_pre > 0) {
void (*preHookFunc) (int *users);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_users_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_users_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_send_users_count_pre[hIndex].func;
preHookFunc(&users);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10346,25 +10721,25 @@ void HP_mapif_send_users_count(int users) {
{
HPMHooks.source.mapif.send_users_count(users);
}
- if( HPMHooks.count.HP_mapif_send_users_count_post ) {
- void (*postHookFunc) (int *users);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_users_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_send_users_count_post > 0) {
+ void (*postHookFunc) (int users);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_users_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_send_users_count_post[hIndex].func;
- postHookFunc(&users);
+ postHookFunc(users);
}
}
return;
}
void HP_mapif_auction_message(int char_id, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_auction_message_pre ) {
+ if (HPMHooks.count.HP_mapif_auction_message_pre > 0) {
void (*preHookFunc) (int *char_id, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_auction_message_pre[hIndex].func;
preHookFunc(&char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10372,25 +10747,25 @@ void HP_mapif_auction_message(int char_id, unsigned char result) {
{
HPMHooks.source.mapif.auction_message(char_id, result);
}
- if( HPMHooks.count.HP_mapif_auction_message_post ) {
- void (*postHookFunc) (int *char_id, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_auction_message_post > 0) {
+ void (*postHookFunc) (int char_id, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_auction_message_post[hIndex].func;
- postHookFunc(&char_id, &result);
+ postHookFunc(char_id, result);
}
}
return;
}
void HP_mapif_auction_sendlist(int fd, int char_id, short count, short pages, unsigned char *buf) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_auction_sendlist_pre ) {
- void (*preHookFunc) (int *fd, int *char_id, short *count, short *pages, unsigned char *buf);
+ if (HPMHooks.count.HP_mapif_auction_sendlist_pre > 0) {
+ void (*preHookFunc) (int *fd, int *char_id, short *count, short *pages, unsigned char **buf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_sendlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_sendlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_auction_sendlist_pre[hIndex].func;
- preHookFunc(&fd, &char_id, &count, &pages, buf);
+ preHookFunc(&fd, &char_id, &count, &pages, &buf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10398,25 +10773,25 @@ void HP_mapif_auction_sendlist(int fd, int char_id, short count, short pages, un
{
HPMHooks.source.mapif.auction_sendlist(fd, char_id, count, pages, buf);
}
- if( HPMHooks.count.HP_mapif_auction_sendlist_post ) {
- void (*postHookFunc) (int *fd, int *char_id, short *count, short *pages, unsigned char *buf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_sendlist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_auction_sendlist_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, short count, short pages, unsigned char *buf);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_sendlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_auction_sendlist_post[hIndex].func;
- postHookFunc(&fd, &char_id, &count, &pages, buf);
+ postHookFunc(fd, char_id, count, pages, buf);
}
}
return;
}
void HP_mapif_parse_auction_requestlist(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_auction_requestlist_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_requestlist_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_requestlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_requestlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_auction_requestlist_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10424,25 +10799,25 @@ void HP_mapif_parse_auction_requestlist(int fd) {
{
HPMHooks.source.mapif.parse_auction_requestlist(fd);
}
- if( HPMHooks.count.HP_mapif_parse_auction_requestlist_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_requestlist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_requestlist_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_requestlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_auction_requestlist_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_auction_register(int fd, struct auction_data *auction) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_auction_register_pre ) {
- void (*preHookFunc) (int *fd, struct auction_data *auction);
+ if (HPMHooks.count.HP_mapif_auction_register_pre > 0) {
+ void (*preHookFunc) (int *fd, struct auction_data **auction);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_register_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_register_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_auction_register_pre[hIndex].func;
- preHookFunc(&fd, auction);
+ preHookFunc(&fd, &auction);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10450,25 +10825,25 @@ void HP_mapif_auction_register(int fd, struct auction_data *auction) {
{
HPMHooks.source.mapif.auction_register(fd, auction);
}
- if( HPMHooks.count.HP_mapif_auction_register_post ) {
- void (*postHookFunc) (int *fd, struct auction_data *auction);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_register_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_auction_register_post > 0) {
+ void (*postHookFunc) (int fd, struct auction_data *auction);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_register_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_auction_register_post[hIndex].func;
- postHookFunc(&fd, auction);
+ postHookFunc(fd, auction);
}
}
return;
}
void HP_mapif_parse_auction_register(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_auction_register_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_register_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_register_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_register_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_auction_register_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10476,25 +10851,25 @@ void HP_mapif_parse_auction_register(int fd) {
{
HPMHooks.source.mapif.parse_auction_register(fd);
}
- if( HPMHooks.count.HP_mapif_parse_auction_register_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_register_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_register_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_register_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_auction_register_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_auction_cancel(int fd, int char_id, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_auction_cancel_pre ) {
+ if (HPMHooks.count.HP_mapif_auction_cancel_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_auction_cancel_pre[hIndex].func;
preHookFunc(&fd, &char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10502,25 +10877,25 @@ void HP_mapif_auction_cancel(int fd, int char_id, unsigned char result) {
{
HPMHooks.source.mapif.auction_cancel(fd, char_id, result);
}
- if( HPMHooks.count.HP_mapif_auction_cancel_post ) {
- void (*postHookFunc) (int *fd, int *char_id, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_cancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_auction_cancel_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_auction_cancel_post[hIndex].func;
- postHookFunc(&fd, &char_id, &result);
+ postHookFunc(fd, char_id, result);
}
}
return;
}
void HP_mapif_parse_auction_cancel(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_auction_cancel_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_cancel_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_auction_cancel_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10528,25 +10903,25 @@ void HP_mapif_parse_auction_cancel(int fd) {
{
HPMHooks.source.mapif.parse_auction_cancel(fd);
}
- if( HPMHooks.count.HP_mapif_parse_auction_cancel_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_cancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_cancel_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_auction_cancel_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_auction_close(int fd, int char_id, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_auction_close_pre ) {
+ if (HPMHooks.count.HP_mapif_auction_close_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_auction_close_pre[hIndex].func;
preHookFunc(&fd, &char_id, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10554,25 +10929,25 @@ void HP_mapif_auction_close(int fd, int char_id, unsigned char result) {
{
HPMHooks.source.mapif.auction_close(fd, char_id, result);
}
- if( HPMHooks.count.HP_mapif_auction_close_post ) {
- void (*postHookFunc) (int *fd, int *char_id, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_auction_close_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_auction_close_post[hIndex].func;
- postHookFunc(&fd, &char_id, &result);
+ postHookFunc(fd, char_id, result);
}
}
return;
}
void HP_mapif_parse_auction_close(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_auction_close_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_close_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_auction_close_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10580,25 +10955,25 @@ void HP_mapif_parse_auction_close(int fd) {
{
HPMHooks.source.mapif.parse_auction_close(fd);
}
- if( HPMHooks.count.HP_mapif_parse_auction_close_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_close_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_auction_close_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_auction_bid(int fd, int char_id, int bid, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_auction_bid_pre ) {
+ if (HPMHooks.count.HP_mapif_auction_bid_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, int *bid, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_bid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_bid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_auction_bid_pre[hIndex].func;
preHookFunc(&fd, &char_id, &bid, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10606,25 +10981,25 @@ void HP_mapif_auction_bid(int fd, int char_id, int bid, unsigned char result) {
{
HPMHooks.source.mapif.auction_bid(fd, char_id, bid, result);
}
- if( HPMHooks.count.HP_mapif_auction_bid_post ) {
- void (*postHookFunc) (int *fd, int *char_id, int *bid, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_bid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_auction_bid_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, int bid, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_auction_bid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_auction_bid_post[hIndex].func;
- postHookFunc(&fd, &char_id, &bid, &result);
+ postHookFunc(fd, char_id, bid, result);
}
}
return;
}
void HP_mapif_parse_auction_bid(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_auction_bid_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_bid_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_bid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_bid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_auction_bid_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10632,26 +11007,53 @@ void HP_mapif_parse_auction_bid(int fd) {
{
HPMHooks.source.mapif.parse_auction_bid(fd);
}
- if( HPMHooks.count.HP_mapif_parse_auction_bid_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_bid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_auction_bid_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_auction_bid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_auction_bid_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
-bool HP_mapif_elemental_save(struct s_elemental *ele) {
+bool HP_mapif_elemental_create(struct s_elemental *ele) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_elemental_save_pre ) {
- bool (*preHookFunc) (struct s_elemental *ele);
+ if (HPMHooks.count.HP_mapif_elemental_create_pre > 0) {
+ bool (*preHookFunc) (struct s_elemental **ele);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_elemental_create_pre[hIndex].func;
+ retVal___ = preHookFunc(&ele);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mapif.elemental_create(ele);
+ }
+ if (HPMHooks.count.HP_mapif_elemental_create_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct s_elemental *ele);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_elemental_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, ele);
+ }
+ }
+ return retVal___;
+}
+bool HP_mapif_elemental_save(const struct s_elemental *ele) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mapif_elemental_save_pre > 0) {
+ bool (*preHookFunc) (const struct s_elemental **ele);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_elemental_save_pre[hIndex].func;
- retVal___ = preHookFunc(ele);
+ retVal___ = preHookFunc(&ele);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10659,9 +11061,9 @@ bool HP_mapif_elemental_save(struct s_elemental *ele) {
{
retVal___ = HPMHooks.source.mapif.elemental_save(ele);
}
- if( HPMHooks.count.HP_mapif_elemental_save_post ) {
- bool (*postHookFunc) (bool retVal___, struct s_elemental *ele);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_elemental_save_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct s_elemental *ele);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_elemental_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ele);
}
@@ -10671,14 +11073,14 @@ bool HP_mapif_elemental_save(struct s_elemental *ele) {
bool HP_mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_elemental_load_pre ) {
- bool (*preHookFunc) (int *ele_id, int *char_id, struct s_elemental *ele);
+ if (HPMHooks.count.HP_mapif_elemental_load_pre > 0) {
+ bool (*preHookFunc) (int *ele_id, int *char_id, struct s_elemental **ele);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_elemental_load_pre[hIndex].func;
- retVal___ = preHookFunc(&ele_id, &char_id, ele);
+ retVal___ = preHookFunc(&ele_id, &char_id, &ele);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10686,11 +11088,11 @@ bool HP_mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
{
retVal___ = HPMHooks.source.mapif.elemental_load(ele_id, char_id, ele);
}
- if( HPMHooks.count.HP_mapif_elemental_load_post ) {
- bool (*postHookFunc) (bool retVal___, int *ele_id, int *char_id, struct s_elemental *ele);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_elemental_load_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int ele_id, int char_id, struct s_elemental *ele);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_elemental_load_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ele_id, &char_id, ele);
+ retVal___ = postHookFunc(retVal___, ele_id, char_id, ele);
}
}
return retVal___;
@@ -10698,14 +11100,14 @@ bool HP_mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
bool HP_mapif_elemental_delete(int ele_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_elemental_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_elemental_delete_pre > 0) {
bool (*preHookFunc) (int *ele_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_elemental_delete_pre[hIndex].func;
retVal___ = preHookFunc(&ele_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10713,25 +11115,25 @@ bool HP_mapif_elemental_delete(int ele_id) {
{
retVal___ = HPMHooks.source.mapif.elemental_delete(ele_id);
}
- if( HPMHooks.count.HP_mapif_elemental_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *ele_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_elemental_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int ele_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_elemental_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ele_id);
+ retVal___ = postHookFunc(retVal___, ele_id);
}
}
return retVal___;
}
void HP_mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_elemental_send_pre ) {
- void (*preHookFunc) (int *fd, struct s_elemental *ele, unsigned char *flag);
+ if (HPMHooks.count.HP_mapif_elemental_send_pre > 0) {
+ void (*preHookFunc) (int *fd, struct s_elemental **ele, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_elemental_send_pre[hIndex].func;
- preHookFunc(&fd, ele, &flag);
+ preHookFunc(&fd, &ele, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10739,25 +11141,25 @@ void HP_mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag
{
HPMHooks.source.mapif.elemental_send(fd, ele, flag);
}
- if( HPMHooks.count.HP_mapif_elemental_send_post ) {
- void (*postHookFunc) (int *fd, struct s_elemental *ele, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_elemental_send_post > 0) {
+ void (*postHookFunc) (int fd, struct s_elemental *ele, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_elemental_send_post[hIndex].func;
- postHookFunc(&fd, ele, &flag);
+ postHookFunc(fd, ele, flag);
}
}
return;
}
-void HP_mapif_parse_elemental_create(int fd, struct s_elemental *ele) {
+void HP_mapif_parse_elemental_create(int fd, const struct s_elemental *ele) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_elemental_create_pre ) {
- void (*preHookFunc) (int *fd, struct s_elemental *ele);
+ if (HPMHooks.count.HP_mapif_parse_elemental_create_pre > 0) {
+ void (*preHookFunc) (int *fd, const struct s_elemental **ele);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_elemental_create_pre[hIndex].func;
- preHookFunc(&fd, ele);
+ preHookFunc(&fd, &ele);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10765,25 +11167,25 @@ void HP_mapif_parse_elemental_create(int fd, struct s_elemental *ele) {
{
HPMHooks.source.mapif.parse_elemental_create(fd, ele);
}
- if( HPMHooks.count.HP_mapif_parse_elemental_create_post ) {
- void (*postHookFunc) (int *fd, struct s_elemental *ele);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_elemental_create_post > 0) {
+ void (*postHookFunc) (int fd, const struct s_elemental *ele);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_elemental_create_post[hIndex].func;
- postHookFunc(&fd, ele);
+ postHookFunc(fd, ele);
}
}
return;
}
void HP_mapif_parse_elemental_load(int fd, int ele_id, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_elemental_load_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_elemental_load_pre > 0) {
void (*preHookFunc) (int *fd, int *ele_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_elemental_load_pre[hIndex].func;
preHookFunc(&fd, &ele_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10791,25 +11193,25 @@ void HP_mapif_parse_elemental_load(int fd, int ele_id, int char_id) {
{
HPMHooks.source.mapif.parse_elemental_load(fd, ele_id, char_id);
}
- if( HPMHooks.count.HP_mapif_parse_elemental_load_post ) {
- void (*postHookFunc) (int *fd, int *ele_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_elemental_load_post > 0) {
+ void (*postHookFunc) (int fd, int ele_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_elemental_load_post[hIndex].func;
- postHookFunc(&fd, &ele_id, &char_id);
+ postHookFunc(fd, ele_id, char_id);
}
}
return;
}
void HP_mapif_elemental_deleted(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_elemental_deleted_pre ) {
+ if (HPMHooks.count.HP_mapif_elemental_deleted_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_deleted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_deleted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_elemental_deleted_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10817,25 +11219,25 @@ void HP_mapif_elemental_deleted(int fd, unsigned char flag) {
{
HPMHooks.source.mapif.elemental_deleted(fd, flag);
}
- if( HPMHooks.count.HP_mapif_elemental_deleted_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_deleted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_elemental_deleted_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_deleted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_elemental_deleted_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_mapif_parse_elemental_delete(int fd, int ele_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_elemental_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_elemental_delete_pre > 0) {
void (*preHookFunc) (int *fd, int *ele_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_elemental_delete_pre[hIndex].func;
preHookFunc(&fd, &ele_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10843,25 +11245,25 @@ void HP_mapif_parse_elemental_delete(int fd, int ele_id) {
{
HPMHooks.source.mapif.parse_elemental_delete(fd, ele_id);
}
- if( HPMHooks.count.HP_mapif_parse_elemental_delete_post ) {
- void (*postHookFunc) (int *fd, int *ele_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_elemental_delete_post > 0) {
+ void (*postHookFunc) (int fd, int ele_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_elemental_delete_post[hIndex].func;
- postHookFunc(&fd, &ele_id);
+ postHookFunc(fd, ele_id);
}
}
return;
}
void HP_mapif_elemental_saved(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_elemental_saved_pre ) {
+ if (HPMHooks.count.HP_mapif_elemental_saved_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_saved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_saved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_elemental_saved_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10869,25 +11271,25 @@ void HP_mapif_elemental_saved(int fd, unsigned char flag) {
{
HPMHooks.source.mapif.elemental_saved(fd, flag);
}
- if( HPMHooks.count.HP_mapif_elemental_saved_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_saved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_elemental_saved_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_elemental_saved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_elemental_saved_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
-void HP_mapif_parse_elemental_save(int fd, struct s_elemental *ele) {
+void HP_mapif_parse_elemental_save(int fd, const struct s_elemental *ele) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_elemental_save_pre ) {
- void (*preHookFunc) (int *fd, struct s_elemental *ele);
+ if (HPMHooks.count.HP_mapif_parse_elemental_save_pre > 0) {
+ void (*preHookFunc) (int *fd, const struct s_elemental **ele);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_elemental_save_pre[hIndex].func;
- preHookFunc(&fd, ele);
+ preHookFunc(&fd, &ele);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10895,11 +11297,11 @@ void HP_mapif_parse_elemental_save(int fd, struct s_elemental *ele) {
{
HPMHooks.source.mapif.parse_elemental_save(fd, ele);
}
- if( HPMHooks.count.HP_mapif_parse_elemental_save_post ) {
- void (*postHookFunc) (int *fd, struct s_elemental *ele);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_elemental_save_post > 0) {
+ void (*postHookFunc) (int fd, const struct s_elemental *ele);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_elemental_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_elemental_save_post[hIndex].func;
- postHookFunc(&fd, ele);
+ postHookFunc(fd, ele);
}
}
return;
@@ -10907,14 +11309,14 @@ void HP_mapif_parse_elemental_save(int fd, struct s_elemental *ele) {
int HP_mapif_guild_created(int fd, int account_id, struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_created_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, struct guild *g);
+ if (HPMHooks.count.HP_mapif_guild_created_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_created_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, g);
+ retVal___ = preHookFunc(&fd, &account_id, &g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10922,11 +11324,11 @@ int HP_mapif_guild_created(int fd, int account_id, struct guild *g) {
{
retVal___ = HPMHooks.source.mapif.guild_created(fd, account_id, g);
}
- if( HPMHooks.count.HP_mapif_guild_created_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_created_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, struct guild *g);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_created_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, g);
+ retVal___ = postHookFunc(retVal___, fd, account_id, g);
}
}
return retVal___;
@@ -10934,14 +11336,14 @@ int HP_mapif_guild_created(int fd, int account_id, struct guild *g) {
int HP_mapif_guild_noinfo(int fd, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_noinfo_pre ) {
+ if (HPMHooks.count.HP_mapif_guild_noinfo_pre > 0) {
int (*preHookFunc) (int *fd, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_noinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_noinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_noinfo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10949,11 +11351,11 @@ int HP_mapif_guild_noinfo(int fd, int guild_id) {
{
retVal___ = HPMHooks.source.mapif.guild_noinfo(fd, guild_id);
}
- if( HPMHooks.count.HP_mapif_guild_noinfo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_noinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_noinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_noinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_noinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id);
+ retVal___ = postHookFunc(retVal___, fd, guild_id);
}
}
return retVal___;
@@ -10961,14 +11363,14 @@ int HP_mapif_guild_noinfo(int fd, int guild_id) {
int HP_mapif_guild_info(int fd, struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_info_pre ) {
- int (*preHookFunc) (int *fd, struct guild *g);
+ if (HPMHooks.count.HP_mapif_guild_info_pre > 0) {
+ int (*preHookFunc) (int *fd, struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_info_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, g);
+ retVal___ = preHookFunc(&fd, &g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10976,11 +11378,11 @@ int HP_mapif_guild_info(int fd, struct guild *g) {
{
retVal___ = HPMHooks.source.mapif.guild_info(fd, g);
}
- if( HPMHooks.count.HP_mapif_guild_info_post ) {
- int (*postHookFunc) (int retVal___, int *fd, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_info_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, struct guild *g);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, g);
+ retVal___ = postHookFunc(retVal___, fd, g);
}
}
return retVal___;
@@ -10988,14 +11390,14 @@ int HP_mapif_guild_info(int fd, struct guild *g) {
int HP_mapif_guild_memberadded(int fd, int guild_id, int account_id, int char_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_memberadded_pre ) {
+ if (HPMHooks.count.HP_mapif_guild_memberadded_pre > 0) {
int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberadded_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberadded_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_memberadded_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11003,11 +11405,11 @@ int HP_mapif_guild_memberadded(int fd, int guild_id, int account_id, int char_id
{
retVal___ = HPMHooks.source.mapif.guild_memberadded(fd, guild_id, account_id, char_id, flag);
}
- if( HPMHooks.count.HP_mapif_guild_memberadded_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *account_id, int *char_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberadded_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_memberadded_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, int char_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberadded_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_memberadded_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &account_id, &char_id, &flag);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, char_id, flag);
}
}
return retVal___;
@@ -11015,14 +11417,14 @@ int HP_mapif_guild_memberadded(int fd, int guild_id, int account_id, int char_id
int HP_mapif_guild_withdraw(int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_withdraw_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag, const char *name, const char *mes);
+ if (HPMHooks.count.HP_mapif_guild_withdraw_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag, const char **name, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_withdraw_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag, name, mes);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag, &name, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11030,11 +11432,11 @@ int HP_mapif_guild_withdraw(int guild_id, int account_id, int char_id, int flag,
{
retVal___ = HPMHooks.source.mapif.guild_withdraw(guild_id, account_id, char_id, flag, name, mes);
}
- if( HPMHooks.count.HP_mapif_guild_withdraw_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *flag, const char *name, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_withdraw_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_withdraw_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &flag, name, mes);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, flag, name, mes);
}
}
return retVal___;
@@ -11042,14 +11444,14 @@ int HP_mapif_guild_withdraw(int guild_id, int account_id, int char_id, int flag,
int HP_mapif_guild_memberinfoshort(struct guild *g, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_memberinfoshort_pre ) {
- int (*preHookFunc) (struct guild *g, int *idx);
+ if (HPMHooks.count.HP_mapif_guild_memberinfoshort_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfoshort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfoshort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_memberinfoshort_pre[hIndex].func;
- retVal___ = preHookFunc(g, &idx);
+ retVal___ = preHookFunc(&g, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11057,11 +11459,11 @@ int HP_mapif_guild_memberinfoshort(struct guild *g, int idx) {
{
retVal___ = HPMHooks.source.mapif.guild_memberinfoshort(g, idx);
}
- if( HPMHooks.count.HP_mapif_guild_memberinfoshort_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfoshort_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_memberinfoshort_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfoshort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_memberinfoshort_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &idx);
+ retVal___ = postHookFunc(retVal___, g, idx);
}
}
return retVal___;
@@ -11069,14 +11471,14 @@ int HP_mapif_guild_memberinfoshort(struct guild *g, int idx) {
int HP_mapif_guild_broken(int guild_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_broken_pre ) {
+ if (HPMHooks.count.HP_mapif_guild_broken_pre > 0) {
int (*preHookFunc) (int *guild_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_broken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_broken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_broken_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11084,26 +11486,26 @@ int HP_mapif_guild_broken(int guild_id, int flag) {
{
retVal___ = HPMHooks.source.mapif.guild_broken(guild_id, flag);
}
- if( HPMHooks.count.HP_mapif_guild_broken_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_broken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_broken_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_broken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_broken_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &flag);
+ retVal___ = postHookFunc(retVal___, guild_id, flag);
}
}
return retVal___;
}
-int HP_mapif_guild_message(int guild_id, int account_id, char *mes, int len, int sfd) {
+int HP_mapif_guild_message(int guild_id, int account_id, const char *mes, int len, int sfd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_message_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, char *mes, int *len, int *sfd);
+ if (HPMHooks.count.HP_mapif_guild_message_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len, int *sfd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_message_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, mes, &len, &sfd);
+ retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len, &sfd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11111,11 +11513,11 @@ int HP_mapif_guild_message(int guild_id, int account_id, char *mes, int len, int
{
retVal___ = HPMHooks.source.mapif.guild_message(guild_id, account_id, mes, len, sfd);
}
- if( HPMHooks.count.HP_mapif_guild_message_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, char *mes, int *len, int *sfd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_message_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len, int sfd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, mes, &len, &sfd);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len, sfd);
}
}
return retVal___;
@@ -11123,14 +11525,14 @@ int HP_mapif_guild_message(int guild_id, int account_id, char *mes, int len, int
int HP_mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_basicinfochanged_pre ) {
- int (*preHookFunc) (int *guild_id, int *type, const void *data, int *len);
+ if (HPMHooks.count.HP_mapif_guild_basicinfochanged_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *type, const void **data, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_basicinfochanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_basicinfochanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_basicinfochanged_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &type, data, &len);
+ retVal___ = preHookFunc(&guild_id, &type, &data, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11138,11 +11540,11 @@ int HP_mapif_guild_basicinfochanged(int guild_id, int type, const void *data, in
{
retVal___ = HPMHooks.source.mapif.guild_basicinfochanged(guild_id, type, data, len);
}
- if( HPMHooks.count.HP_mapif_guild_basicinfochanged_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *type, const void *data, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_basicinfochanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_basicinfochanged_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int type, const void *data, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_basicinfochanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_basicinfochanged_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &type, data, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, type, data, len);
}
}
return retVal___;
@@ -11150,14 +11552,14 @@ int HP_mapif_guild_basicinfochanged(int guild_id, int type, const void *data, in
int HP_mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id, int type, const void *data, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_memberinfochanged_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *type, const void *data, int *len);
+ if (HPMHooks.count.HP_mapif_guild_memberinfochanged_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *type, const void **data, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfochanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfochanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_memberinfochanged_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &type, data, &len);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &type, &data, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11165,11 +11567,11 @@ int HP_mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id,
{
retVal___ = HPMHooks.source.mapif.guild_memberinfochanged(guild_id, account_id, char_id, type, data, len);
}
- if( HPMHooks.count.HP_mapif_guild_memberinfochanged_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *type, const void *data, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfochanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_memberinfochanged_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int type, const void *data, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_memberinfochanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_memberinfochanged_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &type, data, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, type, data, len);
}
}
return retVal___;
@@ -11177,14 +11579,14 @@ int HP_mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id,
int HP_mapif_guild_skillupack(int guild_id, uint16 skill_id, int account_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_skillupack_pre ) {
+ if (HPMHooks.count.HP_mapif_guild_skillupack_pre > 0) {
int (*preHookFunc) (int *guild_id, uint16 *skill_id, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_skillupack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_skillupack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_skillupack_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &skill_id, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11192,11 +11594,11 @@ int HP_mapif_guild_skillupack(int guild_id, uint16 skill_id, int account_id) {
{
retVal___ = HPMHooks.source.mapif.guild_skillupack(guild_id, skill_id, account_id);
}
- if( HPMHooks.count.HP_mapif_guild_skillupack_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, uint16 *skill_id, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_skillupack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_skillupack_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, uint16 skill_id, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_skillupack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_skillupack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &skill_id, &account_id);
+ retVal___ = postHookFunc(retVal___, guild_id, skill_id, account_id);
}
}
return retVal___;
@@ -11204,14 +11606,14 @@ int HP_mapif_guild_skillupack(int guild_id, uint16 skill_id, int account_id) {
int HP_mapif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_alliance_pre ) {
- int (*preHookFunc) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char *name1, const char *name2);
+ if (HPMHooks.count.HP_mapif_guild_alliance_pre > 0) {
+ int (*preHookFunc) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char **name1, const char **name2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_alliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_alliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_alliance_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id1, &guild_id2, &account_id1, &account_id2, &flag, name1, name2);
+ retVal___ = preHookFunc(&guild_id1, &guild_id2, &account_id1, &account_id2, &flag, &name1, &name2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11219,11 +11621,11 @@ int HP_mapif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int a
{
retVal___ = HPMHooks.source.mapif.guild_alliance(guild_id1, guild_id2, account_id1, account_id2, flag, name1, name2);
}
- if( HPMHooks.count.HP_mapif_guild_alliance_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char *name1, const char *name2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_alliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_alliance_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_alliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_alliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id1, &guild_id2, &account_id1, &account_id2, &flag, name1, name2);
+ retVal___ = postHookFunc(retVal___, guild_id1, guild_id2, account_id1, account_id2, flag, name1, name2);
}
}
return retVal___;
@@ -11231,14 +11633,14 @@ int HP_mapif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int a
int HP_mapif_guild_position(struct guild *g, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_position_pre ) {
- int (*preHookFunc) (struct guild *g, int *idx);
+ if (HPMHooks.count.HP_mapif_guild_position_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_position_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_position_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_position_pre[hIndex].func;
- retVal___ = preHookFunc(g, &idx);
+ retVal___ = preHookFunc(&g, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11246,11 +11648,11 @@ int HP_mapif_guild_position(struct guild *g, int idx) {
{
retVal___ = HPMHooks.source.mapif.guild_position(g, idx);
}
- if( HPMHooks.count.HP_mapif_guild_position_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_position_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_position_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_position_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_position_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &idx);
+ retVal___ = postHookFunc(retVal___, g, idx);
}
}
return retVal___;
@@ -11258,14 +11660,14 @@ int HP_mapif_guild_position(struct guild *g, int idx) {
int HP_mapif_guild_notice(struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_notice_pre ) {
- int (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_mapif_guild_notice_pre > 0) {
+ int (*preHookFunc) (struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_notice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_notice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_notice_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11273,9 +11675,9 @@ int HP_mapif_guild_notice(struct guild *g) {
{
retVal___ = HPMHooks.source.mapif.guild_notice(g);
}
- if( HPMHooks.count.HP_mapif_guild_notice_post ) {
+ if (HPMHooks.count.HP_mapif_guild_notice_post > 0) {
int (*postHookFunc) (int retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_notice_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_notice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_notice_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
@@ -11285,14 +11687,14 @@ int HP_mapif_guild_notice(struct guild *g) {
int HP_mapif_guild_emblem(struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_emblem_pre ) {
- int (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_mapif_guild_emblem_pre > 0) {
+ int (*preHookFunc) (struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_emblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_emblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_emblem_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11300,9 +11702,9 @@ int HP_mapif_guild_emblem(struct guild *g) {
{
retVal___ = HPMHooks.source.mapif.guild_emblem(g);
}
- if( HPMHooks.count.HP_mapif_guild_emblem_post ) {
+ if (HPMHooks.count.HP_mapif_guild_emblem_post > 0) {
int (*postHookFunc) (int retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_emblem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_emblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_emblem_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
@@ -11312,14 +11714,14 @@ int HP_mapif_guild_emblem(struct guild *g) {
int HP_mapif_guild_master_changed(struct guild *g, int aid, int cid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_master_changed_pre ) {
- int (*preHookFunc) (struct guild *g, int *aid, int *cid);
+ if (HPMHooks.count.HP_mapif_guild_master_changed_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *aid, int *cid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_master_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_master_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_master_changed_pre[hIndex].func;
- retVal___ = preHookFunc(g, &aid, &cid);
+ retVal___ = preHookFunc(&g, &aid, &cid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11327,26 +11729,26 @@ int HP_mapif_guild_master_changed(struct guild *g, int aid, int cid) {
{
retVal___ = HPMHooks.source.mapif.guild_master_changed(g, aid, cid);
}
- if( HPMHooks.count.HP_mapif_guild_master_changed_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *aid, int *cid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_master_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_master_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int aid, int cid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_master_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_master_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &aid, &cid);
+ retVal___ = postHookFunc(retVal___, g, aid, cid);
}
}
return retVal___;
}
-int HP_mapif_guild_castle_dataload(int fd, int sz, int *castle_ids) {
+int HP_mapif_guild_castle_dataload(int fd, int sz, const int *castle_ids) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_guild_castle_dataload_pre ) {
- int (*preHookFunc) (int *fd, int *sz, int *castle_ids);
+ if (HPMHooks.count.HP_mapif_guild_castle_dataload_pre > 0) {
+ int (*preHookFunc) (int *fd, int *sz, const int **castle_ids);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_castle_dataload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_castle_dataload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_guild_castle_dataload_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &sz, castle_ids);
+ retVal___ = preHookFunc(&fd, &sz, &castle_ids);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11354,26 +11756,26 @@ int HP_mapif_guild_castle_dataload(int fd, int sz, int *castle_ids) {
{
retVal___ = HPMHooks.source.mapif.guild_castle_dataload(fd, sz, castle_ids);
}
- if( HPMHooks.count.HP_mapif_guild_castle_dataload_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *sz, int *castle_ids);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_castle_dataload_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_guild_castle_dataload_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int sz, const int *castle_ids);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_guild_castle_dataload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_guild_castle_dataload_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &sz, castle_ids);
+ retVal___ = postHookFunc(retVal___, fd, sz, castle_ids);
}
}
return retVal___;
}
-int HP_mapif_parse_CreateGuild(int fd, int account_id, char *name, struct guild_member *master) {
+int HP_mapif_parse_CreateGuild(int fd, int account_id, const char *name, const struct guild_member *master) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_CreateGuild_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, char *name, struct guild_member *master);
+ if (HPMHooks.count.HP_mapif_parse_CreateGuild_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, const char **name, const struct guild_member **master);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateGuild_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateGuild_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_CreateGuild_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, name, master);
+ retVal___ = preHookFunc(&fd, &account_id, &name, &master);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11381,11 +11783,11 @@ int HP_mapif_parse_CreateGuild(int fd, int account_id, char *name, struct guild_
{
retVal___ = HPMHooks.source.mapif.parse_CreateGuild(fd, account_id, name, master);
}
- if( HPMHooks.count.HP_mapif_parse_CreateGuild_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, char *name, struct guild_member *master);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateGuild_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_CreateGuild_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, const char *name, const struct guild_member *master);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateGuild_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_CreateGuild_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, name, master);
+ retVal___ = postHookFunc(retVal___, fd, account_id, name, master);
}
}
return retVal___;
@@ -11393,14 +11795,14 @@ int HP_mapif_parse_CreateGuild(int fd, int account_id, char *name, struct guild_
int HP_mapif_parse_GuildInfo(int fd, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildInfo_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildInfo_pre > 0) {
int (*preHookFunc) (int *fd, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildInfo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11408,26 +11810,26 @@ int HP_mapif_parse_GuildInfo(int fd, int guild_id) {
{
retVal___ = HPMHooks.source.mapif.parse_GuildInfo(fd, guild_id);
}
- if( HPMHooks.count.HP_mapif_parse_GuildInfo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildInfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildInfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id);
+ retVal___ = postHookFunc(retVal___, fd, guild_id);
}
}
return retVal___;
}
-int HP_mapif_parse_GuildAddMember(int fd, int guild_id, struct guild_member *m) {
+int HP_mapif_parse_GuildAddMember(int fd, int guild_id, const struct guild_member *m) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildAddMember_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, struct guild_member *m);
+ if (HPMHooks.count.HP_mapif_parse_GuildAddMember_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, const struct guild_member **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAddMember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAddMember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildAddMember_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, m);
+ retVal___ = preHookFunc(&fd, &guild_id, &m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11435,11 +11837,11 @@ int HP_mapif_parse_GuildAddMember(int fd, int guild_id, struct guild_member *m)
{
retVal___ = HPMHooks.source.mapif.parse_GuildAddMember(fd, guild_id, m);
}
- if( HPMHooks.count.HP_mapif_parse_GuildAddMember_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, struct guild_member *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAddMember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildAddMember_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, const struct guild_member *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAddMember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildAddMember_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, m);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, m);
}
}
return retVal___;
@@ -11447,14 +11849,14 @@ int HP_mapif_parse_GuildAddMember(int fd, int guild_id, struct guild_member *m)
int HP_mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char_id, int flag, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildLeave_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *flag, const char *mes);
+ if (HPMHooks.count.HP_mapif_parse_GuildLeave_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *flag, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildLeave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildLeave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildLeave_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &flag, mes);
+ retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &flag, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11462,38 +11864,38 @@ int HP_mapif_parse_GuildLeave(int fd, int guild_id, int account_id, int char_id,
{
retVal___ = HPMHooks.source.mapif.parse_GuildLeave(fd, guild_id, account_id, char_id, flag, mes);
}
- if( HPMHooks.count.HP_mapif_parse_GuildLeave_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *account_id, int *char_id, int *flag, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildLeave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildLeave_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, int char_id, int flag, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildLeave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildLeave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &account_id, &char_id, &flag, mes);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, char_id, flag, mes);
}
}
return retVal___;
}
-int HP_mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int class_) {
+int HP_mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *online, int *lv, int *class_);
+ if (HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildChangeMemberInfoShort_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &online, &lv, &class_);
+ retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &online, &lv, &class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.mapif.parse_GuildChangeMemberInfoShort(fd, guild_id, account_id, char_id, online, lv, class_);
+ retVal___ = HPMHooks.source.mapif.parse_GuildChangeMemberInfoShort(fd, guild_id, account_id, char_id, online, lv, class);
}
- if( HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *account_id, int *char_id, int *online, int *lv, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildChangeMemberInfoShort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildChangeMemberInfoShort_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &account_id, &char_id, &online, &lv, &class_);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, char_id, online, lv, class);
}
}
return retVal___;
@@ -11501,14 +11903,14 @@ int HP_mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_
int HP_mapif_parse_BreakGuild(int fd, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_BreakGuild_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_BreakGuild_pre > 0) {
int (*preHookFunc) (int *fd, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakGuild_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakGuild_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_BreakGuild_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11516,26 +11918,26 @@ int HP_mapif_parse_BreakGuild(int fd, int guild_id) {
{
retVal___ = HPMHooks.source.mapif.parse_BreakGuild(fd, guild_id);
}
- if( HPMHooks.count.HP_mapif_parse_BreakGuild_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakGuild_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_BreakGuild_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakGuild_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_BreakGuild_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id);
+ retVal___ = postHookFunc(retVal___, fd, guild_id);
}
}
return retVal___;
}
-int HP_mapif_parse_GuildMessage(int fd, int guild_id, int account_id, char *mes, int len) {
+int HP_mapif_parse_GuildMessage(int fd, int guild_id, int account_id, const char *mes, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildMessage_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, int *account_id, char *mes, int *len);
+ if (HPMHooks.count.HP_mapif_parse_GuildMessage_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildMessage_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, &account_id, mes, &len);
+ retVal___ = preHookFunc(&fd, &guild_id, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11543,11 +11945,11 @@ int HP_mapif_parse_GuildMessage(int fd, int guild_id, int account_id, char *mes,
{
retVal___ = HPMHooks.source.mapif.parse_GuildMessage(fd, guild_id, account_id, mes, len);
}
- if( HPMHooks.count.HP_mapif_parse_GuildMessage_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *account_id, char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildMessage_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildMessage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &account_id, mes, &len);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, mes, len);
}
}
return retVal___;
@@ -11555,14 +11957,14 @@ int HP_mapif_parse_GuildMessage(int fd, int guild_id, int account_id, char *mes,
int HP_mapif_parse_GuildBasicInfoChange(int fd, int guild_id, int type, const void *data, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, int *type, const void *data, int *len);
+ if (HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, int *type, const void **data, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildBasicInfoChange_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, &type, data, &len);
+ retVal___ = preHookFunc(&fd, &guild_id, &type, &data, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11570,11 +11972,11 @@ int HP_mapif_parse_GuildBasicInfoChange(int fd, int guild_id, int type, const vo
{
retVal___ = HPMHooks.source.mapif.parse_GuildBasicInfoChange(fd, guild_id, type, data, len);
}
- if( HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *type, const void *data, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int type, const void *data, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildBasicInfoChange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildBasicInfoChange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &type, data, &len);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, type, data, len);
}
}
return retVal___;
@@ -11582,14 +11984,14 @@ int HP_mapif_parse_GuildBasicInfoChange(int fd, int guild_id, int type, const vo
int HP_mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *type, const char *data, int *len);
+ if (HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, int *account_id, int *char_id, int *type, const char **data, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildMemberInfoChange_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &type, data, &len);
+ retVal___ = preHookFunc(&fd, &guild_id, &account_id, &char_id, &type, &data, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11597,26 +11999,26 @@ int HP_mapif_parse_GuildMemberInfoChange(int fd, int guild_id, int account_id, i
{
retVal___ = HPMHooks.source.mapif.parse_GuildMemberInfoChange(fd, guild_id, account_id, char_id, type, data, len);
}
- if( HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *account_id, int *char_id, int *type, const char *data, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMemberInfoChange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildMemberInfoChange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &account_id, &char_id, &type, data, &len);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, account_id, char_id, type, data, len);
}
}
return retVal___;
}
-int HP_mapif_parse_GuildPosition(int fd, int guild_id, int idx, struct guild_position *p) {
+int HP_mapif_parse_GuildPosition(int fd, int guild_id, int idx, const struct guild_position *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildPosition_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, int *idx, struct guild_position *p);
+ if (HPMHooks.count.HP_mapif_parse_GuildPosition_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, int *idx, const struct guild_position **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildPosition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildPosition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildPosition_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, &idx, p);
+ retVal___ = preHookFunc(&fd, &guild_id, &idx, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11624,11 +12026,11 @@ int HP_mapif_parse_GuildPosition(int fd, int guild_id, int idx, struct guild_pos
{
retVal___ = HPMHooks.source.mapif.parse_GuildPosition(fd, guild_id, idx, p);
}
- if( HPMHooks.count.HP_mapif_parse_GuildPosition_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, int *idx, struct guild_position *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildPosition_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildPosition_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, int idx, const struct guild_position *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildPosition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildPosition_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &idx, p);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, idx, p);
}
}
return retVal___;
@@ -11636,14 +12038,14 @@ int HP_mapif_parse_GuildPosition(int fd, int guild_id, int idx, struct guild_pos
int HP_mapif_parse_GuildSkillUp(int fd, int guild_id, uint16 skill_id, int account_id, int max) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildSkillUp_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildSkillUp_pre > 0) {
int (*preHookFunc) (int *fd, int *guild_id, uint16 *skill_id, int *account_id, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildSkillUp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildSkillUp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildSkillUp_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &guild_id, &skill_id, &account_id, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11651,11 +12053,11 @@ int HP_mapif_parse_GuildSkillUp(int fd, int guild_id, uint16 skill_id, int accou
{
retVal___ = HPMHooks.source.mapif.parse_GuildSkillUp(fd, guild_id, skill_id, account_id, max);
}
- if( HPMHooks.count.HP_mapif_parse_GuildSkillUp_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, uint16 *skill_id, int *account_id, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildSkillUp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildSkillUp_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, uint16 skill_id, int account_id, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildSkillUp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildSkillUp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, &skill_id, &account_id, &max);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, skill_id, account_id, max);
}
}
return retVal___;
@@ -11663,14 +12065,14 @@ int HP_mapif_parse_GuildSkillUp(int fd, int guild_id, uint16 skill_id, int accou
int HP_mapif_parse_GuildDeleteAlliance(struct guild *g, int guild_id, int account_id1, int account_id2, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_pre ) {
- int (*preHookFunc) (struct guild *g, int *guild_id, int *account_id1, int *account_id2, int *flag);
+ if (HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *guild_id, int *account_id1, int *account_id2, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildDeleteAlliance_pre[hIndex].func;
- retVal___ = preHookFunc(g, &guild_id, &account_id1, &account_id2, &flag);
+ retVal___ = preHookFunc(&g, &guild_id, &account_id1, &account_id2, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11678,11 +12080,11 @@ int HP_mapif_parse_GuildDeleteAlliance(struct guild *g, int guild_id, int accoun
{
retVal___ = HPMHooks.source.mapif.parse_GuildDeleteAlliance(g, guild_id, account_id1, account_id2, flag);
}
- if( HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *guild_id, int *account_id1, int *account_id2, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int guild_id, int account_id1, int account_id2, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildDeleteAlliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildDeleteAlliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &guild_id, &account_id1, &account_id2, &flag);
+ retVal___ = postHookFunc(retVal___, g, guild_id, account_id1, account_id2, flag);
}
}
return retVal___;
@@ -11690,14 +12092,14 @@ int HP_mapif_parse_GuildDeleteAlliance(struct guild *g, int guild_id, int accoun
int HP_mapif_parse_GuildAlliance(int fd, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildAlliance_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildAlliance_pre > 0) {
int (*preHookFunc) (int *fd, int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAlliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAlliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildAlliance_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &guild_id1, &guild_id2, &account_id1, &account_id2, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11705,11 +12107,11 @@ int HP_mapif_parse_GuildAlliance(int fd, int guild_id1, int guild_id2, int accou
{
retVal___ = HPMHooks.source.mapif.parse_GuildAlliance(fd, guild_id1, guild_id2, account_id1, account_id2, flag);
}
- if( HPMHooks.count.HP_mapif_parse_GuildAlliance_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAlliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildAlliance_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildAlliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildAlliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id1, &guild_id2, &account_id1, &account_id2, &flag);
+ retVal___ = postHookFunc(retVal___, fd, guild_id1, guild_id2, account_id1, account_id2, flag);
}
}
return retVal___;
@@ -11717,14 +12119,14 @@ int HP_mapif_parse_GuildAlliance(int fd, int guild_id1, int guild_id2, int accou
int HP_mapif_parse_GuildNotice(int fd, int guild_id, const char *mes1, const char *mes2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildNotice_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, const char *mes1, const char *mes2);
+ if (HPMHooks.count.HP_mapif_parse_GuildNotice_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, const char **mes1, const char **mes2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildNotice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildNotice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildNotice_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, mes1, mes2);
+ retVal___ = preHookFunc(&fd, &guild_id, &mes1, &mes2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11732,11 +12134,11 @@ int HP_mapif_parse_GuildNotice(int fd, int guild_id, const char *mes1, const cha
{
retVal___ = HPMHooks.source.mapif.parse_GuildNotice(fd, guild_id, mes1, mes2);
}
- if( HPMHooks.count.HP_mapif_parse_GuildNotice_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, const char *mes1, const char *mes2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildNotice_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildNotice_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, const char *mes1, const char *mes2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildNotice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildNotice_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, mes1, mes2);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, mes1, mes2);
}
}
return retVal___;
@@ -11744,14 +12146,14 @@ int HP_mapif_parse_GuildNotice(int fd, int guild_id, const char *mes1, const cha
int HP_mapif_parse_GuildEmblem(int fd, int len, int guild_id, int dummy, const char *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildEmblem_pre ) {
- int (*preHookFunc) (int *fd, int *len, int *guild_id, int *dummy, const char *data);
+ if (HPMHooks.count.HP_mapif_parse_GuildEmblem_pre > 0) {
+ int (*preHookFunc) (int *fd, int *len, int *guild_id, int *dummy, const char **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildEmblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildEmblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildEmblem_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &len, &guild_id, &dummy, data);
+ retVal___ = preHookFunc(&fd, &len, &guild_id, &dummy, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11759,26 +12161,26 @@ int HP_mapif_parse_GuildEmblem(int fd, int len, int guild_id, int dummy, const c
{
retVal___ = HPMHooks.source.mapif.parse_GuildEmblem(fd, len, guild_id, dummy, data);
}
- if( HPMHooks.count.HP_mapif_parse_GuildEmblem_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *len, int *guild_id, int *dummy, const char *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildEmblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildEmblem_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int len, int guild_id, int dummy, const char *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildEmblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildEmblem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len, &guild_id, &dummy, data);
+ retVal___ = postHookFunc(retVal___, fd, len, guild_id, dummy, data);
}
}
return retVal___;
}
-int HP_mapif_parse_GuildCastleDataLoad(int fd, int len, int *castle_ids) {
+int HP_mapif_parse_GuildCastleDataLoad(int fd, int len, const int *castle_ids) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_pre ) {
- int (*preHookFunc) (int *fd, int *len, int *castle_ids);
+ if (HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_pre > 0) {
+ int (*preHookFunc) (int *fd, int *len, const int **castle_ids);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildCastleDataLoad_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &len, castle_ids);
+ retVal___ = preHookFunc(&fd, &len, &castle_ids);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11786,11 +12188,11 @@ int HP_mapif_parse_GuildCastleDataLoad(int fd, int len, int *castle_ids) {
{
retVal___ = HPMHooks.source.mapif.parse_GuildCastleDataLoad(fd, len, castle_ids);
}
- if( HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *len, int *castle_ids);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int len, const int *castle_ids);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataLoad_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildCastleDataLoad_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len, castle_ids);
+ retVal___ = postHookFunc(retVal___, fd, len, castle_ids);
}
}
return retVal___;
@@ -11798,14 +12200,14 @@ int HP_mapif_parse_GuildCastleDataLoad(int fd, int len, int *castle_ids) {
int HP_mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_pre > 0) {
int (*preHookFunc) (int *fd, int *castle_id, int *index, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildCastleDataSave_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &castle_id, &index, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11813,11 +12215,11 @@ int HP_mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int val
{
retVal___ = HPMHooks.source.mapif.parse_GuildCastleDataSave(fd, castle_id, index, value);
}
- if( HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *castle_id, int *index, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int castle_id, int index, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildCastleDataSave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildCastleDataSave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &castle_id, &index, &value);
+ retVal___ = postHookFunc(retVal___, fd, castle_id, index, value);
}
}
return retVal___;
@@ -11825,14 +12227,14 @@ int HP_mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int val
int HP_mapif_parse_GuildMasterChange(int fd, int guild_id, const char *name, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_GuildMasterChange_pre ) {
- int (*preHookFunc) (int *fd, int *guild_id, const char *name, int *len);
+ if (HPMHooks.count.HP_mapif_parse_GuildMasterChange_pre > 0) {
+ int (*preHookFunc) (int *fd, int *guild_id, const char **name, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMasterChange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMasterChange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_GuildMasterChange_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &guild_id, name, &len);
+ retVal___ = preHookFunc(&fd, &guild_id, &name, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11840,25 +12242,25 @@ int HP_mapif_parse_GuildMasterChange(int fd, int guild_id, const char *name, int
{
retVal___ = HPMHooks.source.mapif.parse_GuildMasterChange(fd, guild_id, name, len);
}
- if( HPMHooks.count.HP_mapif_parse_GuildMasterChange_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *guild_id, const char *name, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMasterChange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_GuildMasterChange_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int guild_id, const char *name, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_GuildMasterChange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_GuildMasterChange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &guild_id, name, &len);
+ retVal___ = postHookFunc(retVal___, fd, guild_id, name, len);
}
}
return retVal___;
}
-void HP_mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh, unsigned char flag) {
+void HP_mapif_homunculus_created(int fd, int account_id, const struct s_homunculus *sh, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_homunculus_created_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, struct s_homunculus *sh, unsigned char *flag);
+ if (HPMHooks.count.HP_mapif_homunculus_created_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, const struct s_homunculus **sh, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_created_pre[hIndex].func;
- preHookFunc(&fd, &account_id, sh, &flag);
+ preHookFunc(&fd, &account_id, &sh, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11866,25 +12268,25 @@ void HP_mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh
{
HPMHooks.source.mapif.homunculus_created(fd, account_id, sh, flag);
}
- if( HPMHooks.count.HP_mapif_homunculus_created_post ) {
- void (*postHookFunc) (int *fd, int *account_id, struct s_homunculus *sh, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_created_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, const struct s_homunculus *sh, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_created_post[hIndex].func;
- postHookFunc(&fd, &account_id, sh, &flag);
+ postHookFunc(fd, account_id, sh, flag);
}
}
return;
}
void HP_mapif_homunculus_deleted(int fd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_homunculus_deleted_pre ) {
+ if (HPMHooks.count.HP_mapif_homunculus_deleted_pre > 0) {
void (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_deleted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_deleted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_deleted_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11892,25 +12294,25 @@ void HP_mapif_homunculus_deleted(int fd, int flag) {
{
HPMHooks.source.mapif.homunculus_deleted(fd, flag);
}
- if( HPMHooks.count.HP_mapif_homunculus_deleted_post ) {
- void (*postHookFunc) (int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_deleted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_deleted_post > 0) {
+ void (*postHookFunc) (int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_deleted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_deleted_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_mapif_homunculus_loaded(int fd, int account_id, struct s_homunculus *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_homunculus_loaded_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, struct s_homunculus *hd);
+ if (HPMHooks.count.HP_mapif_homunculus_loaded_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, struct s_homunculus **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_loaded_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_loaded_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_loaded_pre[hIndex].func;
- preHookFunc(&fd, &account_id, hd);
+ preHookFunc(&fd, &account_id, &hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11918,25 +12320,25 @@ void HP_mapif_homunculus_loaded(int fd, int account_id, struct s_homunculus *hd)
{
HPMHooks.source.mapif.homunculus_loaded(fd, account_id, hd);
}
- if( HPMHooks.count.HP_mapif_homunculus_loaded_post ) {
- void (*postHookFunc) (int *fd, int *account_id, struct s_homunculus *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_loaded_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_loaded_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, struct s_homunculus *hd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_loaded_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_loaded_post[hIndex].func;
- postHookFunc(&fd, &account_id, hd);
+ postHookFunc(fd, account_id, hd);
}
}
return;
}
void HP_mapif_homunculus_saved(int fd, int account_id, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_homunculus_saved_pre ) {
+ if (HPMHooks.count.HP_mapif_homunculus_saved_pre > 0) {
void (*preHookFunc) (int *fd, int *account_id, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_saved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_saved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_saved_pre[hIndex].func;
preHookFunc(&fd, &account_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11944,25 +12346,25 @@ void HP_mapif_homunculus_saved(int fd, int account_id, bool flag) {
{
HPMHooks.source.mapif.homunculus_saved(fd, account_id, flag);
}
- if( HPMHooks.count.HP_mapif_homunculus_saved_post ) {
- void (*postHookFunc) (int *fd, int *account_id, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_saved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_saved_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_saved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_saved_post[hIndex].func;
- postHookFunc(&fd, &account_id, &flag);
+ postHookFunc(fd, account_id, flag);
}
}
return;
}
-void HP_mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, char *name) {
+void HP_mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned char flag, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_homunculus_renamed_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, int *char_id, unsigned char *flag, char *name);
+ if (HPMHooks.count.HP_mapif_homunculus_renamed_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, int *char_id, unsigned char *flag, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_renamed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_renamed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_renamed_pre[hIndex].func;
- preHookFunc(&fd, &account_id, &char_id, &flag, name);
+ preHookFunc(&fd, &account_id, &char_id, &flag, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11970,26 +12372,53 @@ void HP_mapif_homunculus_renamed(int fd, int account_id, int char_id, unsigned c
{
HPMHooks.source.mapif.homunculus_renamed(fd, account_id, char_id, flag, name);
}
- if( HPMHooks.count.HP_mapif_homunculus_renamed_post ) {
- void (*postHookFunc) (int *fd, int *account_id, int *char_id, unsigned char *flag, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_renamed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_renamed_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, int char_id, unsigned char flag, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_renamed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_renamed_post[hIndex].func;
- postHookFunc(&fd, &account_id, &char_id, &flag, name);
+ postHookFunc(fd, account_id, char_id, flag, name);
}
}
return;
}
-bool HP_mapif_homunculus_save(struct s_homunculus *hd) {
+bool HP_mapif_homunculus_create(struct s_homunculus *hd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mapif_homunculus_create_pre > 0) {
+ bool (*preHookFunc) (struct s_homunculus **hd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_homunculus_create_pre[hIndex].func;
+ retVal___ = preHookFunc(&hd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mapif.homunculus_create(hd);
+ }
+ if (HPMHooks.count.HP_mapif_homunculus_create_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct s_homunculus *hd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_homunculus_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, hd);
+ }
+ }
+ return retVal___;
+}
+bool HP_mapif_homunculus_save(const struct s_homunculus *hd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_homunculus_save_pre ) {
- bool (*preHookFunc) (struct s_homunculus *hd);
+ if (HPMHooks.count.HP_mapif_homunculus_save_pre > 0) {
+ bool (*preHookFunc) (const struct s_homunculus **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_save_pre[hIndex].func;
- retVal___ = preHookFunc(hd);
+ retVal___ = preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11997,9 +12426,9 @@ bool HP_mapif_homunculus_save(struct s_homunculus *hd) {
{
retVal___ = HPMHooks.source.mapif.homunculus_save(hd);
}
- if( HPMHooks.count.HP_mapif_homunculus_save_post ) {
- bool (*postHookFunc) (bool retVal___, struct s_homunculus *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_save_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct s_homunculus *hd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hd);
}
@@ -12009,14 +12438,14 @@ bool HP_mapif_homunculus_save(struct s_homunculus *hd) {
bool HP_mapif_homunculus_load(int homun_id, struct s_homunculus *hd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_homunculus_load_pre ) {
- bool (*preHookFunc) (int *homun_id, struct s_homunculus *hd);
+ if (HPMHooks.count.HP_mapif_homunculus_load_pre > 0) {
+ bool (*preHookFunc) (int *homun_id, struct s_homunculus **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_load_pre[hIndex].func;
- retVal___ = preHookFunc(&homun_id, hd);
+ retVal___ = preHookFunc(&homun_id, &hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12024,11 +12453,11 @@ bool HP_mapif_homunculus_load(int homun_id, struct s_homunculus *hd) {
{
retVal___ = HPMHooks.source.mapif.homunculus_load(homun_id, hd);
}
- if( HPMHooks.count.HP_mapif_homunculus_load_post ) {
- bool (*postHookFunc) (bool retVal___, int *homun_id, struct s_homunculus *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_load_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int homun_id, struct s_homunculus *hd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_load_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &homun_id, hd);
+ retVal___ = postHookFunc(retVal___, homun_id, hd);
}
}
return retVal___;
@@ -12036,14 +12465,14 @@ bool HP_mapif_homunculus_load(int homun_id, struct s_homunculus *hd) {
bool HP_mapif_homunculus_delete(int homun_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_homunculus_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_homunculus_delete_pre > 0) {
bool (*preHookFunc) (int *homun_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_delete_pre[hIndex].func;
retVal___ = preHookFunc(&homun_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12051,26 +12480,26 @@ bool HP_mapif_homunculus_delete(int homun_id) {
{
retVal___ = HPMHooks.source.mapif.homunculus_delete(homun_id);
}
- if( HPMHooks.count.HP_mapif_homunculus_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *homun_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int homun_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &homun_id);
+ retVal___ = postHookFunc(retVal___, homun_id);
}
}
return retVal___;
}
-bool HP_mapif_homunculus_rename(char *name) {
+bool HP_mapif_homunculus_rename(const char *name) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_homunculus_rename_pre ) {
- bool (*preHookFunc) (char *name);
+ if (HPMHooks.count.HP_mapif_homunculus_rename_pre > 0) {
+ bool (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_rename_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_rename_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_homunculus_rename_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12078,25 +12507,25 @@ bool HP_mapif_homunculus_rename(char *name) {
{
retVal___ = HPMHooks.source.mapif.homunculus_rename(name);
}
- if( HPMHooks.count.HP_mapif_homunculus_rename_post ) {
- bool (*postHookFunc) (bool retVal___, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_rename_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_homunculus_rename_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_homunculus_rename_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_homunculus_rename_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
}
return retVal___;
}
-void HP_mapif_parse_homunculus_create(int fd, int len, int account_id, struct s_homunculus *phd) {
+void HP_mapif_parse_homunculus_create(int fd, int len, int account_id, const struct s_homunculus *phd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_homunculus_create_pre ) {
- void (*preHookFunc) (int *fd, int *len, int *account_id, struct s_homunculus *phd);
+ if (HPMHooks.count.HP_mapif_parse_homunculus_create_pre > 0) {
+ void (*preHookFunc) (int *fd, int *len, int *account_id, const struct s_homunculus **phd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_create_pre[hIndex].func;
- preHookFunc(&fd, &len, &account_id, phd);
+ preHookFunc(&fd, &len, &account_id, &phd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12104,25 +12533,25 @@ void HP_mapif_parse_homunculus_create(int fd, int len, int account_id, struct s_
{
HPMHooks.source.mapif.parse_homunculus_create(fd, len, account_id, phd);
}
- if( HPMHooks.count.HP_mapif_parse_homunculus_create_post ) {
- void (*postHookFunc) (int *fd, int *len, int *account_id, struct s_homunculus *phd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_create_post > 0) {
+ void (*postHookFunc) (int fd, int len, int account_id, const struct s_homunculus *phd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_create_post[hIndex].func;
- postHookFunc(&fd, &len, &account_id, phd);
+ postHookFunc(fd, len, account_id, phd);
}
}
return;
}
void HP_mapif_parse_homunculus_delete(int fd, int homun_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_homunculus_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_delete_pre > 0) {
void (*preHookFunc) (int *fd, int *homun_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_delete_pre[hIndex].func;
preHookFunc(&fd, &homun_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12130,25 +12559,25 @@ void HP_mapif_parse_homunculus_delete(int fd, int homun_id) {
{
HPMHooks.source.mapif.parse_homunculus_delete(fd, homun_id);
}
- if( HPMHooks.count.HP_mapif_parse_homunculus_delete_post ) {
- void (*postHookFunc) (int *fd, int *homun_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_delete_post > 0) {
+ void (*postHookFunc) (int fd, int homun_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_delete_post[hIndex].func;
- postHookFunc(&fd, &homun_id);
+ postHookFunc(fd, homun_id);
}
}
return;
}
void HP_mapif_parse_homunculus_load(int fd, int account_id, int homun_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_homunculus_load_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_load_pre > 0) {
void (*preHookFunc) (int *fd, int *account_id, int *homun_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_load_pre[hIndex].func;
preHookFunc(&fd, &account_id, &homun_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12156,25 +12585,25 @@ void HP_mapif_parse_homunculus_load(int fd, int account_id, int homun_id) {
{
HPMHooks.source.mapif.parse_homunculus_load(fd, account_id, homun_id);
}
- if( HPMHooks.count.HP_mapif_parse_homunculus_load_post ) {
- void (*postHookFunc) (int *fd, int *account_id, int *homun_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_load_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, int homun_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_load_post[hIndex].func;
- postHookFunc(&fd, &account_id, &homun_id);
+ postHookFunc(fd, account_id, homun_id);
}
}
return;
}
-void HP_mapif_parse_homunculus_save(int fd, int len, int account_id, struct s_homunculus *phd) {
+void HP_mapif_parse_homunculus_save(int fd, int len, int account_id, const struct s_homunculus *phd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_homunculus_save_pre ) {
- void (*preHookFunc) (int *fd, int *len, int *account_id, struct s_homunculus *phd);
+ if (HPMHooks.count.HP_mapif_parse_homunculus_save_pre > 0) {
+ void (*preHookFunc) (int *fd, int *len, int *account_id, const struct s_homunculus **phd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_save_pre[hIndex].func;
- preHookFunc(&fd, &len, &account_id, phd);
+ preHookFunc(&fd, &len, &account_id, &phd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12182,25 +12611,25 @@ void HP_mapif_parse_homunculus_save(int fd, int len, int account_id, struct s_ho
{
HPMHooks.source.mapif.parse_homunculus_save(fd, len, account_id, phd);
}
- if( HPMHooks.count.HP_mapif_parse_homunculus_save_post ) {
- void (*postHookFunc) (int *fd, int *len, int *account_id, struct s_homunculus *phd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_save_post > 0) {
+ void (*postHookFunc) (int fd, int len, int account_id, const struct s_homunculus *phd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_save_post[hIndex].func;
- postHookFunc(&fd, &len, &account_id, phd);
+ postHookFunc(fd, len, account_id, phd);
}
}
return;
}
-void HP_mapif_parse_homunculus_rename(int fd, int account_id, int char_id, char *name) {
+void HP_mapif_parse_homunculus_rename(int fd, int account_id, int char_id, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_homunculus_rename_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, int *char_id, char *name);
+ if (HPMHooks.count.HP_mapif_parse_homunculus_rename_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, int *char_id, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_rename_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_rename_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_rename_pre[hIndex].func;
- preHookFunc(&fd, &account_id, &char_id, name);
+ preHookFunc(&fd, &account_id, &char_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12208,25 +12637,25 @@ void HP_mapif_parse_homunculus_rename(int fd, int account_id, int char_id, char
{
HPMHooks.source.mapif.parse_homunculus_rename(fd, account_id, char_id, name);
}
- if( HPMHooks.count.HP_mapif_parse_homunculus_rename_post ) {
- void (*postHookFunc) (int *fd, int *account_id, int *char_id, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_rename_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_homunculus_rename_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, int char_id, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_homunculus_rename_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_homunculus_rename_post[hIndex].func;
- postHookFunc(&fd, &account_id, &char_id, name);
+ postHookFunc(fd, account_id, char_id, name);
}
}
return;
}
void HP_mapif_mail_sendinbox(int fd, int char_id, unsigned char flag, struct mail_data *md) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_sendinbox_pre ) {
- void (*preHookFunc) (int *fd, int *char_id, unsigned char *flag, struct mail_data *md);
+ if (HPMHooks.count.HP_mapif_mail_sendinbox_pre > 0) {
+ void (*preHookFunc) (int *fd, int *char_id, unsigned char *flag, struct mail_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendinbox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendinbox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_sendinbox_pre[hIndex].func;
- preHookFunc(&fd, &char_id, &flag, md);
+ preHookFunc(&fd, &char_id, &flag, &md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12234,25 +12663,25 @@ void HP_mapif_mail_sendinbox(int fd, int char_id, unsigned char flag, struct mai
{
HPMHooks.source.mapif.mail_sendinbox(fd, char_id, flag, md);
}
- if( HPMHooks.count.HP_mapif_mail_sendinbox_post ) {
- void (*postHookFunc) (int *fd, int *char_id, unsigned char *flag, struct mail_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendinbox_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mail_sendinbox_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, unsigned char flag, struct mail_data *md);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendinbox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_sendinbox_post[hIndex].func;
- postHookFunc(&fd, &char_id, &flag, md);
+ postHookFunc(fd, char_id, flag, md);
}
}
return;
}
void HP_mapif_parse_mail_requestinbox(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mail_requestinbox_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_requestinbox_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_requestinbox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_requestinbox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mail_requestinbox_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12260,25 +12689,25 @@ void HP_mapif_parse_mail_requestinbox(int fd) {
{
HPMHooks.source.mapif.parse_mail_requestinbox(fd);
}
- if( HPMHooks.count.HP_mapif_parse_mail_requestinbox_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_requestinbox_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_requestinbox_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_requestinbox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mail_requestinbox_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_parse_mail_read(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mail_read_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_read_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mail_read_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12286,25 +12715,25 @@ void HP_mapif_parse_mail_read(int fd) {
{
HPMHooks.source.mapif.parse_mail_read(fd);
}
- if( HPMHooks.count.HP_mapif_parse_mail_read_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_read_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mail_read_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_mail_sendattach(int fd, int char_id, struct mail_message *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_sendattach_pre ) {
- void (*preHookFunc) (int *fd, int *char_id, struct mail_message *msg);
+ if (HPMHooks.count.HP_mapif_mail_sendattach_pre > 0) {
+ void (*preHookFunc) (int *fd, int *char_id, struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendattach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendattach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_sendattach_pre[hIndex].func;
- preHookFunc(&fd, &char_id, msg);
+ preHookFunc(&fd, &char_id, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12312,25 +12741,25 @@ void HP_mapif_mail_sendattach(int fd, int char_id, struct mail_message *msg) {
{
HPMHooks.source.mapif.mail_sendattach(fd, char_id, msg);
}
- if( HPMHooks.count.HP_mapif_mail_sendattach_post ) {
- void (*postHookFunc) (int *fd, int *char_id, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendattach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mail_sendattach_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, struct mail_message *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_sendattach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_sendattach_post[hIndex].func;
- postHookFunc(&fd, &char_id, msg);
+ postHookFunc(fd, char_id, msg);
}
}
return;
}
void HP_mapif_mail_getattach(int fd, int char_id, int mail_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_getattach_pre ) {
+ if (HPMHooks.count.HP_mapif_mail_getattach_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_getattach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_getattach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_getattach_pre[hIndex].func;
preHookFunc(&fd, &char_id, &mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12338,25 +12767,25 @@ void HP_mapif_mail_getattach(int fd, int char_id, int mail_id) {
{
HPMHooks.source.mapif.mail_getattach(fd, char_id, mail_id);
}
- if( HPMHooks.count.HP_mapif_mail_getattach_post ) {
- void (*postHookFunc) (int *fd, int *char_id, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_getattach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mail_getattach_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_getattach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_getattach_post[hIndex].func;
- postHookFunc(&fd, &char_id, &mail_id);
+ postHookFunc(fd, char_id, mail_id);
}
}
return;
}
void HP_mapif_parse_mail_getattach(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mail_getattach_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_getattach_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_getattach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_getattach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mail_getattach_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12364,25 +12793,25 @@ void HP_mapif_parse_mail_getattach(int fd) {
{
HPMHooks.source.mapif.parse_mail_getattach(fd);
}
- if( HPMHooks.count.HP_mapif_parse_mail_getattach_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_getattach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_getattach_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_getattach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mail_getattach_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_mail_delete(int fd, int char_id, int mail_id, bool failed) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_mail_delete_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, int *mail_id, bool *failed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_delete_pre[hIndex].func;
preHookFunc(&fd, &char_id, &mail_id, &failed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12390,25 +12819,25 @@ void HP_mapif_mail_delete(int fd, int char_id, int mail_id, bool failed) {
{
HPMHooks.source.mapif.mail_delete(fd, char_id, mail_id, failed);
}
- if( HPMHooks.count.HP_mapif_mail_delete_post ) {
- void (*postHookFunc) (int *fd, int *char_id, int *mail_id, bool *failed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mail_delete_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, int mail_id, bool failed);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_delete_post[hIndex].func;
- postHookFunc(&fd, &char_id, &mail_id, &failed);
+ postHookFunc(fd, char_id, mail_id, failed);
}
}
return;
}
void HP_mapif_parse_mail_delete(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mail_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_delete_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mail_delete_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12416,25 +12845,25 @@ void HP_mapif_parse_mail_delete(int fd) {
{
HPMHooks.source.mapif.parse_mail_delete(fd);
}
- if( HPMHooks.count.HP_mapif_parse_mail_delete_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_delete_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mail_delete_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_mail_new(struct mail_message *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_new_pre ) {
- void (*preHookFunc) (struct mail_message *msg);
+ if (HPMHooks.count.HP_mapif_mail_new_pre > 0) {
+ void (*preHookFunc) (struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_new_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_new_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_new_pre[hIndex].func;
- preHookFunc(msg);
+ preHookFunc(&msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12442,9 +12871,9 @@ void HP_mapif_mail_new(struct mail_message *msg) {
{
HPMHooks.source.mapif.mail_new(msg);
}
- if( HPMHooks.count.HP_mapif_mail_new_post ) {
+ if (HPMHooks.count.HP_mapif_mail_new_post > 0) {
void (*postHookFunc) (struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_new_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_new_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_new_post[hIndex].func;
postHookFunc(msg);
}
@@ -12453,14 +12882,14 @@ void HP_mapif_mail_new(struct mail_message *msg) {
}
void HP_mapif_mail_return(int fd, int char_id, int mail_id, int new_mail) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_return_pre ) {
+ if (HPMHooks.count.HP_mapif_mail_return_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, int *mail_id, int *new_mail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_return_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_return_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_return_pre[hIndex].func;
preHookFunc(&fd, &char_id, &mail_id, &new_mail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12468,25 +12897,25 @@ void HP_mapif_mail_return(int fd, int char_id, int mail_id, int new_mail) {
{
HPMHooks.source.mapif.mail_return(fd, char_id, mail_id, new_mail);
}
- if( HPMHooks.count.HP_mapif_mail_return_post ) {
- void (*postHookFunc) (int *fd, int *char_id, int *mail_id, int *new_mail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_return_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mail_return_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, int mail_id, int new_mail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_return_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_return_post[hIndex].func;
- postHookFunc(&fd, &char_id, &mail_id, &new_mail);
+ postHookFunc(fd, char_id, mail_id, new_mail);
}
}
return;
}
void HP_mapif_parse_mail_return(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mail_return_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_return_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_return_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_return_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mail_return_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12494,25 +12923,25 @@ void HP_mapif_parse_mail_return(int fd) {
{
HPMHooks.source.mapif.parse_mail_return(fd);
}
- if( HPMHooks.count.HP_mapif_parse_mail_return_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_return_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_return_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_return_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mail_return_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_mail_send(int fd, struct mail_message *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mail_send_pre ) {
- void (*preHookFunc) (int *fd, struct mail_message *msg);
+ if (HPMHooks.count.HP_mapif_mail_send_pre > 0) {
+ void (*preHookFunc) (int *fd, struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mail_send_pre[hIndex].func;
- preHookFunc(&fd, msg);
+ preHookFunc(&fd, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12520,25 +12949,25 @@ void HP_mapif_mail_send(int fd, struct mail_message *msg) {
{
HPMHooks.source.mapif.mail_send(fd, msg);
}
- if( HPMHooks.count.HP_mapif_mail_send_post ) {
- void (*postHookFunc) (int *fd, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mail_send_post > 0) {
+ void (*postHookFunc) (int fd, struct mail_message *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mail_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mail_send_post[hIndex].func;
- postHookFunc(&fd, msg);
+ postHookFunc(fd, msg);
}
}
return;
}
void HP_mapif_parse_mail_send(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mail_send_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_send_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mail_send_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12546,26 +12975,53 @@ void HP_mapif_parse_mail_send(int fd) {
{
HPMHooks.source.mapif.parse_mail_send(fd);
}
- if( HPMHooks.count.HP_mapif_parse_mail_send_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mail_send_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mail_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mail_send_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
-bool HP_mapif_mercenary_save(struct s_mercenary *merc) {
+bool HP_mapif_mercenary_create(struct s_mercenary *merc) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mapif_mercenary_create_pre > 0) {
+ bool (*preHookFunc) (struct s_mercenary **merc);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_mercenary_create_pre[hIndex].func;
+ retVal___ = preHookFunc(&merc);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mapif.mercenary_create(merc);
+ }
+ if (HPMHooks.count.HP_mapif_mercenary_create_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct s_mercenary *merc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_mercenary_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, merc);
+ }
+ }
+ return retVal___;
+}
+bool HP_mapif_mercenary_save(const struct s_mercenary *merc) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_mercenary_save_pre ) {
- bool (*preHookFunc) (struct s_mercenary *merc);
+ if (HPMHooks.count.HP_mapif_mercenary_save_pre > 0) {
+ bool (*preHookFunc) (const struct s_mercenary **merc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mercenary_save_pre[hIndex].func;
- retVal___ = preHookFunc(merc);
+ retVal___ = preHookFunc(&merc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12573,9 +13029,9 @@ bool HP_mapif_mercenary_save(struct s_mercenary *merc) {
{
retVal___ = HPMHooks.source.mapif.mercenary_save(merc);
}
- if( HPMHooks.count.HP_mapif_mercenary_save_post ) {
- bool (*postHookFunc) (bool retVal___, struct s_mercenary *merc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mercenary_save_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct s_mercenary *merc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mercenary_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, merc);
}
@@ -12585,14 +13041,14 @@ bool HP_mapif_mercenary_save(struct s_mercenary *merc) {
bool HP_mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_mercenary_load_pre ) {
- bool (*preHookFunc) (int *merc_id, int *char_id, struct s_mercenary *merc);
+ if (HPMHooks.count.HP_mapif_mercenary_load_pre > 0) {
+ bool (*preHookFunc) (int *merc_id, int *char_id, struct s_mercenary **merc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mercenary_load_pre[hIndex].func;
- retVal___ = preHookFunc(&merc_id, &char_id, merc);
+ retVal___ = preHookFunc(&merc_id, &char_id, &merc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12600,11 +13056,11 @@ bool HP_mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc)
{
retVal___ = HPMHooks.source.mapif.mercenary_load(merc_id, char_id, merc);
}
- if( HPMHooks.count.HP_mapif_mercenary_load_post ) {
- bool (*postHookFunc) (bool retVal___, int *merc_id, int *char_id, struct s_mercenary *merc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mercenary_load_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int merc_id, int char_id, struct s_mercenary *merc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mercenary_load_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &merc_id, &char_id, merc);
+ retVal___ = postHookFunc(retVal___, merc_id, char_id, merc);
}
}
return retVal___;
@@ -12612,14 +13068,14 @@ bool HP_mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc)
bool HP_mapif_mercenary_delete(int merc_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_mercenary_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_mercenary_delete_pre > 0) {
bool (*preHookFunc) (int *merc_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mercenary_delete_pre[hIndex].func;
retVal___ = preHookFunc(&merc_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12627,25 +13083,25 @@ bool HP_mapif_mercenary_delete(int merc_id) {
{
retVal___ = HPMHooks.source.mapif.mercenary_delete(merc_id);
}
- if( HPMHooks.count.HP_mapif_mercenary_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *merc_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mercenary_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int merc_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mercenary_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &merc_id);
+ retVal___ = postHookFunc(retVal___, merc_id);
}
}
return retVal___;
}
void HP_mapif_mercenary_send(int fd, struct s_mercenary *merc, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mercenary_send_pre ) {
- void (*preHookFunc) (int *fd, struct s_mercenary *merc, unsigned char *flag);
+ if (HPMHooks.count.HP_mapif_mercenary_send_pre > 0) {
+ void (*preHookFunc) (int *fd, struct s_mercenary **merc, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mercenary_send_pre[hIndex].func;
- preHookFunc(&fd, merc, &flag);
+ preHookFunc(&fd, &merc, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12653,25 +13109,25 @@ void HP_mapif_mercenary_send(int fd, struct s_mercenary *merc, unsigned char fla
{
HPMHooks.source.mapif.mercenary_send(fd, merc, flag);
}
- if( HPMHooks.count.HP_mapif_mercenary_send_post ) {
- void (*postHookFunc) (int *fd, struct s_mercenary *merc, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mercenary_send_post > 0) {
+ void (*postHookFunc) (int fd, struct s_mercenary *merc, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mercenary_send_post[hIndex].func;
- postHookFunc(&fd, merc, &flag);
+ postHookFunc(fd, merc, flag);
}
}
return;
}
-void HP_mapif_parse_mercenary_create(int fd, struct s_mercenary *merc) {
+void HP_mapif_parse_mercenary_create(int fd, const struct s_mercenary *merc) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mercenary_create_pre ) {
- void (*preHookFunc) (int *fd, struct s_mercenary *merc);
+ if (HPMHooks.count.HP_mapif_parse_mercenary_create_pre > 0) {
+ void (*preHookFunc) (int *fd, const struct s_mercenary **merc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_create_pre[hIndex].func;
- preHookFunc(&fd, merc);
+ preHookFunc(&fd, &merc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12679,25 +13135,25 @@ void HP_mapif_parse_mercenary_create(int fd, struct s_mercenary *merc) {
{
HPMHooks.source.mapif.parse_mercenary_create(fd, merc);
}
- if( HPMHooks.count.HP_mapif_parse_mercenary_create_post ) {
- void (*postHookFunc) (int *fd, struct s_mercenary *merc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mercenary_create_post > 0) {
+ void (*postHookFunc) (int fd, const struct s_mercenary *merc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_create_post[hIndex].func;
- postHookFunc(&fd, merc);
+ postHookFunc(fd, merc);
}
}
return;
}
void HP_mapif_parse_mercenary_load(int fd, int merc_id, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mercenary_load_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mercenary_load_pre > 0) {
void (*preHookFunc) (int *fd, int *merc_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_load_pre[hIndex].func;
preHookFunc(&fd, &merc_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12705,25 +13161,25 @@ void HP_mapif_parse_mercenary_load(int fd, int merc_id, int char_id) {
{
HPMHooks.source.mapif.parse_mercenary_load(fd, merc_id, char_id);
}
- if( HPMHooks.count.HP_mapif_parse_mercenary_load_post ) {
- void (*postHookFunc) (int *fd, int *merc_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mercenary_load_post > 0) {
+ void (*postHookFunc) (int fd, int merc_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_load_post[hIndex].func;
- postHookFunc(&fd, &merc_id, &char_id);
+ postHookFunc(fd, merc_id, char_id);
}
}
return;
}
void HP_mapif_mercenary_deleted(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mercenary_deleted_pre ) {
+ if (HPMHooks.count.HP_mapif_mercenary_deleted_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_deleted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_deleted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mercenary_deleted_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12731,25 +13187,25 @@ void HP_mapif_mercenary_deleted(int fd, unsigned char flag) {
{
HPMHooks.source.mapif.mercenary_deleted(fd, flag);
}
- if( HPMHooks.count.HP_mapif_mercenary_deleted_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_deleted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mercenary_deleted_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_deleted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mercenary_deleted_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_mapif_parse_mercenary_delete(int fd, int merc_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mercenary_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_mercenary_delete_pre > 0) {
void (*preHookFunc) (int *fd, int *merc_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_delete_pre[hIndex].func;
preHookFunc(&fd, &merc_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12757,25 +13213,25 @@ void HP_mapif_parse_mercenary_delete(int fd, int merc_id) {
{
HPMHooks.source.mapif.parse_mercenary_delete(fd, merc_id);
}
- if( HPMHooks.count.HP_mapif_parse_mercenary_delete_post ) {
- void (*postHookFunc) (int *fd, int *merc_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mercenary_delete_post > 0) {
+ void (*postHookFunc) (int fd, int merc_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_delete_post[hIndex].func;
- postHookFunc(&fd, &merc_id);
+ postHookFunc(fd, merc_id);
}
}
return;
}
void HP_mapif_mercenary_saved(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_mercenary_saved_pre ) {
+ if (HPMHooks.count.HP_mapif_mercenary_saved_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_saved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_saved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_mercenary_saved_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12783,25 +13239,25 @@ void HP_mapif_mercenary_saved(int fd, unsigned char flag) {
{
HPMHooks.source.mapif.mercenary_saved(fd, flag);
}
- if( HPMHooks.count.HP_mapif_mercenary_saved_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_saved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_mercenary_saved_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_mercenary_saved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_mercenary_saved_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
-void HP_mapif_parse_mercenary_save(int fd, struct s_mercenary *merc) {
+void HP_mapif_parse_mercenary_save(int fd, const struct s_mercenary *merc) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_mercenary_save_pre ) {
- void (*preHookFunc) (int *fd, struct s_mercenary *merc);
+ if (HPMHooks.count.HP_mapif_parse_mercenary_save_pre > 0) {
+ void (*preHookFunc) (int *fd, const struct s_mercenary **merc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_save_pre[hIndex].func;
- preHookFunc(&fd, merc);
+ preHookFunc(&fd, &merc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12809,11 +13265,11 @@ void HP_mapif_parse_mercenary_save(int fd, struct s_mercenary *merc) {
{
HPMHooks.source.mapif.parse_mercenary_save(fd, merc);
}
- if( HPMHooks.count.HP_mapif_parse_mercenary_save_post ) {
- void (*postHookFunc) (int *fd, struct s_mercenary *merc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_mercenary_save_post > 0) {
+ void (*postHookFunc) (int fd, const struct s_mercenary *merc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_mercenary_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_mercenary_save_post[hIndex].func;
- postHookFunc(&fd, merc);
+ postHookFunc(fd, merc);
}
}
return;
@@ -12821,14 +13277,14 @@ void HP_mapif_parse_mercenary_save(int fd, struct s_mercenary *merc) {
int HP_mapif_party_created(int fd, int account_id, int char_id, struct party *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_created_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, int *char_id, struct party *p);
+ if (HPMHooks.count.HP_mapif_party_created_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, int *char_id, struct party **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_created_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, &char_id, p);
+ retVal___ = preHookFunc(&fd, &account_id, &char_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12836,25 +13292,25 @@ int HP_mapif_party_created(int fd, int account_id, int char_id, struct party *p)
{
retVal___ = HPMHooks.source.mapif.party_created(fd, account_id, char_id, p);
}
- if( HPMHooks.count.HP_mapif_party_created_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *char_id, struct party *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_created_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int char_id, struct party *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_created_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &char_id, p);
+ retVal___ = postHookFunc(retVal___, fd, account_id, char_id, p);
}
}
return retVal___;
}
void HP_mapif_party_noinfo(int fd, int party_id, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_party_noinfo_pre ) {
+ if (HPMHooks.count.HP_mapif_party_noinfo_pre > 0) {
void (*preHookFunc) (int *fd, int *party_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_noinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_noinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_noinfo_pre[hIndex].func;
preHookFunc(&fd, &party_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12862,25 +13318,25 @@ void HP_mapif_party_noinfo(int fd, int party_id, int char_id) {
{
HPMHooks.source.mapif.party_noinfo(fd, party_id, char_id);
}
- if( HPMHooks.count.HP_mapif_party_noinfo_post ) {
- void (*postHookFunc) (int *fd, int *party_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_noinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_noinfo_post > 0) {
+ void (*postHookFunc) (int fd, int party_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_noinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_noinfo_post[hIndex].func;
- postHookFunc(&fd, &party_id, &char_id);
+ postHookFunc(fd, party_id, char_id);
}
}
return;
}
void HP_mapif_party_info(int fd, struct party *p, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_party_info_pre ) {
- void (*preHookFunc) (int *fd, struct party *p, int *char_id);
+ if (HPMHooks.count.HP_mapif_party_info_pre > 0) {
+ void (*preHookFunc) (int *fd, struct party **p, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_info_pre[hIndex].func;
- preHookFunc(&fd, p, &char_id);
+ preHookFunc(&fd, &p, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12888,11 +13344,11 @@ void HP_mapif_party_info(int fd, struct party *p, int char_id) {
{
HPMHooks.source.mapif.party_info(fd, p, char_id);
}
- if( HPMHooks.count.HP_mapif_party_info_post ) {
- void (*postHookFunc) (int *fd, struct party *p, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_info_post > 0) {
+ void (*postHookFunc) (int fd, struct party *p, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_info_post[hIndex].func;
- postHookFunc(&fd, p, &char_id);
+ postHookFunc(fd, p, char_id);
}
}
return;
@@ -12900,14 +13356,14 @@ void HP_mapif_party_info(int fd, struct party *p, int char_id) {
int HP_mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_memberadded_pre ) {
+ if (HPMHooks.count.HP_mapif_party_memberadded_pre > 0) {
int (*preHookFunc) (int *fd, int *party_id, int *account_id, int *char_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_memberadded_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_memberadded_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_memberadded_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &party_id, &account_id, &char_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12915,11 +13371,11 @@ int HP_mapif_party_memberadded(int fd, int party_id, int account_id, int char_id
{
retVal___ = HPMHooks.source.mapif.party_memberadded(fd, party_id, account_id, char_id, flag);
}
- if( HPMHooks.count.HP_mapif_party_memberadded_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, int *account_id, int *char_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_memberadded_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_memberadded_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, int char_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_memberadded_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_memberadded_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, &account_id, &char_id, &flag);
+ retVal___ = postHookFunc(retVal___, fd, party_id, account_id, char_id, flag);
}
}
return retVal___;
@@ -12927,14 +13383,14 @@ int HP_mapif_party_memberadded(int fd, int party_id, int account_id, int char_id
int HP_mapif_party_optionchanged(int fd, struct party *p, int account_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_optionchanged_pre ) {
- int (*preHookFunc) (int *fd, struct party *p, int *account_id, int *flag);
+ if (HPMHooks.count.HP_mapif_party_optionchanged_pre > 0) {
+ int (*preHookFunc) (int *fd, struct party **p, int *account_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_optionchanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_optionchanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_optionchanged_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, p, &account_id, &flag);
+ retVal___ = preHookFunc(&fd, &p, &account_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12942,11 +13398,11 @@ int HP_mapif_party_optionchanged(int fd, struct party *p, int account_id, int fl
{
retVal___ = HPMHooks.source.mapif.party_optionchanged(fd, p, account_id, flag);
}
- if( HPMHooks.count.HP_mapif_party_optionchanged_post ) {
- int (*postHookFunc) (int retVal___, int *fd, struct party *p, int *account_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_optionchanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_optionchanged_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, struct party *p, int account_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_optionchanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_optionchanged_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, p, &account_id, &flag);
+ retVal___ = postHookFunc(retVal___, fd, p, account_id, flag);
}
}
return retVal___;
@@ -12954,14 +13410,14 @@ int HP_mapif_party_optionchanged(int fd, struct party *p, int account_id, int fl
int HP_mapif_party_withdraw(int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_withdraw_pre ) {
+ if (HPMHooks.count.HP_mapif_party_withdraw_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_withdraw_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12969,11 +13425,11 @@ int HP_mapif_party_withdraw(int party_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.mapif.party_withdraw(party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_mapif_party_withdraw_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_withdraw_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_withdraw_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id);
}
}
return retVal___;
@@ -12981,14 +13437,14 @@ int HP_mapif_party_withdraw(int party_id, int account_id, int char_id) {
int HP_mapif_party_membermoved(struct party *p, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_membermoved_pre ) {
- int (*preHookFunc) (struct party *p, int *idx);
+ if (HPMHooks.count.HP_mapif_party_membermoved_pre > 0) {
+ int (*preHookFunc) (struct party **p, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_membermoved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_membermoved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_membermoved_pre[hIndex].func;
- retVal___ = preHookFunc(p, &idx);
+ retVal___ = preHookFunc(&p, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -12996,11 +13452,11 @@ int HP_mapif_party_membermoved(struct party *p, int idx) {
{
retVal___ = HPMHooks.source.mapif.party_membermoved(p, idx);
}
- if( HPMHooks.count.HP_mapif_party_membermoved_post ) {
- int (*postHookFunc) (int retVal___, struct party *p, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_membermoved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_membermoved_post > 0) {
+ int (*postHookFunc) (int retVal___, struct party *p, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_membermoved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_membermoved_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &idx);
+ retVal___ = postHookFunc(retVal___, p, idx);
}
}
return retVal___;
@@ -13008,14 +13464,14 @@ int HP_mapif_party_membermoved(struct party *p, int idx) {
int HP_mapif_party_broken(int party_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_broken_pre ) {
+ if (HPMHooks.count.HP_mapif_party_broken_pre > 0) {
int (*preHookFunc) (int *party_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_broken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_broken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_broken_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13023,26 +13479,26 @@ int HP_mapif_party_broken(int party_id, int flag) {
{
retVal___ = HPMHooks.source.mapif.party_broken(party_id, flag);
}
- if( HPMHooks.count.HP_mapif_party_broken_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_broken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_broken_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_broken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_broken_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &flag);
+ retVal___ = postHookFunc(retVal___, party_id, flag);
}
}
return retVal___;
}
-int HP_mapif_party_message(int party_id, int account_id, char *mes, int len, int sfd) {
+int HP_mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_party_message_pre ) {
- int (*preHookFunc) (int *party_id, int *account_id, char *mes, int *len, int *sfd);
+ if (HPMHooks.count.HP_mapif_party_message_pre > 0) {
+ int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len, int *sfd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_party_message_pre[hIndex].func;
- retVal___ = preHookFunc(&party_id, &account_id, mes, &len, &sfd);
+ retVal___ = preHookFunc(&party_id, &account_id, &mes, &len, &sfd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13050,26 +13506,26 @@ int HP_mapif_party_message(int party_id, int account_id, char *mes, int len, int
{
retVal___ = HPMHooks.source.mapif.party_message(party_id, account_id, mes, len, sfd);
}
- if( HPMHooks.count.HP_mapif_party_message_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, char *mes, int *len, int *sfd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_party_message_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len, int sfd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_party_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_party_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, mes, &len, &sfd);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len, sfd);
}
}
return retVal___;
}
-int HP_mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct party_member *leader) {
+int HP_mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_CreateParty_pre ) {
- int (*preHookFunc) (int *fd, char *name, int *item, int *item2, struct party_member *leader);
+ if (HPMHooks.count.HP_mapif_parse_CreateParty_pre > 0) {
+ int (*preHookFunc) (int *fd, const char **name, int *item, int *item2, const struct party_member **leader);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateParty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateParty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_CreateParty_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, name, &item, &item2, leader);
+ retVal___ = preHookFunc(&fd, &name, &item, &item2, &leader);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13077,25 +13533,25 @@ int HP_mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct p
{
retVal___ = HPMHooks.source.mapif.parse_CreateParty(fd, name, item, item2, leader);
}
- if( HPMHooks.count.HP_mapif_parse_CreateParty_post ) {
- int (*postHookFunc) (int retVal___, int *fd, char *name, int *item, int *item2, struct party_member *leader);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateParty_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_CreateParty_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, const char *name, int item, int item2, const struct party_member *leader);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreateParty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_CreateParty_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, name, &item, &item2, leader);
+ retVal___ = postHookFunc(retVal___, fd, name, item, item2, leader);
}
}
return retVal___;
}
void HP_mapif_parse_PartyInfo(int fd, int party_id, int char_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyInfo_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyInfo_pre > 0) {
void (*preHookFunc) (int *fd, int *party_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyInfo_pre[hIndex].func;
preHookFunc(&fd, &party_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13103,26 +13559,26 @@ void HP_mapif_parse_PartyInfo(int fd, int party_id, int char_id) {
{
HPMHooks.source.mapif.parse_PartyInfo(fd, party_id, char_id);
}
- if( HPMHooks.count.HP_mapif_parse_PartyInfo_post ) {
- void (*postHookFunc) (int *fd, int *party_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyInfo_post > 0) {
+ void (*postHookFunc) (int fd, int party_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyInfo_post[hIndex].func;
- postHookFunc(&fd, &party_id, &char_id);
+ postHookFunc(fd, party_id, char_id);
}
}
return;
}
-int HP_mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member) {
+int HP_mapif_parse_PartyAddMember(int fd, int party_id, const struct party_member *member) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyAddMember_pre ) {
- int (*preHookFunc) (int *fd, int *party_id, struct party_member *member);
+ if (HPMHooks.count.HP_mapif_parse_PartyAddMember_pre > 0) {
+ int (*preHookFunc) (int *fd, int *party_id, const struct party_member **member);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyAddMember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyAddMember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyAddMember_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &party_id, member);
+ retVal___ = preHookFunc(&fd, &party_id, &member);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13130,11 +13586,11 @@ int HP_mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *mem
{
retVal___ = HPMHooks.source.mapif.parse_PartyAddMember(fd, party_id, member);
}
- if( HPMHooks.count.HP_mapif_parse_PartyAddMember_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, struct party_member *member);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyAddMember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyAddMember_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, const struct party_member *member);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyAddMember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyAddMember_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, member);
+ retVal___ = postHookFunc(retVal___, fd, party_id, member);
}
}
return retVal___;
@@ -13142,14 +13598,14 @@ int HP_mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *mem
int HP_mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, int exp, int item) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyChangeOption_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyChangeOption_pre > 0) {
int (*preHookFunc) (int *fd, int *party_id, int *account_id, int *exp, int *item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeOption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeOption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyChangeOption_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &party_id, &account_id, &exp, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13157,11 +13613,11 @@ int HP_mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, int e
{
retVal___ = HPMHooks.source.mapif.parse_PartyChangeOption(fd, party_id, account_id, exp, item);
}
- if( HPMHooks.count.HP_mapif_parse_PartyChangeOption_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, int *account_id, int *exp, int *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeOption_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyChangeOption_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, int exp, int item);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeOption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyChangeOption_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, &account_id, &exp, &item);
+ retVal___ = postHookFunc(retVal___, fd, party_id, account_id, exp, item);
}
}
return retVal___;
@@ -13169,14 +13625,14 @@ int HP_mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, int e
int HP_mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyLeave_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyLeave_pre > 0) {
int (*preHookFunc) (int *fd, int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyLeave_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13184,11 +13640,11 @@ int HP_mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
{
retVal___ = HPMHooks.source.mapif.parse_PartyLeave(fd, party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_mapif_parse_PartyLeave_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyLeave_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyLeave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, fd, party_id, account_id, char_id);
}
}
return retVal___;
@@ -13196,14 +13652,14 @@ int HP_mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id)
int HP_mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyChangeMap_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyChangeMap_pre > 0) {
int (*preHookFunc) (int *fd, int *party_id, int *account_id, int *char_id, unsigned short *map, int *online, unsigned int *lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeMap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeMap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyChangeMap_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &party_id, &account_id, &char_id, &map, &online, &lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13211,11 +13667,11 @@ int HP_mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char
{
retVal___ = HPMHooks.source.mapif.parse_PartyChangeMap(fd, party_id, account_id, char_id, map, online, lv);
}
- if( HPMHooks.count.HP_mapif_parse_PartyChangeMap_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, int *account_id, int *char_id, unsigned short *map, int *online, unsigned int *lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeMap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyChangeMap_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyChangeMap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyChangeMap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, &account_id, &char_id, &map, &online, &lv);
+ retVal___ = postHookFunc(retVal___, fd, party_id, account_id, char_id, map, online, lv);
}
}
return retVal___;
@@ -13223,14 +13679,14 @@ int HP_mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char
int HP_mapif_parse_BreakParty(int fd, int party_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_BreakParty_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_BreakParty_pre > 0) {
int (*preHookFunc) (int *fd, int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakParty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakParty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_BreakParty_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13238,26 +13694,26 @@ int HP_mapif_parse_BreakParty(int fd, int party_id) {
{
retVal___ = HPMHooks.source.mapif.parse_BreakParty(fd, party_id);
}
- if( HPMHooks.count.HP_mapif_parse_BreakParty_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakParty_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_BreakParty_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_BreakParty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_BreakParty_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id);
+ retVal___ = postHookFunc(retVal___, fd, party_id);
}
}
return retVal___;
}
-int HP_mapif_parse_PartyMessage(int fd, int party_id, int account_id, char *mes, int len) {
+int HP_mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyMessage_pre ) {
- int (*preHookFunc) (int *fd, int *party_id, int *account_id, char *mes, int *len);
+ if (HPMHooks.count.HP_mapif_parse_PartyMessage_pre > 0) {
+ int (*preHookFunc) (int *fd, int *party_id, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyMessage_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &party_id, &account_id, mes, &len);
+ retVal___ = preHookFunc(&fd, &party_id, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13265,11 +13721,11 @@ int HP_mapif_parse_PartyMessage(int fd, int party_id, int account_id, char *mes,
{
retVal___ = HPMHooks.source.mapif.parse_PartyMessage(fd, party_id, account_id, mes, len);
}
- if( HPMHooks.count.HP_mapif_parse_PartyMessage_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, int *account_id, char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyMessage_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyMessage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, &account_id, mes, &len);
+ retVal___ = postHookFunc(retVal___, fd, party_id, account_id, mes, len);
}
}
return retVal___;
@@ -13277,14 +13733,14 @@ int HP_mapif_parse_PartyMessage(int fd, int party_id, int account_id, char *mes,
int HP_mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_PartyLeaderChange_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyLeaderChange_pre > 0) {
int (*preHookFunc) (int *fd, int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeaderChange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeaderChange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_PartyLeaderChange_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13292,11 +13748,11 @@ int HP_mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int c
{
retVal___ = HPMHooks.source.mapif.parse_PartyLeaderChange(fd, party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_mapif_parse_PartyLeaderChange_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeaderChange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_PartyLeaderChange_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_PartyLeaderChange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_PartyLeaderChange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, fd, party_id, account_id, char_id);
}
}
return retVal___;
@@ -13304,14 +13760,14 @@ int HP_mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int c
int HP_mapif_pet_created(int fd, int account_id, struct s_pet *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_pet_created_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, struct s_pet *p);
+ if (HPMHooks.count.HP_mapif_pet_created_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, struct s_pet **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_pet_created_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, p);
+ retVal___ = preHookFunc(&fd, &account_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13319,11 +13775,11 @@ int HP_mapif_pet_created(int fd, int account_id, struct s_pet *p) {
{
retVal___ = HPMHooks.source.mapif.pet_created(fd, account_id, p);
}
- if( HPMHooks.count.HP_mapif_pet_created_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, struct s_pet *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_pet_created_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, struct s_pet *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_pet_created_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, p);
+ retVal___ = postHookFunc(retVal___, fd, account_id, p);
}
}
return retVal___;
@@ -13331,14 +13787,14 @@ int HP_mapif_pet_created(int fd, int account_id, struct s_pet *p) {
int HP_mapif_pet_info(int fd, int account_id, struct s_pet *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_pet_info_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, struct s_pet *p);
+ if (HPMHooks.count.HP_mapif_pet_info_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, struct s_pet **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_pet_info_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, p);
+ retVal___ = preHookFunc(&fd, &account_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13346,11 +13802,11 @@ int HP_mapif_pet_info(int fd, int account_id, struct s_pet *p) {
{
retVal___ = HPMHooks.source.mapif.pet_info(fd, account_id, p);
}
- if( HPMHooks.count.HP_mapif_pet_info_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, struct s_pet *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_pet_info_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, struct s_pet *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_pet_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, p);
+ retVal___ = postHookFunc(retVal___, fd, account_id, p);
}
}
return retVal___;
@@ -13358,14 +13814,14 @@ int HP_mapif_pet_info(int fd, int account_id, struct s_pet *p) {
int HP_mapif_pet_noinfo(int fd, int account_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_pet_noinfo_pre ) {
+ if (HPMHooks.count.HP_mapif_pet_noinfo_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_noinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_noinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_pet_noinfo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13373,11 +13829,11 @@ int HP_mapif_pet_noinfo(int fd, int account_id) {
{
retVal___ = HPMHooks.source.mapif.pet_noinfo(fd, account_id);
}
- if( HPMHooks.count.HP_mapif_pet_noinfo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_noinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_pet_noinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pet_noinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_pet_noinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id);
+ retVal___ = postHookFunc(retVal___, fd, account_id);
}
}
return retVal___;
@@ -13385,14 +13841,14 @@ int HP_mapif_pet_noinfo(int fd, int account_id) {
int HP_mapif_save_pet_ack(int fd, int account_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_save_pet_ack_pre ) {
+ if (HPMHooks.count.HP_mapif_save_pet_ack_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_save_pet_ack_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13400,11 +13856,11 @@ int HP_mapif_save_pet_ack(int fd, int account_id, int flag) {
{
retVal___ = HPMHooks.source.mapif.save_pet_ack(fd, account_id, flag);
}
- if( HPMHooks.count.HP_mapif_save_pet_ack_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_save_pet_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_save_pet_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &flag);
+ retVal___ = postHookFunc(retVal___, fd, account_id, flag);
}
}
return retVal___;
@@ -13412,14 +13868,14 @@ int HP_mapif_save_pet_ack(int fd, int account_id, int flag) {
int HP_mapif_delete_pet_ack(int fd, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_delete_pet_ack_pre ) {
+ if (HPMHooks.count.HP_mapif_delete_pet_ack_pre > 0) {
int (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_delete_pet_ack_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13427,26 +13883,26 @@ int HP_mapif_delete_pet_ack(int fd, int flag) {
{
retVal___ = HPMHooks.source.mapif.delete_pet_ack(fd, flag);
}
- if( HPMHooks.count.HP_mapif_delete_pet_ack_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_delete_pet_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_delete_pet_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &flag);
+ retVal___ = postHookFunc(retVal___, fd, flag);
}
}
return retVal___;
}
-int HP_mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name) {
+int HP_mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_create_pet_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, int *char_id, short *pet_class, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char *pet_name);
+ if (HPMHooks.count.HP_mapif_create_pet_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, int *char_id, short *pet_class, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, const char **pet_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_create_pet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_create_pet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_create_pet_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, &char_id, &pet_class, &pet_lv, &pet_egg_id, &pet_equip, &intimate, &hungry, &rename_flag, &incubate, pet_name);
+ retVal___ = preHookFunc(&fd, &account_id, &char_id, &pet_class, &pet_lv, &pet_egg_id, &pet_equip, &intimate, &hungry, &rename_flag, &incubate, &pet_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13454,11 +13910,11 @@ int HP_mapif_create_pet(int fd, int account_id, int char_id, short pet_class, sh
{
retVal___ = HPMHooks.source.mapif.create_pet(fd, account_id, char_id, pet_class, pet_lv, pet_egg_id, pet_equip, intimate, hungry, rename_flag, incubate, pet_name);
}
- if( HPMHooks.count.HP_mapif_create_pet_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *char_id, short *pet_class, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char *pet_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_create_pet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_create_pet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int char_id, short pet_class, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, const char *pet_name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_create_pet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_create_pet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &char_id, &pet_class, &pet_lv, &pet_egg_id, &pet_equip, &intimate, &hungry, &rename_flag, &incubate, pet_name);
+ retVal___ = postHookFunc(retVal___, fd, account_id, char_id, pet_class, pet_lv, pet_egg_id, pet_equip, intimate, hungry, rename_flag, incubate, pet_name);
}
}
return retVal___;
@@ -13466,14 +13922,14 @@ int HP_mapif_create_pet(int fd, int account_id, int char_id, short pet_class, sh
int HP_mapif_load_pet(int fd, int account_id, int char_id, int pet_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_load_pet_pre ) {
+ if (HPMHooks.count.HP_mapif_load_pet_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id, int *char_id, int *pet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_pet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_pet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_load_pet_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id, &char_id, &pet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13481,26 +13937,26 @@ int HP_mapif_load_pet(int fd, int account_id, int char_id, int pet_id) {
{
retVal___ = HPMHooks.source.mapif.load_pet(fd, account_id, char_id, pet_id);
}
- if( HPMHooks.count.HP_mapif_load_pet_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *char_id, int *pet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_pet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_load_pet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int char_id, int pet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_pet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_load_pet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &char_id, &pet_id);
+ retVal___ = postHookFunc(retVal___, fd, account_id, char_id, pet_id);
}
}
return retVal___;
}
-int HP_mapif_save_pet(int fd, int account_id, struct s_pet *data) {
+int HP_mapif_save_pet(int fd, int account_id, const struct s_pet *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_save_pet_pre ) {
- int (*preHookFunc) (int *fd, int *account_id, struct s_pet *data);
+ if (HPMHooks.count.HP_mapif_save_pet_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id, const struct s_pet **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_save_pet_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, &account_id, data);
+ retVal___ = preHookFunc(&fd, &account_id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13508,11 +13964,11 @@ int HP_mapif_save_pet(int fd, int account_id, struct s_pet *data) {
{
retVal___ = HPMHooks.source.mapif.save_pet(fd, account_id, data);
}
- if( HPMHooks.count.HP_mapif_save_pet_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, struct s_pet *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_save_pet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, const struct s_pet *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_pet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_save_pet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, data);
+ retVal___ = postHookFunc(retVal___, fd, account_id, data);
}
}
return retVal___;
@@ -13520,14 +13976,14 @@ int HP_mapif_save_pet(int fd, int account_id, struct s_pet *data) {
int HP_mapif_delete_pet(int fd, int pet_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_delete_pet_pre ) {
+ if (HPMHooks.count.HP_mapif_delete_pet_pre > 0) {
int (*preHookFunc) (int *fd, int *pet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_delete_pet_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &pet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13535,11 +13991,11 @@ int HP_mapif_delete_pet(int fd, int pet_id) {
{
retVal___ = HPMHooks.source.mapif.delete_pet(fd, pet_id);
}
- if( HPMHooks.count.HP_mapif_delete_pet_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *pet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_delete_pet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int pet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_delete_pet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_delete_pet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &pet_id);
+ retVal___ = postHookFunc(retVal___, fd, pet_id);
}
}
return retVal___;
@@ -13547,14 +14003,14 @@ int HP_mapif_delete_pet(int fd, int pet_id) {
int HP_mapif_parse_CreatePet(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_CreatePet_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_CreatePet_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreatePet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreatePet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_CreatePet_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13562,11 +14018,11 @@ int HP_mapif_parse_CreatePet(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_CreatePet(fd);
}
- if( HPMHooks.count.HP_mapif_parse_CreatePet_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreatePet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_CreatePet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_CreatePet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_CreatePet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -13574,14 +14030,14 @@ int HP_mapif_parse_CreatePet(int fd) {
int HP_mapif_parse_LoadPet(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_LoadPet_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_LoadPet_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadPet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadPet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_LoadPet_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13589,11 +14045,11 @@ int HP_mapif_parse_LoadPet(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_LoadPet(fd);
}
- if( HPMHooks.count.HP_mapif_parse_LoadPet_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadPet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_LoadPet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadPet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_LoadPet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -13601,14 +14057,14 @@ int HP_mapif_parse_LoadPet(int fd) {
int HP_mapif_parse_SavePet(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_SavePet_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_SavePet_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SavePet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SavePet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_SavePet_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13616,11 +14072,11 @@ int HP_mapif_parse_SavePet(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_SavePet(fd);
}
- if( HPMHooks.count.HP_mapif_parse_SavePet_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SavePet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_SavePet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SavePet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_SavePet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -13628,14 +14084,14 @@ int HP_mapif_parse_SavePet(int fd) {
int HP_mapif_parse_DeletePet(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_DeletePet_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_DeletePet_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_DeletePet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_DeletePet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_DeletePet_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13643,11 +14099,11 @@ int HP_mapif_parse_DeletePet(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_DeletePet(fd);
}
- if( HPMHooks.count.HP_mapif_parse_DeletePet_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_DeletePet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_DeletePet_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_DeletePet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_DeletePet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -13655,14 +14111,14 @@ int HP_mapif_parse_DeletePet(int fd) {
struct quest* HP_mapif_quests_fromsql(int char_id, int *count) {
int hIndex = 0;
struct quest* retVal___ = NULL;
- if( HPMHooks.count.HP_mapif_quests_fromsql_pre ) {
- struct quest* (*preHookFunc) (int *char_id, int *count);
+ if (HPMHooks.count.HP_mapif_quests_fromsql_pre > 0) {
+ struct quest* (*preHookFunc) (int *char_id, int **count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quests_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quests_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_quests_fromsql_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, count);
+ retVal___ = preHookFunc(&char_id, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13670,11 +14126,11 @@ struct quest* HP_mapif_quests_fromsql(int char_id, int *count) {
{
retVal___ = HPMHooks.source.mapif.quests_fromsql(char_id, count);
}
- if( HPMHooks.count.HP_mapif_quests_fromsql_post ) {
- struct quest* (*postHookFunc) (struct quest* retVal___, int *char_id, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quests_fromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_quests_fromsql_post > 0) {
+ struct quest* (*postHookFunc) (struct quest* retVal___, int char_id, int *count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quests_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_quests_fromsql_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, count);
+ retVal___ = postHookFunc(retVal___, char_id, count);
}
}
return retVal___;
@@ -13682,14 +14138,14 @@ struct quest* HP_mapif_quests_fromsql(int char_id, int *count) {
bool HP_mapif_quest_delete(int char_id, int quest_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_quest_delete_pre ) {
+ if (HPMHooks.count.HP_mapif_quest_delete_pre > 0) {
bool (*preHookFunc) (int *char_id, int *quest_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_quest_delete_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &quest_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13697,11 +14153,11 @@ bool HP_mapif_quest_delete(int char_id, int quest_id) {
{
retVal___ = HPMHooks.source.mapif.quest_delete(char_id, quest_id);
}
- if( HPMHooks.count.HP_mapif_quest_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, int *quest_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_quest_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, int quest_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_quest_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &quest_id);
+ retVal___ = postHookFunc(retVal___, char_id, quest_id);
}
}
return retVal___;
@@ -13709,14 +14165,14 @@ bool HP_mapif_quest_delete(int char_id, int quest_id) {
bool HP_mapif_quest_add(int char_id, struct quest qd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_quest_add_pre ) {
+ if (HPMHooks.count.HP_mapif_quest_add_pre > 0) {
bool (*preHookFunc) (int *char_id, struct quest *qd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_quest_add_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &qd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13724,11 +14180,11 @@ bool HP_mapif_quest_add(int char_id, struct quest qd) {
{
retVal___ = HPMHooks.source.mapif.quest_add(char_id, qd);
}
- if( HPMHooks.count.HP_mapif_quest_add_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, struct quest *qd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_quest_add_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, struct quest qd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_quest_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &qd);
+ retVal___ = postHookFunc(retVal___, char_id, qd);
}
}
return retVal___;
@@ -13736,14 +14192,14 @@ bool HP_mapif_quest_add(int char_id, struct quest qd) {
bool HP_mapif_quest_update(int char_id, struct quest qd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapif_quest_update_pre ) {
+ if (HPMHooks.count.HP_mapif_quest_update_pre > 0) {
bool (*preHookFunc) (int *char_id, struct quest *qd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_quest_update_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &qd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13751,25 +14207,25 @@ bool HP_mapif_quest_update(int char_id, struct quest qd) {
{
retVal___ = HPMHooks.source.mapif.quest_update(char_id, qd);
}
- if( HPMHooks.count.HP_mapif_quest_update_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, struct quest *qd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_quest_update_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, struct quest qd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_quest_update_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &qd);
+ retVal___ = postHookFunc(retVal___, char_id, qd);
}
}
return retVal___;
}
void HP_mapif_quest_save_ack(int fd, int char_id, bool success) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_quest_save_ack_pre ) {
+ if (HPMHooks.count.HP_mapif_quest_save_ack_pre > 0) {
void (*preHookFunc) (int *fd, int *char_id, bool *success);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_save_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_save_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_quest_save_ack_pre[hIndex].func;
preHookFunc(&fd, &char_id, &success);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13777,11 +14233,11 @@ void HP_mapif_quest_save_ack(int fd, int char_id, bool success) {
{
HPMHooks.source.mapif.quest_save_ack(fd, char_id, success);
}
- if( HPMHooks.count.HP_mapif_quest_save_ack_post ) {
- void (*postHookFunc) (int *fd, int *char_id, bool *success);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_save_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_quest_save_ack_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, bool success);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_quest_save_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_quest_save_ack_post[hIndex].func;
- postHookFunc(&fd, &char_id, &success);
+ postHookFunc(fd, char_id, success);
}
}
return;
@@ -13789,14 +14245,14 @@ void HP_mapif_quest_save_ack(int fd, int char_id, bool success) {
int HP_mapif_parse_quest_save(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_quest_save_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_quest_save_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_quest_save_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13804,25 +14260,25 @@ int HP_mapif_parse_quest_save(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_quest_save(fd);
}
- if( HPMHooks.count.HP_mapif_parse_quest_save_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_quest_save_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_quest_save_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_mapif_send_quests(int fd, int char_id, struct quest *tmp_questlog, int num_quests) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_send_quests_pre ) {
- void (*preHookFunc) (int *fd, int *char_id, struct quest *tmp_questlog, int *num_quests);
+ if (HPMHooks.count.HP_mapif_send_quests_pre > 0) {
+ void (*preHookFunc) (int *fd, int *char_id, struct quest **tmp_questlog, int *num_quests);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_quests_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_quests_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_send_quests_pre[hIndex].func;
- preHookFunc(&fd, &char_id, tmp_questlog, &num_quests);
+ preHookFunc(&fd, &char_id, &tmp_questlog, &num_quests);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13830,11 +14286,11 @@ void HP_mapif_send_quests(int fd, int char_id, struct quest *tmp_questlog, int n
{
HPMHooks.source.mapif.send_quests(fd, char_id, tmp_questlog, num_quests);
}
- if( HPMHooks.count.HP_mapif_send_quests_post ) {
- void (*postHookFunc) (int *fd, int *char_id, struct quest *tmp_questlog, int *num_quests);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_quests_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_send_quests_post > 0) {
+ void (*postHookFunc) (int fd, int char_id, struct quest *tmp_questlog, int num_quests);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_send_quests_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_send_quests_post[hIndex].func;
- postHookFunc(&fd, &char_id, tmp_questlog, &num_quests);
+ postHookFunc(fd, char_id, tmp_questlog, num_quests);
}
}
return;
@@ -13842,14 +14298,14 @@ void HP_mapif_send_quests(int fd, int char_id, struct quest *tmp_questlog, int n
int HP_mapif_parse_quest_load(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_quest_load_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_quest_load_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_quest_load_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13857,11 +14313,11 @@ int HP_mapif_parse_quest_load(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_quest_load(fd);
}
- if( HPMHooks.count.HP_mapif_parse_quest_load_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_quest_load_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_quest_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_quest_load_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -13869,14 +14325,14 @@ int HP_mapif_parse_quest_load(int fd) {
int HP_mapif_load_guild_storage(int fd, int account_id, int guild_id, char flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_load_guild_storage_pre ) {
+ if (HPMHooks.count.HP_mapif_load_guild_storage_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id, int *guild_id, char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_guild_storage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_guild_storage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_load_guild_storage_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id, &guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13884,11 +14340,11 @@ int HP_mapif_load_guild_storage(int fd, int account_id, int guild_id, char flag)
{
retVal___ = HPMHooks.source.mapif.load_guild_storage(fd, account_id, guild_id, flag);
}
- if( HPMHooks.count.HP_mapif_load_guild_storage_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *guild_id, char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_guild_storage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_load_guild_storage_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int guild_id, char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_load_guild_storage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_load_guild_storage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &guild_id, &flag);
+ retVal___ = postHookFunc(retVal___, fd, account_id, guild_id, flag);
}
}
return retVal___;
@@ -13896,14 +14352,14 @@ int HP_mapif_load_guild_storage(int fd, int account_id, int guild_id, char flag)
int HP_mapif_save_guild_storage_ack(int fd, int account_id, int guild_id, int fail) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_save_guild_storage_ack_pre ) {
+ if (HPMHooks.count.HP_mapif_save_guild_storage_ack_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id, int *guild_id, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_guild_storage_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_guild_storage_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_save_guild_storage_ack_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id, &guild_id, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13911,11 +14367,11 @@ int HP_mapif_save_guild_storage_ack(int fd, int account_id, int guild_id, int fa
{
retVal___ = HPMHooks.source.mapif.save_guild_storage_ack(fd, account_id, guild_id, fail);
}
- if( HPMHooks.count.HP_mapif_save_guild_storage_ack_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *guild_id, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_guild_storage_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_save_guild_storage_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int guild_id, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_save_guild_storage_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_save_guild_storage_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &guild_id, &fail);
+ retVal___ = postHookFunc(retVal___, fd, account_id, guild_id, fail);
}
}
return retVal___;
@@ -13923,14 +14379,14 @@ int HP_mapif_save_guild_storage_ack(int fd, int account_id, int guild_id, int fa
int HP_mapif_parse_LoadGuildStorage(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_LoadGuildStorage_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_LoadGuildStorage_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadGuildStorage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadGuildStorage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_LoadGuildStorage_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13938,11 +14394,11 @@ int HP_mapif_parse_LoadGuildStorage(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_LoadGuildStorage(fd);
}
- if( HPMHooks.count.HP_mapif_parse_LoadGuildStorage_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadGuildStorage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_LoadGuildStorage_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_LoadGuildStorage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_LoadGuildStorage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -13950,14 +14406,14 @@ int HP_mapif_parse_LoadGuildStorage(int fd) {
int HP_mapif_parse_SaveGuildStorage(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_SaveGuildStorage_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_SaveGuildStorage_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SaveGuildStorage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SaveGuildStorage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_SaveGuildStorage_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13965,26 +14421,133 @@ int HP_mapif_parse_SaveGuildStorage(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_SaveGuildStorage(fd);
}
- if( HPMHooks.count.HP_mapif_parse_SaveGuildStorage_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SaveGuildStorage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_SaveGuildStorage_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_SaveGuildStorage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_SaveGuildStorage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
+ }
+ }
+ return retVal___;
+}
+int HP_mapif_account_storage_load(int fd, int account_id) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_mapif_account_storage_load_pre > 0) {
+ int (*preHookFunc) (int *fd, int *account_id);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_account_storage_load_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_account_storage_load_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &account_id);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mapif.account_storage_load(fd, account_id);
+ }
+ if (HPMHooks.count.HP_mapif_account_storage_load_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_account_storage_load_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_account_storage_load_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, account_id);
}
}
return retVal___;
}
+int HP_mapif_pAccountStorageLoad(int fd) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_mapif_pAccountStorageLoad_pre > 0) {
+ int (*preHookFunc) (int *fd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pAccountStorageLoad_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_pAccountStorageLoad_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mapif.pAccountStorageLoad(fd);
+ }
+ if (HPMHooks.count.HP_mapif_pAccountStorageLoad_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pAccountStorageLoad_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_pAccountStorageLoad_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd);
+ }
+ }
+ return retVal___;
+}
+int HP_mapif_pAccountStorageSave(int fd) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_mapif_pAccountStorageSave_pre > 0) {
+ int (*preHookFunc) (int *fd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pAccountStorageSave_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_pAccountStorageSave_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mapif.pAccountStorageSave(fd);
+ }
+ if (HPMHooks.count.HP_mapif_pAccountStorageSave_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_pAccountStorageSave_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_pAccountStorageSave_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd);
+ }
+ }
+ return retVal___;
+}
+void HP_mapif_sAccountStorageSaveAck(int fd, int account_id, bool save) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mapif_sAccountStorageSaveAck_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, bool *save);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sAccountStorageSaveAck_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mapif_sAccountStorageSaveAck_pre[hIndex].func;
+ preHookFunc(&fd, &account_id, &save);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mapif.sAccountStorageSaveAck(fd, account_id, save);
+ }
+ if (HPMHooks.count.HP_mapif_sAccountStorageSaveAck_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, bool save);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_sAccountStorageSaveAck_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mapif_sAccountStorageSaveAck_post[hIndex].func;
+ postHookFunc(fd, account_id, save);
+ }
+ }
+ return;
+}
int HP_mapif_itembound_ack(int fd, int aid, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_itembound_ack_pre ) {
+ if (HPMHooks.count.HP_mapif_itembound_ack_pre > 0) {
int (*preHookFunc) (int *fd, int *aid, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_itembound_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_itembound_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_itembound_ack_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &aid, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -13992,11 +14555,11 @@ int HP_mapif_itembound_ack(int fd, int aid, int guild_id) {
{
retVal___ = HPMHooks.source.mapif.itembound_ack(fd, aid, guild_id);
}
- if( HPMHooks.count.HP_mapif_itembound_ack_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *aid, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_itembound_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_itembound_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int aid, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_itembound_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_itembound_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &aid, &guild_id);
+ retVal___ = postHookFunc(retVal___, fd, aid, guild_id);
}
}
return retVal___;
@@ -14004,14 +14567,14 @@ int HP_mapif_itembound_ack(int fd, int aid, int guild_id) {
int HP_mapif_parse_ItemBoundRetrieve_sub(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_ItemBoundRetrieve_sub_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14019,25 +14582,25 @@ int HP_mapif_parse_ItemBoundRetrieve_sub(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_ItemBoundRetrieve_sub(fd);
}
- if( HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_ItemBoundRetrieve_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_mapif_parse_ItemBoundRetrieve(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_ItemBoundRetrieve_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14045,25 +14608,25 @@ void HP_mapif_parse_ItemBoundRetrieve(int fd) {
{
HPMHooks.source.mapif.parse_ItemBoundRetrieve(fd);
}
- if( HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_ItemBoundRetrieve_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_ItemBoundRetrieve_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_parse_accinfo(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_accinfo_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_accinfo_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_accinfo_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14071,25 +14634,25 @@ void HP_mapif_parse_accinfo(int fd) {
{
HPMHooks.source.mapif.parse_accinfo(fd);
}
- if( HPMHooks.count.HP_mapif_parse_accinfo_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_accinfo_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_accinfo_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_parse_accinfo2_pre ) {
- void (*preHookFunc) (bool *success, int *map_fd, int *u_fd, int *u_aid, int *account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int *group_id, int *logincount, int *state);
+ if (HPMHooks.count.HP_mapif_parse_accinfo2_pre > 0) {
+ void (*preHookFunc) (bool *success, int *map_fd, int *u_fd, int *u_aid, int *account_id, const char **userid, const char **user_pass, const char **email, const char **last_ip, const char **lastlogin, const char **pin_code, const char **birthdate, int *group_id, int *logincount, int *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_accinfo2_pre[hIndex].func;
- preHookFunc(&success, &map_fd, &u_fd, &u_aid, &account_id, userid, user_pass, email, last_ip, lastlogin, pin_code, birthdate, &group_id, &logincount, &state);
+ preHookFunc(&success, &map_fd, &u_fd, &u_aid, &account_id, &userid, &user_pass, &email, &last_ip, &lastlogin, &pin_code, &birthdate, &group_id, &logincount, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14097,26 +14660,26 @@ void HP_mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int
{
HPMHooks.source.mapif.parse_accinfo2(success, map_fd, u_fd, u_aid, account_id, userid, user_pass, email, last_ip, lastlogin, pin_code, birthdate, group_id, logincount, state);
}
- if( HPMHooks.count.HP_mapif_parse_accinfo2_post ) {
- void (*postHookFunc) (bool *success, int *map_fd, int *u_fd, int *u_aid, int *account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int *group_id, int *logincount, int *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_accinfo2_post > 0) {
+ void (*postHookFunc) (bool success, int map_fd, int u_fd, int u_aid, int account_id, const char *userid, const char *user_pass, const char *email, const char *last_ip, const char *lastlogin, const char *pin_code, const char *birthdate, int group_id, int logincount, int state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_accinfo2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_accinfo2_post[hIndex].func;
- postHookFunc(&success, &map_fd, &u_fd, &u_aid, &account_id, userid, user_pass, email, last_ip, lastlogin, pin_code, birthdate, &group_id, &logincount, &state);
+ postHookFunc(success, map_fd, u_fd, u_aid, account_id, userid, user_pass, email, last_ip, lastlogin, pin_code, birthdate, group_id, logincount, state);
}
}
return;
}
-int HP_mapif_broadcast(unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd) {
+int HP_mapif_broadcast(const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_broadcast_pre ) {
- int (*preHookFunc) (unsigned char *mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd);
+ if (HPMHooks.count.HP_mapif_broadcast_pre > 0) {
+ int (*preHookFunc) (const unsigned char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_broadcast_pre[hIndex].func;
- retVal___ = preHookFunc(mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &sfd);
+ retVal___ = preHookFunc(&mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &sfd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14124,11 +14687,11 @@ int HP_mapif_broadcast(unsigned char *mes, int len, unsigned int fontColor, shor
{
retVal___ = HPMHooks.source.mapif.broadcast(mes, len, fontColor, fontType, fontSize, fontAlign, fontY, sfd);
}
- if( HPMHooks.count.HP_mapif_broadcast_post ) {
- int (*postHookFunc) (int retVal___, unsigned char *mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, int *sfd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_broadcast_post > 0) {
+ int (*postHookFunc) (int retVal___, const unsigned char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, int sfd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_broadcast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_broadcast_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &sfd);
+ retVal___ = postHookFunc(retVal___, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, sfd);
}
}
return retVal___;
@@ -14136,14 +14699,14 @@ int HP_mapif_broadcast(unsigned char *mes, int len, unsigned int fontColor, shor
int HP_mapif_wis_message(struct WisData *wd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_wis_message_pre ) {
- int (*preHookFunc) (struct WisData *wd);
+ if (HPMHooks.count.HP_mapif_wis_message_pre > 0) {
+ int (*preHookFunc) (struct WisData **wd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_wis_message_pre[hIndex].func;
- retVal___ = preHookFunc(wd);
+ retVal___ = preHookFunc(&wd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14151,25 +14714,25 @@ int HP_mapif_wis_message(struct WisData *wd) {
{
retVal___ = HPMHooks.source.mapif.wis_message(wd);
}
- if( HPMHooks.count.HP_mapif_wis_message_post ) {
+ if (HPMHooks.count.HP_mapif_wis_message_post > 0) {
int (*postHookFunc) (int retVal___, struct WisData *wd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_wis_message_post[hIndex].func;
retVal___ = postHookFunc(retVal___, wd);
}
}
return retVal___;
}
-void HP_mapif_wis_response(int fd, unsigned char *src, int flag) {
+void HP_mapif_wis_response(int fd, const unsigned char *src, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_wis_response_pre ) {
- void (*preHookFunc) (int *fd, unsigned char *src, int *flag);
+ if (HPMHooks.count.HP_mapif_wis_response_pre > 0) {
+ void (*preHookFunc) (int *fd, const unsigned char **src, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_wis_response_pre[hIndex].func;
- preHookFunc(&fd, src, &flag);
+ preHookFunc(&fd, &src, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14177,11 +14740,11 @@ void HP_mapif_wis_response(int fd, unsigned char *src, int flag) {
{
HPMHooks.source.mapif.wis_response(fd, src, flag);
}
- if( HPMHooks.count.HP_mapif_wis_response_post ) {
- void (*postHookFunc) (int *fd, unsigned char *src, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_wis_response_post > 0) {
+ void (*postHookFunc) (int fd, const unsigned char *src, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_response_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_wis_response_post[hIndex].func;
- postHookFunc(&fd, src, &flag);
+ postHookFunc(fd, src, flag);
}
}
return;
@@ -14189,14 +14752,14 @@ void HP_mapif_wis_response(int fd, unsigned char *src, int flag) {
int HP_mapif_wis_end(struct WisData *wd, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_wis_end_pre ) {
- int (*preHookFunc) (struct WisData *wd, int *flag);
+ if (HPMHooks.count.HP_mapif_wis_end_pre > 0) {
+ int (*preHookFunc) (struct WisData **wd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_wis_end_pre[hIndex].func;
- retVal___ = preHookFunc(wd, &flag);
+ retVal___ = preHookFunc(&wd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14204,11 +14767,11 @@ int HP_mapif_wis_end(struct WisData *wd, int flag) {
{
retVal___ = HPMHooks.source.mapif.wis_end(wd, flag);
}
- if( HPMHooks.count.HP_mapif_wis_end_post ) {
- int (*postHookFunc) (int retVal___, struct WisData *wd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_wis_end_post > 0) {
+ int (*postHookFunc) (int retVal___, struct WisData *wd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_wis_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_wis_end_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, wd, &flag);
+ retVal___ = postHookFunc(retVal___, wd, flag);
}
}
return retVal___;
@@ -14216,14 +14779,14 @@ int HP_mapif_wis_end(struct WisData *wd, int flag) {
int HP_mapif_account_reg_reply(int fd, int account_id, int char_id, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_account_reg_reply_pre ) {
+ if (HPMHooks.count.HP_mapif_account_reg_reply_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id, int *char_id, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_account_reg_reply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_account_reg_reply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_account_reg_reply_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id, &char_id, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14231,11 +14794,11 @@ int HP_mapif_account_reg_reply(int fd, int account_id, int char_id, int type) {
{
retVal___ = HPMHooks.source.mapif.account_reg_reply(fd, account_id, char_id, type);
}
- if( HPMHooks.count.HP_mapif_account_reg_reply_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *char_id, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_account_reg_reply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_account_reg_reply_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int char_id, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_account_reg_reply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_account_reg_reply_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &char_id, &type);
+ retVal___ = postHookFunc(retVal___, fd, account_id, char_id, type);
}
}
return retVal___;
@@ -14243,14 +14806,14 @@ int HP_mapif_account_reg_reply(int fd, int account_id, int char_id, int type) {
int HP_mapif_disconnectplayer(int fd, int account_id, int char_id, int reason) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_disconnectplayer_pre ) {
+ if (HPMHooks.count.HP_mapif_disconnectplayer_pre > 0) {
int (*preHookFunc) (int *fd, int *account_id, int *char_id, int *reason);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_disconnectplayer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_disconnectplayer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_disconnectplayer_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &account_id, &char_id, &reason);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14258,11 +14821,11 @@ int HP_mapif_disconnectplayer(int fd, int account_id, int char_id, int reason) {
{
retVal___ = HPMHooks.source.mapif.disconnectplayer(fd, account_id, char_id, reason);
}
- if( HPMHooks.count.HP_mapif_disconnectplayer_post ) {
- int (*postHookFunc) (int retVal___, int *fd, int *account_id, int *char_id, int *reason);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_disconnectplayer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_disconnectplayer_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, int account_id, int char_id, int reason);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_disconnectplayer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_disconnectplayer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &account_id, &char_id, &reason);
+ retVal___ = postHookFunc(retVal___, fd, account_id, char_id, reason);
}
}
return retVal___;
@@ -14270,14 +14833,14 @@ int HP_mapif_disconnectplayer(int fd, int account_id, int char_id, int reason) {
int HP_mapif_parse_broadcast(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_broadcast_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_broadcast_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_broadcast_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14285,11 +14848,11 @@ int HP_mapif_parse_broadcast(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_broadcast(fd);
}
- if( HPMHooks.count.HP_mapif_parse_broadcast_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_broadcast_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_broadcast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_broadcast_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -14297,14 +14860,14 @@ int HP_mapif_parse_broadcast(int fd) {
int HP_mapif_parse_WisRequest(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_WisRequest_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_WisRequest_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_WisRequest_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14312,11 +14875,11 @@ int HP_mapif_parse_WisRequest(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_WisRequest(fd);
}
- if( HPMHooks.count.HP_mapif_parse_WisRequest_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_WisRequest_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisRequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_WisRequest_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -14324,14 +14887,14 @@ int HP_mapif_parse_WisRequest(int fd) {
int HP_mapif_parse_WisReply(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_WisReply_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_WisReply_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_WisReply_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14339,11 +14902,11 @@ int HP_mapif_parse_WisReply(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_WisReply(fd);
}
- if( HPMHooks.count.HP_mapif_parse_WisReply_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_WisReply_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisReply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_WisReply_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -14351,14 +14914,14 @@ int HP_mapif_parse_WisReply(int fd) {
int HP_mapif_parse_WisToGM(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_WisToGM_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_WisToGM_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_WisToGM_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14366,11 +14929,11 @@ int HP_mapif_parse_WisToGM(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_WisToGM(fd);
}
- if( HPMHooks.count.HP_mapif_parse_WisToGM_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_WisToGM_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_WisToGM_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_WisToGM_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -14378,14 +14941,14 @@ int HP_mapif_parse_WisToGM(int fd) {
int HP_mapif_parse_Registry(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_Registry_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_Registry_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_Registry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_Registry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_Registry_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14393,11 +14956,11 @@ int HP_mapif_parse_Registry(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_Registry(fd);
}
- if( HPMHooks.count.HP_mapif_parse_Registry_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_Registry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_Registry_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_Registry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_Registry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -14405,14 +14968,14 @@ int HP_mapif_parse_Registry(int fd) {
int HP_mapif_parse_RegistryRequest(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_RegistryRequest_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_RegistryRequest_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_RegistryRequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_RegistryRequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_RegistryRequest_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14420,25 +14983,25 @@ int HP_mapif_parse_RegistryRequest(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_RegistryRequest(fd);
}
- if( HPMHooks.count.HP_mapif_parse_RegistryRequest_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_RegistryRequest_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_RegistryRequest_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_RegistryRequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_RegistryRequest_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_mapif_namechange_ack(int fd, int account_id, int char_id, int type, int flag, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapif_namechange_ack_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, int *char_id, int *type, int *flag, const char *name);
+ if (HPMHooks.count.HP_mapif_namechange_ack_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, int *char_id, int *type, int *flag, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_namechange_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_namechange_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_namechange_ack_pre[hIndex].func;
- preHookFunc(&fd, &account_id, &char_id, &type, &flag, name);
+ preHookFunc(&fd, &account_id, &char_id, &type, &flag, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14446,11 +15009,11 @@ void HP_mapif_namechange_ack(int fd, int account_id, int char_id, int type, int
{
HPMHooks.source.mapif.namechange_ack(fd, account_id, char_id, type, flag, name);
}
- if( HPMHooks.count.HP_mapif_namechange_ack_post ) {
- void (*postHookFunc) (int *fd, int *account_id, int *char_id, int *type, int *flag, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_namechange_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_namechange_ack_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, int char_id, int type, int flag, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_namechange_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_namechange_ack_post[hIndex].func;
- postHookFunc(&fd, &account_id, &char_id, &type, &flag, name);
+ postHookFunc(fd, account_id, char_id, type, flag, name);
}
}
return;
@@ -14458,14 +15021,14 @@ void HP_mapif_namechange_ack(int fd, int account_id, int char_id, int type, int
int HP_mapif_parse_NameChangeRequest(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapif_parse_NameChangeRequest_pre ) {
+ if (HPMHooks.count.HP_mapif_parse_NameChangeRequest_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_NameChangeRequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_NameChangeRequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapif_parse_NameChangeRequest_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14473,27 +15036,27 @@ int HP_mapif_parse_NameChangeRequest(int fd) {
{
retVal___ = HPMHooks.source.mapif.parse_NameChangeRequest(fd);
}
- if( HPMHooks.count.HP_mapif_parse_NameChangeRequest_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_NameChangeRequest_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapif_parse_NameChangeRequest_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapif_parse_NameChangeRequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapif_parse_NameChangeRequest_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-/* mapindex */
+/* mapindex_interface */
int HP_mapindex_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapindex_init_pre ) {
+ if (HPMHooks.count.HP_mapindex_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14501,9 +15064,9 @@ int HP_mapindex_init(void) {
{
retVal___ = HPMHooks.source.mapindex.init();
}
- if( HPMHooks.count.HP_mapindex_init_post ) {
+ if (HPMHooks.count.HP_mapindex_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -14512,14 +15075,14 @@ int HP_mapindex_init(void) {
}
void HP_mapindex_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapindex_final_pre ) {
+ if (HPMHooks.count.HP_mapindex_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14527,9 +15090,9 @@ void HP_mapindex_final(void) {
{
HPMHooks.source.mapindex.final();
}
- if( HPMHooks.count.HP_mapindex_final_post ) {
+ if (HPMHooks.count.HP_mapindex_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_final_post[hIndex].func;
postHookFunc();
}
@@ -14539,14 +15102,14 @@ void HP_mapindex_final(void) {
int HP_mapindex_addmap(int index, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapindex_addmap_pre ) {
- int (*preHookFunc) (int *index, const char *name);
+ if (HPMHooks.count.HP_mapindex_addmap_pre > 0) {
+ int (*preHookFunc) (int *index, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_addmap_pre[hIndex].func;
- retVal___ = preHookFunc(&index, name);
+ retVal___ = preHookFunc(&index, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14554,25 +15117,25 @@ int HP_mapindex_addmap(int index, const char *name) {
{
retVal___ = HPMHooks.source.mapindex.addmap(index, name);
}
- if( HPMHooks.count.HP_mapindex_addmap_post ) {
- int (*postHookFunc) (int retVal___, int *index, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapindex_addmap_post > 0) {
+ int (*postHookFunc) (int retVal___, int index, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_addmap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &index, name);
+ retVal___ = postHookFunc(retVal___, index, name);
}
}
return retVal___;
}
void HP_mapindex_removemap(int index) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapindex_removemap_pre ) {
+ if (HPMHooks.count.HP_mapindex_removemap_pre > 0) {
void (*preHookFunc) (int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_removemap_pre[hIndex].func;
preHookFunc(&index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14580,11 +15143,11 @@ void HP_mapindex_removemap(int index) {
{
HPMHooks.source.mapindex.removemap(index);
}
- if( HPMHooks.count.HP_mapindex_removemap_post ) {
- void (*postHookFunc) (int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapindex_removemap_post > 0) {
+ void (*postHookFunc) (int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_removemap_post[hIndex].func;
- postHookFunc(&index);
+ postHookFunc(index);
}
}
return;
@@ -14592,14 +15155,14 @@ void HP_mapindex_removemap(int index) {
const char* HP_mapindex_getmapname(const char *string, char *output) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapindex_getmapname_pre ) {
- const char* (*preHookFunc) (const char *string, char *output);
+ if (HPMHooks.count.HP_mapindex_getmapname_pre > 0) {
+ const char* (*preHookFunc) (const char **string, char **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_getmapname_pre[hIndex].func;
- retVal___ = preHookFunc(string, output);
+ retVal___ = preHookFunc(&string, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14607,9 +15170,9 @@ const char* HP_mapindex_getmapname(const char *string, char *output) {
{
retVal___ = HPMHooks.source.mapindex.getmapname(string, output);
}
- if( HPMHooks.count.HP_mapindex_getmapname_post ) {
+ if (HPMHooks.count.HP_mapindex_getmapname_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *string, char *output);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_getmapname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, output);
}
@@ -14619,14 +15182,14 @@ const char* HP_mapindex_getmapname(const char *string, char *output) {
const char* HP_mapindex_getmapname_ext(const char *string, char *output) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapindex_getmapname_ext_pre ) {
- const char* (*preHookFunc) (const char *string, char *output);
+ if (HPMHooks.count.HP_mapindex_getmapname_ext_pre > 0) {
+ const char* (*preHookFunc) (const char **string, char **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_pre[hIndex].func;
- retVal___ = preHookFunc(string, output);
+ retVal___ = preHookFunc(&string, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14634,9 +15197,9 @@ const char* HP_mapindex_getmapname_ext(const char *string, char *output) {
{
retVal___ = HPMHooks.source.mapindex.getmapname_ext(string, output);
}
- if( HPMHooks.count.HP_mapindex_getmapname_ext_post ) {
+ if (HPMHooks.count.HP_mapindex_getmapname_ext_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *string, char *output);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, output);
}
@@ -14646,14 +15209,14 @@ const char* HP_mapindex_getmapname_ext(const char *string, char *output) {
unsigned short HP_mapindex_name2id(const char *p1) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_mapindex_name2id_pre ) {
- unsigned short (*preHookFunc) (const char *p1);
+ if (HPMHooks.count.HP_mapindex_name2id_pre > 0) {
+ unsigned short (*preHookFunc) (const char **p1);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_name2id_pre[hIndex].func;
- retVal___ = preHookFunc(p1);
+ retVal___ = preHookFunc(&p1);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14661,9 +15224,9 @@ unsigned short HP_mapindex_name2id(const char *p1) {
{
retVal___ = HPMHooks.source.mapindex.name2id(p1);
}
- if( HPMHooks.count.HP_mapindex_name2id_post ) {
+ if (HPMHooks.count.HP_mapindex_name2id_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, const char *p1);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_name2id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p1);
}
@@ -14673,14 +15236,14 @@ unsigned short HP_mapindex_name2id(const char *p1) {
const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const char *func) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapindex_id2name_pre ) {
- const char* (*preHookFunc) (uint16 *id, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_mapindex_id2name_pre > 0) {
+ const char* (*preHookFunc) (uint16 *id, const char **file, int *line, const char **func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_id2name_pre[hIndex].func;
- retVal___ = preHookFunc(&id, file, &line, func);
+ retVal___ = preHookFunc(&id, &file, &line, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14688,11 +15251,11 @@ const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const cha
{
retVal___ = HPMHooks.source.mapindex.id2name(id, file, line, func);
}
- if( HPMHooks.count.HP_mapindex_id2name_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint16 *id, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapindex_id2name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint16 id, const char *file, int line, const char *func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_id2name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id, file, &line, func);
+ retVal___ = postHookFunc(retVal___, id, file, line, func);
}
}
return retVal___;
@@ -14700,14 +15263,14 @@ const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const cha
bool HP_mapindex_check_default(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapindex_check_default_pre ) {
+ if (HPMHooks.count.HP_mapindex_check_default_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_check_default_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14715,26 +15278,369 @@ bool HP_mapindex_check_default(void) {
{
retVal___ = HPMHooks.source.mapindex.check_default();
}
- if( HPMHooks.count.HP_mapindex_check_default_post ) {
+ if (HPMHooks.count.HP_mapindex_check_default_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_check_default_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-/* nullpo */
+/* md5_interface */
+void HP_md5_string(const char *string, char *output) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_md5_string_pre > 0) {
+ void (*preHookFunc) (const char **string, char **output);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func;
+ preHookFunc(&string, &output);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.md5.string(string, output);
+ }
+ if (HPMHooks.count.HP_md5_string_post > 0) {
+ void (*postHookFunc) (const char *string, char *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func;
+ postHookFunc(string, output);
+ }
+ }
+ return;
+}
+void HP_md5_binary(const uint8 *buf, const int buf_size, uint8 *output) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_md5_binary_pre > 0) {
+ void (*preHookFunc) (const uint8 **buf, const int *buf_size, uint8 **output);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func;
+ preHookFunc(&buf, &buf_size, &output);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.md5.binary(buf, buf_size, output);
+ }
+ if (HPMHooks.count.HP_md5_binary_post > 0) {
+ void (*postHookFunc) (const uint8 *buf, const int buf_size, uint8 *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func;
+ postHookFunc(buf, buf_size, output);
+ }
+ }
+ return;
+}
+void HP_md5_salt(int len, char *output) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_md5_salt_pre > 0) {
+ void (*preHookFunc) (int *len, char **output);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func;
+ preHookFunc(&len, &output);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.md5.salt(len, output);
+ }
+ if (HPMHooks.count.HP_md5_salt_post > 0) {
+ void (*postHookFunc) (int len, char *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func;
+ postHookFunc(len, output);
+ }
+ }
+ return;
+}
+/* mutex_interface */
+struct mutex_data* HP_mutex_create(void) {
+ int hIndex = 0;
+ struct mutex_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_mutex_create_pre > 0) {
+ struct mutex_data* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mutex.create();
+ }
+ if (HPMHooks.count.HP_mutex_create_post > 0) {
+ struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+void HP_mutex_destroy(struct mutex_data *m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_destroy_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.destroy(m);
+ }
+ if (HPMHooks.count.HP_mutex_destroy_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
+void HP_mutex_lock(struct mutex_data *m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_lock_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.lock(m);
+ }
+ if (HPMHooks.count.HP_mutex_lock_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
+bool HP_mutex_trylock(struct mutex_data *m) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mutex_trylock_pre > 0) {
+ bool (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func;
+ retVal___ = preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mutex.trylock(m);
+ }
+ if (HPMHooks.count.HP_mutex_trylock_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, m);
+ }
+ }
+ return retVal___;
+}
+void HP_mutex_unlock(struct mutex_data *m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_unlock_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.unlock(m);
+ }
+ if (HPMHooks.count.HP_mutex_unlock_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
+struct cond_data* HP_mutex_cond_create(void) {
+ int hIndex = 0;
+ struct cond_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_mutex_cond_create_pre > 0) {
+ struct cond_data* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mutex.cond_create();
+ }
+ if (HPMHooks.count.HP_mutex_cond_create_post > 0) {
+ struct cond_data* (*postHookFunc) (struct cond_data* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+void HP_mutex_cond_destroy(struct cond_data *c) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_destroy_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func;
+ preHookFunc(&c);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_destroy(c);
+ }
+ if (HPMHooks.count.HP_mutex_cond_destroy_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func;
+ postHookFunc(c);
+ }
+ }
+ return;
+}
+void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_wait_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func;
+ preHookFunc(&c, &m, &timeout_ticks);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks);
+ }
+ if (HPMHooks.count.HP_mutex_cond_wait_post > 0) {
+ void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func;
+ postHookFunc(c, m, timeout_ticks);
+ }
+ }
+ return;
+}
+void HP_mutex_cond_signal(struct cond_data *c) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_signal_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func;
+ preHookFunc(&c);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_signal(c);
+ }
+ if (HPMHooks.count.HP_mutex_cond_signal_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func;
+ postHookFunc(c);
+ }
+ }
+ return;
+}
+void HP_mutex_cond_broadcast(struct cond_data *c) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_broadcast_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func;
+ preHookFunc(&c);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_broadcast(c);
+ }
+ if (HPMHooks.count.HP_mutex_cond_broadcast_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func;
+ postHookFunc(c);
+ }
+ }
+ return;
+}
+/* nullpo_interface */
void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
int hIndex = 0;
- if( HPMHooks.count.HP_nullpo_assert_report_pre ) {
- void (*preHookFunc) (const char *file, int *line, const char *func, const char *targetname, const char *title);
+ if (HPMHooks.count.HP_nullpo_assert_report_pre > 0) {
+ void (*preHookFunc) (const char **file, int *line, const char **func, const char **targetname, const char **title);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_nullpo_assert_report_pre[hIndex].func;
- preHookFunc(file, &line, func, targetname, title);
+ preHookFunc(&file, &line, &func, &targetname, &title);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14742,26 +15648,26 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const
{
HPMHooks.source.nullpo.assert_report(file, line, func, targetname, title);
}
- if( HPMHooks.count.HP_nullpo_assert_report_post ) {
- void (*postHookFunc) (const char *file, int *line, const char *func, const char *targetname, const char *title);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_post; hIndex++ ) {
+ if (HPMHooks.count.HP_nullpo_assert_report_post > 0) {
+ void (*postHookFunc) (const char *file, int line, const char *func, const char *targetname, const char *title);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_nullpo_assert_report_post[hIndex].func;
- postHookFunc(file, &line, func, targetname, title);
+ postHookFunc(file, line, func, targetname, title);
}
}
return;
}
-/* pincode */
+/* pincode_interface */
void HP_pincode_handle(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_handle_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_pincode_handle_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_handle_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_handle_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_handle_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14769,25 +15675,25 @@ void HP_pincode_handle(int fd, struct char_session_data *sd) {
{
HPMHooks.source.pincode.handle(fd, sd);
}
- if( HPMHooks.count.HP_pincode_handle_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_handle_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_handle_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_handle_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_handle_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_pincode_decrypt(unsigned int userSeed, char *pin) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_decrypt_pre ) {
- void (*preHookFunc) (unsigned int *userSeed, char *pin);
+ if (HPMHooks.count.HP_pincode_decrypt_pre > 0) {
+ void (*preHookFunc) (unsigned int *userSeed, char **pin);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_decrypt_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_decrypt_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_decrypt_pre[hIndex].func;
- preHookFunc(&userSeed, pin);
+ preHookFunc(&userSeed, &pin);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14795,25 +15701,25 @@ void HP_pincode_decrypt(unsigned int userSeed, char *pin) {
{
HPMHooks.source.pincode.decrypt(userSeed, pin);
}
- if( HPMHooks.count.HP_pincode_decrypt_post ) {
- void (*postHookFunc) (unsigned int *userSeed, char *pin);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_decrypt_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_decrypt_post > 0) {
+ void (*postHookFunc) (unsigned int userSeed, char *pin);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_decrypt_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_decrypt_post[hIndex].func;
- postHookFunc(&userSeed, pin);
+ postHookFunc(userSeed, pin);
}
}
return;
}
void HP_pincode_error(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_error_pre ) {
+ if (HPMHooks.count.HP_pincode_error_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_error_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_error_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_error_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14821,25 +15727,25 @@ void HP_pincode_error(int account_id) {
{
HPMHooks.source.pincode.error(account_id);
}
- if( HPMHooks.count.HP_pincode_error_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_error_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_error_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_error_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_error_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
void HP_pincode_update(int account_id, char *pin) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_update_pre ) {
- void (*preHookFunc) (int *account_id, char *pin);
+ if (HPMHooks.count.HP_pincode_update_pre > 0) {
+ void (*preHookFunc) (int *account_id, char **pin);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_update_pre[hIndex].func;
- preHookFunc(&account_id, pin);
+ preHookFunc(&account_id, &pin);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14847,25 +15753,25 @@ void HP_pincode_update(int account_id, char *pin) {
{
HPMHooks.source.pincode.update(account_id, pin);
}
- if( HPMHooks.count.HP_pincode_update_post ) {
- void (*postHookFunc) (int *account_id, char *pin);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_update_post > 0) {
+ void (*postHookFunc) (int account_id, char *pin);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_update_post[hIndex].func;
- postHookFunc(&account_id, pin);
+ postHookFunc(account_id, pin);
}
}
return;
}
void HP_pincode_sendstate(int fd, struct char_session_data *sd, uint16 state) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_sendstate_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd, uint16 *state);
+ if (HPMHooks.count.HP_pincode_sendstate_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd, uint16 *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_sendstate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_sendstate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_sendstate_pre[hIndex].func;
- preHookFunc(&fd, sd, &state);
+ preHookFunc(&fd, &sd, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14873,25 +15779,25 @@ void HP_pincode_sendstate(int fd, struct char_session_data *sd, uint16 state) {
{
HPMHooks.source.pincode.sendstate(fd, sd, state);
}
- if( HPMHooks.count.HP_pincode_sendstate_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd, uint16 *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_sendstate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_sendstate_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd, uint16 state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_sendstate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_sendstate_post[hIndex].func;
- postHookFunc(&fd, sd, &state);
+ postHookFunc(fd, sd, state);
}
}
return;
}
void HP_pincode_setnew(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_setnew_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_pincode_setnew_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_setnew_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_setnew_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_setnew_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14899,25 +15805,25 @@ void HP_pincode_setnew(int fd, struct char_session_data *sd) {
{
HPMHooks.source.pincode.setnew(fd, sd);
}
- if( HPMHooks.count.HP_pincode_setnew_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_setnew_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_setnew_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_setnew_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_setnew_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_pincode_change(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_change_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_pincode_change_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_change_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14925,11 +15831,11 @@ void HP_pincode_change(int fd, struct char_session_data *sd) {
{
HPMHooks.source.pincode.change(fd, sd);
}
- if( HPMHooks.count.HP_pincode_change_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_change_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_change_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
@@ -14937,14 +15843,14 @@ void HP_pincode_change(int fd, struct char_session_data *sd) {
int HP_pincode_compare(int fd, struct char_session_data *sd, char *pin) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pincode_compare_pre ) {
- int (*preHookFunc) (int *fd, struct char_session_data *sd, char *pin);
+ if (HPMHooks.count.HP_pincode_compare_pre > 0) {
+ int (*preHookFunc) (int *fd, struct char_session_data **sd, char **pin);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_compare_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_compare_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_compare_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, sd, pin);
+ retVal___ = preHookFunc(&fd, &sd, &pin);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14952,25 +15858,25 @@ int HP_pincode_compare(int fd, struct char_session_data *sd, char *pin) {
{
retVal___ = HPMHooks.source.pincode.compare(fd, sd, pin);
}
- if( HPMHooks.count.HP_pincode_compare_post ) {
- int (*postHookFunc) (int retVal___, int *fd, struct char_session_data *sd, char *pin);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_compare_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_compare_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, struct char_session_data *sd, char *pin);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_compare_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_compare_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, sd, pin);
+ retVal___ = postHookFunc(retVal___, fd, sd, pin);
}
}
return retVal___;
}
void HP_pincode_check(int fd, struct char_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pincode_check_pre ) {
- void (*preHookFunc) (int *fd, struct char_session_data *sd);
+ if (HPMHooks.count.HP_pincode_check_pre > 0) {
+ void (*preHookFunc) (int *fd, struct char_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_check_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14978,53 +15884,267 @@ void HP_pincode_check(int fd, struct char_session_data *sd) {
{
HPMHooks.source.pincode.check(fd, sd);
}
- if( HPMHooks.count.HP_pincode_check_post ) {
- void (*postHookFunc) (int *fd, struct char_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_check_post > 0) {
+ void (*postHookFunc) (int fd, struct char_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_check_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
-bool HP_pincode_config_read(char *w1, char *w2) {
+bool HP_pincode_config_read(const char *filename, const struct config_t *config, bool imported) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pincode_config_read_pre ) {
- bool (*preHookFunc) (char *w1, char *w2);
+ if (HPMHooks.count.HP_pincode_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pincode_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2);
+ retVal___ = preHookFunc(&filename, &config, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pincode.config_read(w1, w2);
+ retVal___ = HPMHooks.source.pincode.config_read(filename, config, imported);
}
- if( HPMHooks.count.HP_pincode_config_read_post ) {
- bool (*postHookFunc) (bool retVal___, char *w1, char *w2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pincode_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pincode_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, w1, w2);
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+/* rnd_interface */
+void HP_rnd_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rnd_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rnd.init();
+ }
+ if (HPMHooks.count.HP_rnd_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_rnd_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rnd_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rnd.final();
+ }
+ if (HPMHooks.count.HP_rnd_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_rnd_seed(uint32 seed) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rnd_seed_pre > 0) {
+ void (*preHookFunc) (uint32 *seed);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func;
+ preHookFunc(&seed);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rnd.seed(seed);
+ }
+ if (HPMHooks.count.HP_rnd_seed_post > 0) {
+ void (*postHookFunc) (uint32 seed);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func;
+ postHookFunc(seed);
+ }
+ }
+ return;
+}
+int32 HP_rnd_random(void) {
+ int hIndex = 0;
+ int32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_random_pre > 0) {
+ int32 (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.random();
+ }
+ if (HPMHooks.count.HP_rnd_random_post > 0) {
+ int32 (*postHookFunc) (int32 retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+uint32 HP_rnd_roll(uint32 dice_faces) {
+ int hIndex = 0;
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_roll_pre > 0) {
+ uint32 (*preHookFunc) (uint32 *dice_faces);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func;
+ retVal___ = preHookFunc(&dice_faces);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.roll(dice_faces);
+ }
+ if (HPMHooks.count.HP_rnd_roll_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, dice_faces);
+ }
+ }
+ return retVal___;
+}
+int32 HP_rnd_value(int32 min, int32 max) {
+ int hIndex = 0;
+ int32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_value_pre > 0) {
+ int32 (*preHookFunc) (int32 *min, int32 *max);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func;
+ retVal___ = preHookFunc(&min, &max);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.value(min, max);
+ }
+ if (HPMHooks.count.HP_rnd_value_post > 0) {
+ int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, min, max);
}
}
return retVal___;
}
-/* showmsg */
+double HP_rnd_uniform(void) {
+ int hIndex = 0;
+ double retVal___ = 0.;
+ if (HPMHooks.count.HP_rnd_uniform_pre > 0) {
+ double (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.uniform();
+ }
+ if (HPMHooks.count.HP_rnd_uniform_post > 0) {
+ double (*postHookFunc) (double retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+double HP_rnd_uniform53(void) {
+ int hIndex = 0;
+ double retVal___ = 0.;
+ if (HPMHooks.count.HP_rnd_uniform53_pre > 0) {
+ double (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.uniform53();
+ }
+ if (HPMHooks.count.HP_rnd_uniform53_post > 0) {
+ double (*postHookFunc) (double retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+/* showmsg_interface */
void HP_showmsg_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_init_pre ) {
+ if (HPMHooks.count.HP_showmsg_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15032,9 +16152,9 @@ void HP_showmsg_init(void) {
{
HPMHooks.source.showmsg.init();
}
- if( HPMHooks.count.HP_showmsg_init_post ) {
+ if (HPMHooks.count.HP_showmsg_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_init_post[hIndex].func;
postHookFunc();
}
@@ -15043,14 +16163,14 @@ void HP_showmsg_init(void) {
}
void HP_showmsg_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_final_pre ) {
+ if (HPMHooks.count.HP_showmsg_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15058,9 +16178,9 @@ void HP_showmsg_final(void) {
{
HPMHooks.source.showmsg.final();
}
- if( HPMHooks.count.HP_showmsg_final_post ) {
+ if (HPMHooks.count.HP_showmsg_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_final_post[hIndex].func;
postHookFunc();
}
@@ -15069,14 +16189,14 @@ void HP_showmsg_final(void) {
}
void HP_showmsg_clearScreen(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_clearScreen_pre ) {
+ if (HPMHooks.count.HP_showmsg_clearScreen_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_clearScreen_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15084,9 +16204,9 @@ void HP_showmsg_clearScreen(void) {
{
HPMHooks.source.showmsg.clearScreen();
}
- if( HPMHooks.count.HP_showmsg_clearScreen_post ) {
+ if (HPMHooks.count.HP_showmsg_clearScreen_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_clearScreen_post[hIndex].func;
postHookFunc();
}
@@ -15096,16 +16216,16 @@ void HP_showmsg_clearScreen(void) {
int HP_showmsg_showMessageV(const char *string, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_showmsg_showMessageV_pre ) {
- int (*preHookFunc) (const char *string, va_list ap);
+ if (HPMHooks.count.HP_showmsg_showMessageV_pre > 0) {
+ int (*preHookFunc) (const char **string, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_showmsg_showMessageV_pre[hIndex].func;
- retVal___ = preHookFunc(string, ap___copy);
+ retVal___ = preHookFunc(&string, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15115,9 +16235,9 @@ int HP_showmsg_showMessageV(const char *string, va_list ap) {
retVal___ = HPMHooks.source.showmsg.showMessageV(string, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_showmsg_showMessageV_post ) {
+ if (HPMHooks.count.HP_showmsg_showMessageV_post > 0) {
int (*postHookFunc) (int retVal___, const char *string, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_showmsg_showMessageV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, ap___copy);
@@ -15126,17 +16246,17 @@ int HP_showmsg_showMessageV(const char *string, va_list ap) {
}
return retVal___;
}
-/* sockt */
+/* socket_interface */
void HP_sockt_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_init_pre ) {
+ if (HPMHooks.count.HP_sockt_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15144,9 +16264,9 @@ void HP_sockt_init(void) {
{
HPMHooks.source.sockt.init();
}
- if( HPMHooks.count.HP_sockt_init_post ) {
+ if (HPMHooks.count.HP_sockt_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_init_post[hIndex].func;
postHookFunc();
}
@@ -15155,14 +16275,14 @@ void HP_sockt_init(void) {
}
void HP_sockt_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_final_pre ) {
+ if (HPMHooks.count.HP_sockt_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15170,9 +16290,9 @@ void HP_sockt_final(void) {
{
HPMHooks.source.sockt.final();
}
- if( HPMHooks.count.HP_sockt_final_post ) {
+ if (HPMHooks.count.HP_sockt_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_final_post[hIndex].func;
postHookFunc();
}
@@ -15182,14 +16302,14 @@ void HP_sockt_final(void) {
int HP_sockt_perform(int next) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_perform_pre ) {
+ if (HPMHooks.count.HP_sockt_perform_pre > 0) {
int (*preHookFunc) (int *next);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_perform_pre[hIndex].func;
retVal___ = preHookFunc(&next);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15197,25 +16317,25 @@ int HP_sockt_perform(int next) {
{
retVal___ = HPMHooks.source.sockt.perform(next);
}
- if( HPMHooks.count.HP_sockt_perform_post ) {
- int (*postHookFunc) (int retVal___, int *next);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_perform_post > 0) {
+ int (*postHookFunc) (int retVal___, int next);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_perform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &next);
+ retVal___ = postHookFunc(retVal___, next);
}
}
return retVal___;
}
void HP_sockt_datasync(int fd, bool send) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_datasync_pre ) {
+ if (HPMHooks.count.HP_sockt_datasync_pre > 0) {
void (*preHookFunc) (int *fd, bool *send);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_datasync_pre[hIndex].func;
preHookFunc(&fd, &send);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15223,11 +16343,11 @@ void HP_sockt_datasync(int fd, bool send) {
{
HPMHooks.source.sockt.datasync(fd, send);
}
- if( HPMHooks.count.HP_sockt_datasync_post ) {
- void (*postHookFunc) (int *fd, bool *send);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_datasync_post > 0) {
+ void (*postHookFunc) (int fd, bool send);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_datasync_post[hIndex].func;
- postHookFunc(&fd, &send);
+ postHookFunc(fd, send);
}
}
return;
@@ -15235,14 +16355,14 @@ void HP_sockt_datasync(int fd, bool send) {
int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_make_listen_bind_pre ) {
+ if (HPMHooks.count.HP_sockt_make_listen_bind_pre > 0) {
int (*preHookFunc) (uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_make_listen_bind_pre[hIndex].func;
retVal___ = preHookFunc(&ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15250,11 +16370,11 @@ int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
{
retVal___ = HPMHooks.source.sockt.make_listen_bind(ip, port);
}
- if( HPMHooks.count.HP_sockt_make_listen_bind_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_make_listen_bind_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_make_listen_bind_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, &port);
+ retVal___ = postHookFunc(retVal___, ip, port);
}
}
return retVal___;
@@ -15262,14 +16382,14 @@ int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_make_connection_pre ) {
- int (*preHookFunc) (uint32 *ip, uint16 *port, struct hSockOpt *opt);
+ if (HPMHooks.count.HP_sockt_make_connection_pre > 0) {
+ int (*preHookFunc) (uint32 *ip, uint16 *port, struct hSockOpt **opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_make_connection_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, &port, opt);
+ retVal___ = preHookFunc(&ip, &port, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15277,11 +16397,11 @@ int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
{
retVal___ = HPMHooks.source.sockt.make_connection(ip, port, opt);
}
- if( HPMHooks.count.HP_sockt_make_connection_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ip, uint16 *port, struct hSockOpt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_make_connection_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 ip, uint16 port, struct hSockOpt *opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_make_connection_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, &port, opt);
+ retVal___ = postHookFunc(retVal___, ip, port, opt);
}
}
return retVal___;
@@ -15289,14 +16409,14 @@ int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_realloc_fifo_pre ) {
+ if (HPMHooks.count.HP_sockt_realloc_fifo_pre > 0) {
int (*preHookFunc) (int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_realloc_fifo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &rfifo_size, &wfifo_size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15304,11 +16424,11 @@ int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_si
{
retVal___ = HPMHooks.source.sockt.realloc_fifo(fd, rfifo_size, wfifo_size);
}
- if( HPMHooks.count.HP_sockt_realloc_fifo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_realloc_fifo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, unsigned int rfifo_size, unsigned int wfifo_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_realloc_fifo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &rfifo_size, &wfifo_size);
+ retVal___ = postHookFunc(retVal___, fd, rfifo_size, wfifo_size);
}
}
return retVal___;
@@ -15316,14 +16436,14 @@ int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_si
int HP_sockt_realloc_writefifo(int fd, size_t addition) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_realloc_writefifo_pre ) {
+ if (HPMHooks.count.HP_sockt_realloc_writefifo_pre > 0) {
int (*preHookFunc) (int *fd, size_t *addition);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_realloc_writefifo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &addition);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15331,11 +16451,11 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
{
retVal___ = HPMHooks.source.sockt.realloc_writefifo(fd, addition);
}
- if( HPMHooks.count.HP_sockt_realloc_writefifo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *addition);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_realloc_writefifo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t addition);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_realloc_writefifo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &addition);
+ retVal___ = postHookFunc(retVal___, fd, addition);
}
}
return retVal___;
@@ -15343,14 +16463,14 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
int HP_sockt_wfifoset(int fd, size_t len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_wfifoset_pre ) {
+ if (HPMHooks.count.HP_sockt_wfifoset_pre > 0) {
int (*preHookFunc) (int *fd, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_wfifoset_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15358,11 +16478,11 @@ int HP_sockt_wfifoset(int fd, size_t len) {
{
retVal___ = HPMHooks.source.sockt.wfifoset(fd, len);
}
- if( HPMHooks.count.HP_sockt_wfifoset_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_wfifoset_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_wfifoset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len);
+ retVal___ = postHookFunc(retVal___, fd, len);
}
}
return retVal___;
@@ -15370,14 +16490,14 @@ int HP_sockt_wfifoset(int fd, size_t len) {
int HP_sockt_rfifoskip(int fd, size_t len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_rfifoskip_pre ) {
+ if (HPMHooks.count.HP_sockt_rfifoskip_pre > 0) {
int (*preHookFunc) (int *fd, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_rfifoskip_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15385,25 +16505,25 @@ int HP_sockt_rfifoskip(int fd, size_t len) {
{
retVal___ = HPMHooks.source.sockt.rfifoskip(fd, len);
}
- if( HPMHooks.count.HP_sockt_rfifoskip_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_rfifoskip_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_rfifoskip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len);
+ retVal___ = postHookFunc(retVal___, fd, len);
}
}
return retVal___;
}
void HP_sockt_close(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_close_pre ) {
+ if (HPMHooks.count.HP_sockt_close_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_close_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15411,11 +16531,11 @@ void HP_sockt_close(int fd) {
{
HPMHooks.source.sockt.close(fd);
}
- if( HPMHooks.count.HP_sockt_close_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_close_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_close_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -15423,14 +16543,14 @@ void HP_sockt_close(int fd) {
bool HP_sockt_session_is_valid(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_session_is_valid_pre ) {
+ if (HPMHooks.count.HP_sockt_session_is_valid_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_session_is_valid_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15438,11 +16558,11 @@ bool HP_sockt_session_is_valid(int fd) {
{
retVal___ = HPMHooks.source.sockt.session_is_valid(fd);
}
- if( HPMHooks.count.HP_sockt_session_is_valid_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_session_is_valid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_session_is_valid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -15450,14 +16570,14 @@ bool HP_sockt_session_is_valid(int fd) {
bool HP_sockt_session_is_active(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_session_is_active_pre ) {
+ if (HPMHooks.count.HP_sockt_session_is_active_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_session_is_active_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15465,25 +16585,25 @@ bool HP_sockt_session_is_active(int fd) {
{
retVal___ = HPMHooks.source.sockt.session_is_active(fd);
}
- if( HPMHooks.count.HP_sockt_session_is_active_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_session_is_active_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_session_is_active_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_sockt_flush(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_flush_pre ) {
+ if (HPMHooks.count.HP_sockt_flush_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_flush_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15491,25 +16611,25 @@ void HP_sockt_flush(int fd) {
{
HPMHooks.source.sockt.flush(fd);
}
- if( HPMHooks.count.HP_sockt_flush_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_flush_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_flush_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_sockt_flush_fifos(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_flush_fifos_pre ) {
+ if (HPMHooks.count.HP_sockt_flush_fifos_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_flush_fifos_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15517,9 +16637,9 @@ void HP_sockt_flush_fifos(void) {
{
HPMHooks.source.sockt.flush_fifos();
}
- if( HPMHooks.count.HP_sockt_flush_fifos_post ) {
+ if (HPMHooks.count.HP_sockt_flush_fifos_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_flush_fifos_post[hIndex].func;
postHookFunc();
}
@@ -15528,14 +16648,14 @@ void HP_sockt_flush_fifos(void) {
}
void HP_sockt_set_nonblocking(int fd, unsigned long yes) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_set_nonblocking_pre ) {
+ if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) {
void (*preHookFunc) (int *fd, unsigned long *yes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_set_nonblocking_pre[hIndex].func;
preHookFunc(&fd, &yes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15543,25 +16663,25 @@ void HP_sockt_set_nonblocking(int fd, unsigned long yes) {
{
HPMHooks.source.sockt.set_nonblocking(fd, yes);
}
- if( HPMHooks.count.HP_sockt_set_nonblocking_post ) {
- void (*postHookFunc) (int *fd, unsigned long *yes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_set_nonblocking_post > 0) {
+ void (*postHookFunc) (int fd, unsigned long yes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_set_nonblocking_post[hIndex].func;
- postHookFunc(&fd, &yes);
+ postHookFunc(fd, yes);
}
}
return;
}
void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_set_defaultparse_pre ) {
+ if (HPMHooks.count.HP_sockt_set_defaultparse_pre > 0) {
void (*preHookFunc) (ParseFunc *defaultparse);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_set_defaultparse_pre[hIndex].func;
preHookFunc(&defaultparse);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15569,11 +16689,11 @@ void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
{
HPMHooks.source.sockt.set_defaultparse(defaultparse);
}
- if( HPMHooks.count.HP_sockt_set_defaultparse_post ) {
- void (*postHookFunc) (ParseFunc *defaultparse);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_set_defaultparse_post > 0) {
+ void (*postHookFunc) (ParseFunc defaultparse);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_set_defaultparse_post[hIndex].func;
- postHookFunc(&defaultparse);
+ postHookFunc(defaultparse);
}
}
return;
@@ -15581,14 +16701,14 @@ void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
uint32 HP_sockt_host2ip(const char *hostname) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_host2ip_pre ) {
- uint32 (*preHookFunc) (const char *hostname);
+ if (HPMHooks.count.HP_sockt_host2ip_pre > 0) {
+ uint32 (*preHookFunc) (const char **hostname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_host2ip_pre[hIndex].func;
- retVal___ = preHookFunc(hostname);
+ retVal___ = preHookFunc(&hostname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15596,9 +16716,9 @@ uint32 HP_sockt_host2ip(const char *hostname) {
{
retVal___ = HPMHooks.source.sockt.host2ip(hostname);
}
- if( HPMHooks.count.HP_sockt_host2ip_post ) {
+ if (HPMHooks.count.HP_sockt_host2ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___, const char *hostname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_host2ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hostname);
}
@@ -15608,14 +16728,14 @@ uint32 HP_sockt_host2ip(const char *hostname) {
const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sockt_ip2str_pre ) {
- const char* (*preHookFunc) (uint32 *ip, char *ip_str);
+ if (HPMHooks.count.HP_sockt_ip2str_pre > 0) {
+ const char* (*preHookFunc) (uint32 *ip, char **ip_str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_ip2str_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, ip_str);
+ retVal___ = preHookFunc(&ip, &ip_str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15623,11 +16743,11 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
{
retVal___ = HPMHooks.source.sockt.ip2str(ip, ip_str);
}
- if( HPMHooks.count.HP_sockt_ip2str_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint32 *ip, char *ip_str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_ip2str_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint32 ip, char *ip_str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_ip2str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, ip_str);
+ retVal___ = postHookFunc(retVal___, ip, ip_str);
}
}
return retVal___;
@@ -15635,14 +16755,14 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
uint32 HP_sockt_str2ip(const char *ip_str) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_str2ip_pre ) {
- uint32 (*preHookFunc) (const char *ip_str);
+ if (HPMHooks.count.HP_sockt_str2ip_pre > 0) {
+ uint32 (*preHookFunc) (const char **ip_str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_str2ip_pre[hIndex].func;
- retVal___ = preHookFunc(ip_str);
+ retVal___ = preHookFunc(&ip_str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15650,9 +16770,9 @@ uint32 HP_sockt_str2ip(const char *ip_str) {
{
retVal___ = HPMHooks.source.sockt.str2ip(ip_str);
}
- if( HPMHooks.count.HP_sockt_str2ip_post ) {
+ if (HPMHooks.count.HP_sockt_str2ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___, const char *ip_str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_str2ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ip_str);
}
@@ -15662,14 +16782,14 @@ uint32 HP_sockt_str2ip(const char *ip_str) {
uint16 HP_sockt_ntows(uint16 netshort) {
int hIndex = 0;
uint16 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_ntows_pre ) {
+ if (HPMHooks.count.HP_sockt_ntows_pre > 0) {
uint16 (*preHookFunc) (uint16 *netshort);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_ntows_pre[hIndex].func;
retVal___ = preHookFunc(&netshort);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15677,11 +16797,11 @@ uint16 HP_sockt_ntows(uint16 netshort) {
{
retVal___ = HPMHooks.source.sockt.ntows(netshort);
}
- if( HPMHooks.count.HP_sockt_ntows_post ) {
- uint16 (*postHookFunc) (uint16 retVal___, uint16 *netshort);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_ntows_post > 0) {
+ uint16 (*postHookFunc) (uint16 retVal___, uint16 netshort);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_ntows_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &netshort);
+ retVal___ = postHookFunc(retVal___, netshort);
}
}
return retVal___;
@@ -15689,14 +16809,14 @@ uint16 HP_sockt_ntows(uint16 netshort) {
int HP_sockt_getips(uint32 *ips, int max) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_getips_pre ) {
- int (*preHookFunc) (uint32 *ips, int *max);
+ if (HPMHooks.count.HP_sockt_getips_pre > 0) {
+ int (*preHookFunc) (uint32 **ips, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_getips_pre[hIndex].func;
- retVal___ = preHookFunc(ips, &max);
+ retVal___ = preHookFunc(&ips, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15704,25 +16824,25 @@ int HP_sockt_getips(uint32 *ips, int max) {
{
retVal___ = HPMHooks.source.sockt.getips(ips, max);
}
- if( HPMHooks.count.HP_sockt_getips_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ips, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_getips_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 *ips, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_getips_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ips, &max);
+ retVal___ = postHookFunc(retVal___, ips, max);
}
}
return retVal___;
}
void HP_sockt_eof(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_eof_pre ) {
+ if (HPMHooks.count.HP_sockt_eof_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_eof_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15730,11 +16850,11 @@ void HP_sockt_eof(int fd) {
{
HPMHooks.source.sockt.eof(fd);
}
- if( HPMHooks.count.HP_sockt_eof_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_eof_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_eof_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -15742,14 +16862,14 @@ void HP_sockt_eof(int fd) {
uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_lan_subnet_check_pre ) {
- uint32 (*preHookFunc) (uint32 *ip, struct s_subnet *info);
+ if (HPMHooks.count.HP_sockt_lan_subnet_check_pre > 0) {
+ uint32 (*preHookFunc) (uint32 *ip, struct s_subnet **info);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_lan_subnet_check_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, info);
+ retVal___ = preHookFunc(&ip, &info);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15757,11 +16877,11 @@ uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
{
retVal___ = HPMHooks.source.sockt.lan_subnet_check(ip, info);
}
- if( HPMHooks.count.HP_sockt_lan_subnet_check_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip, struct s_subnet *info);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_lan_subnet_check_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 ip, struct s_subnet *info);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_lan_subnet_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, info);
+ retVal___ = postHookFunc(retVal___, ip, info);
}
}
return retVal___;
@@ -15769,14 +16889,14 @@ uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
bool HP_sockt_allowed_ip_check(uint32 ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_allowed_ip_check_pre ) {
+ if (HPMHooks.count.HP_sockt_allowed_ip_check_pre > 0) {
bool (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_allowed_ip_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15784,11 +16904,11 @@ bool HP_sockt_allowed_ip_check(uint32 ip) {
{
retVal___ = HPMHooks.source.sockt.allowed_ip_check(ip);
}
- if( HPMHooks.count.HP_sockt_allowed_ip_check_post ) {
- bool (*postHookFunc) (bool retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_allowed_ip_check_post > 0) {
+ bool (*postHookFunc) (bool retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_allowed_ip_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
@@ -15796,14 +16916,14 @@ bool HP_sockt_allowed_ip_check(uint32 ip) {
bool HP_sockt_trusted_ip_check(uint32 ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_trusted_ip_check_pre ) {
+ if (HPMHooks.count.HP_sockt_trusted_ip_check_pre > 0) {
bool (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_trusted_ip_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15811,26 +16931,26 @@ bool HP_sockt_trusted_ip_check(uint32 ip) {
{
retVal___ = HPMHooks.source.sockt.trusted_ip_check(ip);
}
- if( HPMHooks.count.HP_sockt_trusted_ip_check_post ) {
- bool (*postHookFunc) (bool retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_trusted_ip_check_post > 0) {
+ bool (*postHookFunc) (bool retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_trusted_ip_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
}
-int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname) {
+int HP_sockt_net_config_read_sub(struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_net_config_read_sub_pre ) {
- int (*preHookFunc) (config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ if (HPMHooks.count.HP_sockt_net_config_read_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **t, struct s_subnet_vector **list, const char **filename, const char **groupname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_net_config_read_sub_pre[hIndex].func;
- retVal___ = preHookFunc(t, list, filename, groupname);
+ retVal___ = preHookFunc(&t, &list, &filename, &groupname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15838,9 +16958,9 @@ int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *li
{
retVal___ = HPMHooks.source.sockt.net_config_read_sub(t, list, filename, groupname);
}
- if( HPMHooks.count.HP_sockt_net_config_read_sub_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_net_config_read_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_net_config_read_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, t, list, filename, groupname);
}
@@ -15849,14 +16969,14 @@ int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *li
}
void HP_sockt_net_config_read(const char *filename) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_net_config_read_pre ) {
- void (*preHookFunc) (const char *filename);
+ if (HPMHooks.count.HP_sockt_net_config_read_pre > 0) {
+ void (*preHookFunc) (const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_net_config_read_pre[hIndex].func;
- preHookFunc(filename);
+ preHookFunc(&filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15864,27 +16984,27 @@ void HP_sockt_net_config_read(const char *filename) {
{
HPMHooks.source.sockt.net_config_read(filename);
}
- if( HPMHooks.count.HP_sockt_net_config_read_post ) {
+ if (HPMHooks.count.HP_sockt_net_config_read_post > 0) {
void (*postHookFunc) (const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_net_config_read_post[hIndex].func;
postHookFunc(filename);
}
}
return;
}
-/* SQL */
-int HP_SQL_Connect(Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db) {
+/* sql_interface */
+int HP_SQL_Connect(struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_Connect_pre ) {
- int (*preHookFunc) (Sql *self, const char *user, const char *passwd, const char *host, uint16 *port, const char *db);
+ if (HPMHooks.count.HP_SQL_Connect_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **user, const char **passwd, const char **host, uint16 *port, const char **db);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Connect_pre[hIndex].func;
- retVal___ = preHookFunc(self, user, passwd, host, &port, db);
+ retVal___ = preHookFunc(&self, &user, &passwd, &host, &port, &db);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15892,26 +17012,26 @@ int HP_SQL_Connect(Sql *self, const char *user, const char *passwd, const char *
{
retVal___ = HPMHooks.source.SQL.Connect(self, user, passwd, host, port, db);
}
- if( HPMHooks.count.HP_SQL_Connect_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *user, const char *passwd, const char *host, uint16 *port, const char *db);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Connect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Connect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, user, passwd, host, &port, db);
+ retVal___ = postHookFunc(retVal___, self, user, passwd, host, port, db);
}
}
return retVal___;
}
-int HP_SQL_GetTimeout(Sql *self, uint32 *out_timeout) {
+int HP_SQL_GetTimeout(struct Sql *self, uint32 *out_timeout) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetTimeout_pre ) {
- int (*preHookFunc) (Sql *self, uint32 *out_timeout);
+ if (HPMHooks.count.HP_SQL_GetTimeout_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, uint32 **out_timeout);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetTimeout_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_timeout);
+ retVal___ = preHookFunc(&self, &out_timeout);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15919,26 +17039,26 @@ int HP_SQL_GetTimeout(Sql *self, uint32 *out_timeout) {
{
retVal___ = HPMHooks.source.SQL.GetTimeout(self, out_timeout);
}
- if( HPMHooks.count.HP_SQL_GetTimeout_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, uint32 *out_timeout);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetTimeout_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, uint32 *out_timeout);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetTimeout_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, out_timeout);
}
}
return retVal___;
}
-int HP_SQL_GetColumnNames(Sql *self, const char *table, char *out_buf, size_t buf_len, char sep) {
+int HP_SQL_GetColumnNames(struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetColumnNames_pre ) {
- int (*preHookFunc) (Sql *self, const char *table, char *out_buf, size_t *buf_len, char *sep);
+ if (HPMHooks.count.HP_SQL_GetColumnNames_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **table, char **out_buf, size_t *buf_len, char *sep);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetColumnNames_pre[hIndex].func;
- retVal___ = preHookFunc(self, table, out_buf, &buf_len, &sep);
+ retVal___ = preHookFunc(&self, &table, &out_buf, &buf_len, &sep);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15946,26 +17066,26 @@ int HP_SQL_GetColumnNames(Sql *self, const char *table, char *out_buf, size_t bu
{
retVal___ = HPMHooks.source.SQL.GetColumnNames(self, table, out_buf, buf_len, sep);
}
- if( HPMHooks.count.HP_SQL_GetColumnNames_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *table, char *out_buf, size_t *buf_len, char *sep);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetColumnNames_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetColumnNames_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, table, out_buf, &buf_len, &sep);
+ retVal___ = postHookFunc(retVal___, self, table, out_buf, buf_len, sep);
}
}
return retVal___;
}
-int HP_SQL_SetEncoding(Sql *self, const char *encoding) {
+int HP_SQL_SetEncoding(struct Sql *self, const char *encoding) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_SetEncoding_pre ) {
- int (*preHookFunc) (Sql *self, const char *encoding);
+ if (HPMHooks.count.HP_SQL_SetEncoding_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **encoding);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_SetEncoding_pre[hIndex].func;
- retVal___ = preHookFunc(self, encoding);
+ retVal___ = preHookFunc(&self, &encoding);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15973,26 +17093,26 @@ int HP_SQL_SetEncoding(Sql *self, const char *encoding) {
{
retVal___ = HPMHooks.source.SQL.SetEncoding(self, encoding);
}
- if( HPMHooks.count.HP_SQL_SetEncoding_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *encoding);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_SetEncoding_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *encoding);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_SetEncoding_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, encoding);
}
}
return retVal___;
}
-int HP_SQL_Ping(Sql *self) {
+int HP_SQL_Ping(struct Sql *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_Ping_pre ) {
- int (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_Ping_pre > 0) {
+ int (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Ping_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16000,26 +17120,26 @@ int HP_SQL_Ping(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.Ping(self);
}
- if( HPMHooks.count.HP_SQL_Ping_post ) {
- int (*postHookFunc) (int retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Ping_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Ping_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-size_t HP_SQL_EscapeString(Sql *self, char *out_to, const char *from) {
+size_t HP_SQL_EscapeString(struct Sql *self, char *out_to, const char *from) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_EscapeString_pre ) {
- size_t (*preHookFunc) (Sql *self, char *out_to, const char *from);
+ if (HPMHooks.count.HP_SQL_EscapeString_pre > 0) {
+ size_t (*preHookFunc) (struct Sql **self, char **out_to, const char **from);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_EscapeString_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_to, from);
+ retVal___ = preHookFunc(&self, &out_to, &from);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16027,26 +17147,26 @@ size_t HP_SQL_EscapeString(Sql *self, char *out_to, const char *from) {
{
retVal___ = HPMHooks.source.SQL.EscapeString(self, out_to, from);
}
- if( HPMHooks.count.HP_SQL_EscapeString_post ) {
- size_t (*postHookFunc) (size_t retVal___, Sql *self, char *out_to, const char *from);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_EscapeString_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct Sql *self, char *out_to, const char *from);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_EscapeString_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, out_to, from);
}
}
return retVal___;
}
-size_t HP_SQL_EscapeStringLen(Sql *self, char *out_to, const char *from, size_t from_len) {
+size_t HP_SQL_EscapeStringLen(struct Sql *self, char *out_to, const char *from, size_t from_len) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_EscapeStringLen_pre ) {
- size_t (*preHookFunc) (Sql *self, char *out_to, const char *from, size_t *from_len);
+ if (HPMHooks.count.HP_SQL_EscapeStringLen_pre > 0) {
+ size_t (*preHookFunc) (struct Sql **self, char **out_to, const char **from, size_t *from_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_EscapeStringLen_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_to, from, &from_len);
+ retVal___ = preHookFunc(&self, &out_to, &from, &from_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16054,28 +17174,28 @@ size_t HP_SQL_EscapeStringLen(Sql *self, char *out_to, const char *from, size_t
{
retVal___ = HPMHooks.source.SQL.EscapeStringLen(self, out_to, from, from_len);
}
- if( HPMHooks.count.HP_SQL_EscapeStringLen_post ) {
- size_t (*postHookFunc) (size_t retVal___, Sql *self, char *out_to, const char *from, size_t *from_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_EscapeStringLen_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct Sql *self, char *out_to, const char *from, size_t from_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_EscapeStringLen_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, out_to, from, &from_len);
+ retVal___ = postHookFunc(retVal___, self, out_to, from, from_len);
}
}
return retVal___;
}
-int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
+int HP_SQL_QueryV(struct Sql *self, const char *query, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_QueryV_pre ) {
- int (*preHookFunc) (Sql *self, const char *query, va_list args);
+ if (HPMHooks.count.HP_SQL_QueryV_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **query, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_SQL_QueryV_pre[hIndex].func;
- retVal___ = preHookFunc(self, query, args___copy);
+ retVal___ = preHookFunc(&self, &query, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16085,9 +17205,9 @@ int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
retVal___ = HPMHooks.source.SQL.QueryV(self, query, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_SQL_QueryV_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *query, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_QueryV_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *query, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_SQL_QueryV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query, args___copy);
@@ -16096,17 +17216,17 @@ int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
}
return retVal___;
}
-int HP_SQL_QueryStr(Sql *self, const char *query) {
+int HP_SQL_QueryStr(struct Sql *self, const char *query) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_QueryStr_pre ) {
- int (*preHookFunc) (Sql *self, const char *query);
+ if (HPMHooks.count.HP_SQL_QueryStr_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_QueryStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, query);
+ retVal___ = preHookFunc(&self, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16114,26 +17234,26 @@ int HP_SQL_QueryStr(Sql *self, const char *query) {
{
retVal___ = HPMHooks.source.SQL.QueryStr(self, query);
}
- if( HPMHooks.count.HP_SQL_QueryStr_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_QueryStr_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_QueryStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query);
}
}
return retVal___;
}
-uint64 HP_SQL_LastInsertId(Sql *self) {
+uint64 HP_SQL_LastInsertId(struct Sql *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_LastInsertId_pre ) {
- uint64 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_LastInsertId_pre > 0) {
+ uint64 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_LastInsertId_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16141,26 +17261,26 @@ uint64 HP_SQL_LastInsertId(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.LastInsertId(self);
}
- if( HPMHooks.count.HP_SQL_LastInsertId_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_LastInsertId_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_LastInsertId_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint32 HP_SQL_NumColumns(Sql *self) {
+uint32 HP_SQL_NumColumns(struct Sql *self) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NumColumns_pre ) {
- uint32 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NumColumns_pre > 0) {
+ uint32 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NumColumns_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16168,26 +17288,26 @@ uint32 HP_SQL_NumColumns(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NumColumns(self);
}
- if( HPMHooks.count.HP_SQL_NumColumns_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NumColumns_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NumColumns_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint64 HP_SQL_NumRows(Sql *self) {
+uint64 HP_SQL_NumRows(struct Sql *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NumRows_pre ) {
- uint64 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NumRows_pre > 0) {
+ uint64 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NumRows_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16195,26 +17315,26 @@ uint64 HP_SQL_NumRows(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NumRows(self);
}
- if( HPMHooks.count.HP_SQL_NumRows_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NumRows_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NumRows_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_NextRow(Sql *self) {
+int HP_SQL_NextRow(struct Sql *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NextRow_pre ) {
- int (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NextRow_pre > 0) {
+ int (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NextRow_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16222,26 +17342,26 @@ int HP_SQL_NextRow(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NextRow(self);
}
- if( HPMHooks.count.HP_SQL_NextRow_post ) {
- int (*postHookFunc) (int retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NextRow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NextRow_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_GetData(Sql *self, size_t col, char **out_buf, size_t *out_len) {
+int HP_SQL_GetData(struct Sql *self, size_t col, char **out_buf, size_t *out_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetData_pre ) {
- int (*preHookFunc) (Sql *self, size_t *col, char **out_buf, size_t *out_len);
+ if (HPMHooks.count.HP_SQL_GetData_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, size_t *col, char ***out_buf, size_t **out_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetData_pre[hIndex].func;
- retVal___ = preHookFunc(self, &col, out_buf, out_len);
+ retVal___ = preHookFunc(&self, &col, &out_buf, &out_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16249,25 +17369,25 @@ int HP_SQL_GetData(Sql *self, size_t col, char **out_buf, size_t *out_len) {
{
retVal___ = HPMHooks.source.SQL.GetData(self, col, out_buf, out_len);
}
- if( HPMHooks.count.HP_SQL_GetData_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, size_t *col, char **out_buf, size_t *out_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetData_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, size_t col, char **out_buf, size_t *out_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetData_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &col, out_buf, out_len);
+ retVal___ = postHookFunc(retVal___, self, col, out_buf, out_len);
}
}
return retVal___;
}
-void HP_SQL_FreeResult(Sql *self) {
+void HP_SQL_FreeResult(struct Sql *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_FreeResult_pre ) {
- void (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_FreeResult_pre > 0) {
+ void (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_FreeResult_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16275,25 +17395,25 @@ void HP_SQL_FreeResult(Sql *self) {
{
HPMHooks.source.SQL.FreeResult(self);
}
- if( HPMHooks.count.HP_SQL_FreeResult_post ) {
- void (*postHookFunc) (Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_FreeResult_post > 0) {
+ void (*postHookFunc) (struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_FreeResult_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_ShowDebug_(Sql *self, const char *debug_file, const unsigned long debug_line) {
+void HP_SQL_ShowDebug_(struct Sql *self, const char *debug_file, const unsigned long debug_line) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_ShowDebug__pre ) {
- void (*preHookFunc) (Sql *self, const char *debug_file, const unsigned long *debug_line);
+ if (HPMHooks.count.HP_SQL_ShowDebug__pre > 0) {
+ void (*preHookFunc) (struct Sql **self, const char **debug_file, const unsigned long *debug_line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_ShowDebug__pre[hIndex].func;
- preHookFunc(self, debug_file, &debug_line);
+ preHookFunc(&self, &debug_file, &debug_line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16301,25 +17421,25 @@ void HP_SQL_ShowDebug_(Sql *self, const char *debug_file, const unsigned long de
{
HPMHooks.source.SQL.ShowDebug_(self, debug_file, debug_line);
}
- if( HPMHooks.count.HP_SQL_ShowDebug__post ) {
- void (*postHookFunc) (Sql *self, const char *debug_file, const unsigned long *debug_line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_ShowDebug__post > 0) {
+ void (*postHookFunc) (struct Sql *self, const char *debug_file, const unsigned long debug_line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_ShowDebug__post[hIndex].func;
- postHookFunc(self, debug_file, &debug_line);
+ postHookFunc(self, debug_file, debug_line);
}
}
return;
}
-void HP_SQL_Free(Sql *self) {
+void HP_SQL_Free(struct Sql *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_Free_pre ) {
- void (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_Free_pre > 0) {
+ void (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Free_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16327,9 +17447,9 @@ void HP_SQL_Free(Sql *self) {
{
HPMHooks.source.SQL.Free(self);
}
- if( HPMHooks.count.HP_SQL_Free_post ) {
- void (*postHookFunc) (Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Free_post > 0) {
+ void (*postHookFunc) (struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Free_post[hIndex].func;
postHookFunc(self);
}
@@ -16339,14 +17459,14 @@ void HP_SQL_Free(Sql *self) {
struct Sql* HP_SQL_Malloc(void) {
int hIndex = 0;
struct Sql* retVal___ = NULL;
- if( HPMHooks.count.HP_SQL_Malloc_pre ) {
+ if (HPMHooks.count.HP_SQL_Malloc_pre > 0) {
struct Sql* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Malloc_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16354,26 +17474,26 @@ struct Sql* HP_SQL_Malloc(void) {
{
retVal___ = HPMHooks.source.SQL.Malloc();
}
- if( HPMHooks.count.HP_SQL_Malloc_post ) {
+ if (HPMHooks.count.HP_SQL_Malloc_post > 0) {
struct Sql* (*postHookFunc) (struct Sql* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Malloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-struct SqlStmt* HP_SQL_StmtMalloc(Sql *sql) {
+struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) {
int hIndex = 0;
struct SqlStmt* retVal___ = NULL;
- if( HPMHooks.count.HP_SQL_StmtMalloc_pre ) {
- struct SqlStmt* (*preHookFunc) (Sql *sql);
+ if (HPMHooks.count.HP_SQL_StmtMalloc_pre > 0) {
+ struct SqlStmt* (*preHookFunc) (struct Sql **sql);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_pre[hIndex].func;
- retVal___ = preHookFunc(sql);
+ retVal___ = preHookFunc(&sql);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16381,28 +17501,28 @@ struct SqlStmt* HP_SQL_StmtMalloc(Sql *sql) {
{
retVal___ = HPMHooks.source.SQL.StmtMalloc(sql);
}
- if( HPMHooks.count.HP_SQL_StmtMalloc_post ) {
- struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, Sql *sql);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtMalloc_post > 0) {
+ struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, struct Sql *sql);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sql);
}
}
return retVal___;
}
-int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
+int HP_SQL_StmtPrepareV(struct SqlStmt *self, const char *query, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtPrepareV_pre ) {
- int (*preHookFunc) (SqlStmt *self, const char *query, va_list args);
+ if (HPMHooks.count.HP_SQL_StmtPrepareV_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, const char **query, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_SQL_StmtPrepareV_pre[hIndex].func;
- retVal___ = preHookFunc(self, query, args___copy);
+ retVal___ = preHookFunc(&self, &query, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16412,9 +17532,9 @@ int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
retVal___ = HPMHooks.source.SQL.StmtPrepareV(self, query, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_SQL_StmtPrepareV_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, const char *query, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtPrepareV_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, const char *query, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_SQL_StmtPrepareV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query, args___copy);
@@ -16423,17 +17543,17 @@ int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
}
return retVal___;
}
-int HP_SQL_StmtPrepareStr(SqlStmt *self, const char *query) {
+int HP_SQL_StmtPrepareStr(struct SqlStmt *self, const char *query) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtPrepareStr_pre ) {
- int (*preHookFunc) (SqlStmt *self, const char *query);
+ if (HPMHooks.count.HP_SQL_StmtPrepareStr_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, const char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtPrepareStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, query);
+ retVal___ = preHookFunc(&self, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16441,26 +17561,26 @@ int HP_SQL_StmtPrepareStr(SqlStmt *self, const char *query) {
{
retVal___ = HPMHooks.source.SQL.StmtPrepareStr(self, query);
}
- if( HPMHooks.count.HP_SQL_StmtPrepareStr_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, const char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtPrepareStr_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, const char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtPrepareStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query);
}
}
return retVal___;
}
-size_t HP_SQL_StmtNumParams(SqlStmt *self) {
+size_t HP_SQL_StmtNumParams(struct SqlStmt *self) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumParams_pre ) {
- size_t (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumParams_pre > 0) {
+ size_t (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumParams_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16468,26 +17588,26 @@ size_t HP_SQL_StmtNumParams(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumParams(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumParams_post ) {
- size_t (*postHookFunc) (size_t retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumParams_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumParams_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtBindParam(SqlStmt *self, size_t idx, SqlDataType buffer_type, void *buffer, size_t buffer_len) {
+int HP_SQL_StmtBindParam(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtBindParam_pre ) {
- int (*preHookFunc) (SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len);
+ if (HPMHooks.count.HP_SQL_StmtBindParam_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, const void **buffer, size_t *buffer_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtBindParam_pre[hIndex].func;
- retVal___ = preHookFunc(self, &idx, &buffer_type, buffer, &buffer_len);
+ retVal___ = preHookFunc(&self, &idx, &buffer_type, &buffer, &buffer_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16495,26 +17615,26 @@ int HP_SQL_StmtBindParam(SqlStmt *self, size_t idx, SqlDataType buffer_type, voi
{
retVal___ = HPMHooks.source.SQL.StmtBindParam(self, idx, buffer_type, buffer, buffer_len);
}
- if( HPMHooks.count.HP_SQL_StmtBindParam_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtBindParam_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtBindParam_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &idx, &buffer_type, buffer, &buffer_len);
+ retVal___ = postHookFunc(retVal___, self, idx, buffer_type, buffer, buffer_len);
}
}
return retVal___;
}
-int HP_SQL_StmtExecute(SqlStmt *self) {
+int HP_SQL_StmtExecute(struct SqlStmt *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtExecute_pre ) {
- int (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtExecute_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtExecute_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16522,26 +17642,26 @@ int HP_SQL_StmtExecute(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtExecute(self);
}
- if( HPMHooks.count.HP_SQL_StmtExecute_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtExecute_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtExecute_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint64 HP_SQL_StmtLastInsertId(SqlStmt *self) {
+uint64 HP_SQL_StmtLastInsertId(struct SqlStmt *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtLastInsertId_pre ) {
- uint64 (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtLastInsertId_pre > 0) {
+ uint64 (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtLastInsertId_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16549,26 +17669,26 @@ uint64 HP_SQL_StmtLastInsertId(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtLastInsertId(self);
}
- if( HPMHooks.count.HP_SQL_StmtLastInsertId_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtLastInsertId_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtLastInsertId_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-size_t HP_SQL_StmtNumColumns(SqlStmt *self) {
+size_t HP_SQL_StmtNumColumns(struct SqlStmt *self) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumColumns_pre ) {
- size_t (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumColumns_pre > 0) {
+ size_t (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumColumns_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16576,26 +17696,26 @@ size_t HP_SQL_StmtNumColumns(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumColumns(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumColumns_post ) {
- size_t (*postHookFunc) (size_t retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumColumns_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumColumns_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtBindColumn(SqlStmt *self, size_t idx, SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
+int HP_SQL_StmtBindColumn(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtBindColumn_pre ) {
- int (*preHookFunc) (SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len, uint32 *out_length, int8 *out_is_null);
+ if (HPMHooks.count.HP_SQL_StmtBindColumn_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, void **buffer, size_t *buffer_len, uint32 **out_length, int8 **out_is_null);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtBindColumn_pre[hIndex].func;
- retVal___ = preHookFunc(self, &idx, &buffer_type, buffer, &buffer_len, out_length, out_is_null);
+ retVal___ = preHookFunc(&self, &idx, &buffer_type, &buffer, &buffer_len, &out_length, &out_is_null);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16603,26 +17723,26 @@ int HP_SQL_StmtBindColumn(SqlStmt *self, size_t idx, SqlDataType buffer_type, vo
{
retVal___ = HPMHooks.source.SQL.StmtBindColumn(self, idx, buffer_type, buffer, buffer_len, out_length, out_is_null);
}
- if( HPMHooks.count.HP_SQL_StmtBindColumn_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len, uint32 *out_length, int8 *out_is_null);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtBindColumn_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtBindColumn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &idx, &buffer_type, buffer, &buffer_len, out_length, out_is_null);
+ retVal___ = postHookFunc(retVal___, self, idx, buffer_type, buffer, buffer_len, out_length, out_is_null);
}
}
return retVal___;
}
-uint64 HP_SQL_StmtNumRows(SqlStmt *self) {
+uint64 HP_SQL_StmtNumRows(struct SqlStmt *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumRows_pre ) {
- uint64 (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumRows_pre > 0) {
+ uint64 (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumRows_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16630,26 +17750,26 @@ uint64 HP_SQL_StmtNumRows(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumRows(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumRows_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumRows_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumRows_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtNextRow(SqlStmt *self) {
+int HP_SQL_StmtNextRow(struct SqlStmt *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNextRow_pre ) {
- int (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNextRow_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNextRow_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16657,25 +17777,25 @@ int HP_SQL_StmtNextRow(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNextRow(self);
}
- if( HPMHooks.count.HP_SQL_StmtNextRow_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNextRow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNextRow_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-void HP_SQL_StmtFreeResult(SqlStmt *self) {
+void HP_SQL_StmtFreeResult(struct SqlStmt *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtFreeResult_pre ) {
- void (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtFreeResult_pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtFreeResult_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16683,25 +17803,25 @@ void HP_SQL_StmtFreeResult(SqlStmt *self) {
{
HPMHooks.source.SQL.StmtFreeResult(self);
}
- if( HPMHooks.count.HP_SQL_StmtFreeResult_post ) {
- void (*postHookFunc) (SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtFreeResult_post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtFreeResult_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_StmtFree(SqlStmt *self) {
+void HP_SQL_StmtFree(struct SqlStmt *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtFree_pre ) {
- void (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtFree_pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtFree_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16709,25 +17829,25 @@ void HP_SQL_StmtFree(SqlStmt *self) {
{
HPMHooks.source.SQL.StmtFree(self);
}
- if( HPMHooks.count.HP_SQL_StmtFree_post ) {
- void (*postHookFunc) (SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtFree_post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtFree_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_StmtShowDebug_(SqlStmt *self, const char *debug_file, const unsigned long debug_line) {
+void HP_SQL_StmtShowDebug_(struct SqlStmt *self, const char *debug_file, const unsigned long debug_line) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtShowDebug__pre ) {
- void (*preHookFunc) (SqlStmt *self, const char *debug_file, const unsigned long *debug_line);
+ if (HPMHooks.count.HP_SQL_StmtShowDebug__pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self, const char **debug_file, const unsigned long *debug_line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtShowDebug__pre[hIndex].func;
- preHookFunc(self, debug_file, &debug_line);
+ preHookFunc(&self, &debug_file, &debug_line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16735,27 +17855,27 @@ void HP_SQL_StmtShowDebug_(SqlStmt *self, const char *debug_file, const unsigned
{
HPMHooks.source.SQL.StmtShowDebug_(self, debug_file, debug_line);
}
- if( HPMHooks.count.HP_SQL_StmtShowDebug__post ) {
- void (*postHookFunc) (SqlStmt *self, const char *debug_file, const unsigned long *debug_line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtShowDebug__post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self, const char *debug_file, const unsigned long debug_line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtShowDebug__post[hIndex].func;
- postHookFunc(self, debug_file, &debug_line);
+ postHookFunc(self, debug_file, debug_line);
}
}
return;
}
-/* StrBuf */
+/* stringbuf_interface */
StringBuf* HP_StrBuf_Malloc(void) {
int hIndex = 0;
StringBuf* retVal___ = NULL;
- if( HPMHooks.count.HP_StrBuf_Malloc_pre ) {
+ if (HPMHooks.count.HP_StrBuf_Malloc_pre > 0) {
StringBuf* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Malloc_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16763,9 +17883,9 @@ StringBuf* HP_StrBuf_Malloc(void) {
{
retVal___ = HPMHooks.source.StrBuf.Malloc();
}
- if( HPMHooks.count.HP_StrBuf_Malloc_post ) {
+ if (HPMHooks.count.HP_StrBuf_Malloc_post > 0) {
StringBuf* (*postHookFunc) (StringBuf* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Malloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -16774,14 +17894,14 @@ StringBuf* HP_StrBuf_Malloc(void) {
}
void HP_StrBuf_Init(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Init_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Init_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Init_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16789,9 +17909,9 @@ void HP_StrBuf_Init(StringBuf *self) {
{
HPMHooks.source.StrBuf.Init(self);
}
- if( HPMHooks.count.HP_StrBuf_Init_post ) {
+ if (HPMHooks.count.HP_StrBuf_Init_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Init_post[hIndex].func;
postHookFunc(self);
}
@@ -16801,16 +17921,16 @@ void HP_StrBuf_Init(StringBuf *self) {
int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Vprintf_pre ) {
- int (*preHookFunc) (StringBuf *self, const char *fmt, va_list args);
+ if (HPMHooks.count.HP_StrBuf_Vprintf_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const char **fmt, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_StrBuf_Vprintf_pre[hIndex].func;
- retVal___ = preHookFunc(self, fmt, args___copy);
+ retVal___ = preHookFunc(&self, &fmt, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16820,9 +17940,9 @@ int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
retVal___ = HPMHooks.source.StrBuf.Vprintf(self, fmt, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_StrBuf_Vprintf_post ) {
+ if (HPMHooks.count.HP_StrBuf_Vprintf_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const char *fmt, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_StrBuf_Vprintf_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, fmt, args___copy);
@@ -16834,14 +17954,14 @@ int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Append_pre ) {
- int (*preHookFunc) (StringBuf *self, const StringBuf *sbuf);
+ if (HPMHooks.count.HP_StrBuf_Append_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const StringBuf **sbuf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Append_pre[hIndex].func;
- retVal___ = preHookFunc(self, sbuf);
+ retVal___ = preHookFunc(&self, &sbuf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16849,9 +17969,9 @@ int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
{
retVal___ = HPMHooks.source.StrBuf.Append(self, sbuf);
}
- if( HPMHooks.count.HP_StrBuf_Append_post ) {
+ if (HPMHooks.count.HP_StrBuf_Append_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const StringBuf *sbuf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Append_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, sbuf);
}
@@ -16861,14 +17981,14 @@ int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_AppendStr_pre ) {
- int (*preHookFunc) (StringBuf *self, const char *str);
+ if (HPMHooks.count.HP_StrBuf_AppendStr_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_AppendStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, str);
+ retVal___ = preHookFunc(&self, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16876,9 +17996,9 @@ int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
{
retVal___ = HPMHooks.source.StrBuf.AppendStr(self, str);
}
- if( HPMHooks.count.HP_StrBuf_AppendStr_post ) {
+ if (HPMHooks.count.HP_StrBuf_AppendStr_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_AppendStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, str);
}
@@ -16888,14 +18008,14 @@ int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
int HP_StrBuf_Length(StringBuf *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Length_pre ) {
- int (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Length_pre > 0) {
+ int (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Length_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16903,9 +18023,9 @@ int HP_StrBuf_Length(StringBuf *self) {
{
retVal___ = HPMHooks.source.StrBuf.Length(self);
}
- if( HPMHooks.count.HP_StrBuf_Length_post ) {
+ if (HPMHooks.count.HP_StrBuf_Length_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Length_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
@@ -16915,14 +18035,14 @@ int HP_StrBuf_Length(StringBuf *self) {
char* HP_StrBuf_Value(StringBuf *self) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_StrBuf_Value_pre ) {
- char* (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Value_pre > 0) {
+ char* (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Value_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -16930,9 +18050,9 @@ char* HP_StrBuf_Value(StringBuf *self) {
{
retVal___ = HPMHooks.source.StrBuf.Value(self);
}
- if( HPMHooks.count.HP_StrBuf_Value_post ) {
+ if (HPMHooks.count.HP_StrBuf_Value_post > 0) {
char* (*postHookFunc) (char* retVal___, StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Value_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
@@ -16941,14 +18061,14 @@ char* HP_StrBuf_Value(StringBuf *self) {
}
void HP_StrBuf_Clear(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Clear_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Clear_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Clear_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16956,9 +18076,9 @@ void HP_StrBuf_Clear(StringBuf *self) {
{
HPMHooks.source.StrBuf.Clear(self);
}
- if( HPMHooks.count.HP_StrBuf_Clear_post ) {
+ if (HPMHooks.count.HP_StrBuf_Clear_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Clear_post[hIndex].func;
postHookFunc(self);
}
@@ -16967,14 +18087,14 @@ void HP_StrBuf_Clear(StringBuf *self) {
}
void HP_StrBuf_Destroy(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Destroy_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Destroy_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Destroy_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16982,9 +18102,9 @@ void HP_StrBuf_Destroy(StringBuf *self) {
{
HPMHooks.source.StrBuf.Destroy(self);
}
- if( HPMHooks.count.HP_StrBuf_Destroy_post ) {
+ if (HPMHooks.count.HP_StrBuf_Destroy_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Destroy_post[hIndex].func;
postHookFunc(self);
}
@@ -16993,14 +18113,14 @@ void HP_StrBuf_Destroy(StringBuf *self) {
}
void HP_StrBuf_Free(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Free_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Free_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Free_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17008,27 +18128,27 @@ void HP_StrBuf_Free(StringBuf *self) {
{
HPMHooks.source.StrBuf.Free(self);
}
- if( HPMHooks.count.HP_StrBuf_Free_post ) {
+ if (HPMHooks.count.HP_StrBuf_Free_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Free_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-/* strlib */
+/* strlib_interface */
char* HP_strlib_jstrescape(char *pt) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_jstrescape_pre ) {
- char* (*preHookFunc) (char *pt);
+ if (HPMHooks.count.HP_strlib_jstrescape_pre > 0) {
+ char* (*preHookFunc) (char **pt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jstrescape_pre[hIndex].func;
- retVal___ = preHookFunc(pt);
+ retVal___ = preHookFunc(&pt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17036,9 +18156,9 @@ char* HP_strlib_jstrescape(char *pt) {
{
retVal___ = HPMHooks.source.strlib.jstrescape(pt);
}
- if( HPMHooks.count.HP_strlib_jstrescape_post ) {
+ if (HPMHooks.count.HP_strlib_jstrescape_post > 0) {
char* (*postHookFunc) (char* retVal___, char *pt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jstrescape_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pt);
}
@@ -17048,14 +18168,14 @@ char* HP_strlib_jstrescape(char *pt) {
char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_jstrescapecpy_pre ) {
- char* (*preHookFunc) (char *pt, const char *spt);
+ if (HPMHooks.count.HP_strlib_jstrescapecpy_pre > 0) {
+ char* (*preHookFunc) (char **pt, const char **spt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_pre[hIndex].func;
- retVal___ = preHookFunc(pt, spt);
+ retVal___ = preHookFunc(&pt, &spt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17063,9 +18183,9 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
{
retVal___ = HPMHooks.source.strlib.jstrescapecpy(pt, spt);
}
- if( HPMHooks.count.HP_strlib_jstrescapecpy_post ) {
+ if (HPMHooks.count.HP_strlib_jstrescapecpy_post > 0) {
char* (*postHookFunc) (char* retVal___, char *pt, const char *spt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pt, spt);
}
@@ -17075,14 +18195,14 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_jmemescapecpy_pre ) {
- int (*preHookFunc) (char *pt, const char *spt, int *size);
+ if (HPMHooks.count.HP_strlib_jmemescapecpy_pre > 0) {
+ int (*preHookFunc) (char **pt, const char **spt, int *size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jmemescapecpy_pre[hIndex].func;
- retVal___ = preHookFunc(pt, spt, &size);
+ retVal___ = preHookFunc(&pt, &spt, &size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17090,11 +18210,11 @@ int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
{
retVal___ = HPMHooks.source.strlib.jmemescapecpy(pt, spt, size);
}
- if( HPMHooks.count.HP_strlib_jmemescapecpy_post ) {
- int (*postHookFunc) (int retVal___, char *pt, const char *spt, int *size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_jmemescapecpy_post > 0) {
+ int (*postHookFunc) (int retVal___, char *pt, const char *spt, int size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jmemescapecpy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pt, spt, &size);
+ retVal___ = postHookFunc(retVal___, pt, spt, size);
}
}
return retVal___;
@@ -17102,14 +18222,14 @@ int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
int HP_strlib_remove_control_chars_(char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_remove_control_chars__pre ) {
- int (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_strlib_remove_control_chars__pre > 0) {
+ int (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_remove_control_chars__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17117,9 +18237,9 @@ int HP_strlib_remove_control_chars_(char *str) {
{
retVal___ = HPMHooks.source.strlib.remove_control_chars_(str);
}
- if( HPMHooks.count.HP_strlib_remove_control_chars__post ) {
+ if (HPMHooks.count.HP_strlib_remove_control_chars__post > 0) {
int (*postHookFunc) (int retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_remove_control_chars__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -17129,14 +18249,14 @@ int HP_strlib_remove_control_chars_(char *str) {
char* HP_strlib_trim_(char *str) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_trim__pre ) {
- char* (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_strlib_trim__pre > 0) {
+ char* (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_trim__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17144,9 +18264,9 @@ char* HP_strlib_trim_(char *str) {
{
retVal___ = HPMHooks.source.strlib.trim_(str);
}
- if( HPMHooks.count.HP_strlib_trim__post ) {
+ if (HPMHooks.count.HP_strlib_trim__post > 0) {
char* (*postHookFunc) (char* retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_trim__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -17156,14 +18276,14 @@ char* HP_strlib_trim_(char *str) {
char* HP_strlib_normalize_name_(char *str, const char *delims) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_normalize_name__pre ) {
- char* (*preHookFunc) (char *str, const char *delims);
+ if (HPMHooks.count.HP_strlib_normalize_name__pre > 0) {
+ char* (*preHookFunc) (char **str, const char **delims);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_normalize_name__pre[hIndex].func;
- retVal___ = preHookFunc(str, delims);
+ retVal___ = preHookFunc(&str, &delims);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17171,9 +18291,9 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) {
{
retVal___ = HPMHooks.source.strlib.normalize_name_(str, delims);
}
- if( HPMHooks.count.HP_strlib_normalize_name__post ) {
+ if (HPMHooks.count.HP_strlib_normalize_name__post > 0) {
char* (*postHookFunc) (char* retVal___, char *str, const char *delims);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_normalize_name__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str, delims);
}
@@ -17183,14 +18303,14 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) {
const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_stristr__pre ) {
- const char* (*preHookFunc) (const char *haystack, const char *needle);
+ if (HPMHooks.count.HP_strlib_stristr__pre > 0) {
+ const char* (*preHookFunc) (const char **haystack, const char **needle);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_stristr__pre[hIndex].func;
- retVal___ = preHookFunc(haystack, needle);
+ retVal___ = preHookFunc(&haystack, &needle);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17198,9 +18318,9 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
{
retVal___ = HPMHooks.source.strlib.stristr_(haystack, needle);
}
- if( HPMHooks.count.HP_strlib_stristr__post ) {
+ if (HPMHooks.count.HP_strlib_stristr__post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *haystack, const char *needle);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_stristr__post[hIndex].func;
retVal___ = postHookFunc(retVal___, haystack, needle);
}
@@ -17210,14 +18330,14 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_strlib_strnlen__pre ) {
- size_t (*preHookFunc) (const char *string, size_t *maxlen);
+ if (HPMHooks.count.HP_strlib_strnlen__pre > 0) {
+ size_t (*preHookFunc) (const char **string, size_t *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strnlen__pre[hIndex].func;
- retVal___ = preHookFunc(string, &maxlen);
+ retVal___ = preHookFunc(&string, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17225,11 +18345,11 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
{
retVal___ = HPMHooks.source.strlib.strnlen_(string, maxlen);
}
- if( HPMHooks.count.HP_strlib_strnlen__post ) {
- size_t (*postHookFunc) (size_t retVal___, const char *string, size_t *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_strnlen__post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, const char *string, size_t maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strnlen__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, string, &maxlen);
+ retVal___ = postHookFunc(retVal___, string, maxlen);
}
}
return retVal___;
@@ -17237,14 +18357,14 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_strtok_r__pre ) {
- char* (*preHookFunc) (char *s1, const char *s2, char **lasts);
+ if (HPMHooks.count.HP_strlib_strtok_r__pre > 0) {
+ char* (*preHookFunc) (char **s1, const char **s2, char ***lasts);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strtok_r__pre[hIndex].func;
- retVal___ = preHookFunc(s1, s2, lasts);
+ retVal___ = preHookFunc(&s1, &s2, &lasts);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17252,9 +18372,9 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
{
retVal___ = HPMHooks.source.strlib.strtok_r_(s1, s2, lasts);
}
- if( HPMHooks.count.HP_strlib_strtok_r__post ) {
+ if (HPMHooks.count.HP_strlib_strtok_r__post > 0) {
char* (*postHookFunc) (char* retVal___, char *s1, const char *s2, char **lasts);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strtok_r__post[hIndex].func;
retVal___ = postHookFunc(retVal___, s1, s2, lasts);
}
@@ -17264,14 +18384,14 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
int HP_strlib_e_mail_check_(char *email) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_e_mail_check__pre ) {
- int (*preHookFunc) (char *email);
+ if (HPMHooks.count.HP_strlib_e_mail_check__pre > 0) {
+ int (*preHookFunc) (char **email);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_e_mail_check__pre[hIndex].func;
- retVal___ = preHookFunc(email);
+ retVal___ = preHookFunc(&email);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17279,9 +18399,9 @@ int HP_strlib_e_mail_check_(char *email) {
{
retVal___ = HPMHooks.source.strlib.e_mail_check_(email);
}
- if( HPMHooks.count.HP_strlib_e_mail_check__post ) {
+ if (HPMHooks.count.HP_strlib_e_mail_check__post > 0) {
int (*postHookFunc) (int retVal___, char *email);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_e_mail_check__post[hIndex].func;
retVal___ = postHookFunc(retVal___, email);
}
@@ -17291,14 +18411,14 @@ int HP_strlib_e_mail_check_(char *email) {
int HP_strlib_config_switch_(const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_config_switch__pre ) {
- int (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_strlib_config_switch__pre > 0) {
+ int (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_config_switch__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17306,9 +18426,9 @@ int HP_strlib_config_switch_(const char *str) {
{
retVal___ = HPMHooks.source.strlib.config_switch_(str);
}
- if( HPMHooks.count.HP_strlib_config_switch__post ) {
+ if (HPMHooks.count.HP_strlib_config_switch__post > 0) {
int (*postHookFunc) (int retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_config_switch__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -17318,14 +18438,14 @@ int HP_strlib_config_switch_(const char *str) {
char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_safestrncpy__pre ) {
- char* (*preHookFunc) (char *dst, const char *src, size_t *n);
+ if (HPMHooks.count.HP_strlib_safestrncpy__pre > 0) {
+ char* (*preHookFunc) (char **dst, const char **src, size_t *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_safestrncpy__pre[hIndex].func;
- retVal___ = preHookFunc(dst, src, &n);
+ retVal___ = preHookFunc(&dst, &src, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17333,11 +18453,11 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
{
retVal___ = HPMHooks.source.strlib.safestrncpy_(dst, src, n);
}
- if( HPMHooks.count.HP_strlib_safestrncpy__post ) {
- char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_safestrncpy__post > 0) {
+ char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_safestrncpy__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, dst, src, &n);
+ retVal___ = postHookFunc(retVal___, dst, src, n);
}
}
return retVal___;
@@ -17345,14 +18465,14 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_strlib_safestrnlen__pre ) {
- size_t (*preHookFunc) (const char *string, size_t *maxlen);
+ if (HPMHooks.count.HP_strlib_safestrnlen__pre > 0) {
+ size_t (*preHookFunc) (const char **string, size_t *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_safestrnlen__pre[hIndex].func;
- retVal___ = preHookFunc(string, &maxlen);
+ retVal___ = preHookFunc(&string, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17360,11 +18480,11 @@ size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
{
retVal___ = HPMHooks.source.strlib.safestrnlen_(string, maxlen);
}
- if( HPMHooks.count.HP_strlib_safestrnlen__post ) {
- size_t (*postHookFunc) (size_t retVal___, const char *string, size_t *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_safestrnlen__post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, const char *string, size_t maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_safestrnlen__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, string, &maxlen);
+ retVal___ = postHookFunc(retVal___, string, maxlen);
}
}
return retVal___;
@@ -17372,14 +18492,14 @@ size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
int HP_strlib_strline_(const char *str, size_t pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_strline__pre ) {
- int (*preHookFunc) (const char *str, size_t *pos);
+ if (HPMHooks.count.HP_strlib_strline__pre > 0) {
+ int (*preHookFunc) (const char **str, size_t *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strline__pre[hIndex].func;
- retVal___ = preHookFunc(str, &pos);
+ retVal___ = preHookFunc(&str, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17387,26 +18507,26 @@ int HP_strlib_strline_(const char *str, size_t pos) {
{
retVal___ = HPMHooks.source.strlib.strline_(str, pos);
}
- if( HPMHooks.count.HP_strlib_strline__post ) {
- int (*postHookFunc) (int retVal___, const char *str, size_t *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_strline__post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, size_t pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strline__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &pos);
+ retVal___ = postHookFunc(retVal___, str, pos);
}
}
return retVal___;
}
-bool HP_strlib_bin2hex_(char *output, unsigned char *input, size_t count) {
+bool HP_strlib_bin2hex_(char *output, const unsigned char *input, size_t count) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_strlib_bin2hex__pre ) {
- bool (*preHookFunc) (char *output, unsigned char *input, size_t *count);
+ if (HPMHooks.count.HP_strlib_bin2hex__pre > 0) {
+ bool (*preHookFunc) (char **output, const unsigned char **input, size_t *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_bin2hex__pre[hIndex].func;
- retVal___ = preHookFunc(output, input, &count);
+ retVal___ = preHookFunc(&output, &input, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17414,27 +18534,27 @@ bool HP_strlib_bin2hex_(char *output, unsigned char *input, size_t count) {
{
retVal___ = HPMHooks.source.strlib.bin2hex_(output, input, count);
}
- if( HPMHooks.count.HP_strlib_bin2hex__post ) {
- bool (*postHookFunc) (bool retVal___, char *output, unsigned char *input, size_t *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_bin2hex__post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *output, const unsigned char *input, size_t count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_bin2hex__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, output, input, &count);
+ retVal___ = postHookFunc(retVal___, output, input, count);
}
}
return retVal___;
}
-/* sv */
+/* sv_interface */
int HP_sv_parse_next(struct s_svstate *svstate) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_parse_next_pre ) {
- int (*preHookFunc) (struct s_svstate *svstate);
+ if (HPMHooks.count.HP_sv_parse_next_pre > 0) {
+ int (*preHookFunc) (struct s_svstate **svstate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_parse_next_pre[hIndex].func;
- retVal___ = preHookFunc(svstate);
+ retVal___ = preHookFunc(&svstate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17442,9 +18562,9 @@ int HP_sv_parse_next(struct s_svstate *svstate) {
{
retVal___ = HPMHooks.source.sv.parse_next(svstate);
}
- if( HPMHooks.count.HP_sv_parse_next_post ) {
+ if (HPMHooks.count.HP_sv_parse_next_post > 0) {
int (*postHookFunc) (int retVal___, struct s_svstate *svstate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_parse_next_post[hIndex].func;
retVal___ = postHookFunc(retVal___, svstate);
}
@@ -17454,14 +18574,14 @@ int HP_sv_parse_next(struct s_svstate *svstate) {
int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_parse_pre ) {
- int (*preHookFunc) (const char *str, int *len, int *startoff, char *delim, int *out_pos, int *npos, enum e_svopt *opt);
+ if (HPMHooks.count.HP_sv_parse_pre > 0) {
+ int (*preHookFunc) (const char **str, int *len, int *startoff, char *delim, int **out_pos, int *npos, enum e_svopt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_parse_pre[hIndex].func;
- retVal___ = preHookFunc(str, &len, &startoff, &delim, out_pos, &npos, &opt);
+ retVal___ = preHookFunc(&str, &len, &startoff, &delim, &out_pos, &npos, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17469,11 +18589,11 @@ int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos
{
retVal___ = HPMHooks.source.sv.parse(str, len, startoff, delim, out_pos, npos, opt);
}
- if( HPMHooks.count.HP_sv_parse_post ) {
- int (*postHookFunc) (int retVal___, const char *str, int *len, int *startoff, char *delim, int *out_pos, int *npos, enum e_svopt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &len, &startoff, &delim, out_pos, &npos, &opt);
+ retVal___ = postHookFunc(retVal___, str, len, startoff, delim, out_pos, npos, opt);
}
}
return retVal___;
@@ -17481,14 +18601,14 @@ int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos
int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_split_pre ) {
- int (*preHookFunc) (char *str, int *len, int *startoff, char *delim, char **out_fields, int *nfields, enum e_svopt *opt);
+ if (HPMHooks.count.HP_sv_split_pre > 0) {
+ int (*preHookFunc) (char **str, int *len, int *startoff, char *delim, char ***out_fields, int *nfields, enum e_svopt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_split_pre[hIndex].func;
- retVal___ = preHookFunc(str, &len, &startoff, &delim, out_fields, &nfields, &opt);
+ retVal___ = preHookFunc(&str, &len, &startoff, &delim, &out_fields, &nfields, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17496,11 +18616,11 @@ int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields,
{
retVal___ = HPMHooks.source.sv.split(str, len, startoff, delim, out_fields, nfields, opt);
}
- if( HPMHooks.count.HP_sv_split_post ) {
- int (*postHookFunc) (int retVal___, char *str, int *len, int *startoff, char *delim, char **out_fields, int *nfields, enum e_svopt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_split_post > 0) {
+ int (*postHookFunc) (int retVal___, char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_split_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &len, &startoff, &delim, out_fields, &nfields, &opt);
+ retVal___ = postHookFunc(retVal___, str, len, startoff, delim, out_fields, nfields, opt);
}
}
return retVal___;
@@ -17508,14 +18628,14 @@ int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields,
size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *escapes) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_sv_escape_c_pre ) {
- size_t (*preHookFunc) (char *out_dest, const char *src, size_t *len, const char *escapes);
+ if (HPMHooks.count.HP_sv_escape_c_pre > 0) {
+ size_t (*preHookFunc) (char **out_dest, const char **src, size_t *len, const char **escapes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_escape_c_pre[hIndex].func;
- retVal___ = preHookFunc(out_dest, src, &len, escapes);
+ retVal___ = preHookFunc(&out_dest, &src, &len, &escapes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17523,11 +18643,11 @@ size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *e
{
retVal___ = HPMHooks.source.sv.escape_c(out_dest, src, len, escapes);
}
- if( HPMHooks.count.HP_sv_escape_c_post ) {
- size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t *len, const char *escapes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_escape_c_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t len, const char *escapes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_escape_c_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, out_dest, src, &len, escapes);
+ retVal___ = postHookFunc(retVal___, out_dest, src, len, escapes);
}
}
return retVal___;
@@ -17535,14 +18655,14 @@ size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *e
size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_sv_unescape_c_pre ) {
- size_t (*preHookFunc) (char *out_dest, const char *src, size_t *len);
+ if (HPMHooks.count.HP_sv_unescape_c_pre > 0) {
+ size_t (*preHookFunc) (char **out_dest, const char **src, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_unescape_c_pre[hIndex].func;
- retVal___ = preHookFunc(out_dest, src, &len);
+ retVal___ = preHookFunc(&out_dest, &src, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17550,11 +18670,11 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
{
retVal___ = HPMHooks.source.sv.unescape_c(out_dest, src, len);
}
- if( HPMHooks.count.HP_sv_unescape_c_post ) {
- size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_unescape_c_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_unescape_c_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, out_dest, src, &len);
+ retVal___ = postHookFunc(retVal___, out_dest, src, len);
}
}
return retVal___;
@@ -17562,14 +18682,14 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
const char* HP_sv_skip_escaped_c(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sv_skip_escaped_c_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_sv_skip_escaped_c_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17577,9 +18697,9 @@ const char* HP_sv_skip_escaped_c(const char *p) {
{
retVal___ = HPMHooks.source.sv.skip_escaped_c(p);
}
- if( HPMHooks.count.HP_sv_skip_escaped_c_post ) {
+ if (HPMHooks.count.HP_sv_skip_escaped_c_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -17589,14 +18709,14 @@ const char* HP_sv_skip_escaped_c(const char *p) {
bool HP_sv_readdb(const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current)) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sv_readdb_pre ) {
- bool (*preHookFunc) (const char *directory, const char *filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+ if (HPMHooks.count.HP_sv_readdb_pre > 0) {
+ bool (*preHookFunc) (const char **directory, const char **filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( **parseproc ) (char *fields[], int columns, int current));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_readdb_pre[hIndex].func;
- retVal___ = preHookFunc(directory, filename, &delim, &mincols, &maxcols, &maxrows, parseproc);
+ retVal___ = preHookFunc(&directory, &filename, &delim, &mincols, &maxcols, &maxrows, &parseproc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17604,27 +18724,27 @@ bool HP_sv_readdb(const char *directory, const char *filename, char delim, int m
{
retVal___ = HPMHooks.source.sv.readdb(directory, filename, delim, mincols, maxcols, maxrows, parseproc);
}
- if( HPMHooks.count.HP_sv_readdb_post ) {
- bool (*postHookFunc) (bool retVal___, const char *directory, const char *filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_readdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_readdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, directory, filename, &delim, &mincols, &maxcols, &maxrows, parseproc);
+ retVal___ = postHookFunc(retVal___, directory, filename, delim, mincols, maxcols, maxrows, parseproc);
}
}
return retVal___;
}
-/* sysinfo */
+/* sysinfo_interface */
int HP_sysinfo_getpagesize(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_getpagesize_pre ) {
+ if (HPMHooks.count.HP_sysinfo_getpagesize_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_getpagesize_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17632,9 +18752,9 @@ int HP_sysinfo_getpagesize(void) {
{
retVal___ = HPMHooks.source.sysinfo.getpagesize();
}
- if( HPMHooks.count.HP_sysinfo_getpagesize_post ) {
+ if (HPMHooks.count.HP_sysinfo_getpagesize_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_getpagesize_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17644,14 +18764,14 @@ int HP_sysinfo_getpagesize(void) {
const char* HP_sysinfo_platform(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_platform_pre ) {
+ if (HPMHooks.count.HP_sysinfo_platform_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_platform_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17659,9 +18779,9 @@ const char* HP_sysinfo_platform(void) {
{
retVal___ = HPMHooks.source.sysinfo.platform();
}
- if( HPMHooks.count.HP_sysinfo_platform_post ) {
+ if (HPMHooks.count.HP_sysinfo_platform_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_platform_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17671,14 +18791,14 @@ const char* HP_sysinfo_platform(void) {
const char* HP_sysinfo_osversion(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_osversion_pre ) {
+ if (HPMHooks.count.HP_sysinfo_osversion_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_osversion_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17686,9 +18806,9 @@ const char* HP_sysinfo_osversion(void) {
{
retVal___ = HPMHooks.source.sysinfo.osversion();
}
- if( HPMHooks.count.HP_sysinfo_osversion_post ) {
+ if (HPMHooks.count.HP_sysinfo_osversion_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_osversion_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17698,14 +18818,14 @@ const char* HP_sysinfo_osversion(void) {
const char* HP_sysinfo_cpu(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_cpu_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cpu_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cpu_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17713,9 +18833,9 @@ const char* HP_sysinfo_cpu(void) {
{
retVal___ = HPMHooks.source.sysinfo.cpu();
}
- if( HPMHooks.count.HP_sysinfo_cpu_post ) {
+ if (HPMHooks.count.HP_sysinfo_cpu_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cpu_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17725,14 +18845,14 @@ const char* HP_sysinfo_cpu(void) {
int HP_sysinfo_cpucores(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_cpucores_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cpucores_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cpucores_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17740,9 +18860,9 @@ int HP_sysinfo_cpucores(void) {
{
retVal___ = HPMHooks.source.sysinfo.cpucores();
}
- if( HPMHooks.count.HP_sysinfo_cpucores_post ) {
+ if (HPMHooks.count.HP_sysinfo_cpucores_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cpucores_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17752,14 +18872,14 @@ int HP_sysinfo_cpucores(void) {
const char* HP_sysinfo_arch(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_arch_pre ) {
+ if (HPMHooks.count.HP_sysinfo_arch_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_arch_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17767,9 +18887,9 @@ const char* HP_sysinfo_arch(void) {
{
retVal___ = HPMHooks.source.sysinfo.arch();
}
- if( HPMHooks.count.HP_sysinfo_arch_post ) {
+ if (HPMHooks.count.HP_sysinfo_arch_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_arch_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17779,14 +18899,14 @@ const char* HP_sysinfo_arch(void) {
bool HP_sysinfo_is64bit(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sysinfo_is64bit_pre ) {
+ if (HPMHooks.count.HP_sysinfo_is64bit_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_is64bit_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17794,9 +18914,9 @@ bool HP_sysinfo_is64bit(void) {
{
retVal___ = HPMHooks.source.sysinfo.is64bit();
}
- if( HPMHooks.count.HP_sysinfo_is64bit_post ) {
+ if (HPMHooks.count.HP_sysinfo_is64bit_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_is64bit_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17806,14 +18926,14 @@ bool HP_sysinfo_is64bit(void) {
const char* HP_sysinfo_compiler(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_compiler_pre ) {
+ if (HPMHooks.count.HP_sysinfo_compiler_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_compiler_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17821,9 +18941,9 @@ const char* HP_sysinfo_compiler(void) {
{
retVal___ = HPMHooks.source.sysinfo.compiler();
}
- if( HPMHooks.count.HP_sysinfo_compiler_post ) {
+ if (HPMHooks.count.HP_sysinfo_compiler_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_compiler_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17833,14 +18953,14 @@ const char* HP_sysinfo_compiler(void) {
const char* HP_sysinfo_cflags(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_cflags_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cflags_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cflags_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17848,26 +18968,53 @@ const char* HP_sysinfo_cflags(void) {
{
retVal___ = HPMHooks.source.sysinfo.cflags();
}
- if( HPMHooks.count.HP_sysinfo_cflags_post ) {
+ if (HPMHooks.count.HP_sysinfo_cflags_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cflags_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
+const char* HP_sysinfo_time(void) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_sysinfo_time_pre > 0) {
+ const char* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_sysinfo_time_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.sysinfo.time();
+ }
+ if (HPMHooks.count.HP_sysinfo_time_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_sysinfo_time_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
const char* HP_sysinfo_vcstype(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcstype_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcstype_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcstype_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17875,9 +19022,9 @@ const char* HP_sysinfo_vcstype(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcstype();
}
- if( HPMHooks.count.HP_sysinfo_vcstype_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcstype_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcstype_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17887,14 +19034,14 @@ const char* HP_sysinfo_vcstype(void) {
int HP_sysinfo_vcstypeid(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_vcstypeid_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcstypeid_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcstypeid_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17902,9 +19049,9 @@ int HP_sysinfo_vcstypeid(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcstypeid();
}
- if( HPMHooks.count.HP_sysinfo_vcstypeid_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcstypeid_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcstypeid_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17914,14 +19061,14 @@ int HP_sysinfo_vcstypeid(void) {
const char* HP_sysinfo_vcsrevision_src(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_src_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_src_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17929,9 +19076,9 @@ const char* HP_sysinfo_vcsrevision_src(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcsrevision_src();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_src_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_src_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17941,14 +19088,14 @@ const char* HP_sysinfo_vcsrevision_src(void) {
const char* HP_sysinfo_vcsrevision_scripts(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17956,9 +19103,9 @@ const char* HP_sysinfo_vcsrevision_scripts(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcsrevision_scripts();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17967,14 +19114,14 @@ const char* HP_sysinfo_vcsrevision_scripts(void) {
}
void HP_sysinfo_vcsrevision_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17982,9 +19129,9 @@ void HP_sysinfo_vcsrevision_reload(void) {
{
HPMHooks.source.sysinfo.vcsrevision_reload();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_reload_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_reload_post[hIndex].func;
postHookFunc();
}
@@ -17994,14 +19141,14 @@ void HP_sysinfo_vcsrevision_reload(void) {
bool HP_sysinfo_is_superuser(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sysinfo_is_superuser_pre ) {
+ if (HPMHooks.count.HP_sysinfo_is_superuser_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_is_superuser_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18009,9 +19156,9 @@ bool HP_sysinfo_is_superuser(void) {
{
retVal___ = HPMHooks.source.sysinfo.is_superuser();
}
- if( HPMHooks.count.HP_sysinfo_is_superuser_post ) {
+ if (HPMHooks.count.HP_sysinfo_is_superuser_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_is_superuser_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -18020,14 +19167,14 @@ bool HP_sysinfo_is_superuser(void) {
}
void HP_sysinfo_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_init_pre ) {
+ if (HPMHooks.count.HP_sysinfo_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18035,9 +19182,9 @@ void HP_sysinfo_init(void) {
{
HPMHooks.source.sysinfo.init();
}
- if( HPMHooks.count.HP_sysinfo_init_post ) {
+ if (HPMHooks.count.HP_sysinfo_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_init_post[hIndex].func;
postHookFunc();
}
@@ -18046,14 +19193,14 @@ void HP_sysinfo_init(void) {
}
void HP_sysinfo_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_final_pre ) {
+ if (HPMHooks.count.HP_sysinfo_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18061,27 +19208,320 @@ void HP_sysinfo_final(void) {
{
HPMHooks.source.sysinfo.final();
}
- if( HPMHooks.count.HP_sysinfo_final_post ) {
+ if (HPMHooks.count.HP_sysinfo_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* timer */
+/* thread_interface */
+void HP_thread_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.init();
+ }
+ if (HPMHooks.count.HP_thread_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_thread_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.final();
+ }
+ if (HPMHooks.count.HP_thread_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_create_pre > 0) {
+ struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func;
+ retVal___ = preHookFunc(&entry_point, &param);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.create(entry_point, param);
+ }
+ if (HPMHooks.count.HP_thread_create_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, entry_point, param);
+ }
+ }
+ return retVal___;
+}
+struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_create_opt_pre > 0) {
+ struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func;
+ retVal___ = preHookFunc(&entry_point, &param, &stack_size, &prio);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio);
+ }
+ if (HPMHooks.count.HP_thread_create_opt_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_destroy(struct thread_handle *handle) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_destroy_pre > 0) {
+ void (*preHookFunc) (struct thread_handle **handle);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func;
+ preHookFunc(&handle);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.destroy(handle);
+ }
+ if (HPMHooks.count.HP_thread_destroy_post > 0) {
+ void (*postHookFunc) (struct thread_handle *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func;
+ postHookFunc(handle);
+ }
+ }
+ return;
+}
+struct thread_handle* HP_thread_self(void) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_self_pre > 0) {
+ struct thread_handle* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.self();
+ }
+ if (HPMHooks.count.HP_thread_self_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+int HP_thread_get_tid(void) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_thread_get_tid_pre > 0) {
+ int (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.get_tid();
+ }
+ if (HPMHooks.count.HP_thread_get_tid_post > 0) {
+ int (*postHookFunc) (int retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_thread_wait_pre > 0) {
+ bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func;
+ retVal___ = preHookFunc(&handle, &out_exit_code);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code);
+ }
+ if (HPMHooks.count.HP_thread_wait_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, handle, out_exit_code);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_prio_set_pre > 0) {
+ void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func;
+ preHookFunc(&handle, &prio);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.prio_set(handle, prio);
+ }
+ if (HPMHooks.count.HP_thread_prio_set_post > 0) {
+ void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func;
+ postHookFunc(handle, prio);
+ }
+ }
+ return;
+}
+enum thread_priority HP_thread_prio_get(struct thread_handle *handle) {
+ int hIndex = 0;
+ enum thread_priority retVal___ = THREADPRIO_NORMAL;
+ if (HPMHooks.count.HP_thread_prio_get_pre > 0) {
+ enum thread_priority (*preHookFunc) (struct thread_handle **handle);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func;
+ retVal___ = preHookFunc(&handle);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.prio_get(handle);
+ }
+ if (HPMHooks.count.HP_thread_prio_get_post > 0) {
+ enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, handle);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_yield(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_yield_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.yield();
+ }
+ if (HPMHooks.count.HP_thread_yield_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+/* timer_interface */
int64 HP_timer_gettick(void) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_gettick_pre ) {
+ if (HPMHooks.count.HP_timer_gettick_pre > 0) {
int64 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_gettick_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18089,9 +19529,9 @@ int64 HP_timer_gettick(void) {
{
retVal___ = HPMHooks.source.timer.gettick();
}
- if( HPMHooks.count.HP_timer_gettick_post ) {
+ if (HPMHooks.count.HP_timer_gettick_post > 0) {
int64 (*postHookFunc) (int64 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_gettick_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -18101,14 +19541,14 @@ int64 HP_timer_gettick(void) {
int64 HP_timer_gettick_nocache(void) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_gettick_nocache_pre ) {
+ if (HPMHooks.count.HP_timer_gettick_nocache_pre > 0) {
int64 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_gettick_nocache_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18116,9 +19556,9 @@ int64 HP_timer_gettick_nocache(void) {
{
retVal___ = HPMHooks.source.timer.gettick_nocache();
}
- if( HPMHooks.count.HP_timer_gettick_nocache_post ) {
+ if (HPMHooks.count.HP_timer_gettick_nocache_post > 0) {
int64 (*postHookFunc) (int64 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_gettick_nocache_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -18128,14 +19568,14 @@ int64 HP_timer_gettick_nocache(void) {
int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_pre ) {
+ if (HPMHooks.count.HP_timer_add_pre > 0) {
int (*preHookFunc) (int64 *tick, TimerFunc *func, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_pre[hIndex].func;
retVal___ = preHookFunc(&tick, &func, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18143,11 +19583,11 @@ int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.timer.add(tick, func, id, data);
}
- if( HPMHooks.count.HP_timer_add_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, TimerFunc *func, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &func, &id, &data);
+ retVal___ = postHookFunc(retVal___, tick, func, id, data);
}
}
return retVal___;
@@ -18155,14 +19595,14 @@ int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int interval) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_interval_pre ) {
+ if (HPMHooks.count.HP_timer_add_interval_pre > 0) {
int (*preHookFunc) (int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_interval_pre[hIndex].func;
retVal___ = preHookFunc(&tick, &func, &id, &data, &interval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18170,11 +19610,11 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int
{
retVal___ = HPMHooks.source.timer.add_interval(tick, func, id, data, interval);
}
- if( HPMHooks.count.HP_timer_add_interval_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_interval_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data, int interval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_interval_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &func, &id, &data, &interval);
+ retVal___ = postHookFunc(retVal___, tick, func, id, data, interval);
}
}
return retVal___;
@@ -18182,14 +19622,14 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int
const struct TimerData* HP_timer_get(int tid) {
int hIndex = 0;
const struct TimerData* retVal___ = NULL;
- if( HPMHooks.count.HP_timer_get_pre ) {
+ if (HPMHooks.count.HP_timer_get_pre > 0) {
const struct TimerData* (*preHookFunc) (int *tid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_get_pre[hIndex].func;
retVal___ = preHookFunc(&tid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18197,11 +19637,11 @@ const struct TimerData* HP_timer_get(int tid) {
{
retVal___ = HPMHooks.source.timer.get(tid);
}
- if( HPMHooks.count.HP_timer_get_post ) {
- const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int *tid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_get_post > 0) {
+ const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int tid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_get_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid);
+ retVal___ = postHookFunc(retVal___, tid);
}
}
return retVal___;
@@ -18209,14 +19649,14 @@ const struct TimerData* HP_timer_get(int tid) {
int HP_timer_delete(int tid, TimerFunc func) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_delete_pre ) {
+ if (HPMHooks.count.HP_timer_delete_pre > 0) {
int (*preHookFunc) (int *tid, TimerFunc *func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_delete_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18224,11 +19664,11 @@ int HP_timer_delete(int tid, TimerFunc func) {
{
retVal___ = HPMHooks.source.timer.delete(tid, func);
}
- if( HPMHooks.count.HP_timer_delete_post ) {
- int (*postHookFunc) (int retVal___, int *tid, TimerFunc *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, TimerFunc func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &func);
+ retVal___ = postHookFunc(retVal___, tid, func);
}
}
return retVal___;
@@ -18236,14 +19676,14 @@ int HP_timer_delete(int tid, TimerFunc func) {
int64 HP_timer_addtick(int tid, int64 tick) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_addtick_pre ) {
+ if (HPMHooks.count.HP_timer_addtick_pre > 0) {
int64 (*preHookFunc) (int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_addtick_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18251,11 +19691,11 @@ int64 HP_timer_addtick(int tid, int64 tick) {
{
retVal___ = HPMHooks.source.timer.addtick(tid, tick);
}
- if( HPMHooks.count.HP_timer_addtick_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_addtick_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_addtick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, tid, tick);
}
}
return retVal___;
@@ -18263,14 +19703,14 @@ int64 HP_timer_addtick(int tid, int64 tick) {
int64 HP_timer_settick(int tid, int64 tick) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_settick_pre ) {
+ if (HPMHooks.count.HP_timer_settick_pre > 0) {
int64 (*preHookFunc) (int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_settick_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18278,11 +19718,11 @@ int64 HP_timer_settick(int tid, int64 tick) {
{
retVal___ = HPMHooks.source.timer.settick(tid, tick);
}
- if( HPMHooks.count.HP_timer_settick_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_settick_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_settick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, tid, tick);
}
}
return retVal___;
@@ -18290,14 +19730,14 @@ int64 HP_timer_settick(int tid, int64 tick) {
int HP_timer_add_func_list(TimerFunc func, char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_func_list_pre ) {
- int (*preHookFunc) (TimerFunc *func, char *name);
+ if (HPMHooks.count.HP_timer_add_func_list_pre > 0) {
+ int (*preHookFunc) (TimerFunc *func, char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_func_list_pre[hIndex].func;
- retVal___ = preHookFunc(&func, name);
+ retVal___ = preHookFunc(&func, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18305,11 +19745,11 @@ int HP_timer_add_func_list(TimerFunc func, char *name) {
{
retVal___ = HPMHooks.source.timer.add_func_list(func, name);
}
- if( HPMHooks.count.HP_timer_add_func_list_post ) {
- int (*postHookFunc) (int retVal___, TimerFunc *func, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_func_list_post > 0) {
+ int (*postHookFunc) (int retVal___, TimerFunc func, char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_func_list_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &func, name);
+ retVal___ = postHookFunc(retVal___, func, name);
}
}
return retVal___;
@@ -18317,14 +19757,14 @@ int HP_timer_add_func_list(TimerFunc func, char *name) {
unsigned long HP_timer_get_uptime(void) {
int hIndex = 0;
unsigned long retVal___ = 0;
- if( HPMHooks.count.HP_timer_get_uptime_pre ) {
+ if (HPMHooks.count.HP_timer_get_uptime_pre > 0) {
unsigned long (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_get_uptime_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18332,9 +19772,9 @@ unsigned long HP_timer_get_uptime(void) {
{
retVal___ = HPMHooks.source.timer.get_uptime();
}
- if( HPMHooks.count.HP_timer_get_uptime_post ) {
+ if (HPMHooks.count.HP_timer_get_uptime_post > 0) {
unsigned long (*postHookFunc) (unsigned long retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_get_uptime_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -18344,14 +19784,14 @@ unsigned long HP_timer_get_uptime(void) {
int HP_timer_perform(int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_perform_pre ) {
+ if (HPMHooks.count.HP_timer_perform_pre > 0) {
int (*preHookFunc) (int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_perform_pre[hIndex].func;
retVal___ = preHookFunc(&tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18359,25 +19799,25 @@ int HP_timer_perform(int64 tick) {
{
retVal___ = HPMHooks.source.timer.perform(tick);
}
- if( HPMHooks.count.HP_timer_perform_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_perform_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_perform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick);
+ retVal___ = postHookFunc(retVal___, tick);
}
}
return retVal___;
}
void HP_timer_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_timer_init_pre ) {
+ if (HPMHooks.count.HP_timer_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18385,9 +19825,9 @@ void HP_timer_init(void) {
{
HPMHooks.source.timer.init();
}
- if( HPMHooks.count.HP_timer_init_post ) {
+ if (HPMHooks.count.HP_timer_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_init_post[hIndex].func;
postHookFunc();
}
@@ -18396,14 +19836,14 @@ void HP_timer_init(void) {
}
void HP_timer_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_timer_final_pre ) {
+ if (HPMHooks.count.HP_timer_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18411,9 +19851,9 @@ void HP_timer_final(void) {
{
HPMHooks.source.timer.final();
}
- if( HPMHooks.count.HP_timer_final_post ) {
+ if (HPMHooks.count.HP_timer_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_final_post[hIndex].func;
postHookFunc();
}
diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
index d14117add..a7b1cff4e 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,36 +23,42 @@
* as it will get overwritten.
*/
-memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface));
-memcpy(&HPMHooks.source.chr, chr, sizeof(struct char_interface));
-memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface));
-memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface));
-memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface));
-memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface));
-memcpy(&HPMHooks.source.geoip, geoip, sizeof(struct geoip_interface));
-memcpy(&HPMHooks.source.inter_auction, inter_auction, sizeof(struct inter_auction_interface));
-memcpy(&HPMHooks.source.inter_elemental, inter_elemental, sizeof(struct inter_elemental_interface));
-memcpy(&HPMHooks.source.inter_guild, inter_guild, sizeof(struct inter_guild_interface));
-memcpy(&HPMHooks.source.inter_homunculus, inter_homunculus, sizeof(struct inter_homunculus_interface));
-memcpy(&HPMHooks.source.inter, inter, sizeof(struct inter_interface));
-memcpy(&HPMHooks.source.inter_mail, inter_mail, sizeof(struct inter_mail_interface));
-memcpy(&HPMHooks.source.inter_mercenary, inter_mercenary, sizeof(struct inter_mercenary_interface));
-memcpy(&HPMHooks.source.inter_party, inter_party, sizeof(struct inter_party_interface));
-memcpy(&HPMHooks.source.inter_pet, inter_pet, sizeof(struct inter_pet_interface));
-memcpy(&HPMHooks.source.inter_quest, inter_quest, sizeof(struct inter_quest_interface));
-memcpy(&HPMHooks.source.inter_storage, inter_storage, sizeof(struct inter_storage_interface));
-memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
-memcpy(&HPMHooks.source.loginif, loginif, sizeof(struct loginif_interface));
-memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));
-memcpy(&HPMHooks.source.mapif, mapif, sizeof(struct mapif_interface));
-memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface));
-memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface));
-memcpy(&HPMHooks.source.pincode, pincode, sizeof(struct pincode_interface));
-memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface));
-memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface));
-memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface));
-memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface));
-memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface));
-memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface));
-memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface));
-memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface));
+/* GENERATED FILE DO NOT EDIT */
+
+HPMHooks.source.HCache = *HCache;
+HPMHooks.source.chr = *chr;
+HPMHooks.source.cmdline = *cmdline;
+HPMHooks.source.console = *console;
+HPMHooks.source.core = *core;
+HPMHooks.source.DB = *DB;
+HPMHooks.source.des = *des;
+HPMHooks.source.geoip = *geoip;
+HPMHooks.source.inter_auction = *inter_auction;
+HPMHooks.source.inter_elemental = *inter_elemental;
+HPMHooks.source.inter_guild = *inter_guild;
+HPMHooks.source.inter_homunculus = *inter_homunculus;
+HPMHooks.source.inter = *inter;
+HPMHooks.source.inter_mail = *inter_mail;
+HPMHooks.source.inter_mercenary = *inter_mercenary;
+HPMHooks.source.inter_party = *inter_party;
+HPMHooks.source.inter_pet = *inter_pet;
+HPMHooks.source.inter_quest = *inter_quest;
+HPMHooks.source.inter_storage = *inter_storage;
+HPMHooks.source.libconfig = *libconfig;
+HPMHooks.source.loginif = *loginif;
+HPMHooks.source.mapif = *mapif;
+HPMHooks.source.mapindex = *mapindex;
+HPMHooks.source.md5 = *md5;
+HPMHooks.source.mutex = *mutex;
+HPMHooks.source.nullpo = *nullpo;
+HPMHooks.source.pincode = *pincode;
+HPMHooks.source.rnd = *rnd;
+HPMHooks.source.showmsg = *showmsg;
+HPMHooks.source.sockt = *sockt;
+HPMHooks.source.SQL = *SQL;
+HPMHooks.source.StrBuf = *StrBuf;
+HPMHooks.source.strlib = *strlib;
+HPMHooks.source.sv = *sv;
+HPMHooks.source.sysinfo = *sysinfo;
+HPMHooks.source.thread = *thread;
+HPMHooks.source.timer = *timer;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
index ce78fdd7e..57c1e0233 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,6 +23,8 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
struct {
struct HPMHookPoint *HP_HCache_init_pre;
struct HPMHookPoint *HP_HCache_init_post;
@@ -90,14 +92,64 @@ struct {
struct HPMHookPoint *HP_DB_init_post;
struct HPMHookPoint *HP_DB_final_pre;
struct HPMHookPoint *HP_DB_final_post;
+ struct HPMHookPoint *HP_des_decrypt_block_pre;
+ struct HPMHookPoint *HP_des_decrypt_block_post;
+ struct HPMHookPoint *HP_des_decrypt_pre;
+ struct HPMHookPoint *HP_des_decrypt_post;
+ struct HPMHookPoint *HP_lclif_init_pre;
+ struct HPMHookPoint *HP_lclif_init_post;
+ struct HPMHookPoint *HP_lclif_final_pre;
+ struct HPMHookPoint *HP_lclif_final_post;
+ struct HPMHookPoint *HP_lclif_connection_error_pre;
+ struct HPMHookPoint *HP_lclif_connection_error_post;
+ struct HPMHookPoint *HP_lclif_server_list_pre;
+ struct HPMHookPoint *HP_lclif_server_list_post;
+ struct HPMHookPoint *HP_lclif_auth_failed_pre;
+ struct HPMHookPoint *HP_lclif_auth_failed_post;
+ struct HPMHookPoint *HP_lclif_login_error_pre;
+ struct HPMHookPoint *HP_lclif_login_error_post;
+ struct HPMHookPoint *HP_lclif_coding_key_pre;
+ struct HPMHookPoint *HP_lclif_coding_key_post;
+ struct HPMHookPoint *HP_lclif_packet_pre;
+ struct HPMHookPoint *HP_lclif_packet_post;
+ struct HPMHookPoint *HP_lclif_parse_packet_pre;
+ struct HPMHookPoint *HP_lclif_parse_packet_post;
+ struct HPMHookPoint *HP_lclif_parse_pre;
+ struct HPMHookPoint *HP_lclif_parse_post;
+ struct HPMHookPoint *HP_PRIV__lclif_packetdb_loaddb_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_packetdb_loaddb_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_sub_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_sub_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN2_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN2_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN3_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN3_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN4_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN4_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_HAN_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_LOGIN_HAN_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_REQ_HASH_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_REQ_HASH_post;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre;
+ struct HPMHookPoint *HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post;
struct HPMHookPoint *HP_libconfig_read_pre;
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
struct HPMHookPoint *HP_libconfig_write_post;
- struct HPMHookPoint *HP_libconfig_set_auto_convert_pre;
- struct HPMHookPoint *HP_libconfig_set_auto_convert_post;
- struct HPMHookPoint *HP_libconfig_get_auto_convert_pre;
- struct HPMHookPoint *HP_libconfig_get_auto_convert_post;
+ struct HPMHookPoint *HP_libconfig_set_options_pre;
+ struct HPMHookPoint *HP_libconfig_set_options_post;
+ struct HPMHookPoint *HP_libconfig_get_options_pre;
+ struct HPMHookPoint *HP_libconfig_get_options_post;
struct HPMHookPoint *HP_libconfig_read_string_pre;
struct HPMHookPoint *HP_libconfig_read_string_post;
struct HPMHookPoint *HP_libconfig_read_file_src_pre;
@@ -122,6 +174,8 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_get_bool_post;
struct HPMHookPoint *HP_libconfig_setting_get_string_pre;
struct HPMHookPoint *HP_libconfig_setting_get_string_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_post;
struct HPMHookPoint *HP_libconfig_setting_lookup_int_pre;
struct HPMHookPoint *HP_libconfig_setting_lookup_int_post;
struct HPMHookPoint *HP_libconfig_setting_lookup_int64_pre;
@@ -184,8 +238,6 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_set_hook_post;
struct HPMHookPoint *HP_libconfig_lookup_pre;
struct HPMHookPoint *HP_libconfig_lookup_post;
- struct HPMHookPoint *HP_libconfig_lookup_from_pre;
- struct HPMHookPoint *HP_libconfig_lookup_from_post;
struct HPMHookPoint *HP_libconfig_lookup_int_pre;
struct HPMHookPoint *HP_libconfig_lookup_int_post;
struct HPMHookPoint *HP_libconfig_lookup_int64_pre;
@@ -196,8 +248,8 @@ struct {
struct HPMHookPoint *HP_libconfig_lookup_bool_post;
struct HPMHookPoint *HP_libconfig_lookup_string_pre;
struct HPMHookPoint *HP_libconfig_lookup_string_post;
- struct HPMHookPoint *HP_libconfig_read_file_pre;
- struct HPMHookPoint *HP_libconfig_read_file_post;
+ struct HPMHookPoint *HP_libconfig_load_file_pre;
+ struct HPMHookPoint *HP_libconfig_load_file_post;
struct HPMHookPoint *HP_libconfig_setting_copy_simple_pre;
struct HPMHookPoint *HP_libconfig_setting_copy_simple_post;
struct HPMHookPoint *HP_libconfig_setting_copy_elem_pre;
@@ -206,6 +258,26 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_copy_aggregate_post;
struct HPMHookPoint *HP_libconfig_setting_copy_pre;
struct HPMHookPoint *HP_libconfig_setting_copy_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_bool_real_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_bool_real_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint32_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint32_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint16_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_int16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_int16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_bool_real_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_bool_real_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint32_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint32_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_int16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_int16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_mutable_string_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_mutable_string_post;
+ struct HPMHookPoint *HP_libconfig_lookup_mutable_string_pre;
+ struct HPMHookPoint *HP_libconfig_lookup_mutable_string_post;
struct HPMHookPoint *HP_login_mmo_auth_pre;
struct HPMHookPoint *HP_login_mmo_auth_post;
struct HPMHookPoint *HP_login_mmo_auth_new_pre;
@@ -288,64 +360,66 @@ struct {
struct HPMHookPoint *HP_login_fromchar_parse_accinfo_post;
struct HPMHookPoint *HP_login_parse_fromchar_pre;
struct HPMHookPoint *HP_login_parse_fromchar_post;
- struct HPMHookPoint *HP_login_connection_problem_pre;
- struct HPMHookPoint *HP_login_connection_problem_post;
struct HPMHookPoint *HP_login_kick_pre;
struct HPMHookPoint *HP_login_kick_post;
struct HPMHookPoint *HP_login_auth_ok_pre;
struct HPMHookPoint *HP_login_auth_ok_post;
struct HPMHookPoint *HP_login_auth_failed_pre;
struct HPMHookPoint *HP_login_auth_failed_post;
- struct HPMHookPoint *HP_login_login_error_pre;
- struct HPMHookPoint *HP_login_login_error_post;
- struct HPMHookPoint *HP_login_parse_ping_pre;
- struct HPMHookPoint *HP_login_parse_ping_post;
- struct HPMHookPoint *HP_login_parse_client_md5_pre;
- struct HPMHookPoint *HP_login_parse_client_md5_post;
- struct HPMHookPoint *HP_login_parse_client_login_pre;
- struct HPMHookPoint *HP_login_parse_client_login_post;
- struct HPMHookPoint *HP_login_send_coding_key_pre;
- struct HPMHookPoint *HP_login_send_coding_key_post;
- struct HPMHookPoint *HP_login_parse_request_coding_key_pre;
- struct HPMHookPoint *HP_login_parse_request_coding_key_post;
+ struct HPMHookPoint *HP_login_client_login_pre;
+ struct HPMHookPoint *HP_login_client_login_post;
struct HPMHookPoint *HP_login_char_server_connection_status_pre;
struct HPMHookPoint *HP_login_char_server_connection_status_post;
struct HPMHookPoint *HP_login_parse_request_connection_pre;
struct HPMHookPoint *HP_login_parse_request_connection_post;
- struct HPMHookPoint *HP_login_parse_login_pre;
- struct HPMHookPoint *HP_login_parse_login_post;
struct HPMHookPoint *HP_login_config_set_defaults_pre;
struct HPMHookPoint *HP_login_config_set_defaults_post;
struct HPMHookPoint *HP_login_config_read_pre;
struct HPMHookPoint *HP_login_config_read_post;
- struct HPMHookPoint *HP_iMalloc_init_pre;
- struct HPMHookPoint *HP_iMalloc_init_post;
- struct HPMHookPoint *HP_iMalloc_final_pre;
- struct HPMHookPoint *HP_iMalloc_final_post;
- struct HPMHookPoint *HP_iMalloc_malloc_pre;
- struct HPMHookPoint *HP_iMalloc_malloc_post;
- struct HPMHookPoint *HP_iMalloc_calloc_pre;
- struct HPMHookPoint *HP_iMalloc_calloc_post;
- struct HPMHookPoint *HP_iMalloc_realloc_pre;
- struct HPMHookPoint *HP_iMalloc_realloc_post;
- struct HPMHookPoint *HP_iMalloc_reallocz_pre;
- struct HPMHookPoint *HP_iMalloc_reallocz_post;
- struct HPMHookPoint *HP_iMalloc_astrdup_pre;
- struct HPMHookPoint *HP_iMalloc_astrdup_post;
- struct HPMHookPoint *HP_iMalloc_free_pre;
- struct HPMHookPoint *HP_iMalloc_free_post;
- struct HPMHookPoint *HP_iMalloc_memory_check_pre;
- struct HPMHookPoint *HP_iMalloc_memory_check_post;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_pre;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_post;
- struct HPMHookPoint *HP_iMalloc_usage_pre;
- struct HPMHookPoint *HP_iMalloc_usage_post;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_pre;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_post;
- struct HPMHookPoint *HP_iMalloc_init_messages_pre;
- struct HPMHookPoint *HP_iMalloc_init_messages_post;
+ struct HPMHookPoint *HP_md5_string_pre;
+ struct HPMHookPoint *HP_md5_string_post;
+ struct HPMHookPoint *HP_md5_binary_pre;
+ struct HPMHookPoint *HP_md5_binary_post;
+ struct HPMHookPoint *HP_md5_salt_pre;
+ struct HPMHookPoint *HP_md5_salt_post;
+ struct HPMHookPoint *HP_mutex_create_pre;
+ struct HPMHookPoint *HP_mutex_create_post;
+ struct HPMHookPoint *HP_mutex_destroy_pre;
+ struct HPMHookPoint *HP_mutex_destroy_post;
+ struct HPMHookPoint *HP_mutex_lock_pre;
+ struct HPMHookPoint *HP_mutex_lock_post;
+ struct HPMHookPoint *HP_mutex_trylock_pre;
+ struct HPMHookPoint *HP_mutex_trylock_post;
+ struct HPMHookPoint *HP_mutex_unlock_pre;
+ struct HPMHookPoint *HP_mutex_unlock_post;
+ struct HPMHookPoint *HP_mutex_cond_create_pre;
+ struct HPMHookPoint *HP_mutex_cond_create_post;
+ struct HPMHookPoint *HP_mutex_cond_destroy_pre;
+ struct HPMHookPoint *HP_mutex_cond_destroy_post;
+ struct HPMHookPoint *HP_mutex_cond_wait_pre;
+ struct HPMHookPoint *HP_mutex_cond_wait_post;
+ struct HPMHookPoint *HP_mutex_cond_signal_pre;
+ struct HPMHookPoint *HP_mutex_cond_signal_post;
+ struct HPMHookPoint *HP_mutex_cond_broadcast_pre;
+ struct HPMHookPoint *HP_mutex_cond_broadcast_post;
struct HPMHookPoint *HP_nullpo_assert_report_pre;
struct HPMHookPoint *HP_nullpo_assert_report_post;
+ struct HPMHookPoint *HP_rnd_init_pre;
+ struct HPMHookPoint *HP_rnd_init_post;
+ struct HPMHookPoint *HP_rnd_final_pre;
+ struct HPMHookPoint *HP_rnd_final_post;
+ struct HPMHookPoint *HP_rnd_seed_pre;
+ struct HPMHookPoint *HP_rnd_seed_post;
+ struct HPMHookPoint *HP_rnd_random_pre;
+ struct HPMHookPoint *HP_rnd_random_post;
+ struct HPMHookPoint *HP_rnd_roll_pre;
+ struct HPMHookPoint *HP_rnd_roll_post;
+ struct HPMHookPoint *HP_rnd_value_pre;
+ struct HPMHookPoint *HP_rnd_value_post;
+ struct HPMHookPoint *HP_rnd_uniform_pre;
+ struct HPMHookPoint *HP_rnd_uniform_post;
+ struct HPMHookPoint *HP_rnd_uniform53_pre;
+ struct HPMHookPoint *HP_rnd_uniform53_post;
struct HPMHookPoint *HP_showmsg_init_pre;
struct HPMHookPoint *HP_showmsg_init_post;
struct HPMHookPoint *HP_showmsg_final_pre;
@@ -556,6 +630,8 @@ struct {
struct HPMHookPoint *HP_sysinfo_compiler_post;
struct HPMHookPoint *HP_sysinfo_cflags_pre;
struct HPMHookPoint *HP_sysinfo_cflags_post;
+ struct HPMHookPoint *HP_sysinfo_time_pre;
+ struct HPMHookPoint *HP_sysinfo_time_post;
struct HPMHookPoint *HP_sysinfo_vcstype_pre;
struct HPMHookPoint *HP_sysinfo_vcstype_post;
struct HPMHookPoint *HP_sysinfo_vcstypeid_pre;
@@ -572,6 +648,28 @@ struct {
struct HPMHookPoint *HP_sysinfo_init_post;
struct HPMHookPoint *HP_sysinfo_final_pre;
struct HPMHookPoint *HP_sysinfo_final_post;
+ struct HPMHookPoint *HP_thread_init_pre;
+ struct HPMHookPoint *HP_thread_init_post;
+ struct HPMHookPoint *HP_thread_final_pre;
+ struct HPMHookPoint *HP_thread_final_post;
+ struct HPMHookPoint *HP_thread_create_pre;
+ struct HPMHookPoint *HP_thread_create_post;
+ struct HPMHookPoint *HP_thread_create_opt_pre;
+ struct HPMHookPoint *HP_thread_create_opt_post;
+ struct HPMHookPoint *HP_thread_destroy_pre;
+ struct HPMHookPoint *HP_thread_destroy_post;
+ struct HPMHookPoint *HP_thread_self_pre;
+ struct HPMHookPoint *HP_thread_self_post;
+ struct HPMHookPoint *HP_thread_get_tid_pre;
+ struct HPMHookPoint *HP_thread_get_tid_post;
+ struct HPMHookPoint *HP_thread_wait_pre;
+ struct HPMHookPoint *HP_thread_wait_post;
+ struct HPMHookPoint *HP_thread_prio_set_pre;
+ struct HPMHookPoint *HP_thread_prio_set_post;
+ struct HPMHookPoint *HP_thread_prio_get_pre;
+ struct HPMHookPoint *HP_thread_prio_get_post;
+ struct HPMHookPoint *HP_thread_yield_pre;
+ struct HPMHookPoint *HP_thread_yield_post;
struct HPMHookPoint *HP_timer_gettick_pre;
struct HPMHookPoint *HP_timer_gettick_post;
struct HPMHookPoint *HP_timer_gettick_nocache_pre;
@@ -667,14 +765,64 @@ struct {
int HP_DB_init_post;
int HP_DB_final_pre;
int HP_DB_final_post;
+ int HP_des_decrypt_block_pre;
+ int HP_des_decrypt_block_post;
+ int HP_des_decrypt_pre;
+ int HP_des_decrypt_post;
+ int HP_lclif_init_pre;
+ int HP_lclif_init_post;
+ int HP_lclif_final_pre;
+ int HP_lclif_final_post;
+ int HP_lclif_connection_error_pre;
+ int HP_lclif_connection_error_post;
+ int HP_lclif_server_list_pre;
+ int HP_lclif_server_list_post;
+ int HP_lclif_auth_failed_pre;
+ int HP_lclif_auth_failed_post;
+ int HP_lclif_login_error_pre;
+ int HP_lclif_login_error_post;
+ int HP_lclif_coding_key_pre;
+ int HP_lclif_coding_key_post;
+ int HP_lclif_packet_pre;
+ int HP_lclif_packet_post;
+ int HP_lclif_parse_packet_pre;
+ int HP_lclif_parse_packet_post;
+ int HP_lclif_parse_pre;
+ int HP_lclif_parse_post;
+ int HP_PRIV__lclif_packetdb_loaddb_pre;
+ int HP_PRIV__lclif_packetdb_loaddb_post;
+ int HP_PRIV__lclif_parse_sub_pre;
+ int HP_PRIV__lclif_parse_sub_post;
+ int HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_pre;
+ int HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_post;
+ int HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_pre;
+ int HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_post;
+ int HP_PRIV__lclif_parse_CA_LOGIN_pre;
+ int HP_PRIV__lclif_parse_CA_LOGIN_post;
+ int HP_PRIV__lclif_parse_CA_LOGIN2_pre;
+ int HP_PRIV__lclif_parse_CA_LOGIN2_post;
+ int HP_PRIV__lclif_parse_CA_LOGIN3_pre;
+ int HP_PRIV__lclif_parse_CA_LOGIN3_post;
+ int HP_PRIV__lclif_parse_CA_LOGIN4_pre;
+ int HP_PRIV__lclif_parse_CA_LOGIN4_post;
+ int HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_pre;
+ int HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_post;
+ int HP_PRIV__lclif_parse_CA_LOGIN_HAN_pre;
+ int HP_PRIV__lclif_parse_CA_LOGIN_HAN_post;
+ int HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre;
+ int HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post;
+ int HP_PRIV__lclif_parse_CA_REQ_HASH_pre;
+ int HP_PRIV__lclif_parse_CA_REQ_HASH_post;
+ int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre;
+ int HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post;
int HP_libconfig_read_pre;
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
int HP_libconfig_write_post;
- int HP_libconfig_set_auto_convert_pre;
- int HP_libconfig_set_auto_convert_post;
- int HP_libconfig_get_auto_convert_pre;
- int HP_libconfig_get_auto_convert_post;
+ int HP_libconfig_set_options_pre;
+ int HP_libconfig_set_options_post;
+ int HP_libconfig_get_options_pre;
+ int HP_libconfig_get_options_post;
int HP_libconfig_read_string_pre;
int HP_libconfig_read_string_post;
int HP_libconfig_read_file_src_pre;
@@ -699,6 +847,8 @@ struct {
int HP_libconfig_setting_get_bool_post;
int HP_libconfig_setting_get_string_pre;
int HP_libconfig_setting_get_string_post;
+ int HP_libconfig_setting_lookup_pre;
+ int HP_libconfig_setting_lookup_post;
int HP_libconfig_setting_lookup_int_pre;
int HP_libconfig_setting_lookup_int_post;
int HP_libconfig_setting_lookup_int64_pre;
@@ -761,8 +911,6 @@ struct {
int HP_libconfig_setting_set_hook_post;
int HP_libconfig_lookup_pre;
int HP_libconfig_lookup_post;
- int HP_libconfig_lookup_from_pre;
- int HP_libconfig_lookup_from_post;
int HP_libconfig_lookup_int_pre;
int HP_libconfig_lookup_int_post;
int HP_libconfig_lookup_int64_pre;
@@ -773,8 +921,8 @@ struct {
int HP_libconfig_lookup_bool_post;
int HP_libconfig_lookup_string_pre;
int HP_libconfig_lookup_string_post;
- int HP_libconfig_read_file_pre;
- int HP_libconfig_read_file_post;
+ int HP_libconfig_load_file_pre;
+ int HP_libconfig_load_file_post;
int HP_libconfig_setting_copy_simple_pre;
int HP_libconfig_setting_copy_simple_post;
int HP_libconfig_setting_copy_elem_pre;
@@ -783,6 +931,26 @@ struct {
int HP_libconfig_setting_copy_aggregate_post;
int HP_libconfig_setting_copy_pre;
int HP_libconfig_setting_copy_post;
+ int HP_libconfig_setting_get_bool_real_pre;
+ int HP_libconfig_setting_get_bool_real_post;
+ int HP_libconfig_setting_get_uint32_pre;
+ int HP_libconfig_setting_get_uint32_post;
+ int HP_libconfig_setting_get_uint16_pre;
+ int HP_libconfig_setting_get_uint16_post;
+ int HP_libconfig_setting_get_int16_pre;
+ int HP_libconfig_setting_get_int16_post;
+ int HP_libconfig_setting_lookup_bool_real_pre;
+ int HP_libconfig_setting_lookup_bool_real_post;
+ int HP_libconfig_setting_lookup_uint32_pre;
+ int HP_libconfig_setting_lookup_uint32_post;
+ int HP_libconfig_setting_lookup_uint16_pre;
+ int HP_libconfig_setting_lookup_uint16_post;
+ int HP_libconfig_setting_lookup_int16_pre;
+ int HP_libconfig_setting_lookup_int16_post;
+ int HP_libconfig_setting_lookup_mutable_string_pre;
+ int HP_libconfig_setting_lookup_mutable_string_post;
+ int HP_libconfig_lookup_mutable_string_pre;
+ int HP_libconfig_lookup_mutable_string_post;
int HP_login_mmo_auth_pre;
int HP_login_mmo_auth_post;
int HP_login_mmo_auth_new_pre;
@@ -865,64 +1033,66 @@ struct {
int HP_login_fromchar_parse_accinfo_post;
int HP_login_parse_fromchar_pre;
int HP_login_parse_fromchar_post;
- int HP_login_connection_problem_pre;
- int HP_login_connection_problem_post;
int HP_login_kick_pre;
int HP_login_kick_post;
int HP_login_auth_ok_pre;
int HP_login_auth_ok_post;
int HP_login_auth_failed_pre;
int HP_login_auth_failed_post;
- int HP_login_login_error_pre;
- int HP_login_login_error_post;
- int HP_login_parse_ping_pre;
- int HP_login_parse_ping_post;
- int HP_login_parse_client_md5_pre;
- int HP_login_parse_client_md5_post;
- int HP_login_parse_client_login_pre;
- int HP_login_parse_client_login_post;
- int HP_login_send_coding_key_pre;
- int HP_login_send_coding_key_post;
- int HP_login_parse_request_coding_key_pre;
- int HP_login_parse_request_coding_key_post;
+ int HP_login_client_login_pre;
+ int HP_login_client_login_post;
int HP_login_char_server_connection_status_pre;
int HP_login_char_server_connection_status_post;
int HP_login_parse_request_connection_pre;
int HP_login_parse_request_connection_post;
- int HP_login_parse_login_pre;
- int HP_login_parse_login_post;
int HP_login_config_set_defaults_pre;
int HP_login_config_set_defaults_post;
int HP_login_config_read_pre;
int HP_login_config_read_post;
- int HP_iMalloc_init_pre;
- int HP_iMalloc_init_post;
- int HP_iMalloc_final_pre;
- int HP_iMalloc_final_post;
- int HP_iMalloc_malloc_pre;
- int HP_iMalloc_malloc_post;
- int HP_iMalloc_calloc_pre;
- int HP_iMalloc_calloc_post;
- int HP_iMalloc_realloc_pre;
- int HP_iMalloc_realloc_post;
- int HP_iMalloc_reallocz_pre;
- int HP_iMalloc_reallocz_post;
- int HP_iMalloc_astrdup_pre;
- int HP_iMalloc_astrdup_post;
- int HP_iMalloc_free_pre;
- int HP_iMalloc_free_post;
- int HP_iMalloc_memory_check_pre;
- int HP_iMalloc_memory_check_post;
- int HP_iMalloc_verify_ptr_pre;
- int HP_iMalloc_verify_ptr_post;
- int HP_iMalloc_usage_pre;
- int HP_iMalloc_usage_post;
- int HP_iMalloc_post_shutdown_pre;
- int HP_iMalloc_post_shutdown_post;
- int HP_iMalloc_init_messages_pre;
- int HP_iMalloc_init_messages_post;
+ int HP_md5_string_pre;
+ int HP_md5_string_post;
+ int HP_md5_binary_pre;
+ int HP_md5_binary_post;
+ int HP_md5_salt_pre;
+ int HP_md5_salt_post;
+ int HP_mutex_create_pre;
+ int HP_mutex_create_post;
+ int HP_mutex_destroy_pre;
+ int HP_mutex_destroy_post;
+ int HP_mutex_lock_pre;
+ int HP_mutex_lock_post;
+ int HP_mutex_trylock_pre;
+ int HP_mutex_trylock_post;
+ int HP_mutex_unlock_pre;
+ int HP_mutex_unlock_post;
+ int HP_mutex_cond_create_pre;
+ int HP_mutex_cond_create_post;
+ int HP_mutex_cond_destroy_pre;
+ int HP_mutex_cond_destroy_post;
+ int HP_mutex_cond_wait_pre;
+ int HP_mutex_cond_wait_post;
+ int HP_mutex_cond_signal_pre;
+ int HP_mutex_cond_signal_post;
+ int HP_mutex_cond_broadcast_pre;
+ int HP_mutex_cond_broadcast_post;
int HP_nullpo_assert_report_pre;
int HP_nullpo_assert_report_post;
+ int HP_rnd_init_pre;
+ int HP_rnd_init_post;
+ int HP_rnd_final_pre;
+ int HP_rnd_final_post;
+ int HP_rnd_seed_pre;
+ int HP_rnd_seed_post;
+ int HP_rnd_random_pre;
+ int HP_rnd_random_post;
+ int HP_rnd_roll_pre;
+ int HP_rnd_roll_post;
+ int HP_rnd_value_pre;
+ int HP_rnd_value_post;
+ int HP_rnd_uniform_pre;
+ int HP_rnd_uniform_post;
+ int HP_rnd_uniform53_pre;
+ int HP_rnd_uniform53_post;
int HP_showmsg_init_pre;
int HP_showmsg_init_post;
int HP_showmsg_final_pre;
@@ -1133,6 +1303,8 @@ struct {
int HP_sysinfo_compiler_post;
int HP_sysinfo_cflags_pre;
int HP_sysinfo_cflags_post;
+ int HP_sysinfo_time_pre;
+ int HP_sysinfo_time_post;
int HP_sysinfo_vcstype_pre;
int HP_sysinfo_vcstype_post;
int HP_sysinfo_vcstypeid_pre;
@@ -1149,6 +1321,28 @@ struct {
int HP_sysinfo_init_post;
int HP_sysinfo_final_pre;
int HP_sysinfo_final_post;
+ int HP_thread_init_pre;
+ int HP_thread_init_post;
+ int HP_thread_final_pre;
+ int HP_thread_final_post;
+ int HP_thread_create_pre;
+ int HP_thread_create_post;
+ int HP_thread_create_opt_pre;
+ int HP_thread_create_opt_post;
+ int HP_thread_destroy_pre;
+ int HP_thread_destroy_post;
+ int HP_thread_self_pre;
+ int HP_thread_self_post;
+ int HP_thread_get_tid_pre;
+ int HP_thread_get_tid_post;
+ int HP_thread_wait_pre;
+ int HP_thread_wait_post;
+ int HP_thread_prio_set_pre;
+ int HP_thread_prio_set_post;
+ int HP_thread_prio_get_pre;
+ int HP_thread_prio_get_post;
+ int HP_thread_yield_pre;
+ int HP_thread_yield_post;
int HP_timer_gettick_pre;
int HP_timer_gettick_post;
int HP_timer_gettick_nocache_pre;
@@ -1183,10 +1377,15 @@ struct {
struct console_interface console;
struct core_interface core;
struct db_interface DB;
+ struct des_interface des;
+ struct lclif_interface lclif;
+ struct lclif_interface_private PRIV__lclif;
struct libconfig_interface libconfig;
struct login_interface login;
- struct malloc_interface iMalloc;
+ struct md5_interface md5;
+ struct mutex_interface mutex;
struct nullpo_interface nullpo;
+ struct rnd_interface rnd;
struct showmsg_interface showmsg;
struct socket_interface sockt;
struct sql_interface SQL;
@@ -1194,5 +1393,6 @@ struct {
struct strlib_interface strlib;
struct sv_interface sv;
struct sysinfo_interface sysinfo;
+ struct thread_interface thread;
struct timer_interface timer;
} source;
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
index 5be52d51e..125c54a12 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
@@ -1,7 +1,8 @@
/**
* This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -22,26 +23,28 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
struct HookingPointData HookingPoints[] = {
-/* HCache */
+/* HCache_interface */
{ HP_POP(HCache->init, HP_HCache_init) },
{ HP_POP(HCache->check, HP_HCache_check) },
{ HP_POP(HCache->open, HP_HCache_open) },
-/* cmdline */
+/* cmdline_interface */
{ HP_POP(cmdline->init, HP_cmdline_init) },
{ HP_POP(cmdline->final, HP_cmdline_final) },
{ HP_POP(cmdline->arg_add, HP_cmdline_arg_add) },
{ HP_POP(cmdline->exec, HP_cmdline_exec) },
{ HP_POP(cmdline->arg_next_value, HP_cmdline_arg_next_value) },
{ HP_POP(cmdline->arg_source, HP_cmdline_arg_source) },
-/* console */
+/* console_interface */
{ HP_POP(console->init, HP_console_init) },
{ HP_POP(console->final, HP_console_final) },
{ HP_POP(console->display_title, HP_console_display_title) },
{ HP_POP(console->display_gplnotice, HP_console_display_gplnotice) },
-/* core */
+/* core_interface */
{ HP_POP(core->shutdown_callback, HP_core_shutdown_callback) },
-/* DB */
+/* db_interface */
{ HP_POP(DB->fix_options, HP_DB_fix_options) },
{ HP_POP(DB->default_cmp, HP_DB_default_cmp) },
{ HP_POP(DB->default_hash, HP_DB_default_hash) },
@@ -61,11 +64,39 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(DB->data2ptr, HP_DB_data2ptr) },
{ HP_POP(DB->init, HP_DB_init) },
{ HP_POP(DB->final, HP_DB_final) },
-/* libconfig */
+/* des_interface */
+ { HP_POP(des->decrypt_block, HP_des_decrypt_block) },
+ { HP_POP(des->decrypt, HP_des_decrypt) },
+/* lclif_interface */
+ { HP_POP(lclif->init, HP_lclif_init) },
+ { HP_POP(lclif->final, HP_lclif_final) },
+ { HP_POP(lclif->connection_error, HP_lclif_connection_error) },
+ { HP_POP(lclif->server_list, HP_lclif_server_list) },
+ { HP_POP(lclif->auth_failed, HP_lclif_auth_failed) },
+ { HP_POP(lclif->login_error, HP_lclif_login_error) },
+ { HP_POP(lclif->coding_key, HP_lclif_coding_key) },
+ { HP_POP(lclif->packet, HP_lclif_packet) },
+ { HP_POP(lclif->parse_packet, HP_lclif_parse_packet) },
+ { HP_POP(lclif->parse, HP_lclif_parse) },
+/* lclif_interface_private */
+ { HP_POP(lclif->p->packetdb_loaddb, HP_PRIV__lclif_packetdb_loaddb) },
+ { HP_POP(lclif->p->parse_sub, HP_PRIV__lclif_parse_sub) },
+ { HP_POP(lclif->p->parse_CA_CONNECT_INFO_CHANGED, HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED) },
+ { HP_POP(lclif->p->parse_CA_EXE_HASHCHECK, HP_PRIV__lclif_parse_CA_EXE_HASHCHECK) },
+ { HP_POP(lclif->p->parse_CA_LOGIN, HP_PRIV__lclif_parse_CA_LOGIN) },
+ { HP_POP(lclif->p->parse_CA_LOGIN2, HP_PRIV__lclif_parse_CA_LOGIN2) },
+ { HP_POP(lclif->p->parse_CA_LOGIN3, HP_PRIV__lclif_parse_CA_LOGIN3) },
+ { HP_POP(lclif->p->parse_CA_LOGIN4, HP_PRIV__lclif_parse_CA_LOGIN4) },
+ { HP_POP(lclif->p->parse_CA_LOGIN_PCBANG, HP_PRIV__lclif_parse_CA_LOGIN_PCBANG) },
+ { HP_POP(lclif->p->parse_CA_LOGIN_HAN, HP_PRIV__lclif_parse_CA_LOGIN_HAN) },
+ { HP_POP(lclif->p->parse_CA_SSO_LOGIN_REQ, HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ) },
+ { HP_POP(lclif->p->parse_CA_REQ_HASH, HP_PRIV__lclif_parse_CA_REQ_HASH) },
+ { HP_POP(lclif->p->parse_CA_CHARSERVERCONNECT, HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT) },
+/* libconfig_interface */
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
- { HP_POP(libconfig->set_auto_convert, HP_libconfig_set_auto_convert) },
- { HP_POP(libconfig->get_auto_convert, HP_libconfig_get_auto_convert) },
+ { HP_POP(libconfig->set_options, HP_libconfig_set_options) },
+ { HP_POP(libconfig->get_options, HP_libconfig_get_options) },
{ HP_POP(libconfig->read_string, HP_libconfig_read_string) },
{ HP_POP(libconfig->read_file_src, HP_libconfig_read_file_src) },
{ HP_POP(libconfig->write_file, HP_libconfig_write_file) },
@@ -78,6 +109,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libconfig->setting_get_float, HP_libconfig_setting_get_float) },
{ HP_POP(libconfig->setting_get_bool, HP_libconfig_setting_get_bool) },
{ HP_POP(libconfig->setting_get_string, HP_libconfig_setting_get_string) },
+ { HP_POP(libconfig->setting_lookup, HP_libconfig_setting_lookup) },
{ HP_POP(libconfig->setting_lookup_int, HP_libconfig_setting_lookup_int) },
{ HP_POP(libconfig->setting_lookup_int64, HP_libconfig_setting_lookup_int64) },
{ HP_POP(libconfig->setting_lookup_float, HP_libconfig_setting_lookup_float) },
@@ -109,18 +141,27 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libconfig->setting_remove_elem, HP_libconfig_setting_remove_elem) },
{ HP_POP(libconfig->setting_set_hook, HP_libconfig_setting_set_hook) },
{ HP_POP(libconfig->lookup, HP_libconfig_lookup) },
- { HP_POP(libconfig->lookup_from, HP_libconfig_lookup_from) },
{ HP_POP(libconfig->lookup_int, HP_libconfig_lookup_int) },
{ HP_POP(libconfig->lookup_int64, HP_libconfig_lookup_int64) },
{ HP_POP(libconfig->lookup_float, HP_libconfig_lookup_float) },
{ HP_POP(libconfig->lookup_bool, HP_libconfig_lookup_bool) },
{ HP_POP(libconfig->lookup_string, HP_libconfig_lookup_string) },
- { HP_POP(libconfig->read_file, HP_libconfig_read_file) },
+ { HP_POP(libconfig->load_file, HP_libconfig_load_file) },
{ HP_POP(libconfig->setting_copy_simple, HP_libconfig_setting_copy_simple) },
{ HP_POP(libconfig->setting_copy_elem, HP_libconfig_setting_copy_elem) },
{ HP_POP(libconfig->setting_copy_aggregate, HP_libconfig_setting_copy_aggregate) },
{ HP_POP(libconfig->setting_copy, HP_libconfig_setting_copy) },
-/* login */
+ { HP_POP(libconfig->setting_get_bool_real, HP_libconfig_setting_get_bool_real) },
+ { HP_POP(libconfig->setting_get_uint32, HP_libconfig_setting_get_uint32) },
+ { HP_POP(libconfig->setting_get_uint16, HP_libconfig_setting_get_uint16) },
+ { HP_POP(libconfig->setting_get_int16, HP_libconfig_setting_get_int16) },
+ { HP_POP(libconfig->setting_lookup_bool_real, HP_libconfig_setting_lookup_bool_real) },
+ { HP_POP(libconfig->setting_lookup_uint32, HP_libconfig_setting_lookup_uint32) },
+ { HP_POP(libconfig->setting_lookup_uint16, HP_libconfig_setting_lookup_uint16) },
+ { HP_POP(libconfig->setting_lookup_int16, HP_libconfig_setting_lookup_int16) },
+ { HP_POP(libconfig->setting_lookup_mutable_string, HP_libconfig_setting_lookup_mutable_string) },
+ { HP_POP(libconfig->lookup_mutable_string, HP_libconfig_lookup_mutable_string) },
+/* login_interface */
{ HP_POP(login->mmo_auth, HP_login_mmo_auth) },
{ HP_POP(login->mmo_auth_new, HP_login_mmo_auth_new) },
{ HP_POP(login->waiting_disconnect_timer, HP_login_waiting_disconnect_timer) },
@@ -162,43 +203,46 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(login->fromchar_parse_wrong_pincode, HP_login_fromchar_parse_wrong_pincode) },
{ HP_POP(login->fromchar_parse_accinfo, HP_login_fromchar_parse_accinfo) },
{ HP_POP(login->parse_fromchar, HP_login_parse_fromchar) },
- { HP_POP(login->connection_problem, HP_login_connection_problem) },
{ HP_POP(login->kick, HP_login_kick) },
{ HP_POP(login->auth_ok, HP_login_auth_ok) },
{ HP_POP(login->auth_failed, HP_login_auth_failed) },
- { HP_POP(login->login_error, HP_login_login_error) },
- { HP_POP(login->parse_ping, HP_login_parse_ping) },
- { HP_POP(login->parse_client_md5, HP_login_parse_client_md5) },
- { HP_POP(login->parse_client_login, HP_login_parse_client_login) },
- { HP_POP(login->send_coding_key, HP_login_send_coding_key) },
- { HP_POP(login->parse_request_coding_key, HP_login_parse_request_coding_key) },
+ { HP_POP(login->client_login, HP_login_client_login) },
{ HP_POP(login->char_server_connection_status, HP_login_char_server_connection_status) },
{ HP_POP(login->parse_request_connection, HP_login_parse_request_connection) },
- { HP_POP(login->parse_login, HP_login_parse_login) },
{ HP_POP(login->config_set_defaults, HP_login_config_set_defaults) },
{ HP_POP(login->config_read, HP_login_config_read) },
-/* iMalloc */
- { HP_POP(iMalloc->init, HP_iMalloc_init) },
- { HP_POP(iMalloc->final, HP_iMalloc_final) },
- { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) },
- { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) },
- { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) },
- { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) },
- { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) },
- { HP_POP(iMalloc->free, HP_iMalloc_free) },
- { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) },
- { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) },
- { HP_POP(iMalloc->usage, HP_iMalloc_usage) },
- { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) },
- { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) },
-/* nullpo */
+/* md5_interface */
+ { HP_POP(md5->string, HP_md5_string) },
+ { HP_POP(md5->binary, HP_md5_binary) },
+ { HP_POP(md5->salt, HP_md5_salt) },
+/* mutex_interface */
+ { HP_POP(mutex->create, HP_mutex_create) },
+ { HP_POP(mutex->destroy, HP_mutex_destroy) },
+ { HP_POP(mutex->lock, HP_mutex_lock) },
+ { HP_POP(mutex->trylock, HP_mutex_trylock) },
+ { HP_POP(mutex->unlock, HP_mutex_unlock) },
+ { HP_POP(mutex->cond_create, HP_mutex_cond_create) },
+ { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) },
+ { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) },
+ { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) },
+ { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
+/* nullpo_interface */
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
-/* showmsg */
+/* rnd_interface */
+ { HP_POP(rnd->init, HP_rnd_init) },
+ { HP_POP(rnd->final, HP_rnd_final) },
+ { HP_POP(rnd->seed, HP_rnd_seed) },
+ { HP_POP(rnd->random, HP_rnd_random) },
+ { HP_POP(rnd->roll, HP_rnd_roll) },
+ { HP_POP(rnd->value, HP_rnd_value) },
+ { HP_POP(rnd->uniform, HP_rnd_uniform) },
+ { HP_POP(rnd->uniform53, HP_rnd_uniform53) },
+/* showmsg_interface */
{ HP_POP(showmsg->init, HP_showmsg_init) },
{ HP_POP(showmsg->final, HP_showmsg_final) },
{ HP_POP(showmsg->clearScreen, HP_showmsg_clearScreen) },
{ HP_POP(showmsg->showMessageV, HP_showmsg_showMessageV) },
-/* sockt */
+/* socket_interface */
{ HP_POP(sockt->init, HP_sockt_init) },
{ HP_POP(sockt->final, HP_sockt_final) },
{ HP_POP(sockt->perform, HP_sockt_perform) },
@@ -227,7 +271,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sockt->trusted_ip_check, HP_sockt_trusted_ip_check) },
{ HP_POP(sockt->net_config_read_sub, HP_sockt_net_config_read_sub) },
{ HP_POP(sockt->net_config_read, HP_sockt_net_config_read) },
-/* SQL */
+/* sql_interface */
{ HP_POP(SQL->Connect, HP_SQL_Connect) },
{ HP_POP(SQL->GetTimeout, HP_SQL_GetTimeout) },
{ HP_POP(SQL->GetColumnNames, HP_SQL_GetColumnNames) },
@@ -260,7 +304,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(SQL->StmtFreeResult, HP_SQL_StmtFreeResult) },
{ HP_POP(SQL->StmtFree, HP_SQL_StmtFree) },
{ HP_POP(SQL->StmtShowDebug_, HP_SQL_StmtShowDebug_) },
-/* StrBuf */
+/* stringbuf_interface */
{ HP_POP(StrBuf->Malloc, HP_StrBuf_Malloc) },
{ HP_POP(StrBuf->Init, HP_StrBuf_Init) },
{ HP_POP(StrBuf->Vprintf, HP_StrBuf_Vprintf) },
@@ -271,7 +315,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(StrBuf->Clear, HP_StrBuf_Clear) },
{ HP_POP(StrBuf->Destroy, HP_StrBuf_Destroy) },
{ HP_POP(StrBuf->Free, HP_StrBuf_Free) },
-/* strlib */
+/* strlib_interface */
{ HP_POP(strlib->jstrescape, HP_strlib_jstrescape) },
{ HP_POP(strlib->jstrescapecpy, HP_strlib_jstrescapecpy) },
{ HP_POP(strlib->jmemescapecpy, HP_strlib_jmemescapecpy) },
@@ -287,7 +331,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(strlib->safestrnlen_, HP_strlib_safestrnlen_) },
{ HP_POP(strlib->strline_, HP_strlib_strline_) },
{ HP_POP(strlib->bin2hex_, HP_strlib_bin2hex_) },
-/* sv */
+/* sv_interface */
{ HP_POP(sv->parse_next, HP_sv_parse_next) },
{ HP_POP(sv->parse, HP_sv_parse) },
{ HP_POP(sv->split, HP_sv_split) },
@@ -295,7 +339,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sv->unescape_c, HP_sv_unescape_c) },
{ HP_POP(sv->skip_escaped_c, HP_sv_skip_escaped_c) },
{ HP_POP(sv->readdb, HP_sv_readdb) },
-/* sysinfo */
+/* sysinfo_interface */
{ HP_POP(sysinfo->getpagesize, HP_sysinfo_getpagesize) },
{ HP_POP(sysinfo->platform, HP_sysinfo_platform) },
{ HP_POP(sysinfo->osversion, HP_sysinfo_osversion) },
@@ -305,6 +349,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sysinfo->is64bit, HP_sysinfo_is64bit) },
{ HP_POP(sysinfo->compiler, HP_sysinfo_compiler) },
{ HP_POP(sysinfo->cflags, HP_sysinfo_cflags) },
+ { HP_POP(sysinfo->time, HP_sysinfo_time) },
{ HP_POP(sysinfo->vcstype, HP_sysinfo_vcstype) },
{ HP_POP(sysinfo->vcstypeid, HP_sysinfo_vcstypeid) },
{ HP_POP(sysinfo->vcsrevision_src, HP_sysinfo_vcsrevision_src) },
@@ -313,7 +358,19 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) },
{ HP_POP(sysinfo->init, HP_sysinfo_init) },
{ HP_POP(sysinfo->final, HP_sysinfo_final) },
-/* timer */
+/* thread_interface */
+ { HP_POP(thread->init, HP_thread_init) },
+ { HP_POP(thread->final, HP_thread_final) },
+ { HP_POP(thread->create, HP_thread_create) },
+ { HP_POP(thread->create_opt, HP_thread_create_opt) },
+ { HP_POP(thread->destroy, HP_thread_destroy) },
+ { HP_POP(thread->self, HP_thread_self) },
+ { HP_POP(thread->get_tid, HP_thread_get_tid) },
+ { HP_POP(thread->wait, HP_thread_wait) },
+ { HP_POP(thread->prio_set, HP_thread_prio_set) },
+ { HP_POP(thread->prio_get, HP_thread_prio_get) },
+ { HP_POP(thread->yield, HP_thread_yield) },
+/* timer_interface */
{ HP_POP(timer->gettick, HP_timer_gettick) },
{ HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) },
{ HP_POP(timer->add, HP_timer_add) },
diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
index 670083e94..964d46b0a 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,17 +23,19 @@
* as it will get overwritten.
*/
-/* HCache */
+/* GENERATED FILE DO NOT EDIT */
+
+/* HCache_interface */
void HP_HCache_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_HCache_init_pre ) {
+ if (HPMHooks.count.HP_HCache_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41,9 +43,9 @@ void HP_HCache_init(void) {
{
HPMHooks.source.HCache.init();
}
- if( HPMHooks.count.HP_HCache_init_post ) {
+ if (HPMHooks.count.HP_HCache_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_init_post[hIndex].func;
postHookFunc();
}
@@ -53,14 +55,14 @@ void HP_HCache_init(void) {
bool HP_HCache_check(const char *file) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_HCache_check_pre ) {
- bool (*preHookFunc) (const char *file);
+ if (HPMHooks.count.HP_HCache_check_pre > 0) {
+ bool (*preHookFunc) (const char **file);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_check_pre[hIndex].func;
- retVal___ = preHookFunc(file);
+ retVal___ = preHookFunc(&file);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68,9 +70,9 @@ bool HP_HCache_check(const char *file) {
{
retVal___ = HPMHooks.source.HCache.check(file);
}
- if( HPMHooks.count.HP_HCache_check_post ) {
+ if (HPMHooks.count.HP_HCache_check_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *file);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_check_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file);
}
@@ -80,14 +82,14 @@ bool HP_HCache_check(const char *file) {
FILE* HP_HCache_open(const char *file, const char *opt) {
int hIndex = 0;
FILE* retVal___ = NULL;
- if( HPMHooks.count.HP_HCache_open_pre ) {
- FILE* (*preHookFunc) (const char *file, const char *opt);
+ if (HPMHooks.count.HP_HCache_open_pre > 0) {
+ FILE* (*preHookFunc) (const char **file, const char **opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_open_pre[hIndex].func;
- retVal___ = preHookFunc(file, opt);
+ retVal___ = preHookFunc(&file, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -95,26 +97,26 @@ FILE* HP_HCache_open(const char *file, const char *opt) {
{
retVal___ = HPMHooks.source.HCache.open(file, opt);
}
- if( HPMHooks.count.HP_HCache_open_post ) {
+ if (HPMHooks.count.HP_HCache_open_post > 0) {
FILE* (*postHookFunc) (FILE* retVal___, const char *file, const char *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file, opt);
}
}
return retVal___;
}
-/* cmdline */
+/* cmdline_interface */
void HP_cmdline_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_cmdline_init_pre ) {
+ if (HPMHooks.count.HP_cmdline_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -122,9 +124,9 @@ void HP_cmdline_init(void) {
{
HPMHooks.source.cmdline.init();
}
- if( HPMHooks.count.HP_cmdline_init_post ) {
+ if (HPMHooks.count.HP_cmdline_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_init_post[hIndex].func;
postHookFunc();
}
@@ -133,14 +135,14 @@ void HP_cmdline_init(void) {
}
void HP_cmdline_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_cmdline_final_pre ) {
+ if (HPMHooks.count.HP_cmdline_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -148,9 +150,9 @@ void HP_cmdline_final(void) {
{
HPMHooks.source.cmdline.final();
}
- if( HPMHooks.count.HP_cmdline_final_post ) {
+ if (HPMHooks.count.HP_cmdline_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_final_post[hIndex].func;
postHookFunc();
}
@@ -160,14 +162,14 @@ void HP_cmdline_final(void) {
bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_cmdline_arg_add_pre ) {
- bool (*preHookFunc) (unsigned int *pluginID, const char *name, char *shortname, CmdlineExecFunc *func, const char *help, unsigned int *options);
+ if (HPMHooks.count.HP_cmdline_arg_add_pre > 0) {
+ bool (*preHookFunc) (unsigned int *pluginID, const char **name, char *shortname, CmdlineExecFunc *func, const char **help, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_add_pre[hIndex].func;
- retVal___ = preHookFunc(&pluginID, name, &shortname, &func, help, &options);
+ retVal___ = preHookFunc(&pluginID, &name, &shortname, &func, &help, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -175,11 +177,11 @@ bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname,
{
retVal___ = HPMHooks.source.cmdline.arg_add(pluginID, name, shortname, func, help, options);
}
- if( HPMHooks.count.HP_cmdline_arg_add_post ) {
- bool (*postHookFunc) (bool retVal___, unsigned int *pluginID, const char *name, char *shortname, CmdlineExecFunc *func, const char *help, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_arg_add_post > 0) {
+ bool (*postHookFunc) (bool retVal___, unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pluginID, name, &shortname, &func, help, &options);
+ retVal___ = postHookFunc(retVal___, pluginID, name, shortname, func, help, options);
}
}
return retVal___;
@@ -187,14 +189,14 @@ bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname,
int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_cmdline_exec_pre ) {
- int (*preHookFunc) (int *argc, char **argv, unsigned int *options);
+ if (HPMHooks.count.HP_cmdline_exec_pre > 0) {
+ int (*preHookFunc) (int *argc, char ***argv, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_exec_pre[hIndex].func;
- retVal___ = preHookFunc(&argc, argv, &options);
+ retVal___ = preHookFunc(&argc, &argv, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -202,11 +204,11 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
{
retVal___ = HPMHooks.source.cmdline.exec(argc, argv, options);
}
- if( HPMHooks.count.HP_cmdline_exec_post ) {
- int (*postHookFunc) (int retVal___, int *argc, char **argv, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_exec_post > 0) {
+ int (*postHookFunc) (int retVal___, int argc, char **argv, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_exec_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &argc, argv, &options);
+ retVal___ = postHookFunc(retVal___, argc, argv, options);
}
}
return retVal___;
@@ -214,14 +216,14 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_cmdline_arg_next_value_pre ) {
- bool (*preHookFunc) (const char *name, int *current_arg, int *argc);
+ if (HPMHooks.count.HP_cmdline_arg_next_value_pre > 0) {
+ bool (*preHookFunc) (const char **name, int *current_arg, int *argc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_pre[hIndex].func;
- retVal___ = preHookFunc(name, &current_arg, &argc);
+ retVal___ = preHookFunc(&name, &current_arg, &argc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -229,11 +231,11 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
{
retVal___ = HPMHooks.source.cmdline.arg_next_value(name, current_arg, argc);
}
- if( HPMHooks.count.HP_cmdline_arg_next_value_post ) {
- bool (*postHookFunc) (bool retVal___, const char *name, int *current_arg, int *argc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_arg_next_value_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *name, int current_arg, int argc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &current_arg, &argc);
+ retVal___ = postHookFunc(retVal___, name, current_arg, argc);
}
}
return retVal___;
@@ -241,14 +243,14 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_cmdline_arg_source_pre ) {
- const char* (*preHookFunc) (struct CmdlineArgData *arg);
+ if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) {
+ const char* (*preHookFunc) (struct CmdlineArgData **arg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func;
- retVal___ = preHookFunc(arg);
+ retVal___ = preHookFunc(&arg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -256,26 +258,26 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) {
{
retVal___ = HPMHooks.source.cmdline.arg_source(arg);
}
- if( HPMHooks.count.HP_cmdline_arg_source_post ) {
+ if (HPMHooks.count.HP_cmdline_arg_source_post > 0) {
const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func;
retVal___ = postHookFunc(retVal___, arg);
}
}
return retVal___;
}
-/* console */
+/* console_interface */
void HP_console_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_init_pre ) {
+ if (HPMHooks.count.HP_console_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -283,9 +285,9 @@ void HP_console_init(void) {
{
HPMHooks.source.console.init();
}
- if( HPMHooks.count.HP_console_init_post ) {
+ if (HPMHooks.count.HP_console_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_init_post[hIndex].func;
postHookFunc();
}
@@ -294,14 +296,14 @@ void HP_console_init(void) {
}
void HP_console_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_final_pre ) {
+ if (HPMHooks.count.HP_console_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -309,9 +311,9 @@ void HP_console_final(void) {
{
HPMHooks.source.console.final();
}
- if( HPMHooks.count.HP_console_final_post ) {
+ if (HPMHooks.count.HP_console_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_final_post[hIndex].func;
postHookFunc();
}
@@ -320,14 +322,14 @@ void HP_console_final(void) {
}
void HP_console_display_title(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_display_title_pre ) {
+ if (HPMHooks.count.HP_console_display_title_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_display_title_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -335,9 +337,9 @@ void HP_console_display_title(void) {
{
HPMHooks.source.console.display_title();
}
- if( HPMHooks.count.HP_console_display_title_post ) {
+ if (HPMHooks.count.HP_console_display_title_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_display_title_post[hIndex].func;
postHookFunc();
}
@@ -346,14 +348,14 @@ void HP_console_display_title(void) {
}
void HP_console_display_gplnotice(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_display_gplnotice_pre ) {
+ if (HPMHooks.count.HP_console_display_gplnotice_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -361,26 +363,26 @@ void HP_console_display_gplnotice(void) {
{
HPMHooks.source.console.display_gplnotice();
}
- if( HPMHooks.count.HP_console_display_gplnotice_post ) {
+ if (HPMHooks.count.HP_console_display_gplnotice_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* core */
+/* core_interface */
void HP_core_shutdown_callback(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_core_shutdown_callback_pre ) {
+ if (HPMHooks.count.HP_core_shutdown_callback_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_core_shutdown_callback_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -388,27 +390,27 @@ void HP_core_shutdown_callback(void) {
{
HPMHooks.source.core.shutdown_callback();
}
- if( HPMHooks.count.HP_core_shutdown_callback_post ) {
+ if (HPMHooks.count.HP_core_shutdown_callback_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_core_shutdown_callback_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* DB */
-DBOptions HP_DB_fix_options(DBType type, DBOptions options) {
+/* db_interface */
+enum DBOptions HP_DB_fix_options(enum DBType type, enum DBOptions options) {
int hIndex = 0;
- DBOptions retVal___ = DB_OPT_BASE;
- if( HPMHooks.count.HP_DB_fix_options_pre ) {
- DBOptions (*preHookFunc) (DBType *type, DBOptions *options);
+ enum DBOptions retVal___ = DB_OPT_BASE;
+ if (HPMHooks.count.HP_DB_fix_options_pre > 0) {
+ enum DBOptions (*preHookFunc) (enum DBType *type, enum DBOptions *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_fix_options_pre[hIndex].func;
retVal___ = preHookFunc(&type, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -416,26 +418,26 @@ DBOptions HP_DB_fix_options(DBType type, DBOptions options) {
{
retVal___ = HPMHooks.source.DB.fix_options(type, options);
}
- if( HPMHooks.count.HP_DB_fix_options_post ) {
- DBOptions (*postHookFunc) (DBOptions retVal___, DBType *type, DBOptions *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_fix_options_post > 0) {
+ enum DBOptions (*postHookFunc) (enum DBOptions retVal___, enum DBType type, enum DBOptions options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_fix_options_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &options);
+ retVal___ = postHookFunc(retVal___, type, options);
}
}
return retVal___;
}
-DBComparator HP_DB_default_cmp(DBType type) {
+DBComparator HP_DB_default_cmp(enum DBType type) {
int hIndex = 0;
DBComparator retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_cmp_pre ) {
- DBComparator (*preHookFunc) (DBType *type);
+ if (HPMHooks.count.HP_DB_default_cmp_pre > 0) {
+ DBComparator (*preHookFunc) (enum DBType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_cmp_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -443,26 +445,26 @@ DBComparator HP_DB_default_cmp(DBType type) {
{
retVal___ = HPMHooks.source.DB.default_cmp(type);
}
- if( HPMHooks.count.HP_DB_default_cmp_post ) {
- DBComparator (*postHookFunc) (DBComparator retVal___, DBType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_cmp_post > 0) {
+ DBComparator (*postHookFunc) (DBComparator retVal___, enum DBType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_cmp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-DBHasher HP_DB_default_hash(DBType type) {
+DBHasher HP_DB_default_hash(enum DBType type) {
int hIndex = 0;
DBHasher retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_hash_pre ) {
- DBHasher (*preHookFunc) (DBType *type);
+ if (HPMHooks.count.HP_DB_default_hash_pre > 0) {
+ DBHasher (*preHookFunc) (enum DBType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_hash_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -470,26 +472,26 @@ DBHasher HP_DB_default_hash(DBType type) {
{
retVal___ = HPMHooks.source.DB.default_hash(type);
}
- if( HPMHooks.count.HP_DB_default_hash_post ) {
- DBHasher (*postHookFunc) (DBHasher retVal___, DBType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_hash_post > 0) {
+ DBHasher (*postHookFunc) (DBHasher retVal___, enum DBType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_hash_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-DBReleaser HP_DB_default_release(DBType type, DBOptions options) {
+DBReleaser HP_DB_default_release(enum DBType type, enum DBOptions options) {
int hIndex = 0;
DBReleaser retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_release_pre ) {
- DBReleaser (*preHookFunc) (DBType *type, DBOptions *options);
+ if (HPMHooks.count.HP_DB_default_release_pre > 0) {
+ DBReleaser (*preHookFunc) (enum DBType *type, enum DBOptions *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_release_pre[hIndex].func;
retVal___ = preHookFunc(&type, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -497,26 +499,26 @@ DBReleaser HP_DB_default_release(DBType type, DBOptions options) {
{
retVal___ = HPMHooks.source.DB.default_release(type, options);
}
- if( HPMHooks.count.HP_DB_default_release_post ) {
- DBReleaser (*postHookFunc) (DBReleaser retVal___, DBType *type, DBOptions *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_release_post > 0) {
+ DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBType type, enum DBOptions options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_release_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &options);
+ retVal___ = postHookFunc(retVal___, type, options);
}
}
return retVal___;
}
-DBReleaser HP_DB_custom_release(DBRelease which) {
+DBReleaser HP_DB_custom_release(enum DBReleaseOption which) {
int hIndex = 0;
DBReleaser retVal___ = NULL;
- if( HPMHooks.count.HP_DB_custom_release_pre ) {
- DBReleaser (*preHookFunc) (DBRelease *which);
+ if (HPMHooks.count.HP_DB_custom_release_pre > 0) {
+ DBReleaser (*preHookFunc) (enum DBReleaseOption *which);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_custom_release_pre[hIndex].func;
retVal___ = preHookFunc(&which);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -524,26 +526,26 @@ DBReleaser HP_DB_custom_release(DBRelease which) {
{
retVal___ = HPMHooks.source.DB.custom_release(which);
}
- if( HPMHooks.count.HP_DB_custom_release_post ) {
- DBReleaser (*postHookFunc) (DBReleaser retVal___, DBRelease *which);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_custom_release_post > 0) {
+ DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBReleaseOption which);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_custom_release_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &which);
+ retVal___ = postHookFunc(retVal___, which);
}
}
return retVal___;
}
-DBMap* HP_DB_alloc(const char *file, const char *func, int line, DBType type, DBOptions options, unsigned short maxlen) {
+struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) {
int hIndex = 0;
- DBMap* retVal___ = NULL;
- if( HPMHooks.count.HP_DB_alloc_pre ) {
- DBMap* (*preHookFunc) (const char *file, const char *func, int *line, DBType *type, DBOptions *options, unsigned short *maxlen);
+ struct DBMap* retVal___ = NULL;
+ if (HPMHooks.count.HP_DB_alloc_pre > 0) {
+ struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func;
- retVal___ = preHookFunc(file, func, &line, &type, &options, &maxlen);
+ retVal___ = preHookFunc(&file, &func, &line, &type, &options, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -551,27 +553,26 @@ DBMap* HP_DB_alloc(const char *file, const char *func, int line, DBType type, DB
{
retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen);
}
- if( HPMHooks.count.HP_DB_alloc_post ) {
- DBMap* (*postHookFunc) (DBMap* retVal___, const char *file, const char *func, int *line, DBType *type, DBOptions *options, unsigned short *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_alloc_post > 0) {
+ struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, file, func, &line, &type, &options, &maxlen);
+ retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen);
}
}
return retVal___;
}
-DBKey HP_DB_i2key(int key) {
+union DBKey HP_DB_i2key(int key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_i2key_pre ) {
- DBKey (*preHookFunc) (int *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i2key_pre > 0) {
+ union DBKey (*preHookFunc) (int *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i2key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -579,27 +580,26 @@ DBKey HP_DB_i2key(int key) {
{
retVal___ = HPMHooks.source.DB.i2key(key);
}
- if( HPMHooks.count.HP_DB_i2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, int *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, int key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i2key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_ui2key(unsigned int key) {
+union DBKey HP_DB_ui2key(unsigned int key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_ui2key_pre ) {
- DBKey (*preHookFunc) (unsigned int *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui2key_pre > 0) {
+ union DBKey (*preHookFunc) (unsigned int *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui2key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -607,27 +607,26 @@ DBKey HP_DB_ui2key(unsigned int key) {
{
retVal___ = HPMHooks.source.DB.ui2key(key);
}
- if( HPMHooks.count.HP_DB_ui2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, unsigned int *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, unsigned int key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui2key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_str2key(const char *key) {
+union DBKey HP_DB_str2key(const char *key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_str2key_pre ) {
- DBKey (*preHookFunc) (const char *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_str2key_pre > 0) {
+ union DBKey (*preHookFunc) (const char **key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_str2key_pre[hIndex].func;
- retVal___ = preHookFunc(key);
+ retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -635,27 +634,26 @@ DBKey HP_DB_str2key(const char *key) {
{
retVal___ = HPMHooks.source.DB.str2key(key);
}
- if( HPMHooks.count.HP_DB_str2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, const char *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_str2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, const char *key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_str2key_post[hIndex].func;
retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_i642key(int64 key) {
+union DBKey HP_DB_i642key(int64 key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_i642key_pre ) {
- DBKey (*preHookFunc) (int64 *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i642key_pre > 0) {
+ union DBKey (*preHookFunc) (int64 *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i642key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -663,27 +661,26 @@ DBKey HP_DB_i642key(int64 key) {
{
retVal___ = HPMHooks.source.DB.i642key(key);
}
- if( HPMHooks.count.HP_DB_i642key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, int64 *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i642key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, int64 key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i642key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_ui642key(uint64 key) {
+union DBKey HP_DB_ui642key(uint64 key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_ui642key_pre ) {
- DBKey (*preHookFunc) (uint64 *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui642key_pre > 0) {
+ union DBKey (*preHookFunc) (uint64 *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui642key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -691,27 +688,26 @@ DBKey HP_DB_ui642key(uint64 key) {
{
retVal___ = HPMHooks.source.DB.ui642key(key);
}
- if( HPMHooks.count.HP_DB_ui642key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, uint64 *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui642key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, uint64 key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui642key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBData HP_DB_i2data(int data) {
+struct DBData HP_DB_i2data(int data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_i2data_pre ) {
- DBData (*preHookFunc) (int *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i2data_pre > 0) {
+ struct DBData (*preHookFunc) (int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i2data_pre[hIndex].func;
retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -719,27 +715,26 @@ DBData HP_DB_i2data(int data) {
{
retVal___ = HPMHooks.source.DB.i2data(data);
}
- if( HPMHooks.count.HP_DB_i2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i2data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &data);
+ retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-DBData HP_DB_ui2data(unsigned int data) {
+struct DBData HP_DB_ui2data(unsigned int data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_ui2data_pre ) {
- DBData (*preHookFunc) (unsigned int *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui2data_pre > 0) {
+ struct DBData (*preHookFunc) (unsigned int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui2data_pre[hIndex].func;
retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -747,27 +742,26 @@ DBData HP_DB_ui2data(unsigned int data) {
{
retVal___ = HPMHooks.source.DB.ui2data(data);
}
- if( HPMHooks.count.HP_DB_ui2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, unsigned int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, unsigned int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui2data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &data);
+ retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-DBData HP_DB_ptr2data(void *data) {
+struct DBData HP_DB_ptr2data(void *data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_ptr2data_pre ) {
- DBData (*preHookFunc) (void *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ptr2data_pre > 0) {
+ struct DBData (*preHookFunc) (void **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ptr2data_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -775,26 +769,26 @@ DBData HP_DB_ptr2data(void *data) {
{
retVal___ = HPMHooks.source.DB.ptr2data(data);
}
- if( HPMHooks.count.HP_DB_ptr2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, void *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ptr2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, void *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ptr2data_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-int HP_DB_data2i(DBData *data) {
+int HP_DB_data2i(struct DBData *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_DB_data2i_pre ) {
- int (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2i_pre > 0) {
+ int (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2i_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -802,26 +796,26 @@ int HP_DB_data2i(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2i(data);
}
- if( HPMHooks.count.HP_DB_data2i_post ) {
- int (*postHookFunc) (int retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2i_post > 0) {
+ int (*postHookFunc) (int retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2i_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-unsigned int HP_DB_data2ui(DBData *data) {
+unsigned int HP_DB_data2ui(struct DBData *data) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_DB_data2ui_pre ) {
- unsigned int (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2ui_pre > 0) {
+ unsigned int (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2ui_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -829,26 +823,26 @@ unsigned int HP_DB_data2ui(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2ui(data);
}
- if( HPMHooks.count.HP_DB_data2ui_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2ui_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2ui_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-void* HP_DB_data2ptr(DBData *data) {
+void* HP_DB_data2ptr(struct DBData *data) {
int hIndex = 0;
void* retVal___ = NULL;
- if( HPMHooks.count.HP_DB_data2ptr_pre ) {
- void* (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2ptr_pre > 0) {
+ void* (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -856,9 +850,9 @@ void* HP_DB_data2ptr(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2ptr(data);
}
- if( HPMHooks.count.HP_DB_data2ptr_post ) {
- void* (*postHookFunc) (void* retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2ptr_post > 0) {
+ void* (*postHookFunc) (void* retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -867,14 +861,14 @@ void* HP_DB_data2ptr(DBData *data) {
}
void HP_DB_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_DB_init_pre ) {
+ if (HPMHooks.count.HP_DB_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -882,9 +876,9 @@ void HP_DB_init(void) {
{
HPMHooks.source.DB.init();
}
- if( HPMHooks.count.HP_DB_init_post ) {
+ if (HPMHooks.count.HP_DB_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_init_post[hIndex].func;
postHookFunc();
}
@@ -893,14 +887,14 @@ void HP_DB_init(void) {
}
void HP_DB_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_DB_final_pre ) {
+ if (HPMHooks.count.HP_DB_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -908,27 +902,696 @@ void HP_DB_final(void) {
{
HPMHooks.source.DB.final();
}
- if( HPMHooks.count.HP_DB_final_post ) {
+ if (HPMHooks.count.HP_DB_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* libconfig */
-int HP_libconfig_read(config_t *config, FILE *stream) {
+/* des_interface */
+void HP_des_decrypt_block(struct des_bit64 *block) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_des_decrypt_block_pre > 0) {
+ void (*preHookFunc) (struct des_bit64 **block);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func;
+ preHookFunc(&block);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.des.decrypt_block(block);
+ }
+ if (HPMHooks.count.HP_des_decrypt_block_post > 0) {
+ void (*postHookFunc) (struct des_bit64 *block);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func;
+ postHookFunc(block);
+ }
+ }
+ return;
+}
+void HP_des_decrypt(unsigned char *data, size_t size) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_des_decrypt_pre > 0) {
+ void (*preHookFunc) (unsigned char **data, size_t *size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func;
+ preHookFunc(&data, &size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.des.decrypt(data, size);
+ }
+ if (HPMHooks.count.HP_des_decrypt_post > 0) {
+ void (*postHookFunc) (unsigned char *data, size_t size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func;
+ postHookFunc(data, size);
+ }
+ }
+ return;
+}
+/* lclif_interface */
+void HP_lclif_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_lclif_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.lclif.init();
+ }
+ if (HPMHooks.count.HP_lclif_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_lclif_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_lclif_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.lclif.final();
+ }
+ if (HPMHooks.count.HP_lclif_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_lclif_connection_error(int fd, uint8 error) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_lclif_connection_error_pre > 0) {
+ void (*preHookFunc) (int *fd, uint8 *error);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_connection_error_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_connection_error_pre[hIndex].func;
+ preHookFunc(&fd, &error);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.lclif.connection_error(fd, error);
+ }
+ if (HPMHooks.count.HP_lclif_connection_error_post > 0) {
+ void (*postHookFunc) (int fd, uint8 error);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_connection_error_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_connection_error_post[hIndex].func;
+ postHookFunc(fd, error);
+ }
+ }
+ return;
+}
+bool HP_lclif_server_list(struct login_session_data *sd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_lclif_server_list_pre > 0) {
+ bool (*preHookFunc) (struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_server_list_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_server_list_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.lclif.server_list(sd);
+ }
+ if (HPMHooks.count.HP_lclif_server_list_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_server_list_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_server_list_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd);
+ }
+ }
+ return retVal___;
+}
+void HP_lclif_auth_failed(int fd, time_t ban, uint32 error) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_lclif_auth_failed_pre > 0) {
+ void (*preHookFunc) (int *fd, time_t *ban, uint32 *error);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_auth_failed_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_auth_failed_pre[hIndex].func;
+ preHookFunc(&fd, &ban, &error);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.lclif.auth_failed(fd, ban, error);
+ }
+ if (HPMHooks.count.HP_lclif_auth_failed_post > 0) {
+ void (*postHookFunc) (int fd, time_t ban, uint32 error);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_auth_failed_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_auth_failed_post[hIndex].func;
+ postHookFunc(fd, ban, error);
+ }
+ }
+ return;
+}
+void HP_lclif_login_error(int fd, uint8 error) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_lclif_login_error_pre > 0) {
+ void (*preHookFunc) (int *fd, uint8 *error);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_login_error_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_login_error_pre[hIndex].func;
+ preHookFunc(&fd, &error);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.lclif.login_error(fd, error);
+ }
+ if (HPMHooks.count.HP_lclif_login_error_post > 0) {
+ void (*postHookFunc) (int fd, uint8 error);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_login_error_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_login_error_post[hIndex].func;
+ postHookFunc(fd, error);
+ }
+ }
+ return;
+}
+void HP_lclif_coding_key(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_lclif_coding_key_pre > 0) {
+ void (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_coding_key_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_coding_key_pre[hIndex].func;
+ preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.lclif.coding_key(fd, sd);
+ }
+ if (HPMHooks.count.HP_lclif_coding_key_post > 0) {
+ void (*postHookFunc) (int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_coding_key_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_coding_key_post[hIndex].func;
+ postHookFunc(fd, sd);
+ }
+ }
+ return;
+}
+const struct login_packet_db* HP_lclif_packet(int16 packet_id) {
+ int hIndex = 0;
+ const struct login_packet_db* retVal___ = NULL;
+ if (HPMHooks.count.HP_lclif_packet_pre > 0) {
+ const struct login_packet_db* (*preHookFunc) (int16 *packet_id);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_packet_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_packet_pre[hIndex].func;
+ retVal___ = preHookFunc(&packet_id);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.lclif.packet(packet_id);
+ }
+ if (HPMHooks.count.HP_lclif_packet_post > 0) {
+ const struct login_packet_db* (*postHookFunc) (const struct login_packet_db* retVal___, int16 packet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_packet_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_packet_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, packet_id);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_lclif_parse_packet(const struct login_packet_db *lpd, int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_lclif_parse_packet_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (const struct login_packet_db **lpd, int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_parse_packet_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_parse_packet_pre[hIndex].func;
+ retVal___ = preHookFunc(&lpd, &fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.lclif.parse_packet(lpd, fd, sd);
+ }
+ if (HPMHooks.count.HP_lclif_parse_packet_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, const struct login_packet_db *lpd, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_parse_packet_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_parse_packet_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, lpd, fd, sd);
+ }
+ }
+ return retVal___;
+}
+int HP_lclif_parse(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_pre ) {
- int (*preHookFunc) (config_t *config, FILE *stream);
+ if (HPMHooks.count.HP_lclif_parse_pre > 0) {
+ int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_parse_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_lclif_parse_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.lclif.parse(fd);
+ }
+ if (HPMHooks.count.HP_lclif_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_lclif_parse_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_lclif_parse_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd);
+ }
+ }
+ return retVal___;
+}
+/* lclif_interface_private */
+void HP_PRIV__lclif_packetdb_loaddb(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_packetdb_loaddb_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.PRIV__lclif.packetdb_loaddb();
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_packetdb_loaddb_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_packetdb_loaddb_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_sub(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_sub_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_sub(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_sub_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_CONNECT_INFO_CHANGED(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_CONNECT_INFO_CHANGED_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_EXE_HASHCHECK(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_EXE_HASHCHECK(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_EXE_HASHCHECK_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN2(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN2_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN2_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN2_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN2(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN2_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN2_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN2_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN3(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN3_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN3_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN3_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN3(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN3_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN3_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN3_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN4(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN4_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN4_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN4_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN4(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN4_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN4_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN4_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN_PCBANG(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN_PCBANG(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_PCBANG_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_LOGIN_HAN(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_HAN_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_HAN_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_HAN_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_LOGIN_HAN(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_HAN_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_LOGIN_HAN_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_LOGIN_HAN_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_SSO_LOGIN_REQ(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_SSO_LOGIN_REQ_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_REQ_HASH_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_REQ_HASH_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_REQ_HASH_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_REQ_HASH(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_REQ_HASH_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_REQ_HASH_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_REQ_HASH_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+enum parsefunc_rcode HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ enum parsefunc_rcode retVal___ = PACKET_UNKNOWN;
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre > 0) {
+ enum parsefunc_rcode (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.PRIV__lclif.parse_CA_CHARSERVERCONNECT(fd, sd);
+ }
+ if (HPMHooks.count.HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post > 0) {
+ enum parsefunc_rcode (*postHookFunc) (enum parsefunc_rcode retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_PRIV__lclif_parse_CA_CHARSERVERCONNECT_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+/* libconfig_interface */
+int HP_libconfig_read(struct config_t *config, FILE *stream) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_read_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, FILE **stream);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_pre[hIndex].func;
- retVal___ = preHookFunc(config, stream);
+ retVal___ = preHookFunc(&config, &stream);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -936,25 +1599,25 @@ int HP_libconfig_read(config_t *config, FILE *stream) {
{
retVal___ = HPMHooks.source.libconfig.read(config, stream);
}
- if( HPMHooks.count.HP_libconfig_read_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, FILE *stream);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, FILE *stream);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, stream);
}
}
return retVal___;
}
-void HP_libconfig_write(const config_t *config, FILE *stream) {
+void HP_libconfig_write(const struct config_t *config, FILE *stream) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_write_pre ) {
- void (*preHookFunc) (const config_t *config, FILE *stream);
+ if (HPMHooks.count.HP_libconfig_write_pre > 0) {
+ void (*preHookFunc) (const struct config_t **config, FILE **stream);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_write_pre[hIndex].func;
- preHookFunc(config, stream);
+ preHookFunc(&config, &stream);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -962,79 +1625,79 @@ void HP_libconfig_write(const config_t *config, FILE *stream) {
{
HPMHooks.source.libconfig.write(config, stream);
}
- if( HPMHooks.count.HP_libconfig_write_post ) {
- void (*postHookFunc) (const config_t *config, FILE *stream);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_write_post > 0) {
+ void (*postHookFunc) (const struct config_t *config, FILE *stream);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_write_post[hIndex].func;
postHookFunc(config, stream);
}
}
return;
}
-void HP_libconfig_set_auto_convert(config_t *config, int flag) {
+void HP_libconfig_set_options(struct config_t *config, int options) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_auto_convert_pre ) {
- void (*preHookFunc) (config_t *config, int *flag);
+ if (HPMHooks.count.HP_libconfig_set_options_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_auto_convert_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_set_auto_convert_pre[hIndex].func;
- preHookFunc(config, &flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_set_options_pre[hIndex].func;
+ preHookFunc(&config, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.libconfig.set_auto_convert(config, flag);
+ HPMHooks.source.libconfig.set_options(config, options);
}
- if( HPMHooks.count.HP_libconfig_set_auto_convert_post ) {
- void (*postHookFunc) (config_t *config, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_auto_convert_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_set_auto_convert_post[hIndex].func;
- postHookFunc(config, &flag);
+ if (HPMHooks.count.HP_libconfig_set_options_post > 0) {
+ void (*postHookFunc) (struct config_t *config, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_set_options_post[hIndex].func;
+ postHookFunc(config, options);
}
}
return;
}
-int HP_libconfig_get_auto_convert(const config_t *config) {
+int HP_libconfig_get_options(const struct config_t *config) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_get_auto_convert_pre ) {
- int (*preHookFunc) (const config_t *config);
+ if (HPMHooks.count.HP_libconfig_get_options_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_auto_convert_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_get_auto_convert_pre[hIndex].func;
- retVal___ = preHookFunc(config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_get_options_pre[hIndex].func;
+ retVal___ = preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.libconfig.get_auto_convert(config);
+ retVal___ = HPMHooks.source.libconfig.get_options(config);
}
- if( HPMHooks.count.HP_libconfig_get_auto_convert_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_auto_convert_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_get_auto_convert_post[hIndex].func;
+ if (HPMHooks.count.HP_libconfig_get_options_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_get_options_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config);
}
}
return retVal___;
}
-int HP_libconfig_read_string(config_t *config, const char *str) {
+int HP_libconfig_read_string(struct config_t *config, const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_string_pre ) {
- int (*preHookFunc) (config_t *config, const char *str);
+ if (HPMHooks.count.HP_libconfig_read_string_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_string_pre[hIndex].func;
- retVal___ = preHookFunc(config, str);
+ retVal___ = preHookFunc(&config, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1042,26 +1705,26 @@ int HP_libconfig_read_string(config_t *config, const char *str) {
{
retVal___ = HPMHooks.source.libconfig.read_string(config, str);
}
- if( HPMHooks.count.HP_libconfig_read_string_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_string_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, str);
}
}
return retVal___;
}
-int HP_libconfig_read_file_src(config_t *config, const char *filename) {
+int HP_libconfig_read_file_src(struct config_t *config, const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_file_src_pre ) {
- int (*preHookFunc) (config_t *config, const char *filename);
+ if (HPMHooks.count.HP_libconfig_read_file_src_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_file_src_pre[hIndex].func;
- retVal___ = preHookFunc(config, filename);
+ retVal___ = preHookFunc(&config, &filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1069,26 +1732,26 @@ int HP_libconfig_read_file_src(config_t *config, const char *filename) {
{
retVal___ = HPMHooks.source.libconfig.read_file_src(config, filename);
}
- if( HPMHooks.count.HP_libconfig_read_file_src_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_file_src_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_file_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filename);
}
}
return retVal___;
}
-int HP_libconfig_write_file(config_t *config, const char *filename) {
+int HP_libconfig_write_file(struct config_t *config, const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_write_file_pre ) {
- int (*preHookFunc) (config_t *config, const char *filename);
+ if (HPMHooks.count.HP_libconfig_write_file_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_write_file_pre[hIndex].func;
- retVal___ = preHookFunc(config, filename);
+ retVal___ = preHookFunc(&config, &filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1096,25 +1759,25 @@ int HP_libconfig_write_file(config_t *config, const char *filename) {
{
retVal___ = HPMHooks.source.libconfig.write_file(config, filename);
}
- if( HPMHooks.count.HP_libconfig_write_file_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_write_file_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_write_file_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filename);
}
}
return retVal___;
}
-void HP_libconfig_set_destructor(config_t *config, void ( *destructor ) (void *)) {
+void HP_libconfig_set_destructor(struct config_t *config, void ( *destructor ) (void *)) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_destructor_pre ) {
- void (*preHookFunc) (config_t *config, void ( *destructor ) (void *));
+ if (HPMHooks.count.HP_libconfig_set_destructor_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, void ( **destructor ) (void *));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_destructor_pre[hIndex].func;
- preHookFunc(config, destructor);
+ preHookFunc(&config, &destructor);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1122,25 +1785,25 @@ void HP_libconfig_set_destructor(config_t *config, void ( *destructor ) (void *)
{
HPMHooks.source.libconfig.set_destructor(config, destructor);
}
- if( HPMHooks.count.HP_libconfig_set_destructor_post ) {
- void (*postHookFunc) (config_t *config, void ( *destructor ) (void *));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_set_destructor_post > 0) {
+ void (*postHookFunc) (struct config_t *config, void ( *destructor ) (void *));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_destructor_post[hIndex].func;
postHookFunc(config, destructor);
}
}
return;
}
-void HP_libconfig_set_include_dir(config_t *config, const char *include_dir) {
+void HP_libconfig_set_include_dir(struct config_t *config, const char *include_dir) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_include_dir_pre ) {
- void (*preHookFunc) (config_t *config, const char *include_dir);
+ if (HPMHooks.count.HP_libconfig_set_include_dir_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, const char **include_dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_include_dir_pre[hIndex].func;
- preHookFunc(config, include_dir);
+ preHookFunc(&config, &include_dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1148,25 +1811,25 @@ void HP_libconfig_set_include_dir(config_t *config, const char *include_dir) {
{
HPMHooks.source.libconfig.set_include_dir(config, include_dir);
}
- if( HPMHooks.count.HP_libconfig_set_include_dir_post ) {
- void (*postHookFunc) (config_t *config, const char *include_dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_set_include_dir_post > 0) {
+ void (*postHookFunc) (struct config_t *config, const char *include_dir);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_include_dir_post[hIndex].func;
postHookFunc(config, include_dir);
}
}
return;
}
-void HP_libconfig_init(config_t *config) {
+void HP_libconfig_init(struct config_t *config) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_init_pre ) {
- void (*preHookFunc) (config_t *config);
+ if (HPMHooks.count.HP_libconfig_init_pre > 0) {
+ void (*preHookFunc) (struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_init_pre[hIndex].func;
- preHookFunc(config);
+ preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1174,25 +1837,25 @@ void HP_libconfig_init(config_t *config) {
{
HPMHooks.source.libconfig.init(config);
}
- if( HPMHooks.count.HP_libconfig_init_post ) {
- void (*postHookFunc) (config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_init_post > 0) {
+ void (*postHookFunc) (struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_init_post[hIndex].func;
postHookFunc(config);
}
}
return;
}
-void HP_libconfig_destroy(config_t *config) {
+void HP_libconfig_destroy(struct config_t *config) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_destroy_pre ) {
- void (*preHookFunc) (config_t *config);
+ if (HPMHooks.count.HP_libconfig_destroy_pre > 0) {
+ void (*preHookFunc) (struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_destroy_pre[hIndex].func;
- preHookFunc(config);
+ preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1200,26 +1863,26 @@ void HP_libconfig_destroy(config_t *config) {
{
HPMHooks.source.libconfig.destroy(config);
}
- if( HPMHooks.count.HP_libconfig_destroy_post ) {
- void (*postHookFunc) (config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_destroy_post > 0) {
+ void (*postHookFunc) (struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_destroy_post[hIndex].func;
postHookFunc(config);
}
}
return;
}
-int HP_libconfig_setting_get_int(const config_setting_t *setting) {
+int HP_libconfig_setting_get_int(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_int_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1227,26 +1890,26 @@ int HP_libconfig_setting_get_int(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_int(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-long long HP_libconfig_setting_get_int64(const config_setting_t *setting) {
+int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) {
int hIndex = 0;
- long long retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) {
- long long (*preHookFunc) (const config_setting_t *setting);
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_pre > 0) {
+ int64 (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1254,26 +1917,26 @@ long long HP_libconfig_setting_get_int64(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) {
- long long (*postHookFunc) (long long retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-double HP_libconfig_setting_get_float(const config_setting_t *setting) {
+double HP_libconfig_setting_get_float(const struct config_setting_t *setting) {
int hIndex = 0;
double retVal___ = 0.;
- if( HPMHooks.count.HP_libconfig_setting_get_float_pre ) {
- double (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_float_pre > 0) {
+ double (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1281,26 +1944,26 @@ double HP_libconfig_setting_get_float(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_float(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_float_post ) {
- double (*postHookFunc) (double retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_float_post > 0) {
+ double (*postHookFunc) (double retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_bool(const config_setting_t *setting) {
+int HP_libconfig_setting_get_bool(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_bool_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1308,26 +1971,26 @@ int HP_libconfig_setting_get_bool(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_bool(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-const char* HP_libconfig_setting_get_string(const config_setting_t *setting) {
+const char* HP_libconfig_setting_get_string(const struct config_setting_t *setting) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_string_pre ) {
- const char* (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_string_pre > 0) {
+ const char* (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1335,26 +1998,53 @@ const char* HP_libconfig_setting_get_string(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_string(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_string_post ) {
- const char* (*postHookFunc) (const char* retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_string_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_int(const config_setting_t *setting, const char *name, int *value) {
+struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) {
+ int hIndex = 0;
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, const char **name);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup(setting, name);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, const char *name, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_int_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1362,26 +2052,26 @@ int HP_libconfig_setting_lookup_int(const config_setting_t *setting, const char
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_int(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_int_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_int64(const config_setting_t *setting, const char *name, long long *value) {
+int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, long long *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int64_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1389,26 +2079,26 @@ int HP_libconfig_setting_lookup_int64(const config_setting_t *setting, const cha
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_float(const config_setting_t *setting, const char *name, double *value) {
+int HP_libconfig_setting_lookup_float(const struct config_setting_t *setting, const char *name, double *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_float_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, double *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_float_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, double **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1416,26 +2106,26 @@ int HP_libconfig_setting_lookup_float(const config_setting_t *setting, const cha
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_float(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_float_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_float_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, double *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_bool(const config_setting_t *setting, const char *name, int *value) {
+int HP_libconfig_setting_lookup_bool(const struct config_setting_t *setting, const char *name, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_bool_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1443,26 +2133,26 @@ int HP_libconfig_setting_lookup_bool(const config_setting_t *setting, const char
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_bool(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_string(const config_setting_t *setting, const char *name, const char **value) {
+int HP_libconfig_setting_lookup_string(const struct config_setting_t *setting, const char *name, const char **value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_string_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, const char **value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_string_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, const char ***value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1470,26 +2160,26 @@ int HP_libconfig_setting_lookup_string(const config_setting_t *setting, const ch
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_string(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_string_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, const char **value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, const char **value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_int(config_setting_t *setting, int value) {
+int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_int_pre ) {
- int (*preHookFunc) (config_setting_t *setting, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_int_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1497,26 +2187,26 @@ int HP_libconfig_setting_set_int(config_setting_t *setting, int value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_int(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_int64(config_setting_t *setting, long long value) {
+int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) {
- int (*preHookFunc) (config_setting_t *setting, long long *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int64 *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1524,26 +2214,26 @@ int HP_libconfig_setting_set_int64(config_setting_t *setting, long long value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_float(config_setting_t *setting, double value) {
+int HP_libconfig_setting_set_float(struct config_setting_t *setting, double value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_float_pre ) {
- int (*preHookFunc) (config_setting_t *setting, double *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_float_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, double *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1551,26 +2241,26 @@ int HP_libconfig_setting_set_float(config_setting_t *setting, double value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_float(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_float_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_float_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, double value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_bool(config_setting_t *setting, int value) {
+int HP_libconfig_setting_set_bool(struct config_setting_t *setting, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_bool_pre ) {
- int (*preHookFunc) (config_setting_t *setting, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1578,26 +2268,26 @@ int HP_libconfig_setting_set_bool(config_setting_t *setting, int value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_bool(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_bool_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_string(config_setting_t *setting, const char *value) {
+int HP_libconfig_setting_set_string(struct config_setting_t *setting, const char *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_string_pre ) {
- int (*preHookFunc) (config_setting_t *setting, const char *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_string_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, const char **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting, value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1605,26 +2295,26 @@ int HP_libconfig_setting_set_string(config_setting_t *setting, const char *value
{
retVal___ = HPMHooks.source.libconfig.setting_set_string(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_string_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, const char *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_string_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_format(config_setting_t *setting, short format) {
+int HP_libconfig_setting_set_format(struct config_setting_t *setting, short format) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_format_pre ) {
- int (*preHookFunc) (config_setting_t *setting, short *format);
+ if (HPMHooks.count.HP_libconfig_setting_set_format_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, short *format);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_format_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &format);
+ retVal___ = preHookFunc(&setting, &format);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1632,26 +2322,26 @@ int HP_libconfig_setting_set_format(config_setting_t *setting, short format) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_format(setting, format);
}
- if( HPMHooks.count.HP_libconfig_setting_set_format_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, short *format);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_format_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, short format);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_format_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &format);
+ retVal___ = postHookFunc(retVal___, setting, format);
}
}
return retVal___;
}
-short HP_libconfig_setting_get_format(const config_setting_t *setting) {
+short HP_libconfig_setting_get_format(const struct config_setting_t *setting) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_format_pre ) {
- short (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_format_pre > 0) {
+ short (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_format_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1659,26 +2349,26 @@ short HP_libconfig_setting_get_format(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_format(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_format_post ) {
- short (*postHookFunc) (short retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_format_post > 0) {
+ short (*postHookFunc) (short retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_format_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_int_elem(const config_setting_t *setting, int idx) {
+int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int_elem_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_int_elem_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1686,26 +2376,26 @@ int HP_libconfig_setting_get_int_elem(const config_setting_t *setting, int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_get_int_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int_elem_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-long long HP_libconfig_setting_get_int64_elem(const config_setting_t *setting, int idx) {
+int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
- long long retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) {
- long long (*preHookFunc) (const config_setting_t *setting, int *idx);
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre > 0) {
+ int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1713,26 +2403,26 @@ long long HP_libconfig_setting_get_int64_elem(const config_setting_t *setting, i
{
retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) {
- long long (*postHookFunc) (long long retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_elem_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-double HP_libconfig_setting_get_float_elem(const config_setting_t *setting, int idx) {
+double HP_libconfig_setting_get_float_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
double retVal___ = 0.;
- if( HPMHooks.count.HP_libconfig_setting_get_float_elem_pre ) {
- double (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_float_elem_pre > 0) {
+ double (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1740,26 +2430,26 @@ double HP_libconfig_setting_get_float_elem(const config_setting_t *setting, int
{
retVal___ = HPMHooks.source.libconfig.setting_get_float_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_float_elem_post ) {
- double (*postHookFunc) (double retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_float_elem_post > 0) {
+ double (*postHookFunc) (double retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_bool_elem(const config_setting_t *setting, int idx) {
+int HP_libconfig_setting_get_bool_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1767,26 +2457,26 @@ int HP_libconfig_setting_get_bool_elem(const config_setting_t *setting, int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_get_bool_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_bool_elem_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-const char* HP_libconfig_setting_get_string_elem(const config_setting_t *setting, int idx) {
+const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_string_elem_pre ) {
- const char* (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_string_elem_pre > 0) {
+ const char* (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1794,26 +2484,26 @@ const char* HP_libconfig_setting_get_string_elem(const config_setting_t *setting
{
retVal___ = HPMHooks.source.libconfig.setting_get_string_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_string_elem_post ) {
- const char* (*postHookFunc) (const char* retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_string_elem_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_int_elem(config_setting_t *setting, int idx, int value) {
+struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_int_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, int *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_int_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1821,26 +2511,26 @@ config_setting_t* HP_libconfig_setting_set_int_elem(config_setting_t *setting, i
{
retVal___ = HPMHooks.source.libconfig.setting_set_int_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_int64_elem(config_setting_t *setting, int idx, long long value) {
+struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, long long *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1848,26 +2538,26 @@ config_setting_t* HP_libconfig_setting_set_int64_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_float_elem(config_setting_t *setting, int idx, double value) {
+struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_float_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, double *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_float_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1875,26 +2565,26 @@ config_setting_t* HP_libconfig_setting_set_float_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_float_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_float_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_float_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_bool_elem(config_setting_t *setting, int idx, int value) {
+struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, int *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1902,26 +2592,26 @@ config_setting_t* HP_libconfig_setting_set_bool_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_bool_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_bool_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_string_elem(config_setting_t *setting, int idx, const char *value) {
+struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_string_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, const char *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_string_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1929,26 +2619,26 @@ config_setting_t* HP_libconfig_setting_set_string_elem(config_setting_t *setting
{
retVal___ = HPMHooks.source.libconfig.setting_set_string_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_string_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, const char *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_string_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_index(const config_setting_t *setting) {
+int HP_libconfig_setting_index(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_index_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_index_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_index_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1956,26 +2646,26 @@ int HP_libconfig_setting_index(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_index(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_index_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_index_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_index_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_length(const config_setting_t *setting) {
+int HP_libconfig_setting_length(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_length_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_length_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_length_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1983,26 +2673,26 @@ int HP_libconfig_setting_length(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_length(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_length_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_length_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_length_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_get_elem(const config_setting_t *setting, unsigned int idx) {
+struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_elem_pre ) {
- config_setting_t* (*preHookFunc) (const config_setting_t *setting, unsigned int *idx);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_get_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2010,26 +2700,26 @@ config_setting_t* HP_libconfig_setting_get_elem(const config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_get_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_setting_t *setting, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_get_member(const config_setting_t *setting, const char *name) {
+struct config_setting_t* HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_member_pre ) {
- config_setting_t* (*preHookFunc) (const config_setting_t *setting, const char *name);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_get_member_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name);
+ retVal___ = preHookFunc(&setting, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2037,26 +2727,26 @@ config_setting_t* HP_libconfig_setting_get_member(const config_setting_t *settin
{
retVal___ = HPMHooks.source.libconfig.setting_get_member(setting, name);
}
- if( HPMHooks.count.HP_libconfig_setting_get_member_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_setting_t *setting, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_member_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_add(config_setting_t *parent, const char *name, int type) {
+struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_add_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *parent, const char *name, int *type);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_add_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_add_pre[hIndex].func;
- retVal___ = preHookFunc(parent, name, &type);
+ retVal___ = preHookFunc(&parent, &name, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2064,26 +2754,26 @@ config_setting_t* HP_libconfig_setting_add(config_setting_t *parent, const char
{
retVal___ = HPMHooks.source.libconfig.setting_add(parent, name, type);
}
- if( HPMHooks.count.HP_libconfig_setting_add_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *parent, const char *name, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_add_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, parent, name, &type);
+ retVal___ = postHookFunc(retVal___, parent, name, type);
}
}
return retVal___;
}
-int HP_libconfig_setting_remove(config_setting_t *parent, const char *name) {
+int HP_libconfig_setting_remove(struct config_setting_t *parent, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_remove_pre ) {
- int (*preHookFunc) (config_setting_t *parent, const char *name);
+ if (HPMHooks.count.HP_libconfig_setting_remove_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_remove_pre[hIndex].func;
- retVal___ = preHookFunc(parent, name);
+ retVal___ = preHookFunc(&parent, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2091,26 +2781,26 @@ int HP_libconfig_setting_remove(config_setting_t *parent, const char *name) {
{
retVal___ = HPMHooks.source.libconfig.setting_remove(parent, name);
}
- if( HPMHooks.count.HP_libconfig_setting_remove_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_remove_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_remove_post[hIndex].func;
retVal___ = postHookFunc(retVal___, parent, name);
}
}
return retVal___;
}
-int HP_libconfig_setting_remove_elem(config_setting_t *parent, unsigned int idx) {
+int HP_libconfig_setting_remove_elem(struct config_setting_t *parent, unsigned int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_remove_elem_pre ) {
- int (*preHookFunc) (config_setting_t *parent, unsigned int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_remove_elem_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_remove_elem_pre[hIndex].func;
- retVal___ = preHookFunc(parent, &idx);
+ retVal___ = preHookFunc(&parent, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2118,25 +2808,25 @@ int HP_libconfig_setting_remove_elem(config_setting_t *parent, unsigned int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_remove_elem(parent, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_remove_elem_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_remove_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_remove_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, parent, &idx);
+ retVal___ = postHookFunc(retVal___, parent, idx);
}
}
return retVal___;
}
-void HP_libconfig_setting_set_hook(config_setting_t *setting, void *hook) {
+void HP_libconfig_setting_set_hook(struct config_setting_t *setting, void *hook) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_hook_pre ) {
- void (*preHookFunc) (config_setting_t *setting, void *hook);
+ if (HPMHooks.count.HP_libconfig_setting_set_hook_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **setting, void **hook);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_hook_pre[hIndex].func;
- preHookFunc(setting, hook);
+ preHookFunc(&setting, &hook);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2144,26 +2834,26 @@ void HP_libconfig_setting_set_hook(config_setting_t *setting, void *hook) {
{
HPMHooks.source.libconfig.setting_set_hook(setting, hook);
}
- if( HPMHooks.count.HP_libconfig_setting_set_hook_post ) {
- void (*postHookFunc) (config_setting_t *setting, void *hook);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_hook_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *setting, void *hook);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_hook_post[hIndex].func;
postHookFunc(setting, hook);
}
}
return;
}
-config_setting_t* HP_libconfig_lookup(const config_t *config, const char *filepath) {
+struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, const char *filepath) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_lookup_pre ) {
- config_setting_t* (*preHookFunc) (const config_t *config, const char *filepath);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_lookup_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_t **config, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath);
+ retVal___ = preHookFunc(&config, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2171,53 +2861,26 @@ config_setting_t* HP_libconfig_lookup(const config_t *config, const char *filepa
{
retVal___ = HPMHooks.source.libconfig.lookup(config, filepath);
}
- if( HPMHooks.count.HP_libconfig_lookup_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_t *config, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_lookup_from(config_setting_t *setting, const char *filepath) {
- int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_lookup_from_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, const char *filepath);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_from_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_lookup_from_pre[hIndex].func;
- retVal___ = preHookFunc(setting, filepath);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.libconfig.lookup_from(setting, filepath);
- }
- if( HPMHooks.count.HP_libconfig_lookup_from_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_from_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_lookup_from_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, filepath);
- }
- }
- return retVal___;
-}
-int HP_libconfig_lookup_int(const config_t *config, const char *filepath, int *value) {
+int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_int_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, int *value);
+ if (HPMHooks.count.HP_libconfig_lookup_int_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_int_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2225,26 +2888,26 @@ int HP_libconfig_lookup_int(const config_t *config, const char *filepath, int *v
{
retVal___ = HPMHooks.source.libconfig.lookup_int(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_int_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_int64(const config_t *config, const char *filepath, long long *value) {
+int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, long long *value);
+ if (HPMHooks.count.HP_libconfig_lookup_int64_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2252,26 +2915,26 @@ int HP_libconfig_lookup_int64(const config_t *config, const char *filepath, long
{
retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_int64_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_float(const config_t *config, const char *filepath, double *value) {
+int HP_libconfig_lookup_float(const struct config_t *config, const char *filepath, double *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_float_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, double *value);
+ if (HPMHooks.count.HP_libconfig_lookup_float_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, double **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_float_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2279,26 +2942,26 @@ int HP_libconfig_lookup_float(const config_t *config, const char *filepath, doub
{
retVal___ = HPMHooks.source.libconfig.lookup_float(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_float_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_float_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, double *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_bool(const config_t *config, const char *filepath, int *value) {
+int HP_libconfig_lookup_bool(const struct config_t *config, const char *filepath, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_bool_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, int *value);
+ if (HPMHooks.count.HP_libconfig_lookup_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_bool_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2306,26 +2969,26 @@ int HP_libconfig_lookup_bool(const config_t *config, const char *filepath, int *
{
retVal___ = HPMHooks.source.libconfig.lookup_bool(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_string(const config_t *config, const char *filepath, const char **value) {
+int HP_libconfig_lookup_string(const struct config_t *config, const char *filepath, const char **value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_string_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, const char **value);
+ if (HPMHooks.count.HP_libconfig_lookup_string_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, const char ***value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_string_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2333,52 +2996,52 @@ int HP_libconfig_lookup_string(const config_t *config, const char *filepath, con
{
retVal___ = HPMHooks.source.libconfig.lookup_string(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_string_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, const char **value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, const char **value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_read_file(config_t *config, const char *config_filename) {
+int HP_libconfig_load_file(struct config_t *config, const char *config_filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_file_pre ) {
- int (*preHookFunc) (config_t *config, const char *config_filename);
+ if (HPMHooks.count.HP_libconfig_load_file_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **config_filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_read_file_pre[hIndex].func;
- retVal___ = preHookFunc(config, config_filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_load_file_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_load_file_pre[hIndex].func;
+ retVal___ = preHookFunc(&config, &config_filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.libconfig.read_file(config, config_filename);
+ retVal___ = HPMHooks.source.libconfig.load_file(config, config_filename);
}
- if( HPMHooks.count.HP_libconfig_read_file_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *config_filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_read_file_post[hIndex].func;
+ if (HPMHooks.count.HP_libconfig_load_file_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *config_filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_load_file_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_load_file_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, config_filename);
}
}
return retVal___;
}
-void HP_libconfig_setting_copy_simple(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_simple(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_simple_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_simple_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_simple_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2386,25 +3049,25 @@ void HP_libconfig_setting_copy_simple(config_setting_t *parent, const config_set
{
HPMHooks.source.libconfig.setting_copy_simple(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_simple_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_simple_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_simple_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-void HP_libconfig_setting_copy_elem(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_elem(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_elem_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_elem_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_elem_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2412,25 +3075,25 @@ void HP_libconfig_setting_copy_elem(config_setting_t *parent, const config_setti
{
HPMHooks.source.libconfig.setting_copy_elem(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_elem_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_elem_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_elem_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-void HP_libconfig_setting_copy_aggregate(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_aggregate(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_aggregate_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2438,26 +3101,26 @@ void HP_libconfig_setting_copy_aggregate(config_setting_t *parent, const config_
{
HPMHooks.source.libconfig.setting_copy_aggregate(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_aggregate_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_aggregate_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_aggregate_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-int HP_libconfig_setting_copy(config_setting_t *parent, const config_setting_t *src) {
+int HP_libconfig_setting_copy(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_pre ) {
- int (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_pre[hIndex].func;
- retVal___ = preHookFunc(parent, src);
+ retVal___ = preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2465,27 +3128,297 @@ int HP_libconfig_setting_copy(config_setting_t *parent, const config_setting_t *
{
retVal___ = HPMHooks.source.libconfig.setting_copy(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, parent, src);
}
}
return retVal___;
}
-/* login */
+bool HP_libconfig_setting_get_bool_real(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_real_pre > 0) {
+ bool (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_real_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_real_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_bool_real(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_real_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_real_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_real_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+uint32 HP_libconfig_setting_get_uint32(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_uint32_pre > 0) {
+ uint32 (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint32_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_uint32(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_uint32_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+uint16 HP_libconfig_setting_get_uint16(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ uint16 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_uint16_pre > 0) {
+ uint16 (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_uint16(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_uint16_post > 0) {
+ uint16 (*postHookFunc) (uint16 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+int16 HP_libconfig_setting_get_int16(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ int16 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int16_pre > 0) {
+ int16 (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_int16(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_int16_post > 0) {
+ int16 (*postHookFunc) (int16 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_bool_real(const struct config_setting_t *setting, const char *name, bool *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_real_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, bool **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_real_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_real_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_bool_real(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_real_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, bool *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_real_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_real_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_uint32(const struct config_setting_t *setting, const char *name, uint32 *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint32_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, uint32 **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint32_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_uint32(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint32_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, uint32 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_uint16(const struct config_setting_t *setting, const char *name, uint16 *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint16_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, uint16 **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_uint16(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint16_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, uint16 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_int16(const struct config_setting_t *setting, const char *name, int16 *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int16_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int16 **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_int16(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int16_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int16 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_mutable_string(const struct config_setting_t *setting, const char *name, char *out, size_t out_size) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, char **out, size_t *out_size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_mutable_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &out, &out_size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_mutable_string(setting, name, out, out_size);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, char *out, size_t out_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_mutable_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, out, out_size);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_lookup_mutable_string(const struct config_t *config, const char *name, char *out, size_t out_size) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_lookup_mutable_string_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **name, char **out, size_t *out_size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_mutable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_lookup_mutable_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&config, &name, &out, &out_size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.lookup_mutable_string(config, name, out, out_size);
+ }
+ if (HPMHooks.count.HP_libconfig_lookup_mutable_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *name, char *out, size_t out_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_mutable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_lookup_mutable_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, config, name, out, out_size);
+ }
+ }
+ return retVal___;
+}
+/* login_interface */
int HP_login_mmo_auth(struct login_session_data *sd, bool isServer) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_mmo_auth_pre ) {
- int (*preHookFunc) (struct login_session_data *sd, bool *isServer);
+ if (HPMHooks.count.HP_login_mmo_auth_pre > 0) {
+ int (*preHookFunc) (struct login_session_data **sd, bool *isServer);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_mmo_auth_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &isServer);
+ retVal___ = preHookFunc(&sd, &isServer);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2493,11 +3426,11 @@ int HP_login_mmo_auth(struct login_session_data *sd, bool isServer) {
{
retVal___ = HPMHooks.source.login.mmo_auth(sd, isServer);
}
- if( HPMHooks.count.HP_login_mmo_auth_post ) {
- int (*postHookFunc) (int retVal___, struct login_session_data *sd, bool *isServer);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_mmo_auth_post > 0) {
+ int (*postHookFunc) (int retVal___, struct login_session_data *sd, bool isServer);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_mmo_auth_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &isServer);
+ retVal___ = postHookFunc(retVal___, sd, isServer);
}
}
return retVal___;
@@ -2505,14 +3438,14 @@ int HP_login_mmo_auth(struct login_session_data *sd, bool isServer) {
int HP_login_mmo_auth_new(const char *userid, const char *pass, const char sex, const char *last_ip) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_mmo_auth_new_pre ) {
- int (*preHookFunc) (const char *userid, const char *pass, const char *sex, const char *last_ip);
+ if (HPMHooks.count.HP_login_mmo_auth_new_pre > 0) {
+ int (*preHookFunc) (const char **userid, const char **pass, const char *sex, const char **last_ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_new_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_new_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_mmo_auth_new_pre[hIndex].func;
- retVal___ = preHookFunc(userid, pass, &sex, last_ip);
+ retVal___ = preHookFunc(&userid, &pass, &sex, &last_ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2520,11 +3453,11 @@ int HP_login_mmo_auth_new(const char *userid, const char *pass, const char sex,
{
retVal___ = HPMHooks.source.login.mmo_auth_new(userid, pass, sex, last_ip);
}
- if( HPMHooks.count.HP_login_mmo_auth_new_post ) {
- int (*postHookFunc) (int retVal___, const char *userid, const char *pass, const char *sex, const char *last_ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_new_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_mmo_auth_new_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *userid, const char *pass, const char sex, const char *last_ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_mmo_auth_new_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_mmo_auth_new_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, userid, pass, &sex, last_ip);
+ retVal___ = postHookFunc(retVal___, userid, pass, sex, last_ip);
}
}
return retVal___;
@@ -2532,14 +3465,14 @@ int HP_login_mmo_auth_new(const char *userid, const char *pass, const char sex,
int HP_login_waiting_disconnect_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_waiting_disconnect_timer_pre ) {
+ if (HPMHooks.count.HP_login_waiting_disconnect_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_waiting_disconnect_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_waiting_disconnect_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_waiting_disconnect_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2547,29 +3480,28 @@ int HP_login_waiting_disconnect_timer(int tid, int64 tick, int id, intptr_t data
{
retVal___ = HPMHooks.source.login.waiting_disconnect_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_login_waiting_disconnect_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_waiting_disconnect_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_waiting_disconnect_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_waiting_disconnect_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_waiting_disconnect_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-DBData HP_login_create_online_user(DBKey key, va_list args) {
+struct DBData HP_login_create_online_user(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_login_create_online_user_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_login_create_online_user_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_create_online_user_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_create_online_user_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_login_create_online_user_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2579,12 +3511,12 @@ DBData HP_login_create_online_user(DBKey key, va_list args) {
retVal___ = HPMHooks.source.login.create_online_user(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_login_create_online_user_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_create_online_user_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_create_online_user_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_create_online_user_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_login_create_online_user_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
@@ -2593,14 +3525,14 @@ DBData HP_login_create_online_user(DBKey key, va_list args) {
struct online_login_data* HP_login_add_online_user(int char_server, int account_id) {
int hIndex = 0;
struct online_login_data* retVal___ = NULL;
- if( HPMHooks.count.HP_login_add_online_user_pre ) {
+ if (HPMHooks.count.HP_login_add_online_user_pre > 0) {
struct online_login_data* (*preHookFunc) (int *char_server, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_add_online_user_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_add_online_user_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_add_online_user_pre[hIndex].func;
retVal___ = preHookFunc(&char_server, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2608,25 +3540,25 @@ struct online_login_data* HP_login_add_online_user(int char_server, int account_
{
retVal___ = HPMHooks.source.login.add_online_user(char_server, account_id);
}
- if( HPMHooks.count.HP_login_add_online_user_post ) {
- struct online_login_data* (*postHookFunc) (struct online_login_data* retVal___, int *char_server, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_add_online_user_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_add_online_user_post > 0) {
+ struct online_login_data* (*postHookFunc) (struct online_login_data* retVal___, int char_server, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_add_online_user_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_add_online_user_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_server, &account_id);
+ retVal___ = postHookFunc(retVal___, char_server, account_id);
}
}
return retVal___;
}
void HP_login_remove_online_user(int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_remove_online_user_pre ) {
+ if (HPMHooks.count.HP_login_remove_online_user_pre > 0) {
void (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_remove_online_user_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_remove_online_user_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_remove_online_user_pre[hIndex].func;
preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2634,28 +3566,28 @@ void HP_login_remove_online_user(int account_id) {
{
HPMHooks.source.login.remove_online_user(account_id);
}
- if( HPMHooks.count.HP_login_remove_online_user_post ) {
- void (*postHookFunc) (int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_remove_online_user_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_remove_online_user_post > 0) {
+ void (*postHookFunc) (int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_remove_online_user_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_remove_online_user_post[hIndex].func;
- postHookFunc(&account_id);
+ postHookFunc(account_id);
}
}
return;
}
-int HP_login_online_db_setoffline(DBKey key, DBData *data, va_list ap) {
+int HP_login_online_db_setoffline(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_online_db_setoffline_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_login_online_db_setoffline_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_online_db_setoffline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_online_db_setoffline_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_login_online_db_setoffline_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2665,30 +3597,30 @@ int HP_login_online_db_setoffline(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.login.online_db_setoffline(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_login_online_db_setoffline_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_online_db_setoffline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_online_db_setoffline_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_online_db_setoffline_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_login_online_db_setoffline_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_login_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) {
+int HP_login_online_data_cleanup_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_online_data_cleanup_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_login_online_data_cleanup_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_login_online_data_cleanup_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2698,12 +3630,12 @@ int HP_login_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.login.online_data_cleanup_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_login_online_data_cleanup_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_online_data_cleanup_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_login_online_data_cleanup_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -2712,14 +3644,14 @@ int HP_login_online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) {
int HP_login_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_online_data_cleanup_pre ) {
+ if (HPMHooks.count.HP_login_online_data_cleanup_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_online_data_cleanup_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2727,11 +3659,11 @@ int HP_login_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.login.online_data_cleanup(tid, tick, id, data);
}
- if( HPMHooks.count.HP_login_online_data_cleanup_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_online_data_cleanup_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_online_data_cleanup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_online_data_cleanup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -2739,14 +3671,14 @@ int HP_login_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) {
int HP_login_sync_ip_addresses(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_sync_ip_addresses_pre ) {
+ if (HPMHooks.count.HP_login_sync_ip_addresses_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_sync_ip_addresses_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_sync_ip_addresses_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_sync_ip_addresses_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2754,11 +3686,11 @@ int HP_login_sync_ip_addresses(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.login.sync_ip_addresses(tid, tick, id, data);
}
- if( HPMHooks.count.HP_login_sync_ip_addresses_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_sync_ip_addresses_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_sync_ip_addresses_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_sync_ip_addresses_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_sync_ip_addresses_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -2766,14 +3698,14 @@ int HP_login_sync_ip_addresses(int tid, int64 tick, int id, intptr_t data) {
bool HP_login_check_encrypted(const char *str1, const char *str2, const char *passwd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_login_check_encrypted_pre ) {
- bool (*preHookFunc) (const char *str1, const char *str2, const char *passwd);
+ if (HPMHooks.count.HP_login_check_encrypted_pre > 0) {
+ bool (*preHookFunc) (const char **str1, const char **str2, const char **passwd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_check_encrypted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_check_encrypted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_check_encrypted_pre[hIndex].func;
- retVal___ = preHookFunc(str1, str2, passwd);
+ retVal___ = preHookFunc(&str1, &str2, &passwd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2781,9 +3713,9 @@ bool HP_login_check_encrypted(const char *str1, const char *str2, const char *pa
{
retVal___ = HPMHooks.source.login.check_encrypted(str1, str2, passwd);
}
- if( HPMHooks.count.HP_login_check_encrypted_post ) {
+ if (HPMHooks.count.HP_login_check_encrypted_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *str1, const char *str2, const char *passwd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_check_encrypted_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_check_encrypted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_check_encrypted_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str1, str2, passwd);
}
@@ -2793,14 +3725,14 @@ bool HP_login_check_encrypted(const char *str1, const char *str2, const char *pa
bool HP_login_check_password(const char *md5key, int passwdenc, const char *passwd, const char *refpass) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_login_check_password_pre ) {
- bool (*preHookFunc) (const char *md5key, int *passwdenc, const char *passwd, const char *refpass);
+ if (HPMHooks.count.HP_login_check_password_pre > 0) {
+ bool (*preHookFunc) (const char **md5key, int *passwdenc, const char **passwd, const char **refpass);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_check_password_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_check_password_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_check_password_pre[hIndex].func;
- retVal___ = preHookFunc(md5key, &passwdenc, passwd, refpass);
+ retVal___ = preHookFunc(&md5key, &passwdenc, &passwd, &refpass);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2808,11 +3740,11 @@ bool HP_login_check_password(const char *md5key, int passwdenc, const char *pass
{
retVal___ = HPMHooks.source.login.check_password(md5key, passwdenc, passwd, refpass);
}
- if( HPMHooks.count.HP_login_check_password_post ) {
- bool (*postHookFunc) (bool retVal___, const char *md5key, int *passwdenc, const char *passwd, const char *refpass);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_check_password_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_check_password_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *md5key, int passwdenc, const char *passwd, const char *refpass);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_check_password_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_check_password_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md5key, &passwdenc, passwd, refpass);
+ retVal___ = postHookFunc(retVal___, md5key, passwdenc, passwd, refpass);
}
}
return retVal___;
@@ -2820,14 +3752,14 @@ bool HP_login_check_password(const char *md5key, int passwdenc, const char *pass
uint32 HP_login_lan_subnet_check(uint32 ip) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_login_lan_subnet_check_pre ) {
+ if (HPMHooks.count.HP_login_lan_subnet_check_pre > 0) {
uint32 (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnet_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnet_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_lan_subnet_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2835,25 +3767,25 @@ uint32 HP_login_lan_subnet_check(uint32 ip) {
{
retVal___ = HPMHooks.source.login.lan_subnet_check(ip);
}
- if( HPMHooks.count.HP_login_lan_subnet_check_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnet_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_lan_subnet_check_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_lan_subnet_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_lan_subnet_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
}
void HP_login_fromchar_accinfo(int fd, int account_id, int u_fd, int u_aid, int u_group, int map_fd, struct mmo_account *acc) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_accinfo_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd, struct mmo_account *acc);
+ if (HPMHooks.count.HP_login_fromchar_accinfo_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd, struct mmo_account **acc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_accinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_accinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_accinfo_pre[hIndex].func;
- preHookFunc(&fd, &account_id, &u_fd, &u_aid, &u_group, &map_fd, acc);
+ preHookFunc(&fd, &account_id, &u_fd, &u_aid, &u_group, &map_fd, &acc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2861,25 +3793,25 @@ void HP_login_fromchar_accinfo(int fd, int account_id, int u_fd, int u_aid, int
{
HPMHooks.source.login.fromchar_accinfo(fd, account_id, u_fd, u_aid, u_group, map_fd, acc);
}
- if( HPMHooks.count.HP_login_fromchar_accinfo_post ) {
- void (*postHookFunc) (int *fd, int *account_id, int *u_fd, int *u_aid, int *u_group, int *map_fd, struct mmo_account *acc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_accinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_accinfo_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, int u_fd, int u_aid, int u_group, int map_fd, struct mmo_account *acc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_accinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_accinfo_post[hIndex].func;
- postHookFunc(&fd, &account_id, &u_fd, &u_aid, &u_group, &map_fd, acc);
+ postHookFunc(fd, account_id, u_fd, u_aid, u_group, map_fd, acc);
}
}
return;
}
void HP_login_fromchar_account(int fd, int account_id, struct mmo_account *acc) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_account_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, struct mmo_account *acc);
+ if (HPMHooks.count.HP_login_fromchar_account_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, struct mmo_account **acc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_account_pre[hIndex].func;
- preHookFunc(&fd, &account_id, acc);
+ preHookFunc(&fd, &account_id, &acc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2887,25 +3819,25 @@ void HP_login_fromchar_account(int fd, int account_id, struct mmo_account *acc)
{
HPMHooks.source.login.fromchar_account(fd, account_id, acc);
}
- if( HPMHooks.count.HP_login_fromchar_account_post ) {
- void (*postHookFunc) (int *fd, int *account_id, struct mmo_account *acc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_account_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, struct mmo_account *acc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_account_post[hIndex].func;
- postHookFunc(&fd, &account_id, acc);
+ postHookFunc(fd, account_id, acc);
}
}
return;
}
void HP_login_fromchar_account_update_other(int account_id, unsigned int state) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_account_update_other_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_account_update_other_pre > 0) {
void (*preHookFunc) (int *account_id, unsigned int *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_update_other_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_update_other_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_account_update_other_pre[hIndex].func;
preHookFunc(&account_id, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2913,25 +3845,25 @@ void HP_login_fromchar_account_update_other(int account_id, unsigned int state)
{
HPMHooks.source.login.fromchar_account_update_other(account_id, state);
}
- if( HPMHooks.count.HP_login_fromchar_account_update_other_post ) {
- void (*postHookFunc) (int *account_id, unsigned int *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_update_other_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_account_update_other_post > 0) {
+ void (*postHookFunc) (int account_id, unsigned int state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_account_update_other_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_account_update_other_post[hIndex].func;
- postHookFunc(&account_id, &state);
+ postHookFunc(account_id, state);
}
}
return;
}
void HP_login_fromchar_auth_ack(int fd, int account_id, uint32 login_id1, uint32 login_id2, uint8 sex, int request_id, struct login_auth_node *node) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_auth_ack_pre ) {
- void (*preHookFunc) (int *fd, int *account_id, uint32 *login_id1, uint32 *login_id2, uint8 *sex, int *request_id, struct login_auth_node *node);
+ if (HPMHooks.count.HP_login_fromchar_auth_ack_pre > 0) {
+ void (*preHookFunc) (int *fd, int *account_id, uint32 *login_id1, uint32 *login_id2, uint8 *sex, int *request_id, struct login_auth_node **node);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_auth_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_auth_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_auth_ack_pre[hIndex].func;
- preHookFunc(&fd, &account_id, &login_id1, &login_id2, &sex, &request_id, node);
+ preHookFunc(&fd, &account_id, &login_id1, &login_id2, &sex, &request_id, &node);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2939,25 +3871,25 @@ void HP_login_fromchar_auth_ack(int fd, int account_id, uint32 login_id1, uint32
{
HPMHooks.source.login.fromchar_auth_ack(fd, account_id, login_id1, login_id2, sex, request_id, node);
}
- if( HPMHooks.count.HP_login_fromchar_auth_ack_post ) {
- void (*postHookFunc) (int *fd, int *account_id, uint32 *login_id1, uint32 *login_id2, uint8 *sex, int *request_id, struct login_auth_node *node);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_auth_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_auth_ack_post > 0) {
+ void (*postHookFunc) (int fd, int account_id, uint32 login_id1, uint32 login_id2, uint8 sex, int request_id, struct login_auth_node *node);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_auth_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_auth_ack_post[hIndex].func;
- postHookFunc(&fd, &account_id, &login_id1, &login_id2, &sex, &request_id, node);
+ postHookFunc(fd, account_id, login_id1, login_id2, sex, request_id, node);
}
}
return;
}
void HP_login_fromchar_ban(int account_id, time_t timestamp) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_ban_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_ban_pre > 0) {
void (*preHookFunc) (int *account_id, time_t *timestamp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_ban_pre[hIndex].func;
preHookFunc(&account_id, &timestamp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2965,25 +3897,25 @@ void HP_login_fromchar_ban(int account_id, time_t timestamp) {
{
HPMHooks.source.login.fromchar_ban(account_id, timestamp);
}
- if( HPMHooks.count.HP_login_fromchar_ban_post ) {
- void (*postHookFunc) (int *account_id, time_t *timestamp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_ban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_ban_post > 0) {
+ void (*postHookFunc) (int account_id, time_t timestamp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_ban_post[hIndex].func;
- postHookFunc(&account_id, &timestamp);
+ postHookFunc(account_id, timestamp);
}
}
return;
}
void HP_login_fromchar_change_sex_other(int account_id, char sex) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_change_sex_other_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_change_sex_other_pre > 0) {
void (*preHookFunc) (int *account_id, char *sex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_change_sex_other_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_change_sex_other_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_change_sex_other_pre[hIndex].func;
preHookFunc(&account_id, &sex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2991,25 +3923,25 @@ void HP_login_fromchar_change_sex_other(int account_id, char sex) {
{
HPMHooks.source.login.fromchar_change_sex_other(account_id, sex);
}
- if( HPMHooks.count.HP_login_fromchar_change_sex_other_post ) {
- void (*postHookFunc) (int *account_id, char *sex);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_change_sex_other_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_change_sex_other_post > 0) {
+ void (*postHookFunc) (int account_id, char sex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_change_sex_other_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_change_sex_other_post[hIndex].func;
- postHookFunc(&account_id, &sex);
+ postHookFunc(account_id, sex);
}
}
return;
}
void HP_login_fromchar_pong(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_pong_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_pong_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_pong_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_pong_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_pong_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3017,25 +3949,25 @@ void HP_login_fromchar_pong(int fd) {
{
HPMHooks.source.login.fromchar_pong(fd);
}
- if( HPMHooks.count.HP_login_fromchar_pong_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_pong_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_pong_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_pong_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_pong_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_login_fromchar_parse_auth(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_auth_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_auth_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_auth_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_auth_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_auth_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3043,25 +3975,25 @@ void HP_login_fromchar_parse_auth(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_auth(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_auth_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_auth_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_auth_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_auth_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_auth_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_update_users(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_update_users_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_update_users_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_users_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_users_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_update_users_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3069,25 +4001,25 @@ void HP_login_fromchar_parse_update_users(int fd, int id) {
{
HPMHooks.source.login.fromchar_parse_update_users(fd, id);
}
- if( HPMHooks.count.HP_login_fromchar_parse_update_users_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_users_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_update_users_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_users_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_update_users_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_login_fromchar_parse_request_change_email(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_request_change_email_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_request_change_email_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_change_email_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_change_email_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_request_change_email_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3095,25 +4027,25 @@ void HP_login_fromchar_parse_request_change_email(int fd, int id, const char *ip
{
HPMHooks.source.login.fromchar_parse_request_change_email(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_request_change_email_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_change_email_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_request_change_email_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_change_email_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_request_change_email_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_account_data(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_account_data_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_account_data_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_data_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3121,25 +4053,25 @@ void HP_login_fromchar_parse_account_data(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_account_data(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_account_data_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_data_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_data_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_ping(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_ping_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_ping_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ping_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ping_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_ping_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3147,25 +4079,25 @@ void HP_login_fromchar_parse_ping(int fd) {
{
HPMHooks.source.login.fromchar_parse_ping(fd);
}
- if( HPMHooks.count.HP_login_fromchar_parse_ping_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ping_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_ping_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ping_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_ping_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_login_fromchar_parse_change_email(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_change_email_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_change_email_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_email_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_email_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_change_email_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3173,25 +4105,25 @@ void HP_login_fromchar_parse_change_email(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_change_email(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_change_email_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_email_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_change_email_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_email_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_change_email_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_account_update(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_account_update_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_account_update_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_update_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3199,25 +4131,25 @@ void HP_login_fromchar_parse_account_update(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_account_update(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_account_update_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_update_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_update_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_ban(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_ban_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_ban_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_ban_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3225,25 +4157,25 @@ void HP_login_fromchar_parse_ban(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_ban(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_ban_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_ban_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_ban_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_change_sex(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_change_sex_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_change_sex_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_sex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_sex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_change_sex_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3251,25 +4183,25 @@ void HP_login_fromchar_parse_change_sex(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_change_sex(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_change_sex_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_sex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_change_sex_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_sex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_change_sex_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_account_reg2(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_account_reg2_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_account_reg2_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_reg2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_reg2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_reg2_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3277,25 +4209,25 @@ void HP_login_fromchar_parse_account_reg2(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_account_reg2(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_account_reg2_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_reg2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_reg2_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_reg2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_reg2_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_unban(int fd, int id, const char *ip) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_unban_pre ) {
- void (*preHookFunc) (int *fd, int *id, const char *ip);
+ if (HPMHooks.count.HP_login_fromchar_parse_unban_pre > 0) {
+ void (*preHookFunc) (int *fd, int *id, const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_unban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_unban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_unban_pre[hIndex].func;
- preHookFunc(&fd, &id, ip);
+ preHookFunc(&fd, &id, &ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3303,25 +4235,25 @@ void HP_login_fromchar_parse_unban(int fd, int id, const char *ip) {
{
HPMHooks.source.login.fromchar_parse_unban(fd, id, ip);
}
- if( HPMHooks.count.HP_login_fromchar_parse_unban_post ) {
- void (*postHookFunc) (int *fd, int *id, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_unban_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_unban_post > 0) {
+ void (*postHookFunc) (int fd, int id, const char *ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_unban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_unban_post[hIndex].func;
- postHookFunc(&fd, &id, ip);
+ postHookFunc(fd, id, ip);
}
}
return;
}
void HP_login_fromchar_parse_account_online(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_account_online_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_online_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_online_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_online_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_online_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3329,25 +4261,25 @@ void HP_login_fromchar_parse_account_online(int fd, int id) {
{
HPMHooks.source.login.fromchar_parse_account_online(fd, id);
}
- if( HPMHooks.count.HP_login_fromchar_parse_account_online_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_online_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_online_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_online_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_online_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_login_fromchar_parse_account_offline(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_account_offline_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_offline_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_offline_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3355,25 +4287,25 @@ void HP_login_fromchar_parse_account_offline(int fd) {
{
HPMHooks.source.login.fromchar_parse_account_offline(fd);
}
- if( HPMHooks.count.HP_login_fromchar_parse_account_offline_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_account_offline_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_account_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_account_offline_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_login_fromchar_parse_online_accounts(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_online_accounts_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_online_accounts_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_online_accounts_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_online_accounts_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_online_accounts_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3381,25 +4313,25 @@ void HP_login_fromchar_parse_online_accounts(int fd, int id) {
{
HPMHooks.source.login.fromchar_parse_online_accounts(fd, id);
}
- if( HPMHooks.count.HP_login_fromchar_parse_online_accounts_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_online_accounts_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_online_accounts_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_online_accounts_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_online_accounts_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_login_fromchar_parse_request_account_reg2(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_request_account_reg2_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3407,25 +4339,25 @@ void HP_login_fromchar_parse_request_account_reg2(int fd) {
{
HPMHooks.source.login.fromchar_parse_request_account_reg2(fd);
}
- if( HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_request_account_reg2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_request_account_reg2_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_login_fromchar_parse_update_wan_ip(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_update_wan_ip_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3433,25 +4365,25 @@ void HP_login_fromchar_parse_update_wan_ip(int fd, int id) {
{
HPMHooks.source.login.fromchar_parse_update_wan_ip(fd, id);
}
- if( HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_update_wan_ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_update_wan_ip_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_login_fromchar_parse_all_offline(int fd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_all_offline_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_all_offline_pre > 0) {
void (*preHookFunc) (int *fd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_all_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_all_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_all_offline_pre[hIndex].func;
preHookFunc(&fd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3459,25 +4391,25 @@ void HP_login_fromchar_parse_all_offline(int fd, int id) {
{
HPMHooks.source.login.fromchar_parse_all_offline(fd, id);
}
- if( HPMHooks.count.HP_login_fromchar_parse_all_offline_post ) {
- void (*postHookFunc) (int *fd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_all_offline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_all_offline_post > 0) {
+ void (*postHookFunc) (int fd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_all_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_all_offline_post[hIndex].func;
- postHookFunc(&fd, &id);
+ postHookFunc(fd, id);
}
}
return;
}
void HP_login_fromchar_parse_change_pincode(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_change_pincode_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_change_pincode_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_pincode_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_pincode_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_change_pincode_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3485,11 +4417,11 @@ void HP_login_fromchar_parse_change_pincode(int fd) {
{
HPMHooks.source.login.fromchar_parse_change_pincode(fd);
}
- if( HPMHooks.count.HP_login_fromchar_parse_change_pincode_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_pincode_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_change_pincode_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_change_pincode_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_change_pincode_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -3497,14 +4429,14 @@ void HP_login_fromchar_parse_change_pincode(int fd) {
bool HP_login_fromchar_parse_wrong_pincode(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_wrong_pincode_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3512,25 +4444,25 @@ bool HP_login_fromchar_parse_wrong_pincode(int fd) {
{
retVal___ = HPMHooks.source.login.fromchar_parse_wrong_pincode(fd);
}
- if( HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_wrong_pincode_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_wrong_pincode_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_login_fromchar_parse_accinfo(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_fromchar_parse_accinfo_pre ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_accinfo_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_accinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_accinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_fromchar_parse_accinfo_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3538,11 +4470,11 @@ void HP_login_fromchar_parse_accinfo(int fd) {
{
HPMHooks.source.login.fromchar_parse_accinfo(fd);
}
- if( HPMHooks.count.HP_login_fromchar_parse_accinfo_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_accinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_fromchar_parse_accinfo_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_fromchar_parse_accinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_fromchar_parse_accinfo_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -3550,14 +4482,14 @@ void HP_login_fromchar_parse_accinfo(int fd) {
int HP_login_parse_fromchar(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_login_parse_fromchar_pre ) {
+ if (HPMHooks.count.HP_login_parse_fromchar_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_fromchar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_fromchar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_parse_fromchar_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3565,51 +4497,25 @@ int HP_login_parse_fromchar(int fd) {
{
retVal___ = HPMHooks.source.login.parse_fromchar(fd);
}
- if( HPMHooks.count.HP_login_parse_fromchar_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_fromchar_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_parse_fromchar_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_fromchar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_parse_fromchar_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
-void HP_login_connection_problem(int fd, uint8 status) {
- int hIndex = 0;
- if( HPMHooks.count.HP_login_connection_problem_pre ) {
- void (*preHookFunc) (int *fd, uint8 *status);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_connection_problem_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_connection_problem_pre[hIndex].func;
- preHookFunc(&fd, &status);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.login.connection_problem(fd, status);
- }
- if( HPMHooks.count.HP_login_connection_problem_post ) {
- void (*postHookFunc) (int *fd, uint8 *status);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_connection_problem_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_connection_problem_post[hIndex].func;
- postHookFunc(&fd, &status);
- }
- }
- return;
-}
void HP_login_kick(struct login_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_kick_pre ) {
- void (*preHookFunc) (struct login_session_data *sd);
+ if (HPMHooks.count.HP_login_kick_pre > 0) {
+ void (*preHookFunc) (struct login_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_kick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_kick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_kick_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3617,9 +4523,9 @@ void HP_login_kick(struct login_session_data *sd) {
{
HPMHooks.source.login.kick(sd);
}
- if( HPMHooks.count.HP_login_kick_post ) {
+ if (HPMHooks.count.HP_login_kick_post > 0) {
void (*postHookFunc) (struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_kick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_kick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_kick_post[hIndex].func;
postHookFunc(sd);
}
@@ -3628,14 +4534,14 @@ void HP_login_kick(struct login_session_data *sd) {
}
void HP_login_auth_ok(struct login_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_auth_ok_pre ) {
- void (*preHookFunc) (struct login_session_data *sd);
+ if (HPMHooks.count.HP_login_auth_ok_pre > 0) {
+ void (*preHookFunc) (struct login_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_auth_ok_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3643,9 +4549,9 @@ void HP_login_auth_ok(struct login_session_data *sd) {
{
HPMHooks.source.login.auth_ok(sd);
}
- if( HPMHooks.count.HP_login_auth_ok_post ) {
+ if (HPMHooks.count.HP_login_auth_ok_post > 0) {
void (*postHookFunc) (struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_ok_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_auth_ok_post[hIndex].func;
postHookFunc(sd);
}
@@ -3654,14 +4560,14 @@ void HP_login_auth_ok(struct login_session_data *sd) {
}
void HP_login_auth_failed(struct login_session_data *sd, int result) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_auth_failed_pre ) {
- void (*preHookFunc) (struct login_session_data *sd, int *result);
+ if (HPMHooks.count.HP_login_auth_failed_pre > 0) {
+ void (*preHookFunc) (struct login_session_data **sd, int *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_login_auth_failed_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3669,688 +4575,742 @@ void HP_login_auth_failed(struct login_session_data *sd, int result) {
{
HPMHooks.source.login.auth_failed(sd, result);
}
- if( HPMHooks.count.HP_login_auth_failed_post ) {
- void (*postHookFunc) (struct login_session_data *sd, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_login_auth_failed_post > 0) {
+ void (*postHookFunc) (struct login_session_data *sd, int result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_auth_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_login_auth_failed_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
-void HP_login_login_error(int fd, uint8 status) {
+bool HP_login_client_login(int fd, struct login_session_data *sd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_login_client_login_pre > 0) {
+ bool (*preHookFunc) (int *fd, struct login_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_client_login_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_login_client_login_pre[hIndex].func;
+ retVal___ = preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.login.client_login(fd, sd);
+ }
+ if (HPMHooks.count.HP_login_client_login_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd, struct login_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_client_login_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_login_client_login_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fd, sd);
+ }
+ }
+ return retVal___;
+}
+void HP_login_char_server_connection_status(int fd, struct login_session_data *sd, uint8 status) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_login_error_pre ) {
- void (*preHookFunc) (int *fd, uint8 *status);
+ if (HPMHooks.count.HP_login_char_server_connection_status_pre > 0) {
+ void (*preHookFunc) (int *fd, struct login_session_data **sd, uint8 *status);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_login_error_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_login_error_pre[hIndex].func;
- preHookFunc(&fd, &status);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_char_server_connection_status_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_login_char_server_connection_status_pre[hIndex].func;
+ preHookFunc(&fd, &sd, &status);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.login_error(fd, status);
+ HPMHooks.source.login.char_server_connection_status(fd, sd, status);
}
- if( HPMHooks.count.HP_login_login_error_post ) {
- void (*postHookFunc) (int *fd, uint8 *status);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_login_error_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_login_error_post[hIndex].func;
- postHookFunc(&fd, &status);
+ if (HPMHooks.count.HP_login_char_server_connection_status_post > 0) {
+ void (*postHookFunc) (int fd, struct login_session_data *sd, uint8 status);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_char_server_connection_status_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_login_char_server_connection_status_post[hIndex].func;
+ postHookFunc(fd, sd, status);
}
}
return;
}
-void HP_login_parse_ping(int fd, struct login_session_data *sd) {
+void HP_login_parse_request_connection(int fd, struct login_session_data *sd, const char *ip, uint32 ipl) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_parse_ping_pre ) {
- void (*preHookFunc) (int *fd, struct login_session_data *sd);
+ if (HPMHooks.count.HP_login_parse_request_connection_pre > 0) {
+ void (*preHookFunc) (int *fd, struct login_session_data **sd, const char **ip, uint32 *ipl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_ping_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_parse_ping_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_request_connection_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_login_parse_request_connection_pre[hIndex].func;
+ preHookFunc(&fd, &sd, &ip, &ipl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.parse_ping(fd, sd);
+ HPMHooks.source.login.parse_request_connection(fd, sd, ip, ipl);
}
- if( HPMHooks.count.HP_login_parse_ping_post ) {
- void (*postHookFunc) (int *fd, struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_ping_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_parse_ping_post[hIndex].func;
- postHookFunc(&fd, sd);
+ if (HPMHooks.count.HP_login_parse_request_connection_post > 0) {
+ void (*postHookFunc) (int fd, struct login_session_data *sd, const char *ip, uint32 ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_request_connection_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_login_parse_request_connection_post[hIndex].func;
+ postHookFunc(fd, sd, ip, ipl);
}
}
return;
}
-void HP_login_parse_client_md5(int fd, struct login_session_data *sd) {
+void HP_login_config_set_defaults(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_parse_client_md5_pre ) {
- void (*preHookFunc) (int *fd, struct login_session_data *sd);
+ if (HPMHooks.count.HP_login_config_set_defaults_pre > 0) {
+ void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_client_md5_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_parse_client_md5_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_config_set_defaults_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_login_config_set_defaults_pre[hIndex].func;
+ preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.parse_client_md5(fd, sd);
+ HPMHooks.source.login.config_set_defaults();
}
- if( HPMHooks.count.HP_login_parse_client_md5_post ) {
- void (*postHookFunc) (int *fd, struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_client_md5_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_parse_client_md5_post[hIndex].func;
- postHookFunc(&fd, sd);
+ if (HPMHooks.count.HP_login_config_set_defaults_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_config_set_defaults_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_login_config_set_defaults_post[hIndex].func;
+ postHookFunc();
}
}
return;
}
-bool HP_login_parse_client_login(int fd, struct login_session_data *sd, const char *ip) {
+bool HP_login_config_read(const char *filename, bool included) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_login_parse_client_login_pre ) {
- bool (*preHookFunc) (int *fd, struct login_session_data *sd, const char *ip);
+ if (HPMHooks.count.HP_login_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *included);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_client_login_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_parse_client_login_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, sd, ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_config_read_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_login_config_read_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &included);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.login.parse_client_login(fd, sd, ip);
+ retVal___ = HPMHooks.source.login.config_read(filename, included);
}
- if( HPMHooks.count.HP_login_parse_client_login_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd, struct login_session_data *sd, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_client_login_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_parse_client_login_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, sd, ip);
+ if (HPMHooks.count.HP_login_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool included);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_login_config_read_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_login_config_read_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, included);
}
}
return retVal___;
}
-void HP_login_send_coding_key(int fd, struct login_session_data *sd) {
+/* md5_interface */
+void HP_md5_string(const char *string, char *output) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_send_coding_key_pre ) {
- void (*preHookFunc) (int *fd, struct login_session_data *sd);
+ if (HPMHooks.count.HP_md5_string_pre > 0) {
+ void (*preHookFunc) (const char **string, char **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_send_coding_key_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_send_coding_key_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func;
+ preHookFunc(&string, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.send_coding_key(fd, sd);
+ HPMHooks.source.md5.string(string, output);
}
- if( HPMHooks.count.HP_login_send_coding_key_post ) {
- void (*postHookFunc) (int *fd, struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_send_coding_key_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_send_coding_key_post[hIndex].func;
- postHookFunc(&fd, sd);
+ if (HPMHooks.count.HP_md5_string_post > 0) {
+ void (*postHookFunc) (const char *string, char *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func;
+ postHookFunc(string, output);
}
}
return;
}
-void HP_login_parse_request_coding_key(int fd, struct login_session_data *sd) {
+void HP_md5_binary(const uint8 *buf, const int buf_size, uint8 *output) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_parse_request_coding_key_pre ) {
- void (*preHookFunc) (int *fd, struct login_session_data *sd);
+ if (HPMHooks.count.HP_md5_binary_pre > 0) {
+ void (*preHookFunc) (const uint8 **buf, const int *buf_size, uint8 **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_request_coding_key_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_parse_request_coding_key_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func;
+ preHookFunc(&buf, &buf_size, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.parse_request_coding_key(fd, sd);
+ HPMHooks.source.md5.binary(buf, buf_size, output);
}
- if( HPMHooks.count.HP_login_parse_request_coding_key_post ) {
- void (*postHookFunc) (int *fd, struct login_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_request_coding_key_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_parse_request_coding_key_post[hIndex].func;
- postHookFunc(&fd, sd);
+ if (HPMHooks.count.HP_md5_binary_post > 0) {
+ void (*postHookFunc) (const uint8 *buf, const int buf_size, uint8 *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func;
+ postHookFunc(buf, buf_size, output);
}
}
return;
}
-void HP_login_char_server_connection_status(int fd, struct login_session_data *sd, uint8 status) {
+void HP_md5_salt(int len, char *output) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_char_server_connection_status_pre ) {
- void (*preHookFunc) (int *fd, struct login_session_data *sd, uint8 *status);
+ if (HPMHooks.count.HP_md5_salt_pre > 0) {
+ void (*preHookFunc) (int *len, char **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_char_server_connection_status_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_char_server_connection_status_pre[hIndex].func;
- preHookFunc(&fd, sd, &status);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func;
+ preHookFunc(&len, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.char_server_connection_status(fd, sd, status);
+ HPMHooks.source.md5.salt(len, output);
}
- if( HPMHooks.count.HP_login_char_server_connection_status_post ) {
- void (*postHookFunc) (int *fd, struct login_session_data *sd, uint8 *status);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_char_server_connection_status_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_char_server_connection_status_post[hIndex].func;
- postHookFunc(&fd, sd, &status);
+ if (HPMHooks.count.HP_md5_salt_post > 0) {
+ void (*postHookFunc) (int len, char *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func;
+ postHookFunc(len, output);
}
}
return;
}
-void HP_login_parse_request_connection(int fd, struct login_session_data *sd, const char *ip, uint32 ipl) {
+/* mutex_interface */
+struct mutex_data* HP_mutex_create(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_parse_request_connection_pre ) {
- void (*preHookFunc) (int *fd, struct login_session_data *sd, const char *ip, uint32 *ipl);
+ struct mutex_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_mutex_create_pre > 0) {
+ struct mutex_data* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_request_connection_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_parse_request_connection_pre[hIndex].func;
- preHookFunc(&fd, sd, ip, &ipl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func;
+ retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.login.parse_request_connection(fd, sd, ip, ipl);
+ retVal___ = HPMHooks.source.mutex.create();
}
- if( HPMHooks.count.HP_login_parse_request_connection_post ) {
- void (*postHookFunc) (int *fd, struct login_session_data *sd, const char *ip, uint32 *ipl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_request_connection_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_parse_request_connection_post[hIndex].func;
- postHookFunc(&fd, sd, ip, &ipl);
+ if (HPMHooks.count.HP_mutex_create_post > 0) {
+ struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
}
}
- return;
+ return retVal___;
}
-int HP_login_parse_login(int fd) {
+void HP_mutex_destroy(struct mutex_data *m) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_login_parse_login_pre ) {
- int (*preHookFunc) (int *fd);
+ if (HPMHooks.count.HP_mutex_destroy_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_login_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_parse_login_pre[hIndex].func;
- retVal___ = preHookFunc(&fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func;
+ preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.login.parse_login(fd);
+ HPMHooks.source.mutex.destroy(m);
}
- if( HPMHooks.count.HP_login_parse_login_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_parse_login_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_parse_login_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ if (HPMHooks.count.HP_mutex_destroy_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func;
+ postHookFunc(m);
}
}
- return retVal___;
+ return;
}
-void HP_login_config_set_defaults(void) {
+void HP_mutex_lock(struct mutex_data *m) {
int hIndex = 0;
- if( HPMHooks.count.HP_login_config_set_defaults_pre ) {
- void (*preHookFunc) (void);
+ if (HPMHooks.count.HP_mutex_lock_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_config_set_defaults_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_config_set_defaults_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func;
+ preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.login.config_set_defaults();
+ HPMHooks.source.mutex.lock(m);
}
- if( HPMHooks.count.HP_login_config_set_defaults_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_config_set_defaults_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_config_set_defaults_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_mutex_lock_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func;
+ postHookFunc(m);
}
}
return;
}
-int HP_login_config_read(const char *cfgName) {
+bool HP_mutex_trylock(struct mutex_data *m) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_login_config_read_pre ) {
- int (*preHookFunc) (const char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mutex_trylock_pre > 0) {
+ bool (*preHookFunc) (struct mutex_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_config_read_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_login_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func;
+ retVal___ = preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.login.config_read(cfgName);
+ retVal___ = HPMHooks.source.mutex.trylock(m);
}
- if( HPMHooks.count.HP_login_config_read_post ) {
- int (*postHookFunc) (int retVal___, const char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_login_config_read_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_login_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ if (HPMHooks.count.HP_mutex_trylock_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, m);
}
}
return retVal___;
}
-/* iMalloc */
-void HP_iMalloc_init(void) {
+void HP_mutex_unlock(struct mutex_data *m) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_pre ) {
- void (*preHookFunc) (void);
+ if (HPMHooks.count.HP_mutex_unlock_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func;
+ preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.init();
+ HPMHooks.source.mutex.unlock(m);
}
- if( HPMHooks.count.HP_iMalloc_init_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_mutex_unlock_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func;
+ postHookFunc(m);
}
}
return;
}
-void HP_iMalloc_final(void) {
+struct cond_data* HP_mutex_cond_create(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_final_pre ) {
- void (*preHookFunc) (void);
+ struct cond_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_mutex_cond_create_pre > 0) {
+ struct cond_data* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func;
+ retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.iMalloc.final();
+ retVal___ = HPMHooks.source.mutex.cond_create();
}
- if( HPMHooks.count.HP_iMalloc_final_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_mutex_cond_create_post > 0) {
+ struct cond_data* (*postHookFunc) (struct cond_data* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
}
}
- return;
+ return retVal___;
}
-void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) {
+void HP_mutex_cond_destroy(struct cond_data *c) {
int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_malloc_pre ) {
- void* (*preHookFunc) (size_t *size, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_mutex_cond_destroy_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func;
- retVal___ = preHookFunc(&size, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func;
+ preHookFunc(&c);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func);
+ HPMHooks.source.mutex.cond_destroy(c);
}
- if( HPMHooks.count.HP_iMalloc_malloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &size, file, &line, func);
+ if (HPMHooks.count.HP_mutex_cond_destroy_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func;
+ postHookFunc(c);
}
}
- return retVal___;
+ return;
}
-void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
+void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) {
int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_calloc_pre ) {
- void* (*preHookFunc) (size_t *num, size_t *size, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_mutex_cond_wait_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func;
- retVal___ = preHookFunc(&num, &size, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func;
+ preHookFunc(&c, &m, &timeout_ticks);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func);
+ HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks);
}
- if( HPMHooks.count.HP_iMalloc_calloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t *num, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &num, &size, file, &line, func);
+ if (HPMHooks.count.HP_mutex_cond_wait_post > 0) {
+ void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func;
+ postHookFunc(c, m, timeout_ticks);
}
}
- return retVal___;
+ return;
}
-void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) {
+void HP_mutex_cond_signal(struct cond_data *c) {
int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_realloc_pre ) {
- void* (*preHookFunc) (void *p, size_t *size, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_mutex_cond_signal_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func;
- retVal___ = preHookFunc(p, &size, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func;
+ preHookFunc(&c);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func);
+ HPMHooks.source.mutex.cond_signal(c);
}
- if( HPMHooks.count.HP_iMalloc_realloc_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &size, file, &line, func);
+ if (HPMHooks.count.HP_mutex_cond_signal_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func;
+ postHookFunc(c);
}
}
- return retVal___;
+ return;
}
-void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
+void HP_mutex_cond_broadcast(struct cond_data *c) {
int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_reallocz_pre ) {
- void* (*preHookFunc) (void *p, size_t *size, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_mutex_cond_broadcast_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func;
- retVal___ = preHookFunc(p, &size, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func;
+ preHookFunc(&c);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func);
+ HPMHooks.source.mutex.cond_broadcast(c);
}
- if( HPMHooks.count.HP_iMalloc_reallocz_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &size, file, &line, func);
+ if (HPMHooks.count.HP_mutex_cond_broadcast_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func;
+ postHookFunc(c);
}
}
- return retVal___;
+ return;
}
-char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) {
+/* nullpo_interface */
+void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrdup_pre ) {
- char* (*preHookFunc) (const char *p, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_nullpo_assert_report_pre > 0) {
+ void (*preHookFunc) (const char **file, int *line, const char **func, const char **targetname, const char **title);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func;
- retVal___ = preHookFunc(p, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_nullpo_assert_report_pre[hIndex].func;
+ preHookFunc(&file, &line, &func, &targetname, &title);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func);
+ HPMHooks.source.nullpo.assert_report(file, line, func, targetname, title);
}
- if( HPMHooks.count.HP_iMalloc_astrdup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, file, &line, func);
+ if (HPMHooks.count.HP_nullpo_assert_report_post > 0) {
+ void (*postHookFunc) (const char *file, int line, const char *func, const char *targetname, const char *title);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_nullpo_assert_report_post[hIndex].func;
+ postHookFunc(file, line, func, targetname, title);
}
}
- return retVal___;
+ return;
}
-void HP_iMalloc_free(void *p, const char *file, int line, const char *func) {
+/* rnd_interface */
+void HP_rnd_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_free_pre ) {
- void (*preHookFunc) (void *p, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_rnd_init_pre > 0) {
+ void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func;
- preHookFunc(p, file, &line, func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func;
+ preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.free(p, file, line, func);
+ HPMHooks.source.rnd.init();
}
- if( HPMHooks.count.HP_iMalloc_free_post ) {
- void (*postHookFunc) (void *p, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func;
- postHookFunc(p, file, &line, func);
+ if (HPMHooks.count.HP_rnd_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func;
+ postHookFunc();
}
}
return;
}
-void HP_iMalloc_memory_check(void) {
+void HP_rnd_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_memory_check_pre ) {
+ if (HPMHooks.count.HP_rnd_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.iMalloc.memory_check();
+ HPMHooks.source.rnd.final();
}
- if( HPMHooks.count.HP_iMalloc_memory_check_post ) {
+ if (HPMHooks.count.HP_rnd_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-bool HP_iMalloc_verify_ptr(void *ptr) {
+void HP_rnd_seed(uint32 seed) {
int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) {
- bool (*preHookFunc) (void *ptr);
+ if (HPMHooks.count.HP_rnd_seed_pre > 0) {
+ void (*preHookFunc) (uint32 *seed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func;
- retVal___ = preHookFunc(ptr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func;
+ preHookFunc(&seed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return retVal___;
+ return;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr);
+ HPMHooks.source.rnd.seed(seed);
}
- if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) {
- bool (*postHookFunc) (bool retVal___, void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ptr);
+ if (HPMHooks.count.HP_rnd_seed_post > 0) {
+ void (*postHookFunc) (uint32 seed);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func;
+ postHookFunc(seed);
}
}
- return retVal___;
+ return;
}
-size_t HP_iMalloc_usage(void) {
+int32 HP_rnd_random(void) {
int hIndex = 0;
- size_t retVal___ = 0;
- if( HPMHooks.count.HP_iMalloc_usage_pre ) {
- size_t (*preHookFunc) (void);
+ int32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_random_pre > 0) {
+ int32 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.iMalloc.usage();
+ retVal___ = HPMHooks.source.rnd.random();
}
- if( HPMHooks.count.HP_iMalloc_usage_post ) {
- size_t (*postHookFunc) (size_t retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func;
+ if (HPMHooks.count.HP_rnd_random_post > 0) {
+ int32 (*postHookFunc) (int32 retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-void HP_iMalloc_post_shutdown(void) {
+uint32 HP_rnd_roll(uint32 dice_faces) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) {
- void (*preHookFunc) (void);
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_roll_pre > 0) {
+ uint32 (*preHookFunc) (uint32 *dice_faces);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func;
+ retVal___ = preHookFunc(&dice_faces);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.iMalloc.post_shutdown();
+ retVal___ = HPMHooks.source.rnd.roll(dice_faces);
}
- if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_rnd_roll_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, dice_faces);
}
}
- return;
+ return retVal___;
}
-void HP_iMalloc_init_messages(void) {
+int32 HP_rnd_value(int32 min, int32 max) {
int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_messages_pre ) {
- void (*preHookFunc) (void);
+ int32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_value_pre > 0) {
+ int32 (*preHookFunc) (int32 *min, int32 *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func;
- preHookFunc();
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func;
+ retVal___ = preHookFunc(&min, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.iMalloc.init_messages();
+ retVal___ = HPMHooks.source.rnd.value(min, max);
}
- if( HPMHooks.count.HP_iMalloc_init_messages_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func;
- postHookFunc();
+ if (HPMHooks.count.HP_rnd_value_post > 0) {
+ int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, min, max);
}
}
- return;
+ return retVal___;
}
-/* nullpo */
-void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
+double HP_rnd_uniform(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_nullpo_assert_report_pre ) {
- void (*preHookFunc) (const char *file, int *line, const char *func, const char *targetname, const char *title);
+ double retVal___ = 0.;
+ if (HPMHooks.count.HP_rnd_uniform_pre > 0) {
+ double (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_nullpo_assert_report_pre[hIndex].func;
- preHookFunc(file, &line, func, targetname, title);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func;
+ retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.nullpo.assert_report(file, line, func, targetname, title);
+ retVal___ = HPMHooks.source.rnd.uniform();
}
- if( HPMHooks.count.HP_nullpo_assert_report_post ) {
- void (*postHookFunc) (const char *file, int *line, const char *func, const char *targetname, const char *title);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_nullpo_assert_report_post[hIndex].func;
- postHookFunc(file, &line, func, targetname, title);
+ if (HPMHooks.count.HP_rnd_uniform_post > 0) {
+ double (*postHookFunc) (double retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
}
}
- return;
+ return retVal___;
+}
+double HP_rnd_uniform53(void) {
+ int hIndex = 0;
+ double retVal___ = 0.;
+ if (HPMHooks.count.HP_rnd_uniform53_pre > 0) {
+ double (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.uniform53();
+ }
+ if (HPMHooks.count.HP_rnd_uniform53_post > 0) {
+ double (*postHookFunc) (double retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
}
-/* showmsg */
+/* showmsg_interface */
void HP_showmsg_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_init_pre ) {
+ if (HPMHooks.count.HP_showmsg_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4358,9 +5318,9 @@ void HP_showmsg_init(void) {
{
HPMHooks.source.showmsg.init();
}
- if( HPMHooks.count.HP_showmsg_init_post ) {
+ if (HPMHooks.count.HP_showmsg_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_init_post[hIndex].func;
postHookFunc();
}
@@ -4369,14 +5329,14 @@ void HP_showmsg_init(void) {
}
void HP_showmsg_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_final_pre ) {
+ if (HPMHooks.count.HP_showmsg_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4384,9 +5344,9 @@ void HP_showmsg_final(void) {
{
HPMHooks.source.showmsg.final();
}
- if( HPMHooks.count.HP_showmsg_final_post ) {
+ if (HPMHooks.count.HP_showmsg_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_final_post[hIndex].func;
postHookFunc();
}
@@ -4395,14 +5355,14 @@ void HP_showmsg_final(void) {
}
void HP_showmsg_clearScreen(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_clearScreen_pre ) {
+ if (HPMHooks.count.HP_showmsg_clearScreen_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_clearScreen_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4410,9 +5370,9 @@ void HP_showmsg_clearScreen(void) {
{
HPMHooks.source.showmsg.clearScreen();
}
- if( HPMHooks.count.HP_showmsg_clearScreen_post ) {
+ if (HPMHooks.count.HP_showmsg_clearScreen_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_clearScreen_post[hIndex].func;
postHookFunc();
}
@@ -4422,16 +5382,16 @@ void HP_showmsg_clearScreen(void) {
int HP_showmsg_showMessageV(const char *string, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_showmsg_showMessageV_pre ) {
- int (*preHookFunc) (const char *string, va_list ap);
+ if (HPMHooks.count.HP_showmsg_showMessageV_pre > 0) {
+ int (*preHookFunc) (const char **string, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_showmsg_showMessageV_pre[hIndex].func;
- retVal___ = preHookFunc(string, ap___copy);
+ retVal___ = preHookFunc(&string, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4441,9 +5401,9 @@ int HP_showmsg_showMessageV(const char *string, va_list ap) {
retVal___ = HPMHooks.source.showmsg.showMessageV(string, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_showmsg_showMessageV_post ) {
+ if (HPMHooks.count.HP_showmsg_showMessageV_post > 0) {
int (*postHookFunc) (int retVal___, const char *string, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_showmsg_showMessageV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, ap___copy);
@@ -4452,17 +5412,17 @@ int HP_showmsg_showMessageV(const char *string, va_list ap) {
}
return retVal___;
}
-/* sockt */
+/* socket_interface */
void HP_sockt_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_init_pre ) {
+ if (HPMHooks.count.HP_sockt_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4470,9 +5430,9 @@ void HP_sockt_init(void) {
{
HPMHooks.source.sockt.init();
}
- if( HPMHooks.count.HP_sockt_init_post ) {
+ if (HPMHooks.count.HP_sockt_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_init_post[hIndex].func;
postHookFunc();
}
@@ -4481,14 +5441,14 @@ void HP_sockt_init(void) {
}
void HP_sockt_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_final_pre ) {
+ if (HPMHooks.count.HP_sockt_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4496,9 +5456,9 @@ void HP_sockt_final(void) {
{
HPMHooks.source.sockt.final();
}
- if( HPMHooks.count.HP_sockt_final_post ) {
+ if (HPMHooks.count.HP_sockt_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_final_post[hIndex].func;
postHookFunc();
}
@@ -4508,14 +5468,14 @@ void HP_sockt_final(void) {
int HP_sockt_perform(int next) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_perform_pre ) {
+ if (HPMHooks.count.HP_sockt_perform_pre > 0) {
int (*preHookFunc) (int *next);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_perform_pre[hIndex].func;
retVal___ = preHookFunc(&next);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4523,25 +5483,25 @@ int HP_sockt_perform(int next) {
{
retVal___ = HPMHooks.source.sockt.perform(next);
}
- if( HPMHooks.count.HP_sockt_perform_post ) {
- int (*postHookFunc) (int retVal___, int *next);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_perform_post > 0) {
+ int (*postHookFunc) (int retVal___, int next);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_perform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &next);
+ retVal___ = postHookFunc(retVal___, next);
}
}
return retVal___;
}
void HP_sockt_datasync(int fd, bool send) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_datasync_pre ) {
+ if (HPMHooks.count.HP_sockt_datasync_pre > 0) {
void (*preHookFunc) (int *fd, bool *send);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_datasync_pre[hIndex].func;
preHookFunc(&fd, &send);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4549,11 +5509,11 @@ void HP_sockt_datasync(int fd, bool send) {
{
HPMHooks.source.sockt.datasync(fd, send);
}
- if( HPMHooks.count.HP_sockt_datasync_post ) {
- void (*postHookFunc) (int *fd, bool *send);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_datasync_post > 0) {
+ void (*postHookFunc) (int fd, bool send);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_datasync_post[hIndex].func;
- postHookFunc(&fd, &send);
+ postHookFunc(fd, send);
}
}
return;
@@ -4561,14 +5521,14 @@ void HP_sockt_datasync(int fd, bool send) {
int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_make_listen_bind_pre ) {
+ if (HPMHooks.count.HP_sockt_make_listen_bind_pre > 0) {
int (*preHookFunc) (uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_make_listen_bind_pre[hIndex].func;
retVal___ = preHookFunc(&ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4576,11 +5536,11 @@ int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
{
retVal___ = HPMHooks.source.sockt.make_listen_bind(ip, port);
}
- if( HPMHooks.count.HP_sockt_make_listen_bind_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_make_listen_bind_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_make_listen_bind_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, &port);
+ retVal___ = postHookFunc(retVal___, ip, port);
}
}
return retVal___;
@@ -4588,14 +5548,14 @@ int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_make_connection_pre ) {
- int (*preHookFunc) (uint32 *ip, uint16 *port, struct hSockOpt *opt);
+ if (HPMHooks.count.HP_sockt_make_connection_pre > 0) {
+ int (*preHookFunc) (uint32 *ip, uint16 *port, struct hSockOpt **opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_make_connection_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, &port, opt);
+ retVal___ = preHookFunc(&ip, &port, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4603,11 +5563,11 @@ int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
{
retVal___ = HPMHooks.source.sockt.make_connection(ip, port, opt);
}
- if( HPMHooks.count.HP_sockt_make_connection_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ip, uint16 *port, struct hSockOpt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_make_connection_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 ip, uint16 port, struct hSockOpt *opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_make_connection_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, &port, opt);
+ retVal___ = postHookFunc(retVal___, ip, port, opt);
}
}
return retVal___;
@@ -4615,14 +5575,14 @@ int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_realloc_fifo_pre ) {
+ if (HPMHooks.count.HP_sockt_realloc_fifo_pre > 0) {
int (*preHookFunc) (int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_realloc_fifo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &rfifo_size, &wfifo_size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4630,11 +5590,11 @@ int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_si
{
retVal___ = HPMHooks.source.sockt.realloc_fifo(fd, rfifo_size, wfifo_size);
}
- if( HPMHooks.count.HP_sockt_realloc_fifo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_realloc_fifo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, unsigned int rfifo_size, unsigned int wfifo_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_realloc_fifo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &rfifo_size, &wfifo_size);
+ retVal___ = postHookFunc(retVal___, fd, rfifo_size, wfifo_size);
}
}
return retVal___;
@@ -4642,14 +5602,14 @@ int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_si
int HP_sockt_realloc_writefifo(int fd, size_t addition) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_realloc_writefifo_pre ) {
+ if (HPMHooks.count.HP_sockt_realloc_writefifo_pre > 0) {
int (*preHookFunc) (int *fd, size_t *addition);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_realloc_writefifo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &addition);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4657,11 +5617,11 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
{
retVal___ = HPMHooks.source.sockt.realloc_writefifo(fd, addition);
}
- if( HPMHooks.count.HP_sockt_realloc_writefifo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *addition);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_realloc_writefifo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t addition);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_realloc_writefifo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &addition);
+ retVal___ = postHookFunc(retVal___, fd, addition);
}
}
return retVal___;
@@ -4669,14 +5629,14 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
int HP_sockt_wfifoset(int fd, size_t len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_wfifoset_pre ) {
+ if (HPMHooks.count.HP_sockt_wfifoset_pre > 0) {
int (*preHookFunc) (int *fd, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_wfifoset_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4684,11 +5644,11 @@ int HP_sockt_wfifoset(int fd, size_t len) {
{
retVal___ = HPMHooks.source.sockt.wfifoset(fd, len);
}
- if( HPMHooks.count.HP_sockt_wfifoset_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_wfifoset_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_wfifoset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len);
+ retVal___ = postHookFunc(retVal___, fd, len);
}
}
return retVal___;
@@ -4696,14 +5656,14 @@ int HP_sockt_wfifoset(int fd, size_t len) {
int HP_sockt_rfifoskip(int fd, size_t len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_rfifoskip_pre ) {
+ if (HPMHooks.count.HP_sockt_rfifoskip_pre > 0) {
int (*preHookFunc) (int *fd, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_rfifoskip_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4711,25 +5671,25 @@ int HP_sockt_rfifoskip(int fd, size_t len) {
{
retVal___ = HPMHooks.source.sockt.rfifoskip(fd, len);
}
- if( HPMHooks.count.HP_sockt_rfifoskip_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_rfifoskip_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_rfifoskip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len);
+ retVal___ = postHookFunc(retVal___, fd, len);
}
}
return retVal___;
}
void HP_sockt_close(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_close_pre ) {
+ if (HPMHooks.count.HP_sockt_close_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_close_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4737,11 +5697,11 @@ void HP_sockt_close(int fd) {
{
HPMHooks.source.sockt.close(fd);
}
- if( HPMHooks.count.HP_sockt_close_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_close_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_close_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -4749,14 +5709,14 @@ void HP_sockt_close(int fd) {
bool HP_sockt_session_is_valid(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_session_is_valid_pre ) {
+ if (HPMHooks.count.HP_sockt_session_is_valid_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_session_is_valid_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4764,11 +5724,11 @@ bool HP_sockt_session_is_valid(int fd) {
{
retVal___ = HPMHooks.source.sockt.session_is_valid(fd);
}
- if( HPMHooks.count.HP_sockt_session_is_valid_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_session_is_valid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_session_is_valid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -4776,14 +5736,14 @@ bool HP_sockt_session_is_valid(int fd) {
bool HP_sockt_session_is_active(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_session_is_active_pre ) {
+ if (HPMHooks.count.HP_sockt_session_is_active_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_session_is_active_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4791,25 +5751,25 @@ bool HP_sockt_session_is_active(int fd) {
{
retVal___ = HPMHooks.source.sockt.session_is_active(fd);
}
- if( HPMHooks.count.HP_sockt_session_is_active_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_session_is_active_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_session_is_active_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_sockt_flush(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_flush_pre ) {
+ if (HPMHooks.count.HP_sockt_flush_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_flush_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4817,25 +5777,25 @@ void HP_sockt_flush(int fd) {
{
HPMHooks.source.sockt.flush(fd);
}
- if( HPMHooks.count.HP_sockt_flush_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_flush_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_flush_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_sockt_flush_fifos(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_flush_fifos_pre ) {
+ if (HPMHooks.count.HP_sockt_flush_fifos_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_flush_fifos_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4843,9 +5803,9 @@ void HP_sockt_flush_fifos(void) {
{
HPMHooks.source.sockt.flush_fifos();
}
- if( HPMHooks.count.HP_sockt_flush_fifos_post ) {
+ if (HPMHooks.count.HP_sockt_flush_fifos_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_flush_fifos_post[hIndex].func;
postHookFunc();
}
@@ -4854,14 +5814,14 @@ void HP_sockt_flush_fifos(void) {
}
void HP_sockt_set_nonblocking(int fd, unsigned long yes) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_set_nonblocking_pre ) {
+ if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) {
void (*preHookFunc) (int *fd, unsigned long *yes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_set_nonblocking_pre[hIndex].func;
preHookFunc(&fd, &yes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4869,25 +5829,25 @@ void HP_sockt_set_nonblocking(int fd, unsigned long yes) {
{
HPMHooks.source.sockt.set_nonblocking(fd, yes);
}
- if( HPMHooks.count.HP_sockt_set_nonblocking_post ) {
- void (*postHookFunc) (int *fd, unsigned long *yes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_set_nonblocking_post > 0) {
+ void (*postHookFunc) (int fd, unsigned long yes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_set_nonblocking_post[hIndex].func;
- postHookFunc(&fd, &yes);
+ postHookFunc(fd, yes);
}
}
return;
}
void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_set_defaultparse_pre ) {
+ if (HPMHooks.count.HP_sockt_set_defaultparse_pre > 0) {
void (*preHookFunc) (ParseFunc *defaultparse);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_set_defaultparse_pre[hIndex].func;
preHookFunc(&defaultparse);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4895,11 +5855,11 @@ void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
{
HPMHooks.source.sockt.set_defaultparse(defaultparse);
}
- if( HPMHooks.count.HP_sockt_set_defaultparse_post ) {
- void (*postHookFunc) (ParseFunc *defaultparse);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_set_defaultparse_post > 0) {
+ void (*postHookFunc) (ParseFunc defaultparse);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_set_defaultparse_post[hIndex].func;
- postHookFunc(&defaultparse);
+ postHookFunc(defaultparse);
}
}
return;
@@ -4907,14 +5867,14 @@ void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
uint32 HP_sockt_host2ip(const char *hostname) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_host2ip_pre ) {
- uint32 (*preHookFunc) (const char *hostname);
+ if (HPMHooks.count.HP_sockt_host2ip_pre > 0) {
+ uint32 (*preHookFunc) (const char **hostname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_host2ip_pre[hIndex].func;
- retVal___ = preHookFunc(hostname);
+ retVal___ = preHookFunc(&hostname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4922,9 +5882,9 @@ uint32 HP_sockt_host2ip(const char *hostname) {
{
retVal___ = HPMHooks.source.sockt.host2ip(hostname);
}
- if( HPMHooks.count.HP_sockt_host2ip_post ) {
+ if (HPMHooks.count.HP_sockt_host2ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___, const char *hostname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_host2ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hostname);
}
@@ -4934,14 +5894,14 @@ uint32 HP_sockt_host2ip(const char *hostname) {
const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sockt_ip2str_pre ) {
- const char* (*preHookFunc) (uint32 *ip, char *ip_str);
+ if (HPMHooks.count.HP_sockt_ip2str_pre > 0) {
+ const char* (*preHookFunc) (uint32 *ip, char **ip_str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_ip2str_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, ip_str);
+ retVal___ = preHookFunc(&ip, &ip_str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4949,11 +5909,11 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
{
retVal___ = HPMHooks.source.sockt.ip2str(ip, ip_str);
}
- if( HPMHooks.count.HP_sockt_ip2str_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint32 *ip, char *ip_str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_ip2str_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint32 ip, char *ip_str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_ip2str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, ip_str);
+ retVal___ = postHookFunc(retVal___, ip, ip_str);
}
}
return retVal___;
@@ -4961,14 +5921,14 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
uint32 HP_sockt_str2ip(const char *ip_str) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_str2ip_pre ) {
- uint32 (*preHookFunc) (const char *ip_str);
+ if (HPMHooks.count.HP_sockt_str2ip_pre > 0) {
+ uint32 (*preHookFunc) (const char **ip_str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_str2ip_pre[hIndex].func;
- retVal___ = preHookFunc(ip_str);
+ retVal___ = preHookFunc(&ip_str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4976,9 +5936,9 @@ uint32 HP_sockt_str2ip(const char *ip_str) {
{
retVal___ = HPMHooks.source.sockt.str2ip(ip_str);
}
- if( HPMHooks.count.HP_sockt_str2ip_post ) {
+ if (HPMHooks.count.HP_sockt_str2ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___, const char *ip_str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_str2ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ip_str);
}
@@ -4988,14 +5948,14 @@ uint32 HP_sockt_str2ip(const char *ip_str) {
uint16 HP_sockt_ntows(uint16 netshort) {
int hIndex = 0;
uint16 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_ntows_pre ) {
+ if (HPMHooks.count.HP_sockt_ntows_pre > 0) {
uint16 (*preHookFunc) (uint16 *netshort);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_ntows_pre[hIndex].func;
retVal___ = preHookFunc(&netshort);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5003,11 +5963,11 @@ uint16 HP_sockt_ntows(uint16 netshort) {
{
retVal___ = HPMHooks.source.sockt.ntows(netshort);
}
- if( HPMHooks.count.HP_sockt_ntows_post ) {
- uint16 (*postHookFunc) (uint16 retVal___, uint16 *netshort);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_ntows_post > 0) {
+ uint16 (*postHookFunc) (uint16 retVal___, uint16 netshort);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_ntows_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &netshort);
+ retVal___ = postHookFunc(retVal___, netshort);
}
}
return retVal___;
@@ -5015,14 +5975,14 @@ uint16 HP_sockt_ntows(uint16 netshort) {
int HP_sockt_getips(uint32 *ips, int max) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_getips_pre ) {
- int (*preHookFunc) (uint32 *ips, int *max);
+ if (HPMHooks.count.HP_sockt_getips_pre > 0) {
+ int (*preHookFunc) (uint32 **ips, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_getips_pre[hIndex].func;
- retVal___ = preHookFunc(ips, &max);
+ retVal___ = preHookFunc(&ips, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5030,25 +5990,25 @@ int HP_sockt_getips(uint32 *ips, int max) {
{
retVal___ = HPMHooks.source.sockt.getips(ips, max);
}
- if( HPMHooks.count.HP_sockt_getips_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ips, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_getips_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 *ips, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_getips_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ips, &max);
+ retVal___ = postHookFunc(retVal___, ips, max);
}
}
return retVal___;
}
void HP_sockt_eof(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_eof_pre ) {
+ if (HPMHooks.count.HP_sockt_eof_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_eof_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5056,11 +6016,11 @@ void HP_sockt_eof(int fd) {
{
HPMHooks.source.sockt.eof(fd);
}
- if( HPMHooks.count.HP_sockt_eof_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_eof_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_eof_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -5068,14 +6028,14 @@ void HP_sockt_eof(int fd) {
uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_lan_subnet_check_pre ) {
- uint32 (*preHookFunc) (uint32 *ip, struct s_subnet *info);
+ if (HPMHooks.count.HP_sockt_lan_subnet_check_pre > 0) {
+ uint32 (*preHookFunc) (uint32 *ip, struct s_subnet **info);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_lan_subnet_check_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, info);
+ retVal___ = preHookFunc(&ip, &info);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5083,11 +6043,11 @@ uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
{
retVal___ = HPMHooks.source.sockt.lan_subnet_check(ip, info);
}
- if( HPMHooks.count.HP_sockt_lan_subnet_check_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip, struct s_subnet *info);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_lan_subnet_check_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 ip, struct s_subnet *info);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_lan_subnet_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, info);
+ retVal___ = postHookFunc(retVal___, ip, info);
}
}
return retVal___;
@@ -5095,14 +6055,14 @@ uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
bool HP_sockt_allowed_ip_check(uint32 ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_allowed_ip_check_pre ) {
+ if (HPMHooks.count.HP_sockt_allowed_ip_check_pre > 0) {
bool (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_allowed_ip_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5110,11 +6070,11 @@ bool HP_sockt_allowed_ip_check(uint32 ip) {
{
retVal___ = HPMHooks.source.sockt.allowed_ip_check(ip);
}
- if( HPMHooks.count.HP_sockt_allowed_ip_check_post ) {
- bool (*postHookFunc) (bool retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_allowed_ip_check_post > 0) {
+ bool (*postHookFunc) (bool retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_allowed_ip_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
@@ -5122,14 +6082,14 @@ bool HP_sockt_allowed_ip_check(uint32 ip) {
bool HP_sockt_trusted_ip_check(uint32 ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_trusted_ip_check_pre ) {
+ if (HPMHooks.count.HP_sockt_trusted_ip_check_pre > 0) {
bool (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_trusted_ip_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5137,26 +6097,26 @@ bool HP_sockt_trusted_ip_check(uint32 ip) {
{
retVal___ = HPMHooks.source.sockt.trusted_ip_check(ip);
}
- if( HPMHooks.count.HP_sockt_trusted_ip_check_post ) {
- bool (*postHookFunc) (bool retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_trusted_ip_check_post > 0) {
+ bool (*postHookFunc) (bool retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_trusted_ip_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
}
-int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname) {
+int HP_sockt_net_config_read_sub(struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_net_config_read_sub_pre ) {
- int (*preHookFunc) (config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ if (HPMHooks.count.HP_sockt_net_config_read_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **t, struct s_subnet_vector **list, const char **filename, const char **groupname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_net_config_read_sub_pre[hIndex].func;
- retVal___ = preHookFunc(t, list, filename, groupname);
+ retVal___ = preHookFunc(&t, &list, &filename, &groupname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5164,9 +6124,9 @@ int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *li
{
retVal___ = HPMHooks.source.sockt.net_config_read_sub(t, list, filename, groupname);
}
- if( HPMHooks.count.HP_sockt_net_config_read_sub_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_net_config_read_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_net_config_read_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, t, list, filename, groupname);
}
@@ -5175,14 +6135,14 @@ int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *li
}
void HP_sockt_net_config_read(const char *filename) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_net_config_read_pre ) {
- void (*preHookFunc) (const char *filename);
+ if (HPMHooks.count.HP_sockt_net_config_read_pre > 0) {
+ void (*preHookFunc) (const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_net_config_read_pre[hIndex].func;
- preHookFunc(filename);
+ preHookFunc(&filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5190,27 +6150,27 @@ void HP_sockt_net_config_read(const char *filename) {
{
HPMHooks.source.sockt.net_config_read(filename);
}
- if( HPMHooks.count.HP_sockt_net_config_read_post ) {
+ if (HPMHooks.count.HP_sockt_net_config_read_post > 0) {
void (*postHookFunc) (const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_net_config_read_post[hIndex].func;
postHookFunc(filename);
}
}
return;
}
-/* SQL */
-int HP_SQL_Connect(Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db) {
+/* sql_interface */
+int HP_SQL_Connect(struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_Connect_pre ) {
- int (*preHookFunc) (Sql *self, const char *user, const char *passwd, const char *host, uint16 *port, const char *db);
+ if (HPMHooks.count.HP_SQL_Connect_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **user, const char **passwd, const char **host, uint16 *port, const char **db);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Connect_pre[hIndex].func;
- retVal___ = preHookFunc(self, user, passwd, host, &port, db);
+ retVal___ = preHookFunc(&self, &user, &passwd, &host, &port, &db);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5218,26 +6178,26 @@ int HP_SQL_Connect(Sql *self, const char *user, const char *passwd, const char *
{
retVal___ = HPMHooks.source.SQL.Connect(self, user, passwd, host, port, db);
}
- if( HPMHooks.count.HP_SQL_Connect_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *user, const char *passwd, const char *host, uint16 *port, const char *db);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Connect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Connect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, user, passwd, host, &port, db);
+ retVal___ = postHookFunc(retVal___, self, user, passwd, host, port, db);
}
}
return retVal___;
}
-int HP_SQL_GetTimeout(Sql *self, uint32 *out_timeout) {
+int HP_SQL_GetTimeout(struct Sql *self, uint32 *out_timeout) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetTimeout_pre ) {
- int (*preHookFunc) (Sql *self, uint32 *out_timeout);
+ if (HPMHooks.count.HP_SQL_GetTimeout_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, uint32 **out_timeout);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetTimeout_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_timeout);
+ retVal___ = preHookFunc(&self, &out_timeout);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5245,26 +6205,26 @@ int HP_SQL_GetTimeout(Sql *self, uint32 *out_timeout) {
{
retVal___ = HPMHooks.source.SQL.GetTimeout(self, out_timeout);
}
- if( HPMHooks.count.HP_SQL_GetTimeout_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, uint32 *out_timeout);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetTimeout_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, uint32 *out_timeout);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetTimeout_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, out_timeout);
}
}
return retVal___;
}
-int HP_SQL_GetColumnNames(Sql *self, const char *table, char *out_buf, size_t buf_len, char sep) {
+int HP_SQL_GetColumnNames(struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetColumnNames_pre ) {
- int (*preHookFunc) (Sql *self, const char *table, char *out_buf, size_t *buf_len, char *sep);
+ if (HPMHooks.count.HP_SQL_GetColumnNames_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **table, char **out_buf, size_t *buf_len, char *sep);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetColumnNames_pre[hIndex].func;
- retVal___ = preHookFunc(self, table, out_buf, &buf_len, &sep);
+ retVal___ = preHookFunc(&self, &table, &out_buf, &buf_len, &sep);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5272,26 +6232,26 @@ int HP_SQL_GetColumnNames(Sql *self, const char *table, char *out_buf, size_t bu
{
retVal___ = HPMHooks.source.SQL.GetColumnNames(self, table, out_buf, buf_len, sep);
}
- if( HPMHooks.count.HP_SQL_GetColumnNames_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *table, char *out_buf, size_t *buf_len, char *sep);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetColumnNames_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetColumnNames_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, table, out_buf, &buf_len, &sep);
+ retVal___ = postHookFunc(retVal___, self, table, out_buf, buf_len, sep);
}
}
return retVal___;
}
-int HP_SQL_SetEncoding(Sql *self, const char *encoding) {
+int HP_SQL_SetEncoding(struct Sql *self, const char *encoding) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_SetEncoding_pre ) {
- int (*preHookFunc) (Sql *self, const char *encoding);
+ if (HPMHooks.count.HP_SQL_SetEncoding_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **encoding);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_SetEncoding_pre[hIndex].func;
- retVal___ = preHookFunc(self, encoding);
+ retVal___ = preHookFunc(&self, &encoding);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5299,26 +6259,26 @@ int HP_SQL_SetEncoding(Sql *self, const char *encoding) {
{
retVal___ = HPMHooks.source.SQL.SetEncoding(self, encoding);
}
- if( HPMHooks.count.HP_SQL_SetEncoding_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *encoding);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_SetEncoding_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *encoding);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_SetEncoding_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, encoding);
}
}
return retVal___;
}
-int HP_SQL_Ping(Sql *self) {
+int HP_SQL_Ping(struct Sql *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_Ping_pre ) {
- int (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_Ping_pre > 0) {
+ int (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Ping_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5326,26 +6286,26 @@ int HP_SQL_Ping(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.Ping(self);
}
- if( HPMHooks.count.HP_SQL_Ping_post ) {
- int (*postHookFunc) (int retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Ping_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Ping_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-size_t HP_SQL_EscapeString(Sql *self, char *out_to, const char *from) {
+size_t HP_SQL_EscapeString(struct Sql *self, char *out_to, const char *from) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_EscapeString_pre ) {
- size_t (*preHookFunc) (Sql *self, char *out_to, const char *from);
+ if (HPMHooks.count.HP_SQL_EscapeString_pre > 0) {
+ size_t (*preHookFunc) (struct Sql **self, char **out_to, const char **from);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_EscapeString_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_to, from);
+ retVal___ = preHookFunc(&self, &out_to, &from);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5353,26 +6313,26 @@ size_t HP_SQL_EscapeString(Sql *self, char *out_to, const char *from) {
{
retVal___ = HPMHooks.source.SQL.EscapeString(self, out_to, from);
}
- if( HPMHooks.count.HP_SQL_EscapeString_post ) {
- size_t (*postHookFunc) (size_t retVal___, Sql *self, char *out_to, const char *from);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_EscapeString_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct Sql *self, char *out_to, const char *from);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_EscapeString_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, out_to, from);
}
}
return retVal___;
}
-size_t HP_SQL_EscapeStringLen(Sql *self, char *out_to, const char *from, size_t from_len) {
+size_t HP_SQL_EscapeStringLen(struct Sql *self, char *out_to, const char *from, size_t from_len) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_EscapeStringLen_pre ) {
- size_t (*preHookFunc) (Sql *self, char *out_to, const char *from, size_t *from_len);
+ if (HPMHooks.count.HP_SQL_EscapeStringLen_pre > 0) {
+ size_t (*preHookFunc) (struct Sql **self, char **out_to, const char **from, size_t *from_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_EscapeStringLen_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_to, from, &from_len);
+ retVal___ = preHookFunc(&self, &out_to, &from, &from_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5380,28 +6340,28 @@ size_t HP_SQL_EscapeStringLen(Sql *self, char *out_to, const char *from, size_t
{
retVal___ = HPMHooks.source.SQL.EscapeStringLen(self, out_to, from, from_len);
}
- if( HPMHooks.count.HP_SQL_EscapeStringLen_post ) {
- size_t (*postHookFunc) (size_t retVal___, Sql *self, char *out_to, const char *from, size_t *from_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_EscapeStringLen_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct Sql *self, char *out_to, const char *from, size_t from_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_EscapeStringLen_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, out_to, from, &from_len);
+ retVal___ = postHookFunc(retVal___, self, out_to, from, from_len);
}
}
return retVal___;
}
-int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
+int HP_SQL_QueryV(struct Sql *self, const char *query, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_QueryV_pre ) {
- int (*preHookFunc) (Sql *self, const char *query, va_list args);
+ if (HPMHooks.count.HP_SQL_QueryV_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **query, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_SQL_QueryV_pre[hIndex].func;
- retVal___ = preHookFunc(self, query, args___copy);
+ retVal___ = preHookFunc(&self, &query, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5411,9 +6371,9 @@ int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
retVal___ = HPMHooks.source.SQL.QueryV(self, query, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_SQL_QueryV_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *query, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_QueryV_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *query, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_SQL_QueryV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query, args___copy);
@@ -5422,17 +6382,17 @@ int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
}
return retVal___;
}
-int HP_SQL_QueryStr(Sql *self, const char *query) {
+int HP_SQL_QueryStr(struct Sql *self, const char *query) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_QueryStr_pre ) {
- int (*preHookFunc) (Sql *self, const char *query);
+ if (HPMHooks.count.HP_SQL_QueryStr_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_QueryStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, query);
+ retVal___ = preHookFunc(&self, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5440,26 +6400,26 @@ int HP_SQL_QueryStr(Sql *self, const char *query) {
{
retVal___ = HPMHooks.source.SQL.QueryStr(self, query);
}
- if( HPMHooks.count.HP_SQL_QueryStr_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_QueryStr_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_QueryStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query);
}
}
return retVal___;
}
-uint64 HP_SQL_LastInsertId(Sql *self) {
+uint64 HP_SQL_LastInsertId(struct Sql *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_LastInsertId_pre ) {
- uint64 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_LastInsertId_pre > 0) {
+ uint64 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_LastInsertId_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5467,26 +6427,26 @@ uint64 HP_SQL_LastInsertId(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.LastInsertId(self);
}
- if( HPMHooks.count.HP_SQL_LastInsertId_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_LastInsertId_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_LastInsertId_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint32 HP_SQL_NumColumns(Sql *self) {
+uint32 HP_SQL_NumColumns(struct Sql *self) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NumColumns_pre ) {
- uint32 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NumColumns_pre > 0) {
+ uint32 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NumColumns_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5494,26 +6454,26 @@ uint32 HP_SQL_NumColumns(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NumColumns(self);
}
- if( HPMHooks.count.HP_SQL_NumColumns_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NumColumns_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NumColumns_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint64 HP_SQL_NumRows(Sql *self) {
+uint64 HP_SQL_NumRows(struct Sql *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NumRows_pre ) {
- uint64 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NumRows_pre > 0) {
+ uint64 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NumRows_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5521,26 +6481,26 @@ uint64 HP_SQL_NumRows(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NumRows(self);
}
- if( HPMHooks.count.HP_SQL_NumRows_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NumRows_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NumRows_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_NextRow(Sql *self) {
+int HP_SQL_NextRow(struct Sql *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NextRow_pre ) {
- int (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NextRow_pre > 0) {
+ int (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NextRow_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5548,26 +6508,26 @@ int HP_SQL_NextRow(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NextRow(self);
}
- if( HPMHooks.count.HP_SQL_NextRow_post ) {
- int (*postHookFunc) (int retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NextRow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NextRow_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_GetData(Sql *self, size_t col, char **out_buf, size_t *out_len) {
+int HP_SQL_GetData(struct Sql *self, size_t col, char **out_buf, size_t *out_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetData_pre ) {
- int (*preHookFunc) (Sql *self, size_t *col, char **out_buf, size_t *out_len);
+ if (HPMHooks.count.HP_SQL_GetData_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, size_t *col, char ***out_buf, size_t **out_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetData_pre[hIndex].func;
- retVal___ = preHookFunc(self, &col, out_buf, out_len);
+ retVal___ = preHookFunc(&self, &col, &out_buf, &out_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5575,25 +6535,25 @@ int HP_SQL_GetData(Sql *self, size_t col, char **out_buf, size_t *out_len) {
{
retVal___ = HPMHooks.source.SQL.GetData(self, col, out_buf, out_len);
}
- if( HPMHooks.count.HP_SQL_GetData_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, size_t *col, char **out_buf, size_t *out_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetData_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, size_t col, char **out_buf, size_t *out_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetData_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &col, out_buf, out_len);
+ retVal___ = postHookFunc(retVal___, self, col, out_buf, out_len);
}
}
return retVal___;
}
-void HP_SQL_FreeResult(Sql *self) {
+void HP_SQL_FreeResult(struct Sql *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_FreeResult_pre ) {
- void (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_FreeResult_pre > 0) {
+ void (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_FreeResult_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5601,25 +6561,25 @@ void HP_SQL_FreeResult(Sql *self) {
{
HPMHooks.source.SQL.FreeResult(self);
}
- if( HPMHooks.count.HP_SQL_FreeResult_post ) {
- void (*postHookFunc) (Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_FreeResult_post > 0) {
+ void (*postHookFunc) (struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_FreeResult_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_ShowDebug_(Sql *self, const char *debug_file, const unsigned long debug_line) {
+void HP_SQL_ShowDebug_(struct Sql *self, const char *debug_file, const unsigned long debug_line) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_ShowDebug__pre ) {
- void (*preHookFunc) (Sql *self, const char *debug_file, const unsigned long *debug_line);
+ if (HPMHooks.count.HP_SQL_ShowDebug__pre > 0) {
+ void (*preHookFunc) (struct Sql **self, const char **debug_file, const unsigned long *debug_line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_ShowDebug__pre[hIndex].func;
- preHookFunc(self, debug_file, &debug_line);
+ preHookFunc(&self, &debug_file, &debug_line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5627,25 +6587,25 @@ void HP_SQL_ShowDebug_(Sql *self, const char *debug_file, const unsigned long de
{
HPMHooks.source.SQL.ShowDebug_(self, debug_file, debug_line);
}
- if( HPMHooks.count.HP_SQL_ShowDebug__post ) {
- void (*postHookFunc) (Sql *self, const char *debug_file, const unsigned long *debug_line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_ShowDebug__post > 0) {
+ void (*postHookFunc) (struct Sql *self, const char *debug_file, const unsigned long debug_line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_ShowDebug__post[hIndex].func;
- postHookFunc(self, debug_file, &debug_line);
+ postHookFunc(self, debug_file, debug_line);
}
}
return;
}
-void HP_SQL_Free(Sql *self) {
+void HP_SQL_Free(struct Sql *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_Free_pre ) {
- void (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_Free_pre > 0) {
+ void (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Free_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5653,9 +6613,9 @@ void HP_SQL_Free(Sql *self) {
{
HPMHooks.source.SQL.Free(self);
}
- if( HPMHooks.count.HP_SQL_Free_post ) {
- void (*postHookFunc) (Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Free_post > 0) {
+ void (*postHookFunc) (struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Free_post[hIndex].func;
postHookFunc(self);
}
@@ -5665,14 +6625,14 @@ void HP_SQL_Free(Sql *self) {
struct Sql* HP_SQL_Malloc(void) {
int hIndex = 0;
struct Sql* retVal___ = NULL;
- if( HPMHooks.count.HP_SQL_Malloc_pre ) {
+ if (HPMHooks.count.HP_SQL_Malloc_pre > 0) {
struct Sql* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Malloc_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5680,26 +6640,26 @@ struct Sql* HP_SQL_Malloc(void) {
{
retVal___ = HPMHooks.source.SQL.Malloc();
}
- if( HPMHooks.count.HP_SQL_Malloc_post ) {
+ if (HPMHooks.count.HP_SQL_Malloc_post > 0) {
struct Sql* (*postHookFunc) (struct Sql* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Malloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-struct SqlStmt* HP_SQL_StmtMalloc(Sql *sql) {
+struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) {
int hIndex = 0;
struct SqlStmt* retVal___ = NULL;
- if( HPMHooks.count.HP_SQL_StmtMalloc_pre ) {
- struct SqlStmt* (*preHookFunc) (Sql *sql);
+ if (HPMHooks.count.HP_SQL_StmtMalloc_pre > 0) {
+ struct SqlStmt* (*preHookFunc) (struct Sql **sql);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_pre[hIndex].func;
- retVal___ = preHookFunc(sql);
+ retVal___ = preHookFunc(&sql);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5707,28 +6667,28 @@ struct SqlStmt* HP_SQL_StmtMalloc(Sql *sql) {
{
retVal___ = HPMHooks.source.SQL.StmtMalloc(sql);
}
- if( HPMHooks.count.HP_SQL_StmtMalloc_post ) {
- struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, Sql *sql);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtMalloc_post > 0) {
+ struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, struct Sql *sql);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sql);
}
}
return retVal___;
}
-int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
+int HP_SQL_StmtPrepareV(struct SqlStmt *self, const char *query, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtPrepareV_pre ) {
- int (*preHookFunc) (SqlStmt *self, const char *query, va_list args);
+ if (HPMHooks.count.HP_SQL_StmtPrepareV_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, const char **query, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_SQL_StmtPrepareV_pre[hIndex].func;
- retVal___ = preHookFunc(self, query, args___copy);
+ retVal___ = preHookFunc(&self, &query, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5738,9 +6698,9 @@ int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
retVal___ = HPMHooks.source.SQL.StmtPrepareV(self, query, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_SQL_StmtPrepareV_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, const char *query, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtPrepareV_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, const char *query, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_SQL_StmtPrepareV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query, args___copy);
@@ -5749,17 +6709,17 @@ int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
}
return retVal___;
}
-int HP_SQL_StmtPrepareStr(SqlStmt *self, const char *query) {
+int HP_SQL_StmtPrepareStr(struct SqlStmt *self, const char *query) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtPrepareStr_pre ) {
- int (*preHookFunc) (SqlStmt *self, const char *query);
+ if (HPMHooks.count.HP_SQL_StmtPrepareStr_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, const char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtPrepareStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, query);
+ retVal___ = preHookFunc(&self, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5767,26 +6727,26 @@ int HP_SQL_StmtPrepareStr(SqlStmt *self, const char *query) {
{
retVal___ = HPMHooks.source.SQL.StmtPrepareStr(self, query);
}
- if( HPMHooks.count.HP_SQL_StmtPrepareStr_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, const char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtPrepareStr_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, const char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtPrepareStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query);
}
}
return retVal___;
}
-size_t HP_SQL_StmtNumParams(SqlStmt *self) {
+size_t HP_SQL_StmtNumParams(struct SqlStmt *self) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumParams_pre ) {
- size_t (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumParams_pre > 0) {
+ size_t (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumParams_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5794,26 +6754,26 @@ size_t HP_SQL_StmtNumParams(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumParams(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumParams_post ) {
- size_t (*postHookFunc) (size_t retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumParams_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumParams_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtBindParam(SqlStmt *self, size_t idx, SqlDataType buffer_type, void *buffer, size_t buffer_len) {
+int HP_SQL_StmtBindParam(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtBindParam_pre ) {
- int (*preHookFunc) (SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len);
+ if (HPMHooks.count.HP_SQL_StmtBindParam_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, const void **buffer, size_t *buffer_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtBindParam_pre[hIndex].func;
- retVal___ = preHookFunc(self, &idx, &buffer_type, buffer, &buffer_len);
+ retVal___ = preHookFunc(&self, &idx, &buffer_type, &buffer, &buffer_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5821,26 +6781,26 @@ int HP_SQL_StmtBindParam(SqlStmt *self, size_t idx, SqlDataType buffer_type, voi
{
retVal___ = HPMHooks.source.SQL.StmtBindParam(self, idx, buffer_type, buffer, buffer_len);
}
- if( HPMHooks.count.HP_SQL_StmtBindParam_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtBindParam_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtBindParam_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &idx, &buffer_type, buffer, &buffer_len);
+ retVal___ = postHookFunc(retVal___, self, idx, buffer_type, buffer, buffer_len);
}
}
return retVal___;
}
-int HP_SQL_StmtExecute(SqlStmt *self) {
+int HP_SQL_StmtExecute(struct SqlStmt *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtExecute_pre ) {
- int (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtExecute_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtExecute_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5848,26 +6808,26 @@ int HP_SQL_StmtExecute(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtExecute(self);
}
- if( HPMHooks.count.HP_SQL_StmtExecute_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtExecute_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtExecute_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint64 HP_SQL_StmtLastInsertId(SqlStmt *self) {
+uint64 HP_SQL_StmtLastInsertId(struct SqlStmt *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtLastInsertId_pre ) {
- uint64 (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtLastInsertId_pre > 0) {
+ uint64 (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtLastInsertId_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5875,26 +6835,26 @@ uint64 HP_SQL_StmtLastInsertId(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtLastInsertId(self);
}
- if( HPMHooks.count.HP_SQL_StmtLastInsertId_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtLastInsertId_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtLastInsertId_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-size_t HP_SQL_StmtNumColumns(SqlStmt *self) {
+size_t HP_SQL_StmtNumColumns(struct SqlStmt *self) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumColumns_pre ) {
- size_t (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumColumns_pre > 0) {
+ size_t (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumColumns_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5902,26 +6862,26 @@ size_t HP_SQL_StmtNumColumns(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumColumns(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumColumns_post ) {
- size_t (*postHookFunc) (size_t retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumColumns_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumColumns_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtBindColumn(SqlStmt *self, size_t idx, SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
+int HP_SQL_StmtBindColumn(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtBindColumn_pre ) {
- int (*preHookFunc) (SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len, uint32 *out_length, int8 *out_is_null);
+ if (HPMHooks.count.HP_SQL_StmtBindColumn_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, void **buffer, size_t *buffer_len, uint32 **out_length, int8 **out_is_null);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtBindColumn_pre[hIndex].func;
- retVal___ = preHookFunc(self, &idx, &buffer_type, buffer, &buffer_len, out_length, out_is_null);
+ retVal___ = preHookFunc(&self, &idx, &buffer_type, &buffer, &buffer_len, &out_length, &out_is_null);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5929,26 +6889,26 @@ int HP_SQL_StmtBindColumn(SqlStmt *self, size_t idx, SqlDataType buffer_type, vo
{
retVal___ = HPMHooks.source.SQL.StmtBindColumn(self, idx, buffer_type, buffer, buffer_len, out_length, out_is_null);
}
- if( HPMHooks.count.HP_SQL_StmtBindColumn_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len, uint32 *out_length, int8 *out_is_null);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtBindColumn_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtBindColumn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &idx, &buffer_type, buffer, &buffer_len, out_length, out_is_null);
+ retVal___ = postHookFunc(retVal___, self, idx, buffer_type, buffer, buffer_len, out_length, out_is_null);
}
}
return retVal___;
}
-uint64 HP_SQL_StmtNumRows(SqlStmt *self) {
+uint64 HP_SQL_StmtNumRows(struct SqlStmt *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumRows_pre ) {
- uint64 (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumRows_pre > 0) {
+ uint64 (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumRows_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5956,26 +6916,26 @@ uint64 HP_SQL_StmtNumRows(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumRows(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumRows_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumRows_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumRows_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtNextRow(SqlStmt *self) {
+int HP_SQL_StmtNextRow(struct SqlStmt *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNextRow_pre ) {
- int (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNextRow_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNextRow_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5983,25 +6943,25 @@ int HP_SQL_StmtNextRow(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNextRow(self);
}
- if( HPMHooks.count.HP_SQL_StmtNextRow_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNextRow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNextRow_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-void HP_SQL_StmtFreeResult(SqlStmt *self) {
+void HP_SQL_StmtFreeResult(struct SqlStmt *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtFreeResult_pre ) {
- void (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtFreeResult_pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtFreeResult_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6009,25 +6969,25 @@ void HP_SQL_StmtFreeResult(SqlStmt *self) {
{
HPMHooks.source.SQL.StmtFreeResult(self);
}
- if( HPMHooks.count.HP_SQL_StmtFreeResult_post ) {
- void (*postHookFunc) (SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtFreeResult_post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtFreeResult_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_StmtFree(SqlStmt *self) {
+void HP_SQL_StmtFree(struct SqlStmt *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtFree_pre ) {
- void (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtFree_pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtFree_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6035,25 +6995,25 @@ void HP_SQL_StmtFree(SqlStmt *self) {
{
HPMHooks.source.SQL.StmtFree(self);
}
- if( HPMHooks.count.HP_SQL_StmtFree_post ) {
- void (*postHookFunc) (SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtFree_post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtFree_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_StmtShowDebug_(SqlStmt *self, const char *debug_file, const unsigned long debug_line) {
+void HP_SQL_StmtShowDebug_(struct SqlStmt *self, const char *debug_file, const unsigned long debug_line) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtShowDebug__pre ) {
- void (*preHookFunc) (SqlStmt *self, const char *debug_file, const unsigned long *debug_line);
+ if (HPMHooks.count.HP_SQL_StmtShowDebug__pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self, const char **debug_file, const unsigned long *debug_line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtShowDebug__pre[hIndex].func;
- preHookFunc(self, debug_file, &debug_line);
+ preHookFunc(&self, &debug_file, &debug_line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6061,27 +7021,27 @@ void HP_SQL_StmtShowDebug_(SqlStmt *self, const char *debug_file, const unsigned
{
HPMHooks.source.SQL.StmtShowDebug_(self, debug_file, debug_line);
}
- if( HPMHooks.count.HP_SQL_StmtShowDebug__post ) {
- void (*postHookFunc) (SqlStmt *self, const char *debug_file, const unsigned long *debug_line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtShowDebug__post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self, const char *debug_file, const unsigned long debug_line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtShowDebug__post[hIndex].func;
- postHookFunc(self, debug_file, &debug_line);
+ postHookFunc(self, debug_file, debug_line);
}
}
return;
}
-/* StrBuf */
+/* stringbuf_interface */
StringBuf* HP_StrBuf_Malloc(void) {
int hIndex = 0;
StringBuf* retVal___ = NULL;
- if( HPMHooks.count.HP_StrBuf_Malloc_pre ) {
+ if (HPMHooks.count.HP_StrBuf_Malloc_pre > 0) {
StringBuf* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Malloc_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6089,9 +7049,9 @@ StringBuf* HP_StrBuf_Malloc(void) {
{
retVal___ = HPMHooks.source.StrBuf.Malloc();
}
- if( HPMHooks.count.HP_StrBuf_Malloc_post ) {
+ if (HPMHooks.count.HP_StrBuf_Malloc_post > 0) {
StringBuf* (*postHookFunc) (StringBuf* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Malloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6100,14 +7060,14 @@ StringBuf* HP_StrBuf_Malloc(void) {
}
void HP_StrBuf_Init(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Init_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Init_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Init_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6115,9 +7075,9 @@ void HP_StrBuf_Init(StringBuf *self) {
{
HPMHooks.source.StrBuf.Init(self);
}
- if( HPMHooks.count.HP_StrBuf_Init_post ) {
+ if (HPMHooks.count.HP_StrBuf_Init_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Init_post[hIndex].func;
postHookFunc(self);
}
@@ -6127,16 +7087,16 @@ void HP_StrBuf_Init(StringBuf *self) {
int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Vprintf_pre ) {
- int (*preHookFunc) (StringBuf *self, const char *fmt, va_list args);
+ if (HPMHooks.count.HP_StrBuf_Vprintf_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const char **fmt, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_StrBuf_Vprintf_pre[hIndex].func;
- retVal___ = preHookFunc(self, fmt, args___copy);
+ retVal___ = preHookFunc(&self, &fmt, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6146,9 +7106,9 @@ int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
retVal___ = HPMHooks.source.StrBuf.Vprintf(self, fmt, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_StrBuf_Vprintf_post ) {
+ if (HPMHooks.count.HP_StrBuf_Vprintf_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const char *fmt, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_StrBuf_Vprintf_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, fmt, args___copy);
@@ -6160,14 +7120,14 @@ int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Append_pre ) {
- int (*preHookFunc) (StringBuf *self, const StringBuf *sbuf);
+ if (HPMHooks.count.HP_StrBuf_Append_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const StringBuf **sbuf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Append_pre[hIndex].func;
- retVal___ = preHookFunc(self, sbuf);
+ retVal___ = preHookFunc(&self, &sbuf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6175,9 +7135,9 @@ int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
{
retVal___ = HPMHooks.source.StrBuf.Append(self, sbuf);
}
- if( HPMHooks.count.HP_StrBuf_Append_post ) {
+ if (HPMHooks.count.HP_StrBuf_Append_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const StringBuf *sbuf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Append_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, sbuf);
}
@@ -6187,14 +7147,14 @@ int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_AppendStr_pre ) {
- int (*preHookFunc) (StringBuf *self, const char *str);
+ if (HPMHooks.count.HP_StrBuf_AppendStr_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_AppendStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, str);
+ retVal___ = preHookFunc(&self, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6202,9 +7162,9 @@ int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
{
retVal___ = HPMHooks.source.StrBuf.AppendStr(self, str);
}
- if( HPMHooks.count.HP_StrBuf_AppendStr_post ) {
+ if (HPMHooks.count.HP_StrBuf_AppendStr_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_AppendStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, str);
}
@@ -6214,14 +7174,14 @@ int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
int HP_StrBuf_Length(StringBuf *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Length_pre ) {
- int (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Length_pre > 0) {
+ int (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Length_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6229,9 +7189,9 @@ int HP_StrBuf_Length(StringBuf *self) {
{
retVal___ = HPMHooks.source.StrBuf.Length(self);
}
- if( HPMHooks.count.HP_StrBuf_Length_post ) {
+ if (HPMHooks.count.HP_StrBuf_Length_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Length_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
@@ -6241,14 +7201,14 @@ int HP_StrBuf_Length(StringBuf *self) {
char* HP_StrBuf_Value(StringBuf *self) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_StrBuf_Value_pre ) {
- char* (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Value_pre > 0) {
+ char* (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Value_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6256,9 +7216,9 @@ char* HP_StrBuf_Value(StringBuf *self) {
{
retVal___ = HPMHooks.source.StrBuf.Value(self);
}
- if( HPMHooks.count.HP_StrBuf_Value_post ) {
+ if (HPMHooks.count.HP_StrBuf_Value_post > 0) {
char* (*postHookFunc) (char* retVal___, StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Value_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
@@ -6267,14 +7227,14 @@ char* HP_StrBuf_Value(StringBuf *self) {
}
void HP_StrBuf_Clear(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Clear_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Clear_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Clear_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6282,9 +7242,9 @@ void HP_StrBuf_Clear(StringBuf *self) {
{
HPMHooks.source.StrBuf.Clear(self);
}
- if( HPMHooks.count.HP_StrBuf_Clear_post ) {
+ if (HPMHooks.count.HP_StrBuf_Clear_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Clear_post[hIndex].func;
postHookFunc(self);
}
@@ -6293,14 +7253,14 @@ void HP_StrBuf_Clear(StringBuf *self) {
}
void HP_StrBuf_Destroy(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Destroy_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Destroy_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Destroy_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6308,9 +7268,9 @@ void HP_StrBuf_Destroy(StringBuf *self) {
{
HPMHooks.source.StrBuf.Destroy(self);
}
- if( HPMHooks.count.HP_StrBuf_Destroy_post ) {
+ if (HPMHooks.count.HP_StrBuf_Destroy_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Destroy_post[hIndex].func;
postHookFunc(self);
}
@@ -6319,14 +7279,14 @@ void HP_StrBuf_Destroy(StringBuf *self) {
}
void HP_StrBuf_Free(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Free_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Free_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Free_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6334,27 +7294,27 @@ void HP_StrBuf_Free(StringBuf *self) {
{
HPMHooks.source.StrBuf.Free(self);
}
- if( HPMHooks.count.HP_StrBuf_Free_post ) {
+ if (HPMHooks.count.HP_StrBuf_Free_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Free_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-/* strlib */
+/* strlib_interface */
char* HP_strlib_jstrescape(char *pt) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_jstrescape_pre ) {
- char* (*preHookFunc) (char *pt);
+ if (HPMHooks.count.HP_strlib_jstrescape_pre > 0) {
+ char* (*preHookFunc) (char **pt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jstrescape_pre[hIndex].func;
- retVal___ = preHookFunc(pt);
+ retVal___ = preHookFunc(&pt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6362,9 +7322,9 @@ char* HP_strlib_jstrescape(char *pt) {
{
retVal___ = HPMHooks.source.strlib.jstrescape(pt);
}
- if( HPMHooks.count.HP_strlib_jstrescape_post ) {
+ if (HPMHooks.count.HP_strlib_jstrescape_post > 0) {
char* (*postHookFunc) (char* retVal___, char *pt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jstrescape_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pt);
}
@@ -6374,14 +7334,14 @@ char* HP_strlib_jstrescape(char *pt) {
char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_jstrescapecpy_pre ) {
- char* (*preHookFunc) (char *pt, const char *spt);
+ if (HPMHooks.count.HP_strlib_jstrescapecpy_pre > 0) {
+ char* (*preHookFunc) (char **pt, const char **spt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_pre[hIndex].func;
- retVal___ = preHookFunc(pt, spt);
+ retVal___ = preHookFunc(&pt, &spt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6389,9 +7349,9 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
{
retVal___ = HPMHooks.source.strlib.jstrescapecpy(pt, spt);
}
- if( HPMHooks.count.HP_strlib_jstrescapecpy_post ) {
+ if (HPMHooks.count.HP_strlib_jstrescapecpy_post > 0) {
char* (*postHookFunc) (char* retVal___, char *pt, const char *spt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pt, spt);
}
@@ -6401,14 +7361,14 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_jmemescapecpy_pre ) {
- int (*preHookFunc) (char *pt, const char *spt, int *size);
+ if (HPMHooks.count.HP_strlib_jmemescapecpy_pre > 0) {
+ int (*preHookFunc) (char **pt, const char **spt, int *size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jmemescapecpy_pre[hIndex].func;
- retVal___ = preHookFunc(pt, spt, &size);
+ retVal___ = preHookFunc(&pt, &spt, &size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6416,11 +7376,11 @@ int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
{
retVal___ = HPMHooks.source.strlib.jmemescapecpy(pt, spt, size);
}
- if( HPMHooks.count.HP_strlib_jmemescapecpy_post ) {
- int (*postHookFunc) (int retVal___, char *pt, const char *spt, int *size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_jmemescapecpy_post > 0) {
+ int (*postHookFunc) (int retVal___, char *pt, const char *spt, int size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jmemescapecpy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pt, spt, &size);
+ retVal___ = postHookFunc(retVal___, pt, spt, size);
}
}
return retVal___;
@@ -6428,14 +7388,14 @@ int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
int HP_strlib_remove_control_chars_(char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_remove_control_chars__pre ) {
- int (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_strlib_remove_control_chars__pre > 0) {
+ int (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_remove_control_chars__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6443,9 +7403,9 @@ int HP_strlib_remove_control_chars_(char *str) {
{
retVal___ = HPMHooks.source.strlib.remove_control_chars_(str);
}
- if( HPMHooks.count.HP_strlib_remove_control_chars__post ) {
+ if (HPMHooks.count.HP_strlib_remove_control_chars__post > 0) {
int (*postHookFunc) (int retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_remove_control_chars__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -6455,14 +7415,14 @@ int HP_strlib_remove_control_chars_(char *str) {
char* HP_strlib_trim_(char *str) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_trim__pre ) {
- char* (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_strlib_trim__pre > 0) {
+ char* (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_trim__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6470,9 +7430,9 @@ char* HP_strlib_trim_(char *str) {
{
retVal___ = HPMHooks.source.strlib.trim_(str);
}
- if( HPMHooks.count.HP_strlib_trim__post ) {
+ if (HPMHooks.count.HP_strlib_trim__post > 0) {
char* (*postHookFunc) (char* retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_trim__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -6482,14 +7442,14 @@ char* HP_strlib_trim_(char *str) {
char* HP_strlib_normalize_name_(char *str, const char *delims) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_normalize_name__pre ) {
- char* (*preHookFunc) (char *str, const char *delims);
+ if (HPMHooks.count.HP_strlib_normalize_name__pre > 0) {
+ char* (*preHookFunc) (char **str, const char **delims);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_normalize_name__pre[hIndex].func;
- retVal___ = preHookFunc(str, delims);
+ retVal___ = preHookFunc(&str, &delims);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6497,9 +7457,9 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) {
{
retVal___ = HPMHooks.source.strlib.normalize_name_(str, delims);
}
- if( HPMHooks.count.HP_strlib_normalize_name__post ) {
+ if (HPMHooks.count.HP_strlib_normalize_name__post > 0) {
char* (*postHookFunc) (char* retVal___, char *str, const char *delims);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_normalize_name__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str, delims);
}
@@ -6509,14 +7469,14 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) {
const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_stristr__pre ) {
- const char* (*preHookFunc) (const char *haystack, const char *needle);
+ if (HPMHooks.count.HP_strlib_stristr__pre > 0) {
+ const char* (*preHookFunc) (const char **haystack, const char **needle);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_stristr__pre[hIndex].func;
- retVal___ = preHookFunc(haystack, needle);
+ retVal___ = preHookFunc(&haystack, &needle);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6524,9 +7484,9 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
{
retVal___ = HPMHooks.source.strlib.stristr_(haystack, needle);
}
- if( HPMHooks.count.HP_strlib_stristr__post ) {
+ if (HPMHooks.count.HP_strlib_stristr__post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *haystack, const char *needle);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_stristr__post[hIndex].func;
retVal___ = postHookFunc(retVal___, haystack, needle);
}
@@ -6536,14 +7496,14 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_strlib_strnlen__pre ) {
- size_t (*preHookFunc) (const char *string, size_t *maxlen);
+ if (HPMHooks.count.HP_strlib_strnlen__pre > 0) {
+ size_t (*preHookFunc) (const char **string, size_t *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strnlen__pre[hIndex].func;
- retVal___ = preHookFunc(string, &maxlen);
+ retVal___ = preHookFunc(&string, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6551,11 +7511,11 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
{
retVal___ = HPMHooks.source.strlib.strnlen_(string, maxlen);
}
- if( HPMHooks.count.HP_strlib_strnlen__post ) {
- size_t (*postHookFunc) (size_t retVal___, const char *string, size_t *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_strnlen__post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, const char *string, size_t maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strnlen__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, string, &maxlen);
+ retVal___ = postHookFunc(retVal___, string, maxlen);
}
}
return retVal___;
@@ -6563,14 +7523,14 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_strtok_r__pre ) {
- char* (*preHookFunc) (char *s1, const char *s2, char **lasts);
+ if (HPMHooks.count.HP_strlib_strtok_r__pre > 0) {
+ char* (*preHookFunc) (char **s1, const char **s2, char ***lasts);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strtok_r__pre[hIndex].func;
- retVal___ = preHookFunc(s1, s2, lasts);
+ retVal___ = preHookFunc(&s1, &s2, &lasts);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6578,9 +7538,9 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
{
retVal___ = HPMHooks.source.strlib.strtok_r_(s1, s2, lasts);
}
- if( HPMHooks.count.HP_strlib_strtok_r__post ) {
+ if (HPMHooks.count.HP_strlib_strtok_r__post > 0) {
char* (*postHookFunc) (char* retVal___, char *s1, const char *s2, char **lasts);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strtok_r__post[hIndex].func;
retVal___ = postHookFunc(retVal___, s1, s2, lasts);
}
@@ -6590,14 +7550,14 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
int HP_strlib_e_mail_check_(char *email) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_e_mail_check__pre ) {
- int (*preHookFunc) (char *email);
+ if (HPMHooks.count.HP_strlib_e_mail_check__pre > 0) {
+ int (*preHookFunc) (char **email);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_e_mail_check__pre[hIndex].func;
- retVal___ = preHookFunc(email);
+ retVal___ = preHookFunc(&email);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6605,9 +7565,9 @@ int HP_strlib_e_mail_check_(char *email) {
{
retVal___ = HPMHooks.source.strlib.e_mail_check_(email);
}
- if( HPMHooks.count.HP_strlib_e_mail_check__post ) {
+ if (HPMHooks.count.HP_strlib_e_mail_check__post > 0) {
int (*postHookFunc) (int retVal___, char *email);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_e_mail_check__post[hIndex].func;
retVal___ = postHookFunc(retVal___, email);
}
@@ -6617,14 +7577,14 @@ int HP_strlib_e_mail_check_(char *email) {
int HP_strlib_config_switch_(const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_config_switch__pre ) {
- int (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_strlib_config_switch__pre > 0) {
+ int (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_config_switch__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6632,9 +7592,9 @@ int HP_strlib_config_switch_(const char *str) {
{
retVal___ = HPMHooks.source.strlib.config_switch_(str);
}
- if( HPMHooks.count.HP_strlib_config_switch__post ) {
+ if (HPMHooks.count.HP_strlib_config_switch__post > 0) {
int (*postHookFunc) (int retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_config_switch__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -6644,14 +7604,14 @@ int HP_strlib_config_switch_(const char *str) {
char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_safestrncpy__pre ) {
- char* (*preHookFunc) (char *dst, const char *src, size_t *n);
+ if (HPMHooks.count.HP_strlib_safestrncpy__pre > 0) {
+ char* (*preHookFunc) (char **dst, const char **src, size_t *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_safestrncpy__pre[hIndex].func;
- retVal___ = preHookFunc(dst, src, &n);
+ retVal___ = preHookFunc(&dst, &src, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6659,11 +7619,11 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
{
retVal___ = HPMHooks.source.strlib.safestrncpy_(dst, src, n);
}
- if( HPMHooks.count.HP_strlib_safestrncpy__post ) {
- char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_safestrncpy__post > 0) {
+ char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_safestrncpy__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, dst, src, &n);
+ retVal___ = postHookFunc(retVal___, dst, src, n);
}
}
return retVal___;
@@ -6671,14 +7631,14 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_strlib_safestrnlen__pre ) {
- size_t (*preHookFunc) (const char *string, size_t *maxlen);
+ if (HPMHooks.count.HP_strlib_safestrnlen__pre > 0) {
+ size_t (*preHookFunc) (const char **string, size_t *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_safestrnlen__pre[hIndex].func;
- retVal___ = preHookFunc(string, &maxlen);
+ retVal___ = preHookFunc(&string, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6686,11 +7646,11 @@ size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
{
retVal___ = HPMHooks.source.strlib.safestrnlen_(string, maxlen);
}
- if( HPMHooks.count.HP_strlib_safestrnlen__post ) {
- size_t (*postHookFunc) (size_t retVal___, const char *string, size_t *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_safestrnlen__post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, const char *string, size_t maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_safestrnlen__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, string, &maxlen);
+ retVal___ = postHookFunc(retVal___, string, maxlen);
}
}
return retVal___;
@@ -6698,14 +7658,14 @@ size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
int HP_strlib_strline_(const char *str, size_t pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_strline__pre ) {
- int (*preHookFunc) (const char *str, size_t *pos);
+ if (HPMHooks.count.HP_strlib_strline__pre > 0) {
+ int (*preHookFunc) (const char **str, size_t *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strline__pre[hIndex].func;
- retVal___ = preHookFunc(str, &pos);
+ retVal___ = preHookFunc(&str, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6713,26 +7673,26 @@ int HP_strlib_strline_(const char *str, size_t pos) {
{
retVal___ = HPMHooks.source.strlib.strline_(str, pos);
}
- if( HPMHooks.count.HP_strlib_strline__post ) {
- int (*postHookFunc) (int retVal___, const char *str, size_t *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_strline__post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, size_t pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strline__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &pos);
+ retVal___ = postHookFunc(retVal___, str, pos);
}
}
return retVal___;
}
-bool HP_strlib_bin2hex_(char *output, unsigned char *input, size_t count) {
+bool HP_strlib_bin2hex_(char *output, const unsigned char *input, size_t count) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_strlib_bin2hex__pre ) {
- bool (*preHookFunc) (char *output, unsigned char *input, size_t *count);
+ if (HPMHooks.count.HP_strlib_bin2hex__pre > 0) {
+ bool (*preHookFunc) (char **output, const unsigned char **input, size_t *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_bin2hex__pre[hIndex].func;
- retVal___ = preHookFunc(output, input, &count);
+ retVal___ = preHookFunc(&output, &input, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6740,27 +7700,27 @@ bool HP_strlib_bin2hex_(char *output, unsigned char *input, size_t count) {
{
retVal___ = HPMHooks.source.strlib.bin2hex_(output, input, count);
}
- if( HPMHooks.count.HP_strlib_bin2hex__post ) {
- bool (*postHookFunc) (bool retVal___, char *output, unsigned char *input, size_t *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_bin2hex__post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *output, const unsigned char *input, size_t count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_bin2hex__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, output, input, &count);
+ retVal___ = postHookFunc(retVal___, output, input, count);
}
}
return retVal___;
}
-/* sv */
+/* sv_interface */
int HP_sv_parse_next(struct s_svstate *svstate) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_parse_next_pre ) {
- int (*preHookFunc) (struct s_svstate *svstate);
+ if (HPMHooks.count.HP_sv_parse_next_pre > 0) {
+ int (*preHookFunc) (struct s_svstate **svstate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_parse_next_pre[hIndex].func;
- retVal___ = preHookFunc(svstate);
+ retVal___ = preHookFunc(&svstate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6768,9 +7728,9 @@ int HP_sv_parse_next(struct s_svstate *svstate) {
{
retVal___ = HPMHooks.source.sv.parse_next(svstate);
}
- if( HPMHooks.count.HP_sv_parse_next_post ) {
+ if (HPMHooks.count.HP_sv_parse_next_post > 0) {
int (*postHookFunc) (int retVal___, struct s_svstate *svstate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_parse_next_post[hIndex].func;
retVal___ = postHookFunc(retVal___, svstate);
}
@@ -6780,14 +7740,14 @@ int HP_sv_parse_next(struct s_svstate *svstate) {
int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_parse_pre ) {
- int (*preHookFunc) (const char *str, int *len, int *startoff, char *delim, int *out_pos, int *npos, enum e_svopt *opt);
+ if (HPMHooks.count.HP_sv_parse_pre > 0) {
+ int (*preHookFunc) (const char **str, int *len, int *startoff, char *delim, int **out_pos, int *npos, enum e_svopt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_parse_pre[hIndex].func;
- retVal___ = preHookFunc(str, &len, &startoff, &delim, out_pos, &npos, &opt);
+ retVal___ = preHookFunc(&str, &len, &startoff, &delim, &out_pos, &npos, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6795,11 +7755,11 @@ int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos
{
retVal___ = HPMHooks.source.sv.parse(str, len, startoff, delim, out_pos, npos, opt);
}
- if( HPMHooks.count.HP_sv_parse_post ) {
- int (*postHookFunc) (int retVal___, const char *str, int *len, int *startoff, char *delim, int *out_pos, int *npos, enum e_svopt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &len, &startoff, &delim, out_pos, &npos, &opt);
+ retVal___ = postHookFunc(retVal___, str, len, startoff, delim, out_pos, npos, opt);
}
}
return retVal___;
@@ -6807,14 +7767,14 @@ int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos
int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_split_pre ) {
- int (*preHookFunc) (char *str, int *len, int *startoff, char *delim, char **out_fields, int *nfields, enum e_svopt *opt);
+ if (HPMHooks.count.HP_sv_split_pre > 0) {
+ int (*preHookFunc) (char **str, int *len, int *startoff, char *delim, char ***out_fields, int *nfields, enum e_svopt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_split_pre[hIndex].func;
- retVal___ = preHookFunc(str, &len, &startoff, &delim, out_fields, &nfields, &opt);
+ retVal___ = preHookFunc(&str, &len, &startoff, &delim, &out_fields, &nfields, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6822,11 +7782,11 @@ int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields,
{
retVal___ = HPMHooks.source.sv.split(str, len, startoff, delim, out_fields, nfields, opt);
}
- if( HPMHooks.count.HP_sv_split_post ) {
- int (*postHookFunc) (int retVal___, char *str, int *len, int *startoff, char *delim, char **out_fields, int *nfields, enum e_svopt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_split_post > 0) {
+ int (*postHookFunc) (int retVal___, char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_split_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &len, &startoff, &delim, out_fields, &nfields, &opt);
+ retVal___ = postHookFunc(retVal___, str, len, startoff, delim, out_fields, nfields, opt);
}
}
return retVal___;
@@ -6834,14 +7794,14 @@ int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields,
size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *escapes) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_sv_escape_c_pre ) {
- size_t (*preHookFunc) (char *out_dest, const char *src, size_t *len, const char *escapes);
+ if (HPMHooks.count.HP_sv_escape_c_pre > 0) {
+ size_t (*preHookFunc) (char **out_dest, const char **src, size_t *len, const char **escapes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_escape_c_pre[hIndex].func;
- retVal___ = preHookFunc(out_dest, src, &len, escapes);
+ retVal___ = preHookFunc(&out_dest, &src, &len, &escapes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6849,11 +7809,11 @@ size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *e
{
retVal___ = HPMHooks.source.sv.escape_c(out_dest, src, len, escapes);
}
- if( HPMHooks.count.HP_sv_escape_c_post ) {
- size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t *len, const char *escapes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_escape_c_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t len, const char *escapes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_escape_c_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, out_dest, src, &len, escapes);
+ retVal___ = postHookFunc(retVal___, out_dest, src, len, escapes);
}
}
return retVal___;
@@ -6861,14 +7821,14 @@ size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *e
size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_sv_unescape_c_pre ) {
- size_t (*preHookFunc) (char *out_dest, const char *src, size_t *len);
+ if (HPMHooks.count.HP_sv_unescape_c_pre > 0) {
+ size_t (*preHookFunc) (char **out_dest, const char **src, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_unescape_c_pre[hIndex].func;
- retVal___ = preHookFunc(out_dest, src, &len);
+ retVal___ = preHookFunc(&out_dest, &src, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6876,11 +7836,11 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
{
retVal___ = HPMHooks.source.sv.unescape_c(out_dest, src, len);
}
- if( HPMHooks.count.HP_sv_unescape_c_post ) {
- size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_unescape_c_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_unescape_c_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, out_dest, src, &len);
+ retVal___ = postHookFunc(retVal___, out_dest, src, len);
}
}
return retVal___;
@@ -6888,14 +7848,14 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
const char* HP_sv_skip_escaped_c(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sv_skip_escaped_c_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_sv_skip_escaped_c_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6903,9 +7863,9 @@ const char* HP_sv_skip_escaped_c(const char *p) {
{
retVal___ = HPMHooks.source.sv.skip_escaped_c(p);
}
- if( HPMHooks.count.HP_sv_skip_escaped_c_post ) {
+ if (HPMHooks.count.HP_sv_skip_escaped_c_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -6915,14 +7875,14 @@ const char* HP_sv_skip_escaped_c(const char *p) {
bool HP_sv_readdb(const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current)) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sv_readdb_pre ) {
- bool (*preHookFunc) (const char *directory, const char *filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+ if (HPMHooks.count.HP_sv_readdb_pre > 0) {
+ bool (*preHookFunc) (const char **directory, const char **filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( **parseproc ) (char *fields[], int columns, int current));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_readdb_pre[hIndex].func;
- retVal___ = preHookFunc(directory, filename, &delim, &mincols, &maxcols, &maxrows, parseproc);
+ retVal___ = preHookFunc(&directory, &filename, &delim, &mincols, &maxcols, &maxrows, &parseproc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6930,27 +7890,27 @@ bool HP_sv_readdb(const char *directory, const char *filename, char delim, int m
{
retVal___ = HPMHooks.source.sv.readdb(directory, filename, delim, mincols, maxcols, maxrows, parseproc);
}
- if( HPMHooks.count.HP_sv_readdb_post ) {
- bool (*postHookFunc) (bool retVal___, const char *directory, const char *filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_readdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_readdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, directory, filename, &delim, &mincols, &maxcols, &maxrows, parseproc);
+ retVal___ = postHookFunc(retVal___, directory, filename, delim, mincols, maxcols, maxrows, parseproc);
}
}
return retVal___;
}
-/* sysinfo */
+/* sysinfo_interface */
int HP_sysinfo_getpagesize(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_getpagesize_pre ) {
+ if (HPMHooks.count.HP_sysinfo_getpagesize_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_getpagesize_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6958,9 +7918,9 @@ int HP_sysinfo_getpagesize(void) {
{
retVal___ = HPMHooks.source.sysinfo.getpagesize();
}
- if( HPMHooks.count.HP_sysinfo_getpagesize_post ) {
+ if (HPMHooks.count.HP_sysinfo_getpagesize_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_getpagesize_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6970,14 +7930,14 @@ int HP_sysinfo_getpagesize(void) {
const char* HP_sysinfo_platform(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_platform_pre ) {
+ if (HPMHooks.count.HP_sysinfo_platform_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_platform_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6985,9 +7945,9 @@ const char* HP_sysinfo_platform(void) {
{
retVal___ = HPMHooks.source.sysinfo.platform();
}
- if( HPMHooks.count.HP_sysinfo_platform_post ) {
+ if (HPMHooks.count.HP_sysinfo_platform_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_platform_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6997,14 +7957,14 @@ const char* HP_sysinfo_platform(void) {
const char* HP_sysinfo_osversion(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_osversion_pre ) {
+ if (HPMHooks.count.HP_sysinfo_osversion_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_osversion_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7012,9 +7972,9 @@ const char* HP_sysinfo_osversion(void) {
{
retVal___ = HPMHooks.source.sysinfo.osversion();
}
- if( HPMHooks.count.HP_sysinfo_osversion_post ) {
+ if (HPMHooks.count.HP_sysinfo_osversion_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_osversion_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7024,14 +7984,14 @@ const char* HP_sysinfo_osversion(void) {
const char* HP_sysinfo_cpu(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_cpu_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cpu_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cpu_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7039,9 +7999,9 @@ const char* HP_sysinfo_cpu(void) {
{
retVal___ = HPMHooks.source.sysinfo.cpu();
}
- if( HPMHooks.count.HP_sysinfo_cpu_post ) {
+ if (HPMHooks.count.HP_sysinfo_cpu_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cpu_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7051,14 +8011,14 @@ const char* HP_sysinfo_cpu(void) {
int HP_sysinfo_cpucores(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_cpucores_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cpucores_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cpucores_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7066,9 +8026,9 @@ int HP_sysinfo_cpucores(void) {
{
retVal___ = HPMHooks.source.sysinfo.cpucores();
}
- if( HPMHooks.count.HP_sysinfo_cpucores_post ) {
+ if (HPMHooks.count.HP_sysinfo_cpucores_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cpucores_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7078,14 +8038,14 @@ int HP_sysinfo_cpucores(void) {
const char* HP_sysinfo_arch(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_arch_pre ) {
+ if (HPMHooks.count.HP_sysinfo_arch_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_arch_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7093,9 +8053,9 @@ const char* HP_sysinfo_arch(void) {
{
retVal___ = HPMHooks.source.sysinfo.arch();
}
- if( HPMHooks.count.HP_sysinfo_arch_post ) {
+ if (HPMHooks.count.HP_sysinfo_arch_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_arch_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7105,14 +8065,14 @@ const char* HP_sysinfo_arch(void) {
bool HP_sysinfo_is64bit(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sysinfo_is64bit_pre ) {
+ if (HPMHooks.count.HP_sysinfo_is64bit_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_is64bit_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7120,9 +8080,9 @@ bool HP_sysinfo_is64bit(void) {
{
retVal___ = HPMHooks.source.sysinfo.is64bit();
}
- if( HPMHooks.count.HP_sysinfo_is64bit_post ) {
+ if (HPMHooks.count.HP_sysinfo_is64bit_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_is64bit_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7132,14 +8092,14 @@ bool HP_sysinfo_is64bit(void) {
const char* HP_sysinfo_compiler(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_compiler_pre ) {
+ if (HPMHooks.count.HP_sysinfo_compiler_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_compiler_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7147,9 +8107,9 @@ const char* HP_sysinfo_compiler(void) {
{
retVal___ = HPMHooks.source.sysinfo.compiler();
}
- if( HPMHooks.count.HP_sysinfo_compiler_post ) {
+ if (HPMHooks.count.HP_sysinfo_compiler_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_compiler_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7159,14 +8119,14 @@ const char* HP_sysinfo_compiler(void) {
const char* HP_sysinfo_cflags(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_cflags_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cflags_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cflags_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7174,26 +8134,53 @@ const char* HP_sysinfo_cflags(void) {
{
retVal___ = HPMHooks.source.sysinfo.cflags();
}
- if( HPMHooks.count.HP_sysinfo_cflags_post ) {
+ if (HPMHooks.count.HP_sysinfo_cflags_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cflags_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
+const char* HP_sysinfo_time(void) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_sysinfo_time_pre > 0) {
+ const char* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_sysinfo_time_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.sysinfo.time();
+ }
+ if (HPMHooks.count.HP_sysinfo_time_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_sysinfo_time_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
const char* HP_sysinfo_vcstype(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcstype_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcstype_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcstype_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7201,9 +8188,9 @@ const char* HP_sysinfo_vcstype(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcstype();
}
- if( HPMHooks.count.HP_sysinfo_vcstype_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcstype_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcstype_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7213,14 +8200,14 @@ const char* HP_sysinfo_vcstype(void) {
int HP_sysinfo_vcstypeid(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_vcstypeid_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcstypeid_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcstypeid_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7228,9 +8215,9 @@ int HP_sysinfo_vcstypeid(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcstypeid();
}
- if( HPMHooks.count.HP_sysinfo_vcstypeid_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcstypeid_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcstypeid_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7240,14 +8227,14 @@ int HP_sysinfo_vcstypeid(void) {
const char* HP_sysinfo_vcsrevision_src(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_src_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_src_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7255,9 +8242,9 @@ const char* HP_sysinfo_vcsrevision_src(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcsrevision_src();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_src_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_src_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7267,14 +8254,14 @@ const char* HP_sysinfo_vcsrevision_src(void) {
const char* HP_sysinfo_vcsrevision_scripts(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7282,9 +8269,9 @@ const char* HP_sysinfo_vcsrevision_scripts(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcsrevision_scripts();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7293,14 +8280,14 @@ const char* HP_sysinfo_vcsrevision_scripts(void) {
}
void HP_sysinfo_vcsrevision_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7308,9 +8295,9 @@ void HP_sysinfo_vcsrevision_reload(void) {
{
HPMHooks.source.sysinfo.vcsrevision_reload();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_reload_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_reload_post[hIndex].func;
postHookFunc();
}
@@ -7320,14 +8307,14 @@ void HP_sysinfo_vcsrevision_reload(void) {
bool HP_sysinfo_is_superuser(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sysinfo_is_superuser_pre ) {
+ if (HPMHooks.count.HP_sysinfo_is_superuser_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_is_superuser_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7335,9 +8322,9 @@ bool HP_sysinfo_is_superuser(void) {
{
retVal___ = HPMHooks.source.sysinfo.is_superuser();
}
- if( HPMHooks.count.HP_sysinfo_is_superuser_post ) {
+ if (HPMHooks.count.HP_sysinfo_is_superuser_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_is_superuser_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7346,14 +8333,14 @@ bool HP_sysinfo_is_superuser(void) {
}
void HP_sysinfo_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_init_pre ) {
+ if (HPMHooks.count.HP_sysinfo_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7361,9 +8348,9 @@ void HP_sysinfo_init(void) {
{
HPMHooks.source.sysinfo.init();
}
- if( HPMHooks.count.HP_sysinfo_init_post ) {
+ if (HPMHooks.count.HP_sysinfo_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_init_post[hIndex].func;
postHookFunc();
}
@@ -7372,14 +8359,14 @@ void HP_sysinfo_init(void) {
}
void HP_sysinfo_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_final_pre ) {
+ if (HPMHooks.count.HP_sysinfo_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7387,27 +8374,320 @@ void HP_sysinfo_final(void) {
{
HPMHooks.source.sysinfo.final();
}
- if( HPMHooks.count.HP_sysinfo_final_post ) {
+ if (HPMHooks.count.HP_sysinfo_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* timer */
+/* thread_interface */
+void HP_thread_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.init();
+ }
+ if (HPMHooks.count.HP_thread_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_thread_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.final();
+ }
+ if (HPMHooks.count.HP_thread_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_create_pre > 0) {
+ struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func;
+ retVal___ = preHookFunc(&entry_point, &param);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.create(entry_point, param);
+ }
+ if (HPMHooks.count.HP_thread_create_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, entry_point, param);
+ }
+ }
+ return retVal___;
+}
+struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_create_opt_pre > 0) {
+ struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func;
+ retVal___ = preHookFunc(&entry_point, &param, &stack_size, &prio);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio);
+ }
+ if (HPMHooks.count.HP_thread_create_opt_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_destroy(struct thread_handle *handle) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_destroy_pre > 0) {
+ void (*preHookFunc) (struct thread_handle **handle);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func;
+ preHookFunc(&handle);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.destroy(handle);
+ }
+ if (HPMHooks.count.HP_thread_destroy_post > 0) {
+ void (*postHookFunc) (struct thread_handle *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func;
+ postHookFunc(handle);
+ }
+ }
+ return;
+}
+struct thread_handle* HP_thread_self(void) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_self_pre > 0) {
+ struct thread_handle* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.self();
+ }
+ if (HPMHooks.count.HP_thread_self_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+int HP_thread_get_tid(void) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_thread_get_tid_pre > 0) {
+ int (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.get_tid();
+ }
+ if (HPMHooks.count.HP_thread_get_tid_post > 0) {
+ int (*postHookFunc) (int retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_thread_wait_pre > 0) {
+ bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func;
+ retVal___ = preHookFunc(&handle, &out_exit_code);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code);
+ }
+ if (HPMHooks.count.HP_thread_wait_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, handle, out_exit_code);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_prio_set_pre > 0) {
+ void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func;
+ preHookFunc(&handle, &prio);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.prio_set(handle, prio);
+ }
+ if (HPMHooks.count.HP_thread_prio_set_post > 0) {
+ void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func;
+ postHookFunc(handle, prio);
+ }
+ }
+ return;
+}
+enum thread_priority HP_thread_prio_get(struct thread_handle *handle) {
+ int hIndex = 0;
+ enum thread_priority retVal___ = THREADPRIO_NORMAL;
+ if (HPMHooks.count.HP_thread_prio_get_pre > 0) {
+ enum thread_priority (*preHookFunc) (struct thread_handle **handle);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func;
+ retVal___ = preHookFunc(&handle);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.prio_get(handle);
+ }
+ if (HPMHooks.count.HP_thread_prio_get_post > 0) {
+ enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, handle);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_yield(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_yield_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.yield();
+ }
+ if (HPMHooks.count.HP_thread_yield_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+/* timer_interface */
int64 HP_timer_gettick(void) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_gettick_pre ) {
+ if (HPMHooks.count.HP_timer_gettick_pre > 0) {
int64 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_gettick_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7415,9 +8695,9 @@ int64 HP_timer_gettick(void) {
{
retVal___ = HPMHooks.source.timer.gettick();
}
- if( HPMHooks.count.HP_timer_gettick_post ) {
+ if (HPMHooks.count.HP_timer_gettick_post > 0) {
int64 (*postHookFunc) (int64 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_gettick_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7427,14 +8707,14 @@ int64 HP_timer_gettick(void) {
int64 HP_timer_gettick_nocache(void) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_gettick_nocache_pre ) {
+ if (HPMHooks.count.HP_timer_gettick_nocache_pre > 0) {
int64 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_gettick_nocache_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7442,9 +8722,9 @@ int64 HP_timer_gettick_nocache(void) {
{
retVal___ = HPMHooks.source.timer.gettick_nocache();
}
- if( HPMHooks.count.HP_timer_gettick_nocache_post ) {
+ if (HPMHooks.count.HP_timer_gettick_nocache_post > 0) {
int64 (*postHookFunc) (int64 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_gettick_nocache_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7454,14 +8734,14 @@ int64 HP_timer_gettick_nocache(void) {
int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_pre ) {
+ if (HPMHooks.count.HP_timer_add_pre > 0) {
int (*preHookFunc) (int64 *tick, TimerFunc *func, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_pre[hIndex].func;
retVal___ = preHookFunc(&tick, &func, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7469,11 +8749,11 @@ int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.timer.add(tick, func, id, data);
}
- if( HPMHooks.count.HP_timer_add_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, TimerFunc *func, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &func, &id, &data);
+ retVal___ = postHookFunc(retVal___, tick, func, id, data);
}
}
return retVal___;
@@ -7481,14 +8761,14 @@ int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int interval) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_interval_pre ) {
+ if (HPMHooks.count.HP_timer_add_interval_pre > 0) {
int (*preHookFunc) (int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_interval_pre[hIndex].func;
retVal___ = preHookFunc(&tick, &func, &id, &data, &interval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7496,11 +8776,11 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int
{
retVal___ = HPMHooks.source.timer.add_interval(tick, func, id, data, interval);
}
- if( HPMHooks.count.HP_timer_add_interval_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_interval_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data, int interval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_interval_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &func, &id, &data, &interval);
+ retVal___ = postHookFunc(retVal___, tick, func, id, data, interval);
}
}
return retVal___;
@@ -7508,14 +8788,14 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int
const struct TimerData* HP_timer_get(int tid) {
int hIndex = 0;
const struct TimerData* retVal___ = NULL;
- if( HPMHooks.count.HP_timer_get_pre ) {
+ if (HPMHooks.count.HP_timer_get_pre > 0) {
const struct TimerData* (*preHookFunc) (int *tid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_get_pre[hIndex].func;
retVal___ = preHookFunc(&tid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7523,11 +8803,11 @@ const struct TimerData* HP_timer_get(int tid) {
{
retVal___ = HPMHooks.source.timer.get(tid);
}
- if( HPMHooks.count.HP_timer_get_post ) {
- const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int *tid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_get_post > 0) {
+ const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int tid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_get_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid);
+ retVal___ = postHookFunc(retVal___, tid);
}
}
return retVal___;
@@ -7535,14 +8815,14 @@ const struct TimerData* HP_timer_get(int tid) {
int HP_timer_delete(int tid, TimerFunc func) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_delete_pre ) {
+ if (HPMHooks.count.HP_timer_delete_pre > 0) {
int (*preHookFunc) (int *tid, TimerFunc *func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_delete_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7550,11 +8830,11 @@ int HP_timer_delete(int tid, TimerFunc func) {
{
retVal___ = HPMHooks.source.timer.delete(tid, func);
}
- if( HPMHooks.count.HP_timer_delete_post ) {
- int (*postHookFunc) (int retVal___, int *tid, TimerFunc *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, TimerFunc func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &func);
+ retVal___ = postHookFunc(retVal___, tid, func);
}
}
return retVal___;
@@ -7562,14 +8842,14 @@ int HP_timer_delete(int tid, TimerFunc func) {
int64 HP_timer_addtick(int tid, int64 tick) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_addtick_pre ) {
+ if (HPMHooks.count.HP_timer_addtick_pre > 0) {
int64 (*preHookFunc) (int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_addtick_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7577,11 +8857,11 @@ int64 HP_timer_addtick(int tid, int64 tick) {
{
retVal___ = HPMHooks.source.timer.addtick(tid, tick);
}
- if( HPMHooks.count.HP_timer_addtick_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_addtick_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_addtick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, tid, tick);
}
}
return retVal___;
@@ -7589,14 +8869,14 @@ int64 HP_timer_addtick(int tid, int64 tick) {
int64 HP_timer_settick(int tid, int64 tick) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_settick_pre ) {
+ if (HPMHooks.count.HP_timer_settick_pre > 0) {
int64 (*preHookFunc) (int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_settick_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7604,11 +8884,11 @@ int64 HP_timer_settick(int tid, int64 tick) {
{
retVal___ = HPMHooks.source.timer.settick(tid, tick);
}
- if( HPMHooks.count.HP_timer_settick_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_settick_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_settick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, tid, tick);
}
}
return retVal___;
@@ -7616,14 +8896,14 @@ int64 HP_timer_settick(int tid, int64 tick) {
int HP_timer_add_func_list(TimerFunc func, char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_func_list_pre ) {
- int (*preHookFunc) (TimerFunc *func, char *name);
+ if (HPMHooks.count.HP_timer_add_func_list_pre > 0) {
+ int (*preHookFunc) (TimerFunc *func, char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_func_list_pre[hIndex].func;
- retVal___ = preHookFunc(&func, name);
+ retVal___ = preHookFunc(&func, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7631,11 +8911,11 @@ int HP_timer_add_func_list(TimerFunc func, char *name) {
{
retVal___ = HPMHooks.source.timer.add_func_list(func, name);
}
- if( HPMHooks.count.HP_timer_add_func_list_post ) {
- int (*postHookFunc) (int retVal___, TimerFunc *func, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_func_list_post > 0) {
+ int (*postHookFunc) (int retVal___, TimerFunc func, char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_func_list_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &func, name);
+ retVal___ = postHookFunc(retVal___, func, name);
}
}
return retVal___;
@@ -7643,14 +8923,14 @@ int HP_timer_add_func_list(TimerFunc func, char *name) {
unsigned long HP_timer_get_uptime(void) {
int hIndex = 0;
unsigned long retVal___ = 0;
- if( HPMHooks.count.HP_timer_get_uptime_pre ) {
+ if (HPMHooks.count.HP_timer_get_uptime_pre > 0) {
unsigned long (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_get_uptime_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7658,9 +8938,9 @@ unsigned long HP_timer_get_uptime(void) {
{
retVal___ = HPMHooks.source.timer.get_uptime();
}
- if( HPMHooks.count.HP_timer_get_uptime_post ) {
+ if (HPMHooks.count.HP_timer_get_uptime_post > 0) {
unsigned long (*postHookFunc) (unsigned long retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_get_uptime_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -7670,14 +8950,14 @@ unsigned long HP_timer_get_uptime(void) {
int HP_timer_perform(int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_perform_pre ) {
+ if (HPMHooks.count.HP_timer_perform_pre > 0) {
int (*preHookFunc) (int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_perform_pre[hIndex].func;
retVal___ = preHookFunc(&tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7685,25 +8965,25 @@ int HP_timer_perform(int64 tick) {
{
retVal___ = HPMHooks.source.timer.perform(tick);
}
- if( HPMHooks.count.HP_timer_perform_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_perform_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_perform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick);
+ retVal___ = postHookFunc(retVal___, tick);
}
}
return retVal___;
}
void HP_timer_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_timer_init_pre ) {
+ if (HPMHooks.count.HP_timer_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7711,9 +8991,9 @@ void HP_timer_init(void) {
{
HPMHooks.source.timer.init();
}
- if( HPMHooks.count.HP_timer_init_post ) {
+ if (HPMHooks.count.HP_timer_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_init_post[hIndex].func;
postHookFunc();
}
@@ -7722,14 +9002,14 @@ void HP_timer_init(void) {
}
void HP_timer_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_timer_final_pre ) {
+ if (HPMHooks.count.HP_timer_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7737,9 +9017,9 @@ void HP_timer_final(void) {
{
HPMHooks.source.timer.final();
}
- if( HPMHooks.count.HP_timer_final_post ) {
+ if (HPMHooks.count.HP_timer_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_final_post[hIndex].func;
postHookFunc();
}
diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
index bbc1cecbc..8c3b935ac 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,20 +23,28 @@
* as it will get overwritten.
*/
-memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface));
-memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface));
-memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface));
-memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface));
-memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface));
-memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
-memcpy(&HPMHooks.source.login, login, sizeof(struct login_interface));
-memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));
-memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface));
-memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface));
-memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface));
-memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface));
-memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface));
-memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface));
-memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface));
-memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface));
-memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface));
+/* GENERATED FILE DO NOT EDIT */
+
+HPMHooks.source.HCache = *HCache;
+HPMHooks.source.cmdline = *cmdline;
+HPMHooks.source.console = *console;
+HPMHooks.source.core = *core;
+HPMHooks.source.DB = *DB;
+HPMHooks.source.des = *des;
+HPMHooks.source.lclif = *lclif;
+HPMHooks.source.PRIV__lclif = *lclif->p;
+HPMHooks.source.libconfig = *libconfig;
+HPMHooks.source.login = *login;
+HPMHooks.source.md5 = *md5;
+HPMHooks.source.mutex = *mutex;
+HPMHooks.source.nullpo = *nullpo;
+HPMHooks.source.rnd = *rnd;
+HPMHooks.source.showmsg = *showmsg;
+HPMHooks.source.sockt = *sockt;
+HPMHooks.source.SQL = *SQL;
+HPMHooks.source.StrBuf = *StrBuf;
+HPMHooks.source.strlib = *strlib;
+HPMHooks.source.sv = *sv;
+HPMHooks.source.sysinfo = *sysinfo;
+HPMHooks.source.thread = *thread;
+HPMHooks.source.timer = *timer;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 2445074f6..e84a9bd0d 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,6 +23,8 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
struct {
struct HPMHookPoint *HP_HCache_init_pre;
struct HPMHookPoint *HP_HCache_init_post;
@@ -108,12 +110,16 @@ struct {
struct HPMHookPoint *HP_battle_calc_attack_post;
struct HPMHookPoint *HP_battle_calc_damage_pre;
struct HPMHookPoint *HP_battle_calc_damage_post;
+ struct HPMHookPoint *HP_battle_calc_pc_damage_pre;
+ struct HPMHookPoint *HP_battle_calc_pc_damage_post;
struct HPMHookPoint *HP_battle_calc_gvg_damage_pre;
struct HPMHookPoint *HP_battle_calc_gvg_damage_post;
struct HPMHookPoint *HP_battle_calc_bg_damage_pre;
struct HPMHookPoint *HP_battle_calc_bg_damage_post;
struct HPMHookPoint *HP_battle_weapon_attack_pre;
struct HPMHookPoint *HP_battle_weapon_attack_post;
+ struct HPMHookPoint *HP_battle_check_arrows_pre;
+ struct HPMHookPoint *HP_battle_check_arrows_post;
struct HPMHookPoint *HP_battle_calc_weapon_attack_pre;
struct HPMHookPoint *HP_battle_calc_weapon_attack_post;
struct HPMHookPoint *HP_battle_delay_damage_pre;
@@ -192,6 +198,8 @@ struct {
struct HPMHookPoint *HP_battle_config_read_post;
struct HPMHookPoint *HP_battle_config_set_defaults_pre;
struct HPMHookPoint *HP_battle_config_set_defaults_post;
+ struct HPMHookPoint *HP_battle_config_set_value_sub_pre;
+ struct HPMHookPoint *HP_battle_config_set_value_sub_post;
struct HPMHookPoint *HP_battle_config_set_value_pre;
struct HPMHookPoint *HP_battle_config_set_value_post;
struct HPMHookPoint *HP_battle_config_get_value_pre;
@@ -832,6 +840,8 @@ struct {
struct HPMHookPoint *HP_clif_skill_itemlistwindow_post;
struct HPMHookPoint *HP_clif_sc_load_pre;
struct HPMHookPoint *HP_clif_sc_load_post;
+ struct HPMHookPoint *HP_clif_sc_continue_pre;
+ struct HPMHookPoint *HP_clif_sc_continue_post;
struct HPMHookPoint *HP_clif_sc_end_pre;
struct HPMHookPoint *HP_clif_sc_end_post;
struct HPMHookPoint *HP_clif_initialstatus_pre;
@@ -894,8 +904,8 @@ struct {
struct HPMHookPoint *HP_clif_skill_estimation_post;
struct HPMHookPoint *HP_clif_skill_warppoint_pre;
struct HPMHookPoint *HP_clif_skill_warppoint_post;
- struct HPMHookPoint *HP_clif_skillcasting_pre;
- struct HPMHookPoint *HP_clif_skillcasting_post;
+ struct HPMHookPoint *HP_clif_useskill_pre;
+ struct HPMHookPoint *HP_clif_useskill_post;
struct HPMHookPoint *HP_clif_produce_effect_pre;
struct HPMHookPoint *HP_clif_produce_effect_post;
struct HPMHookPoint *HP_clif_devotion_pre;
@@ -984,8 +994,10 @@ struct {
struct HPMHookPoint *HP_clif_message_post;
struct HPMHookPoint *HP_clif_messageln_pre;
struct HPMHookPoint *HP_clif_messageln_post;
- struct HPMHookPoint *HP_clif_process_message_pre;
- struct HPMHookPoint *HP_clif_process_message_post;
+ struct HPMHookPoint *HP_clif_process_chat_message_pre;
+ struct HPMHookPoint *HP_clif_process_chat_message_post;
+ struct HPMHookPoint *HP_clif_process_whisper_message_pre;
+ struct HPMHookPoint *HP_clif_process_whisper_message_post;
struct HPMHookPoint *HP_clif_wisexin_pre;
struct HPMHookPoint *HP_clif_wisexin_post;
struct HPMHookPoint *HP_clif_wisall_pre;
@@ -1388,6 +1400,12 @@ struct {
struct HPMHookPoint *HP_clif_comparemergeitem_post;
struct HPMHookPoint *HP_clif_ackmergeitems_pre;
struct HPMHookPoint *HP_clif_ackmergeitems_post;
+ struct HPMHookPoint *HP_clif_isdisguised_pre;
+ struct HPMHookPoint *HP_clif_isdisguised_post;
+ struct HPMHookPoint *HP_clif_navigate_to_pre;
+ struct HPMHookPoint *HP_clif_navigate_to_post;
+ struct HPMHookPoint *HP_clif_bl_type_pre;
+ struct HPMHookPoint *HP_clif_bl_type_post;
struct HPMHookPoint *HP_clif_pWantToConnection_pre;
struct HPMHookPoint *HP_clif_pWantToConnection_post;
struct HPMHookPoint *HP_clif_pLoadEndAck_pre;
@@ -1842,8 +1860,8 @@ struct {
struct HPMHookPoint *HP_clif_pNPCMarketClosed_post;
struct HPMHookPoint *HP_clif_pNPCMarketPurchase_pre;
struct HPMHookPoint *HP_clif_pNPCMarketPurchase_post;
- struct HPMHookPoint *HP_clif_add_random_options_pre;
- struct HPMHookPoint *HP_clif_add_random_options_post;
+ struct HPMHookPoint *HP_clif_add_item_options_pre;
+ struct HPMHookPoint *HP_clif_add_item_options_post;
struct HPMHookPoint *HP_clif_pHotkeyRowShift_pre;
struct HPMHookPoint *HP_clif_pHotkeyRowShift_post;
struct HPMHookPoint *HP_clif_dressroom_open_pre;
@@ -1854,6 +1872,8 @@ struct {
struct HPMHookPoint *HP_clif_selectcart_post;
struct HPMHookPoint *HP_clif_pSelectCart_pre;
struct HPMHookPoint *HP_clif_pSelectCart_post;
+ struct HPMHookPoint *HP_clif_get_bl_name_pre;
+ struct HPMHookPoint *HP_clif_get_bl_name_post;
struct HPMHookPoint *HP_cmdline_init_pre;
struct HPMHookPoint *HP_cmdline_init_post;
struct HPMHookPoint *HP_cmdline_final_pre;
@@ -1914,6 +1934,10 @@ struct {
struct HPMHookPoint *HP_DB_init_post;
struct HPMHookPoint *HP_DB_final_pre;
struct HPMHookPoint *HP_DB_final_post;
+ struct HPMHookPoint *HP_des_decrypt_block_pre;
+ struct HPMHookPoint *HP_des_decrypt_block_post;
+ struct HPMHookPoint *HP_des_decrypt_pre;
+ struct HPMHookPoint *HP_des_decrypt_post;
struct HPMHookPoint *HP_duel_create_pre;
struct HPMHookPoint *HP_duel_create_post;
struct HPMHookPoint *HP_duel_invite_pre;
@@ -1996,6 +2020,20 @@ struct {
struct HPMHookPoint *HP_elemental_ai_timer_post;
struct HPMHookPoint *HP_elemental_read_db_pre;
struct HPMHookPoint *HP_elemental_read_db_post;
+ struct HPMHookPoint *HP_grfio_init_pre;
+ struct HPMHookPoint *HP_grfio_init_post;
+ struct HPMHookPoint *HP_grfio_final_pre;
+ struct HPMHookPoint *HP_grfio_final_post;
+ struct HPMHookPoint *HP_grfio_reads_pre;
+ struct HPMHookPoint *HP_grfio_reads_post;
+ struct HPMHookPoint *HP_grfio_find_file_pre;
+ struct HPMHookPoint *HP_grfio_find_file_post;
+ struct HPMHookPoint *HP_grfio_crc32_pre;
+ struct HPMHookPoint *HP_grfio_crc32_post;
+ struct HPMHookPoint *HP_grfio_decode_zip_pre;
+ struct HPMHookPoint *HP_grfio_decode_zip_post;
+ struct HPMHookPoint *HP_grfio_encode_zip_pre;
+ struct HPMHookPoint *HP_grfio_encode_zip_post;
struct HPMHookPoint *HP_guild_init_pre;
struct HPMHookPoint *HP_guild_init_post;
struct HPMHookPoint *HP_guild_final_pre;
@@ -2348,6 +2386,10 @@ struct {
struct HPMHookPoint *HP_intif_saveregistry_post;
struct HPMHookPoint *HP_intif_request_registry_pre;
struct HPMHookPoint *HP_intif_request_registry_post;
+ struct HPMHookPoint *HP_intif_request_account_storage_pre;
+ struct HPMHookPoint *HP_intif_request_account_storage_post;
+ struct HPMHookPoint *HP_intif_send_account_storage_pre;
+ struct HPMHookPoint *HP_intif_send_account_storage_post;
struct HPMHookPoint *HP_intif_request_guild_storage_pre;
struct HPMHookPoint *HP_intif_request_guild_storage_post;
struct HPMHookPoint *HP_intif_send_guild_storage_pre;
@@ -2478,10 +2520,14 @@ struct {
struct HPMHookPoint *HP_intif_pWisToGM_post;
struct HPMHookPoint *HP_intif_pRegisters_pre;
struct HPMHookPoint *HP_intif_pRegisters_post;
+ struct HPMHookPoint *HP_intif_pAccountStorage_pre;
+ struct HPMHookPoint *HP_intif_pAccountStorage_post;
struct HPMHookPoint *HP_intif_pChangeNameOk_pre;
struct HPMHookPoint *HP_intif_pChangeNameOk_post;
struct HPMHookPoint *HP_intif_pMessageToFD_pre;
struct HPMHookPoint *HP_intif_pMessageToFD_post;
+ struct HPMHookPoint *HP_intif_pAccountStorageSaveAck_pre;
+ struct HPMHookPoint *HP_intif_pAccountStorageSaveAck_post;
struct HPMHookPoint *HP_intif_pLoadGuildStorage_pre;
struct HPMHookPoint *HP_intif_pLoadGuildStorage_post;
struct HPMHookPoint *HP_intif_pSaveGuildStorage_pre;
@@ -2610,6 +2656,10 @@ struct {
struct HPMHookPoint *HP_ircbot_identify_timer_post;
struct HPMHookPoint *HP_ircbot_join_timer_pre;
struct HPMHookPoint *HP_ircbot_join_timer_post;
+ struct HPMHookPoint *HP_ircbot_queue_timer_pre;
+ struct HPMHookPoint *HP_ircbot_queue_timer_post;
+ struct HPMHookPoint *HP_ircbot_queue_pre;
+ struct HPMHookPoint *HP_ircbot_queue_post;
struct HPMHookPoint *HP_ircbot_send_pre;
struct HPMHookPoint *HP_ircbot_send_post;
struct HPMHookPoint *HP_ircbot_relay_pre;
@@ -2618,6 +2668,8 @@ struct {
struct HPMHookPoint *HP_ircbot_pong_post;
struct HPMHookPoint *HP_ircbot_privmsg_pre;
struct HPMHookPoint *HP_ircbot_privmsg_post;
+ struct HPMHookPoint *HP_ircbot_privmsg_ctcp_pre;
+ struct HPMHookPoint *HP_ircbot_privmsg_ctcp_post;
struct HPMHookPoint *HP_ircbot_userjoin_pre;
struct HPMHookPoint *HP_ircbot_userjoin_post;
struct HPMHookPoint *HP_ircbot_userleave_pre;
@@ -2638,6 +2690,8 @@ struct {
struct HPMHookPoint *HP_itemdb_read_chains_post;
struct HPMHookPoint *HP_itemdb_read_packages_pre;
struct HPMHookPoint *HP_itemdb_read_packages_post;
+ struct HPMHookPoint *HP_itemdb_read_options_pre;
+ struct HPMHookPoint *HP_itemdb_read_options_post;
struct HPMHookPoint *HP_itemdb_write_cached_packages_pre;
struct HPMHookPoint *HP_itemdb_write_cached_packages_post;
struct HPMHookPoint *HP_itemdb_read_cached_packages_pre;
@@ -2654,6 +2708,8 @@ struct {
struct HPMHookPoint *HP_itemdb_search_post;
struct HPMHookPoint *HP_itemdb_exists_pre;
struct HPMHookPoint *HP_itemdb_exists_post;
+ struct HPMHookPoint *HP_itemdb_option_exists_pre;
+ struct HPMHookPoint *HP_itemdb_option_exists_post;
struct HPMHookPoint *HP_itemdb_in_group_pre;
struct HPMHookPoint *HP_itemdb_in_group_post;
struct HPMHookPoint *HP_itemdb_group_item_pre;
@@ -2670,6 +2726,8 @@ struct {
struct HPMHookPoint *HP_itemdb_searchrandomid_post;
struct HPMHookPoint *HP_itemdb_typename_pre;
struct HPMHookPoint *HP_itemdb_typename_post;
+ struct HPMHookPoint *HP_itemdb_jobmask2mapid_pre;
+ struct HPMHookPoint *HP_itemdb_jobmask2mapid_post;
struct HPMHookPoint *HP_itemdb_jobid2mapid_pre;
struct HPMHookPoint *HP_itemdb_jobid2mapid_post;
struct HPMHookPoint *HP_itemdb_create_dummy_data_pre;
@@ -2716,8 +2774,12 @@ struct {
struct HPMHookPoint *HP_itemdb_gendercheck_post;
struct HPMHookPoint *HP_itemdb_validate_entry_pre;
struct HPMHookPoint *HP_itemdb_validate_entry_post;
+ struct HPMHookPoint *HP_itemdb_readdb_options_additional_fields_pre;
+ struct HPMHookPoint *HP_itemdb_readdb_options_additional_fields_post;
struct HPMHookPoint *HP_itemdb_readdb_additional_fields_pre;
struct HPMHookPoint *HP_itemdb_readdb_additional_fields_post;
+ struct HPMHookPoint *HP_itemdb_readdb_job_sub_pre;
+ struct HPMHookPoint *HP_itemdb_readdb_job_sub_post;
struct HPMHookPoint *HP_itemdb_readdb_libconfig_sub_pre;
struct HPMHookPoint *HP_itemdb_readdb_libconfig_sub_post;
struct HPMHookPoint *HP_itemdb_readdb_libconfig_pre;
@@ -2730,6 +2792,8 @@ struct {
struct HPMHookPoint *HP_itemdb_destroy_item_data_post;
struct HPMHookPoint *HP_itemdb_final_sub_pre;
struct HPMHookPoint *HP_itemdb_final_sub_post;
+ struct HPMHookPoint *HP_itemdb_options_final_sub_pre;
+ struct HPMHookPoint *HP_itemdb_options_final_sub_post;
struct HPMHookPoint *HP_itemdb_clear_pre;
struct HPMHookPoint *HP_itemdb_clear_post;
struct HPMHookPoint *HP_itemdb_id2combo_pre;
@@ -2742,10 +2806,10 @@ struct {
struct HPMHookPoint *HP_libconfig_read_post;
struct HPMHookPoint *HP_libconfig_write_pre;
struct HPMHookPoint *HP_libconfig_write_post;
- struct HPMHookPoint *HP_libconfig_set_auto_convert_pre;
- struct HPMHookPoint *HP_libconfig_set_auto_convert_post;
- struct HPMHookPoint *HP_libconfig_get_auto_convert_pre;
- struct HPMHookPoint *HP_libconfig_get_auto_convert_post;
+ struct HPMHookPoint *HP_libconfig_set_options_pre;
+ struct HPMHookPoint *HP_libconfig_set_options_post;
+ struct HPMHookPoint *HP_libconfig_get_options_pre;
+ struct HPMHookPoint *HP_libconfig_get_options_post;
struct HPMHookPoint *HP_libconfig_read_string_pre;
struct HPMHookPoint *HP_libconfig_read_string_post;
struct HPMHookPoint *HP_libconfig_read_file_src_pre;
@@ -2770,6 +2834,8 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_get_bool_post;
struct HPMHookPoint *HP_libconfig_setting_get_string_pre;
struct HPMHookPoint *HP_libconfig_setting_get_string_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_post;
struct HPMHookPoint *HP_libconfig_setting_lookup_int_pre;
struct HPMHookPoint *HP_libconfig_setting_lookup_int_post;
struct HPMHookPoint *HP_libconfig_setting_lookup_int64_pre;
@@ -2832,8 +2898,6 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_set_hook_post;
struct HPMHookPoint *HP_libconfig_lookup_pre;
struct HPMHookPoint *HP_libconfig_lookup_post;
- struct HPMHookPoint *HP_libconfig_lookup_from_pre;
- struct HPMHookPoint *HP_libconfig_lookup_from_post;
struct HPMHookPoint *HP_libconfig_lookup_int_pre;
struct HPMHookPoint *HP_libconfig_lookup_int_post;
struct HPMHookPoint *HP_libconfig_lookup_int64_pre;
@@ -2844,8 +2908,8 @@ struct {
struct HPMHookPoint *HP_libconfig_lookup_bool_post;
struct HPMHookPoint *HP_libconfig_lookup_string_pre;
struct HPMHookPoint *HP_libconfig_lookup_string_post;
- struct HPMHookPoint *HP_libconfig_read_file_pre;
- struct HPMHookPoint *HP_libconfig_read_file_post;
+ struct HPMHookPoint *HP_libconfig_load_file_pre;
+ struct HPMHookPoint *HP_libconfig_load_file_post;
struct HPMHookPoint *HP_libconfig_setting_copy_simple_pre;
struct HPMHookPoint *HP_libconfig_setting_copy_simple_post;
struct HPMHookPoint *HP_libconfig_setting_copy_elem_pre;
@@ -2854,6 +2918,26 @@ struct {
struct HPMHookPoint *HP_libconfig_setting_copy_aggregate_post;
struct HPMHookPoint *HP_libconfig_setting_copy_pre;
struct HPMHookPoint *HP_libconfig_setting_copy_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_bool_real_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_bool_real_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint32_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint32_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_uint16_post;
+ struct HPMHookPoint *HP_libconfig_setting_get_int16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_get_int16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_bool_real_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_bool_real_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint32_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint32_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_uint16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_int16_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_int16_post;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_mutable_string_pre;
+ struct HPMHookPoint *HP_libconfig_setting_lookup_mutable_string_post;
+ struct HPMHookPoint *HP_libconfig_lookup_mutable_string_pre;
+ struct HPMHookPoint *HP_libconfig_lookup_mutable_string_post;
struct HPMHookPoint *HP_logs_pick_pc_pre;
struct HPMHookPoint *HP_logs_pick_pc_post;
struct HPMHookPoint *HP_logs_pick_mob_pre;
@@ -2916,32 +3000,6 @@ struct {
struct HPMHookPoint *HP_mail_deliveryfail_post;
struct HPMHookPoint *HP_mail_invalid_operation_pre;
struct HPMHookPoint *HP_mail_invalid_operation_post;
- struct HPMHookPoint *HP_iMalloc_init_pre;
- struct HPMHookPoint *HP_iMalloc_init_post;
- struct HPMHookPoint *HP_iMalloc_final_pre;
- struct HPMHookPoint *HP_iMalloc_final_post;
- struct HPMHookPoint *HP_iMalloc_malloc_pre;
- struct HPMHookPoint *HP_iMalloc_malloc_post;
- struct HPMHookPoint *HP_iMalloc_calloc_pre;
- struct HPMHookPoint *HP_iMalloc_calloc_post;
- struct HPMHookPoint *HP_iMalloc_realloc_pre;
- struct HPMHookPoint *HP_iMalloc_realloc_post;
- struct HPMHookPoint *HP_iMalloc_reallocz_pre;
- struct HPMHookPoint *HP_iMalloc_reallocz_post;
- struct HPMHookPoint *HP_iMalloc_astrdup_pre;
- struct HPMHookPoint *HP_iMalloc_astrdup_post;
- struct HPMHookPoint *HP_iMalloc_free_pre;
- struct HPMHookPoint *HP_iMalloc_free_post;
- struct HPMHookPoint *HP_iMalloc_memory_check_pre;
- struct HPMHookPoint *HP_iMalloc_memory_check_post;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_pre;
- struct HPMHookPoint *HP_iMalloc_verify_ptr_post;
- struct HPMHookPoint *HP_iMalloc_usage_pre;
- struct HPMHookPoint *HP_iMalloc_usage_post;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_pre;
- struct HPMHookPoint *HP_iMalloc_post_shutdown_post;
- struct HPMHookPoint *HP_iMalloc_init_messages_pre;
- struct HPMHookPoint *HP_iMalloc_init_messages_post;
struct HPMHookPoint *HP_map_zone_init_pre;
struct HPMHookPoint *HP_map_zone_init_post;
struct HPMHookPoint *HP_map_zone_remove_pre;
@@ -3168,12 +3226,14 @@ struct {
struct HPMHookPoint *HP_map_readallmaps_post;
struct HPMHookPoint *HP_map_config_read_pre;
struct HPMHookPoint *HP_map_config_read_post;
- struct HPMHookPoint *HP_map_config_read_sub_pre;
- struct HPMHookPoint *HP_map_config_read_sub_post;
- struct HPMHookPoint *HP_map_reloadnpc_sub_pre;
- struct HPMHookPoint *HP_map_reloadnpc_sub_post;
+ struct HPMHookPoint *HP_map_read_npclist_pre;
+ struct HPMHookPoint *HP_map_read_npclist_post;
struct HPMHookPoint *HP_map_inter_config_read_pre;
struct HPMHookPoint *HP_map_inter_config_read_post;
+ struct HPMHookPoint *HP_map_inter_config_read_database_names_pre;
+ struct HPMHookPoint *HP_map_inter_config_read_database_names_post;
+ struct HPMHookPoint *HP_map_inter_config_read_connection_pre;
+ struct HPMHookPoint *HP_map_inter_config_read_connection_post;
struct HPMHookPoint *HP_map_sql_init_pre;
struct HPMHookPoint *HP_map_sql_init_post;
struct HPMHookPoint *HP_map_sql_close_pre;
@@ -3264,6 +3324,12 @@ struct {
struct HPMHookPoint *HP_mapreg_reload_post;
struct HPMHookPoint *HP_mapreg_config_read_pre;
struct HPMHookPoint *HP_mapreg_config_read_post;
+ struct HPMHookPoint *HP_md5_string_pre;
+ struct HPMHookPoint *HP_md5_string_post;
+ struct HPMHookPoint *HP_md5_binary_pre;
+ struct HPMHookPoint *HP_md5_binary_post;
+ struct HPMHookPoint *HP_md5_salt_pre;
+ struct HPMHookPoint *HP_md5_salt_post;
struct HPMHookPoint *HP_mercenary_init_pre;
struct HPMHookPoint *HP_mercenary_init_post;
struct HPMHookPoint *HP_mercenary_class_pre;
@@ -3520,6 +3586,26 @@ struct {
struct HPMHookPoint *HP_mob_clear_spawninfo_post;
struct HPMHookPoint *HP_mob_destroy_mob_db_pre;
struct HPMHookPoint *HP_mob_destroy_mob_db_post;
+ struct HPMHookPoint *HP_mutex_create_pre;
+ struct HPMHookPoint *HP_mutex_create_post;
+ struct HPMHookPoint *HP_mutex_destroy_pre;
+ struct HPMHookPoint *HP_mutex_destroy_post;
+ struct HPMHookPoint *HP_mutex_lock_pre;
+ struct HPMHookPoint *HP_mutex_lock_post;
+ struct HPMHookPoint *HP_mutex_trylock_pre;
+ struct HPMHookPoint *HP_mutex_trylock_post;
+ struct HPMHookPoint *HP_mutex_unlock_pre;
+ struct HPMHookPoint *HP_mutex_unlock_post;
+ struct HPMHookPoint *HP_mutex_cond_create_pre;
+ struct HPMHookPoint *HP_mutex_cond_create_post;
+ struct HPMHookPoint *HP_mutex_cond_destroy_pre;
+ struct HPMHookPoint *HP_mutex_cond_destroy_post;
+ struct HPMHookPoint *HP_mutex_cond_wait_pre;
+ struct HPMHookPoint *HP_mutex_cond_wait_post;
+ struct HPMHookPoint *HP_mutex_cond_signal_pre;
+ struct HPMHookPoint *HP_mutex_cond_signal_post;
+ struct HPMHookPoint *HP_mutex_cond_broadcast_pre;
+ struct HPMHookPoint *HP_mutex_cond_broadcast_post;
struct HPMHookPoint *HP_npc_chat_sub_pre;
struct HPMHookPoint *HP_npc_chat_sub_post;
struct HPMHookPoint *HP_npc_chat_finalize_pre;
@@ -4196,8 +4282,10 @@ struct {
struct HPMHookPoint *HP_pc_getmaxspiritball_post;
struct HPMHookPoint *HP_pc_addfame_pre;
struct HPMHookPoint *HP_pc_addfame_post;
- struct HPMHookPoint *HP_pc_famerank_pre;
- struct HPMHookPoint *HP_pc_famerank_post;
+ struct HPMHookPoint *HP_pc_fame_rank_pre;
+ struct HPMHookPoint *HP_pc_fame_rank_post;
+ struct HPMHookPoint *HP_pc_famelist_type_pre;
+ struct HPMHookPoint *HP_pc_famelist_type_post;
struct HPMHookPoint *HP_pc_set_hate_mob_pre;
struct HPMHookPoint *HP_pc_set_hate_mob_post;
struct HPMHookPoint *HP_pc_readdb_pre;
@@ -4328,6 +4416,12 @@ struct {
struct HPMHookPoint *HP_pc_update_idle_time_post;
struct HPMHookPoint *HP_pc_have_magnifier_pre;
struct HPMHookPoint *HP_pc_have_magnifier_post;
+ struct HPMHookPoint *HP_pc_process_chat_message_pre;
+ struct HPMHookPoint *HP_pc_process_chat_message_post;
+ struct HPMHookPoint *HP_pc_check_supernovice_call_pre;
+ struct HPMHookPoint *HP_pc_check_supernovice_call_post;
+ struct HPMHookPoint *HP_pc_check_basicskill_pre;
+ struct HPMHookPoint *HP_pc_check_basicskill_post;
struct HPMHookPoint *HP_libpcre_compile_pre;
struct HPMHookPoint *HP_libpcre_compile_post;
struct HPMHookPoint *HP_libpcre_study_pre;
@@ -4450,6 +4544,22 @@ struct {
struct HPMHookPoint *HP_quest_read_db_post;
struct HPMHookPoint *HP_quest_read_db_sub_pre;
struct HPMHookPoint *HP_quest_read_db_sub_post;
+ struct HPMHookPoint *HP_rnd_init_pre;
+ struct HPMHookPoint *HP_rnd_init_post;
+ struct HPMHookPoint *HP_rnd_final_pre;
+ struct HPMHookPoint *HP_rnd_final_post;
+ struct HPMHookPoint *HP_rnd_seed_pre;
+ struct HPMHookPoint *HP_rnd_seed_post;
+ struct HPMHookPoint *HP_rnd_random_pre;
+ struct HPMHookPoint *HP_rnd_random_post;
+ struct HPMHookPoint *HP_rnd_roll_pre;
+ struct HPMHookPoint *HP_rnd_roll_post;
+ struct HPMHookPoint *HP_rnd_value_pre;
+ struct HPMHookPoint *HP_rnd_value_post;
+ struct HPMHookPoint *HP_rnd_uniform_pre;
+ struct HPMHookPoint *HP_rnd_uniform_post;
+ struct HPMHookPoint *HP_rnd_uniform53_pre;
+ struct HPMHookPoint *HP_rnd_uniform53_post;
struct HPMHookPoint *HP_script_init_pre;
struct HPMHookPoint *HP_script_init_post;
struct HPMHookPoint *HP_script_final_pre;
@@ -4492,6 +4602,8 @@ struct {
struct HPMHookPoint *HP_script_get_val_post;
struct HPMHookPoint *HP_script_get_val_ref_str_pre;
struct HPMHookPoint *HP_script_get_val_ref_str_post;
+ struct HPMHookPoint *HP_script_get_val_pc_ref_str_pre;
+ struct HPMHookPoint *HP_script_get_val_pc_ref_str_post;
struct HPMHookPoint *HP_script_get_val_scope_str_pre;
struct HPMHookPoint *HP_script_get_val_scope_str_post;
struct HPMHookPoint *HP_script_get_val_npc_str_pre;
@@ -4500,6 +4612,8 @@ struct {
struct HPMHookPoint *HP_script_get_val_instance_str_post;
struct HPMHookPoint *HP_script_get_val_ref_num_pre;
struct HPMHookPoint *HP_script_get_val_ref_num_post;
+ struct HPMHookPoint *HP_script_get_val_pc_ref_num_pre;
+ struct HPMHookPoint *HP_script_get_val_pc_ref_num_post;
struct HPMHookPoint *HP_script_get_val_scope_num_pre;
struct HPMHookPoint *HP_script_get_val_scope_num_post;
struct HPMHookPoint *HP_script_get_val_npc_num_pre;
@@ -4510,6 +4624,8 @@ struct {
struct HPMHookPoint *HP_script_get_val2_post;
struct HPMHookPoint *HP_script_push_str_pre;
struct HPMHookPoint *HP_script_push_str_post;
+ struct HPMHookPoint *HP_script_push_conststr_pre;
+ struct HPMHookPoint *HP_script_push_conststr_post;
struct HPMHookPoint *HP_script_push_copy_pre;
struct HPMHookPoint *HP_script_push_copy_post;
struct HPMHookPoint *HP_script_pop_stack_pre;
@@ -4624,6 +4740,16 @@ struct {
struct HPMHookPoint *HP_script_parse_variable_post;
struct HPMHookPoint *HP_script_parse_simpleexpr_pre;
struct HPMHookPoint *HP_script_parse_simpleexpr_post;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_paren_pre;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_paren_post;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_number_pre;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_number_post;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_string_pre;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_string_post;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_name_pre;
+ struct HPMHookPoint *HP_script_parse_simpleexpr_name_post;
+ struct HPMHookPoint *HP_script_add_translatable_string_pre;
+ struct HPMHookPoint *HP_script_add_translatable_string_post;
struct HPMHookPoint *HP_script_parse_expr_pre;
struct HPMHookPoint *HP_script_parse_expr_post;
struct HPMHookPoint *HP_script_parse_line_pre;
@@ -4632,6 +4758,8 @@ struct {
struct HPMHookPoint *HP_script_read_constdb_post;
struct HPMHookPoint *HP_script_constdb_comment_pre;
struct HPMHookPoint *HP_script_constdb_comment_post;
+ struct HPMHookPoint *HP_script_load_parameters_pre;
+ struct HPMHookPoint *HP_script_load_parameters_post;
struct HPMHookPoint *HP_script_print_line_pre;
struct HPMHookPoint *HP_script_print_line_post;
struct HPMHookPoint *HP_script_errorwarning_sub_pre;
@@ -4640,6 +4768,8 @@ struct {
struct HPMHookPoint *HP_script_set_reg_post;
struct HPMHookPoint *HP_script_set_reg_ref_str_pre;
struct HPMHookPoint *HP_script_set_reg_ref_str_post;
+ struct HPMHookPoint *HP_script_set_reg_pc_ref_str_pre;
+ struct HPMHookPoint *HP_script_set_reg_pc_ref_str_post;
struct HPMHookPoint *HP_script_set_reg_scope_str_pre;
struct HPMHookPoint *HP_script_set_reg_scope_str_post;
struct HPMHookPoint *HP_script_set_reg_npc_str_pre;
@@ -4648,6 +4778,8 @@ struct {
struct HPMHookPoint *HP_script_set_reg_instance_str_post;
struct HPMHookPoint *HP_script_set_reg_ref_num_pre;
struct HPMHookPoint *HP_script_set_reg_ref_num_post;
+ struct HPMHookPoint *HP_script_set_reg_pc_ref_num_pre;
+ struct HPMHookPoint *HP_script_set_reg_pc_ref_num_post;
struct HPMHookPoint *HP_script_set_reg_scope_num_pre;
struct HPMHookPoint *HP_script_set_reg_scope_num_post;
struct HPMHookPoint *HP_script_set_reg_npc_num_pre;
@@ -4764,6 +4896,8 @@ struct {
struct HPMHookPoint *HP_script_string_dup_post;
struct HPMHookPoint *HP_script_load_translations_pre;
struct HPMHookPoint *HP_script_load_translations_post;
+ struct HPMHookPoint *HP_script_load_translation_addstring_pre;
+ struct HPMHookPoint *HP_script_load_translation_addstring_post;
struct HPMHookPoint *HP_script_load_translation_pre;
struct HPMHookPoint *HP_script_load_translation_post;
struct HPMHookPoint *HP_script_translation_db_destroyer_pre;
@@ -5008,8 +5142,12 @@ struct {
struct HPMHookPoint *HP_skill_enchant_elemental_end_post;
struct HPMHookPoint *HP_skill_not_ok_pre;
struct HPMHookPoint *HP_skill_not_ok_post;
+ struct HPMHookPoint *HP_skill_not_ok_unknown_pre;
+ struct HPMHookPoint *HP_skill_not_ok_unknown_post;
struct HPMHookPoint *HP_skill_not_ok_hom_pre;
struct HPMHookPoint *HP_skill_not_ok_hom_post;
+ struct HPMHookPoint *HP_skill_not_ok_hom_unknown_pre;
+ struct HPMHookPoint *HP_skill_not_ok_hom_unknown_post;
struct HPMHookPoint *HP_skill_not_ok_mercenary_pre;
struct HPMHookPoint *HP_skill_not_ok_mercenary_post;
struct HPMHookPoint *HP_skill_chastle_mob_changetarget_pre;
@@ -5020,6 +5158,8 @@ struct {
struct HPMHookPoint *HP_skill_produce_mix_post;
struct HPMHookPoint *HP_skill_arrow_create_pre;
struct HPMHookPoint *HP_skill_arrow_create_post;
+ struct HPMHookPoint *HP_skill_castend_type_pre;
+ struct HPMHookPoint *HP_skill_castend_type_post;
struct HPMHookPoint *HP_skill_castend_nodamage_id_pre;
struct HPMHookPoint *HP_skill_castend_nodamage_id_post;
struct HPMHookPoint *HP_skill_castend_damage_id_pre;
@@ -5104,6 +5244,8 @@ struct {
struct HPMHookPoint *HP_skill_unitsetmapcell_post;
struct HPMHookPoint *HP_skill_unit_onplace_timer_pre;
struct HPMHookPoint *HP_skill_unit_onplace_timer_post;
+ struct HPMHookPoint *HP_skill_unit_onplace_timer_unknown_pre;
+ struct HPMHookPoint *HP_skill_unit_onplace_timer_unknown_post;
struct HPMHookPoint *HP_skill_unit_effect_pre;
struct HPMHookPoint *HP_skill_unit_effect_post;
struct HPMHookPoint *HP_skill_unit_timer_sub_onplace_pre;
@@ -5124,16 +5266,50 @@ struct {
struct HPMHookPoint *HP_skill_unit_timer_sub_post;
struct HPMHookPoint *HP_skill_init_unit_layout_pre;
struct HPMHookPoint *HP_skill_init_unit_layout_post;
- struct HPMHookPoint *HP_skill_parse_row_skilldb_pre;
- struct HPMHookPoint *HP_skill_parse_row_skilldb_post;
- struct HPMHookPoint *HP_skill_parse_row_requiredb_pre;
- struct HPMHookPoint *HP_skill_parse_row_requiredb_post;
- struct HPMHookPoint *HP_skill_parse_row_castdb_pre;
- struct HPMHookPoint *HP_skill_parse_row_castdb_post;
- struct HPMHookPoint *HP_skill_parse_row_castnodexdb_pre;
- struct HPMHookPoint *HP_skill_parse_row_castnodexdb_post;
- struct HPMHookPoint *HP_skill_parse_row_unitdb_pre;
- struct HPMHookPoint *HP_skill_parse_row_unitdb_post;
+ struct HPMHookPoint *HP_skill_init_unit_layout_unknown_pre;
+ struct HPMHookPoint *HP_skill_init_unit_layout_unknown_post;
+ struct HPMHookPoint *HP_skill_validate_hittype_pre;
+ struct HPMHookPoint *HP_skill_validate_hittype_post;
+ struct HPMHookPoint *HP_skill_validate_skilltype_pre;
+ struct HPMHookPoint *HP_skill_validate_skilltype_post;
+ struct HPMHookPoint *HP_skill_validate_attacktype_pre;
+ struct HPMHookPoint *HP_skill_validate_attacktype_post;
+ struct HPMHookPoint *HP_skill_validate_element_pre;
+ struct HPMHookPoint *HP_skill_validate_element_post;
+ struct HPMHookPoint *HP_skill_validate_skillinfo_pre;
+ struct HPMHookPoint *HP_skill_validate_skillinfo_post;
+ struct HPMHookPoint *HP_skill_validate_damagetype_pre;
+ struct HPMHookPoint *HP_skill_validate_damagetype_post;
+ struct HPMHookPoint *HP_skill_validate_castnodex_pre;
+ struct HPMHookPoint *HP_skill_validate_castnodex_post;
+ struct HPMHookPoint *HP_skill_validate_weapontype_pre;
+ struct HPMHookPoint *HP_skill_validate_weapontype_post;
+ struct HPMHookPoint *HP_skill_validate_ammotype_pre;
+ struct HPMHookPoint *HP_skill_validate_ammotype_post;
+ struct HPMHookPoint *HP_skill_validate_state_pre;
+ struct HPMHookPoint *HP_skill_validate_state_post;
+ struct HPMHookPoint *HP_skill_validate_item_requirements_pre;
+ struct HPMHookPoint *HP_skill_validate_item_requirements_post;
+ struct HPMHookPoint *HP_skill_validate_unit_target_pre;
+ struct HPMHookPoint *HP_skill_validate_unit_target_post;
+ struct HPMHookPoint *HP_skill_validate_unit_flag_pre;
+ struct HPMHookPoint *HP_skill_validate_unit_flag_post;
+ struct HPMHookPoint *HP_skill_validate_additional_fields_pre;
+ struct HPMHookPoint *HP_skill_validate_additional_fields_post;
+ struct HPMHookPoint *HP_skill_validate_skilldb_pre;
+ struct HPMHookPoint *HP_skill_validate_skilldb_post;
+ struct HPMHookPoint *HP_skill_validate_weapontype_sub_pre;
+ struct HPMHookPoint *HP_skill_validate_weapontype_sub_post;
+ struct HPMHookPoint *HP_skill_validate_ammotype_sub_pre;
+ struct HPMHookPoint *HP_skill_validate_ammotype_sub_post;
+ struct HPMHookPoint *HP_skill_validate_unit_flag_sub_pre;
+ struct HPMHookPoint *HP_skill_validate_unit_flag_sub_post;
+ struct HPMHookPoint *HP_skill_read_skilldb_pre;
+ struct HPMHookPoint *HP_skill_read_skilldb_post;
+ struct HPMHookPoint *HP_skill_config_set_level_pre;
+ struct HPMHookPoint *HP_skill_config_set_level_post;
+ struct HPMHookPoint *HP_skill_level_set_value_pre;
+ struct HPMHookPoint *HP_skill_level_set_value_post;
struct HPMHookPoint *HP_skill_parse_row_producedb_pre;
struct HPMHookPoint *HP_skill_parse_row_producedb_post;
struct HPMHookPoint *HP_skill_parse_row_createarrowdb_pre;
@@ -5246,6 +5422,12 @@ struct {
struct HPMHookPoint *HP_skill_get_requirement_item_unknown_post;
struct HPMHookPoint *HP_skill_get_requirement_unknown_pre;
struct HPMHookPoint *HP_skill_get_requirement_unknown_post;
+ struct HPMHookPoint *HP_skill_splash_target_pre;
+ struct HPMHookPoint *HP_skill_splash_target_post;
+ struct HPMHookPoint *HP_skill_check_npc_chaospanic_pre;
+ struct HPMHookPoint *HP_skill_check_npc_chaospanic_post;
+ struct HPMHookPoint *HP_skill_count_wos_pre;
+ struct HPMHookPoint *HP_skill_count_wos_post;
struct HPMHookPoint *HP_sockt_init_pre;
struct HPMHookPoint *HP_sockt_init_post;
struct HPMHookPoint *HP_sockt_final_pre;
@@ -5590,6 +5772,14 @@ struct {
struct HPMHookPoint *HP_status_read_job_db_post;
struct HPMHookPoint *HP_status_read_job_db_sub_pre;
struct HPMHookPoint *HP_status_read_job_db_sub_post;
+ struct HPMHookPoint *HP_status_set_sc_pre;
+ struct HPMHookPoint *HP_status_set_sc_post;
+ struct HPMHookPoint *HP_status_copy_pre;
+ struct HPMHookPoint *HP_status_copy_post;
+ struct HPMHookPoint *HP_status_base_matk_min_pre;
+ struct HPMHookPoint *HP_status_base_matk_min_post;
+ struct HPMHookPoint *HP_status_base_matk_max_pre;
+ struct HPMHookPoint *HP_status_base_matk_max_post;
struct HPMHookPoint *HP_storage_reconnect_pre;
struct HPMHookPoint *HP_storage_reconnect_post;
struct HPMHookPoint *HP_storage_delitem_pre;
@@ -5698,6 +5888,8 @@ struct {
struct HPMHookPoint *HP_sysinfo_compiler_post;
struct HPMHookPoint *HP_sysinfo_cflags_pre;
struct HPMHookPoint *HP_sysinfo_cflags_post;
+ struct HPMHookPoint *HP_sysinfo_time_pre;
+ struct HPMHookPoint *HP_sysinfo_time_post;
struct HPMHookPoint *HP_sysinfo_vcstype_pre;
struct HPMHookPoint *HP_sysinfo_vcstype_post;
struct HPMHookPoint *HP_sysinfo_vcstypeid_pre;
@@ -5714,6 +5906,28 @@ struct {
struct HPMHookPoint *HP_sysinfo_init_post;
struct HPMHookPoint *HP_sysinfo_final_pre;
struct HPMHookPoint *HP_sysinfo_final_post;
+ struct HPMHookPoint *HP_thread_init_pre;
+ struct HPMHookPoint *HP_thread_init_post;
+ struct HPMHookPoint *HP_thread_final_pre;
+ struct HPMHookPoint *HP_thread_final_post;
+ struct HPMHookPoint *HP_thread_create_pre;
+ struct HPMHookPoint *HP_thread_create_post;
+ struct HPMHookPoint *HP_thread_create_opt_pre;
+ struct HPMHookPoint *HP_thread_create_opt_post;
+ struct HPMHookPoint *HP_thread_destroy_pre;
+ struct HPMHookPoint *HP_thread_destroy_post;
+ struct HPMHookPoint *HP_thread_self_pre;
+ struct HPMHookPoint *HP_thread_self_post;
+ struct HPMHookPoint *HP_thread_get_tid_pre;
+ struct HPMHookPoint *HP_thread_get_tid_post;
+ struct HPMHookPoint *HP_thread_wait_pre;
+ struct HPMHookPoint *HP_thread_wait_post;
+ struct HPMHookPoint *HP_thread_prio_set_pre;
+ struct HPMHookPoint *HP_thread_prio_set_post;
+ struct HPMHookPoint *HP_thread_prio_get_pre;
+ struct HPMHookPoint *HP_thread_prio_get_post;
+ struct HPMHookPoint *HP_thread_yield_pre;
+ struct HPMHookPoint *HP_thread_yield_post;
struct HPMHookPoint *HP_timer_gettick_pre;
struct HPMHookPoint *HP_timer_gettick_post;
struct HPMHookPoint *HP_timer_gettick_nocache_pre;
@@ -5766,6 +5980,8 @@ struct {
struct HPMHookPoint *HP_unit_bl2ud_post;
struct HPMHookPoint *HP_unit_bl2ud2_pre;
struct HPMHookPoint *HP_unit_bl2ud2_post;
+ struct HPMHookPoint *HP_unit_init_ud_pre;
+ struct HPMHookPoint *HP_unit_init_ud_post;
struct HPMHookPoint *HP_unit_attack_timer_pre;
struct HPMHookPoint *HP_unit_attack_timer_post;
struct HPMHookPoint *HP_unit_walktoxy_timer_pre;
@@ -5957,12 +6173,16 @@ struct {
int HP_battle_calc_attack_post;
int HP_battle_calc_damage_pre;
int HP_battle_calc_damage_post;
+ int HP_battle_calc_pc_damage_pre;
+ int HP_battle_calc_pc_damage_post;
int HP_battle_calc_gvg_damage_pre;
int HP_battle_calc_gvg_damage_post;
int HP_battle_calc_bg_damage_pre;
int HP_battle_calc_bg_damage_post;
int HP_battle_weapon_attack_pre;
int HP_battle_weapon_attack_post;
+ int HP_battle_check_arrows_pre;
+ int HP_battle_check_arrows_post;
int HP_battle_calc_weapon_attack_pre;
int HP_battle_calc_weapon_attack_post;
int HP_battle_delay_damage_pre;
@@ -6041,6 +6261,8 @@ struct {
int HP_battle_config_read_post;
int HP_battle_config_set_defaults_pre;
int HP_battle_config_set_defaults_post;
+ int HP_battle_config_set_value_sub_pre;
+ int HP_battle_config_set_value_sub_post;
int HP_battle_config_set_value_pre;
int HP_battle_config_set_value_post;
int HP_battle_config_get_value_pre;
@@ -6681,6 +6903,8 @@ struct {
int HP_clif_skill_itemlistwindow_post;
int HP_clif_sc_load_pre;
int HP_clif_sc_load_post;
+ int HP_clif_sc_continue_pre;
+ int HP_clif_sc_continue_post;
int HP_clif_sc_end_pre;
int HP_clif_sc_end_post;
int HP_clif_initialstatus_pre;
@@ -6743,8 +6967,8 @@ struct {
int HP_clif_skill_estimation_post;
int HP_clif_skill_warppoint_pre;
int HP_clif_skill_warppoint_post;
- int HP_clif_skillcasting_pre;
- int HP_clif_skillcasting_post;
+ int HP_clif_useskill_pre;
+ int HP_clif_useskill_post;
int HP_clif_produce_effect_pre;
int HP_clif_produce_effect_post;
int HP_clif_devotion_pre;
@@ -6833,8 +7057,10 @@ struct {
int HP_clif_message_post;
int HP_clif_messageln_pre;
int HP_clif_messageln_post;
- int HP_clif_process_message_pre;
- int HP_clif_process_message_post;
+ int HP_clif_process_chat_message_pre;
+ int HP_clif_process_chat_message_post;
+ int HP_clif_process_whisper_message_pre;
+ int HP_clif_process_whisper_message_post;
int HP_clif_wisexin_pre;
int HP_clif_wisexin_post;
int HP_clif_wisall_pre;
@@ -7237,6 +7463,12 @@ struct {
int HP_clif_comparemergeitem_post;
int HP_clif_ackmergeitems_pre;
int HP_clif_ackmergeitems_post;
+ int HP_clif_isdisguised_pre;
+ int HP_clif_isdisguised_post;
+ int HP_clif_navigate_to_pre;
+ int HP_clif_navigate_to_post;
+ int HP_clif_bl_type_pre;
+ int HP_clif_bl_type_post;
int HP_clif_pWantToConnection_pre;
int HP_clif_pWantToConnection_post;
int HP_clif_pLoadEndAck_pre;
@@ -7691,8 +7923,8 @@ struct {
int HP_clif_pNPCMarketClosed_post;
int HP_clif_pNPCMarketPurchase_pre;
int HP_clif_pNPCMarketPurchase_post;
- int HP_clif_add_random_options_pre;
- int HP_clif_add_random_options_post;
+ int HP_clif_add_item_options_pre;
+ int HP_clif_add_item_options_post;
int HP_clif_pHotkeyRowShift_pre;
int HP_clif_pHotkeyRowShift_post;
int HP_clif_dressroom_open_pre;
@@ -7703,6 +7935,8 @@ struct {
int HP_clif_selectcart_post;
int HP_clif_pSelectCart_pre;
int HP_clif_pSelectCart_post;
+ int HP_clif_get_bl_name_pre;
+ int HP_clif_get_bl_name_post;
int HP_cmdline_init_pre;
int HP_cmdline_init_post;
int HP_cmdline_final_pre;
@@ -7763,6 +7997,10 @@ struct {
int HP_DB_init_post;
int HP_DB_final_pre;
int HP_DB_final_post;
+ int HP_des_decrypt_block_pre;
+ int HP_des_decrypt_block_post;
+ int HP_des_decrypt_pre;
+ int HP_des_decrypt_post;
int HP_duel_create_pre;
int HP_duel_create_post;
int HP_duel_invite_pre;
@@ -7845,6 +8083,20 @@ struct {
int HP_elemental_ai_timer_post;
int HP_elemental_read_db_pre;
int HP_elemental_read_db_post;
+ int HP_grfio_init_pre;
+ int HP_grfio_init_post;
+ int HP_grfio_final_pre;
+ int HP_grfio_final_post;
+ int HP_grfio_reads_pre;
+ int HP_grfio_reads_post;
+ int HP_grfio_find_file_pre;
+ int HP_grfio_find_file_post;
+ int HP_grfio_crc32_pre;
+ int HP_grfio_crc32_post;
+ int HP_grfio_decode_zip_pre;
+ int HP_grfio_decode_zip_post;
+ int HP_grfio_encode_zip_pre;
+ int HP_grfio_encode_zip_post;
int HP_guild_init_pre;
int HP_guild_init_post;
int HP_guild_final_pre;
@@ -8197,6 +8449,10 @@ struct {
int HP_intif_saveregistry_post;
int HP_intif_request_registry_pre;
int HP_intif_request_registry_post;
+ int HP_intif_request_account_storage_pre;
+ int HP_intif_request_account_storage_post;
+ int HP_intif_send_account_storage_pre;
+ int HP_intif_send_account_storage_post;
int HP_intif_request_guild_storage_pre;
int HP_intif_request_guild_storage_post;
int HP_intif_send_guild_storage_pre;
@@ -8327,10 +8583,14 @@ struct {
int HP_intif_pWisToGM_post;
int HP_intif_pRegisters_pre;
int HP_intif_pRegisters_post;
+ int HP_intif_pAccountStorage_pre;
+ int HP_intif_pAccountStorage_post;
int HP_intif_pChangeNameOk_pre;
int HP_intif_pChangeNameOk_post;
int HP_intif_pMessageToFD_pre;
int HP_intif_pMessageToFD_post;
+ int HP_intif_pAccountStorageSaveAck_pre;
+ int HP_intif_pAccountStorageSaveAck_post;
int HP_intif_pLoadGuildStorage_pre;
int HP_intif_pLoadGuildStorage_post;
int HP_intif_pSaveGuildStorage_pre;
@@ -8459,6 +8719,10 @@ struct {
int HP_ircbot_identify_timer_post;
int HP_ircbot_join_timer_pre;
int HP_ircbot_join_timer_post;
+ int HP_ircbot_queue_timer_pre;
+ int HP_ircbot_queue_timer_post;
+ int HP_ircbot_queue_pre;
+ int HP_ircbot_queue_post;
int HP_ircbot_send_pre;
int HP_ircbot_send_post;
int HP_ircbot_relay_pre;
@@ -8467,6 +8731,8 @@ struct {
int HP_ircbot_pong_post;
int HP_ircbot_privmsg_pre;
int HP_ircbot_privmsg_post;
+ int HP_ircbot_privmsg_ctcp_pre;
+ int HP_ircbot_privmsg_ctcp_post;
int HP_ircbot_userjoin_pre;
int HP_ircbot_userjoin_post;
int HP_ircbot_userleave_pre;
@@ -8487,6 +8753,8 @@ struct {
int HP_itemdb_read_chains_post;
int HP_itemdb_read_packages_pre;
int HP_itemdb_read_packages_post;
+ int HP_itemdb_read_options_pre;
+ int HP_itemdb_read_options_post;
int HP_itemdb_write_cached_packages_pre;
int HP_itemdb_write_cached_packages_post;
int HP_itemdb_read_cached_packages_pre;
@@ -8503,6 +8771,8 @@ struct {
int HP_itemdb_search_post;
int HP_itemdb_exists_pre;
int HP_itemdb_exists_post;
+ int HP_itemdb_option_exists_pre;
+ int HP_itemdb_option_exists_post;
int HP_itemdb_in_group_pre;
int HP_itemdb_in_group_post;
int HP_itemdb_group_item_pre;
@@ -8519,6 +8789,8 @@ struct {
int HP_itemdb_searchrandomid_post;
int HP_itemdb_typename_pre;
int HP_itemdb_typename_post;
+ int HP_itemdb_jobmask2mapid_pre;
+ int HP_itemdb_jobmask2mapid_post;
int HP_itemdb_jobid2mapid_pre;
int HP_itemdb_jobid2mapid_post;
int HP_itemdb_create_dummy_data_pre;
@@ -8565,8 +8837,12 @@ struct {
int HP_itemdb_gendercheck_post;
int HP_itemdb_validate_entry_pre;
int HP_itemdb_validate_entry_post;
+ int HP_itemdb_readdb_options_additional_fields_pre;
+ int HP_itemdb_readdb_options_additional_fields_post;
int HP_itemdb_readdb_additional_fields_pre;
int HP_itemdb_readdb_additional_fields_post;
+ int HP_itemdb_readdb_job_sub_pre;
+ int HP_itemdb_readdb_job_sub_post;
int HP_itemdb_readdb_libconfig_sub_pre;
int HP_itemdb_readdb_libconfig_sub_post;
int HP_itemdb_readdb_libconfig_pre;
@@ -8579,6 +8855,8 @@ struct {
int HP_itemdb_destroy_item_data_post;
int HP_itemdb_final_sub_pre;
int HP_itemdb_final_sub_post;
+ int HP_itemdb_options_final_sub_pre;
+ int HP_itemdb_options_final_sub_post;
int HP_itemdb_clear_pre;
int HP_itemdb_clear_post;
int HP_itemdb_id2combo_pre;
@@ -8591,10 +8869,10 @@ struct {
int HP_libconfig_read_post;
int HP_libconfig_write_pre;
int HP_libconfig_write_post;
- int HP_libconfig_set_auto_convert_pre;
- int HP_libconfig_set_auto_convert_post;
- int HP_libconfig_get_auto_convert_pre;
- int HP_libconfig_get_auto_convert_post;
+ int HP_libconfig_set_options_pre;
+ int HP_libconfig_set_options_post;
+ int HP_libconfig_get_options_pre;
+ int HP_libconfig_get_options_post;
int HP_libconfig_read_string_pre;
int HP_libconfig_read_string_post;
int HP_libconfig_read_file_src_pre;
@@ -8619,6 +8897,8 @@ struct {
int HP_libconfig_setting_get_bool_post;
int HP_libconfig_setting_get_string_pre;
int HP_libconfig_setting_get_string_post;
+ int HP_libconfig_setting_lookup_pre;
+ int HP_libconfig_setting_lookup_post;
int HP_libconfig_setting_lookup_int_pre;
int HP_libconfig_setting_lookup_int_post;
int HP_libconfig_setting_lookup_int64_pre;
@@ -8681,8 +8961,6 @@ struct {
int HP_libconfig_setting_set_hook_post;
int HP_libconfig_lookup_pre;
int HP_libconfig_lookup_post;
- int HP_libconfig_lookup_from_pre;
- int HP_libconfig_lookup_from_post;
int HP_libconfig_lookup_int_pre;
int HP_libconfig_lookup_int_post;
int HP_libconfig_lookup_int64_pre;
@@ -8693,8 +8971,8 @@ struct {
int HP_libconfig_lookup_bool_post;
int HP_libconfig_lookup_string_pre;
int HP_libconfig_lookup_string_post;
- int HP_libconfig_read_file_pre;
- int HP_libconfig_read_file_post;
+ int HP_libconfig_load_file_pre;
+ int HP_libconfig_load_file_post;
int HP_libconfig_setting_copy_simple_pre;
int HP_libconfig_setting_copy_simple_post;
int HP_libconfig_setting_copy_elem_pre;
@@ -8703,6 +8981,26 @@ struct {
int HP_libconfig_setting_copy_aggregate_post;
int HP_libconfig_setting_copy_pre;
int HP_libconfig_setting_copy_post;
+ int HP_libconfig_setting_get_bool_real_pre;
+ int HP_libconfig_setting_get_bool_real_post;
+ int HP_libconfig_setting_get_uint32_pre;
+ int HP_libconfig_setting_get_uint32_post;
+ int HP_libconfig_setting_get_uint16_pre;
+ int HP_libconfig_setting_get_uint16_post;
+ int HP_libconfig_setting_get_int16_pre;
+ int HP_libconfig_setting_get_int16_post;
+ int HP_libconfig_setting_lookup_bool_real_pre;
+ int HP_libconfig_setting_lookup_bool_real_post;
+ int HP_libconfig_setting_lookup_uint32_pre;
+ int HP_libconfig_setting_lookup_uint32_post;
+ int HP_libconfig_setting_lookup_uint16_pre;
+ int HP_libconfig_setting_lookup_uint16_post;
+ int HP_libconfig_setting_lookup_int16_pre;
+ int HP_libconfig_setting_lookup_int16_post;
+ int HP_libconfig_setting_lookup_mutable_string_pre;
+ int HP_libconfig_setting_lookup_mutable_string_post;
+ int HP_libconfig_lookup_mutable_string_pre;
+ int HP_libconfig_lookup_mutable_string_post;
int HP_logs_pick_pc_pre;
int HP_logs_pick_pc_post;
int HP_logs_pick_mob_pre;
@@ -8765,32 +9063,6 @@ struct {
int HP_mail_deliveryfail_post;
int HP_mail_invalid_operation_pre;
int HP_mail_invalid_operation_post;
- int HP_iMalloc_init_pre;
- int HP_iMalloc_init_post;
- int HP_iMalloc_final_pre;
- int HP_iMalloc_final_post;
- int HP_iMalloc_malloc_pre;
- int HP_iMalloc_malloc_post;
- int HP_iMalloc_calloc_pre;
- int HP_iMalloc_calloc_post;
- int HP_iMalloc_realloc_pre;
- int HP_iMalloc_realloc_post;
- int HP_iMalloc_reallocz_pre;
- int HP_iMalloc_reallocz_post;
- int HP_iMalloc_astrdup_pre;
- int HP_iMalloc_astrdup_post;
- int HP_iMalloc_free_pre;
- int HP_iMalloc_free_post;
- int HP_iMalloc_memory_check_pre;
- int HP_iMalloc_memory_check_post;
- int HP_iMalloc_verify_ptr_pre;
- int HP_iMalloc_verify_ptr_post;
- int HP_iMalloc_usage_pre;
- int HP_iMalloc_usage_post;
- int HP_iMalloc_post_shutdown_pre;
- int HP_iMalloc_post_shutdown_post;
- int HP_iMalloc_init_messages_pre;
- int HP_iMalloc_init_messages_post;
int HP_map_zone_init_pre;
int HP_map_zone_init_post;
int HP_map_zone_remove_pre;
@@ -9017,12 +9289,14 @@ struct {
int HP_map_readallmaps_post;
int HP_map_config_read_pre;
int HP_map_config_read_post;
- int HP_map_config_read_sub_pre;
- int HP_map_config_read_sub_post;
- int HP_map_reloadnpc_sub_pre;
- int HP_map_reloadnpc_sub_post;
+ int HP_map_read_npclist_pre;
+ int HP_map_read_npclist_post;
int HP_map_inter_config_read_pre;
int HP_map_inter_config_read_post;
+ int HP_map_inter_config_read_database_names_pre;
+ int HP_map_inter_config_read_database_names_post;
+ int HP_map_inter_config_read_connection_pre;
+ int HP_map_inter_config_read_connection_post;
int HP_map_sql_init_pre;
int HP_map_sql_init_post;
int HP_map_sql_close_pre;
@@ -9113,6 +9387,12 @@ struct {
int HP_mapreg_reload_post;
int HP_mapreg_config_read_pre;
int HP_mapreg_config_read_post;
+ int HP_md5_string_pre;
+ int HP_md5_string_post;
+ int HP_md5_binary_pre;
+ int HP_md5_binary_post;
+ int HP_md5_salt_pre;
+ int HP_md5_salt_post;
int HP_mercenary_init_pre;
int HP_mercenary_init_post;
int HP_mercenary_class_pre;
@@ -9369,6 +9649,26 @@ struct {
int HP_mob_clear_spawninfo_post;
int HP_mob_destroy_mob_db_pre;
int HP_mob_destroy_mob_db_post;
+ int HP_mutex_create_pre;
+ int HP_mutex_create_post;
+ int HP_mutex_destroy_pre;
+ int HP_mutex_destroy_post;
+ int HP_mutex_lock_pre;
+ int HP_mutex_lock_post;
+ int HP_mutex_trylock_pre;
+ int HP_mutex_trylock_post;
+ int HP_mutex_unlock_pre;
+ int HP_mutex_unlock_post;
+ int HP_mutex_cond_create_pre;
+ int HP_mutex_cond_create_post;
+ int HP_mutex_cond_destroy_pre;
+ int HP_mutex_cond_destroy_post;
+ int HP_mutex_cond_wait_pre;
+ int HP_mutex_cond_wait_post;
+ int HP_mutex_cond_signal_pre;
+ int HP_mutex_cond_signal_post;
+ int HP_mutex_cond_broadcast_pre;
+ int HP_mutex_cond_broadcast_post;
int HP_npc_chat_sub_pre;
int HP_npc_chat_sub_post;
int HP_npc_chat_finalize_pre;
@@ -10045,8 +10345,10 @@ struct {
int HP_pc_getmaxspiritball_post;
int HP_pc_addfame_pre;
int HP_pc_addfame_post;
- int HP_pc_famerank_pre;
- int HP_pc_famerank_post;
+ int HP_pc_fame_rank_pre;
+ int HP_pc_fame_rank_post;
+ int HP_pc_famelist_type_pre;
+ int HP_pc_famelist_type_post;
int HP_pc_set_hate_mob_pre;
int HP_pc_set_hate_mob_post;
int HP_pc_readdb_pre;
@@ -10177,6 +10479,12 @@ struct {
int HP_pc_update_idle_time_post;
int HP_pc_have_magnifier_pre;
int HP_pc_have_magnifier_post;
+ int HP_pc_process_chat_message_pre;
+ int HP_pc_process_chat_message_post;
+ int HP_pc_check_supernovice_call_pre;
+ int HP_pc_check_supernovice_call_post;
+ int HP_pc_check_basicskill_pre;
+ int HP_pc_check_basicskill_post;
int HP_libpcre_compile_pre;
int HP_libpcre_compile_post;
int HP_libpcre_study_pre;
@@ -10299,6 +10607,22 @@ struct {
int HP_quest_read_db_post;
int HP_quest_read_db_sub_pre;
int HP_quest_read_db_sub_post;
+ int HP_rnd_init_pre;
+ int HP_rnd_init_post;
+ int HP_rnd_final_pre;
+ int HP_rnd_final_post;
+ int HP_rnd_seed_pre;
+ int HP_rnd_seed_post;
+ int HP_rnd_random_pre;
+ int HP_rnd_random_post;
+ int HP_rnd_roll_pre;
+ int HP_rnd_roll_post;
+ int HP_rnd_value_pre;
+ int HP_rnd_value_post;
+ int HP_rnd_uniform_pre;
+ int HP_rnd_uniform_post;
+ int HP_rnd_uniform53_pre;
+ int HP_rnd_uniform53_post;
int HP_script_init_pre;
int HP_script_init_post;
int HP_script_final_pre;
@@ -10341,6 +10665,8 @@ struct {
int HP_script_get_val_post;
int HP_script_get_val_ref_str_pre;
int HP_script_get_val_ref_str_post;
+ int HP_script_get_val_pc_ref_str_pre;
+ int HP_script_get_val_pc_ref_str_post;
int HP_script_get_val_scope_str_pre;
int HP_script_get_val_scope_str_post;
int HP_script_get_val_npc_str_pre;
@@ -10349,6 +10675,8 @@ struct {
int HP_script_get_val_instance_str_post;
int HP_script_get_val_ref_num_pre;
int HP_script_get_val_ref_num_post;
+ int HP_script_get_val_pc_ref_num_pre;
+ int HP_script_get_val_pc_ref_num_post;
int HP_script_get_val_scope_num_pre;
int HP_script_get_val_scope_num_post;
int HP_script_get_val_npc_num_pre;
@@ -10359,6 +10687,8 @@ struct {
int HP_script_get_val2_post;
int HP_script_push_str_pre;
int HP_script_push_str_post;
+ int HP_script_push_conststr_pre;
+ int HP_script_push_conststr_post;
int HP_script_push_copy_pre;
int HP_script_push_copy_post;
int HP_script_pop_stack_pre;
@@ -10473,6 +10803,16 @@ struct {
int HP_script_parse_variable_post;
int HP_script_parse_simpleexpr_pre;
int HP_script_parse_simpleexpr_post;
+ int HP_script_parse_simpleexpr_paren_pre;
+ int HP_script_parse_simpleexpr_paren_post;
+ int HP_script_parse_simpleexpr_number_pre;
+ int HP_script_parse_simpleexpr_number_post;
+ int HP_script_parse_simpleexpr_string_pre;
+ int HP_script_parse_simpleexpr_string_post;
+ int HP_script_parse_simpleexpr_name_pre;
+ int HP_script_parse_simpleexpr_name_post;
+ int HP_script_add_translatable_string_pre;
+ int HP_script_add_translatable_string_post;
int HP_script_parse_expr_pre;
int HP_script_parse_expr_post;
int HP_script_parse_line_pre;
@@ -10481,6 +10821,8 @@ struct {
int HP_script_read_constdb_post;
int HP_script_constdb_comment_pre;
int HP_script_constdb_comment_post;
+ int HP_script_load_parameters_pre;
+ int HP_script_load_parameters_post;
int HP_script_print_line_pre;
int HP_script_print_line_post;
int HP_script_errorwarning_sub_pre;
@@ -10489,6 +10831,8 @@ struct {
int HP_script_set_reg_post;
int HP_script_set_reg_ref_str_pre;
int HP_script_set_reg_ref_str_post;
+ int HP_script_set_reg_pc_ref_str_pre;
+ int HP_script_set_reg_pc_ref_str_post;
int HP_script_set_reg_scope_str_pre;
int HP_script_set_reg_scope_str_post;
int HP_script_set_reg_npc_str_pre;
@@ -10497,6 +10841,8 @@ struct {
int HP_script_set_reg_instance_str_post;
int HP_script_set_reg_ref_num_pre;
int HP_script_set_reg_ref_num_post;
+ int HP_script_set_reg_pc_ref_num_pre;
+ int HP_script_set_reg_pc_ref_num_post;
int HP_script_set_reg_scope_num_pre;
int HP_script_set_reg_scope_num_post;
int HP_script_set_reg_npc_num_pre;
@@ -10613,6 +10959,8 @@ struct {
int HP_script_string_dup_post;
int HP_script_load_translations_pre;
int HP_script_load_translations_post;
+ int HP_script_load_translation_addstring_pre;
+ int HP_script_load_translation_addstring_post;
int HP_script_load_translation_pre;
int HP_script_load_translation_post;
int HP_script_translation_db_destroyer_pre;
@@ -10857,8 +11205,12 @@ struct {
int HP_skill_enchant_elemental_end_post;
int HP_skill_not_ok_pre;
int HP_skill_not_ok_post;
+ int HP_skill_not_ok_unknown_pre;
+ int HP_skill_not_ok_unknown_post;
int HP_skill_not_ok_hom_pre;
int HP_skill_not_ok_hom_post;
+ int HP_skill_not_ok_hom_unknown_pre;
+ int HP_skill_not_ok_hom_unknown_post;
int HP_skill_not_ok_mercenary_pre;
int HP_skill_not_ok_mercenary_post;
int HP_skill_chastle_mob_changetarget_pre;
@@ -10869,6 +11221,8 @@ struct {
int HP_skill_produce_mix_post;
int HP_skill_arrow_create_pre;
int HP_skill_arrow_create_post;
+ int HP_skill_castend_type_pre;
+ int HP_skill_castend_type_post;
int HP_skill_castend_nodamage_id_pre;
int HP_skill_castend_nodamage_id_post;
int HP_skill_castend_damage_id_pre;
@@ -10953,6 +11307,8 @@ struct {
int HP_skill_unitsetmapcell_post;
int HP_skill_unit_onplace_timer_pre;
int HP_skill_unit_onplace_timer_post;
+ int HP_skill_unit_onplace_timer_unknown_pre;
+ int HP_skill_unit_onplace_timer_unknown_post;
int HP_skill_unit_effect_pre;
int HP_skill_unit_effect_post;
int HP_skill_unit_timer_sub_onplace_pre;
@@ -10973,16 +11329,50 @@ struct {
int HP_skill_unit_timer_sub_post;
int HP_skill_init_unit_layout_pre;
int HP_skill_init_unit_layout_post;
- int HP_skill_parse_row_skilldb_pre;
- int HP_skill_parse_row_skilldb_post;
- int HP_skill_parse_row_requiredb_pre;
- int HP_skill_parse_row_requiredb_post;
- int HP_skill_parse_row_castdb_pre;
- int HP_skill_parse_row_castdb_post;
- int HP_skill_parse_row_castnodexdb_pre;
- int HP_skill_parse_row_castnodexdb_post;
- int HP_skill_parse_row_unitdb_pre;
- int HP_skill_parse_row_unitdb_post;
+ int HP_skill_init_unit_layout_unknown_pre;
+ int HP_skill_init_unit_layout_unknown_post;
+ int HP_skill_validate_hittype_pre;
+ int HP_skill_validate_hittype_post;
+ int HP_skill_validate_skilltype_pre;
+ int HP_skill_validate_skilltype_post;
+ int HP_skill_validate_attacktype_pre;
+ int HP_skill_validate_attacktype_post;
+ int HP_skill_validate_element_pre;
+ int HP_skill_validate_element_post;
+ int HP_skill_validate_skillinfo_pre;
+ int HP_skill_validate_skillinfo_post;
+ int HP_skill_validate_damagetype_pre;
+ int HP_skill_validate_damagetype_post;
+ int HP_skill_validate_castnodex_pre;
+ int HP_skill_validate_castnodex_post;
+ int HP_skill_validate_weapontype_pre;
+ int HP_skill_validate_weapontype_post;
+ int HP_skill_validate_ammotype_pre;
+ int HP_skill_validate_ammotype_post;
+ int HP_skill_validate_state_pre;
+ int HP_skill_validate_state_post;
+ int HP_skill_validate_item_requirements_pre;
+ int HP_skill_validate_item_requirements_post;
+ int HP_skill_validate_unit_target_pre;
+ int HP_skill_validate_unit_target_post;
+ int HP_skill_validate_unit_flag_pre;
+ int HP_skill_validate_unit_flag_post;
+ int HP_skill_validate_additional_fields_pre;
+ int HP_skill_validate_additional_fields_post;
+ int HP_skill_validate_skilldb_pre;
+ int HP_skill_validate_skilldb_post;
+ int HP_skill_validate_weapontype_sub_pre;
+ int HP_skill_validate_weapontype_sub_post;
+ int HP_skill_validate_ammotype_sub_pre;
+ int HP_skill_validate_ammotype_sub_post;
+ int HP_skill_validate_unit_flag_sub_pre;
+ int HP_skill_validate_unit_flag_sub_post;
+ int HP_skill_read_skilldb_pre;
+ int HP_skill_read_skilldb_post;
+ int HP_skill_config_set_level_pre;
+ int HP_skill_config_set_level_post;
+ int HP_skill_level_set_value_pre;
+ int HP_skill_level_set_value_post;
int HP_skill_parse_row_producedb_pre;
int HP_skill_parse_row_producedb_post;
int HP_skill_parse_row_createarrowdb_pre;
@@ -11095,6 +11485,12 @@ struct {
int HP_skill_get_requirement_item_unknown_post;
int HP_skill_get_requirement_unknown_pre;
int HP_skill_get_requirement_unknown_post;
+ int HP_skill_splash_target_pre;
+ int HP_skill_splash_target_post;
+ int HP_skill_check_npc_chaospanic_pre;
+ int HP_skill_check_npc_chaospanic_post;
+ int HP_skill_count_wos_pre;
+ int HP_skill_count_wos_post;
int HP_sockt_init_pre;
int HP_sockt_init_post;
int HP_sockt_final_pre;
@@ -11439,6 +11835,14 @@ struct {
int HP_status_read_job_db_post;
int HP_status_read_job_db_sub_pre;
int HP_status_read_job_db_sub_post;
+ int HP_status_set_sc_pre;
+ int HP_status_set_sc_post;
+ int HP_status_copy_pre;
+ int HP_status_copy_post;
+ int HP_status_base_matk_min_pre;
+ int HP_status_base_matk_min_post;
+ int HP_status_base_matk_max_pre;
+ int HP_status_base_matk_max_post;
int HP_storage_reconnect_pre;
int HP_storage_reconnect_post;
int HP_storage_delitem_pre;
@@ -11547,6 +11951,8 @@ struct {
int HP_sysinfo_compiler_post;
int HP_sysinfo_cflags_pre;
int HP_sysinfo_cflags_post;
+ int HP_sysinfo_time_pre;
+ int HP_sysinfo_time_post;
int HP_sysinfo_vcstype_pre;
int HP_sysinfo_vcstype_post;
int HP_sysinfo_vcstypeid_pre;
@@ -11563,6 +11969,28 @@ struct {
int HP_sysinfo_init_post;
int HP_sysinfo_final_pre;
int HP_sysinfo_final_post;
+ int HP_thread_init_pre;
+ int HP_thread_init_post;
+ int HP_thread_final_pre;
+ int HP_thread_final_post;
+ int HP_thread_create_pre;
+ int HP_thread_create_post;
+ int HP_thread_create_opt_pre;
+ int HP_thread_create_opt_post;
+ int HP_thread_destroy_pre;
+ int HP_thread_destroy_post;
+ int HP_thread_self_pre;
+ int HP_thread_self_post;
+ int HP_thread_get_tid_pre;
+ int HP_thread_get_tid_post;
+ int HP_thread_wait_pre;
+ int HP_thread_wait_post;
+ int HP_thread_prio_set_pre;
+ int HP_thread_prio_set_post;
+ int HP_thread_prio_get_pre;
+ int HP_thread_prio_get_post;
+ int HP_thread_yield_pre;
+ int HP_thread_yield_post;
int HP_timer_gettick_pre;
int HP_timer_gettick_post;
int HP_timer_gettick_nocache_pre;
@@ -11615,6 +12043,8 @@ struct {
int HP_unit_bl2ud_post;
int HP_unit_bl2ud2_pre;
int HP_unit_bl2ud2_post;
+ int HP_unit_init_ud_pre;
+ int HP_unit_init_ud_post;
int HP_unit_attack_timer_pre;
int HP_unit_attack_timer_post;
int HP_unit_walktoxy_timer_pre;
@@ -11735,8 +12165,10 @@ struct {
struct console_interface console;
struct core_interface core;
struct db_interface DB;
+ struct des_interface des;
struct duel_interface duel;
struct elemental_interface elemental;
+ struct grfio_interface grfio;
struct guild_interface guild;
struct guild_storage_interface gstorage;
struct homunculus_interface homun;
@@ -11747,13 +12179,14 @@ struct {
struct libconfig_interface libconfig;
struct log_interface logs;
struct mail_interface mail;
- struct malloc_interface iMalloc;
struct map_interface map;
struct mapindex_interface mapindex;
struct mapit_interface mapit;
struct mapreg_interface mapreg;
+ struct md5_interface md5;
struct mercenary_interface mercenary;
struct mob_interface mob;
+ struct mutex_interface mutex;
struct npc_chat_interface npc_chat;
struct npc_interface npc;
struct nullpo_interface nullpo;
@@ -11764,6 +12197,7 @@ struct {
struct pcre_interface libpcre;
struct pet_interface pet;
struct quest_interface quest;
+ struct rnd_interface rnd;
struct script_interface script;
struct searchstore_interface searchstore;
struct showmsg_interface showmsg;
@@ -11776,6 +12210,7 @@ struct {
struct strlib_interface strlib;
struct sv_interface sv;
struct sysinfo_interface sysinfo;
+ struct thread_interface thread;
struct timer_interface timer;
struct trade_interface trade;
struct unit_interface unit;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 4ec436d51..a8ec0b4f5 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1,7 +1,8 @@
/**
* This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -22,12 +23,14 @@
* as it will get overwritten.
*/
+/* GENERATED FILE DO NOT EDIT */
+
struct HookingPointData HookingPoints[] = {
-/* HCache */
+/* HCache_interface */
{ HP_POP(HCache->init, HP_HCache_init) },
{ HP_POP(HCache->check, HP_HCache_check) },
{ HP_POP(HCache->open, HP_HCache_open) },
-/* atcommand */
+/* atcommand_interface */
{ HP_POP(atcommand->init, HP_atcommand_init) },
{ HP_POP(atcommand->final, HP_atcommand_final) },
{ HP_POP(atcommand->exec, HP_atcommand_exec) },
@@ -63,14 +66,16 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(atcommand->expand_message_table, HP_atcommand_expand_message_table) },
{ HP_POP(atcommand->msgfd, HP_atcommand_msgfd) },
{ HP_POP(atcommand->msgsd, HP_atcommand_msgsd) },
-/* battle */
+/* battle_interface */
{ HP_POP(battle->init, HP_battle_init) },
{ HP_POP(battle->final, HP_battle_final) },
{ HP_POP(battle->calc_attack, HP_battle_calc_attack) },
{ HP_POP(battle->calc_damage, HP_battle_calc_damage) },
+ { HP_POP(battle->calc_pc_damage, HP_battle_calc_pc_damage) },
{ HP_POP(battle->calc_gvg_damage, HP_battle_calc_gvg_damage) },
{ HP_POP(battle->calc_bg_damage, HP_battle_calc_bg_damage) },
{ HP_POP(battle->weapon_attack, HP_battle_weapon_attack) },
+ { HP_POP(battle->check_arrows, HP_battle_check_arrows) },
{ HP_POP(battle->calc_weapon_attack, HP_battle_calc_weapon_attack) },
{ HP_POP(battle->delay_damage, HP_battle_delay_damage) },
{ HP_POP(battle->drain, HP_battle_drain) },
@@ -110,6 +115,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(battle->calc_drain, HP_battle_calc_drain) },
{ HP_POP(battle->config_read, HP_battle_config_read) },
{ HP_POP(battle->config_set_defaults, HP_battle_config_set_defaults) },
+ { HP_POP(battle->config_set_value_sub, HP_battle_config_set_value_sub) },
{ HP_POP(battle->config_set_value, HP_battle_config_set_value) },
{ HP_POP(battle->config_get_value, HP_battle_config_get_value) },
{ HP_POP(battle->config_adjust, HP_battle_config_adjust) },
@@ -119,7 +125,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(battle->calc_skillratio_magic_unknown, HP_battle_calc_skillratio_magic_unknown) },
{ HP_POP(battle->calc_skillratio_weapon_unknown, HP_battle_calc_skillratio_weapon_unknown) },
{ HP_POP(battle->calc_misc_attack_unknown, HP_battle_calc_misc_attack_unknown) },
-/* bg */
+/* battleground_interface */
{ HP_POP(bg->init, HP_bg_init) },
{ HP_POP(bg->final, HP_bg_final) },
{ HP_POP(bg->name2arena, HP_bg_name2arena) },
@@ -151,7 +157,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(bg->team_db_final, HP_bg_team_db_final) },
{ HP_POP(bg->str2teamtype, HP_bg_str2teamtype) },
{ HP_POP(bg->config_read, HP_bg_config_read) },
-/* buyingstore */
+/* buyingstore_interface */
{ HP_POP(buyingstore->setup, HP_buyingstore_setup) },
{ HP_POP(buyingstore->create, HP_buyingstore_create) },
{ HP_POP(buyingstore->close, HP_buyingstore_close) },
@@ -160,7 +166,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(buyingstore->search, HP_buyingstore_search) },
{ HP_POP(buyingstore->searchall, HP_buyingstore_searchall) },
{ HP_POP(buyingstore->getuid, HP_buyingstore_getuid) },
-/* channel */
+/* channel_interface */
{ HP_POP(channel->init, HP_channel_init) },
{ HP_POP(channel->final, HP_channel_final) },
{ HP_POP(channel->search, HP_channel_search) },
@@ -182,7 +188,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(channel->quit_guild, HP_channel_quit_guild) },
{ HP_POP(channel->irc_join, HP_channel_irc_join) },
{ HP_POP(channel->config_read, HP_channel_config_read) },
-/* chat */
+/* chat_interface */
{ HP_POP(chat->create_pc_chat, HP_chat_create_pc_chat) },
{ HP_POP(chat->join, HP_chat_join) },
{ HP_POP(chat->leave, HP_chat_leave) },
@@ -196,7 +202,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(chat->npc_kick_all, HP_chat_npc_kick_all) },
{ HP_POP(chat->trigger_event, HP_chat_trigger_event) },
{ HP_POP(chat->create, HP_chat_create) },
-/* chrif */
+/* chrif_interface */
{ HP_POP(chrif->init, HP_chrif_init) },
{ HP_POP(chrif->final, HP_chrif_final) },
{ HP_POP(chrif->setuserid, HP_chrif_setuserid) },
@@ -267,7 +273,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(chrif->parse, HP_chrif_parse) },
{ HP_POP(chrif->save_scdata_single, HP_chrif_save_scdata_single) },
{ HP_POP(chrif->del_scdata_single, HP_chrif_del_scdata_single) },
-/* clif */
+/* clif_interface */
{ HP_POP(clif->init, HP_clif_init) },
{ HP_POP(clif->final, HP_clif_final) },
{ HP_POP(clif->setip, HP_clif_setip) },
@@ -436,6 +442,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->autoshadowspell_list, HP_clif_autoshadowspell_list) },
{ HP_POP(clif->skill_itemlistwindow, HP_clif_skill_itemlistwindow) },
{ HP_POP(clif->sc_load, HP_clif_sc_load) },
+ { HP_POP(clif->sc_continue, HP_clif_sc_continue) },
{ HP_POP(clif->sc_end, HP_clif_sc_end) },
{ HP_POP(clif->initialstatus, HP_clif_initialstatus) },
{ HP_POP(clif->cooldown_list, HP_clif_cooldown_list) },
@@ -467,7 +474,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->skill_poseffect, HP_clif_skill_poseffect) },
{ HP_POP(clif->skill_estimation, HP_clif_skill_estimation) },
{ HP_POP(clif->skill_warppoint, HP_clif_skill_warppoint) },
- { HP_POP(clif->skillcasting, HP_clif_skillcasting) },
+ { HP_POP(clif->useskill, HP_clif_useskill) },
{ HP_POP(clif->produce_effect, HP_clif_produce_effect) },
{ HP_POP(clif->devotion, HP_clif_devotion) },
{ HP_POP(clif->spiritball, HP_clif_spiritball) },
@@ -512,7 +519,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->msgtable_skill, HP_clif_msgtable_skill) },
{ HP_POP(clif->message, HP_clif_message) },
{ HP_POP(clif->messageln, HP_clif_messageln) },
- { HP_POP(clif->process_message, HP_clif_process_message) },
+ { HP_POP(clif->process_chat_message, HP_clif_process_chat_message) },
+ { HP_POP(clif->process_whisper_message, HP_clif_process_whisper_message) },
{ HP_POP(clif->wisexin, HP_clif_wisexin) },
{ HP_POP(clif->wisall, HP_clif_wisall) },
{ HP_POP(clif->PMIgnoreList, HP_clif_PMIgnoreList) },
@@ -714,6 +722,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->cancelmergeitem, HP_clif_cancelmergeitem) },
{ HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) },
{ HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) },
+ { HP_POP(clif->isdisguised, HP_clif_isdisguised) },
+ { HP_POP(clif->navigate_to, HP_clif_navigate_to) },
+ { HP_POP(clif->bl_type, HP_clif_bl_type) },
{ HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) },
{ HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) },
{ HP_POP(clif->pTickSend, HP_clif_pTickSend) },
@@ -941,27 +952,28 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->pNPCShopClosed, HP_clif_pNPCShopClosed) },
{ HP_POP(clif->pNPCMarketClosed, HP_clif_pNPCMarketClosed) },
{ HP_POP(clif->pNPCMarketPurchase, HP_clif_pNPCMarketPurchase) },
- { HP_POP(clif->add_random_options, HP_clif_add_random_options) },
+ { HP_POP(clif->add_item_options, HP_clif_add_item_options) },
{ HP_POP(clif->pHotkeyRowShift, HP_clif_pHotkeyRowShift) },
{ HP_POP(clif->dressroom_open, HP_clif_dressroom_open) },
{ HP_POP(clif->pOneClick_ItemIdentify, HP_clif_pOneClick_ItemIdentify) },
{ HP_POP(clif->selectcart, HP_clif_selectcart) },
{ HP_POP(clif->pSelectCart, HP_clif_pSelectCart) },
-/* cmdline */
+ { HP_POP(clif->get_bl_name, HP_clif_get_bl_name) },
+/* cmdline_interface */
{ HP_POP(cmdline->init, HP_cmdline_init) },
{ HP_POP(cmdline->final, HP_cmdline_final) },
{ HP_POP(cmdline->arg_add, HP_cmdline_arg_add) },
{ HP_POP(cmdline->exec, HP_cmdline_exec) },
{ HP_POP(cmdline->arg_next_value, HP_cmdline_arg_next_value) },
{ HP_POP(cmdline->arg_source, HP_cmdline_arg_source) },
-/* console */
+/* console_interface */
{ HP_POP(console->init, HP_console_init) },
{ HP_POP(console->final, HP_console_final) },
{ HP_POP(console->display_title, HP_console_display_title) },
{ HP_POP(console->display_gplnotice, HP_console_display_gplnotice) },
-/* core */
+/* core_interface */
{ HP_POP(core->shutdown_callback, HP_core_shutdown_callback) },
-/* DB */
+/* db_interface */
{ HP_POP(DB->fix_options, HP_DB_fix_options) },
{ HP_POP(DB->default_cmp, HP_DB_default_cmp) },
{ HP_POP(DB->default_hash, HP_DB_default_hash) },
@@ -981,7 +993,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(DB->data2ptr, HP_DB_data2ptr) },
{ HP_POP(DB->init, HP_DB_init) },
{ HP_POP(DB->final, HP_DB_final) },
-/* duel */
+/* des_interface */
+ { HP_POP(des->decrypt_block, HP_des_decrypt_block) },
+ { HP_POP(des->decrypt, HP_des_decrypt) },
+/* duel_interface */
{ HP_POP(duel->create, HP_duel_create) },
{ HP_POP(duel->invite, HP_duel_invite) },
{ HP_POP(duel->accept, HP_duel_accept) },
@@ -991,7 +1006,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(duel->checktime, HP_duel_checktime) },
{ HP_POP(duel->init, HP_duel_init) },
{ HP_POP(duel->final, HP_duel_final) },
-/* elemental */
+/* elemental_interface */
{ HP_POP(elemental->init, HP_elemental_init) },
{ HP_POP(elemental->final, HP_elemental_final) },
{ HP_POP(elemental->class, HP_elemental_class) },
@@ -1024,7 +1039,15 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(elemental->ai_sub_foreachclient, HP_elemental_ai_sub_foreachclient) },
{ HP_POP(elemental->ai_timer, HP_elemental_ai_timer) },
{ HP_POP(elemental->read_db, HP_elemental_read_db) },
-/* guild */
+/* grfio_interface */
+ { HP_POP(grfio->init, HP_grfio_init) },
+ { HP_POP(grfio->final, HP_grfio_final) },
+ { HP_POP(grfio->reads, HP_grfio_reads) },
+ { HP_POP(grfio->find_file, HP_grfio_find_file) },
+ { HP_POP(grfio->crc32, HP_grfio_crc32) },
+ { HP_POP(grfio->decode_zip, HP_grfio_decode_zip) },
+ { HP_POP(grfio->encode_zip, HP_grfio_encode_zip) },
+/* guild_interface */
{ HP_POP(guild->init, HP_guild_init) },
{ HP_POP(guild->final, HP_guild_final) },
{ HP_POP(guild->skill_get_max, HP_guild_skill_get_max) },
@@ -1111,7 +1134,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(guild->check_member, HP_guild_check_member) },
{ HP_POP(guild->get_alliance_count, HP_guild_get_alliance_count) },
{ HP_POP(guild->castle_reconnect_sub, HP_guild_castle_reconnect_sub) },
-/* gstorage */
+/* guild_storage_interface */
{ HP_POP(gstorage->ensure, HP_gstorage_ensure) },
{ HP_POP(gstorage->init, HP_gstorage_init) },
{ HP_POP(gstorage->final, HP_gstorage_final) },
@@ -1128,7 +1151,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(gstorage->save, HP_gstorage_save) },
{ HP_POP(gstorage->saved, HP_gstorage_saved) },
{ HP_POP(gstorage->create, HP_gstorage_create) },
-/* homun */
+/* homunculus_interface */
{ HP_POP(homun->init, HP_homun_init) },
{ HP_POP(homun->final, HP_homun_final) },
{ HP_POP(homun->reload, HP_homun_reload) },
@@ -1176,7 +1199,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(homun->addspiritball, HP_homun_addspiritball) },
{ HP_POP(homun->delspiritball, HP_homun_delspiritball) },
{ HP_POP(homun->get_intimacy_grade, HP_homun_get_intimacy_grade) },
-/* instance */
+/* instance_interface */
{ HP_POP(instance->init, HP_instance_init) },
{ HP_POP(instance->final, HP_instance_final) },
{ HP_POP(instance->reload, HP_instance_reload) },
@@ -1195,7 +1218,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) },
-/* intif */
+/* intif_interface */
{ HP_POP(intif->parse, HP_intif_parse) },
{ HP_POP(intif->create_pet, HP_intif_create_pet) },
{ HP_POP(intif->broadcast, HP_intif_broadcast) },
@@ -1205,6 +1228,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(intif->wis_message_to_gm, HP_intif_wis_message_to_gm) },
{ HP_POP(intif->saveregistry, HP_intif_saveregistry) },
{ HP_POP(intif->request_registry, HP_intif_request_registry) },
+ { HP_POP(intif->request_account_storage, HP_intif_request_account_storage) },
+ { HP_POP(intif->send_account_storage, HP_intif_send_account_storage) },
{ HP_POP(intif->request_guild_storage, HP_intif_request_guild_storage) },
{ HP_POP(intif->send_guild_storage, HP_intif_send_guild_storage) },
{ HP_POP(intif->create_party, HP_intif_create_party) },
@@ -1270,8 +1295,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(intif->pWisToGM_sub, HP_intif_pWisToGM_sub) },
{ HP_POP(intif->pWisToGM, HP_intif_pWisToGM) },
{ HP_POP(intif->pRegisters, HP_intif_pRegisters) },
+ { HP_POP(intif->pAccountStorage, HP_intif_pAccountStorage) },
{ HP_POP(intif->pChangeNameOk, HP_intif_pChangeNameOk) },
{ HP_POP(intif->pMessageToFD, HP_intif_pMessageToFD) },
+ { HP_POP(intif->pAccountStorageSaveAck, HP_intif_pAccountStorageSaveAck) },
{ HP_POP(intif->pLoadGuildStorage, HP_intif_pLoadGuildStorage) },
{ HP_POP(intif->pSaveGuildStorage, HP_intif_pSaveGuildStorage) },
{ HP_POP(intif->pPartyCreated, HP_intif_pPartyCreated) },
@@ -1327,7 +1354,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(intif->pRecvHomunculusData, HP_intif_pRecvHomunculusData) },
{ HP_POP(intif->pSaveHomunculusOk, HP_intif_pSaveHomunculusOk) },
{ HP_POP(intif->pDeleteHomunculusOk, HP_intif_pDeleteHomunculusOk) },
-/* ircbot */
+/* irc_bot_interface */
{ HP_POP(ircbot->init, HP_ircbot_init) },
{ HP_POP(ircbot->final, HP_ircbot_final) },
{ HP_POP(ircbot->parse, HP_ircbot_parse) },
@@ -1337,14 +1364,17 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(ircbot->connect_timer, HP_ircbot_connect_timer) },
{ HP_POP(ircbot->identify_timer, HP_ircbot_identify_timer) },
{ HP_POP(ircbot->join_timer, HP_ircbot_join_timer) },
+ { HP_POP(ircbot->queue_timer, HP_ircbot_queue_timer) },
+ { HP_POP(ircbot->queue, HP_ircbot_queue) },
{ HP_POP(ircbot->send, HP_ircbot_send) },
{ HP_POP(ircbot->relay, HP_ircbot_relay) },
{ HP_POP(ircbot->pong, HP_ircbot_pong) },
{ HP_POP(ircbot->privmsg, HP_ircbot_privmsg) },
+ { HP_POP(ircbot->privmsg_ctcp, HP_ircbot_privmsg_ctcp) },
{ HP_POP(ircbot->userjoin, HP_ircbot_userjoin) },
{ HP_POP(ircbot->userleave, HP_ircbot_userleave) },
{ HP_POP(ircbot->usernick, HP_ircbot_usernick) },
-/* itemdb */
+/* itemdb_interface */
{ HP_POP(itemdb->init, HP_itemdb_init) },
{ HP_POP(itemdb->final, HP_itemdb_final) },
{ HP_POP(itemdb->reload, HP_itemdb_reload) },
@@ -1352,6 +1382,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->read_groups, HP_itemdb_read_groups) },
{ HP_POP(itemdb->read_chains, HP_itemdb_read_chains) },
{ HP_POP(itemdb->read_packages, HP_itemdb_read_packages) },
+ { HP_POP(itemdb->read_options, HP_itemdb_read_options) },
{ HP_POP(itemdb->write_cached_packages, HP_itemdb_write_cached_packages) },
{ HP_POP(itemdb->read_cached_packages, HP_itemdb_read_cached_packages) },
{ HP_POP(itemdb->name2id, HP_itemdb_name2id) },
@@ -1360,6 +1391,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->load, HP_itemdb_load) },
{ HP_POP(itemdb->search, HP_itemdb_search) },
{ HP_POP(itemdb->exists, HP_itemdb_exists) },
+ { HP_POP(itemdb->option_exists, HP_itemdb_option_exists) },
{ HP_POP(itemdb->in_group, HP_itemdb_in_group) },
{ HP_POP(itemdb->group_item, HP_itemdb_group_item) },
{ HP_POP(itemdb->chain_item, HP_itemdb_chain_item) },
@@ -1368,6 +1400,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->searchname_array_sub, HP_itemdb_searchname_array_sub) },
{ HP_POP(itemdb->searchrandomid, HP_itemdb_searchrandomid) },
{ HP_POP(itemdb->typename, HP_itemdb_typename) },
+ { HP_POP(itemdb->jobmask2mapid, HP_itemdb_jobmask2mapid) },
{ HP_POP(itemdb->jobid2mapid, HP_itemdb_jobid2mapid) },
{ HP_POP(itemdb->create_dummy_data, HP_itemdb_create_dummy_data) },
{ HP_POP(itemdb->create_item_data, HP_itemdb_create_item_data) },
@@ -1391,22 +1424,25 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(itemdb->read_combos, HP_itemdb_read_combos) },
{ HP_POP(itemdb->gendercheck, HP_itemdb_gendercheck) },
{ HP_POP(itemdb->validate_entry, HP_itemdb_validate_entry) },
+ { HP_POP(itemdb->readdb_options_additional_fields, HP_itemdb_readdb_options_additional_fields) },
{ HP_POP(itemdb->readdb_additional_fields, HP_itemdb_readdb_additional_fields) },
+ { HP_POP(itemdb->readdb_job_sub, HP_itemdb_readdb_job_sub) },
{ HP_POP(itemdb->readdb_libconfig_sub, HP_itemdb_readdb_libconfig_sub) },
{ HP_POP(itemdb->readdb_libconfig, HP_itemdb_readdb_libconfig) },
{ HP_POP(itemdb->unique_id, HP_itemdb_unique_id) },
{ HP_POP(itemdb->read, HP_itemdb_read) },
{ HP_POP(itemdb->destroy_item_data, HP_itemdb_destroy_item_data) },
{ HP_POP(itemdb->final_sub, HP_itemdb_final_sub) },
+ { HP_POP(itemdb->options_final_sub, HP_itemdb_options_final_sub) },
{ HP_POP(itemdb->clear, HP_itemdb_clear) },
{ HP_POP(itemdb->id2combo, HP_itemdb_id2combo) },
{ HP_POP(itemdb->is_item_usable, HP_itemdb_is_item_usable) },
{ HP_POP(itemdb->lookup_const, HP_itemdb_lookup_const) },
-/* libconfig */
+/* libconfig_interface */
{ HP_POP(libconfig->read, HP_libconfig_read) },
{ HP_POP(libconfig->write, HP_libconfig_write) },
- { HP_POP(libconfig->set_auto_convert, HP_libconfig_set_auto_convert) },
- { HP_POP(libconfig->get_auto_convert, HP_libconfig_get_auto_convert) },
+ { HP_POP(libconfig->set_options, HP_libconfig_set_options) },
+ { HP_POP(libconfig->get_options, HP_libconfig_get_options) },
{ HP_POP(libconfig->read_string, HP_libconfig_read_string) },
{ HP_POP(libconfig->read_file_src, HP_libconfig_read_file_src) },
{ HP_POP(libconfig->write_file, HP_libconfig_write_file) },
@@ -1419,6 +1455,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libconfig->setting_get_float, HP_libconfig_setting_get_float) },
{ HP_POP(libconfig->setting_get_bool, HP_libconfig_setting_get_bool) },
{ HP_POP(libconfig->setting_get_string, HP_libconfig_setting_get_string) },
+ { HP_POP(libconfig->setting_lookup, HP_libconfig_setting_lookup) },
{ HP_POP(libconfig->setting_lookup_int, HP_libconfig_setting_lookup_int) },
{ HP_POP(libconfig->setting_lookup_int64, HP_libconfig_setting_lookup_int64) },
{ HP_POP(libconfig->setting_lookup_float, HP_libconfig_setting_lookup_float) },
@@ -1450,18 +1487,27 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libconfig->setting_remove_elem, HP_libconfig_setting_remove_elem) },
{ HP_POP(libconfig->setting_set_hook, HP_libconfig_setting_set_hook) },
{ HP_POP(libconfig->lookup, HP_libconfig_lookup) },
- { HP_POP(libconfig->lookup_from, HP_libconfig_lookup_from) },
{ HP_POP(libconfig->lookup_int, HP_libconfig_lookup_int) },
{ HP_POP(libconfig->lookup_int64, HP_libconfig_lookup_int64) },
{ HP_POP(libconfig->lookup_float, HP_libconfig_lookup_float) },
{ HP_POP(libconfig->lookup_bool, HP_libconfig_lookup_bool) },
{ HP_POP(libconfig->lookup_string, HP_libconfig_lookup_string) },
- { HP_POP(libconfig->read_file, HP_libconfig_read_file) },
+ { HP_POP(libconfig->load_file, HP_libconfig_load_file) },
{ HP_POP(libconfig->setting_copy_simple, HP_libconfig_setting_copy_simple) },
{ HP_POP(libconfig->setting_copy_elem, HP_libconfig_setting_copy_elem) },
{ HP_POP(libconfig->setting_copy_aggregate, HP_libconfig_setting_copy_aggregate) },
{ HP_POP(libconfig->setting_copy, HP_libconfig_setting_copy) },
-/* logs */
+ { HP_POP(libconfig->setting_get_bool_real, HP_libconfig_setting_get_bool_real) },
+ { HP_POP(libconfig->setting_get_uint32, HP_libconfig_setting_get_uint32) },
+ { HP_POP(libconfig->setting_get_uint16, HP_libconfig_setting_get_uint16) },
+ { HP_POP(libconfig->setting_get_int16, HP_libconfig_setting_get_int16) },
+ { HP_POP(libconfig->setting_lookup_bool_real, HP_libconfig_setting_lookup_bool_real) },
+ { HP_POP(libconfig->setting_lookup_uint32, HP_libconfig_setting_lookup_uint32) },
+ { HP_POP(libconfig->setting_lookup_uint16, HP_libconfig_setting_lookup_uint16) },
+ { HP_POP(libconfig->setting_lookup_int16, HP_libconfig_setting_lookup_int16) },
+ { HP_POP(libconfig->setting_lookup_mutable_string, HP_libconfig_setting_lookup_mutable_string) },
+ { HP_POP(libconfig->lookup_mutable_string, HP_libconfig_lookup_mutable_string) },
+/* log_interface */
{ HP_POP(logs->pick_pc, HP_logs_pick_pc) },
{ HP_POP(logs->pick_mob, HP_logs_pick_mob) },
{ HP_POP(logs->zeny, HP_logs_zeny) },
@@ -1484,7 +1530,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(logs->picktype2char, HP_logs_picktype2char) },
{ HP_POP(logs->chattype2char, HP_logs_chattype2char) },
{ HP_POP(logs->should_log_item, HP_logs_should_log_item) },
-/* mail */
+/* mail_interface */
{ HP_POP(mail->clear, HP_mail_clear) },
{ HP_POP(mail->removeitem, HP_mail_removeitem) },
{ HP_POP(mail->removezeny, HP_mail_removezeny) },
@@ -1494,21 +1540,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mail->openmail, HP_mail_openmail) },
{ HP_POP(mail->deliveryfail, HP_mail_deliveryfail) },
{ HP_POP(mail->invalid_operation, HP_mail_invalid_operation) },
-/* iMalloc */
- { HP_POP(iMalloc->init, HP_iMalloc_init) },
- { HP_POP(iMalloc->final, HP_iMalloc_final) },
- { HP_POP(iMalloc->malloc, HP_iMalloc_malloc) },
- { HP_POP(iMalloc->calloc, HP_iMalloc_calloc) },
- { HP_POP(iMalloc->realloc, HP_iMalloc_realloc) },
- { HP_POP(iMalloc->reallocz, HP_iMalloc_reallocz) },
- { HP_POP(iMalloc->astrdup, HP_iMalloc_astrdup) },
- { HP_POP(iMalloc->free, HP_iMalloc_free) },
- { HP_POP(iMalloc->memory_check, HP_iMalloc_memory_check) },
- { HP_POP(iMalloc->verify_ptr, HP_iMalloc_verify_ptr) },
- { HP_POP(iMalloc->usage, HP_iMalloc_usage) },
- { HP_POP(iMalloc->post_shutdown, HP_iMalloc_post_shutdown) },
- { HP_POP(iMalloc->init_messages, HP_iMalloc_init_messages) },
-/* map */
+/* map_interface */
{ HP_POP(map->zone_init, HP_map_zone_init) },
{ HP_POP(map->zone_remove, HP_map_zone_remove) },
{ HP_POP(map->zone_apply, HP_map_zone_apply) },
@@ -1622,9 +1654,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(map->readgat, HP_map_readgat) },
{ HP_POP(map->readallmaps, HP_map_readallmaps) },
{ HP_POP(map->config_read, HP_map_config_read) },
- { HP_POP(map->config_read_sub, HP_map_config_read_sub) },
- { HP_POP(map->reloadnpc_sub, HP_map_reloadnpc_sub) },
+ { HP_POP(map->read_npclist, HP_map_read_npclist) },
{ HP_POP(map->inter_config_read, HP_map_inter_config_read) },
+ { HP_POP(map->inter_config_read_database_names, HP_map_inter_config_read_database_names) },
+ { HP_POP(map->inter_config_read_connection, HP_map_inter_config_read_connection) },
{ HP_POP(map->sql_init, HP_map_sql_init) },
{ HP_POP(map->sql_close, HP_map_sql_close) },
{ HP_POP(map->zone_mf_cache, HP_map_zone_mf_cache) },
@@ -1642,7 +1675,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(map->remove_questinfo, HP_map_remove_questinfo) },
{ HP_POP(map->merge_zone, HP_map_merge_zone) },
{ HP_POP(map->zone_clear_single, HP_map_zone_clear_single) },
-/* mapindex */
+/* mapindex_interface */
{ HP_POP(mapindex->init, HP_mapindex_init) },
{ HP_POP(mapindex->final, HP_mapindex_final) },
{ HP_POP(mapindex->addmap, HP_mapindex_addmap) },
@@ -1652,7 +1685,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapindex->name2id, HP_mapindex_name2id) },
{ HP_POP(mapindex->id2name, HP_mapindex_id2name) },
{ HP_POP(mapindex->check_default, HP_mapindex_check_default) },
-/* mapit */
+/* mapit_interface */
{ HP_POP(mapit->alloc, HP_mapit_alloc) },
{ HP_POP(mapit->free, HP_mapit_free) },
{ HP_POP(mapit->first, HP_mapit_first) },
@@ -1660,7 +1693,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapit->next, HP_mapit_next) },
{ HP_POP(mapit->prev, HP_mapit_prev) },
{ HP_POP(mapit->exists, HP_mapit_exists) },
-/* mapreg */
+/* mapreg_interface */
{ HP_POP(mapreg->init, HP_mapreg_init) },
{ HP_POP(mapreg->final, HP_mapreg_final) },
{ HP_POP(mapreg->readreg, HP_mapreg_readreg) },
@@ -1673,7 +1706,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mapreg->destroyreg, HP_mapreg_destroyreg) },
{ HP_POP(mapreg->reload, HP_mapreg_reload) },
{ HP_POP(mapreg->config_read, HP_mapreg_config_read) },
-/* mercenary */
+/* md5_interface */
+ { HP_POP(md5->string, HP_md5_string) },
+ { HP_POP(md5->binary, HP_md5_binary) },
+ { HP_POP(md5->salt, HP_md5_salt) },
+/* mercenary_interface */
{ HP_POP(mercenary->init, HP_mercenary_init) },
{ HP_POP(mercenary->class, HP_mercenary_class) },
{ HP_POP(mercenary->get_viewdata, HP_mercenary_get_viewdata) },
@@ -1699,7 +1736,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mercenary->contract_end_timer, HP_mercenary_contract_end_timer) },
{ HP_POP(mercenary->read_db_sub, HP_mercenary_read_db_sub) },
{ HP_POP(mercenary->read_skill_db_sub, HP_mercenary_read_skill_db_sub) },
-/* mob */
+/* mob_interface */
{ HP_POP(mob->init, HP_mob_init) },
{ HP_POP(mob->final, HP_mob_final) },
{ HP_POP(mob->reload, HP_mob_reload) },
@@ -1803,7 +1840,18 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(mob->load, HP_mob_load) },
{ HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) },
{ HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) },
-/* npc_chat */
+/* mutex_interface */
+ { HP_POP(mutex->create, HP_mutex_create) },
+ { HP_POP(mutex->destroy, HP_mutex_destroy) },
+ { HP_POP(mutex->lock, HP_mutex_lock) },
+ { HP_POP(mutex->trylock, HP_mutex_trylock) },
+ { HP_POP(mutex->unlock, HP_mutex_unlock) },
+ { HP_POP(mutex->cond_create, HP_mutex_cond_create) },
+ { HP_POP(mutex->cond_destroy, HP_mutex_cond_destroy) },
+ { HP_POP(mutex->cond_wait, HP_mutex_cond_wait) },
+ { HP_POP(mutex->cond_signal, HP_mutex_cond_signal) },
+ { HP_POP(mutex->cond_broadcast, HP_mutex_cond_broadcast) },
+/* npc_chat_interface */
{ HP_POP(npc_chat->sub, HP_npc_chat_sub) },
{ HP_POP(npc_chat->finalize, HP_npc_chat_finalize) },
{ HP_POP(npc_chat->def_pattern, HP_npc_chat_def_pattern) },
@@ -1813,7 +1861,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc_chat->activate_pcreset, HP_npc_chat_activate_pcreset) },
{ HP_POP(npc_chat->lookup_pcreset, HP_npc_chat_lookup_pcreset) },
{ HP_POP(npc_chat->finalize_pcrematch_entry, HP_npc_chat_finalize_pcrematch_entry) },
-/* npc */
+/* npc_interface */
{ HP_POP(npc->init, HP_npc_init) },
{ HP_POP(npc->final, HP_npc_final) },
{ HP_POP(npc->get_new_npc_id, HP_npc_get_new_npc_id) },
@@ -1924,9 +1972,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->market_delfromsql_sub, HP_npc_market_delfromsql_sub) },
{ HP_POP(npc->db_checkid, HP_npc_db_checkid) },
{ HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) },
-/* nullpo */
+/* nullpo_interface */
{ HP_POP(nullpo->assert_report, HP_nullpo_assert_report) },
-/* party */
+/* party_interface */
{ HP_POP(party->init, HP_party_init) },
{ HP_POP(party->final, HP_party_final) },
{ HP_POP(party->search, HP_party_search) },
@@ -1976,7 +2024,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(party->check_state, HP_party_check_state) },
{ HP_POP(party->create_booking_data, HP_party_create_booking_data) },
{ HP_POP(party->db_final, HP_party_db_final) },
-/* path */
+/* path_interface */
{ HP_POP(path->blownpos, HP_path_blownpos) },
{ HP_POP(path->search, HP_path_search) },
{ HP_POP(path->search_long, HP_path_search_long) },
@@ -1984,7 +2032,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(path->distance, HP_path_distance) },
{ HP_POP(path->check_distance_client, HP_path_check_distance_client) },
{ HP_POP(path->distance_client, HP_path_distance_client) },
-/* pcg */
+/* pc_groups_interface */
{ HP_POP(pcg->init, HP_pcg_init) },
{ HP_POP(pcg->final, HP_pcg_final) },
{ HP_POP(pcg->reload, HP_pcg_reload) },
@@ -1996,7 +2044,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pcg->get_name, HP_pcg_get_name) },
{ HP_POP(pcg->get_level, HP_pcg_get_level) },
{ HP_POP(pcg->get_idx, HP_pcg_get_idx) },
-/* pc */
+/* pc_interface */
{ HP_POP(pc->init, HP_pc_init) },
{ HP_POP(pc->final, HP_pc_final) },
{ HP_POP(pc->get_dummy_sd, HP_pc_get_dummy_sd) },
@@ -2148,7 +2196,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->delspiritball, HP_pc_delspiritball) },
{ HP_POP(pc->getmaxspiritball, HP_pc_getmaxspiritball) },
{ HP_POP(pc->addfame, HP_pc_addfame) },
- { HP_POP(pc->famerank, HP_pc_famerank) },
+ { HP_POP(pc->fame_rank, HP_pc_fame_rank) },
+ { HP_POP(pc->famelist_type, HP_pc_famelist_type) },
{ HP_POP(pc->set_hate_mob, HP_pc_set_hate_mob) },
{ HP_POP(pc->readdb, HP_pc_readdb) },
{ HP_POP(pc->map_day_timer, HP_pc_map_day_timer) },
@@ -2214,7 +2263,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->check_job_name, HP_pc_check_job_name) },
{ HP_POP(pc->update_idle_time, HP_pc_update_idle_time) },
{ HP_POP(pc->have_magnifier, HP_pc_have_magnifier) },
-/* libpcre */
+ { HP_POP(pc->process_chat_message, HP_pc_process_chat_message) },
+ { HP_POP(pc->check_supernovice_call, HP_pc_check_supernovice_call) },
+ { HP_POP(pc->check_basicskill, HP_pc_check_basicskill) },
+/* pcre_interface */
{ HP_POP(libpcre->compile, HP_libpcre_compile) },
{ HP_POP(libpcre->study, HP_libpcre_study) },
{ HP_POP(libpcre->exec, HP_libpcre_exec) },
@@ -2223,7 +2275,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(libpcre->free_substring, HP_libpcre_free_substring) },
{ HP_POP(libpcre->copy_named_substring, HP_libpcre_copy_named_substring) },
{ HP_POP(libpcre->get_substring, HP_libpcre_get_substring) },
-/* pet */
+/* pet_interface */
{ HP_POP(pet->init, HP_pet_init) },
{ HP_POP(pet->final, HP_pet_final) },
{ HP_POP(pet->hungry_val, HP_pet_hungry_val) },
@@ -2262,7 +2314,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pet->recovery_timer, HP_pet_recovery_timer) },
{ HP_POP(pet->skill_support_timer, HP_pet_skill_support_timer) },
{ HP_POP(pet->read_db, HP_pet_read_db) },
-/* quest */
+/* quest_interface */
{ HP_POP(quest->init, HP_quest_init) },
{ HP_POP(quest->final, HP_quest_final) },
{ HP_POP(quest->reload, HP_quest_reload) },
@@ -2278,7 +2330,16 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(quest->clear, HP_quest_clear) },
{ HP_POP(quest->read_db, HP_quest_read_db) },
{ HP_POP(quest->read_db_sub, HP_quest_read_db_sub) },
-/* script */
+/* rnd_interface */
+ { HP_POP(rnd->init, HP_rnd_init) },
+ { HP_POP(rnd->final, HP_rnd_final) },
+ { HP_POP(rnd->seed, HP_rnd_seed) },
+ { HP_POP(rnd->random, HP_rnd_random) },
+ { HP_POP(rnd->roll, HP_rnd_roll) },
+ { HP_POP(rnd->value, HP_rnd_value) },
+ { HP_POP(rnd->uniform, HP_rnd_uniform) },
+ { HP_POP(rnd->uniform53, HP_rnd_uniform53) },
+/* script_interface */
{ HP_POP(script->init, HP_script_init) },
{ HP_POP(script->final, HP_script_final) },
{ HP_POP(script->reload, HP_script_reload) },
@@ -2300,15 +2361,18 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->push_val, HP_script_push_val) },
{ HP_POP(script->get_val, HP_script_get_val) },
{ HP_POP(script->get_val_ref_str, HP_script_get_val_ref_str) },
+ { HP_POP(script->get_val_pc_ref_str, HP_script_get_val_pc_ref_str) },
{ HP_POP(script->get_val_scope_str, HP_script_get_val_scope_str) },
{ HP_POP(script->get_val_npc_str, HP_script_get_val_npc_str) },
{ HP_POP(script->get_val_instance_str, HP_script_get_val_instance_str) },
{ HP_POP(script->get_val_ref_num, HP_script_get_val_ref_num) },
+ { HP_POP(script->get_val_pc_ref_num, HP_script_get_val_pc_ref_num) },
{ HP_POP(script->get_val_scope_num, HP_script_get_val_scope_num) },
{ HP_POP(script->get_val_npc_num, HP_script_get_val_npc_num) },
{ HP_POP(script->get_val_instance_num, HP_script_get_val_instance_num) },
{ HP_POP(script->get_val2, HP_script_get_val2) },
{ HP_POP(script->push_str, HP_script_push_str) },
+ { HP_POP(script->push_conststr, HP_script_push_conststr) },
{ HP_POP(script->push_copy, HP_script_push_copy) },
{ HP_POP(script->pop_stack, HP_script_pop_stack) },
{ HP_POP(script->set_constant, HP_script_set_constant) },
@@ -2366,18 +2430,26 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->parse_nextline, HP_script_parse_nextline) },
{ HP_POP(script->parse_variable, HP_script_parse_variable) },
{ HP_POP(script->parse_simpleexpr, HP_script_parse_simpleexpr) },
+ { HP_POP(script->parse_simpleexpr_paren, HP_script_parse_simpleexpr_paren) },
+ { HP_POP(script->parse_simpleexpr_number, HP_script_parse_simpleexpr_number) },
+ { HP_POP(script->parse_simpleexpr_string, HP_script_parse_simpleexpr_string) },
+ { HP_POP(script->parse_simpleexpr_name, HP_script_parse_simpleexpr_name) },
+ { HP_POP(script->add_translatable_string, HP_script_add_translatable_string) },
{ HP_POP(script->parse_expr, HP_script_parse_expr) },
{ HP_POP(script->parse_line, HP_script_parse_line) },
{ HP_POP(script->read_constdb, HP_script_read_constdb) },
{ HP_POP(script->constdb_comment, HP_script_constdb_comment) },
+ { HP_POP(script->load_parameters, HP_script_load_parameters) },
{ HP_POP(script->print_line, HP_script_print_line) },
{ HP_POP(script->errorwarning_sub, HP_script_errorwarning_sub) },
{ HP_POP(script->set_reg, HP_script_set_reg) },
{ HP_POP(script->set_reg_ref_str, HP_script_set_reg_ref_str) },
+ { HP_POP(script->set_reg_pc_ref_str, HP_script_set_reg_pc_ref_str) },
{ HP_POP(script->set_reg_scope_str, HP_script_set_reg_scope_str) },
{ HP_POP(script->set_reg_npc_str, HP_script_set_reg_npc_str) },
{ HP_POP(script->set_reg_instance_str, HP_script_set_reg_instance_str) },
{ HP_POP(script->set_reg_ref_num, HP_script_set_reg_ref_num) },
+ { HP_POP(script->set_reg_pc_ref_num, HP_script_set_reg_pc_ref_num) },
{ HP_POP(script->set_reg_scope_num, HP_script_set_reg_scope_num) },
{ HP_POP(script->set_reg_npc_num, HP_script_set_reg_npc_num) },
{ HP_POP(script->set_reg_instance_num, HP_script_set_reg_instance_num) },
@@ -2436,6 +2508,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->mapindexname2id, HP_script_mapindexname2id) },
{ HP_POP(script->string_dup, HP_script_string_dup) },
{ HP_POP(script->load_translations, HP_script_load_translations) },
+ { HP_POP(script->load_translation_addstring, HP_script_load_translation_addstring) },
{ HP_POP(script->load_translation, HP_script_load_translation) },
{ HP_POP(script->translation_db_destroyer, HP_script_translation_db_destroyer) },
{ HP_POP(script->clear_translations, HP_script_clear_translations) },
@@ -2446,7 +2519,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->run_use_script, HP_script_run_use_script) },
{ HP_POP(script->run_item_equip_script, HP_script_run_item_equip_script) },
{ HP_POP(script->run_item_unequip_script, HP_script_run_item_unequip_script) },
-/* searchstore */
+/* searchstore_interface */
{ HP_POP(searchstore->open, HP_searchstore_open) },
{ HP_POP(searchstore->query, HP_searchstore_query) },
{ HP_POP(searchstore->querynext, HP_searchstore_querynext) },
@@ -2457,12 +2530,12 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(searchstore->queryremote, HP_searchstore_queryremote) },
{ HP_POP(searchstore->clearremote, HP_searchstore_clearremote) },
{ HP_POP(searchstore->result, HP_searchstore_result) },
-/* showmsg */
+/* showmsg_interface */
{ HP_POP(showmsg->init, HP_showmsg_init) },
{ HP_POP(showmsg->final, HP_showmsg_final) },
{ HP_POP(showmsg->clearScreen, HP_showmsg_clearScreen) },
{ HP_POP(showmsg->showMessageV, HP_showmsg_showMessageV) },
-/* skill */
+/* skill_interface */
{ HP_POP(skill->init, HP_skill_init) },
{ HP_POP(skill->final, HP_skill_final) },
{ HP_POP(skill->reload, HP_skill_reload) },
@@ -2561,12 +2634,15 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->can_cloak, HP_skill_can_cloak) },
{ HP_POP(skill->enchant_elemental_end, HP_skill_enchant_elemental_end) },
{ HP_POP(skill->not_ok, HP_skill_not_ok) },
+ { HP_POP(skill->not_ok_unknown, HP_skill_not_ok_unknown) },
{ HP_POP(skill->not_ok_hom, HP_skill_not_ok_hom) },
+ { HP_POP(skill->not_ok_hom_unknown, HP_skill_not_ok_hom_unknown) },
{ HP_POP(skill->not_ok_mercenary, HP_skill_not_ok_mercenary) },
{ HP_POP(skill->chastle_mob_changetarget, HP_skill_chastle_mob_changetarget) },
{ HP_POP(skill->can_produce_mix, HP_skill_can_produce_mix) },
{ HP_POP(skill->produce_mix, HP_skill_produce_mix) },
{ HP_POP(skill->arrow_create, HP_skill_arrow_create) },
+ { HP_POP(skill->castend_type, HP_skill_castend_type) },
{ HP_POP(skill->castend_nodamage_id, HP_skill_castend_nodamage_id) },
{ HP_POP(skill->castend_damage_id, HP_skill_castend_damage_id) },
{ HP_POP(skill->castend_pos2, HP_skill_castend_pos2) },
@@ -2609,6 +2685,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->sit_out, HP_skill_sit_out) },
{ HP_POP(skill->unitsetmapcell, HP_skill_unitsetmapcell) },
{ HP_POP(skill->unit_onplace_timer, HP_skill_unit_onplace_timer) },
+ { HP_POP(skill->unit_onplace_timer_unknown, HP_skill_unit_onplace_timer_unknown) },
{ HP_POP(skill->unit_effect, HP_skill_unit_effect) },
{ HP_POP(skill->unit_timer_sub_onplace, HP_skill_unit_timer_sub_onplace) },
{ HP_POP(skill->unit_move_sub, HP_skill_unit_move_sub) },
@@ -2619,11 +2696,28 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->unit_timer, HP_skill_unit_timer) },
{ HP_POP(skill->unit_timer_sub, HP_skill_unit_timer_sub) },
{ HP_POP(skill->init_unit_layout, HP_skill_init_unit_layout) },
- { HP_POP(skill->parse_row_skilldb, HP_skill_parse_row_skilldb) },
- { HP_POP(skill->parse_row_requiredb, HP_skill_parse_row_requiredb) },
- { HP_POP(skill->parse_row_castdb, HP_skill_parse_row_castdb) },
- { HP_POP(skill->parse_row_castnodexdb, HP_skill_parse_row_castnodexdb) },
- { HP_POP(skill->parse_row_unitdb, HP_skill_parse_row_unitdb) },
+ { HP_POP(skill->init_unit_layout_unknown, HP_skill_init_unit_layout_unknown) },
+ { HP_POP(skill->validate_hittype, HP_skill_validate_hittype) },
+ { HP_POP(skill->validate_skilltype, HP_skill_validate_skilltype) },
+ { HP_POP(skill->validate_attacktype, HP_skill_validate_attacktype) },
+ { HP_POP(skill->validate_element, HP_skill_validate_element) },
+ { HP_POP(skill->validate_skillinfo, HP_skill_validate_skillinfo) },
+ { HP_POP(skill->validate_damagetype, HP_skill_validate_damagetype) },
+ { HP_POP(skill->validate_castnodex, HP_skill_validate_castnodex) },
+ { HP_POP(skill->validate_weapontype, HP_skill_validate_weapontype) },
+ { HP_POP(skill->validate_ammotype, HP_skill_validate_ammotype) },
+ { HP_POP(skill->validate_state, HP_skill_validate_state) },
+ { HP_POP(skill->validate_item_requirements, HP_skill_validate_item_requirements) },
+ { HP_POP(skill->validate_unit_target, HP_skill_validate_unit_target) },
+ { HP_POP(skill->validate_unit_flag, HP_skill_validate_unit_flag) },
+ { HP_POP(skill->validate_additional_fields, HP_skill_validate_additional_fields) },
+ { HP_POP(skill->validate_skilldb, HP_skill_validate_skilldb) },
+ { HP_POP(skill->validate_weapontype_sub, HP_skill_validate_weapontype_sub) },
+ { HP_POP(skill->validate_ammotype_sub, HP_skill_validate_ammotype_sub) },
+ { HP_POP(skill->validate_unit_flag_sub, HP_skill_validate_unit_flag_sub) },
+ { HP_POP(skill->read_skilldb, HP_skill_read_skilldb) },
+ { HP_POP(skill->config_set_level, HP_skill_config_set_level) },
+ { HP_POP(skill->level_set_value, HP_skill_level_set_value) },
{ HP_POP(skill->parse_row_producedb, HP_skill_parse_row_producedb) },
{ HP_POP(skill->parse_row_createarrowdb, HP_skill_parse_row_createarrowdb) },
{ HP_POP(skill->parse_row_abradb, HP_skill_parse_row_abradb) },
@@ -2680,7 +2774,10 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(skill->get_requirement_off_unknown, HP_skill_get_requirement_off_unknown) },
{ HP_POP(skill->get_requirement_item_unknown, HP_skill_get_requirement_item_unknown) },
{ HP_POP(skill->get_requirement_unknown, HP_skill_get_requirement_unknown) },
-/* sockt */
+ { HP_POP(skill->splash_target, HP_skill_splash_target) },
+ { HP_POP(skill->check_npc_chaospanic, HP_skill_check_npc_chaospanic) },
+ { HP_POP(skill->count_wos, HP_skill_count_wos) },
+/* socket_interface */
{ HP_POP(sockt->init, HP_sockt_init) },
{ HP_POP(sockt->final, HP_sockt_final) },
{ HP_POP(sockt->perform, HP_sockt_perform) },
@@ -2709,7 +2806,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sockt->trusted_ip_check, HP_sockt_trusted_ip_check) },
{ HP_POP(sockt->net_config_read_sub, HP_sockt_net_config_read_sub) },
{ HP_POP(sockt->net_config_read, HP_sockt_net_config_read) },
-/* SQL */
+/* sql_interface */
{ HP_POP(SQL->Connect, HP_SQL_Connect) },
{ HP_POP(SQL->GetTimeout, HP_SQL_GetTimeout) },
{ HP_POP(SQL->GetColumnNames, HP_SQL_GetColumnNames) },
@@ -2742,7 +2839,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(SQL->StmtFreeResult, HP_SQL_StmtFreeResult) },
{ HP_POP(SQL->StmtFree, HP_SQL_StmtFree) },
{ HP_POP(SQL->StmtShowDebug_, HP_SQL_StmtShowDebug_) },
-/* status */
+/* status_interface */
{ HP_POP(status->init, HP_status_init) },
{ HP_POP(status->final, HP_status_final) },
{ HP_POP(status->get_refine_chance, HP_status_get_refine_chance) },
@@ -2855,7 +2952,11 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(status->readdb_scconfig, HP_status_readdb_scconfig) },
{ HP_POP(status->read_job_db, HP_status_read_job_db) },
{ HP_POP(status->read_job_db_sub, HP_status_read_job_db_sub) },
-/* storage */
+ { HP_POP(status->set_sc, HP_status_set_sc) },
+ { HP_POP(status->copy, HP_status_copy) },
+ { HP_POP(status->base_matk_min, HP_status_base_matk_min) },
+ { HP_POP(status->base_matk_max, HP_status_base_matk_max) },
+/* storage_interface */
{ HP_POP(storage->reconnect, HP_storage_reconnect) },
{ HP_POP(storage->delitem, HP_storage_delitem) },
{ HP_POP(storage->open, HP_storage_open) },
@@ -2869,7 +2970,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(storage->comp_item, HP_storage_comp_item) },
{ HP_POP(storage->sortitem, HP_storage_sortitem) },
{ HP_POP(storage->reconnect_sub, HP_storage_reconnect_sub) },
-/* StrBuf */
+/* stringbuf_interface */
{ HP_POP(StrBuf->Malloc, HP_StrBuf_Malloc) },
{ HP_POP(StrBuf->Init, HP_StrBuf_Init) },
{ HP_POP(StrBuf->Vprintf, HP_StrBuf_Vprintf) },
@@ -2880,7 +2981,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(StrBuf->Clear, HP_StrBuf_Clear) },
{ HP_POP(StrBuf->Destroy, HP_StrBuf_Destroy) },
{ HP_POP(StrBuf->Free, HP_StrBuf_Free) },
-/* strlib */
+/* strlib_interface */
{ HP_POP(strlib->jstrescape, HP_strlib_jstrescape) },
{ HP_POP(strlib->jstrescapecpy, HP_strlib_jstrescapecpy) },
{ HP_POP(strlib->jmemescapecpy, HP_strlib_jmemescapecpy) },
@@ -2896,7 +2997,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(strlib->safestrnlen_, HP_strlib_safestrnlen_) },
{ HP_POP(strlib->strline_, HP_strlib_strline_) },
{ HP_POP(strlib->bin2hex_, HP_strlib_bin2hex_) },
-/* sv */
+/* sv_interface */
{ HP_POP(sv->parse_next, HP_sv_parse_next) },
{ HP_POP(sv->parse, HP_sv_parse) },
{ HP_POP(sv->split, HP_sv_split) },
@@ -2904,7 +3005,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sv->unescape_c, HP_sv_unescape_c) },
{ HP_POP(sv->skip_escaped_c, HP_sv_skip_escaped_c) },
{ HP_POP(sv->readdb, HP_sv_readdb) },
-/* sysinfo */
+/* sysinfo_interface */
{ HP_POP(sysinfo->getpagesize, HP_sysinfo_getpagesize) },
{ HP_POP(sysinfo->platform, HP_sysinfo_platform) },
{ HP_POP(sysinfo->osversion, HP_sysinfo_osversion) },
@@ -2914,6 +3015,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sysinfo->is64bit, HP_sysinfo_is64bit) },
{ HP_POP(sysinfo->compiler, HP_sysinfo_compiler) },
{ HP_POP(sysinfo->cflags, HP_sysinfo_cflags) },
+ { HP_POP(sysinfo->time, HP_sysinfo_time) },
{ HP_POP(sysinfo->vcstype, HP_sysinfo_vcstype) },
{ HP_POP(sysinfo->vcstypeid, HP_sysinfo_vcstypeid) },
{ HP_POP(sysinfo->vcsrevision_src, HP_sysinfo_vcsrevision_src) },
@@ -2922,7 +3024,19 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(sysinfo->is_superuser, HP_sysinfo_is_superuser) },
{ HP_POP(sysinfo->init, HP_sysinfo_init) },
{ HP_POP(sysinfo->final, HP_sysinfo_final) },
-/* timer */
+/* thread_interface */
+ { HP_POP(thread->init, HP_thread_init) },
+ { HP_POP(thread->final, HP_thread_final) },
+ { HP_POP(thread->create, HP_thread_create) },
+ { HP_POP(thread->create_opt, HP_thread_create_opt) },
+ { HP_POP(thread->destroy, HP_thread_destroy) },
+ { HP_POP(thread->self, HP_thread_self) },
+ { HP_POP(thread->get_tid, HP_thread_get_tid) },
+ { HP_POP(thread->wait, HP_thread_wait) },
+ { HP_POP(thread->prio_set, HP_thread_prio_set) },
+ { HP_POP(thread->prio_get, HP_thread_prio_get) },
+ { HP_POP(thread->yield, HP_thread_yield) },
+/* timer_interface */
{ HP_POP(timer->gettick, HP_timer_gettick) },
{ HP_POP(timer->gettick_nocache, HP_timer_gettick_nocache) },
{ HP_POP(timer->add, HP_timer_add) },
@@ -2936,7 +3050,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(timer->perform, HP_timer_perform) },
{ HP_POP(timer->init, HP_timer_init) },
{ HP_POP(timer->final, HP_timer_final) },
-/* trade */
+/* trade_interface */
{ HP_POP(trade->request, HP_trade_request) },
{ HP_POP(trade->ack, HP_trade_ack) },
{ HP_POP(trade->check_impossible, HP_trade_check_impossible) },
@@ -2946,11 +3060,12 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(trade->ok, HP_trade_ok) },
{ HP_POP(trade->cancel, HP_trade_cancel) },
{ HP_POP(trade->commit, HP_trade_commit) },
-/* unit */
+/* unit_interface */
{ HP_POP(unit->init, HP_unit_init) },
{ HP_POP(unit->final, HP_unit_final) },
{ HP_POP(unit->bl2ud, HP_unit_bl2ud) },
{ HP_POP(unit->bl2ud2, HP_unit_bl2ud2) },
+ { HP_POP(unit->init_ud, HP_unit_init_ud) },
{ HP_POP(unit->attack_timer, HP_unit_attack_timer) },
{ HP_POP(unit->walktoxy_timer, HP_unit_walktoxy_timer) },
{ HP_POP(unit->walktoxy_sub, HP_unit_walktoxy_sub) },
@@ -2995,7 +3110,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(unit->remove_map_pc, HP_unit_remove_map_pc) },
{ HP_POP(unit->free_pc, HP_unit_free_pc) },
{ HP_POP(unit->free, HP_unit_free) },
-/* vending */
+/* vending_interface */
{ HP_POP(vending->init, HP_vending_init) },
{ HP_POP(vending->final, HP_vending_final) },
{ HP_POP(vending->close, HP_vending_close) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index f7b6ef056..c0b70bf60 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,17 +23,19 @@
* as it will get overwritten.
*/
-/* HCache */
+/* GENERATED FILE DO NOT EDIT */
+
+/* HCache_interface */
void HP_HCache_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_HCache_init_pre ) {
+ if (HPMHooks.count.HP_HCache_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41,9 +43,9 @@ void HP_HCache_init(void) {
{
HPMHooks.source.HCache.init();
}
- if( HPMHooks.count.HP_HCache_init_post ) {
+ if (HPMHooks.count.HP_HCache_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_init_post[hIndex].func;
postHookFunc();
}
@@ -53,14 +55,14 @@ void HP_HCache_init(void) {
bool HP_HCache_check(const char *file) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_HCache_check_pre ) {
- bool (*preHookFunc) (const char *file);
+ if (HPMHooks.count.HP_HCache_check_pre > 0) {
+ bool (*preHookFunc) (const char **file);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_check_pre[hIndex].func;
- retVal___ = preHookFunc(file);
+ retVal___ = preHookFunc(&file);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68,9 +70,9 @@ bool HP_HCache_check(const char *file) {
{
retVal___ = HPMHooks.source.HCache.check(file);
}
- if( HPMHooks.count.HP_HCache_check_post ) {
+ if (HPMHooks.count.HP_HCache_check_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *file);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_check_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file);
}
@@ -80,14 +82,14 @@ bool HP_HCache_check(const char *file) {
FILE* HP_HCache_open(const char *file, const char *opt) {
int hIndex = 0;
FILE* retVal___ = NULL;
- if( HPMHooks.count.HP_HCache_open_pre ) {
- FILE* (*preHookFunc) (const char *file, const char *opt);
+ if (HPMHooks.count.HP_HCache_open_pre > 0) {
+ FILE* (*preHookFunc) (const char **file, const char **opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_HCache_open_pre[hIndex].func;
- retVal___ = preHookFunc(file, opt);
+ retVal___ = preHookFunc(&file, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -95,26 +97,26 @@ FILE* HP_HCache_open(const char *file, const char *opt) {
{
retVal___ = HPMHooks.source.HCache.open(file, opt);
}
- if( HPMHooks.count.HP_HCache_open_post ) {
+ if (HPMHooks.count.HP_HCache_open_post > 0) {
FILE* (*postHookFunc) (FILE* retVal___, const char *file, const char *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_HCache_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_HCache_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file, opt);
}
}
return retVal___;
}
-/* atcommand */
+/* atcommand_interface */
void HP_atcommand_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_init_pre ) {
+ if (HPMHooks.count.HP_atcommand_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -122,25 +124,25 @@ void HP_atcommand_init(bool minimal) {
{
HPMHooks.source.atcommand.init(minimal);
}
- if( HPMHooks.count.HP_atcommand_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_atcommand_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_final_pre ) {
+ if (HPMHooks.count.HP_atcommand_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -148,9 +150,9 @@ void HP_atcommand_final(void) {
{
HPMHooks.source.atcommand.final();
}
- if( HPMHooks.count.HP_atcommand_final_post ) {
+ if (HPMHooks.count.HP_atcommand_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_final_post[hIndex].func;
postHookFunc();
}
@@ -160,14 +162,14 @@ void HP_atcommand_final(void) {
bool HP_atcommand_exec(const int fd, struct map_session_data *sd, const char *message, bool player_invoked) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_atcommand_exec_pre ) {
- bool (*preHookFunc) (const int *fd, struct map_session_data *sd, const char *message, bool *player_invoked);
+ if (HPMHooks.count.HP_atcommand_exec_pre > 0) {
+ bool (*preHookFunc) (const int *fd, struct map_session_data **sd, const char **message, bool *player_invoked);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exec_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exec_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_exec_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, sd, message, &player_invoked);
+ retVal___ = preHookFunc(&fd, &sd, &message, &player_invoked);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -175,11 +177,11 @@ bool HP_atcommand_exec(const int fd, struct map_session_data *sd, const char *me
{
retVal___ = HPMHooks.source.atcommand.exec(fd, sd, message, player_invoked);
}
- if( HPMHooks.count.HP_atcommand_exec_post ) {
- bool (*postHookFunc) (bool retVal___, const int *fd, struct map_session_data *sd, const char *message, bool *player_invoked);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exec_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_exec_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const int fd, struct map_session_data *sd, const char *message, bool player_invoked);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exec_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_exec_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, sd, message, &player_invoked);
+ retVal___ = postHookFunc(retVal___, fd, sd, message, player_invoked);
}
}
return retVal___;
@@ -187,14 +189,14 @@ bool HP_atcommand_exec(const int fd, struct map_session_data *sd, const char *me
bool HP_atcommand_create(char *name, AtCommandFunc func) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_atcommand_create_pre ) {
- bool (*preHookFunc) (char *name, AtCommandFunc *func);
+ if (HPMHooks.count.HP_atcommand_create_pre > 0) {
+ bool (*preHookFunc) (char **name, AtCommandFunc *func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_create_pre[hIndex].func;
- retVal___ = preHookFunc(name, &func);
+ retVal___ = preHookFunc(&name, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -202,11 +204,11 @@ bool HP_atcommand_create(char *name, AtCommandFunc func) {
{
retVal___ = HPMHooks.source.atcommand.create(name, func);
}
- if( HPMHooks.count.HP_atcommand_create_post ) {
- bool (*postHookFunc) (bool retVal___, char *name, AtCommandFunc *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_create_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *name, AtCommandFunc func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &func);
+ retVal___ = postHookFunc(retVal___, name, func);
}
}
return retVal___;
@@ -214,14 +216,14 @@ bool HP_atcommand_create(char *name, AtCommandFunc func) {
bool HP_atcommand_can_use(struct map_session_data *sd, const char *command) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_atcommand_can_use_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *command);
+ if (HPMHooks.count.HP_atcommand_can_use_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **command);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_can_use_pre[hIndex].func;
- retVal___ = preHookFunc(sd, command);
+ retVal___ = preHookFunc(&sd, &command);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -229,9 +231,9 @@ bool HP_atcommand_can_use(struct map_session_data *sd, const char *command) {
{
retVal___ = HPMHooks.source.atcommand.can_use(sd, command);
}
- if( HPMHooks.count.HP_atcommand_can_use_post ) {
+ if (HPMHooks.count.HP_atcommand_can_use_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *command);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_can_use_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, command);
}
@@ -241,14 +243,14 @@ bool HP_atcommand_can_use(struct map_session_data *sd, const char *command) {
bool HP_atcommand_can_use2(struct map_session_data *sd, const char *command, AtCommandType type) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_atcommand_can_use2_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *command, AtCommandType *type);
+ if (HPMHooks.count.HP_atcommand_can_use2_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **command, AtCommandType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_can_use2_pre[hIndex].func;
- retVal___ = preHookFunc(sd, command, &type);
+ retVal___ = preHookFunc(&sd, &command, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -256,25 +258,25 @@ bool HP_atcommand_can_use2(struct map_session_data *sd, const char *command, AtC
{
retVal___ = HPMHooks.source.atcommand.can_use2(sd, command, type);
}
- if( HPMHooks.count.HP_atcommand_can_use2_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *command, AtCommandType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_can_use2_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *command, AtCommandType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_can_use2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_can_use2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, command, &type);
+ retVal___ = postHookFunc(retVal___, sd, command, type);
}
}
return retVal___;
}
-void HP_atcommand_load_groups(GroupSettings **groups, config_setting_t **commands_, size_t sz) {
+void HP_atcommand_load_groups(GroupSettings **groups, struct config_setting_t **commands_, size_t sz) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_load_groups_pre ) {
- void (*preHookFunc) (GroupSettings **groups, config_setting_t **commands_, size_t *sz);
+ if (HPMHooks.count.HP_atcommand_load_groups_pre > 0) {
+ void (*preHookFunc) (GroupSettings ***groups, struct config_setting_t ***commands_, size_t *sz);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_load_groups_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_load_groups_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_load_groups_pre[hIndex].func;
- preHookFunc(groups, commands_, &sz);
+ preHookFunc(&groups, &commands_, &sz);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -282,11 +284,11 @@ void HP_atcommand_load_groups(GroupSettings **groups, config_setting_t **command
{
HPMHooks.source.atcommand.load_groups(groups, commands_, sz);
}
- if( HPMHooks.count.HP_atcommand_load_groups_post ) {
- void (*postHookFunc) (GroupSettings **groups, config_setting_t **commands_, size_t *sz);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_load_groups_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_load_groups_post > 0) {
+ void (*postHookFunc) (GroupSettings **groups, struct config_setting_t **commands_, size_t sz);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_load_groups_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_load_groups_post[hIndex].func;
- postHookFunc(groups, commands_, &sz);
+ postHookFunc(groups, commands_, sz);
}
}
return;
@@ -294,14 +296,14 @@ void HP_atcommand_load_groups(GroupSettings **groups, config_setting_t **command
AtCommandInfo* HP_atcommand_exists(const char *name) {
int hIndex = 0;
AtCommandInfo* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_exists_pre ) {
- AtCommandInfo* (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_atcommand_exists_pre > 0) {
+ AtCommandInfo* (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exists_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exists_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_exists_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -309,9 +311,9 @@ AtCommandInfo* HP_atcommand_exists(const char *name) {
{
retVal___ = HPMHooks.source.atcommand.exists(name);
}
- if( HPMHooks.count.HP_atcommand_exists_post ) {
+ if (HPMHooks.count.HP_atcommand_exists_post > 0) {
AtCommandInfo* (*postHookFunc) (AtCommandInfo* retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exists_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_exists_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_exists_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -321,14 +323,14 @@ AtCommandInfo* HP_atcommand_exists(const char *name) {
bool HP_atcommand_msg_read(const char *cfg_name, bool allow_override) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_atcommand_msg_read_pre ) {
- bool (*preHookFunc) (const char *cfg_name, bool *allow_override);
+ if (HPMHooks.count.HP_atcommand_msg_read_pre > 0) {
+ bool (*preHookFunc) (const char **cfg_name, bool *allow_override);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_msg_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfg_name, &allow_override);
+ retVal___ = preHookFunc(&cfg_name, &allow_override);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -336,25 +338,25 @@ bool HP_atcommand_msg_read(const char *cfg_name, bool allow_override) {
{
retVal___ = HPMHooks.source.atcommand.msg_read(cfg_name, allow_override);
}
- if( HPMHooks.count.HP_atcommand_msg_read_post ) {
- bool (*postHookFunc) (bool retVal___, const char *cfg_name, bool *allow_override);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_msg_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *cfg_name, bool allow_override);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_msg_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfg_name, &allow_override);
+ retVal___ = postHookFunc(retVal___, cfg_name, allow_override);
}
}
return retVal___;
}
void HP_atcommand_final_msg(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_final_msg_pre ) {
+ if (HPMHooks.count.HP_atcommand_final_msg_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_msg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_msg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_final_msg_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -362,9 +364,9 @@ void HP_atcommand_final_msg(void) {
{
HPMHooks.source.atcommand.final_msg();
}
- if( HPMHooks.count.HP_atcommand_final_msg_post ) {
+ if (HPMHooks.count.HP_atcommand_final_msg_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_msg_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_final_msg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_final_msg_post[hIndex].func;
postHookFunc();
}
@@ -374,14 +376,14 @@ void HP_atcommand_final_msg(void) {
struct atcmd_binding_data* HP_atcommand_get_bind_byname(const char *name) {
int hIndex = 0;
struct atcmd_binding_data* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_get_bind_byname_pre ) {
- struct atcmd_binding_data* (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_atcommand_get_bind_byname_pre > 0) {
+ struct atcmd_binding_data* (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_bind_byname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_bind_byname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_get_bind_byname_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -389,9 +391,9 @@ struct atcmd_binding_data* HP_atcommand_get_bind_byname(const char *name) {
{
retVal___ = HPMHooks.source.atcommand.get_bind_byname(name);
}
- if( HPMHooks.count.HP_atcommand_get_bind_byname_post ) {
+ if (HPMHooks.count.HP_atcommand_get_bind_byname_post > 0) {
struct atcmd_binding_data* (*postHookFunc) (struct atcmd_binding_data* retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_bind_byname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_bind_byname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_get_bind_byname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -401,14 +403,14 @@ struct atcmd_binding_data* HP_atcommand_get_bind_byname(const char *name) {
AtCommandInfo* HP_atcommand_get_info_byname(const char *name) {
int hIndex = 0;
AtCommandInfo* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_get_info_byname_pre ) {
- AtCommandInfo* (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_atcommand_get_info_byname_pre > 0) {
+ AtCommandInfo* (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_info_byname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_info_byname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_get_info_byname_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -416,9 +418,9 @@ AtCommandInfo* HP_atcommand_get_info_byname(const char *name) {
{
retVal___ = HPMHooks.source.atcommand.get_info_byname(name);
}
- if( HPMHooks.count.HP_atcommand_get_info_byname_post ) {
+ if (HPMHooks.count.HP_atcommand_get_info_byname_post > 0) {
AtCommandInfo* (*postHookFunc) (AtCommandInfo* retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_info_byname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_info_byname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_get_info_byname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -428,14 +430,14 @@ AtCommandInfo* HP_atcommand_get_info_byname(const char *name) {
const char* HP_atcommand_check_alias(const char *aliasname) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_check_alias_pre ) {
- const char* (*preHookFunc) (const char *aliasname);
+ if (HPMHooks.count.HP_atcommand_check_alias_pre > 0) {
+ const char* (*preHookFunc) (const char **aliasname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_check_alias_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_check_alias_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_check_alias_pre[hIndex].func;
- retVal___ = preHookFunc(aliasname);
+ retVal___ = preHookFunc(&aliasname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -443,9 +445,9 @@ const char* HP_atcommand_check_alias(const char *aliasname) {
{
retVal___ = HPMHooks.source.atcommand.check_alias(aliasname);
}
- if( HPMHooks.count.HP_atcommand_check_alias_post ) {
+ if (HPMHooks.count.HP_atcommand_check_alias_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *aliasname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_check_alias_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_check_alias_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_check_alias_post[hIndex].func;
retVal___ = postHookFunc(retVal___, aliasname);
}
@@ -454,14 +456,14 @@ const char* HP_atcommand_check_alias(const char *aliasname) {
}
void HP_atcommand_get_suggestions(struct map_session_data *sd, const char *name, bool is_atcmd_cmd) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_get_suggestions_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *name, bool *is_atcmd_cmd);
+ if (HPMHooks.count.HP_atcommand_get_suggestions_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **name, bool *is_atcmd_cmd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_suggestions_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_suggestions_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_get_suggestions_pre[hIndex].func;
- preHookFunc(sd, name, &is_atcmd_cmd);
+ preHookFunc(&sd, &name, &is_atcmd_cmd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -469,25 +471,25 @@ void HP_atcommand_get_suggestions(struct map_session_data *sd, const char *name,
{
HPMHooks.source.atcommand.get_suggestions(sd, name, is_atcmd_cmd);
}
- if( HPMHooks.count.HP_atcommand_get_suggestions_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *name, bool *is_atcmd_cmd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_suggestions_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_get_suggestions_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *name, bool is_atcmd_cmd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_suggestions_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_get_suggestions_post[hIndex].func;
- postHookFunc(sd, name, &is_atcmd_cmd);
+ postHookFunc(sd, name, is_atcmd_cmd);
}
}
return;
}
void HP_atcommand_config_read(const char *config_filename) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_config_read_pre ) {
- void (*preHookFunc) (const char *config_filename);
+ if (HPMHooks.count.HP_atcommand_config_read_pre > 0) {
+ void (*preHookFunc) (const char **config_filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_config_read_pre[hIndex].func;
- preHookFunc(config_filename);
+ preHookFunc(&config_filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -495,9 +497,9 @@ void HP_atcommand_config_read(const char *config_filename) {
{
HPMHooks.source.atcommand.config_read(config_filename);
}
- if( HPMHooks.count.HP_atcommand_config_read_post ) {
+ if (HPMHooks.count.HP_atcommand_config_read_post > 0) {
void (*postHookFunc) (const char *config_filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_config_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_config_read_post[hIndex].func;
postHookFunc(config_filename);
}
@@ -507,16 +509,16 @@ void HP_atcommand_config_read(const char *config_filename) {
int HP_atcommand_stopattack(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_stopattack_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_atcommand_stopattack_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_stopattack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_stopattack_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_atcommand_stopattack_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -526,9 +528,9 @@ int HP_atcommand_stopattack(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.atcommand.stopattack(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_atcommand_stopattack_post ) {
+ if (HPMHooks.count.HP_atcommand_stopattack_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_stopattack_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_stopattack_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_atcommand_stopattack_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -540,16 +542,16 @@ int HP_atcommand_stopattack(struct block_list *bl, va_list ap) {
int HP_atcommand_pvpoff_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_pvpoff_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_atcommand_pvpoff_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpoff_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpoff_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_atcommand_pvpoff_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -559,9 +561,9 @@ int HP_atcommand_pvpoff_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.atcommand.pvpoff_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_atcommand_pvpoff_sub_post ) {
+ if (HPMHooks.count.HP_atcommand_pvpoff_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpoff_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpoff_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_atcommand_pvpoff_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -573,16 +575,16 @@ int HP_atcommand_pvpoff_sub(struct block_list *bl, va_list ap) {
int HP_atcommand_pvpon_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_pvpon_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_atcommand_pvpon_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpon_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpon_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_atcommand_pvpon_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -592,9 +594,9 @@ int HP_atcommand_pvpon_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.atcommand.pvpon_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_atcommand_pvpon_sub_post ) {
+ if (HPMHooks.count.HP_atcommand_pvpon_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpon_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_pvpon_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_atcommand_pvpon_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -606,16 +608,16 @@ int HP_atcommand_pvpon_sub(struct block_list *bl, va_list ap) {
int HP_atcommand_atkillmonster_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_atkillmonster_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_atcommand_atkillmonster_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_atkillmonster_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_atkillmonster_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_atcommand_atkillmonster_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -625,9 +627,9 @@ int HP_atcommand_atkillmonster_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.atcommand.atkillmonster_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_atcommand_atkillmonster_sub_post ) {
+ if (HPMHooks.count.HP_atcommand_atkillmonster_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_atkillmonster_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_atkillmonster_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_atcommand_atkillmonster_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -638,14 +640,14 @@ int HP_atcommand_atkillmonster_sub(struct block_list *bl, va_list ap) {
}
void HP_atcommand_raise_sub(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_raise_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_atcommand_raise_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_raise_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_raise_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_raise_sub_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -653,9 +655,9 @@ void HP_atcommand_raise_sub(struct map_session_data *sd) {
{
HPMHooks.source.atcommand.raise_sub(sd);
}
- if( HPMHooks.count.HP_atcommand_raise_sub_post ) {
+ if (HPMHooks.count.HP_atcommand_raise_sub_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_raise_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_raise_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_raise_sub_post[hIndex].func;
postHookFunc(sd);
}
@@ -664,14 +666,14 @@ void HP_atcommand_raise_sub(struct map_session_data *sd) {
}
void HP_atcommand_get_jail_time(int jailtime, int *year, int *month, int *day, int *hour, int *minute) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_get_jail_time_pre ) {
- void (*preHookFunc) (int *jailtime, int *year, int *month, int *day, int *hour, int *minute);
+ if (HPMHooks.count.HP_atcommand_get_jail_time_pre > 0) {
+ void (*preHookFunc) (int *jailtime, int **year, int **month, int **day, int **hour, int **minute);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_jail_time_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_jail_time_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_get_jail_time_pre[hIndex].func;
- preHookFunc(&jailtime, year, month, day, hour, minute);
+ preHookFunc(&jailtime, &year, &month, &day, &hour, &minute);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -679,11 +681,11 @@ void HP_atcommand_get_jail_time(int jailtime, int *year, int *month, int *day, i
{
HPMHooks.source.atcommand.get_jail_time(jailtime, year, month, day, hour, minute);
}
- if( HPMHooks.count.HP_atcommand_get_jail_time_post ) {
- void (*postHookFunc) (int *jailtime, int *year, int *month, int *day, int *hour, int *minute);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_jail_time_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_get_jail_time_post > 0) {
+ void (*postHookFunc) (int jailtime, int *year, int *month, int *day, int *hour, int *minute);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_get_jail_time_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_get_jail_time_post[hIndex].func;
- postHookFunc(&jailtime, year, month, day, hour, minute);
+ postHookFunc(jailtime, year, month, day, hour, minute);
}
}
return;
@@ -691,16 +693,16 @@ void HP_atcommand_get_jail_time(int jailtime, int *year, int *month, int *day, i
int HP_atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_cleanfloor_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_atcommand_cleanfloor_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cleanfloor_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cleanfloor_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_atcommand_cleanfloor_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -710,9 +712,9 @@ int HP_atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.atcommand.cleanfloor_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_atcommand_cleanfloor_sub_post ) {
+ if (HPMHooks.count.HP_atcommand_cleanfloor_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cleanfloor_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cleanfloor_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_atcommand_cleanfloor_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -724,16 +726,16 @@ int HP_atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) {
int HP_atcommand_mutearea_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_mutearea_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_atcommand_mutearea_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_mutearea_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_mutearea_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_atcommand_mutearea_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -743,9 +745,9 @@ int HP_atcommand_mutearea_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.atcommand.mutearea_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_atcommand_mutearea_sub_post ) {
+ if (HPMHooks.count.HP_atcommand_mutearea_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_mutearea_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_mutearea_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_atcommand_mutearea_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -756,14 +758,14 @@ int HP_atcommand_mutearea_sub(struct block_list *bl, va_list ap) {
}
void HP_atcommand_getring(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_getring_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_atcommand_getring_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_getring_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -771,9 +773,9 @@ void HP_atcommand_getring(struct map_session_data *sd) {
{
HPMHooks.source.atcommand.getring(sd);
}
- if( HPMHooks.count.HP_atcommand_getring_post ) {
+ if (HPMHooks.count.HP_atcommand_getring_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_getring_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_getring_post[hIndex].func;
postHookFunc(sd);
}
@@ -782,14 +784,14 @@ void HP_atcommand_getring(struct map_session_data *sd) {
}
void HP_atcommand_channel_help(int fd, const char *command, bool can_create) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_channel_help_pre ) {
- void (*preHookFunc) (int *fd, const char *command, bool *can_create);
+ if (HPMHooks.count.HP_atcommand_channel_help_pre > 0) {
+ void (*preHookFunc) (int *fd, const char **command, bool *can_create);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_channel_help_pre[hIndex].func;
- preHookFunc(&fd, command, &can_create);
+ preHookFunc(&fd, &command, &can_create);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -797,25 +799,25 @@ void HP_atcommand_channel_help(int fd, const char *command, bool can_create) {
{
HPMHooks.source.atcommand.channel_help(fd, command, can_create);
}
- if( HPMHooks.count.HP_atcommand_channel_help_post ) {
- void (*postHookFunc) (int *fd, const char *command, bool *can_create);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_channel_help_post > 0) {
+ void (*postHookFunc) (int fd, const char *command, bool can_create);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_channel_help_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_channel_help_post[hIndex].func;
- postHookFunc(&fd, command, &can_create);
+ postHookFunc(fd, command, can_create);
}
}
return;
}
void HP_atcommand_commands_sub(struct map_session_data *sd, const int fd, AtCommandType type) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_commands_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const int *fd, AtCommandType *type);
+ if (HPMHooks.count.HP_atcommand_commands_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const int *fd, AtCommandType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_commands_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_commands_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_commands_sub_pre[hIndex].func;
- preHookFunc(sd, &fd, &type);
+ preHookFunc(&sd, &fd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -823,25 +825,25 @@ void HP_atcommand_commands_sub(struct map_session_data *sd, const int fd, AtComm
{
HPMHooks.source.atcommand.commands_sub(sd, fd, type);
}
- if( HPMHooks.count.HP_atcommand_commands_sub_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const int *fd, AtCommandType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_commands_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_commands_sub_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const int fd, AtCommandType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_commands_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_commands_sub_post[hIndex].func;
- postHookFunc(sd, &fd, &type);
+ postHookFunc(sd, fd, type);
}
}
return;
}
void HP_atcommand_cmd_db_clear(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_cmd_db_clear_pre ) {
+ if (HPMHooks.count.HP_atcommand_cmd_db_clear_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_cmd_db_clear_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -849,28 +851,28 @@ void HP_atcommand_cmd_db_clear(void) {
{
HPMHooks.source.atcommand.cmd_db_clear();
}
- if( HPMHooks.count.HP_atcommand_cmd_db_clear_post ) {
+ if (HPMHooks.count.HP_atcommand_cmd_db_clear_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_cmd_db_clear_post[hIndex].func;
postHookFunc();
}
}
return;
}
-int HP_atcommand_cmd_db_clear_sub(DBKey key, DBData *data, va_list args) {
+int HP_atcommand_cmd_db_clear_sub(union DBKey key, struct DBData *data, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_atcommand_cmd_db_clear_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list args);
+ if (HPMHooks.count.HP_atcommand_cmd_db_clear_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_sub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_atcommand_cmd_db_clear_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, args___copy);
+ retVal___ = preHookFunc(&key, &data, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -880,12 +882,12 @@ int HP_atcommand_cmd_db_clear_sub(DBKey key, DBData *data, va_list args) {
retVal___ = HPMHooks.source.atcommand.cmd_db_clear_sub(key, data, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_atcommand_cmd_db_clear_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_cmd_db_clear_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_cmd_db_clear_sub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_atcommand_cmd_db_clear_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, args___copy);
+ retVal___ = postHookFunc(retVal___, key, data, args___copy);
va_end(args___copy);
}
}
@@ -893,14 +895,14 @@ int HP_atcommand_cmd_db_clear_sub(DBKey key, DBData *data, va_list args) {
}
void HP_atcommand_doload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_doload_pre ) {
+ if (HPMHooks.count.HP_atcommand_doload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_doload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_doload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_doload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -908,9 +910,9 @@ void HP_atcommand_doload(void) {
{
HPMHooks.source.atcommand.doload();
}
- if( HPMHooks.count.HP_atcommand_doload_post ) {
+ if (HPMHooks.count.HP_atcommand_doload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_doload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_doload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_doload_post[hIndex].func;
postHookFunc();
}
@@ -919,14 +921,14 @@ void HP_atcommand_doload(void) {
}
void HP_atcommand_base_commands(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_base_commands_pre ) {
+ if (HPMHooks.count.HP_atcommand_base_commands_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_base_commands_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_base_commands_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_base_commands_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -934,9 +936,9 @@ void HP_atcommand_base_commands(void) {
{
HPMHooks.source.atcommand.base_commands();
}
- if( HPMHooks.count.HP_atcommand_base_commands_post ) {
+ if (HPMHooks.count.HP_atcommand_base_commands_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_base_commands_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_base_commands_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_base_commands_post[hIndex].func;
postHookFunc();
}
@@ -946,14 +948,14 @@ void HP_atcommand_base_commands(void) {
bool HP_atcommand_add(char *name, AtCommandFunc func, bool replace) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_atcommand_add_pre ) {
- bool (*preHookFunc) (char *name, AtCommandFunc *func, bool *replace);
+ if (HPMHooks.count.HP_atcommand_add_pre > 0) {
+ bool (*preHookFunc) (char **name, AtCommandFunc *func, bool *replace);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_add_pre[hIndex].func;
- retVal___ = preHookFunc(name, &func, &replace);
+ retVal___ = preHookFunc(&name, &func, &replace);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -961,11 +963,11 @@ bool HP_atcommand_add(char *name, AtCommandFunc func, bool replace) {
{
retVal___ = HPMHooks.source.atcommand.add(name, func, replace);
}
- if( HPMHooks.count.HP_atcommand_add_post ) {
- bool (*postHookFunc) (bool retVal___, char *name, AtCommandFunc *func, bool *replace);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_add_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *name, AtCommandFunc func, bool replace);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &func, &replace);
+ retVal___ = postHookFunc(retVal___, name, func, replace);
}
}
return retVal___;
@@ -973,14 +975,14 @@ bool HP_atcommand_add(char *name, AtCommandFunc func, bool replace) {
const char* HP_atcommand_msg(int msg_number) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_msg_pre ) {
+ if (HPMHooks.count.HP_atcommand_msg_pre > 0) {
const char* (*preHookFunc) (int *msg_number);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_msg_pre[hIndex].func;
retVal___ = preHookFunc(&msg_number);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -988,25 +990,25 @@ const char* HP_atcommand_msg(int msg_number) {
{
retVal___ = HPMHooks.source.atcommand.msg(msg_number);
}
- if( HPMHooks.count.HP_atcommand_msg_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *msg_number);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_msg_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int msg_number);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_msg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &msg_number);
+ retVal___ = postHookFunc(retVal___, msg_number);
}
}
return retVal___;
}
void HP_atcommand_expand_message_table(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_atcommand_expand_message_table_pre ) {
+ if (HPMHooks.count.HP_atcommand_expand_message_table_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_expand_message_table_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_expand_message_table_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_expand_message_table_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1014,9 +1016,9 @@ void HP_atcommand_expand_message_table(void) {
{
HPMHooks.source.atcommand.expand_message_table();
}
- if( HPMHooks.count.HP_atcommand_expand_message_table_post ) {
+ if (HPMHooks.count.HP_atcommand_expand_message_table_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_expand_message_table_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_expand_message_table_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_expand_message_table_post[hIndex].func;
postHookFunc();
}
@@ -1026,14 +1028,14 @@ void HP_atcommand_expand_message_table(void) {
const char* HP_atcommand_msgfd(int fd, int msg_number) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_msgfd_pre ) {
+ if (HPMHooks.count.HP_atcommand_msgfd_pre > 0) {
const char* (*preHookFunc) (int *fd, int *msg_number);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgfd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgfd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_msgfd_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &msg_number);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1041,11 +1043,11 @@ const char* HP_atcommand_msgfd(int fd, int msg_number) {
{
retVal___ = HPMHooks.source.atcommand.msgfd(fd, msg_number);
}
- if( HPMHooks.count.HP_atcommand_msgfd_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *fd, int *msg_number);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgfd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_msgfd_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int fd, int msg_number);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgfd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_msgfd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &msg_number);
+ retVal___ = postHookFunc(retVal___, fd, msg_number);
}
}
return retVal___;
@@ -1053,14 +1055,14 @@ const char* HP_atcommand_msgfd(int fd, int msg_number) {
const char* HP_atcommand_msgsd(struct map_session_data *sd, int msg_number) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_atcommand_msgsd_pre ) {
- const char* (*preHookFunc) (struct map_session_data *sd, int *msg_number);
+ if (HPMHooks.count.HP_atcommand_msgsd_pre > 0) {
+ const char* (*preHookFunc) (struct map_session_data **sd, int *msg_number);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgsd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgsd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_atcommand_msgsd_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &msg_number);
+ retVal___ = preHookFunc(&sd, &msg_number);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1068,26 +1070,26 @@ const char* HP_atcommand_msgsd(struct map_session_data *sd, int msg_number) {
{
retVal___ = HPMHooks.source.atcommand.msgsd(sd, msg_number);
}
- if( HPMHooks.count.HP_atcommand_msgsd_post ) {
- const char* (*postHookFunc) (const char* retVal___, struct map_session_data *sd, int *msg_number);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgsd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_atcommand_msgsd_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, struct map_session_data *sd, int msg_number);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_msgsd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_atcommand_msgsd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &msg_number);
+ retVal___ = postHookFunc(retVal___, sd, msg_number);
}
}
return retVal___;
}
-/* battle */
+/* battle_interface */
void HP_battle_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_init_pre ) {
+ if (HPMHooks.count.HP_battle_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1095,25 +1097,25 @@ void HP_battle_init(bool minimal) {
{
HPMHooks.source.battle.init(minimal);
}
- if( HPMHooks.count.HP_battle_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_battle_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_final_pre ) {
+ if (HPMHooks.count.HP_battle_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1121,9 +1123,9 @@ void HP_battle_final(void) {
{
HPMHooks.source.battle.final();
}
- if( HPMHooks.count.HP_battle_final_post ) {
+ if (HPMHooks.count.HP_battle_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_final_post[hIndex].func;
postHookFunc();
}
@@ -1132,16 +1134,15 @@ void HP_battle_final(void) {
}
struct Damage HP_battle_calc_attack(int attack_type, struct block_list *bl, struct block_list *target, uint16 skill_id, uint16 skill_lv, int count) {
int hIndex = 0;
- struct Damage retVal___;
- memset(&retVal___, '\0', sizeof(struct Damage));
- if( HPMHooks.count.HP_battle_calc_attack_pre ) {
- struct Damage (*preHookFunc) (int *attack_type, struct block_list *bl, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *count);
+ struct Damage retVal___ = { 0 };
+ if (HPMHooks.count.HP_battle_calc_attack_pre > 0) {
+ struct Damage (*preHookFunc) (int *attack_type, struct block_list **bl, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_attack_pre[hIndex].func;
- retVal___ = preHookFunc(&attack_type, bl, target, &skill_id, &skill_lv, &count);
+ retVal___ = preHookFunc(&attack_type, &bl, &target, &skill_id, &skill_lv, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1149,11 +1150,11 @@ struct Damage HP_battle_calc_attack(int attack_type, struct block_list *bl, stru
{
retVal___ = HPMHooks.source.battle.calc_attack(attack_type, bl, target, skill_id, skill_lv, count);
}
- if( HPMHooks.count.HP_battle_calc_attack_post ) {
- struct Damage (*postHookFunc) (struct Damage retVal___, int *attack_type, struct block_list *bl, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_attack_post > 0) {
+ struct Damage (*postHookFunc) (struct Damage retVal___, int attack_type, struct block_list *bl, struct block_list *target, uint16 skill_id, uint16 skill_lv, int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &attack_type, bl, target, &skill_id, &skill_lv, &count);
+ retVal___ = postHookFunc(retVal___, attack_type, bl, target, skill_id, skill_lv, count);
}
}
return retVal___;
@@ -1161,14 +1162,14 @@ struct Damage HP_battle_calc_attack(int attack_type, struct block_list *bl, stru
int64 HP_battle_calc_damage(struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_damage_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *bl, struct Damage *d, int64 *damage, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_battle_calc_damage_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, d, &damage, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&src, &bl, &d, &damage, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1176,11 +1177,38 @@ int64 HP_battle_calc_damage(struct block_list *src, struct block_list *bl, struc
{
retVal___ = HPMHooks.source.battle.calc_damage(src, bl, d, damage, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_battle_calc_damage_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 *damage, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_damage_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, d, &damage, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, src, bl, d, damage, skill_id, skill_lv);
+ }
+ }
+ return retVal___;
+}
+int64 HP_battle_calc_pc_damage(struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv) {
+ int hIndex = 0;
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_battle_calc_pc_damage_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, struct Damage **d, int64 *damage, uint16 *skill_id, uint16 *skill_lv);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_pc_damage_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_battle_calc_pc_damage_pre[hIndex].func;
+ retVal___ = preHookFunc(&src, &bl, &d, &damage, &skill_id, &skill_lv);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.battle.calc_pc_damage(src, bl, d, damage, skill_id, skill_lv);
+ }
+ if (HPMHooks.count.HP_battle_calc_pc_damage_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, struct Damage *d, int64 damage, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_pc_damage_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_battle_calc_pc_damage_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, src, bl, d, damage, skill_id, skill_lv);
}
}
return retVal___;
@@ -1188,14 +1216,14 @@ int64 HP_battle_calc_damage(struct block_list *src, struct block_list *bl, struc
int64 HP_battle_calc_gvg_damage(struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_gvg_damage_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
+ if (HPMHooks.count.HP_battle_calc_gvg_damage_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_gvg_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_gvg_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_gvg_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &damage, &div_, &skill_id, &skill_lv, &flag);
+ retVal___ = preHookFunc(&src, &bl, &damage, &div_, &skill_id, &skill_lv, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1203,11 +1231,11 @@ int64 HP_battle_calc_gvg_damage(struct block_list *src, struct block_list *bl, i
{
retVal___ = HPMHooks.source.battle.calc_gvg_damage(src, bl, damage, div_, skill_id, skill_lv, flag);
}
- if( HPMHooks.count.HP_battle_calc_gvg_damage_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_gvg_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_gvg_damage_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_gvg_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_gvg_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &damage, &div_, &skill_id, &skill_lv, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, damage, div_, skill_id, skill_lv, flag);
}
}
return retVal___;
@@ -1215,14 +1243,14 @@ int64 HP_battle_calc_gvg_damage(struct block_list *src, struct block_list *bl, i
int64 HP_battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_bg_damage_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
+ if (HPMHooks.count.HP_battle_calc_bg_damage_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_bg_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_bg_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_bg_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &damage, &div_, &skill_id, &skill_lv, &flag);
+ retVal___ = preHookFunc(&src, &bl, &damage, &div_, &skill_id, &skill_lv, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1230,11 +1258,11 @@ int64 HP_battle_calc_bg_damage(struct block_list *src, struct block_list *bl, in
{
retVal___ = HPMHooks.source.battle.calc_bg_damage(src, bl, damage, div_, skill_id, skill_lv, flag);
}
- if( HPMHooks.count.HP_battle_calc_bg_damage_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 *damage, int *div_, uint16 *skill_id, uint16 *skill_lv, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_bg_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_bg_damage_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_bg_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_bg_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &damage, &div_, &skill_id, &skill_lv, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, damage, div_, skill_id, skill_lv, flag);
}
}
return retVal___;
@@ -1242,14 +1270,14 @@ int64 HP_battle_calc_bg_damage(struct block_list *src, struct block_list *bl, in
enum damage_lv HP_battle_weapon_attack(struct block_list *bl, struct block_list *target, int64 tick, int flag) {
int hIndex = 0;
enum damage_lv retVal___ = ATK_NONE;
- if( HPMHooks.count.HP_battle_weapon_attack_pre ) {
- enum damage_lv (*preHookFunc) (struct block_list *bl, struct block_list *target, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_battle_weapon_attack_pre > 0) {
+ enum damage_lv (*preHookFunc) (struct block_list **bl, struct block_list **target, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_weapon_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_weapon_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_weapon_attack_pre[hIndex].func;
- retVal___ = preHookFunc(bl, target, &tick, &flag);
+ retVal___ = preHookFunc(&bl, &target, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1257,27 +1285,53 @@ enum damage_lv HP_battle_weapon_attack(struct block_list *bl, struct block_list
{
retVal___ = HPMHooks.source.battle.weapon_attack(bl, target, tick, flag);
}
- if( HPMHooks.count.HP_battle_weapon_attack_post ) {
- enum damage_lv (*postHookFunc) (enum damage_lv retVal___, struct block_list *bl, struct block_list *target, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_weapon_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_weapon_attack_post > 0) {
+ enum damage_lv (*postHookFunc) (enum damage_lv retVal___, struct block_list *bl, struct block_list *target, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_weapon_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_weapon_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, target, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, bl, target, tick, flag);
+ }
+ }
+ return retVal___;
+}
+bool HP_battle_check_arrows(struct map_session_data *sd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_battle_check_arrows_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_arrows_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_battle_check_arrows_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.battle.check_arrows(sd);
+ }
+ if (HPMHooks.count.HP_battle_check_arrows_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_arrows_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_battle_check_arrows_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
struct Damage HP_battle_calc_weapon_attack(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int wflag) {
int hIndex = 0;
- struct Damage retVal___;
- memset(&retVal___, '\0', sizeof(struct Damage));
- if( HPMHooks.count.HP_battle_calc_weapon_attack_pre ) {
- struct Damage (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *wflag);
+ struct Damage retVal___ = { 0 };
+ if (HPMHooks.count.HP_battle_calc_weapon_attack_pre > 0) {
+ struct Damage (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *wflag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_weapon_attack_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &wflag);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &wflag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1285,11 +1339,11 @@ struct Damage HP_battle_calc_weapon_attack(struct block_list *src, struct block_
{
retVal___ = HPMHooks.source.battle.calc_weapon_attack(src, target, skill_id, skill_lv, wflag);
}
- if( HPMHooks.count.HP_battle_calc_weapon_attack_post ) {
- struct Damage (*postHookFunc) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *wflag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_weapon_attack_post > 0) {
+ struct Damage (*postHookFunc) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int wflag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_weapon_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &wflag);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, wflag);
}
}
return retVal___;
@@ -1297,14 +1351,14 @@ struct Damage HP_battle_calc_weapon_attack(struct block_list *src, struct block_
int HP_battle_delay_damage(int64 tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_delay_damage_pre ) {
- int (*preHookFunc) (int64 *tick, int *amotion, struct block_list *src, struct block_list *target, int *attack_type, uint16 *skill_id, uint16 *skill_lv, int64 *damage, enum damage_lv *dmg_lv, int *ddelay, bool *additional_effects);
+ if (HPMHooks.count.HP_battle_delay_damage_pre > 0) {
+ int (*preHookFunc) (int64 *tick, int *amotion, struct block_list **src, struct block_list **target, int *attack_type, uint16 *skill_id, uint16 *skill_lv, int64 *damage, enum damage_lv *dmg_lv, int *ddelay, bool *additional_effects);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_delay_damage_pre[hIndex].func;
- retVal___ = preHookFunc(&tick, &amotion, src, target, &attack_type, &skill_id, &skill_lv, &damage, &dmg_lv, &ddelay, &additional_effects);
+ retVal___ = preHookFunc(&tick, &amotion, &src, &target, &attack_type, &skill_id, &skill_lv, &damage, &dmg_lv, &ddelay, &additional_effects);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1312,25 +1366,25 @@ int HP_battle_delay_damage(int64 tick, int amotion, struct block_list *src, stru
{
retVal___ = HPMHooks.source.battle.delay_damage(tick, amotion, src, target, attack_type, skill_id, skill_lv, damage, dmg_lv, ddelay, additional_effects);
}
- if( HPMHooks.count.HP_battle_delay_damage_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, int *amotion, struct block_list *src, struct block_list *target, int *attack_type, uint16 *skill_id, uint16 *skill_lv, int64 *damage, enum damage_lv *dmg_lv, int *ddelay, bool *additional_effects);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_delay_damage_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_delay_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &amotion, src, target, &attack_type, &skill_id, &skill_lv, &damage, &dmg_lv, &ddelay, &additional_effects);
+ retVal___ = postHookFunc(retVal___, tick, amotion, src, target, attack_type, skill_id, skill_lv, damage, dmg_lv, ddelay, additional_effects);
}
}
return retVal___;
}
void HP_battle_drain(struct map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int boss) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_drain_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *tbl, int64 *rdamage, int64 *ldamage, int *race, int *boss);
+ if (HPMHooks.count.HP_battle_drain_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **tbl, int64 *rdamage, int64 *ldamage, int *race, int *boss);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_drain_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_drain_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_drain_pre[hIndex].func;
- preHookFunc(sd, tbl, &rdamage, &ldamage, &race, &boss);
+ preHookFunc(&sd, &tbl, &rdamage, &ldamage, &race, &boss);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1338,25 +1392,25 @@ void HP_battle_drain(struct map_session_data *sd, struct block_list *tbl, int64
{
HPMHooks.source.battle.drain(sd, tbl, rdamage, ldamage, race, boss);
}
- if( HPMHooks.count.HP_battle_drain_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct block_list *tbl, int64 *rdamage, int64 *ldamage, int *race, int *boss);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_drain_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_drain_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int boss);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_drain_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_drain_post[hIndex].func;
- postHookFunc(sd, tbl, &rdamage, &ldamage, &race, &boss);
+ postHookFunc(sd, tbl, rdamage, ldamage, race, boss);
}
}
return;
}
void HP_battle_reflect_damage(struct block_list *target, struct block_list *src, struct Damage *wd, uint16 skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_reflect_damage_pre ) {
- void (*preHookFunc) (struct block_list *target, struct block_list *src, struct Damage *wd, uint16 *skill_id);
+ if (HPMHooks.count.HP_battle_reflect_damage_pre > 0) {
+ void (*preHookFunc) (struct block_list **target, struct block_list **src, struct Damage **wd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_reflect_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_reflect_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_reflect_damage_pre[hIndex].func;
- preHookFunc(target, src, wd, &skill_id);
+ preHookFunc(&target, &src, &wd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1364,11 +1418,11 @@ void HP_battle_reflect_damage(struct block_list *target, struct block_list *src,
{
HPMHooks.source.battle.reflect_damage(target, src, wd, skill_id);
}
- if( HPMHooks.count.HP_battle_reflect_damage_post ) {
- void (*postHookFunc) (struct block_list *target, struct block_list *src, struct Damage *wd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_reflect_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_reflect_damage_post > 0) {
+ void (*postHookFunc) (struct block_list *target, struct block_list *src, struct Damage *wd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_reflect_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_reflect_damage_post[hIndex].func;
- postHookFunc(target, src, wd, &skill_id);
+ postHookFunc(target, src, wd, skill_id);
}
}
return;
@@ -1376,14 +1430,14 @@ void HP_battle_reflect_damage(struct block_list *target, struct block_list *src,
int HP_battle_attr_ratio(int atk_elem, int def_type, int def_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_attr_ratio_pre ) {
+ if (HPMHooks.count.HP_battle_attr_ratio_pre > 0) {
int (*preHookFunc) (int *atk_elem, int *def_type, int *def_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_ratio_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_ratio_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_attr_ratio_pre[hIndex].func;
retVal___ = preHookFunc(&atk_elem, &def_type, &def_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1391,11 +1445,11 @@ int HP_battle_attr_ratio(int atk_elem, int def_type, int def_lv) {
{
retVal___ = HPMHooks.source.battle.attr_ratio(atk_elem, def_type, def_lv);
}
- if( HPMHooks.count.HP_battle_attr_ratio_post ) {
- int (*postHookFunc) (int retVal___, int *atk_elem, int *def_type, int *def_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_ratio_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_attr_ratio_post > 0) {
+ int (*postHookFunc) (int retVal___, int atk_elem, int def_type, int def_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_ratio_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_attr_ratio_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &atk_elem, &def_type, &def_lv);
+ retVal___ = postHookFunc(retVal___, atk_elem, def_type, def_lv);
}
}
return retVal___;
@@ -1403,14 +1457,14 @@ int HP_battle_attr_ratio(int atk_elem, int def_type, int def_lv) {
int64 HP_battle_attr_fix(struct block_list *src, struct block_list *target, int64 damage, int atk_elem, int def_type, int def_lv) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_attr_fix_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *target, int64 *damage, int *atk_elem, int *def_type, int *def_lv);
+ if (HPMHooks.count.HP_battle_attr_fix_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **target, int64 *damage, int *atk_elem, int *def_type, int *def_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_fix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_fix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_attr_fix_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &damage, &atk_elem, &def_type, &def_lv);
+ retVal___ = preHookFunc(&src, &target, &damage, &atk_elem, &def_type, &def_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1418,11 +1472,11 @@ int64 HP_battle_attr_fix(struct block_list *src, struct block_list *target, int6
{
retVal___ = HPMHooks.source.battle.attr_fix(src, target, damage, atk_elem, def_type, def_lv);
}
- if( HPMHooks.count.HP_battle_attr_fix_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *target, int64 *damage, int *atk_elem, int *def_type, int *def_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_fix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_attr_fix_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *target, int64 damage, int atk_elem, int def_type, int def_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_attr_fix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_attr_fix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &damage, &atk_elem, &def_type, &def_lv);
+ retVal___ = postHookFunc(retVal___, src, target, damage, atk_elem, def_type, def_lv);
}
}
return retVal___;
@@ -1430,14 +1484,14 @@ int64 HP_battle_attr_fix(struct block_list *src, struct block_list *target, int6
int64 HP_battle_calc_cardfix(int attack_type, struct block_list *src, struct block_list *target, int nk, int s_ele, int s_ele_, int64 damage, int left, int flag) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_cardfix_pre ) {
- int64 (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, int *nk, int *s_ele, int *s_ele_, int64 *damage, int *left, int *flag);
+ if (HPMHooks.count.HP_battle_calc_cardfix_pre > 0) {
+ int64 (*preHookFunc) (int *attack_type, struct block_list **src, struct block_list **target, int *nk, int *s_ele, int *s_ele_, int64 *damage, int *left, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_cardfix_pre[hIndex].func;
- retVal___ = preHookFunc(&attack_type, src, target, &nk, &s_ele, &s_ele_, &damage, &left, &flag);
+ retVal___ = preHookFunc(&attack_type, &src, &target, &nk, &s_ele, &s_ele_, &damage, &left, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1445,11 +1499,11 @@ int64 HP_battle_calc_cardfix(int attack_type, struct block_list *src, struct blo
{
retVal___ = HPMHooks.source.battle.calc_cardfix(attack_type, src, target, nk, s_ele, s_ele_, damage, left, flag);
}
- if( HPMHooks.count.HP_battle_calc_cardfix_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *attack_type, struct block_list *src, struct block_list *target, int *nk, int *s_ele, int *s_ele_, int64 *damage, int *left, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_cardfix_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int attack_type, struct block_list *src, struct block_list *target, int nk, int s_ele, int s_ele_, int64 damage, int left, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_cardfix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &attack_type, src, target, &nk, &s_ele, &s_ele_, &damage, &left, &flag);
+ retVal___ = postHookFunc(retVal___, attack_type, src, target, nk, s_ele, s_ele_, damage, left, flag);
}
}
return retVal___;
@@ -1457,14 +1511,14 @@ int64 HP_battle_calc_cardfix(int attack_type, struct block_list *src, struct blo
int64 HP_battle_calc_cardfix2(struct block_list *src, struct block_list *bl, int64 damage, int s_ele, int nk, int flag) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_cardfix2_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *bl, int64 *damage, int *s_ele, int *nk, int *flag);
+ if (HPMHooks.count.HP_battle_calc_cardfix2_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, int64 *damage, int *s_ele, int *nk, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_cardfix2_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &damage, &s_ele, &nk, &flag);
+ retVal___ = preHookFunc(&src, &bl, &damage, &s_ele, &nk, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1472,11 +1526,11 @@ int64 HP_battle_calc_cardfix2(struct block_list *src, struct block_list *bl, int
{
retVal___ = HPMHooks.source.battle.calc_cardfix2(src, bl, damage, s_ele, nk, flag);
}
- if( HPMHooks.count.HP_battle_calc_cardfix2_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 *damage, int *s_ele, int *nk, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_cardfix2_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, int64 damage, int s_ele, int nk, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_cardfix2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_cardfix2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &damage, &s_ele, &nk, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, damage, s_ele, nk, flag);
}
}
return retVal___;
@@ -1484,14 +1538,14 @@ int64 HP_battle_calc_cardfix2(struct block_list *src, struct block_list *bl, int
int64 HP_battle_calc_elefix(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int nk, int n_ele, int s_ele, int s_ele_, bool left, int flag) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_elefix_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *nk, int *n_ele, int *s_ele, int *s_ele_, bool *left, int *flag);
+ if (HPMHooks.count.HP_battle_calc_elefix_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *nk, int *n_ele, int *s_ele, int *s_ele_, bool *left, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_elefix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_elefix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_elefix_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &damage, &nk, &n_ele, &s_ele, &s_ele_, &left, &flag);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &damage, &nk, &n_ele, &s_ele, &s_ele_, &left, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1499,11 +1553,11 @@ int64 HP_battle_calc_elefix(struct block_list *src, struct block_list *target, u
{
retVal___ = HPMHooks.source.battle.calc_elefix(src, target, skill_id, skill_lv, damage, nk, n_ele, s_ele, s_ele_, left, flag);
}
- if( HPMHooks.count.HP_battle_calc_elefix_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *nk, int *n_ele, int *s_ele, int *s_ele_, bool *left, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_elefix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_elefix_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int nk, int n_ele, int s_ele, int s_ele_, bool left, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_elefix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_elefix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &damage, &nk, &n_ele, &s_ele, &s_ele_, &left, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, damage, nk, n_ele, s_ele, s_ele_, left, flag);
}
}
return retVal___;
@@ -1511,14 +1565,14 @@ int64 HP_battle_calc_elefix(struct block_list *src, struct block_list *target, u
int64 HP_battle_calc_masteryfix(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int div, bool left, bool weapon) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_masteryfix_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
+ if (HPMHooks.count.HP_battle_calc_masteryfix_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_masteryfix_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &damage, &div, &left, &weapon);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &damage, &div, &left, &weapon);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1526,11 +1580,11 @@ int64 HP_battle_calc_masteryfix(struct block_list *src, struct block_list *targe
{
retVal___ = HPMHooks.source.battle.calc_masteryfix(src, target, skill_id, skill_lv, damage, div, left, weapon);
}
- if( HPMHooks.count.HP_battle_calc_masteryfix_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_masteryfix_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int div, bool left, bool weapon);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_masteryfix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &damage, &div, &left, &weapon);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, damage, div, left, weapon);
}
}
return retVal___;
@@ -1538,14 +1592,14 @@ int64 HP_battle_calc_masteryfix(struct block_list *src, struct block_list *targe
int HP_battle_calc_chorusbonus(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_chorusbonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_battle_calc_chorusbonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_chorusbonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_chorusbonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_chorusbonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1553,9 +1607,9 @@ int HP_battle_calc_chorusbonus(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.battle.calc_chorusbonus(sd);
}
- if( HPMHooks.count.HP_battle_calc_chorusbonus_post ) {
+ if (HPMHooks.count.HP_battle_calc_chorusbonus_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_chorusbonus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_chorusbonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_chorusbonus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -1565,14 +1619,14 @@ int HP_battle_calc_chorusbonus(struct map_session_data *sd) {
int HP_battle_calc_skillratio(int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int skillratio, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_skillratio_pre ) {
- int (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
+ if (HPMHooks.count.HP_battle_calc_skillratio_pre > 0) {
+ int (*preHookFunc) (int *attack_type, struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_skillratio_pre[hIndex].func;
- retVal___ = preHookFunc(&attack_type, src, target, &skill_id, &skill_lv, &skillratio, &flag);
+ retVal___ = preHookFunc(&attack_type, &src, &target, &skill_id, &skill_lv, &skillratio, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1580,11 +1634,11 @@ int HP_battle_calc_skillratio(int attack_type, struct block_list *src, struct bl
{
retVal___ = HPMHooks.source.battle.calc_skillratio(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
}
- if( HPMHooks.count.HP_battle_calc_skillratio_post ) {
- int (*postHookFunc) (int retVal___, int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_skillratio_post > 0) {
+ int (*postHookFunc) (int retVal___, int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int skillratio, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_skillratio_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &attack_type, src, target, &skill_id, &skill_lv, &skillratio, &flag);
+ retVal___ = postHookFunc(retVal___, attack_type, src, target, skill_id, skill_lv, skillratio, flag);
}
}
return retVal___;
@@ -1592,14 +1646,14 @@ int HP_battle_calc_skillratio(int attack_type, struct block_list *src, struct bl
int64 HP_battle_calc_sizefix(struct map_session_data *sd, int64 damage, int type, int size, bool ignore) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_sizefix_pre ) {
- int64 (*preHookFunc) (struct map_session_data *sd, int64 *damage, int *type, int *size, bool *ignore);
+ if (HPMHooks.count.HP_battle_calc_sizefix_pre > 0) {
+ int64 (*preHookFunc) (struct map_session_data **sd, int64 *damage, int *type, int *size, bool *ignore);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_sizefix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_sizefix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_sizefix_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &damage, &type, &size, &ignore);
+ retVal___ = preHookFunc(&sd, &damage, &type, &size, &ignore);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1607,11 +1661,11 @@ int64 HP_battle_calc_sizefix(struct map_session_data *sd, int64 damage, int type
{
retVal___ = HPMHooks.source.battle.calc_sizefix(sd, damage, type, size, ignore);
}
- if( HPMHooks.count.HP_battle_calc_sizefix_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct map_session_data *sd, int64 *damage, int *type, int *size, bool *ignore);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_sizefix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_sizefix_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct map_session_data *sd, int64 damage, int type, int size, bool ignore);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_sizefix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_sizefix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &damage, &type, &size, &ignore);
+ retVal___ = postHookFunc(retVal___, sd, damage, type, size, ignore);
}
}
return retVal___;
@@ -1619,14 +1673,14 @@ int64 HP_battle_calc_sizefix(struct map_session_data *sd, int64 damage, int type
int64 HP_battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, struct weapon_atk *watk, int nk, bool n_ele, short s_ele, short s_ele_, int size, int type, int flag, int flag2) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_weapon_damage_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, struct weapon_atk *watk, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *size, int *type, int *flag, int *flag2);
+ if (HPMHooks.count.HP_battle_calc_weapon_damage_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, struct weapon_atk **watk, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *size, int *type, int *flag, int *flag2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_weapon_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &skill_id, &skill_lv, watk, &nk, &n_ele, &s_ele, &s_ele_, &size, &type, &flag, &flag2);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &watk, &nk, &n_ele, &s_ele, &s_ele_, &size, &type, &flag, &flag2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1634,11 +1688,11 @@ int64 HP_battle_calc_weapon_damage(struct block_list *src, struct block_list *bl
{
retVal___ = HPMHooks.source.battle.calc_weapon_damage(src, bl, skill_id, skill_lv, watk, nk, n_ele, s_ele, s_ele_, size, type, flag, flag2);
}
- if( HPMHooks.count.HP_battle_calc_weapon_damage_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, struct weapon_atk *watk, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *size, int *type, int *flag, int *flag2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_weapon_damage_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, struct weapon_atk *watk, int nk, bool n_ele, short s_ele, short s_ele_, int size, int type, int flag, int flag2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_weapon_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_weapon_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &skill_id, &skill_lv, watk, &nk, &n_ele, &s_ele, &s_ele_, &size, &type, &flag, &flag2);
+ retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, watk, nk, n_ele, s_ele, s_ele_, size, type, flag, flag2);
}
}
return retVal___;
@@ -1646,14 +1700,14 @@ int64 HP_battle_calc_weapon_damage(struct block_list *src, struct block_list *bl
int64 HP_battle_calc_defense(int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int flag, int pdef) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_defense_pre ) {
- int64 (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *flag, int *pdef);
+ if (HPMHooks.count.HP_battle_calc_defense_pre > 0) {
+ int64 (*preHookFunc) (int *attack_type, struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *flag, int *pdef);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_defense_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_defense_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_defense_pre[hIndex].func;
- retVal___ = preHookFunc(&attack_type, src, target, &skill_id, &skill_lv, &damage, &flag, &pdef);
+ retVal___ = preHookFunc(&attack_type, &src, &target, &skill_id, &skill_lv, &damage, &flag, &pdef);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1661,11 +1715,11 @@ int64 HP_battle_calc_defense(int attack_type, struct block_list *src, struct blo
{
retVal___ = HPMHooks.source.battle.calc_defense(attack_type, src, target, skill_id, skill_lv, damage, flag, pdef);
}
- if( HPMHooks.count.HP_battle_calc_defense_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *flag, int *pdef);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_defense_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_defense_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int attack_type, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int flag, int pdef);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_defense_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_defense_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &attack_type, src, target, &skill_id, &skill_lv, &damage, &flag, &pdef);
+ retVal___ = postHookFunc(retVal___, attack_type, src, target, skill_id, skill_lv, damage, flag, pdef);
}
}
return retVal___;
@@ -1673,14 +1727,14 @@ int64 HP_battle_calc_defense(int attack_type, struct block_list *src, struct blo
struct block_list* HP_battle_get_master(struct block_list *src) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_battle_get_master_pre ) {
- struct block_list* (*preHookFunc) (struct block_list *src);
+ if (HPMHooks.count.HP_battle_get_master_pre > 0) {
+ struct block_list* (*preHookFunc) (struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_master_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_master_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_get_master_pre[hIndex].func;
- retVal___ = preHookFunc(src);
+ retVal___ = preHookFunc(&src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1688,9 +1742,9 @@ struct block_list* HP_battle_get_master(struct block_list *src) {
{
retVal___ = HPMHooks.source.battle.get_master(src);
}
- if( HPMHooks.count.HP_battle_get_master_post ) {
+ if (HPMHooks.count.HP_battle_get_master_post > 0) {
struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_master_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_master_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_get_master_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src);
}
@@ -1700,14 +1754,14 @@ struct block_list* HP_battle_get_master(struct block_list *src) {
struct block_list* HP_battle_get_targeted(struct block_list *target) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_battle_get_targeted_pre ) {
- struct block_list* (*preHookFunc) (struct block_list *target);
+ if (HPMHooks.count.HP_battle_get_targeted_pre > 0) {
+ struct block_list* (*preHookFunc) (struct block_list **target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_get_targeted_pre[hIndex].func;
- retVal___ = preHookFunc(target);
+ retVal___ = preHookFunc(&target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1715,9 +1769,9 @@ struct block_list* HP_battle_get_targeted(struct block_list *target) {
{
retVal___ = HPMHooks.source.battle.get_targeted(target);
}
- if( HPMHooks.count.HP_battle_get_targeted_post ) {
+ if (HPMHooks.count.HP_battle_get_targeted_post > 0) {
struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_get_targeted_post[hIndex].func;
retVal___ = postHookFunc(retVal___, target);
}
@@ -1727,14 +1781,14 @@ struct block_list* HP_battle_get_targeted(struct block_list *target) {
struct block_list* HP_battle_get_enemy(struct block_list *target, int type, int range) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_battle_get_enemy_pre ) {
- struct block_list* (*preHookFunc) (struct block_list *target, int *type, int *range);
+ if (HPMHooks.count.HP_battle_get_enemy_pre > 0) {
+ struct block_list* (*preHookFunc) (struct block_list **target, int *type, int *range);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_get_enemy_pre[hIndex].func;
- retVal___ = preHookFunc(target, &type, &range);
+ retVal___ = preHookFunc(&target, &type, &range);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1742,11 +1796,11 @@ struct block_list* HP_battle_get_enemy(struct block_list *target, int type, int
{
retVal___ = HPMHooks.source.battle.get_enemy(target, type, range);
}
- if( HPMHooks.count.HP_battle_get_enemy_post ) {
- struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *target, int *type, int *range);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_get_enemy_post > 0) {
+ struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *target, int type, int range);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_get_enemy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, target, &type, &range);
+ retVal___ = postHookFunc(retVal___, target, type, range);
}
}
return retVal___;
@@ -1754,14 +1808,14 @@ struct block_list* HP_battle_get_enemy(struct block_list *target, int type, int
int HP_battle_get_target(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_get_target_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_battle_get_target_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_get_target_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1769,9 +1823,9 @@ int HP_battle_get_target(struct block_list *bl) {
{
retVal___ = HPMHooks.source.battle.get_target(bl);
}
- if( HPMHooks.count.HP_battle_get_target_post ) {
+ if (HPMHooks.count.HP_battle_get_target_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_target_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_get_target_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -1781,14 +1835,14 @@ int HP_battle_get_target(struct block_list *bl) {
int HP_battle_get_current_skill(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_get_current_skill_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_battle_get_current_skill_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_current_skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_current_skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_get_current_skill_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1796,9 +1850,9 @@ int HP_battle_get_current_skill(struct block_list *bl) {
{
retVal___ = HPMHooks.source.battle.get_current_skill(bl);
}
- if( HPMHooks.count.HP_battle_get_current_skill_post ) {
+ if (HPMHooks.count.HP_battle_get_current_skill_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_current_skill_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_current_skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_get_current_skill_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -1808,14 +1862,14 @@ int HP_battle_get_current_skill(struct block_list *bl) {
bool HP_battle_check_undead(int race, int element) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_battle_check_undead_pre ) {
+ if (HPMHooks.count.HP_battle_check_undead_pre > 0) {
bool (*preHookFunc) (int *race, int *element);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_undead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_undead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_check_undead_pre[hIndex].func;
retVal___ = preHookFunc(&race, &element);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1823,11 +1877,11 @@ bool HP_battle_check_undead(int race, int element) {
{
retVal___ = HPMHooks.source.battle.check_undead(race, element);
}
- if( HPMHooks.count.HP_battle_check_undead_post ) {
- bool (*postHookFunc) (bool retVal___, int *race, int *element);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_undead_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_check_undead_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int race, int element);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_undead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_check_undead_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &race, &element);
+ retVal___ = postHookFunc(retVal___, race, element);
}
}
return retVal___;
@@ -1835,14 +1889,14 @@ bool HP_battle_check_undead(int race, int element) {
int HP_battle_check_target(struct block_list *src, struct block_list *target, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_check_target_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, int *flag);
+ if (HPMHooks.count.HP_battle_check_target_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_check_target_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &flag);
+ retVal___ = preHookFunc(&src, &target, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1850,11 +1904,11 @@ int HP_battle_check_target(struct block_list *src, struct block_list *target, in
{
retVal___ = HPMHooks.source.battle.check_target(src, target, flag);
}
- if( HPMHooks.count.HP_battle_check_target_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_target_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_check_target_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_check_target_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, flag);
}
}
return retVal___;
@@ -1862,14 +1916,14 @@ int HP_battle_check_target(struct block_list *src, struct block_list *target, in
bool HP_battle_check_range(struct block_list *src, struct block_list *bl, int range) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_battle_check_range_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *bl, int *range);
+ if (HPMHooks.count.HP_battle_check_range_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, int *range);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_range_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_range_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_check_range_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &range);
+ retVal___ = preHookFunc(&src, &bl, &range);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1877,25 +1931,25 @@ bool HP_battle_check_range(struct block_list *src, struct block_list *bl, int ra
{
retVal___ = HPMHooks.source.battle.check_range(src, bl, range);
}
- if( HPMHooks.count.HP_battle_check_range_post ) {
- bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, int *range);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_range_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_check_range_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, int range);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_check_range_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_check_range_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &range);
+ retVal___ = postHookFunc(retVal___, src, bl, range);
}
}
return retVal___;
}
void HP_battle_consume_ammo(struct map_session_data *sd, int skill_id, int lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_consume_ammo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *skill_id, int *lv);
+ if (HPMHooks.count.HP_battle_consume_ammo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *skill_id, int *lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_consume_ammo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_consume_ammo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_consume_ammo_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &lv);
+ preHookFunc(&sd, &skill_id, &lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -1903,11 +1957,11 @@ void HP_battle_consume_ammo(struct map_session_data *sd, int skill_id, int lv) {
{
HPMHooks.source.battle.consume_ammo(sd, skill_id, lv);
}
- if( HPMHooks.count.HP_battle_consume_ammo_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *skill_id, int *lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_consume_ammo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_consume_ammo_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int skill_id, int lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_consume_ammo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_consume_ammo_post[hIndex].func;
- postHookFunc(sd, &skill_id, &lv);
+ postHookFunc(sd, skill_id, lv);
}
}
return;
@@ -1915,16 +1969,16 @@ void HP_battle_consume_ammo(struct map_session_data *sd, int skill_id, int lv) {
int HP_battle_get_targeted_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_get_targeted_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_battle_get_targeted_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_battle_get_targeted_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1934,9 +1988,9 @@ int HP_battle_get_targeted_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.battle.get_targeted_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_battle_get_targeted_sub_post ) {
+ if (HPMHooks.count.HP_battle_get_targeted_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_targeted_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_battle_get_targeted_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -1948,16 +2002,16 @@ int HP_battle_get_targeted_sub(struct block_list *bl, va_list ap) {
int HP_battle_get_enemy_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_get_enemy_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_battle_get_enemy_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_battle_get_enemy_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -1967,9 +2021,9 @@ int HP_battle_get_enemy_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.battle.get_enemy_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_battle_get_enemy_sub_post ) {
+ if (HPMHooks.count.HP_battle_get_enemy_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_battle_get_enemy_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -1981,16 +2035,16 @@ int HP_battle_get_enemy_sub(struct block_list *bl, va_list ap) {
int HP_battle_get_enemy_area_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_get_enemy_area_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_battle_get_enemy_area_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_battle_get_enemy_area_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2000,9 +2054,9 @@ int HP_battle_get_enemy_area_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.battle.get_enemy_area_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_battle_get_enemy_area_sub_post ) {
+ if (HPMHooks.count.HP_battle_get_enemy_area_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_battle_get_enemy_area_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -2014,14 +2068,14 @@ int HP_battle_get_enemy_area_sub(struct block_list *bl, va_list ap) {
int HP_battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_delay_damage_sub_pre ) {
+ if (HPMHooks.count.HP_battle_delay_damage_sub_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_delay_damage_sub_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2029,11 +2083,11 @@ int HP_battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.battle.delay_damage_sub(tid, tick, id, data);
}
- if( HPMHooks.count.HP_battle_delay_damage_sub_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_delay_damage_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_delay_damage_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_delay_damage_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -2041,14 +2095,14 @@ int HP_battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
int HP_battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_blewcount_bonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_battle_blewcount_bonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_blewcount_bonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_blewcount_bonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_blewcount_bonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2056,11 +2110,11 @@ int HP_battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.battle.blewcount_bonus(sd, skill_id);
}
- if( HPMHooks.count.HP_battle_blewcount_bonus_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_blewcount_bonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_blewcount_bonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_blewcount_bonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_blewcount_bonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
@@ -2068,14 +2122,14 @@ int HP_battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id) {
int HP_battle_range_type(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_range_type_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_battle_range_type_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_range_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_range_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_range_type_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2083,11 +2137,11 @@ int HP_battle_range_type(struct block_list *src, struct block_list *target, uint
{
retVal___ = HPMHooks.source.battle.range_type(src, target, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_battle_range_type_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_range_type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_range_type_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_range_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_range_type_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv);
}
}
return retVal___;
@@ -2095,14 +2149,14 @@ int HP_battle_range_type(struct block_list *src, struct block_list *target, uint
int64 HP_battle_calc_base_damage(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_base_damage_pre ) {
- int64 (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *type, int *flag, int *flag2);
+ if (HPMHooks.count.HP_battle_calc_base_damage_pre > 0) {
+ int64 (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *type, int *flag, int *flag2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_base_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &skill_id, &skill_lv, &nk, &n_ele, &s_ele, &s_ele_, &type, &flag, &flag2);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &nk, &n_ele, &s_ele, &s_ele_, &type, &flag, &flag2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2110,11 +2164,11 @@ int64 HP_battle_calc_base_damage(struct block_list *src, struct block_list *bl,
{
retVal___ = HPMHooks.source.battle.calc_base_damage(src, bl, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, type, flag, flag2);
}
- if( HPMHooks.count.HP_battle_calc_base_damage_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *nk, bool *n_ele, short *s_ele, short *s_ele_, int *type, int *flag, int *flag2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_base_damage_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_base_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &skill_id, &skill_lv, &nk, &n_ele, &s_ele, &s_ele_, &type, &flag, &flag2);
+ retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, nk, n_ele, s_ele, s_ele_, type, flag, flag2);
}
}
return retVal___;
@@ -2122,14 +2176,14 @@ int64 HP_battle_calc_base_damage(struct block_list *src, struct block_list *bl,
int64 HP_battle_calc_base_damage2(struct status_data *st, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, struct map_session_data *sd, int flag) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_base_damage2_pre ) {
- int64 (*preHookFunc) (struct status_data *st, struct weapon_atk *wa, struct status_change *sc, unsigned short *t_size, struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_battle_calc_base_damage2_pre > 0) {
+ int64 (*preHookFunc) (struct status_data **st, struct weapon_atk **wa, struct status_change **sc, unsigned short *t_size, struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_base_damage2_pre[hIndex].func;
- retVal___ = preHookFunc(st, wa, sc, &t_size, sd, &flag);
+ retVal___ = preHookFunc(&st, &wa, &sc, &t_size, &sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2137,27 +2191,26 @@ int64 HP_battle_calc_base_damage2(struct status_data *st, struct weapon_atk *wa,
{
retVal___ = HPMHooks.source.battle.calc_base_damage2(st, wa, sc, t_size, sd, flag);
}
- if( HPMHooks.count.HP_battle_calc_base_damage2_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct status_data *st, struct weapon_atk *wa, struct status_change *sc, unsigned short *t_size, struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_base_damage2_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct status_data *st, struct weapon_atk *wa, struct status_change *sc, unsigned short t_size, struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_base_damage2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_base_damage2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, st, wa, sc, &t_size, sd, &flag);
+ retVal___ = postHookFunc(retVal___, st, wa, sc, t_size, sd, flag);
}
}
return retVal___;
}
struct Damage HP_battle_calc_misc_attack(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int mflag) {
int hIndex = 0;
- struct Damage retVal___;
- memset(&retVal___, '\0', sizeof(struct Damage));
- if( HPMHooks.count.HP_battle_calc_misc_attack_pre ) {
- struct Damage (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
+ struct Damage retVal___ = { 0 };
+ if (HPMHooks.count.HP_battle_calc_misc_attack_pre > 0) {
+ struct Damage (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_misc_attack_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &mflag);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &mflag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2165,27 +2218,26 @@ struct Damage HP_battle_calc_misc_attack(struct block_list *src, struct block_li
{
retVal___ = HPMHooks.source.battle.calc_misc_attack(src, target, skill_id, skill_lv, mflag);
}
- if( HPMHooks.count.HP_battle_calc_misc_attack_post ) {
- struct Damage (*postHookFunc) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_misc_attack_post > 0) {
+ struct Damage (*postHookFunc) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int mflag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_misc_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &mflag);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, mflag);
}
}
return retVal___;
}
struct Damage HP_battle_calc_magic_attack(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int mflag) {
int hIndex = 0;
- struct Damage retVal___;
- memset(&retVal___, '\0', sizeof(struct Damage));
- if( HPMHooks.count.HP_battle_calc_magic_attack_pre ) {
- struct Damage (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
+ struct Damage retVal___ = { 0 };
+ if (HPMHooks.count.HP_battle_calc_magic_attack_pre > 0) {
+ struct Damage (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_magic_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_magic_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_magic_attack_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &mflag);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &mflag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2193,11 +2245,11 @@ struct Damage HP_battle_calc_magic_attack(struct block_list *src, struct block_l
{
retVal___ = HPMHooks.source.battle.calc_magic_attack(src, target, skill_id, skill_lv, mflag);
}
- if( HPMHooks.count.HP_battle_calc_magic_attack_post ) {
- struct Damage (*postHookFunc) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_magic_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_magic_attack_post > 0) {
+ struct Damage (*postHookFunc) (struct Damage retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int mflag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_magic_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_magic_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &mflag);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, mflag);
}
}
return retVal___;
@@ -2205,14 +2257,14 @@ struct Damage HP_battle_calc_magic_attack(struct block_list *src, struct block_l
int HP_battle_adjust_skill_damage(int m, unsigned short skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_adjust_skill_damage_pre ) {
+ if (HPMHooks.count.HP_battle_adjust_skill_damage_pre > 0) {
int (*preHookFunc) (int *m, unsigned short *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_adjust_skill_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_adjust_skill_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_adjust_skill_damage_pre[hIndex].func;
retVal___ = preHookFunc(&m, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2220,11 +2272,11 @@ int HP_battle_adjust_skill_damage(int m, unsigned short skill_id) {
{
retVal___ = HPMHooks.source.battle.adjust_skill_damage(m, skill_id);
}
- if( HPMHooks.count.HP_battle_adjust_skill_damage_post ) {
- int (*postHookFunc) (int retVal___, int *m, unsigned short *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_adjust_skill_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_adjust_skill_damage_post > 0) {
+ int (*postHookFunc) (int retVal___, int m, unsigned short skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_adjust_skill_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_adjust_skill_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &skill_id);
+ retVal___ = postHookFunc(retVal___, m, skill_id);
}
}
return retVal___;
@@ -2232,14 +2284,14 @@ int HP_battle_adjust_skill_damage(int m, unsigned short skill_id) {
int64 HP_battle_add_mastery(struct map_session_data *sd, struct block_list *target, int64 dmg, int type) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_battle_add_mastery_pre ) {
- int64 (*preHookFunc) (struct map_session_data *sd, struct block_list *target, int64 *dmg, int *type);
+ if (HPMHooks.count.HP_battle_add_mastery_pre > 0) {
+ int64 (*preHookFunc) (struct map_session_data **sd, struct block_list **target, int64 *dmg, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_add_mastery_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_add_mastery_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_add_mastery_pre[hIndex].func;
- retVal___ = preHookFunc(sd, target, &dmg, &type);
+ retVal___ = preHookFunc(&sd, &target, &dmg, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2247,11 +2299,11 @@ int64 HP_battle_add_mastery(struct map_session_data *sd, struct block_list *targ
{
retVal___ = HPMHooks.source.battle.add_mastery(sd, target, dmg, type);
}
- if( HPMHooks.count.HP_battle_add_mastery_post ) {
- int64 (*postHookFunc) (int64 retVal___, struct map_session_data *sd, struct block_list *target, int64 *dmg, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_add_mastery_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_add_mastery_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, struct map_session_data *sd, struct block_list *target, int64 dmg, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_add_mastery_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_add_mastery_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, target, &dmg, &type);
+ retVal___ = postHookFunc(retVal___, sd, target, dmg, type);
}
}
return retVal___;
@@ -2259,14 +2311,14 @@ int64 HP_battle_add_mastery(struct map_session_data *sd, struct block_list *targ
int HP_battle_calc_drain(int64 damage, int rate, int per) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_calc_drain_pre ) {
+ if (HPMHooks.count.HP_battle_calc_drain_pre > 0) {
int (*preHookFunc) (int64 *damage, int *rate, int *per);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_drain_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_drain_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_drain_pre[hIndex].func;
retVal___ = preHookFunc(&damage, &rate, &per);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2274,52 +2326,52 @@ int HP_battle_calc_drain(int64 damage, int rate, int per) {
{
retVal___ = HPMHooks.source.battle.calc_drain(damage, rate, per);
}
- if( HPMHooks.count.HP_battle_calc_drain_post ) {
- int (*postHookFunc) (int retVal___, int64 *damage, int *rate, int *per);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_drain_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_calc_drain_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 damage, int rate, int per);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_drain_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_drain_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &damage, &rate, &per);
+ retVal___ = postHookFunc(retVal___, damage, rate, per);
}
}
return retVal___;
}
-int HP_battle_config_read(const char *cfgName) {
+bool HP_battle_config_read(const char *filename, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_battle_config_read_pre ) {
- int (*preHookFunc) (const char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_battle_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.battle.config_read(cfgName);
+ retVal___ = HPMHooks.source.battle.config_read(filename, imported);
}
- if( HPMHooks.count.HP_battle_config_read_post ) {
- int (*postHookFunc) (int retVal___, const char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
return retVal___;
}
void HP_battle_config_set_defaults(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_config_set_defaults_pre ) {
+ if (HPMHooks.count.HP_battle_config_set_defaults_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_defaults_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_defaults_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_config_set_defaults_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2327,38 +2379,65 @@ void HP_battle_config_set_defaults(void) {
{
HPMHooks.source.battle.config_set_defaults();
}
- if( HPMHooks.count.HP_battle_config_set_defaults_post ) {
+ if (HPMHooks.count.HP_battle_config_set_defaults_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_defaults_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_defaults_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_config_set_defaults_post[hIndex].func;
postHookFunc();
}
}
return;
}
-int HP_battle_config_set_value(const char *w1, const char *w2) {
+bool HP_battle_config_set_value_sub(int index, int value) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_battle_config_set_value_pre ) {
- int (*preHookFunc) (const char *w1, const char *w2);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_battle_config_set_value_sub_pre > 0) {
+ bool (*preHookFunc) (int *index, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_battle_config_set_value_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&index, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.battle.config_set_value_sub(index, value);
+ }
+ if (HPMHooks.count.HP_battle_config_set_value_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int index, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_battle_config_set_value_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, index, value);
+ }
+ }
+ return retVal___;
+}
+bool HP_battle_config_set_value(const char *param, const char *value) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_battle_config_set_value_pre > 0) {
+ bool (*preHookFunc) (const char **param, const char **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_config_set_value_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2);
+ retVal___ = preHookFunc(&param, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.battle.config_set_value(w1, w2);
+ retVal___ = HPMHooks.source.battle.config_set_value(param, value);
}
- if( HPMHooks.count.HP_battle_config_set_value_post ) {
- int (*postHookFunc) (int retVal___, const char *w1, const char *w2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_config_set_value_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *param, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_config_set_value_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, w1, w2);
+ retVal___ = postHookFunc(retVal___, param, value);
}
}
return retVal___;
@@ -2366,14 +2445,14 @@ int HP_battle_config_set_value(const char *w1, const char *w2) {
bool HP_battle_config_get_value(const char *w1, int *value) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_battle_config_get_value_pre ) {
- bool (*preHookFunc) (const char *w1, int *value);
+ if (HPMHooks.count.HP_battle_config_get_value_pre > 0) {
+ bool (*preHookFunc) (const char **w1, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_get_value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_get_value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_config_get_value_pre[hIndex].func;
- retVal___ = preHookFunc(w1, value);
+ retVal___ = preHookFunc(&w1, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2381,9 +2460,9 @@ bool HP_battle_config_get_value(const char *w1, int *value) {
{
retVal___ = HPMHooks.source.battle.config_get_value(w1, value);
}
- if( HPMHooks.count.HP_battle_config_get_value_post ) {
+ if (HPMHooks.count.HP_battle_config_get_value_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *w1, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_get_value_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_get_value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_config_get_value_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, value);
}
@@ -2392,14 +2471,14 @@ bool HP_battle_config_get_value(const char *w1, int *value) {
}
void HP_battle_config_adjust(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_config_adjust_pre ) {
+ if (HPMHooks.count.HP_battle_config_adjust_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_adjust_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_adjust_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_config_adjust_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2407,9 +2486,9 @@ void HP_battle_config_adjust(void) {
{
HPMHooks.source.battle.config_adjust();
}
- if( HPMHooks.count.HP_battle_config_adjust_post ) {
+ if (HPMHooks.count.HP_battle_config_adjust_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_adjust_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_adjust_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_config_adjust_post[hIndex].func;
postHookFunc();
}
@@ -2419,14 +2498,14 @@ void HP_battle_config_adjust(void) {
struct block_list* HP_battle_get_enemy_area(struct block_list *src, int x, int y, int range, int type, int ignore_id) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_battle_get_enemy_area_pre ) {
- struct block_list* (*preHookFunc) (struct block_list *src, int *x, int *y, int *range, int *type, int *ignore_id);
+ if (HPMHooks.count.HP_battle_get_enemy_area_pre > 0) {
+ struct block_list* (*preHookFunc) (struct block_list **src, int *x, int *y, int *range, int *type, int *ignore_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_get_enemy_area_pre[hIndex].func;
- retVal___ = preHookFunc(src, &x, &y, &range, &type, &ignore_id);
+ retVal___ = preHookFunc(&src, &x, &y, &range, &type, &ignore_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2434,11 +2513,11 @@ struct block_list* HP_battle_get_enemy_area(struct block_list *src, int x, int y
{
retVal___ = HPMHooks.source.battle.get_enemy_area(src, x, y, range, type, ignore_id);
}
- if( HPMHooks.count.HP_battle_get_enemy_area_post ) {
- struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *src, int *x, int *y, int *range, int *type, int *ignore_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_post; hIndex++ ) {
+ if (HPMHooks.count.HP_battle_get_enemy_area_post > 0) {
+ struct block_list* (*postHookFunc) (struct block_list* retVal___, struct block_list *src, int x, int y, int range, int type, int ignore_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_get_enemy_area_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_get_enemy_area_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &x, &y, &range, &type, &ignore_id);
+ retVal___ = postHookFunc(retVal___, src, x, y, range, type, ignore_id);
}
}
return retVal___;
@@ -2446,16 +2525,16 @@ struct block_list* HP_battle_get_enemy_area(struct block_list *src, int x, int y
int HP_battle_damage_area(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_battle_damage_area_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_battle_damage_area_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_damage_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_damage_area_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_battle_damage_area_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2465,9 +2544,9 @@ int HP_battle_damage_area(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.battle.damage_area(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_battle_damage_area_post ) {
+ if (HPMHooks.count.HP_battle_damage_area_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_damage_area_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_damage_area_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_battle_damage_area_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -2478,14 +2557,14 @@ int HP_battle_damage_area(struct block_list *bl, va_list ap) {
}
void HP_battle_calc_masteryfix_unknown(struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_calc_masteryfix_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
+ if (HPMHooks.count.HP_battle_calc_masteryfix_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int64 **damage, int **div, bool **left, bool **weapon);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_masteryfix_unknown_pre[hIndex].func;
- preHookFunc(src, target, skill_id, skill_lv, damage, div, left, weapon);
+ preHookFunc(&src, &target, &skill_id, &skill_lv, &damage, &div, &left, &weapon);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2493,9 +2572,9 @@ void HP_battle_calc_masteryfix_unknown(struct block_list *src, struct block_list
{
HPMHooks.source.battle.calc_masteryfix_unknown(src, target, skill_id, skill_lv, damage, div, left, weapon);
}
- if( HPMHooks.count.HP_battle_calc_masteryfix_unknown_post ) {
+ if (HPMHooks.count.HP_battle_calc_masteryfix_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *damage, int *div, bool *left, bool *weapon);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_masteryfix_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_masteryfix_unknown_post[hIndex].func;
postHookFunc(src, target, skill_id, skill_lv, damage, div, left, weapon);
}
@@ -2504,14 +2583,14 @@ void HP_battle_calc_masteryfix_unknown(struct block_list *src, struct block_list
}
void HP_battle_calc_skillratio_magic_unknown(int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
+ if (HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int **skillratio, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_skillratio_magic_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
+ preHookFunc(&attack_type, &src, &target, &skill_id, &skill_lv, &skillratio, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2519,9 +2598,9 @@ void HP_battle_calc_skillratio_magic_unknown(int *attack_type, struct block_list
{
HPMHooks.source.battle.calc_skillratio_magic_unknown(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
}
- if( HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_post ) {
+ if (HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_magic_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_skillratio_magic_unknown_post[hIndex].func;
postHookFunc(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
}
@@ -2530,14 +2609,14 @@ void HP_battle_calc_skillratio_magic_unknown(int *attack_type, struct block_list
}
void HP_battle_calc_skillratio_weapon_unknown(int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
+ if (HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int **skillratio, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_skillratio_weapon_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
+ preHookFunc(&attack_type, &src, &target, &skill_id, &skill_lv, &skillratio, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2545,9 +2624,9 @@ void HP_battle_calc_skillratio_weapon_unknown(int *attack_type, struct block_lis
{
HPMHooks.source.battle.calc_skillratio_weapon_unknown(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
}
- if( HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_post ) {
+ if (HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *skillratio, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_skillratio_weapon_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_skillratio_weapon_unknown_post[hIndex].func;
postHookFunc(attack_type, src, target, skill_id, skill_lv, skillratio, flag);
}
@@ -2556,14 +2635,14 @@ void HP_battle_calc_skillratio_weapon_unknown(int *attack_type, struct block_lis
}
void HP_battle_calc_misc_attack_unknown(struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag, struct Damage *md) {
int hIndex = 0;
- if( HPMHooks.count.HP_battle_calc_misc_attack_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag, struct Damage *md);
+ if (HPMHooks.count.HP_battle_calc_misc_attack_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 **skill_id, uint16 **skill_lv, int **mflag, struct Damage **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_battle_calc_misc_attack_unknown_pre[hIndex].func;
- preHookFunc(src, target, skill_id, skill_lv, mflag, md);
+ preHookFunc(&src, &target, &skill_id, &skill_lv, &mflag, &md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2571,26 +2650,26 @@ void HP_battle_calc_misc_attack_unknown(struct block_list *src, struct block_lis
{
HPMHooks.source.battle.calc_misc_attack_unknown(src, target, skill_id, skill_lv, mflag, md);
}
- if( HPMHooks.count.HP_battle_calc_misc_attack_unknown_post ) {
+ if (HPMHooks.count.HP_battle_calc_misc_attack_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int *mflag, struct Damage *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_battle_calc_misc_attack_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_battle_calc_misc_attack_unknown_post[hIndex].func;
postHookFunc(src, target, skill_id, skill_lv, mflag, md);
}
}
return;
}
-/* bg */
+/* battleground_interface */
void HP_bg_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_init_pre ) {
+ if (HPMHooks.count.HP_bg_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2598,25 +2677,25 @@ void HP_bg_init(bool minimal) {
{
HPMHooks.source.bg.init(minimal);
}
- if( HPMHooks.count.HP_bg_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_bg_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_final_pre ) {
+ if (HPMHooks.count.HP_bg_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2624,26 +2703,26 @@ void HP_bg_final(void) {
{
HPMHooks.source.bg.final();
}
- if( HPMHooks.count.HP_bg_final_post ) {
+ if (HPMHooks.count.HP_bg_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-struct bg_arena* HP_bg_name2arena(char *name) {
+struct bg_arena* HP_bg_name2arena(const char *name) {
int hIndex = 0;
struct bg_arena* retVal___ = NULL;
- if( HPMHooks.count.HP_bg_name2arena_pre ) {
- struct bg_arena* (*preHookFunc) (char *name);
+ if (HPMHooks.count.HP_bg_name2arena_pre > 0) {
+ struct bg_arena* (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_name2arena_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_name2arena_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_name2arena_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2651,9 +2730,9 @@ struct bg_arena* HP_bg_name2arena(char *name) {
{
retVal___ = HPMHooks.source.bg.name2arena(name);
}
- if( HPMHooks.count.HP_bg_name2arena_post ) {
- struct bg_arena* (*postHookFunc) (struct bg_arena* retVal___, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_name2arena_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_name2arena_post > 0) {
+ struct bg_arena* (*postHookFunc) (struct bg_arena* retVal___, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_name2arena_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_name2arena_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -2662,14 +2741,14 @@ struct bg_arena* HP_bg_name2arena(char *name) {
}
void HP_bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_queue_add_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types *type);
+ if (HPMHooks.count.HP_bg_queue_add_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct bg_arena **arena, enum bg_queue_types *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_queue_add_pre[hIndex].func;
- preHookFunc(sd, arena, &type);
+ preHookFunc(&sd, &arena, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2677,11 +2756,11 @@ void HP_bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum b
{
HPMHooks.source.bg.queue_add(sd, arena, type);
}
- if( HPMHooks.count.HP_bg_queue_add_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_queue_add_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_queue_add_post[hIndex].func;
- postHookFunc(sd, arena, &type);
+ postHookFunc(sd, arena, type);
}
}
return;
@@ -2689,14 +2768,14 @@ void HP_bg_queue_add(struct map_session_data *sd, struct bg_arena *arena, enum b
enum BATTLEGROUNDS_QUEUE_ACK HP_bg_can_queue(struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type) {
int hIndex = 0;
enum BATTLEGROUNDS_QUEUE_ACK retVal___ = BGQA_SUCCESS;
- if( HPMHooks.count.HP_bg_can_queue_pre ) {
- enum BATTLEGROUNDS_QUEUE_ACK (*preHookFunc) (struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types *type);
+ if (HPMHooks.count.HP_bg_can_queue_pre > 0) {
+ enum BATTLEGROUNDS_QUEUE_ACK (*preHookFunc) (struct map_session_data **sd, struct bg_arena **arena, enum bg_queue_types *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_can_queue_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_can_queue_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_can_queue_pre[hIndex].func;
- retVal___ = preHookFunc(sd, arena, &type);
+ retVal___ = preHookFunc(&sd, &arena, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2704,11 +2783,11 @@ enum BATTLEGROUNDS_QUEUE_ACK HP_bg_can_queue(struct map_session_data *sd, struct
{
retVal___ = HPMHooks.source.bg.can_queue(sd, arena, type);
}
- if( HPMHooks.count.HP_bg_can_queue_post ) {
- enum BATTLEGROUNDS_QUEUE_ACK (*postHookFunc) (enum BATTLEGROUNDS_QUEUE_ACK retVal___, struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_can_queue_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_can_queue_post > 0) {
+ enum BATTLEGROUNDS_QUEUE_ACK (*postHookFunc) (enum BATTLEGROUNDS_QUEUE_ACK retVal___, struct map_session_data *sd, struct bg_arena *arena, enum bg_queue_types type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_can_queue_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_can_queue_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, arena, &type);
+ retVal___ = postHookFunc(retVal___, sd, arena, type);
}
}
return retVal___;
@@ -2716,14 +2795,14 @@ enum BATTLEGROUNDS_QUEUE_ACK HP_bg_can_queue(struct map_session_data *sd, struct
int HP_bg_id2pos(int queue_id, int account_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_id2pos_pre ) {
+ if (HPMHooks.count.HP_bg_id2pos_pre > 0) {
int (*preHookFunc) (int *queue_id, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_id2pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_id2pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_id2pos_pre[hIndex].func;
retVal___ = preHookFunc(&queue_id, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2731,25 +2810,25 @@ int HP_bg_id2pos(int queue_id, int account_id) {
{
retVal___ = HPMHooks.source.bg.id2pos(queue_id, account_id);
}
- if( HPMHooks.count.HP_bg_id2pos_post ) {
- int (*postHookFunc) (int retVal___, int *queue_id, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_id2pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_id2pos_post > 0) {
+ int (*postHookFunc) (int retVal___, int queue_id, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_id2pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_id2pos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &queue_id, &account_id);
+ retVal___ = postHookFunc(retVal___, queue_id, account_id);
}
}
return retVal___;
}
void HP_bg_queue_pc_cleanup(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_queue_pc_cleanup_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_bg_queue_pc_cleanup_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pc_cleanup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pc_cleanup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_queue_pc_cleanup_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2757,9 +2836,9 @@ void HP_bg_queue_pc_cleanup(struct map_session_data *sd) {
{
HPMHooks.source.bg.queue_pc_cleanup(sd);
}
- if( HPMHooks.count.HP_bg_queue_pc_cleanup_post ) {
+ if (HPMHooks.count.HP_bg_queue_pc_cleanup_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pc_cleanup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pc_cleanup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_queue_pc_cleanup_post[hIndex].func;
postHookFunc(sd);
}
@@ -2768,14 +2847,14 @@ void HP_bg_queue_pc_cleanup(struct map_session_data *sd) {
}
void HP_bg_begin(struct bg_arena *arena) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_begin_pre ) {
- void (*preHookFunc) (struct bg_arena *arena);
+ if (HPMHooks.count.HP_bg_begin_pre > 0) {
+ void (*preHookFunc) (struct bg_arena **arena);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_begin_pre[hIndex].func;
- preHookFunc(arena);
+ preHookFunc(&arena);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2783,9 +2862,9 @@ void HP_bg_begin(struct bg_arena *arena) {
{
HPMHooks.source.bg.begin(arena);
}
- if( HPMHooks.count.HP_bg_begin_post ) {
+ if (HPMHooks.count.HP_bg_begin_post > 0) {
void (*postHookFunc) (struct bg_arena *arena);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_begin_post[hIndex].func;
postHookFunc(arena);
}
@@ -2795,14 +2874,14 @@ void HP_bg_begin(struct bg_arena *arena) {
int HP_bg_begin_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_begin_timer_pre ) {
+ if (HPMHooks.count.HP_bg_begin_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_begin_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2810,25 +2889,25 @@ int HP_bg_begin_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.bg.begin_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_bg_begin_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_begin_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_begin_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_begin_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_bg_queue_pregame(struct bg_arena *arena) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_queue_pregame_pre ) {
- void (*preHookFunc) (struct bg_arena *arena);
+ if (HPMHooks.count.HP_bg_queue_pregame_pre > 0) {
+ void (*preHookFunc) (struct bg_arena **arena);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pregame_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pregame_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_queue_pregame_pre[hIndex].func;
- preHookFunc(arena);
+ preHookFunc(&arena);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2836,9 +2915,9 @@ void HP_bg_queue_pregame(struct bg_arena *arena) {
{
HPMHooks.source.bg.queue_pregame(arena);
}
- if( HPMHooks.count.HP_bg_queue_pregame_post ) {
+ if (HPMHooks.count.HP_bg_queue_pregame_post > 0) {
void (*postHookFunc) (struct bg_arena *arena);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pregame_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_pregame_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_queue_pregame_post[hIndex].func;
postHookFunc(arena);
}
@@ -2848,14 +2927,14 @@ void HP_bg_queue_pregame(struct bg_arena *arena) {
int HP_bg_fillup_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_fillup_timer_pre ) {
+ if (HPMHooks.count.HP_bg_fillup_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_fillup_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_fillup_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_fillup_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2863,25 +2942,25 @@ int HP_bg_fillup_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.bg.fillup_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_bg_fillup_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_fillup_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_fillup_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_fillup_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_fillup_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_bg_queue_ready_ack(struct bg_arena *arena, struct map_session_data *sd, bool response) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_queue_ready_ack_pre ) {
- void (*preHookFunc) (struct bg_arena *arena, struct map_session_data *sd, bool *response);
+ if (HPMHooks.count.HP_bg_queue_ready_ack_pre > 0) {
+ void (*preHookFunc) (struct bg_arena **arena, struct map_session_data **sd, bool *response);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_ready_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_ready_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_queue_ready_ack_pre[hIndex].func;
- preHookFunc(arena, sd, &response);
+ preHookFunc(&arena, &sd, &response);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2889,25 +2968,25 @@ void HP_bg_queue_ready_ack(struct bg_arena *arena, struct map_session_data *sd,
{
HPMHooks.source.bg.queue_ready_ack(arena, sd, response);
}
- if( HPMHooks.count.HP_bg_queue_ready_ack_post ) {
- void (*postHookFunc) (struct bg_arena *arena, struct map_session_data *sd, bool *response);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_ready_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_queue_ready_ack_post > 0) {
+ void (*postHookFunc) (struct bg_arena *arena, struct map_session_data *sd, bool response);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_ready_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_queue_ready_ack_post[hIndex].func;
- postHookFunc(arena, sd, &response);
+ postHookFunc(arena, sd, response);
}
}
return;
}
void HP_bg_match_over(struct bg_arena *arena, bool canceled) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_match_over_pre ) {
- void (*preHookFunc) (struct bg_arena *arena, bool *canceled);
+ if (HPMHooks.count.HP_bg_match_over_pre > 0) {
+ void (*preHookFunc) (struct bg_arena **arena, bool *canceled);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_match_over_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_match_over_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_match_over_pre[hIndex].func;
- preHookFunc(arena, &canceled);
+ preHookFunc(&arena, &canceled);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2915,25 +2994,25 @@ void HP_bg_match_over(struct bg_arena *arena, bool canceled) {
{
HPMHooks.source.bg.match_over(arena, canceled);
}
- if( HPMHooks.count.HP_bg_match_over_post ) {
- void (*postHookFunc) (struct bg_arena *arena, bool *canceled);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_match_over_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_match_over_post > 0) {
+ void (*postHookFunc) (struct bg_arena *arena, bool canceled);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_match_over_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_match_over_post[hIndex].func;
- postHookFunc(arena, &canceled);
+ postHookFunc(arena, canceled);
}
}
return;
}
void HP_bg_queue_check(struct bg_arena *arena) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_queue_check_pre ) {
- void (*preHookFunc) (struct bg_arena *arena);
+ if (HPMHooks.count.HP_bg_queue_check_pre > 0) {
+ void (*preHookFunc) (struct bg_arena **arena);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_queue_check_pre[hIndex].func;
- preHookFunc(arena);
+ preHookFunc(&arena);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -2941,9 +3020,9 @@ void HP_bg_queue_check(struct bg_arena *arena) {
{
HPMHooks.source.bg.queue_check(arena);
}
- if( HPMHooks.count.HP_bg_queue_check_post ) {
+ if (HPMHooks.count.HP_bg_queue_check_post > 0) {
void (*postHookFunc) (struct bg_arena *arena);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_queue_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_queue_check_post[hIndex].func;
postHookFunc(arena);
}
@@ -2953,14 +3032,14 @@ void HP_bg_queue_check(struct bg_arena *arena) {
struct battleground_data* HP_bg_team_search(int bg_id) {
int hIndex = 0;
struct battleground_data* retVal___ = NULL;
- if( HPMHooks.count.HP_bg_team_search_pre ) {
+ if (HPMHooks.count.HP_bg_team_search_pre > 0) {
struct battleground_data* (*preHookFunc) (int *bg_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_team_search_pre[hIndex].func;
retVal___ = preHookFunc(&bg_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2968,11 +3047,11 @@ struct battleground_data* HP_bg_team_search(int bg_id) {
{
retVal___ = HPMHooks.source.bg.team_search(bg_id);
}
- if( HPMHooks.count.HP_bg_team_search_post ) {
- struct battleground_data* (*postHookFunc) (struct battleground_data* retVal___, int *bg_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_team_search_post > 0) {
+ struct battleground_data* (*postHookFunc) (struct battleground_data* retVal___, int bg_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_team_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &bg_id);
+ retVal___ = postHookFunc(retVal___, bg_id);
}
}
return retVal___;
@@ -2980,14 +3059,14 @@ struct battleground_data* HP_bg_team_search(int bg_id) {
struct map_session_data* HP_bg_getavailablesd(struct battleground_data *bgd) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_bg_getavailablesd_pre ) {
- struct map_session_data* (*preHookFunc) (struct battleground_data *bgd);
+ if (HPMHooks.count.HP_bg_getavailablesd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct battleground_data **bgd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_getavailablesd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_getavailablesd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_getavailablesd_pre[hIndex].func;
- retVal___ = preHookFunc(bgd);
+ retVal___ = preHookFunc(&bgd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -2995,9 +3074,9 @@ struct map_session_data* HP_bg_getavailablesd(struct battleground_data *bgd) {
{
retVal___ = HPMHooks.source.bg.getavailablesd(bgd);
}
- if( HPMHooks.count.HP_bg_getavailablesd_post ) {
+ if (HPMHooks.count.HP_bg_getavailablesd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct battleground_data *bgd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_getavailablesd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_getavailablesd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_getavailablesd_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bgd);
}
@@ -3007,14 +3086,14 @@ struct map_session_data* HP_bg_getavailablesd(struct battleground_data *bgd) {
bool HP_bg_team_delete(int bg_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_bg_team_delete_pre ) {
+ if (HPMHooks.count.HP_bg_team_delete_pre > 0) {
bool (*preHookFunc) (int *bg_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_team_delete_pre[hIndex].func;
retVal___ = preHookFunc(&bg_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3022,11 +3101,11 @@ bool HP_bg_team_delete(int bg_id) {
{
retVal___ = HPMHooks.source.bg.team_delete(bg_id);
}
- if( HPMHooks.count.HP_bg_team_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *bg_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_team_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int bg_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_team_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &bg_id);
+ retVal___ = postHookFunc(retVal___, bg_id);
}
}
return retVal___;
@@ -3034,14 +3113,14 @@ bool HP_bg_team_delete(int bg_id) {
bool HP_bg_team_warp(int bg_id, unsigned short map_index, short x, short y) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_bg_team_warp_pre ) {
+ if (HPMHooks.count.HP_bg_team_warp_pre > 0) {
bool (*preHookFunc) (int *bg_id, unsigned short *map_index, short *x, short *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_warp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_warp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_team_warp_pre[hIndex].func;
retVal___ = preHookFunc(&bg_id, &map_index, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3049,25 +3128,25 @@ bool HP_bg_team_warp(int bg_id, unsigned short map_index, short x, short y) {
{
retVal___ = HPMHooks.source.bg.team_warp(bg_id, map_index, x, y);
}
- if( HPMHooks.count.HP_bg_team_warp_post ) {
- bool (*postHookFunc) (bool retVal___, int *bg_id, unsigned short *map_index, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_warp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_team_warp_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int bg_id, unsigned short map_index, short x, short y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_warp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_team_warp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &bg_id, &map_index, &x, &y);
+ retVal___ = postHookFunc(retVal___, bg_id, map_index, x, y);
}
}
return retVal___;
}
void HP_bg_send_dot_remove(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_send_dot_remove_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_bg_send_dot_remove_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_dot_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_dot_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_send_dot_remove_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3075,9 +3154,9 @@ void HP_bg_send_dot_remove(struct map_session_data *sd) {
{
HPMHooks.source.bg.send_dot_remove(sd);
}
- if( HPMHooks.count.HP_bg_send_dot_remove_post ) {
+ if (HPMHooks.count.HP_bg_send_dot_remove_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_dot_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_dot_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_send_dot_remove_post[hIndex].func;
postHookFunc(sd);
}
@@ -3087,14 +3166,14 @@ void HP_bg_send_dot_remove(struct map_session_data *sd) {
bool HP_bg_team_join(int bg_id, struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_bg_team_join_pre ) {
- bool (*preHookFunc) (int *bg_id, struct map_session_data *sd);
+ if (HPMHooks.count.HP_bg_team_join_pre > 0) {
+ bool (*preHookFunc) (int *bg_id, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_join_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_join_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_team_join_pre[hIndex].func;
- retVal___ = preHookFunc(&bg_id, sd);
+ retVal___ = preHookFunc(&bg_id, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3102,11 +3181,11 @@ bool HP_bg_team_join(int bg_id, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.bg.team_join(bg_id, sd);
}
- if( HPMHooks.count.HP_bg_team_join_post ) {
- bool (*postHookFunc) (bool retVal___, int *bg_id, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_join_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_team_join_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int bg_id, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_join_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_team_join_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &bg_id, sd);
+ retVal___ = postHookFunc(retVal___, bg_id, sd);
}
}
return retVal___;
@@ -3114,14 +3193,14 @@ bool HP_bg_team_join(int bg_id, struct map_session_data *sd) {
int HP_bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_team_leave_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, enum bg_team_leave_type *flag);
+ if (HPMHooks.count.HP_bg_team_leave_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, enum bg_team_leave_type *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_team_leave_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3129,11 +3208,11 @@ int HP_bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type flag)
{
retVal___ = HPMHooks.source.bg.team_leave(sd, flag);
}
- if( HPMHooks.count.HP_bg_team_leave_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum bg_team_leave_type *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_team_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum bg_team_leave_type flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_team_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -3141,14 +3220,14 @@ int HP_bg_team_leave(struct map_session_data *sd, enum bg_team_leave_type flag)
bool HP_bg_member_respawn(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_bg_member_respawn_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_bg_member_respawn_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_member_respawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_member_respawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_member_respawn_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3156,9 +3235,9 @@ bool HP_bg_member_respawn(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.bg.member_respawn(sd);
}
- if( HPMHooks.count.HP_bg_member_respawn_post ) {
+ if (HPMHooks.count.HP_bg_member_respawn_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_member_respawn_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_member_respawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_member_respawn_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -3168,14 +3247,14 @@ bool HP_bg_member_respawn(struct map_session_data *sd) {
int HP_bg_create(unsigned short map_index, short rx, short ry, const char *ev, const char *dev) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_create_pre ) {
- int (*preHookFunc) (unsigned short *map_index, short *rx, short *ry, const char *ev, const char *dev);
+ if (HPMHooks.count.HP_bg_create_pre > 0) {
+ int (*preHookFunc) (unsigned short *map_index, short *rx, short *ry, const char **ev, const char **dev);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_create_pre[hIndex].func;
- retVal___ = preHookFunc(&map_index, &rx, &ry, ev, dev);
+ retVal___ = preHookFunc(&map_index, &rx, &ry, &ev, &dev);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3183,11 +3262,11 @@ int HP_bg_create(unsigned short map_index, short rx, short ry, const char *ev, c
{
retVal___ = HPMHooks.source.bg.create(map_index, rx, ry, ev, dev);
}
- if( HPMHooks.count.HP_bg_create_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *map_index, short *rx, short *ry, const char *ev, const char *dev);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_create_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short map_index, short rx, short ry, const char *ev, const char *dev);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &map_index, &rx, &ry, ev, dev);
+ retVal___ = postHookFunc(retVal___, map_index, rx, ry, ev, dev);
}
}
return retVal___;
@@ -3195,14 +3274,14 @@ int HP_bg_create(unsigned short map_index, short rx, short ry, const char *ev, c
int HP_bg_team_get_id(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_team_get_id_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_bg_team_get_id_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_get_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_get_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_team_get_id_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3210,55 +3289,55 @@ int HP_bg_team_get_id(struct block_list *bl) {
{
retVal___ = HPMHooks.source.bg.team_get_id(bl);
}
- if( HPMHooks.count.HP_bg_team_get_id_post ) {
+ if (HPMHooks.count.HP_bg_team_get_id_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_get_id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_get_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_team_get_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-bool HP_bg_send_message(struct map_session_data *sd, const char *mes, int len) {
+bool HP_bg_send_message(struct map_session_data *sd, const char *mes) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_bg_send_message_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *mes, int *len);
+ if (HPMHooks.count.HP_bg_send_message_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_send_message_pre[hIndex].func;
- retVal___ = preHookFunc(sd, mes, &len);
+ retVal___ = preHookFunc(&sd, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.bg.send_message(sd, mes, len);
+ retVal___ = HPMHooks.source.bg.send_message(sd, mes);
}
- if( HPMHooks.count.HP_bg_send_message_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_send_message_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_send_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, mes, &len);
+ retVal___ = postHookFunc(retVal___, sd, mes);
}
}
return retVal___;
}
-int HP_bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
+int HP_bg_send_xy_timer_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_send_xy_timer_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_bg_send_xy_timer_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_bg_send_xy_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3268,12 +3347,12 @@ int HP_bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.bg.send_xy_timer_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_bg_send_xy_timer_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_send_xy_timer_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_bg_send_xy_timer_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -3282,14 +3361,14 @@ int HP_bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
int HP_bg_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_send_xy_timer_pre ) {
+ if (HPMHooks.count.HP_bg_send_xy_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_send_xy_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3297,11 +3376,11 @@ int HP_bg_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.bg.send_xy_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_bg_send_xy_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_send_xy_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_send_xy_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_send_xy_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -3309,14 +3388,14 @@ int HP_bg_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_bg_afk_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_afk_timer_pre ) {
+ if (HPMHooks.count.HP_bg_afk_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_afk_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_afk_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_afk_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3324,28 +3403,28 @@ int HP_bg_afk_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.bg.afk_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_bg_afk_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_afk_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_afk_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_afk_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_afk_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-int HP_bg_team_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_bg_team_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_bg_team_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_bg_team_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_bg_team_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3355,12 +3434,12 @@ int HP_bg_team_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.bg.team_db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_bg_team_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_bg_team_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_team_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_bg_team_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -3369,14 +3448,14 @@ int HP_bg_team_db_final(DBKey key, DBData *data, va_list ap) {
enum bg_queue_types HP_bg_str2teamtype(const char *str) {
int hIndex = 0;
enum bg_queue_types retVal___ = BGQT_INVALID;
- if( HPMHooks.count.HP_bg_str2teamtype_pre ) {
- enum bg_queue_types (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_bg_str2teamtype_pre > 0) {
+ enum bg_queue_types (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_str2teamtype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_str2teamtype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_str2teamtype_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3384,9 +3463,9 @@ enum bg_queue_types HP_bg_str2teamtype(const char *str) {
{
retVal___ = HPMHooks.source.bg.str2teamtype(str);
}
- if( HPMHooks.count.HP_bg_str2teamtype_post ) {
+ if (HPMHooks.count.HP_bg_str2teamtype_post > 0) {
enum bg_queue_types (*postHookFunc) (enum bg_queue_types retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_str2teamtype_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_str2teamtype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_str2teamtype_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -3395,14 +3474,14 @@ enum bg_queue_types HP_bg_str2teamtype(const char *str) {
}
void HP_bg_config_read(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_bg_config_read_pre ) {
+ if (HPMHooks.count.HP_bg_config_read_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_bg_config_read_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3410,27 +3489,27 @@ void HP_bg_config_read(void) {
{
HPMHooks.source.bg.config_read();
}
- if( HPMHooks.count.HP_bg_config_read_post ) {
+ if (HPMHooks.count.HP_bg_config_read_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_bg_config_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_bg_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_bg_config_read_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* buyingstore */
+/* buyingstore_interface */
bool HP_buyingstore_setup(struct map_session_data *sd, unsigned char slots) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_buyingstore_setup_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, unsigned char *slots);
+ if (HPMHooks.count.HP_buyingstore_setup_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, unsigned char *slots);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_setup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_setup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_setup_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &slots);
+ retVal___ = preHookFunc(&sd, &slots);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3438,25 +3517,25 @@ bool HP_buyingstore_setup(struct map_session_data *sd, unsigned char slots) {
{
retVal___ = HPMHooks.source.buyingstore.setup(sd, slots);
}
- if( HPMHooks.count.HP_buyingstore_setup_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned char *slots);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_setup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_buyingstore_setup_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned char slots);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_setup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_setup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &slots);
+ retVal___ = postHookFunc(retVal___, sd, slots);
}
}
return retVal___;
}
void HP_buyingstore_create(struct map_session_data *sd, int zenylimit, unsigned char result, const char *storename, const uint8 *itemlist, unsigned int count) {
int hIndex = 0;
- if( HPMHooks.count.HP_buyingstore_create_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *zenylimit, unsigned char *result, const char *storename, const uint8 *itemlist, unsigned int *count);
+ if (HPMHooks.count.HP_buyingstore_create_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *zenylimit, unsigned char *result, const char **storename, const uint8 **itemlist, unsigned int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_create_pre[hIndex].func;
- preHookFunc(sd, &zenylimit, &result, storename, itemlist, &count);
+ preHookFunc(&sd, &zenylimit, &result, &storename, &itemlist, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3464,25 +3543,25 @@ void HP_buyingstore_create(struct map_session_data *sd, int zenylimit, unsigned
{
HPMHooks.source.buyingstore.create(sd, zenylimit, result, storename, itemlist, count);
}
- if( HPMHooks.count.HP_buyingstore_create_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *zenylimit, unsigned char *result, const char *storename, const uint8 *itemlist, unsigned int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_buyingstore_create_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int zenylimit, unsigned char result, const char *storename, const uint8 *itemlist, unsigned int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_create_post[hIndex].func;
- postHookFunc(sd, &zenylimit, &result, storename, itemlist, &count);
+ postHookFunc(sd, zenylimit, result, storename, itemlist, count);
}
}
return;
}
void HP_buyingstore_close(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_buyingstore_close_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_buyingstore_close_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_close_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3490,9 +3569,9 @@ void HP_buyingstore_close(struct map_session_data *sd) {
{
HPMHooks.source.buyingstore.close(sd);
}
- if( HPMHooks.count.HP_buyingstore_close_post ) {
+ if (HPMHooks.count.HP_buyingstore_close_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_close_post[hIndex].func;
postHookFunc(sd);
}
@@ -3501,14 +3580,14 @@ void HP_buyingstore_close(struct map_session_data *sd) {
}
void HP_buyingstore_open(struct map_session_data *sd, int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_buyingstore_open_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id);
+ if (HPMHooks.count.HP_buyingstore_open_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_open_pre[hIndex].func;
- preHookFunc(sd, &account_id);
+ preHookFunc(&sd, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3516,25 +3595,25 @@ void HP_buyingstore_open(struct map_session_data *sd, int account_id) {
{
HPMHooks.source.buyingstore.open(sd, account_id);
}
- if( HPMHooks.count.HP_buyingstore_open_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_open_post; hIndex++ ) {
+ if (HPMHooks.count.HP_buyingstore_open_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_open_post[hIndex].func;
- postHookFunc(sd, &account_id);
+ postHookFunc(sd, account_id);
}
}
return;
}
void HP_buyingstore_trade(struct map_session_data *sd, int account_id, unsigned int buyer_id, const uint8 *itemlist, unsigned int count) {
int hIndex = 0;
- if( HPMHooks.count.HP_buyingstore_trade_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id, unsigned int *buyer_id, const uint8 *itemlist, unsigned int *count);
+ if (HPMHooks.count.HP_buyingstore_trade_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id, unsigned int *buyer_id, const uint8 **itemlist, unsigned int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_trade_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_trade_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_trade_pre[hIndex].func;
- preHookFunc(sd, &account_id, &buyer_id, itemlist, &count);
+ preHookFunc(&sd, &account_id, &buyer_id, &itemlist, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3542,11 +3621,11 @@ void HP_buyingstore_trade(struct map_session_data *sd, int account_id, unsigned
{
HPMHooks.source.buyingstore.trade(sd, account_id, buyer_id, itemlist, count);
}
- if( HPMHooks.count.HP_buyingstore_trade_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id, unsigned int *buyer_id, const uint8 *itemlist, unsigned int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_trade_post; hIndex++ ) {
+ if (HPMHooks.count.HP_buyingstore_trade_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id, unsigned int buyer_id, const uint8 *itemlist, unsigned int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_trade_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_trade_post[hIndex].func;
- postHookFunc(sd, &account_id, &buyer_id, itemlist, &count);
+ postHookFunc(sd, account_id, buyer_id, itemlist, count);
}
}
return;
@@ -3554,14 +3633,14 @@ void HP_buyingstore_trade(struct map_session_data *sd, int account_id, unsigned
bool HP_buyingstore_search(struct map_session_data *sd, unsigned short nameid) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_buyingstore_search_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, unsigned short *nameid);
+ if (HPMHooks.count.HP_buyingstore_search_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_search_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3569,11 +3648,11 @@ bool HP_buyingstore_search(struct map_session_data *sd, unsigned short nameid) {
{
retVal___ = HPMHooks.source.buyingstore.search(sd, nameid);
}
- if( HPMHooks.count.HP_buyingstore_search_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned short *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_buyingstore_search_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned short nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
@@ -3581,14 +3660,14 @@ bool HP_buyingstore_search(struct map_session_data *sd, unsigned short nameid) {
bool HP_buyingstore_searchall(struct map_session_data *sd, const struct s_search_store_search *s) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_buyingstore_searchall_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const struct s_search_store_search *s);
+ if (HPMHooks.count.HP_buyingstore_searchall_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const struct s_search_store_search **s);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_searchall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_searchall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_searchall_pre[hIndex].func;
- retVal___ = preHookFunc(sd, s);
+ retVal___ = preHookFunc(&sd, &s);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3596,9 +3675,9 @@ bool HP_buyingstore_searchall(struct map_session_data *sd, const struct s_search
{
retVal___ = HPMHooks.source.buyingstore.searchall(sd, s);
}
- if( HPMHooks.count.HP_buyingstore_searchall_post ) {
+ if (HPMHooks.count.HP_buyingstore_searchall_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct s_search_store_search *s);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_searchall_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_searchall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_searchall_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, s);
}
@@ -3608,14 +3687,14 @@ bool HP_buyingstore_searchall(struct map_session_data *sd, const struct s_search
unsigned int HP_buyingstore_getuid(void) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_buyingstore_getuid_pre ) {
+ if (HPMHooks.count.HP_buyingstore_getuid_pre > 0) {
unsigned int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_getuid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_getuid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_buyingstore_getuid_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3623,27 +3702,27 @@ unsigned int HP_buyingstore_getuid(void) {
{
retVal___ = HPMHooks.source.buyingstore.getuid();
}
- if( HPMHooks.count.HP_buyingstore_getuid_post ) {
+ if (HPMHooks.count.HP_buyingstore_getuid_post > 0) {
unsigned int (*postHookFunc) (unsigned int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_getuid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_buyingstore_getuid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_buyingstore_getuid_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-/* channel */
+/* channel_interface */
int HP_channel_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_channel_init_pre ) {
+ if (HPMHooks.count.HP_channel_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3651,25 +3730,25 @@ int HP_channel_init(bool minimal) {
{
retVal___ = HPMHooks.source.channel.init(minimal);
}
- if( HPMHooks.count.HP_channel_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_channel_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
}
void HP_channel_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_final_pre ) {
+ if (HPMHooks.count.HP_channel_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3677,9 +3756,9 @@ void HP_channel_final(void) {
{
HPMHooks.source.channel.final();
}
- if( HPMHooks.count.HP_channel_final_post ) {
+ if (HPMHooks.count.HP_channel_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_final_post[hIndex].func;
postHookFunc();
}
@@ -3689,14 +3768,14 @@ void HP_channel_final(void) {
struct channel_data* HP_channel_search(const char *name, struct map_session_data *sd) {
int hIndex = 0;
struct channel_data* retVal___ = NULL;
- if( HPMHooks.count.HP_channel_search_pre ) {
- struct channel_data* (*preHookFunc) (const char *name, struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_search_pre > 0) {
+ struct channel_data* (*preHookFunc) (const char **name, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_search_pre[hIndex].func;
- retVal___ = preHookFunc(name, sd);
+ retVal___ = preHookFunc(&name, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3704,9 +3783,9 @@ struct channel_data* HP_channel_search(const char *name, struct map_session_data
{
retVal___ = HPMHooks.source.channel.search(name, sd);
}
- if( HPMHooks.count.HP_channel_search_post ) {
+ if (HPMHooks.count.HP_channel_search_post > 0) {
struct channel_data* (*postHookFunc) (struct channel_data* retVal___, const char *name, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_search_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_search_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name, sd);
}
@@ -3716,14 +3795,14 @@ struct channel_data* HP_channel_search(const char *name, struct map_session_data
struct channel_data* HP_channel_create(enum channel_types type, const char *name, unsigned char color) {
int hIndex = 0;
struct channel_data* retVal___ = NULL;
- if( HPMHooks.count.HP_channel_create_pre ) {
- struct channel_data* (*preHookFunc) (enum channel_types *type, const char *name, unsigned char *color);
+ if (HPMHooks.count.HP_channel_create_pre > 0) {
+ struct channel_data* (*preHookFunc) (enum channel_types *type, const char **name, unsigned char *color);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_create_pre[hIndex].func;
- retVal___ = preHookFunc(&type, name, &color);
+ retVal___ = preHookFunc(&type, &name, &color);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3731,25 +3810,25 @@ struct channel_data* HP_channel_create(enum channel_types type, const char *name
{
retVal___ = HPMHooks.source.channel.create(type, name, color);
}
- if( HPMHooks.count.HP_channel_create_post ) {
- struct channel_data* (*postHookFunc) (struct channel_data* retVal___, enum channel_types *type, const char *name, unsigned char *color);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_channel_create_post > 0) {
+ struct channel_data* (*postHookFunc) (struct channel_data* retVal___, enum channel_types type, const char *name, unsigned char color);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, name, &color);
+ retVal___ = postHookFunc(retVal___, type, name, color);
}
}
return retVal___;
}
void HP_channel_delete(struct channel_data *chan) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_delete_pre ) {
- void (*preHookFunc) (struct channel_data *chan);
+ if (HPMHooks.count.HP_channel_delete_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_delete_pre[hIndex].func;
- preHookFunc(chan);
+ preHookFunc(&chan);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3757,9 +3836,9 @@ void HP_channel_delete(struct channel_data *chan) {
{
HPMHooks.source.channel.delete(chan);
}
- if( HPMHooks.count.HP_channel_delete_post ) {
+ if (HPMHooks.count.HP_channel_delete_post > 0) {
void (*postHookFunc) (struct channel_data *chan);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_delete_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_delete_post[hIndex].func;
postHookFunc(chan);
}
@@ -3768,14 +3847,14 @@ void HP_channel_delete(struct channel_data *chan) {
}
void HP_channel_set_password(struct channel_data *chan, const char *password) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_set_password_pre ) {
- void (*preHookFunc) (struct channel_data *chan, const char *password);
+ if (HPMHooks.count.HP_channel_set_password_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, const char **password);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_password_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_password_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_set_password_pre[hIndex].func;
- preHookFunc(chan, password);
+ preHookFunc(&chan, &password);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3783,9 +3862,9 @@ void HP_channel_set_password(struct channel_data *chan, const char *password) {
{
HPMHooks.source.channel.set_password(chan, password);
}
- if( HPMHooks.count.HP_channel_set_password_post ) {
+ if (HPMHooks.count.HP_channel_set_password_post > 0) {
void (*postHookFunc) (struct channel_data *chan, const char *password);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_password_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_password_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_set_password_post[hIndex].func;
postHookFunc(chan, password);
}
@@ -3795,14 +3874,14 @@ void HP_channel_set_password(struct channel_data *chan, const char *password) {
enum channel_operation_status HP_channel_ban(struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd) {
int hIndex = 0;
enum channel_operation_status retVal___ = HCS_STATUS_FAIL;
- if( HPMHooks.count.HP_channel_ban_pre ) {
- enum channel_operation_status (*preHookFunc) (struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_channel_ban_pre > 0) {
+ enum channel_operation_status (*preHookFunc) (struct channel_data **chan, const struct map_session_data **ssd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_ban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_ban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_ban_pre[hIndex].func;
- retVal___ = preHookFunc(chan, ssd, tsd);
+ retVal___ = preHookFunc(&chan, &ssd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3810,9 +3889,9 @@ enum channel_operation_status HP_channel_ban(struct channel_data *chan, const st
{
retVal___ = HPMHooks.source.channel.ban(chan, ssd, tsd);
}
- if( HPMHooks.count.HP_channel_ban_post ) {
+ if (HPMHooks.count.HP_channel_ban_post > 0) {
enum channel_operation_status (*postHookFunc) (enum channel_operation_status retVal___, struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_ban_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_ban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_ban_post[hIndex].func;
retVal___ = postHookFunc(retVal___, chan, ssd, tsd);
}
@@ -3822,14 +3901,14 @@ enum channel_operation_status HP_channel_ban(struct channel_data *chan, const st
enum channel_operation_status HP_channel_unban(struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd) {
int hIndex = 0;
enum channel_operation_status retVal___ = HCS_STATUS_FAIL;
- if( HPMHooks.count.HP_channel_unban_pre ) {
- enum channel_operation_status (*preHookFunc) (struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_channel_unban_pre > 0) {
+ enum channel_operation_status (*preHookFunc) (struct channel_data **chan, const struct map_session_data **ssd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_unban_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_unban_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_unban_pre[hIndex].func;
- retVal___ = preHookFunc(chan, ssd, tsd);
+ retVal___ = preHookFunc(&chan, &ssd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3837,9 +3916,9 @@ enum channel_operation_status HP_channel_unban(struct channel_data *chan, const
{
retVal___ = HPMHooks.source.channel.unban(chan, ssd, tsd);
}
- if( HPMHooks.count.HP_channel_unban_post ) {
+ if (HPMHooks.count.HP_channel_unban_post > 0) {
enum channel_operation_status (*postHookFunc) (enum channel_operation_status retVal___, struct channel_data *chan, const struct map_session_data *ssd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_unban_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_unban_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_unban_post[hIndex].func;
retVal___ = postHookFunc(retVal___, chan, ssd, tsd);
}
@@ -3848,14 +3927,14 @@ enum channel_operation_status HP_channel_unban(struct channel_data *chan, const
}
void HP_channel_set_options(struct channel_data *chan, unsigned int options) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_set_options_pre ) {
- void (*preHookFunc) (struct channel_data *chan, unsigned int *options);
+ if (HPMHooks.count.HP_channel_set_options_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_options_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_options_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_set_options_pre[hIndex].func;
- preHookFunc(chan, &options);
+ preHookFunc(&chan, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3863,25 +3942,25 @@ void HP_channel_set_options(struct channel_data *chan, unsigned int options) {
{
HPMHooks.source.channel.set_options(chan, options);
}
- if( HPMHooks.count.HP_channel_set_options_post ) {
- void (*postHookFunc) (struct channel_data *chan, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_options_post; hIndex++ ) {
+ if (HPMHooks.count.HP_channel_set_options_post > 0) {
+ void (*postHookFunc) (struct channel_data *chan, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_set_options_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_set_options_post[hIndex].func;
- postHookFunc(chan, &options);
+ postHookFunc(chan, options);
}
}
return;
}
void HP_channel_send(struct channel_data *chan, struct map_session_data *sd, const char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_send_pre ) {
- void (*preHookFunc) (struct channel_data *chan, struct map_session_data *sd, const char *msg);
+ if (HPMHooks.count.HP_channel_send_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, struct map_session_data **sd, const char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_send_pre[hIndex].func;
- preHookFunc(chan, sd, msg);
+ preHookFunc(&chan, &sd, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3889,9 +3968,9 @@ void HP_channel_send(struct channel_data *chan, struct map_session_data *sd, con
{
HPMHooks.source.channel.send(chan, sd, msg);
}
- if( HPMHooks.count.HP_channel_send_post ) {
+ if (HPMHooks.count.HP_channel_send_post > 0) {
void (*postHookFunc) (struct channel_data *chan, struct map_session_data *sd, const char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_send_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_send_post[hIndex].func;
postHookFunc(chan, sd, msg);
}
@@ -3900,14 +3979,14 @@ void HP_channel_send(struct channel_data *chan, struct map_session_data *sd, con
}
void HP_channel_join_sub(struct channel_data *chan, struct map_session_data *sd, bool stealth) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_join_sub_pre ) {
- void (*preHookFunc) (struct channel_data *chan, struct map_session_data *sd, bool *stealth);
+ if (HPMHooks.count.HP_channel_join_sub_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, struct map_session_data **sd, bool *stealth);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_join_sub_pre[hIndex].func;
- preHookFunc(chan, sd, &stealth);
+ preHookFunc(&chan, &sd, &stealth);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3915,11 +3994,11 @@ void HP_channel_join_sub(struct channel_data *chan, struct map_session_data *sd,
{
HPMHooks.source.channel.join_sub(chan, sd, stealth);
}
- if( HPMHooks.count.HP_channel_join_sub_post ) {
- void (*postHookFunc) (struct channel_data *chan, struct map_session_data *sd, bool *stealth);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_channel_join_sub_post > 0) {
+ void (*postHookFunc) (struct channel_data *chan, struct map_session_data *sd, bool stealth);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_join_sub_post[hIndex].func;
- postHookFunc(chan, sd, &stealth);
+ postHookFunc(chan, sd, stealth);
}
}
return;
@@ -3927,14 +4006,14 @@ void HP_channel_join_sub(struct channel_data *chan, struct map_session_data *sd,
enum channel_operation_status HP_channel_join(struct channel_data *chan, struct map_session_data *sd, const char *password, bool silent) {
int hIndex = 0;
enum channel_operation_status retVal___ = HCS_STATUS_FAIL;
- if( HPMHooks.count.HP_channel_join_pre ) {
- enum channel_operation_status (*preHookFunc) (struct channel_data *chan, struct map_session_data *sd, const char *password, bool *silent);
+ if (HPMHooks.count.HP_channel_join_pre > 0) {
+ enum channel_operation_status (*preHookFunc) (struct channel_data **chan, struct map_session_data **sd, const char **password, bool *silent);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_join_pre[hIndex].func;
- retVal___ = preHookFunc(chan, sd, password, &silent);
+ retVal___ = preHookFunc(&chan, &sd, &password, &silent);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -3942,25 +4021,25 @@ enum channel_operation_status HP_channel_join(struct channel_data *chan, struct
{
retVal___ = HPMHooks.source.channel.join(chan, sd, password, silent);
}
- if( HPMHooks.count.HP_channel_join_post ) {
- enum channel_operation_status (*postHookFunc) (enum channel_operation_status retVal___, struct channel_data *chan, struct map_session_data *sd, const char *password, bool *silent);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_post; hIndex++ ) {
+ if (HPMHooks.count.HP_channel_join_post > 0) {
+ enum channel_operation_status (*postHookFunc) (enum channel_operation_status retVal___, struct channel_data *chan, struct map_session_data *sd, const char *password, bool silent);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_join_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_join_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, chan, sd, password, &silent);
+ retVal___ = postHookFunc(retVal___, chan, sd, password, silent);
}
}
return retVal___;
}
void HP_channel_leave(struct channel_data *chan, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_leave_pre ) {
- void (*preHookFunc) (struct channel_data *chan, struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_leave_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_leave_pre[hIndex].func;
- preHookFunc(chan, sd);
+ preHookFunc(&chan, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3968,9 +4047,9 @@ void HP_channel_leave(struct channel_data *chan, struct map_session_data *sd) {
{
HPMHooks.source.channel.leave(chan, sd);
}
- if( HPMHooks.count.HP_channel_leave_post ) {
+ if (HPMHooks.count.HP_channel_leave_post > 0) {
void (*postHookFunc) (struct channel_data *chan, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_leave_post[hIndex].func;
postHookFunc(chan, sd);
}
@@ -3979,14 +4058,14 @@ void HP_channel_leave(struct channel_data *chan, struct map_session_data *sd) {
}
void HP_channel_leave_sub(struct channel_data *chan, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_leave_sub_pre ) {
- void (*preHookFunc) (struct channel_data *chan, struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_leave_sub_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_leave_sub_pre[hIndex].func;
- preHookFunc(chan, sd);
+ preHookFunc(&chan, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -3994,9 +4073,9 @@ void HP_channel_leave_sub(struct channel_data *chan, struct map_session_data *sd
{
HPMHooks.source.channel.leave_sub(chan, sd);
}
- if( HPMHooks.count.HP_channel_leave_sub_post ) {
+ if (HPMHooks.count.HP_channel_leave_sub_post > 0) {
void (*postHookFunc) (struct channel_data *chan, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_leave_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_leave_sub_post[hIndex].func;
postHookFunc(chan, sd);
}
@@ -4005,14 +4084,14 @@ void HP_channel_leave_sub(struct channel_data *chan, struct map_session_data *sd
}
void HP_channel_quit(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_quit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_quit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_quit_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4020,9 +4099,9 @@ void HP_channel_quit(struct map_session_data *sd) {
{
HPMHooks.source.channel.quit(sd);
}
- if( HPMHooks.count.HP_channel_quit_post ) {
+ if (HPMHooks.count.HP_channel_quit_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_quit_post[hIndex].func;
postHookFunc(sd);
}
@@ -4031,14 +4110,14 @@ void HP_channel_quit(struct map_session_data *sd) {
}
void HP_channel_map_join(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_map_join_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_map_join_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_map_join_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_map_join_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_map_join_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4046,9 +4125,9 @@ void HP_channel_map_join(struct map_session_data *sd) {
{
HPMHooks.source.channel.map_join(sd);
}
- if( HPMHooks.count.HP_channel_map_join_post ) {
+ if (HPMHooks.count.HP_channel_map_join_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_map_join_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_map_join_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_map_join_post[hIndex].func;
postHookFunc(sd);
}
@@ -4057,14 +4136,14 @@ void HP_channel_map_join(struct map_session_data *sd) {
}
void HP_channel_guild_join_alliance(const struct guild *g_source, const struct guild *g_ally) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_guild_join_alliance_pre ) {
- void (*preHookFunc) (const struct guild *g_source, const struct guild *g_ally);
+ if (HPMHooks.count.HP_channel_guild_join_alliance_pre > 0) {
+ void (*preHookFunc) (const struct guild **g_source, const struct guild **g_ally);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_join_alliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_join_alliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_guild_join_alliance_pre[hIndex].func;
- preHookFunc(g_source, g_ally);
+ preHookFunc(&g_source, &g_ally);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4072,9 +4151,9 @@ void HP_channel_guild_join_alliance(const struct guild *g_source, const struct g
{
HPMHooks.source.channel.guild_join_alliance(g_source, g_ally);
}
- if( HPMHooks.count.HP_channel_guild_join_alliance_post ) {
+ if (HPMHooks.count.HP_channel_guild_join_alliance_post > 0) {
void (*postHookFunc) (const struct guild *g_source, const struct guild *g_ally);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_join_alliance_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_join_alliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_guild_join_alliance_post[hIndex].func;
postHookFunc(g_source, g_ally);
}
@@ -4083,14 +4162,14 @@ void HP_channel_guild_join_alliance(const struct guild *g_source, const struct g
}
void HP_channel_guild_leave_alliance(const struct guild *g_source, const struct guild *g_ally) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_guild_leave_alliance_pre ) {
- void (*preHookFunc) (const struct guild *g_source, const struct guild *g_ally);
+ if (HPMHooks.count.HP_channel_guild_leave_alliance_pre > 0) {
+ void (*preHookFunc) (const struct guild **g_source, const struct guild **g_ally);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_leave_alliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_leave_alliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_guild_leave_alliance_pre[hIndex].func;
- preHookFunc(g_source, g_ally);
+ preHookFunc(&g_source, &g_ally);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4098,9 +4177,9 @@ void HP_channel_guild_leave_alliance(const struct guild *g_source, const struct
{
HPMHooks.source.channel.guild_leave_alliance(g_source, g_ally);
}
- if( HPMHooks.count.HP_channel_guild_leave_alliance_post ) {
+ if (HPMHooks.count.HP_channel_guild_leave_alliance_post > 0) {
void (*postHookFunc) (const struct guild *g_source, const struct guild *g_ally);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_leave_alliance_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_guild_leave_alliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_guild_leave_alliance_post[hIndex].func;
postHookFunc(g_source, g_ally);
}
@@ -4109,14 +4188,14 @@ void HP_channel_guild_leave_alliance(const struct guild *g_source, const struct
}
void HP_channel_quit_guild(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_quit_guild_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_quit_guild_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_guild_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_guild_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_quit_guild_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4124,9 +4203,9 @@ void HP_channel_quit_guild(struct map_session_data *sd) {
{
HPMHooks.source.channel.quit_guild(sd);
}
- if( HPMHooks.count.HP_channel_quit_guild_post ) {
+ if (HPMHooks.count.HP_channel_quit_guild_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_guild_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_quit_guild_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_quit_guild_post[hIndex].func;
postHookFunc(sd);
}
@@ -4135,14 +4214,14 @@ void HP_channel_quit_guild(struct map_session_data *sd) {
}
void HP_channel_irc_join(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_irc_join_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_channel_irc_join_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_irc_join_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_irc_join_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_irc_join_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4150,9 +4229,9 @@ void HP_channel_irc_join(struct map_session_data *sd) {
{
HPMHooks.source.channel.irc_join(sd);
}
- if( HPMHooks.count.HP_channel_irc_join_post ) {
+ if (HPMHooks.count.HP_channel_irc_join_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_irc_join_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_irc_join_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_irc_join_post[hIndex].func;
postHookFunc(sd);
}
@@ -4161,14 +4240,14 @@ void HP_channel_irc_join(struct map_session_data *sd) {
}
void HP_channel_config_read(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_channel_config_read_pre ) {
+ if (HPMHooks.count.HP_channel_config_read_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_channel_config_read_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4176,27 +4255,27 @@ void HP_channel_config_read(void) {
{
HPMHooks.source.channel.config_read();
}
- if( HPMHooks.count.HP_channel_config_read_post ) {
+ if (HPMHooks.count.HP_channel_config_read_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_channel_config_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_channel_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_channel_config_read_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* chat */
+/* chat_interface */
bool HP_chat_create_pc_chat(struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_create_pc_chat_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *title, const char *pass, int *limit, bool *pub);
+ if (HPMHooks.count.HP_chat_create_pc_chat_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **title, const char **pass, int *limit, bool *pub);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pc_chat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pc_chat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_create_pc_chat_pre[hIndex].func;
- retVal___ = preHookFunc(sd, title, pass, &limit, &pub);
+ retVal___ = preHookFunc(&sd, &title, &pass, &limit, &pub);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4204,11 +4283,11 @@ bool HP_chat_create_pc_chat(struct map_session_data *sd, const char *title, cons
{
retVal___ = HPMHooks.source.chat.create_pc_chat(sd, title, pass, limit, pub);
}
- if( HPMHooks.count.HP_chat_create_pc_chat_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int *limit, bool *pub);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pc_chat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chat_create_pc_chat_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pc_chat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_create_pc_chat_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, title, pass, &limit, &pub);
+ retVal___ = postHookFunc(retVal___, sd, title, pass, limit, pub);
}
}
return retVal___;
@@ -4216,14 +4295,14 @@ bool HP_chat_create_pc_chat(struct map_session_data *sd, const char *title, cons
bool HP_chat_join(struct map_session_data *sd, int chatid, const char *pass) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_join_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *chatid, const char *pass);
+ if (HPMHooks.count.HP_chat_join_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *chatid, const char **pass);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_join_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_join_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_join_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &chatid, pass);
+ retVal___ = preHookFunc(&sd, &chatid, &pass);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4231,11 +4310,11 @@ bool HP_chat_join(struct map_session_data *sd, int chatid, const char *pass) {
{
retVal___ = HPMHooks.source.chat.join(sd, chatid, pass);
}
- if( HPMHooks.count.HP_chat_join_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *chatid, const char *pass);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_join_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chat_join_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int chatid, const char *pass);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_join_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_join_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &chatid, pass);
+ retVal___ = postHookFunc(retVal___, sd, chatid, pass);
}
}
return retVal___;
@@ -4243,14 +4322,14 @@ bool HP_chat_join(struct map_session_data *sd, int chatid, const char *pass) {
int HP_chat_leave(struct map_session_data *sd, bool kicked) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chat_leave_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, bool *kicked);
+ if (HPMHooks.count.HP_chat_leave_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, bool *kicked);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_leave_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &kicked);
+ retVal___ = preHookFunc(&sd, &kicked);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4258,11 +4337,11 @@ int HP_chat_leave(struct map_session_data *sd, bool kicked) {
{
retVal___ = HPMHooks.source.chat.leave(sd, kicked);
}
- if( HPMHooks.count.HP_chat_leave_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, bool *kicked);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chat_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, bool kicked);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &kicked);
+ retVal___ = postHookFunc(retVal___, sd, kicked);
}
}
return retVal___;
@@ -4270,14 +4349,14 @@ int HP_chat_leave(struct map_session_data *sd, bool kicked) {
bool HP_chat_change_owner(struct map_session_data *sd, const char *nextownername) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_change_owner_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *nextownername);
+ if (HPMHooks.count.HP_chat_change_owner_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **nextownername);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_owner_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_owner_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_change_owner_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nextownername);
+ retVal___ = preHookFunc(&sd, &nextownername);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4285,9 +4364,9 @@ bool HP_chat_change_owner(struct map_session_data *sd, const char *nextownername
{
retVal___ = HPMHooks.source.chat.change_owner(sd, nextownername);
}
- if( HPMHooks.count.HP_chat_change_owner_post ) {
+ if (HPMHooks.count.HP_chat_change_owner_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *nextownername);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_owner_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_owner_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_change_owner_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, nextownername);
}
@@ -4297,14 +4376,14 @@ bool HP_chat_change_owner(struct map_session_data *sd, const char *nextownername
bool HP_chat_change_status(struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_change_status_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *title, const char *pass, int *limit, bool *pub);
+ if (HPMHooks.count.HP_chat_change_status_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **title, const char **pass, int *limit, bool *pub);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_status_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_status_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_change_status_pre[hIndex].func;
- retVal___ = preHookFunc(sd, title, pass, &limit, &pub);
+ retVal___ = preHookFunc(&sd, &title, &pass, &limit, &pub);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4312,11 +4391,11 @@ bool HP_chat_change_status(struct map_session_data *sd, const char *title, const
{
retVal___ = HPMHooks.source.chat.change_status(sd, title, pass, limit, pub);
}
- if( HPMHooks.count.HP_chat_change_status_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int *limit, bool *pub);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_status_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chat_change_status_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *title, const char *pass, int limit, bool pub);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_change_status_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_change_status_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, title, pass, &limit, &pub);
+ retVal___ = postHookFunc(retVal___, sd, title, pass, limit, pub);
}
}
return retVal___;
@@ -4324,14 +4403,14 @@ bool HP_chat_change_status(struct map_session_data *sd, const char *title, const
bool HP_chat_kick(struct map_session_data *sd, const char *kickusername) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_kick_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *kickusername);
+ if (HPMHooks.count.HP_chat_kick_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **kickusername);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_kick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_kick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_kick_pre[hIndex].func;
- retVal___ = preHookFunc(sd, kickusername);
+ retVal___ = preHookFunc(&sd, &kickusername);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4339,38 +4418,38 @@ bool HP_chat_kick(struct map_session_data *sd, const char *kickusername) {
{
retVal___ = HPMHooks.source.chat.kick(sd, kickusername);
}
- if( HPMHooks.count.HP_chat_kick_post ) {
+ if (HPMHooks.count.HP_chat_kick_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *kickusername);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_kick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_kick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_kick_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, kickusername);
}
}
return retVal___;
}
-bool HP_chat_create_npc_chat(struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl) {
+bool HP_chat_create_npc_chat(struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_create_npc_chat_pre ) {
- bool (*preHookFunc) (struct npc_data *nd, const char *title, int *limit, bool *pub, int *trigger, const char *ev, int *zeny, int *minLvl, int *maxLvl);
+ if (HPMHooks.count.HP_chat_create_npc_chat_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd, const char **title, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_npc_chat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_npc_chat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_create_npc_chat_pre[hIndex].func;
- retVal___ = preHookFunc(nd, title, &limit, &pub, &trigger, ev, &zeny, &minLvl, &maxLvl);
+ retVal___ = preHookFunc(&nd, &title, &limit, &pub, &trigger, &ev, &zeny, &min_level, &max_level);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.chat.create_npc_chat(nd, title, limit, pub, trigger, ev, zeny, minLvl, maxLvl);
+ retVal___ = HPMHooks.source.chat.create_npc_chat(nd, title, limit, pub, trigger, ev, zeny, min_level, max_level);
}
- if( HPMHooks.count.HP_chat_create_npc_chat_post ) {
- bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const char *title, int *limit, bool *pub, int *trigger, const char *ev, int *zeny, int *minLvl, int *maxLvl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_npc_chat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chat_create_npc_chat_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const char *title, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_npc_chat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_create_npc_chat_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, title, &limit, &pub, &trigger, ev, &zeny, &minLvl, &maxLvl);
+ retVal___ = postHookFunc(retVal___, nd, title, limit, pub, trigger, ev, zeny, min_level, max_level);
}
}
return retVal___;
@@ -4378,14 +4457,14 @@ bool HP_chat_create_npc_chat(struct npc_data *nd, const char *title, int limit,
bool HP_chat_delete_npc_chat(struct npc_data *nd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_delete_npc_chat_pre ) {
- bool (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_chat_delete_npc_chat_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_delete_npc_chat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_delete_npc_chat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_delete_npc_chat_pre[hIndex].func;
- retVal___ = preHookFunc(nd);
+ retVal___ = preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4393,9 +4472,9 @@ bool HP_chat_delete_npc_chat(struct npc_data *nd) {
{
retVal___ = HPMHooks.source.chat.delete_npc_chat(nd);
}
- if( HPMHooks.count.HP_chat_delete_npc_chat_post ) {
+ if (HPMHooks.count.HP_chat_delete_npc_chat_post > 0) {
bool (*postHookFunc) (bool retVal___, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_delete_npc_chat_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_delete_npc_chat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_delete_npc_chat_post[hIndex].func;
retVal___ = postHookFunc(retVal___, nd);
}
@@ -4405,14 +4484,14 @@ bool HP_chat_delete_npc_chat(struct npc_data *nd) {
bool HP_chat_enable_event(struct chat_data *cd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_enable_event_pre ) {
- bool (*preHookFunc) (struct chat_data *cd);
+ if (HPMHooks.count.HP_chat_enable_event_pre > 0) {
+ bool (*preHookFunc) (struct chat_data **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_enable_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_enable_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_enable_event_pre[hIndex].func;
- retVal___ = preHookFunc(cd);
+ retVal___ = preHookFunc(&cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4420,9 +4499,9 @@ bool HP_chat_enable_event(struct chat_data *cd) {
{
retVal___ = HPMHooks.source.chat.enable_event(cd);
}
- if( HPMHooks.count.HP_chat_enable_event_post ) {
+ if (HPMHooks.count.HP_chat_enable_event_post > 0) {
bool (*postHookFunc) (bool retVal___, struct chat_data *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_enable_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_enable_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_enable_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, cd);
}
@@ -4432,14 +4511,14 @@ bool HP_chat_enable_event(struct chat_data *cd) {
bool HP_chat_disable_event(struct chat_data *cd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_disable_event_pre ) {
- bool (*preHookFunc) (struct chat_data *cd);
+ if (HPMHooks.count.HP_chat_disable_event_pre > 0) {
+ bool (*preHookFunc) (struct chat_data **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_disable_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_disable_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_disable_event_pre[hIndex].func;
- retVal___ = preHookFunc(cd);
+ retVal___ = preHookFunc(&cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4447,9 +4526,9 @@ bool HP_chat_disable_event(struct chat_data *cd) {
{
retVal___ = HPMHooks.source.chat.disable_event(cd);
}
- if( HPMHooks.count.HP_chat_disable_event_post ) {
+ if (HPMHooks.count.HP_chat_disable_event_post > 0) {
bool (*postHookFunc) (bool retVal___, struct chat_data *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_disable_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_disable_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_disable_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, cd);
}
@@ -4459,14 +4538,14 @@ bool HP_chat_disable_event(struct chat_data *cd) {
bool HP_chat_npc_kick_all(struct chat_data *cd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_npc_kick_all_pre ) {
- bool (*preHookFunc) (struct chat_data *cd);
+ if (HPMHooks.count.HP_chat_npc_kick_all_pre > 0) {
+ bool (*preHookFunc) (struct chat_data **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_npc_kick_all_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_npc_kick_all_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_npc_kick_all_pre[hIndex].func;
- retVal___ = preHookFunc(cd);
+ retVal___ = preHookFunc(&cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4474,9 +4553,9 @@ bool HP_chat_npc_kick_all(struct chat_data *cd) {
{
retVal___ = HPMHooks.source.chat.npc_kick_all(cd);
}
- if( HPMHooks.count.HP_chat_npc_kick_all_post ) {
+ if (HPMHooks.count.HP_chat_npc_kick_all_post > 0) {
bool (*postHookFunc) (bool retVal___, struct chat_data *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_npc_kick_all_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_npc_kick_all_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_npc_kick_all_post[hIndex].func;
retVal___ = postHookFunc(retVal___, cd);
}
@@ -4486,14 +4565,14 @@ bool HP_chat_npc_kick_all(struct chat_data *cd) {
bool HP_chat_trigger_event(struct chat_data *cd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chat_trigger_event_pre ) {
- bool (*preHookFunc) (struct chat_data *cd);
+ if (HPMHooks.count.HP_chat_trigger_event_pre > 0) {
+ bool (*preHookFunc) (struct chat_data **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_trigger_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_trigger_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_trigger_event_pre[hIndex].func;
- retVal___ = preHookFunc(cd);
+ retVal___ = preHookFunc(&cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4501,53 +4580,53 @@ bool HP_chat_trigger_event(struct chat_data *cd) {
{
retVal___ = HPMHooks.source.chat.trigger_event(cd);
}
- if( HPMHooks.count.HP_chat_trigger_event_post ) {
+ if (HPMHooks.count.HP_chat_trigger_event_post > 0) {
bool (*postHookFunc) (bool retVal___, struct chat_data *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_trigger_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_trigger_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_trigger_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, cd);
}
}
return retVal___;
}
-struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int minLvl, int maxLvl) {
+struct chat_data* HP_chat_create(struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level) {
int hIndex = 0;
struct chat_data* retVal___ = NULL;
- if( HPMHooks.count.HP_chat_create_pre ) {
- struct chat_data* (*preHookFunc) (struct block_list *bl, const char *title, const char *pass, int *limit, bool *pub, int *trigger, const char *ev, int *zeny, int *minLvl, int *maxLvl);
+ if (HPMHooks.count.HP_chat_create_pre > 0) {
+ struct chat_data* (*preHookFunc) (struct block_list **bl, const char **title, const char **pass, int *limit, bool *pub, int *trigger, const char **ev, int *zeny, int *min_level, int *max_level);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chat_create_pre[hIndex].func;
- retVal___ = preHookFunc(bl, title, pass, &limit, &pub, &trigger, ev, &zeny, &minLvl, &maxLvl);
+ retVal___ = preHookFunc(&bl, &title, &pass, &limit, &pub, &trigger, &ev, &zeny, &min_level, &max_level);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.chat.create(bl, title, pass, limit, pub, trigger, ev, zeny, minLvl, maxLvl);
+ retVal___ = HPMHooks.source.chat.create(bl, title, pass, limit, pub, trigger, ev, zeny, min_level, max_level);
}
- if( HPMHooks.count.HP_chat_create_post ) {
- struct chat_data* (*postHookFunc) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int *limit, bool *pub, int *trigger, const char *ev, int *zeny, int *minLvl, int *maxLvl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chat_create_post > 0) {
+ struct chat_data* (*postHookFunc) (struct chat_data* retVal___, struct block_list *bl, const char *title, const char *pass, int limit, bool pub, int trigger, const char *ev, int zeny, int min_level, int max_level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chat_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chat_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, title, pass, &limit, &pub, &trigger, ev, &zeny, &minLvl, &maxLvl);
+ retVal___ = postHookFunc(retVal___, bl, title, pass, limit, pub, trigger, ev, zeny, min_level, max_level);
}
}
return retVal___;
}
-/* chrif */
+/* chrif_interface */
void HP_chrif_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_init_pre ) {
+ if (HPMHooks.count.HP_chrif_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4555,25 +4634,25 @@ void HP_chrif_init(bool minimal) {
{
HPMHooks.source.chrif.init(minimal);
}
- if( HPMHooks.count.HP_chrif_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_chrif_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_final_pre ) {
+ if (HPMHooks.count.HP_chrif_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4581,9 +4660,9 @@ void HP_chrif_final(void) {
{
HPMHooks.source.chrif.final();
}
- if( HPMHooks.count.HP_chrif_final_post ) {
+ if (HPMHooks.count.HP_chrif_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_final_post[hIndex].func;
postHookFunc();
}
@@ -4592,14 +4671,14 @@ void HP_chrif_final(void) {
}
void HP_chrif_setuserid(char *id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_setuserid_pre ) {
- void (*preHookFunc) (char *id);
+ if (HPMHooks.count.HP_chrif_setuserid_pre > 0) {
+ void (*preHookFunc) (char **id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setuserid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setuserid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_setuserid_pre[hIndex].func;
- preHookFunc(id);
+ preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4607,9 +4686,9 @@ void HP_chrif_setuserid(char *id) {
{
HPMHooks.source.chrif.setuserid(id);
}
- if( HPMHooks.count.HP_chrif_setuserid_post ) {
+ if (HPMHooks.count.HP_chrif_setuserid_post > 0) {
void (*postHookFunc) (char *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setuserid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setuserid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_setuserid_post[hIndex].func;
postHookFunc(id);
}
@@ -4618,14 +4697,14 @@ void HP_chrif_setuserid(char *id) {
}
void HP_chrif_setpasswd(char *pwd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_setpasswd_pre ) {
- void (*preHookFunc) (char *pwd);
+ if (HPMHooks.count.HP_chrif_setpasswd_pre > 0) {
+ void (*preHookFunc) (char **pwd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setpasswd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setpasswd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_setpasswd_pre[hIndex].func;
- preHookFunc(pwd);
+ preHookFunc(&pwd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4633,9 +4712,9 @@ void HP_chrif_setpasswd(char *pwd) {
{
HPMHooks.source.chrif.setpasswd(pwd);
}
- if( HPMHooks.count.HP_chrif_setpasswd_post ) {
+ if (HPMHooks.count.HP_chrif_setpasswd_post > 0) {
void (*postHookFunc) (char *pwd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setpasswd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setpasswd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_setpasswd_post[hIndex].func;
postHookFunc(pwd);
}
@@ -4644,14 +4723,14 @@ void HP_chrif_setpasswd(char *pwd) {
}
void HP_chrif_checkdefaultlogin(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_checkdefaultlogin_pre ) {
+ if (HPMHooks.count.HP_chrif_checkdefaultlogin_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_checkdefaultlogin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_checkdefaultlogin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_checkdefaultlogin_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4659,9 +4738,9 @@ void HP_chrif_checkdefaultlogin(void) {
{
HPMHooks.source.chrif.checkdefaultlogin();
}
- if( HPMHooks.count.HP_chrif_checkdefaultlogin_post ) {
+ if (HPMHooks.count.HP_chrif_checkdefaultlogin_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_checkdefaultlogin_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_checkdefaultlogin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_checkdefaultlogin_post[hIndex].func;
postHookFunc();
}
@@ -4671,14 +4750,14 @@ void HP_chrif_checkdefaultlogin(void) {
bool HP_chrif_setip(const char *ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_setip_pre ) {
- bool (*preHookFunc) (const char *ip);
+ if (HPMHooks.count.HP_chrif_setip_pre > 0) {
+ bool (*preHookFunc) (const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_setip_pre[hIndex].func;
- retVal___ = preHookFunc(ip);
+ retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4686,9 +4765,9 @@ bool HP_chrif_setip(const char *ip) {
{
retVal___ = HPMHooks.source.chrif.setip(ip);
}
- if( HPMHooks.count.HP_chrif_setip_post ) {
+ if (HPMHooks.count.HP_chrif_setip_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_setip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ip);
}
@@ -4697,14 +4776,14 @@ bool HP_chrif_setip(const char *ip) {
}
void HP_chrif_setport(uint16 port) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_setport_pre ) {
+ if (HPMHooks.count.HP_chrif_setport_pre > 0) {
void (*preHookFunc) (uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_setport_pre[hIndex].func;
preHookFunc(&port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4712,11 +4791,11 @@ void HP_chrif_setport(uint16 port) {
{
HPMHooks.source.chrif.setport(port);
}
- if( HPMHooks.count.HP_chrif_setport_post ) {
- void (*postHookFunc) (uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setport_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_setport_post > 0) {
+ void (*postHookFunc) (uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_setport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_setport_post[hIndex].func;
- postHookFunc(&port);
+ postHookFunc(port);
}
}
return;
@@ -4724,14 +4803,14 @@ void HP_chrif_setport(uint16 port) {
int HP_chrif_isconnected(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_isconnected_pre ) {
+ if (HPMHooks.count.HP_chrif_isconnected_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_isconnected_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_isconnected_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_isconnected_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4739,9 +4818,9 @@ int HP_chrif_isconnected(void) {
{
retVal___ = HPMHooks.source.chrif.isconnected();
}
- if( HPMHooks.count.HP_chrif_isconnected_post ) {
+ if (HPMHooks.count.HP_chrif_isconnected_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_isconnected_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_isconnected_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_isconnected_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -4750,14 +4829,14 @@ int HP_chrif_isconnected(void) {
}
void HP_chrif_check_shutdown(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_check_shutdown_pre ) {
+ if (HPMHooks.count.HP_chrif_check_shutdown_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_shutdown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_shutdown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_check_shutdown_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4765,9 +4844,9 @@ void HP_chrif_check_shutdown(void) {
{
HPMHooks.source.chrif.check_shutdown();
}
- if( HPMHooks.count.HP_chrif_check_shutdown_post ) {
+ if (HPMHooks.count.HP_chrif_check_shutdown_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_shutdown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_shutdown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_check_shutdown_post[hIndex].func;
postHookFunc();
}
@@ -4777,14 +4856,14 @@ void HP_chrif_check_shutdown(void) {
struct auth_node* HP_chrif_search(int account_id) {
int hIndex = 0;
struct auth_node* retVal___ = NULL;
- if( HPMHooks.count.HP_chrif_search_pre ) {
+ if (HPMHooks.count.HP_chrif_search_pre > 0) {
struct auth_node* (*preHookFunc) (int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_search_pre[hIndex].func;
retVal___ = preHookFunc(&account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4792,11 +4871,11 @@ struct auth_node* HP_chrif_search(int account_id) {
{
retVal___ = HPMHooks.source.chrif.search(account_id);
}
- if( HPMHooks.count.HP_chrif_search_post ) {
- struct auth_node* (*postHookFunc) (struct auth_node* retVal___, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_search_post > 0) {
+ struct auth_node* (*postHookFunc) (struct auth_node* retVal___, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id);
+ retVal___ = postHookFunc(retVal___, account_id);
}
}
return retVal___;
@@ -4804,14 +4883,14 @@ struct auth_node* HP_chrif_search(int account_id) {
struct auth_node* HP_chrif_auth_check(int account_id, int char_id, enum sd_state state) {
int hIndex = 0;
struct auth_node* retVal___ = NULL;
- if( HPMHooks.count.HP_chrif_auth_check_pre ) {
+ if (HPMHooks.count.HP_chrif_auth_check_pre > 0) {
struct auth_node* (*preHookFunc) (int *account_id, int *char_id, enum sd_state *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_auth_check_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4819,11 +4898,11 @@ struct auth_node* HP_chrif_auth_check(int account_id, int char_id, enum sd_state
{
retVal___ = HPMHooks.source.chrif.auth_check(account_id, char_id, state);
}
- if( HPMHooks.count.HP_chrif_auth_check_post ) {
- struct auth_node* (*postHookFunc) (struct auth_node* retVal___, int *account_id, int *char_id, enum sd_state *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_auth_check_post > 0) {
+ struct auth_node* (*postHookFunc) (struct auth_node* retVal___, int account_id, int char_id, enum sd_state state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_auth_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id, &state);
+ retVal___ = postHookFunc(retVal___, account_id, char_id, state);
}
}
return retVal___;
@@ -4831,14 +4910,14 @@ struct auth_node* HP_chrif_auth_check(int account_id, int char_id, enum sd_state
bool HP_chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_auth_delete_pre ) {
+ if (HPMHooks.count.HP_chrif_auth_delete_pre > 0) {
bool (*preHookFunc) (int *account_id, int *char_id, enum sd_state *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_auth_delete_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4846,11 +4925,11 @@ bool HP_chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
{
retVal___ = HPMHooks.source.chrif.auth_delete(account_id, char_id, state);
}
- if( HPMHooks.count.HP_chrif_auth_delete_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, int *char_id, enum sd_state *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_auth_delete_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, int char_id, enum sd_state state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_auth_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id, &state);
+ retVal___ = postHookFunc(retVal___, account_id, char_id, state);
}
}
return retVal___;
@@ -4858,14 +4937,14 @@ bool HP_chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
bool HP_chrif_auth_finished(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_auth_finished_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_chrif_auth_finished_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_finished_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_finished_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_auth_finished_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4873,9 +4952,9 @@ bool HP_chrif_auth_finished(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.chrif.auth_finished(sd);
}
- if( HPMHooks.count.HP_chrif_auth_finished_post ) {
+ if (HPMHooks.count.HP_chrif_auth_finished_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_finished_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_finished_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_auth_finished_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -4884,14 +4963,14 @@ bool HP_chrif_auth_finished(struct map_session_data *sd) {
}
void HP_chrif_authreq(struct map_session_data *sd, bool hstandalone) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_authreq_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *hstandalone);
+ if (HPMHooks.count.HP_chrif_authreq_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *hstandalone);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authreq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authreq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_authreq_pre[hIndex].func;
- preHookFunc(sd, &hstandalone);
+ preHookFunc(&sd, &hstandalone);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4899,25 +4978,25 @@ void HP_chrif_authreq(struct map_session_data *sd, bool hstandalone) {
{
HPMHooks.source.chrif.authreq(sd, hstandalone);
}
- if( HPMHooks.count.HP_chrif_authreq_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *hstandalone);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authreq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_authreq_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool hstandalone);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authreq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_authreq_post[hIndex].func;
- postHookFunc(sd, &hstandalone);
+ postHookFunc(sd, hstandalone);
}
}
return;
}
void HP_chrif_authok(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_authok_pre ) {
+ if (HPMHooks.count.HP_chrif_authok_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_authok_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -4925,11 +5004,11 @@ void HP_chrif_authok(int fd) {
{
HPMHooks.source.chrif.authok(fd);
}
- if( HPMHooks.count.HP_chrif_authok_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_authok_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_authok_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -4937,14 +5016,14 @@ void HP_chrif_authok(int fd) {
bool HP_chrif_scdata_request(int account_id, int char_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_scdata_request_pre ) {
+ if (HPMHooks.count.HP_chrif_scdata_request_pre > 0) {
bool (*preHookFunc) (int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_scdata_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_scdata_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_scdata_request_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4952,11 +5031,11 @@ bool HP_chrif_scdata_request(int account_id, int char_id) {
{
retVal___ = HPMHooks.source.chrif.scdata_request(account_id, char_id);
}
- if( HPMHooks.count.HP_chrif_scdata_request_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_scdata_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_scdata_request_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_scdata_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_scdata_request_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, account_id, char_id);
}
}
return retVal___;
@@ -4964,14 +5043,14 @@ bool HP_chrif_scdata_request(int account_id, int char_id) {
bool HP_chrif_save(struct map_session_data *sd, int flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_save_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_chrif_save_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_save_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -4979,11 +5058,11 @@ bool HP_chrif_save(struct map_session_data *sd, int flag) {
{
retVal___ = HPMHooks.source.chrif.save(sd, flag);
}
- if( HPMHooks.count.HP_chrif_save_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_save_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_save_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -4991,14 +5070,14 @@ bool HP_chrif_save(struct map_session_data *sd, int flag) {
bool HP_chrif_charselectreq(struct map_session_data *sd, uint32 s_ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_charselectreq_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, uint32 *s_ip);
+ if (HPMHooks.count.HP_chrif_charselectreq_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, uint32 *s_ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_charselectreq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_charselectreq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_charselectreq_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &s_ip);
+ retVal___ = preHookFunc(&sd, &s_ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5006,11 +5085,11 @@ bool HP_chrif_charselectreq(struct map_session_data *sd, uint32 s_ip) {
{
retVal___ = HPMHooks.source.chrif.charselectreq(sd, s_ip);
}
- if( HPMHooks.count.HP_chrif_charselectreq_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, uint32 *s_ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_charselectreq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_charselectreq_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, uint32 s_ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_charselectreq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_charselectreq_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &s_ip);
+ retVal___ = postHookFunc(retVal___, sd, s_ip);
}
}
return retVal___;
@@ -5018,14 +5097,14 @@ bool HP_chrif_charselectreq(struct map_session_data *sd, uint32 s_ip) {
bool HP_chrif_changemapserver(struct map_session_data *sd, uint32 ip, uint16 port) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_changemapserver_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, uint32 *ip, uint16 *port);
+ if (HPMHooks.count.HP_chrif_changemapserver_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserver_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserver_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_changemapserver_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &ip, &port);
+ retVal___ = preHookFunc(&sd, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5033,11 +5112,11 @@ bool HP_chrif_changemapserver(struct map_session_data *sd, uint32 ip, uint16 por
{
retVal___ = HPMHooks.source.chrif.changemapserver(sd, ip, port);
}
- if( HPMHooks.count.HP_chrif_changemapserver_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserver_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_changemapserver_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserver_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_changemapserver_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &ip, &port);
+ retVal___ = postHookFunc(retVal___, sd, ip, port);
}
}
return retVal___;
@@ -5045,14 +5124,14 @@ bool HP_chrif_changemapserver(struct map_session_data *sd, uint32 ip, uint16 por
bool HP_chrif_searchcharid(int char_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_searchcharid_pre ) {
+ if (HPMHooks.count.HP_chrif_searchcharid_pre > 0) {
bool (*preHookFunc) (int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_searchcharid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_searchcharid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_searchcharid_pre[hIndex].func;
retVal___ = preHookFunc(&char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5060,11 +5139,11 @@ bool HP_chrif_searchcharid(int char_id) {
{
retVal___ = HPMHooks.source.chrif.searchcharid(char_id);
}
- if( HPMHooks.count.HP_chrif_searchcharid_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_searchcharid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_searchcharid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_searchcharid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_searchcharid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id);
+ retVal___ = postHookFunc(retVal___, char_id);
}
}
return retVal___;
@@ -5072,14 +5151,14 @@ bool HP_chrif_searchcharid(int char_id) {
bool HP_chrif_changeemail(int id, const char *actual_email, const char *new_email) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_changeemail_pre ) {
- bool (*preHookFunc) (int *id, const char *actual_email, const char *new_email);
+ if (HPMHooks.count.HP_chrif_changeemail_pre > 0) {
+ bool (*preHookFunc) (int *id, const char **actual_email, const char **new_email);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changeemail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changeemail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_changeemail_pre[hIndex].func;
- retVal___ = preHookFunc(&id, actual_email, new_email);
+ retVal___ = preHookFunc(&id, &actual_email, &new_email);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5087,11 +5166,11 @@ bool HP_chrif_changeemail(int id, const char *actual_email, const char *new_emai
{
retVal___ = HPMHooks.source.chrif.changeemail(id, actual_email, new_email);
}
- if( HPMHooks.count.HP_chrif_changeemail_post ) {
- bool (*postHookFunc) (bool retVal___, int *id, const char *actual_email, const char *new_email);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changeemail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_changeemail_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int id, const char *actual_email, const char *new_email);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changeemail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_changeemail_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id, actual_email, new_email);
+ retVal___ = postHookFunc(retVal___, id, actual_email, new_email);
}
}
return retVal___;
@@ -5099,14 +5178,14 @@ bool HP_chrif_changeemail(int id, const char *actual_email, const char *new_emai
bool HP_chrif_char_ask_name(int acc, const char *character_name, unsigned short operation_type, int year, int month, int day, int hour, int minute, int second) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_char_ask_name_pre ) {
- bool (*preHookFunc) (int *acc, const char *character_name, unsigned short *operation_type, int *year, int *month, int *day, int *hour, int *minute, int *second);
+ if (HPMHooks.count.HP_chrif_char_ask_name_pre > 0) {
+ bool (*preHookFunc) (int *acc, const char **character_name, unsigned short *operation_type, int *year, int *month, int *day, int *hour, int *minute, int *second);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_char_ask_name_pre[hIndex].func;
- retVal___ = preHookFunc(&acc, character_name, &operation_type, &year, &month, &day, &hour, &minute, &second);
+ retVal___ = preHookFunc(&acc, &character_name, &operation_type, &year, &month, &day, &hour, &minute, &second);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5114,11 +5193,11 @@ bool HP_chrif_char_ask_name(int acc, const char *character_name, unsigned short
{
retVal___ = HPMHooks.source.chrif.char_ask_name(acc, character_name, operation_type, year, month, day, hour, minute, second);
}
- if( HPMHooks.count.HP_chrif_char_ask_name_post ) {
- bool (*postHookFunc) (bool retVal___, int *acc, const char *character_name, unsigned short *operation_type, int *year, int *month, int *day, int *hour, int *minute, int *second);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_char_ask_name_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int acc, const char *character_name, unsigned short operation_type, int year, int month, int day, int hour, int minute, int second);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_char_ask_name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &acc, character_name, &operation_type, &year, &month, &day, &hour, &minute, &second);
+ retVal___ = postHookFunc(retVal___, acc, character_name, operation_type, year, month, day, hour, minute, second);
}
}
return retVal___;
@@ -5126,14 +5205,14 @@ bool HP_chrif_char_ask_name(int acc, const char *character_name, unsigned short
int HP_chrif_updatefamelist(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_updatefamelist_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_chrif_updatefamelist_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_updatefamelist_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5141,9 +5220,9 @@ int HP_chrif_updatefamelist(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.chrif.updatefamelist(sd);
}
- if( HPMHooks.count.HP_chrif_updatefamelist_post ) {
+ if (HPMHooks.count.HP_chrif_updatefamelist_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_updatefamelist_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -5153,14 +5232,14 @@ int HP_chrif_updatefamelist(struct map_session_data *sd) {
bool HP_chrif_buildfamelist(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_buildfamelist_pre ) {
+ if (HPMHooks.count.HP_chrif_buildfamelist_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_buildfamelist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_buildfamelist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_buildfamelist_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5168,9 +5247,9 @@ bool HP_chrif_buildfamelist(void) {
{
retVal___ = HPMHooks.source.chrif.buildfamelist();
}
- if( HPMHooks.count.HP_chrif_buildfamelist_post ) {
+ if (HPMHooks.count.HP_chrif_buildfamelist_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_buildfamelist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_buildfamelist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_buildfamelist_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -5180,14 +5259,14 @@ bool HP_chrif_buildfamelist(void) {
bool HP_chrif_save_scdata(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_save_scdata_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_chrif_save_scdata_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_save_scdata_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5195,9 +5274,9 @@ bool HP_chrif_save_scdata(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.chrif.save_scdata(sd);
}
- if( HPMHooks.count.HP_chrif_save_scdata_post ) {
+ if (HPMHooks.count.HP_chrif_save_scdata_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_save_scdata_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -5207,14 +5286,14 @@ bool HP_chrif_save_scdata(struct map_session_data *sd) {
bool HP_chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_ragsrvinfo_pre ) {
+ if (HPMHooks.count.HP_chrif_ragsrvinfo_pre > 0) {
bool (*preHookFunc) (int *base_rate, int *job_rate, int *drop_rate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_ragsrvinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_ragsrvinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_ragsrvinfo_pre[hIndex].func;
retVal___ = preHookFunc(&base_rate, &job_rate, &drop_rate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5222,11 +5301,11 @@ bool HP_chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) {
{
retVal___ = HPMHooks.source.chrif.ragsrvinfo(base_rate, job_rate, drop_rate);
}
- if( HPMHooks.count.HP_chrif_ragsrvinfo_post ) {
- bool (*postHookFunc) (bool retVal___, int *base_rate, int *job_rate, int *drop_rate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_ragsrvinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_ragsrvinfo_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int base_rate, int job_rate, int drop_rate);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_ragsrvinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_ragsrvinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &base_rate, &job_rate, &drop_rate);
+ retVal___ = postHookFunc(retVal___, base_rate, job_rate, drop_rate);
}
}
return retVal___;
@@ -5234,14 +5313,14 @@ bool HP_chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) {
bool HP_chrif_char_offline_nsd(int account_id, int char_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_char_offline_nsd_pre ) {
+ if (HPMHooks.count.HP_chrif_char_offline_nsd_pre > 0) {
bool (*preHookFunc) (int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_offline_nsd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_offline_nsd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_char_offline_nsd_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5249,11 +5328,11 @@ bool HP_chrif_char_offline_nsd(int account_id, int char_id) {
{
retVal___ = HPMHooks.source.chrif.char_offline_nsd(account_id, char_id);
}
- if( HPMHooks.count.HP_chrif_char_offline_nsd_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_offline_nsd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_char_offline_nsd_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_offline_nsd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_char_offline_nsd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, account_id, char_id);
}
}
return retVal___;
@@ -5261,14 +5340,14 @@ bool HP_chrif_char_offline_nsd(int account_id, int char_id) {
bool HP_chrif_char_reset_offline(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_char_reset_offline_pre ) {
+ if (HPMHooks.count.HP_chrif_char_reset_offline_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_reset_offline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_reset_offline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_char_reset_offline_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5276,9 +5355,9 @@ bool HP_chrif_char_reset_offline(void) {
{
retVal___ = HPMHooks.source.chrif.char_reset_offline();
}
- if( HPMHooks.count.HP_chrif_char_reset_offline_post ) {
+ if (HPMHooks.count.HP_chrif_char_reset_offline_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_reset_offline_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_reset_offline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_char_reset_offline_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -5288,14 +5367,14 @@ bool HP_chrif_char_reset_offline(void) {
bool HP_chrif_send_users_tochar(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_send_users_tochar_pre ) {
+ if (HPMHooks.count.HP_chrif_send_users_tochar_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_users_tochar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_users_tochar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_send_users_tochar_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5303,9 +5382,9 @@ bool HP_chrif_send_users_tochar(void) {
{
retVal___ = HPMHooks.source.chrif.send_users_tochar();
}
- if( HPMHooks.count.HP_chrif_send_users_tochar_post ) {
+ if (HPMHooks.count.HP_chrif_send_users_tochar_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_users_tochar_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_users_tochar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_send_users_tochar_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -5315,14 +5394,14 @@ bool HP_chrif_send_users_tochar(void) {
bool HP_chrif_char_online(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_char_online_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_chrif_char_online_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_online_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_online_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_char_online_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5330,9 +5409,9 @@ bool HP_chrif_char_online(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.chrif.char_online(sd);
}
- if( HPMHooks.count.HP_chrif_char_online_post ) {
+ if (HPMHooks.count.HP_chrif_char_online_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_online_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_online_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_char_online_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -5342,14 +5421,14 @@ bool HP_chrif_char_online(struct map_session_data *sd) {
bool HP_chrif_changesex(struct map_session_data *sd, bool change_account) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_changesex_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, bool *change_account);
+ if (HPMHooks.count.HP_chrif_changesex_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, bool *change_account);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changesex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changesex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_changesex_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &change_account);
+ retVal___ = preHookFunc(&sd, &change_account);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5357,11 +5436,11 @@ bool HP_chrif_changesex(struct map_session_data *sd, bool change_account) {
{
retVal___ = HPMHooks.source.chrif.changesex(sd, change_account);
}
- if( HPMHooks.count.HP_chrif_changesex_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, bool *change_account);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changesex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_changesex_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, bool change_account);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changesex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_changesex_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &change_account);
+ retVal___ = postHookFunc(retVal___, sd, change_account);
}
}
return retVal___;
@@ -5369,14 +5448,14 @@ bool HP_chrif_changesex(struct map_session_data *sd, bool change_account) {
bool HP_chrif_divorce(int partner_id1, int partner_id2) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_divorce_pre ) {
+ if (HPMHooks.count.HP_chrif_divorce_pre > 0) {
bool (*preHookFunc) (int *partner_id1, int *partner_id2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorce_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorce_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_divorce_pre[hIndex].func;
retVal___ = preHookFunc(&partner_id1, &partner_id2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5384,11 +5463,11 @@ bool HP_chrif_divorce(int partner_id1, int partner_id2) {
{
retVal___ = HPMHooks.source.chrif.divorce(partner_id1, partner_id2);
}
- if( HPMHooks.count.HP_chrif_divorce_post ) {
- bool (*postHookFunc) (bool retVal___, int *partner_id1, int *partner_id2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorce_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_divorce_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int partner_id1, int partner_id2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorce_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_divorce_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &partner_id1, &partner_id2);
+ retVal___ = postHookFunc(retVal___, partner_id1, partner_id2);
}
}
return retVal___;
@@ -5396,14 +5475,14 @@ bool HP_chrif_divorce(int partner_id1, int partner_id2) {
bool HP_chrif_removefriend(int char_id, int friend_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_removefriend_pre ) {
+ if (HPMHooks.count.HP_chrif_removefriend_pre > 0) {
bool (*preHookFunc) (int *char_id, int *friend_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removefriend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removefriend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_removefriend_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &friend_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5411,25 +5490,25 @@ bool HP_chrif_removefriend(int char_id, int friend_id) {
{
retVal___ = HPMHooks.source.chrif.removefriend(char_id, friend_id);
}
- if( HPMHooks.count.HP_chrif_removefriend_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, int *friend_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removefriend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_removefriend_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, int friend_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removefriend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_removefriend_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &friend_id);
+ retVal___ = postHookFunc(retVal___, char_id, friend_id);
}
}
return retVal___;
}
void HP_chrif_send_report(char *buf, int len) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_send_report_pre ) {
- void (*preHookFunc) (char *buf, int *len);
+ if (HPMHooks.count.HP_chrif_send_report_pre > 0) {
+ void (*preHookFunc) (char **buf, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_report_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_report_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_send_report_pre[hIndex].func;
- preHookFunc(buf, &len);
+ preHookFunc(&buf, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5437,11 +5516,11 @@ void HP_chrif_send_report(char *buf, int len) {
{
HPMHooks.source.chrif.send_report(buf, len);
}
- if( HPMHooks.count.HP_chrif_send_report_post ) {
- void (*postHookFunc) (char *buf, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_report_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_send_report_post > 0) {
+ void (*postHookFunc) (char *buf, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_report_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_send_report_post[hIndex].func;
- postHookFunc(buf, &len);
+ postHookFunc(buf, len);
}
}
return;
@@ -5449,14 +5528,14 @@ void HP_chrif_send_report(char *buf, int len) {
bool HP_chrif_flush(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_flush_pre ) {
+ if (HPMHooks.count.HP_chrif_flush_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_flush_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_flush_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_flush_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5464,9 +5543,9 @@ bool HP_chrif_flush(void) {
{
retVal___ = HPMHooks.source.chrif.flush();
}
- if( HPMHooks.count.HP_chrif_flush_post ) {
+ if (HPMHooks.count.HP_chrif_flush_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_flush_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_flush_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_flush_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -5475,14 +5554,14 @@ bool HP_chrif_flush(void) {
}
void HP_chrif_skillid2idx(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_skillid2idx_pre ) {
+ if (HPMHooks.count.HP_chrif_skillid2idx_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_skillid2idx_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_skillid2idx_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_skillid2idx_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5490,11 +5569,11 @@ void HP_chrif_skillid2idx(int fd) {
{
HPMHooks.source.chrif.skillid2idx(fd);
}
- if( HPMHooks.count.HP_chrif_skillid2idx_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_skillid2idx_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_skillid2idx_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_skillid2idx_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_skillid2idx_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -5502,14 +5581,14 @@ void HP_chrif_skillid2idx(int fd) {
bool HP_chrif_sd_to_auth(struct map_session_data *sd, enum sd_state state) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_sd_to_auth_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, enum sd_state *state);
+ if (HPMHooks.count.HP_chrif_sd_to_auth_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, enum sd_state *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sd_to_auth_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sd_to_auth_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_sd_to_auth_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &state);
+ retVal___ = preHookFunc(&sd, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5517,11 +5596,11 @@ bool HP_chrif_sd_to_auth(struct map_session_data *sd, enum sd_state state) {
{
retVal___ = HPMHooks.source.chrif.sd_to_auth(sd, state);
}
- if( HPMHooks.count.HP_chrif_sd_to_auth_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum sd_state *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sd_to_auth_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_sd_to_auth_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum sd_state state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sd_to_auth_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_sd_to_auth_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &state);
+ retVal___ = postHookFunc(retVal___, sd, state);
}
}
return retVal___;
@@ -5529,14 +5608,14 @@ bool HP_chrif_sd_to_auth(struct map_session_data *sd, enum sd_state state) {
int HP_chrif_check_connect_char_server(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_check_connect_char_server_pre ) {
+ if (HPMHooks.count.HP_chrif_check_connect_char_server_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_connect_char_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_connect_char_server_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_check_connect_char_server_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5544,11 +5623,11 @@ int HP_chrif_check_connect_char_server(int tid, int64 tick, int id, intptr_t dat
{
retVal___ = HPMHooks.source.chrif.check_connect_char_server(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chrif_check_connect_char_server_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_connect_char_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_check_connect_char_server_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_check_connect_char_server_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_check_connect_char_server_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -5556,14 +5635,14 @@ int HP_chrif_check_connect_char_server(int tid, int64 tick, int id, intptr_t dat
bool HP_chrif_auth_logout(struct map_session_data *sd, enum sd_state state) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_auth_logout_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, enum sd_state *state);
+ if (HPMHooks.count.HP_chrif_auth_logout_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, enum sd_state *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_logout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_logout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_auth_logout_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &state);
+ retVal___ = preHookFunc(&sd, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5571,25 +5650,25 @@ bool HP_chrif_auth_logout(struct map_session_data *sd, enum sd_state state) {
{
retVal___ = HPMHooks.source.chrif.auth_logout(sd, state);
}
- if( HPMHooks.count.HP_chrif_auth_logout_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum sd_state *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_logout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_auth_logout_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, enum sd_state state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_logout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_auth_logout_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &state);
+ retVal___ = postHookFunc(retVal___, sd, state);
}
}
return retVal___;
}
void HP_chrif_save_ack(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_save_ack_pre ) {
+ if (HPMHooks.count.HP_chrif_save_ack_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_save_ack_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5597,28 +5676,28 @@ void HP_chrif_save_ack(int fd) {
{
HPMHooks.source.chrif.save_ack(fd);
}
- if( HPMHooks.count.HP_chrif_save_ack_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_save_ack_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_save_ack_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
-int HP_chrif_reconnect(DBKey key, DBData *data, va_list ap) {
+int HP_chrif_reconnect(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_reconnect_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chrif_reconnect_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_reconnect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_reconnect_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chrif_reconnect_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5628,30 +5707,30 @@ int HP_chrif_reconnect(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chrif.reconnect(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chrif_reconnect_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_reconnect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_reconnect_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_reconnect_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chrif_reconnect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_chrif_auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
+int HP_chrif_auth_db_cleanup_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_auth_db_cleanup_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chrif_auth_db_cleanup_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chrif_auth_db_cleanup_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5661,12 +5740,12 @@ int HP_chrif_auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chrif.auth_db_cleanup_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chrif_auth_db_cleanup_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_auth_db_cleanup_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chrif_auth_db_cleanup_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -5675,14 +5754,14 @@ int HP_chrif_auth_db_cleanup_sub(DBKey key, DBData *data, va_list ap) {
bool HP_chrif_char_ask_name_answer(int acc, const char *player_name, uint16 type, uint16 answer) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_char_ask_name_answer_pre ) {
- bool (*preHookFunc) (int *acc, const char *player_name, uint16 *type, uint16 *answer);
+ if (HPMHooks.count.HP_chrif_char_ask_name_answer_pre > 0) {
+ bool (*preHookFunc) (int *acc, const char **player_name, uint16 *type, uint16 *answer);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_answer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_answer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_char_ask_name_answer_pre[hIndex].func;
- retVal___ = preHookFunc(&acc, player_name, &type, &answer);
+ retVal___ = preHookFunc(&acc, &player_name, &type, &answer);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5690,28 +5769,28 @@ bool HP_chrif_char_ask_name_answer(int acc, const char *player_name, uint16 type
{
retVal___ = HPMHooks.source.chrif.char_ask_name_answer(acc, player_name, type, answer);
}
- if( HPMHooks.count.HP_chrif_char_ask_name_answer_post ) {
- bool (*postHookFunc) (bool retVal___, int *acc, const char *player_name, uint16 *type, uint16 *answer);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_answer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_char_ask_name_answer_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int acc, const char *player_name, uint16 type, uint16 answer);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_char_ask_name_answer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_char_ask_name_answer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &acc, player_name, &type, &answer);
+ retVal___ = postHookFunc(retVal___, acc, player_name, type, answer);
}
}
return retVal___;
}
-int HP_chrif_auth_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_chrif_auth_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_auth_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_chrif_auth_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_chrif_auth_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5721,12 +5800,12 @@ int HP_chrif_auth_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.chrif.auth_db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_chrif_auth_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_auth_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_chrif_auth_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -5735,14 +5814,14 @@ int HP_chrif_auth_db_final(DBKey key, DBData *data, va_list ap) {
int HP_chrif_send_usercount_tochar(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_send_usercount_tochar_pre ) {
+ if (HPMHooks.count.HP_chrif_send_usercount_tochar_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_usercount_tochar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_usercount_tochar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_send_usercount_tochar_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5750,11 +5829,11 @@ int HP_chrif_send_usercount_tochar(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.chrif.send_usercount_tochar(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chrif_send_usercount_tochar_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_usercount_tochar_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_send_usercount_tochar_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_send_usercount_tochar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_send_usercount_tochar_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -5762,14 +5841,14 @@ int HP_chrif_send_usercount_tochar(int tid, int64 tick, int id, intptr_t data) {
int HP_chrif_auth_db_cleanup(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_auth_db_cleanup_pre ) {
+ if (HPMHooks.count.HP_chrif_auth_db_cleanup_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_auth_db_cleanup_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5777,25 +5856,25 @@ int HP_chrif_auth_db_cleanup(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.chrif.auth_db_cleanup(tid, tick, id, data);
}
- if( HPMHooks.count.HP_chrif_auth_db_cleanup_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_auth_db_cleanup_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_auth_db_cleanup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_auth_db_cleanup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_chrif_connect(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_connect_pre ) {
+ if (HPMHooks.count.HP_chrif_connect_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_connect_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5803,25 +5882,25 @@ void HP_chrif_connect(int fd) {
{
HPMHooks.source.chrif.connect(fd);
}
- if( HPMHooks.count.HP_chrif_connect_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_connect_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_connect_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_connectack(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_connectack_pre ) {
+ if (HPMHooks.count.HP_chrif_connectack_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connectack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connectack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_connectack_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5829,25 +5908,25 @@ void HP_chrif_connectack(int fd) {
{
HPMHooks.source.chrif.connectack(fd);
}
- if( HPMHooks.count.HP_chrif_connectack_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connectack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_connectack_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_connectack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_connectack_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_sendmap(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_sendmap_pre ) {
+ if (HPMHooks.count.HP_chrif_sendmap_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_sendmap_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5855,25 +5934,25 @@ void HP_chrif_sendmap(int fd) {
{
HPMHooks.source.chrif.sendmap(fd);
}
- if( HPMHooks.count.HP_chrif_sendmap_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_sendmap_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_sendmap_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_sendmapack(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_sendmapack_pre ) {
+ if (HPMHooks.count.HP_chrif_sendmapack_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmapack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmapack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_sendmapack_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5881,25 +5960,25 @@ void HP_chrif_sendmapack(int fd) {
{
HPMHooks.source.chrif.sendmapack(fd);
}
- if( HPMHooks.count.HP_chrif_sendmapack_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmapack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_sendmapack_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_sendmapack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_sendmapack_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_recvmap(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_recvmap_pre ) {
+ if (HPMHooks.count.HP_chrif_recvmap_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvmap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_recvmap_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5907,11 +5986,11 @@ void HP_chrif_recvmap(int fd) {
{
HPMHooks.source.chrif.recvmap(fd);
}
- if( HPMHooks.count.HP_chrif_recvmap_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvmap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_recvmap_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvmap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_recvmap_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -5919,14 +5998,14 @@ void HP_chrif_recvmap(int fd) {
bool HP_chrif_changemapserverack(int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_changemapserverack_pre ) {
+ if (HPMHooks.count.HP_chrif_changemapserverack_pre > 0) {
bool (*preHookFunc) (int *account_id, int *login_id1, int *login_id2, int *char_id, short *map_index, short *x, short *y, uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserverack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserverack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_changemapserverack_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &login_id1, &login_id2, &char_id, &map_index, &x, &y, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5934,25 +6013,25 @@ bool HP_chrif_changemapserverack(int account_id, int login_id1, int login_id2, i
{
retVal___ = HPMHooks.source.chrif.changemapserverack(account_id, login_id1, login_id2, char_id, map_index, x, y, ip, port);
}
- if( HPMHooks.count.HP_chrif_changemapserverack_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, int *login_id1, int *login_id2, int *char_id, short *map_index, short *x, short *y, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserverack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_changemapserverack_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changemapserverack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_changemapserverack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &login_id1, &login_id2, &char_id, &map_index, &x, &y, &ip, &port);
+ retVal___ = postHookFunc(retVal___, account_id, login_id1, login_id2, char_id, map_index, x, y, ip, port);
}
}
return retVal___;
}
void HP_chrif_changedsex(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_changedsex_pre ) {
+ if (HPMHooks.count.HP_chrif_changedsex_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changedsex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changedsex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_changedsex_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -5960,11 +6039,11 @@ void HP_chrif_changedsex(int fd) {
{
HPMHooks.source.chrif.changedsex(fd);
}
- if( HPMHooks.count.HP_chrif_changedsex_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changedsex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_changedsex_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_changedsex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_changedsex_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -5972,14 +6051,14 @@ void HP_chrif_changedsex(int fd) {
bool HP_chrif_divorceack(int char_id, int partner_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_divorceack_pre ) {
+ if (HPMHooks.count.HP_chrif_divorceack_pre > 0) {
bool (*preHookFunc) (int *char_id, int *partner_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorceack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorceack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_divorceack_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &partner_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -5987,25 +6066,25 @@ bool HP_chrif_divorceack(int char_id, int partner_id) {
{
retVal___ = HPMHooks.source.chrif.divorceack(char_id, partner_id);
}
- if( HPMHooks.count.HP_chrif_divorceack_post ) {
- bool (*postHookFunc) (bool retVal___, int *char_id, int *partner_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorceack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_divorceack_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int char_id, int partner_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_divorceack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_divorceack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &partner_id);
+ retVal___ = postHookFunc(retVal___, char_id, partner_id);
}
}
return retVal___;
}
void HP_chrif_idbanned(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_idbanned_pre ) {
+ if (HPMHooks.count.HP_chrif_idbanned_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_idbanned_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_idbanned_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_idbanned_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6013,25 +6092,25 @@ void HP_chrif_idbanned(int fd) {
{
HPMHooks.source.chrif.idbanned(fd);
}
- if( HPMHooks.count.HP_chrif_idbanned_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_idbanned_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_idbanned_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_idbanned_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_idbanned_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_recvfamelist(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_recvfamelist_pre ) {
+ if (HPMHooks.count.HP_chrif_recvfamelist_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvfamelist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvfamelist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_recvfamelist_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6039,11 +6118,11 @@ void HP_chrif_recvfamelist(int fd) {
{
HPMHooks.source.chrif.recvfamelist(fd);
}
- if( HPMHooks.count.HP_chrif_recvfamelist_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvfamelist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_recvfamelist_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_recvfamelist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_recvfamelist_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -6051,14 +6130,14 @@ void HP_chrif_recvfamelist(int fd) {
bool HP_chrif_load_scdata(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_chrif_load_scdata_pre ) {
+ if (HPMHooks.count.HP_chrif_load_scdata_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_load_scdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_load_scdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_load_scdata_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6066,25 +6145,25 @@ bool HP_chrif_load_scdata(int fd) {
{
retVal___ = HPMHooks.source.chrif.load_scdata(fd);
}
- if( HPMHooks.count.HP_chrif_load_scdata_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_load_scdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_load_scdata_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_load_scdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_load_scdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chrif_update_ip(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_update_ip_pre ) {
+ if (HPMHooks.count.HP_chrif_update_ip_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_update_ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_update_ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_update_ip_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6092,11 +6171,11 @@ void HP_chrif_update_ip(int fd) {
{
HPMHooks.source.chrif.update_ip(fd);
}
- if( HPMHooks.count.HP_chrif_update_ip_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_update_ip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_update_ip_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_update_ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_update_ip_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -6104,14 +6183,14 @@ void HP_chrif_update_ip(int fd) {
int HP_chrif_disconnectplayer(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_disconnectplayer_pre ) {
+ if (HPMHooks.count.HP_chrif_disconnectplayer_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_disconnectplayer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_disconnectplayer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_disconnectplayer_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6119,25 +6198,25 @@ int HP_chrif_disconnectplayer(int fd) {
{
retVal___ = HPMHooks.source.chrif.disconnectplayer(fd);
}
- if( HPMHooks.count.HP_chrif_disconnectplayer_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_disconnectplayer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_disconnectplayer_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_disconnectplayer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_disconnectplayer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chrif_removemap(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_removemap_pre ) {
+ if (HPMHooks.count.HP_chrif_removemap_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_removemap_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6145,11 +6224,11 @@ void HP_chrif_removemap(int fd) {
{
HPMHooks.source.chrif.removemap(fd);
}
- if( HPMHooks.count.HP_chrif_removemap_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_removemap_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_removemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_removemap_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -6157,14 +6236,14 @@ void HP_chrif_removemap(int fd) {
int HP_chrif_updatefamelist_ack(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_updatefamelist_ack_pre ) {
+ if (HPMHooks.count.HP_chrif_updatefamelist_ack_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_updatefamelist_ack_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6172,25 +6251,25 @@ int HP_chrif_updatefamelist_ack(int fd) {
{
retVal___ = HPMHooks.source.chrif.updatefamelist_ack(fd);
}
- if( HPMHooks.count.HP_chrif_updatefamelist_ack_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_updatefamelist_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_updatefamelist_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_updatefamelist_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chrif_keepalive(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_keepalive_pre ) {
+ if (HPMHooks.count.HP_chrif_keepalive_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_keepalive_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6198,25 +6277,25 @@ void HP_chrif_keepalive(int fd) {
{
HPMHooks.source.chrif.keepalive(fd);
}
- if( HPMHooks.count.HP_chrif_keepalive_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_keepalive_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_keepalive_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_keepalive_ack(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_keepalive_ack_pre ) {
+ if (HPMHooks.count.HP_chrif_keepalive_ack_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_keepalive_ack_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6224,25 +6303,25 @@ void HP_chrif_keepalive_ack(int fd) {
{
HPMHooks.source.chrif.keepalive_ack(fd);
}
- if( HPMHooks.count.HP_chrif_keepalive_ack_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_keepalive_ack_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_keepalive_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_keepalive_ack_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_deadopt(int father_id, int mother_id, int child_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_deadopt_pre ) {
+ if (HPMHooks.count.HP_chrif_deadopt_pre > 0) {
void (*preHookFunc) (int *father_id, int *mother_id, int *child_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_deadopt_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_deadopt_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_deadopt_pre[hIndex].func;
preHookFunc(&father_id, &mother_id, &child_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6250,25 +6329,25 @@ void HP_chrif_deadopt(int father_id, int mother_id, int child_id) {
{
HPMHooks.source.chrif.deadopt(father_id, mother_id, child_id);
}
- if( HPMHooks.count.HP_chrif_deadopt_post ) {
- void (*postHookFunc) (int *father_id, int *mother_id, int *child_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_deadopt_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_deadopt_post > 0) {
+ void (*postHookFunc) (int father_id, int mother_id, int child_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_deadopt_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_deadopt_post[hIndex].func;
- postHookFunc(&father_id, &mother_id, &child_id);
+ postHookFunc(father_id, mother_id, child_id);
}
}
return;
}
void HP_chrif_authfail(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_authfail_pre ) {
+ if (HPMHooks.count.HP_chrif_authfail_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authfail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authfail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_authfail_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6276,25 +6355,25 @@ void HP_chrif_authfail(int fd) {
{
HPMHooks.source.chrif.authfail(fd);
}
- if( HPMHooks.count.HP_chrif_authfail_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authfail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_authfail_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_authfail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_authfail_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_chrif_on_ready(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_on_ready_pre ) {
+ if (HPMHooks.count.HP_chrif_on_ready_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_ready_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_ready_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_on_ready_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6302,9 +6381,9 @@ void HP_chrif_on_ready(void) {
{
HPMHooks.source.chrif.on_ready();
}
- if( HPMHooks.count.HP_chrif_on_ready_post ) {
+ if (HPMHooks.count.HP_chrif_on_ready_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_ready_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_ready_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_on_ready_post[hIndex].func;
postHookFunc();
}
@@ -6313,14 +6392,14 @@ void HP_chrif_on_ready(void) {
}
void HP_chrif_on_disconnect(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_on_disconnect_pre ) {
+ if (HPMHooks.count.HP_chrif_on_disconnect_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_disconnect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_disconnect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_on_disconnect_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6328,9 +6407,9 @@ void HP_chrif_on_disconnect(void) {
{
HPMHooks.source.chrif.on_disconnect();
}
- if( HPMHooks.count.HP_chrif_on_disconnect_post ) {
+ if (HPMHooks.count.HP_chrif_on_disconnect_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_disconnect_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_on_disconnect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_on_disconnect_post[hIndex].func;
postHookFunc();
}
@@ -6340,14 +6419,14 @@ void HP_chrif_on_disconnect(void) {
int HP_chrif_parse(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_chrif_parse_pre ) {
+ if (HPMHooks.count.HP_chrif_parse_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_parse_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6355,25 +6434,25 @@ int HP_chrif_parse(int fd) {
{
retVal___ = HPMHooks.source.chrif.parse(fd);
}
- if( HPMHooks.count.HP_chrif_parse_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_chrif_save_scdata_single(int account_id, int char_id, short type, struct status_change_entry *sce) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_save_scdata_single_pre ) {
- void (*preHookFunc) (int *account_id, int *char_id, short *type, struct status_change_entry *sce);
+ if (HPMHooks.count.HP_chrif_save_scdata_single_pre > 0) {
+ void (*preHookFunc) (int *account_id, int *char_id, short *type, struct status_change_entry **sce);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_save_scdata_single_pre[hIndex].func;
- preHookFunc(&account_id, &char_id, &type, sce);
+ preHookFunc(&account_id, &char_id, &type, &sce);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6381,25 +6460,25 @@ void HP_chrif_save_scdata_single(int account_id, int char_id, short type, struct
{
HPMHooks.source.chrif.save_scdata_single(account_id, char_id, type, sce);
}
- if( HPMHooks.count.HP_chrif_save_scdata_single_post ) {
- void (*postHookFunc) (int *account_id, int *char_id, short *type, struct status_change_entry *sce);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_save_scdata_single_post > 0) {
+ void (*postHookFunc) (int account_id, int char_id, short type, struct status_change_entry *sce);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_save_scdata_single_post[hIndex].func;
- postHookFunc(&account_id, &char_id, &type, sce);
+ postHookFunc(account_id, char_id, type, sce);
}
}
return;
}
void HP_chrif_del_scdata_single(int account_id, int char_id, short type) {
int hIndex = 0;
- if( HPMHooks.count.HP_chrif_del_scdata_single_pre ) {
+ if (HPMHooks.count.HP_chrif_del_scdata_single_pre > 0) {
void (*preHookFunc) (int *account_id, int *char_id, short *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_del_scdata_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_del_scdata_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_chrif_del_scdata_single_pre[hIndex].func;
preHookFunc(&account_id, &char_id, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6407,27 +6486,27 @@ void HP_chrif_del_scdata_single(int account_id, int char_id, short type) {
{
HPMHooks.source.chrif.del_scdata_single(account_id, char_id, type);
}
- if( HPMHooks.count.HP_chrif_del_scdata_single_post ) {
- void (*postHookFunc) (int *account_id, int *char_id, short *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_del_scdata_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_chrif_del_scdata_single_post > 0) {
+ void (*postHookFunc) (int account_id, int char_id, short type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_chrif_del_scdata_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_chrif_del_scdata_single_post[hIndex].func;
- postHookFunc(&account_id, &char_id, &type);
+ postHookFunc(account_id, char_id, type);
}
}
return;
}
-/* clif */
+/* clif_interface */
int HP_clif_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_init_pre ) {
+ if (HPMHooks.count.HP_clif_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6435,25 +6514,25 @@ int HP_clif_init(bool minimal) {
{
retVal___ = HPMHooks.source.clif.init(minimal);
}
- if( HPMHooks.count.HP_clif_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
}
void HP_clif_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_final_pre ) {
+ if (HPMHooks.count.HP_clif_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6461,9 +6540,9 @@ void HP_clif_final(void) {
{
HPMHooks.source.clif.final();
}
- if( HPMHooks.count.HP_clif_final_post ) {
+ if (HPMHooks.count.HP_clif_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_final_post[hIndex].func;
postHookFunc();
}
@@ -6473,14 +6552,14 @@ void HP_clif_final(void) {
bool HP_clif_setip(const char *ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_setip_pre ) {
- bool (*preHookFunc) (const char *ip);
+ if (HPMHooks.count.HP_clif_setip_pre > 0) {
+ bool (*preHookFunc) (const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_setip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_setip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_setip_pre[hIndex].func;
- retVal___ = preHookFunc(ip);
+ retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6488,9 +6567,9 @@ bool HP_clif_setip(const char *ip) {
{
retVal___ = HPMHooks.source.clif.setip(ip);
}
- if( HPMHooks.count.HP_clif_setip_post ) {
+ if (HPMHooks.count.HP_clif_setip_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_setip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_setip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_setip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ip);
}
@@ -6500,14 +6579,14 @@ bool HP_clif_setip(const char *ip) {
bool HP_clif_setbindip(const char *ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_setbindip_pre ) {
- bool (*preHookFunc) (const char *ip);
+ if (HPMHooks.count.HP_clif_setbindip_pre > 0) {
+ bool (*preHookFunc) (const char **ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_setbindip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_setbindip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_setbindip_pre[hIndex].func;
- retVal___ = preHookFunc(ip);
+ retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6515,9 +6594,9 @@ bool HP_clif_setbindip(const char *ip) {
{
retVal___ = HPMHooks.source.clif.setbindip(ip);
}
- if( HPMHooks.count.HP_clif_setbindip_post ) {
+ if (HPMHooks.count.HP_clif_setbindip_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_setbindip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_setbindip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_setbindip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ip);
}
@@ -6526,14 +6605,14 @@ bool HP_clif_setbindip(const char *ip) {
}
void HP_clif_setport(uint16 port) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_setport_pre ) {
+ if (HPMHooks.count.HP_clif_setport_pre > 0) {
void (*preHookFunc) (uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_setport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_setport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_setport_pre[hIndex].func;
preHookFunc(&port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6541,11 +6620,11 @@ void HP_clif_setport(uint16 port) {
{
HPMHooks.source.clif.setport(port);
}
- if( HPMHooks.count.HP_clif_setport_post ) {
- void (*postHookFunc) (uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_setport_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_setport_post > 0) {
+ void (*postHookFunc) (uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_setport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_setport_post[hIndex].func;
- postHookFunc(&port);
+ postHookFunc(port);
}
}
return;
@@ -6553,14 +6632,14 @@ void HP_clif_setport(uint16 port) {
uint32 HP_clif_refresh_ip(void) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_clif_refresh_ip_pre ) {
+ if (HPMHooks.count.HP_clif_refresh_ip_pre > 0) {
uint32 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_refresh_ip_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6568,9 +6647,9 @@ uint32 HP_clif_refresh_ip(void) {
{
retVal___ = HPMHooks.source.clif.refresh_ip();
}
- if( HPMHooks.count.HP_clif_refresh_ip_post ) {
+ if (HPMHooks.count.HP_clif_refresh_ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_refresh_ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -6580,14 +6659,14 @@ uint32 HP_clif_refresh_ip(void) {
bool HP_clif_send(const void *buf, int len, struct block_list *bl, enum send_target type) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_send_pre ) {
- bool (*preHookFunc) (const void *buf, int *len, struct block_list *bl, enum send_target *type);
+ if (HPMHooks.count.HP_clif_send_pre > 0) {
+ bool (*preHookFunc) (const void **buf, int *len, struct block_list **bl, enum send_target *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_send_pre[hIndex].func;
- retVal___ = preHookFunc(buf, &len, bl, &type);
+ retVal___ = preHookFunc(&buf, &len, &bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6595,11 +6674,11 @@ bool HP_clif_send(const void *buf, int len, struct block_list *bl, enum send_tar
{
retVal___ = HPMHooks.source.clif.send(buf, len, bl, type);
}
- if( HPMHooks.count.HP_clif_send_post ) {
- bool (*postHookFunc) (bool retVal___, const void *buf, int *len, struct block_list *bl, enum send_target *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_send_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const void *buf, int len, struct block_list *bl, enum send_target type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_send_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, buf, &len, bl, &type);
+ retVal___ = postHookFunc(retVal___, buf, len, bl, type);
}
}
return retVal___;
@@ -6607,16 +6686,16 @@ bool HP_clif_send(const void *buf, int len, struct block_list *bl, enum send_tar
int HP_clif_send_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_send_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_clif_send_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_clif_send_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6626,9 +6705,9 @@ int HP_clif_send_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.clif.send_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_clif_send_sub_post ) {
+ if (HPMHooks.count.HP_clif_send_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_clif_send_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -6640,14 +6719,14 @@ int HP_clif_send_sub(struct block_list *bl, va_list ap) {
int HP_clif_send_actual(int fd, void *buf, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_send_actual_pre ) {
- int (*preHookFunc) (int *fd, void *buf, int *len);
+ if (HPMHooks.count.HP_clif_send_actual_pre > 0) {
+ int (*preHookFunc) (int *fd, void **buf, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_actual_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_actual_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_send_actual_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, buf, &len);
+ retVal___ = preHookFunc(&fd, &buf, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6655,11 +6734,11 @@ int HP_clif_send_actual(int fd, void *buf, int len) {
{
retVal___ = HPMHooks.source.clif.send_actual(fd, buf, len);
}
- if( HPMHooks.count.HP_clif_send_actual_post ) {
- int (*postHookFunc) (int retVal___, int *fd, void *buf, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_actual_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_send_actual_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, void *buf, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_actual_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_send_actual_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, buf, &len);
+ retVal___ = postHookFunc(retVal___, fd, buf, len);
}
}
return retVal___;
@@ -6667,14 +6746,14 @@ int HP_clif_send_actual(int fd, void *buf, int len) {
int HP_clif_parse(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_parse_pre ) {
+ if (HPMHooks.count.HP_clif_parse_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_parse_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6682,11 +6761,11 @@ int HP_clif_parse(int fd) {
{
retVal___ = HPMHooks.source.clif.parse(fd);
}
- if( HPMHooks.count.HP_clif_parse_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -6694,14 +6773,14 @@ int HP_clif_parse(int fd) {
const struct s_packet_db* HP_clif_packet(int packet_id) {
int hIndex = 0;
const struct s_packet_db* retVal___ = NULL;
- if( HPMHooks.count.HP_clif_packet_pre ) {
+ if (HPMHooks.count.HP_clif_packet_pre > 0) {
const struct s_packet_db* (*preHookFunc) (int *packet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_packet_pre[hIndex].func;
retVal___ = preHookFunc(&packet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6709,11 +6788,11 @@ const struct s_packet_db* HP_clif_packet(int packet_id) {
{
retVal___ = HPMHooks.source.clif.packet(packet_id);
}
- if( HPMHooks.count.HP_clif_packet_post ) {
- const struct s_packet_db* (*postHookFunc) (const struct s_packet_db* retVal___, int *packet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_packet_post > 0) {
+ const struct s_packet_db* (*postHookFunc) (const struct s_packet_db* retVal___, int packet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_packet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_packet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &packet_id);
+ retVal___ = postHookFunc(retVal___, packet_id);
}
}
return retVal___;
@@ -6721,14 +6800,14 @@ const struct s_packet_db* HP_clif_packet(int packet_id) {
unsigned short HP_clif_parse_cmd(int fd, struct map_session_data *sd) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_clif_parse_cmd_pre ) {
- unsigned short (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_parse_cmd_pre > 0) {
+ unsigned short (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_cmd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_cmd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_parse_cmd_pre[hIndex].func;
- retVal___ = preHookFunc(&fd, sd);
+ retVal___ = preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6736,11 +6815,11 @@ unsigned short HP_clif_parse_cmd(int fd, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.clif.parse_cmd(fd, sd);
}
- if( HPMHooks.count.HP_clif_parse_cmd_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_cmd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_parse_cmd_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_cmd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_parse_cmd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, sd);
+ retVal___ = postHookFunc(retVal___, fd, sd);
}
}
return retVal___;
@@ -6748,14 +6827,14 @@ unsigned short HP_clif_parse_cmd(int fd, struct map_session_data *sd) {
unsigned short HP_clif_decrypt_cmd(int cmd, struct map_session_data *sd) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_clif_decrypt_cmd_pre ) {
- unsigned short (*preHookFunc) (int *cmd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_decrypt_cmd_pre > 0) {
+ unsigned short (*preHookFunc) (int *cmd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_decrypt_cmd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_decrypt_cmd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_decrypt_cmd_pre[hIndex].func;
- retVal___ = preHookFunc(&cmd, sd);
+ retVal___ = preHookFunc(&cmd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -6763,25 +6842,25 @@ unsigned short HP_clif_decrypt_cmd(int cmd, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.clif.decrypt_cmd(cmd, sd);
}
- if( HPMHooks.count.HP_clif_decrypt_cmd_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, int *cmd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_decrypt_cmd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_decrypt_cmd_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, int cmd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_decrypt_cmd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_decrypt_cmd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &cmd, sd);
+ retVal___ = postHookFunc(retVal___, cmd, sd);
}
}
return retVal___;
}
void HP_clif_authok(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_authok_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_authok_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_authok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_authok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_authok_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6789,9 +6868,9 @@ void HP_clif_authok(struct map_session_data *sd) {
{
HPMHooks.source.clif.authok(sd);
}
- if( HPMHooks.count.HP_clif_authok_post ) {
+ if (HPMHooks.count.HP_clif_authok_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_authok_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_authok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_authok_post[hIndex].func;
postHookFunc(sd);
}
@@ -6800,14 +6879,14 @@ void HP_clif_authok(struct map_session_data *sd) {
}
void HP_clif_authrefuse(int fd, uint8 error_code) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_authrefuse_pre ) {
+ if (HPMHooks.count.HP_clif_authrefuse_pre > 0) {
void (*preHookFunc) (int *fd, uint8 *error_code);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_authrefuse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_authrefuse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_authrefuse_pre[hIndex].func;
preHookFunc(&fd, &error_code);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6815,25 +6894,25 @@ void HP_clif_authrefuse(int fd, uint8 error_code) {
{
HPMHooks.source.clif.authrefuse(fd, error_code);
}
- if( HPMHooks.count.HP_clif_authrefuse_post ) {
- void (*postHookFunc) (int *fd, uint8 *error_code);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_authrefuse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_authrefuse_post > 0) {
+ void (*postHookFunc) (int fd, uint8 error_code);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_authrefuse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_authrefuse_post[hIndex].func;
- postHookFunc(&fd, &error_code);
+ postHookFunc(fd, error_code);
}
}
return;
}
void HP_clif_authfail_fd(int fd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_authfail_fd_pre ) {
+ if (HPMHooks.count.HP_clif_authfail_fd_pre > 0) {
void (*preHookFunc) (int *fd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_authfail_fd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_authfail_fd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_authfail_fd_pre[hIndex].func;
preHookFunc(&fd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6841,25 +6920,25 @@ void HP_clif_authfail_fd(int fd, int type) {
{
HPMHooks.source.clif.authfail_fd(fd, type);
}
- if( HPMHooks.count.HP_clif_authfail_fd_post ) {
- void (*postHookFunc) (int *fd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_authfail_fd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_authfail_fd_post > 0) {
+ void (*postHookFunc) (int fd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_authfail_fd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_authfail_fd_post[hIndex].func;
- postHookFunc(&fd, &type);
+ postHookFunc(fd, type);
}
}
return;
}
void HP_clif_charselectok(int id, uint8 ok) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_charselectok_pre ) {
+ if (HPMHooks.count.HP_clif_charselectok_pre > 0) {
void (*preHookFunc) (int *id, uint8 *ok);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charselectok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charselectok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_charselectok_pre[hIndex].func;
preHookFunc(&id, &ok);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6867,25 +6946,25 @@ void HP_clif_charselectok(int id, uint8 ok) {
{
HPMHooks.source.clif.charselectok(id, ok);
}
- if( HPMHooks.count.HP_clif_charselectok_post ) {
- void (*postHookFunc) (int *id, uint8 *ok);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charselectok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_charselectok_post > 0) {
+ void (*postHookFunc) (int id, uint8 ok);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charselectok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_charselectok_post[hIndex].func;
- postHookFunc(&id, &ok);
+ postHookFunc(id, ok);
}
}
return;
}
void HP_clif_dropflooritem(struct flooritem_data *fitem) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_dropflooritem_pre ) {
- void (*preHookFunc) (struct flooritem_data *fitem);
+ if (HPMHooks.count.HP_clif_dropflooritem_pre > 0) {
+ void (*preHookFunc) (struct flooritem_data **fitem);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropflooritem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropflooritem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_dropflooritem_pre[hIndex].func;
- preHookFunc(fitem);
+ preHookFunc(&fitem);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6893,9 +6972,9 @@ void HP_clif_dropflooritem(struct flooritem_data *fitem) {
{
HPMHooks.source.clif.dropflooritem(fitem);
}
- if( HPMHooks.count.HP_clif_dropflooritem_post ) {
+ if (HPMHooks.count.HP_clif_dropflooritem_post > 0) {
void (*postHookFunc) (struct flooritem_data *fitem);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropflooritem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropflooritem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_dropflooritem_post[hIndex].func;
postHookFunc(fitem);
}
@@ -6904,14 +6983,14 @@ void HP_clif_dropflooritem(struct flooritem_data *fitem) {
}
void HP_clif_clearflooritem(struct flooritem_data *fitem, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearflooritem_pre ) {
- void (*preHookFunc) (struct flooritem_data *fitem, int *fd);
+ if (HPMHooks.count.HP_clif_clearflooritem_pre > 0) {
+ void (*preHookFunc) (struct flooritem_data **fitem, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearflooritem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearflooritem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearflooritem_pre[hIndex].func;
- preHookFunc(fitem, &fd);
+ preHookFunc(&fitem, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6919,25 +6998,25 @@ void HP_clif_clearflooritem(struct flooritem_data *fitem, int fd) {
{
HPMHooks.source.clif.clearflooritem(fitem, fd);
}
- if( HPMHooks.count.HP_clif_clearflooritem_post ) {
- void (*postHookFunc) (struct flooritem_data *fitem, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearflooritem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearflooritem_post > 0) {
+ void (*postHookFunc) (struct flooritem_data *fitem, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearflooritem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearflooritem_post[hIndex].func;
- postHookFunc(fitem, &fd);
+ postHookFunc(fitem, fd);
}
}
return;
}
void HP_clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_additem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *amount, int *fail);
+ if (HPMHooks.count.HP_clif_additem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *amount, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_additem_pre[hIndex].func;
- preHookFunc(sd, &n, &amount, &fail);
+ preHookFunc(&sd, &n, &amount, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6945,25 +7024,25 @@ void HP_clif_additem(struct map_session_data *sd, int n, int amount, int fail) {
{
HPMHooks.source.clif.additem(sd, n, amount, fail);
}
- if( HPMHooks.count.HP_clif_additem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *amount, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_additem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int amount, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_additem_post[hIndex].func;
- postHookFunc(sd, &n, &amount, &fail);
+ postHookFunc(sd, n, amount, fail);
}
}
return;
}
void HP_clif_dropitem(struct map_session_data *sd, int n, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_dropitem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *amount);
+ if (HPMHooks.count.HP_clif_dropitem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_dropitem_pre[hIndex].func;
- preHookFunc(sd, &n, &amount);
+ preHookFunc(&sd, &n, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6971,25 +7050,25 @@ void HP_clif_dropitem(struct map_session_data *sd, int n, int amount) {
{
HPMHooks.source.clif.dropitem(sd, n, amount);
}
- if( HPMHooks.count.HP_clif_dropitem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_dropitem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dropitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_dropitem_post[hIndex].func;
- postHookFunc(sd, &n, &amount);
+ postHookFunc(sd, n, amount);
}
}
return;
}
void HP_clif_delitem(struct map_session_data *sd, int n, int amount, short reason) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_delitem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *amount, short *reason);
+ if (HPMHooks.count.HP_clif_delitem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *amount, short *reason);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_delitem_pre[hIndex].func;
- preHookFunc(sd, &n, &amount, &reason);
+ preHookFunc(&sd, &n, &amount, &reason);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -6997,25 +7076,25 @@ void HP_clif_delitem(struct map_session_data *sd, int n, int amount, short reaso
{
HPMHooks.source.clif.delitem(sd, n, amount, reason);
}
- if( HPMHooks.count.HP_clif_delitem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *amount, short *reason);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_delitem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int amount, short reason);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_delitem_post[hIndex].func;
- postHookFunc(sd, &n, &amount, &reason);
+ postHookFunc(sd, n, amount, reason);
}
}
return;
}
void HP_clif_takeitem(struct block_list *src, struct block_list *dst) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_takeitem_pre ) {
- void (*preHookFunc) (struct block_list *src, struct block_list *dst);
+ if (HPMHooks.count.HP_clif_takeitem_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct block_list **dst);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_takeitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_takeitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_takeitem_pre[hIndex].func;
- preHookFunc(src, dst);
+ preHookFunc(&src, &dst);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7023,9 +7102,9 @@ void HP_clif_takeitem(struct block_list *src, struct block_list *dst) {
{
HPMHooks.source.clif.takeitem(src, dst);
}
- if( HPMHooks.count.HP_clif_takeitem_post ) {
+ if (HPMHooks.count.HP_clif_takeitem_post > 0) {
void (*postHookFunc) (struct block_list *src, struct block_list *dst);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_takeitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_takeitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_takeitem_post[hIndex].func;
postHookFunc(src, dst);
}
@@ -7034,14 +7113,14 @@ void HP_clif_takeitem(struct block_list *src, struct block_list *dst) {
}
void HP_clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_equip_pre ) {
- void (*preHookFunc) (short *idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int *eqp_pos);
+ if (HPMHooks.count.HP_clif_item_equip_pre > 0) {
+ void (*preHookFunc) (short *idx, struct EQUIPITEM_INFO **p, struct item **i, struct item_data **id, int *eqp_pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_equip_pre[hIndex].func;
- preHookFunc(&idx, p, i, id, &eqp_pos);
+ preHookFunc(&idx, &p, &i, &id, &eqp_pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7049,25 +7128,25 @@ void HP_clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, str
{
HPMHooks.source.clif.item_equip(idx, p, i, id, eqp_pos);
}
- if( HPMHooks.count.HP_clif_item_equip_post ) {
- void (*postHookFunc) (short *idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int *eqp_pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_equip_post > 0) {
+ void (*postHookFunc) (short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_equip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_equip_post[hIndex].func;
- postHookFunc(&idx, p, i, id, &eqp_pos);
+ postHookFunc(idx, p, i, id, eqp_pos);
}
}
return;
}
void HP_clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_normal_pre ) {
- void (*preHookFunc) (short *idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
+ if (HPMHooks.count.HP_clif_item_normal_pre > 0) {
+ void (*preHookFunc) (short *idx, struct NORMALITEM_INFO **p, struct item **i, struct item_data **id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_normal_pre[hIndex].func;
- preHookFunc(&idx, p, i, id);
+ preHookFunc(&idx, &p, &i, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7075,25 +7154,25 @@ void HP_clif_item_normal(short idx, struct NORMALITEM_INFO *p, struct item *i, s
{
HPMHooks.source.clif.item_normal(idx, p, i, id);
}
- if( HPMHooks.count.HP_clif_item_normal_post ) {
- void (*postHookFunc) (short *idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_normal_post > 0) {
+ void (*postHookFunc) (short idx, struct NORMALITEM_INFO *p, struct item *i, struct item_data *id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_normal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_normal_post[hIndex].func;
- postHookFunc(&idx, p, i, id);
+ postHookFunc(idx, p, i, id);
}
}
return;
}
void HP_clif_arrowequip(struct map_session_data *sd, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_arrowequip_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *val);
+ if (HPMHooks.count.HP_clif_arrowequip_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrowequip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrowequip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_arrowequip_pre[hIndex].func;
- preHookFunc(sd, &val);
+ preHookFunc(&sd, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7101,25 +7180,25 @@ void HP_clif_arrowequip(struct map_session_data *sd, int val) {
{
HPMHooks.source.clif.arrowequip(sd, val);
}
- if( HPMHooks.count.HP_clif_arrowequip_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrowequip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_arrowequip_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrowequip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_arrowequip_post[hIndex].func;
- postHookFunc(sd, &val);
+ postHookFunc(sd, val);
}
}
return;
}
void HP_clif_arrow_fail(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_arrow_fail_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_arrow_fail_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_fail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_fail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_arrow_fail_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7127,25 +7206,25 @@ void HP_clif_arrow_fail(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.arrow_fail(sd, type);
}
- if( HPMHooks.count.HP_clif_arrow_fail_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_fail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_arrow_fail_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_fail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_arrow_fail_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_use_card(struct map_session_data *sd, int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_use_card_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx);
+ if (HPMHooks.count.HP_clif_use_card_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_use_card_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_use_card_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_use_card_pre[hIndex].func;
- preHookFunc(sd, &idx);
+ preHookFunc(&sd, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7153,25 +7232,25 @@ void HP_clif_use_card(struct map_session_data *sd, int idx) {
{
HPMHooks.source.clif.use_card(sd, idx);
}
- if( HPMHooks.count.HP_clif_use_card_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_use_card_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_use_card_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_use_card_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_use_card_post[hIndex].func;
- postHookFunc(sd, &idx);
+ postHookFunc(sd, idx);
}
}
return;
}
void HP_clif_cart_additem(struct map_session_data *sd, int n, int amount, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cart_additem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *amount, int *fail);
+ if (HPMHooks.count.HP_clif_cart_additem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *amount, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cart_additem_pre[hIndex].func;
- preHookFunc(sd, &n, &amount, &fail);
+ preHookFunc(&sd, &n, &amount, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7179,25 +7258,25 @@ void HP_clif_cart_additem(struct map_session_data *sd, int n, int amount, int fa
{
HPMHooks.source.clif.cart_additem(sd, n, amount, fail);
}
- if( HPMHooks.count.HP_clif_cart_additem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *amount, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cart_additem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int amount, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cart_additem_post[hIndex].func;
- postHookFunc(sd, &n, &amount, &fail);
+ postHookFunc(sd, n, amount, fail);
}
}
return;
}
void HP_clif_cart_delitem(struct map_session_data *sd, int n, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cart_delitem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *amount);
+ if (HPMHooks.count.HP_clif_cart_delitem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_delitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_delitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cart_delitem_pre[hIndex].func;
- preHookFunc(sd, &n, &amount);
+ preHookFunc(&sd, &n, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7205,25 +7284,25 @@ void HP_clif_cart_delitem(struct map_session_data *sd, int n, int amount) {
{
HPMHooks.source.clif.cart_delitem(sd, n, amount);
}
- if( HPMHooks.count.HP_clif_cart_delitem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_delitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cart_delitem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_delitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cart_delitem_post[hIndex].func;
- postHookFunc(sd, &n, &amount);
+ postHookFunc(sd, n, amount);
}
}
return;
}
void HP_clif_equipitemack(struct map_session_data *sd, int n, int pos, enum e_EQUIP_ITEM_ACK result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_equipitemack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *pos, enum e_EQUIP_ITEM_ACK *result);
+ if (HPMHooks.count.HP_clif_equipitemack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *pos, enum e_EQUIP_ITEM_ACK *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipitemack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipitemack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_equipitemack_pre[hIndex].func;
- preHookFunc(sd, &n, &pos, &result);
+ preHookFunc(&sd, &n, &pos, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7231,25 +7310,25 @@ void HP_clif_equipitemack(struct map_session_data *sd, int n, int pos, enum e_EQ
{
HPMHooks.source.clif.equipitemack(sd, n, pos, result);
}
- if( HPMHooks.count.HP_clif_equipitemack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *pos, enum e_EQUIP_ITEM_ACK *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipitemack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_equipitemack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int pos, enum e_EQUIP_ITEM_ACK result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipitemack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_equipitemack_post[hIndex].func;
- postHookFunc(sd, &n, &pos, &result);
+ postHookFunc(sd, n, pos, result);
}
}
return;
}
void HP_clif_unequipitemack(struct map_session_data *sd, int n, int pos, enum e_UNEQUIP_ITEM_ACK result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_unequipitemack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *pos, enum e_UNEQUIP_ITEM_ACK *result);
+ if (HPMHooks.count.HP_clif_unequipitemack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *pos, enum e_UNEQUIP_ITEM_ACK *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_unequipitemack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_unequipitemack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_unequipitemack_pre[hIndex].func;
- preHookFunc(sd, &n, &pos, &result);
+ preHookFunc(&sd, &n, &pos, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7257,25 +7336,25 @@ void HP_clif_unequipitemack(struct map_session_data *sd, int n, int pos, enum e_
{
HPMHooks.source.clif.unequipitemack(sd, n, pos, result);
}
- if( HPMHooks.count.HP_clif_unequipitemack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *pos, enum e_UNEQUIP_ITEM_ACK *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_unequipitemack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_unequipitemack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int pos, enum e_UNEQUIP_ITEM_ACK result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_unequipitemack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_unequipitemack_post[hIndex].func;
- postHookFunc(sd, &n, &pos, &result);
+ postHookFunc(sd, n, pos, result);
}
}
return;
}
void HP_clif_useitemack(struct map_session_data *sd, int index, int amount, bool ok) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_useitemack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index, int *amount, bool *ok);
+ if (HPMHooks.count.HP_clif_useitemack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount, bool *ok);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_useitemack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_useitemack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_useitemack_pre[hIndex].func;
- preHookFunc(sd, &index, &amount, &ok);
+ preHookFunc(&sd, &index, &amount, &ok);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7283,25 +7362,25 @@ void HP_clif_useitemack(struct map_session_data *sd, int index, int amount, bool
{
HPMHooks.source.clif.useitemack(sd, index, amount, ok);
}
- if( HPMHooks.count.HP_clif_useitemack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index, int *amount, bool *ok);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_useitemack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_useitemack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index, int amount, bool ok);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_useitemack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_useitemack_post[hIndex].func;
- postHookFunc(sd, &index, &amount, &ok);
+ postHookFunc(sd, index, amount, ok);
}
}
return;
}
void HP_clif_addcards(unsigned char *buf, struct item *item) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_addcards_pre ) {
- void (*preHookFunc) (unsigned char *buf, struct item *item);
+ if (HPMHooks.count.HP_clif_addcards_pre > 0) {
+ void (*preHookFunc) (unsigned char **buf, struct item **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_addcards_pre[hIndex].func;
- preHookFunc(buf, item);
+ preHookFunc(&buf, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7309,9 +7388,9 @@ void HP_clif_addcards(unsigned char *buf, struct item *item) {
{
HPMHooks.source.clif.addcards(buf, item);
}
- if( HPMHooks.count.HP_clif_addcards_post ) {
+ if (HPMHooks.count.HP_clif_addcards_post > 0) {
void (*postHookFunc) (unsigned char *buf, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_addcards_post[hIndex].func;
postHookFunc(buf, item);
}
@@ -7320,14 +7399,14 @@ void HP_clif_addcards(unsigned char *buf, struct item *item) {
}
void HP_clif_addcards2(unsigned short *cards, struct item *item) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_addcards2_pre ) {
- void (*preHookFunc) (unsigned short *cards, struct item *item);
+ if (HPMHooks.count.HP_clif_addcards2_pre > 0) {
+ void (*preHookFunc) (unsigned short **cards, struct item **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_addcards2_pre[hIndex].func;
- preHookFunc(cards, item);
+ preHookFunc(&cards, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7335,9 +7414,9 @@ void HP_clif_addcards2(unsigned short *cards, struct item *item) {
{
HPMHooks.source.clif.addcards2(cards, item);
}
- if( HPMHooks.count.HP_clif_addcards2_post ) {
+ if (HPMHooks.count.HP_clif_addcards2_post > 0) {
void (*postHookFunc) (unsigned short *cards, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addcards2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_addcards2_post[hIndex].func;
postHookFunc(cards, item);
}
@@ -7346,14 +7425,14 @@ void HP_clif_addcards2(unsigned short *cards, struct item *item) {
}
void HP_clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_data *id, int equip) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_sub_pre ) {
- void (*preHookFunc) (unsigned char *buf, int *n, struct item *i, struct item_data *id, int *equip);
+ if (HPMHooks.count.HP_clif_item_sub_pre > 0) {
+ void (*preHookFunc) (unsigned char **buf, int *n, struct item **i, struct item_data **id, int *equip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_sub_pre[hIndex].func;
- preHookFunc(buf, &n, i, id, &equip);
+ preHookFunc(&buf, &n, &i, &id, &equip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7361,25 +7440,25 @@ void HP_clif_item_sub(unsigned char *buf, int n, struct item *i, struct item_dat
{
HPMHooks.source.clif.item_sub(buf, n, i, id, equip);
}
- if( HPMHooks.count.HP_clif_item_sub_post ) {
- void (*postHookFunc) (unsigned char *buf, int *n, struct item *i, struct item_data *id, int *equip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_sub_post > 0) {
+ void (*postHookFunc) (unsigned char *buf, int n, struct item *i, struct item_data *id, int equip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_sub_post[hIndex].func;
- postHookFunc(buf, &n, i, id, &equip);
+ postHookFunc(buf, n, i, id, equip);
}
}
return;
}
void HP_clif_getareachar_item(struct map_session_data *sd, struct flooritem_data *fitem) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_getareachar_item_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct flooritem_data *fitem);
+ if (HPMHooks.count.HP_clif_getareachar_item_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct flooritem_data **fitem);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_getareachar_item_pre[hIndex].func;
- preHookFunc(sd, fitem);
+ preHookFunc(&sd, &fitem);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7387,9 +7466,9 @@ void HP_clif_getareachar_item(struct map_session_data *sd, struct flooritem_data
{
HPMHooks.source.clif.getareachar_item(sd, fitem);
}
- if( HPMHooks.count.HP_clif_getareachar_item_post ) {
+ if (HPMHooks.count.HP_clif_getareachar_item_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct flooritem_data *fitem);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_item_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_getareachar_item_post[hIndex].func;
postHookFunc(sd, fitem);
}
@@ -7398,14 +7477,14 @@ void HP_clif_getareachar_item(struct map_session_data *sd, struct flooritem_data
}
void HP_clif_cart_additem_ack(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cart_additem_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_cart_additem_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cart_additem_ack_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7413,25 +7492,25 @@ void HP_clif_cart_additem_ack(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.cart_additem_ack(sd, flag);
}
- if( HPMHooks.count.HP_clif_cart_additem_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cart_additem_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cart_additem_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cart_additem_ack_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_cashshop_load(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cashshop_load_pre ) {
+ if (HPMHooks.count.HP_clif_cashshop_load_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cashshop_load_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7439,9 +7518,9 @@ void HP_clif_cashshop_load(void) {
{
HPMHooks.source.clif.cashshop_load();
}
- if( HPMHooks.count.HP_clif_cashshop_load_post ) {
+ if (HPMHooks.count.HP_clif_cashshop_load_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_load_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cashshop_load_post[hIndex].func;
postHookFunc();
}
@@ -7450,14 +7529,14 @@ void HP_clif_cashshop_load(void) {
}
void HP_clif_package_announce(struct map_session_data *sd, unsigned short nameid, unsigned short containerid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_package_announce_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *nameid, unsigned short *containerid);
+ if (HPMHooks.count.HP_clif_package_announce_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *containerid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_package_announce_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_package_announce_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_package_announce_pre[hIndex].func;
- preHookFunc(sd, &nameid, &containerid);
+ preHookFunc(&sd, &nameid, &containerid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7465,25 +7544,25 @@ void HP_clif_package_announce(struct map_session_data *sd, unsigned short nameid
{
HPMHooks.source.clif.package_announce(sd, nameid, containerid);
}
- if( HPMHooks.count.HP_clif_package_announce_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *nameid, unsigned short *containerid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_package_announce_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_package_announce_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short containerid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_package_announce_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_package_announce_post[hIndex].func;
- postHookFunc(sd, &nameid, &containerid);
+ postHookFunc(sd, nameid, containerid);
}
}
return;
}
void HP_clif_item_drop_announce(struct map_session_data *sd, unsigned short nameid, char *monsterName) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_drop_announce_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *nameid, char *monsterName);
+ if (HPMHooks.count.HP_clif_item_drop_announce_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, char **monsterName);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_drop_announce_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_drop_announce_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_drop_announce_pre[hIndex].func;
- preHookFunc(sd, &nameid, monsterName);
+ preHookFunc(&sd, &nameid, &monsterName);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7491,25 +7570,25 @@ void HP_clif_item_drop_announce(struct map_session_data *sd, unsigned short name
{
HPMHooks.source.clif.item_drop_announce(sd, nameid, monsterName);
}
- if( HPMHooks.count.HP_clif_item_drop_announce_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *nameid, char *monsterName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_drop_announce_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_drop_announce_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, char *monsterName);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_drop_announce_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_drop_announce_post[hIndex].func;
- postHookFunc(sd, &nameid, monsterName);
+ postHookFunc(sd, nameid, monsterName);
}
}
return;
}
void HP_clif_clearunit_single(int id, clr_type type, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearunit_single_pre ) {
+ if (HPMHooks.count.HP_clif_clearunit_single_pre > 0) {
void (*preHookFunc) (int *id, clr_type *type, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearunit_single_pre[hIndex].func;
preHookFunc(&id, &type, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7517,25 +7596,25 @@ void HP_clif_clearunit_single(int id, clr_type type, int fd) {
{
HPMHooks.source.clif.clearunit_single(id, type, fd);
}
- if( HPMHooks.count.HP_clif_clearunit_single_post ) {
- void (*postHookFunc) (int *id, clr_type *type, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearunit_single_post > 0) {
+ void (*postHookFunc) (int id, clr_type type, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearunit_single_post[hIndex].func;
- postHookFunc(&id, &type, &fd);
+ postHookFunc(id, type, fd);
}
}
return;
}
void HP_clif_clearunit_area(struct block_list *bl, clr_type type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearunit_area_pre ) {
- void (*preHookFunc) (struct block_list *bl, clr_type *type);
+ if (HPMHooks.count.HP_clif_clearunit_area_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, clr_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_area_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearunit_area_pre[hIndex].func;
- preHookFunc(bl, &type);
+ preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7543,25 +7622,25 @@ void HP_clif_clearunit_area(struct block_list *bl, clr_type type) {
{
HPMHooks.source.clif.clearunit_area(bl, type);
}
- if( HPMHooks.count.HP_clif_clearunit_area_post ) {
- void (*postHookFunc) (struct block_list *bl, clr_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_area_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearunit_area_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, clr_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_area_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearunit_area_post[hIndex].func;
- postHookFunc(bl, &type);
+ postHookFunc(bl, type);
}
}
return;
}
void HP_clif_clearunit_delayed(struct block_list *bl, clr_type type, int64 tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearunit_delayed_pre ) {
- void (*preHookFunc) (struct block_list *bl, clr_type *type, int64 *tick);
+ if (HPMHooks.count.HP_clif_clearunit_delayed_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, clr_type *type, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearunit_delayed_pre[hIndex].func;
- preHookFunc(bl, &type, &tick);
+ preHookFunc(&bl, &type, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7569,25 +7648,25 @@ void HP_clif_clearunit_delayed(struct block_list *bl, clr_type type, int64 tick)
{
HPMHooks.source.clif.clearunit_delayed(bl, type, tick);
}
- if( HPMHooks.count.HP_clif_clearunit_delayed_post ) {
- void (*postHookFunc) (struct block_list *bl, clr_type *type, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearunit_delayed_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, clr_type type, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearunit_delayed_post[hIndex].func;
- postHookFunc(bl, &type, &tick);
+ postHookFunc(bl, type, tick);
}
}
return;
}
void HP_clif_walkok(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_walkok_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_walkok_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_walkok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_walkok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_walkok_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7595,9 +7674,9 @@ void HP_clif_walkok(struct map_session_data *sd) {
{
HPMHooks.source.clif.walkok(sd);
}
- if( HPMHooks.count.HP_clif_walkok_post ) {
+ if (HPMHooks.count.HP_clif_walkok_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_walkok_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_walkok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_walkok_post[hIndex].func;
postHookFunc(sd);
}
@@ -7606,14 +7685,14 @@ void HP_clif_walkok(struct map_session_data *sd) {
}
void HP_clif_move(struct unit_data *ud) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_move_pre ) {
- void (*preHookFunc) (struct unit_data *ud);
+ if (HPMHooks.count.HP_clif_move_pre > 0) {
+ void (*preHookFunc) (struct unit_data **ud);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_move_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_move_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_move_pre[hIndex].func;
- preHookFunc(ud);
+ preHookFunc(&ud);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7621,9 +7700,9 @@ void HP_clif_move(struct unit_data *ud) {
{
HPMHooks.source.clif.move(ud);
}
- if( HPMHooks.count.HP_clif_move_post ) {
+ if (HPMHooks.count.HP_clif_move_post > 0) {
void (*postHookFunc) (struct unit_data *ud);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_move_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_move_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_move_post[hIndex].func;
postHookFunc(ud);
}
@@ -7632,14 +7711,14 @@ void HP_clif_move(struct unit_data *ud) {
}
void HP_clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *ud) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_move2_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct view_data *vd, struct unit_data *ud);
+ if (HPMHooks.count.HP_clif_move2_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct view_data **vd, struct unit_data **ud);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_move2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_move2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_move2_pre[hIndex].func;
- preHookFunc(bl, vd, ud);
+ preHookFunc(&bl, &vd, &ud);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7647,9 +7726,9 @@ void HP_clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data
{
HPMHooks.source.clif.move2(bl, vd, ud);
}
- if( HPMHooks.count.HP_clif_move2_post ) {
+ if (HPMHooks.count.HP_clif_move2_post > 0) {
void (*postHookFunc) (struct block_list *bl, struct view_data *vd, struct unit_data *ud);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_move2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_move2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_move2_post[hIndex].func;
postHookFunc(bl, vd, ud);
}
@@ -7658,14 +7737,14 @@ void HP_clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data
}
void HP_clif_blown(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_blown_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_blown_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_blown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_blown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_blown_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7673,9 +7752,9 @@ void HP_clif_blown(struct block_list *bl) {
{
HPMHooks.source.clif.blown(bl);
}
- if( HPMHooks.count.HP_clif_blown_post ) {
+ if (HPMHooks.count.HP_clif_blown_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_blown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_blown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_blown_post[hIndex].func;
postHookFunc(bl);
}
@@ -7684,14 +7763,14 @@ void HP_clif_blown(struct block_list *bl) {
}
void HP_clif_slide(struct block_list *bl, int x, int y) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_slide_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *x, int *y);
+ if (HPMHooks.count.HP_clif_slide_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *x, int *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_slide_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_slide_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_slide_pre[hIndex].func;
- preHookFunc(bl, &x, &y);
+ preHookFunc(&bl, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7699,25 +7778,25 @@ void HP_clif_slide(struct block_list *bl, int x, int y) {
{
HPMHooks.source.clif.slide(bl, x, y);
}
- if( HPMHooks.count.HP_clif_slide_post ) {
- void (*postHookFunc) (struct block_list *bl, int *x, int *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_slide_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_slide_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int x, int y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_slide_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_slide_post[hIndex].func;
- postHookFunc(bl, &x, &y);
+ postHookFunc(bl, x, y);
}
}
return;
}
void HP_clif_fixpos(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_fixpos_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_fixpos_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fixpos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fixpos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_fixpos_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7725,9 +7804,9 @@ void HP_clif_fixpos(struct block_list *bl) {
{
HPMHooks.source.clif.fixpos(bl);
}
- if( HPMHooks.count.HP_clif_fixpos_post ) {
+ if (HPMHooks.count.HP_clif_fixpos_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fixpos_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fixpos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_fixpos_post[hIndex].func;
postHookFunc(bl);
}
@@ -7736,14 +7815,14 @@ void HP_clif_fixpos(struct block_list *bl) {
}
void HP_clif_changelook(struct block_list *bl, int type, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changelook_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type, int *val);
+ if (HPMHooks.count.HP_clif_changelook_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changelook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changelook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changelook_pre[hIndex].func;
- preHookFunc(bl, &type, &val);
+ preHookFunc(&bl, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7751,25 +7830,25 @@ void HP_clif_changelook(struct block_list *bl, int type, int val) {
{
HPMHooks.source.clif.changelook(bl, type, val);
}
- if( HPMHooks.count.HP_clif_changelook_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changelook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changelook_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changelook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changelook_post[hIndex].func;
- postHookFunc(bl, &type, &val);
+ postHookFunc(bl, type, val);
}
}
return;
}
void HP_clif_changetraplook(struct block_list *bl, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changetraplook_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *val);
+ if (HPMHooks.count.HP_clif_changetraplook_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changetraplook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changetraplook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changetraplook_pre[hIndex].func;
- preHookFunc(bl, &val);
+ preHookFunc(&bl, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7777,25 +7856,25 @@ void HP_clif_changetraplook(struct block_list *bl, int val) {
{
HPMHooks.source.clif.changetraplook(bl, val);
}
- if( HPMHooks.count.HP_clif_changetraplook_post ) {
- void (*postHookFunc) (struct block_list *bl, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changetraplook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changetraplook_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changetraplook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changetraplook_post[hIndex].func;
- postHookFunc(bl, &val);
+ postHookFunc(bl, val);
}
}
return;
}
void HP_clif_refreshlook(struct block_list *bl, int id, int type, int val, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_refreshlook_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *id, int *type, int *val, enum send_target *target);
+ if (HPMHooks.count.HP_clif_refreshlook_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *id, int *type, int *val, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refreshlook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refreshlook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_refreshlook_pre[hIndex].func;
- preHookFunc(bl, &id, &type, &val, &target);
+ preHookFunc(&bl, &id, &type, &val, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7803,25 +7882,25 @@ void HP_clif_refreshlook(struct block_list *bl, int id, int type, int val, enum
{
HPMHooks.source.clif.refreshlook(bl, id, type, val, target);
}
- if( HPMHooks.count.HP_clif_refreshlook_post ) {
- void (*postHookFunc) (struct block_list *bl, int *id, int *type, int *val, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refreshlook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_refreshlook_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int id, int type, int val, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refreshlook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_refreshlook_post[hIndex].func;
- postHookFunc(bl, &id, &type, &val, &target);
+ postHookFunc(bl, id, type, val, target);
}
}
return;
}
void HP_clif_sendlook(struct block_list *bl, int id, int type, int val, int val2, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sendlook_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *id, int *type, int *val, int *val2, enum send_target *target);
+ if (HPMHooks.count.HP_clif_sendlook_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *id, int *type, int *val, int *val2, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendlook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendlook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sendlook_pre[hIndex].func;
- preHookFunc(bl, &id, &type, &val, &val2, &target);
+ preHookFunc(&bl, &id, &type, &val, &val2, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7829,51 +7908,51 @@ void HP_clif_sendlook(struct block_list *bl, int id, int type, int val, int val2
{
HPMHooks.source.clif.sendlook(bl, id, type, val, val2, target);
}
- if( HPMHooks.count.HP_clif_sendlook_post ) {
- void (*postHookFunc) (struct block_list *bl, int *id, int *type, int *val, int *val2, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendlook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_sendlook_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendlook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sendlook_post[hIndex].func;
- postHookFunc(bl, &id, &type, &val, &val2, &target);
+ postHookFunc(bl, id, type, val, val2, target);
}
}
return;
}
-void HP_clif_class_change(struct block_list *bl, int class_, int type) {
+void HP_clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_class_change_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *class_, int *type);
+ if (HPMHooks.count.HP_clif_class_change_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *class_, int *type, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_class_change_pre[hIndex].func;
- preHookFunc(bl, &class_, &type);
+ preHookFunc(&bl, &class_, &type, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.class_change(bl, class_, type);
+ HPMHooks.source.clif.class_change(bl, class_, type, sd);
}
- if( HPMHooks.count.HP_clif_class_change_post ) {
- void (*postHookFunc) (struct block_list *bl, int *class_, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_class_change_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int class_, int type, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_class_change_post[hIndex].func;
- postHookFunc(bl, &class_, &type);
+ postHookFunc(bl, class_, type, sd);
}
}
return;
}
void HP_clif_skill_delunit(struct skill_unit *su) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_delunit_pre ) {
- void (*preHookFunc) (struct skill_unit *su);
+ if (HPMHooks.count.HP_clif_skill_delunit_pre > 0) {
+ void (*preHookFunc) (struct skill_unit **su);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_delunit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_delunit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_delunit_pre[hIndex].func;
- preHookFunc(su);
+ preHookFunc(&su);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7881,9 +7960,9 @@ void HP_clif_skill_delunit(struct skill_unit *su) {
{
HPMHooks.source.clif.skill_delunit(su);
}
- if( HPMHooks.count.HP_clif_skill_delunit_post ) {
+ if (HPMHooks.count.HP_clif_skill_delunit_post > 0) {
void (*postHookFunc) (struct skill_unit *su);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_delunit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_delunit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_delunit_post[hIndex].func;
postHookFunc(su);
}
@@ -7892,14 +7971,14 @@ void HP_clif_skill_delunit(struct skill_unit *su) {
}
void HP_clif_skillunit_update(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skillunit_update_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_skillunit_update_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillunit_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillunit_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skillunit_update_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7907,9 +7986,9 @@ void HP_clif_skillunit_update(struct block_list *bl) {
{
HPMHooks.source.clif.skillunit_update(bl);
}
- if( HPMHooks.count.HP_clif_skillunit_update_post ) {
+ if (HPMHooks.count.HP_clif_skillunit_update_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillunit_update_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillunit_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skillunit_update_post[hIndex].func;
postHookFunc(bl);
}
@@ -7919,14 +7998,14 @@ void HP_clif_skillunit_update(struct block_list *bl) {
int HP_clif_clearunit_delayed_sub(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_clearunit_delayed_sub_pre ) {
+ if (HPMHooks.count.HP_clif_clearunit_delayed_sub_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearunit_delayed_sub_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -7934,25 +8013,25 @@ int HP_clif_clearunit_delayed_sub(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.clif.clearunit_delayed_sub(tid, tick, id, data);
}
- if( HPMHooks.count.HP_clif_clearunit_delayed_sub_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearunit_delayed_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearunit_delayed_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearunit_delayed_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_clif_set_unit_idle(struct block_list *bl, struct map_session_data *tsd, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_set_unit_idle_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct map_session_data *tsd, enum send_target *target);
+ if (HPMHooks.count.HP_clif_set_unit_idle_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct map_session_data **tsd, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_set_unit_idle_pre[hIndex].func;
- preHookFunc(bl, tsd, &target);
+ preHookFunc(&bl, &tsd, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7960,25 +8039,25 @@ void HP_clif_set_unit_idle(struct block_list *bl, struct map_session_data *tsd,
{
HPMHooks.source.clif.set_unit_idle(bl, tsd, target);
}
- if( HPMHooks.count.HP_clif_set_unit_idle_post ) {
- void (*postHookFunc) (struct block_list *bl, struct map_session_data *tsd, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_set_unit_idle_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct map_session_data *tsd, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_set_unit_idle_post[hIndex].func;
- postHookFunc(bl, tsd, &target);
+ postHookFunc(bl, tsd, target);
}
}
return;
}
void HP_clif_spawn_unit(struct block_list *bl, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_spawn_unit_pre ) {
- void (*preHookFunc) (struct block_list *bl, enum send_target *target);
+ if (HPMHooks.count.HP_clif_spawn_unit_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spawn_unit_pre[hIndex].func;
- preHookFunc(bl, &target);
+ preHookFunc(&bl, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -7986,25 +8065,25 @@ void HP_clif_spawn_unit(struct block_list *bl, enum send_target target) {
{
HPMHooks.source.clif.spawn_unit(bl, target);
}
- if( HPMHooks.count.HP_clif_spawn_unit_post ) {
- void (*postHookFunc) (struct block_list *bl, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_spawn_unit_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spawn_unit_post[hIndex].func;
- postHookFunc(bl, &target);
+ postHookFunc(bl, target);
}
}
return;
}
void HP_clif_spawn_unit2(struct block_list *bl, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_spawn_unit2_pre ) {
- void (*preHookFunc) (struct block_list *bl, enum send_target *target);
+ if (HPMHooks.count.HP_clif_spawn_unit2_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spawn_unit2_pre[hIndex].func;
- preHookFunc(bl, &target);
+ preHookFunc(&bl, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8012,25 +8091,25 @@ void HP_clif_spawn_unit2(struct block_list *bl, enum send_target target) {
{
HPMHooks.source.clif.spawn_unit2(bl, target);
}
- if( HPMHooks.count.HP_clif_spawn_unit2_post ) {
- void (*postHookFunc) (struct block_list *bl, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_spawn_unit2_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_unit2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spawn_unit2_post[hIndex].func;
- postHookFunc(bl, &target);
+ postHookFunc(bl, target);
}
}
return;
}
void HP_clif_set_unit_idle2(struct block_list *bl, struct map_session_data *tsd, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_set_unit_idle2_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct map_session_data *tsd, enum send_target *target);
+ if (HPMHooks.count.HP_clif_set_unit_idle2_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct map_session_data **tsd, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_set_unit_idle2_pre[hIndex].func;
- preHookFunc(bl, tsd, &target);
+ preHookFunc(&bl, &tsd, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8038,25 +8117,25 @@ void HP_clif_set_unit_idle2(struct block_list *bl, struct map_session_data *tsd,
{
HPMHooks.source.clif.set_unit_idle2(bl, tsd, target);
}
- if( HPMHooks.count.HP_clif_set_unit_idle2_post ) {
- void (*postHookFunc) (struct block_list *bl, struct map_session_data *tsd, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_set_unit_idle2_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct map_session_data *tsd, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_idle2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_set_unit_idle2_post[hIndex].func;
- postHookFunc(bl, tsd, &target);
+ postHookFunc(bl, tsd, target);
}
}
return;
}
void HP_clif_set_unit_walking(struct block_list *bl, struct map_session_data *tsd, struct unit_data *ud, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_set_unit_walking_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct map_session_data *tsd, struct unit_data *ud, enum send_target *target);
+ if (HPMHooks.count.HP_clif_set_unit_walking_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct map_session_data **tsd, struct unit_data **ud, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_walking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_walking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_set_unit_walking_pre[hIndex].func;
- preHookFunc(bl, tsd, ud, &target);
+ preHookFunc(&bl, &tsd, &ud, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8064,11 +8143,11 @@ void HP_clif_set_unit_walking(struct block_list *bl, struct map_session_data *ts
{
HPMHooks.source.clif.set_unit_walking(bl, tsd, ud, target);
}
- if( HPMHooks.count.HP_clif_set_unit_walking_post ) {
- void (*postHookFunc) (struct block_list *bl, struct map_session_data *tsd, struct unit_data *ud, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_walking_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_set_unit_walking_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct map_session_data *tsd, struct unit_data *ud, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_set_unit_walking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_set_unit_walking_post[hIndex].func;
- postHookFunc(bl, tsd, ud, &target);
+ postHookFunc(bl, tsd, ud, target);
}
}
return;
@@ -8076,14 +8155,14 @@ void HP_clif_set_unit_walking(struct block_list *bl, struct map_session_data *ts
int HP_clif_calc_walkdelay(struct block_list *bl, int delay, int type, int damage, int div_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_calc_walkdelay_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *delay, int *type, int *damage, int *div_);
+ if (HPMHooks.count.HP_clif_calc_walkdelay_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *delay, int *type, int *damage, int *div_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_calc_walkdelay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_calc_walkdelay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_calc_walkdelay_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &delay, &type, &damage, &div_);
+ retVal___ = preHookFunc(&bl, &delay, &type, &damage, &div_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8091,25 +8170,25 @@ int HP_clif_calc_walkdelay(struct block_list *bl, int delay, int type, int damag
{
retVal___ = HPMHooks.source.clif.calc_walkdelay(bl, delay, type, damage, div_);
}
- if( HPMHooks.count.HP_clif_calc_walkdelay_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *delay, int *type, int *damage, int *div_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_calc_walkdelay_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_calc_walkdelay_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int delay, int type, int damage, int div_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_calc_walkdelay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_calc_walkdelay_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &delay, &type, &damage, &div_);
+ retVal___ = postHookFunc(retVal___, bl, delay, type, damage, div_);
}
}
return retVal___;
}
void HP_clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_getareachar_skillunit_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct skill_unit *su, enum send_target *target);
+ if (HPMHooks.count.HP_clif_getareachar_skillunit_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct skill_unit **su, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_skillunit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_skillunit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_getareachar_skillunit_pre[hIndex].func;
- preHookFunc(bl, su, &target);
+ preHookFunc(&bl, &su, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8117,25 +8196,25 @@ void HP_clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *su,
{
HPMHooks.source.clif.getareachar_skillunit(bl, su, target);
}
- if( HPMHooks.count.HP_clif_getareachar_skillunit_post ) {
- void (*postHookFunc) (struct block_list *bl, struct skill_unit *su, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_skillunit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_getareachar_skillunit_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct skill_unit *su, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_skillunit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_getareachar_skillunit_post[hIndex].func;
- postHookFunc(bl, su, &target);
+ postHookFunc(bl, su, target);
}
}
return;
}
void HP_clif_getareachar_unit(struct map_session_data *sd, struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_getareachar_unit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *bl);
+ if (HPMHooks.count.HP_clif_getareachar_unit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_unit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_unit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_getareachar_unit_pre[hIndex].func;
- preHookFunc(sd, bl);
+ preHookFunc(&sd, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8143,9 +8222,9 @@ void HP_clif_getareachar_unit(struct map_session_data *sd, struct block_list *bl
{
HPMHooks.source.clif.getareachar_unit(sd, bl);
}
- if( HPMHooks.count.HP_clif_getareachar_unit_post ) {
+ if (HPMHooks.count.HP_clif_getareachar_unit_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_unit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_unit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_getareachar_unit_post[hIndex].func;
postHookFunc(sd, bl);
}
@@ -8154,14 +8233,14 @@ void HP_clif_getareachar_unit(struct map_session_data *sd, struct block_list *bl
}
void HP_clif_clearchar_skillunit(struct skill_unit *su, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearchar_skillunit_pre ) {
- void (*preHookFunc) (struct skill_unit *su, int *fd);
+ if (HPMHooks.count.HP_clif_clearchar_skillunit_pre > 0) {
+ void (*preHookFunc) (struct skill_unit **su, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchar_skillunit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchar_skillunit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearchar_skillunit_pre[hIndex].func;
- preHookFunc(su, &fd);
+ preHookFunc(&su, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8169,11 +8248,11 @@ void HP_clif_clearchar_skillunit(struct skill_unit *su, int fd) {
{
HPMHooks.source.clif.clearchar_skillunit(su, fd);
}
- if( HPMHooks.count.HP_clif_clearchar_skillunit_post ) {
- void (*postHookFunc) (struct skill_unit *su, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchar_skillunit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearchar_skillunit_post > 0) {
+ void (*postHookFunc) (struct skill_unit *su, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchar_skillunit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearchar_skillunit_post[hIndex].func;
- postHookFunc(su, &fd);
+ postHookFunc(su, fd);
}
}
return;
@@ -8181,16 +8260,16 @@ void HP_clif_clearchar_skillunit(struct skill_unit *su, int fd) {
int HP_clif_getareachar(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_getareachar_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_clif_getareachar_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_clif_getareachar_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8200,9 +8279,9 @@ int HP_clif_getareachar(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.clif.getareachar(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_clif_getareachar_post ) {
+ if (HPMHooks.count.HP_clif_getareachar_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_clif_getareachar_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -8213,14 +8292,14 @@ int HP_clif_getareachar(struct block_list *bl, va_list ap) {
}
void HP_clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_graffiti_entry_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct skill_unit *su, enum send_target *target);
+ if (HPMHooks.count.HP_clif_graffiti_entry_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct skill_unit **su, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_graffiti_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_graffiti_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_graffiti_entry_pre[hIndex].func;
- preHookFunc(bl, su, &target);
+ preHookFunc(&bl, &su, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8228,11 +8307,11 @@ void HP_clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum s
{
HPMHooks.source.clif.graffiti_entry(bl, su, target);
}
- if( HPMHooks.count.HP_clif_graffiti_entry_post ) {
- void (*postHookFunc) (struct block_list *bl, struct skill_unit *su, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_graffiti_entry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_graffiti_entry_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct skill_unit *su, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_graffiti_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_graffiti_entry_post[hIndex].func;
- postHookFunc(bl, su, &target);
+ postHookFunc(bl, su, target);
}
}
return;
@@ -8240,14 +8319,14 @@ void HP_clif_graffiti_entry(struct block_list *bl, struct skill_unit *su, enum s
bool HP_clif_spawn(struct block_list *bl) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_spawn_pre ) {
- bool (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_spawn_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spawn_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8255,9 +8334,9 @@ bool HP_clif_spawn(struct block_list *bl) {
{
retVal___ = HPMHooks.source.clif.spawn(bl);
}
- if( HPMHooks.count.HP_clif_spawn_post ) {
+ if (HPMHooks.count.HP_clif_spawn_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spawn_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -8266,14 +8345,14 @@ bool HP_clif_spawn(struct block_list *bl) {
}
void HP_clif_changemap(struct map_session_data *sd, short m, int x, int y) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changemap_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *m, int *x, int *y);
+ if (HPMHooks.count.HP_clif_changemap_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *m, int *x, int *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changemap_pre[hIndex].func;
- preHookFunc(sd, &m, &x, &y);
+ preHookFunc(&sd, &m, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8281,25 +8360,25 @@ void HP_clif_changemap(struct map_session_data *sd, short m, int x, int y) {
{
HPMHooks.source.clif.changemap(sd, m, x, y);
}
- if( HPMHooks.count.HP_clif_changemap_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *m, int *x, int *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changemap_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short m, int x, int y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changemap_post[hIndex].func;
- postHookFunc(sd, &m, &x, &y);
+ postHookFunc(sd, m, x, y);
}
}
return;
}
void HP_clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changemapcell_pre ) {
+ if (HPMHooks.count.HP_clif_changemapcell_pre > 0) {
void (*preHookFunc) (int *fd, int16 *m, int *x, int *y, int *type, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapcell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapcell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changemapcell_pre[hIndex].func;
preHookFunc(&fd, &m, &x, &y, &type, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8307,25 +8386,25 @@ void HP_clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_ta
{
HPMHooks.source.clif.changemapcell(fd, m, x, y, type, target);
}
- if( HPMHooks.count.HP_clif_changemapcell_post ) {
- void (*postHookFunc) (int *fd, int16 *m, int *x, int *y, int *type, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapcell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changemapcell_post > 0) {
+ void (*postHookFunc) (int fd, int16 m, int x, int y, int type, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapcell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changemapcell_post[hIndex].func;
- postHookFunc(&fd, &m, &x, &y, &type, &target);
+ postHookFunc(fd, m, x, y, type, target);
}
}
return;
}
void HP_clif_map_property(struct map_session_data *sd, enum map_property property) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_map_property_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum map_property *property);
+ if (HPMHooks.count.HP_clif_map_property_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum map_property *property);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_map_property_pre[hIndex].func;
- preHookFunc(sd, &property);
+ preHookFunc(&sd, &property);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8333,25 +8412,25 @@ void HP_clif_map_property(struct map_session_data *sd, enum map_property propert
{
HPMHooks.source.clif.map_property(sd, property);
}
- if( HPMHooks.count.HP_clif_map_property_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum map_property *property);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_map_property_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum map_property property);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_map_property_post[hIndex].func;
- postHookFunc(sd, &property);
+ postHookFunc(sd, property);
}
}
return;
}
void HP_clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pvpset_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *pvprank, int *pvpnum, int *type);
+ if (HPMHooks.count.HP_clif_pvpset_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *pvprank, int *pvpnum, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pvpset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pvpset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pvpset_pre[hIndex].func;
- preHookFunc(sd, &pvprank, &pvpnum, &type);
+ preHookFunc(&sd, &pvprank, &pvpnum, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8359,25 +8438,25 @@ void HP_clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum, int ty
{
HPMHooks.source.clif.pvpset(sd, pvprank, pvpnum, type);
}
- if( HPMHooks.count.HP_clif_pvpset_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *pvprank, int *pvpnum, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pvpset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pvpset_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int pvprank, int pvpnum, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pvpset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pvpset_post[hIndex].func;
- postHookFunc(sd, &pvprank, &pvpnum, &type);
+ postHookFunc(sd, pvprank, pvpnum, type);
}
}
return;
}
void HP_clif_map_property_mapall(int mapid, enum map_property property) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_map_property_mapall_pre ) {
+ if (HPMHooks.count.HP_clif_map_property_mapall_pre > 0) {
void (*preHookFunc) (int *mapid, enum map_property *property);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_mapall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_mapall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_map_property_mapall_pre[hIndex].func;
preHookFunc(&mapid, &property);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8385,25 +8464,25 @@ void HP_clif_map_property_mapall(int mapid, enum map_property property) {
{
HPMHooks.source.clif.map_property_mapall(mapid, property);
}
- if( HPMHooks.count.HP_clif_map_property_mapall_post ) {
- void (*postHookFunc) (int *mapid, enum map_property *property);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_mapall_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_map_property_mapall_post > 0) {
+ void (*postHookFunc) (int mapid, enum map_property property);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_property_mapall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_map_property_mapall_post[hIndex].func;
- postHookFunc(&mapid, &property);
+ postHookFunc(mapid, property);
}
}
return;
}
void HP_clif_bossmapinfo(int fd, struct mob_data *md, short flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bossmapinfo_pre ) {
- void (*preHookFunc) (int *fd, struct mob_data *md, short *flag);
+ if (HPMHooks.count.HP_clif_bossmapinfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct mob_data **md, short *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bossmapinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bossmapinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bossmapinfo_pre[hIndex].func;
- preHookFunc(&fd, md, &flag);
+ preHookFunc(&fd, &md, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8411,25 +8490,25 @@ void HP_clif_bossmapinfo(int fd, struct mob_data *md, short flag) {
{
HPMHooks.source.clif.bossmapinfo(fd, md, flag);
}
- if( HPMHooks.count.HP_clif_bossmapinfo_post ) {
- void (*postHookFunc) (int *fd, struct mob_data *md, short *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bossmapinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bossmapinfo_post > 0) {
+ void (*postHookFunc) (int fd, struct mob_data *md, short flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bossmapinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bossmapinfo_post[hIndex].func;
- postHookFunc(&fd, md, &flag);
+ postHookFunc(fd, md, flag);
}
}
return;
}
void HP_clif_map_type(struct map_session_data *sd, enum map_type type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_map_type_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum map_type *type);
+ if (HPMHooks.count.HP_clif_map_type_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum map_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_map_type_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8437,25 +8516,25 @@ void HP_clif_map_type(struct map_session_data *sd, enum map_type type) {
{
HPMHooks.source.clif.map_type(sd, type);
}
- if( HPMHooks.count.HP_clif_map_type_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum map_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_map_type_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum map_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_map_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_map_type_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_maptypeproperty2(struct block_list *bl, enum send_target t) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_maptypeproperty2_pre ) {
- void (*preHookFunc) (struct block_list *bl, enum send_target *t);
+ if (HPMHooks.count.HP_clif_maptypeproperty2_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, enum send_target *t);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_maptypeproperty2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_maptypeproperty2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_maptypeproperty2_pre[hIndex].func;
- preHookFunc(bl, &t);
+ preHookFunc(&bl, &t);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8463,25 +8542,25 @@ void HP_clif_maptypeproperty2(struct block_list *bl, enum send_target t) {
{
HPMHooks.source.clif.maptypeproperty2(bl, t);
}
- if( HPMHooks.count.HP_clif_maptypeproperty2_post ) {
- void (*postHookFunc) (struct block_list *bl, enum send_target *t);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_maptypeproperty2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_maptypeproperty2_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, enum send_target t);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_maptypeproperty2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_maptypeproperty2_post[hIndex].func;
- postHookFunc(bl, &t);
+ postHookFunc(bl, t);
}
}
return;
}
void HP_clif_changemapserver(struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changemapserver_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *map_index, int *x, int *y, uint32 *ip, uint16 *port);
+ if (HPMHooks.count.HP_clif_changemapserver_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *map_index, int *x, int *y, uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapserver_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapserver_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changemapserver_pre[hIndex].func;
- preHookFunc(sd, &map_index, &x, &y, &ip, &port);
+ preHookFunc(&sd, &map_index, &x, &y, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8489,25 +8568,25 @@ void HP_clif_changemapserver(struct map_session_data *sd, unsigned short map_ind
{
HPMHooks.source.clif.changemapserver(sd, map_index, x, y, ip, port);
}
- if( HPMHooks.count.HP_clif_changemapserver_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *map_index, int *x, int *y, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapserver_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changemapserver_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changemapserver_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changemapserver_post[hIndex].func;
- postHookFunc(sd, &map_index, &x, &y, &ip, &port);
+ postHookFunc(sd, map_index, x, y, ip, port);
}
}
return;
}
void HP_clif_npcbuysell(struct map_session_data *sd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_npcbuysell_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *id);
+ if (HPMHooks.count.HP_clif_npcbuysell_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npcbuysell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npcbuysell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_npcbuysell_pre[hIndex].func;
- preHookFunc(sd, &id);
+ preHookFunc(&sd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8515,25 +8594,25 @@ void HP_clif_npcbuysell(struct map_session_data *sd, int id) {
{
HPMHooks.source.clif.npcbuysell(sd, id);
}
- if( HPMHooks.count.HP_clif_npcbuysell_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npcbuysell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_npcbuysell_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npcbuysell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_npcbuysell_post[hIndex].func;
- postHookFunc(sd, &id);
+ postHookFunc(sd, id);
}
}
return;
}
void HP_clif_buylist(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buylist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_clif_buylist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buylist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buylist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buylist_pre[hIndex].func;
- preHookFunc(sd, nd);
+ preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8541,9 +8620,9 @@ void HP_clif_buylist(struct map_session_data *sd, struct npc_data *nd) {
{
HPMHooks.source.clif.buylist(sd, nd);
}
- if( HPMHooks.count.HP_clif_buylist_post ) {
+ if (HPMHooks.count.HP_clif_buylist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buylist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buylist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buylist_post[hIndex].func;
postHookFunc(sd, nd);
}
@@ -8552,14 +8631,14 @@ void HP_clif_buylist(struct map_session_data *sd, struct npc_data *nd) {
}
void HP_clif_selllist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_selllist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_selllist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_selllist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_selllist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_selllist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8567,9 +8646,9 @@ void HP_clif_selllist(struct map_session_data *sd) {
{
HPMHooks.source.clif.selllist(sd);
}
- if( HPMHooks.count.HP_clif_selllist_post ) {
+ if (HPMHooks.count.HP_clif_selllist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_selllist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_selllist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_selllist_post[hIndex].func;
postHookFunc(sd);
}
@@ -8578,14 +8657,14 @@ void HP_clif_selllist(struct map_session_data *sd) {
}
void HP_clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cashshop_show_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_clif_cashshop_show_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_show_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_show_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cashshop_show_pre[hIndex].func;
- preHookFunc(sd, nd);
+ preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8593,9 +8672,9 @@ void HP_clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd) {
{
HPMHooks.source.clif.cashshop_show(sd, nd);
}
- if( HPMHooks.count.HP_clif_cashshop_show_post ) {
+ if (HPMHooks.count.HP_clif_cashshop_show_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_show_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_show_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cashshop_show_post[hIndex].func;
postHookFunc(sd, nd);
}
@@ -8604,14 +8683,14 @@ void HP_clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd) {
}
void HP_clif_npc_buy_result(struct map_session_data *sd, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_npc_buy_result_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *result);
+ if (HPMHooks.count.HP_clif_npc_buy_result_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_buy_result_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_buy_result_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_npc_buy_result_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8619,25 +8698,25 @@ void HP_clif_npc_buy_result(struct map_session_data *sd, unsigned char result) {
{
HPMHooks.source.clif.npc_buy_result(sd, result);
}
- if( HPMHooks.count.HP_clif_npc_buy_result_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_buy_result_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_npc_buy_result_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_buy_result_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_npc_buy_result_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
void HP_clif_npc_sell_result(struct map_session_data *sd, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_npc_sell_result_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *result);
+ if (HPMHooks.count.HP_clif_npc_sell_result_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_sell_result_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_sell_result_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_npc_sell_result_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8645,25 +8724,25 @@ void HP_clif_npc_sell_result(struct map_session_data *sd, unsigned char result)
{
HPMHooks.source.clif.npc_sell_result(sd, result);
}
- if( HPMHooks.count.HP_clif_npc_sell_result_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_sell_result_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_npc_sell_result_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_sell_result_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_npc_sell_result_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
void HP_clif_cashshop_ack(struct map_session_data *sd, int error) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cashshop_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *error);
+ if (HPMHooks.count.HP_clif_cashshop_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *error);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cashshop_ack_pre[hIndex].func;
- preHookFunc(sd, &error);
+ preHookFunc(&sd, &error);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8671,25 +8750,25 @@ void HP_clif_cashshop_ack(struct map_session_data *sd, int error) {
{
HPMHooks.source.clif.cashshop_ack(sd, error);
}
- if( HPMHooks.count.HP_clif_cashshop_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *error);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cashshop_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int error);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashshop_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cashshop_ack_post[hIndex].func;
- postHookFunc(sd, &error);
+ postHookFunc(sd, error);
}
}
return;
}
void HP_clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptmes_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid, const char *mes);
+ if (HPMHooks.count.HP_clif_scriptmes_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmes_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmes_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptmes_pre[hIndex].func;
- preHookFunc(sd, &npcid, mes);
+ preHookFunc(&sd, &npcid, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8697,25 +8776,25 @@ void HP_clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes)
{
HPMHooks.source.clif.scriptmes(sd, npcid, mes);
}
- if( HPMHooks.count.HP_clif_scriptmes_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmes_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptmes_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmes_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptmes_post[hIndex].func;
- postHookFunc(sd, &npcid, mes);
+ postHookFunc(sd, npcid, mes);
}
}
return;
}
void HP_clif_scriptnext(struct map_session_data *sd, int npcid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptnext_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid);
+ if (HPMHooks.count.HP_clif_scriptnext_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptnext_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptnext_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptnext_pre[hIndex].func;
- preHookFunc(sd, &npcid);
+ preHookFunc(&sd, &npcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8723,25 +8802,25 @@ void HP_clif_scriptnext(struct map_session_data *sd, int npcid) {
{
HPMHooks.source.clif.scriptnext(sd, npcid);
}
- if( HPMHooks.count.HP_clif_scriptnext_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptnext_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptnext_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptnext_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptnext_post[hIndex].func;
- postHookFunc(sd, &npcid);
+ postHookFunc(sd, npcid);
}
}
return;
}
void HP_clif_scriptclose(struct map_session_data *sd, int npcid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptclose_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid);
+ if (HPMHooks.count.HP_clif_scriptclose_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclose_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclose_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptclose_pre[hIndex].func;
- preHookFunc(sd, &npcid);
+ preHookFunc(&sd, &npcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8749,25 +8828,25 @@ void HP_clif_scriptclose(struct map_session_data *sd, int npcid) {
{
HPMHooks.source.clif.scriptclose(sd, npcid);
}
- if( HPMHooks.count.HP_clif_scriptclose_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclose_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptclose_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclose_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptclose_post[hIndex].func;
- postHookFunc(sd, &npcid);
+ postHookFunc(sd, npcid);
}
}
return;
}
void HP_clif_scriptmenu(struct map_session_data *sd, int npcid, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptmenu_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid, const char *mes);
+ if (HPMHooks.count.HP_clif_scriptmenu_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmenu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmenu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptmenu_pre[hIndex].func;
- preHookFunc(sd, &npcid, mes);
+ preHookFunc(&sd, &npcid, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8775,25 +8854,25 @@ void HP_clif_scriptmenu(struct map_session_data *sd, int npcid, const char *mes)
{
HPMHooks.source.clif.scriptmenu(sd, npcid, mes);
}
- if( HPMHooks.count.HP_clif_scriptmenu_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmenu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptmenu_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptmenu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptmenu_post[hIndex].func;
- postHookFunc(sd, &npcid, mes);
+ postHookFunc(sd, npcid, mes);
}
}
return;
}
void HP_clif_scriptinput(struct map_session_data *sd, int npcid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptinput_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid);
+ if (HPMHooks.count.HP_clif_scriptinput_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinput_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinput_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptinput_pre[hIndex].func;
- preHookFunc(sd, &npcid);
+ preHookFunc(&sd, &npcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8801,25 +8880,25 @@ void HP_clif_scriptinput(struct map_session_data *sd, int npcid) {
{
HPMHooks.source.clif.scriptinput(sd, npcid);
}
- if( HPMHooks.count.HP_clif_scriptinput_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinput_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptinput_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinput_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptinput_post[hIndex].func;
- postHookFunc(sd, &npcid);
+ postHookFunc(sd, npcid);
}
}
return;
}
void HP_clif_scriptinputstr(struct map_session_data *sd, int npcid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptinputstr_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid);
+ if (HPMHooks.count.HP_clif_scriptinputstr_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinputstr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinputstr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptinputstr_pre[hIndex].func;
- preHookFunc(sd, &npcid);
+ preHookFunc(&sd, &npcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8827,25 +8906,25 @@ void HP_clif_scriptinputstr(struct map_session_data *sd, int npcid) {
{
HPMHooks.source.clif.scriptinputstr(sd, npcid);
}
- if( HPMHooks.count.HP_clif_scriptinputstr_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinputstr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptinputstr_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptinputstr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptinputstr_post[hIndex].func;
- postHookFunc(sd, &npcid);
+ postHookFunc(sd, npcid);
}
}
return;
}
void HP_clif_cutin(struct map_session_data *sd, const char *image, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cutin_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *image, int *type);
+ if (HPMHooks.count.HP_clif_cutin_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **image, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cutin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cutin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cutin_pre[hIndex].func;
- preHookFunc(sd, image, &type);
+ preHookFunc(&sd, &image, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8853,25 +8932,25 @@ void HP_clif_cutin(struct map_session_data *sd, const char *image, int type) {
{
HPMHooks.source.clif.cutin(sd, image, type);
}
- if( HPMHooks.count.HP_clif_cutin_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *image, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cutin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cutin_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *image, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cutin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cutin_post[hIndex].func;
- postHookFunc(sd, image, &type);
+ postHookFunc(sd, image, type);
}
}
return;
}
void HP_clif_sendfakenpc(struct map_session_data *sd, int npcid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sendfakenpc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid);
+ if (HPMHooks.count.HP_clif_sendfakenpc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendfakenpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendfakenpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sendfakenpc_pre[hIndex].func;
- preHookFunc(sd, &npcid);
+ preHookFunc(&sd, &npcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8879,25 +8958,25 @@ void HP_clif_sendfakenpc(struct map_session_data *sd, int npcid) {
{
HPMHooks.source.clif.sendfakenpc(sd, npcid);
}
- if( HPMHooks.count.HP_clif_sendfakenpc_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendfakenpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_sendfakenpc_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendfakenpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sendfakenpc_post[hIndex].func;
- postHookFunc(sd, &npcid);
+ postHookFunc(sd, npcid);
}
}
return;
}
void HP_clif_scriptclear(struct map_session_data *sd, int npcid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_scriptclear_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npcid);
+ if (HPMHooks.count.HP_clif_scriptclear_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_scriptclear_pre[hIndex].func;
- preHookFunc(sd, &npcid);
+ preHookFunc(&sd, &npcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8905,25 +8984,25 @@ void HP_clif_scriptclear(struct map_session_data *sd, int npcid) {
{
HPMHooks.source.clif.scriptclear(sd, npcid);
}
- if( HPMHooks.count.HP_clif_scriptclear_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_scriptclear_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_scriptclear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_scriptclear_post[hIndex].func;
- postHookFunc(sd, &npcid);
+ postHookFunc(sd, npcid);
}
}
return;
}
void HP_clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_viewpoint_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *npc_id, int *type, int *x, int *y, int *id, int *color);
+ if (HPMHooks.count.HP_clif_viewpoint_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *npc_id, int *type, int *x, int *y, int *id, int *color);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewpoint_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewpoint_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_viewpoint_pre[hIndex].func;
- preHookFunc(sd, &npc_id, &type, &x, &y, &id, &color);
+ preHookFunc(&sd, &npc_id, &type, &x, &y, &id, &color);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8931,11 +9010,11 @@ void HP_clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x,
{
HPMHooks.source.clif.viewpoint(sd, npc_id, type, x, y, id, color);
}
- if( HPMHooks.count.HP_clif_viewpoint_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *npc_id, int *type, int *x, int *y, int *id, int *color);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewpoint_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_viewpoint_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewpoint_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_viewpoint_post[hIndex].func;
- postHookFunc(sd, &npc_id, &type, &x, &y, &id, &color);
+ postHookFunc(sd, npc_id, type, x, y, id, color);
}
}
return;
@@ -8943,14 +9022,14 @@ void HP_clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x,
int HP_clif_damage(struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_damage_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *dst, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
+ if (HPMHooks.count.HP_clif_damage_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, dst, &sdelay, &ddelay, &damage, &div, &type, &damage2);
+ retVal___ = preHookFunc(&src, &dst, &sdelay, &ddelay, &damage, &div, &type, &damage2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -8958,25 +9037,25 @@ int HP_clif_damage(struct block_list *src, struct block_list *dst, int sdelay, i
{
retVal___ = HPMHooks.source.clif.damage(src, dst, sdelay, ddelay, damage, div, type, damage2);
}
- if( HPMHooks.count.HP_clif_damage_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_damage_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, dst, &sdelay, &ddelay, &damage, &div, &type, &damage2);
+ retVal___ = postHookFunc(retVal___, src, dst, sdelay, ddelay, damage, div, type, damage2);
}
}
return retVal___;
}
void HP_clif_sitting(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sitting_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_sitting_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sitting_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sitting_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sitting_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -8984,9 +9063,9 @@ void HP_clif_sitting(struct block_list *bl) {
{
HPMHooks.source.clif.sitting(bl);
}
- if( HPMHooks.count.HP_clif_sitting_post ) {
+ if (HPMHooks.count.HP_clif_sitting_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sitting_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sitting_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sitting_post[hIndex].func;
postHookFunc(bl);
}
@@ -8995,14 +9074,14 @@ void HP_clif_sitting(struct block_list *bl) {
}
void HP_clif_standing(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_standing_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_standing_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_standing_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_standing_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_standing_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9010,9 +9089,9 @@ void HP_clif_standing(struct block_list *bl) {
{
HPMHooks.source.clif.standing(bl);
}
- if( HPMHooks.count.HP_clif_standing_post ) {
+ if (HPMHooks.count.HP_clif_standing_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_standing_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_standing_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_standing_post[hIndex].func;
postHookFunc(bl);
}
@@ -9021,14 +9100,14 @@ void HP_clif_standing(struct block_list *bl) {
}
void HP_clif_arrow_create_list(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_arrow_create_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_arrow_create_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_create_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_create_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_arrow_create_list_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9036,9 +9115,9 @@ void HP_clif_arrow_create_list(struct map_session_data *sd) {
{
HPMHooks.source.clif.arrow_create_list(sd);
}
- if( HPMHooks.count.HP_clif_arrow_create_list_post ) {
+ if (HPMHooks.count.HP_clif_arrow_create_list_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_create_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_arrow_create_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_arrow_create_list_post[hIndex].func;
postHookFunc(sd);
}
@@ -9047,14 +9126,14 @@ void HP_clif_arrow_create_list(struct map_session_data *sd) {
}
void HP_clif_refresh_storagewindow(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_refresh_storagewindow_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_refresh_storagewindow_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_storagewindow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_storagewindow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_refresh_storagewindow_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9062,9 +9141,9 @@ void HP_clif_refresh_storagewindow(struct map_session_data *sd) {
{
HPMHooks.source.clif.refresh_storagewindow(sd);
}
- if( HPMHooks.count.HP_clif_refresh_storagewindow_post ) {
+ if (HPMHooks.count.HP_clif_refresh_storagewindow_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_storagewindow_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_storagewindow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_refresh_storagewindow_post[hIndex].func;
postHookFunc(sd);
}
@@ -9073,14 +9152,14 @@ void HP_clif_refresh_storagewindow(struct map_session_data *sd) {
}
void HP_clif_refresh(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_refresh_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_refresh_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_refresh_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9088,9 +9167,9 @@ void HP_clif_refresh(struct map_session_data *sd) {
{
HPMHooks.source.clif.refresh(sd);
}
- if( HPMHooks.count.HP_clif_refresh_post ) {
+ if (HPMHooks.count.HP_clif_refresh_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refresh_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_refresh_post[hIndex].func;
postHookFunc(sd);
}
@@ -9099,14 +9178,14 @@ void HP_clif_refresh(struct map_session_data *sd) {
}
void HP_clif_fame_blacksmith(struct map_session_data *sd, int points) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_fame_blacksmith_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *points);
+ if (HPMHooks.count.HP_clif_fame_blacksmith_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_blacksmith_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_blacksmith_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_fame_blacksmith_pre[hIndex].func;
- preHookFunc(sd, &points);
+ preHookFunc(&sd, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9114,25 +9193,25 @@ void HP_clif_fame_blacksmith(struct map_session_data *sd, int points) {
{
HPMHooks.source.clif.fame_blacksmith(sd, points);
}
- if( HPMHooks.count.HP_clif_fame_blacksmith_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_blacksmith_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_fame_blacksmith_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_blacksmith_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_fame_blacksmith_post[hIndex].func;
- postHookFunc(sd, &points);
+ postHookFunc(sd, points);
}
}
return;
}
void HP_clif_fame_alchemist(struct map_session_data *sd, int points) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_fame_alchemist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *points);
+ if (HPMHooks.count.HP_clif_fame_alchemist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_alchemist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_alchemist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_fame_alchemist_pre[hIndex].func;
- preHookFunc(sd, &points);
+ preHookFunc(&sd, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9140,25 +9219,25 @@ void HP_clif_fame_alchemist(struct map_session_data *sd, int points) {
{
HPMHooks.source.clif.fame_alchemist(sd, points);
}
- if( HPMHooks.count.HP_clif_fame_alchemist_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_alchemist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_fame_alchemist_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_alchemist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_fame_alchemist_post[hIndex].func;
- postHookFunc(sd, &points);
+ postHookFunc(sd, points);
}
}
return;
}
void HP_clif_fame_taekwon(struct map_session_data *sd, int points) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_fame_taekwon_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *points);
+ if (HPMHooks.count.HP_clif_fame_taekwon_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_taekwon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_taekwon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_fame_taekwon_pre[hIndex].func;
- preHookFunc(sd, &points);
+ preHookFunc(&sd, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9166,25 +9245,25 @@ void HP_clif_fame_taekwon(struct map_session_data *sd, int points) {
{
HPMHooks.source.clif.fame_taekwon(sd, points);
}
- if( HPMHooks.count.HP_clif_fame_taekwon_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_taekwon_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_fame_taekwon_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_fame_taekwon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_fame_taekwon_post[hIndex].func;
- postHookFunc(sd, &points);
+ postHookFunc(sd, points);
}
}
return;
}
void HP_clif_ranklist(struct map_session_data *sd, enum fame_list_type type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_ranklist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum fame_list_type *type);
+ if (HPMHooks.count.HP_clif_ranklist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum fame_list_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_ranklist_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9192,25 +9271,25 @@ void HP_clif_ranklist(struct map_session_data *sd, enum fame_list_type type) {
{
HPMHooks.source.clif.ranklist(sd, type);
}
- if( HPMHooks.count.HP_clif_ranklist_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum fame_list_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_ranklist_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum fame_list_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_ranklist_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_update_rankingpoint_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum fame_list_type *type, int *points);
+ if (HPMHooks.count.HP_clif_update_rankingpoint_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum fame_list_type *type, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_update_rankingpoint_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_update_rankingpoint_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_update_rankingpoint_pre[hIndex].func;
- preHookFunc(sd, &type, &points);
+ preHookFunc(&sd, &type, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9218,25 +9297,25 @@ void HP_clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_typ
{
HPMHooks.source.clif.update_rankingpoint(sd, type, points);
}
- if( HPMHooks.count.HP_clif_update_rankingpoint_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum fame_list_type *type, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_update_rankingpoint_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_update_rankingpoint_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum fame_list_type type, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_update_rankingpoint_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_update_rankingpoint_post[hIndex].func;
- postHookFunc(sd, &type, &points);
+ postHookFunc(sd, type, points);
}
}
return;
}
void HP_clif_pRanklist(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRanklist_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRanklist_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRanklist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRanklist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRanklist_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9244,25 +9323,25 @@ void HP_clif_pRanklist(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRanklist(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRanklist_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRanklist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRanklist_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRanklist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRanklist_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_hotkeys(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_hotkeys_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_hotkeys_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeys_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeys_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_hotkeys_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9270,9 +9349,9 @@ void HP_clif_hotkeys(struct map_session_data *sd) {
{
HPMHooks.source.clif.hotkeys(sd);
}
- if( HPMHooks.count.HP_clif_hotkeys_post ) {
+ if (HPMHooks.count.HP_clif_hotkeys_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeys_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeys_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_hotkeys_post[hIndex].func;
postHookFunc(sd);
}
@@ -9282,16 +9361,16 @@ void HP_clif_hotkeys(struct map_session_data *sd) {
int HP_clif_insight(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_insight_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_clif_insight_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_insight_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_insight_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_clif_insight_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9301,9 +9380,9 @@ int HP_clif_insight(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.clif.insight(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_clif_insight_post ) {
+ if (HPMHooks.count.HP_clif_insight_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_insight_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_insight_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_clif_insight_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -9315,16 +9394,16 @@ int HP_clif_insight(struct block_list *bl, va_list ap) {
int HP_clif_outsight(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_outsight_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_clif_outsight_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_outsight_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_outsight_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_clif_outsight_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -9334,9 +9413,9 @@ int HP_clif_outsight(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.clif.outsight(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_clif_outsight_post ) {
+ if (HPMHooks.count.HP_clif_outsight_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_outsight_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_outsight_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_clif_outsight_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -9347,14 +9426,14 @@ int HP_clif_outsight(struct block_list *bl, va_list ap) {
}
void HP_clif_skillcastcancel(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skillcastcancel_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_skillcastcancel_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcastcancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcastcancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skillcastcancel_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9362,9 +9441,9 @@ void HP_clif_skillcastcancel(struct block_list *bl) {
{
HPMHooks.source.clif.skillcastcancel(bl);
}
- if( HPMHooks.count.HP_clif_skillcastcancel_post ) {
+ if (HPMHooks.count.HP_clif_skillcastcancel_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcastcancel_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcastcancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skillcastcancel_post[hIndex].func;
postHookFunc(bl);
}
@@ -9373,14 +9452,14 @@ void HP_clif_skillcastcancel(struct block_list *bl) {
}
void HP_clif_skill_fail(struct map_session_data *sd, uint16 skill_id, enum useskill_fail_cause cause, int btype) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_fail_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, enum useskill_fail_cause *cause, int *btype);
+ if (HPMHooks.count.HP_clif_skill_fail_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, enum useskill_fail_cause *cause, int *btype);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_fail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_fail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_fail_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &cause, &btype);
+ preHookFunc(&sd, &skill_id, &cause, &btype);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9388,25 +9467,25 @@ void HP_clif_skill_fail(struct map_session_data *sd, uint16 skill_id, enum usesk
{
HPMHooks.source.clif.skill_fail(sd, skill_id, cause, btype);
}
- if( HPMHooks.count.HP_clif_skill_fail_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, enum useskill_fail_cause *cause, int *btype);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_fail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_fail_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, enum useskill_fail_cause cause, int btype);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_fail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_fail_post[hIndex].func;
- postHookFunc(sd, &skill_id, &cause, &btype);
+ postHookFunc(sd, skill_id, cause, btype);
}
}
return;
}
void HP_clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int duration) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_cooldown_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, unsigned int *duration);
+ if (HPMHooks.count.HP_clif_skill_cooldown_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, unsigned int *duration);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_cooldown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_cooldown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_cooldown_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &duration);
+ preHookFunc(&sd, &skill_id, &duration);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9414,25 +9493,25 @@ void HP_clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsign
{
HPMHooks.source.clif.skill_cooldown(sd, skill_id, duration);
}
- if( HPMHooks.count.HP_clif_skill_cooldown_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, unsigned int *duration);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_cooldown_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_cooldown_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, unsigned int duration);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_cooldown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_cooldown_post[hIndex].func;
- postHookFunc(sd, &skill_id, &duration);
+ postHookFunc(sd, skill_id, duration);
}
}
return;
}
void HP_clif_skill_memomessage(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_memomessage_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_skill_memomessage_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_memomessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_memomessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_memomessage_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9440,25 +9519,25 @@ void HP_clif_skill_memomessage(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.skill_memomessage(sd, type);
}
- if( HPMHooks.count.HP_clif_skill_memomessage_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_memomessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_memomessage_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_memomessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_memomessage_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_skill_mapinfomessage(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_mapinfomessage_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_skill_mapinfomessage_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_mapinfomessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_mapinfomessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_mapinfomessage_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9466,25 +9545,25 @@ void HP_clif_skill_mapinfomessage(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.skill_mapinfomessage(sd, type);
}
- if( HPMHooks.count.HP_clif_skill_mapinfomessage_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_mapinfomessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_mapinfomessage_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_mapinfomessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_mapinfomessage_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, int trigger) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_produce_mix_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *skill_id, int *trigger);
+ if (HPMHooks.count.HP_clif_skill_produce_mix_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *skill_id, int *trigger);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_produce_mix_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_produce_mix_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_produce_mix_list_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &trigger);
+ preHookFunc(&sd, &skill_id, &trigger);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9492,25 +9571,25 @@ void HP_clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, i
{
HPMHooks.source.clif.skill_produce_mix_list(sd, skill_id, trigger);
}
- if( HPMHooks.count.HP_clif_skill_produce_mix_list_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *skill_id, int *trigger);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_produce_mix_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_produce_mix_list_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int skill_id, int trigger);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_produce_mix_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_produce_mix_list_post[hIndex].func;
- postHookFunc(sd, &skill_id, &trigger);
+ postHookFunc(sd, skill_id, trigger);
}
}
return;
}
void HP_clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cooking_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *trigger, uint16 *skill_id, int *qty, int *list_type);
+ if (HPMHooks.count.HP_clif_cooking_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *trigger, uint16 *skill_id, int *qty, int *list_type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooking_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooking_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cooking_list_pre[hIndex].func;
- preHookFunc(sd, &trigger, &skill_id, &qty, &list_type);
+ preHookFunc(&sd, &trigger, &skill_id, &qty, &list_type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9518,25 +9597,25 @@ void HP_clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill
{
HPMHooks.source.clif.cooking_list(sd, trigger, skill_id, qty, list_type);
}
- if( HPMHooks.count.HP_clif_cooking_list_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *trigger, uint16 *skill_id, int *qty, int *list_type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooking_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cooking_list_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooking_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cooking_list_post[hIndex].func;
- postHookFunc(sd, &trigger, &skill_id, &qty, &list_type);
+ postHookFunc(sd, trigger, skill_id, qty, list_type);
}
}
return;
}
void HP_clif_autospell(struct map_session_data *sd, uint16 skill_lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_autospell_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_lv);
+ if (HPMHooks.count.HP_clif_autospell_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_autospell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_autospell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_autospell_pre[hIndex].func;
- preHookFunc(sd, &skill_lv);
+ preHookFunc(&sd, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9544,25 +9623,25 @@ void HP_clif_autospell(struct map_session_data *sd, uint16 skill_lv) {
{
HPMHooks.source.clif.autospell(sd, skill_lv);
}
- if( HPMHooks.count.HP_clif_autospell_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_autospell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_autospell_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_autospell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_autospell_post[hIndex].func;
- postHookFunc(sd, &skill_lv);
+ postHookFunc(sd, skill_lv);
}
}
return;
}
void HP_clif_combo_delay(struct block_list *bl, int wait) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_combo_delay_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *wait);
+ if (HPMHooks.count.HP_clif_combo_delay_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *wait);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_combo_delay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_combo_delay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_combo_delay_pre[hIndex].func;
- preHookFunc(bl, &wait);
+ preHookFunc(&bl, &wait);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9570,25 +9649,25 @@ void HP_clif_combo_delay(struct block_list *bl, int wait) {
{
HPMHooks.source.clif.combo_delay(bl, wait);
}
- if( HPMHooks.count.HP_clif_combo_delay_post ) {
- void (*postHookFunc) (struct block_list *bl, int *wait);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_combo_delay_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_combo_delay_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int wait);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_combo_delay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_combo_delay_post[hIndex].func;
- postHookFunc(bl, &wait);
+ postHookFunc(bl, wait);
}
}
return;
}
void HP_clif_status_change(struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_status_change_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type, int *flag, int *tick, int *val1, int *val2, int *val3);
+ if (HPMHooks.count.HP_clif_status_change_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type, int *flag, int *tick, int *val1, int *val2, int *val3);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_status_change_pre[hIndex].func;
- preHookFunc(bl, &type, &flag, &tick, &val1, &val2, &val3);
+ preHookFunc(&bl, &type, &flag, &tick, &val1, &val2, &val3);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9596,25 +9675,25 @@ void HP_clif_status_change(struct block_list *bl, int type, int flag, int tick,
{
HPMHooks.source.clif.status_change(bl, type, flag, tick, val1, val2, val3);
}
- if( HPMHooks.count.HP_clif_status_change_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type, int *flag, int *tick, int *val1, int *val2, int *val3);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_status_change_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_status_change_post[hIndex].func;
- postHookFunc(bl, &type, &flag, &tick, &val1, &val2, &val3);
+ postHookFunc(bl, type, flag, tick, val1, val2, val3);
}
}
return;
}
void HP_clif_insert_card(struct map_session_data *sd, int idx_equip, int idx_card, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_insert_card_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx_equip, int *idx_card, int *flag);
+ if (HPMHooks.count.HP_clif_insert_card_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx_equip, int *idx_card, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_insert_card_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_insert_card_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_insert_card_pre[hIndex].func;
- preHookFunc(sd, &idx_equip, &idx_card, &flag);
+ preHookFunc(&sd, &idx_equip, &idx_card, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9622,25 +9701,25 @@ void HP_clif_insert_card(struct map_session_data *sd, int idx_equip, int idx_car
{
HPMHooks.source.clif.insert_card(sd, idx_equip, idx_card, flag);
}
- if( HPMHooks.count.HP_clif_insert_card_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx_equip, int *idx_card, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_insert_card_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_insert_card_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx_equip, int idx_card, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_insert_card_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_insert_card_post[hIndex].func;
- postHookFunc(sd, &idx_equip, &idx_card, &flag);
+ postHookFunc(sd, idx_equip, idx_card, flag);
}
}
return;
}
void HP_clif_inventorylist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_inventorylist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ 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++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventorylist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_inventorylist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9648,9 +9727,9 @@ void HP_clif_inventorylist(struct map_session_data *sd) {
{
HPMHooks.source.clif.inventorylist(sd);
}
- if( HPMHooks.count.HP_clif_inventorylist_post ) {
+ 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++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventorylist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_inventorylist_post[hIndex].func;
postHookFunc(sd);
}
@@ -9659,14 +9738,14 @@ void HP_clif_inventorylist(struct map_session_data *sd) {
}
void HP_clif_equiplist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_equiplist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ 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++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiplist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_equiplist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9674,9 +9753,9 @@ void HP_clif_equiplist(struct map_session_data *sd) {
{
HPMHooks.source.clif.equiplist(sd);
}
- if( HPMHooks.count.HP_clif_equiplist_post ) {
+ 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++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiplist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_equiplist_post[hIndex].func;
postHookFunc(sd);
}
@@ -9685,14 +9764,14 @@ void HP_clif_equiplist(struct map_session_data *sd) {
}
void HP_clif_cartlist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cartlist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ 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++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cartlist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9700,9 +9779,9 @@ void HP_clif_cartlist(struct map_session_data *sd) {
{
HPMHooks.source.clif.cartlist(sd);
}
- if( HPMHooks.count.HP_clif_cartlist_post ) {
+ 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++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cartlist_post[hIndex].func;
postHookFunc(sd);
}
@@ -9711,14 +9790,14 @@ void HP_clif_cartlist(struct map_session_data *sd) {
}
void HP_clif_favorite_item(struct map_session_data *sd, unsigned short index) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_favorite_item_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *index);
+ if (HPMHooks.count.HP_clif_favorite_item_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_favorite_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_favorite_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_favorite_item_pre[hIndex].func;
- preHookFunc(sd, &index);
+ preHookFunc(&sd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9726,25 +9805,25 @@ void HP_clif_favorite_item(struct map_session_data *sd, unsigned short index) {
{
HPMHooks.source.clif.favorite_item(sd, index);
}
- if( HPMHooks.count.HP_clif_favorite_item_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_favorite_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_favorite_item_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_favorite_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_favorite_item_post[hIndex].func;
- postHookFunc(sd, &index);
+ postHookFunc(sd, index);
}
}
return;
}
void HP_clif_clearcart(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearcart_pre ) {
+ if (HPMHooks.count.HP_clif_clearcart_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearcart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearcart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearcart_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9752,25 +9831,25 @@ void HP_clif_clearcart(int fd) {
{
HPMHooks.source.clif.clearcart(fd);
}
- if( HPMHooks.count.HP_clif_clearcart_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearcart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearcart_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearcart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearcart_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_clif_item_identify_list(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_identify_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_item_identify_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identify_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identify_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_identify_list_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9778,9 +9857,9 @@ void HP_clif_item_identify_list(struct map_session_data *sd) {
{
HPMHooks.source.clif.item_identify_list(sd);
}
- if( HPMHooks.count.HP_clif_item_identify_list_post ) {
+ if (HPMHooks.count.HP_clif_item_identify_list_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identify_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identify_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_identify_list_post[hIndex].func;
postHookFunc(sd);
}
@@ -9789,14 +9868,14 @@ void HP_clif_item_identify_list(struct map_session_data *sd) {
}
void HP_clif_item_identified(struct map_session_data *sd, int idx, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_identified_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx, int *flag);
+ if (HPMHooks.count.HP_clif_item_identified_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identified_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identified_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_identified_pre[hIndex].func;
- preHookFunc(sd, &idx, &flag);
+ preHookFunc(&sd, &idx, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9804,25 +9883,25 @@ void HP_clif_item_identified(struct map_session_data *sd, int idx, int flag) {
{
HPMHooks.source.clif.item_identified(sd, idx, flag);
}
- if( HPMHooks.count.HP_clif_item_identified_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identified_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_identified_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_identified_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_identified_post[hIndex].func;
- postHookFunc(sd, &idx, &flag);
+ postHookFunc(sd, idx, flag);
}
}
return;
}
void HP_clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd, int lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_repair_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *dstsd, int *lv);
+ if (HPMHooks.count.HP_clif_item_repair_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **dstsd, int *lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repair_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repair_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_repair_list_pre[hIndex].func;
- preHookFunc(sd, dstsd, &lv);
+ preHookFunc(&sd, &dstsd, &lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9830,25 +9909,25 @@ void HP_clif_item_repair_list(struct map_session_data *sd, struct map_session_da
{
HPMHooks.source.clif.item_repair_list(sd, dstsd, lv);
}
- if( HPMHooks.count.HP_clif_item_repair_list_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *dstsd, int *lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repair_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_repair_list_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *dstsd, int lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repair_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_repair_list_post[hIndex].func;
- postHookFunc(sd, dstsd, &lv);
+ postHookFunc(sd, dstsd, lv);
}
}
return;
}
void HP_clif_item_repaireffect(struct map_session_data *sd, int idx, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_repaireffect_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx, int *flag);
+ if (HPMHooks.count.HP_clif_item_repaireffect_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repaireffect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repaireffect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_repaireffect_pre[hIndex].func;
- preHookFunc(sd, &idx, &flag);
+ preHookFunc(&sd, &idx, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9856,25 +9935,25 @@ void HP_clif_item_repaireffect(struct map_session_data *sd, int idx, int flag) {
{
HPMHooks.source.clif.item_repaireffect(sd, idx, flag);
}
- if( HPMHooks.count.HP_clif_item_repaireffect_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repaireffect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_repaireffect_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_repaireffect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_repaireffect_post[hIndex].func;
- postHookFunc(sd, &idx, &flag);
+ postHookFunc(sd, idx, flag);
}
}
return;
}
void HP_clif_item_damaged(struct map_session_data *sd, unsigned short position) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_damaged_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *position);
+ if (HPMHooks.count.HP_clif_item_damaged_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *position);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_damaged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_damaged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_damaged_pre[hIndex].func;
- preHookFunc(sd, &position);
+ preHookFunc(&sd, &position);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9882,25 +9961,25 @@ void HP_clif_item_damaged(struct map_session_data *sd, unsigned short position)
{
HPMHooks.source.clif.item_damaged(sd, position);
}
- if( HPMHooks.count.HP_clif_item_damaged_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *position);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_damaged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_damaged_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short position);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_damaged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_damaged_post[hIndex].func;
- postHookFunc(sd, &position);
+ postHookFunc(sd, position);
}
}
return;
}
void HP_clif_item_refine_list(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_refine_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_item_refine_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_refine_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_refine_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_refine_list_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9908,9 +9987,9 @@ void HP_clif_item_refine_list(struct map_session_data *sd) {
{
HPMHooks.source.clif.item_refine_list(sd);
}
- if( HPMHooks.count.HP_clif_item_refine_list_post ) {
+ if (HPMHooks.count.HP_clif_item_refine_list_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_refine_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_refine_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_refine_list_post[hIndex].func;
postHookFunc(sd);
}
@@ -9919,14 +9998,14 @@ void HP_clif_item_refine_list(struct map_session_data *sd) {
}
void HP_clif_item_skill(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_item_skill_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_clif_item_skill_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_item_skill_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &skill_lv);
+ preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9934,25 +10013,25 @@ void HP_clif_item_skill(struct map_session_data *sd, uint16 skill_id, uint16 ski
{
HPMHooks.source.clif.item_skill(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_clif_item_skill_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_skill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_item_skill_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_item_skill_post[hIndex].func;
- postHookFunc(sd, &skill_id, &skill_lv);
+ postHookFunc(sd, skill_id, skill_lv);
}
}
return;
}
void HP_clif_mvp_item(struct map_session_data *sd, int nameid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mvp_item_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_clif_mvp_item_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mvp_item_pre[hIndex].func;
- preHookFunc(sd, &nameid);
+ preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9960,25 +10039,25 @@ void HP_clif_mvp_item(struct map_session_data *sd, int nameid) {
{
HPMHooks.source.clif.mvp_item(sd, nameid);
}
- if( HPMHooks.count.HP_clif_mvp_item_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mvp_item_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mvp_item_post[hIndex].func;
- postHookFunc(sd, &nameid);
+ postHookFunc(sd, nameid);
}
}
return;
}
void HP_clif_mvp_exp(struct map_session_data *sd, unsigned int exp) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mvp_exp_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *exp);
+ if (HPMHooks.count.HP_clif_mvp_exp_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *exp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_exp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_exp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mvp_exp_pre[hIndex].func;
- preHookFunc(sd, &exp);
+ preHookFunc(&sd, &exp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -9986,25 +10065,25 @@ void HP_clif_mvp_exp(struct map_session_data *sd, unsigned int exp) {
{
HPMHooks.source.clif.mvp_exp(sd, exp);
}
- if( HPMHooks.count.HP_clif_mvp_exp_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *exp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_exp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mvp_exp_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int exp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_exp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mvp_exp_post[hIndex].func;
- postHookFunc(sd, &exp);
+ postHookFunc(sd, exp);
}
}
return;
}
void HP_clif_mvp_noitem(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mvp_noitem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_mvp_noitem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_noitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_noitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mvp_noitem_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10012,9 +10091,9 @@ void HP_clif_mvp_noitem(struct map_session_data *sd) {
{
HPMHooks.source.clif.mvp_noitem(sd);
}
- if( HPMHooks.count.HP_clif_mvp_noitem_post ) {
+ if (HPMHooks.count.HP_clif_mvp_noitem_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_noitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_noitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mvp_noitem_post[hIndex].func;
postHookFunc(sd);
}
@@ -10023,14 +10102,14 @@ void HP_clif_mvp_noitem(struct map_session_data *sd) {
}
void HP_clif_changed_dir(struct block_list *bl, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changed_dir_pre ) {
- void (*preHookFunc) (struct block_list *bl, enum send_target *target);
+ if (HPMHooks.count.HP_clif_changed_dir_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changed_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changed_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changed_dir_pre[hIndex].func;
- preHookFunc(bl, &target);
+ preHookFunc(&bl, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10038,25 +10117,25 @@ void HP_clif_changed_dir(struct block_list *bl, enum send_target target) {
{
HPMHooks.source.clif.changed_dir(bl, target);
}
- if( HPMHooks.count.HP_clif_changed_dir_post ) {
- void (*postHookFunc) (struct block_list *bl, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changed_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changed_dir_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changed_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changed_dir_post[hIndex].func;
- postHookFunc(bl, &target);
+ postHookFunc(bl, target);
}
}
return;
}
void HP_clif_charnameack(int fd, struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_charnameack_pre ) {
- void (*preHookFunc) (int *fd, struct block_list *bl);
+ if (HPMHooks.count.HP_clif_charnameack_pre > 0) {
+ void (*preHookFunc) (int *fd, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_charnameack_pre[hIndex].func;
- preHookFunc(&fd, bl);
+ preHookFunc(&fd, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10064,25 +10143,25 @@ void HP_clif_charnameack(int fd, struct block_list *bl) {
{
HPMHooks.source.clif.charnameack(fd, bl);
}
- if( HPMHooks.count.HP_clif_charnameack_post ) {
- void (*postHookFunc) (int *fd, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_charnameack_post > 0) {
+ void (*postHookFunc) (int fd, struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_charnameack_post[hIndex].func;
- postHookFunc(&fd, bl);
+ postHookFunc(fd, bl);
}
}
return;
}
void HP_clif_monster_hp_bar(struct mob_data *md, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_monster_hp_bar_pre ) {
- void (*preHookFunc) (struct mob_data *md, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_monster_hp_bar_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_monster_hp_bar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_monster_hp_bar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_monster_hp_bar_pre[hIndex].func;
- preHookFunc(md, sd);
+ preHookFunc(&md, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10090,9 +10169,9 @@ void HP_clif_monster_hp_bar(struct mob_data *md, struct map_session_data *sd) {
{
HPMHooks.source.clif.monster_hp_bar(md, sd);
}
- if( HPMHooks.count.HP_clif_monster_hp_bar_post ) {
+ if (HPMHooks.count.HP_clif_monster_hp_bar_post > 0) {
void (*postHookFunc) (struct mob_data *md, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_monster_hp_bar_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_monster_hp_bar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_monster_hp_bar_post[hIndex].func;
postHookFunc(md, sd);
}
@@ -10102,14 +10181,14 @@ void HP_clif_monster_hp_bar(struct mob_data *md, struct map_session_data *sd) {
int HP_clif_hpmeter(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_hpmeter_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_hpmeter_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_hpmeter_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10117,9 +10196,9 @@ int HP_clif_hpmeter(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.clif.hpmeter(sd);
}
- if( HPMHooks.count.HP_clif_hpmeter_post ) {
+ if (HPMHooks.count.HP_clif_hpmeter_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_hpmeter_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -10128,14 +10207,14 @@ int HP_clif_hpmeter(struct map_session_data *sd) {
}
void HP_clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_hpmeter_single_pre ) {
+ if (HPMHooks.count.HP_clif_hpmeter_single_pre > 0) {
void (*preHookFunc) (int *fd, int *id, unsigned int *hp, unsigned int *maxhp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_hpmeter_single_pre[hIndex].func;
preHookFunc(&fd, &id, &hp, &maxhp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10143,11 +10222,11 @@ void HP_clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp)
{
HPMHooks.source.clif.hpmeter_single(fd, id, hp, maxhp);
}
- if( HPMHooks.count.HP_clif_hpmeter_single_post ) {
- void (*postHookFunc) (int *fd, int *id, unsigned int *hp, unsigned int *maxhp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_hpmeter_single_post > 0) {
+ void (*postHookFunc) (int fd, int id, unsigned int hp, unsigned int maxhp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_hpmeter_single_post[hIndex].func;
- postHookFunc(&fd, &id, &hp, &maxhp);
+ postHookFunc(fd, id, hp, maxhp);
}
}
return;
@@ -10155,16 +10234,16 @@ void HP_clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp)
int HP_clif_hpmeter_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_hpmeter_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_clif_hpmeter_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_clif_hpmeter_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10174,9 +10253,9 @@ int HP_clif_hpmeter_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.clif.hpmeter_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_clif_hpmeter_sub_post ) {
+ if (HPMHooks.count.HP_clif_hpmeter_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hpmeter_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_clif_hpmeter_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -10187,14 +10266,14 @@ int HP_clif_hpmeter_sub(struct block_list *bl, va_list ap) {
}
void HP_clif_upgrademessage(int fd, int result, int item_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_upgrademessage_pre ) {
+ if (HPMHooks.count.HP_clif_upgrademessage_pre > 0) {
void (*preHookFunc) (int *fd, int *result, int *item_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_upgrademessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_upgrademessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_upgrademessage_pre[hIndex].func;
preHookFunc(&fd, &result, &item_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10202,25 +10281,25 @@ void HP_clif_upgrademessage(int fd, int result, int item_id) {
{
HPMHooks.source.clif.upgrademessage(fd, result, item_id);
}
- if( HPMHooks.count.HP_clif_upgrademessage_post ) {
- void (*postHookFunc) (int *fd, int *result, int *item_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_upgrademessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_upgrademessage_post > 0) {
+ void (*postHookFunc) (int fd, int result, int item_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_upgrademessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_upgrademessage_post[hIndex].func;
- postHookFunc(&fd, &result, &item_id);
+ postHookFunc(fd, result, item_id);
}
}
return;
}
void HP_clif_get_weapon_view(struct map_session_data *sd, unsigned short *rhand, unsigned short *lhand) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_get_weapon_view_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *rhand, unsigned short *lhand);
+ if (HPMHooks.count.HP_clif_get_weapon_view_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short **rhand, unsigned short **lhand);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_weapon_view_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_weapon_view_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_get_weapon_view_pre[hIndex].func;
- preHookFunc(sd, rhand, lhand);
+ preHookFunc(&sd, &rhand, &lhand);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10228,9 +10307,9 @@ void HP_clif_get_weapon_view(struct map_session_data *sd, unsigned short *rhand,
{
HPMHooks.source.clif.get_weapon_view(sd, rhand, lhand);
}
- if( HPMHooks.count.HP_clif_get_weapon_view_post ) {
+ if (HPMHooks.count.HP_clif_get_weapon_view_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, unsigned short *rhand, unsigned short *lhand);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_weapon_view_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_weapon_view_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_get_weapon_view_post[hIndex].func;
postHookFunc(sd, rhand, lhand);
}
@@ -10239,14 +10318,14 @@ void HP_clif_get_weapon_view(struct map_session_data *sd, unsigned short *rhand,
}
void HP_clif_gospel_info(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_gospel_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_gospel_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_gospel_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_gospel_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_gospel_info_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10254,25 +10333,25 @@ void HP_clif_gospel_info(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.gospel_info(sd, type);
}
- if( HPMHooks.count.HP_clif_gospel_info_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_gospel_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_gospel_info_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_gospel_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_gospel_info_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_feel_req_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd, uint16 *skill_lv);
+ if (HPMHooks.count.HP_clif_feel_req_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_req_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_req_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_feel_req_pre[hIndex].func;
- preHookFunc(&fd, sd, &skill_lv);
+ preHookFunc(&fd, &sd, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10280,25 +10359,25 @@ void HP_clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv) {
{
HPMHooks.source.clif.feel_req(fd, sd, skill_lv);
}
- if( HPMHooks.count.HP_clif_feel_req_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_req_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_feel_req_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_req_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_feel_req_post[hIndex].func;
- postHookFunc(&fd, sd, &skill_lv);
+ postHookFunc(fd, sd, skill_lv);
}
}
return;
}
void HP_clif_starskill(struct map_session_data *sd, const char *mapname, int monster_id, unsigned char star, unsigned char result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_starskill_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *mapname, int *monster_id, unsigned char *star, unsigned char *result);
+ if (HPMHooks.count.HP_clif_starskill_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **mapname, int *monster_id, unsigned char *star, unsigned char *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_starskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_starskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_starskill_pre[hIndex].func;
- preHookFunc(sd, mapname, &monster_id, &star, &result);
+ preHookFunc(&sd, &mapname, &monster_id, &star, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10306,25 +10385,25 @@ void HP_clif_starskill(struct map_session_data *sd, const char *mapname, int mon
{
HPMHooks.source.clif.starskill(sd, mapname, monster_id, star, result);
}
- if( HPMHooks.count.HP_clif_starskill_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *mapname, int *monster_id, unsigned char *star, unsigned char *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_starskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_starskill_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *mapname, int monster_id, unsigned char star, unsigned char result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_starskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_starskill_post[hIndex].func;
- postHookFunc(sd, mapname, &monster_id, &star, &result);
+ postHookFunc(sd, mapname, monster_id, star, result);
}
}
return;
}
void HP_clif_feel_info(struct map_session_data *sd, unsigned char feel_level, unsigned char type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_feel_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *feel_level, unsigned char *type);
+ if (HPMHooks.count.HP_clif_feel_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *feel_level, unsigned char *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_feel_info_pre[hIndex].func;
- preHookFunc(sd, &feel_level, &type);
+ preHookFunc(&sd, &feel_level, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10332,25 +10411,25 @@ void HP_clif_feel_info(struct map_session_data *sd, unsigned char feel_level, un
{
HPMHooks.source.clif.feel_info(sd, feel_level, type);
}
- if( HPMHooks.count.HP_clif_feel_info_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *feel_level, unsigned char *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_feel_info_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char feel_level, unsigned char type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_feel_info_post[hIndex].func;
- postHookFunc(sd, &feel_level, &type);
+ postHookFunc(sd, feel_level, type);
}
}
return;
}
void HP_clif_hate_info(struct map_session_data *sd, unsigned char hate_level, int class_, unsigned char type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_hate_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *hate_level, int *class_, unsigned char *type);
+ if (HPMHooks.count.HP_clif_hate_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *hate_level, int *class_, unsigned char *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hate_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hate_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_hate_info_pre[hIndex].func;
- preHookFunc(sd, &hate_level, &class_, &type);
+ preHookFunc(&sd, &hate_level, &class_, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10358,25 +10437,25 @@ void HP_clif_hate_info(struct map_session_data *sd, unsigned char hate_level, in
{
HPMHooks.source.clif.hate_info(sd, hate_level, class_, type);
}
- if( HPMHooks.count.HP_clif_hate_info_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *hate_level, int *class_, unsigned char *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hate_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_hate_info_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char hate_level, int class_, unsigned char type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hate_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_hate_info_post[hIndex].func;
- postHookFunc(sd, &hate_level, &class_, &type);
+ postHookFunc(sd, hate_level, class_, type);
}
}
return;
}
void HP_clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mission_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *mob_id, unsigned char *progress);
+ if (HPMHooks.count.HP_clif_mission_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *mob_id, unsigned char *progress);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mission_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mission_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mission_info_pre[hIndex].func;
- preHookFunc(sd, &mob_id, &progress);
+ preHookFunc(&sd, &mob_id, &progress);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10384,25 +10463,25 @@ void HP_clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char
{
HPMHooks.source.clif.mission_info(sd, mob_id, progress);
}
- if( HPMHooks.count.HP_clif_mission_info_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *mob_id, unsigned char *progress);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mission_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mission_info_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int mob_id, unsigned char progress);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mission_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mission_info_post[hIndex].func;
- postHookFunc(sd, &mob_id, &progress);
+ postHookFunc(sd, mob_id, progress);
}
}
return;
}
void HP_clif_feel_hate_reset(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_feel_hate_reset_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_feel_hate_reset_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_hate_reset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_hate_reset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_feel_hate_reset_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10410,9 +10489,9 @@ void HP_clif_feel_hate_reset(struct map_session_data *sd) {
{
HPMHooks.source.clif.feel_hate_reset(sd);
}
- if( HPMHooks.count.HP_clif_feel_hate_reset_post ) {
+ if (HPMHooks.count.HP_clif_feel_hate_reset_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_hate_reset_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_feel_hate_reset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_feel_hate_reset_post[hIndex].func;
postHookFunc(sd);
}
@@ -10421,14 +10500,14 @@ void HP_clif_feel_hate_reset(struct map_session_data *sd) {
}
void HP_clif_partytickack(struct map_session_data *sd, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_partytickack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *flag);
+ if (HPMHooks.count.HP_clif_partytickack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_partytickack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_partytickack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_partytickack_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10436,25 +10515,25 @@ void HP_clif_partytickack(struct map_session_data *sd, bool flag) {
{
HPMHooks.source.clif.partytickack(sd, flag);
}
- if( HPMHooks.count.HP_clif_partytickack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_partytickack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_partytickack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_partytickack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_partytickack_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_equiptickack(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_equiptickack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_equiptickack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiptickack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiptickack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_equiptickack_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10462,25 +10541,25 @@ void HP_clif_equiptickack(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.equiptickack(sd, flag);
}
- if( HPMHooks.count.HP_clif_equiptickack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiptickack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_equiptickack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiptickack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_equiptickack_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_viewequip_ack(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_viewequip_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_clif_viewequip_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewequip_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewequip_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_viewequip_ack_pre[hIndex].func;
- preHookFunc(sd, tsd);
+ preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10488,9 +10567,9 @@ void HP_clif_viewequip_ack(struct map_session_data *sd, struct map_session_data
{
HPMHooks.source.clif.viewequip_ack(sd, tsd);
}
- if( HPMHooks.count.HP_clif_viewequip_ack_post ) {
+ if (HPMHooks.count.HP_clif_viewequip_ack_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewequip_ack_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_viewequip_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_viewequip_ack_post[hIndex].func;
postHookFunc(sd, tsd);
}
@@ -10499,14 +10578,14 @@ void HP_clif_viewequip_ack(struct map_session_data *sd, struct map_session_data
}
void HP_clif_equpcheckbox(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_equpcheckbox_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_equpcheckbox_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_equpcheckbox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equpcheckbox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_equpcheckbox_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10514,9 +10593,9 @@ void HP_clif_equpcheckbox(struct map_session_data *sd) {
{
HPMHooks.source.clif.equpcheckbox(sd);
}
- if( HPMHooks.count.HP_clif_equpcheckbox_post ) {
+ if (HPMHooks.count.HP_clif_equpcheckbox_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_equpcheckbox_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equpcheckbox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_equpcheckbox_post[hIndex].func;
postHookFunc(sd);
}
@@ -10525,14 +10604,14 @@ void HP_clif_equpcheckbox(struct map_session_data *sd) {
}
void HP_clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool is_quest) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_displayexp_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *exp, char *type, bool *is_quest);
+ if (HPMHooks.count.HP_clif_displayexp_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *exp, char *type, bool *is_quest);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_displayexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_displayexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_displayexp_pre[hIndex].func;
- preHookFunc(sd, &exp, &type, &is_quest);
+ preHookFunc(&sd, &exp, &type, &is_quest);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10540,25 +10619,25 @@ void HP_clif_displayexp(struct map_session_data *sd, unsigned int exp, char type
{
HPMHooks.source.clif.displayexp(sd, exp, type, is_quest);
}
- if( HPMHooks.count.HP_clif_displayexp_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *exp, char *type, bool *is_quest);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_displayexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_displayexp_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int exp, char type, bool is_quest);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_displayexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_displayexp_post[hIndex].func;
- postHookFunc(sd, &exp, &type, &is_quest);
+ postHookFunc(sd, exp, type, is_quest);
}
}
return;
}
void HP_clif_font(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_font_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_font_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_font_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_font_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_font_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10566,9 +10645,9 @@ void HP_clif_font(struct map_session_data *sd) {
{
HPMHooks.source.clif.font(sd);
}
- if( HPMHooks.count.HP_clif_font_post ) {
+ if (HPMHooks.count.HP_clif_font_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_font_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_font_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_font_post[hIndex].func;
postHookFunc(sd);
}
@@ -10577,14 +10656,14 @@ void HP_clif_font(struct map_session_data *sd) {
}
void HP_clif_progressbar(struct map_session_data *sd, unsigned int color, unsigned int second) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_progressbar_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *color, unsigned int *second);
+ if (HPMHooks.count.HP_clif_progressbar_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *color, unsigned int *second);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_progressbar_pre[hIndex].func;
- preHookFunc(sd, &color, &second);
+ preHookFunc(&sd, &color, &second);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10592,25 +10671,25 @@ void HP_clif_progressbar(struct map_session_data *sd, unsigned int color, unsign
{
HPMHooks.source.clif.progressbar(sd, color, second);
}
- if( HPMHooks.count.HP_clif_progressbar_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *color, unsigned int *second);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_progressbar_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int color, unsigned int second);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_progressbar_post[hIndex].func;
- postHookFunc(sd, &color, &second);
+ postHookFunc(sd, color, second);
}
}
return;
}
void HP_clif_progressbar_abort(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_progressbar_abort_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_progressbar_abort_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_abort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_abort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_progressbar_abort_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10618,9 +10697,9 @@ void HP_clif_progressbar_abort(struct map_session_data *sd) {
{
HPMHooks.source.clif.progressbar_abort(sd);
}
- if( HPMHooks.count.HP_clif_progressbar_abort_post ) {
+ if (HPMHooks.count.HP_clif_progressbar_abort_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_abort_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_progressbar_abort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_progressbar_abort_post[hIndex].func;
postHookFunc(sd);
}
@@ -10629,14 +10708,14 @@ void HP_clif_progressbar_abort(struct map_session_data *sd) {
}
void HP_clif_showdigit(struct map_session_data *sd, unsigned char type, int value) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_showdigit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *type, int *value);
+ if (HPMHooks.count.HP_clif_showdigit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *type, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_showdigit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_showdigit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_showdigit_pre[hIndex].func;
- preHookFunc(sd, &type, &value);
+ preHookFunc(&sd, &type, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10644,11 +10723,11 @@ void HP_clif_showdigit(struct map_session_data *sd, unsigned char type, int valu
{
HPMHooks.source.clif.showdigit(sd, type, value);
}
- if( HPMHooks.count.HP_clif_showdigit_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *type, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_showdigit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_showdigit_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char type, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_showdigit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_showdigit_post[hIndex].func;
- postHookFunc(sd, &type, &value);
+ postHookFunc(sd, type, value);
}
}
return;
@@ -10656,14 +10735,14 @@ void HP_clif_showdigit(struct map_session_data *sd, unsigned char type, int valu
int HP_clif_elementalconverter_list(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_elementalconverter_list_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_elementalconverter_list_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_elementalconverter_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elementalconverter_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_elementalconverter_list_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10671,9 +10750,9 @@ int HP_clif_elementalconverter_list(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.clif.elementalconverter_list(sd);
}
- if( HPMHooks.count.HP_clif_elementalconverter_list_post ) {
+ if (HPMHooks.count.HP_clif_elementalconverter_list_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_elementalconverter_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elementalconverter_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_elementalconverter_list_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -10683,14 +10762,14 @@ int HP_clif_elementalconverter_list(struct map_session_data *sd) {
int HP_clif_spellbook_list(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_spellbook_list_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_spellbook_list_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spellbook_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spellbook_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spellbook_list_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10698,9 +10777,9 @@ int HP_clif_spellbook_list(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.clif.spellbook_list(sd);
}
- if( HPMHooks.count.HP_clif_spellbook_list_post ) {
+ if (HPMHooks.count.HP_clif_spellbook_list_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spellbook_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spellbook_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spellbook_list_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -10710,14 +10789,14 @@ int HP_clif_spellbook_list(struct map_session_data *sd) {
int HP_clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short x, short y) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_magicdecoy_list_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_lv, short *x, short *y);
+ if (HPMHooks.count.HP_clif_magicdecoy_list_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_lv, short *x, short *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_magicdecoy_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_magicdecoy_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_magicdecoy_list_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_lv, &x, &y);
+ retVal___ = preHookFunc(&sd, &skill_lv, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10725,11 +10804,11 @@ int HP_clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short
{
retVal___ = HPMHooks.source.clif.magicdecoy_list(sd, skill_lv, x, y);
}
- if( HPMHooks.count.HP_clif_magicdecoy_list_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_lv, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_magicdecoy_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_magicdecoy_list_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_lv, short x, short y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_magicdecoy_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_magicdecoy_list_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_lv, &x, &y);
+ retVal___ = postHookFunc(retVal___, sd, skill_lv, x, y);
}
}
return retVal___;
@@ -10737,14 +10816,14 @@ int HP_clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short
int HP_clif_poison_list(struct map_session_data *sd, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_poison_list_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_lv);
+ if (HPMHooks.count.HP_clif_poison_list_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_poison_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_poison_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_poison_list_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_lv);
+ retVal___ = preHookFunc(&sd, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10752,11 +10831,11 @@ int HP_clif_poison_list(struct map_session_data *sd, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.clif.poison_list(sd, skill_lv);
}
- if( HPMHooks.count.HP_clif_poison_list_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_poison_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_poison_list_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_poison_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_poison_list_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, skill_lv);
}
}
return retVal___;
@@ -10764,14 +10843,14 @@ int HP_clif_poison_list(struct map_session_data *sd, uint16 skill_lv) {
int HP_clif_autoshadowspell_list(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_autoshadowspell_list_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_autoshadowspell_list_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_autoshadowspell_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_autoshadowspell_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_autoshadowspell_list_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10779,9 +10858,9 @@ int HP_clif_autoshadowspell_list(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.clif.autoshadowspell_list(sd);
}
- if( HPMHooks.count.HP_clif_autoshadowspell_list_post ) {
+ if (HPMHooks.count.HP_clif_autoshadowspell_list_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_autoshadowspell_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_autoshadowspell_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_autoshadowspell_list_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -10791,14 +10870,14 @@ int HP_clif_autoshadowspell_list(struct map_session_data *sd) {
int HP_clif_skill_itemlistwindow(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_skill_itemlistwindow_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_clif_skill_itemlistwindow_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_itemlistwindow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_itemlistwindow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_itemlistwindow_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -10806,25 +10885,25 @@ int HP_clif_skill_itemlistwindow(struct map_session_data *sd, uint16 skill_id, u
{
retVal___ = HPMHooks.source.clif.skill_itemlistwindow(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_clif_skill_itemlistwindow_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_itemlistwindow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_itemlistwindow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_itemlistwindow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_itemlistwindow_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv);
}
}
return retVal___;
}
void HP_clif_sc_load(struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sc_load_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3);
+ if (HPMHooks.count.HP_clif_sc_load_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sc_load_pre[hIndex].func;
- preHookFunc(bl, &tid, &target, &type, &val1, &val2, &val3);
+ preHookFunc(&bl, &tid, &target, &type, &val1, &val2, &val3);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10832,25 +10911,51 @@ void HP_clif_sc_load(struct block_list *bl, int tid, enum send_target target, in
{
HPMHooks.source.clif.sc_load(bl, tid, target, type, val1, val2, val3);
}
- if( HPMHooks.count.HP_clif_sc_load_post ) {
- void (*postHookFunc) (struct block_list *bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_sc_load_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sc_load_post[hIndex].func;
- postHookFunc(bl, &tid, &target, &type, &val1, &val2, &val3);
+ postHookFunc(bl, tid, target, type, val1, val2, val3);
+ }
+ }
+ return;
+}
+void HP_clif_sc_continue(struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_sc_continue_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *tid, enum send_target *target, int *type, int *val1, int *val2, int *val3);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_continue_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_sc_continue_pre[hIndex].func;
+ preHookFunc(&bl, &tid, &target, &type, &val1, &val2, &val3);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.sc_continue(bl, tid, target, type, val1, val2, val3);
+ }
+ if (HPMHooks.count.HP_clif_sc_continue_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_continue_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_sc_continue_post[hIndex].func;
+ postHookFunc(bl, tid, target, type, val1, val2, val3);
}
}
return;
}
void HP_clif_sc_end(struct block_list *bl, int tid, enum send_target target, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sc_end_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *tid, enum send_target *target, int *type);
+ if (HPMHooks.count.HP_clif_sc_end_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *tid, enum send_target *target, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sc_end_pre[hIndex].func;
- preHookFunc(bl, &tid, &target, &type);
+ preHookFunc(&bl, &tid, &target, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10858,25 +10963,25 @@ void HP_clif_sc_end(struct block_list *bl, int tid, enum send_target target, int
{
HPMHooks.source.clif.sc_end(bl, tid, target, type);
}
- if( HPMHooks.count.HP_clif_sc_end_post ) {
- void (*postHookFunc) (struct block_list *bl, int *tid, enum send_target *target, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_sc_end_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int tid, enum send_target target, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sc_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sc_end_post[hIndex].func;
- postHookFunc(bl, &tid, &target, &type);
+ postHookFunc(bl, tid, target, type);
}
}
return;
}
void HP_clif_initialstatus(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_initialstatus_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_initialstatus_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_initialstatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_initialstatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_initialstatus_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10884,9 +10989,9 @@ void HP_clif_initialstatus(struct map_session_data *sd) {
{
HPMHooks.source.clif.initialstatus(sd);
}
- if( HPMHooks.count.HP_clif_initialstatus_post ) {
+ if (HPMHooks.count.HP_clif_initialstatus_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_initialstatus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_initialstatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_initialstatus_post[hIndex].func;
postHookFunc(sd);
}
@@ -10895,14 +11000,14 @@ void HP_clif_initialstatus(struct map_session_data *sd) {
}
void HP_clif_cooldown_list(int fd, struct skill_cd *cd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cooldown_list_pre ) {
- void (*preHookFunc) (int *fd, struct skill_cd *cd);
+ if (HPMHooks.count.HP_clif_cooldown_list_pre > 0) {
+ void (*preHookFunc) (int *fd, struct skill_cd **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooldown_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooldown_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cooldown_list_pre[hIndex].func;
- preHookFunc(&fd, cd);
+ preHookFunc(&fd, &cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10910,25 +11015,25 @@ void HP_clif_cooldown_list(int fd, struct skill_cd *cd) {
{
HPMHooks.source.clif.cooldown_list(fd, cd);
}
- if( HPMHooks.count.HP_clif_cooldown_list_post ) {
- void (*postHookFunc) (int *fd, struct skill_cd *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooldown_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cooldown_list_post > 0) {
+ void (*postHookFunc) (int fd, struct skill_cd *cd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cooldown_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cooldown_list_post[hIndex].func;
- postHookFunc(&fd, cd);
+ postHookFunc(fd, cd);
}
}
return;
}
void HP_clif_updatestatus(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_updatestatus_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_updatestatus_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_updatestatus_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10936,25 +11041,25 @@ void HP_clif_updatestatus(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.updatestatus(sd, type);
}
- if( HPMHooks.count.HP_clif_updatestatus_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestatus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_updatestatus_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_updatestatus_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_changestatus(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changestatus_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_clif_changestatus_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changestatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changestatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changestatus_pre[hIndex].func;
- preHookFunc(sd, &type, &val);
+ preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10962,25 +11067,25 @@ void HP_clif_changestatus(struct map_session_data *sd, int type, int val) {
{
HPMHooks.source.clif.changestatus(sd, type, val);
}
- if( HPMHooks.count.HP_clif_changestatus_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changestatus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_changestatus_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changestatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changestatus_post[hIndex].func;
- postHookFunc(sd, &type, &val);
+ postHookFunc(sd, type, val);
}
}
return;
}
void HP_clif_statusupack(struct map_session_data *sd, int type, int ok, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_statusupack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type, int *ok, int *val);
+ if (HPMHooks.count.HP_clif_statusupack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type, int *ok, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_statusupack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_statusupack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_statusupack_pre[hIndex].func;
- preHookFunc(sd, &type, &ok, &val);
+ preHookFunc(&sd, &type, &ok, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -10988,25 +11093,25 @@ void HP_clif_statusupack(struct map_session_data *sd, int type, int ok, int val)
{
HPMHooks.source.clif.statusupack(sd, type, ok, val);
}
- if( HPMHooks.count.HP_clif_statusupack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type, int *ok, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_statusupack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_statusupack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type, int ok, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_statusupack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_statusupack_post[hIndex].func;
- postHookFunc(sd, &type, &ok, &val);
+ postHookFunc(sd, type, ok, val);
}
}
return;
}
void HP_clif_movetoattack(struct map_session_data *sd, struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_movetoattack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *bl);
+ if (HPMHooks.count.HP_clif_movetoattack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_movetoattack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_movetoattack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_movetoattack_pre[hIndex].func;
- preHookFunc(sd, bl);
+ preHookFunc(&sd, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11014,9 +11119,9 @@ void HP_clif_movetoattack(struct map_session_data *sd, struct block_list *bl) {
{
HPMHooks.source.clif.movetoattack(sd, bl);
}
- if( HPMHooks.count.HP_clif_movetoattack_post ) {
+ if (HPMHooks.count.HP_clif_movetoattack_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_movetoattack_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_movetoattack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_movetoattack_post[hIndex].func;
postHookFunc(sd, bl);
}
@@ -11025,14 +11130,14 @@ void HP_clif_movetoattack(struct map_session_data *sd, struct block_list *bl) {
}
void HP_clif_solved_charname(int fd, int charid, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_solved_charname_pre ) {
- void (*preHookFunc) (int *fd, int *charid, const char *name);
+ if (HPMHooks.count.HP_clif_solved_charname_pre > 0) {
+ void (*preHookFunc) (int *fd, int *charid, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_solved_charname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_solved_charname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_solved_charname_pre[hIndex].func;
- preHookFunc(&fd, &charid, name);
+ preHookFunc(&fd, &charid, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11040,25 +11145,25 @@ void HP_clif_solved_charname(int fd, int charid, const char *name) {
{
HPMHooks.source.clif.solved_charname(fd, charid, name);
}
- if( HPMHooks.count.HP_clif_solved_charname_post ) {
- void (*postHookFunc) (int *fd, int *charid, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_solved_charname_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_solved_charname_post > 0) {
+ void (*postHookFunc) (int fd, int charid, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_solved_charname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_solved_charname_post[hIndex].func;
- postHookFunc(&fd, &charid, name);
+ postHookFunc(fd, charid, name);
}
}
return;
}
void HP_clif_charnameupdate(struct map_session_data *ssd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_charnameupdate_pre ) {
- void (*preHookFunc) (struct map_session_data *ssd);
+ if (HPMHooks.count.HP_clif_charnameupdate_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **ssd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameupdate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameupdate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_charnameupdate_pre[hIndex].func;
- preHookFunc(ssd);
+ preHookFunc(&ssd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11066,9 +11171,9 @@ void HP_clif_charnameupdate(struct map_session_data *ssd) {
{
HPMHooks.source.clif.charnameupdate(ssd);
}
- if( HPMHooks.count.HP_clif_charnameupdate_post ) {
+ if (HPMHooks.count.HP_clif_charnameupdate_post > 0) {
void (*postHookFunc) (struct map_session_data *ssd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameupdate_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charnameupdate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_charnameupdate_post[hIndex].func;
postHookFunc(ssd);
}
@@ -11078,14 +11183,14 @@ void HP_clif_charnameupdate(struct map_session_data *ssd) {
int HP_clif_delayquit(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_delayquit_pre ) {
+ if (HPMHooks.count.HP_clif_delayquit_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delayquit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delayquit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_delayquit_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11093,25 +11198,25 @@ int HP_clif_delayquit(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.clif.delayquit(tid, tick, id, data);
}
- if( HPMHooks.count.HP_clif_delayquit_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delayquit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_delayquit_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delayquit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_delayquit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_clif_getareachar_pc(struct map_session_data *sd, struct map_session_data *dstsd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_getareachar_pc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *dstsd);
+ if (HPMHooks.count.HP_clif_getareachar_pc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **dstsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_getareachar_pc_pre[hIndex].func;
- preHookFunc(sd, dstsd);
+ preHookFunc(&sd, &dstsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11119,9 +11224,9 @@ void HP_clif_getareachar_pc(struct map_session_data *sd, struct map_session_data
{
HPMHooks.source.clif.getareachar_pc(sd, dstsd);
}
- if( HPMHooks.count.HP_clif_getareachar_pc_post ) {
+ if (HPMHooks.count.HP_clif_getareachar_pc_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *dstsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_pc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_getareachar_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_getareachar_pc_post[hIndex].func;
postHookFunc(sd, dstsd);
}
@@ -11130,14 +11235,14 @@ void HP_clif_getareachar_pc(struct map_session_data *sd, struct map_session_data
}
void HP_clif_disconnect_ack(struct map_session_data *sd, short result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_disconnect_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *result);
+ if (HPMHooks.count.HP_clif_disconnect_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_disconnect_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disconnect_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_disconnect_ack_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11145,25 +11250,25 @@ void HP_clif_disconnect_ack(struct map_session_data *sd, short result) {
{
HPMHooks.source.clif.disconnect_ack(sd, result);
}
- if( HPMHooks.count.HP_clif_disconnect_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_disconnect_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_disconnect_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disconnect_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_disconnect_ack_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
void HP_clif_PVPInfo(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PVPInfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PVPInfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PVPInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PVPInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PVPInfo_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11171,9 +11276,9 @@ void HP_clif_PVPInfo(struct map_session_data *sd) {
{
HPMHooks.source.clif.PVPInfo(sd);
}
- if( HPMHooks.count.HP_clif_PVPInfo_post ) {
+ if (HPMHooks.count.HP_clif_PVPInfo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PVPInfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PVPInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PVPInfo_post[hIndex].func;
postHookFunc(sd);
}
@@ -11182,14 +11287,14 @@ void HP_clif_PVPInfo(struct map_session_data *sd) {
}
void HP_clif_blacksmith(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_blacksmith_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_blacksmith_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_blacksmith_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_blacksmith_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_blacksmith_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11197,9 +11302,9 @@ void HP_clif_blacksmith(struct map_session_data *sd) {
{
HPMHooks.source.clif.blacksmith(sd);
}
- if( HPMHooks.count.HP_clif_blacksmith_post ) {
+ if (HPMHooks.count.HP_clif_blacksmith_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_blacksmith_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_blacksmith_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_blacksmith_post[hIndex].func;
postHookFunc(sd);
}
@@ -11208,14 +11313,14 @@ void HP_clif_blacksmith(struct map_session_data *sd) {
}
void HP_clif_alchemist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_alchemist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_alchemist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_alchemist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_alchemist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_alchemist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11223,9 +11328,9 @@ void HP_clif_alchemist(struct map_session_data *sd) {
{
HPMHooks.source.clif.alchemist(sd);
}
- if( HPMHooks.count.HP_clif_alchemist_post ) {
+ if (HPMHooks.count.HP_clif_alchemist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_alchemist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_alchemist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_alchemist_post[hIndex].func;
postHookFunc(sd);
}
@@ -11234,14 +11339,14 @@ void HP_clif_alchemist(struct map_session_data *sd) {
}
void HP_clif_taekwon(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_taekwon_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_taekwon_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_taekwon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_taekwon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_taekwon_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11249,9 +11354,9 @@ void HP_clif_taekwon(struct map_session_data *sd) {
{
HPMHooks.source.clif.taekwon(sd);
}
- if( HPMHooks.count.HP_clif_taekwon_post ) {
+ if (HPMHooks.count.HP_clif_taekwon_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_taekwon_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_taekwon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_taekwon_post[hIndex].func;
postHookFunc(sd);
}
@@ -11260,14 +11365,14 @@ void HP_clif_taekwon(struct map_session_data *sd) {
}
void HP_clif_ranking_pk(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_ranking_pk_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_ranking_pk_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranking_pk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranking_pk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_ranking_pk_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11275,9 +11380,9 @@ void HP_clif_ranking_pk(struct map_session_data *sd) {
{
HPMHooks.source.clif.ranking_pk(sd);
}
- if( HPMHooks.count.HP_clif_ranking_pk_post ) {
+ if (HPMHooks.count.HP_clif_ranking_pk_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranking_pk_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranking_pk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_ranking_pk_post[hIndex].func;
postHookFunc(sd);
}
@@ -11286,14 +11391,14 @@ void HP_clif_ranking_pk(struct map_session_data *sd) {
}
void HP_clif_quitsave(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quitsave_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_quitsave_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quitsave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quitsave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quitsave_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11301,25 +11406,25 @@ void HP_clif_quitsave(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.quitsave(fd, sd);
}
- if( HPMHooks.count.HP_clif_quitsave_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quitsave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_quitsave_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quitsave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quitsave_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_misceffect(struct block_list *bl, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_misceffect_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_clif_misceffect_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_misceffect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_misceffect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_misceffect_pre[hIndex].func;
- preHookFunc(bl, &type);
+ preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11327,25 +11432,25 @@ void HP_clif_misceffect(struct block_list *bl, int type) {
{
HPMHooks.source.clif.misceffect(bl, type);
}
- if( HPMHooks.count.HP_clif_misceffect_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_misceffect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_misceffect_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_misceffect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_misceffect_post[hIndex].func;
- postHookFunc(bl, &type);
+ postHookFunc(bl, type);
}
}
return;
}
void HP_clif_changeoption(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changeoption_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_changeoption_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changeoption_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11353,9 +11458,9 @@ void HP_clif_changeoption(struct block_list *bl) {
{
HPMHooks.source.clif.changeoption(bl);
}
- if( HPMHooks.count.HP_clif_changeoption_post ) {
+ if (HPMHooks.count.HP_clif_changeoption_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changeoption_post[hIndex].func;
postHookFunc(bl);
}
@@ -11364,14 +11469,14 @@ void HP_clif_changeoption(struct block_list *bl) {
}
void HP_clif_changeoption2(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changeoption2_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_changeoption2_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changeoption2_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11379,9 +11484,9 @@ void HP_clif_changeoption2(struct block_list *bl) {
{
HPMHooks.source.clif.changeoption2(bl);
}
- if( HPMHooks.count.HP_clif_changeoption2_post ) {
+ if (HPMHooks.count.HP_clif_changeoption2_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changeoption2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changeoption2_post[hIndex].func;
postHookFunc(bl);
}
@@ -11390,14 +11495,14 @@ void HP_clif_changeoption2(struct block_list *bl) {
}
void HP_clif_emotion(struct block_list *bl, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_emotion_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_clif_emotion_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_emotion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_emotion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_emotion_pre[hIndex].func;
- preHookFunc(bl, &type);
+ preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11405,25 +11510,25 @@ void HP_clif_emotion(struct block_list *bl, int type) {
{
HPMHooks.source.clif.emotion(bl, type);
}
- if( HPMHooks.count.HP_clif_emotion_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_emotion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_emotion_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_emotion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_emotion_post[hIndex].func;
- postHookFunc(bl, &type);
+ postHookFunc(bl, type);
}
}
return;
}
void HP_clif_talkiebox(struct block_list *bl, const char *talkie) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_talkiebox_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *talkie);
+ if (HPMHooks.count.HP_clif_talkiebox_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **talkie);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_talkiebox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_talkiebox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_talkiebox_pre[hIndex].func;
- preHookFunc(bl, talkie);
+ preHookFunc(&bl, &talkie);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11431,9 +11536,9 @@ void HP_clif_talkiebox(struct block_list *bl, const char *talkie) {
{
HPMHooks.source.clif.talkiebox(bl, talkie);
}
- if( HPMHooks.count.HP_clif_talkiebox_post ) {
+ if (HPMHooks.count.HP_clif_talkiebox_post > 0) {
void (*postHookFunc) (struct block_list *bl, const char *talkie);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_talkiebox_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_talkiebox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_talkiebox_post[hIndex].func;
postHookFunc(bl, talkie);
}
@@ -11442,14 +11547,14 @@ void HP_clif_talkiebox(struct block_list *bl, const char *talkie) {
}
void HP_clif_wedding_effect(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_wedding_effect_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_wedding_effect_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wedding_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wedding_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_wedding_effect_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11457,9 +11562,9 @@ void HP_clif_wedding_effect(struct block_list *bl) {
{
HPMHooks.source.clif.wedding_effect(bl);
}
- if( HPMHooks.count.HP_clif_wedding_effect_post ) {
+ if (HPMHooks.count.HP_clif_wedding_effect_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wedding_effect_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wedding_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_wedding_effect_post[hIndex].func;
postHookFunc(bl);
}
@@ -11468,14 +11573,14 @@ void HP_clif_wedding_effect(struct block_list *bl) {
}
void HP_clif_divorced(struct map_session_data *sd, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_divorced_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *name);
+ if (HPMHooks.count.HP_clif_divorced_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_divorced_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_divorced_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_divorced_pre[hIndex].func;
- preHookFunc(sd, name);
+ preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11483,9 +11588,9 @@ void HP_clif_divorced(struct map_session_data *sd, const char *name) {
{
HPMHooks.source.clif.divorced(sd, name);
}
- if( HPMHooks.count.HP_clif_divorced_post ) {
+ if (HPMHooks.count.HP_clif_divorced_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_divorced_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_divorced_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_divorced_post[hIndex].func;
postHookFunc(sd, name);
}
@@ -11494,14 +11599,14 @@ void HP_clif_divorced(struct map_session_data *sd, const char *name) {
}
void HP_clif_callpartner(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_callpartner_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_callpartner_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_callpartner_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_callpartner_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_callpartner_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11509,9 +11614,9 @@ void HP_clif_callpartner(struct map_session_data *sd) {
{
HPMHooks.source.clif.callpartner(sd);
}
- if( HPMHooks.count.HP_clif_callpartner_post ) {
+ if (HPMHooks.count.HP_clif_callpartner_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_callpartner_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_callpartner_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_callpartner_post[hIndex].func;
postHookFunc(sd);
}
@@ -11521,14 +11626,14 @@ void HP_clif_callpartner(struct map_session_data *sd) {
int HP_clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_skill_damage_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, int *type);
+ if (HPMHooks.count.HP_clif_skill_damage_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, dst, &tick, &sdelay, &ddelay, &damage, &div, &skill_id, &skill_lv, &type);
+ retVal___ = preHookFunc(&src, &dst, &tick, &sdelay, &ddelay, &damage, &div, &skill_id, &skill_lv, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11536,11 +11641,11 @@ int HP_clif_skill_damage(struct block_list *src, struct block_list *dst, int64 t
{
retVal___ = HPMHooks.source.clif.skill_damage(src, dst, tick, sdelay, ddelay, damage, div, skill_id, skill_lv, type);
}
- if( HPMHooks.count.HP_clif_skill_damage_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int64 *tick, int *sdelay, int *ddelay, int64 *damage, int *div, uint16 *skill_id, uint16 *skill_lv, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_damage_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, dst, &tick, &sdelay, &ddelay, &damage, &div, &skill_id, &skill_lv, &type);
+ retVal___ = postHookFunc(retVal___, src, dst, tick, sdelay, ddelay, damage, div, skill_id, skill_lv, type);
}
}
return retVal___;
@@ -11548,14 +11653,14 @@ int HP_clif_skill_damage(struct block_list *src, struct block_list *dst, int64 t
int HP_clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_skill_nodamage_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *dst, uint16 *skill_id, int *heal, int *fail);
+ if (HPMHooks.count.HP_clif_skill_nodamage_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **dst, uint16 *skill_id, int *heal, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_nodamage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_nodamage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_nodamage_pre[hIndex].func;
- retVal___ = preHookFunc(src, dst, &skill_id, &heal, &fail);
+ retVal___ = preHookFunc(&src, &dst, &skill_id, &heal, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -11563,25 +11668,25 @@ int HP_clif_skill_nodamage(struct block_list *src, struct block_list *dst, uint1
{
retVal___ = HPMHooks.source.clif.skill_nodamage(src, dst, skill_id, heal, fail);
}
- if( HPMHooks.count.HP_clif_skill_nodamage_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, uint16 *skill_id, int *heal, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_nodamage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_nodamage_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *dst, uint16 skill_id, int heal, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_nodamage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_nodamage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, dst, &skill_id, &heal, &fail);
+ retVal___ = postHookFunc(retVal___, src, dst, skill_id, heal, fail);
}
}
return retVal___;
}
void HP_clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_poseffect_pre ) {
- void (*preHookFunc) (struct block_list *src, uint16 *skill_id, int *val, int *x, int *y, int64 *tick);
+ if (HPMHooks.count.HP_clif_skill_poseffect_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, uint16 *skill_id, int *val, int *x, int *y, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_poseffect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_poseffect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_poseffect_pre[hIndex].func;
- preHookFunc(src, &skill_id, &val, &x, &y, &tick);
+ preHookFunc(&src, &skill_id, &val, &x, &y, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11589,25 +11694,25 @@ void HP_clif_skill_poseffect(struct block_list *src, uint16 skill_id, int val, i
{
HPMHooks.source.clif.skill_poseffect(src, skill_id, val, x, y, tick);
}
- if( HPMHooks.count.HP_clif_skill_poseffect_post ) {
- void (*postHookFunc) (struct block_list *src, uint16 *skill_id, int *val, int *x, int *y, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_poseffect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_poseffect_post > 0) {
+ void (*postHookFunc) (struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_poseffect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_poseffect_post[hIndex].func;
- postHookFunc(src, &skill_id, &val, &x, &y, &tick);
+ postHookFunc(src, skill_id, val, x, y, tick);
}
}
return;
}
void HP_clif_skill_estimation(struct map_session_data *sd, struct block_list *dst) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_estimation_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *dst);
+ if (HPMHooks.count.HP_clif_skill_estimation_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **dst);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_estimation_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_estimation_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_estimation_pre[hIndex].func;
- preHookFunc(sd, dst);
+ preHookFunc(&sd, &dst);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11615,9 +11720,9 @@ void HP_clif_skill_estimation(struct map_session_data *sd, struct block_list *ds
{
HPMHooks.source.clif.skill_estimation(sd, dst);
}
- if( HPMHooks.count.HP_clif_skill_estimation_post ) {
+ if (HPMHooks.count.HP_clif_skill_estimation_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct block_list *dst);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_estimation_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_estimation_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_estimation_post[hIndex].func;
postHookFunc(sd, dst);
}
@@ -11626,14 +11731,14 @@ void HP_clif_skill_estimation(struct map_session_data *sd, struct block_list *ds
}
void HP_clif_skill_warppoint(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skill_warppoint_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, unsigned short *map1, unsigned short *map2, unsigned short *map3, unsigned short *map4);
+ if (HPMHooks.count.HP_clif_skill_warppoint_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv, unsigned short *map1, unsigned short *map2, unsigned short *map3, unsigned short *map4);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_warppoint_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_warppoint_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skill_warppoint_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &skill_lv, &map1, &map2, &map3, &map4);
+ preHookFunc(&sd, &skill_id, &skill_lv, &map1, &map2, &map3, &map4);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11641,51 +11746,51 @@ void HP_clif_skill_warppoint(struct map_session_data *sd, uint16 skill_id, uint1
{
HPMHooks.source.clif.skill_warppoint(sd, skill_id, skill_lv, map1, map2, map3, map4);
}
- if( HPMHooks.count.HP_clif_skill_warppoint_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, unsigned short *map1, unsigned short *map2, unsigned short *map3, unsigned short *map4);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_warppoint_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skill_warppoint_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skill_warppoint_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skill_warppoint_post[hIndex].func;
- postHookFunc(sd, &skill_id, &skill_lv, &map1, &map2, &map3, &map4);
+ postHookFunc(sd, skill_id, skill_lv, map1, map2, map3, map4);
}
}
return;
}
-void HP_clif_skillcasting(struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime) {
+void HP_clif_useskill(struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skillcasting_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, int *property, int *casttime);
+ if (HPMHooks.count.HP_clif_useskill_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, uint16 *skill_lv, int *casttime);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcasting_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_clif_skillcasting_pre[hIndex].func;
- preHookFunc(bl, &src_id, &dst_id, &dst_x, &dst_y, &skill_id, &property, &casttime);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_useskill_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_useskill_pre[hIndex].func;
+ preHookFunc(&bl, &src_id, &dst_id, &dst_x, &dst_y, &skill_id, &skill_lv, &casttime);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.skillcasting(bl, src_id, dst_id, dst_x, dst_y, skill_id, property, casttime);
+ HPMHooks.source.clif.useskill(bl, src_id, dst_id, dst_x, dst_y, skill_id, skill_lv, casttime);
}
- if( HPMHooks.count.HP_clif_skillcasting_post ) {
- void (*postHookFunc) (struct block_list *bl, int *src_id, int *dst_id, int *dst_x, int *dst_y, uint16 *skill_id, int *property, int *casttime);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillcasting_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_clif_skillcasting_post[hIndex].func;
- postHookFunc(bl, &src_id, &dst_id, &dst_x, &dst_y, &skill_id, &property, &casttime);
+ if (HPMHooks.count.HP_clif_useskill_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_useskill_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_useskill_post[hIndex].func;
+ postHookFunc(bl, src_id, dst_id, dst_x, dst_y, skill_id, skill_lv, casttime);
}
}
return;
}
void HP_clif_produce_effect(struct map_session_data *sd, int flag, int nameid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_produce_effect_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag, int *nameid);
+ if (HPMHooks.count.HP_clif_produce_effect_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_produce_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_produce_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_produce_effect_pre[hIndex].func;
- preHookFunc(sd, &flag, &nameid);
+ preHookFunc(&sd, &flag, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11693,25 +11798,25 @@ void HP_clif_produce_effect(struct map_session_data *sd, int flag, int nameid) {
{
HPMHooks.source.clif.produce_effect(sd, flag, nameid);
}
- if( HPMHooks.count.HP_clif_produce_effect_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_produce_effect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_produce_effect_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_produce_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_produce_effect_post[hIndex].func;
- postHookFunc(sd, &flag, &nameid);
+ postHookFunc(sd, flag, nameid);
}
}
return;
}
void HP_clif_devotion(struct block_list *src, struct map_session_data *tsd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_devotion_pre ) {
- void (*preHookFunc) (struct block_list *src, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_clif_devotion_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_devotion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_devotion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_devotion_pre[hIndex].func;
- preHookFunc(src, tsd);
+ preHookFunc(&src, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11719,9 +11824,9 @@ void HP_clif_devotion(struct block_list *src, struct map_session_data *tsd) {
{
HPMHooks.source.clif.devotion(src, tsd);
}
- if( HPMHooks.count.HP_clif_devotion_post ) {
+ if (HPMHooks.count.HP_clif_devotion_post > 0) {
void (*postHookFunc) (struct block_list *src, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_devotion_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_devotion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_devotion_post[hIndex].func;
postHookFunc(src, tsd);
}
@@ -11730,14 +11835,14 @@ void HP_clif_devotion(struct block_list *src, struct map_session_data *tsd) {
}
void HP_clif_spiritball(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_spiritball_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_spiritball_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spiritball_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11745,9 +11850,9 @@ void HP_clif_spiritball(struct block_list *bl) {
{
HPMHooks.source.clif.spiritball(bl);
}
- if( HPMHooks.count.HP_clif_spiritball_post ) {
+ if (HPMHooks.count.HP_clif_spiritball_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spiritball_post[hIndex].func;
postHookFunc(bl);
}
@@ -11756,14 +11861,14 @@ void HP_clif_spiritball(struct block_list *bl) {
}
void HP_clif_spiritball_single(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_spiritball_single_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_spiritball_single_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spiritball_single_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11771,25 +11876,25 @@ void HP_clif_spiritball_single(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.spiritball_single(fd, sd);
}
- if( HPMHooks.count.HP_clif_spiritball_single_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_spiritball_single_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritball_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spiritball_single_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_bladestop(struct block_list *src, int dst_id, int active) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bladestop_pre ) {
- void (*preHookFunc) (struct block_list *src, int *dst_id, int *active);
+ if (HPMHooks.count.HP_clif_bladestop_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, int *dst_id, int *active);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bladestop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bladestop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bladestop_pre[hIndex].func;
- preHookFunc(src, &dst_id, &active);
+ preHookFunc(&src, &dst_id, &active);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11797,25 +11902,25 @@ void HP_clif_bladestop(struct block_list *src, int dst_id, int active) {
{
HPMHooks.source.clif.bladestop(src, dst_id, active);
}
- if( HPMHooks.count.HP_clif_bladestop_post ) {
- void (*postHookFunc) (struct block_list *src, int *dst_id, int *active);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bladestop_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bladestop_post > 0) {
+ void (*postHookFunc) (struct block_list *src, int dst_id, int active);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bladestop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bladestop_post[hIndex].func;
- postHookFunc(src, &dst_id, &active);
+ postHookFunc(src, dst_id, active);
}
}
return;
}
void HP_clif_mvp_effect(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mvp_effect_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_mvp_effect_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mvp_effect_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11823,9 +11928,9 @@ void HP_clif_mvp_effect(struct map_session_data *sd) {
{
HPMHooks.source.clif.mvp_effect(sd);
}
- if( HPMHooks.count.HP_clif_mvp_effect_post ) {
+ if (HPMHooks.count.HP_clif_mvp_effect_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_effect_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mvp_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mvp_effect_post[hIndex].func;
postHookFunc(sd);
}
@@ -11834,14 +11939,14 @@ void HP_clif_mvp_effect(struct map_session_data *sd) {
}
void HP_clif_heal(int fd, int type, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_heal_pre ) {
+ if (HPMHooks.count.HP_clif_heal_pre > 0) {
void (*preHookFunc) (int *fd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_heal_pre[hIndex].func;
preHookFunc(&fd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11849,25 +11954,25 @@ void HP_clif_heal(int fd, int type, int val) {
{
HPMHooks.source.clif.heal(fd, type, val);
}
- if( HPMHooks.count.HP_clif_heal_post ) {
- void (*postHookFunc) (int *fd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_heal_post > 0) {
+ void (*postHookFunc) (int fd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_heal_post[hIndex].func;
- postHookFunc(&fd, &type, &val);
+ postHookFunc(fd, type, val);
}
}
return;
}
void HP_clif_resurrection(struct block_list *bl, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_resurrection_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_clif_resurrection_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_resurrection_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_resurrection_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_resurrection_pre[hIndex].func;
- preHookFunc(bl, &type);
+ preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11875,25 +11980,25 @@ void HP_clif_resurrection(struct block_list *bl, int type) {
{
HPMHooks.source.clif.resurrection(bl, type);
}
- if( HPMHooks.count.HP_clif_resurrection_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_resurrection_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_resurrection_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_resurrection_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_resurrection_post[hIndex].func;
- postHookFunc(bl, &type);
+ postHookFunc(bl, type);
}
}
return;
}
void HP_clif_refine(int fd, int fail, int index, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_refine_pre ) {
+ if (HPMHooks.count.HP_clif_refine_pre > 0) {
void (*preHookFunc) (int *fd, int *fail, int *index, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refine_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refine_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_refine_pre[hIndex].func;
preHookFunc(&fd, &fail, &index, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11901,25 +12006,25 @@ void HP_clif_refine(int fd, int fail, int index, int val) {
{
HPMHooks.source.clif.refine(fd, fail, index, val);
}
- if( HPMHooks.count.HP_clif_refine_post ) {
- void (*postHookFunc) (int *fd, int *fail, int *index, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_refine_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_refine_post > 0) {
+ void (*postHookFunc) (int fd, int fail, int index, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_refine_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_refine_post[hIndex].func;
- postHookFunc(&fd, &fail, &index, &val);
+ postHookFunc(fd, fail, index, val);
}
}
return;
}
void HP_clif_weather(int16 m) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_weather_pre ) {
+ if (HPMHooks.count.HP_clif_weather_pre > 0) {
void (*preHookFunc) (int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_weather_pre[hIndex].func;
preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11927,25 +12032,25 @@ void HP_clif_weather(int16 m) {
{
HPMHooks.source.clif.weather(m);
}
- if( HPMHooks.count.HP_clif_weather_post ) {
- void (*postHookFunc) (int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_weather_post > 0) {
+ void (*postHookFunc) (int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_weather_post[hIndex].func;
- postHookFunc(&m);
+ postHookFunc(m);
}
}
return;
}
void HP_clif_specialeffect(struct block_list *bl, int type, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_specialeffect_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type, enum send_target *target);
+ if (HPMHooks.count.HP_clif_specialeffect_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_specialeffect_pre[hIndex].func;
- preHookFunc(bl, &type, &target);
+ preHookFunc(&bl, &type, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11953,25 +12058,25 @@ void HP_clif_specialeffect(struct block_list *bl, int type, enum send_target tar
{
HPMHooks.source.clif.specialeffect(bl, type, target);
}
- if( HPMHooks.count.HP_clif_specialeffect_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_specialeffect_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_specialeffect_post[hIndex].func;
- postHookFunc(bl, &type, &target);
+ postHookFunc(bl, type, target);
}
}
return;
}
void HP_clif_specialeffect_single(struct block_list *bl, int type, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_specialeffect_single_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *type, int *fd);
+ if (HPMHooks.count.HP_clif_specialeffect_single_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_specialeffect_single_pre[hIndex].func;
- preHookFunc(bl, &type, &fd);
+ preHookFunc(&bl, &type, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -11979,25 +12084,25 @@ void HP_clif_specialeffect_single(struct block_list *bl, int type, int fd) {
{
HPMHooks.source.clif.specialeffect_single(bl, type, fd);
}
- if( HPMHooks.count.HP_clif_specialeffect_single_post ) {
- void (*postHookFunc) (struct block_list *bl, int *type, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_specialeffect_single_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_specialeffect_single_post[hIndex].func;
- postHookFunc(bl, &type, &fd);
+ postHookFunc(bl, type, fd);
}
}
return;
}
void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num, send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_specialeffect_value_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *effect_id, int *num, send_target *target);
+ if (HPMHooks.count.HP_clif_specialeffect_value_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *effect_id, int *num, send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_specialeffect_value_pre[hIndex].func;
- preHookFunc(bl, &effect_id, &num, &target);
+ preHookFunc(&bl, &effect_id, &num, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12005,25 +12110,25 @@ void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num,
{
HPMHooks.source.clif.specialeffect_value(bl, effect_id, num, target);
}
- if( HPMHooks.count.HP_clif_specialeffect_value_post ) {
- void (*postHookFunc) (struct block_list *bl, int *effect_id, int *num, send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_specialeffect_value_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int effect_id, int num, send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_specialeffect_value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_specialeffect_value_post[hIndex].func;
- postHookFunc(bl, &effect_id, &num, &target);
+ postHookFunc(bl, effect_id, num, target);
}
}
return;
}
void HP_clif_millenniumshield(struct block_list *bl, short shields) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_millenniumshield_pre ) {
- void (*preHookFunc) (struct block_list *bl, short *shields);
+ if (HPMHooks.count.HP_clif_millenniumshield_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, short *shields);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_millenniumshield_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_millenniumshield_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_millenniumshield_pre[hIndex].func;
- preHookFunc(bl, &shields);
+ preHookFunc(&bl, &shields);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12031,25 +12136,25 @@ void HP_clif_millenniumshield(struct block_list *bl, short shields) {
{
HPMHooks.source.clif.millenniumshield(bl, shields);
}
- if( HPMHooks.count.HP_clif_millenniumshield_post ) {
- void (*postHookFunc) (struct block_list *bl, short *shields);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_millenniumshield_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_millenniumshield_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, short shields);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_millenniumshield_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_millenniumshield_post[hIndex].func;
- postHookFunc(bl, &shields);
+ postHookFunc(bl, shields);
}
}
return;
}
void HP_clif_spiritcharm(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_spiritcharm_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_spiritcharm_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritcharm_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritcharm_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_spiritcharm_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12057,9 +12162,9 @@ void HP_clif_spiritcharm(struct map_session_data *sd) {
{
HPMHooks.source.clif.spiritcharm(sd);
}
- if( HPMHooks.count.HP_clif_spiritcharm_post ) {
+ if (HPMHooks.count.HP_clif_spiritcharm_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritcharm_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_spiritcharm_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_spiritcharm_post[hIndex].func;
postHookFunc(sd);
}
@@ -12068,14 +12173,14 @@ void HP_clif_spiritcharm(struct map_session_data *sd) {
}
void HP_clif_charm_single(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_charm_single_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_charm_single_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charm_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charm_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_charm_single_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12083,25 +12188,25 @@ void HP_clif_charm_single(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.charm_single(fd, sd);
}
- if( HPMHooks.count.HP_clif_charm_single_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_charm_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_charm_single_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_charm_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_charm_single_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_snap(struct block_list *bl, short x, short y) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_snap_pre ) {
- void (*preHookFunc) (struct block_list *bl, short *x, short *y);
+ if (HPMHooks.count.HP_clif_snap_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, short *x, short *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_snap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_snap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_snap_pre[hIndex].func;
- preHookFunc(bl, &x, &y);
+ preHookFunc(&bl, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12109,25 +12214,25 @@ void HP_clif_snap(struct block_list *bl, short x, short y) {
{
HPMHooks.source.clif.snap(bl, x, y);
}
- if( HPMHooks.count.HP_clif_snap_post ) {
- void (*postHookFunc) (struct block_list *bl, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_snap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_snap_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, short x, short y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_snap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_snap_post[hIndex].func;
- postHookFunc(bl, &x, &y);
+ postHookFunc(bl, x, y);
}
}
return;
}
void HP_clif_weather_check(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_weather_check_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_weather_check_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_weather_check_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12135,9 +12240,9 @@ void HP_clif_weather_check(struct map_session_data *sd) {
{
HPMHooks.source.clif.weather_check(sd);
}
- if( HPMHooks.count.HP_clif_weather_check_post ) {
+ if (HPMHooks.count.HP_clif_weather_check_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_weather_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_weather_check_post[hIndex].func;
postHookFunc(sd);
}
@@ -12146,14 +12251,14 @@ void HP_clif_weather_check(struct map_session_data *sd) {
}
void HP_clif_playBGM(struct map_session_data *sd, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_playBGM_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *name);
+ if (HPMHooks.count.HP_clif_playBGM_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_playBGM_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_playBGM_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_playBGM_pre[hIndex].func;
- preHookFunc(sd, name);
+ preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12161,9 +12266,9 @@ void HP_clif_playBGM(struct map_session_data *sd, const char *name) {
{
HPMHooks.source.clif.playBGM(sd, name);
}
- if( HPMHooks.count.HP_clif_playBGM_post ) {
+ if (HPMHooks.count.HP_clif_playBGM_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_playBGM_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_playBGM_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_playBGM_post[hIndex].func;
postHookFunc(sd, name);
}
@@ -12172,14 +12277,14 @@ void HP_clif_playBGM(struct map_session_data *sd, const char *name) {
}
void HP_clif_soundeffect(struct map_session_data *sd, struct block_list *bl, const char *name, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_soundeffect_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *bl, const char *name, int *type);
+ if (HPMHooks.count.HP_clif_soundeffect_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, const char **name, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_soundeffect_pre[hIndex].func;
- preHookFunc(sd, bl, name, &type);
+ preHookFunc(&sd, &bl, &name, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12187,25 +12292,25 @@ void HP_clif_soundeffect(struct map_session_data *sd, struct block_list *bl, con
{
HPMHooks.source.clif.soundeffect(sd, bl, name, type);
}
- if( HPMHooks.count.HP_clif_soundeffect_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl, const char *name, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_soundeffect_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl, const char *name, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_soundeffect_post[hIndex].func;
- postHookFunc(sd, bl, name, &type);
+ postHookFunc(sd, bl, name, type);
}
}
return;
}
void HP_clif_soundeffectall(struct block_list *bl, const char *name, int type, enum send_target coverage) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_soundeffectall_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *name, int *type, enum send_target *coverage);
+ if (HPMHooks.count.HP_clif_soundeffectall_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **name, int *type, enum send_target *coverage);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffectall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffectall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_soundeffectall_pre[hIndex].func;
- preHookFunc(bl, name, &type, &coverage);
+ preHookFunc(&bl, &name, &type, &coverage);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12213,25 +12318,25 @@ void HP_clif_soundeffectall(struct block_list *bl, const char *name, int type, e
{
HPMHooks.source.clif.soundeffectall(bl, name, type, coverage);
}
- if( HPMHooks.count.HP_clif_soundeffectall_post ) {
- void (*postHookFunc) (struct block_list *bl, const char *name, int *type, enum send_target *coverage);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffectall_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_soundeffectall_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, const char *name, int type, enum send_target coverage);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_soundeffectall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_soundeffectall_post[hIndex].func;
- postHookFunc(bl, name, &type, &coverage);
+ postHookFunc(bl, name, type, coverage);
}
}
return;
}
void HP_clif_GlobalMessage(struct block_list *bl, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_GlobalMessage_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *message);
+ if (HPMHooks.count.HP_clif_GlobalMessage_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GlobalMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GlobalMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_GlobalMessage_pre[hIndex].func;
- preHookFunc(bl, message);
+ preHookFunc(&bl, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12239,9 +12344,9 @@ void HP_clif_GlobalMessage(struct block_list *bl, const char *message) {
{
HPMHooks.source.clif.GlobalMessage(bl, message);
}
- if( HPMHooks.count.HP_clif_GlobalMessage_post ) {
+ if (HPMHooks.count.HP_clif_GlobalMessage_post > 0) {
void (*postHookFunc) (struct block_list *bl, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GlobalMessage_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GlobalMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_GlobalMessage_post[hIndex].func;
postHookFunc(bl, message);
}
@@ -12250,14 +12355,14 @@ void HP_clif_GlobalMessage(struct block_list *bl, const char *message) {
}
void HP_clif_createchat(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_createchat_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_createchat_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_createchat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_createchat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_createchat_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12265,25 +12370,25 @@ void HP_clif_createchat(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.createchat(sd, flag);
}
- if( HPMHooks.count.HP_clif_createchat_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_createchat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_createchat_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_createchat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_createchat_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_dispchat(struct chat_data *cd, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_dispchat_pre ) {
- void (*preHookFunc) (struct chat_data *cd, int *fd);
+ if (HPMHooks.count.HP_clif_dispchat_pre > 0) {
+ void (*preHookFunc) (struct chat_data **cd, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dispchat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dispchat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_dispchat_pre[hIndex].func;
- preHookFunc(cd, &fd);
+ preHookFunc(&cd, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12291,25 +12396,25 @@ void HP_clif_dispchat(struct chat_data *cd, int fd) {
{
HPMHooks.source.clif.dispchat(cd, fd);
}
- if( HPMHooks.count.HP_clif_dispchat_post ) {
- void (*postHookFunc) (struct chat_data *cd, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dispchat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_dispchat_post > 0) {
+ void (*postHookFunc) (struct chat_data *cd, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dispchat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_dispchat_post[hIndex].func;
- postHookFunc(cd, &fd);
+ postHookFunc(cd, fd);
}
}
return;
}
void HP_clif_joinchatfail(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_joinchatfail_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_joinchatfail_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatfail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatfail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_joinchatfail_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12317,25 +12422,25 @@ void HP_clif_joinchatfail(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.joinchatfail(sd, flag);
}
- if( HPMHooks.count.HP_clif_joinchatfail_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatfail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_joinchatfail_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatfail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_joinchatfail_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_joinchatok(struct map_session_data *sd, struct chat_data *cd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_joinchatok_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct chat_data *cd);
+ if (HPMHooks.count.HP_clif_joinchatok_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct chat_data **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_joinchatok_pre[hIndex].func;
- preHookFunc(sd, cd);
+ preHookFunc(&sd, &cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12343,9 +12448,9 @@ void HP_clif_joinchatok(struct map_session_data *sd, struct chat_data *cd) {
{
HPMHooks.source.clif.joinchatok(sd, cd);
}
- if( HPMHooks.count.HP_clif_joinchatok_post ) {
+ if (HPMHooks.count.HP_clif_joinchatok_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct chat_data *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatok_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_joinchatok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_joinchatok_post[hIndex].func;
postHookFunc(sd, cd);
}
@@ -12354,14 +12459,14 @@ void HP_clif_joinchatok(struct map_session_data *sd, struct chat_data *cd) {
}
void HP_clif_addchat(struct chat_data *cd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_addchat_pre ) {
- void (*preHookFunc) (struct chat_data *cd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_addchat_pre > 0) {
+ void (*preHookFunc) (struct chat_data **cd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addchat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addchat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_addchat_pre[hIndex].func;
- preHookFunc(cd, sd);
+ preHookFunc(&cd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12369,9 +12474,9 @@ void HP_clif_addchat(struct chat_data *cd, struct map_session_data *sd) {
{
HPMHooks.source.clif.addchat(cd, sd);
}
- if( HPMHooks.count.HP_clif_addchat_post ) {
+ if (HPMHooks.count.HP_clif_addchat_post > 0) {
void (*postHookFunc) (struct chat_data *cd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addchat_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addchat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_addchat_post[hIndex].func;
postHookFunc(cd, sd);
}
@@ -12380,14 +12485,14 @@ void HP_clif_addchat(struct chat_data *cd, struct map_session_data *sd) {
}
void HP_clif_changechatowner(struct chat_data *cd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changechatowner_pre ) {
- void (*preHookFunc) (struct chat_data *cd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_changechatowner_pre > 0) {
+ void (*preHookFunc) (struct chat_data **cd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatowner_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatowner_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changechatowner_pre[hIndex].func;
- preHookFunc(cd, sd);
+ preHookFunc(&cd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12395,9 +12500,9 @@ void HP_clif_changechatowner(struct chat_data *cd, struct map_session_data *sd)
{
HPMHooks.source.clif.changechatowner(cd, sd);
}
- if( HPMHooks.count.HP_clif_changechatowner_post ) {
+ if (HPMHooks.count.HP_clif_changechatowner_post > 0) {
void (*postHookFunc) (struct chat_data *cd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatowner_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatowner_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changechatowner_post[hIndex].func;
postHookFunc(cd, sd);
}
@@ -12406,14 +12511,14 @@ void HP_clif_changechatowner(struct chat_data *cd, struct map_session_data *sd)
}
void HP_clif_clearchat(struct chat_data *cd, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_clearchat_pre ) {
- void (*preHookFunc) (struct chat_data *cd, int *fd);
+ if (HPMHooks.count.HP_clif_clearchat_pre > 0) {
+ void (*preHookFunc) (struct chat_data **cd, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_clearchat_pre[hIndex].func;
- preHookFunc(cd, &fd);
+ preHookFunc(&cd, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12421,25 +12526,25 @@ void HP_clif_clearchat(struct chat_data *cd, int fd) {
{
HPMHooks.source.clif.clearchat(cd, fd);
}
- if( HPMHooks.count.HP_clif_clearchat_post ) {
- void (*postHookFunc) (struct chat_data *cd, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_clearchat_post > 0) {
+ void (*postHookFunc) (struct chat_data *cd, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_clearchat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_clearchat_post[hIndex].func;
- postHookFunc(cd, &fd);
+ postHookFunc(cd, fd);
}
}
return;
}
void HP_clif_leavechat(struct chat_data *cd, struct map_session_data *sd, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_leavechat_pre ) {
- void (*preHookFunc) (struct chat_data *cd, struct map_session_data *sd, bool *flag);
+ if (HPMHooks.count.HP_clif_leavechat_pre > 0) {
+ void (*preHookFunc) (struct chat_data **cd, struct map_session_data **sd, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_leavechat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_leavechat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_leavechat_pre[hIndex].func;
- preHookFunc(cd, sd, &flag);
+ preHookFunc(&cd, &sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12447,25 +12552,25 @@ void HP_clif_leavechat(struct chat_data *cd, struct map_session_data *sd, bool f
{
HPMHooks.source.clif.leavechat(cd, sd, flag);
}
- if( HPMHooks.count.HP_clif_leavechat_post ) {
- void (*postHookFunc) (struct chat_data *cd, struct map_session_data *sd, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_leavechat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_leavechat_post > 0) {
+ void (*postHookFunc) (struct chat_data *cd, struct map_session_data *sd, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_leavechat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_leavechat_post[hIndex].func;
- postHookFunc(cd, sd, &flag);
+ postHookFunc(cd, sd, flag);
}
}
return;
}
void HP_clif_changechatstatus(struct chat_data *cd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_changechatstatus_pre ) {
- void (*preHookFunc) (struct chat_data *cd);
+ if (HPMHooks.count.HP_clif_changechatstatus_pre > 0) {
+ void (*preHookFunc) (struct chat_data **cd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatstatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatstatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_changechatstatus_pre[hIndex].func;
- preHookFunc(cd);
+ preHookFunc(&cd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12473,25 +12578,25 @@ void HP_clif_changechatstatus(struct chat_data *cd) {
{
HPMHooks.source.clif.changechatstatus(cd);
}
- if( HPMHooks.count.HP_clif_changechatstatus_post ) {
+ if (HPMHooks.count.HP_clif_changechatstatus_post > 0) {
void (*postHookFunc) (struct chat_data *cd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatstatus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_changechatstatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_changechatstatus_post[hIndex].func;
postHookFunc(cd);
}
}
return;
}
-void HP_clif_wis_message(int fd, const char *nick, const char *mes, size_t mes_len) {
+void HP_clif_wis_message(int fd, const char *nick, const char *mes, int mes_len) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_wis_message_pre ) {
- void (*preHookFunc) (int *fd, const char *nick, const char *mes, size_t *mes_len);
+ if (HPMHooks.count.HP_clif_wis_message_pre > 0) {
+ void (*preHookFunc) (int *fd, const char **nick, const char **mes, int *mes_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_wis_message_pre[hIndex].func;
- preHookFunc(&fd, nick, mes, &mes_len);
+ preHookFunc(&fd, &nick, &mes, &mes_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12499,25 +12604,25 @@ void HP_clif_wis_message(int fd, const char *nick, const char *mes, size_t mes_l
{
HPMHooks.source.clif.wis_message(fd, nick, mes, mes_len);
}
- if( HPMHooks.count.HP_clif_wis_message_post ) {
- void (*postHookFunc) (int *fd, const char *nick, const char *mes, size_t *mes_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_wis_message_post > 0) {
+ void (*postHookFunc) (int fd, const char *nick, const char *mes, int mes_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_wis_message_post[hIndex].func;
- postHookFunc(&fd, nick, mes, &mes_len);
+ postHookFunc(fd, nick, mes, mes_len);
}
}
return;
}
void HP_clif_wis_end(int fd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_wis_end_pre ) {
+ if (HPMHooks.count.HP_clif_wis_end_pre > 0) {
void (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_wis_end_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12525,51 +12630,51 @@ void HP_clif_wis_end(int fd, int flag) {
{
HPMHooks.source.clif.wis_end(fd, flag);
}
- if( HPMHooks.count.HP_clif_wis_end_post ) {
- void (*postHookFunc) (int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_wis_end_post > 0) {
+ void (*postHookFunc) (int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wis_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_wis_end_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
-void HP_clif_disp_message(struct block_list *src, const char *mes, size_t len, enum send_target target) {
+void HP_clif_disp_message(struct block_list *src, const char *mes, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_disp_message_pre ) {
- void (*preHookFunc) (struct block_list *src, const char *mes, size_t *len, enum send_target *target);
+ if (HPMHooks.count.HP_clif_disp_message_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, const char **mes, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_disp_message_pre[hIndex].func;
- preHookFunc(src, mes, &len, &target);
+ preHookFunc(&src, &mes, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.disp_message(src, mes, len, target);
+ HPMHooks.source.clif.disp_message(src, mes, target);
}
- if( HPMHooks.count.HP_clif_disp_message_post ) {
- void (*postHookFunc) (struct block_list *src, const char *mes, size_t *len, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_disp_message_post > 0) {
+ void (*postHookFunc) (struct block_list *src, const char *mes, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_disp_message_post[hIndex].func;
- postHookFunc(src, mes, &len, &target);
+ postHookFunc(src, mes, target);
}
}
return;
}
-void HP_clif_broadcast(struct block_list *bl, const char *mes, size_t len, int type, enum send_target target) {
+void HP_clif_broadcast(struct block_list *bl, const char *mes, int len, int type, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_broadcast_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *mes, size_t *len, int *type, enum send_target *target);
+ if (HPMHooks.count.HP_clif_broadcast_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **mes, int *len, int *type, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_broadcast_pre[hIndex].func;
- preHookFunc(bl, mes, &len, &type, &target);
+ preHookFunc(&bl, &mes, &len, &type, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12577,25 +12682,25 @@ void HP_clif_broadcast(struct block_list *bl, const char *mes, size_t len, int t
{
HPMHooks.source.clif.broadcast(bl, mes, len, type, target);
}
- if( HPMHooks.count.HP_clif_broadcast_post ) {
- void (*postHookFunc) (struct block_list *bl, const char *mes, size_t *len, int *type, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_broadcast_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, const char *mes, int len, int type, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_broadcast_post[hIndex].func;
- postHookFunc(bl, mes, &len, &type, &target);
+ postHookFunc(bl, mes, len, type, target);
}
}
return;
}
-void HP_clif_broadcast2(struct block_list *bl, const char *mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target) {
+void HP_clif_broadcast2(struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_broadcast2_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *mes, size_t *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, enum send_target *target);
+ if (HPMHooks.count.HP_clif_broadcast2_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_broadcast2_pre[hIndex].func;
- preHookFunc(bl, mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &target);
+ preHookFunc(&bl, &mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12603,25 +12708,25 @@ void HP_clif_broadcast2(struct block_list *bl, const char *mes, size_t len, unsi
{
HPMHooks.source.clif.broadcast2(bl, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, target);
}
- if( HPMHooks.count.HP_clif_broadcast2_post ) {
- void (*postHookFunc) (struct block_list *bl, const char *mes, size_t *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_broadcast2_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_broadcast2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_broadcast2_post[hIndex].func;
- postHookFunc(bl, mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY, &target);
+ postHookFunc(bl, mes, len, fontColor, fontType, fontSize, fontAlign, fontY, target);
}
}
return;
}
void HP_clif_messagecolor_self(int fd, uint32 color, const char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_messagecolor_self_pre ) {
- void (*preHookFunc) (int *fd, uint32 *color, const char *msg);
+ if (HPMHooks.count.HP_clif_messagecolor_self_pre > 0) {
+ void (*preHookFunc) (int *fd, uint32 *color, const char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_self_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_self_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_messagecolor_self_pre[hIndex].func;
- preHookFunc(&fd, &color, msg);
+ preHookFunc(&fd, &color, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12629,25 +12734,25 @@ void HP_clif_messagecolor_self(int fd, uint32 color, const char *msg) {
{
HPMHooks.source.clif.messagecolor_self(fd, color, msg);
}
- if( HPMHooks.count.HP_clif_messagecolor_self_post ) {
- void (*postHookFunc) (int *fd, uint32 *color, const char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_self_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_messagecolor_self_post > 0) {
+ void (*postHookFunc) (int fd, uint32 color, const char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_self_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_messagecolor_self_post[hIndex].func;
- postHookFunc(&fd, &color, msg);
+ postHookFunc(fd, color, msg);
}
}
return;
}
void HP_clif_messagecolor(struct block_list *bl, uint32 color, const char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_messagecolor_pre ) {
- void (*preHookFunc) (struct block_list *bl, uint32 *color, const char *msg);
+ if (HPMHooks.count.HP_clif_messagecolor_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, uint32 *color, const char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_messagecolor_pre[hIndex].func;
- preHookFunc(bl, &color, msg);
+ preHookFunc(&bl, &color, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12655,25 +12760,25 @@ void HP_clif_messagecolor(struct block_list *bl, uint32 color, const char *msg)
{
HPMHooks.source.clif.messagecolor(bl, color, msg);
}
- if( HPMHooks.count.HP_clif_messagecolor_post ) {
- void (*postHookFunc) (struct block_list *bl, uint32 *color, const char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_messagecolor_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, uint32 color, const char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_messagecolor_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_messagecolor_post[hIndex].func;
- postHookFunc(bl, &color, msg);
+ postHookFunc(bl, color, msg);
}
}
return;
}
void HP_clif_disp_overhead(struct block_list *bl, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_disp_overhead_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *mes);
+ if (HPMHooks.count.HP_clif_disp_overhead_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_overhead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_overhead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_disp_overhead_pre[hIndex].func;
- preHookFunc(bl, mes);
+ preHookFunc(&bl, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12681,9 +12786,9 @@ void HP_clif_disp_overhead(struct block_list *bl, const char *mes) {
{
HPMHooks.source.clif.disp_overhead(bl, mes);
}
- if( HPMHooks.count.HP_clif_disp_overhead_post ) {
+ if (HPMHooks.count.HP_clif_disp_overhead_post > 0) {
void (*postHookFunc) (struct block_list *bl, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_overhead_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_overhead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_disp_overhead_post[hIndex].func;
postHookFunc(bl, mes);
}
@@ -12692,14 +12797,14 @@ void HP_clif_disp_overhead(struct block_list *bl, const char *mes) {
}
void HP_clif_msgtable(struct map_session_data *sd, unsigned short msg_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_msgtable_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *msg_id);
+ if (HPMHooks.count.HP_clif_msgtable_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *msg_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_msgtable_pre[hIndex].func;
- preHookFunc(sd, &msg_id);
+ preHookFunc(&sd, &msg_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12707,25 +12812,25 @@ void HP_clif_msgtable(struct map_session_data *sd, unsigned short msg_id) {
{
HPMHooks.source.clif.msgtable(sd, msg_id);
}
- if( HPMHooks.count.HP_clif_msgtable_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *msg_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_msgtable_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short msg_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_msgtable_post[hIndex].func;
- postHookFunc(sd, &msg_id);
+ postHookFunc(sd, msg_id);
}
}
return;
}
void HP_clif_msgtable_num(struct map_session_data *sd, unsigned short msg_id, int value) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_msgtable_num_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *msg_id, int *value);
+ if (HPMHooks.count.HP_clif_msgtable_num_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *msg_id, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_msgtable_num_pre[hIndex].func;
- preHookFunc(sd, &msg_id, &value);
+ preHookFunc(&sd, &msg_id, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12733,25 +12838,25 @@ void HP_clif_msgtable_num(struct map_session_data *sd, unsigned short msg_id, in
{
HPMHooks.source.clif.msgtable_num(sd, msg_id, value);
}
- if( HPMHooks.count.HP_clif_msgtable_num_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *msg_id, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_msgtable_num_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short msg_id, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_msgtable_num_post[hIndex].func;
- postHookFunc(sd, &msg_id, &value);
+ postHookFunc(sd, msg_id, value);
}
}
return;
}
void HP_clif_msgtable_skill(struct map_session_data *sd, uint16 skill_id, int msg_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_msgtable_skill_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *msg_id);
+ if (HPMHooks.count.HP_clif_msgtable_skill_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, int *msg_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_msgtable_skill_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &msg_id);
+ preHookFunc(&sd, &skill_id, &msg_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12759,25 +12864,25 @@ void HP_clif_msgtable_skill(struct map_session_data *sd, uint16 skill_id, int ms
{
HPMHooks.source.clif.msgtable_skill(sd, skill_id, msg_id);
}
- if( HPMHooks.count.HP_clif_msgtable_skill_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *msg_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_skill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_msgtable_skill_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, int msg_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_msgtable_skill_post[hIndex].func;
- postHookFunc(sd, &skill_id, &msg_id);
+ postHookFunc(sd, skill_id, msg_id);
}
}
return;
}
void HP_clif_message(const int fd, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_message_pre ) {
- void (*preHookFunc) (const int *fd, const char *mes);
+ if (HPMHooks.count.HP_clif_message_pre > 0) {
+ void (*preHookFunc) (const int *fd, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_message_pre[hIndex].func;
- preHookFunc(&fd, mes);
+ preHookFunc(&fd, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12785,25 +12890,25 @@ void HP_clif_message(const int fd, const char *mes) {
{
HPMHooks.source.clif.message(fd, mes);
}
- if( HPMHooks.count.HP_clif_message_post ) {
- void (*postHookFunc) (const int *fd, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_message_post > 0) {
+ void (*postHookFunc) (const int fd, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_message_post[hIndex].func;
- postHookFunc(&fd, mes);
+ postHookFunc(fd, mes);
}
}
return;
}
void HP_clif_messageln(const int fd, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_messageln_pre ) {
- void (*preHookFunc) (const int *fd, const char *mes);
+ if (HPMHooks.count.HP_clif_messageln_pre > 0) {
+ void (*preHookFunc) (const int *fd, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_messageln_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_messageln_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_messageln_pre[hIndex].func;
- preHookFunc(&fd, mes);
+ preHookFunc(&fd, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12811,52 +12916,79 @@ void HP_clif_messageln(const int fd, const char *mes) {
{
HPMHooks.source.clif.messageln(fd, mes);
}
- if( HPMHooks.count.HP_clif_messageln_post ) {
- void (*postHookFunc) (const int *fd, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_messageln_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_messageln_post > 0) {
+ void (*postHookFunc) (const int fd, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_messageln_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_messageln_post[hIndex].func;
- postHookFunc(&fd, mes);
+ postHookFunc(fd, mes);
}
}
return;
}
-bool HP_clif_process_message(struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) {
+const char* HP_clif_process_chat_message(struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_clif_process_chat_message_pre > 0) {
+ const char* (*preHookFunc) (struct map_session_data **sd, const struct packet_chat_message **packet, char **out_buf, int *out_buflen);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_chat_message_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_process_chat_message_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &packet, &out_buf, &out_buflen);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.clif.process_chat_message(sd, packet, out_buf, out_buflen);
+ }
+ if (HPMHooks.count.HP_clif_process_chat_message_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_chat_message_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_process_chat_message_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, packet, out_buf, out_buflen);
+ }
+ }
+ return retVal___;
+}
+bool HP_clif_process_whisper_message(struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_process_message_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_);
+ if (HPMHooks.count.HP_clif_process_whisper_message_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const struct packet_whisper_message **packet, char **out_name, char **out_message, int *out_messagelen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_message_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_clif_process_message_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &format, name_, namelen_, message_, messagelen_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_whisper_message_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_process_whisper_message_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &packet, &out_name, &out_message, &out_messagelen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.clif.process_message(sd, format, name_, namelen_, message_, messagelen_);
+ retVal___ = HPMHooks.source.clif.process_whisper_message(sd, packet, out_name, out_message, out_messagelen);
}
- if( HPMHooks.count.HP_clif_process_message_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_message_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_clif_process_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &format, name_, namelen_, message_, messagelen_);
+ if (HPMHooks.count.HP_clif_process_whisper_message_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_process_whisper_message_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_process_whisper_message_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, packet, out_name, out_message, out_messagelen);
}
}
return retVal___;
}
void HP_clif_wisexin(struct map_session_data *sd, int type, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_wisexin_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type, int *flag);
+ if (HPMHooks.count.HP_clif_wisexin_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisexin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisexin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_wisexin_pre[hIndex].func;
- preHookFunc(sd, &type, &flag);
+ preHookFunc(&sd, &type, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12864,25 +12996,25 @@ void HP_clif_wisexin(struct map_session_data *sd, int type, int flag) {
{
HPMHooks.source.clif.wisexin(sd, type, flag);
}
- if( HPMHooks.count.HP_clif_wisexin_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisexin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_wisexin_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisexin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_wisexin_post[hIndex].func;
- postHookFunc(sd, &type, &flag);
+ postHookFunc(sd, type, flag);
}
}
return;
}
void HP_clif_wisall(struct map_session_data *sd, int type, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_wisall_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type, int *flag);
+ if (HPMHooks.count.HP_clif_wisall_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_wisall_pre[hIndex].func;
- preHookFunc(sd, &type, &flag);
+ preHookFunc(&sd, &type, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12890,25 +13022,25 @@ void HP_clif_wisall(struct map_session_data *sd, int type, int flag) {
{
HPMHooks.source.clif.wisall(sd, type, flag);
}
- if( HPMHooks.count.HP_clif_wisall_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisall_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_wisall_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_wisall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_wisall_post[hIndex].func;
- postHookFunc(sd, &type, &flag);
+ postHookFunc(sd, type, flag);
}
}
return;
}
void HP_clif_PMIgnoreList(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PMIgnoreList_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PMIgnoreList_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PMIgnoreList_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PMIgnoreList_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PMIgnoreList_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12916,9 +13048,9 @@ void HP_clif_PMIgnoreList(struct map_session_data *sd) {
{
HPMHooks.source.clif.PMIgnoreList(sd);
}
- if( HPMHooks.count.HP_clif_PMIgnoreList_post ) {
+ if (HPMHooks.count.HP_clif_PMIgnoreList_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PMIgnoreList_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PMIgnoreList_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PMIgnoreList_post[hIndex].func;
postHookFunc(sd);
}
@@ -12927,14 +13059,14 @@ void HP_clif_PMIgnoreList(struct map_session_data *sd) {
}
void HP_clif_ShowScript(struct block_list *bl, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_ShowScript_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *message);
+ if (HPMHooks.count.HP_clif_ShowScript_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ShowScript_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ShowScript_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_ShowScript_pre[hIndex].func;
- preHookFunc(bl, message);
+ preHookFunc(&bl, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12942,9 +13074,9 @@ void HP_clif_ShowScript(struct block_list *bl, const char *message) {
{
HPMHooks.source.clif.ShowScript(bl, message);
}
- if( HPMHooks.count.HP_clif_ShowScript_post ) {
+ if (HPMHooks.count.HP_clif_ShowScript_post > 0) {
void (*postHookFunc) (struct block_list *bl, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ShowScript_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ShowScript_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_ShowScript_post[hIndex].func;
postHookFunc(bl, message);
}
@@ -12953,14 +13085,14 @@ void HP_clif_ShowScript(struct block_list *bl, const char *message) {
}
void HP_clif_traderequest(struct map_session_data *sd, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_traderequest_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *name);
+ if (HPMHooks.count.HP_clif_traderequest_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_traderequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_traderequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_traderequest_pre[hIndex].func;
- preHookFunc(sd, name);
+ preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12968,9 +13100,9 @@ void HP_clif_traderequest(struct map_session_data *sd, const char *name) {
{
HPMHooks.source.clif.traderequest(sd, name);
}
- if( HPMHooks.count.HP_clif_traderequest_post ) {
+ if (HPMHooks.count.HP_clif_traderequest_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_traderequest_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_traderequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_traderequest_post[hIndex].func;
postHookFunc(sd, name);
}
@@ -12979,14 +13111,14 @@ void HP_clif_traderequest(struct map_session_data *sd, const char *name) {
}
void HP_clif_tradestart(struct map_session_data *sd, uint8 type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradestart_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint8 *type);
+ if (HPMHooks.count.HP_clif_tradestart_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint8 *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradestart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradestart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradestart_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -12994,25 +13126,25 @@ void HP_clif_tradestart(struct map_session_data *sd, uint8 type) {
{
HPMHooks.source.clif.tradestart(sd, type);
}
- if( HPMHooks.count.HP_clif_tradestart_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint8 *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradestart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_tradestart_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint8 type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradestart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradestart_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_tradeadditem(struct map_session_data *sd, struct map_session_data *tsd, int index, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradeadditem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd, int *index, int *amount);
+ if (HPMHooks.count.HP_clif_tradeadditem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeadditem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeadditem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradeadditem_pre[hIndex].func;
- preHookFunc(sd, tsd, &index, &amount);
+ preHookFunc(&sd, &tsd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13020,25 +13152,25 @@ void HP_clif_tradeadditem(struct map_session_data *sd, struct map_session_data *
{
HPMHooks.source.clif.tradeadditem(sd, tsd, index, amount);
}
- if( HPMHooks.count.HP_clif_tradeadditem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeadditem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_tradeadditem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeadditem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradeadditem_post[hIndex].func;
- postHookFunc(sd, tsd, &index, &amount);
+ postHookFunc(sd, tsd, index, amount);
}
}
return;
}
void HP_clif_tradeitemok(struct map_session_data *sd, int index, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradeitemok_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index, int *fail);
+ if (HPMHooks.count.HP_clif_tradeitemok_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeitemok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeitemok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradeitemok_pre[hIndex].func;
- preHookFunc(sd, &index, &fail);
+ preHookFunc(&sd, &index, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13046,25 +13178,25 @@ void HP_clif_tradeitemok(struct map_session_data *sd, int index, int fail) {
{
HPMHooks.source.clif.tradeitemok(sd, index, fail);
}
- if( HPMHooks.count.HP_clif_tradeitemok_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeitemok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_tradeitemok_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeitemok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradeitemok_post[hIndex].func;
- postHookFunc(sd, &index, &fail);
+ postHookFunc(sd, index, fail);
}
}
return;
}
void HP_clif_tradedeal_lock(struct map_session_data *sd, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradedeal_lock_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *fail);
+ if (HPMHooks.count.HP_clif_tradedeal_lock_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradedeal_lock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradedeal_lock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradedeal_lock_pre[hIndex].func;
- preHookFunc(sd, &fail);
+ preHookFunc(&sd, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13072,25 +13204,25 @@ void HP_clif_tradedeal_lock(struct map_session_data *sd, int fail) {
{
HPMHooks.source.clif.tradedeal_lock(sd, fail);
}
- if( HPMHooks.count.HP_clif_tradedeal_lock_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradedeal_lock_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_tradedeal_lock_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradedeal_lock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradedeal_lock_post[hIndex].func;
- postHookFunc(sd, &fail);
+ postHookFunc(sd, fail);
}
}
return;
}
void HP_clif_tradecancelled(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradecancelled_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_tradecancelled_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecancelled_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecancelled_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradecancelled_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13098,9 +13230,9 @@ void HP_clif_tradecancelled(struct map_session_data *sd) {
{
HPMHooks.source.clif.tradecancelled(sd);
}
- if( HPMHooks.count.HP_clif_tradecancelled_post ) {
+ if (HPMHooks.count.HP_clif_tradecancelled_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecancelled_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecancelled_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradecancelled_post[hIndex].func;
postHookFunc(sd);
}
@@ -13109,14 +13241,14 @@ void HP_clif_tradecancelled(struct map_session_data *sd) {
}
void HP_clif_tradecompleted(struct map_session_data *sd, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradecompleted_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *fail);
+ if (HPMHooks.count.HP_clif_tradecompleted_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecompleted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecompleted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradecompleted_pre[hIndex].func;
- preHookFunc(sd, &fail);
+ preHookFunc(&sd, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13124,25 +13256,25 @@ void HP_clif_tradecompleted(struct map_session_data *sd, int fail) {
{
HPMHooks.source.clif.tradecompleted(sd, fail);
}
- if( HPMHooks.count.HP_clif_tradecompleted_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecompleted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_tradecompleted_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradecompleted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradecompleted_post[hIndex].func;
- postHookFunc(sd, &fail);
+ postHookFunc(sd, fail);
}
}
return;
}
void HP_clif_tradeundo(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_tradeundo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_tradeundo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeundo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeundo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_tradeundo_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13150,9 +13282,9 @@ void HP_clif_tradeundo(struct map_session_data *sd) {
{
HPMHooks.source.clif.tradeundo(sd);
}
- if( HPMHooks.count.HP_clif_tradeundo_post ) {
+ if (HPMHooks.count.HP_clif_tradeundo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeundo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_tradeundo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_tradeundo_post[hIndex].func;
postHookFunc(sd);
}
@@ -13161,14 +13293,14 @@ void HP_clif_tradeundo(struct map_session_data *sd) {
}
void HP_clif_openvendingreq(struct map_session_data *sd, int num) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_openvendingreq_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *num);
+ if (HPMHooks.count.HP_clif_openvendingreq_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *num);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvendingreq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvendingreq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_openvendingreq_pre[hIndex].func;
- preHookFunc(sd, &num);
+ preHookFunc(&sd, &num);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13176,25 +13308,25 @@ void HP_clif_openvendingreq(struct map_session_data *sd, int num) {
{
HPMHooks.source.clif.openvendingreq(sd, num);
}
- if( HPMHooks.count.HP_clif_openvendingreq_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *num);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvendingreq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_openvendingreq_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int num);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvendingreq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_openvendingreq_post[hIndex].func;
- postHookFunc(sd, &num);
+ postHookFunc(sd, num);
}
}
return;
}
void HP_clif_showvendingboard(struct block_list *bl, const char *message, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_showvendingboard_pre ) {
- void (*preHookFunc) (struct block_list *bl, const char *message, int *fd);
+ if (HPMHooks.count.HP_clif_showvendingboard_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **message, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_showvendingboard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_showvendingboard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_showvendingboard_pre[hIndex].func;
- preHookFunc(bl, message, &fd);
+ preHookFunc(&bl, &message, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13202,25 +13334,25 @@ void HP_clif_showvendingboard(struct block_list *bl, const char *message, int fd
{
HPMHooks.source.clif.showvendingboard(bl, message, fd);
}
- if( HPMHooks.count.HP_clif_showvendingboard_post ) {
- void (*postHookFunc) (struct block_list *bl, const char *message, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_showvendingboard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_showvendingboard_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, const char *message, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_showvendingboard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_showvendingboard_post[hIndex].func;
- postHookFunc(bl, message, &fd);
+ postHookFunc(bl, message, fd);
}
}
return;
}
void HP_clif_closevendingboard(struct block_list *bl, int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_closevendingboard_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *fd);
+ if (HPMHooks.count.HP_clif_closevendingboard_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_closevendingboard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_closevendingboard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_closevendingboard_pre[hIndex].func;
- preHookFunc(bl, &fd);
+ preHookFunc(&bl, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13228,25 +13360,25 @@ void HP_clif_closevendingboard(struct block_list *bl, int fd) {
{
HPMHooks.source.clif.closevendingboard(bl, fd);
}
- if( HPMHooks.count.HP_clif_closevendingboard_post ) {
- void (*postHookFunc) (struct block_list *bl, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_closevendingboard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_closevendingboard_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_closevendingboard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_closevendingboard_post[hIndex].func;
- postHookFunc(bl, &fd);
+ postHookFunc(bl, fd);
}
}
return;
}
void HP_clif_vendinglist(struct map_session_data *sd, unsigned int id, struct s_vending *vending_list) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_vendinglist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *id, struct s_vending *vending_list);
+ if (HPMHooks.count.HP_clif_vendinglist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *id, struct s_vending **vending_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendinglist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendinglist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_vendinglist_pre[hIndex].func;
- preHookFunc(sd, &id, vending_list);
+ preHookFunc(&sd, &id, &vending_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13254,25 +13386,25 @@ void HP_clif_vendinglist(struct map_session_data *sd, unsigned int id, struct s_
{
HPMHooks.source.clif.vendinglist(sd, id, vending_list);
}
- if( HPMHooks.count.HP_clif_vendinglist_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *id, struct s_vending *vending_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendinglist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_vendinglist_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int id, struct s_vending *vending_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendinglist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_vendinglist_post[hIndex].func;
- postHookFunc(sd, &id, vending_list);
+ postHookFunc(sd, id, vending_list);
}
}
return;
}
void HP_clif_buyvending(struct map_session_data *sd, int index, int amount, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyvending_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index, int *amount, int *fail);
+ if (HPMHooks.count.HP_clif_buyvending_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyvending_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyvending_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyvending_pre[hIndex].func;
- preHookFunc(sd, &index, &amount, &fail);
+ preHookFunc(&sd, &index, &amount, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13280,25 +13412,25 @@ void HP_clif_buyvending(struct map_session_data *sd, int index, int amount, int
{
HPMHooks.source.clif.buyvending(sd, index, amount, fail);
}
- if( HPMHooks.count.HP_clif_buyvending_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index, int *amount, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyvending_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_buyvending_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index, int amount, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyvending_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyvending_post[hIndex].func;
- postHookFunc(sd, &index, &amount, &fail);
+ postHookFunc(sd, index, amount, fail);
}
}
return;
}
void HP_clif_openvending(struct map_session_data *sd, int id, struct s_vending *vending_list) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_openvending_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *id, struct s_vending *vending_list);
+ if (HPMHooks.count.HP_clif_openvending_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *id, struct s_vending **vending_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvending_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvending_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_openvending_pre[hIndex].func;
- preHookFunc(sd, &id, vending_list);
+ preHookFunc(&sd, &id, &vending_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13306,51 +13438,51 @@ void HP_clif_openvending(struct map_session_data *sd, int id, struct s_vending *
{
HPMHooks.source.clif.openvending(sd, id, vending_list);
}
- if( HPMHooks.count.HP_clif_openvending_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *id, struct s_vending *vending_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvending_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_openvending_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int id, struct s_vending *vending_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_openvending_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_openvending_post[hIndex].func;
- postHookFunc(sd, &id, vending_list);
+ postHookFunc(sd, id, vending_list);
}
}
return;
}
-void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount) {
+void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_vendingreport_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_clif_vendingreport_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_vendingreport_pre[hIndex].func;
- preHookFunc(sd, &index, &amount);
+ preHookFunc(&sd, &index, &amount, &char_id, &zeny);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.vendingreport(sd, index, amount);
+ HPMHooks.source.clif.vendingreport(sd, index, amount, char_id, zeny);
}
- if( HPMHooks.count.HP_clif_vendingreport_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_vendingreport_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_vendingreport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_vendingreport_post[hIndex].func;
- postHookFunc(sd, &index, &amount);
+ postHookFunc(sd, index, amount, char_id, zeny);
}
}
return;
}
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 ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item *items, int *items_length);
+ 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++ ) {
+ 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);
+ preHookFunc(&sd, &items, &items_length);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13358,25 +13490,25 @@ void HP_clif_storagelist(struct map_session_data *sd, struct item *items, int it
{
HPMHooks.source.clif.storagelist(sd, items, items_length);
}
- if( HPMHooks.count.HP_clif_storagelist_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct item *items, int *items_length);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storagelist_post; hIndex++ ) {
+ 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);
+ postHookFunc(sd, items, items_length);
}
}
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 ) {
- void (*preHookFunc) (struct map_session_data *sd, int *amount, int *max_amount);
+ if (HPMHooks.count.HP_clif_updatestorageamount_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *amount, int *max_amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestorageamount_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestorageamount_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_updatestorageamount_pre[hIndex].func;
- preHookFunc(sd, &amount, &max_amount);
+ preHookFunc(&sd, &amount, &max_amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13384,25 +13516,25 @@ void HP_clif_updatestorageamount(struct map_session_data *sd, int amount, int ma
{
HPMHooks.source.clif.updatestorageamount(sd, amount, max_amount);
}
- if( HPMHooks.count.HP_clif_updatestorageamount_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *amount, int *max_amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestorageamount_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_updatestorageamount_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int amount, int max_amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_updatestorageamount_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_updatestorageamount_post[hIndex].func;
- postHookFunc(sd, &amount, &max_amount);
+ postHookFunc(sd, amount, max_amount);
}
}
return;
}
void HP_clif_storageitemadded(struct map_session_data *sd, struct item *i, int index, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_storageitemadded_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item *i, int *index, int *amount);
+ if (HPMHooks.count.HP_clif_storageitemadded_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item **i, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemadded_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemadded_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_storageitemadded_pre[hIndex].func;
- preHookFunc(sd, i, &index, &amount);
+ preHookFunc(&sd, &i, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13410,25 +13542,25 @@ void HP_clif_storageitemadded(struct map_session_data *sd, struct item *i, int i
{
HPMHooks.source.clif.storageitemadded(sd, i, index, amount);
}
- if( HPMHooks.count.HP_clif_storageitemadded_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct item *i, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemadded_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_storageitemadded_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct item *i, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemadded_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_storageitemadded_post[hIndex].func;
- postHookFunc(sd, i, &index, &amount);
+ postHookFunc(sd, i, index, amount);
}
}
return;
}
void HP_clif_storageitemremoved(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_storageitemremoved_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_clif_storageitemremoved_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemremoved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemremoved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_storageitemremoved_pre[hIndex].func;
- preHookFunc(sd, &index, &amount);
+ preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13436,25 +13568,25 @@ void HP_clif_storageitemremoved(struct map_session_data *sd, int index, int amou
{
HPMHooks.source.clif.storageitemremoved(sd, index, amount);
}
- if( HPMHooks.count.HP_clif_storageitemremoved_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemremoved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_storageitemremoved_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageitemremoved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_storageitemremoved_post[hIndex].func;
- postHookFunc(sd, &index, &amount);
+ postHookFunc(sd, index, amount);
}
}
return;
}
void HP_clif_storageclose(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_storageclose_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_storageclose_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageclose_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageclose_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_storageclose_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13462,9 +13594,9 @@ void HP_clif_storageclose(struct map_session_data *sd) {
{
HPMHooks.source.clif.storageclose(sd);
}
- if( HPMHooks.count.HP_clif_storageclose_post ) {
+ if (HPMHooks.count.HP_clif_storageclose_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageclose_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageclose_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_storageclose_post[hIndex].func;
postHookFunc(sd);
}
@@ -13473,14 +13605,14 @@ void HP_clif_storageclose(struct map_session_data *sd) {
}
void HP_clif_skillinfoblock(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skillinfoblock_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_skillinfoblock_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfoblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfoblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skillinfoblock_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13488,9 +13620,9 @@ void HP_clif_skillinfoblock(struct map_session_data *sd) {
{
HPMHooks.source.clif.skillinfoblock(sd);
}
- if( HPMHooks.count.HP_clif_skillinfoblock_post ) {
+ if (HPMHooks.count.HP_clif_skillinfoblock_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfoblock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfoblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skillinfoblock_post[hIndex].func;
postHookFunc(sd);
}
@@ -13499,14 +13631,14 @@ void HP_clif_skillinfoblock(struct map_session_data *sd) {
}
void HP_clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skillup_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *skill_lv, int *flag);
+ if (HPMHooks.count.HP_clif_skillup_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, int *skill_lv, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skillup_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &skill_lv, &flag);
+ preHookFunc(&sd, &skill_id, &skill_lv, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13514,25 +13646,25 @@ void HP_clif_skillup(struct map_session_data *sd, uint16 skill_id, int skill_lv,
{
HPMHooks.source.clif.skillup(sd, skill_id, skill_lv, flag);
}
- if( HPMHooks.count.HP_clif_skillup_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *skill_lv, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skillup_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, int skill_lv, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skillup_post[hIndex].func;
- postHookFunc(sd, &skill_id, &skill_lv, &flag);
+ postHookFunc(sd, skill_id, skill_lv, flag);
}
}
return;
}
void HP_clif_skillinfo(struct map_session_data *sd, int skill_id, int inf) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_skillinfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *skill_id, int *inf);
+ if (HPMHooks.count.HP_clif_skillinfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *skill_id, int *inf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_skillinfo_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &inf);
+ preHookFunc(&sd, &skill_id, &inf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13540,25 +13672,25 @@ void HP_clif_skillinfo(struct map_session_data *sd, int skill_id, int inf) {
{
HPMHooks.source.clif.skillinfo(sd, skill_id, inf);
}
- if( HPMHooks.count.HP_clif_skillinfo_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *skill_id, int *inf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_skillinfo_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int skill_id, int inf);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_skillinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_skillinfo_post[hIndex].func;
- postHookFunc(sd, &skill_id, &inf);
+ postHookFunc(sd, skill_id, inf);
}
}
return;
}
void HP_clif_addskill(struct map_session_data *sd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_addskill_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *id);
+ if (HPMHooks.count.HP_clif_addskill_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_addskill_pre[hIndex].func;
- preHookFunc(sd, &id);
+ preHookFunc(&sd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13566,25 +13698,25 @@ void HP_clif_addskill(struct map_session_data *sd, int id) {
{
HPMHooks.source.clif.addskill(sd, id);
}
- if( HPMHooks.count.HP_clif_addskill_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_addskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_addskill_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_addskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_addskill_post[hIndex].func;
- postHookFunc(sd, &id);
+ postHookFunc(sd, id);
}
}
return;
}
void HP_clif_deleteskill(struct map_session_data *sd, int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_deleteskill_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *id);
+ if (HPMHooks.count.HP_clif_deleteskill_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_deleteskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_deleteskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_deleteskill_pre[hIndex].func;
- preHookFunc(sd, &id);
+ preHookFunc(&sd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13592,25 +13724,25 @@ void HP_clif_deleteskill(struct map_session_data *sd, int id) {
{
HPMHooks.source.clif.deleteskill(sd, id);
}
- if( HPMHooks.count.HP_clif_deleteskill_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_deleteskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_deleteskill_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_deleteskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_deleteskill_post[hIndex].func;
- postHookFunc(sd, &id);
+ postHookFunc(sd, id);
}
}
return;
}
void HP_clif_party_created(struct map_session_data *sd, int result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_created_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *result);
+ if (HPMHooks.count.HP_clif_party_created_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_created_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13618,25 +13750,25 @@ void HP_clif_party_created(struct map_session_data *sd, int result) {
{
HPMHooks.source.clif.party_created(sd, result);
}
- if( HPMHooks.count.HP_clif_party_created_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_party_created_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_created_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
void HP_clif_party_member_info(struct party_data *p, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_member_info_pre ) {
- void (*preHookFunc) (struct party_data *p, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_party_member_info_pre > 0) {
+ void (*preHookFunc) (struct party_data **p, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_member_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_member_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_member_info_pre[hIndex].func;
- preHookFunc(p, sd);
+ preHookFunc(&p, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13644,9 +13776,9 @@ void HP_clif_party_member_info(struct party_data *p, struct map_session_data *sd
{
HPMHooks.source.clif.party_member_info(p, sd);
}
- if( HPMHooks.count.HP_clif_party_member_info_post ) {
+ if (HPMHooks.count.HP_clif_party_member_info_post > 0) {
void (*postHookFunc) (struct party_data *p, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_member_info_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_member_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_member_info_post[hIndex].func;
postHookFunc(p, sd);
}
@@ -13655,14 +13787,14 @@ void HP_clif_party_member_info(struct party_data *p, struct map_session_data *sd
}
void HP_clif_party_info(struct party_data *p, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_info_pre ) {
- void (*preHookFunc) (struct party_data *p, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_party_info_pre > 0) {
+ void (*preHookFunc) (struct party_data **p, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_info_pre[hIndex].func;
- preHookFunc(p, sd);
+ preHookFunc(&p, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13670,9 +13802,9 @@ void HP_clif_party_info(struct party_data *p, struct map_session_data *sd) {
{
HPMHooks.source.clif.party_info(p, sd);
}
- if( HPMHooks.count.HP_clif_party_info_post ) {
+ if (HPMHooks.count.HP_clif_party_info_post > 0) {
void (*postHookFunc) (struct party_data *p, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_info_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_info_post[hIndex].func;
postHookFunc(p, sd);
}
@@ -13681,14 +13813,14 @@ void HP_clif_party_info(struct party_data *p, struct map_session_data *sd) {
}
void HP_clif_party_invite(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_invite_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_clif_party_invite_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_invite_pre[hIndex].func;
- preHookFunc(sd, tsd);
+ preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13696,9 +13828,9 @@ void HP_clif_party_invite(struct map_session_data *sd, struct map_session_data *
{
HPMHooks.source.clif.party_invite(sd, tsd);
}
- if( HPMHooks.count.HP_clif_party_invite_post ) {
+ if (HPMHooks.count.HP_clif_party_invite_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_invite_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_invite_post[hIndex].func;
postHookFunc(sd, tsd);
}
@@ -13707,14 +13839,14 @@ void HP_clif_party_invite(struct map_session_data *sd, struct map_session_data *
}
void HP_clif_party_inviteack(struct map_session_data *sd, const char *nick, int result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_inviteack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *nick, int *result);
+ if (HPMHooks.count.HP_clif_party_inviteack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **nick, int *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_inviteack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_inviteack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_inviteack_pre[hIndex].func;
- preHookFunc(sd, nick, &result);
+ preHookFunc(&sd, &nick, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13722,25 +13854,25 @@ void HP_clif_party_inviteack(struct map_session_data *sd, const char *nick, int
{
HPMHooks.source.clif.party_inviteack(sd, nick, result);
}
- if( HPMHooks.count.HP_clif_party_inviteack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *nick, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_inviteack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_party_inviteack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *nick, int result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_inviteack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_inviteack_post[hIndex].func;
- postHookFunc(sd, nick, &result);
+ postHookFunc(sd, nick, result);
}
}
return;
}
void HP_clif_party_option(struct party_data *p, struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_option_pre ) {
- void (*preHookFunc) (struct party_data *p, struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_party_option_pre > 0) {
+ void (*preHookFunc) (struct party_data **p, struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_option_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_option_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_option_pre[hIndex].func;
- preHookFunc(p, sd, &flag);
+ preHookFunc(&p, &sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13748,25 +13880,25 @@ void HP_clif_party_option(struct party_data *p, struct map_session_data *sd, int
{
HPMHooks.source.clif.party_option(p, sd, flag);
}
- if( HPMHooks.count.HP_clif_party_option_post ) {
- void (*postHookFunc) (struct party_data *p, struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_option_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_party_option_post > 0) {
+ void (*postHookFunc) (struct party_data *p, struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_option_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_option_post[hIndex].func;
- postHookFunc(p, sd, &flag);
+ postHookFunc(p, sd, flag);
}
}
return;
}
void HP_clif_party_withdraw(struct party_data *p, struct map_session_data *sd, int account_id, const char *name, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_withdraw_pre ) {
- void (*preHookFunc) (struct party_data *p, struct map_session_data *sd, int *account_id, const char *name, int *flag);
+ if (HPMHooks.count.HP_clif_party_withdraw_pre > 0) {
+ void (*preHookFunc) (struct party_data **p, struct map_session_data **sd, int *account_id, const char **name, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_withdraw_pre[hIndex].func;
- preHookFunc(p, sd, &account_id, name, &flag);
+ preHookFunc(&p, &sd, &account_id, &name, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13774,25 +13906,25 @@ void HP_clif_party_withdraw(struct party_data *p, struct map_session_data *sd, i
{
HPMHooks.source.clif.party_withdraw(p, sd, account_id, name, flag);
}
- if( HPMHooks.count.HP_clif_party_withdraw_post ) {
- void (*postHookFunc) (struct party_data *p, struct map_session_data *sd, int *account_id, const char *name, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_party_withdraw_post > 0) {
+ void (*postHookFunc) (struct party_data *p, struct map_session_data *sd, int account_id, const char *name, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_withdraw_post[hIndex].func;
- postHookFunc(p, sd, &account_id, name, &flag);
+ postHookFunc(p, sd, account_id, name, flag);
}
}
return;
}
void HP_clif_party_message(struct party_data *p, int account_id, const char *mes, int len) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_message_pre ) {
- void (*preHookFunc) (struct party_data *p, int *account_id, const char *mes, int *len);
+ if (HPMHooks.count.HP_clif_party_message_pre > 0) {
+ void (*preHookFunc) (struct party_data **p, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_message_pre[hIndex].func;
- preHookFunc(p, &account_id, mes, &len);
+ preHookFunc(&p, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13800,25 +13932,25 @@ void HP_clif_party_message(struct party_data *p, int account_id, const char *mes
{
HPMHooks.source.clif.party_message(p, account_id, mes, len);
}
- if( HPMHooks.count.HP_clif_party_message_post ) {
- void (*postHookFunc) (struct party_data *p, int *account_id, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_party_message_post > 0) {
+ void (*postHookFunc) (struct party_data *p, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_message_post[hIndex].func;
- postHookFunc(p, &account_id, mes, &len);
+ postHookFunc(p, account_id, mes, len);
}
}
return;
}
void HP_clif_party_xy(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_xy_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_party_xy_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_xy_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13826,9 +13958,9 @@ void HP_clif_party_xy(struct map_session_data *sd) {
{
HPMHooks.source.clif.party_xy(sd);
}
- if( HPMHooks.count.HP_clif_party_xy_post ) {
+ if (HPMHooks.count.HP_clif_party_xy_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_xy_post[hIndex].func;
postHookFunc(sd);
}
@@ -13837,14 +13969,14 @@ void HP_clif_party_xy(struct map_session_data *sd) {
}
void HP_clif_party_xy_single(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_xy_single_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_party_xy_single_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_xy_single_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13852,25 +13984,25 @@ void HP_clif_party_xy_single(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.party_xy_single(fd, sd);
}
- if( HPMHooks.count.HP_clif_party_xy_single_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_party_xy_single_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_xy_single_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_party_hp(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_hp_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_party_hp_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_hp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_hp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_hp_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13878,9 +14010,9 @@ void HP_clif_party_hp(struct map_session_data *sd) {
{
HPMHooks.source.clif.party_hp(sd);
}
- if( HPMHooks.count.HP_clif_party_hp_post ) {
+ if (HPMHooks.count.HP_clif_party_hp_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_hp_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_hp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_hp_post[hIndex].func;
postHookFunc(sd);
}
@@ -13889,14 +14021,14 @@ void HP_clif_party_hp(struct map_session_data *sd) {
}
void HP_clif_party_xy_remove(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_xy_remove_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_party_xy_remove_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_xy_remove_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13904,9 +14036,9 @@ void HP_clif_party_xy_remove(struct map_session_data *sd) {
{
HPMHooks.source.clif.party_xy_remove(sd);
}
- if( HPMHooks.count.HP_clif_party_xy_remove_post ) {
+ if (HPMHooks.count.HP_clif_party_xy_remove_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_xy_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_xy_remove_post[hIndex].func;
postHookFunc(sd);
}
@@ -13915,14 +14047,14 @@ void HP_clif_party_xy_remove(struct map_session_data *sd) {
}
void HP_clif_party_show_picker(struct map_session_data *sd, struct item *item_data) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_party_show_picker_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item *item_data);
+ if (HPMHooks.count.HP_clif_party_show_picker_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item **item_data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_show_picker_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_show_picker_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_party_show_picker_pre[hIndex].func;
- preHookFunc(sd, item_data);
+ preHookFunc(&sd, &item_data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13930,9 +14062,9 @@ void HP_clif_party_show_picker(struct map_session_data *sd, struct item *item_da
{
HPMHooks.source.clif.party_show_picker(sd, item_data);
}
- if( HPMHooks.count.HP_clif_party_show_picker_post ) {
+ if (HPMHooks.count.HP_clif_party_show_picker_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct item *item_data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_show_picker_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_show_picker_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_party_show_picker_post[hIndex].func;
postHookFunc(sd, item_data);
}
@@ -13941,14 +14073,14 @@ void HP_clif_party_show_picker(struct map_session_data *sd, struct item *item_da
}
void HP_clif_partyinvitationstate(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_partyinvitationstate_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_partyinvitationstate_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_partyinvitationstate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_partyinvitationstate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_partyinvitationstate_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13956,9 +14088,9 @@ void HP_clif_partyinvitationstate(struct map_session_data *sd) {
{
HPMHooks.source.clif.partyinvitationstate(sd);
}
- if( HPMHooks.count.HP_clif_partyinvitationstate_post ) {
+ if (HPMHooks.count.HP_clif_partyinvitationstate_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_partyinvitationstate_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_partyinvitationstate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_partyinvitationstate_post[hIndex].func;
postHookFunc(sd);
}
@@ -13967,14 +14099,14 @@ void HP_clif_partyinvitationstate(struct map_session_data *sd) {
}
void HP_clif_PartyLeaderChanged(struct map_session_data *sd, int prev_leader_aid, int new_leader_aid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyLeaderChanged_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *prev_leader_aid, int *new_leader_aid);
+ if (HPMHooks.count.HP_clif_PartyLeaderChanged_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *prev_leader_aid, int *new_leader_aid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyLeaderChanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyLeaderChanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyLeaderChanged_pre[hIndex].func;
- preHookFunc(sd, &prev_leader_aid, &new_leader_aid);
+ preHookFunc(&sd, &prev_leader_aid, &new_leader_aid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -13982,25 +14114,25 @@ void HP_clif_PartyLeaderChanged(struct map_session_data *sd, int prev_leader_aid
{
HPMHooks.source.clif.PartyLeaderChanged(sd, prev_leader_aid, new_leader_aid);
}
- if( HPMHooks.count.HP_clif_PartyLeaderChanged_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *prev_leader_aid, int *new_leader_aid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyLeaderChanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyLeaderChanged_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int prev_leader_aid, int new_leader_aid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyLeaderChanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyLeaderChanged_post[hIndex].func;
- postHookFunc(sd, &prev_leader_aid, &new_leader_aid);
+ postHookFunc(sd, prev_leader_aid, new_leader_aid);
}
}
return;
}
void HP_clif_guild_created(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_created_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_guild_created_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_created_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14008,25 +14140,25 @@ void HP_clif_guild_created(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.guild_created(sd, flag);
}
- if( HPMHooks.count.HP_clif_guild_created_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_created_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_created_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_guild_belonginfo(struct map_session_data *sd, struct guild *g) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_belonginfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct guild *g);
+ if (HPMHooks.count.HP_clif_guild_belonginfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_belonginfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_belonginfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_belonginfo_pre[hIndex].func;
- preHookFunc(sd, g);
+ preHookFunc(&sd, &g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14034,9 +14166,9 @@ void HP_clif_guild_belonginfo(struct map_session_data *sd, struct guild *g) {
{
HPMHooks.source.clif.guild_belonginfo(sd, g);
}
- if( HPMHooks.count.HP_clif_guild_belonginfo_post ) {
+ if (HPMHooks.count.HP_clif_guild_belonginfo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_belonginfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_belonginfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_belonginfo_post[hIndex].func;
postHookFunc(sd, g);
}
@@ -14045,14 +14177,14 @@ void HP_clif_guild_belonginfo(struct map_session_data *sd, struct guild *g) {
}
void HP_clif_guild_masterormember(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_masterormember_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_masterormember_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_masterormember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_masterormember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_masterormember_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14060,9 +14192,9 @@ void HP_clif_guild_masterormember(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_masterormember(sd);
}
- if( HPMHooks.count.HP_clif_guild_masterormember_post ) {
+ if (HPMHooks.count.HP_clif_guild_masterormember_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_masterormember_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_masterormember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_masterormember_post[hIndex].func;
postHookFunc(sd);
}
@@ -14071,14 +14203,14 @@ void HP_clif_guild_masterormember(struct map_session_data *sd) {
}
void HP_clif_guild_basicinfo(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_basicinfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_basicinfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_basicinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_basicinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_basicinfo_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14086,9 +14218,9 @@ void HP_clif_guild_basicinfo(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_basicinfo(sd);
}
- if( HPMHooks.count.HP_clif_guild_basicinfo_post ) {
+ if (HPMHooks.count.HP_clif_guild_basicinfo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_basicinfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_basicinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_basicinfo_post[hIndex].func;
postHookFunc(sd);
}
@@ -14097,14 +14229,14 @@ void HP_clif_guild_basicinfo(struct map_session_data *sd) {
}
void HP_clif_guild_allianceinfo(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_allianceinfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_allianceinfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_allianceinfo_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14112,9 +14244,9 @@ void HP_clif_guild_allianceinfo(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_allianceinfo(sd);
}
- if( HPMHooks.count.HP_clif_guild_allianceinfo_post ) {
+ if (HPMHooks.count.HP_clif_guild_allianceinfo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceinfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_allianceinfo_post[hIndex].func;
postHookFunc(sd);
}
@@ -14123,14 +14255,14 @@ void HP_clif_guild_allianceinfo(struct map_session_data *sd) {
}
void HP_clif_guild_memberlist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_memberlist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_memberlist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_memberlist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14138,9 +14270,9 @@ void HP_clif_guild_memberlist(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_memberlist(sd);
}
- if( HPMHooks.count.HP_clif_guild_memberlist_post ) {
+ if (HPMHooks.count.HP_clif_guild_memberlist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_memberlist_post[hIndex].func;
postHookFunc(sd);
}
@@ -14149,14 +14281,14 @@ void HP_clif_guild_memberlist(struct map_session_data *sd) {
}
void HP_clif_guild_skillinfo(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_skillinfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_skillinfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_skillinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_skillinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_skillinfo_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14164,9 +14296,9 @@ void HP_clif_guild_skillinfo(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_skillinfo(sd);
}
- if( HPMHooks.count.HP_clif_guild_skillinfo_post ) {
+ if (HPMHooks.count.HP_clif_guild_skillinfo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_skillinfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_skillinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_skillinfo_post[hIndex].func;
postHookFunc(sd);
}
@@ -14175,14 +14307,14 @@ void HP_clif_guild_skillinfo(struct map_session_data *sd) {
}
void HP_clif_guild_send_onlineinfo(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_send_onlineinfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_send_onlineinfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_send_onlineinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_send_onlineinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_send_onlineinfo_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14190,9 +14322,9 @@ void HP_clif_guild_send_onlineinfo(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_send_onlineinfo(sd);
}
- if( HPMHooks.count.HP_clif_guild_send_onlineinfo_post ) {
+ if (HPMHooks.count.HP_clif_guild_send_onlineinfo_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_send_onlineinfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_send_onlineinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_send_onlineinfo_post[hIndex].func;
postHookFunc(sd);
}
@@ -14201,14 +14333,14 @@ void HP_clif_guild_send_onlineinfo(struct map_session_data *sd) {
}
void HP_clif_guild_memberlogin_notice(struct guild *g, int idx, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_memberlogin_notice_pre ) {
- void (*preHookFunc) (struct guild *g, int *idx, int *flag);
+ if (HPMHooks.count.HP_clif_guild_memberlogin_notice_pre > 0) {
+ void (*preHookFunc) (struct guild **g, int *idx, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlogin_notice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlogin_notice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_memberlogin_notice_pre[hIndex].func;
- preHookFunc(g, &idx, &flag);
+ preHookFunc(&g, &idx, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14216,25 +14348,25 @@ void HP_clif_guild_memberlogin_notice(struct guild *g, int idx, int flag) {
{
HPMHooks.source.clif.guild_memberlogin_notice(g, idx, flag);
}
- if( HPMHooks.count.HP_clif_guild_memberlogin_notice_post ) {
- void (*postHookFunc) (struct guild *g, int *idx, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlogin_notice_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_memberlogin_notice_post > 0) {
+ void (*postHookFunc) (struct guild *g, int idx, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberlogin_notice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_memberlogin_notice_post[hIndex].func;
- postHookFunc(g, &idx, &flag);
+ postHookFunc(g, idx, flag);
}
}
return;
}
void HP_clif_guild_invite(struct map_session_data *sd, struct guild *g) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_invite_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct guild *g);
+ if (HPMHooks.count.HP_clif_guild_invite_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_invite_pre[hIndex].func;
- preHookFunc(sd, g);
+ preHookFunc(&sd, &g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14242,9 +14374,9 @@ void HP_clif_guild_invite(struct map_session_data *sd, struct guild *g) {
{
HPMHooks.source.clif.guild_invite(sd, g);
}
- if( HPMHooks.count.HP_clif_guild_invite_post ) {
+ if (HPMHooks.count.HP_clif_guild_invite_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_invite_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_invite_post[hIndex].func;
postHookFunc(sd, g);
}
@@ -14253,14 +14385,14 @@ void HP_clif_guild_invite(struct map_session_data *sd, struct guild *g) {
}
void HP_clif_guild_inviteack(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_inviteack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_guild_inviteack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_inviteack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_inviteack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_inviteack_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14268,25 +14400,25 @@ void HP_clif_guild_inviteack(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.guild_inviteack(sd, flag);
}
- if( HPMHooks.count.HP_clif_guild_inviteack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_inviteack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_inviteack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_inviteack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_inviteack_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_guild_leave(struct map_session_data *sd, const char *name, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_leave_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *name, const char *mes);
+ if (HPMHooks.count.HP_clif_guild_leave_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **name, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_leave_pre[hIndex].func;
- preHookFunc(sd, name, mes);
+ preHookFunc(&sd, &name, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14294,9 +14426,9 @@ void HP_clif_guild_leave(struct map_session_data *sd, const char *name, const ch
{
HPMHooks.source.clif.guild_leave(sd, name, mes);
}
- if( HPMHooks.count.HP_clif_guild_leave_post ) {
+ if (HPMHooks.count.HP_clif_guild_leave_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *name, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_leave_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_leave_post[hIndex].func;
postHookFunc(sd, name, mes);
}
@@ -14305,14 +14437,14 @@ void HP_clif_guild_leave(struct map_session_data *sd, const char *name, const ch
}
void HP_clif_guild_expulsion(struct map_session_data *sd, const char *name, const char *mes, int account_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_expulsion_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *name, const char *mes, int *account_id);
+ if (HPMHooks.count.HP_clif_guild_expulsion_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **name, const char **mes, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_expulsion_pre[hIndex].func;
- preHookFunc(sd, name, mes, &account_id);
+ preHookFunc(&sd, &name, &mes, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14320,25 +14452,25 @@ void HP_clif_guild_expulsion(struct map_session_data *sd, const char *name, cons
{
HPMHooks.source.clif.guild_expulsion(sd, name, mes, account_id);
}
- if( HPMHooks.count.HP_clif_guild_expulsion_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *name, const char *mes, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_expulsion_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *name, const char *mes, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_expulsion_post[hIndex].func;
- postHookFunc(sd, name, mes, &account_id);
+ postHookFunc(sd, name, mes, account_id);
}
}
return;
}
void HP_clif_guild_positionchanged(struct guild *g, int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_positionchanged_pre ) {
- void (*preHookFunc) (struct guild *g, int *idx);
+ if (HPMHooks.count.HP_clif_guild_positionchanged_pre > 0) {
+ void (*preHookFunc) (struct guild **g, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionchanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionchanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_positionchanged_pre[hIndex].func;
- preHookFunc(g, &idx);
+ preHookFunc(&g, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14346,25 +14478,25 @@ void HP_clif_guild_positionchanged(struct guild *g, int idx) {
{
HPMHooks.source.clif.guild_positionchanged(g, idx);
}
- if( HPMHooks.count.HP_clif_guild_positionchanged_post ) {
- void (*postHookFunc) (struct guild *g, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionchanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_positionchanged_post > 0) {
+ void (*postHookFunc) (struct guild *g, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionchanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_positionchanged_post[hIndex].func;
- postHookFunc(g, &idx);
+ postHookFunc(g, idx);
}
}
return;
}
void HP_clif_guild_memberpositionchanged(struct guild *g, int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_memberpositionchanged_pre ) {
- void (*preHookFunc) (struct guild *g, int *idx);
+ if (HPMHooks.count.HP_clif_guild_memberpositionchanged_pre > 0) {
+ void (*preHookFunc) (struct guild **g, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberpositionchanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberpositionchanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_memberpositionchanged_pre[hIndex].func;
- preHookFunc(g, &idx);
+ preHookFunc(&g, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14372,25 +14504,25 @@ void HP_clif_guild_memberpositionchanged(struct guild *g, int idx) {
{
HPMHooks.source.clif.guild_memberpositionchanged(g, idx);
}
- if( HPMHooks.count.HP_clif_guild_memberpositionchanged_post ) {
- void (*postHookFunc) (struct guild *g, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberpositionchanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_memberpositionchanged_post > 0) {
+ void (*postHookFunc) (struct guild *g, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_memberpositionchanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_memberpositionchanged_post[hIndex].func;
- postHookFunc(g, &idx);
+ postHookFunc(g, idx);
}
}
return;
}
void HP_clif_guild_emblem(struct map_session_data *sd, struct guild *g) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_emblem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct guild *g);
+ if (HPMHooks.count.HP_clif_guild_emblem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_emblem_pre[hIndex].func;
- preHookFunc(sd, g);
+ preHookFunc(&sd, &g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14398,9 +14530,9 @@ void HP_clif_guild_emblem(struct map_session_data *sd, struct guild *g) {
{
HPMHooks.source.clif.guild_emblem(sd, g);
}
- if( HPMHooks.count.HP_clif_guild_emblem_post ) {
+ if (HPMHooks.count.HP_clif_guild_emblem_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_emblem_post[hIndex].func;
postHookFunc(sd, g);
}
@@ -14409,14 +14541,14 @@ void HP_clif_guild_emblem(struct map_session_data *sd, struct guild *g) {
}
void HP_clif_guild_emblem_area(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_emblem_area_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_clif_guild_emblem_area_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_area_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_emblem_area_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14424,9 +14556,9 @@ void HP_clif_guild_emblem_area(struct block_list *bl) {
{
HPMHooks.source.clif.guild_emblem_area(bl);
}
- if( HPMHooks.count.HP_clif_guild_emblem_area_post ) {
+ if (HPMHooks.count.HP_clif_guild_emblem_area_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_area_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_emblem_area_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_emblem_area_post[hIndex].func;
postHookFunc(bl);
}
@@ -14435,14 +14567,14 @@ void HP_clif_guild_emblem_area(struct block_list *bl) {
}
void HP_clif_guild_notice(struct map_session_data *sd, struct guild *g) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_notice_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct guild *g);
+ if (HPMHooks.count.HP_clif_guild_notice_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_notice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_notice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_notice_pre[hIndex].func;
- preHookFunc(sd, g);
+ preHookFunc(&sd, &g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14450,9 +14582,9 @@ void HP_clif_guild_notice(struct map_session_data *sd, struct guild *g) {
{
HPMHooks.source.clif.guild_notice(sd, g);
}
- if( HPMHooks.count.HP_clif_guild_notice_post ) {
+ if (HPMHooks.count.HP_clif_guild_notice_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_notice_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_notice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_notice_post[hIndex].func;
postHookFunc(sd, g);
}
@@ -14461,14 +14593,14 @@ void HP_clif_guild_notice(struct map_session_data *sd, struct guild *g) {
}
void HP_clif_guild_message(struct guild *g, int account_id, const char *mes, int len) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_message_pre ) {
- void (*preHookFunc) (struct guild *g, int *account_id, const char *mes, int *len);
+ if (HPMHooks.count.HP_clif_guild_message_pre > 0) {
+ void (*preHookFunc) (struct guild **g, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_message_pre[hIndex].func;
- preHookFunc(g, &account_id, mes, &len);
+ preHookFunc(&g, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14476,25 +14608,25 @@ void HP_clif_guild_message(struct guild *g, int account_id, const char *mes, int
{
HPMHooks.source.clif.guild_message(g, account_id, mes, len);
}
- if( HPMHooks.count.HP_clif_guild_message_post ) {
- void (*postHookFunc) (struct guild *g, int *account_id, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_message_post > 0) {
+ void (*postHookFunc) (struct guild *g, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_message_post[hIndex].func;
- postHookFunc(g, &account_id, mes, &len);
+ postHookFunc(g, account_id, mes, len);
}
}
return;
}
void HP_clif_guild_reqalliance(struct map_session_data *sd, int account_id, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_reqalliance_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id, const char *name);
+ if (HPMHooks.count.HP_clif_guild_reqalliance_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_reqalliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_reqalliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_reqalliance_pre[hIndex].func;
- preHookFunc(sd, &account_id, name);
+ preHookFunc(&sd, &account_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14502,25 +14634,25 @@ void HP_clif_guild_reqalliance(struct map_session_data *sd, int account_id, cons
{
HPMHooks.source.clif.guild_reqalliance(sd, account_id, name);
}
- if( HPMHooks.count.HP_clif_guild_reqalliance_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_reqalliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_reqalliance_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_reqalliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_reqalliance_post[hIndex].func;
- postHookFunc(sd, &account_id, name);
+ postHookFunc(sd, account_id, name);
}
}
return;
}
void HP_clif_guild_allianceack(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_allianceack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_guild_allianceack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_allianceack_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14528,25 +14660,25 @@ void HP_clif_guild_allianceack(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.guild_allianceack(sd, flag);
}
- if( HPMHooks.count.HP_clif_guild_allianceack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_allianceack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_allianceack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_allianceack_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_guild_delalliance(struct map_session_data *sd, int guild_id, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_delalliance_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *guild_id, int *flag);
+ if (HPMHooks.count.HP_clif_guild_delalliance_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *guild_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_delalliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_delalliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_delalliance_pre[hIndex].func;
- preHookFunc(sd, &guild_id, &flag);
+ preHookFunc(&sd, &guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14554,25 +14686,25 @@ void HP_clif_guild_delalliance(struct map_session_data *sd, int guild_id, int fl
{
HPMHooks.source.clif.guild_delalliance(sd, guild_id, flag);
}
- if( HPMHooks.count.HP_clif_guild_delalliance_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *guild_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_delalliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_delalliance_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int guild_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_delalliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_delalliance_post[hIndex].func;
- postHookFunc(sd, &guild_id, &flag);
+ postHookFunc(sd, guild_id, flag);
}
}
return;
}
void HP_clif_guild_oppositionack(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_oppositionack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_guild_oppositionack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_oppositionack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_oppositionack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_oppositionack_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14580,25 +14712,25 @@ void HP_clif_guild_oppositionack(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.guild_oppositionack(sd, flag);
}
- if( HPMHooks.count.HP_clif_guild_oppositionack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_oppositionack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_oppositionack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_oppositionack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_oppositionack_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_guild_broken(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_broken_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_guild_broken_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_broken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_broken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_broken_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14606,25 +14738,25 @@ void HP_clif_guild_broken(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.guild_broken(sd, flag);
}
- if( HPMHooks.count.HP_clif_guild_broken_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_broken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_broken_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_broken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_broken_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_guild_xy(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_xy_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_xy_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_xy_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14632,9 +14764,9 @@ void HP_clif_guild_xy(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_xy(sd);
}
- if( HPMHooks.count.HP_clif_guild_xy_post ) {
+ if (HPMHooks.count.HP_clif_guild_xy_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_xy_post[hIndex].func;
postHookFunc(sd);
}
@@ -14643,14 +14775,14 @@ void HP_clif_guild_xy(struct map_session_data *sd) {
}
void HP_clif_guild_xy_single(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_xy_single_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_xy_single_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_xy_single_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14658,25 +14790,25 @@ void HP_clif_guild_xy_single(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_xy_single(fd, sd);
}
- if( HPMHooks.count.HP_clif_guild_xy_single_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_guild_xy_single_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_xy_single_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_guild_xy_remove(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_xy_remove_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_xy_remove_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_xy_remove_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14684,9 +14816,9 @@ void HP_clif_guild_xy_remove(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_xy_remove(sd);
}
- if( HPMHooks.count.HP_clif_guild_xy_remove_post ) {
+ if (HPMHooks.count.HP_clif_guild_xy_remove_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_xy_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_xy_remove_post[hIndex].func;
postHookFunc(sd);
}
@@ -14695,14 +14827,14 @@ void HP_clif_guild_xy_remove(struct map_session_data *sd) {
}
void HP_clif_guild_positionnamelist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_positionnamelist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_positionnamelist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionnamelist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionnamelist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_positionnamelist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14710,9 +14842,9 @@ void HP_clif_guild_positionnamelist(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_positionnamelist(sd);
}
- if( HPMHooks.count.HP_clif_guild_positionnamelist_post ) {
+ if (HPMHooks.count.HP_clif_guild_positionnamelist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionnamelist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positionnamelist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_positionnamelist_post[hIndex].func;
postHookFunc(sd);
}
@@ -14721,14 +14853,14 @@ void HP_clif_guild_positionnamelist(struct map_session_data *sd) {
}
void HP_clif_guild_positioninfolist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_positioninfolist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_positioninfolist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positioninfolist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positioninfolist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_positioninfolist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14736,9 +14868,9 @@ void HP_clif_guild_positioninfolist(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_positioninfolist(sd);
}
- if( HPMHooks.count.HP_clif_guild_positioninfolist_post ) {
+ if (HPMHooks.count.HP_clif_guild_positioninfolist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positioninfolist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_positioninfolist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_positioninfolist_post[hIndex].func;
postHookFunc(sd);
}
@@ -14747,14 +14879,14 @@ void HP_clif_guild_positioninfolist(struct map_session_data *sd) {
}
void HP_clif_guild_expulsionlist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_guild_expulsionlist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_guild_expulsionlist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsionlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsionlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_guild_expulsionlist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14762,9 +14894,9 @@ void HP_clif_guild_expulsionlist(struct map_session_data *sd) {
{
HPMHooks.source.clif.guild_expulsionlist(sd);
}
- if( HPMHooks.count.HP_clif_guild_expulsionlist_post ) {
+ if (HPMHooks.count.HP_clif_guild_expulsionlist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsionlist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsionlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_guild_expulsionlist_post[hIndex].func;
postHookFunc(sd);
}
@@ -14774,14 +14906,14 @@ void HP_clif_guild_expulsionlist(struct map_session_data *sd) {
bool HP_clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_validate_emblem_pre ) {
- bool (*preHookFunc) (const uint8 *emblem, unsigned long *emblem_len);
+ if (HPMHooks.count.HP_clif_validate_emblem_pre > 0) {
+ bool (*preHookFunc) (const uint8 **emblem, unsigned long *emblem_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_validate_emblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_validate_emblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_validate_emblem_pre[hIndex].func;
- retVal___ = preHookFunc(emblem, &emblem_len);
+ retVal___ = preHookFunc(&emblem, &emblem_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -14789,25 +14921,25 @@ bool HP_clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) {
{
retVal___ = HPMHooks.source.clif.validate_emblem(emblem, emblem_len);
}
- if( HPMHooks.count.HP_clif_validate_emblem_post ) {
- bool (*postHookFunc) (bool retVal___, const uint8 *emblem, unsigned long *emblem_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_validate_emblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_validate_emblem_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const uint8 *emblem, unsigned long emblem_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_validate_emblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_validate_emblem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, emblem, &emblem_len);
+ retVal___ = postHookFunc(retVal___, emblem, emblem_len);
}
}
return retVal___;
}
void HP_clif_bg_hp(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bg_hp_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_bg_hp_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_hp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_hp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bg_hp_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14815,9 +14947,9 @@ void HP_clif_bg_hp(struct map_session_data *sd) {
{
HPMHooks.source.clif.bg_hp(sd);
}
- if( HPMHooks.count.HP_clif_bg_hp_post ) {
+ if (HPMHooks.count.HP_clif_bg_hp_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_hp_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_hp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bg_hp_post[hIndex].func;
postHookFunc(sd);
}
@@ -14826,14 +14958,14 @@ void HP_clif_bg_hp(struct map_session_data *sd) {
}
void HP_clif_bg_xy(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bg_xy_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_bg_xy_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bg_xy_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14841,9 +14973,9 @@ void HP_clif_bg_xy(struct map_session_data *sd) {
{
HPMHooks.source.clif.bg_xy(sd);
}
- if( HPMHooks.count.HP_clif_bg_xy_post ) {
+ if (HPMHooks.count.HP_clif_bg_xy_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bg_xy_post[hIndex].func;
postHookFunc(sd);
}
@@ -14852,14 +14984,14 @@ void HP_clif_bg_xy(struct map_session_data *sd) {
}
void HP_clif_bg_xy_remove(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bg_xy_remove_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_bg_xy_remove_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bg_xy_remove_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14867,51 +14999,51 @@ void HP_clif_bg_xy_remove(struct map_session_data *sd) {
{
HPMHooks.source.clif.bg_xy_remove(sd);
}
- if( HPMHooks.count.HP_clif_bg_xy_remove_post ) {
+ if (HPMHooks.count.HP_clif_bg_xy_remove_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_xy_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bg_xy_remove_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-void HP_clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes, size_t len) {
+void HP_clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bg_message_pre ) {
- void (*preHookFunc) (struct battleground_data *bgd, int *src_id, const char *name, const char *mes, size_t *len);
+ if (HPMHooks.count.HP_clif_bg_message_pre > 0) {
+ void (*preHookFunc) (struct battleground_data **bgd, int *src_id, const char **name, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bg_message_pre[hIndex].func;
- preHookFunc(bgd, &src_id, name, mes, &len);
+ preHookFunc(&bgd, &src_id, &name, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.bg_message(bgd, src_id, name, mes, len);
+ HPMHooks.source.clif.bg_message(bgd, src_id, name, mes);
}
- if( HPMHooks.count.HP_clif_bg_message_post ) {
- void (*postHookFunc) (struct battleground_data *bgd, int *src_id, const char *name, const char *mes, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bg_message_post > 0) {
+ void (*postHookFunc) (struct battleground_data *bgd, int src_id, const char *name, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bg_message_post[hIndex].func;
- postHookFunc(bgd, &src_id, name, mes, &len);
+ postHookFunc(bgd, src_id, name, mes);
}
}
return;
}
void HP_clif_bg_updatescore(int16 m) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bg_updatescore_pre ) {
+ if (HPMHooks.count.HP_clif_bg_updatescore_pre > 0) {
void (*preHookFunc) (int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bg_updatescore_pre[hIndex].func;
preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14919,25 +15051,25 @@ void HP_clif_bg_updatescore(int16 m) {
{
HPMHooks.source.clif.bg_updatescore(m);
}
- if( HPMHooks.count.HP_clif_bg_updatescore_post ) {
- void (*postHookFunc) (int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bg_updatescore_post > 0) {
+ void (*postHookFunc) (int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bg_updatescore_post[hIndex].func;
- postHookFunc(&m);
+ postHookFunc(m);
}
}
return;
}
void HP_clif_bg_updatescore_single(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bg_updatescore_single_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_bg_updatescore_single_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bg_updatescore_single_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14945,9 +15077,9 @@ void HP_clif_bg_updatescore_single(struct map_session_data *sd) {
{
HPMHooks.source.clif.bg_updatescore_single(sd);
}
- if( HPMHooks.count.HP_clif_bg_updatescore_single_post ) {
+ if (HPMHooks.count.HP_clif_bg_updatescore_single_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_single_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bg_updatescore_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bg_updatescore_single_post[hIndex].func;
postHookFunc(sd);
}
@@ -14956,14 +15088,14 @@ void HP_clif_bg_updatescore_single(struct map_session_data *sd) {
}
void HP_clif_sendbgemblem_area(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sendbgemblem_area_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_sendbgemblem_area_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_area_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sendbgemblem_area_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14971,9 +15103,9 @@ void HP_clif_sendbgemblem_area(struct map_session_data *sd) {
{
HPMHooks.source.clif.sendbgemblem_area(sd);
}
- if( HPMHooks.count.HP_clif_sendbgemblem_area_post ) {
+ if (HPMHooks.count.HP_clif_sendbgemblem_area_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_area_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_area_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sendbgemblem_area_post[hIndex].func;
postHookFunc(sd);
}
@@ -14982,14 +15114,14 @@ void HP_clif_sendbgemblem_area(struct map_session_data *sd) {
}
void HP_clif_sendbgemblem_single(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sendbgemblem_single_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_sendbgemblem_single_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sendbgemblem_single_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -14997,11 +15129,11 @@ void HP_clif_sendbgemblem_single(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.sendbgemblem_single(fd, sd);
}
- if( HPMHooks.count.HP_clif_sendbgemblem_single_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_sendbgemblem_single_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendbgemblem_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sendbgemblem_single_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
@@ -15009,14 +15141,14 @@ void HP_clif_sendbgemblem_single(int fd, struct map_session_data *sd) {
int HP_clif_instance(int instance_id, int type, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_instance_pre ) {
+ if (HPMHooks.count.HP_clif_instance_pre > 0) {
int (*preHookFunc) (int *instance_id, int *type, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_instance_pre[hIndex].func;
retVal___ = preHookFunc(&instance_id, &type, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15024,25 +15156,25 @@ int HP_clif_instance(int instance_id, int type, int flag) {
{
retVal___ = HPMHooks.source.clif.instance(instance_id, type, flag);
}
- if( HPMHooks.count.HP_clif_instance_post ) {
- int (*postHookFunc) (int retVal___, int *instance_id, int *type, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_instance_post > 0) {
+ int (*postHookFunc) (int retVal___, int instance_id, int type, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_instance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &instance_id, &type, &flag);
+ retVal___ = postHookFunc(retVal___, instance_id, type, flag);
}
}
return retVal___;
}
void HP_clif_instance_join(int fd, int instance_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_instance_join_pre ) {
+ if (HPMHooks.count.HP_clif_instance_join_pre > 0) {
void (*preHookFunc) (int *fd, int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_join_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_join_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_instance_join_pre[hIndex].func;
preHookFunc(&fd, &instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15050,25 +15182,25 @@ void HP_clif_instance_join(int fd, int instance_id) {
{
HPMHooks.source.clif.instance_join(fd, instance_id);
}
- if( HPMHooks.count.HP_clif_instance_join_post ) {
- void (*postHookFunc) (int *fd, int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_join_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_instance_join_post > 0) {
+ void (*postHookFunc) (int fd, int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_join_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_instance_join_post[hIndex].func;
- postHookFunc(&fd, &instance_id);
+ postHookFunc(fd, instance_id);
}
}
return;
}
void HP_clif_instance_leave(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_instance_leave_pre ) {
+ if (HPMHooks.count.HP_clif_instance_leave_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_instance_leave_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15076,25 +15208,25 @@ void HP_clif_instance_leave(int fd) {
{
HPMHooks.source.clif.instance_leave(fd);
}
- if( HPMHooks.count.HP_clif_instance_leave_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_instance_leave_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_instance_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_instance_leave_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_clif_catch_process(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_catch_process_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_catch_process_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_catch_process_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_catch_process_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_catch_process_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15102,9 +15234,9 @@ void HP_clif_catch_process(struct map_session_data *sd) {
{
HPMHooks.source.clif.catch_process(sd);
}
- if( HPMHooks.count.HP_clif_catch_process_post ) {
+ if (HPMHooks.count.HP_clif_catch_process_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_catch_process_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_catch_process_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_catch_process_post[hIndex].func;
postHookFunc(sd);
}
@@ -15113,14 +15245,14 @@ void HP_clif_catch_process(struct map_session_data *sd) {
}
void HP_clif_pet_roulette(struct map_session_data *sd, int data) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pet_roulette_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *data);
+ if (HPMHooks.count.HP_clif_pet_roulette_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_roulette_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_roulette_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pet_roulette_pre[hIndex].func;
- preHookFunc(sd, &data);
+ preHookFunc(&sd, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15128,25 +15260,25 @@ void HP_clif_pet_roulette(struct map_session_data *sd, int data) {
{
HPMHooks.source.clif.pet_roulette(sd, data);
}
- if( HPMHooks.count.HP_clif_pet_roulette_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_roulette_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pet_roulette_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_roulette_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pet_roulette_post[hIndex].func;
- postHookFunc(sd, &data);
+ postHookFunc(sd, data);
}
}
return;
}
void HP_clif_sendegg(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_sendegg_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_sendegg_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendegg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendegg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_sendegg_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15154,9 +15286,9 @@ void HP_clif_sendegg(struct map_session_data *sd) {
{
HPMHooks.source.clif.sendegg(sd);
}
- if( HPMHooks.count.HP_clif_sendegg_post ) {
+ if (HPMHooks.count.HP_clif_sendegg_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendegg_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_sendegg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_sendegg_post[hIndex].func;
postHookFunc(sd);
}
@@ -15165,14 +15297,14 @@ void HP_clif_sendegg(struct map_session_data *sd) {
}
void HP_clif_send_petstatus(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_send_petstatus_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_send_petstatus_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petstatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petstatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_send_petstatus_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15180,9 +15312,9 @@ void HP_clif_send_petstatus(struct map_session_data *sd) {
{
HPMHooks.source.clif.send_petstatus(sd);
}
- if( HPMHooks.count.HP_clif_send_petstatus_post ) {
+ if (HPMHooks.count.HP_clif_send_petstatus_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petstatus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petstatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_send_petstatus_post[hIndex].func;
postHookFunc(sd);
}
@@ -15191,14 +15323,14 @@ void HP_clif_send_petstatus(struct map_session_data *sd) {
}
void HP_clif_send_petdata(struct map_session_data *sd, struct pet_data *pd, int type, int param) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_send_petdata_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct pet_data *pd, int *type, int *param);
+ if (HPMHooks.count.HP_clif_send_petdata_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct pet_data **pd, int *type, int *param);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_send_petdata_pre[hIndex].func;
- preHookFunc(sd, pd, &type, &param);
+ preHookFunc(&sd, &pd, &type, &param);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15206,25 +15338,25 @@ void HP_clif_send_petdata(struct map_session_data *sd, struct pet_data *pd, int
{
HPMHooks.source.clif.send_petdata(sd, pd, type, param);
}
- if( HPMHooks.count.HP_clif_send_petdata_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct pet_data *pd, int *type, int *param);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_send_petdata_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct pet_data *pd, int type, int param);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_petdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_send_petdata_post[hIndex].func;
- postHookFunc(sd, pd, &type, &param);
+ postHookFunc(sd, pd, type, param);
}
}
return;
}
void HP_clif_pet_emotion(struct pet_data *pd, int param) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pet_emotion_pre ) {
- void (*preHookFunc) (struct pet_data *pd, int *param);
+ if (HPMHooks.count.HP_clif_pet_emotion_pre > 0) {
+ void (*preHookFunc) (struct pet_data **pd, int *param);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_emotion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_emotion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pet_emotion_pre[hIndex].func;
- preHookFunc(pd, &param);
+ preHookFunc(&pd, &param);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15232,25 +15364,25 @@ void HP_clif_pet_emotion(struct pet_data *pd, int param) {
{
HPMHooks.source.clif.pet_emotion(pd, param);
}
- if( HPMHooks.count.HP_clif_pet_emotion_post ) {
- void (*postHookFunc) (struct pet_data *pd, int *param);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_emotion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pet_emotion_post > 0) {
+ void (*postHookFunc) (struct pet_data *pd, int param);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_emotion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pet_emotion_post[hIndex].func;
- postHookFunc(pd, &param);
+ postHookFunc(pd, param);
}
}
return;
}
void HP_clif_pet_food(struct map_session_data *sd, int foodid, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pet_food_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *foodid, int *fail);
+ if (HPMHooks.count.HP_clif_pet_food_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *foodid, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_food_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_food_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pet_food_pre[hIndex].func;
- preHookFunc(sd, &foodid, &fail);
+ preHookFunc(&sd, &foodid, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15258,11 +15390,11 @@ void HP_clif_pet_food(struct map_session_data *sd, int foodid, int fail) {
{
HPMHooks.source.clif.pet_food(sd, foodid, fail);
}
- if( HPMHooks.count.HP_clif_pet_food_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *foodid, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_food_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pet_food_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int foodid, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pet_food_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pet_food_post[hIndex].func;
- postHookFunc(sd, &foodid, &fail);
+ postHookFunc(sd, foodid, fail);
}
}
return;
@@ -15270,16 +15402,16 @@ void HP_clif_pet_food(struct map_session_data *sd, int foodid, int fail) {
int HP_clif_friendslist_toggle_sub(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_friendslist_toggle_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_clif_friendslist_toggle_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_clif_friendslist_toggle_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -15289,9 +15421,9 @@ int HP_clif_friendslist_toggle_sub(struct map_session_data *sd, va_list ap) {
retVal___ = HPMHooks.source.clif.friendslist_toggle_sub(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_clif_friendslist_toggle_sub_post ) {
+ if (HPMHooks.count.HP_clif_friendslist_toggle_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_clif_friendslist_toggle_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -15302,14 +15434,14 @@ int HP_clif_friendslist_toggle_sub(struct map_session_data *sd, va_list ap) {
}
void HP_clif_friendslist_send(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_friendslist_send_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_friendslist_send_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_friendslist_send_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15317,9 +15449,9 @@ void HP_clif_friendslist_send(struct map_session_data *sd) {
{
HPMHooks.source.clif.friendslist_send(sd);
}
- if( HPMHooks.count.HP_clif_friendslist_send_post ) {
+ if (HPMHooks.count.HP_clif_friendslist_send_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_send_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_friendslist_send_post[hIndex].func;
postHookFunc(sd);
}
@@ -15328,14 +15460,14 @@ void HP_clif_friendslist_send(struct map_session_data *sd) {
}
void HP_clif_friendslist_reqack(struct map_session_data *sd, struct map_session_data *f_sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_friendslist_reqack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *f_sd, int *type);
+ if (HPMHooks.count.HP_clif_friendslist_reqack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **f_sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_reqack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_reqack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_friendslist_reqack_pre[hIndex].func;
- preHookFunc(sd, f_sd, &type);
+ preHookFunc(&sd, &f_sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15343,25 +15475,25 @@ void HP_clif_friendslist_reqack(struct map_session_data *sd, struct map_session_
{
HPMHooks.source.clif.friendslist_reqack(sd, f_sd, type);
}
- if( HPMHooks.count.HP_clif_friendslist_reqack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *f_sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_reqack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_friendslist_reqack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *f_sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_reqack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_friendslist_reqack_post[hIndex].func;
- postHookFunc(sd, f_sd, &type);
+ postHookFunc(sd, f_sd, type);
}
}
return;
}
void HP_clif_friendslist_toggle(struct map_session_data *sd, int account_id, int char_id, int online) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_friendslist_toggle_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id, int *char_id, int *online);
+ if (HPMHooks.count.HP_clif_friendslist_toggle_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id, int *char_id, int *online);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_friendslist_toggle_pre[hIndex].func;
- preHookFunc(sd, &account_id, &char_id, &online);
+ preHookFunc(&sd, &account_id, &char_id, &online);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15369,25 +15501,25 @@ void HP_clif_friendslist_toggle(struct map_session_data *sd, int account_id, int
{
HPMHooks.source.clif.friendslist_toggle(sd, account_id, char_id, online);
}
- if( HPMHooks.count.HP_clif_friendslist_toggle_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id, int *char_id, int *online);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_friendslist_toggle_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id, int char_id, int online);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendslist_toggle_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_friendslist_toggle_post[hIndex].func;
- postHookFunc(sd, &account_id, &char_id, &online);
+ postHookFunc(sd, account_id, char_id, online);
}
}
return;
}
void HP_clif_friendlist_req(struct map_session_data *sd, int account_id, int char_id, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_friendlist_req_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id, int *char_id, const char *name);
+ if (HPMHooks.count.HP_clif_friendlist_req_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id, int *char_id, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendlist_req_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendlist_req_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_friendlist_req_pre[hIndex].func;
- preHookFunc(sd, &account_id, &char_id, name);
+ preHookFunc(&sd, &account_id, &char_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15395,25 +15527,25 @@ void HP_clif_friendlist_req(struct map_session_data *sd, int account_id, int cha
{
HPMHooks.source.clif.friendlist_req(sd, account_id, char_id, name);
}
- if( HPMHooks.count.HP_clif_friendlist_req_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id, int *char_id, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendlist_req_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_friendlist_req_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id, int char_id, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_friendlist_req_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_friendlist_req_post[hIndex].func;
- postHookFunc(sd, &account_id, &char_id, name);
+ postHookFunc(sd, account_id, char_id, name);
}
}
return;
}
void HP_clif_GM_kickack(struct map_session_data *sd, int result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_GM_kickack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *result);
+ if (HPMHooks.count.HP_clif_GM_kickack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kickack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kickack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_GM_kickack_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15421,25 +15553,25 @@ void HP_clif_GM_kickack(struct map_session_data *sd, int result) {
{
HPMHooks.source.clif.GM_kickack(sd, result);
}
- if( HPMHooks.count.HP_clif_GM_kickack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kickack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_GM_kickack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kickack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_GM_kickack_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
void HP_clif_GM_kick(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_GM_kick_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_clif_GM_kick_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_GM_kick_pre[hIndex].func;
- preHookFunc(sd, tsd);
+ preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15447,9 +15579,9 @@ void HP_clif_GM_kick(struct map_session_data *sd, struct map_session_data *tsd)
{
HPMHooks.source.clif.GM_kick(sd, tsd);
}
- if( HPMHooks.count.HP_clif_GM_kick_post ) {
+ if (HPMHooks.count.HP_clif_GM_kick_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_kick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_GM_kick_post[hIndex].func;
postHookFunc(sd, tsd);
}
@@ -15458,14 +15590,14 @@ void HP_clif_GM_kick(struct map_session_data *sd, struct map_session_data *tsd)
}
void HP_clif_manner_message(struct map_session_data *sd, uint32 type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_manner_message_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint32 *type);
+ if (HPMHooks.count.HP_clif_manner_message_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint32 *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_manner_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_manner_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_manner_message_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15473,25 +15605,25 @@ void HP_clif_manner_message(struct map_session_data *sd, uint32 type) {
{
HPMHooks.source.clif.manner_message(sd, type);
}
- if( HPMHooks.count.HP_clif_manner_message_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint32 *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_manner_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_manner_message_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint32 type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_manner_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_manner_message_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_GM_silence(struct map_session_data *sd, struct map_session_data *tsd, uint8 type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_GM_silence_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd, uint8 *type);
+ if (HPMHooks.count.HP_clif_GM_silence_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd, uint8 *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_silence_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_silence_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_GM_silence_pre[hIndex].func;
- preHookFunc(sd, tsd, &type);
+ preHookFunc(&sd, &tsd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15499,25 +15631,25 @@ void HP_clif_GM_silence(struct map_session_data *sd, struct map_session_data *ts
{
HPMHooks.source.clif.GM_silence(sd, tsd, type);
}
- if( HPMHooks.count.HP_clif_GM_silence_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd, uint8 *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_silence_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_GM_silence_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *tsd, uint8 type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_GM_silence_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_GM_silence_post[hIndex].func;
- postHookFunc(sd, tsd, &type);
+ postHookFunc(sd, tsd, type);
}
}
return;
}
void HP_clif_account_name(struct map_session_data *sd, int account_id, const char *accname) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_account_name_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id, const char *accname);
+ if (HPMHooks.count.HP_clif_account_name_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id, const char **accname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_account_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_account_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_account_name_pre[hIndex].func;
- preHookFunc(sd, &account_id, accname);
+ preHookFunc(&sd, &account_id, &accname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15525,25 +15657,25 @@ void HP_clif_account_name(struct map_session_data *sd, int account_id, const cha
{
HPMHooks.source.clif.account_name(sd, account_id, accname);
}
- if( HPMHooks.count.HP_clif_account_name_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id, const char *accname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_account_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_account_name_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id, const char *accname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_account_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_account_name_post[hIndex].func;
- postHookFunc(sd, &account_id, accname);
+ postHookFunc(sd, account_id, accname);
}
}
return;
}
void HP_clif_check(int fd, struct map_session_data *pl_sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_check_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *pl_sd);
+ if (HPMHooks.count.HP_clif_check_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **pl_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_check_pre[hIndex].func;
- preHookFunc(&fd, pl_sd);
+ preHookFunc(&fd, &pl_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15551,25 +15683,25 @@ void HP_clif_check(int fd, struct map_session_data *pl_sd) {
{
HPMHooks.source.clif.check(fd, pl_sd);
}
- if( HPMHooks.count.HP_clif_check_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *pl_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_check_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *pl_sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_check_post[hIndex].func;
- postHookFunc(&fd, pl_sd);
+ postHookFunc(fd, pl_sd);
}
}
return;
}
void HP_clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_hominfo_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct homun_data *hd, int *flag);
+ if (HPMHooks.count.HP_clif_hominfo_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct homun_data **hd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hominfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hominfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_hominfo_pre[hIndex].func;
- preHookFunc(sd, hd, &flag);
+ preHookFunc(&sd, &hd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15577,25 +15709,25 @@ void HP_clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int fla
{
HPMHooks.source.clif.hominfo(sd, hd, flag);
}
- if( HPMHooks.count.HP_clif_hominfo_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct homun_data *hd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hominfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_hominfo_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct homun_data *hd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hominfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_hominfo_post[hIndex].func;
- postHookFunc(sd, hd, &flag);
+ postHookFunc(sd, hd, flag);
}
}
return;
}
void HP_clif_homskillinfoblock(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_homskillinfoblock_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_homskillinfoblock_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillinfoblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillinfoblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_homskillinfoblock_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15603,9 +15735,9 @@ void HP_clif_homskillinfoblock(struct map_session_data *sd) {
{
HPMHooks.source.clif.homskillinfoblock(sd);
}
- if( HPMHooks.count.HP_clif_homskillinfoblock_post ) {
+ if (HPMHooks.count.HP_clif_homskillinfoblock_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillinfoblock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillinfoblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_homskillinfoblock_post[hIndex].func;
postHookFunc(sd);
}
@@ -15614,14 +15746,14 @@ void HP_clif_homskillinfoblock(struct map_session_data *sd) {
}
void HP_clif_homskillup(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_homskillup_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_clif_homskillup_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_homskillup_pre[hIndex].func;
- preHookFunc(sd, &skill_id);
+ preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15629,25 +15761,25 @@ void HP_clif_homskillup(struct map_session_data *sd, uint16 skill_id) {
{
HPMHooks.source.clif.homskillup(sd, skill_id);
}
- if( HPMHooks.count.HP_clif_homskillup_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_homskillup_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_homskillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_homskillup_post[hIndex].func;
- postHookFunc(sd, &skill_id);
+ postHookFunc(sd, skill_id);
}
}
return;
}
void HP_clif_hom_food(struct map_session_data *sd, int foodid, int fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_hom_food_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *foodid, int *fail);
+ if (HPMHooks.count.HP_clif_hom_food_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *foodid, int *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hom_food_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hom_food_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_hom_food_pre[hIndex].func;
- preHookFunc(sd, &foodid, &fail);
+ preHookFunc(&sd, &foodid, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15655,25 +15787,25 @@ void HP_clif_hom_food(struct map_session_data *sd, int foodid, int fail) {
{
HPMHooks.source.clif.hom_food(sd, foodid, fail);
}
- if( HPMHooks.count.HP_clif_hom_food_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *foodid, int *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_hom_food_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_hom_food_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int foodid, int fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hom_food_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_hom_food_post[hIndex].func;
- postHookFunc(sd, &foodid, &fail);
+ postHookFunc(sd, foodid, fail);
}
}
return;
}
void HP_clif_send_homdata(struct map_session_data *sd, int state, int param) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_send_homdata_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *state, int *param);
+ if (HPMHooks.count.HP_clif_send_homdata_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *state, int *param);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_homdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_homdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_send_homdata_pre[hIndex].func;
- preHookFunc(sd, &state, &param);
+ preHookFunc(&sd, &state, &param);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15681,25 +15813,25 @@ void HP_clif_send_homdata(struct map_session_data *sd, int state, int param) {
{
HPMHooks.source.clif.send_homdata(sd, state, param);
}
- if( HPMHooks.count.HP_clif_send_homdata_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *state, int *param);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_homdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_send_homdata_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int state, int param);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_homdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_send_homdata_post[hIndex].func;
- postHookFunc(sd, &state, &param);
+ postHookFunc(sd, state, param);
}
}
return;
}
void HP_clif_quest_send_list(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_send_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_quest_send_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_send_list_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15707,9 +15839,9 @@ void HP_clif_quest_send_list(struct map_session_data *sd) {
{
HPMHooks.source.clif.quest_send_list(sd);
}
- if( HPMHooks.count.HP_clif_quest_send_list_post ) {
+ if (HPMHooks.count.HP_clif_quest_send_list_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_send_list_post[hIndex].func;
postHookFunc(sd);
}
@@ -15718,14 +15850,14 @@ void HP_clif_quest_send_list(struct map_session_data *sd) {
}
void HP_clif_quest_send_mission(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_send_mission_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_quest_send_mission_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_mission_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_mission_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_send_mission_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15733,9 +15865,9 @@ void HP_clif_quest_send_mission(struct map_session_data *sd) {
{
HPMHooks.source.clif.quest_send_mission(sd);
}
- if( HPMHooks.count.HP_clif_quest_send_mission_post ) {
+ if (HPMHooks.count.HP_clif_quest_send_mission_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_mission_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_send_mission_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_send_mission_post[hIndex].func;
postHookFunc(sd);
}
@@ -15744,14 +15876,14 @@ void HP_clif_quest_send_mission(struct map_session_data *sd) {
}
void HP_clif_quest_add(struct map_session_data *sd, struct quest *qd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_add_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct quest *qd);
+ if (HPMHooks.count.HP_clif_quest_add_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct quest **qd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_add_pre[hIndex].func;
- preHookFunc(sd, qd);
+ preHookFunc(&sd, &qd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15759,9 +15891,9 @@ void HP_clif_quest_add(struct map_session_data *sd, struct quest *qd) {
{
HPMHooks.source.clif.quest_add(sd, qd);
}
- if( HPMHooks.count.HP_clif_quest_add_post ) {
+ if (HPMHooks.count.HP_clif_quest_add_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct quest *qd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_add_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_add_post[hIndex].func;
postHookFunc(sd, qd);
}
@@ -15770,14 +15902,14 @@ void HP_clif_quest_add(struct map_session_data *sd, struct quest *qd) {
}
void HP_clif_quest_delete(struct map_session_data *sd, int quest_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_delete_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *quest_id);
+ if (HPMHooks.count.HP_clif_quest_delete_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *quest_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_delete_pre[hIndex].func;
- preHookFunc(sd, &quest_id);
+ preHookFunc(&sd, &quest_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15785,25 +15917,25 @@ void HP_clif_quest_delete(struct map_session_data *sd, int quest_id) {
{
HPMHooks.source.clif.quest_delete(sd, quest_id);
}
- if( HPMHooks.count.HP_clif_quest_delete_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *quest_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_quest_delete_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int quest_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_delete_post[hIndex].func;
- postHookFunc(sd, &quest_id);
+ postHookFunc(sd, quest_id);
}
}
return;
}
void HP_clif_quest_update_status(struct map_session_data *sd, int quest_id, bool active) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_update_status_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *quest_id, bool *active);
+ if (HPMHooks.count.HP_clif_quest_update_status_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *quest_id, bool *active);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_status_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_status_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_update_status_pre[hIndex].func;
- preHookFunc(sd, &quest_id, &active);
+ preHookFunc(&sd, &quest_id, &active);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15811,25 +15943,25 @@ void HP_clif_quest_update_status(struct map_session_data *sd, int quest_id, bool
{
HPMHooks.source.clif.quest_update_status(sd, quest_id, active);
}
- if( HPMHooks.count.HP_clif_quest_update_status_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *quest_id, bool *active);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_status_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_quest_update_status_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int quest_id, bool active);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_status_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_update_status_post[hIndex].func;
- postHookFunc(sd, &quest_id, &active);
+ postHookFunc(sd, quest_id, active);
}
}
return;
}
void HP_clif_quest_update_objective(struct map_session_data *sd, struct quest *qd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_update_objective_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct quest *qd);
+ if (HPMHooks.count.HP_clif_quest_update_objective_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct quest **qd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_objective_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_objective_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_update_objective_pre[hIndex].func;
- preHookFunc(sd, qd);
+ preHookFunc(&sd, &qd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15837,9 +15969,9 @@ void HP_clif_quest_update_objective(struct map_session_data *sd, struct quest *q
{
HPMHooks.source.clif.quest_update_objective(sd, qd);
}
- if( HPMHooks.count.HP_clif_quest_update_objective_post ) {
+ if (HPMHooks.count.HP_clif_quest_update_objective_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct quest *qd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_objective_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_update_objective_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_update_objective_post[hIndex].func;
postHookFunc(sd, qd);
}
@@ -15848,14 +15980,14 @@ void HP_clif_quest_update_objective(struct map_session_data *sd, struct quest *q
}
void HP_clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, short state, short color) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_quest_show_event_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *bl, short *state, short *color);
+ if (HPMHooks.count.HP_clif_quest_show_event_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, short *state, short *color);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_show_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_show_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_quest_show_event_pre[hIndex].func;
- preHookFunc(sd, bl, &state, &color);
+ preHookFunc(&sd, &bl, &state, &color);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15863,25 +15995,25 @@ void HP_clif_quest_show_event(struct map_session_data *sd, struct block_list *bl
{
HPMHooks.source.clif.quest_show_event(sd, bl, state, color);
}
- if( HPMHooks.count.HP_clif_quest_show_event_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl, short *state, short *color);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_show_event_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_quest_show_event_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct block_list *bl, short state, short color);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_quest_show_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_quest_show_event_post[hIndex].func;
- postHookFunc(sd, bl, &state, &color);
+ postHookFunc(sd, bl, state, color);
}
}
return;
}
void HP_clif_mail_window(int fd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_window_pre ) {
+ if (HPMHooks.count.HP_clif_mail_window_pre > 0) {
void (*preHookFunc) (int *fd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_window_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_window_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_window_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15889,25 +16021,25 @@ void HP_clif_mail_window(int fd, int flag) {
{
HPMHooks.source.clif.mail_window(fd, flag);
}
- if( HPMHooks.count.HP_clif_mail_window_post ) {
- void (*postHookFunc) (int *fd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_window_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_window_post > 0) {
+ void (*postHookFunc) (int fd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_window_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_window_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_clif_mail_read(struct map_session_data *sd, int mail_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_read_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *mail_id);
+ if (HPMHooks.count.HP_clif_mail_read_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_read_pre[hIndex].func;
- preHookFunc(sd, &mail_id);
+ preHookFunc(&sd, &mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15915,25 +16047,25 @@ void HP_clif_mail_read(struct map_session_data *sd, int mail_id) {
{
HPMHooks.source.clif.mail_read(sd, mail_id);
}
- if( HPMHooks.count.HP_clif_mail_read_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_read_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_read_post[hIndex].func;
- postHookFunc(sd, &mail_id);
+ postHookFunc(sd, mail_id);
}
}
return;
}
void HP_clif_mail_delete(int fd, int mail_id, short fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_delete_pre ) {
+ if (HPMHooks.count.HP_clif_mail_delete_pre > 0) {
void (*preHookFunc) (int *fd, int *mail_id, short *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_delete_pre[hIndex].func;
preHookFunc(&fd, &mail_id, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15941,25 +16073,25 @@ void HP_clif_mail_delete(int fd, int mail_id, short fail) {
{
HPMHooks.source.clif.mail_delete(fd, mail_id, fail);
}
- if( HPMHooks.count.HP_clif_mail_delete_post ) {
- void (*postHookFunc) (int *fd, int *mail_id, short *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_delete_post > 0) {
+ void (*postHookFunc) (int fd, int mail_id, short fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_delete_post[hIndex].func;
- postHookFunc(&fd, &mail_id, &fail);
+ postHookFunc(fd, mail_id, fail);
}
}
return;
}
void HP_clif_mail_return(int fd, int mail_id, short fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_return_pre ) {
+ if (HPMHooks.count.HP_clif_mail_return_pre > 0) {
void (*preHookFunc) (int *fd, int *mail_id, short *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_return_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_return_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_return_pre[hIndex].func;
preHookFunc(&fd, &mail_id, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15967,25 +16099,25 @@ void HP_clif_mail_return(int fd, int mail_id, short fail) {
{
HPMHooks.source.clif.mail_return(fd, mail_id, fail);
}
- if( HPMHooks.count.HP_clif_mail_return_post ) {
- void (*postHookFunc) (int *fd, int *mail_id, short *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_return_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_return_post > 0) {
+ void (*postHookFunc) (int fd, int mail_id, short fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_return_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_return_post[hIndex].func;
- postHookFunc(&fd, &mail_id, &fail);
+ postHookFunc(fd, mail_id, fail);
}
}
return;
}
void HP_clif_mail_send(int fd, bool fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_send_pre ) {
+ if (HPMHooks.count.HP_clif_mail_send_pre > 0) {
void (*preHookFunc) (int *fd, bool *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_send_pre[hIndex].func;
preHookFunc(&fd, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -15993,25 +16125,25 @@ void HP_clif_mail_send(int fd, bool fail) {
{
HPMHooks.source.clif.mail_send(fd, fail);
}
- if( HPMHooks.count.HP_clif_mail_send_post ) {
- void (*postHookFunc) (int *fd, bool *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_send_post > 0) {
+ void (*postHookFunc) (int fd, bool fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_send_post[hIndex].func;
- postHookFunc(&fd, &fail);
+ postHookFunc(fd, fail);
}
}
return;
}
void HP_clif_mail_new(int fd, int mail_id, const char *sender, const char *title) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_new_pre ) {
- void (*preHookFunc) (int *fd, int *mail_id, const char *sender, const char *title);
+ if (HPMHooks.count.HP_clif_mail_new_pre > 0) {
+ void (*preHookFunc) (int *fd, int *mail_id, const char **sender, const char **title);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_new_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_new_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_new_pre[hIndex].func;
- preHookFunc(&fd, &mail_id, sender, title);
+ preHookFunc(&fd, &mail_id, &sender, &title);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16019,25 +16151,25 @@ void HP_clif_mail_new(int fd, int mail_id, const char *sender, const char *title
{
HPMHooks.source.clif.mail_new(fd, mail_id, sender, title);
}
- if( HPMHooks.count.HP_clif_mail_new_post ) {
- void (*postHookFunc) (int *fd, int *mail_id, const char *sender, const char *title);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_new_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_new_post > 0) {
+ void (*postHookFunc) (int fd, int mail_id, const char *sender, const char *title);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_new_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_new_post[hIndex].func;
- postHookFunc(&fd, &mail_id, sender, title);
+ postHookFunc(fd, mail_id, sender, title);
}
}
return;
}
void HP_clif_mail_refreshinbox(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_refreshinbox_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_mail_refreshinbox_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_refreshinbox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_refreshinbox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_refreshinbox_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16045,9 +16177,9 @@ void HP_clif_mail_refreshinbox(struct map_session_data *sd) {
{
HPMHooks.source.clif.mail_refreshinbox(sd);
}
- if( HPMHooks.count.HP_clif_mail_refreshinbox_post ) {
+ if (HPMHooks.count.HP_clif_mail_refreshinbox_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_refreshinbox_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_refreshinbox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_refreshinbox_post[hIndex].func;
postHookFunc(sd);
}
@@ -16056,14 +16188,14 @@ void HP_clif_mail_refreshinbox(struct map_session_data *sd) {
}
void HP_clif_mail_getattachment(int fd, uint8 flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_getattachment_pre ) {
+ if (HPMHooks.count.HP_clif_mail_getattachment_pre > 0) {
void (*preHookFunc) (int *fd, uint8 *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_getattachment_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_getattachment_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_getattachment_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16071,25 +16203,25 @@ void HP_clif_mail_getattachment(int fd, uint8 flag) {
{
HPMHooks.source.clif.mail_getattachment(fd, flag);
}
- if( HPMHooks.count.HP_clif_mail_getattachment_post ) {
- void (*postHookFunc) (int *fd, uint8 *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_getattachment_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_getattachment_post > 0) {
+ void (*postHookFunc) (int fd, uint8 flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_getattachment_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_getattachment_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_clif_mail_setattachment(int fd, int index, uint8 flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mail_setattachment_pre ) {
+ if (HPMHooks.count.HP_clif_mail_setattachment_pre > 0) {
void (*preHookFunc) (int *fd, int *index, uint8 *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_setattachment_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_setattachment_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mail_setattachment_pre[hIndex].func;
preHookFunc(&fd, &index, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16097,25 +16229,25 @@ void HP_clif_mail_setattachment(int fd, int index, uint8 flag) {
{
HPMHooks.source.clif.mail_setattachment(fd, index, flag);
}
- if( HPMHooks.count.HP_clif_mail_setattachment_post ) {
- void (*postHookFunc) (int *fd, int *index, uint8 *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_setattachment_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mail_setattachment_post > 0) {
+ void (*postHookFunc) (int fd, int index, uint8 flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mail_setattachment_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mail_setattachment_post[hIndex].func;
- postHookFunc(&fd, &index, &flag);
+ postHookFunc(fd, index, flag);
}
}
return;
}
void HP_clif_auction_openwindow(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_auction_openwindow_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_auction_openwindow_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_openwindow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_openwindow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_auction_openwindow_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16123,25 +16255,25 @@ void HP_clif_auction_openwindow(struct map_session_data *sd) {
{
HPMHooks.source.clif.auction_openwindow(sd);
}
- if( HPMHooks.count.HP_clif_auction_openwindow_post ) {
+ if (HPMHooks.count.HP_clif_auction_openwindow_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_openwindow_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_openwindow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_auction_openwindow_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-void HP_clif_auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf) {
+void HP_clif_auction_results(struct map_session_data *sd, short count, short pages, const uint8 *buf) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_auction_results_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *count, short *pages, uint8 *buf);
+ if (HPMHooks.count.HP_clif_auction_results_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *count, short *pages, const uint8 **buf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_results_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_results_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_auction_results_pre[hIndex].func;
- preHookFunc(sd, &count, &pages, buf);
+ preHookFunc(&sd, &count, &pages, &buf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16149,25 +16281,25 @@ void HP_clif_auction_results(struct map_session_data *sd, short count, short pag
{
HPMHooks.source.clif.auction_results(sd, count, pages, buf);
}
- if( HPMHooks.count.HP_clif_auction_results_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *count, short *pages, uint8 *buf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_results_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_auction_results_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short count, short pages, const uint8 *buf);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_results_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_auction_results_post[hIndex].func;
- postHookFunc(sd, &count, &pages, buf);
+ postHookFunc(sd, count, pages, buf);
}
}
return;
}
void HP_clif_auction_message(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_auction_message_pre ) {
+ if (HPMHooks.count.HP_clif_auction_message_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_auction_message_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16175,25 +16307,25 @@ void HP_clif_auction_message(int fd, unsigned char flag) {
{
HPMHooks.source.clif.auction_message(fd, flag);
}
- if( HPMHooks.count.HP_clif_auction_message_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_auction_message_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_auction_message_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_clif_auction_close(int fd, unsigned char flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_auction_close_pre ) {
+ if (HPMHooks.count.HP_clif_auction_close_pre > 0) {
void (*preHookFunc) (int *fd, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_auction_close_pre[hIndex].func;
preHookFunc(&fd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16201,25 +16333,25 @@ void HP_clif_auction_close(int fd, unsigned char flag) {
{
HPMHooks.source.clif.auction_close(fd, flag);
}
- if( HPMHooks.count.HP_clif_auction_close_post ) {
- void (*postHookFunc) (int *fd, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_auction_close_post > 0) {
+ void (*postHookFunc) (int fd, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_auction_close_post[hIndex].func;
- postHookFunc(&fd, &flag);
+ postHookFunc(fd, flag);
}
}
return;
}
void HP_clif_auction_setitem(int fd, int index, bool fail) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_auction_setitem_pre ) {
+ if (HPMHooks.count.HP_clif_auction_setitem_pre > 0) {
void (*preHookFunc) (int *fd, int *index, bool *fail);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_setitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_setitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_auction_setitem_pre[hIndex].func;
preHookFunc(&fd, &index, &fail);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16227,25 +16359,25 @@ void HP_clif_auction_setitem(int fd, int index, bool fail) {
{
HPMHooks.source.clif.auction_setitem(fd, index, fail);
}
- if( HPMHooks.count.HP_clif_auction_setitem_post ) {
- void (*postHookFunc) (int *fd, int *index, bool *fail);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_setitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_auction_setitem_post > 0) {
+ void (*postHookFunc) (int fd, int index, bool fail);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_auction_setitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_auction_setitem_post[hIndex].func;
- postHookFunc(&fd, &index, &fail);
+ postHookFunc(fd, index, fail);
}
}
return;
}
void HP_clif_mercenary_info(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mercenary_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_mercenary_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mercenary_info_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16253,9 +16385,9 @@ void HP_clif_mercenary_info(struct map_session_data *sd) {
{
HPMHooks.source.clif.mercenary_info(sd);
}
- if( HPMHooks.count.HP_clif_mercenary_info_post ) {
+ if (HPMHooks.count.HP_clif_mercenary_info_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_info_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mercenary_info_post[hIndex].func;
postHookFunc(sd);
}
@@ -16264,14 +16396,14 @@ void HP_clif_mercenary_info(struct map_session_data *sd) {
}
void HP_clif_mercenary_skillblock(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mercenary_skillblock_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_mercenary_skillblock_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_skillblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_skillblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mercenary_skillblock_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16279,9 +16411,9 @@ void HP_clif_mercenary_skillblock(struct map_session_data *sd) {
{
HPMHooks.source.clif.mercenary_skillblock(sd);
}
- if( HPMHooks.count.HP_clif_mercenary_skillblock_post ) {
+ if (HPMHooks.count.HP_clif_mercenary_skillblock_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_skillblock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_skillblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mercenary_skillblock_post[hIndex].func;
postHookFunc(sd);
}
@@ -16290,14 +16422,14 @@ void HP_clif_mercenary_skillblock(struct map_session_data *sd) {
}
void HP_clif_mercenary_message(struct map_session_data *sd, int message) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mercenary_message_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *message);
+ if (HPMHooks.count.HP_clif_mercenary_message_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mercenary_message_pre[hIndex].func;
- preHookFunc(sd, &message);
+ preHookFunc(&sd, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16305,25 +16437,25 @@ void HP_clif_mercenary_message(struct map_session_data *sd, int message) {
{
HPMHooks.source.clif.mercenary_message(sd, message);
}
- if( HPMHooks.count.HP_clif_mercenary_message_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mercenary_message_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int message);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mercenary_message_post[hIndex].func;
- postHookFunc(sd, &message);
+ postHookFunc(sd, message);
}
}
return;
}
void HP_clif_mercenary_updatestatus(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_mercenary_updatestatus_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_mercenary_updatestatus_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_updatestatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_updatestatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_mercenary_updatestatus_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16331,25 +16463,25 @@ void HP_clif_mercenary_updatestatus(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.mercenary_updatestatus(sd, type);
}
- if( HPMHooks.count.HP_clif_mercenary_updatestatus_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_updatestatus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_mercenary_updatestatus_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mercenary_updatestatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_mercenary_updatestatus_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_rental_time(int fd, int nameid, int seconds) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_rental_time_pre ) {
+ if (HPMHooks.count.HP_clif_rental_time_pre > 0) {
void (*preHookFunc) (int *fd, int *nameid, int *seconds);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_time_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_time_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_rental_time_pre[hIndex].func;
preHookFunc(&fd, &nameid, &seconds);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16357,25 +16489,25 @@ void HP_clif_rental_time(int fd, int nameid, int seconds) {
{
HPMHooks.source.clif.rental_time(fd, nameid, seconds);
}
- if( HPMHooks.count.HP_clif_rental_time_post ) {
- void (*postHookFunc) (int *fd, int *nameid, int *seconds);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_time_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_rental_time_post > 0) {
+ void (*postHookFunc) (int fd, int nameid, int seconds);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_time_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_rental_time_post[hIndex].func;
- postHookFunc(&fd, &nameid, &seconds);
+ postHookFunc(fd, nameid, seconds);
}
}
return;
}
void HP_clif_rental_expired(int fd, int index, int nameid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_rental_expired_pre ) {
+ if (HPMHooks.count.HP_clif_rental_expired_pre > 0) {
void (*preHookFunc) (int *fd, int *index, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_expired_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_expired_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_rental_expired_pre[hIndex].func;
preHookFunc(&fd, &index, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16383,25 +16515,25 @@ void HP_clif_rental_expired(int fd, int index, int nameid) {
{
HPMHooks.source.clif.rental_expired(fd, index, nameid);
}
- if( HPMHooks.count.HP_clif_rental_expired_post ) {
- void (*postHookFunc) (int *fd, int *index, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_expired_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_rental_expired_post > 0) {
+ void (*postHookFunc) (int fd, int index, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_rental_expired_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_rental_expired_post[hIndex].func;
- postHookFunc(&fd, &index, &nameid);
+ postHookFunc(fd, index, nameid);
}
}
return;
}
void HP_clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingRegisterAck_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_PartyBookingRegisterAck_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRegisterAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRegisterAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingRegisterAck_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16409,25 +16541,25 @@ void HP_clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.PartyBookingRegisterAck(sd, flag);
}
- if( HPMHooks.count.HP_clif_PartyBookingRegisterAck_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRegisterAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingRegisterAck_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRegisterAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingRegisterAck_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_PartyBookingDeleteAck(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingDeleteAck_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_PartyBookingDeleteAck_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingDeleteAck_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16435,25 +16567,25 @@ void HP_clif_PartyBookingDeleteAck(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.PartyBookingDeleteAck(sd, flag);
}
- if( HPMHooks.count.HP_clif_PartyBookingDeleteAck_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingDeleteAck_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingDeleteAck_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info **results, int count, bool more_result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingSearchAck_pre ) {
- void (*preHookFunc) (int *fd, struct party_booking_ad_info **results, int *count, bool *more_result);
+ if (HPMHooks.count.HP_clif_PartyBookingSearchAck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct party_booking_ad_info ***results, int *count, bool *more_result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSearchAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSearchAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingSearchAck_pre[hIndex].func;
- preHookFunc(&fd, results, &count, &more_result);
+ preHookFunc(&fd, &results, &count, &more_result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16461,25 +16593,25 @@ void HP_clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info **result
{
HPMHooks.source.clif.PartyBookingSearchAck(fd, results, count, more_result);
}
- if( HPMHooks.count.HP_clif_PartyBookingSearchAck_post ) {
- void (*postHookFunc) (int *fd, struct party_booking_ad_info **results, int *count, bool *more_result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSearchAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingSearchAck_post > 0) {
+ void (*postHookFunc) (int fd, struct party_booking_ad_info **results, int count, bool more_result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSearchAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingSearchAck_post[hIndex].func;
- postHookFunc(&fd, results, &count, &more_result);
+ postHookFunc(fd, results, count, more_result);
}
}
return;
}
void HP_clif_PartyBookingUpdateNotify(struct map_session_data *sd, struct party_booking_ad_info *pb_ad) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingUpdateNotify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+ if (HPMHooks.count.HP_clif_PartyBookingUpdateNotify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingUpdateNotify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingUpdateNotify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingUpdateNotify_pre[hIndex].func;
- preHookFunc(sd, pb_ad);
+ preHookFunc(&sd, &pb_ad);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16487,9 +16619,9 @@ void HP_clif_PartyBookingUpdateNotify(struct map_session_data *sd, struct party_
{
HPMHooks.source.clif.PartyBookingUpdateNotify(sd, pb_ad);
}
- if( HPMHooks.count.HP_clif_PartyBookingUpdateNotify_post ) {
+ if (HPMHooks.count.HP_clif_PartyBookingUpdateNotify_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingUpdateNotify_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingUpdateNotify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingUpdateNotify_post[hIndex].func;
postHookFunc(sd, pb_ad);
}
@@ -16498,14 +16630,14 @@ void HP_clif_PartyBookingUpdateNotify(struct map_session_data *sd, struct party_
}
void HP_clif_PartyBookingDeleteNotify(struct map_session_data *sd, int index) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingDeleteNotify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index);
+ if (HPMHooks.count.HP_clif_PartyBookingDeleteNotify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteNotify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteNotify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingDeleteNotify_pre[hIndex].func;
- preHookFunc(sd, &index);
+ preHookFunc(&sd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16513,25 +16645,25 @@ void HP_clif_PartyBookingDeleteNotify(struct map_session_data *sd, int index) {
{
HPMHooks.source.clif.PartyBookingDeleteNotify(sd, index);
}
- if( HPMHooks.count.HP_clif_PartyBookingDeleteNotify_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteNotify_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingDeleteNotify_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingDeleteNotify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingDeleteNotify_post[hIndex].func;
- postHookFunc(sd, &index);
+ postHookFunc(sd, index);
}
}
return;
}
void HP_clif_PartyBookingInsertNotify(struct map_session_data *sd, struct party_booking_ad_info *pb_ad) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingInsertNotify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+ if (HPMHooks.count.HP_clif_PartyBookingInsertNotify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingInsertNotify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingInsertNotify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingInsertNotify_pre[hIndex].func;
- preHookFunc(sd, pb_ad);
+ preHookFunc(&sd, &pb_ad);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16539,9 +16671,9 @@ void HP_clif_PartyBookingInsertNotify(struct map_session_data *sd, struct party_
{
HPMHooks.source.clif.PartyBookingInsertNotify(sd, pb_ad);
}
- if( HPMHooks.count.HP_clif_PartyBookingInsertNotify_post ) {
+ if (HPMHooks.count.HP_clif_PartyBookingInsertNotify_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingInsertNotify_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingInsertNotify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingInsertNotify_post[hIndex].func;
postHookFunc(sd, pb_ad);
}
@@ -16550,14 +16682,14 @@ void HP_clif_PartyBookingInsertNotify(struct map_session_data *sd, struct party_
}
void HP_clif_PartyRecruitRegisterAck(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyRecruitRegisterAck_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_PartyRecruitRegisterAck_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitRegisterAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitRegisterAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyRecruitRegisterAck_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16565,25 +16697,25 @@ void HP_clif_PartyRecruitRegisterAck(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.PartyRecruitRegisterAck(sd, flag);
}
- if( HPMHooks.count.HP_clif_PartyRecruitRegisterAck_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitRegisterAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyRecruitRegisterAck_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitRegisterAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyRecruitRegisterAck_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_PartyRecruitDeleteAck(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyRecruitDeleteAck_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_clif_PartyRecruitDeleteAck_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyRecruitDeleteAck_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16591,25 +16723,25 @@ void HP_clif_PartyRecruitDeleteAck(struct map_session_data *sd, int flag) {
{
HPMHooks.source.clif.PartyRecruitDeleteAck(sd, flag);
}
- if( HPMHooks.count.HP_clif_PartyRecruitDeleteAck_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyRecruitDeleteAck_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyRecruitDeleteAck_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_clif_PartyRecruitSearchAck(int fd, struct party_booking_ad_info **results, int count, bool more_result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyRecruitSearchAck_pre ) {
- void (*preHookFunc) (int *fd, struct party_booking_ad_info **results, int *count, bool *more_result);
+ if (HPMHooks.count.HP_clif_PartyRecruitSearchAck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct party_booking_ad_info ***results, int *count, bool *more_result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitSearchAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitSearchAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyRecruitSearchAck_pre[hIndex].func;
- preHookFunc(&fd, results, &count, &more_result);
+ preHookFunc(&fd, &results, &count, &more_result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16617,25 +16749,25 @@ void HP_clif_PartyRecruitSearchAck(int fd, struct party_booking_ad_info **result
{
HPMHooks.source.clif.PartyRecruitSearchAck(fd, results, count, more_result);
}
- if( HPMHooks.count.HP_clif_PartyRecruitSearchAck_post ) {
- void (*postHookFunc) (int *fd, struct party_booking_ad_info **results, int *count, bool *more_result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitSearchAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyRecruitSearchAck_post > 0) {
+ void (*postHookFunc) (int fd, struct party_booking_ad_info **results, int count, bool more_result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitSearchAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyRecruitSearchAck_post[hIndex].func;
- postHookFunc(&fd, results, &count, &more_result);
+ postHookFunc(fd, results, count, more_result);
}
}
return;
}
void HP_clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_booking_ad_info *pb_ad) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+ if (HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyRecruitUpdateNotify_pre[hIndex].func;
- preHookFunc(sd, pb_ad);
+ preHookFunc(&sd, &pb_ad);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16643,9 +16775,9 @@ void HP_clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_
{
HPMHooks.source.clif.PartyRecruitUpdateNotify(sd, pb_ad);
}
- if( HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_post ) {
+ if (HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitUpdateNotify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyRecruitUpdateNotify_post[hIndex].func;
postHookFunc(sd, pb_ad);
}
@@ -16654,14 +16786,14 @@ void HP_clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_
}
void HP_clif_PartyRecruitDeleteNotify(struct map_session_data *sd, int index) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *index);
+ if (HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyRecruitDeleteNotify_pre[hIndex].func;
- preHookFunc(sd, &index);
+ preHookFunc(&sd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16669,25 +16801,25 @@ void HP_clif_PartyRecruitDeleteNotify(struct map_session_data *sd, int index) {
{
HPMHooks.source.clif.PartyRecruitDeleteNotify(sd, index);
}
- if( HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitDeleteNotify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyRecruitDeleteNotify_post[hIndex].func;
- postHookFunc(sd, &index);
+ postHookFunc(sd, index);
}
}
return;
}
void HP_clif_PartyRecruitInsertNotify(struct map_session_data *sd, struct party_booking_ad_info *pb_ad) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyRecruitInsertNotify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
+ if (HPMHooks.count.HP_clif_PartyRecruitInsertNotify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct party_booking_ad_info **pb_ad);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitInsertNotify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitInsertNotify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyRecruitInsertNotify_pre[hIndex].func;
- preHookFunc(sd, pb_ad);
+ preHookFunc(&sd, &pb_ad);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16695,9 +16827,9 @@ void HP_clif_PartyRecruitInsertNotify(struct map_session_data *sd, struct party_
{
HPMHooks.source.clif.PartyRecruitInsertNotify(sd, pb_ad);
}
- if( HPMHooks.count.HP_clif_PartyRecruitInsertNotify_post ) {
+ if (HPMHooks.count.HP_clif_PartyRecruitInsertNotify_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct party_booking_ad_info *pb_ad);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitInsertNotify_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyRecruitInsertNotify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyRecruitInsertNotify_post[hIndex].func;
postHookFunc(sd, pb_ad);
}
@@ -16706,14 +16838,14 @@ void HP_clif_PartyRecruitInsertNotify(struct map_session_data *sd, struct party_
}
void HP_clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_pre ) {
- void (*preHookFunc) (int *index, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_pre > 0) {
+ void (*preHookFunc) (int *index, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingVolunteerInfo_pre[hIndex].func;
- preHookFunc(&index, sd);
+ preHookFunc(&index, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16721,25 +16853,25 @@ void HP_clif_PartyBookingVolunteerInfo(int index, struct map_session_data *sd) {
{
HPMHooks.source.clif.PartyBookingVolunteerInfo(index, sd);
}
- if( HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_post ) {
- void (*postHookFunc) (int *index, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_post > 0) {
+ void (*postHookFunc) (int index, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingVolunteerInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingVolunteerInfo_post[hIndex].func;
- postHookFunc(&index, sd);
+ postHookFunc(index, sd);
}
}
return;
}
void HP_clif_PartyBookingRefuseVolunteer(unsigned int aid, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_pre ) {
- void (*preHookFunc) (unsigned int *aid, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_pre > 0) {
+ void (*preHookFunc) (unsigned int *aid, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingRefuseVolunteer_pre[hIndex].func;
- preHookFunc(&aid, sd);
+ preHookFunc(&aid, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16747,25 +16879,25 @@ void HP_clif_PartyBookingRefuseVolunteer(unsigned int aid, struct map_session_da
{
HPMHooks.source.clif.PartyBookingRefuseVolunteer(aid, sd);
}
- if( HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_post ) {
- void (*postHookFunc) (unsigned int *aid, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_post > 0) {
+ void (*postHookFunc) (unsigned int aid, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingRefuseVolunteer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingRefuseVolunteer_post[hIndex].func;
- postHookFunc(&aid, sd);
+ postHookFunc(aid, sd);
}
}
return;
}
void HP_clif_PartyBookingCancelVolunteer(int index, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_pre ) {
- void (*preHookFunc) (int *index, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_pre > 0) {
+ void (*preHookFunc) (int *index, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingCancelVolunteer_pre[hIndex].func;
- preHookFunc(&index, sd);
+ preHookFunc(&index, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16773,25 +16905,25 @@ void HP_clif_PartyBookingCancelVolunteer(int index, struct map_session_data *sd)
{
HPMHooks.source.clif.PartyBookingCancelVolunteer(index, sd);
}
- if( HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_post ) {
- void (*postHookFunc) (int *index, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_post > 0) {
+ void (*postHookFunc) (int index, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingCancelVolunteer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingCancelVolunteer_post[hIndex].func;
- postHookFunc(&index, sd);
+ postHookFunc(index, sd);
}
}
return;
}
void HP_clif_PartyBookingAddFilteringList(int index, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingAddFilteringList_pre ) {
- void (*preHookFunc) (int *index, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PartyBookingAddFilteringList_pre > 0) {
+ void (*preHookFunc) (int *index, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingAddFilteringList_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingAddFilteringList_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingAddFilteringList_pre[hIndex].func;
- preHookFunc(&index, sd);
+ preHookFunc(&index, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16799,25 +16931,25 @@ void HP_clif_PartyBookingAddFilteringList(int index, struct map_session_data *sd
{
HPMHooks.source.clif.PartyBookingAddFilteringList(index, sd);
}
- if( HPMHooks.count.HP_clif_PartyBookingAddFilteringList_post ) {
- void (*postHookFunc) (int *index, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingAddFilteringList_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingAddFilteringList_post > 0) {
+ void (*postHookFunc) (int index, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingAddFilteringList_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingAddFilteringList_post[hIndex].func;
- postHookFunc(&index, sd);
+ postHookFunc(index, sd);
}
}
return;
}
void HP_clif_PartyBookingSubFilteringList(int gid, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_PartyBookingSubFilteringList_pre ) {
- void (*preHookFunc) (int *gid, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_PartyBookingSubFilteringList_pre > 0) {
+ void (*preHookFunc) (int *gid, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSubFilteringList_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSubFilteringList_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_PartyBookingSubFilteringList_pre[hIndex].func;
- preHookFunc(&gid, sd);
+ preHookFunc(&gid, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16825,25 +16957,25 @@ void HP_clif_PartyBookingSubFilteringList(int gid, struct map_session_data *sd)
{
HPMHooks.source.clif.PartyBookingSubFilteringList(gid, sd);
}
- if( HPMHooks.count.HP_clif_PartyBookingSubFilteringList_post ) {
- void (*postHookFunc) (int *gid, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSubFilteringList_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_PartyBookingSubFilteringList_post > 0) {
+ void (*postHookFunc) (int gid, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_PartyBookingSubFilteringList_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_PartyBookingSubFilteringList_post[hIndex].func;
- postHookFunc(&gid, sd);
+ postHookFunc(gid, sd);
}
}
return;
}
void HP_clif_buyingstore_open(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_open_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_buyingstore_open_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_open_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16851,9 +16983,9 @@ void HP_clif_buyingstore_open(struct map_session_data *sd) {
{
HPMHooks.source.clif.buyingstore_open(sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_open_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_open_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_open_post[hIndex].func;
postHookFunc(sd);
}
@@ -16862,14 +16994,14 @@ void HP_clif_buyingstore_open(struct map_session_data *sd) {
}
void HP_clif_buyingstore_open_failed(struct map_session_data *sd, unsigned short result, unsigned int weight) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_open_failed_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *result, unsigned int *weight);
+ if (HPMHooks.count.HP_clif_buyingstore_open_failed_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *result, unsigned int *weight);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_open_failed_pre[hIndex].func;
- preHookFunc(sd, &result, &weight);
+ preHookFunc(&sd, &result, &weight);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16877,25 +17009,25 @@ void HP_clif_buyingstore_open_failed(struct map_session_data *sd, unsigned short
{
HPMHooks.source.clif.buyingstore_open_failed(sd, result, weight);
}
- if( HPMHooks.count.HP_clif_buyingstore_open_failed_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *result, unsigned int *weight);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_buyingstore_open_failed_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short result, unsigned int weight);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_open_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_open_failed_post[hIndex].func;
- postHookFunc(sd, &result, &weight);
+ postHookFunc(sd, result, weight);
}
}
return;
}
void HP_clif_buyingstore_myitemlist(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_myitemlist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_buyingstore_myitemlist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_myitemlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_myitemlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_myitemlist_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16903,9 +17035,9 @@ void HP_clif_buyingstore_myitemlist(struct map_session_data *sd) {
{
HPMHooks.source.clif.buyingstore_myitemlist(sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_myitemlist_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_myitemlist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_myitemlist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_myitemlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_myitemlist_post[hIndex].func;
postHookFunc(sd);
}
@@ -16914,14 +17046,14 @@ void HP_clif_buyingstore_myitemlist(struct map_session_data *sd) {
}
void HP_clif_buyingstore_entry(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_entry_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_buyingstore_entry_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_entry_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16929,9 +17061,9 @@ void HP_clif_buyingstore_entry(struct map_session_data *sd) {
{
HPMHooks.source.clif.buyingstore_entry(sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_entry_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_entry_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_entry_post[hIndex].func;
postHookFunc(sd);
}
@@ -16940,14 +17072,14 @@ void HP_clif_buyingstore_entry(struct map_session_data *sd) {
}
void HP_clif_buyingstore_entry_single(struct map_session_data *sd, struct map_session_data *pl_sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_entry_single_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *pl_sd);
+ if (HPMHooks.count.HP_clif_buyingstore_entry_single_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **pl_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_entry_single_pre[hIndex].func;
- preHookFunc(sd, pl_sd);
+ preHookFunc(&sd, &pl_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16955,9 +17087,9 @@ void HP_clif_buyingstore_entry_single(struct map_session_data *sd, struct map_se
{
HPMHooks.source.clif.buyingstore_entry_single(sd, pl_sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_entry_single_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_entry_single_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *pl_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_single_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_entry_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_entry_single_post[hIndex].func;
postHookFunc(sd, pl_sd);
}
@@ -16966,14 +17098,14 @@ void HP_clif_buyingstore_entry_single(struct map_session_data *sd, struct map_se
}
void HP_clif_buyingstore_disappear_entry(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_disappear_entry_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_buyingstore_disappear_entry_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_disappear_entry_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -16981,9 +17113,9 @@ void HP_clif_buyingstore_disappear_entry(struct map_session_data *sd) {
{
HPMHooks.source.clif.buyingstore_disappear_entry(sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_disappear_entry_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_disappear_entry_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_disappear_entry_post[hIndex].func;
postHookFunc(sd);
}
@@ -16992,14 +17124,14 @@ void HP_clif_buyingstore_disappear_entry(struct map_session_data *sd) {
}
void HP_clif_buyingstore_disappear_entry_single(struct map_session_data *sd, struct map_session_data *pl_sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *pl_sd);
+ if (HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **pl_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_disappear_entry_single_pre[hIndex].func;
- preHookFunc(sd, pl_sd);
+ preHookFunc(&sd, &pl_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17007,9 +17139,9 @@ void HP_clif_buyingstore_disappear_entry_single(struct map_session_data *sd, str
{
HPMHooks.source.clif.buyingstore_disappear_entry_single(sd, pl_sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *pl_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_disappear_entry_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_disappear_entry_single_post[hIndex].func;
postHookFunc(sd, pl_sd);
}
@@ -17018,14 +17150,14 @@ void HP_clif_buyingstore_disappear_entry_single(struct map_session_data *sd, str
}
void HP_clif_buyingstore_itemlist(struct map_session_data *sd, struct map_session_data *pl_sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_itemlist_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *pl_sd);
+ if (HPMHooks.count.HP_clif_buyingstore_itemlist_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **pl_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_itemlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_itemlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_itemlist_pre[hIndex].func;
- preHookFunc(sd, pl_sd);
+ preHookFunc(&sd, &pl_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17033,9 +17165,9 @@ void HP_clif_buyingstore_itemlist(struct map_session_data *sd, struct map_sessio
{
HPMHooks.source.clif.buyingstore_itemlist(sd, pl_sd);
}
- if( HPMHooks.count.HP_clif_buyingstore_itemlist_post ) {
+ if (HPMHooks.count.HP_clif_buyingstore_itemlist_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *pl_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_itemlist_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_itemlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_itemlist_post[hIndex].func;
postHookFunc(sd, pl_sd);
}
@@ -17044,14 +17176,14 @@ void HP_clif_buyingstore_itemlist(struct map_session_data *sd, struct map_sessio
}
void HP_clif_buyingstore_trade_failed_buyer(struct map_session_data *sd, short result) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *result);
+ if (HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *result);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_trade_failed_buyer_pre[hIndex].func;
- preHookFunc(sd, &result);
+ preHookFunc(&sd, &result);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17059,51 +17191,51 @@ void HP_clif_buyingstore_trade_failed_buyer(struct map_session_data *sd, short r
{
HPMHooks.source.clif.buyingstore_trade_failed_buyer(sd, result);
}
- if( HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *result);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short result);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_buyer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_trade_failed_buyer_post[hIndex].func;
- postHookFunc(sd, &result);
+ postHookFunc(sd, result);
}
}
return;
}
-void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount) {
+void HP_clif_buyingstore_update_item(struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_update_item_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *nameid, unsigned short *amount);
+ if (HPMHooks.count.HP_clif_buyingstore_update_item_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid, unsigned short *amount, uint32 *char_id, int *zeny);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_pre[hIndex].func;
- preHookFunc(sd, &nameid, &amount);
+ preHookFunc(&sd, &nameid, &amount, &char_id, &zeny);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount);
+ HPMHooks.source.clif.buyingstore_update_item(sd, nameid, amount, char_id, zeny);
}
- if( HPMHooks.count.HP_clif_buyingstore_update_item_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *nameid, unsigned short *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_buyingstore_update_item_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_update_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_update_item_post[hIndex].func;
- postHookFunc(sd, &nameid, &amount);
+ postHookFunc(sd, nameid, amount, char_id, zeny);
}
}
return;
}
void HP_clif_buyingstore_delete_item(struct map_session_data *sd, short index, unsigned short amount, int price) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_delete_item_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *index, unsigned short *amount, int *price);
+ if (HPMHooks.count.HP_clif_buyingstore_delete_item_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *index, unsigned short *amount, int *price);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_delete_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_delete_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_delete_item_pre[hIndex].func;
- preHookFunc(sd, &index, &amount, &price);
+ preHookFunc(&sd, &index, &amount, &price);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17111,25 +17243,25 @@ void HP_clif_buyingstore_delete_item(struct map_session_data *sd, short index, u
{
HPMHooks.source.clif.buyingstore_delete_item(sd, index, amount, price);
}
- if( HPMHooks.count.HP_clif_buyingstore_delete_item_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *index, unsigned short *amount, int *price);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_delete_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_buyingstore_delete_item_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short index, unsigned short amount, int price);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_delete_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_delete_item_post[hIndex].func;
- postHookFunc(sd, &index, &amount, &price);
+ postHookFunc(sd, index, amount, price);
}
}
return;
}
void HP_clif_buyingstore_trade_failed_seller(struct map_session_data *sd, short result, unsigned short nameid) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *result, unsigned short *nameid);
+ if (HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *result, unsigned short *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_buyingstore_trade_failed_seller_pre[hIndex].func;
- preHookFunc(sd, &result, &nameid);
+ preHookFunc(&sd, &result, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17137,25 +17269,25 @@ void HP_clif_buyingstore_trade_failed_seller(struct map_session_data *sd, short
{
HPMHooks.source.clif.buyingstore_trade_failed_seller(sd, result, nameid);
}
- if( HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *result, unsigned short *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short result, unsigned short nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_buyingstore_trade_failed_seller_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_buyingstore_trade_failed_seller_post[hIndex].func;
- postHookFunc(sd, &result, &nameid);
+ postHookFunc(sd, result, nameid);
}
}
return;
}
void HP_clif_search_store_info_ack(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_search_store_info_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_search_store_info_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_search_store_info_ack_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17163,9 +17295,9 @@ void HP_clif_search_store_info_ack(struct map_session_data *sd) {
{
HPMHooks.source.clif.search_store_info_ack(sd);
}
- if( HPMHooks.count.HP_clif_search_store_info_ack_post ) {
+ if (HPMHooks.count.HP_clif_search_store_info_ack_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_ack_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_search_store_info_ack_post[hIndex].func;
postHookFunc(sd);
}
@@ -17174,14 +17306,14 @@ void HP_clif_search_store_info_ack(struct map_session_data *sd) {
}
void HP_clif_search_store_info_failed(struct map_session_data *sd, unsigned char reason) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_search_store_info_failed_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *reason);
+ if (HPMHooks.count.HP_clif_search_store_info_failed_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *reason);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_failed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_failed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_search_store_info_failed_pre[hIndex].func;
- preHookFunc(sd, &reason);
+ preHookFunc(&sd, &reason);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17189,25 +17321,25 @@ void HP_clif_search_store_info_failed(struct map_session_data *sd, unsigned char
{
HPMHooks.source.clif.search_store_info_failed(sd, reason);
}
- if( HPMHooks.count.HP_clif_search_store_info_failed_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *reason);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_failed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_search_store_info_failed_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char reason);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_failed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_search_store_info_failed_post[hIndex].func;
- postHookFunc(sd, &reason);
+ postHookFunc(sd, reason);
}
}
return;
}
void HP_clif_open_search_store_info(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_open_search_store_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_open_search_store_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_search_store_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_search_store_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_open_search_store_info_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17215,9 +17347,9 @@ void HP_clif_open_search_store_info(struct map_session_data *sd) {
{
HPMHooks.source.clif.open_search_store_info(sd);
}
- if( HPMHooks.count.HP_clif_open_search_store_info_post ) {
+ if (HPMHooks.count.HP_clif_open_search_store_info_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_search_store_info_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_open_search_store_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_open_search_store_info_post[hIndex].func;
postHookFunc(sd);
}
@@ -17226,14 +17358,14 @@ void HP_clif_open_search_store_info(struct map_session_data *sd) {
}
void HP_clif_search_store_info_click_ack(struct map_session_data *sd, short x, short y) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_search_store_info_click_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *x, short *y);
+ if (HPMHooks.count.HP_clif_search_store_info_click_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *x, short *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_click_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_click_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_search_store_info_click_ack_pre[hIndex].func;
- preHookFunc(sd, &x, &y);
+ preHookFunc(&sd, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17241,25 +17373,25 @@ void HP_clif_search_store_info_click_ack(struct map_session_data *sd, short x, s
{
HPMHooks.source.clif.search_store_info_click_ack(sd, x, y);
}
- if( HPMHooks.count.HP_clif_search_store_info_click_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_click_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_search_store_info_click_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short x, short y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_search_store_info_click_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_search_store_info_click_ack_post[hIndex].func;
- postHookFunc(sd, &x, &y);
+ postHookFunc(sd, x, y);
}
}
return;
}
void HP_clif_elemental_info(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_elemental_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_elemental_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_elemental_info_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17267,9 +17399,9 @@ void HP_clif_elemental_info(struct map_session_data *sd) {
{
HPMHooks.source.clif.elemental_info(sd);
}
- if( HPMHooks.count.HP_clif_elemental_info_post ) {
+ if (HPMHooks.count.HP_clif_elemental_info_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_info_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_elemental_info_post[hIndex].func;
postHookFunc(sd);
}
@@ -17278,14 +17410,14 @@ void HP_clif_elemental_info(struct map_session_data *sd) {
}
void HP_clif_elemental_updatestatus(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_elemental_updatestatus_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_elemental_updatestatus_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_updatestatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_updatestatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_elemental_updatestatus_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17293,25 +17425,25 @@ void HP_clif_elemental_updatestatus(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.elemental_updatestatus(sd, type);
}
- if( HPMHooks.count.HP_clif_elemental_updatestatus_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_updatestatus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_elemental_updatestatus_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemental_updatestatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_elemental_updatestatus_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bgqueue_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK *response, unsigned char *arena_id);
+ if (HPMHooks.count.HP_clif_bgqueue_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum BATTLEGROUNDS_QUEUE_ACK *response, unsigned char *arena_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bgqueue_ack_pre[hIndex].func;
- preHookFunc(sd, &response, &arena_id);
+ preHookFunc(&sd, &response, &arena_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17319,25 +17451,25 @@ void HP_clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_A
{
HPMHooks.source.clif.bgqueue_ack(sd, response, arena_id);
}
- if( HPMHooks.count.HP_clif_bgqueue_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK *response, unsigned char *arena_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bgqueue_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bgqueue_ack_post[hIndex].func;
- postHookFunc(sd, &response, &arena_id);
+ postHookFunc(sd, response, arena_id);
}
}
return;
}
-void HP_clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, char *name) {
+void HP_clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bgqueue_notice_delete_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED *response, char *name);
+ if (HPMHooks.count.HP_clif_bgqueue_notice_delete_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED *response, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_notice_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_notice_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bgqueue_notice_delete_pre[hIndex].func;
- preHookFunc(sd, &response, name);
+ preHookFunc(&sd, &response, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17345,25 +17477,25 @@ void HP_clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUN
{
HPMHooks.source.clif.bgqueue_notice_delete(sd, response, name);
}
- if( HPMHooks.count.HP_clif_bgqueue_notice_delete_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED *response, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_notice_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bgqueue_notice_delete_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_notice_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bgqueue_notice_delete_post[hIndex].func;
- postHookFunc(sd, &response, name);
+ postHookFunc(sd, response, name);
}
}
return;
}
void HP_clif_bgqueue_update_info(struct map_session_data *sd, unsigned char arena_id, int position) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bgqueue_update_info_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *arena_id, int *position);
+ if (HPMHooks.count.HP_clif_bgqueue_update_info_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *arena_id, int *position);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_update_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_update_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bgqueue_update_info_pre[hIndex].func;
- preHookFunc(sd, &arena_id, &position);
+ preHookFunc(&sd, &arena_id, &position);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17371,25 +17503,25 @@ void HP_clif_bgqueue_update_info(struct map_session_data *sd, unsigned char aren
{
HPMHooks.source.clif.bgqueue_update_info(sd, arena_id, position);
}
- if( HPMHooks.count.HP_clif_bgqueue_update_info_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *arena_id, int *position);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_update_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bgqueue_update_info_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char arena_id, int position);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_update_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bgqueue_update_info_post[hIndex].func;
- postHookFunc(sd, &arena_id, &position);
+ postHookFunc(sd, arena_id, position);
}
}
return;
}
void HP_clif_bgqueue_joined(struct map_session_data *sd, int pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bgqueue_joined_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *pos);
+ if (HPMHooks.count.HP_clif_bgqueue_joined_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_joined_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_joined_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bgqueue_joined_pre[hIndex].func;
- preHookFunc(sd, &pos);
+ preHookFunc(&sd, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17397,25 +17529,25 @@ void HP_clif_bgqueue_joined(struct map_session_data *sd, int pos) {
{
HPMHooks.source.clif.bgqueue_joined(sd, pos);
}
- if( HPMHooks.count.HP_clif_bgqueue_joined_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_joined_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bgqueue_joined_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_joined_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bgqueue_joined_post[hIndex].func;
- postHookFunc(sd, &pos);
+ postHookFunc(sd, pos);
}
}
return;
}
void HP_clif_bgqueue_pcleft(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bgqueue_pcleft_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_bgqueue_pcleft_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_pcleft_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_pcleft_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bgqueue_pcleft_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17423,9 +17555,9 @@ void HP_clif_bgqueue_pcleft(struct map_session_data *sd) {
{
HPMHooks.source.clif.bgqueue_pcleft(sd);
}
- if( HPMHooks.count.HP_clif_bgqueue_pcleft_post ) {
+ if (HPMHooks.count.HP_clif_bgqueue_pcleft_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_pcleft_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_pcleft_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bgqueue_pcleft_post[hIndex].func;
postHookFunc(sd);
}
@@ -17434,14 +17566,14 @@ void HP_clif_bgqueue_pcleft(struct map_session_data *sd) {
}
void HP_clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char arena_id, enum send_target target) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bgqueue_battlebegins_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *arena_id, enum send_target *target);
+ if (HPMHooks.count.HP_clif_bgqueue_battlebegins_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *arena_id, enum send_target *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_battlebegins_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_battlebegins_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bgqueue_battlebegins_pre[hIndex].func;
- preHookFunc(sd, &arena_id, &target);
+ preHookFunc(&sd, &arena_id, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17449,25 +17581,25 @@ void HP_clif_bgqueue_battlebegins(struct map_session_data *sd, unsigned char are
{
HPMHooks.source.clif.bgqueue_battlebegins(sd, arena_id, target);
}
- if( HPMHooks.count.HP_clif_bgqueue_battlebegins_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *arena_id, enum send_target *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_battlebegins_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bgqueue_battlebegins_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char arena_id, enum send_target target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bgqueue_battlebegins_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bgqueue_battlebegins_post[hIndex].func;
- postHookFunc(sd, &arena_id, &target);
+ postHookFunc(sd, arena_id, target);
}
}
return;
}
void HP_clif_adopt_reply(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_adopt_reply_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_clif_adopt_reply_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_reply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_reply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_adopt_reply_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17475,25 +17607,25 @@ void HP_clif_adopt_reply(struct map_session_data *sd, int type) {
{
HPMHooks.source.clif.adopt_reply(sd, type);
}
- if( HPMHooks.count.HP_clif_adopt_reply_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_reply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_adopt_reply_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_reply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_adopt_reply_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_clif_adopt_request(struct map_session_data *sd, struct map_session_data *src, int p_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_adopt_request_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *src, int *p_id);
+ if (HPMHooks.count.HP_clif_adopt_request_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **src, int *p_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_adopt_request_pre[hIndex].func;
- preHookFunc(sd, src, &p_id);
+ preHookFunc(&sd, &src, &p_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17501,25 +17633,25 @@ void HP_clif_adopt_request(struct map_session_data *sd, struct map_session_data
{
HPMHooks.source.clif.adopt_request(sd, src, p_id);
}
- if( HPMHooks.count.HP_clif_adopt_request_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *src, int *p_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_adopt_request_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *src, int p_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_adopt_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_adopt_request_post[hIndex].func;
- postHookFunc(sd, src, &p_id);
+ postHookFunc(sd, src, p_id);
}
}
return;
}
void HP_clif_readbook(int fd, int book_id, int page) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_readbook_pre ) {
+ if (HPMHooks.count.HP_clif_readbook_pre > 0) {
void (*preHookFunc) (int *fd, int *book_id, int *page);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_readbook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_readbook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_readbook_pre[hIndex].func;
preHookFunc(&fd, &book_id, &page);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17527,25 +17659,25 @@ void HP_clif_readbook(int fd, int book_id, int page) {
{
HPMHooks.source.clif.readbook(fd, book_id, page);
}
- if( HPMHooks.count.HP_clif_readbook_post ) {
- void (*postHookFunc) (int *fd, int *book_id, int *page);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_readbook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_readbook_post > 0) {
+ void (*postHookFunc) (int fd, int book_id, int page);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_readbook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_readbook_post[hIndex].func;
- postHookFunc(&fd, &book_id, &page);
+ postHookFunc(fd, book_id, page);
}
}
return;
}
void HP_clif_notify_time(struct map_session_data *sd, int64 time) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_notify_time_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int64 *time);
+ if (HPMHooks.count.HP_clif_notify_time_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int64 *time);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_time_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_time_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_notify_time_pre[hIndex].func;
- preHookFunc(sd, &time);
+ preHookFunc(&sd, &time);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17553,25 +17685,25 @@ void HP_clif_notify_time(struct map_session_data *sd, int64 time) {
{
HPMHooks.source.clif.notify_time(sd, time);
}
- if( HPMHooks.count.HP_clif_notify_time_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int64 *time);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_time_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_notify_time_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int64 time);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_time_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_notify_time_post[hIndex].func;
- postHookFunc(sd, &time);
+ postHookFunc(sd, time);
}
}
return;
}
void HP_clif_user_count(struct map_session_data *sd, int count) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_user_count_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *count);
+ if (HPMHooks.count.HP_clif_user_count_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_user_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_user_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_user_count_pre[hIndex].func;
- preHookFunc(sd, &count);
+ preHookFunc(&sd, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17579,25 +17711,25 @@ void HP_clif_user_count(struct map_session_data *sd, int count) {
{
HPMHooks.source.clif.user_count(sd, count);
}
- if( HPMHooks.count.HP_clif_user_count_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_user_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_user_count_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_user_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_user_count_post[hIndex].func;
- postHookFunc(sd, &count);
+ postHookFunc(sd, count);
}
}
return;
}
void HP_clif_noask_sub(struct map_session_data *src, struct map_session_data *target, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_noask_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *src, struct map_session_data *target, int *type);
+ if (HPMHooks.count.HP_clif_noask_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **src, struct map_session_data **target, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_noask_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_noask_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_noask_sub_pre[hIndex].func;
- preHookFunc(src, target, &type);
+ preHookFunc(&src, &target, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17605,25 +17737,25 @@ void HP_clif_noask_sub(struct map_session_data *src, struct map_session_data *ta
{
HPMHooks.source.clif.noask_sub(src, target, type);
}
- if( HPMHooks.count.HP_clif_noask_sub_post ) {
- void (*postHookFunc) (struct map_session_data *src, struct map_session_data *target, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_noask_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_noask_sub_post > 0) {
+ void (*postHookFunc) (struct map_session_data *src, struct map_session_data *target, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_noask_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_noask_sub_post[hIndex].func;
- postHookFunc(src, target, &type);
+ postHookFunc(src, target, type);
}
}
return;
}
void HP_clif_bc_ready(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bc_ready_pre ) {
+ if (HPMHooks.count.HP_clif_bc_ready_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bc_ready_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bc_ready_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bc_ready_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17631,9 +17763,9 @@ void HP_clif_bc_ready(void) {
{
HPMHooks.source.clif.bc_ready();
}
- if( HPMHooks.count.HP_clif_bc_ready_post ) {
+ if (HPMHooks.count.HP_clif_bc_ready_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bc_ready_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bc_ready_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bc_ready_post[hIndex].func;
postHookFunc();
}
@@ -17642,14 +17774,14 @@ void HP_clif_bc_ready(void) {
}
void HP_clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_channel_msg_pre ) {
- void (*preHookFunc) (struct channel_data *chan, struct map_session_data *sd, char *msg);
+ if (HPMHooks.count.HP_clif_channel_msg_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, struct map_session_data **sd, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_channel_msg_pre[hIndex].func;
- preHookFunc(chan, sd, msg);
+ preHookFunc(&chan, &sd, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17657,9 +17789,9 @@ void HP_clif_channel_msg(struct channel_data *chan, struct map_session_data *sd,
{
HPMHooks.source.clif.channel_msg(chan, sd, msg);
}
- if( HPMHooks.count.HP_clif_channel_msg_post ) {
+ if (HPMHooks.count.HP_clif_channel_msg_post > 0) {
void (*postHookFunc) (struct channel_data *chan, struct map_session_data *sd, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_channel_msg_post[hIndex].func;
postHookFunc(chan, sd, msg);
}
@@ -17668,14 +17800,14 @@ void HP_clif_channel_msg(struct channel_data *chan, struct map_session_data *sd,
}
void HP_clif_channel_msg2(struct channel_data *chan, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_channel_msg2_pre ) {
- void (*preHookFunc) (struct channel_data *chan, char *msg);
+ if (HPMHooks.count.HP_clif_channel_msg2_pre > 0) {
+ void (*preHookFunc) (struct channel_data **chan, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_channel_msg2_pre[hIndex].func;
- preHookFunc(chan, msg);
+ preHookFunc(&chan, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17683,9 +17815,9 @@ void HP_clif_channel_msg2(struct channel_data *chan, char *msg) {
{
HPMHooks.source.clif.channel_msg2(chan, msg);
}
- if( HPMHooks.count.HP_clif_channel_msg2_post ) {
+ if (HPMHooks.count.HP_clif_channel_msg2_post > 0) {
void (*postHookFunc) (struct channel_data *chan, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_channel_msg2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_channel_msg2_post[hIndex].func;
postHookFunc(chan, msg);
}
@@ -17695,14 +17827,14 @@ void HP_clif_channel_msg2(struct channel_data *chan, char *msg) {
int HP_clif_undisguise_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_undisguise_timer_pre ) {
+ if (HPMHooks.count.HP_clif_undisguise_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_undisguise_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_undisguise_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_undisguise_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17710,25 +17842,25 @@ int HP_clif_undisguise_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.clif.undisguise_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_clif_undisguise_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_undisguise_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_undisguise_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_undisguise_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_undisguise_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bank_deposit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK *reason);
+ if (HPMHooks.count.HP_clif_bank_deposit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum e_BANKING_DEPOSIT_ACK *reason);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_deposit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_deposit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bank_deposit_pre[hIndex].func;
- preHookFunc(sd, &reason);
+ preHookFunc(&sd, &reason);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17736,25 +17868,25 @@ void HP_clif_bank_deposit(struct map_session_data *sd, enum e_BANKING_DEPOSIT_AC
{
HPMHooks.source.clif.bank_deposit(sd, reason);
}
- if( HPMHooks.count.HP_clif_bank_deposit_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK *reason);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_deposit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bank_deposit_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_deposit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bank_deposit_post[hIndex].func;
- postHookFunc(sd, &reason);
+ postHookFunc(sd, reason);
}
}
return;
}
void HP_clif_bank_withdraw(struct map_session_data *sd, enum e_BANKING_WITHDRAW_ACK reason) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_bank_withdraw_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum e_BANKING_WITHDRAW_ACK *reason);
+ if (HPMHooks.count.HP_clif_bank_withdraw_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum e_BANKING_WITHDRAW_ACK *reason);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_bank_withdraw_pre[hIndex].func;
- preHookFunc(sd, &reason);
+ preHookFunc(&sd, &reason);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17762,25 +17894,25 @@ void HP_clif_bank_withdraw(struct map_session_data *sd, enum e_BANKING_WITHDRAW_
{
HPMHooks.source.clif.bank_withdraw(sd, reason);
}
- if( HPMHooks.count.HP_clif_bank_withdraw_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum e_BANKING_WITHDRAW_ACK *reason);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_bank_withdraw_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum e_BANKING_WITHDRAW_ACK reason);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bank_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_bank_withdraw_post[hIndex].func;
- postHookFunc(sd, &reason);
+ postHookFunc(sd, reason);
}
}
return;
}
void HP_clif_show_modifiers(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_show_modifiers_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_show_modifiers_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_show_modifiers_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_show_modifiers_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_show_modifiers_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17788,9 +17920,9 @@ void HP_clif_show_modifiers(struct map_session_data *sd) {
{
HPMHooks.source.clif.show_modifiers(sd);
}
- if( HPMHooks.count.HP_clif_show_modifiers_post ) {
+ if (HPMHooks.count.HP_clif_show_modifiers_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_show_modifiers_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_show_modifiers_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_show_modifiers_post[hIndex].func;
postHookFunc(sd);
}
@@ -17799,14 +17931,14 @@ void HP_clif_show_modifiers(struct map_session_data *sd) {
}
void HP_clif_notify_bounditem(struct map_session_data *sd, unsigned short index) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_notify_bounditem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned short *index);
+ if (HPMHooks.count.HP_clif_notify_bounditem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned short *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_bounditem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_bounditem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_notify_bounditem_pre[hIndex].func;
- preHookFunc(sd, &index);
+ preHookFunc(&sd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17814,11 +17946,11 @@ void HP_clif_notify_bounditem(struct map_session_data *sd, unsigned short index)
{
HPMHooks.source.clif.notify_bounditem(sd, index);
}
- if( HPMHooks.count.HP_clif_notify_bounditem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned short *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_bounditem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_notify_bounditem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned short index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_bounditem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_notify_bounditem_post[hIndex].func;
- postHookFunc(sd, &index);
+ postHookFunc(sd, index);
}
}
return;
@@ -17826,14 +17958,14 @@ void HP_clif_notify_bounditem(struct map_session_data *sd, unsigned short index)
int HP_clif_delay_damage(int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_delay_damage_pre ) {
- int (*preHookFunc) (int64 *tick, struct block_list *src, struct block_list *dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, unsigned char *type);
+ if (HPMHooks.count.HP_clif_delay_damage_pre > 0) {
+ int (*preHookFunc) (int64 *tick, struct block_list **src, struct block_list **dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, unsigned char *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_delay_damage_pre[hIndex].func;
- retVal___ = preHookFunc(&tick, src, dst, &sdelay, &ddelay, &in_damage, &div, &type);
+ retVal___ = preHookFunc(&tick, &src, &dst, &sdelay, &ddelay, &in_damage, &div, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17841,11 +17973,11 @@ int HP_clif_delay_damage(int64 tick, struct block_list *src, struct block_list *
{
retVal___ = HPMHooks.source.clif.delay_damage(tick, src, dst, sdelay, ddelay, in_damage, div, type);
}
- if( HPMHooks.count.HP_clif_delay_damage_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, struct block_list *src, struct block_list *dst, int *sdelay, int *ddelay, int64 *in_damage, short *div, unsigned char *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_delay_damage_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_delay_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, src, dst, &sdelay, &ddelay, &in_damage, &div, &type);
+ retVal___ = postHookFunc(retVal___, tick, src, dst, sdelay, ddelay, in_damage, div, type);
}
}
return retVal___;
@@ -17853,14 +17985,14 @@ int HP_clif_delay_damage(int64 tick, struct block_list *src, struct block_list *
int HP_clif_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_delay_damage_sub_pre ) {
+ if (HPMHooks.count.HP_clif_delay_damage_sub_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_delay_damage_sub_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17868,25 +18000,25 @@ int HP_clif_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.clif.delay_damage_sub(tid, tick, id, data);
}
- if( HPMHooks.count.HP_clif_delay_damage_sub_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_delay_damage_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_delay_damage_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_delay_damage_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_npc_market_open_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_clif_npc_market_open_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_npc_market_open_pre[hIndex].func;
- preHookFunc(sd, nd);
+ preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17894,37 +18026,37 @@ void HP_clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) {
{
HPMHooks.source.clif.npc_market_open(sd, nd);
}
- if( HPMHooks.count.HP_clif_npc_market_open_post ) {
+ if (HPMHooks.count.HP_clif_npc_market_open_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_npc_market_open_post[hIndex].func;
postHookFunc(sd, nd);
}
}
return;
}
-void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char response) {
+void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, const struct itemlist *item_list, unsigned char response) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_npc_market_purchase_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char *response);
+ if (HPMHooks.count.HP_clif_npc_market_purchase_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const struct itemlist **item_list, unsigned char *response);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_npc_market_purchase_ack_pre[hIndex].func;
- preHookFunc(sd, req, &response);
+ preHookFunc(&sd, &item_list, &response);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.clif.npc_market_purchase_ack(sd, req, response);
+ HPMHooks.source.clif.npc_market_purchase_ack(sd, item_list, response);
}
- if( HPMHooks.count.HP_clif_npc_market_purchase_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char *response);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_npc_market_purchase_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_npc_market_purchase_ack_post[hIndex].func;
- postHookFunc(sd, req, &response);
+ postHookFunc(sd, item_list, response);
}
}
return;
@@ -17932,14 +18064,14 @@ void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_
bool HP_clif_parse_roulette_db(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_clif_parse_roulette_db_pre ) {
+ if (HPMHooks.count.HP_clif_parse_roulette_db_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_roulette_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_roulette_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_parse_roulette_db_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -17947,9 +18079,9 @@ bool HP_clif_parse_roulette_db(void) {
{
retVal___ = HPMHooks.source.clif.parse_roulette_db();
}
- if( HPMHooks.count.HP_clif_parse_roulette_db_post ) {
+ if (HPMHooks.count.HP_clif_parse_roulette_db_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_roulette_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_parse_roulette_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_parse_roulette_db_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -17958,14 +18090,14 @@ bool HP_clif_parse_roulette_db(void) {
}
void HP_clif_roulette_generate_ack(struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_roulette_generate_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *result, short *stage, short *prizeIdx, short *bonusItemID);
+ if (HPMHooks.count.HP_clif_roulette_generate_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *result, short *stage, short *prizeIdx, short *bonusItemID);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_generate_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_generate_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_roulette_generate_ack_pre[hIndex].func;
- preHookFunc(sd, &result, &stage, &prizeIdx, &bonusItemID);
+ preHookFunc(&sd, &result, &stage, &prizeIdx, &bonusItemID);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17973,25 +18105,25 @@ void HP_clif_roulette_generate_ack(struct map_session_data *sd, unsigned char re
{
HPMHooks.source.clif.roulette_generate_ack(sd, result, stage, prizeIdx, bonusItemID);
}
- if( HPMHooks.count.HP_clif_roulette_generate_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *result, short *stage, short *prizeIdx, short *bonusItemID);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_generate_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_roulette_generate_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_generate_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_roulette_generate_ack_post[hIndex].func;
- postHookFunc(sd, &result, &stage, &prizeIdx, &bonusItemID);
+ postHookFunc(sd, result, stage, prizeIdx, bonusItemID);
}
}
return;
}
void HP_clif_openmergeitem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_openmergeitem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_openmergeitem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openmergeitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_openmergeitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_openmergeitem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -17999,25 +18131,25 @@ void HP_clif_openmergeitem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.openmergeitem(fd, sd);
}
- if( HPMHooks.count.HP_clif_openmergeitem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_openmergeitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_openmergeitem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_openmergeitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_openmergeitem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_cancelmergeitem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_cancelmergeitem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_cancelmergeitem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cancelmergeitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cancelmergeitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_cancelmergeitem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18025,11 +18157,11 @@ void HP_clif_cancelmergeitem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.cancelmergeitem(fd, sd);
}
- if( HPMHooks.count.HP_clif_cancelmergeitem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_cancelmergeitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_cancelmergeitem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cancelmergeitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_cancelmergeitem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
@@ -18037,14 +18169,14 @@ void HP_clif_cancelmergeitem(int fd, struct map_session_data *sd) {
int HP_clif_comparemergeitem(const void *a, const void *b) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_clif_comparemergeitem_pre ) {
- int (*preHookFunc) (const void *a, const void *b);
+ if (HPMHooks.count.HP_clif_comparemergeitem_pre > 0) {
+ int (*preHookFunc) (const void **a, const void **b);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_comparemergeitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_comparemergeitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_comparemergeitem_pre[hIndex].func;
- retVal___ = preHookFunc(a, b);
+ retVal___ = preHookFunc(&a, &b);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -18052,9 +18184,9 @@ int HP_clif_comparemergeitem(const void *a, const void *b) {
{
retVal___ = HPMHooks.source.clif.comparemergeitem(a, b);
}
- if( HPMHooks.count.HP_clif_comparemergeitem_post ) {
+ if (HPMHooks.count.HP_clif_comparemergeitem_post > 0) {
int (*postHookFunc) (int retVal___, const void *a, const void *b);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_comparemergeitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_comparemergeitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_comparemergeitem_post[hIndex].func;
retVal___ = postHookFunc(retVal___, a, b);
}
@@ -18063,14 +18195,14 @@ int HP_clif_comparemergeitem(const void *a, const void *b) {
}
void HP_clif_ackmergeitems(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_ackmergeitems_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_ackmergeitems_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ackmergeitems_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ackmergeitems_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_ackmergeitems_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18078,25 +18210,105 @@ void HP_clif_ackmergeitems(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.ackmergeitems(fd, sd);
}
- if( HPMHooks.count.HP_clif_ackmergeitems_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_ackmergeitems_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_ackmergeitems_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ackmergeitems_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_ackmergeitems_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
+bool HP_clif_isdisguised(struct block_list *bl) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_clif_isdisguised_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_isdisguised_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_isdisguised_pre[hIndex].func;
+ retVal___ = preHookFunc(&bl);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.clif.isdisguised(bl);
+ }
+ if (HPMHooks.count.HP_clif_isdisguised_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_isdisguised_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_isdisguised_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, bl);
+ }
+ }
+ return retVal___;
+}
+void HP_clif_navigate_to(struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_navigate_to_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_navigate_to_pre[hIndex].func;
+ preHookFunc(&sd, &mapname, &x, &y, &flag, &hideWindow, &mob_id);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.navigate_to(sd, mapname, x, y, flag, hideWindow, mob_id);
+ }
+ if (HPMHooks.count.HP_clif_navigate_to_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_navigate_to_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_navigate_to_post[hIndex].func;
+ postHookFunc(sd, mapname, x, y, flag, hideWindow, mob_id);
+ }
+ }
+ return;
+}
+unsigned char HP_clif_bl_type(struct block_list *bl) {
+ int hIndex = 0;
+ unsigned char retVal___ = 0;
+ if (HPMHooks.count.HP_clif_bl_type_pre > 0) {
+ unsigned char (*preHookFunc) (struct block_list **bl);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bl_type_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_bl_type_pre[hIndex].func;
+ retVal___ = preHookFunc(&bl);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.clif.bl_type(bl);
+ }
+ if (HPMHooks.count.HP_clif_bl_type_post > 0) {
+ unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_bl_type_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_bl_type_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, bl);
+ }
+ }
+ return retVal___;
+}
void HP_clif_pWantToConnection(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pWantToConnection_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pWantToConnection_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWantToConnection_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWantToConnection_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pWantToConnection_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18104,25 +18316,25 @@ void HP_clif_pWantToConnection(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pWantToConnection(fd, sd);
}
- if( HPMHooks.count.HP_clif_pWantToConnection_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWantToConnection_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pWantToConnection_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWantToConnection_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pWantToConnection_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pLoadEndAck(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pLoadEndAck_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pLoadEndAck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLoadEndAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLoadEndAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pLoadEndAck_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18130,25 +18342,25 @@ void HP_clif_pLoadEndAck(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pLoadEndAck(fd, sd);
}
- if( HPMHooks.count.HP_clif_pLoadEndAck_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLoadEndAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pLoadEndAck_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLoadEndAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pLoadEndAck_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTickSend(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTickSend_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTickSend_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTickSend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTickSend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTickSend_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18156,25 +18368,25 @@ void HP_clif_pTickSend(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTickSend(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTickSend_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTickSend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTickSend_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTickSend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTickSend_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pHotkey(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHotkey_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHotkey_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkey_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkey_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHotkey_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18182,25 +18394,25 @@ void HP_clif_pHotkey(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHotkey(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHotkey_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkey_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHotkey_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkey_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHotkey_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pProgressbar(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pProgressbar_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pProgressbar_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProgressbar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProgressbar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pProgressbar_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18208,25 +18420,25 @@ void HP_clif_pProgressbar(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pProgressbar(fd, sd);
}
- if( HPMHooks.count.HP_clif_pProgressbar_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProgressbar_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pProgressbar_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProgressbar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pProgressbar_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pWalkToXY(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pWalkToXY_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pWalkToXY_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWalkToXY_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWalkToXY_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pWalkToXY_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18234,25 +18446,25 @@ void HP_clif_pWalkToXY(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pWalkToXY(fd, sd);
}
- if( HPMHooks.count.HP_clif_pWalkToXY_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWalkToXY_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pWalkToXY_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWalkToXY_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pWalkToXY_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pQuitGame(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pQuitGame_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pQuitGame_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pQuitGame_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pQuitGame_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pQuitGame_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18260,25 +18472,25 @@ void HP_clif_pQuitGame(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pQuitGame(fd, sd);
}
- if( HPMHooks.count.HP_clif_pQuitGame_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pQuitGame_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pQuitGame_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pQuitGame_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pQuitGame_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGetCharNameRequest(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGetCharNameRequest_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGetCharNameRequest_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetCharNameRequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetCharNameRequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGetCharNameRequest_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18286,25 +18498,25 @@ void HP_clif_pGetCharNameRequest(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGetCharNameRequest(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGetCharNameRequest_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetCharNameRequest_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGetCharNameRequest_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetCharNameRequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGetCharNameRequest_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGlobalMessage(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGlobalMessage_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGlobalMessage_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGlobalMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGlobalMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGlobalMessage_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18312,25 +18524,25 @@ void HP_clif_pGlobalMessage(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGlobalMessage(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGlobalMessage_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGlobalMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGlobalMessage_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGlobalMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGlobalMessage_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMapMove(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMapMove_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMapMove_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMapMove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMapMove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMapMove_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18338,25 +18550,25 @@ void HP_clif_pMapMove(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMapMove(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMapMove_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMapMove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMapMove_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMapMove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMapMove_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChangeDir(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChangeDir_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChangeDir_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeDir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeDir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChangeDir_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18364,25 +18576,25 @@ void HP_clif_pChangeDir(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChangeDir(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChangeDir_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeDir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChangeDir_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeDir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChangeDir_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pEmotion(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pEmotion_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pEmotion_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEmotion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEmotion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pEmotion_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18390,25 +18602,25 @@ void HP_clif_pEmotion(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pEmotion(fd, sd);
}
- if( HPMHooks.count.HP_clif_pEmotion_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEmotion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pEmotion_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEmotion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pEmotion_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pHowManyConnections(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHowManyConnections_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHowManyConnections_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHowManyConnections_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHowManyConnections_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHowManyConnections_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18416,25 +18628,25 @@ void HP_clif_pHowManyConnections(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHowManyConnections(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHowManyConnections_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHowManyConnections_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHowManyConnections_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHowManyConnections_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHowManyConnections_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pActionRequest(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pActionRequest_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pActionRequest_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pActionRequest_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18442,25 +18654,25 @@ void HP_clif_pActionRequest(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pActionRequest(fd, sd);
}
- if( HPMHooks.count.HP_clif_pActionRequest_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pActionRequest_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pActionRequest_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pActionRequest_sub(struct map_session_data *sd, int action_type, int target_id, int64 tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pActionRequest_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *action_type, int *target_id, int64 *tick);
+ if (HPMHooks.count.HP_clif_pActionRequest_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *action_type, int *target_id, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pActionRequest_sub_pre[hIndex].func;
- preHookFunc(sd, &action_type, &target_id, &tick);
+ preHookFunc(&sd, &action_type, &target_id, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18468,25 +18680,25 @@ void HP_clif_pActionRequest_sub(struct map_session_data *sd, int action_type, in
{
HPMHooks.source.clif.pActionRequest_sub(sd, action_type, target_id, tick);
}
- if( HPMHooks.count.HP_clif_pActionRequest_sub_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *action_type, int *target_id, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pActionRequest_sub_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int action_type, int target_id, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pActionRequest_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pActionRequest_sub_post[hIndex].func;
- postHookFunc(sd, &action_type, &target_id, &tick);
+ postHookFunc(sd, action_type, target_id, tick);
}
}
return;
}
void HP_clif_pRestart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRestart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRestart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRestart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRestart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRestart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18494,25 +18706,25 @@ void HP_clif_pRestart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRestart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRestart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRestart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRestart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRestart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRestart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pWisMessage(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pWisMessage_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pWisMessage_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWisMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWisMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pWisMessage_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18520,25 +18732,25 @@ void HP_clif_pWisMessage(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pWisMessage(fd, sd);
}
- if( HPMHooks.count.HP_clif_pWisMessage_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWisMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pWisMessage_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWisMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pWisMessage_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBroadcast(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBroadcast_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBroadcast_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBroadcast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBroadcast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBroadcast_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18546,25 +18758,25 @@ void HP_clif_pBroadcast(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBroadcast(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBroadcast_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBroadcast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBroadcast_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBroadcast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBroadcast_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTakeItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTakeItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTakeItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTakeItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTakeItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTakeItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18572,25 +18784,25 @@ void HP_clif_pTakeItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTakeItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTakeItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTakeItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTakeItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTakeItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTakeItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pDropItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pDropItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pDropItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDropItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDropItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pDropItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18598,25 +18810,25 @@ void HP_clif_pDropItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pDropItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pDropItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDropItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pDropItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDropItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pDropItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUseItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUseItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18624,25 +18836,25 @@ void HP_clif_pUseItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUseItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUseItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pEquipItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pEquipItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pEquipItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pEquipItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18650,25 +18862,25 @@ void HP_clif_pEquipItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pEquipItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pEquipItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pEquipItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pEquipItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUnequipItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUnequipItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUnequipItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUnequipItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUnequipItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUnequipItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18676,25 +18888,25 @@ void HP_clif_pUnequipItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUnequipItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUnequipItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUnequipItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUnequipItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUnequipItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUnequipItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcClicked(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcClicked_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcClicked_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcClicked_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcClicked_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcClicked_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18702,25 +18914,25 @@ void HP_clif_pNpcClicked(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcClicked(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcClicked_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcClicked_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcClicked_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcClicked_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcClicked_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcBuySellSelected(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcBuySellSelected_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcBuySellSelected_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuySellSelected_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuySellSelected_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcBuySellSelected_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18728,25 +18940,25 @@ void HP_clif_pNpcBuySellSelected(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcBuySellSelected(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcBuySellSelected_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuySellSelected_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcBuySellSelected_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuySellSelected_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcBuySellSelected_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcBuyListSend(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcBuyListSend_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcBuyListSend_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuyListSend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuyListSend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcBuyListSend_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18754,25 +18966,25 @@ void HP_clif_pNpcBuyListSend(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcBuyListSend(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcBuyListSend_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuyListSend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcBuyListSend_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcBuyListSend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcBuyListSend_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcSellListSend(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcSellListSend_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcSellListSend_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSellListSend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSellListSend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcSellListSend_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18780,25 +18992,25 @@ void HP_clif_pNpcSellListSend(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcSellListSend(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcSellListSend_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSellListSend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcSellListSend_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSellListSend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcSellListSend_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCreateChatRoom(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCreateChatRoom_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCreateChatRoom_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateChatRoom_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateChatRoom_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCreateChatRoom_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18806,25 +19018,25 @@ void HP_clif_pCreateChatRoom(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCreateChatRoom(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCreateChatRoom_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateChatRoom_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCreateChatRoom_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateChatRoom_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCreateChatRoom_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChatAddMember(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChatAddMember_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChatAddMember_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatAddMember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatAddMember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChatAddMember_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18832,25 +19044,25 @@ void HP_clif_pChatAddMember(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChatAddMember(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChatAddMember_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatAddMember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChatAddMember_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatAddMember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChatAddMember_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChatRoomStatusChange(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChatRoomStatusChange_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChatRoomStatusChange_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatRoomStatusChange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatRoomStatusChange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChatRoomStatusChange_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18858,25 +19070,25 @@ void HP_clif_pChatRoomStatusChange(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChatRoomStatusChange(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChatRoomStatusChange_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatRoomStatusChange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChatRoomStatusChange_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatRoomStatusChange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChatRoomStatusChange_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChangeChatOwner(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChangeChatOwner_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChangeChatOwner_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeChatOwner_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeChatOwner_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChangeChatOwner_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18884,25 +19096,25 @@ void HP_clif_pChangeChatOwner(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChangeChatOwner(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChangeChatOwner_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeChatOwner_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChangeChatOwner_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeChatOwner_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChangeChatOwner_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pKickFromChat(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pKickFromChat_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pKickFromChat_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pKickFromChat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pKickFromChat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pKickFromChat_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18910,25 +19122,25 @@ void HP_clif_pKickFromChat(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pKickFromChat(fd, sd);
}
- if( HPMHooks.count.HP_clif_pKickFromChat_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pKickFromChat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pKickFromChat_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pKickFromChat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pKickFromChat_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChatLeave(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChatLeave_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChatLeave_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatLeave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatLeave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChatLeave_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18936,25 +19148,25 @@ void HP_clif_pChatLeave(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChatLeave(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChatLeave_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatLeave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChatLeave_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChatLeave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChatLeave_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTradeRequest(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTradeRequest_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTradeRequest_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeRequest_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeRequest_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTradeRequest_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18962,25 +19174,25 @@ void HP_clif_pTradeRequest(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTradeRequest(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTradeRequest_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeRequest_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTradeRequest_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeRequest_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTradeRequest_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTradeAck(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTradeAck_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTradeAck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTradeAck_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -18988,25 +19200,25 @@ void HP_clif_pTradeAck(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTradeAck(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTradeAck_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTradeAck_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTradeAck_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTradeAddItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTradeAddItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTradeAddItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAddItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAddItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTradeAddItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19014,25 +19226,25 @@ void HP_clif_pTradeAddItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTradeAddItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTradeAddItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAddItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTradeAddItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeAddItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTradeAddItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTradeOk(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTradeOk_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTradeOk_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTradeOk_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19040,25 +19252,25 @@ void HP_clif_pTradeOk(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTradeOk(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTradeOk_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTradeOk_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTradeOk_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTradeCancel(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTradeCancel_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTradeCancel_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTradeCancel_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19066,25 +19278,25 @@ void HP_clif_pTradeCancel(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTradeCancel(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTradeCancel_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTradeCancel_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTradeCancel_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTradeCommit(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTradeCommit_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTradeCommit_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCommit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCommit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTradeCommit_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19092,25 +19304,25 @@ void HP_clif_pTradeCommit(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTradeCommit(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTradeCommit_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCommit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTradeCommit_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTradeCommit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTradeCommit_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pStopAttack(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pStopAttack_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pStopAttack_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStopAttack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStopAttack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pStopAttack_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19118,25 +19330,25 @@ void HP_clif_pStopAttack(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pStopAttack(fd, sd);
}
- if( HPMHooks.count.HP_clif_pStopAttack_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStopAttack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pStopAttack_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStopAttack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pStopAttack_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPutItemToCart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPutItemToCart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPutItemToCart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPutItemToCart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPutItemToCart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPutItemToCart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19144,25 +19356,25 @@ void HP_clif_pPutItemToCart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPutItemToCart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPutItemToCart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPutItemToCart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPutItemToCart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPutItemToCart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPutItemToCart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGetItemFromCart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGetItemFromCart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGetItemFromCart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetItemFromCart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetItemFromCart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGetItemFromCart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19170,25 +19382,25 @@ void HP_clif_pGetItemFromCart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGetItemFromCart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGetItemFromCart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetItemFromCart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGetItemFromCart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGetItemFromCart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGetItemFromCart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRemoveOption(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRemoveOption_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRemoveOption_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemoveOption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemoveOption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRemoveOption_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19196,25 +19408,25 @@ void HP_clif_pRemoveOption(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRemoveOption(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRemoveOption_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemoveOption_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRemoveOption_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemoveOption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRemoveOption_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChangeCart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChangeCart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChangeCart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeCart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeCart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChangeCart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19222,25 +19434,25 @@ void HP_clif_pChangeCart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChangeCart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChangeCart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeCart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChangeCart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeCart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChangeCart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pStatusUp(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pStatusUp_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pStatusUp_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStatusUp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStatusUp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pStatusUp_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19248,25 +19460,25 @@ void HP_clif_pStatusUp(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pStatusUp(fd, sd);
}
- if( HPMHooks.count.HP_clif_pStatusUp_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStatusUp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pStatusUp_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStatusUp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pStatusUp_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSkillUp(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSkillUp_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSkillUp_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillUp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillUp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSkillUp_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19274,25 +19486,25 @@ void HP_clif_pSkillUp(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSkillUp(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSkillUp_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillUp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSkillUp_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillUp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSkillUp_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUseSkillToId(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToId_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUseSkillToId_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToId_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19300,25 +19512,25 @@ void HP_clif_pUseSkillToId(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUseSkillToId(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUseSkillToId_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToId_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToId_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUseSkillToId_homun(struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToId_homun_pre ) {
- void (*preHookFunc) (struct homun_data *hd, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
+ if (HPMHooks.count.HP_clif_pUseSkillToId_homun_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_homun_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_homun_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToId_homun_pre[hIndex].func;
- preHookFunc(hd, sd, &tick, &skill_id, &skill_lv, &target_id);
+ preHookFunc(&hd, &sd, &tick, &skill_id, &skill_lv, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19326,25 +19538,25 @@ void HP_clif_pUseSkillToId_homun(struct homun_data *hd, struct map_session_data
{
HPMHooks.source.clif.pUseSkillToId_homun(hd, sd, tick, skill_id, skill_lv, target_id);
}
- if( HPMHooks.count.HP_clif_pUseSkillToId_homun_post ) {
- void (*postHookFunc) (struct homun_data *hd, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_homun_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToId_homun_post > 0) {
+ void (*postHookFunc) (struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_homun_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToId_homun_post[hIndex].func;
- postHookFunc(hd, sd, &tick, &skill_id, &skill_lv, &target_id);
+ postHookFunc(hd, sd, tick, skill_id, skill_lv, target_id);
}
}
return;
}
void HP_clif_pUseSkillToId_mercenary(struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToId_mercenary_pre ) {
- void (*preHookFunc) (struct mercenary_data *md, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
+ if (HPMHooks.count.HP_clif_pUseSkillToId_mercenary_pre > 0) {
+ void (*preHookFunc) (struct mercenary_data **md, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_mercenary_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_mercenary_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToId_mercenary_pre[hIndex].func;
- preHookFunc(md, sd, &tick, &skill_id, &skill_lv, &target_id);
+ preHookFunc(&md, &sd, &tick, &skill_id, &skill_lv, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19352,25 +19564,25 @@ void HP_clif_pUseSkillToId_mercenary(struct mercenary_data *md, struct map_sessi
{
HPMHooks.source.clif.pUseSkillToId_mercenary(md, sd, tick, skill_id, skill_lv, target_id);
}
- if( HPMHooks.count.HP_clif_pUseSkillToId_mercenary_post ) {
- void (*postHookFunc) (struct mercenary_data *md, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_mercenary_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToId_mercenary_post > 0) {
+ void (*postHookFunc) (struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToId_mercenary_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToId_mercenary_post[hIndex].func;
- postHookFunc(md, sd, &tick, &skill_id, &skill_lv, &target_id);
+ postHookFunc(md, sd, tick, skill_id, skill_lv, target_id);
}
}
return;
}
void HP_clif_pUseSkillToPos(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToPos_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUseSkillToPos_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToPos_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19378,25 +19590,25 @@ void HP_clif_pUseSkillToPos(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUseSkillToPos(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUseSkillToPos_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToPos_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToPos_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUseSkillToPosSub(int fd, struct map_session_data *sd, uint16 skill_lv, uint16 skill_id, short x, short y, int skillmoreinfo) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToPosSub_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd, uint16 *skill_lv, uint16 *skill_id, short *x, short *y, int *skillmoreinfo);
+ if (HPMHooks.count.HP_clif_pUseSkillToPosSub_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd, uint16 *skill_lv, uint16 *skill_id, short *x, short *y, int *skillmoreinfo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosSub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosSub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToPosSub_pre[hIndex].func;
- preHookFunc(&fd, sd, &skill_lv, &skill_id, &x, &y, &skillmoreinfo);
+ preHookFunc(&fd, &sd, &skill_lv, &skill_id, &x, &y, &skillmoreinfo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19404,25 +19616,25 @@ void HP_clif_pUseSkillToPosSub(int fd, struct map_session_data *sd, uint16 skill
{
HPMHooks.source.clif.pUseSkillToPosSub(fd, sd, skill_lv, skill_id, x, y, skillmoreinfo);
}
- if( HPMHooks.count.HP_clif_pUseSkillToPosSub_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd, uint16 *skill_lv, uint16 *skill_id, short *x, short *y, int *skillmoreinfo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosSub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToPosSub_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd, uint16 skill_lv, uint16 skill_id, short x, short y, int skillmoreinfo);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosSub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToPosSub_post[hIndex].func;
- postHookFunc(&fd, sd, &skill_lv, &skill_id, &x, &y, &skillmoreinfo);
+ postHookFunc(fd, sd, skill_lv, skill_id, x, y, skillmoreinfo);
}
}
return;
}
void HP_clif_pUseSkillToPos_homun(struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToPos_homun_pre ) {
- void (*preHookFunc) (struct homun_data *hd, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
+ if (HPMHooks.count.HP_clif_pUseSkillToPos_homun_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_homun_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_homun_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToPos_homun_pre[hIndex].func;
- preHookFunc(hd, sd, &tick, &skill_id, &skill_lv, &x, &y, &skillmoreinfo);
+ preHookFunc(&hd, &sd, &tick, &skill_id, &skill_lv, &x, &y, &skillmoreinfo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19430,25 +19642,25 @@ void HP_clif_pUseSkillToPos_homun(struct homun_data *hd, struct map_session_data
{
HPMHooks.source.clif.pUseSkillToPos_homun(hd, sd, tick, skill_id, skill_lv, x, y, skillmoreinfo);
}
- if( HPMHooks.count.HP_clif_pUseSkillToPos_homun_post ) {
- void (*postHookFunc) (struct homun_data *hd, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_homun_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToPos_homun_post > 0) {
+ void (*postHookFunc) (struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_homun_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToPos_homun_post[hIndex].func;
- postHookFunc(hd, sd, &tick, &skill_id, &skill_lv, &x, &y, &skillmoreinfo);
+ postHookFunc(hd, sd, tick, skill_id, skill_lv, x, y, skillmoreinfo);
}
}
return;
}
void HP_clif_pUseSkillToPos_mercenary(struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_pre ) {
- void (*preHookFunc) (struct mercenary_data *md, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
+ if (HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_pre > 0) {
+ void (*preHookFunc) (struct mercenary_data **md, struct map_session_data **sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToPos_mercenary_pre[hIndex].func;
- preHookFunc(md, sd, &tick, &skill_id, &skill_lv, &x, &y, &skillmoreinfo);
+ preHookFunc(&md, &sd, &tick, &skill_id, &skill_lv, &x, &y, &skillmoreinfo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19456,25 +19668,25 @@ void HP_clif_pUseSkillToPos_mercenary(struct mercenary_data *md, struct map_sess
{
HPMHooks.source.clif.pUseSkillToPos_mercenary(md, sd, tick, skill_id, skill_lv, x, y, skillmoreinfo);
}
- if( HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_post ) {
- void (*postHookFunc) (struct mercenary_data *md, struct map_session_data *sd, int64 *tick, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *skillmoreinfo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_post > 0) {
+ void (*postHookFunc) (struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, short x, short y, int skillmoreinfo);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPos_mercenary_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToPos_mercenary_post[hIndex].func;
- postHookFunc(md, sd, &tick, &skill_id, &skill_lv, &x, &y, &skillmoreinfo);
+ postHookFunc(md, sd, tick, skill_id, skill_lv, x, y, skillmoreinfo);
}
}
return;
}
void HP_clif_pUseSkillToPosMoreInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillToPosMoreInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19482,25 +19694,25 @@ void HP_clif_pUseSkillToPosMoreInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUseSkillToPosMoreInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillToPosMoreInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillToPosMoreInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUseSkillMap(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseSkillMap_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUseSkillMap_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillMap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillMap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseSkillMap_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19508,25 +19720,25 @@ void HP_clif_pUseSkillMap(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUseSkillMap(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUseSkillMap_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillMap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseSkillMap_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseSkillMap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseSkillMap_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRequestMemo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRequestMemo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRequestMemo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRequestMemo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRequestMemo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRequestMemo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19534,25 +19746,25 @@ void HP_clif_pRequestMemo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRequestMemo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRequestMemo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRequestMemo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRequestMemo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRequestMemo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRequestMemo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pProduceMix(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pProduceMix_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pProduceMix_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProduceMix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProduceMix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pProduceMix_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19560,25 +19772,25 @@ void HP_clif_pProduceMix(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pProduceMix(fd, sd);
}
- if( HPMHooks.count.HP_clif_pProduceMix_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProduceMix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pProduceMix_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pProduceMix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pProduceMix_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCooking(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCooking_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCooking_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCooking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCooking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCooking_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19586,25 +19798,25 @@ void HP_clif_pCooking(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCooking(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCooking_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCooking_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCooking_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCooking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCooking_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRepairItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRepairItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRepairItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRepairItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRepairItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRepairItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19612,25 +19824,25 @@ void HP_clif_pRepairItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRepairItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRepairItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRepairItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRepairItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRepairItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRepairItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pWeaponRefine(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pWeaponRefine_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pWeaponRefine_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWeaponRefine_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWeaponRefine_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pWeaponRefine_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19638,25 +19850,25 @@ void HP_clif_pWeaponRefine(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pWeaponRefine(fd, sd);
}
- if( HPMHooks.count.HP_clif_pWeaponRefine_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWeaponRefine_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pWeaponRefine_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pWeaponRefine_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pWeaponRefine_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcSelectMenu(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcSelectMenu_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcSelectMenu_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSelectMenu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSelectMenu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcSelectMenu_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19664,25 +19876,25 @@ void HP_clif_pNpcSelectMenu(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcSelectMenu(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcSelectMenu_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSelectMenu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcSelectMenu_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcSelectMenu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcSelectMenu_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcNextClicked(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcNextClicked_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcNextClicked_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcNextClicked_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcNextClicked_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcNextClicked_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19690,25 +19902,25 @@ void HP_clif_pNpcNextClicked(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcNextClicked(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcNextClicked_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcNextClicked_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcNextClicked_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcNextClicked_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcNextClicked_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcAmountInput(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcAmountInput_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcAmountInput_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcAmountInput_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcAmountInput_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcAmountInput_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19716,25 +19928,25 @@ void HP_clif_pNpcAmountInput(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcAmountInput(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcAmountInput_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcAmountInput_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcAmountInput_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcAmountInput_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcAmountInput_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcStringInput(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcStringInput_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcStringInput_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcStringInput_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcStringInput_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcStringInput_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19742,25 +19954,25 @@ void HP_clif_pNpcStringInput(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcStringInput(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcStringInput_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcStringInput_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcStringInput_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcStringInput_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcStringInput_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNpcCloseClicked(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNpcCloseClicked_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNpcCloseClicked_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcCloseClicked_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcCloseClicked_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNpcCloseClicked_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19768,25 +19980,25 @@ void HP_clif_pNpcCloseClicked(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNpcCloseClicked(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNpcCloseClicked_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcCloseClicked_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNpcCloseClicked_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNpcCloseClicked_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNpcCloseClicked_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pItemIdentify(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pItemIdentify_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pItemIdentify_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemIdentify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemIdentify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pItemIdentify_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19794,25 +20006,25 @@ void HP_clif_pItemIdentify(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pItemIdentify(fd, sd);
}
- if( HPMHooks.count.HP_clif_pItemIdentify_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemIdentify_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pItemIdentify_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemIdentify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pItemIdentify_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSelectArrow(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSelectArrow_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSelectArrow_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectArrow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectArrow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSelectArrow_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19820,25 +20032,25 @@ void HP_clif_pSelectArrow(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSelectArrow(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSelectArrow_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectArrow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSelectArrow_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectArrow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSelectArrow_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAutoSpell(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAutoSpell_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAutoSpell_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoSpell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoSpell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAutoSpell_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19846,25 +20058,25 @@ void HP_clif_pAutoSpell(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAutoSpell(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAutoSpell_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoSpell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAutoSpell_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoSpell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAutoSpell_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pUseCard(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pUseCard_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pUseCard_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseCard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseCard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pUseCard_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19872,25 +20084,25 @@ void HP_clif_pUseCard(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pUseCard(fd, sd);
}
- if( HPMHooks.count.HP_clif_pUseCard_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseCard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pUseCard_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pUseCard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pUseCard_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pInsertCard(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pInsertCard_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pInsertCard_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pInsertCard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pInsertCard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pInsertCard_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19898,25 +20110,25 @@ void HP_clif_pInsertCard(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pInsertCard(fd, sd);
}
- if( HPMHooks.count.HP_clif_pInsertCard_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pInsertCard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pInsertCard_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pInsertCard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pInsertCard_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSolveCharName(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSolveCharName_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSolveCharName_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSolveCharName_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSolveCharName_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSolveCharName_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19924,25 +20136,25 @@ void HP_clif_pSolveCharName(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSolveCharName(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSolveCharName_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSolveCharName_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSolveCharName_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSolveCharName_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSolveCharName_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pResetChar(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pResetChar_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pResetChar_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pResetChar_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pResetChar_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pResetChar_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19950,25 +20162,25 @@ void HP_clif_pResetChar(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pResetChar(fd, sd);
}
- if( HPMHooks.count.HP_clif_pResetChar_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pResetChar_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pResetChar_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pResetChar_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pResetChar_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pLocalBroadcast(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pLocalBroadcast_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pLocalBroadcast_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLocalBroadcast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLocalBroadcast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pLocalBroadcast_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -19976,25 +20188,25 @@ void HP_clif_pLocalBroadcast(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pLocalBroadcast(fd, sd);
}
- if( HPMHooks.count.HP_clif_pLocalBroadcast_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLocalBroadcast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pLocalBroadcast_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLocalBroadcast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pLocalBroadcast_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMoveToKafra(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMoveToKafra_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMoveToKafra_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafra_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafra_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMoveToKafra_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20002,25 +20214,25 @@ void HP_clif_pMoveToKafra(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMoveToKafra(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMoveToKafra_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafra_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMoveToKafra_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafra_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMoveToKafra_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMoveFromKafra(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMoveFromKafra_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMoveFromKafra_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafra_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafra_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMoveFromKafra_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20028,25 +20240,25 @@ void HP_clif_pMoveFromKafra(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMoveFromKafra(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMoveFromKafra_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafra_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMoveFromKafra_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafra_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMoveFromKafra_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMoveToKafraFromCart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMoveToKafraFromCart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMoveToKafraFromCart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafraFromCart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafraFromCart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMoveToKafraFromCart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20054,25 +20266,25 @@ void HP_clif_pMoveToKafraFromCart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMoveToKafraFromCart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMoveToKafraFromCart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafraFromCart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMoveToKafraFromCart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveToKafraFromCart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMoveToKafraFromCart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMoveFromKafraToCart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMoveFromKafraToCart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMoveFromKafraToCart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafraToCart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafraToCart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMoveFromKafraToCart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20080,25 +20292,25 @@ void HP_clif_pMoveFromKafraToCart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMoveFromKafraToCart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMoveFromKafraToCart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafraToCart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMoveFromKafraToCart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveFromKafraToCart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMoveFromKafraToCart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCloseKafra(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCloseKafra_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCloseKafra_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseKafra_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseKafra_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCloseKafra_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20106,25 +20318,25 @@ void HP_clif_pCloseKafra(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCloseKafra(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCloseKafra_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseKafra_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCloseKafra_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseKafra_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCloseKafra_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pStoragePassword(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pStoragePassword_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pStoragePassword_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStoragePassword_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStoragePassword_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pStoragePassword_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20132,25 +20344,25 @@ void HP_clif_pStoragePassword(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pStoragePassword(fd, sd);
}
- if( HPMHooks.count.HP_clif_pStoragePassword_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStoragePassword_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pStoragePassword_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStoragePassword_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pStoragePassword_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCreateParty(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCreateParty_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCreateParty_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCreateParty_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20158,25 +20370,25 @@ void HP_clif_pCreateParty(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCreateParty(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCreateParty_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCreateParty_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCreateParty_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCreateParty2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCreateParty2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCreateParty2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCreateParty2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20184,25 +20396,25 @@ void HP_clif_pCreateParty2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCreateParty2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCreateParty2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCreateParty2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateParty2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCreateParty2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyInvite(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyInvite_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyInvite_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyInvite_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20210,25 +20422,25 @@ void HP_clif_pPartyInvite(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyInvite(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyInvite_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyInvite_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyInvite_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyInvite2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyInvite2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyInvite2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyInvite2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20236,25 +20448,25 @@ void HP_clif_pPartyInvite2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyInvite2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyInvite2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyInvite2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyInvite2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyInvite2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pReplyPartyInvite(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pReplyPartyInvite_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pReplyPartyInvite_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pReplyPartyInvite_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20262,25 +20474,25 @@ void HP_clif_pReplyPartyInvite(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pReplyPartyInvite(fd, sd);
}
- if( HPMHooks.count.HP_clif_pReplyPartyInvite_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pReplyPartyInvite_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pReplyPartyInvite_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pReplyPartyInvite2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pReplyPartyInvite2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pReplyPartyInvite2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pReplyPartyInvite2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20288,25 +20500,25 @@ void HP_clif_pReplyPartyInvite2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pReplyPartyInvite2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pReplyPartyInvite2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pReplyPartyInvite2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReplyPartyInvite2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pReplyPartyInvite2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pLeaveParty(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pLeaveParty_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pLeaveParty_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLeaveParty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLeaveParty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pLeaveParty_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20314,25 +20526,25 @@ void HP_clif_pLeaveParty(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pLeaveParty(fd, sd);
}
- if( HPMHooks.count.HP_clif_pLeaveParty_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLeaveParty_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pLeaveParty_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLeaveParty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pLeaveParty_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRemovePartyMember(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRemovePartyMember_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRemovePartyMember_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemovePartyMember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemovePartyMember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRemovePartyMember_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20340,25 +20552,25 @@ void HP_clif_pRemovePartyMember(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRemovePartyMember(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRemovePartyMember_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemovePartyMember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRemovePartyMember_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRemovePartyMember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRemovePartyMember_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyChangeOption(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyChangeOption_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyChangeOption_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeOption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeOption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyChangeOption_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20366,25 +20578,25 @@ void HP_clif_pPartyChangeOption(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyChangeOption(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyChangeOption_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeOption_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyChangeOption_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeOption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyChangeOption_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyMessage(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyMessage_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyMessage_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyMessage_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20392,25 +20604,25 @@ void HP_clif_pPartyMessage(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyMessage(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyMessage_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyMessage_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyMessage_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyChangeLeader(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyChangeLeader_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyChangeLeader_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeLeader_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeLeader_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyChangeLeader_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20418,25 +20630,25 @@ void HP_clif_pPartyChangeLeader(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyChangeLeader(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyChangeLeader_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeLeader_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyChangeLeader_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyChangeLeader_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyChangeLeader_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingRegisterReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingRegisterReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingRegisterReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRegisterReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRegisterReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingRegisterReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20444,25 +20656,25 @@ void HP_clif_pPartyBookingRegisterReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingRegisterReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingRegisterReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRegisterReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingRegisterReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRegisterReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingRegisterReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingSearchReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingSearchReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingSearchReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSearchReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSearchReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingSearchReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20470,25 +20682,25 @@ void HP_clif_pPartyBookingSearchReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingSearchReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingSearchReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSearchReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingSearchReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSearchReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingSearchReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingDeleteReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingDeleteReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingDeleteReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingDeleteReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingDeleteReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingDeleteReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20496,25 +20708,25 @@ void HP_clif_pPartyBookingDeleteReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingDeleteReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingDeleteReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingDeleteReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingDeleteReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingDeleteReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingDeleteReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingUpdateReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingUpdateReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingUpdateReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingUpdateReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingUpdateReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingUpdateReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20522,25 +20734,25 @@ void HP_clif_pPartyBookingUpdateReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingUpdateReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingUpdateReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingUpdateReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingUpdateReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingUpdateReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingUpdateReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyRecruitRegisterReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyRecruitRegisterReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20548,25 +20760,25 @@ void HP_clif_pPartyRecruitRegisterReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyRecruitRegisterReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitRegisterReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyRecruitRegisterReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyRecruitSearchReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyRecruitSearchReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyRecruitSearchReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitSearchReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitSearchReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyRecruitSearchReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20574,25 +20786,25 @@ void HP_clif_pPartyRecruitSearchReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyRecruitSearchReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyRecruitSearchReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitSearchReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyRecruitSearchReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitSearchReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyRecruitSearchReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyRecruitDeleteReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyRecruitDeleteReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20600,25 +20812,25 @@ void HP_clif_pPartyRecruitDeleteReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyRecruitDeleteReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitDeleteReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyRecruitDeleteReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyRecruitUpdateReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyRecruitUpdateReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20626,25 +20838,25 @@ void HP_clif_pPartyRecruitUpdateReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyRecruitUpdateReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyRecruitUpdateReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyRecruitUpdateReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCloseVending(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCloseVending_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCloseVending_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseVending_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseVending_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCloseVending_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20652,25 +20864,25 @@ void HP_clif_pCloseVending(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCloseVending(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCloseVending_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseVending_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCloseVending_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseVending_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCloseVending_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pVendingListReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pVendingListReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pVendingListReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pVendingListReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pVendingListReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pVendingListReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20678,25 +20890,25 @@ void HP_clif_pVendingListReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pVendingListReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pVendingListReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pVendingListReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pVendingListReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pVendingListReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pVendingListReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPurchaseReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPurchaseReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPurchaseReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPurchaseReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20704,25 +20916,25 @@ void HP_clif_pPurchaseReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPurchaseReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPurchaseReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPurchaseReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPurchaseReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPurchaseReq2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPurchaseReq2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPurchaseReq2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPurchaseReq2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20730,25 +20942,25 @@ void HP_clif_pPurchaseReq2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPurchaseReq2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPurchaseReq2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPurchaseReq2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPurchaseReq2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPurchaseReq2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pOpenVending(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pOpenVending_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pOpenVending_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOpenVending_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOpenVending_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pOpenVending_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20756,25 +20968,25 @@ void HP_clif_pOpenVending(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pOpenVending(fd, sd);
}
- if( HPMHooks.count.HP_clif_pOpenVending_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOpenVending_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pOpenVending_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOpenVending_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pOpenVending_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCreateGuild(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCreateGuild_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCreateGuild_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateGuild_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateGuild_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCreateGuild_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20782,25 +20994,25 @@ void HP_clif_pCreateGuild(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCreateGuild(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCreateGuild_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateGuild_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCreateGuild_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCreateGuild_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCreateGuild_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildCheckMaster(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildCheckMaster_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildCheckMaster_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCheckMaster_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCheckMaster_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildCheckMaster_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20808,25 +21020,25 @@ void HP_clif_pGuildCheckMaster(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildCheckMaster(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildCheckMaster_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCheckMaster_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildCheckMaster_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildCheckMaster_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildCheckMaster_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildRequestInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildRequestInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildRequestInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildRequestInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20834,25 +21046,25 @@ void HP_clif_pGuildRequestInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildRequestInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildRequestInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildRequestInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildRequestInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildChangePositionInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildChangePositionInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildChangePositionInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangePositionInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangePositionInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildChangePositionInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20860,25 +21072,25 @@ void HP_clif_pGuildChangePositionInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildChangePositionInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildChangePositionInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangePositionInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildChangePositionInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangePositionInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildChangePositionInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildChangeMemberPosition(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildChangeMemberPosition_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildChangeMemberPosition_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeMemberPosition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeMemberPosition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildChangeMemberPosition_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20886,25 +21098,25 @@ void HP_clif_pGuildChangeMemberPosition(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildChangeMemberPosition(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildChangeMemberPosition_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeMemberPosition_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildChangeMemberPosition_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeMemberPosition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildChangeMemberPosition_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildRequestEmblem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildRequestEmblem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildRequestEmblem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestEmblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestEmblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildRequestEmblem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20912,25 +21124,25 @@ void HP_clif_pGuildRequestEmblem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildRequestEmblem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildRequestEmblem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestEmblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildRequestEmblem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestEmblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildRequestEmblem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildChangeEmblem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildChangeEmblem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildChangeEmblem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeEmblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeEmblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildChangeEmblem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20938,25 +21150,25 @@ void HP_clif_pGuildChangeEmblem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildChangeEmblem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildChangeEmblem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeEmblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildChangeEmblem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeEmblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildChangeEmblem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildChangeNotice(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildChangeNotice_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildChangeNotice_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeNotice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeNotice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildChangeNotice_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20964,25 +21176,25 @@ void HP_clif_pGuildChangeNotice(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildChangeNotice(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildChangeNotice_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeNotice_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildChangeNotice_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildChangeNotice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildChangeNotice_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildInvite(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildInvite_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildInvite_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildInvite_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -20990,25 +21202,25 @@ void HP_clif_pGuildInvite(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildInvite(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildInvite_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildInvite_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildInvite_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildReplyInvite(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildReplyInvite_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildReplyInvite_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyInvite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyInvite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildReplyInvite_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21016,25 +21228,25 @@ void HP_clif_pGuildReplyInvite(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildReplyInvite(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildReplyInvite_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyInvite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildReplyInvite_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyInvite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildReplyInvite_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildLeave(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildLeave_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildLeave_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildLeave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildLeave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildLeave_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21042,25 +21254,25 @@ void HP_clif_pGuildLeave(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildLeave(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildLeave_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildLeave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildLeave_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildLeave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildLeave_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildExpulsion(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildExpulsion_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildExpulsion_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildExpulsion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildExpulsion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildExpulsion_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21068,25 +21280,25 @@ void HP_clif_pGuildExpulsion(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildExpulsion(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildExpulsion_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildExpulsion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildExpulsion_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildExpulsion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildExpulsion_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildMessage(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildMessage_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildMessage_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildMessage_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21094,25 +21306,25 @@ void HP_clif_pGuildMessage(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildMessage(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildMessage_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildMessage_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildMessage_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildRequestAlliance(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildRequestAlliance_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildRequestAlliance_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestAlliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestAlliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildRequestAlliance_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21120,25 +21332,25 @@ void HP_clif_pGuildRequestAlliance(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildRequestAlliance(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildRequestAlliance_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestAlliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildRequestAlliance_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildRequestAlliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildRequestAlliance_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildReplyAlliance(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildReplyAlliance_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildReplyAlliance_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyAlliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyAlliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildReplyAlliance_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21146,25 +21358,25 @@ void HP_clif_pGuildReplyAlliance(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildReplyAlliance(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildReplyAlliance_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyAlliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildReplyAlliance_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildReplyAlliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildReplyAlliance_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildDelAlliance(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildDelAlliance_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildDelAlliance_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildDelAlliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildDelAlliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildDelAlliance_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21172,25 +21384,25 @@ void HP_clif_pGuildDelAlliance(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildDelAlliance(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildDelAlliance_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildDelAlliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildDelAlliance_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildDelAlliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildDelAlliance_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildOpposition(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildOpposition_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildOpposition_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildOpposition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildOpposition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildOpposition_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21198,25 +21410,25 @@ void HP_clif_pGuildOpposition(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildOpposition(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildOpposition_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildOpposition_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildOpposition_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildOpposition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildOpposition_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildBreak(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildBreak_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildBreak_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildBreak_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildBreak_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildBreak_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21224,25 +21436,25 @@ void HP_clif_pGuildBreak(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildBreak(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildBreak_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildBreak_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildBreak_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildBreak_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildBreak_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPetMenu(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPetMenu_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPetMenu_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPetMenu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPetMenu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPetMenu_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21250,25 +21462,25 @@ void HP_clif_pPetMenu(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPetMenu(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPetMenu_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPetMenu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPetMenu_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPetMenu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPetMenu_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCatchPet(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCatchPet_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCatchPet_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCatchPet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCatchPet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCatchPet_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21276,25 +21488,25 @@ void HP_clif_pCatchPet(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCatchPet(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCatchPet_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCatchPet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCatchPet_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCatchPet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCatchPet_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSelectEgg(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSelectEgg_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSelectEgg_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectEgg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectEgg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSelectEgg_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21302,25 +21514,25 @@ void HP_clif_pSelectEgg(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSelectEgg(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSelectEgg_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectEgg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSelectEgg_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectEgg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSelectEgg_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSendEmotion(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSendEmotion_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSendEmotion_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSendEmotion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSendEmotion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSendEmotion_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21328,25 +21540,25 @@ void HP_clif_pSendEmotion(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSendEmotion(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSendEmotion_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSendEmotion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSendEmotion_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSendEmotion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSendEmotion_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChangePetName(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChangePetName_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChangePetName_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangePetName_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangePetName_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChangePetName_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21354,25 +21566,25 @@ void HP_clif_pChangePetName(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChangePetName(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChangePetName_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangePetName_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChangePetName_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangePetName_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChangePetName_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMKick(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMKick_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMKick_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMKick_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21380,25 +21592,25 @@ void HP_clif_pGMKick(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMKick(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMKick_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMKick_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMKick_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMKickAll(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMKickAll_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMKickAll_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKickAll_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKickAll_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMKickAll_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21406,25 +21618,25 @@ void HP_clif_pGMKickAll(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMKickAll(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMKickAll_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKickAll_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMKickAll_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMKickAll_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMKickAll_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMShift(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMShift_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMShift_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMShift_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMShift_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMShift_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21432,25 +21644,25 @@ void HP_clif_pGMShift(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMShift(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMShift_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMShift_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMShift_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMShift_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMShift_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMRemove2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMRemove2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMRemove2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRemove2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRemove2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMRemove2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21458,25 +21670,25 @@ void HP_clif_pGMRemove2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMRemove2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMRemove2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRemove2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMRemove2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRemove2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMRemove2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMRecall(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMRecall_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMRecall_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMRecall_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21484,25 +21696,25 @@ void HP_clif_pGMRecall(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMRecall(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMRecall_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMRecall_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMRecall_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMRecall2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMRecall2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMRecall2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMRecall2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21510,25 +21722,25 @@ void HP_clif_pGMRecall2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMRecall2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMRecall2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMRecall2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRecall2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMRecall2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGM_Monster_Item(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGM_Monster_Item_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGM_Monster_Item_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGM_Monster_Item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGM_Monster_Item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGM_Monster_Item_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21536,25 +21748,25 @@ void HP_clif_pGM_Monster_Item(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGM_Monster_Item(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGM_Monster_Item_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGM_Monster_Item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGM_Monster_Item_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGM_Monster_Item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGM_Monster_Item_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMHide(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMHide_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMHide_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMHide_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMHide_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMHide_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21562,25 +21774,25 @@ void HP_clif_pGMHide(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMHide(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMHide_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMHide_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMHide_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMHide_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMHide_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMReqNoChat(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMReqNoChat_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMReqNoChat_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqNoChat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqNoChat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMReqNoChat_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21588,25 +21800,25 @@ void HP_clif_pGMReqNoChat(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMReqNoChat(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMReqNoChat_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqNoChat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMReqNoChat_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqNoChat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMReqNoChat_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMRc(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMRc_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMRc_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMRc_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21614,25 +21826,25 @@ void HP_clif_pGMRc(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMRc(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMRc_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMRc_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMRc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMRc_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMReqAccountName(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMReqAccountName_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMReqAccountName_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqAccountName_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqAccountName_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMReqAccountName_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21640,25 +21852,25 @@ void HP_clif_pGMReqAccountName(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMReqAccountName(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMReqAccountName_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqAccountName_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMReqAccountName_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMReqAccountName_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMReqAccountName_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMChangeMapType(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMChangeMapType_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMChangeMapType_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMChangeMapType_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMChangeMapType_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMChangeMapType_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21666,25 +21878,25 @@ void HP_clif_pGMChangeMapType(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMChangeMapType(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMChangeMapType_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMChangeMapType_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMChangeMapType_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMChangeMapType_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMChangeMapType_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGMFullStrip(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGMFullStrip_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGMFullStrip_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMFullStrip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMFullStrip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGMFullStrip_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21692,25 +21904,25 @@ void HP_clif_pGMFullStrip(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGMFullStrip(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGMFullStrip_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMFullStrip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGMFullStrip_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGMFullStrip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGMFullStrip_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPMIgnore(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPMIgnore_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPMIgnore_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnore_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnore_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPMIgnore_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21718,25 +21930,25 @@ void HP_clif_pPMIgnore(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPMIgnore(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPMIgnore_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnore_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPMIgnore_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnore_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPMIgnore_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPMIgnoreAll(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPMIgnoreAll_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPMIgnoreAll_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreAll_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreAll_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPMIgnoreAll_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21744,25 +21956,25 @@ void HP_clif_pPMIgnoreAll(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPMIgnoreAll(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPMIgnoreAll_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreAll_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPMIgnoreAll_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreAll_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPMIgnoreAll_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPMIgnoreList(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPMIgnoreList_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPMIgnoreList_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreList_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreList_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPMIgnoreList_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21770,25 +21982,25 @@ void HP_clif_pPMIgnoreList(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPMIgnoreList(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPMIgnoreList_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreList_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPMIgnoreList_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPMIgnoreList_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPMIgnoreList_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNoviceDoriDori(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNoviceDoriDori_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNoviceDoriDori_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceDoriDori_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceDoriDori_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNoviceDoriDori_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21796,25 +22008,25 @@ void HP_clif_pNoviceDoriDori(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNoviceDoriDori(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNoviceDoriDori_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceDoriDori_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNoviceDoriDori_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceDoriDori_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNoviceDoriDori_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNoviceExplosionSpirits(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNoviceExplosionSpirits_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNoviceExplosionSpirits_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceExplosionSpirits_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceExplosionSpirits_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNoviceExplosionSpirits_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21822,25 +22034,25 @@ void HP_clif_pNoviceExplosionSpirits(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNoviceExplosionSpirits(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNoviceExplosionSpirits_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceExplosionSpirits_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNoviceExplosionSpirits_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNoviceExplosionSpirits_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNoviceExplosionSpirits_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pFriendsListAdd(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pFriendsListAdd_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pFriendsListAdd_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListAdd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListAdd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pFriendsListAdd_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21848,25 +22060,25 @@ void HP_clif_pFriendsListAdd(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pFriendsListAdd(fd, sd);
}
- if( HPMHooks.count.HP_clif_pFriendsListAdd_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListAdd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pFriendsListAdd_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListAdd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pFriendsListAdd_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pFriendsListReply(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pFriendsListReply_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pFriendsListReply_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListReply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListReply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pFriendsListReply_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21874,25 +22086,25 @@ void HP_clif_pFriendsListReply(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pFriendsListReply(fd, sd);
}
- if( HPMHooks.count.HP_clif_pFriendsListReply_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListReply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pFriendsListReply_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListReply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pFriendsListReply_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pFriendsListRemove(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pFriendsListRemove_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pFriendsListRemove_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListRemove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListRemove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pFriendsListRemove_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21900,25 +22112,25 @@ void HP_clif_pFriendsListRemove(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pFriendsListRemove(fd, sd);
}
- if( HPMHooks.count.HP_clif_pFriendsListRemove_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListRemove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pFriendsListRemove_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFriendsListRemove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pFriendsListRemove_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPVPInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPVPInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPVPInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPVPInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPVPInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPVPInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21926,25 +22138,25 @@ void HP_clif_pPVPInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPVPInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPVPInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPVPInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPVPInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPVPInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPVPInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBlacksmith(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBlacksmith_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBlacksmith_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBlacksmith_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBlacksmith_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBlacksmith_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21952,25 +22164,25 @@ void HP_clif_pBlacksmith(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBlacksmith(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBlacksmith_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBlacksmith_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBlacksmith_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBlacksmith_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBlacksmith_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAlchemist(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAlchemist_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAlchemist_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAlchemist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAlchemist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAlchemist_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -21978,25 +22190,25 @@ void HP_clif_pAlchemist(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAlchemist(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAlchemist_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAlchemist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAlchemist_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAlchemist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAlchemist_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pTaekwon(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pTaekwon_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pTaekwon_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTaekwon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTaekwon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pTaekwon_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22004,25 +22216,25 @@ void HP_clif_pTaekwon(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pTaekwon(fd, sd);
}
- if( HPMHooks.count.HP_clif_pTaekwon_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTaekwon_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pTaekwon_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pTaekwon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pTaekwon_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRankingPk(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRankingPk_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRankingPk_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRankingPk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRankingPk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRankingPk_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22030,25 +22242,25 @@ void HP_clif_pRankingPk(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRankingPk(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRankingPk_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRankingPk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRankingPk_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRankingPk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRankingPk_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pFeelSaveOk(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pFeelSaveOk_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pFeelSaveOk_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFeelSaveOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFeelSaveOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pFeelSaveOk_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22056,25 +22268,25 @@ void HP_clif_pFeelSaveOk(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pFeelSaveOk(fd, sd);
}
- if( HPMHooks.count.HP_clif_pFeelSaveOk_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFeelSaveOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pFeelSaveOk_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pFeelSaveOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pFeelSaveOk_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pChangeHomunculusName(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pChangeHomunculusName_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pChangeHomunculusName_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeHomunculusName_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeHomunculusName_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pChangeHomunculusName_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22082,25 +22294,25 @@ void HP_clif_pChangeHomunculusName(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pChangeHomunculusName(fd, sd);
}
- if( HPMHooks.count.HP_clif_pChangeHomunculusName_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeHomunculusName_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pChangeHomunculusName_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pChangeHomunculusName_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pChangeHomunculusName_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pHomMoveToMaster(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHomMoveToMaster_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHomMoveToMaster_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveToMaster_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveToMaster_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHomMoveToMaster_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22108,25 +22320,25 @@ void HP_clif_pHomMoveToMaster(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHomMoveToMaster(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHomMoveToMaster_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveToMaster_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHomMoveToMaster_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveToMaster_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHomMoveToMaster_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pHomMoveTo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHomMoveTo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHomMoveTo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveTo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveTo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHomMoveTo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22134,25 +22346,25 @@ void HP_clif_pHomMoveTo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHomMoveTo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHomMoveTo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveTo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHomMoveTo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMoveTo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHomMoveTo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pHomAttack(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHomAttack_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHomAttack_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomAttack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomAttack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHomAttack_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22160,25 +22372,25 @@ void HP_clif_pHomAttack(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHomAttack(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHomAttack_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomAttack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHomAttack_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomAttack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHomAttack_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pHomMenu(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHomMenu_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHomMenu_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMenu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMenu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHomMenu_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22186,25 +22398,25 @@ void HP_clif_pHomMenu(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHomMenu(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHomMenu_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMenu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHomMenu_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHomMenu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHomMenu_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAutoRevive(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAutoRevive_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAutoRevive_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoRevive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoRevive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAutoRevive_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22212,25 +22424,25 @@ void HP_clif_pAutoRevive(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAutoRevive(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAutoRevive_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoRevive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAutoRevive_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAutoRevive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAutoRevive_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCheck(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCheck_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCheck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCheck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCheck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCheck_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22238,25 +22450,25 @@ void HP_clif_pCheck(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCheck(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCheck_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCheck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCheck_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCheck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCheck_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_refreshinbox(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_refreshinbox_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_refreshinbox_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_refreshinbox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_refreshinbox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_refreshinbox_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22264,25 +22476,25 @@ void HP_clif_pMail_refreshinbox(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_refreshinbox(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_refreshinbox_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_refreshinbox_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_refreshinbox_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_refreshinbox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_refreshinbox_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_read(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_read_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_read_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_read_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22290,25 +22502,25 @@ void HP_clif_pMail_read(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_read(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_read_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_read_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_read_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_getattach(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_getattach_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_getattach_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_getattach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_getattach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_getattach_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22316,25 +22528,25 @@ void HP_clif_pMail_getattach(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_getattach(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_getattach_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_getattach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_getattach_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_getattach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_getattach_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_delete(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_delete_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_delete_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_delete_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22342,25 +22554,25 @@ void HP_clif_pMail_delete(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_delete(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_delete_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_delete_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_delete_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_return(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_return_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_return_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_return_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_return_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_return_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22368,25 +22580,25 @@ void HP_clif_pMail_return(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_return(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_return_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_return_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_return_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_return_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_return_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_setattach(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_setattach_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_setattach_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_setattach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_setattach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_setattach_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22394,25 +22606,25 @@ void HP_clif_pMail_setattach(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_setattach(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_setattach_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_setattach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_setattach_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_setattach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_setattach_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_winopen(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_winopen_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_winopen_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_winopen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_winopen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_winopen_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22420,25 +22632,25 @@ void HP_clif_pMail_winopen(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_winopen(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_winopen_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_winopen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_winopen_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_winopen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_winopen_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMail_send(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMail_send_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMail_send_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMail_send_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22446,25 +22658,25 @@ void HP_clif_pMail_send(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMail_send(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMail_send_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMail_send_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMail_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMail_send_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_cancelreg(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_cancelreg_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_cancelreg_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancelreg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancelreg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_cancelreg_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22472,25 +22684,25 @@ void HP_clif_pAuction_cancelreg(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_cancelreg(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_cancelreg_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancelreg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_cancelreg_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancelreg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_cancelreg_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_setitem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_setitem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_setitem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_setitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_setitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_setitem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22498,25 +22710,25 @@ void HP_clif_pAuction_setitem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_setitem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_setitem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_setitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_setitem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_setitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_setitem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_register(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_register_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_register_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_register_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_register_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_register_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22524,25 +22736,25 @@ void HP_clif_pAuction_register(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_register(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_register_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_register_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_register_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_register_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_register_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_cancel(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_cancel_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_cancel_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_cancel_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22550,25 +22762,25 @@ void HP_clif_pAuction_cancel(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_cancel(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_cancel_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_cancel_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_cancel_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_close(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_close_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_close_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_close_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22576,25 +22788,25 @@ void HP_clif_pAuction_close(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_close(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_close_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_close_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_close_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_bid(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_bid_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_bid_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_bid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_bid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_bid_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22602,25 +22814,25 @@ void HP_clif_pAuction_bid(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_bid(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_bid_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_bid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_bid_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_bid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_bid_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_search(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_search_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_search_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_search_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22628,25 +22840,25 @@ void HP_clif_pAuction_search(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_search(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_search_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_search_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_search_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAuction_buysell(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAuction_buysell_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAuction_buysell_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_buysell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_buysell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAuction_buysell_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22654,25 +22866,25 @@ void HP_clif_pAuction_buysell(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAuction_buysell(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAuction_buysell_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_buysell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAuction_buysell_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAuction_buysell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAuction_buysell_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pcashshop_buy(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pcashshop_buy_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pcashshop_buy_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pcashshop_buy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pcashshop_buy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pcashshop_buy_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22680,25 +22892,25 @@ void HP_clif_pcashshop_buy(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pcashshop_buy(fd, sd);
}
- if( HPMHooks.count.HP_clif_pcashshop_buy_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pcashshop_buy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pcashshop_buy_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pcashshop_buy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pcashshop_buy_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAdopt_request(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAdopt_request_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAdopt_request_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAdopt_request_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22706,25 +22918,25 @@ void HP_clif_pAdopt_request(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAdopt_request(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAdopt_request_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAdopt_request_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAdopt_request_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pAdopt_reply(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pAdopt_reply_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pAdopt_reply_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_reply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_reply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pAdopt_reply_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22732,25 +22944,25 @@ void HP_clif_pAdopt_reply(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pAdopt_reply(fd, sd);
}
- if( HPMHooks.count.HP_clif_pAdopt_reply_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_reply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pAdopt_reply_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAdopt_reply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pAdopt_reply_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pViewPlayerEquip(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pViewPlayerEquip_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pViewPlayerEquip_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pViewPlayerEquip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pViewPlayerEquip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pViewPlayerEquip_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22758,25 +22970,25 @@ void HP_clif_pViewPlayerEquip(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pViewPlayerEquip(fd, sd);
}
- if( HPMHooks.count.HP_clif_pViewPlayerEquip_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pViewPlayerEquip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pViewPlayerEquip_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pViewPlayerEquip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pViewPlayerEquip_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pEquipTick(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pEquipTick_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pEquipTick_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipTick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipTick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pEquipTick_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22784,25 +22996,25 @@ void HP_clif_pEquipTick(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pEquipTick(fd, sd);
}
- if( HPMHooks.count.HP_clif_pEquipTick_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipTick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pEquipTick_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipTick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pEquipTick_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pquestStateAck(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pquestStateAck_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pquestStateAck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pquestStateAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pquestStateAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pquestStateAck_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22810,25 +23022,25 @@ void HP_clif_pquestStateAck(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pquestStateAck(fd, sd);
}
- if( HPMHooks.count.HP_clif_pquestStateAck_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pquestStateAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pquestStateAck_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pquestStateAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pquestStateAck_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pmercenary_action(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pmercenary_action_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pmercenary_action_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pmercenary_action_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pmercenary_action_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pmercenary_action_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22836,25 +23048,25 @@ void HP_clif_pmercenary_action(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pmercenary_action(fd, sd);
}
- if( HPMHooks.count.HP_clif_pmercenary_action_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pmercenary_action_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pmercenary_action_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pmercenary_action_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pmercenary_action_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBattleChat(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBattleChat_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBattleChat_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBattleChat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBattleChat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBattleChat_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22862,25 +23074,25 @@ void HP_clif_pBattleChat(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBattleChat(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBattleChat_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBattleChat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBattleChat_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBattleChat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBattleChat_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pLessEffect(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pLessEffect_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pLessEffect_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLessEffect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLessEffect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pLessEffect_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22888,25 +23100,25 @@ void HP_clif_pLessEffect(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pLessEffect(fd, sd);
}
- if( HPMHooks.count.HP_clif_pLessEffect_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLessEffect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pLessEffect_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pLessEffect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pLessEffect_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pItemListWindowSelected(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pItemListWindowSelected_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pItemListWindowSelected_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemListWindowSelected_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemListWindowSelected_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pItemListWindowSelected_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22914,25 +23126,25 @@ void HP_clif_pItemListWindowSelected(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pItemListWindowSelected(fd, sd);
}
- if( HPMHooks.count.HP_clif_pItemListWindowSelected_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemListWindowSelected_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pItemListWindowSelected_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pItemListWindowSelected_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pItemListWindowSelected_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pReqOpenBuyingStore(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pReqOpenBuyingStore_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pReqOpenBuyingStore_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqOpenBuyingStore_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqOpenBuyingStore_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pReqOpenBuyingStore_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22940,25 +23152,25 @@ void HP_clif_pReqOpenBuyingStore(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pReqOpenBuyingStore(fd, sd);
}
- if( HPMHooks.count.HP_clif_pReqOpenBuyingStore_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqOpenBuyingStore_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pReqOpenBuyingStore_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqOpenBuyingStore_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pReqOpenBuyingStore_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pReqCloseBuyingStore(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pReqCloseBuyingStore_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pReqCloseBuyingStore_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqCloseBuyingStore_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqCloseBuyingStore_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pReqCloseBuyingStore_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22966,25 +23178,25 @@ void HP_clif_pReqCloseBuyingStore(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pReqCloseBuyingStore(fd, sd);
}
- if( HPMHooks.count.HP_clif_pReqCloseBuyingStore_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqCloseBuyingStore_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pReqCloseBuyingStore_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqCloseBuyingStore_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pReqCloseBuyingStore_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pReqClickBuyingStore(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pReqClickBuyingStore_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pReqClickBuyingStore_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqClickBuyingStore_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqClickBuyingStore_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pReqClickBuyingStore_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -22992,25 +23204,25 @@ void HP_clif_pReqClickBuyingStore(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pReqClickBuyingStore(fd, sd);
}
- if( HPMHooks.count.HP_clif_pReqClickBuyingStore_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqClickBuyingStore_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pReqClickBuyingStore_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqClickBuyingStore_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pReqClickBuyingStore_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pReqTradeBuyingStore(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pReqTradeBuyingStore_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pReqTradeBuyingStore_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqTradeBuyingStore_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqTradeBuyingStore_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pReqTradeBuyingStore_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23018,25 +23230,25 @@ void HP_clif_pReqTradeBuyingStore(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pReqTradeBuyingStore(fd, sd);
}
- if( HPMHooks.count.HP_clif_pReqTradeBuyingStore_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqTradeBuyingStore_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pReqTradeBuyingStore_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqTradeBuyingStore_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pReqTradeBuyingStore_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSearchStoreInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSearchStoreInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSearchStoreInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSearchStoreInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23044,25 +23256,25 @@ void HP_clif_pSearchStoreInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSearchStoreInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSearchStoreInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSearchStoreInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSearchStoreInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSearchStoreInfoNextPage(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSearchStoreInfoNextPage_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23070,25 +23282,25 @@ void HP_clif_pSearchStoreInfoNextPage(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSearchStoreInfoNextPage(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoNextPage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSearchStoreInfoNextPage_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCloseSearchStoreInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCloseSearchStoreInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCloseSearchStoreInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseSearchStoreInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseSearchStoreInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCloseSearchStoreInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23096,25 +23308,25 @@ void HP_clif_pCloseSearchStoreInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCloseSearchStoreInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCloseSearchStoreInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseSearchStoreInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCloseSearchStoreInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCloseSearchStoreInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCloseSearchStoreInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSearchStoreInfoListItemClick(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSearchStoreInfoListItemClick_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23122,25 +23334,25 @@ void HP_clif_pSearchStoreInfoListItemClick(int fd, struct map_session_data *sd)
{
HPMHooks.source.clif.pSearchStoreInfoListItemClick(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSearchStoreInfoListItemClick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSearchStoreInfoListItemClick_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pDebug(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pDebug_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pDebug_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDebug_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDebug_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pDebug_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23148,25 +23360,25 @@ void HP_clif_pDebug(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pDebug(fd, sd);
}
- if( HPMHooks.count.HP_clif_pDebug_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDebug_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pDebug_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDebug_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pDebug_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pSkillSelectMenu(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSkillSelectMenu_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSkillSelectMenu_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillSelectMenu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillSelectMenu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSkillSelectMenu_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23174,25 +23386,25 @@ void HP_clif_pSkillSelectMenu(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSkillSelectMenu(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSkillSelectMenu_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillSelectMenu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSkillSelectMenu_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSkillSelectMenu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSkillSelectMenu_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pMoveItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pMoveItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pMoveItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pMoveItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23200,25 +23412,25 @@ void HP_clif_pMoveItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pMoveItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pMoveItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pMoveItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMoveItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pMoveItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pDull(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pDull_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pDull_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDull_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDull_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pDull_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23226,25 +23438,25 @@ void HP_clif_pDull(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pDull(fd, sd);
}
- if( HPMHooks.count.HP_clif_pDull_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDull_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pDull_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pDull_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pDull_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBGQueueRegister(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBGQueueRegister_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBGQueueRegister_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRegister_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRegister_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBGQueueRegister_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23252,25 +23464,25 @@ void HP_clif_pBGQueueRegister(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBGQueueRegister(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBGQueueRegister_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRegister_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBGQueueRegister_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRegister_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBGQueueRegister_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBGQueueCheckState(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBGQueueCheckState_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBGQueueCheckState_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueCheckState_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueCheckState_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBGQueueCheckState_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23278,25 +23490,25 @@ void HP_clif_pBGQueueCheckState(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBGQueueCheckState(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBGQueueCheckState_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueCheckState_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBGQueueCheckState_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueCheckState_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBGQueueCheckState_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBGQueueRevokeReq(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBGQueueRevokeReq_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBGQueueRevokeReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRevokeReq_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRevokeReq_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBGQueueRevokeReq_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23304,25 +23516,25 @@ void HP_clif_pBGQueueRevokeReq(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBGQueueRevokeReq(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBGQueueRevokeReq_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRevokeReq_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBGQueueRevokeReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueRevokeReq_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBGQueueRevokeReq_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBGQueueBattleBeginAck(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBGQueueBattleBeginAck_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23330,25 +23542,25 @@ void HP_clif_pBGQueueBattleBeginAck(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBGQueueBattleBeginAck(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBGQueueBattleBeginAck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBGQueueBattleBeginAck_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCashShopOpen(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCashShopOpen_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCashShopOpen_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23356,25 +23568,25 @@ void HP_clif_pCashShopOpen(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCashShopOpen(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCashShopOpen_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCashShopOpen_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCashShopClose(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCashShopClose_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCashShopClose_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopClose_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopClose_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCashShopClose_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23382,25 +23594,25 @@ void HP_clif_pCashShopClose(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCashShopClose(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCashShopClose_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopClose_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCashShopClose_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopClose_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCashShopClose_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCashShopReqTab(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCashShopReqTab_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCashShopReqTab_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopReqTab_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopReqTab_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCashShopReqTab_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23408,25 +23620,25 @@ void HP_clif_pCashShopReqTab(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCashShopReqTab(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCashShopReqTab_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopReqTab_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCashShopReqTab_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopReqTab_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCashShopReqTab_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCashShopSchedule(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCashShopSchedule_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCashShopSchedule_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopSchedule_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopSchedule_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCashShopSchedule_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23434,25 +23646,25 @@ void HP_clif_pCashShopSchedule(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCashShopSchedule(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCashShopSchedule_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopSchedule_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCashShopSchedule_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopSchedule_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCashShopSchedule_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pCashShopBuy(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pCashShopBuy_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pCashShopBuy_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopBuy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopBuy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pCashShopBuy_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23460,25 +23672,25 @@ void HP_clif_pCashShopBuy(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pCashShopBuy(fd, sd);
}
- if( HPMHooks.count.HP_clif_pCashShopBuy_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopBuy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pCashShopBuy_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopBuy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pCashShopBuy_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyTick(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyTick_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyTick_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyTick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyTick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyTick_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23486,25 +23698,25 @@ void HP_clif_pPartyTick(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyTick(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyTick_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyTick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyTick_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyTick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyTick_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pGuildInvite2(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pGuildInvite2_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pGuildInvite2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pGuildInvite2_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23512,25 +23724,25 @@ void HP_clif_pGuildInvite2(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pGuildInvite2(fd, sd);
}
- if( HPMHooks.count.HP_clif_pGuildInvite2_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pGuildInvite2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pGuildInvite2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pGuildInvite2_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingAddFilter(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingAddFilter_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23538,25 +23750,25 @@ void HP_clif_pPartyBookingAddFilter(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingAddFilter(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingAddFilter_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingAddFilter_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingAddFilter_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingAddFilter_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingAddFilter_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingSubFilter(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingSubFilter_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingSubFilter_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSubFilter_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSubFilter_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingSubFilter_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23564,25 +23776,25 @@ void HP_clif_pPartyBookingSubFilter(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingSubFilter(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingSubFilter_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSubFilter_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingSubFilter_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingSubFilter_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingSubFilter_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingReqVolunteer(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingReqVolunteer_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23590,25 +23802,25 @@ void HP_clif_pPartyBookingReqVolunteer(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingReqVolunteer(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingReqVolunteer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingReqVolunteer_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingRefuseVolunteer(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingRefuseVolunteer_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23616,25 +23828,25 @@ void HP_clif_pPartyBookingRefuseVolunteer(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingRefuseVolunteer(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingRefuseVolunteer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingRefuseVolunteer_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pPartyBookingCancelVolunteer(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pPartyBookingCancelVolunteer_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23642,25 +23854,25 @@ void HP_clif_pPartyBookingCancelVolunteer(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pPartyBookingCancelVolunteer(fd, sd);
}
- if( HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pPartyBookingCancelVolunteer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pPartyBookingCancelVolunteer_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBankDeposit(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBankDeposit_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBankDeposit_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankDeposit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankDeposit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBankDeposit_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23668,25 +23880,25 @@ void HP_clif_pBankDeposit(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBankDeposit(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBankDeposit_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankDeposit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBankDeposit_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankDeposit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBankDeposit_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBankWithdraw(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBankWithdraw_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBankWithdraw_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankWithdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankWithdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBankWithdraw_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23694,25 +23906,25 @@ void HP_clif_pBankWithdraw(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBankWithdraw(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBankWithdraw_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankWithdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBankWithdraw_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankWithdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBankWithdraw_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBankCheck(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBankCheck_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBankCheck_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankCheck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankCheck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBankCheck_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23720,25 +23932,25 @@ void HP_clif_pBankCheck(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBankCheck(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBankCheck_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankCheck_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBankCheck_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankCheck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBankCheck_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBankOpen(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBankOpen_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBankOpen_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankOpen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankOpen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBankOpen_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23746,25 +23958,25 @@ void HP_clif_pBankOpen(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBankOpen(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBankOpen_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankOpen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBankOpen_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankOpen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBankOpen_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pBankClose(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pBankClose_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pBankClose_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankClose_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankClose_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pBankClose_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23772,25 +23984,25 @@ void HP_clif_pBankClose(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pBankClose(fd, sd);
}
- if( HPMHooks.count.HP_clif_pBankClose_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankClose_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pBankClose_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pBankClose_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pBankClose_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRouletteOpen(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRouletteOpen_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRouletteOpen_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteOpen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteOpen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRouletteOpen_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23798,25 +24010,25 @@ void HP_clif_pRouletteOpen(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRouletteOpen(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRouletteOpen_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteOpen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRouletteOpen_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteOpen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRouletteOpen_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRouletteInfo(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRouletteInfo_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRouletteInfo_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRouletteInfo_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23824,25 +24036,25 @@ void HP_clif_pRouletteInfo(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRouletteInfo(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRouletteInfo_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRouletteInfo_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRouletteInfo_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRouletteClose(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRouletteClose_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRouletteClose_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteClose_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteClose_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRouletteClose_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23850,25 +24062,25 @@ void HP_clif_pRouletteClose(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRouletteClose(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRouletteClose_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteClose_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRouletteClose_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteClose_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRouletteClose_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRouletteGenerate(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRouletteGenerate_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRouletteGenerate_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteGenerate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteGenerate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRouletteGenerate_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23876,25 +24088,25 @@ void HP_clif_pRouletteGenerate(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRouletteGenerate(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRouletteGenerate_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteGenerate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRouletteGenerate_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteGenerate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRouletteGenerate_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pRouletteRecvItem(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pRouletteRecvItem_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pRouletteRecvItem_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteRecvItem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteRecvItem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pRouletteRecvItem_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23902,25 +24114,25 @@ void HP_clif_pRouletteRecvItem(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pRouletteRecvItem(fd, sd);
}
- if( HPMHooks.count.HP_clif_pRouletteRecvItem_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteRecvItem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pRouletteRecvItem_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRouletteRecvItem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pRouletteRecvItem_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNPCShopClosed(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNPCShopClosed_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNPCShopClosed_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCShopClosed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCShopClosed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNPCShopClosed_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23928,25 +24140,25 @@ void HP_clif_pNPCShopClosed(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNPCShopClosed(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNPCShopClosed_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCShopClosed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNPCShopClosed_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCShopClosed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNPCShopClosed_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNPCMarketClosed(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNPCMarketClosed_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNPCMarketClosed_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketClosed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketClosed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNPCMarketClosed_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23954,25 +24166,25 @@ void HP_clif_pNPCMarketClosed(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNPCMarketClosed(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNPCMarketClosed_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketClosed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNPCMarketClosed_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketClosed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNPCMarketClosed_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_pNPCMarketPurchase(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pNPCMarketPurchase_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pNPCMarketPurchase_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketPurchase_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketPurchase_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pNPCMarketPurchase_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -23980,51 +24192,52 @@ void HP_clif_pNPCMarketPurchase(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pNPCMarketPurchase(fd, sd);
}
- if( HPMHooks.count.HP_clif_pNPCMarketPurchase_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketPurchase_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pNPCMarketPurchase_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketPurchase_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pNPCMarketPurchase_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
-void HP_clif_add_random_options(unsigned char *buf, struct item *item) {
+int HP_clif_add_item_options(struct ItemOptions *buf, const struct item *it) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_add_random_options_pre ) {
- void (*preHookFunc) (unsigned char *buf, struct item *item);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_clif_add_item_options_pre > 0) {
+ int (*preHookFunc) (struct ItemOptions **buf, const struct item **it);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_add_random_options_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_clif_add_random_options_pre[hIndex].func;
- preHookFunc(buf, item);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_add_item_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_add_item_options_pre[hIndex].func;
+ retVal___ = preHookFunc(&buf, &it);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.clif.add_random_options(buf, item);
+ retVal___ = HPMHooks.source.clif.add_item_options(buf, it);
}
- if( HPMHooks.count.HP_clif_add_random_options_post ) {
- void (*postHookFunc) (unsigned char *buf, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_add_random_options_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_clif_add_random_options_post[hIndex].func;
- postHookFunc(buf, item);
+ if (HPMHooks.count.HP_clif_add_item_options_post > 0) {
+ int (*postHookFunc) (int retVal___, struct ItemOptions *buf, const struct item *it);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_add_item_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_add_item_options_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, buf, it);
}
}
- return;
+ return retVal___;
}
void HP_clif_pHotkeyRowShift(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pHotkeyRowShift_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pHotkeyRowShift_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkeyRowShift_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkeyRowShift_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pHotkeyRowShift_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24032,25 +24245,25 @@ void HP_clif_pHotkeyRowShift(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pHotkeyRowShift(fd, sd);
}
- if( HPMHooks.count.HP_clif_pHotkeyRowShift_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkeyRowShift_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pHotkeyRowShift_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pHotkeyRowShift_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pHotkeyRowShift_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_dressroom_open(struct map_session_data *sd, int view) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_dressroom_open_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *view);
+ if (HPMHooks.count.HP_clif_dressroom_open_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *view);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dressroom_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dressroom_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_dressroom_open_pre[hIndex].func;
- preHookFunc(sd, &view);
+ preHookFunc(&sd, &view);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24058,25 +24271,25 @@ void HP_clif_dressroom_open(struct map_session_data *sd, int view) {
{
HPMHooks.source.clif.dressroom_open(sd, view);
}
- if( HPMHooks.count.HP_clif_dressroom_open_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *view);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_dressroom_open_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_dressroom_open_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int view);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_dressroom_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_dressroom_open_post[hIndex].func;
- postHookFunc(sd, &view);
+ postHookFunc(sd, view);
}
}
return;
}
void HP_clif_pOneClick_ItemIdentify(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pOneClick_ItemIdentify_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pOneClick_ItemIdentify_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOneClick_ItemIdentify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOneClick_ItemIdentify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pOneClick_ItemIdentify_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24084,25 +24297,25 @@ void HP_clif_pOneClick_ItemIdentify(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pOneClick_ItemIdentify(fd, sd);
}
- if( HPMHooks.count.HP_clif_pOneClick_ItemIdentify_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOneClick_ItemIdentify_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pOneClick_ItemIdentify_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pOneClick_ItemIdentify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pOneClick_ItemIdentify_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
void HP_clif_selectcart(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_selectcart_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_selectcart_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_selectcart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_selectcart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_selectcart_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24110,9 +24323,9 @@ void HP_clif_selectcart(struct map_session_data *sd) {
{
HPMHooks.source.clif.selectcart(sd);
}
- if( HPMHooks.count.HP_clif_selectcart_post ) {
+ if (HPMHooks.count.HP_clif_selectcart_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_selectcart_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_selectcart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_selectcart_post[hIndex].func;
postHookFunc(sd);
}
@@ -24121,14 +24334,14 @@ void HP_clif_selectcart(struct map_session_data *sd) {
}
void HP_clif_pSelectCart(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_clif_pSelectCart_pre ) {
- void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_clif_pSelectCart_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectCart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectCart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_pSelectCart_pre[hIndex].func;
- preHookFunc(&fd, sd);
+ preHookFunc(&fd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24136,26 +24349,53 @@ void HP_clif_pSelectCart(int fd, struct map_session_data *sd) {
{
HPMHooks.source.clif.pSelectCart(fd, sd);
}
- if( HPMHooks.count.HP_clif_pSelectCart_post ) {
- void (*postHookFunc) (int *fd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectCart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_clif_pSelectCart_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pSelectCart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_pSelectCart_post[hIndex].func;
- postHookFunc(&fd, sd);
+ postHookFunc(fd, sd);
}
}
return;
}
-/* cmdline */
+const char* HP_clif_get_bl_name(const struct block_list *bl) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_clif_get_bl_name_pre > 0) {
+ const char* (*preHookFunc) (const struct block_list **bl);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_bl_name_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_get_bl_name_pre[hIndex].func;
+ retVal___ = preHookFunc(&bl);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.clif.get_bl_name(bl);
+ }
+ if (HPMHooks.count.HP_clif_get_bl_name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_get_bl_name_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_get_bl_name_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, bl);
+ }
+ }
+ return retVal___;
+}
+/* cmdline_interface */
void HP_cmdline_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_cmdline_init_pre ) {
+ if (HPMHooks.count.HP_cmdline_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24163,9 +24403,9 @@ void HP_cmdline_init(void) {
{
HPMHooks.source.cmdline.init();
}
- if( HPMHooks.count.HP_cmdline_init_post ) {
+ if (HPMHooks.count.HP_cmdline_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_init_post[hIndex].func;
postHookFunc();
}
@@ -24174,14 +24414,14 @@ void HP_cmdline_init(void) {
}
void HP_cmdline_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_cmdline_final_pre ) {
+ if (HPMHooks.count.HP_cmdline_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24189,9 +24429,9 @@ void HP_cmdline_final(void) {
{
HPMHooks.source.cmdline.final();
}
- if( HPMHooks.count.HP_cmdline_final_post ) {
+ if (HPMHooks.count.HP_cmdline_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_final_post[hIndex].func;
postHookFunc();
}
@@ -24201,14 +24441,14 @@ void HP_cmdline_final(void) {
bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_cmdline_arg_add_pre ) {
- bool (*preHookFunc) (unsigned int *pluginID, const char *name, char *shortname, CmdlineExecFunc *func, const char *help, unsigned int *options);
+ if (HPMHooks.count.HP_cmdline_arg_add_pre > 0) {
+ bool (*preHookFunc) (unsigned int *pluginID, const char **name, char *shortname, CmdlineExecFunc *func, const char **help, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_add_pre[hIndex].func;
- retVal___ = preHookFunc(&pluginID, name, &shortname, &func, help, &options);
+ retVal___ = preHookFunc(&pluginID, &name, &shortname, &func, &help, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24216,11 +24456,11 @@ bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname,
{
retVal___ = HPMHooks.source.cmdline.arg_add(pluginID, name, shortname, func, help, options);
}
- if( HPMHooks.count.HP_cmdline_arg_add_post ) {
- bool (*postHookFunc) (bool retVal___, unsigned int *pluginID, const char *name, char *shortname, CmdlineExecFunc *func, const char *help, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_arg_add_post > 0) {
+ bool (*postHookFunc) (bool retVal___, unsigned int pluginID, const char *name, char shortname, CmdlineExecFunc func, const char *help, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pluginID, name, &shortname, &func, help, &options);
+ retVal___ = postHookFunc(retVal___, pluginID, name, shortname, func, help, options);
}
}
return retVal___;
@@ -24228,14 +24468,14 @@ bool HP_cmdline_arg_add(unsigned int pluginID, const char *name, char shortname,
int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_cmdline_exec_pre ) {
- int (*preHookFunc) (int *argc, char **argv, unsigned int *options);
+ if (HPMHooks.count.HP_cmdline_exec_pre > 0) {
+ int (*preHookFunc) (int *argc, char ***argv, unsigned int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_exec_pre[hIndex].func;
- retVal___ = preHookFunc(&argc, argv, &options);
+ retVal___ = preHookFunc(&argc, &argv, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24243,11 +24483,11 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
{
retVal___ = HPMHooks.source.cmdline.exec(argc, argv, options);
}
- if( HPMHooks.count.HP_cmdline_exec_post ) {
- int (*postHookFunc) (int retVal___, int *argc, char **argv, unsigned int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_exec_post > 0) {
+ int (*postHookFunc) (int retVal___, int argc, char **argv, unsigned int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_exec_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_exec_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &argc, argv, &options);
+ retVal___ = postHookFunc(retVal___, argc, argv, options);
}
}
return retVal___;
@@ -24255,14 +24495,14 @@ int HP_cmdline_exec(int argc, char **argv, unsigned int options) {
bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_cmdline_arg_next_value_pre ) {
- bool (*preHookFunc) (const char *name, int *current_arg, int *argc);
+ if (HPMHooks.count.HP_cmdline_arg_next_value_pre > 0) {
+ bool (*preHookFunc) (const char **name, int *current_arg, int *argc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_pre[hIndex].func;
- retVal___ = preHookFunc(name, &current_arg, &argc);
+ retVal___ = preHookFunc(&name, &current_arg, &argc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24270,11 +24510,11 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
{
retVal___ = HPMHooks.source.cmdline.arg_next_value(name, current_arg, argc);
}
- if( HPMHooks.count.HP_cmdline_arg_next_value_post ) {
- bool (*postHookFunc) (bool retVal___, const char *name, int *current_arg, int *argc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++ ) {
+ if (HPMHooks.count.HP_cmdline_arg_next_value_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *name, int current_arg, int argc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_next_value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_next_value_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &current_arg, &argc);
+ retVal___ = postHookFunc(retVal___, name, current_arg, argc);
}
}
return retVal___;
@@ -24282,14 +24522,14 @@ bool HP_cmdline_arg_next_value(const char *name, int current_arg, int argc) {
const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_cmdline_arg_source_pre ) {
- const char* (*preHookFunc) (struct CmdlineArgData *arg);
+ if (HPMHooks.count.HP_cmdline_arg_source_pre > 0) {
+ const char* (*preHookFunc) (struct CmdlineArgData **arg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_cmdline_arg_source_pre[hIndex].func;
- retVal___ = preHookFunc(arg);
+ retVal___ = preHookFunc(&arg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24297,26 +24537,26 @@ const char* HP_cmdline_arg_source(struct CmdlineArgData *arg) {
{
retVal___ = HPMHooks.source.cmdline.arg_source(arg);
}
- if( HPMHooks.count.HP_cmdline_arg_source_post ) {
+ if (HPMHooks.count.HP_cmdline_arg_source_post > 0) {
const char* (*postHookFunc) (const char* retVal___, struct CmdlineArgData *arg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_cmdline_arg_source_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_cmdline_arg_source_post[hIndex].func;
retVal___ = postHookFunc(retVal___, arg);
}
}
return retVal___;
}
-/* console */
+/* console_interface */
void HP_console_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_init_pre ) {
+ if (HPMHooks.count.HP_console_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24324,9 +24564,9 @@ void HP_console_init(void) {
{
HPMHooks.source.console.init();
}
- if( HPMHooks.count.HP_console_init_post ) {
+ if (HPMHooks.count.HP_console_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_init_post[hIndex].func;
postHookFunc();
}
@@ -24335,14 +24575,14 @@ void HP_console_init(void) {
}
void HP_console_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_final_pre ) {
+ if (HPMHooks.count.HP_console_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24350,9 +24590,9 @@ void HP_console_final(void) {
{
HPMHooks.source.console.final();
}
- if( HPMHooks.count.HP_console_final_post ) {
+ if (HPMHooks.count.HP_console_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_final_post[hIndex].func;
postHookFunc();
}
@@ -24361,14 +24601,14 @@ void HP_console_final(void) {
}
void HP_console_display_title(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_display_title_pre ) {
+ if (HPMHooks.count.HP_console_display_title_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_display_title_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24376,9 +24616,9 @@ void HP_console_display_title(void) {
{
HPMHooks.source.console.display_title();
}
- if( HPMHooks.count.HP_console_display_title_post ) {
+ if (HPMHooks.count.HP_console_display_title_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_title_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_display_title_post[hIndex].func;
postHookFunc();
}
@@ -24387,14 +24627,14 @@ void HP_console_display_title(void) {
}
void HP_console_display_gplnotice(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_console_display_gplnotice_pre ) {
+ if (HPMHooks.count.HP_console_display_gplnotice_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_console_display_gplnotice_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24402,26 +24642,26 @@ void HP_console_display_gplnotice(void) {
{
HPMHooks.source.console.display_gplnotice();
}
- if( HPMHooks.count.HP_console_display_gplnotice_post ) {
+ if (HPMHooks.count.HP_console_display_gplnotice_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_console_display_gplnotice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_console_display_gplnotice_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* core */
+/* core_interface */
void HP_core_shutdown_callback(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_core_shutdown_callback_pre ) {
+ if (HPMHooks.count.HP_core_shutdown_callback_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_core_shutdown_callback_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24429,27 +24669,27 @@ void HP_core_shutdown_callback(void) {
{
HPMHooks.source.core.shutdown_callback();
}
- if( HPMHooks.count.HP_core_shutdown_callback_post ) {
+ if (HPMHooks.count.HP_core_shutdown_callback_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_core_shutdown_callback_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_core_shutdown_callback_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* DB */
-DBOptions HP_DB_fix_options(DBType type, DBOptions options) {
+/* db_interface */
+enum DBOptions HP_DB_fix_options(enum DBType type, enum DBOptions options) {
int hIndex = 0;
- DBOptions retVal___ = DB_OPT_BASE;
- if( HPMHooks.count.HP_DB_fix_options_pre ) {
- DBOptions (*preHookFunc) (DBType *type, DBOptions *options);
+ enum DBOptions retVal___ = DB_OPT_BASE;
+ if (HPMHooks.count.HP_DB_fix_options_pre > 0) {
+ enum DBOptions (*preHookFunc) (enum DBType *type, enum DBOptions *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_fix_options_pre[hIndex].func;
retVal___ = preHookFunc(&type, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24457,26 +24697,26 @@ DBOptions HP_DB_fix_options(DBType type, DBOptions options) {
{
retVal___ = HPMHooks.source.DB.fix_options(type, options);
}
- if( HPMHooks.count.HP_DB_fix_options_post ) {
- DBOptions (*postHookFunc) (DBOptions retVal___, DBType *type, DBOptions *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_fix_options_post > 0) {
+ enum DBOptions (*postHookFunc) (enum DBOptions retVal___, enum DBType type, enum DBOptions options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_fix_options_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_fix_options_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &options);
+ retVal___ = postHookFunc(retVal___, type, options);
}
}
return retVal___;
}
-DBComparator HP_DB_default_cmp(DBType type) {
+DBComparator HP_DB_default_cmp(enum DBType type) {
int hIndex = 0;
DBComparator retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_cmp_pre ) {
- DBComparator (*preHookFunc) (DBType *type);
+ if (HPMHooks.count.HP_DB_default_cmp_pre > 0) {
+ DBComparator (*preHookFunc) (enum DBType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_cmp_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24484,26 +24724,26 @@ DBComparator HP_DB_default_cmp(DBType type) {
{
retVal___ = HPMHooks.source.DB.default_cmp(type);
}
- if( HPMHooks.count.HP_DB_default_cmp_post ) {
- DBComparator (*postHookFunc) (DBComparator retVal___, DBType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_cmp_post > 0) {
+ DBComparator (*postHookFunc) (DBComparator retVal___, enum DBType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_cmp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_cmp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-DBHasher HP_DB_default_hash(DBType type) {
+DBHasher HP_DB_default_hash(enum DBType type) {
int hIndex = 0;
DBHasher retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_hash_pre ) {
- DBHasher (*preHookFunc) (DBType *type);
+ if (HPMHooks.count.HP_DB_default_hash_pre > 0) {
+ DBHasher (*preHookFunc) (enum DBType *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_hash_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24511,26 +24751,26 @@ DBHasher HP_DB_default_hash(DBType type) {
{
retVal___ = HPMHooks.source.DB.default_hash(type);
}
- if( HPMHooks.count.HP_DB_default_hash_post ) {
- DBHasher (*postHookFunc) (DBHasher retVal___, DBType *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_hash_post > 0) {
+ DBHasher (*postHookFunc) (DBHasher retVal___, enum DBType type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_hash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_hash_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-DBReleaser HP_DB_default_release(DBType type, DBOptions options) {
+DBReleaser HP_DB_default_release(enum DBType type, enum DBOptions options) {
int hIndex = 0;
DBReleaser retVal___ = NULL;
- if( HPMHooks.count.HP_DB_default_release_pre ) {
- DBReleaser (*preHookFunc) (DBType *type, DBOptions *options);
+ if (HPMHooks.count.HP_DB_default_release_pre > 0) {
+ DBReleaser (*preHookFunc) (enum DBType *type, enum DBOptions *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_default_release_pre[hIndex].func;
retVal___ = preHookFunc(&type, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24538,26 +24778,26 @@ DBReleaser HP_DB_default_release(DBType type, DBOptions options) {
{
retVal___ = HPMHooks.source.DB.default_release(type, options);
}
- if( HPMHooks.count.HP_DB_default_release_post ) {
- DBReleaser (*postHookFunc) (DBReleaser retVal___, DBType *type, DBOptions *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_default_release_post > 0) {
+ DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBType type, enum DBOptions options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_default_release_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_default_release_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &options);
+ retVal___ = postHookFunc(retVal___, type, options);
}
}
return retVal___;
}
-DBReleaser HP_DB_custom_release(DBRelease which) {
+DBReleaser HP_DB_custom_release(enum DBReleaseOption which) {
int hIndex = 0;
DBReleaser retVal___ = NULL;
- if( HPMHooks.count.HP_DB_custom_release_pre ) {
- DBReleaser (*preHookFunc) (DBRelease *which);
+ if (HPMHooks.count.HP_DB_custom_release_pre > 0) {
+ DBReleaser (*preHookFunc) (enum DBReleaseOption *which);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_custom_release_pre[hIndex].func;
retVal___ = preHookFunc(&which);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24565,26 +24805,26 @@ DBReleaser HP_DB_custom_release(DBRelease which) {
{
retVal___ = HPMHooks.source.DB.custom_release(which);
}
- if( HPMHooks.count.HP_DB_custom_release_post ) {
- DBReleaser (*postHookFunc) (DBReleaser retVal___, DBRelease *which);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_custom_release_post > 0) {
+ DBReleaser (*postHookFunc) (DBReleaser retVal___, enum DBReleaseOption which);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_custom_release_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_custom_release_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &which);
+ retVal___ = postHookFunc(retVal___, which);
}
}
return retVal___;
}
-DBMap* HP_DB_alloc(const char *file, const char *func, int line, DBType type, DBOptions options, unsigned short maxlen) {
+struct DBMap* HP_DB_alloc(const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen) {
int hIndex = 0;
- DBMap* retVal___ = NULL;
- if( HPMHooks.count.HP_DB_alloc_pre ) {
- DBMap* (*preHookFunc) (const char *file, const char *func, int *line, DBType *type, DBOptions *options, unsigned short *maxlen);
+ struct DBMap* retVal___ = NULL;
+ if (HPMHooks.count.HP_DB_alloc_pre > 0) {
+ struct DBMap* (*preHookFunc) (const char **file, const char **func, int *line, enum DBType *type, enum DBOptions *options, unsigned short *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_alloc_pre[hIndex].func;
- retVal___ = preHookFunc(file, func, &line, &type, &options, &maxlen);
+ retVal___ = preHookFunc(&file, &func, &line, &type, &options, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24592,27 +24832,26 @@ DBMap* HP_DB_alloc(const char *file, const char *func, int line, DBType type, DB
{
retVal___ = HPMHooks.source.DB.alloc(file, func, line, type, options, maxlen);
}
- if( HPMHooks.count.HP_DB_alloc_post ) {
- DBMap* (*postHookFunc) (DBMap* retVal___, const char *file, const char *func, int *line, DBType *type, DBOptions *options, unsigned short *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_alloc_post > 0) {
+ struct DBMap* (*postHookFunc) (struct DBMap* retVal___, const char *file, const char *func, int line, enum DBType type, enum DBOptions options, unsigned short maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_alloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_alloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, file, func, &line, &type, &options, &maxlen);
+ retVal___ = postHookFunc(retVal___, file, func, line, type, options, maxlen);
}
}
return retVal___;
}
-DBKey HP_DB_i2key(int key) {
+union DBKey HP_DB_i2key(int key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_i2key_pre ) {
- DBKey (*preHookFunc) (int *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i2key_pre > 0) {
+ union DBKey (*preHookFunc) (int *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i2key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24620,27 +24859,26 @@ DBKey HP_DB_i2key(int key) {
{
retVal___ = HPMHooks.source.DB.i2key(key);
}
- if( HPMHooks.count.HP_DB_i2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, int *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, int key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i2key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_ui2key(unsigned int key) {
+union DBKey HP_DB_ui2key(unsigned int key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_ui2key_pre ) {
- DBKey (*preHookFunc) (unsigned int *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui2key_pre > 0) {
+ union DBKey (*preHookFunc) (unsigned int *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui2key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24648,27 +24886,26 @@ DBKey HP_DB_ui2key(unsigned int key) {
{
retVal___ = HPMHooks.source.DB.ui2key(key);
}
- if( HPMHooks.count.HP_DB_ui2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, unsigned int *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, unsigned int key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui2key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_str2key(const char *key) {
+union DBKey HP_DB_str2key(const char *key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_str2key_pre ) {
- DBKey (*preHookFunc) (const char *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_str2key_pre > 0) {
+ union DBKey (*preHookFunc) (const char **key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_str2key_pre[hIndex].func;
- retVal___ = preHookFunc(key);
+ retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24676,27 +24913,26 @@ DBKey HP_DB_str2key(const char *key) {
{
retVal___ = HPMHooks.source.DB.str2key(key);
}
- if( HPMHooks.count.HP_DB_str2key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, const char *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_str2key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, const char *key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_str2key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_str2key_post[hIndex].func;
retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_i642key(int64 key) {
+union DBKey HP_DB_i642key(int64 key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_i642key_pre ) {
- DBKey (*preHookFunc) (int64 *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i642key_pre > 0) {
+ union DBKey (*preHookFunc) (int64 *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i642key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24704,27 +24940,26 @@ DBKey HP_DB_i642key(int64 key) {
{
retVal___ = HPMHooks.source.DB.i642key(key);
}
- if( HPMHooks.count.HP_DB_i642key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, int64 *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i642key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, int64 key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i642key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i642key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBKey HP_DB_ui642key(uint64 key) {
+union DBKey HP_DB_ui642key(uint64 key) {
int hIndex = 0;
- DBKey retVal___;
- memset(&retVal___, '\0', sizeof(DBKey));
- if( HPMHooks.count.HP_DB_ui642key_pre ) {
- DBKey (*preHookFunc) (uint64 *key);
+ union DBKey retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui642key_pre > 0) {
+ union DBKey (*preHookFunc) (uint64 *key);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui642key_pre[hIndex].func;
retVal___ = preHookFunc(&key);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24732,27 +24967,26 @@ DBKey HP_DB_ui642key(uint64 key) {
{
retVal___ = HPMHooks.source.DB.ui642key(key);
}
- if( HPMHooks.count.HP_DB_ui642key_post ) {
- DBKey (*postHookFunc) (DBKey retVal___, uint64 *key);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui642key_post > 0) {
+ union DBKey (*postHookFunc) (union DBKey retVal___, uint64 key);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui642key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui642key_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key);
+ retVal___ = postHookFunc(retVal___, key);
}
}
return retVal___;
}
-DBData HP_DB_i2data(int data) {
+struct DBData HP_DB_i2data(int data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_i2data_pre ) {
- DBData (*preHookFunc) (int *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_i2data_pre > 0) {
+ struct DBData (*preHookFunc) (int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_i2data_pre[hIndex].func;
retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24760,27 +24994,26 @@ DBData HP_DB_i2data(int data) {
{
retVal___ = HPMHooks.source.DB.i2data(data);
}
- if( HPMHooks.count.HP_DB_i2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_i2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_i2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_i2data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &data);
+ retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-DBData HP_DB_ui2data(unsigned int data) {
+struct DBData HP_DB_ui2data(unsigned int data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_ui2data_pre ) {
- DBData (*preHookFunc) (unsigned int *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ui2data_pre > 0) {
+ struct DBData (*preHookFunc) (unsigned int *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ui2data_pre[hIndex].func;
retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24788,27 +25021,26 @@ DBData HP_DB_ui2data(unsigned int data) {
{
retVal___ = HPMHooks.source.DB.ui2data(data);
}
- if( HPMHooks.count.HP_DB_ui2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, unsigned int *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ui2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, unsigned int data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ui2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ui2data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &data);
+ retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-DBData HP_DB_ptr2data(void *data) {
+struct DBData HP_DB_ptr2data(void *data) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_DB_ptr2data_pre ) {
- DBData (*preHookFunc) (void *data);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_DB_ptr2data_pre > 0) {
+ struct DBData (*preHookFunc) (void **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_ptr2data_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24816,26 +25048,26 @@ DBData HP_DB_ptr2data(void *data) {
{
retVal___ = HPMHooks.source.DB.ptr2data(data);
}
- if( HPMHooks.count.HP_DB_ptr2data_post ) {
- DBData (*postHookFunc) (DBData retVal___, void *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_ptr2data_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, void *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_ptr2data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_ptr2data_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-int HP_DB_data2i(DBData *data) {
+int HP_DB_data2i(struct DBData *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_DB_data2i_pre ) {
- int (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2i_pre > 0) {
+ int (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2i_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24843,26 +25075,26 @@ int HP_DB_data2i(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2i(data);
}
- if( HPMHooks.count.HP_DB_data2i_post ) {
- int (*postHookFunc) (int retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2i_post > 0) {
+ int (*postHookFunc) (int retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2i_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2i_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-unsigned int HP_DB_data2ui(DBData *data) {
+unsigned int HP_DB_data2ui(struct DBData *data) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_DB_data2ui_pre ) {
- unsigned int (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2ui_pre > 0) {
+ unsigned int (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2ui_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24870,26 +25102,26 @@ unsigned int HP_DB_data2ui(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2ui(data);
}
- if( HPMHooks.count.HP_DB_data2ui_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2ui_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ui_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2ui_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
}
return retVal___;
}
-void* HP_DB_data2ptr(DBData *data) {
+void* HP_DB_data2ptr(struct DBData *data) {
int hIndex = 0;
void* retVal___ = NULL;
- if( HPMHooks.count.HP_DB_data2ptr_pre ) {
- void* (*preHookFunc) (DBData *data);
+ if (HPMHooks.count.HP_DB_data2ptr_pre > 0) {
+ void* (*preHookFunc) (struct DBData **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_data2ptr_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24897,9 +25129,9 @@ void* HP_DB_data2ptr(DBData *data) {
{
retVal___ = HPMHooks.source.DB.data2ptr(data);
}
- if( HPMHooks.count.HP_DB_data2ptr_post ) {
- void* (*postHookFunc) (void* retVal___, DBData *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_DB_data2ptr_post > 0) {
+ void* (*postHookFunc) (void* retVal___, struct DBData *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_data2ptr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_data2ptr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -24908,14 +25140,14 @@ void* HP_DB_data2ptr(DBData *data) {
}
void HP_DB_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_DB_init_pre ) {
+ if (HPMHooks.count.HP_DB_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24923,9 +25155,9 @@ void HP_DB_init(void) {
{
HPMHooks.source.DB.init();
}
- if( HPMHooks.count.HP_DB_init_post ) {
+ if (HPMHooks.count.HP_DB_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_init_post[hIndex].func;
postHookFunc();
}
@@ -24934,14 +25166,14 @@ void HP_DB_init(void) {
}
void HP_DB_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_DB_final_pre ) {
+ if (HPMHooks.count.HP_DB_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_DB_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -24949,27 +25181,80 @@ void HP_DB_final(void) {
{
HPMHooks.source.DB.final();
}
- if( HPMHooks.count.HP_DB_final_post ) {
+ if (HPMHooks.count.HP_DB_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_DB_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_DB_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* duel */
+/* des_interface */
+void HP_des_decrypt_block(struct des_bit64 *block) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_des_decrypt_block_pre > 0) {
+ void (*preHookFunc) (struct des_bit64 **block);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_des_decrypt_block_pre[hIndex].func;
+ preHookFunc(&block);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.des.decrypt_block(block);
+ }
+ if (HPMHooks.count.HP_des_decrypt_block_post > 0) {
+ void (*postHookFunc) (struct des_bit64 *block);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_block_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_des_decrypt_block_post[hIndex].func;
+ postHookFunc(block);
+ }
+ }
+ return;
+}
+void HP_des_decrypt(unsigned char *data, size_t size) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_des_decrypt_pre > 0) {
+ void (*preHookFunc) (unsigned char **data, size_t *size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_des_decrypt_pre[hIndex].func;
+ preHookFunc(&data, &size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.des.decrypt(data, size);
+ }
+ if (HPMHooks.count.HP_des_decrypt_post > 0) {
+ void (*postHookFunc) (unsigned char *data, size_t size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_des_decrypt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_des_decrypt_post[hIndex].func;
+ postHookFunc(data, size);
+ }
+ }
+ return;
+}
+/* duel_interface */
int HP_duel_create(struct map_session_data *sd, const unsigned int maxpl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_duel_create_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const unsigned int *maxpl);
+ if (HPMHooks.count.HP_duel_create_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const unsigned int *maxpl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &maxpl);
+ retVal___ = preHookFunc(&sd, &maxpl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -24977,25 +25262,25 @@ int HP_duel_create(struct map_session_data *sd, const unsigned int maxpl) {
{
retVal___ = HPMHooks.source.duel.create(sd, maxpl);
}
- if( HPMHooks.count.HP_duel_create_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, const unsigned int *maxpl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_create_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const unsigned int maxpl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &maxpl);
+ retVal___ = postHookFunc(retVal___, sd, maxpl);
}
}
return retVal___;
}
void HP_duel_invite(const unsigned int did, struct map_session_data *sd, struct map_session_data *target_sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_invite_pre ) {
- void (*preHookFunc) (const unsigned int *did, struct map_session_data *sd, struct map_session_data *target_sd);
+ if (HPMHooks.count.HP_duel_invite_pre > 0) {
+ void (*preHookFunc) (const unsigned int *did, struct map_session_data **sd, struct map_session_data **target_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_invite_pre[hIndex].func;
- preHookFunc(&did, sd, target_sd);
+ preHookFunc(&did, &sd, &target_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25003,25 +25288,25 @@ void HP_duel_invite(const unsigned int did, struct map_session_data *sd, struct
{
HPMHooks.source.duel.invite(did, sd, target_sd);
}
- if( HPMHooks.count.HP_duel_invite_post ) {
- void (*postHookFunc) (const unsigned int *did, struct map_session_data *sd, struct map_session_data *target_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_invite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_invite_post > 0) {
+ void (*postHookFunc) (const unsigned int did, struct map_session_data *sd, struct map_session_data *target_sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_invite_post[hIndex].func;
- postHookFunc(&did, sd, target_sd);
+ postHookFunc(did, sd, target_sd);
}
}
return;
}
void HP_duel_accept(const unsigned int did, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_accept_pre ) {
- void (*preHookFunc) (const unsigned int *did, struct map_session_data *sd);
+ if (HPMHooks.count.HP_duel_accept_pre > 0) {
+ void (*preHookFunc) (const unsigned int *did, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_accept_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_accept_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_accept_pre[hIndex].func;
- preHookFunc(&did, sd);
+ preHookFunc(&did, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25029,25 +25314,25 @@ void HP_duel_accept(const unsigned int did, struct map_session_data *sd) {
{
HPMHooks.source.duel.accept(did, sd);
}
- if( HPMHooks.count.HP_duel_accept_post ) {
- void (*postHookFunc) (const unsigned int *did, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_accept_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_accept_post > 0) {
+ void (*postHookFunc) (const unsigned int did, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_accept_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_accept_post[hIndex].func;
- postHookFunc(&did, sd);
+ postHookFunc(did, sd);
}
}
return;
}
void HP_duel_reject(const unsigned int did, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_reject_pre ) {
- void (*preHookFunc) (const unsigned int *did, struct map_session_data *sd);
+ if (HPMHooks.count.HP_duel_reject_pre > 0) {
+ void (*preHookFunc) (const unsigned int *did, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_reject_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_reject_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_reject_pre[hIndex].func;
- preHookFunc(&did, sd);
+ preHookFunc(&did, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25055,25 +25340,25 @@ void HP_duel_reject(const unsigned int did, struct map_session_data *sd) {
{
HPMHooks.source.duel.reject(did, sd);
}
- if( HPMHooks.count.HP_duel_reject_post ) {
- void (*postHookFunc) (const unsigned int *did, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_reject_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_reject_post > 0) {
+ void (*postHookFunc) (const unsigned int did, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_reject_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_reject_post[hIndex].func;
- postHookFunc(&did, sd);
+ postHookFunc(did, sd);
}
}
return;
}
void HP_duel_leave(const unsigned int did, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_leave_pre ) {
- void (*preHookFunc) (const unsigned int *did, struct map_session_data *sd);
+ if (HPMHooks.count.HP_duel_leave_pre > 0) {
+ void (*preHookFunc) (const unsigned int *did, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_leave_pre[hIndex].func;
- preHookFunc(&did, sd);
+ preHookFunc(&did, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25081,25 +25366,25 @@ void HP_duel_leave(const unsigned int did, struct map_session_data *sd) {
{
HPMHooks.source.duel.leave(did, sd);
}
- if( HPMHooks.count.HP_duel_leave_post ) {
- void (*postHookFunc) (const unsigned int *did, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_leave_post > 0) {
+ void (*postHookFunc) (const unsigned int did, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_leave_post[hIndex].func;
- postHookFunc(&did, sd);
+ postHookFunc(did, sd);
}
}
return;
}
void HP_duel_showinfo(const unsigned int did, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_showinfo_pre ) {
- void (*preHookFunc) (const unsigned int *did, struct map_session_data *sd);
+ if (HPMHooks.count.HP_duel_showinfo_pre > 0) {
+ void (*preHookFunc) (const unsigned int *did, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_showinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_showinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_showinfo_pre[hIndex].func;
- preHookFunc(&did, sd);
+ preHookFunc(&did, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25107,11 +25392,11 @@ void HP_duel_showinfo(const unsigned int did, struct map_session_data *sd) {
{
HPMHooks.source.duel.showinfo(did, sd);
}
- if( HPMHooks.count.HP_duel_showinfo_post ) {
- void (*postHookFunc) (const unsigned int *did, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_showinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_showinfo_post > 0) {
+ void (*postHookFunc) (const unsigned int did, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_showinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_showinfo_post[hIndex].func;
- postHookFunc(&did, sd);
+ postHookFunc(did, sd);
}
}
return;
@@ -25119,14 +25404,14 @@ void HP_duel_showinfo(const unsigned int did, struct map_session_data *sd) {
int HP_duel_checktime(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_duel_checktime_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_duel_checktime_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_checktime_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_checktime_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_checktime_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25134,9 +25419,9 @@ int HP_duel_checktime(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.duel.checktime(sd);
}
- if( HPMHooks.count.HP_duel_checktime_post ) {
+ if (HPMHooks.count.HP_duel_checktime_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_checktime_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_checktime_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_checktime_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -25145,14 +25430,14 @@ int HP_duel_checktime(struct map_session_data *sd) {
}
void HP_duel_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_init_pre ) {
+ if (HPMHooks.count.HP_duel_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25160,25 +25445,25 @@ void HP_duel_init(bool minimal) {
{
HPMHooks.source.duel.init(minimal);
}
- if( HPMHooks.count.HP_duel_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_duel_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_duel_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_duel_final_pre ) {
+ if (HPMHooks.count.HP_duel_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_duel_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25186,27 +25471,27 @@ void HP_duel_final(void) {
{
HPMHooks.source.duel.final();
}
- if( HPMHooks.count.HP_duel_final_post ) {
+ if (HPMHooks.count.HP_duel_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_duel_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_duel_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_duel_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* elemental */
+/* elemental_interface */
int HP_elemental_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_init_pre ) {
+ if (HPMHooks.count.HP_elemental_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25214,25 +25499,25 @@ int HP_elemental_init(bool minimal) {
{
retVal___ = HPMHooks.source.elemental.init(minimal);
}
- if( HPMHooks.count.HP_elemental_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
}
void HP_elemental_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_elemental_final_pre ) {
+ if (HPMHooks.count.HP_elemental_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25240,9 +25525,9 @@ void HP_elemental_final(void) {
{
HPMHooks.source.elemental.final();
}
- if( HPMHooks.count.HP_elemental_final_post ) {
+ if (HPMHooks.count.HP_elemental_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_final_post[hIndex].func;
postHookFunc();
}
@@ -25252,14 +25537,14 @@ void HP_elemental_final(void) {
bool HP_elemental_class(int class_) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_elemental_class_pre ) {
+ if (HPMHooks.count.HP_elemental_class_pre > 0) {
bool (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_class_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_class_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_class_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25267,11 +25552,11 @@ bool HP_elemental_class(int class_) {
{
retVal___ = HPMHooks.source.elemental.class(class_);
}
- if( HPMHooks.count.HP_elemental_class_post ) {
- bool (*postHookFunc) (bool retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_class_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_class_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_class_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_class_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -25279,14 +25564,14 @@ bool HP_elemental_class(int class_) {
struct view_data* HP_elemental_get_viewdata(int class_) {
int hIndex = 0;
struct view_data* retVal___ = NULL;
- if( HPMHooks.count.HP_elemental_get_viewdata_pre ) {
+ if (HPMHooks.count.HP_elemental_get_viewdata_pre > 0) {
struct view_data* (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_get_viewdata_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25294,11 +25579,11 @@ struct view_data* HP_elemental_get_viewdata(int class_) {
{
retVal___ = HPMHooks.source.elemental.get_viewdata(class_);
}
- if( HPMHooks.count.HP_elemental_get_viewdata_post ) {
- struct view_data* (*postHookFunc) (struct view_data* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_viewdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_get_viewdata_post > 0) {
+ struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_get_viewdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -25306,14 +25591,14 @@ struct view_data* HP_elemental_get_viewdata(int class_) {
int HP_elemental_create(struct map_session_data *sd, int class_, unsigned int lifetime) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_create_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *class_, unsigned int *lifetime);
+ if (HPMHooks.count.HP_elemental_create_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *class_, unsigned int *lifetime);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &class_, &lifetime);
+ retVal___ = preHookFunc(&sd, &class_, &lifetime);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25321,26 +25606,26 @@ int HP_elemental_create(struct map_session_data *sd, int class_, unsigned int li
{
retVal___ = HPMHooks.source.elemental.create(sd, class_, lifetime);
}
- if( HPMHooks.count.HP_elemental_create_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *class_, unsigned int *lifetime);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_create_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int class_, unsigned int lifetime);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &class_, &lifetime);
+ retVal___ = postHookFunc(retVal___, sd, class_, lifetime);
}
}
return retVal___;
}
-int HP_elemental_data_received(struct s_elemental *ele, bool flag) {
+int HP_elemental_data_received(const struct s_elemental *ele, bool flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_data_received_pre ) {
- int (*preHookFunc) (struct s_elemental *ele, bool *flag);
+ if (HPMHooks.count.HP_elemental_data_received_pre > 0) {
+ int (*preHookFunc) (const struct s_elemental **ele, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_data_received_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_data_received_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_data_received_pre[hIndex].func;
- retVal___ = preHookFunc(ele, &flag);
+ retVal___ = preHookFunc(&ele, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25348,11 +25633,11 @@ int HP_elemental_data_received(struct s_elemental *ele, bool flag) {
{
retVal___ = HPMHooks.source.elemental.data_received(ele, flag);
}
- if( HPMHooks.count.HP_elemental_data_received_post ) {
- int (*postHookFunc) (int retVal___, struct s_elemental *ele, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_data_received_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_data_received_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct s_elemental *ele, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_data_received_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_data_received_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ele, &flag);
+ retVal___ = postHookFunc(retVal___, ele, flag);
}
}
return retVal___;
@@ -25360,14 +25645,14 @@ int HP_elemental_data_received(struct s_elemental *ele, bool flag) {
int HP_elemental_save(struct elemental_data *ed) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_save_pre ) {
- int (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_save_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_save_pre[hIndex].func;
- retVal___ = preHookFunc(ed);
+ retVal___ = preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25375,9 +25660,9 @@ int HP_elemental_save(struct elemental_data *ed) {
{
retVal___ = HPMHooks.source.elemental.save(ed);
}
- if( HPMHooks.count.HP_elemental_save_post ) {
+ if (HPMHooks.count.HP_elemental_save_post > 0) {
int (*postHookFunc) (int retVal___, struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ed);
}
@@ -25387,14 +25672,14 @@ int HP_elemental_save(struct elemental_data *ed) {
int HP_elemental_change_mode_ack(struct elemental_data *ed, int mode) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_change_mode_ack_pre ) {
- int (*preHookFunc) (struct elemental_data *ed, int *mode);
+ if (HPMHooks.count.HP_elemental_change_mode_ack_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, int *mode);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_change_mode_ack_pre[hIndex].func;
- retVal___ = preHookFunc(ed, &mode);
+ retVal___ = preHookFunc(&ed, &mode);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25402,26 +25687,26 @@ int HP_elemental_change_mode_ack(struct elemental_data *ed, int mode) {
{
retVal___ = HPMHooks.source.elemental.change_mode_ack(ed, mode);
}
- if( HPMHooks.count.HP_elemental_change_mode_ack_post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, int *mode);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_change_mode_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, int mode);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_change_mode_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, &mode);
+ retVal___ = postHookFunc(retVal___, ed, mode);
}
}
return retVal___;
}
-int HP_elemental_change_mode(struct elemental_data *ed, int mode) {
+int HP_elemental_change_mode(struct elemental_data *ed, uint32 mode) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_change_mode_pre ) {
- int (*preHookFunc) (struct elemental_data *ed, int *mode);
+ if (HPMHooks.count.HP_elemental_change_mode_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, uint32 *mode);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_change_mode_pre[hIndex].func;
- retVal___ = preHookFunc(ed, &mode);
+ retVal___ = preHookFunc(&ed, &mode);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25429,25 +25714,25 @@ int HP_elemental_change_mode(struct elemental_data *ed, int mode) {
{
retVal___ = HPMHooks.source.elemental.change_mode(ed, mode);
}
- if( HPMHooks.count.HP_elemental_change_mode_post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, int *mode);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_change_mode_post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, uint32 mode);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_change_mode_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_change_mode_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, &mode);
+ retVal___ = postHookFunc(retVal___, ed, mode);
}
}
return retVal___;
}
void HP_elemental_heal(struct elemental_data *ed, int hp, int sp) {
int hIndex = 0;
- if( HPMHooks.count.HP_elemental_heal_pre ) {
- void (*preHookFunc) (struct elemental_data *ed, int *hp, int *sp);
+ if (HPMHooks.count.HP_elemental_heal_pre > 0) {
+ void (*preHookFunc) (struct elemental_data **ed, int *hp, int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_heal_pre[hIndex].func;
- preHookFunc(ed, &hp, &sp);
+ preHookFunc(&ed, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25455,11 +25740,11 @@ void HP_elemental_heal(struct elemental_data *ed, int hp, int sp) {
{
HPMHooks.source.elemental.heal(ed, hp, sp);
}
- if( HPMHooks.count.HP_elemental_heal_post ) {
- void (*postHookFunc) (struct elemental_data *ed, int *hp, int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_heal_post > 0) {
+ void (*postHookFunc) (struct elemental_data *ed, int hp, int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_heal_post[hIndex].func;
- postHookFunc(ed, &hp, &sp);
+ postHookFunc(ed, hp, sp);
}
}
return;
@@ -25467,14 +25752,14 @@ void HP_elemental_heal(struct elemental_data *ed, int hp, int sp) {
int HP_elemental_dead(struct elemental_data *ed) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_dead_pre ) {
- int (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_dead_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_dead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_dead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_dead_pre[hIndex].func;
- retVal___ = preHookFunc(ed);
+ retVal___ = preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25482,9 +25767,9 @@ int HP_elemental_dead(struct elemental_data *ed) {
{
retVal___ = HPMHooks.source.elemental.dead(ed);
}
- if( HPMHooks.count.HP_elemental_dead_post ) {
+ if (HPMHooks.count.HP_elemental_dead_post > 0) {
int (*postHookFunc) (int retVal___, struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_dead_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_dead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_dead_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ed);
}
@@ -25494,14 +25779,14 @@ int HP_elemental_dead(struct elemental_data *ed) {
int HP_elemental_delete(struct elemental_data *ed, int reply) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_delete_pre ) {
- int (*preHookFunc) (struct elemental_data *ed, int *reply);
+ if (HPMHooks.count.HP_elemental_delete_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, int *reply);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_delete_pre[hIndex].func;
- retVal___ = preHookFunc(ed, &reply);
+ retVal___ = preHookFunc(&ed, &reply);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25509,25 +25794,25 @@ int HP_elemental_delete(struct elemental_data *ed, int reply) {
{
retVal___ = HPMHooks.source.elemental.delete(ed, reply);
}
- if( HPMHooks.count.HP_elemental_delete_post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, int *reply);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, int reply);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, &reply);
+ retVal___ = postHookFunc(retVal___, ed, reply);
}
}
return retVal___;
}
void HP_elemental_summon_stop(struct elemental_data *ed) {
int hIndex = 0;
- if( HPMHooks.count.HP_elemental_summon_stop_pre ) {
- void (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_summon_stop_pre > 0) {
+ void (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_stop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_stop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_summon_stop_pre[hIndex].func;
- preHookFunc(ed);
+ preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25535,9 +25820,9 @@ void HP_elemental_summon_stop(struct elemental_data *ed) {
{
HPMHooks.source.elemental.summon_stop(ed);
}
- if( HPMHooks.count.HP_elemental_summon_stop_post ) {
+ if (HPMHooks.count.HP_elemental_summon_stop_post > 0) {
void (*postHookFunc) (struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_stop_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_stop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_summon_stop_post[hIndex].func;
postHookFunc(ed);
}
@@ -25547,14 +25832,14 @@ void HP_elemental_summon_stop(struct elemental_data *ed) {
int HP_elemental_get_lifetime(struct elemental_data *ed) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_get_lifetime_pre ) {
- int (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_get_lifetime_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_lifetime_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_lifetime_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_get_lifetime_pre[hIndex].func;
- retVal___ = preHookFunc(ed);
+ retVal___ = preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25562,9 +25847,9 @@ int HP_elemental_get_lifetime(struct elemental_data *ed) {
{
retVal___ = HPMHooks.source.elemental.get_lifetime(ed);
}
- if( HPMHooks.count.HP_elemental_get_lifetime_post ) {
+ if (HPMHooks.count.HP_elemental_get_lifetime_post > 0) {
int (*postHookFunc) (int retVal___, struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_lifetime_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_get_lifetime_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_get_lifetime_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ed);
}
@@ -25574,14 +25859,14 @@ int HP_elemental_get_lifetime(struct elemental_data *ed) {
int HP_elemental_unlocktarget(struct elemental_data *ed) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_unlocktarget_pre ) {
- int (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_unlocktarget_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_unlocktarget_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_unlocktarget_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_unlocktarget_pre[hIndex].func;
- retVal___ = preHookFunc(ed);
+ retVal___ = preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25589,9 +25874,9 @@ int HP_elemental_unlocktarget(struct elemental_data *ed) {
{
retVal___ = HPMHooks.source.elemental.unlocktarget(ed);
}
- if( HPMHooks.count.HP_elemental_unlocktarget_post ) {
+ if (HPMHooks.count.HP_elemental_unlocktarget_post > 0) {
int (*postHookFunc) (int retVal___, struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_unlocktarget_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_unlocktarget_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_unlocktarget_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ed);
}
@@ -25601,14 +25886,14 @@ int HP_elemental_unlocktarget(struct elemental_data *ed) {
int HP_elemental_skillnotok(uint16 skill_id, struct elemental_data *ed) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_skillnotok_pre ) {
- int (*preHookFunc) (uint16 *skill_id, struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_skillnotok_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skillnotok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skillnotok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_skillnotok_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, ed);
+ retVal___ = preHookFunc(&skill_id, &ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25616,11 +25901,11 @@ int HP_elemental_skillnotok(uint16 skill_id, struct elemental_data *ed) {
{
retVal___ = HPMHooks.source.elemental.skillnotok(skill_id, ed);
}
- if( HPMHooks.count.HP_elemental_skillnotok_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skillnotok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_skillnotok_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct elemental_data *ed);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skillnotok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_skillnotok_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, ed);
+ retVal___ = postHookFunc(retVal___, skill_id, ed);
}
}
return retVal___;
@@ -25628,14 +25913,14 @@ int HP_elemental_skillnotok(uint16 skill_id, struct elemental_data *ed) {
int HP_elemental_set_target(struct map_session_data *sd, struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_set_target_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct block_list *bl);
+ if (HPMHooks.count.HP_elemental_set_target_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_set_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_set_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_set_target_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bl);
+ retVal___ = preHookFunc(&sd, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25643,9 +25928,9 @@ int HP_elemental_set_target(struct map_session_data *sd, struct block_list *bl)
{
retVal___ = HPMHooks.source.elemental.set_target(sd, bl);
}
- if( HPMHooks.count.HP_elemental_set_target_post ) {
+ if (HPMHooks.count.HP_elemental_set_target_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_set_target_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_set_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_set_target_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, bl);
}
@@ -25655,14 +25940,14 @@ int HP_elemental_set_target(struct map_session_data *sd, struct block_list *bl)
int HP_elemental_clean_single_effect(struct elemental_data *ed, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_clean_single_effect_pre ) {
- int (*preHookFunc) (struct elemental_data *ed, uint16 *skill_id);
+ if (HPMHooks.count.HP_elemental_clean_single_effect_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_single_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_single_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_clean_single_effect_pre[hIndex].func;
- retVal___ = preHookFunc(ed, &skill_id);
+ retVal___ = preHookFunc(&ed, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25670,11 +25955,11 @@ int HP_elemental_clean_single_effect(struct elemental_data *ed, uint16 skill_id)
{
retVal___ = HPMHooks.source.elemental.clean_single_effect(ed, skill_id);
}
- if( HPMHooks.count.HP_elemental_clean_single_effect_post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_single_effect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_clean_single_effect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_single_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_clean_single_effect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, &skill_id);
+ retVal___ = postHookFunc(retVal___, ed, skill_id);
}
}
return retVal___;
@@ -25682,14 +25967,14 @@ int HP_elemental_clean_single_effect(struct elemental_data *ed, uint16 skill_id)
int HP_elemental_clean_effect(struct elemental_data *ed) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_clean_effect_pre ) {
- int (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_clean_effect_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_clean_effect_pre[hIndex].func;
- retVal___ = preHookFunc(ed);
+ retVal___ = preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25697,9 +25982,9 @@ int HP_elemental_clean_effect(struct elemental_data *ed) {
{
retVal___ = HPMHooks.source.elemental.clean_effect(ed);
}
- if( HPMHooks.count.HP_elemental_clean_effect_post ) {
+ if (HPMHooks.count.HP_elemental_clean_effect_post > 0) {
int (*postHookFunc) (int retVal___, struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_effect_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_clean_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_clean_effect_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ed);
}
@@ -25709,14 +25994,14 @@ int HP_elemental_clean_effect(struct elemental_data *ed) {
int HP_elemental_action(struct elemental_data *ed, struct block_list *bl, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_action_pre ) {
- int (*preHookFunc) (struct elemental_data *ed, struct block_list *bl, int64 *tick);
+ if (HPMHooks.count.HP_elemental_action_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, struct block_list **bl, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_action_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_action_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_action_pre[hIndex].func;
- retVal___ = preHookFunc(ed, bl, &tick);
+ retVal___ = preHookFunc(&ed, &bl, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25724,27 +26009,26 @@ int HP_elemental_action(struct elemental_data *ed, struct block_list *bl, int64
{
retVal___ = HPMHooks.source.elemental.action(ed, bl, tick);
}
- if( HPMHooks.count.HP_elemental_action_post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, struct block_list *bl, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_action_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_action_post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, struct block_list *bl, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_action_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_action_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, bl, &tick);
+ retVal___ = postHookFunc(retVal___, ed, bl, tick);
}
}
return retVal___;
}
struct skill_condition HP_elemental_skill_get_requirements(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
- struct skill_condition retVal___;
- memset(&retVal___, '\0', sizeof(struct skill_condition));
- if( HPMHooks.count.HP_elemental_skill_get_requirements_pre ) {
+ struct skill_condition retVal___ = { 0 };
+ if (HPMHooks.count.HP_elemental_skill_get_requirements_pre > 0) {
struct skill_condition (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skill_get_requirements_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skill_get_requirements_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_skill_get_requirements_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25752,11 +26036,11 @@ struct skill_condition HP_elemental_skill_get_requirements(uint16 skill_id, uint
{
retVal___ = HPMHooks.source.elemental.skill_get_requirements(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_elemental_skill_get_requirements_post ) {
- struct skill_condition (*postHookFunc) (struct skill_condition retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skill_get_requirements_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_skill_get_requirements_post > 0) {
+ struct skill_condition (*postHookFunc) (struct skill_condition retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_skill_get_requirements_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_skill_get_requirements_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -25764,14 +26048,14 @@ struct skill_condition HP_elemental_skill_get_requirements(uint16 skill_id, uint
int HP_elemental_read_skilldb(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_read_skilldb_pre ) {
+ if (HPMHooks.count.HP_elemental_read_skilldb_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_skilldb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_skilldb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_read_skilldb_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25779,9 +26063,9 @@ int HP_elemental_read_skilldb(void) {
{
retVal___ = HPMHooks.source.elemental.read_skilldb();
}
- if( HPMHooks.count.HP_elemental_read_skilldb_post ) {
+ if (HPMHooks.count.HP_elemental_read_skilldb_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_skilldb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_skilldb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_read_skilldb_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -25790,14 +26074,14 @@ int HP_elemental_read_skilldb(void) {
}
void HP_elemental_reload_db(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_elemental_reload_db_pre ) {
+ if (HPMHooks.count.HP_elemental_reload_db_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_reload_db_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25805,9 +26089,9 @@ void HP_elemental_reload_db(void) {
{
HPMHooks.source.elemental.reload_db();
}
- if( HPMHooks.count.HP_elemental_reload_db_post ) {
+ if (HPMHooks.count.HP_elemental_reload_db_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_reload_db_post[hIndex].func;
postHookFunc();
}
@@ -25816,14 +26100,14 @@ void HP_elemental_reload_db(void) {
}
void HP_elemental_reload_skilldb(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_elemental_reload_skilldb_pre ) {
+ if (HPMHooks.count.HP_elemental_reload_skilldb_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_skilldb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_skilldb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_reload_skilldb_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25831,9 +26115,9 @@ void HP_elemental_reload_skilldb(void) {
{
HPMHooks.source.elemental.reload_skilldb();
}
- if( HPMHooks.count.HP_elemental_reload_skilldb_post ) {
+ if (HPMHooks.count.HP_elemental_reload_skilldb_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_skilldb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_reload_skilldb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_reload_skilldb_post[hIndex].func;
postHookFunc();
}
@@ -25843,14 +26127,14 @@ void HP_elemental_reload_skilldb(void) {
int HP_elemental_search_index(int class_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_search_index_pre ) {
+ if (HPMHooks.count.HP_elemental_search_index_pre > 0) {
int (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_search_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_search_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_search_index_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25858,25 +26142,25 @@ int HP_elemental_search_index(int class_) {
{
retVal___ = HPMHooks.source.elemental.search_index(class_);
}
- if( HPMHooks.count.HP_elemental_search_index_post ) {
- int (*postHookFunc) (int retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_search_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_search_index_post > 0) {
+ int (*postHookFunc) (int retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_search_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_search_index_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
}
void HP_elemental_summon_init(struct elemental_data *ed) {
int hIndex = 0;
- if( HPMHooks.count.HP_elemental_summon_init_pre ) {
- void (*preHookFunc) (struct elemental_data *ed);
+ if (HPMHooks.count.HP_elemental_summon_init_pre > 0) {
+ void (*preHookFunc) (struct elemental_data **ed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_summon_init_pre[hIndex].func;
- preHookFunc(ed);
+ preHookFunc(&ed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -25884,9 +26168,9 @@ void HP_elemental_summon_init(struct elemental_data *ed) {
{
HPMHooks.source.elemental.summon_init(ed);
}
- if( HPMHooks.count.HP_elemental_summon_init_post ) {
+ if (HPMHooks.count.HP_elemental_summon_init_post > 0) {
void (*postHookFunc) (struct elemental_data *ed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_summon_init_post[hIndex].func;
postHookFunc(ed);
}
@@ -25896,14 +26180,14 @@ void HP_elemental_summon_init(struct elemental_data *ed) {
int HP_elemental_summon_end_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_summon_end_timer_pre ) {
+ if (HPMHooks.count.HP_elemental_summon_end_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_end_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_end_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_summon_end_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25911,11 +26195,11 @@ int HP_elemental_summon_end_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.elemental.summon_end_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_elemental_summon_end_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_end_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_summon_end_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_summon_end_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_summon_end_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -25923,16 +26207,16 @@ int HP_elemental_summon_end_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_elemental_ai_sub_timer_activesearch(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_elemental_ai_sub_timer_activesearch_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25942,9 +26226,9 @@ int HP_elemental_ai_sub_timer_activesearch(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.elemental.ai_sub_timer_activesearch(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_post ) {
+ if (HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_activesearch_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_elemental_ai_sub_timer_activesearch_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -25956,14 +26240,14 @@ int HP_elemental_ai_sub_timer_activesearch(struct block_list *bl, va_list ap) {
int HP_elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data *sd, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_ai_sub_timer_pre ) {
- int (*preHookFunc) (struct elemental_data *ed, struct map_session_data *sd, int64 *tick);
+ if (HPMHooks.count.HP_elemental_ai_sub_timer_pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, struct map_session_data **sd, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_ai_sub_timer_pre[hIndex].func;
- retVal___ = preHookFunc(ed, sd, &tick);
+ retVal___ = preHookFunc(&ed, &sd, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -25971,11 +26255,11 @@ int HP_elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data
{
retVal___ = HPMHooks.source.elemental.ai_sub_timer(ed, sd, tick);
}
- if( HPMHooks.count.HP_elemental_ai_sub_timer_post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, struct map_session_data *sd, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_ai_sub_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, struct map_session_data *sd, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_ai_sub_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, sd, &tick);
+ retVal___ = postHookFunc(retVal___, ed, sd, tick);
}
}
return retVal___;
@@ -25983,16 +26267,16 @@ int HP_elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_data
int HP_elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_ai_sub_foreachclient_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_elemental_ai_sub_foreachclient_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_foreachclient_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_foreachclient_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_elemental_ai_sub_foreachclient_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26002,9 +26286,9 @@ int HP_elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
retVal___ = HPMHooks.source.elemental.ai_sub_foreachclient(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_elemental_ai_sub_foreachclient_post ) {
+ if (HPMHooks.count.HP_elemental_ai_sub_foreachclient_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_foreachclient_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_sub_foreachclient_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_elemental_ai_sub_foreachclient_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -26016,14 +26300,14 @@ int HP_elemental_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int HP_elemental_ai_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_ai_timer_pre ) {
+ if (HPMHooks.count.HP_elemental_ai_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_ai_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26031,11 +26315,11 @@ int HP_elemental_ai_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.elemental.ai_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_elemental_ai_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_elemental_ai_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_ai_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_ai_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -26043,14 +26327,14 @@ int HP_elemental_ai_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_elemental_read_db(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_elemental_read_db_pre ) {
+ if (HPMHooks.count.HP_elemental_read_db_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_elemental_read_db_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26058,26 +26342,214 @@ int HP_elemental_read_db(void) {
{
retVal___ = HPMHooks.source.elemental.read_db();
}
- if( HPMHooks.count.HP_elemental_read_db_post ) {
+ if (HPMHooks.count.HP_elemental_read_db_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_elemental_read_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_elemental_read_db_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-/* guild */
+/* grfio_interface */
+void HP_grfio_init(const char *fname) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_grfio_init_pre > 0) {
+ void (*preHookFunc) (const char **fname);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_init_pre[hIndex].func;
+ preHookFunc(&fname);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.grfio.init(fname);
+ }
+ if (HPMHooks.count.HP_grfio_init_post > 0) {
+ void (*postHookFunc) (const char *fname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_init_post[hIndex].func;
+ postHookFunc(fname);
+ }
+ }
+ return;
+}
+void HP_grfio_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_grfio_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.grfio.final();
+ }
+ if (HPMHooks.count.HP_grfio_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void* HP_grfio_reads(const char *fname, int *size) {
+ int hIndex = 0;
+ void* retVal___ = NULL;
+ if (HPMHooks.count.HP_grfio_reads_pre > 0) {
+ void* (*preHookFunc) (const char **fname, int **size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_reads_pre[hIndex].func;
+ retVal___ = preHookFunc(&fname, &size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.grfio.reads(fname, size);
+ }
+ if (HPMHooks.count.HP_grfio_reads_post > 0) {
+ void* (*postHookFunc) (void* retVal___, const char *fname, int *size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_reads_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_reads_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fname, size);
+ }
+ }
+ return retVal___;
+}
+const char* HP_grfio_find_file(const char *fname) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_grfio_find_file_pre > 0) {
+ const char* (*preHookFunc) (const char **fname);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_find_file_pre[hIndex].func;
+ retVal___ = preHookFunc(&fname);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.grfio.find_file(fname);
+ }
+ if (HPMHooks.count.HP_grfio_find_file_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *fname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_find_file_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_find_file_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, fname);
+ }
+ }
+ return retVal___;
+}
+unsigned long HP_grfio_crc32(const unsigned char *buf, unsigned int len) {
+ int hIndex = 0;
+ unsigned long retVal___ = 0;
+ if (HPMHooks.count.HP_grfio_crc32_pre > 0) {
+ unsigned long (*preHookFunc) (const unsigned char **buf, unsigned int *len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_crc32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_crc32_pre[hIndex].func;
+ retVal___ = preHookFunc(&buf, &len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.grfio.crc32(buf, len);
+ }
+ if (HPMHooks.count.HP_grfio_crc32_post > 0) {
+ unsigned long (*postHookFunc) (unsigned long retVal___, const unsigned char *buf, unsigned int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_crc32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_crc32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, buf, len);
+ }
+ }
+ return retVal___;
+}
+int HP_grfio_decode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_grfio_decode_zip_pre > 0) {
+ int (*preHookFunc) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_zip_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_decode_zip_pre[hIndex].func;
+ retVal___ = preHookFunc(&dest, &dest_len, &source, &source_len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.grfio.decode_zip(dest, dest_len, source, source_len);
+ }
+ if (HPMHooks.count.HP_grfio_decode_zip_post > 0) {
+ int (*postHookFunc) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_decode_zip_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_decode_zip_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, dest, dest_len, source, source_len);
+ }
+ }
+ return retVal___;
+}
+int HP_grfio_encode_zip(void *dest, unsigned long *dest_len, const void *source, unsigned long source_len) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_grfio_encode_zip_pre > 0) {
+ int (*preHookFunc) (void **dest, unsigned long **dest_len, const void **source, unsigned long *source_len);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_encode_zip_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_grfio_encode_zip_pre[hIndex].func;
+ retVal___ = preHookFunc(&dest, &dest_len, &source, &source_len);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.grfio.encode_zip(dest, dest_len, source, source_len);
+ }
+ if (HPMHooks.count.HP_grfio_encode_zip_post > 0) {
+ int (*postHookFunc) (int retVal___, void *dest, unsigned long *dest_len, const void *source, unsigned long source_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_grfio_encode_zip_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_grfio_encode_zip_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, dest, dest_len, source, source_len);
+ }
+ }
+ return retVal___;
+}
+/* guild_interface */
void HP_guild_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_init_pre ) {
+ if (HPMHooks.count.HP_guild_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -26085,25 +26557,25 @@ void HP_guild_init(bool minimal) {
{
HPMHooks.source.guild.init(minimal);
}
- if( HPMHooks.count.HP_guild_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_guild_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_final_pre ) {
+ if (HPMHooks.count.HP_guild_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -26111,9 +26583,9 @@ void HP_guild_final(void) {
{
HPMHooks.source.guild.final();
}
- if( HPMHooks.count.HP_guild_final_post ) {
+ if (HPMHooks.count.HP_guild_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_final_post[hIndex].func;
postHookFunc();
}
@@ -26123,14 +26595,14 @@ void HP_guild_final(void) {
int HP_guild_skill_get_max(int id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_skill_get_max_pre ) {
+ if (HPMHooks.count.HP_guild_skill_get_max_pre > 0) {
int (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_skill_get_max_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_skill_get_max_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_skill_get_max_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26138,11 +26610,11 @@ int HP_guild_skill_get_max(int id) {
{
retVal___ = HPMHooks.source.guild.skill_get_max(id);
}
- if( HPMHooks.count.HP_guild_skill_get_max_post ) {
- int (*postHookFunc) (int retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_skill_get_max_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_skill_get_max_post > 0) {
+ int (*postHookFunc) (int retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_skill_get_max_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_skill_get_max_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -26150,14 +26622,14 @@ int HP_guild_skill_get_max(int id) {
int HP_guild_checkskill(struct guild *g, int id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_checkskill_pre ) {
- int (*preHookFunc) (struct guild *g, int *id);
+ if (HPMHooks.count.HP_guild_checkskill_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_checkskill_pre[hIndex].func;
- retVal___ = preHookFunc(g, &id);
+ retVal___ = preHookFunc(&g, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26165,11 +26637,11 @@ int HP_guild_checkskill(struct guild *g, int id) {
{
retVal___ = HPMHooks.source.guild.checkskill(g, id);
}
- if( HPMHooks.count.HP_guild_checkskill_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_checkskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_checkskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &id);
+ retVal___ = postHookFunc(retVal___, g, id);
}
}
return retVal___;
@@ -26177,14 +26649,14 @@ int HP_guild_checkskill(struct guild *g, int id) {
int HP_guild_check_skill_require(struct guild *g, int id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_check_skill_require_pre ) {
- int (*preHookFunc) (struct guild *g, int *id);
+ if (HPMHooks.count.HP_guild_check_skill_require_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_skill_require_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_skill_require_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_check_skill_require_pre[hIndex].func;
- retVal___ = preHookFunc(g, &id);
+ retVal___ = preHookFunc(&g, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26192,11 +26664,11 @@ int HP_guild_check_skill_require(struct guild *g, int id) {
{
retVal___ = HPMHooks.source.guild.check_skill_require(g, id);
}
- if( HPMHooks.count.HP_guild_check_skill_require_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_skill_require_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_check_skill_require_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_skill_require_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_check_skill_require_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &id);
+ retVal___ = postHookFunc(retVal___, g, id);
}
}
return retVal___;
@@ -26204,14 +26676,14 @@ int HP_guild_check_skill_require(struct guild *g, int id) {
int HP_guild_checkcastles(struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_checkcastles_pre ) {
- int (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_guild_checkcastles_pre > 0) {
+ int (*preHookFunc) (struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkcastles_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkcastles_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_checkcastles_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26219,9 +26691,9 @@ int HP_guild_checkcastles(struct guild *g) {
{
retVal___ = HPMHooks.source.guild.checkcastles(g);
}
- if( HPMHooks.count.HP_guild_checkcastles_post ) {
+ if (HPMHooks.count.HP_guild_checkcastles_post > 0) {
int (*postHookFunc) (int retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkcastles_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_checkcastles_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_checkcastles_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
@@ -26231,14 +26703,14 @@ int HP_guild_checkcastles(struct guild *g) {
bool HP_guild_isallied(int guild_id, int guild_id2) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_guild_isallied_pre ) {
+ if (HPMHooks.count.HP_guild_isallied_pre > 0) {
bool (*preHookFunc) (int *guild_id, int *guild_id2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_isallied_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_isallied_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_isallied_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &guild_id2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26246,11 +26718,11 @@ bool HP_guild_isallied(int guild_id, int guild_id2) {
{
retVal___ = HPMHooks.source.guild.isallied(guild_id, guild_id2);
}
- if( HPMHooks.count.HP_guild_isallied_post ) {
- bool (*postHookFunc) (bool retVal___, int *guild_id, int *guild_id2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_isallied_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_isallied_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int guild_id, int guild_id2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_isallied_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_isallied_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &guild_id2);
+ retVal___ = postHookFunc(retVal___, guild_id, guild_id2);
}
}
return retVal___;
@@ -26258,14 +26730,14 @@ bool HP_guild_isallied(int guild_id, int guild_id2) {
struct guild* HP_guild_search(int guild_id) {
int hIndex = 0;
struct guild* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_search_pre ) {
+ if (HPMHooks.count.HP_guild_search_pre > 0) {
struct guild* (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_search_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26273,11 +26745,11 @@ struct guild* HP_guild_search(int guild_id) {
{
retVal___ = HPMHooks.source.guild.search(guild_id);
}
- if( HPMHooks.count.HP_guild_search_post ) {
- struct guild* (*postHookFunc) (struct guild* retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_search_post > 0) {
+ struct guild* (*postHookFunc) (struct guild* retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -26285,14 +26757,14 @@ struct guild* HP_guild_search(int guild_id) {
struct guild* HP_guild_searchname(char *str) {
int hIndex = 0;
struct guild* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_searchname_pre ) {
- struct guild* (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_guild_searchname_pre > 0) {
+ struct guild* (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_searchname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_searchname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_searchname_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26300,9 +26772,9 @@ struct guild* HP_guild_searchname(char *str) {
{
retVal___ = HPMHooks.source.guild.searchname(str);
}
- if( HPMHooks.count.HP_guild_searchname_post ) {
+ if (HPMHooks.count.HP_guild_searchname_post > 0) {
struct guild* (*postHookFunc) (struct guild* retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_searchname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_searchname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_searchname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -26312,14 +26784,14 @@ struct guild* HP_guild_searchname(char *str) {
struct guild_castle* HP_guild_castle_search(int gcid) {
int hIndex = 0;
struct guild_castle* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_castle_search_pre ) {
+ if (HPMHooks.count.HP_guild_castle_search_pre > 0) {
struct guild_castle* (*preHookFunc) (int *gcid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_castle_search_pre[hIndex].func;
retVal___ = preHookFunc(&gcid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26327,11 +26799,11 @@ struct guild_castle* HP_guild_castle_search(int gcid) {
{
retVal___ = HPMHooks.source.guild.castle_search(gcid);
}
- if( HPMHooks.count.HP_guild_castle_search_post ) {
- struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, int *gcid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_castle_search_post > 0) {
+ struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, int gcid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_castle_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &gcid);
+ retVal___ = postHookFunc(retVal___, gcid);
}
}
return retVal___;
@@ -26339,14 +26811,14 @@ struct guild_castle* HP_guild_castle_search(int gcid) {
struct guild_castle* HP_guild_mapname2gc(const char *mapname) {
int hIndex = 0;
struct guild_castle* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_mapname2gc_pre ) {
- struct guild_castle* (*preHookFunc) (const char *mapname);
+ if (HPMHooks.count.HP_guild_mapname2gc_pre > 0) {
+ struct guild_castle* (*preHookFunc) (const char **mapname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapname2gc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapname2gc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_mapname2gc_pre[hIndex].func;
- retVal___ = preHookFunc(mapname);
+ retVal___ = preHookFunc(&mapname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26354,9 +26826,9 @@ struct guild_castle* HP_guild_mapname2gc(const char *mapname) {
{
retVal___ = HPMHooks.source.guild.mapname2gc(mapname);
}
- if( HPMHooks.count.HP_guild_mapname2gc_post ) {
+ if (HPMHooks.count.HP_guild_mapname2gc_post > 0) {
struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, const char *mapname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapname2gc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapname2gc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_mapname2gc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, mapname);
}
@@ -26366,14 +26838,14 @@ struct guild_castle* HP_guild_mapname2gc(const char *mapname) {
struct guild_castle* HP_guild_mapindex2gc(short map_index) {
int hIndex = 0;
struct guild_castle* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_mapindex2gc_pre ) {
+ if (HPMHooks.count.HP_guild_mapindex2gc_pre > 0) {
struct guild_castle* (*preHookFunc) (short *map_index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapindex2gc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapindex2gc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_mapindex2gc_pre[hIndex].func;
retVal___ = preHookFunc(&map_index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26381,11 +26853,11 @@ struct guild_castle* HP_guild_mapindex2gc(short map_index) {
{
retVal___ = HPMHooks.source.guild.mapindex2gc(map_index);
}
- if( HPMHooks.count.HP_guild_mapindex2gc_post ) {
- struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, short *map_index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapindex2gc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_mapindex2gc_post > 0) {
+ struct guild_castle* (*postHookFunc) (struct guild_castle* retVal___, short map_index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_mapindex2gc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_mapindex2gc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &map_index);
+ retVal___ = postHookFunc(retVal___, map_index);
}
}
return retVal___;
@@ -26393,14 +26865,14 @@ struct guild_castle* HP_guild_mapindex2gc(short map_index) {
struct map_session_data* HP_guild_getavailablesd(struct guild *g) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_getavailablesd_pre ) {
- struct map_session_data* (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_guild_getavailablesd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getavailablesd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getavailablesd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_getavailablesd_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26408,26 +26880,26 @@ struct map_session_data* HP_guild_getavailablesd(struct guild *g) {
{
retVal___ = HPMHooks.source.guild.getavailablesd(g);
}
- if( HPMHooks.count.HP_guild_getavailablesd_post ) {
+ if (HPMHooks.count.HP_guild_getavailablesd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getavailablesd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getavailablesd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_getavailablesd_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
}
return retVal___;
}
-int HP_guild_getindex(struct guild *g, int account_id, int char_id) {
+int HP_guild_getindex(const struct guild *g, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_getindex_pre ) {
- int (*preHookFunc) (struct guild *g, int *account_id, int *char_id);
+ if (HPMHooks.count.HP_guild_getindex_pre > 0) {
+ int (*preHookFunc) (const struct guild **g, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getindex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getindex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_getindex_pre[hIndex].func;
- retVal___ = preHookFunc(g, &account_id, &char_id);
+ retVal___ = preHookFunc(&g, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26435,11 +26907,11 @@ int HP_guild_getindex(struct guild *g, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.guild.getindex(g, account_id, char_id);
}
- if( HPMHooks.count.HP_guild_getindex_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getindex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_getindex_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct guild *g, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getindex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_getindex_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, g, account_id, char_id);
}
}
return retVal___;
@@ -26447,14 +26919,14 @@ int HP_guild_getindex(struct guild *g, int account_id, int char_id) {
int HP_guild_getposition(struct guild *g, struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_getposition_pre ) {
- int (*preHookFunc) (struct guild *g, struct map_session_data *sd);
+ if (HPMHooks.count.HP_guild_getposition_pre > 0) {
+ int (*preHookFunc) (struct guild **g, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getposition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getposition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_getposition_pre[hIndex].func;
- retVal___ = preHookFunc(g, sd);
+ retVal___ = preHookFunc(&g, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26462,9 +26934,9 @@ int HP_guild_getposition(struct guild *g, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.guild.getposition(g, sd);
}
- if( HPMHooks.count.HP_guild_getposition_post ) {
+ if (HPMHooks.count.HP_guild_getposition_post > 0) {
int (*postHookFunc) (int retVal___, struct guild *g, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getposition_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getposition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_getposition_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g, sd);
}
@@ -26474,14 +26946,14 @@ int HP_guild_getposition(struct guild *g, struct map_session_data *sd) {
unsigned int HP_guild_payexp(struct map_session_data *sd, unsigned int exp) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_guild_payexp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd, unsigned int *exp);
+ if (HPMHooks.count.HP_guild_payexp_pre > 0) {
+ unsigned int (*preHookFunc) (struct map_session_data **sd, unsigned int *exp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_payexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &exp);
+ retVal___ = preHookFunc(&sd, &exp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26489,11 +26961,11 @@ unsigned int HP_guild_payexp(struct map_session_data *sd, unsigned int exp) {
{
retVal___ = HPMHooks.source.guild.payexp(sd, exp);
}
- if( HPMHooks.count.HP_guild_payexp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, unsigned int *exp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_payexp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, unsigned int exp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_payexp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &exp);
+ retVal___ = postHookFunc(retVal___, sd, exp);
}
}
return retVal___;
@@ -26501,14 +26973,14 @@ unsigned int HP_guild_payexp(struct map_session_data *sd, unsigned int exp) {
int HP_guild_getexp(struct map_session_data *sd, int exp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_getexp_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *exp);
+ if (HPMHooks.count.HP_guild_getexp_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *exp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_getexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &exp);
+ retVal___ = preHookFunc(&sd, &exp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26516,11 +26988,11 @@ int HP_guild_getexp(struct map_session_data *sd, int exp) {
{
retVal___ = HPMHooks.source.guild.getexp(sd, exp);
}
- if( HPMHooks.count.HP_guild_getexp_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *exp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_getexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_getexp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int exp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_getexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_getexp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &exp);
+ retVal___ = postHookFunc(retVal___, sd, exp);
}
}
return retVal___;
@@ -26528,14 +27000,14 @@ int HP_guild_getexp(struct map_session_data *sd, int exp) {
int HP_guild_create(struct map_session_data *sd, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_create_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *name);
+ if (HPMHooks.count.HP_guild_create_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name);
+ retVal___ = preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26543,9 +27015,9 @@ int HP_guild_create(struct map_session_data *sd, const char *name) {
{
retVal___ = HPMHooks.source.guild.create(sd, name);
}
- if( HPMHooks.count.HP_guild_create_post ) {
+ if (HPMHooks.count.HP_guild_create_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, name);
}
@@ -26555,14 +27027,14 @@ int HP_guild_create(struct map_session_data *sd, const char *name) {
int HP_guild_created(int account_id, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_created_pre ) {
+ if (HPMHooks.count.HP_guild_created_pre > 0) {
int (*preHookFunc) (int *account_id, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_created_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26570,11 +27042,11 @@ int HP_guild_created(int account_id, int guild_id) {
{
retVal___ = HPMHooks.source.guild.created(account_id, guild_id);
}
- if( HPMHooks.count.HP_guild_created_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_created_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_created_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &guild_id);
+ retVal___ = postHookFunc(retVal___, account_id, guild_id);
}
}
return retVal___;
@@ -26582,14 +27054,14 @@ int HP_guild_created(int account_id, int guild_id) {
int HP_guild_request_info(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_request_info_pre ) {
+ if (HPMHooks.count.HP_guild_request_info_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_request_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_request_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_request_info_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26597,11 +27069,11 @@ int HP_guild_request_info(int guild_id) {
{
retVal___ = HPMHooks.source.guild.request_info(guild_id);
}
- if( HPMHooks.count.HP_guild_request_info_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_request_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_request_info_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_request_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_request_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -26609,14 +27081,14 @@ int HP_guild_request_info(int guild_id) {
int HP_guild_recv_noinfo(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_recv_noinfo_pre ) {
+ if (HPMHooks.count.HP_guild_recv_noinfo_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_noinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_noinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_recv_noinfo_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26624,26 +27096,26 @@ int HP_guild_recv_noinfo(int guild_id) {
{
retVal___ = HPMHooks.source.guild.recv_noinfo(guild_id);
}
- if( HPMHooks.count.HP_guild_recv_noinfo_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_noinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_recv_noinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_noinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_recv_noinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
}
-int HP_guild_recv_info(struct guild *sg) {
+int HP_guild_recv_info(const struct guild *sg) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_recv_info_pre ) {
- int (*preHookFunc) (struct guild *sg);
+ if (HPMHooks.count.HP_guild_recv_info_pre > 0) {
+ int (*preHookFunc) (const struct guild **sg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_recv_info_pre[hIndex].func;
- retVal___ = preHookFunc(sg);
+ retVal___ = preHookFunc(&sg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26651,9 +27123,9 @@ int HP_guild_recv_info(struct guild *sg) {
{
retVal___ = HPMHooks.source.guild.recv_info(sg);
}
- if( HPMHooks.count.HP_guild_recv_info_post ) {
- int (*postHookFunc) (int retVal___, struct guild *sg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_recv_info_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct guild *sg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_recv_info_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sg);
}
@@ -26663,14 +27135,14 @@ int HP_guild_recv_info(struct guild *sg) {
int HP_guild_npc_request_info(int guild_id, const char *ev) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_npc_request_info_pre ) {
- int (*preHookFunc) (int *guild_id, const char *ev);
+ if (HPMHooks.count.HP_guild_npc_request_info_pre > 0) {
+ int (*preHookFunc) (int *guild_id, const char **ev);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_npc_request_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_npc_request_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_npc_request_info_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, ev);
+ retVal___ = preHookFunc(&guild_id, &ev);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26678,11 +27150,11 @@ int HP_guild_npc_request_info(int guild_id, const char *ev) {
{
retVal___ = HPMHooks.source.guild.npc_request_info(guild_id, ev);
}
- if( HPMHooks.count.HP_guild_npc_request_info_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, const char *ev);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_npc_request_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_npc_request_info_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, const char *ev);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_npc_request_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_npc_request_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, ev);
+ retVal___ = postHookFunc(retVal___, guild_id, ev);
}
}
return retVal___;
@@ -26690,14 +27162,14 @@ int HP_guild_npc_request_info(int guild_id, const char *ev) {
int HP_guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_invite_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_guild_invite_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_invite_pre[hIndex].func;
- retVal___ = preHookFunc(sd, tsd);
+ retVal___ = preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26705,9 +27177,9 @@ int HP_guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
{
retVal___ = HPMHooks.source.guild.invite(sd, tsd);
}
- if( HPMHooks.count.HP_guild_invite_post ) {
+ if (HPMHooks.count.HP_guild_invite_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_invite_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_invite_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, tsd);
}
@@ -26717,14 +27189,14 @@ int HP_guild_invite(struct map_session_data *sd, struct map_session_data *tsd) {
int HP_guild_reply_invite(struct map_session_data *sd, int guild_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_reply_invite_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *guild_id, int *flag);
+ if (HPMHooks.count.HP_guild_reply_invite_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *guild_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_reply_invite_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &guild_id, &flag);
+ retVal___ = preHookFunc(&sd, &guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26732,25 +27204,25 @@ int HP_guild_reply_invite(struct map_session_data *sd, int guild_id, int flag) {
{
retVal___ = HPMHooks.source.guild.reply_invite(sd, guild_id, flag);
}
- if( HPMHooks.count.HP_guild_reply_invite_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *guild_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_invite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_reply_invite_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int guild_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_reply_invite_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &guild_id, &flag);
+ retVal___ = postHookFunc(retVal___, sd, guild_id, flag);
}
}
return retVal___;
}
void HP_guild_member_joined(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_member_joined_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_guild_member_joined_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_joined_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_joined_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_member_joined_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -26758,9 +27230,9 @@ void HP_guild_member_joined(struct map_session_data *sd) {
{
HPMHooks.source.guild.member_joined(sd);
}
- if( HPMHooks.count.HP_guild_member_joined_post ) {
+ if (HPMHooks.count.HP_guild_member_joined_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_joined_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_joined_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_member_joined_post[hIndex].func;
postHookFunc(sd);
}
@@ -26770,14 +27242,14 @@ void HP_guild_member_joined(struct map_session_data *sd) {
int HP_guild_member_added(int guild_id, int account_id, int char_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_member_added_pre ) {
+ if (HPMHooks.count.HP_guild_member_added_pre > 0) {
int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_added_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_added_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_member_added_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26785,11 +27257,11 @@ int HP_guild_member_added(int guild_id, int account_id, int char_id, int flag) {
{
retVal___ = HPMHooks.source.guild.member_added(guild_id, account_id, char_id, flag);
}
- if( HPMHooks.count.HP_guild_member_added_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_added_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_member_added_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_added_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_member_added_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &flag);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, flag);
}
}
return retVal___;
@@ -26797,14 +27269,14 @@ int HP_guild_member_added(int guild_id, int account_id, int char_id, int flag) {
int HP_guild_leave(struct map_session_data *sd, int guild_id, int account_id, int char_id, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_leave_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *guild_id, int *account_id, int *char_id, const char *mes);
+ if (HPMHooks.count.HP_guild_leave_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *guild_id, int *account_id, int *char_id, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_leave_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &guild_id, &account_id, &char_id, mes);
+ retVal___ = preHookFunc(&sd, &guild_id, &account_id, &char_id, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26812,11 +27284,11 @@ int HP_guild_leave(struct map_session_data *sd, int guild_id, int account_id, in
{
retVal___ = HPMHooks.source.guild.leave(sd, guild_id, account_id, char_id, mes);
}
- if( HPMHooks.count.HP_guild_leave_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *guild_id, int *account_id, int *char_id, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int guild_id, int account_id, int char_id, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &guild_id, &account_id, &char_id, mes);
+ retVal___ = postHookFunc(retVal___, sd, guild_id, account_id, char_id, mes);
}
}
return retVal___;
@@ -26824,14 +27296,14 @@ int HP_guild_leave(struct map_session_data *sd, int guild_id, int account_id, in
int HP_guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_member_withdraw_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag, const char *name, const char *mes);
+ if (HPMHooks.count.HP_guild_member_withdraw_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag, const char **name, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_member_withdraw_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag, name, mes);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag, &name, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26839,11 +27311,11 @@ int HP_guild_member_withdraw(int guild_id, int account_id, int char_id, int flag
{
retVal___ = HPMHooks.source.guild.member_withdraw(guild_id, account_id, char_id, flag, name, mes);
}
- if( HPMHooks.count.HP_guild_member_withdraw_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *flag, const char *name, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_member_withdraw_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_member_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_member_withdraw_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &flag, name, mes);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, flag, name, mes);
}
}
return retVal___;
@@ -26851,14 +27323,14 @@ int HP_guild_member_withdraw(int guild_id, int account_id, int char_id, int flag
int HP_guild_expulsion(struct map_session_data *sd, int guild_id, int account_id, int char_id, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_expulsion_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *guild_id, int *account_id, int *char_id, const char *mes);
+ if (HPMHooks.count.HP_guild_expulsion_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *guild_id, int *account_id, int *char_id, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_expulsion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_expulsion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_expulsion_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &guild_id, &account_id, &char_id, mes);
+ retVal___ = preHookFunc(&sd, &guild_id, &account_id, &char_id, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26866,11 +27338,11 @@ int HP_guild_expulsion(struct map_session_data *sd, int guild_id, int account_id
{
retVal___ = HPMHooks.source.guild.expulsion(sd, guild_id, account_id, char_id, mes);
}
- if( HPMHooks.count.HP_guild_expulsion_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *guild_id, int *account_id, int *char_id, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_expulsion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_expulsion_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int guild_id, int account_id, int char_id, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_expulsion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_expulsion_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &guild_id, &account_id, &char_id, mes);
+ retVal___ = postHookFunc(retVal___, sd, guild_id, account_id, char_id, mes);
}
}
return retVal___;
@@ -26878,14 +27350,14 @@ int HP_guild_expulsion(struct map_session_data *sd, int guild_id, int account_id
int HP_guild_skillup(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_skillup_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_guild_skillup_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_skillup_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26893,25 +27365,25 @@ int HP_guild_skillup(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.guild.skillup(sd, skill_id);
}
- if( HPMHooks.count.HP_guild_skillup_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_skillup_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_skillup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
}
void HP_guild_block_skill(struct map_session_data *sd, int time) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_block_skill_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *time);
+ if (HPMHooks.count.HP_guild_block_skill_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *time);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_block_skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_block_skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_block_skill_pre[hIndex].func;
- preHookFunc(sd, &time);
+ preHookFunc(&sd, &time);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -26919,11 +27391,11 @@ void HP_guild_block_skill(struct map_session_data *sd, int time) {
{
HPMHooks.source.guild.block_skill(sd, time);
}
- if( HPMHooks.count.HP_guild_block_skill_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *time);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_block_skill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_block_skill_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int time);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_block_skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_block_skill_post[hIndex].func;
- postHookFunc(sd, &time);
+ postHookFunc(sd, time);
}
}
return;
@@ -26931,14 +27403,14 @@ void HP_guild_block_skill(struct map_session_data *sd, int time) {
int HP_guild_reqalliance(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_reqalliance_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_guild_reqalliance_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_reqalliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_reqalliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_reqalliance_pre[hIndex].func;
- retVal___ = preHookFunc(sd, tsd);
+ retVal___ = preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26946,9 +27418,9 @@ int HP_guild_reqalliance(struct map_session_data *sd, struct map_session_data *t
{
retVal___ = HPMHooks.source.guild.reqalliance(sd, tsd);
}
- if( HPMHooks.count.HP_guild_reqalliance_post ) {
+ if (HPMHooks.count.HP_guild_reqalliance_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_reqalliance_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_reqalliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_reqalliance_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, tsd);
}
@@ -26958,14 +27430,14 @@ int HP_guild_reqalliance(struct map_session_data *sd, struct map_session_data *t
int HP_guild_reply_reqalliance(struct map_session_data *sd, int account_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_reply_reqalliance_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *account_id, int *flag);
+ if (HPMHooks.count.HP_guild_reply_reqalliance_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *account_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_reqalliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_reqalliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_reply_reqalliance_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &account_id, &flag);
+ retVal___ = preHookFunc(&sd, &account_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -26973,11 +27445,11 @@ int HP_guild_reply_reqalliance(struct map_session_data *sd, int account_id, int
{
retVal___ = HPMHooks.source.guild.reply_reqalliance(sd, account_id, flag);
}
- if( HPMHooks.count.HP_guild_reply_reqalliance_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *account_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_reqalliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_reply_reqalliance_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int account_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_reply_reqalliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_reply_reqalliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &account_id, &flag);
+ retVal___ = postHookFunc(retVal___, sd, account_id, flag);
}
}
return retVal___;
@@ -26985,14 +27457,14 @@ int HP_guild_reply_reqalliance(struct map_session_data *sd, int account_id, int
int HP_guild_allianceack(int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_allianceack_pre ) {
- int (*preHookFunc) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char *name1, const char *name2);
+ if (HPMHooks.count.HP_guild_allianceack_pre > 0) {
+ int (*preHookFunc) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char **name1, const char **name2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_allianceack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_allianceack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_allianceack_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id1, &guild_id2, &account_id1, &account_id2, &flag, name1, name2);
+ retVal___ = preHookFunc(&guild_id1, &guild_id2, &account_id1, &account_id2, &flag, &name1, &name2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27000,11 +27472,11 @@ int HP_guild_allianceack(int guild_id1, int guild_id2, int account_id1, int acco
{
retVal___ = HPMHooks.source.guild.allianceack(guild_id1, guild_id2, account_id1, account_id2, flag, name1, name2);
}
- if( HPMHooks.count.HP_guild_allianceack_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag, const char *name1, const char *name2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_allianceack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_allianceack_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_allianceack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_allianceack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id1, &guild_id2, &account_id1, &account_id2, &flag, name1, name2);
+ retVal___ = postHookFunc(retVal___, guild_id1, guild_id2, account_id1, account_id2, flag, name1, name2);
}
}
return retVal___;
@@ -27012,14 +27484,14 @@ int HP_guild_allianceack(int guild_id1, int guild_id2, int account_id1, int acco
int HP_guild_delalliance(struct map_session_data *sd, int guild_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_delalliance_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *guild_id, int *flag);
+ if (HPMHooks.count.HP_guild_delalliance_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *guild_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_delalliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_delalliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_delalliance_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &guild_id, &flag);
+ retVal___ = preHookFunc(&sd, &guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27027,11 +27499,11 @@ int HP_guild_delalliance(struct map_session_data *sd, int guild_id, int flag) {
{
retVal___ = HPMHooks.source.guild.delalliance(sd, guild_id, flag);
}
- if( HPMHooks.count.HP_guild_delalliance_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *guild_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_delalliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_delalliance_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int guild_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_delalliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_delalliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &guild_id, &flag);
+ retVal___ = postHookFunc(retVal___, sd, guild_id, flag);
}
}
return retVal___;
@@ -27039,14 +27511,14 @@ int HP_guild_delalliance(struct map_session_data *sd, int guild_id, int flag) {
int HP_guild_opposition(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_opposition_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_guild_opposition_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_opposition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_opposition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_opposition_pre[hIndex].func;
- retVal___ = preHookFunc(sd, tsd);
+ retVal___ = preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27054,9 +27526,9 @@ int HP_guild_opposition(struct map_session_data *sd, struct map_session_data *ts
{
retVal___ = HPMHooks.source.guild.opposition(sd, tsd);
}
- if( HPMHooks.count.HP_guild_opposition_post ) {
+ if (HPMHooks.count.HP_guild_opposition_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_opposition_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_opposition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_opposition_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, tsd);
}
@@ -27066,14 +27538,14 @@ int HP_guild_opposition(struct map_session_data *sd, struct map_session_data *ts
int HP_guild_check_alliance(int guild_id1, int guild_id2, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_check_alliance_pre ) {
+ if (HPMHooks.count.HP_guild_check_alliance_pre > 0) {
int (*preHookFunc) (int *guild_id1, int *guild_id2, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_alliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_alliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_check_alliance_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id1, &guild_id2, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27081,11 +27553,11 @@ int HP_guild_check_alliance(int guild_id1, int guild_id2, int flag) {
{
retVal___ = HPMHooks.source.guild.check_alliance(guild_id1, guild_id2, flag);
}
- if( HPMHooks.count.HP_guild_check_alliance_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id1, int *guild_id2, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_alliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_check_alliance_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id1, int guild_id2, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_alliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_check_alliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id1, &guild_id2, &flag);
+ retVal___ = postHookFunc(retVal___, guild_id1, guild_id2, flag);
}
}
return retVal___;
@@ -27093,14 +27565,14 @@ int HP_guild_check_alliance(int guild_id1, int guild_id2, int flag) {
int HP_guild_send_memberinfoshort(struct map_session_data *sd, int online) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_send_memberinfoshort_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *online);
+ if (HPMHooks.count.HP_guild_send_memberinfoshort_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *online);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_memberinfoshort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_memberinfoshort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_send_memberinfoshort_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &online);
+ retVal___ = preHookFunc(&sd, &online);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27108,38 +27580,38 @@ int HP_guild_send_memberinfoshort(struct map_session_data *sd, int online) {
{
retVal___ = HPMHooks.source.guild.send_memberinfoshort(sd, online);
}
- if( HPMHooks.count.HP_guild_send_memberinfoshort_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *online);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_memberinfoshort_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_send_memberinfoshort_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int online);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_memberinfoshort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_send_memberinfoshort_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &online);
+ retVal___ = postHookFunc(retVal___, sd, online);
}
}
return retVal___;
}
-int HP_guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int class_) {
+int HP_guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_recv_memberinfoshort_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int *class_);
+ if (HPMHooks.count.HP_guild_recv_memberinfoshort_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_memberinfoshort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_memberinfoshort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_recv_memberinfoshort_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &online, &lv, &class_);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &online, &lv, &class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.guild.recv_memberinfoshort(guild_id, account_id, char_id, online, lv, class_);
+ retVal___ = HPMHooks.source.guild.recv_memberinfoshort(guild_id, account_id, char_id, online, lv, class);
}
- if( HPMHooks.count.HP_guild_recv_memberinfoshort_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *online, int *lv, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_memberinfoshort_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_recv_memberinfoshort_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_memberinfoshort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_recv_memberinfoshort_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &online, &lv, &class_);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, online, lv, class);
}
}
return retVal___;
@@ -27147,14 +27619,14 @@ int HP_guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int
int HP_guild_change_memberposition(int guild_id, int account_id, int char_id, short idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_change_memberposition_pre ) {
+ if (HPMHooks.count.HP_guild_change_memberposition_pre > 0) {
int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, short *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_memberposition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_memberposition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_change_memberposition_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27162,11 +27634,11 @@ int HP_guild_change_memberposition(int guild_id, int account_id, int char_id, sh
{
retVal___ = HPMHooks.source.guild.change_memberposition(guild_id, account_id, char_id, idx);
}
- if( HPMHooks.count.HP_guild_change_memberposition_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, short *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_memberposition_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_change_memberposition_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, short idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_memberposition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_change_memberposition_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &idx);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, idx);
}
}
return retVal___;
@@ -27174,14 +27646,14 @@ int HP_guild_change_memberposition(int guild_id, int account_id, int char_id, sh
int HP_guild_memberposition_changed(struct guild *g, int idx, int pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_memberposition_changed_pre ) {
- int (*preHookFunc) (struct guild *g, int *idx, int *pos);
+ if (HPMHooks.count.HP_guild_memberposition_changed_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *idx, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_memberposition_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_memberposition_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_memberposition_changed_pre[hIndex].func;
- retVal___ = preHookFunc(g, &idx, &pos);
+ retVal___ = preHookFunc(&g, &idx, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27189,11 +27661,11 @@ int HP_guild_memberposition_changed(struct guild *g, int idx, int pos) {
{
retVal___ = HPMHooks.source.guild.memberposition_changed(g, idx, pos);
}
- if( HPMHooks.count.HP_guild_memberposition_changed_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *idx, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_memberposition_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_memberposition_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int idx, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_memberposition_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_memberposition_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &idx, &pos);
+ retVal___ = postHookFunc(retVal___, g, idx, pos);
}
}
return retVal___;
@@ -27201,14 +27673,14 @@ int HP_guild_memberposition_changed(struct guild *g, int idx, int pos) {
int HP_guild_change_position(int guild_id, int idx, int mode, int exp_mode, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_change_position_pre ) {
- int (*preHookFunc) (int *guild_id, int *idx, int *mode, int *exp_mode, const char *name);
+ if (HPMHooks.count.HP_guild_change_position_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *idx, int *mode, int *exp_mode, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_position_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_position_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_change_position_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &idx, &mode, &exp_mode, name);
+ retVal___ = preHookFunc(&guild_id, &idx, &mode, &exp_mode, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27216,26 +27688,26 @@ int HP_guild_change_position(int guild_id, int idx, int mode, int exp_mode, cons
{
retVal___ = HPMHooks.source.guild.change_position(guild_id, idx, mode, exp_mode, name);
}
- if( HPMHooks.count.HP_guild_change_position_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *idx, int *mode, int *exp_mode, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_position_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_change_position_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int idx, int mode, int exp_mode, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_position_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_change_position_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &idx, &mode, &exp_mode, name);
+ retVal___ = postHookFunc(retVal___, guild_id, idx, mode, exp_mode, name);
}
}
return retVal___;
}
-int HP_guild_position_changed(int guild_id, int idx, struct guild_position *p) {
+int HP_guild_position_changed(int guild_id, int idx, const struct guild_position *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_position_changed_pre ) {
- int (*preHookFunc) (int *guild_id, int *idx, struct guild_position *p);
+ if (HPMHooks.count.HP_guild_position_changed_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *idx, const struct guild_position **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_position_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_position_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_position_changed_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &idx, p);
+ retVal___ = preHookFunc(&guild_id, &idx, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27243,11 +27715,11 @@ int HP_guild_position_changed(int guild_id, int idx, struct guild_position *p) {
{
retVal___ = HPMHooks.source.guild.position_changed(guild_id, idx, p);
}
- if( HPMHooks.count.HP_guild_position_changed_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *idx, struct guild_position *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_position_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_position_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int idx, const struct guild_position *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_position_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_position_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &idx, p);
+ retVal___ = postHookFunc(retVal___, guild_id, idx, p);
}
}
return retVal___;
@@ -27255,14 +27727,14 @@ int HP_guild_position_changed(int guild_id, int idx, struct guild_position *p) {
int HP_guild_change_notice(struct map_session_data *sd, int guild_id, const char *mes1, const char *mes2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_change_notice_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *guild_id, const char *mes1, const char *mes2);
+ if (HPMHooks.count.HP_guild_change_notice_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *guild_id, const char **mes1, const char **mes2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_notice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_notice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_change_notice_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &guild_id, mes1, mes2);
+ retVal___ = preHookFunc(&sd, &guild_id, &mes1, &mes2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27270,11 +27742,11 @@ int HP_guild_change_notice(struct map_session_data *sd, int guild_id, const char
{
retVal___ = HPMHooks.source.guild.change_notice(sd, guild_id, mes1, mes2);
}
- if( HPMHooks.count.HP_guild_change_notice_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *guild_id, const char *mes1, const char *mes2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_notice_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_change_notice_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int guild_id, const char *mes1, const char *mes2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_notice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_change_notice_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &guild_id, mes1, mes2);
+ retVal___ = postHookFunc(retVal___, sd, guild_id, mes1, mes2);
}
}
return retVal___;
@@ -27282,14 +27754,14 @@ int HP_guild_change_notice(struct map_session_data *sd, int guild_id, const char
int HP_guild_notice_changed(int guild_id, const char *mes1, const char *mes2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_notice_changed_pre ) {
- int (*preHookFunc) (int *guild_id, const char *mes1, const char *mes2);
+ if (HPMHooks.count.HP_guild_notice_changed_pre > 0) {
+ int (*preHookFunc) (int *guild_id, const char **mes1, const char **mes2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_notice_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_notice_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_notice_changed_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, mes1, mes2);
+ retVal___ = preHookFunc(&guild_id, &mes1, &mes2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27297,11 +27769,11 @@ int HP_guild_notice_changed(int guild_id, const char *mes1, const char *mes2) {
{
retVal___ = HPMHooks.source.guild.notice_changed(guild_id, mes1, mes2);
}
- if( HPMHooks.count.HP_guild_notice_changed_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, const char *mes1, const char *mes2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_notice_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_notice_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, const char *mes1, const char *mes2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_notice_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_notice_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, mes1, mes2);
+ retVal___ = postHookFunc(retVal___, guild_id, mes1, mes2);
}
}
return retVal___;
@@ -27309,14 +27781,14 @@ int HP_guild_notice_changed(int guild_id, const char *mes1, const char *mes2) {
int HP_guild_change_emblem(struct map_session_data *sd, int len, const char *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_change_emblem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *len, const char *data);
+ if (HPMHooks.count.HP_guild_change_emblem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *len, const char **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_emblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_emblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_change_emblem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &len, data);
+ retVal___ = preHookFunc(&sd, &len, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27324,11 +27796,11 @@ int HP_guild_change_emblem(struct map_session_data *sd, int len, const char *dat
{
retVal___ = HPMHooks.source.guild.change_emblem(sd, len, data);
}
- if( HPMHooks.count.HP_guild_change_emblem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *len, const char *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_emblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_change_emblem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int len, const char *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_change_emblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_change_emblem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &len, data);
+ retVal___ = postHookFunc(retVal___, sd, len, data);
}
}
return retVal___;
@@ -27336,14 +27808,14 @@ int HP_guild_change_emblem(struct map_session_data *sd, int len, const char *dat
int HP_guild_emblem_changed(int len, int guild_id, int emblem_id, const char *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_emblem_changed_pre ) {
- int (*preHookFunc) (int *len, int *guild_id, int *emblem_id, const char *data);
+ if (HPMHooks.count.HP_guild_emblem_changed_pre > 0) {
+ int (*preHookFunc) (int *len, int *guild_id, int *emblem_id, const char **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_emblem_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_emblem_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_emblem_changed_pre[hIndex].func;
- retVal___ = preHookFunc(&len, &guild_id, &emblem_id, data);
+ retVal___ = preHookFunc(&len, &guild_id, &emblem_id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27351,38 +27823,38 @@ int HP_guild_emblem_changed(int len, int guild_id, int emblem_id, const char *da
{
retVal___ = HPMHooks.source.guild.emblem_changed(len, guild_id, emblem_id, data);
}
- if( HPMHooks.count.HP_guild_emblem_changed_post ) {
- int (*postHookFunc) (int retVal___, int *len, int *guild_id, int *emblem_id, const char *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_emblem_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_emblem_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, int len, int guild_id, int emblem_id, const char *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_emblem_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_emblem_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &len, &guild_id, &emblem_id, data);
+ retVal___ = postHookFunc(retVal___, len, guild_id, emblem_id, data);
}
}
return retVal___;
}
-int HP_guild_send_message(struct map_session_data *sd, const char *mes, int len) {
+int HP_guild_send_message(struct map_session_data *sd, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_send_message_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *mes, int *len);
+ if (HPMHooks.count.HP_guild_send_message_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_send_message_pre[hIndex].func;
- retVal___ = preHookFunc(sd, mes, &len);
+ retVal___ = preHookFunc(&sd, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.guild.send_message(sd, mes, len);
+ retVal___ = HPMHooks.source.guild.send_message(sd, mes);
}
- if( HPMHooks.count.HP_guild_send_message_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_send_message_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_send_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, mes, &len);
+ retVal___ = postHookFunc(retVal___, sd, mes);
}
}
return retVal___;
@@ -27390,14 +27862,14 @@ int HP_guild_send_message(struct map_session_data *sd, const char *mes, int len)
int HP_guild_recv_message(int guild_id, int account_id, const char *mes, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_recv_message_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, const char *mes, int *len);
+ if (HPMHooks.count.HP_guild_recv_message_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_recv_message_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, mes, &len);
+ retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27405,11 +27877,11 @@ int HP_guild_recv_message(int guild_id, int account_id, const char *mes, int len
{
retVal___ = HPMHooks.source.guild.recv_message(guild_id, account_id, mes, len);
}
- if( HPMHooks.count.HP_guild_recv_message_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_recv_message_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_recv_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, mes, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len);
}
}
return retVal___;
@@ -27417,14 +27889,14 @@ int HP_guild_recv_message(int guild_id, int account_id, const char *mes, int len
int HP_guild_send_dot_remove(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_send_dot_remove_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_guild_send_dot_remove_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_dot_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_dot_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_send_dot_remove_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27432,9 +27904,9 @@ int HP_guild_send_dot_remove(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.guild.send_dot_remove(sd);
}
- if( HPMHooks.count.HP_guild_send_dot_remove_post ) {
+ if (HPMHooks.count.HP_guild_send_dot_remove_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_dot_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_dot_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_send_dot_remove_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -27444,14 +27916,14 @@ int HP_guild_send_dot_remove(struct map_session_data *sd) {
int HP_guild_skillupack(int guild_id, uint16 skill_id, int account_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_skillupack_pre ) {
+ if (HPMHooks.count.HP_guild_skillupack_pre > 0) {
int (*preHookFunc) (int *guild_id, uint16 *skill_id, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillupack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillupack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_skillupack_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &skill_id, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27459,26 +27931,26 @@ int HP_guild_skillupack(int guild_id, uint16 skill_id, int account_id) {
{
retVal___ = HPMHooks.source.guild.skillupack(guild_id, skill_id, account_id);
}
- if( HPMHooks.count.HP_guild_skillupack_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, uint16 *skill_id, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillupack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_skillupack_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, uint16 skill_id, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_skillupack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_skillupack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &skill_id, &account_id);
+ retVal___ = postHookFunc(retVal___, guild_id, skill_id, account_id);
}
}
return retVal___;
}
-int HP_guild_dobreak(struct map_session_data *sd, char *name) {
+int HP_guild_dobreak(struct map_session_data *sd, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_dobreak_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *name);
+ if (HPMHooks.count.HP_guild_dobreak_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_dobreak_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_dobreak_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_dobreak_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name);
+ retVal___ = preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27486,9 +27958,9 @@ int HP_guild_dobreak(struct map_session_data *sd, char *name) {
{
retVal___ = HPMHooks.source.guild.dobreak(sd, name);
}
- if( HPMHooks.count.HP_guild_dobreak_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_dobreak_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_dobreak_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_dobreak_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_dobreak_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, name);
}
@@ -27498,14 +27970,14 @@ int HP_guild_dobreak(struct map_session_data *sd, char *name) {
int HP_guild_broken(int guild_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_broken_pre ) {
+ if (HPMHooks.count.HP_guild_broken_pre > 0) {
int (*preHookFunc) (int *guild_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_broken_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27513,11 +27985,11 @@ int HP_guild_broken(int guild_id, int flag) {
{
retVal___ = HPMHooks.source.guild.broken(guild_id, flag);
}
- if( HPMHooks.count.HP_guild_broken_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_broken_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_broken_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &flag);
+ retVal___ = postHookFunc(retVal___, guild_id, flag);
}
}
return retVal___;
@@ -27525,14 +27997,14 @@ int HP_guild_broken(int guild_id, int flag) {
int HP_guild_gm_change(int guild_id, struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_gm_change_pre ) {
- int (*preHookFunc) (int *guild_id, struct map_session_data *sd);
+ if (HPMHooks.count.HP_guild_gm_change_pre > 0) {
+ int (*preHookFunc) (int *guild_id, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_gm_change_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, sd);
+ retVal___ = preHookFunc(&guild_id, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27540,11 +28012,11 @@ int HP_guild_gm_change(int guild_id, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.guild.gm_change(guild_id, sd);
}
- if( HPMHooks.count.HP_guild_gm_change_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_gm_change_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_gm_change_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, sd);
+ retVal___ = postHookFunc(retVal___, guild_id, sd);
}
}
return retVal___;
@@ -27552,14 +28024,14 @@ int HP_guild_gm_change(int guild_id, struct map_session_data *sd) {
int HP_guild_gm_changed(int guild_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_gm_changed_pre ) {
+ if (HPMHooks.count.HP_guild_gm_changed_pre > 0) {
int (*preHookFunc) (int *guild_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_changed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_changed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_gm_changed_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27567,25 +28039,25 @@ int HP_guild_gm_changed(int guild_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.guild.gm_changed(guild_id, account_id, char_id);
}
- if( HPMHooks.count.HP_guild_gm_changed_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_changed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_gm_changed_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_changed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_gm_changed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id);
}
}
return retVal___;
}
void HP_guild_castle_map_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_castle_map_init_pre ) {
+ if (HPMHooks.count.HP_guild_castle_map_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_map_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_map_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_castle_map_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27593,9 +28065,9 @@ void HP_guild_castle_map_init(void) {
{
HPMHooks.source.guild.castle_map_init();
}
- if( HPMHooks.count.HP_guild_castle_map_init_post ) {
+ if (HPMHooks.count.HP_guild_castle_map_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_map_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_map_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_castle_map_init_post[hIndex].func;
postHookFunc();
}
@@ -27605,14 +28077,14 @@ void HP_guild_castle_map_init(void) {
int HP_guild_castledatasave(int castle_id, int index, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_castledatasave_pre ) {
+ if (HPMHooks.count.HP_guild_castledatasave_pre > 0) {
int (*preHookFunc) (int *castle_id, int *index, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledatasave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledatasave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_castledatasave_pre[hIndex].func;
retVal___ = preHookFunc(&castle_id, &index, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27620,26 +28092,26 @@ int HP_guild_castledatasave(int castle_id, int index, int value) {
{
retVal___ = HPMHooks.source.guild.castledatasave(castle_id, index, value);
}
- if( HPMHooks.count.HP_guild_castledatasave_post ) {
- int (*postHookFunc) (int retVal___, int *castle_id, int *index, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledatasave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_castledatasave_post > 0) {
+ int (*postHookFunc) (int retVal___, int castle_id, int index, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledatasave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_castledatasave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &castle_id, &index, &value);
+ retVal___ = postHookFunc(retVal___, castle_id, index, value);
}
}
return retVal___;
}
-int HP_guild_castledataloadack(int len, struct guild_castle *gc) {
+int HP_guild_castledataloadack(int len, const struct guild_castle *gc) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_castledataloadack_pre ) {
- int (*preHookFunc) (int *len, struct guild_castle *gc);
+ if (HPMHooks.count.HP_guild_castledataloadack_pre > 0) {
+ int (*preHookFunc) (int *len, const struct guild_castle **gc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledataloadack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledataloadack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_castledataloadack_pre[hIndex].func;
- retVal___ = preHookFunc(&len, gc);
+ retVal___ = preHookFunc(&len, &gc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27647,25 +28119,25 @@ int HP_guild_castledataloadack(int len, struct guild_castle *gc) {
{
retVal___ = HPMHooks.source.guild.castledataloadack(len, gc);
}
- if( HPMHooks.count.HP_guild_castledataloadack_post ) {
- int (*postHookFunc) (int retVal___, int *len, struct guild_castle *gc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledataloadack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_castledataloadack_post > 0) {
+ int (*postHookFunc) (int retVal___, int len, const struct guild_castle *gc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castledataloadack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_castledataloadack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &len, gc);
+ retVal___ = postHookFunc(retVal___, len, gc);
}
}
return retVal___;
}
void HP_guild_castle_reconnect(int castle_id, int index, int value) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_castle_reconnect_pre ) {
+ if (HPMHooks.count.HP_guild_castle_reconnect_pre > 0) {
void (*preHookFunc) (int *castle_id, int *index, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_castle_reconnect_pre[hIndex].func;
preHookFunc(&castle_id, &index, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27673,25 +28145,25 @@ void HP_guild_castle_reconnect(int castle_id, int index, int value) {
{
HPMHooks.source.guild.castle_reconnect(castle_id, index, value);
}
- if( HPMHooks.count.HP_guild_castle_reconnect_post ) {
- void (*postHookFunc) (int *castle_id, int *index, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_castle_reconnect_post > 0) {
+ void (*postHookFunc) (int castle_id, int index, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_castle_reconnect_post[hIndex].func;
- postHookFunc(&castle_id, &index, &value);
+ postHookFunc(castle_id, index, value);
}
}
return;
}
void HP_guild_agit_start(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_agit_start_pre ) {
+ if (HPMHooks.count.HP_guild_agit_start_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_agit_start_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27699,9 +28171,9 @@ void HP_guild_agit_start(void) {
{
HPMHooks.source.guild.agit_start();
}
- if( HPMHooks.count.HP_guild_agit_start_post ) {
+ if (HPMHooks.count.HP_guild_agit_start_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_start_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_agit_start_post[hIndex].func;
postHookFunc();
}
@@ -27710,14 +28182,14 @@ void HP_guild_agit_start(void) {
}
void HP_guild_agit_end(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_agit_end_pre ) {
+ if (HPMHooks.count.HP_guild_agit_end_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_agit_end_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27725,9 +28197,9 @@ void HP_guild_agit_end(void) {
{
HPMHooks.source.guild.agit_end();
}
- if( HPMHooks.count.HP_guild_agit_end_post ) {
+ if (HPMHooks.count.HP_guild_agit_end_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_end_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_agit_end_post[hIndex].func;
postHookFunc();
}
@@ -27736,14 +28208,14 @@ void HP_guild_agit_end(void) {
}
void HP_guild_agit2_start(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_agit2_start_pre ) {
+ if (HPMHooks.count.HP_guild_agit2_start_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_agit2_start_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27751,9 +28223,9 @@ void HP_guild_agit2_start(void) {
{
HPMHooks.source.guild.agit2_start();
}
- if( HPMHooks.count.HP_guild_agit2_start_post ) {
+ if (HPMHooks.count.HP_guild_agit2_start_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_start_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_agit2_start_post[hIndex].func;
postHookFunc();
}
@@ -27762,14 +28234,14 @@ void HP_guild_agit2_start(void) {
}
void HP_guild_agit2_end(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_agit2_end_pre ) {
+ if (HPMHooks.count.HP_guild_agit2_end_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_agit2_end_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27777,9 +28249,9 @@ void HP_guild_agit2_end(void) {
{
HPMHooks.source.guild.agit2_end();
}
- if( HPMHooks.count.HP_guild_agit2_end_post ) {
+ if (HPMHooks.count.HP_guild_agit2_end_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_end_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_agit2_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_agit2_end_post[hIndex].func;
postHookFunc();
}
@@ -27788,14 +28260,14 @@ void HP_guild_agit2_end(void) {
}
void HP_guild_flag_add(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_flag_add_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_guild_flag_add_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_flag_add_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27803,9 +28275,9 @@ void HP_guild_flag_add(struct npc_data *nd) {
{
HPMHooks.source.guild.flag_add(nd);
}
- if( HPMHooks.count.HP_guild_flag_add_post ) {
+ if (HPMHooks.count.HP_guild_flag_add_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_add_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_flag_add_post[hIndex].func;
postHookFunc(nd);
}
@@ -27814,14 +28286,14 @@ void HP_guild_flag_add(struct npc_data *nd) {
}
void HP_guild_flag_remove(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_flag_remove_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_guild_flag_remove_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_flag_remove_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27829,9 +28301,9 @@ void HP_guild_flag_remove(struct npc_data *nd) {
{
HPMHooks.source.guild.flag_remove(nd);
}
- if( HPMHooks.count.HP_guild_flag_remove_post ) {
+ if (HPMHooks.count.HP_guild_flag_remove_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_flag_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_flag_remove_post[hIndex].func;
postHookFunc(nd);
}
@@ -27840,14 +28312,14 @@ void HP_guild_flag_remove(struct npc_data *nd) {
}
void HP_guild_flags_clear(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_flags_clear_pre ) {
+ if (HPMHooks.count.HP_guild_flags_clear_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_flags_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_flags_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_flags_clear_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27855,9 +28327,9 @@ void HP_guild_flags_clear(void) {
{
HPMHooks.source.guild.flags_clear();
}
- if( HPMHooks.count.HP_guild_flags_clear_post ) {
+ if (HPMHooks.count.HP_guild_flags_clear_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_flags_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_flags_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_flags_clear_post[hIndex].func;
postHookFunc();
}
@@ -27866,14 +28338,14 @@ void HP_guild_flags_clear(void) {
}
void HP_guild_aura_refresh(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_aura_refresh_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_guild_aura_refresh_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_aura_refresh_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_aura_refresh_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_aura_refresh_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &skill_lv);
+ preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27881,25 +28353,25 @@ void HP_guild_aura_refresh(struct map_session_data *sd, uint16 skill_id, uint16
{
HPMHooks.source.guild.aura_refresh(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_guild_aura_refresh_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_aura_refresh_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_aura_refresh_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_aura_refresh_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_aura_refresh_post[hIndex].func;
- postHookFunc(sd, &skill_id, &skill_lv);
+ postHookFunc(sd, skill_id, skill_lv);
}
}
return;
}
void HP_guild_retrieveitembound(int char_id, int aid, int guild_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_retrieveitembound_pre ) {
+ if (HPMHooks.count.HP_guild_retrieveitembound_pre > 0) {
void (*preHookFunc) (int *char_id, int *aid, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_retrieveitembound_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_retrieveitembound_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_retrieveitembound_pre[hIndex].func;
preHookFunc(&char_id, &aid, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -27907,11 +28379,11 @@ void HP_guild_retrieveitembound(int char_id, int aid, int guild_id) {
{
HPMHooks.source.guild.retrieveitembound(char_id, aid, guild_id);
}
- if( HPMHooks.count.HP_guild_retrieveitembound_post ) {
- void (*postHookFunc) (int *char_id, int *aid, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_retrieveitembound_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_retrieveitembound_post > 0) {
+ void (*postHookFunc) (int char_id, int aid, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_retrieveitembound_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_retrieveitembound_post[hIndex].func;
- postHookFunc(&char_id, &aid, &guild_id);
+ postHookFunc(char_id, aid, guild_id);
}
}
return;
@@ -27919,14 +28391,14 @@ void HP_guild_retrieveitembound(int char_id, int aid, int guild_id) {
int HP_guild_payexp_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_payexp_timer_pre ) {
+ if (HPMHooks.count.HP_guild_payexp_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_payexp_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27934,11 +28406,11 @@ int HP_guild_payexp_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.guild.payexp_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_guild_payexp_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_payexp_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_payexp_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -27946,14 +28418,14 @@ int HP_guild_payexp_timer(int tid, int64 tick, int id, intptr_t data) {
struct map_session_data* HP_guild_sd_check(int guild_id, int account_id, int char_id) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_guild_sd_check_pre ) {
+ if (HPMHooks.count.HP_guild_sd_check_pre > 0) {
struct map_session_data* (*preHookFunc) (int *guild_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_sd_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_sd_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_sd_check_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27961,11 +28433,11 @@ struct map_session_data* HP_guild_sd_check(int guild_id, int account_id, int cha
{
retVal___ = HPMHooks.source.guild.sd_check(guild_id, account_id, char_id);
}
- if( HPMHooks.count.HP_guild_sd_check_post ) {
- struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int *guild_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_sd_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_sd_check_post > 0) {
+ struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int guild_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_sd_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_sd_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id);
}
}
return retVal___;
@@ -27973,14 +28445,14 @@ struct map_session_data* HP_guild_sd_check(int guild_id, int account_id, int cha
bool HP_guild_read_guildskill_tree_db(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_guild_read_guildskill_tree_db_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_guild_read_guildskill_tree_db_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_guildskill_tree_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_guildskill_tree_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_read_guildskill_tree_db_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -27988,11 +28460,11 @@ bool HP_guild_read_guildskill_tree_db(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.guild.read_guildskill_tree_db(split, columns, current);
}
- if( HPMHooks.count.HP_guild_read_guildskill_tree_db_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_guildskill_tree_db_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_read_guildskill_tree_db_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_guildskill_tree_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_read_guildskill_tree_db_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
@@ -28000,14 +28472,14 @@ bool HP_guild_read_guildskill_tree_db(char *split[], int columns, int current) {
bool HP_guild_read_castledb(char *str[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_guild_read_castledb_pre ) {
- bool (*preHookFunc) (char *str[], int *columns, int *current);
+ if (HPMHooks.count.HP_guild_read_castledb_pre > 0) {
+ bool (*preHookFunc) (char **str[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_read_castledb_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28015,28 +28487,28 @@ bool HP_guild_read_castledb(char *str[], int columns, int current) {
{
retVal___ = HPMHooks.source.guild.read_castledb(str, columns, current);
}
- if( HPMHooks.count.HP_guild_read_castledb_post ) {
- bool (*postHookFunc) (bool retVal___, char *str[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_read_castledb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_read_castledb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_read_castledb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
}
-int HP_guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
+int HP_guild_payexp_timer_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_payexp_timer_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_payexp_timer_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_payexp_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28046,30 +28518,30 @@ int HP_guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.payexp_timer_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_payexp_timer_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_payexp_timer_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_payexp_timer_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_payexp_timer_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
+int HP_guild_send_xy_timer_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_send_xy_timer_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_send_xy_timer_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_send_xy_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28079,12 +28551,12 @@ int HP_guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.send_xy_timer_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_send_xy_timer_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_send_xy_timer_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_send_xy_timer_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -28093,14 +28565,14 @@ int HP_guild_send_xy_timer_sub(DBKey key, DBData *data, va_list ap) {
int HP_guild_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_send_xy_timer_pre ) {
+ if (HPMHooks.count.HP_guild_send_xy_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_send_xy_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28108,29 +28580,28 @@ int HP_guild_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.guild.send_xy_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_guild_send_xy_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_send_xy_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_send_xy_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_send_xy_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-DBData HP_guild_create_expcache(DBKey key, va_list args) {
+struct DBData HP_guild_create_expcache(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_guild_create_expcache_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_guild_create_expcache_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_expcache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_expcache_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_guild_create_expcache_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28140,30 +28611,30 @@ DBData HP_guild_create_expcache(DBKey key, va_list args) {
retVal___ = HPMHooks.source.guild.create_expcache(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_guild_create_expcache_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_expcache_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_create_expcache_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_create_expcache_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_guild_create_expcache_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
return retVal___;
}
-int HP_guild_eventlist_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_guild_eventlist_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_eventlist_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_eventlist_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_eventlist_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_eventlist_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_eventlist_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28173,30 +28644,30 @@ int HP_guild_eventlist_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.eventlist_db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_eventlist_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_eventlist_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_eventlist_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_eventlist_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_eventlist_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_guild_expcache_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_expcache_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_expcache_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_expcache_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_expcache_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_expcache_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28206,30 +28677,30 @@ int HP_guild_expcache_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.expcache_db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_expcache_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_expcache_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_expcache_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_expcache_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_expcache_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_guild_castle_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_guild_castle_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_castle_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_castle_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_castle_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28239,30 +28710,30 @@ int HP_guild_castle_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.castle_db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_castle_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_castle_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_castle_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_guild_broken_sub(DBKey key, DBData *data, va_list ap) {
+int HP_guild_broken_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_broken_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_broken_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_broken_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28272,30 +28743,30 @@ int HP_guild_broken_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.broken_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_broken_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_broken_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_broken_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_broken_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_guild_castle_broken_sub(DBKey key, DBData *data, va_list ap) {
+int HP_guild_castle_broken_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_castle_broken_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_guild_castle_broken_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_broken_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_broken_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_castle_broken_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28305,12 +28776,12 @@ int HP_guild_castle_broken_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.guild.castle_broken_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_castle_broken_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_broken_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_castle_broken_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_broken_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_castle_broken_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -28318,14 +28789,14 @@ int HP_guild_castle_broken_sub(DBKey key, DBData *data, va_list ap) {
}
void HP_guild_makemember(struct guild_member *m, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_makemember_pre ) {
- void (*preHookFunc) (struct guild_member *m, struct map_session_data *sd);
+ if (HPMHooks.count.HP_guild_makemember_pre > 0) {
+ void (*preHookFunc) (struct guild_member **m, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_makemember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_makemember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_makemember_pre[hIndex].func;
- preHookFunc(m, sd);
+ preHookFunc(&m, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28333,26 +28804,26 @@ void HP_guild_makemember(struct guild_member *m, struct map_session_data *sd) {
{
HPMHooks.source.guild.makemember(m, sd);
}
- if( HPMHooks.count.HP_guild_makemember_post ) {
+ if (HPMHooks.count.HP_guild_makemember_post > 0) {
void (*postHookFunc) (struct guild_member *m, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_makemember_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_makemember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_makemember_post[hIndex].func;
postHookFunc(m, sd);
}
}
return;
}
-int HP_guild_check_member(struct guild *g) {
+int HP_guild_check_member(const struct guild *g) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_check_member_pre ) {
- int (*preHookFunc) (struct guild *g);
+ if (HPMHooks.count.HP_guild_check_member_pre > 0) {
+ int (*preHookFunc) (const struct guild **g);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_check_member_pre[hIndex].func;
- retVal___ = preHookFunc(g);
+ retVal___ = preHookFunc(&g);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28360,9 +28831,9 @@ int HP_guild_check_member(struct guild *g) {
{
retVal___ = HPMHooks.source.guild.check_member(g);
}
- if( HPMHooks.count.HP_guild_check_member_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_check_member_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct guild *g);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_check_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_check_member_post[hIndex].func;
retVal___ = postHookFunc(retVal___, g);
}
@@ -28372,14 +28843,14 @@ int HP_guild_check_member(struct guild *g) {
int HP_guild_get_alliance_count(struct guild *g, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_guild_get_alliance_count_pre ) {
- int (*preHookFunc) (struct guild *g, int *flag);
+ if (HPMHooks.count.HP_guild_get_alliance_count_pre > 0) {
+ int (*preHookFunc) (struct guild **g, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_get_alliance_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_get_alliance_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_get_alliance_count_pre[hIndex].func;
- retVal___ = preHookFunc(g, &flag);
+ retVal___ = preHookFunc(&g, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28387,27 +28858,27 @@ int HP_guild_get_alliance_count(struct guild *g, int flag) {
{
retVal___ = HPMHooks.source.guild.get_alliance_count(g, flag);
}
- if( HPMHooks.count.HP_guild_get_alliance_count_post ) {
- int (*postHookFunc) (int retVal___, struct guild *g, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_get_alliance_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_guild_get_alliance_count_post > 0) {
+ int (*postHookFunc) (int retVal___, struct guild *g, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_get_alliance_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_get_alliance_count_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, g, &flag);
+ retVal___ = postHookFunc(retVal___, g, flag);
}
}
return retVal___;
}
void HP_guild_castle_reconnect_sub(void *key, void *data, va_list ap) {
int hIndex = 0;
- if( HPMHooks.count.HP_guild_castle_reconnect_sub_pre ) {
- void (*preHookFunc) (void *key, void *data, va_list ap);
+ if (HPMHooks.count.HP_guild_castle_reconnect_sub_pre > 0) {
+ void (*preHookFunc) (void **key, void **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_guild_castle_reconnect_sub_pre[hIndex].func;
- preHookFunc(key, data, ap___copy);
+ preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28417,9 +28888,9 @@ void HP_guild_castle_reconnect_sub(void *key, void *data, va_list ap) {
HPMHooks.source.guild.castle_reconnect_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_guild_castle_reconnect_sub_post ) {
+ if (HPMHooks.count.HP_guild_castle_reconnect_sub_post > 0) {
void (*postHookFunc) (void *key, void *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_castle_reconnect_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_guild_castle_reconnect_sub_post[hIndex].func;
postHookFunc(key, data, ap___copy);
@@ -28428,18 +28899,18 @@ void HP_guild_castle_reconnect_sub(void *key, void *data, va_list ap) {
}
return;
}
-/* gstorage */
+/* guild_storage_interface */
struct guild_storage* HP_gstorage_ensure(int guild_id) {
int hIndex = 0;
struct guild_storage* retVal___ = NULL;
- if( HPMHooks.count.HP_gstorage_ensure_pre ) {
+ if (HPMHooks.count.HP_gstorage_ensure_pre > 0) {
struct guild_storage* (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_ensure_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_ensure_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_ensure_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28447,25 +28918,25 @@ struct guild_storage* HP_gstorage_ensure(int guild_id) {
{
retVal___ = HPMHooks.source.gstorage.ensure(guild_id);
}
- if( HPMHooks.count.HP_gstorage_ensure_post ) {
- struct guild_storage* (*postHookFunc) (struct guild_storage* retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_ensure_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_ensure_post > 0) {
+ struct guild_storage* (*postHookFunc) (struct guild_storage* retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_ensure_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_ensure_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
}
void HP_gstorage_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_gstorage_init_pre ) {
+ if (HPMHooks.count.HP_gstorage_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28473,25 +28944,25 @@ void HP_gstorage_init(bool minimal) {
{
HPMHooks.source.gstorage.init(minimal);
}
- if( HPMHooks.count.HP_gstorage_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_gstorage_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_gstorage_final_pre ) {
+ if (HPMHooks.count.HP_gstorage_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28499,9 +28970,9 @@ void HP_gstorage_final(void) {
{
HPMHooks.source.gstorage.final();
}
- if( HPMHooks.count.HP_gstorage_final_post ) {
+ if (HPMHooks.count.HP_gstorage_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_final_post[hIndex].func;
postHookFunc();
}
@@ -28511,14 +28982,14 @@ void HP_gstorage_final(void) {
int HP_gstorage_delete(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_delete_pre ) {
+ if (HPMHooks.count.HP_gstorage_delete_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_delete_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28526,11 +28997,11 @@ int HP_gstorage_delete(int guild_id) {
{
retVal___ = HPMHooks.source.gstorage.delete(guild_id);
}
- if( HPMHooks.count.HP_gstorage_delete_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -28538,14 +29009,14 @@ int HP_gstorage_delete(int guild_id) {
int HP_gstorage_open(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_open_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_gstorage_open_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_open_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28553,9 +29024,9 @@ int HP_gstorage_open(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.gstorage.open(sd);
}
- if( HPMHooks.count.HP_gstorage_open_post ) {
+ if (HPMHooks.count.HP_gstorage_open_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -28565,14 +29036,14 @@ int HP_gstorage_open(struct map_session_data *sd) {
int HP_gstorage_additem(struct map_session_data *sd, struct guild_storage *stor, struct item *item_data, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_additem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct guild_storage *stor, struct item *item_data, int *amount);
+ if (HPMHooks.count.HP_gstorage_additem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct guild_storage **stor, struct item **item_data, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_additem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, stor, item_data, &amount);
+ retVal___ = preHookFunc(&sd, &stor, &item_data, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28580,11 +29051,11 @@ int HP_gstorage_additem(struct map_session_data *sd, struct guild_storage *stor,
{
retVal___ = HPMHooks.source.gstorage.additem(sd, stor, item_data, amount);
}
- if( HPMHooks.count.HP_gstorage_additem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct guild_storage *stor, struct item *item_data, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_additem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct guild_storage *stor, struct item *item_data, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_additem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, stor, item_data, &amount);
+ retVal___ = postHookFunc(retVal___, sd, stor, item_data, amount);
}
}
return retVal___;
@@ -28592,14 +29063,14 @@ int HP_gstorage_additem(struct map_session_data *sd, struct guild_storage *stor,
int HP_gstorage_delitem(struct map_session_data *sd, struct guild_storage *stor, int n, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_delitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct guild_storage *stor, int *n, int *amount);
+ if (HPMHooks.count.HP_gstorage_delitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct guild_storage **stor, int *n, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_delitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, stor, &n, &amount);
+ retVal___ = preHookFunc(&sd, &stor, &n, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28607,11 +29078,11 @@ int HP_gstorage_delitem(struct map_session_data *sd, struct guild_storage *stor,
{
retVal___ = HPMHooks.source.gstorage.delitem(sd, stor, n, amount);
}
- if( HPMHooks.count.HP_gstorage_delitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct guild_storage *stor, int *n, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_delitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct guild_storage *stor, int n, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_delitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_delitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, stor, &n, &amount);
+ retVal___ = postHookFunc(retVal___, sd, stor, n, amount);
}
}
return retVal___;
@@ -28619,14 +29090,14 @@ int HP_gstorage_delitem(struct map_session_data *sd, struct guild_storage *stor,
int HP_gstorage_add(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_add_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_gstorage_add_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_add_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28634,11 +29105,11 @@ int HP_gstorage_add(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.gstorage.add(sd, index, amount);
}
- if( HPMHooks.count.HP_gstorage_add_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_add_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -28646,14 +29117,14 @@ int HP_gstorage_add(struct map_session_data *sd, int index, int amount) {
int HP_gstorage_get(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_get_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_gstorage_get_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_get_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_get_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_get_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28661,11 +29132,11 @@ int HP_gstorage_get(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.gstorage.get(sd, index, amount);
}
- if( HPMHooks.count.HP_gstorage_get_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_get_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_get_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_get_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_get_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -28673,14 +29144,14 @@ int HP_gstorage_get(struct map_session_data *sd, int index, int amount) {
int HP_gstorage_addfromcart(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_addfromcart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_gstorage_addfromcart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_addfromcart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_addfromcart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_addfromcart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28688,11 +29159,11 @@ int HP_gstorage_addfromcart(struct map_session_data *sd, int index, int amount)
{
retVal___ = HPMHooks.source.gstorage.addfromcart(sd, index, amount);
}
- if( HPMHooks.count.HP_gstorage_addfromcart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_addfromcart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_addfromcart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_addfromcart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_addfromcart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -28700,14 +29171,14 @@ int HP_gstorage_addfromcart(struct map_session_data *sd, int index, int amount)
int HP_gstorage_gettocart(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_gettocart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_gstorage_gettocart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_gettocart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_gettocart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_gettocart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28715,11 +29186,11 @@ int HP_gstorage_gettocart(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.gstorage.gettocart(sd, index, amount);
}
- if( HPMHooks.count.HP_gstorage_gettocart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_gettocart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_gettocart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_gettocart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_gettocart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -28727,14 +29198,14 @@ int HP_gstorage_gettocart(struct map_session_data *sd, int index, int amount) {
int HP_gstorage_close(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_close_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_gstorage_close_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_close_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28742,9 +29213,9 @@ int HP_gstorage_close(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.gstorage.close(sd);
}
- if( HPMHooks.count.HP_gstorage_close_post ) {
+ if (HPMHooks.count.HP_gstorage_close_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_close_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -28754,14 +29225,14 @@ int HP_gstorage_close(struct map_session_data *sd) {
int HP_gstorage_pc_quit(struct map_session_data *sd, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_pc_quit_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_gstorage_pc_quit_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_pc_quit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_pc_quit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_pc_quit_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28769,11 +29240,11 @@ int HP_gstorage_pc_quit(struct map_session_data *sd, int flag) {
{
retVal___ = HPMHooks.source.gstorage.pc_quit(sd, flag);
}
- if( HPMHooks.count.HP_gstorage_pc_quit_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_pc_quit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_pc_quit_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_pc_quit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_pc_quit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -28781,14 +29252,14 @@ int HP_gstorage_pc_quit(struct map_session_data *sd, int flag) {
int HP_gstorage_save(int account_id, int guild_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_save_pre ) {
+ if (HPMHooks.count.HP_gstorage_save_pre > 0) {
int (*preHookFunc) (int *account_id, int *guild_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_save_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &guild_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28796,11 +29267,11 @@ int HP_gstorage_save(int account_id, int guild_id, int flag) {
{
retVal___ = HPMHooks.source.gstorage.save(account_id, guild_id, flag);
}
- if( HPMHooks.count.HP_gstorage_save_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *guild_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_save_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_save_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int guild_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_save_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &guild_id, &flag);
+ retVal___ = postHookFunc(retVal___, account_id, guild_id, flag);
}
}
return retVal___;
@@ -28808,14 +29279,14 @@ int HP_gstorage_save(int account_id, int guild_id, int flag) {
int HP_gstorage_saved(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_gstorage_saved_pre ) {
+ if (HPMHooks.count.HP_gstorage_saved_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_saved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_saved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_gstorage_saved_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28823,29 +29294,28 @@ int HP_gstorage_saved(int guild_id) {
{
retVal___ = HPMHooks.source.gstorage.saved(guild_id);
}
- if( HPMHooks.count.HP_gstorage_saved_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_saved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_saved_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_saved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_gstorage_saved_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
}
-DBData HP_gstorage_create(DBKey key, va_list args) {
+struct DBData HP_gstorage_create(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_gstorage_create_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_gstorage_create_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_create_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_gstorage_create_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28855,28 +29325,28 @@ DBData HP_gstorage_create(DBKey key, va_list args) {
retVal___ = HPMHooks.source.gstorage.create(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_gstorage_create_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_gstorage_create_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_gstorage_create_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_gstorage_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
return retVal___;
}
-/* homun */
+/* homunculus_interface */
void HP_homun_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_init_pre ) {
+ if (HPMHooks.count.HP_homun_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28884,25 +29354,25 @@ void HP_homun_init(bool minimal) {
{
HPMHooks.source.homun.init(minimal);
}
- if( HPMHooks.count.HP_homun_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_homun_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_final_pre ) {
+ if (HPMHooks.count.HP_homun_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28910,9 +29380,9 @@ void HP_homun_final(void) {
{
HPMHooks.source.homun.final();
}
- if( HPMHooks.count.HP_homun_final_post ) {
+ if (HPMHooks.count.HP_homun_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_final_post[hIndex].func;
postHookFunc();
}
@@ -28921,14 +29391,14 @@ void HP_homun_final(void) {
}
void HP_homun_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_reload_pre ) {
+ if (HPMHooks.count.HP_homun_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28936,9 +29406,9 @@ void HP_homun_reload(void) {
{
HPMHooks.source.homun.reload();
}
- if( HPMHooks.count.HP_homun_reload_post ) {
+ if (HPMHooks.count.HP_homun_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_reload_post[hIndex].func;
postHookFunc();
}
@@ -28947,14 +29417,14 @@ void HP_homun_reload(void) {
}
void HP_homun_reload_skill(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_reload_skill_pre ) {
+ if (HPMHooks.count.HP_homun_reload_skill_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_reload_skill_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -28962,9 +29432,9 @@ void HP_homun_reload_skill(void) {
{
HPMHooks.source.homun.reload_skill();
}
- if( HPMHooks.count.HP_homun_reload_skill_post ) {
+ if (HPMHooks.count.HP_homun_reload_skill_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_skill_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_reload_skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_reload_skill_post[hIndex].func;
postHookFunc();
}
@@ -28974,14 +29444,14 @@ void HP_homun_reload_skill(void) {
struct view_data* HP_homun_get_viewdata(int class_) {
int hIndex = 0;
struct view_data* retVal___ = NULL;
- if( HPMHooks.count.HP_homun_get_viewdata_pre ) {
+ if (HPMHooks.count.HP_homun_get_viewdata_pre > 0) {
struct view_data* (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_get_viewdata_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -28989,11 +29459,11 @@ struct view_data* HP_homun_get_viewdata(int class_) {
{
retVal___ = HPMHooks.source.homun.get_viewdata(class_);
}
- if( HPMHooks.count.HP_homun_get_viewdata_post ) {
- struct view_data* (*postHookFunc) (struct view_data* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_viewdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_get_viewdata_post > 0) {
+ struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_get_viewdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -29001,14 +29471,14 @@ struct view_data* HP_homun_get_viewdata(int class_) {
enum homun_type HP_homun_class2type(int class_) {
int hIndex = 0;
enum homun_type retVal___ = HT_INVALID;
- if( HPMHooks.count.HP_homun_class2type_pre ) {
+ if (HPMHooks.count.HP_homun_class2type_pre > 0) {
enum homun_type (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_class2type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_class2type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_class2type_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29016,25 +29486,25 @@ enum homun_type HP_homun_class2type(int class_) {
{
retVal___ = HPMHooks.source.homun.class2type(class_);
}
- if( HPMHooks.count.HP_homun_class2type_post ) {
- enum homun_type (*postHookFunc) (enum homun_type retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_class2type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_class2type_post > 0) {
+ enum homun_type (*postHookFunc) (enum homun_type retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_class2type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_class2type_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
}
void HP_homun_damaged(struct homun_data *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_damaged_pre ) {
- void (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_damaged_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_damaged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_damaged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_damaged_pre[hIndex].func;
- preHookFunc(hd);
+ preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29042,9 +29512,9 @@ void HP_homun_damaged(struct homun_data *hd) {
{
HPMHooks.source.homun.damaged(hd);
}
- if( HPMHooks.count.HP_homun_damaged_post ) {
+ if (HPMHooks.count.HP_homun_damaged_post > 0) {
void (*postHookFunc) (struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_damaged_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_damaged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_damaged_post[hIndex].func;
postHookFunc(hd);
}
@@ -29054,14 +29524,14 @@ void HP_homun_damaged(struct homun_data *hd) {
int HP_homun_dead(struct homun_data *hd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_dead_pre ) {
- int (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_dead_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_dead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_dead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_dead_pre[hIndex].func;
- retVal___ = preHookFunc(hd);
+ retVal___ = preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29069,9 +29539,9 @@ int HP_homun_dead(struct homun_data *hd) {
{
retVal___ = HPMHooks.source.homun.dead(hd);
}
- if( HPMHooks.count.HP_homun_dead_post ) {
+ if (HPMHooks.count.HP_homun_dead_post > 0) {
int (*postHookFunc) (int retVal___, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_dead_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_dead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_dead_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hd);
}
@@ -29081,14 +29551,14 @@ int HP_homun_dead(struct homun_data *hd) {
int HP_homun_vaporize(struct map_session_data *sd, enum homun_state flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_vaporize_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, enum homun_state *flag);
+ if (HPMHooks.count.HP_homun_vaporize_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, enum homun_state *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_vaporize_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_vaporize_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_vaporize_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29096,11 +29566,11 @@ int HP_homun_vaporize(struct map_session_data *sd, enum homun_state flag) {
{
retVal___ = HPMHooks.source.homun.vaporize(sd, flag);
}
- if( HPMHooks.count.HP_homun_vaporize_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum homun_state *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_vaporize_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_vaporize_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum homun_state flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_vaporize_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_vaporize_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -29108,14 +29578,14 @@ int HP_homun_vaporize(struct map_session_data *sd, enum homun_state flag) {
int HP_homun_delete(struct homun_data *hd, int emote) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_delete_pre ) {
- int (*preHookFunc) (struct homun_data *hd, int *emote);
+ if (HPMHooks.count.HP_homun_delete_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, int *emote);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_delete_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &emote);
+ retVal___ = preHookFunc(&hd, &emote);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29123,11 +29593,11 @@ int HP_homun_delete(struct homun_data *hd, int emote) {
{
retVal___ = HPMHooks.source.homun.delete(hd, emote);
}
- if( HPMHooks.count.HP_homun_delete_post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, int *emote);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, int emote);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &emote);
+ retVal___ = postHookFunc(retVal___, hd, emote);
}
}
return retVal___;
@@ -29135,14 +29605,14 @@ int HP_homun_delete(struct homun_data *hd, int emote) {
int HP_homun_checkskill(struct homun_data *hd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_checkskill_pre ) {
- int (*preHookFunc) (struct homun_data *hd, uint16 *skill_id);
+ if (HPMHooks.count.HP_homun_checkskill_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_checkskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_checkskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_checkskill_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &skill_id);
+ retVal___ = preHookFunc(&hd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29150,11 +29620,11 @@ int HP_homun_checkskill(struct homun_data *hd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.homun.checkskill(hd, skill_id);
}
- if( HPMHooks.count.HP_homun_checkskill_post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_checkskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_checkskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_checkskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_checkskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &skill_id);
+ retVal___ = postHookFunc(retVal___, hd, skill_id);
}
}
return retVal___;
@@ -29162,14 +29632,14 @@ int HP_homun_checkskill(struct homun_data *hd, uint16 skill_id) {
int HP_homun_calc_skilltree(struct homun_data *hd, int flag_evolve) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_calc_skilltree_pre ) {
- int (*preHookFunc) (struct homun_data *hd, int *flag_evolve);
+ if (HPMHooks.count.HP_homun_calc_skilltree_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, int *flag_evolve);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_calc_skilltree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_calc_skilltree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_calc_skilltree_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &flag_evolve);
+ retVal___ = preHookFunc(&hd, &flag_evolve);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29177,11 +29647,11 @@ int HP_homun_calc_skilltree(struct homun_data *hd, int flag_evolve) {
{
retVal___ = HPMHooks.source.homun.calc_skilltree(hd, flag_evolve);
}
- if( HPMHooks.count.HP_homun_calc_skilltree_post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, int *flag_evolve);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_calc_skilltree_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_calc_skilltree_post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, int flag_evolve);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_calc_skilltree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_calc_skilltree_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &flag_evolve);
+ retVal___ = postHookFunc(retVal___, hd, flag_evolve);
}
}
return retVal___;
@@ -29189,14 +29659,14 @@ int HP_homun_calc_skilltree(struct homun_data *hd, int flag_evolve) {
int HP_homun_skill_tree_get_max(int id, int b_class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_skill_tree_get_max_pre ) {
+ if (HPMHooks.count.HP_homun_skill_tree_get_max_pre > 0) {
int (*preHookFunc) (int *id, int *b_class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_tree_get_max_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_tree_get_max_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_skill_tree_get_max_pre[hIndex].func;
retVal___ = preHookFunc(&id, &b_class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29204,25 +29674,25 @@ int HP_homun_skill_tree_get_max(int id, int b_class) {
{
retVal___ = HPMHooks.source.homun.skill_tree_get_max(id, b_class);
}
- if( HPMHooks.count.HP_homun_skill_tree_get_max_post ) {
- int (*postHookFunc) (int retVal___, int *id, int *b_class);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_tree_get_max_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_skill_tree_get_max_post > 0) {
+ int (*postHookFunc) (int retVal___, int id, int b_class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_tree_get_max_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_skill_tree_get_max_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id, &b_class);
+ retVal___ = postHookFunc(retVal___, id, b_class);
}
}
return retVal___;
}
void HP_homun_skillup(struct homun_data *hd, uint16 skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_skillup_pre ) {
- void (*preHookFunc) (struct homun_data *hd, uint16 *skill_id);
+ if (HPMHooks.count.HP_homun_skillup_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_skillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_skillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_skillup_pre[hIndex].func;
- preHookFunc(hd, &skill_id);
+ preHookFunc(&hd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29230,11 +29700,11 @@ void HP_homun_skillup(struct homun_data *hd, uint16 skill_id) {
{
HPMHooks.source.homun.skillup(hd, skill_id);
}
- if( HPMHooks.count.HP_homun_skillup_post ) {
- void (*postHookFunc) (struct homun_data *hd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_skillup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_skillup_post > 0) {
+ void (*postHookFunc) (struct homun_data *hd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_skillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_skillup_post[hIndex].func;
- postHookFunc(hd, &skill_id);
+ postHookFunc(hd, skill_id);
}
}
return;
@@ -29242,14 +29712,14 @@ void HP_homun_skillup(struct homun_data *hd, uint16 skill_id) {
bool HP_homun_levelup(struct homun_data *hd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_levelup_pre ) {
- bool (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_levelup_pre > 0) {
+ bool (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_levelup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_levelup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_levelup_pre[hIndex].func;
- retVal___ = preHookFunc(hd);
+ retVal___ = preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29257,9 +29727,9 @@ bool HP_homun_levelup(struct homun_data *hd) {
{
retVal___ = HPMHooks.source.homun.levelup(hd);
}
- if( HPMHooks.count.HP_homun_levelup_post ) {
+ if (HPMHooks.count.HP_homun_levelup_post > 0) {
bool (*postHookFunc) (bool retVal___, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_levelup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_levelup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_levelup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hd);
}
@@ -29269,14 +29739,14 @@ bool HP_homun_levelup(struct homun_data *hd) {
int HP_homun_change_class(struct homun_data *hd, short class_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_change_class_pre ) {
- int (*preHookFunc) (struct homun_data *hd, short *class_);
+ if (HPMHooks.count.HP_homun_change_class_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, short *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_class_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_class_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_change_class_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &class_);
+ retVal___ = preHookFunc(&hd, &class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29284,11 +29754,11 @@ int HP_homun_change_class(struct homun_data *hd, short class_) {
{
retVal___ = HPMHooks.source.homun.change_class(hd, class_);
}
- if( HPMHooks.count.HP_homun_change_class_post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, short *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_class_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_change_class_post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, short class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_class_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_change_class_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &class_);
+ retVal___ = postHookFunc(retVal___, hd, class_);
}
}
return retVal___;
@@ -29296,14 +29766,14 @@ int HP_homun_change_class(struct homun_data *hd, short class_) {
bool HP_homun_evolve(struct homun_data *hd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_evolve_pre ) {
- bool (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_evolve_pre > 0) {
+ bool (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_evolve_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_evolve_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_evolve_pre[hIndex].func;
- retVal___ = preHookFunc(hd);
+ retVal___ = preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29311,9 +29781,9 @@ bool HP_homun_evolve(struct homun_data *hd) {
{
retVal___ = HPMHooks.source.homun.evolve(hd);
}
- if( HPMHooks.count.HP_homun_evolve_post ) {
+ if (HPMHooks.count.HP_homun_evolve_post > 0) {
bool (*postHookFunc) (bool retVal___, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_evolve_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_evolve_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_evolve_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hd);
}
@@ -29323,14 +29793,14 @@ bool HP_homun_evolve(struct homun_data *hd) {
bool HP_homun_mutate(struct homun_data *hd, int homun_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_mutate_pre ) {
- bool (*preHookFunc) (struct homun_data *hd, int *homun_id);
+ if (HPMHooks.count.HP_homun_mutate_pre > 0) {
+ bool (*preHookFunc) (struct homun_data **hd, int *homun_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_mutate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_mutate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_mutate_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &homun_id);
+ retVal___ = preHookFunc(&hd, &homun_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29338,11 +29808,11 @@ bool HP_homun_mutate(struct homun_data *hd, int homun_id) {
{
retVal___ = HPMHooks.source.homun.mutate(hd, homun_id);
}
- if( HPMHooks.count.HP_homun_mutate_post ) {
- bool (*postHookFunc) (bool retVal___, struct homun_data *hd, int *homun_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_mutate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_mutate_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct homun_data *hd, int homun_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_mutate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_mutate_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &homun_id);
+ retVal___ = postHookFunc(retVal___, hd, homun_id);
}
}
return retVal___;
@@ -29350,14 +29820,14 @@ bool HP_homun_mutate(struct homun_data *hd, int homun_id) {
int HP_homun_gainexp(struct homun_data *hd, unsigned int exp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_gainexp_pre ) {
- int (*preHookFunc) (struct homun_data *hd, unsigned int *exp);
+ if (HPMHooks.count.HP_homun_gainexp_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, unsigned int *exp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_gainexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_gainexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_gainexp_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &exp);
+ retVal___ = preHookFunc(&hd, &exp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29365,11 +29835,11 @@ int HP_homun_gainexp(struct homun_data *hd, unsigned int exp) {
{
retVal___ = HPMHooks.source.homun.gainexp(hd, exp);
}
- if( HPMHooks.count.HP_homun_gainexp_post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, unsigned int *exp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_gainexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_gainexp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, unsigned int exp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_gainexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_gainexp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &exp);
+ retVal___ = postHookFunc(retVal___, hd, exp);
}
}
return retVal___;
@@ -29377,14 +29847,14 @@ int HP_homun_gainexp(struct homun_data *hd, unsigned int exp) {
unsigned int HP_homun_add_intimacy(struct homun_data *hd, unsigned int value) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_homun_add_intimacy_pre ) {
- unsigned int (*preHookFunc) (struct homun_data *hd, unsigned int *value);
+ if (HPMHooks.count.HP_homun_add_intimacy_pre > 0) {
+ unsigned int (*preHookFunc) (struct homun_data **hd, unsigned int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_add_intimacy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_add_intimacy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_add_intimacy_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &value);
+ retVal___ = preHookFunc(&hd, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29392,11 +29862,11 @@ unsigned int HP_homun_add_intimacy(struct homun_data *hd, unsigned int value) {
{
retVal___ = HPMHooks.source.homun.add_intimacy(hd, value);
}
- if( HPMHooks.count.HP_homun_add_intimacy_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct homun_data *hd, unsigned int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_add_intimacy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_add_intimacy_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct homun_data *hd, unsigned int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_add_intimacy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_add_intimacy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &value);
+ retVal___ = postHookFunc(retVal___, hd, value);
}
}
return retVal___;
@@ -29404,14 +29874,14 @@ unsigned int HP_homun_add_intimacy(struct homun_data *hd, unsigned int value) {
unsigned int HP_homun_consume_intimacy(struct homun_data *hd, unsigned int value) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_homun_consume_intimacy_pre ) {
- unsigned int (*preHookFunc) (struct homun_data *hd, unsigned int *value);
+ if (HPMHooks.count.HP_homun_consume_intimacy_pre > 0) {
+ unsigned int (*preHookFunc) (struct homun_data **hd, unsigned int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_consume_intimacy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_consume_intimacy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_consume_intimacy_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &value);
+ retVal___ = preHookFunc(&hd, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29419,25 +29889,25 @@ unsigned int HP_homun_consume_intimacy(struct homun_data *hd, unsigned int value
{
retVal___ = HPMHooks.source.homun.consume_intimacy(hd, value);
}
- if( HPMHooks.count.HP_homun_consume_intimacy_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct homun_data *hd, unsigned int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_consume_intimacy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_consume_intimacy_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct homun_data *hd, unsigned int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_consume_intimacy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_consume_intimacy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &value);
+ retVal___ = postHookFunc(retVal___, hd, value);
}
}
return retVal___;
}
void HP_homun_healed(struct homun_data *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_healed_pre ) {
- void (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_healed_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_healed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_healed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_healed_pre[hIndex].func;
- preHookFunc(hd);
+ preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29445,9 +29915,9 @@ void HP_homun_healed(struct homun_data *hd) {
{
HPMHooks.source.homun.healed(hd);
}
- if( HPMHooks.count.HP_homun_healed_post ) {
+ if (HPMHooks.count.HP_homun_healed_post > 0) {
void (*postHookFunc) (struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_healed_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_healed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_healed_post[hIndex].func;
postHookFunc(hd);
}
@@ -29456,14 +29926,14 @@ void HP_homun_healed(struct homun_data *hd) {
}
void HP_homun_save(struct homun_data *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_save_pre ) {
- void (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_save_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_save_pre[hIndex].func;
- preHookFunc(hd);
+ preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29471,9 +29941,9 @@ void HP_homun_save(struct homun_data *hd) {
{
HPMHooks.source.homun.save(hd);
}
- if( HPMHooks.count.HP_homun_save_post ) {
+ if (HPMHooks.count.HP_homun_save_post > 0) {
void (*postHookFunc) (struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_save_post[hIndex].func;
postHookFunc(hd);
}
@@ -29483,14 +29953,14 @@ void HP_homun_save(struct homun_data *hd) {
unsigned char HP_homun_menu(struct map_session_data *sd, unsigned char menu_num) {
int hIndex = 0;
unsigned char retVal___ = 0;
- if( HPMHooks.count.HP_homun_menu_pre ) {
- unsigned char (*preHookFunc) (struct map_session_data *sd, unsigned char *menu_num);
+ if (HPMHooks.count.HP_homun_menu_pre > 0) {
+ unsigned char (*preHookFunc) (struct map_session_data **sd, unsigned char *menu_num);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_menu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_menu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_menu_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &menu_num);
+ retVal___ = preHookFunc(&sd, &menu_num);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29498,11 +29968,11 @@ unsigned char HP_homun_menu(struct map_session_data *sd, unsigned char menu_num)
{
retVal___ = HPMHooks.source.homun.menu(sd, menu_num);
}
- if( HPMHooks.count.HP_homun_menu_post ) {
- unsigned char (*postHookFunc) (unsigned char retVal___, struct map_session_data *sd, unsigned char *menu_num);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_menu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_menu_post > 0) {
+ unsigned char (*postHookFunc) (unsigned char retVal___, struct map_session_data *sd, unsigned char menu_num);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_menu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_menu_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &menu_num);
+ retVal___ = postHookFunc(retVal___, sd, menu_num);
}
}
return retVal___;
@@ -29510,14 +29980,14 @@ unsigned char HP_homun_menu(struct map_session_data *sd, unsigned char menu_num)
bool HP_homun_feed(struct map_session_data *sd, struct homun_data *hd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_feed_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_feed_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_feed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_feed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_feed_pre[hIndex].func;
- retVal___ = preHookFunc(sd, hd);
+ retVal___ = preHookFunc(&sd, &hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29525,9 +29995,9 @@ bool HP_homun_feed(struct map_session_data *sd, struct homun_data *hd) {
{
retVal___ = HPMHooks.source.homun.feed(sd, hd);
}
- if( HPMHooks.count.HP_homun_feed_post ) {
+ if (HPMHooks.count.HP_homun_feed_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_feed_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_feed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_feed_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, hd);
}
@@ -29537,14 +30007,14 @@ bool HP_homun_feed(struct map_session_data *sd, struct homun_data *hd) {
int HP_homun_hunger_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_hunger_timer_pre ) {
+ if (HPMHooks.count.HP_homun_hunger_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_hunger_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29552,25 +30022,25 @@ int HP_homun_hunger_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.homun.hunger_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_homun_hunger_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_hunger_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_hunger_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_homun_hunger_timer_delete(struct homun_data *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_hunger_timer_delete_pre ) {
- void (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_hunger_timer_delete_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_hunger_timer_delete_pre[hIndex].func;
- preHookFunc(hd);
+ preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29578,26 +30048,26 @@ void HP_homun_hunger_timer_delete(struct homun_data *hd) {
{
HPMHooks.source.homun.hunger_timer_delete(hd);
}
- if( HPMHooks.count.HP_homun_hunger_timer_delete_post ) {
+ if (HPMHooks.count.HP_homun_hunger_timer_delete_post > 0) {
void (*postHookFunc) (struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_delete_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_hunger_timer_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_hunger_timer_delete_post[hIndex].func;
postHookFunc(hd);
}
}
return;
}
-int HP_homun_change_name(struct map_session_data *sd, char *name) {
+int HP_homun_change_name(struct map_session_data *sd, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_change_name_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *name);
+ if (HPMHooks.count.HP_homun_change_name_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_change_name_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name);
+ retVal___ = preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29605,26 +30075,26 @@ int HP_homun_change_name(struct map_session_data *sd, char *name) {
{
retVal___ = HPMHooks.source.homun.change_name(sd, name);
}
- if( HPMHooks.count.HP_homun_change_name_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_change_name_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_change_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, name);
}
}
return retVal___;
}
-bool HP_homun_change_name_ack(struct map_session_data *sd, char *name, int flag) {
+bool HP_homun_change_name_ack(struct map_session_data *sd, const char *name, int flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_change_name_ack_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, char *name, int *flag);
+ if (HPMHooks.count.HP_homun_change_name_ack_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **name, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_change_name_ack_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name, &flag);
+ retVal___ = preHookFunc(&sd, &name, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29632,11 +30102,11 @@ bool HP_homun_change_name_ack(struct map_session_data *sd, char *name, int flag)
{
retVal___ = HPMHooks.source.homun.change_name_ack(sd, name, flag);
}
- if( HPMHooks.count.HP_homun_change_name_ack_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, char *name, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_change_name_ack_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *name, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_change_name_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_change_name_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, name, &flag);
+ retVal___ = postHookFunc(retVal___, sd, name, flag);
}
}
return retVal___;
@@ -29644,14 +30114,14 @@ bool HP_homun_change_name_ack(struct map_session_data *sd, char *name, int flag)
int HP_homun_db_search(int key, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_homun_db_search_pre ) {
+ if (HPMHooks.count.HP_homun_db_search_pre > 0) {
int (*preHookFunc) (int *key, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_db_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_db_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_db_search_pre[hIndex].func;
retVal___ = preHookFunc(&key, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29659,26 +30129,26 @@ int HP_homun_db_search(int key, int type) {
{
retVal___ = HPMHooks.source.homun.db_search(key, type);
}
- if( HPMHooks.count.HP_homun_db_search_post ) {
- int (*postHookFunc) (int retVal___, int *key, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_db_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_db_search_post > 0) {
+ int (*postHookFunc) (int retVal___, int key, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_db_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_db_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, &type);
+ retVal___ = postHookFunc(retVal___, key, type);
}
}
return retVal___;
}
-bool HP_homun_create(struct map_session_data *sd, struct s_homunculus *hom) {
+bool HP_homun_create(struct map_session_data *sd, const struct s_homunculus *hom) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_create_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct s_homunculus *hom);
+ if (HPMHooks.count.HP_homun_create_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const struct s_homunculus **hom);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, hom);
+ retVal___ = preHookFunc(&sd, &hom);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29686,9 +30156,9 @@ bool HP_homun_create(struct map_session_data *sd, struct s_homunculus *hom) {
{
retVal___ = HPMHooks.source.homun.create(sd, hom);
}
- if( HPMHooks.count.HP_homun_create_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct s_homunculus *hom);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_create_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct s_homunculus *hom);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, hom);
}
@@ -29697,14 +30167,14 @@ bool HP_homun_create(struct map_session_data *sd, struct s_homunculus *hom) {
}
void HP_homun_init_timers(struct homun_data *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_init_timers_pre ) {
- void (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_init_timers_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_timers_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_timers_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_init_timers_pre[hIndex].func;
- preHookFunc(hd);
+ preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29712,9 +30182,9 @@ void HP_homun_init_timers(struct homun_data *hd) {
{
HPMHooks.source.homun.init_timers(hd);
}
- if( HPMHooks.count.HP_homun_init_timers_post ) {
+ if (HPMHooks.count.HP_homun_init_timers_post > 0) {
void (*postHookFunc) (struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_timers_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_init_timers_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_init_timers_post[hIndex].func;
postHookFunc(hd);
}
@@ -29724,14 +30194,14 @@ void HP_homun_init_timers(struct homun_data *hd) {
bool HP_homun_call(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_call_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_homun_call_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_call_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_call_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_call_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29739,26 +30209,26 @@ bool HP_homun_call(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.homun.call(sd);
}
- if( HPMHooks.count.HP_homun_call_post ) {
+ if (HPMHooks.count.HP_homun_call_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_call_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_call_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_call_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-bool HP_homun_recv_data(int account_id, struct s_homunculus *sh, int flag) {
+bool HP_homun_recv_data(int account_id, const struct s_homunculus *sh, int flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_recv_data_pre ) {
- bool (*preHookFunc) (int *account_id, struct s_homunculus *sh, int *flag);
+ if (HPMHooks.count.HP_homun_recv_data_pre > 0) {
+ bool (*preHookFunc) (int *account_id, const struct s_homunculus **sh, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_recv_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_recv_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_recv_data_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, sh, &flag);
+ retVal___ = preHookFunc(&account_id, &sh, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29766,11 +30236,11 @@ bool HP_homun_recv_data(int account_id, struct s_homunculus *sh, int flag) {
{
retVal___ = HPMHooks.source.homun.recv_data(account_id, sh, flag);
}
- if( HPMHooks.count.HP_homun_recv_data_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, struct s_homunculus *sh, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_recv_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_recv_data_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, const struct s_homunculus *sh, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_recv_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_recv_data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, sh, &flag);
+ retVal___ = postHookFunc(retVal___, account_id, sh, flag);
}
}
return retVal___;
@@ -29778,14 +30248,14 @@ bool HP_homun_recv_data(int account_id, struct s_homunculus *sh, int flag) {
bool HP_homun_creation_request(struct map_session_data *sd, int class_) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_creation_request_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *class_);
+ if (HPMHooks.count.HP_homun_creation_request_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_creation_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_creation_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_creation_request_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &class_);
+ retVal___ = preHookFunc(&sd, &class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29793,11 +30263,11 @@ bool HP_homun_creation_request(struct map_session_data *sd, int class_) {
{
retVal___ = HPMHooks.source.homun.creation_request(sd, class_);
}
- if( HPMHooks.count.HP_homun_creation_request_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_creation_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_creation_request_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_creation_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_creation_request_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &class_);
+ retVal___ = postHookFunc(retVal___, sd, class_);
}
}
return retVal___;
@@ -29805,14 +30275,14 @@ bool HP_homun_creation_request(struct map_session_data *sd, int class_) {
bool HP_homun_ressurect(struct map_session_data *sd, unsigned char per, short x, short y) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_ressurect_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, unsigned char *per, short *x, short *y);
+ if (HPMHooks.count.HP_homun_ressurect_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, unsigned char *per, short *x, short *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_ressurect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_ressurect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_ressurect_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &per, &x, &y);
+ retVal___ = preHookFunc(&sd, &per, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29820,25 +30290,25 @@ bool HP_homun_ressurect(struct map_session_data *sd, unsigned char per, short x,
{
retVal___ = HPMHooks.source.homun.ressurect(sd, per, x, y);
}
- if( HPMHooks.count.HP_homun_ressurect_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned char *per, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_ressurect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_ressurect_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned char per, short x, short y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_ressurect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_ressurect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &per, &x, &y);
+ retVal___ = postHookFunc(retVal___, sd, per, x, y);
}
}
return retVal___;
}
void HP_homun_revive(struct homun_data *hd, unsigned int hp, unsigned int sp) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_revive_pre ) {
- void (*preHookFunc) (struct homun_data *hd, unsigned int *hp, unsigned int *sp);
+ if (HPMHooks.count.HP_homun_revive_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd, unsigned int *hp, unsigned int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_revive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_revive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_revive_pre[hIndex].func;
- preHookFunc(hd, &hp, &sp);
+ preHookFunc(&hd, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29846,25 +30316,25 @@ void HP_homun_revive(struct homun_data *hd, unsigned int hp, unsigned int sp) {
{
HPMHooks.source.homun.revive(hd, hp, sp);
}
- if( HPMHooks.count.HP_homun_revive_post ) {
- void (*postHookFunc) (struct homun_data *hd, unsigned int *hp, unsigned int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_revive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_revive_post > 0) {
+ void (*postHookFunc) (struct homun_data *hd, unsigned int hp, unsigned int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_revive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_revive_post[hIndex].func;
- postHookFunc(hd, &hp, &sp);
+ postHookFunc(hd, hp, sp);
}
}
return;
}
void HP_homun_stat_reset(struct homun_data *hd) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_stat_reset_pre ) {
- void (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_stat_reset_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_stat_reset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_stat_reset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_stat_reset_pre[hIndex].func;
- preHookFunc(hd);
+ preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29872,9 +30342,9 @@ void HP_homun_stat_reset(struct homun_data *hd) {
{
HPMHooks.source.homun.stat_reset(hd);
}
- if( HPMHooks.count.HP_homun_stat_reset_post ) {
+ if (HPMHooks.count.HP_homun_stat_reset_post > 0) {
void (*postHookFunc) (struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_stat_reset_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_stat_reset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_stat_reset_post[hIndex].func;
postHookFunc(hd);
}
@@ -29884,14 +30354,14 @@ void HP_homun_stat_reset(struct homun_data *hd) {
bool HP_homun_shuffle(struct homun_data *hd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_shuffle_pre ) {
- bool (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_shuffle_pre > 0) {
+ bool (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_shuffle_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_shuffle_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_shuffle_pre[hIndex].func;
- retVal___ = preHookFunc(hd);
+ retVal___ = preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29899,9 +30369,9 @@ bool HP_homun_shuffle(struct homun_data *hd) {
{
retVal___ = HPMHooks.source.homun.shuffle(hd);
}
- if( HPMHooks.count.HP_homun_shuffle_post ) {
+ if (HPMHooks.count.HP_homun_shuffle_post > 0) {
bool (*postHookFunc) (bool retVal___, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_shuffle_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_shuffle_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_shuffle_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hd);
}
@@ -29911,14 +30381,14 @@ bool HP_homun_shuffle(struct homun_data *hd) {
bool HP_homun_read_db_sub(char *str[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_read_db_sub_pre ) {
- bool (*preHookFunc) (char *str[], int *columns, int *current);
+ if (HPMHooks.count.HP_homun_read_db_sub_pre > 0) {
+ bool (*preHookFunc) (char **str[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_read_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29926,25 +30396,25 @@ bool HP_homun_read_db_sub(char *str[], int columns, int current) {
{
retVal___ = HPMHooks.source.homun.read_db_sub(str, columns, current);
}
- if( HPMHooks.count.HP_homun_read_db_sub_post ) {
- bool (*postHookFunc) (bool retVal___, char *str[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_read_db_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_read_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
}
void HP_homun_read_db(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_read_db_pre ) {
+ if (HPMHooks.count.HP_homun_read_db_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_read_db_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -29952,9 +30422,9 @@ void HP_homun_read_db(void) {
{
HPMHooks.source.homun.read_db();
}
- if( HPMHooks.count.HP_homun_read_db_post ) {
+ if (HPMHooks.count.HP_homun_read_db_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_read_db_post[hIndex].func;
postHookFunc();
}
@@ -29964,14 +30434,14 @@ void HP_homun_read_db(void) {
bool HP_homun_read_skill_db_sub(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_homun_read_skill_db_sub_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_homun_read_skill_db_sub_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_skill_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_skill_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_read_skill_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -29979,25 +30449,25 @@ bool HP_homun_read_skill_db_sub(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.homun.read_skill_db_sub(split, columns, current);
}
- if( HPMHooks.count.HP_homun_read_skill_db_sub_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_skill_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_read_skill_db_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_read_skill_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_read_skill_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
}
void HP_homun_skill_db_read(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_skill_db_read_pre ) {
+ if (HPMHooks.count.HP_homun_skill_db_read_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_db_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_db_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_skill_db_read_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30005,9 +30475,9 @@ void HP_homun_skill_db_read(void) {
{
HPMHooks.source.homun.skill_db_read();
}
- if( HPMHooks.count.HP_homun_skill_db_read_post ) {
+ if (HPMHooks.count.HP_homun_skill_db_read_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_db_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_skill_db_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_skill_db_read_post[hIndex].func;
postHookFunc();
}
@@ -30016,14 +30486,14 @@ void HP_homun_skill_db_read(void) {
}
void HP_homun_exp_db_read(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_exp_db_read_pre ) {
+ if (HPMHooks.count.HP_homun_exp_db_read_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_exp_db_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_exp_db_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_exp_db_read_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30031,9 +30501,9 @@ void HP_homun_exp_db_read(void) {
{
HPMHooks.source.homun.exp_db_read();
}
- if( HPMHooks.count.HP_homun_exp_db_read_post ) {
+ if (HPMHooks.count.HP_homun_exp_db_read_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_exp_db_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_exp_db_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_exp_db_read_post[hIndex].func;
postHookFunc();
}
@@ -30042,14 +30512,14 @@ void HP_homun_exp_db_read(void) {
}
void HP_homun_addspiritball(struct homun_data *hd, int max) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_addspiritball_pre ) {
- void (*preHookFunc) (struct homun_data *hd, int *max);
+ if (HPMHooks.count.HP_homun_addspiritball_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_addspiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_addspiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_addspiritball_pre[hIndex].func;
- preHookFunc(hd, &max);
+ preHookFunc(&hd, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30057,25 +30527,25 @@ void HP_homun_addspiritball(struct homun_data *hd, int max) {
{
HPMHooks.source.homun.addspiritball(hd, max);
}
- if( HPMHooks.count.HP_homun_addspiritball_post ) {
- void (*postHookFunc) (struct homun_data *hd, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_addspiritball_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_addspiritball_post > 0) {
+ void (*postHookFunc) (struct homun_data *hd, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_addspiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_addspiritball_post[hIndex].func;
- postHookFunc(hd, &max);
+ postHookFunc(hd, max);
}
}
return;
}
void HP_homun_delspiritball(struct homun_data *hd, int count, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_homun_delspiritball_pre ) {
- void (*preHookFunc) (struct homun_data *hd, int *count, int *type);
+ if (HPMHooks.count.HP_homun_delspiritball_pre > 0) {
+ void (*preHookFunc) (struct homun_data **hd, int *count, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_delspiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_delspiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_delspiritball_pre[hIndex].func;
- preHookFunc(hd, &count, &type);
+ preHookFunc(&hd, &count, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30083,11 +30553,11 @@ void HP_homun_delspiritball(struct homun_data *hd, int count, int type) {
{
HPMHooks.source.homun.delspiritball(hd, count, type);
}
- if( HPMHooks.count.HP_homun_delspiritball_post ) {
- void (*postHookFunc) (struct homun_data *hd, int *count, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_delspiritball_post; hIndex++ ) {
+ if (HPMHooks.count.HP_homun_delspiritball_post > 0) {
+ void (*postHookFunc) (struct homun_data *hd, int count, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_delspiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_delspiritball_post[hIndex].func;
- postHookFunc(hd, &count, &type);
+ postHookFunc(hd, count, type);
}
}
return;
@@ -30095,14 +30565,14 @@ void HP_homun_delspiritball(struct homun_data *hd, int count, int type) {
int8 HP_homun_get_intimacy_grade(struct homun_data *hd) {
int hIndex = 0;
int8 retVal___ = 0;
- if( HPMHooks.count.HP_homun_get_intimacy_grade_pre ) {
- int8 (*preHookFunc) (struct homun_data *hd);
+ if (HPMHooks.count.HP_homun_get_intimacy_grade_pre > 0) {
+ int8 (*preHookFunc) (struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_intimacy_grade_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_intimacy_grade_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_homun_get_intimacy_grade_pre[hIndex].func;
- retVal___ = preHookFunc(hd);
+ retVal___ = preHookFunc(&hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30110,26 +30580,26 @@ int8 HP_homun_get_intimacy_grade(struct homun_data *hd) {
{
retVal___ = HPMHooks.source.homun.get_intimacy_grade(hd);
}
- if( HPMHooks.count.HP_homun_get_intimacy_grade_post ) {
+ if (HPMHooks.count.HP_homun_get_intimacy_grade_post > 0) {
int8 (*postHookFunc) (int8 retVal___, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_intimacy_grade_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_homun_get_intimacy_grade_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_homun_get_intimacy_grade_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hd);
}
}
return retVal___;
}
-/* instance */
+/* instance_interface */
void HP_instance_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_init_pre ) {
+ if (HPMHooks.count.HP_instance_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30137,25 +30607,25 @@ void HP_instance_init(bool minimal) {
{
HPMHooks.source.instance.init(minimal);
}
- if( HPMHooks.count.HP_instance_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_instance_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_final_pre ) {
+ if (HPMHooks.count.HP_instance_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30163,9 +30633,9 @@ void HP_instance_final(void) {
{
HPMHooks.source.instance.final();
}
- if( HPMHooks.count.HP_instance_final_post ) {
+ if (HPMHooks.count.HP_instance_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_final_post[hIndex].func;
postHookFunc();
}
@@ -30174,14 +30644,14 @@ void HP_instance_final(void) {
}
void HP_instance_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_reload_pre ) {
+ if (HPMHooks.count.HP_instance_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30189,9 +30659,9 @@ void HP_instance_reload(void) {
{
HPMHooks.source.instance.reload();
}
- if( HPMHooks.count.HP_instance_reload_post ) {
+ if (HPMHooks.count.HP_instance_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_reload_post[hIndex].func;
postHookFunc();
}
@@ -30201,14 +30671,14 @@ void HP_instance_reload(void) {
int HP_instance_create(int party_id, const char *name, enum instance_owner_type type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_create_pre ) {
- int (*preHookFunc) (int *party_id, const char *name, enum instance_owner_type *type);
+ if (HPMHooks.count.HP_instance_create_pre > 0) {
+ int (*preHookFunc) (int *party_id, const char **name, enum instance_owner_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_create_pre[hIndex].func;
- retVal___ = preHookFunc(&party_id, name, &type);
+ retVal___ = preHookFunc(&party_id, &name, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30216,11 +30686,11 @@ int HP_instance_create(int party_id, const char *name, enum instance_owner_type
{
retVal___ = HPMHooks.source.instance.create(party_id, name, type);
}
- if( HPMHooks.count.HP_instance_create_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, const char *name, enum instance_owner_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_create_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, const char *name, enum instance_owner_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, name, &type);
+ retVal___ = postHookFunc(retVal___, party_id, name, type);
}
}
return retVal___;
@@ -30228,14 +30698,14 @@ int HP_instance_create(int party_id, const char *name, enum instance_owner_type
int HP_instance_add_map(const char *name, int instance_id, bool usebasename, const char *map_name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_add_map_pre ) {
- int (*preHookFunc) (const char *name, int *instance_id, bool *usebasename, const char *map_name);
+ if (HPMHooks.count.HP_instance_add_map_pre > 0) {
+ int (*preHookFunc) (const char **name, int *instance_id, bool *usebasename, const char **map_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_add_map_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_add_map_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_add_map_pre[hIndex].func;
- retVal___ = preHookFunc(name, &instance_id, &usebasename, map_name);
+ retVal___ = preHookFunc(&name, &instance_id, &usebasename, &map_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30243,25 +30713,25 @@ int HP_instance_add_map(const char *name, int instance_id, bool usebasename, con
{
retVal___ = HPMHooks.source.instance.add_map(name, instance_id, usebasename, map_name);
}
- if( HPMHooks.count.HP_instance_add_map_post ) {
- int (*postHookFunc) (int retVal___, const char *name, int *instance_id, bool *usebasename, const char *map_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_add_map_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_add_map_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *name, int instance_id, bool usebasename, const char *map_name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_add_map_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_add_map_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &instance_id, &usebasename, map_name);
+ retVal___ = postHookFunc(retVal___, name, instance_id, usebasename, map_name);
}
}
return retVal___;
}
void HP_instance_del_map(int16 m) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_del_map_pre ) {
+ if (HPMHooks.count.HP_instance_del_map_pre > 0) {
void (*preHookFunc) (int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_del_map_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_del_map_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_del_map_pre[hIndex].func;
preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30269,11 +30739,11 @@ void HP_instance_del_map(int16 m) {
{
HPMHooks.source.instance.del_map(m);
}
- if( HPMHooks.count.HP_instance_del_map_post ) {
- void (*postHookFunc) (int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_del_map_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_del_map_post > 0) {
+ void (*postHookFunc) (int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_del_map_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_del_map_post[hIndex].func;
- postHookFunc(&m);
+ postHookFunc(m);
}
}
return;
@@ -30281,14 +30751,14 @@ void HP_instance_del_map(int16 m) {
int HP_instance_map2imap(int16 m, int instance_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_map2imap_pre ) {
+ if (HPMHooks.count.HP_instance_map2imap_pre > 0) {
int (*preHookFunc) (int16 *m, int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_map2imap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_map2imap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_map2imap_pre[hIndex].func;
retVal___ = preHookFunc(&m, &instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30296,11 +30766,11 @@ int HP_instance_map2imap(int16 m, int instance_id) {
{
retVal___ = HPMHooks.source.instance.map2imap(m, instance_id);
}
- if( HPMHooks.count.HP_instance_map2imap_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_map2imap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_map2imap_post > 0) {
+ int (*postHookFunc) (int retVal___, int16 m, int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_map2imap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_map2imap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &instance_id);
+ retVal___ = postHookFunc(retVal___, m, instance_id);
}
}
return retVal___;
@@ -30308,14 +30778,14 @@ int HP_instance_map2imap(int16 m, int instance_id) {
int HP_instance_mapid2imapid(int16 m, int instance_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_mapid2imapid_pre ) {
+ if (HPMHooks.count.HP_instance_mapid2imapid_pre > 0) {
int (*preHookFunc) (int16 *m, int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapid2imapid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapid2imapid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_mapid2imapid_pre[hIndex].func;
retVal___ = preHookFunc(&m, &instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30323,11 +30793,11 @@ int HP_instance_mapid2imapid(int16 m, int instance_id) {
{
retVal___ = HPMHooks.source.instance.mapid2imapid(m, instance_id);
}
- if( HPMHooks.count.HP_instance_mapid2imapid_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapid2imapid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_mapid2imapid_post > 0) {
+ int (*postHookFunc) (int retVal___, int16 m, int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapid2imapid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_mapid2imapid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &instance_id);
+ retVal___ = postHookFunc(retVal___, m, instance_id);
}
}
return retVal___;
@@ -30335,14 +30805,14 @@ int HP_instance_mapid2imapid(int16 m, int instance_id) {
int HP_instance_mapname2imap(const char *map_name, int instance_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_mapname2imap_pre ) {
- int (*preHookFunc) (const char *map_name, int *instance_id);
+ if (HPMHooks.count.HP_instance_mapname2imap_pre > 0) {
+ int (*preHookFunc) (const char **map_name, int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapname2imap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapname2imap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_mapname2imap_pre[hIndex].func;
- retVal___ = preHookFunc(map_name, &instance_id);
+ retVal___ = preHookFunc(&map_name, &instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30350,11 +30820,11 @@ int HP_instance_mapname2imap(const char *map_name, int instance_id) {
{
retVal___ = HPMHooks.source.instance.mapname2imap(map_name, instance_id);
}
- if( HPMHooks.count.HP_instance_mapname2imap_post ) {
- int (*postHookFunc) (int retVal___, const char *map_name, int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapname2imap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_mapname2imap_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *map_name, int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapname2imap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_mapname2imap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, map_name, &instance_id);
+ retVal___ = postHookFunc(retVal___, map_name, instance_id);
}
}
return retVal___;
@@ -30362,16 +30832,16 @@ int HP_instance_mapname2imap(const char *map_name, int instance_id) {
int HP_instance_map_npcsub(struct block_list *bl, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_map_npcsub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list args);
+ if (HPMHooks.count.HP_instance_map_npcsub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_map_npcsub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_map_npcsub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_instance_map_npcsub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, args___copy);
+ retVal___ = preHookFunc(&bl, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30381,9 +30851,9 @@ int HP_instance_map_npcsub(struct block_list *bl, va_list args) {
retVal___ = HPMHooks.source.instance.map_npcsub(bl, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_instance_map_npcsub_post ) {
+ if (HPMHooks.count.HP_instance_map_npcsub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_map_npcsub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_map_npcsub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_instance_map_npcsub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, args___copy);
@@ -30395,16 +30865,16 @@ int HP_instance_map_npcsub(struct block_list *bl, va_list args) {
int HP_instance_init_npc(struct block_list *bl, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_init_npc_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list args);
+ if (HPMHooks.count.HP_instance_init_npc_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_npc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_npc_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_instance_init_npc_pre[hIndex].func;
- retVal___ = preHookFunc(bl, args___copy);
+ retVal___ = preHookFunc(&bl, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30414,9 +30884,9 @@ int HP_instance_init_npc(struct block_list *bl, va_list args) {
retVal___ = HPMHooks.source.instance.init_npc(bl, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_instance_init_npc_post ) {
+ if (HPMHooks.count.HP_instance_init_npc_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_npc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_npc_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_instance_init_npc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, args___copy);
@@ -30427,14 +30897,14 @@ int HP_instance_init_npc(struct block_list *bl, va_list args) {
}
void HP_instance_destroy(int instance_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_destroy_pre ) {
+ if (HPMHooks.count.HP_instance_destroy_pre > 0) {
void (*preHookFunc) (int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_destroy_pre[hIndex].func;
preHookFunc(&instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30442,25 +30912,25 @@ void HP_instance_destroy(int instance_id) {
{
HPMHooks.source.instance.destroy(instance_id);
}
- if( HPMHooks.count.HP_instance_destroy_post ) {
- void (*postHookFunc) (int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_destroy_post > 0) {
+ void (*postHookFunc) (int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_destroy_post[hIndex].func;
- postHookFunc(&instance_id);
+ postHookFunc(instance_id);
}
}
return;
}
void HP_instance_start(int instance_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_start_pre ) {
+ if (HPMHooks.count.HP_instance_start_pre > 0) {
void (*preHookFunc) (int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_start_pre[hIndex].func;
preHookFunc(&instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30468,25 +30938,25 @@ void HP_instance_start(int instance_id) {
{
HPMHooks.source.instance.start(instance_id);
}
- if( HPMHooks.count.HP_instance_start_post ) {
- void (*postHookFunc) (int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_start_post > 0) {
+ void (*postHookFunc) (int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_start_post[hIndex].func;
- postHookFunc(&instance_id);
+ postHookFunc(instance_id);
}
}
return;
}
void HP_instance_check_idle(int instance_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_check_idle_pre ) {
+ if (HPMHooks.count.HP_instance_check_idle_pre > 0) {
void (*preHookFunc) (int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_idle_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_idle_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_check_idle_pre[hIndex].func;
preHookFunc(&instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30494,25 +30964,25 @@ void HP_instance_check_idle(int instance_id) {
{
HPMHooks.source.instance.check_idle(instance_id);
}
- if( HPMHooks.count.HP_instance_check_idle_post ) {
- void (*postHookFunc) (int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_idle_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_check_idle_post > 0) {
+ void (*postHookFunc) (int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_idle_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_check_idle_post[hIndex].func;
- postHookFunc(&instance_id);
+ postHookFunc(instance_id);
}
}
return;
}
void HP_instance_check_kick(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_check_kick_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_instance_check_kick_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_kick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_kick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_check_kick_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30520,9 +30990,9 @@ void HP_instance_check_kick(struct map_session_data *sd) {
{
HPMHooks.source.instance.check_kick(sd);
}
- if( HPMHooks.count.HP_instance_check_kick_post ) {
+ if (HPMHooks.count.HP_instance_check_kick_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_kick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_check_kick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_check_kick_post[hIndex].func;
postHookFunc(sd);
}
@@ -30531,14 +31001,14 @@ void HP_instance_check_kick(struct map_session_data *sd) {
}
void HP_instance_set_timeout(int instance_id, unsigned int progress_timeout, unsigned int idle_timeout) {
int hIndex = 0;
- if( HPMHooks.count.HP_instance_set_timeout_pre ) {
+ if (HPMHooks.count.HP_instance_set_timeout_pre > 0) {
void (*preHookFunc) (int *instance_id, unsigned int *progress_timeout, unsigned int *idle_timeout);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_set_timeout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_set_timeout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_set_timeout_pre[hIndex].func;
preHookFunc(&instance_id, &progress_timeout, &idle_timeout);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -30546,11 +31016,11 @@ void HP_instance_set_timeout(int instance_id, unsigned int progress_timeout, uns
{
HPMHooks.source.instance.set_timeout(instance_id, progress_timeout, idle_timeout);
}
- if( HPMHooks.count.HP_instance_set_timeout_post ) {
- void (*postHookFunc) (int *instance_id, unsigned int *progress_timeout, unsigned int *idle_timeout);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_set_timeout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_set_timeout_post > 0) {
+ void (*postHookFunc) (int instance_id, unsigned int progress_timeout, unsigned int idle_timeout);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_set_timeout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_set_timeout_post[hIndex].func;
- postHookFunc(&instance_id, &progress_timeout, &idle_timeout);
+ postHookFunc(instance_id, progress_timeout, idle_timeout);
}
}
return;
@@ -30558,14 +31028,14 @@ void HP_instance_set_timeout(int instance_id, unsigned int progress_timeout, uns
bool HP_instance_valid(int instance_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_instance_valid_pre ) {
+ if (HPMHooks.count.HP_instance_valid_pre > 0) {
bool (*preHookFunc) (int *instance_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_valid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_valid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_valid_pre[hIndex].func;
retVal___ = preHookFunc(&instance_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30573,11 +31043,11 @@ bool HP_instance_valid(int instance_id) {
{
retVal___ = HPMHooks.source.instance.valid(instance_id);
}
- if( HPMHooks.count.HP_instance_valid_post ) {
- bool (*postHookFunc) (bool retVal___, int *instance_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_valid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_valid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int instance_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_valid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_valid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &instance_id);
+ retVal___ = postHookFunc(retVal___, instance_id);
}
}
return retVal___;
@@ -30585,14 +31055,14 @@ bool HP_instance_valid(int instance_id) {
int HP_instance_destroy_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_instance_destroy_timer_pre ) {
+ if (HPMHooks.count.HP_instance_destroy_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_instance_destroy_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30600,27 +31070,27 @@ int HP_instance_destroy_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.instance.destroy_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_instance_destroy_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_instance_destroy_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_destroy_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_instance_destroy_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-/* intif */
+/* intif_interface */
int HP_intif_parse(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_parse_pre ) {
+ if (HPMHooks.count.HP_intif_parse_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_parse_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30628,11 +31098,11 @@ int HP_intif_parse(int fd) {
{
retVal___ = HPMHooks.source.intif.parse(fd);
}
- if( HPMHooks.count.HP_intif_parse_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -30640,14 +31110,14 @@ int HP_intif_parse(int fd) {
int HP_intif_create_pet(int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_create_pet_pre ) {
- int (*preHookFunc) (int *account_id, int *char_id, short *pet_type, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char *pet_name);
+ if (HPMHooks.count.HP_intif_create_pet_pre > 0) {
+ int (*preHookFunc) (int *account_id, int *char_id, short *pet_type, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char **pet_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_pet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_pet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_create_pet_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, &char_id, &pet_type, &pet_lv, &pet_egg_id, &pet_equip, &intimate, &hungry, &rename_flag, &incubate, pet_name);
+ retVal___ = preHookFunc(&account_id, &char_id, &pet_type, &pet_lv, &pet_egg_id, &pet_equip, &intimate, &hungry, &rename_flag, &incubate, &pet_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30655,26 +31125,26 @@ int HP_intif_create_pet(int account_id, int char_id, short pet_type, short pet_l
{
retVal___ = HPMHooks.source.intif.create_pet(account_id, char_id, pet_type, pet_lv, pet_egg_id, pet_equip, intimate, hungry, rename_flag, incubate, pet_name);
}
- if( HPMHooks.count.HP_intif_create_pet_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *char_id, short *pet_type, short *pet_lv, short *pet_egg_id, short *pet_equip, short *intimate, short *hungry, char *rename_flag, char *incubate, char *pet_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_pet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_create_pet_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id, short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_pet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_create_pet_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id, &pet_type, &pet_lv, &pet_egg_id, &pet_equip, &intimate, &hungry, &rename_flag, &incubate, pet_name);
+ retVal___ = postHookFunc(retVal___, account_id, char_id, pet_type, pet_lv, pet_egg_id, pet_equip, intimate, hungry, rename_flag, incubate, pet_name);
}
}
return retVal___;
}
-int HP_intif_broadcast(const char *mes, size_t len, int type) {
+int HP_intif_broadcast(const char *mes, int len, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_broadcast_pre ) {
- int (*preHookFunc) (const char *mes, size_t *len, int *type);
+ if (HPMHooks.count.HP_intif_broadcast_pre > 0) {
+ int (*preHookFunc) (const char **mes, int *len, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_broadcast_pre[hIndex].func;
- retVal___ = preHookFunc(mes, &len, &type);
+ retVal___ = preHookFunc(&mes, &len, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30682,26 +31152,26 @@ int HP_intif_broadcast(const char *mes, size_t len, int type) {
{
retVal___ = HPMHooks.source.intif.broadcast(mes, len, type);
}
- if( HPMHooks.count.HP_intif_broadcast_post ) {
- int (*postHookFunc) (int retVal___, const char *mes, size_t *len, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_broadcast_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *mes, int len, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_broadcast_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mes, &len, &type);
+ retVal___ = postHookFunc(retVal___, mes, len, type);
}
}
return retVal___;
}
-int HP_intif_broadcast2(const char *mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) {
+int HP_intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_broadcast2_pre ) {
- int (*preHookFunc) (const char *mes, size_t *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY);
+ if (HPMHooks.count.HP_intif_broadcast2_pre > 0) {
+ int (*preHookFunc) (const char **mes, int *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_broadcast2_pre[hIndex].func;
- retVal___ = preHookFunc(mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY);
+ retVal___ = preHookFunc(&mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30709,11 +31179,11 @@ int HP_intif_broadcast2(const char *mes, size_t len, unsigned int fontColor, sho
{
retVal___ = HPMHooks.source.intif.broadcast2(mes, len, fontColor, fontType, fontSize, fontAlign, fontY);
}
- if( HPMHooks.count.HP_intif_broadcast2_post ) {
- int (*postHookFunc) (int retVal___, const char *mes, size_t *len, unsigned int *fontColor, short *fontType, short *fontSize, short *fontAlign, short *fontY);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_broadcast2_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_broadcast2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_broadcast2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mes, &len, &fontColor, &fontType, &fontSize, &fontAlign, &fontY);
+ retVal___ = postHookFunc(retVal___, mes, len, fontColor, fontType, fontSize, fontAlign, fontY);
}
}
return retVal___;
@@ -30721,14 +31191,14 @@ int HP_intif_broadcast2(const char *mes, size_t len, unsigned int fontColor, sho
int HP_intif_main_message(struct map_session_data *sd, const char *message) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_main_message_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *message);
+ if (HPMHooks.count.HP_intif_main_message_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_main_message_pre[hIndex].func;
- retVal___ = preHookFunc(sd, message);
+ retVal___ = preHookFunc(&sd, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30736,26 +31206,26 @@ int HP_intif_main_message(struct map_session_data *sd, const char *message) {
{
retVal___ = HPMHooks.source.intif.main_message(sd, message);
}
- if( HPMHooks.count.HP_intif_main_message_post ) {
+ if (HPMHooks.count.HP_intif_main_message_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_main_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_main_message_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, message);
}
}
return retVal___;
}
-int HP_intif_wis_message(struct map_session_data *sd, char *nick, char *mes, size_t mes_len) {
+int HP_intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_wis_message_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *nick, char *mes, size_t *mes_len);
+ if (HPMHooks.count.HP_intif_wis_message_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **nick, const char **mes, int *mes_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_wis_message_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nick, mes, &mes_len);
+ retVal___ = preHookFunc(&sd, &nick, &mes, &mes_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30763,11 +31233,11 @@ int HP_intif_wis_message(struct map_session_data *sd, char *nick, char *mes, siz
{
retVal___ = HPMHooks.source.intif.wis_message(sd, nick, mes, mes_len);
}
- if( HPMHooks.count.HP_intif_wis_message_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *nick, char *mes, size_t *mes_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_wis_message_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *nick, const char *mes, int mes_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_wis_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, nick, mes, &mes_len);
+ retVal___ = postHookFunc(retVal___, sd, nick, mes, mes_len);
}
}
return retVal___;
@@ -30775,14 +31245,14 @@ int HP_intif_wis_message(struct map_session_data *sd, char *nick, char *mes, siz
int HP_intif_wis_message_to_gm(char *Wisp_name, int permission, char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_wis_message_to_gm_pre ) {
- int (*preHookFunc) (char *Wisp_name, int *permission, char *mes);
+ if (HPMHooks.count.HP_intif_wis_message_to_gm_pre > 0) {
+ int (*preHookFunc) (char **Wisp_name, int *permission, char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_wis_message_to_gm_pre[hIndex].func;
- retVal___ = preHookFunc(Wisp_name, &permission, mes);
+ retVal___ = preHookFunc(&Wisp_name, &permission, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30790,11 +31260,11 @@ int HP_intif_wis_message_to_gm(char *Wisp_name, int permission, char *mes) {
{
retVal___ = HPMHooks.source.intif.wis_message_to_gm(Wisp_name, permission, mes);
}
- if( HPMHooks.count.HP_intif_wis_message_to_gm_post ) {
- int (*postHookFunc) (int retVal___, char *Wisp_name, int *permission, char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_wis_message_to_gm_post > 0) {
+ int (*postHookFunc) (int retVal___, char *Wisp_name, int permission, char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_wis_message_to_gm_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_wis_message_to_gm_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, Wisp_name, &permission, mes);
+ retVal___ = postHookFunc(retVal___, Wisp_name, permission, mes);
}
}
return retVal___;
@@ -30802,14 +31272,14 @@ int HP_intif_wis_message_to_gm(char *Wisp_name, int permission, char *mes) {
int HP_intif_saveregistry(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_saveregistry_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_intif_saveregistry_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_saveregistry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_saveregistry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_saveregistry_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30817,9 +31287,9 @@ int HP_intif_saveregistry(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.intif.saveregistry(sd);
}
- if( HPMHooks.count.HP_intif_saveregistry_post ) {
+ if (HPMHooks.count.HP_intif_saveregistry_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_saveregistry_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_saveregistry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_saveregistry_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -30829,14 +31299,14 @@ int HP_intif_saveregistry(struct map_session_data *sd) {
int HP_intif_request_registry(struct map_session_data *sd, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_request_registry_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_intif_request_registry_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_registry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_registry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_request_registry_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30844,26 +31314,78 @@ int HP_intif_request_registry(struct map_session_data *sd, int flag) {
{
retVal___ = HPMHooks.source.intif.request_registry(sd, flag);
}
- if( HPMHooks.count.HP_intif_request_registry_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_registry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_request_registry_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_registry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_request_registry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
}
+void HP_intif_request_account_storage(const struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_intif_request_account_storage_pre > 0) {
+ void (*preHookFunc) (const struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_account_storage_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_intif_request_account_storage_pre[hIndex].func;
+ preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.intif.request_account_storage(sd);
+ }
+ if (HPMHooks.count.HP_intif_request_account_storage_post > 0) {
+ void (*postHookFunc) (const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_account_storage_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_intif_request_account_storage_post[hIndex].func;
+ postHookFunc(sd);
+ }
+ }
+ return;
+}
+void HP_intif_send_account_storage(const struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_intif_send_account_storage_pre > 0) {
+ void (*preHookFunc) (const struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_account_storage_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_intif_send_account_storage_pre[hIndex].func;
+ preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.intif.send_account_storage(sd);
+ }
+ if (HPMHooks.count.HP_intif_send_account_storage_post > 0) {
+ void (*postHookFunc) (const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_account_storage_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_intif_send_account_storage_post[hIndex].func;
+ postHookFunc(sd);
+ }
+ }
+ return;
+}
int HP_intif_request_guild_storage(int account_id, int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_request_guild_storage_pre ) {
+ if (HPMHooks.count.HP_intif_request_guild_storage_pre > 0) {
int (*preHookFunc) (int *account_id, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_guild_storage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_guild_storage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_request_guild_storage_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30871,11 +31393,11 @@ int HP_intif_request_guild_storage(int account_id, int guild_id) {
{
retVal___ = HPMHooks.source.intif.request_guild_storage(account_id, guild_id);
}
- if( HPMHooks.count.HP_intif_request_guild_storage_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_guild_storage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_request_guild_storage_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_guild_storage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_request_guild_storage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &guild_id);
+ retVal___ = postHookFunc(retVal___, account_id, guild_id);
}
}
return retVal___;
@@ -30883,14 +31405,14 @@ int HP_intif_request_guild_storage(int account_id, int guild_id) {
int HP_intif_send_guild_storage(int account_id, struct guild_storage *gstor) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_send_guild_storage_pre ) {
- int (*preHookFunc) (int *account_id, struct guild_storage *gstor);
+ if (HPMHooks.count.HP_intif_send_guild_storage_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct guild_storage **gstor);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_guild_storage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_guild_storage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_send_guild_storage_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, gstor);
+ retVal___ = preHookFunc(&account_id, &gstor);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30898,26 +31420,26 @@ int HP_intif_send_guild_storage(int account_id, struct guild_storage *gstor) {
{
retVal___ = HPMHooks.source.intif.send_guild_storage(account_id, gstor);
}
- if( HPMHooks.count.HP_intif_send_guild_storage_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct guild_storage *gstor);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_guild_storage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_send_guild_storage_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct guild_storage *gstor);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_guild_storage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_send_guild_storage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, gstor);
+ retVal___ = postHookFunc(retVal___, account_id, gstor);
}
}
return retVal___;
}
-int HP_intif_create_party(struct party_member *member, char *name, int item, int item2) {
+int HP_intif_create_party(struct party_member *member, const char *name, int item, int item2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_create_party_pre ) {
- int (*preHookFunc) (struct party_member *member, char *name, int *item, int *item2);
+ if (HPMHooks.count.HP_intif_create_party_pre > 0) {
+ int (*preHookFunc) (struct party_member **member, const char **name, int *item, int *item2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_party_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_party_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_create_party_pre[hIndex].func;
- retVal___ = preHookFunc(member, name, &item, &item2);
+ retVal___ = preHookFunc(&member, &name, &item, &item2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30925,11 +31447,11 @@ int HP_intif_create_party(struct party_member *member, char *name, int item, int
{
retVal___ = HPMHooks.source.intif.create_party(member, name, item, item2);
}
- if( HPMHooks.count.HP_intif_create_party_post ) {
- int (*postHookFunc) (int retVal___, struct party_member *member, char *name, int *item, int *item2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_party_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_create_party_post > 0) {
+ int (*postHookFunc) (int retVal___, struct party_member *member, const char *name, int item, int item2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_create_party_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_create_party_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, member, name, &item, &item2);
+ retVal___ = postHookFunc(retVal___, member, name, item, item2);
}
}
return retVal___;
@@ -30937,14 +31459,14 @@ int HP_intif_create_party(struct party_member *member, char *name, int item, int
int HP_intif_request_partyinfo(int party_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_request_partyinfo_pre ) {
+ if (HPMHooks.count.HP_intif_request_partyinfo_pre > 0) {
int (*preHookFunc) (int *party_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_partyinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_partyinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_request_partyinfo_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30952,11 +31474,11 @@ int HP_intif_request_partyinfo(int party_id, int char_id) {
{
retVal___ = HPMHooks.source.intif.request_partyinfo(party_id, char_id);
}
- if( HPMHooks.count.HP_intif_request_partyinfo_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_partyinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_request_partyinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_partyinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_request_partyinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, char_id);
}
}
return retVal___;
@@ -30964,14 +31486,14 @@ int HP_intif_request_partyinfo(int party_id, int char_id) {
int HP_intif_party_addmember(int party_id, struct party_member *member) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_party_addmember_pre ) {
- int (*preHookFunc) (int *party_id, struct party_member *member);
+ if (HPMHooks.count.HP_intif_party_addmember_pre > 0) {
+ int (*preHookFunc) (int *party_id, struct party_member **member);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_addmember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_addmember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_party_addmember_pre[hIndex].func;
- retVal___ = preHookFunc(&party_id, member);
+ retVal___ = preHookFunc(&party_id, &member);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -30979,11 +31501,11 @@ int HP_intif_party_addmember(int party_id, struct party_member *member) {
{
retVal___ = HPMHooks.source.intif.party_addmember(party_id, member);
}
- if( HPMHooks.count.HP_intif_party_addmember_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, struct party_member *member);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_addmember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_party_addmember_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, struct party_member *member);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_addmember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_party_addmember_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, member);
+ retVal___ = postHookFunc(retVal___, party_id, member);
}
}
return retVal___;
@@ -30991,14 +31513,14 @@ int HP_intif_party_addmember(int party_id, struct party_member *member) {
int HP_intif_party_changeoption(int party_id, int account_id, int exp, int item) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_party_changeoption_pre ) {
+ if (HPMHooks.count.HP_intif_party_changeoption_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *exp, int *item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changeoption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changeoption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_party_changeoption_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &exp, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31006,11 +31528,11 @@ int HP_intif_party_changeoption(int party_id, int account_id, int exp, int item)
{
retVal___ = HPMHooks.source.intif.party_changeoption(party_id, account_id, exp, item);
}
- if( HPMHooks.count.HP_intif_party_changeoption_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *exp, int *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changeoption_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_party_changeoption_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int exp, int item);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changeoption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_party_changeoption_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &exp, &item);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, exp, item);
}
}
return retVal___;
@@ -31018,14 +31540,14 @@ int HP_intif_party_changeoption(int party_id, int account_id, int exp, int item)
int HP_intif_party_leave(int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_party_leave_pre ) {
+ if (HPMHooks.count.HP_intif_party_leave_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_party_leave_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31033,11 +31555,11 @@ int HP_intif_party_leave(int party_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.intif.party_leave(party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_intif_party_leave_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_party_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_party_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id);
}
}
return retVal___;
@@ -31045,14 +31567,14 @@ int HP_intif_party_leave(int party_id, int account_id, int char_id) {
int HP_intif_party_changemap(struct map_session_data *sd, int online) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_party_changemap_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *online);
+ if (HPMHooks.count.HP_intif_party_changemap_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *online);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_party_changemap_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &online);
+ retVal___ = preHookFunc(&sd, &online);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31060,11 +31582,11 @@ int HP_intif_party_changemap(struct map_session_data *sd, int online) {
{
retVal___ = HPMHooks.source.intif.party_changemap(sd, online);
}
- if( HPMHooks.count.HP_intif_party_changemap_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *online);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_party_changemap_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int online);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_changemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_party_changemap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &online);
+ retVal___ = postHookFunc(retVal___, sd, online);
}
}
return retVal___;
@@ -31072,14 +31594,14 @@ int HP_intif_party_changemap(struct map_session_data *sd, int online) {
int HP_intif_break_party(int party_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_break_party_pre ) {
+ if (HPMHooks.count.HP_intif_break_party_pre > 0) {
int (*preHookFunc) (int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_break_party_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_break_party_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_break_party_pre[hIndex].func;
retVal___ = preHookFunc(&party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31087,11 +31609,11 @@ int HP_intif_break_party(int party_id) {
{
retVal___ = HPMHooks.source.intif.break_party(party_id);
}
- if( HPMHooks.count.HP_intif_break_party_post ) {
- int (*postHookFunc) (int retVal___, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_break_party_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_break_party_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_break_party_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_break_party_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id);
+ retVal___ = postHookFunc(retVal___, party_id);
}
}
return retVal___;
@@ -31099,14 +31621,14 @@ int HP_intif_break_party(int party_id) {
int HP_intif_party_message(int party_id, int account_id, const char *mes, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_party_message_pre ) {
- int (*preHookFunc) (int *party_id, int *account_id, const char *mes, int *len);
+ if (HPMHooks.count.HP_intif_party_message_pre > 0) {
+ int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_party_message_pre[hIndex].func;
- retVal___ = preHookFunc(&party_id, &account_id, mes, &len);
+ retVal___ = preHookFunc(&party_id, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31114,11 +31636,11 @@ int HP_intif_party_message(int party_id, int account_id, const char *mes, int le
{
retVal___ = HPMHooks.source.intif.party_message(party_id, account_id, mes, len);
}
- if( HPMHooks.count.HP_intif_party_message_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_party_message_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_party_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, mes, &len);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len);
}
}
return retVal___;
@@ -31126,14 +31648,14 @@ int HP_intif_party_message(int party_id, int account_id, const char *mes, int le
int HP_intif_party_leaderchange(int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_party_leaderchange_pre ) {
+ if (HPMHooks.count.HP_intif_party_leaderchange_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leaderchange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leaderchange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_party_leaderchange_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31141,11 +31663,11 @@ int HP_intif_party_leaderchange(int party_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.intif.party_leaderchange(party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_intif_party_leaderchange_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leaderchange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_party_leaderchange_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_party_leaderchange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_party_leaderchange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id);
}
}
return retVal___;
@@ -31153,14 +31675,14 @@ int HP_intif_party_leaderchange(int party_id, int account_id, int char_id) {
int HP_intif_guild_create(const char *name, const struct guild_member *master) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_create_pre ) {
- int (*preHookFunc) (const char *name, const struct guild_member *master);
+ if (HPMHooks.count.HP_intif_guild_create_pre > 0) {
+ int (*preHookFunc) (const char **name, const struct guild_member **master);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_create_pre[hIndex].func;
- retVal___ = preHookFunc(name, master);
+ retVal___ = preHookFunc(&name, &master);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31168,9 +31690,9 @@ int HP_intif_guild_create(const char *name, const struct guild_member *master) {
{
retVal___ = HPMHooks.source.intif.guild_create(name, master);
}
- if( HPMHooks.count.HP_intif_guild_create_post ) {
+ if (HPMHooks.count.HP_intif_guild_create_post > 0) {
int (*postHookFunc) (int retVal___, const char *name, const struct guild_member *master);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_create_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name, master);
}
@@ -31180,14 +31702,14 @@ int HP_intif_guild_create(const char *name, const struct guild_member *master) {
int HP_intif_guild_request_info(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_request_info_pre ) {
+ if (HPMHooks.count.HP_intif_guild_request_info_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_request_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_request_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_request_info_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31195,11 +31717,11 @@ int HP_intif_guild_request_info(int guild_id) {
{
retVal___ = HPMHooks.source.intif.guild_request_info(guild_id);
}
- if( HPMHooks.count.HP_intif_guild_request_info_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_request_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_request_info_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_request_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_request_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -31207,14 +31729,14 @@ int HP_intif_guild_request_info(int guild_id) {
int HP_intif_guild_addmember(int guild_id, struct guild_member *m) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_addmember_pre ) {
- int (*preHookFunc) (int *guild_id, struct guild_member *m);
+ if (HPMHooks.count.HP_intif_guild_addmember_pre > 0) {
+ int (*preHookFunc) (int *guild_id, struct guild_member **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_addmember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_addmember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_addmember_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, m);
+ retVal___ = preHookFunc(&guild_id, &m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31222,11 +31744,11 @@ int HP_intif_guild_addmember(int guild_id, struct guild_member *m) {
{
retVal___ = HPMHooks.source.intif.guild_addmember(guild_id, m);
}
- if( HPMHooks.count.HP_intif_guild_addmember_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, struct guild_member *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_addmember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_addmember_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, struct guild_member *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_addmember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_addmember_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, m);
+ retVal___ = postHookFunc(retVal___, guild_id, m);
}
}
return retVal___;
@@ -31234,14 +31756,14 @@ int HP_intif_guild_addmember(int guild_id, struct guild_member *m) {
int HP_intif_guild_leave(int guild_id, int account_id, int char_id, int flag, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_leave_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag, const char *mes);
+ if (HPMHooks.count.HP_intif_guild_leave_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *flag, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_leave_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag, mes);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &flag, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31249,38 +31771,38 @@ int HP_intif_guild_leave(int guild_id, int account_id, int char_id, int flag, co
{
retVal___ = HPMHooks.source.intif.guild_leave(guild_id, account_id, char_id, flag, mes);
}
- if( HPMHooks.count.HP_intif_guild_leave_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *flag, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_leave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_leave_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int flag, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_leave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &flag, mes);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, flag, mes);
}
}
return retVal___;
}
-int HP_intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int class_) {
+int HP_intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_memberinfoshort_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int *class_);
+ if (HPMHooks.count.HP_intif_guild_memberinfoshort_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_memberinfoshort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_memberinfoshort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_memberinfoshort_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &online, &lv, &class_);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &online, &lv, &class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.intif.guild_memberinfoshort(guild_id, account_id, char_id, online, lv, class_);
+ retVal___ = HPMHooks.source.intif.guild_memberinfoshort(guild_id, account_id, char_id, online, lv, class);
}
- if( HPMHooks.count.HP_intif_guild_memberinfoshort_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *online, int *lv, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_memberinfoshort_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_memberinfoshort_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_memberinfoshort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_memberinfoshort_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &online, &lv, &class_);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, online, lv, class);
}
}
return retVal___;
@@ -31288,14 +31810,14 @@ int HP_intif_guild_memberinfoshort(int guild_id, int account_id, int char_id, in
int HP_intif_guild_break(int guild_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_break_pre ) {
+ if (HPMHooks.count.HP_intif_guild_break_pre > 0) {
int (*preHookFunc) (int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_break_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_break_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_break_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31303,11 +31825,11 @@ int HP_intif_guild_break(int guild_id) {
{
retVal___ = HPMHooks.source.intif.guild_break(guild_id);
}
- if( HPMHooks.count.HP_intif_guild_break_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_break_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_break_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_break_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_break_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id);
+ retVal___ = postHookFunc(retVal___, guild_id);
}
}
return retVal___;
@@ -31315,14 +31837,14 @@ int HP_intif_guild_break(int guild_id) {
int HP_intif_guild_message(int guild_id, int account_id, const char *mes, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_message_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, const char *mes, int *len);
+ if (HPMHooks.count.HP_intif_guild_message_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_message_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, mes, &len);
+ retVal___ = preHookFunc(&guild_id, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31330,26 +31852,26 @@ int HP_intif_guild_message(int guild_id, int account_id, const char *mes, int le
{
retVal___ = HPMHooks.source.intif.guild_message(guild_id, account_id, mes, len);
}
- if( HPMHooks.count.HP_intif_guild_message_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_message_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, mes, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, mes, len);
}
}
return retVal___;
}
-int HP_intif_guild_change_gm(int guild_id, const char *name, size_t len) {
+int HP_intif_guild_change_gm(int guild_id, const char *name, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_change_gm_pre ) {
- int (*preHookFunc) (int *guild_id, const char *name, size_t *len);
+ if (HPMHooks.count.HP_intif_guild_change_gm_pre > 0) {
+ int (*preHookFunc) (int *guild_id, const char **name, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_gm_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_gm_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_change_gm_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, name, &len);
+ retVal___ = preHookFunc(&guild_id, &name, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31357,11 +31879,11 @@ int HP_intif_guild_change_gm(int guild_id, const char *name, size_t len) {
{
retVal___ = HPMHooks.source.intif.guild_change_gm(guild_id, name, len);
}
- if( HPMHooks.count.HP_intif_guild_change_gm_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, const char *name, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_gm_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_change_gm_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, const char *name, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_gm_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_change_gm_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, name, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, name, len);
}
}
return retVal___;
@@ -31369,14 +31891,14 @@ int HP_intif_guild_change_gm(int guild_id, const char *name, size_t len) {
int HP_intif_guild_change_basicinfo(int guild_id, int type, const void *data, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_change_basicinfo_pre ) {
- int (*preHookFunc) (int *guild_id, int *type, const void *data, int *len);
+ if (HPMHooks.count.HP_intif_guild_change_basicinfo_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *type, const void **data, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_basicinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_basicinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_change_basicinfo_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &type, data, &len);
+ retVal___ = preHookFunc(&guild_id, &type, &data, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31384,11 +31906,11 @@ int HP_intif_guild_change_basicinfo(int guild_id, int type, const void *data, in
{
retVal___ = HPMHooks.source.intif.guild_change_basicinfo(guild_id, type, data, len);
}
- if( HPMHooks.count.HP_intif_guild_change_basicinfo_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *type, const void *data, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_basicinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_change_basicinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int type, const void *data, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_basicinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_change_basicinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &type, data, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, type, data, len);
}
}
return retVal___;
@@ -31396,14 +31918,14 @@ int HP_intif_guild_change_basicinfo(int guild_id, int type, const void *data, in
int HP_intif_guild_change_memberinfo(int guild_id, int account_id, int char_id, int type, const void *data, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_change_memberinfo_pre ) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *type, const void *data, int *len);
+ if (HPMHooks.count.HP_intif_guild_change_memberinfo_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *type, const void **data, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_memberinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_memberinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_change_memberinfo_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &type, data, &len);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &type, &data, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31411,11 +31933,11 @@ int HP_intif_guild_change_memberinfo(int guild_id, int account_id, int char_id,
{
retVal___ = HPMHooks.source.intif.guild_change_memberinfo(guild_id, account_id, char_id, type, data, len);
}
- if( HPMHooks.count.HP_intif_guild_change_memberinfo_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *account_id, int *char_id, int *type, const void *data, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_memberinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_change_memberinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int type, const void *data, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_change_memberinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_change_memberinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &account_id, &char_id, &type, data, &len);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, type, data, len);
}
}
return retVal___;
@@ -31423,14 +31945,14 @@ int HP_intif_guild_change_memberinfo(int guild_id, int account_id, int char_id,
int HP_intif_guild_position(int guild_id, int idx, struct guild_position *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_position_pre ) {
- int (*preHookFunc) (int *guild_id, int *idx, struct guild_position *p);
+ if (HPMHooks.count.HP_intif_guild_position_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *idx, struct guild_position **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_position_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_position_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_position_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &idx, p);
+ retVal___ = preHookFunc(&guild_id, &idx, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31438,11 +31960,11 @@ int HP_intif_guild_position(int guild_id, int idx, struct guild_position *p) {
{
retVal___ = HPMHooks.source.intif.guild_position(guild_id, idx, p);
}
- if( HPMHooks.count.HP_intif_guild_position_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *idx, struct guild_position *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_position_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_position_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int idx, struct guild_position *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_position_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_position_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &idx, p);
+ retVal___ = postHookFunc(retVal___, guild_id, idx, p);
}
}
return retVal___;
@@ -31450,14 +31972,14 @@ int HP_intif_guild_position(int guild_id, int idx, struct guild_position *p) {
int HP_intif_guild_skillup(int guild_id, uint16 skill_id, int account_id, int max) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_skillup_pre ) {
+ if (HPMHooks.count.HP_intif_guild_skillup_pre > 0) {
int (*preHookFunc) (int *guild_id, uint16 *skill_id, int *account_id, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_skillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_skillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_skillup_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id, &skill_id, &account_id, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31465,11 +31987,11 @@ int HP_intif_guild_skillup(int guild_id, uint16 skill_id, int account_id, int ma
{
retVal___ = HPMHooks.source.intif.guild_skillup(guild_id, skill_id, account_id, max);
}
- if( HPMHooks.count.HP_intif_guild_skillup_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, uint16 *skill_id, int *account_id, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_skillup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_skillup_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, uint16 skill_id, int account_id, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_skillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_skillup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &skill_id, &account_id, &max);
+ retVal___ = postHookFunc(retVal___, guild_id, skill_id, account_id, max);
}
}
return retVal___;
@@ -31477,14 +31999,14 @@ int HP_intif_guild_skillup(int guild_id, uint16 skill_id, int account_id, int ma
int HP_intif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int account_id2, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_alliance_pre ) {
+ if (HPMHooks.count.HP_intif_guild_alliance_pre > 0) {
int (*preHookFunc) (int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_alliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_alliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_alliance_pre[hIndex].func;
retVal___ = preHookFunc(&guild_id1, &guild_id2, &account_id1, &account_id2, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31492,11 +32014,11 @@ int HP_intif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int a
{
retVal___ = HPMHooks.source.intif.guild_alliance(guild_id1, guild_id2, account_id1, account_id2, flag);
}
- if( HPMHooks.count.HP_intif_guild_alliance_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id1, int *guild_id2, int *account_id1, int *account_id2, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_alliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_alliance_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_alliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_alliance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id1, &guild_id2, &account_id1, &account_id2, &flag);
+ retVal___ = postHookFunc(retVal___, guild_id1, guild_id2, account_id1, account_id2, flag);
}
}
return retVal___;
@@ -31504,14 +32026,14 @@ int HP_intif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int a
int HP_intif_guild_notice(int guild_id, const char *mes1, const char *mes2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_notice_pre ) {
- int (*preHookFunc) (int *guild_id, const char *mes1, const char *mes2);
+ if (HPMHooks.count.HP_intif_guild_notice_pre > 0) {
+ int (*preHookFunc) (int *guild_id, const char **mes1, const char **mes2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_notice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_notice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_notice_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, mes1, mes2);
+ retVal___ = preHookFunc(&guild_id, &mes1, &mes2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31519,11 +32041,11 @@ int HP_intif_guild_notice(int guild_id, const char *mes1, const char *mes2) {
{
retVal___ = HPMHooks.source.intif.guild_notice(guild_id, mes1, mes2);
}
- if( HPMHooks.count.HP_intif_guild_notice_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, const char *mes1, const char *mes2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_notice_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_notice_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, const char *mes1, const char *mes2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_notice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_notice_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, mes1, mes2);
+ retVal___ = postHookFunc(retVal___, guild_id, mes1, mes2);
}
}
return retVal___;
@@ -31531,14 +32053,14 @@ int HP_intif_guild_notice(int guild_id, const char *mes1, const char *mes2) {
int HP_intif_guild_emblem(int guild_id, int len, const char *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_emblem_pre ) {
- int (*preHookFunc) (int *guild_id, int *len, const char *data);
+ if (HPMHooks.count.HP_intif_guild_emblem_pre > 0) {
+ int (*preHookFunc) (int *guild_id, int *len, const char **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_emblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_emblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_emblem_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &len, data);
+ retVal___ = preHookFunc(&guild_id, &len, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31546,11 +32068,11 @@ int HP_intif_guild_emblem(int guild_id, int len, const char *data) {
{
retVal___ = HPMHooks.source.intif.guild_emblem(guild_id, len, data);
}
- if( HPMHooks.count.HP_intif_guild_emblem_post ) {
- int (*postHookFunc) (int retVal___, int *guild_id, int *len, const char *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_emblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_emblem_post > 0) {
+ int (*postHookFunc) (int retVal___, int guild_id, int len, const char *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_emblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_emblem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &guild_id, &len, data);
+ retVal___ = postHookFunc(retVal___, guild_id, len, data);
}
}
return retVal___;
@@ -31558,14 +32080,14 @@ int HP_intif_guild_emblem(int guild_id, int len, const char *data) {
int HP_intif_guild_castle_dataload(int num, int *castle_ids) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_castle_dataload_pre ) {
- int (*preHookFunc) (int *num, int *castle_ids);
+ if (HPMHooks.count.HP_intif_guild_castle_dataload_pre > 0) {
+ int (*preHookFunc) (int *num, int **castle_ids);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_dataload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_dataload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_castle_dataload_pre[hIndex].func;
- retVal___ = preHookFunc(&num, castle_ids);
+ retVal___ = preHookFunc(&num, &castle_ids);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31573,11 +32095,11 @@ int HP_intif_guild_castle_dataload(int num, int *castle_ids) {
{
retVal___ = HPMHooks.source.intif.guild_castle_dataload(num, castle_ids);
}
- if( HPMHooks.count.HP_intif_guild_castle_dataload_post ) {
- int (*postHookFunc) (int retVal___, int *num, int *castle_ids);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_dataload_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_castle_dataload_post > 0) {
+ int (*postHookFunc) (int retVal___, int num, int *castle_ids);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_dataload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_castle_dataload_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &num, castle_ids);
+ retVal___ = postHookFunc(retVal___, num, castle_ids);
}
}
return retVal___;
@@ -31585,14 +32107,14 @@ int HP_intif_guild_castle_dataload(int num, int *castle_ids) {
int HP_intif_guild_castle_datasave(int castle_id, int index, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_guild_castle_datasave_pre ) {
+ if (HPMHooks.count.HP_intif_guild_castle_datasave_pre > 0) {
int (*preHookFunc) (int *castle_id, int *index, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_datasave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_datasave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_guild_castle_datasave_pre[hIndex].func;
retVal___ = preHookFunc(&castle_id, &index, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31600,25 +32122,25 @@ int HP_intif_guild_castle_datasave(int castle_id, int index, int value) {
{
retVal___ = HPMHooks.source.intif.guild_castle_datasave(castle_id, index, value);
}
- if( HPMHooks.count.HP_intif_guild_castle_datasave_post ) {
- int (*postHookFunc) (int retVal___, int *castle_id, int *index, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_datasave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_guild_castle_datasave_post > 0) {
+ int (*postHookFunc) (int retVal___, int castle_id, int index, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_guild_castle_datasave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_guild_castle_datasave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &castle_id, &index, &value);
+ retVal___ = postHookFunc(retVal___, castle_id, index, value);
}
}
return retVal___;
}
void HP_intif_itembound_req(int char_id, int aid, int guild_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_itembound_req_pre ) {
+ if (HPMHooks.count.HP_intif_itembound_req_pre > 0) {
void (*preHookFunc) (int *char_id, int *aid, int *guild_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_itembound_req_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_itembound_req_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_itembound_req_pre[hIndex].func;
preHookFunc(&char_id, &aid, &guild_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -31626,11 +32148,11 @@ void HP_intif_itembound_req(int char_id, int aid, int guild_id) {
{
HPMHooks.source.intif.itembound_req(char_id, aid, guild_id);
}
- if( HPMHooks.count.HP_intif_itembound_req_post ) {
- void (*postHookFunc) (int *char_id, int *aid, int *guild_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_itembound_req_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_itembound_req_post > 0) {
+ void (*postHookFunc) (int char_id, int aid, int guild_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_itembound_req_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_itembound_req_post[hIndex].func;
- postHookFunc(&char_id, &aid, &guild_id);
+ postHookFunc(char_id, aid, guild_id);
}
}
return;
@@ -31638,14 +32160,14 @@ void HP_intif_itembound_req(int char_id, int aid, int guild_id) {
int HP_intif_request_petdata(int account_id, int char_id, int pet_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_request_petdata_pre ) {
+ if (HPMHooks.count.HP_intif_request_petdata_pre > 0) {
int (*preHookFunc) (int *account_id, int *char_id, int *pet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_petdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_petdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_request_petdata_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &char_id, &pet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31653,11 +32175,11 @@ int HP_intif_request_petdata(int account_id, int char_id, int pet_id) {
{
retVal___ = HPMHooks.source.intif.request_petdata(account_id, char_id, pet_id);
}
- if( HPMHooks.count.HP_intif_request_petdata_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, int *char_id, int *pet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_petdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_request_petdata_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, int char_id, int pet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_petdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_request_petdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &char_id, &pet_id);
+ retVal___ = postHookFunc(retVal___, account_id, char_id, pet_id);
}
}
return retVal___;
@@ -31665,14 +32187,14 @@ int HP_intif_request_petdata(int account_id, int char_id, int pet_id) {
int HP_intif_save_petdata(int account_id, struct s_pet *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_save_petdata_pre ) {
- int (*preHookFunc) (int *account_id, struct s_pet *p);
+ if (HPMHooks.count.HP_intif_save_petdata_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct s_pet **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_save_petdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_save_petdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_save_petdata_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, p);
+ retVal___ = preHookFunc(&account_id, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31680,11 +32202,11 @@ int HP_intif_save_petdata(int account_id, struct s_pet *p) {
{
retVal___ = HPMHooks.source.intif.save_petdata(account_id, p);
}
- if( HPMHooks.count.HP_intif_save_petdata_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct s_pet *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_save_petdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_save_petdata_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct s_pet *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_save_petdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_save_petdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, p);
+ retVal___ = postHookFunc(retVal___, account_id, p);
}
}
return retVal___;
@@ -31692,14 +32214,14 @@ int HP_intif_save_petdata(int account_id, struct s_pet *p) {
int HP_intif_delete_petdata(int pet_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_delete_petdata_pre ) {
+ if (HPMHooks.count.HP_intif_delete_petdata_pre > 0) {
int (*preHookFunc) (int *pet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_delete_petdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_delete_petdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_delete_petdata_pre[hIndex].func;
retVal___ = preHookFunc(&pet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31707,26 +32229,26 @@ int HP_intif_delete_petdata(int pet_id) {
{
retVal___ = HPMHooks.source.intif.delete_petdata(pet_id);
}
- if( HPMHooks.count.HP_intif_delete_petdata_post ) {
- int (*postHookFunc) (int retVal___, int *pet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_delete_petdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_delete_petdata_post > 0) {
+ int (*postHookFunc) (int retVal___, int pet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_delete_petdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_delete_petdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &pet_id);
+ retVal___ = postHookFunc(retVal___, pet_id);
}
}
return retVal___;
}
-int HP_intif_rename(struct map_session_data *sd, int type, char *name) {
+int HP_intif_rename(struct map_session_data *sd, int type, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_rename_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, char *name);
+ if (HPMHooks.count.HP_intif_rename_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_rename_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_rename_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_rename_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, name);
+ retVal___ = preHookFunc(&sd, &type, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31734,11 +32256,11 @@ int HP_intif_rename(struct map_session_data *sd, int type, char *name) {
{
retVal___ = HPMHooks.source.intif.rename(sd, type, name);
}
- if( HPMHooks.count.HP_intif_rename_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_rename_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_rename_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_rename_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_rename_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, name);
+ retVal___ = postHookFunc(retVal___, sd, type, name);
}
}
return retVal___;
@@ -31746,14 +32268,14 @@ int HP_intif_rename(struct map_session_data *sd, int type, char *name) {
int HP_intif_homunculus_create(int account_id, struct s_homunculus *sh) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_homunculus_create_pre ) {
- int (*preHookFunc) (int *account_id, struct s_homunculus *sh);
+ if (HPMHooks.count.HP_intif_homunculus_create_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct s_homunculus **sh);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_homunculus_create_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, sh);
+ retVal___ = preHookFunc(&account_id, &sh);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31761,11 +32283,11 @@ int HP_intif_homunculus_create(int account_id, struct s_homunculus *sh) {
{
retVal___ = HPMHooks.source.intif.homunculus_create(account_id, sh);
}
- if( HPMHooks.count.HP_intif_homunculus_create_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct s_homunculus *sh);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_homunculus_create_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct s_homunculus *sh);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_homunculus_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, sh);
+ retVal___ = postHookFunc(retVal___, account_id, sh);
}
}
return retVal___;
@@ -31773,14 +32295,14 @@ int HP_intif_homunculus_create(int account_id, struct s_homunculus *sh) {
bool HP_intif_homunculus_requestload(int account_id, int homun_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_intif_homunculus_requestload_pre ) {
+ if (HPMHooks.count.HP_intif_homunculus_requestload_pre > 0) {
bool (*preHookFunc) (int *account_id, int *homun_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_homunculus_requestload_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &homun_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31788,11 +32310,11 @@ bool HP_intif_homunculus_requestload(int account_id, int homun_id) {
{
retVal___ = HPMHooks.source.intif.homunculus_requestload(account_id, homun_id);
}
- if( HPMHooks.count.HP_intif_homunculus_requestload_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, int *homun_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestload_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_homunculus_requestload_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, int homun_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_homunculus_requestload_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &homun_id);
+ retVal___ = postHookFunc(retVal___, account_id, homun_id);
}
}
return retVal___;
@@ -31800,14 +32322,14 @@ bool HP_intif_homunculus_requestload(int account_id, int homun_id) {
int HP_intif_homunculus_requestsave(int account_id, struct s_homunculus *sh) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_homunculus_requestsave_pre ) {
- int (*preHookFunc) (int *account_id, struct s_homunculus *sh);
+ if (HPMHooks.count.HP_intif_homunculus_requestsave_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct s_homunculus **sh);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestsave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestsave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_homunculus_requestsave_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, sh);
+ retVal___ = preHookFunc(&account_id, &sh);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31815,11 +32337,11 @@ int HP_intif_homunculus_requestsave(int account_id, struct s_homunculus *sh) {
{
retVal___ = HPMHooks.source.intif.homunculus_requestsave(account_id, sh);
}
- if( HPMHooks.count.HP_intif_homunculus_requestsave_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct s_homunculus *sh);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestsave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_homunculus_requestsave_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct s_homunculus *sh);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestsave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_homunculus_requestsave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, sh);
+ retVal___ = postHookFunc(retVal___, account_id, sh);
}
}
return retVal___;
@@ -31827,14 +32349,14 @@ int HP_intif_homunculus_requestsave(int account_id, struct s_homunculus *sh) {
int HP_intif_homunculus_requestdelete(int homun_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_homunculus_requestdelete_pre ) {
+ if (HPMHooks.count.HP_intif_homunculus_requestdelete_pre > 0) {
int (*preHookFunc) (int *homun_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestdelete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestdelete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_homunculus_requestdelete_pre[hIndex].func;
retVal___ = preHookFunc(&homun_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31842,25 +32364,25 @@ int HP_intif_homunculus_requestdelete(int homun_id) {
{
retVal___ = HPMHooks.source.intif.homunculus_requestdelete(homun_id);
}
- if( HPMHooks.count.HP_intif_homunculus_requestdelete_post ) {
- int (*postHookFunc) (int retVal___, int *homun_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestdelete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_homunculus_requestdelete_post > 0) {
+ int (*postHookFunc) (int retVal___, int homun_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_homunculus_requestdelete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_homunculus_requestdelete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &homun_id);
+ retVal___ = postHookFunc(retVal___, homun_id);
}
}
return retVal___;
}
void HP_intif_request_questlog(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_request_questlog_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_intif_request_questlog_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_questlog_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_questlog_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_request_questlog_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -31868,9 +32390,9 @@ void HP_intif_request_questlog(struct map_session_data *sd) {
{
HPMHooks.source.intif.request_questlog(sd);
}
- if( HPMHooks.count.HP_intif_request_questlog_post ) {
+ if (HPMHooks.count.HP_intif_request_questlog_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_questlog_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_questlog_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_request_questlog_post[hIndex].func;
postHookFunc(sd);
}
@@ -31880,14 +32402,14 @@ void HP_intif_request_questlog(struct map_session_data *sd) {
int HP_intif_quest_save(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_quest_save_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_intif_quest_save_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_quest_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_quest_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_quest_save_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31895,9 +32417,9 @@ int HP_intif_quest_save(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.intif.quest_save(sd);
}
- if( HPMHooks.count.HP_intif_quest_save_post ) {
+ if (HPMHooks.count.HP_intif_quest_save_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_quest_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_quest_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_quest_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -31907,14 +32429,14 @@ int HP_intif_quest_save(struct map_session_data *sd) {
int HP_intif_mercenary_create(struct s_mercenary *merc) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_mercenary_create_pre ) {
- int (*preHookFunc) (struct s_mercenary *merc);
+ if (HPMHooks.count.HP_intif_mercenary_create_pre > 0) {
+ int (*preHookFunc) (struct s_mercenary **merc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_mercenary_create_pre[hIndex].func;
- retVal___ = preHookFunc(merc);
+ retVal___ = preHookFunc(&merc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31922,9 +32444,9 @@ int HP_intif_mercenary_create(struct s_mercenary *merc) {
{
retVal___ = HPMHooks.source.intif.mercenary_create(merc);
}
- if( HPMHooks.count.HP_intif_mercenary_create_post ) {
+ if (HPMHooks.count.HP_intif_mercenary_create_post > 0) {
int (*postHookFunc) (int retVal___, struct s_mercenary *merc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_create_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_mercenary_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___, merc);
}
@@ -31934,14 +32456,14 @@ int HP_intif_mercenary_create(struct s_mercenary *merc) {
int HP_intif_mercenary_request(int merc_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_mercenary_request_pre ) {
+ if (HPMHooks.count.HP_intif_mercenary_request_pre > 0) {
int (*preHookFunc) (int *merc_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_mercenary_request_pre[hIndex].func;
retVal___ = preHookFunc(&merc_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31949,11 +32471,11 @@ int HP_intif_mercenary_request(int merc_id, int char_id) {
{
retVal___ = HPMHooks.source.intif.mercenary_request(merc_id, char_id);
}
- if( HPMHooks.count.HP_intif_mercenary_request_post ) {
- int (*postHookFunc) (int retVal___, int *merc_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_mercenary_request_post > 0) {
+ int (*postHookFunc) (int retVal___, int merc_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_mercenary_request_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &merc_id, &char_id);
+ retVal___ = postHookFunc(retVal___, merc_id, char_id);
}
}
return retVal___;
@@ -31961,14 +32483,14 @@ int HP_intif_mercenary_request(int merc_id, int char_id) {
int HP_intif_mercenary_delete(int merc_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_mercenary_delete_pre ) {
+ if (HPMHooks.count.HP_intif_mercenary_delete_pre > 0) {
int (*preHookFunc) (int *merc_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_mercenary_delete_pre[hIndex].func;
retVal___ = preHookFunc(&merc_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -31976,11 +32498,11 @@ int HP_intif_mercenary_delete(int merc_id) {
{
retVal___ = HPMHooks.source.intif.mercenary_delete(merc_id);
}
- if( HPMHooks.count.HP_intif_mercenary_delete_post ) {
- int (*postHookFunc) (int retVal___, int *merc_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_mercenary_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int merc_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_mercenary_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &merc_id);
+ retVal___ = postHookFunc(retVal___, merc_id);
}
}
return retVal___;
@@ -31988,14 +32510,14 @@ int HP_intif_mercenary_delete(int merc_id) {
int HP_intif_mercenary_save(struct s_mercenary *merc) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_mercenary_save_pre ) {
- int (*preHookFunc) (struct s_mercenary *merc);
+ if (HPMHooks.count.HP_intif_mercenary_save_pre > 0) {
+ int (*preHookFunc) (struct s_mercenary **merc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_mercenary_save_pre[hIndex].func;
- retVal___ = preHookFunc(merc);
+ retVal___ = preHookFunc(&merc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32003,9 +32525,9 @@ int HP_intif_mercenary_save(struct s_mercenary *merc) {
{
retVal___ = HPMHooks.source.intif.mercenary_save(merc);
}
- if( HPMHooks.count.HP_intif_mercenary_save_post ) {
+ if (HPMHooks.count.HP_intif_mercenary_save_post > 0) {
int (*postHookFunc) (int retVal___, struct s_mercenary *merc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_mercenary_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_mercenary_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, merc);
}
@@ -32015,14 +32537,14 @@ int HP_intif_mercenary_save(struct s_mercenary *merc) {
int HP_intif_Mail_requestinbox(int char_id, unsigned char flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Mail_requestinbox_pre ) {
+ if (HPMHooks.count.HP_intif_Mail_requestinbox_pre > 0) {
int (*preHookFunc) (int *char_id, unsigned char *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_requestinbox_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_requestinbox_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Mail_requestinbox_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32030,11 +32552,11 @@ int HP_intif_Mail_requestinbox(int char_id, unsigned char flag) {
{
retVal___ = HPMHooks.source.intif.Mail_requestinbox(char_id, flag);
}
- if( HPMHooks.count.HP_intif_Mail_requestinbox_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, unsigned char *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_requestinbox_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Mail_requestinbox_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, unsigned char flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_requestinbox_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Mail_requestinbox_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &flag);
+ retVal___ = postHookFunc(retVal___, char_id, flag);
}
}
return retVal___;
@@ -32042,14 +32564,14 @@ int HP_intif_Mail_requestinbox(int char_id, unsigned char flag) {
int HP_intif_Mail_read(int mail_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Mail_read_pre ) {
+ if (HPMHooks.count.HP_intif_Mail_read_pre > 0) {
int (*preHookFunc) (int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Mail_read_pre[hIndex].func;
retVal___ = preHookFunc(&mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32057,11 +32579,11 @@ int HP_intif_Mail_read(int mail_id) {
{
retVal___ = HPMHooks.source.intif.Mail_read(mail_id);
}
- if( HPMHooks.count.HP_intif_Mail_read_post ) {
- int (*postHookFunc) (int retVal___, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Mail_read_post > 0) {
+ int (*postHookFunc) (int retVal___, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Mail_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &mail_id);
+ retVal___ = postHookFunc(retVal___, mail_id);
}
}
return retVal___;
@@ -32069,14 +32591,14 @@ int HP_intif_Mail_read(int mail_id) {
int HP_intif_Mail_getattach(int char_id, int mail_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Mail_getattach_pre ) {
+ if (HPMHooks.count.HP_intif_Mail_getattach_pre > 0) {
int (*preHookFunc) (int *char_id, int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_getattach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_getattach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Mail_getattach_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32084,11 +32606,11 @@ int HP_intif_Mail_getattach(int char_id, int mail_id) {
{
retVal___ = HPMHooks.source.intif.Mail_getattach(char_id, mail_id);
}
- if( HPMHooks.count.HP_intif_Mail_getattach_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_getattach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Mail_getattach_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_getattach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Mail_getattach_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &mail_id);
+ retVal___ = postHookFunc(retVal___, char_id, mail_id);
}
}
return retVal___;
@@ -32096,14 +32618,14 @@ int HP_intif_Mail_getattach(int char_id, int mail_id) {
int HP_intif_Mail_delete(int char_id, int mail_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Mail_delete_pre ) {
+ if (HPMHooks.count.HP_intif_Mail_delete_pre > 0) {
int (*preHookFunc) (int *char_id, int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Mail_delete_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32111,11 +32633,11 @@ int HP_intif_Mail_delete(int char_id, int mail_id) {
{
retVal___ = HPMHooks.source.intif.Mail_delete(char_id, mail_id);
}
- if( HPMHooks.count.HP_intif_Mail_delete_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Mail_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Mail_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &mail_id);
+ retVal___ = postHookFunc(retVal___, char_id, mail_id);
}
}
return retVal___;
@@ -32123,14 +32645,14 @@ int HP_intif_Mail_delete(int char_id, int mail_id) {
int HP_intif_Mail_return(int char_id, int mail_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Mail_return_pre ) {
+ if (HPMHooks.count.HP_intif_Mail_return_pre > 0) {
int (*preHookFunc) (int *char_id, int *mail_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_return_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_return_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Mail_return_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &mail_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32138,11 +32660,11 @@ int HP_intif_Mail_return(int char_id, int mail_id) {
{
retVal___ = HPMHooks.source.intif.Mail_return(char_id, mail_id);
}
- if( HPMHooks.count.HP_intif_Mail_return_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, int *mail_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_return_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Mail_return_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int mail_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_return_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Mail_return_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &mail_id);
+ retVal___ = postHookFunc(retVal___, char_id, mail_id);
}
}
return retVal___;
@@ -32150,14 +32672,14 @@ int HP_intif_Mail_return(int char_id, int mail_id) {
int HP_intif_Mail_send(int account_id, struct mail_message *msg) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Mail_send_pre ) {
- int (*preHookFunc) (int *account_id, struct mail_message *msg);
+ if (HPMHooks.count.HP_intif_Mail_send_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_send_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_send_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Mail_send_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, msg);
+ retVal___ = preHookFunc(&account_id, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32165,11 +32687,11 @@ int HP_intif_Mail_send(int account_id, struct mail_message *msg) {
{
retVal___ = HPMHooks.source.intif.Mail_send(account_id, msg);
}
- if( HPMHooks.count.HP_intif_Mail_send_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_send_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Mail_send_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct mail_message *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Mail_send_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Mail_send_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, msg);
+ retVal___ = postHookFunc(retVal___, account_id, msg);
}
}
return retVal___;
@@ -32177,14 +32699,14 @@ int HP_intif_Mail_send(int account_id, struct mail_message *msg) {
int HP_intif_Auction_requestlist(int char_id, short type, int price, const char *searchtext, short page) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Auction_requestlist_pre ) {
- int (*preHookFunc) (int *char_id, short *type, int *price, const char *searchtext, short *page);
+ if (HPMHooks.count.HP_intif_Auction_requestlist_pre > 0) {
+ int (*preHookFunc) (int *char_id, short *type, int *price, const char **searchtext, short *page);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_requestlist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_requestlist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Auction_requestlist_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, &type, &price, searchtext, &page);
+ retVal___ = preHookFunc(&char_id, &type, &price, &searchtext, &page);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32192,11 +32714,11 @@ int HP_intif_Auction_requestlist(int char_id, short type, int price, const char
{
retVal___ = HPMHooks.source.intif.Auction_requestlist(char_id, type, price, searchtext, page);
}
- if( HPMHooks.count.HP_intif_Auction_requestlist_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, short *type, int *price, const char *searchtext, short *page);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_requestlist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Auction_requestlist_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, short type, int price, const char *searchtext, short page);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_requestlist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Auction_requestlist_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &type, &price, searchtext, &page);
+ retVal___ = postHookFunc(retVal___, char_id, type, price, searchtext, page);
}
}
return retVal___;
@@ -32204,14 +32726,14 @@ int HP_intif_Auction_requestlist(int char_id, short type, int price, const char
int HP_intif_Auction_register(struct auction_data *auction) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Auction_register_pre ) {
- int (*preHookFunc) (struct auction_data *auction);
+ if (HPMHooks.count.HP_intif_Auction_register_pre > 0) {
+ int (*preHookFunc) (struct auction_data **auction);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_register_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_register_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Auction_register_pre[hIndex].func;
- retVal___ = preHookFunc(auction);
+ retVal___ = preHookFunc(&auction);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32219,9 +32741,9 @@ int HP_intif_Auction_register(struct auction_data *auction) {
{
retVal___ = HPMHooks.source.intif.Auction_register(auction);
}
- if( HPMHooks.count.HP_intif_Auction_register_post ) {
+ if (HPMHooks.count.HP_intif_Auction_register_post > 0) {
int (*postHookFunc) (int retVal___, struct auction_data *auction);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_register_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_register_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Auction_register_post[hIndex].func;
retVal___ = postHookFunc(retVal___, auction);
}
@@ -32231,14 +32753,14 @@ int HP_intif_Auction_register(struct auction_data *auction) {
int HP_intif_Auction_cancel(int char_id, unsigned int auction_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Auction_cancel_pre ) {
+ if (HPMHooks.count.HP_intif_Auction_cancel_pre > 0) {
int (*preHookFunc) (int *char_id, unsigned int *auction_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Auction_cancel_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &auction_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32246,11 +32768,11 @@ int HP_intif_Auction_cancel(int char_id, unsigned int auction_id) {
{
retVal___ = HPMHooks.source.intif.Auction_cancel(char_id, auction_id);
}
- if( HPMHooks.count.HP_intif_Auction_cancel_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, unsigned int *auction_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_cancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Auction_cancel_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, unsigned int auction_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Auction_cancel_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &auction_id);
+ retVal___ = postHookFunc(retVal___, char_id, auction_id);
}
}
return retVal___;
@@ -32258,14 +32780,14 @@ int HP_intif_Auction_cancel(int char_id, unsigned int auction_id) {
int HP_intif_Auction_close(int char_id, unsigned int auction_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Auction_close_pre ) {
+ if (HPMHooks.count.HP_intif_Auction_close_pre > 0) {
int (*preHookFunc) (int *char_id, unsigned int *auction_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Auction_close_pre[hIndex].func;
retVal___ = preHookFunc(&char_id, &auction_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32273,11 +32795,11 @@ int HP_intif_Auction_close(int char_id, unsigned int auction_id) {
{
retVal___ = HPMHooks.source.intif.Auction_close(char_id, auction_id);
}
- if( HPMHooks.count.HP_intif_Auction_close_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, unsigned int *auction_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Auction_close_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, unsigned int auction_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Auction_close_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &auction_id);
+ retVal___ = postHookFunc(retVal___, char_id, auction_id);
}
}
return retVal___;
@@ -32285,14 +32807,14 @@ int HP_intif_Auction_close(int char_id, unsigned int auction_id) {
int HP_intif_Auction_bid(int char_id, const char *name, unsigned int auction_id, int bid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_Auction_bid_pre ) {
- int (*preHookFunc) (int *char_id, const char *name, unsigned int *auction_id, int *bid);
+ if (HPMHooks.count.HP_intif_Auction_bid_pre > 0) {
+ int (*preHookFunc) (int *char_id, const char **name, unsigned int *auction_id, int *bid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_bid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_bid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_Auction_bid_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, name, &auction_id, &bid);
+ retVal___ = preHookFunc(&char_id, &name, &auction_id, &bid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32300,11 +32822,11 @@ int HP_intif_Auction_bid(int char_id, const char *name, unsigned int auction_id,
{
retVal___ = HPMHooks.source.intif.Auction_bid(char_id, name, auction_id, bid);
}
- if( HPMHooks.count.HP_intif_Auction_bid_post ) {
- int (*postHookFunc) (int retVal___, int *char_id, const char *name, unsigned int *auction_id, int *bid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_bid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_Auction_bid_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, const char *name, unsigned int auction_id, int bid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_Auction_bid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_Auction_bid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, name, &auction_id, &bid);
+ retVal___ = postHookFunc(retVal___, char_id, name, auction_id, bid);
}
}
return retVal___;
@@ -32312,14 +32834,14 @@ int HP_intif_Auction_bid(int char_id, const char *name, unsigned int auction_id,
int HP_intif_elemental_create(struct s_elemental *ele) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_elemental_create_pre ) {
- int (*preHookFunc) (struct s_elemental *ele);
+ if (HPMHooks.count.HP_intif_elemental_create_pre > 0) {
+ int (*preHookFunc) (struct s_elemental **ele);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_elemental_create_pre[hIndex].func;
- retVal___ = preHookFunc(ele);
+ retVal___ = preHookFunc(&ele);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32327,9 +32849,9 @@ int HP_intif_elemental_create(struct s_elemental *ele) {
{
retVal___ = HPMHooks.source.intif.elemental_create(ele);
}
- if( HPMHooks.count.HP_intif_elemental_create_post ) {
+ if (HPMHooks.count.HP_intif_elemental_create_post > 0) {
int (*postHookFunc) (int retVal___, struct s_elemental *ele);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_create_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_elemental_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ele);
}
@@ -32339,14 +32861,14 @@ int HP_intif_elemental_create(struct s_elemental *ele) {
int HP_intif_elemental_request(int ele_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_elemental_request_pre ) {
+ if (HPMHooks.count.HP_intif_elemental_request_pre > 0) {
int (*preHookFunc) (int *ele_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_elemental_request_pre[hIndex].func;
retVal___ = preHookFunc(&ele_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32354,11 +32876,11 @@ int HP_intif_elemental_request(int ele_id, int char_id) {
{
retVal___ = HPMHooks.source.intif.elemental_request(ele_id, char_id);
}
- if( HPMHooks.count.HP_intif_elemental_request_post ) {
- int (*postHookFunc) (int retVal___, int *ele_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_request_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_elemental_request_post > 0) {
+ int (*postHookFunc) (int retVal___, int ele_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_elemental_request_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ele_id, &char_id);
+ retVal___ = postHookFunc(retVal___, ele_id, char_id);
}
}
return retVal___;
@@ -32366,14 +32888,14 @@ int HP_intif_elemental_request(int ele_id, int char_id) {
int HP_intif_elemental_delete(int ele_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_elemental_delete_pre ) {
+ if (HPMHooks.count.HP_intif_elemental_delete_pre > 0) {
int (*preHookFunc) (int *ele_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_elemental_delete_pre[hIndex].func;
retVal___ = preHookFunc(&ele_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32381,11 +32903,11 @@ int HP_intif_elemental_delete(int ele_id) {
{
retVal___ = HPMHooks.source.intif.elemental_delete(ele_id);
}
- if( HPMHooks.count.HP_intif_elemental_delete_post ) {
- int (*postHookFunc) (int retVal___, int *ele_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_elemental_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int ele_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_elemental_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ele_id);
+ retVal___ = postHookFunc(retVal___, ele_id);
}
}
return retVal___;
@@ -32393,14 +32915,14 @@ int HP_intif_elemental_delete(int ele_id) {
int HP_intif_elemental_save(struct s_elemental *ele) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_elemental_save_pre ) {
- int (*preHookFunc) (struct s_elemental *ele);
+ if (HPMHooks.count.HP_intif_elemental_save_pre > 0) {
+ int (*preHookFunc) (struct s_elemental **ele);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_elemental_save_pre[hIndex].func;
- retVal___ = preHookFunc(ele);
+ retVal___ = preHookFunc(&ele);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32408,9 +32930,9 @@ int HP_intif_elemental_save(struct s_elemental *ele) {
{
retVal___ = HPMHooks.source.intif.elemental_save(ele);
}
- if( HPMHooks.count.HP_intif_elemental_save_post ) {
+ if (HPMHooks.count.HP_intif_elemental_save_post > 0) {
int (*postHookFunc) (int retVal___, struct s_elemental *ele);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_elemental_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_elemental_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ele);
}
@@ -32419,14 +32941,14 @@ int HP_intif_elemental_save(struct s_elemental *ele) {
}
void HP_intif_request_accinfo(int u_fd, int aid, int group_lv, char *query) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_request_accinfo_pre ) {
- void (*preHookFunc) (int *u_fd, int *aid, int *group_lv, char *query);
+ if (HPMHooks.count.HP_intif_request_accinfo_pre > 0) {
+ void (*preHookFunc) (int *u_fd, int *aid, int *group_lv, char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_accinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_accinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_request_accinfo_pre[hIndex].func;
- preHookFunc(&u_fd, &aid, &group_lv, query);
+ preHookFunc(&u_fd, &aid, &group_lv, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32434,11 +32956,11 @@ void HP_intif_request_accinfo(int u_fd, int aid, int group_lv, char *query) {
{
HPMHooks.source.intif.request_accinfo(u_fd, aid, group_lv, query);
}
- if( HPMHooks.count.HP_intif_request_accinfo_post ) {
- void (*postHookFunc) (int *u_fd, int *aid, int *group_lv, char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_accinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_request_accinfo_post > 0) {
+ void (*postHookFunc) (int u_fd, int aid, int group_lv, char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_request_accinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_request_accinfo_post[hIndex].func;
- postHookFunc(&u_fd, &aid, &group_lv, query);
+ postHookFunc(u_fd, aid, group_lv, query);
}
}
return;
@@ -32446,14 +32968,14 @@ void HP_intif_request_accinfo(int u_fd, int aid, int group_lv, char *query) {
int HP_intif_CheckForCharServer(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_CheckForCharServer_pre ) {
+ if (HPMHooks.count.HP_intif_CheckForCharServer_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_CheckForCharServer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_CheckForCharServer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_CheckForCharServer_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32461,9 +32983,9 @@ int HP_intif_CheckForCharServer(void) {
{
retVal___ = HPMHooks.source.intif.CheckForCharServer();
}
- if( HPMHooks.count.HP_intif_CheckForCharServer_post ) {
+ if (HPMHooks.count.HP_intif_CheckForCharServer_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_CheckForCharServer_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_CheckForCharServer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_CheckForCharServer_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -32472,14 +32994,14 @@ int HP_intif_CheckForCharServer(void) {
}
void HP_intif_pWisMessage(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pWisMessage_pre ) {
+ if (HPMHooks.count.HP_intif_pWisMessage_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pWisMessage_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32487,25 +33009,25 @@ void HP_intif_pWisMessage(int fd) {
{
HPMHooks.source.intif.pWisMessage(fd);
}
- if( HPMHooks.count.HP_intif_pWisMessage_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pWisMessage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pWisMessage_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pWisEnd(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pWisEnd_pre ) {
+ if (HPMHooks.count.HP_intif_pWisEnd_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pWisEnd_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32513,11 +33035,11 @@ void HP_intif_pWisEnd(int fd) {
{
HPMHooks.source.intif.pWisEnd(fd);
}
- if( HPMHooks.count.HP_intif_pWisEnd_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pWisEnd_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisEnd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pWisEnd_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -32525,16 +33047,16 @@ void HP_intif_pWisEnd(int fd) {
int HP_intif_pWisToGM_sub(struct map_session_data *sd, va_list va) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_intif_pWisToGM_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list va);
+ if (HPMHooks.count.HP_intif_pWisToGM_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list va);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_pre; hIndex++) {
va_list va___copy; va_copy(va___copy, va);
preHookFunc = HPMHooks.list.HP_intif_pWisToGM_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, va___copy);
+ retVal___ = preHookFunc(&sd, va___copy);
va_end(va___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -32544,9 +33066,9 @@ int HP_intif_pWisToGM_sub(struct map_session_data *sd, va_list va) {
retVal___ = HPMHooks.source.intif.pWisToGM_sub(sd, va___copy);
va_end(va___copy);
}
- if( HPMHooks.count.HP_intif_pWisToGM_sub_post ) {
+ if (HPMHooks.count.HP_intif_pWisToGM_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list va);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_sub_post; hIndex++) {
va_list va___copy; va_copy(va___copy, va);
postHookFunc = HPMHooks.list.HP_intif_pWisToGM_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, va___copy);
@@ -32557,14 +33079,14 @@ int HP_intif_pWisToGM_sub(struct map_session_data *sd, va_list va) {
}
void HP_intif_pWisToGM(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pWisToGM_pre ) {
+ if (HPMHooks.count.HP_intif_pWisToGM_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pWisToGM_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32572,25 +33094,25 @@ void HP_intif_pWisToGM(int fd) {
{
HPMHooks.source.intif.pWisToGM(fd);
}
- if( HPMHooks.count.HP_intif_pWisToGM_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pWisToGM_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pWisToGM_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pWisToGM_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pRegisters(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pRegisters_pre ) {
+ if (HPMHooks.count.HP_intif_pRegisters_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRegisters_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRegisters_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pRegisters_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32598,25 +33120,51 @@ void HP_intif_pRegisters(int fd) {
{
HPMHooks.source.intif.pRegisters(fd);
}
- if( HPMHooks.count.HP_intif_pRegisters_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRegisters_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pRegisters_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRegisters_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pRegisters_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
+ }
+ }
+ return;
+}
+void HP_intif_pAccountStorage(int fd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_intif_pAccountStorage_pre > 0) {
+ void (*preHookFunc) (int *fd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAccountStorage_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_intif_pAccountStorage_pre[hIndex].func;
+ preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.intif.pAccountStorage(fd);
+ }
+ if (HPMHooks.count.HP_intif_pAccountStorage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAccountStorage_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_intif_pAccountStorage_post[hIndex].func;
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pChangeNameOk(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pChangeNameOk_pre ) {
+ if (HPMHooks.count.HP_intif_pChangeNameOk_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pChangeNameOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pChangeNameOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pChangeNameOk_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32624,25 +33172,25 @@ void HP_intif_pChangeNameOk(int fd) {
{
HPMHooks.source.intif.pChangeNameOk(fd);
}
- if( HPMHooks.count.HP_intif_pChangeNameOk_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pChangeNameOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pChangeNameOk_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pChangeNameOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pChangeNameOk_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMessageToFD(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMessageToFD_pre ) {
+ if (HPMHooks.count.HP_intif_pMessageToFD_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMessageToFD_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMessageToFD_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMessageToFD_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32650,25 +33198,51 @@ void HP_intif_pMessageToFD(int fd) {
{
HPMHooks.source.intif.pMessageToFD(fd);
}
- if( HPMHooks.count.HP_intif_pMessageToFD_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMessageToFD_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMessageToFD_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMessageToFD_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMessageToFD_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
+ }
+ }
+ return;
+}
+void HP_intif_pAccountStorageSaveAck(int fd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_intif_pAccountStorageSaveAck_pre > 0) {
+ void (*preHookFunc) (int *fd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAccountStorageSaveAck_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_intif_pAccountStorageSaveAck_pre[hIndex].func;
+ preHookFunc(&fd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.intif.pAccountStorageSaveAck(fd);
+ }
+ if (HPMHooks.count.HP_intif_pAccountStorageSaveAck_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAccountStorageSaveAck_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_intif_pAccountStorageSaveAck_post[hIndex].func;
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pLoadGuildStorage(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pLoadGuildStorage_pre ) {
+ if (HPMHooks.count.HP_intif_pLoadGuildStorage_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pLoadGuildStorage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pLoadGuildStorage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pLoadGuildStorage_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32676,25 +33250,25 @@ void HP_intif_pLoadGuildStorage(int fd) {
{
HPMHooks.source.intif.pLoadGuildStorage(fd);
}
- if( HPMHooks.count.HP_intif_pLoadGuildStorage_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pLoadGuildStorage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pLoadGuildStorage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pLoadGuildStorage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pLoadGuildStorage_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pSaveGuildStorage(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pSaveGuildStorage_pre ) {
+ if (HPMHooks.count.HP_intif_pSaveGuildStorage_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveGuildStorage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveGuildStorage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pSaveGuildStorage_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32702,25 +33276,25 @@ void HP_intif_pSaveGuildStorage(int fd) {
{
HPMHooks.source.intif.pSaveGuildStorage(fd);
}
- if( HPMHooks.count.HP_intif_pSaveGuildStorage_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveGuildStorage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pSaveGuildStorage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveGuildStorage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pSaveGuildStorage_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyCreated(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyCreated_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyCreated_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyCreated_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyCreated_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyCreated_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32728,25 +33302,25 @@ void HP_intif_pPartyCreated(int fd) {
{
HPMHooks.source.intif.pPartyCreated(fd);
}
- if( HPMHooks.count.HP_intif_pPartyCreated_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyCreated_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyCreated_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyCreated_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyCreated_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyInfo(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyInfo_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyInfo_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyInfo_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32754,25 +33328,25 @@ void HP_intif_pPartyInfo(int fd) {
{
HPMHooks.source.intif.pPartyInfo(fd);
}
- if( HPMHooks.count.HP_intif_pPartyInfo_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyInfo_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyInfo_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyMemberAdded(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyMemberAdded_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyMemberAdded_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberAdded_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberAdded_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyMemberAdded_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32780,25 +33354,25 @@ void HP_intif_pPartyMemberAdded(int fd) {
{
HPMHooks.source.intif.pPartyMemberAdded(fd);
}
- if( HPMHooks.count.HP_intif_pPartyMemberAdded_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberAdded_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyMemberAdded_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberAdded_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyMemberAdded_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyOptionChanged(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyOptionChanged_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyOptionChanged_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyOptionChanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyOptionChanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyOptionChanged_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32806,25 +33380,25 @@ void HP_intif_pPartyOptionChanged(int fd) {
{
HPMHooks.source.intif.pPartyOptionChanged(fd);
}
- if( HPMHooks.count.HP_intif_pPartyOptionChanged_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyOptionChanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyOptionChanged_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyOptionChanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyOptionChanged_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyMemberWithdraw(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyMemberWithdraw_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyMemberWithdraw_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberWithdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberWithdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyMemberWithdraw_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32832,25 +33406,25 @@ void HP_intif_pPartyMemberWithdraw(int fd) {
{
HPMHooks.source.intif.pPartyMemberWithdraw(fd);
}
- if( HPMHooks.count.HP_intif_pPartyMemberWithdraw_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberWithdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyMemberWithdraw_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMemberWithdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyMemberWithdraw_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyMove(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyMove_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyMove_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyMove_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32858,25 +33432,25 @@ void HP_intif_pPartyMove(int fd) {
{
HPMHooks.source.intif.pPartyMove(fd);
}
- if( HPMHooks.count.HP_intif_pPartyMove_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyMove_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyMove_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyBroken(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyBroken_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyBroken_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyBroken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyBroken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyBroken_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32884,25 +33458,25 @@ void HP_intif_pPartyBroken(int fd) {
{
HPMHooks.source.intif.pPartyBroken(fd);
}
- if( HPMHooks.count.HP_intif_pPartyBroken_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyBroken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyBroken_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyBroken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyBroken_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pPartyMessage(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pPartyMessage_pre ) {
+ if (HPMHooks.count.HP_intif_pPartyMessage_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pPartyMessage_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32910,25 +33484,25 @@ void HP_intif_pPartyMessage(int fd) {
{
HPMHooks.source.intif.pPartyMessage(fd);
}
- if( HPMHooks.count.HP_intif_pPartyMessage_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pPartyMessage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pPartyMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pPartyMessage_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildCreated(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildCreated_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildCreated_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCreated_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCreated_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildCreated_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32936,25 +33510,25 @@ void HP_intif_pGuildCreated(int fd) {
{
HPMHooks.source.intif.pGuildCreated(fd);
}
- if( HPMHooks.count.HP_intif_pGuildCreated_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCreated_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildCreated_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCreated_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildCreated_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildInfo(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildInfo_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildInfo_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildInfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildInfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildInfo_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32962,25 +33536,25 @@ void HP_intif_pGuildInfo(int fd) {
{
HPMHooks.source.intif.pGuildInfo(fd);
}
- if( HPMHooks.count.HP_intif_pGuildInfo_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildInfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildInfo_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildInfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildInfo_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildMemberAdded(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildMemberAdded_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberAdded_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberAdded_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberAdded_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildMemberAdded_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -32988,25 +33562,25 @@ void HP_intif_pGuildMemberAdded(int fd) {
{
HPMHooks.source.intif.pGuildMemberAdded(fd);
}
- if( HPMHooks.count.HP_intif_pGuildMemberAdded_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberAdded_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberAdded_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberAdded_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildMemberAdded_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildMemberWithdraw(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildMemberWithdraw_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberWithdraw_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberWithdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberWithdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildMemberWithdraw_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33014,25 +33588,25 @@ void HP_intif_pGuildMemberWithdraw(int fd) {
{
HPMHooks.source.intif.pGuildMemberWithdraw(fd);
}
- if( HPMHooks.count.HP_intif_pGuildMemberWithdraw_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberWithdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberWithdraw_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberWithdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildMemberWithdraw_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildMemberInfoShort(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildMemberInfoShort_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberInfoShort_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoShort_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoShort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildMemberInfoShort_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33040,25 +33614,25 @@ void HP_intif_pGuildMemberInfoShort(int fd) {
{
HPMHooks.source.intif.pGuildMemberInfoShort(fd);
}
- if( HPMHooks.count.HP_intif_pGuildMemberInfoShort_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoShort_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberInfoShort_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoShort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildMemberInfoShort_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildBroken(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildBroken_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildBroken_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBroken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBroken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildBroken_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33066,25 +33640,25 @@ void HP_intif_pGuildBroken(int fd) {
{
HPMHooks.source.intif.pGuildBroken(fd);
}
- if( HPMHooks.count.HP_intif_pGuildBroken_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBroken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildBroken_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBroken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildBroken_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildMessage(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildMessage_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildMessage_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildMessage_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33092,25 +33666,25 @@ void HP_intif_pGuildMessage(int fd) {
{
HPMHooks.source.intif.pGuildMessage(fd);
}
- if( HPMHooks.count.HP_intif_pGuildMessage_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildMessage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildMessage_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildBasicInfoChanged(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildBasicInfoChanged_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildBasicInfoChanged_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBasicInfoChanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBasicInfoChanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildBasicInfoChanged_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33118,25 +33692,25 @@ void HP_intif_pGuildBasicInfoChanged(int fd) {
{
HPMHooks.source.intif.pGuildBasicInfoChanged(fd);
}
- if( HPMHooks.count.HP_intif_pGuildBasicInfoChanged_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBasicInfoChanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildBasicInfoChanged_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildBasicInfoChanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildBasicInfoChanged_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildMemberInfoChanged(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildMemberInfoChanged_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberInfoChanged_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoChanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoChanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildMemberInfoChanged_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33144,25 +33718,25 @@ void HP_intif_pGuildMemberInfoChanged(int fd) {
{
HPMHooks.source.intif.pGuildMemberInfoChanged(fd);
}
- if( HPMHooks.count.HP_intif_pGuildMemberInfoChanged_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoChanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildMemberInfoChanged_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMemberInfoChanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildMemberInfoChanged_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildPosition(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildPosition_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildPosition_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildPosition_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildPosition_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildPosition_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33170,25 +33744,25 @@ void HP_intif_pGuildPosition(int fd) {
{
HPMHooks.source.intif.pGuildPosition(fd);
}
- if( HPMHooks.count.HP_intif_pGuildPosition_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildPosition_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildPosition_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildPosition_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildPosition_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildSkillUp(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildSkillUp_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildSkillUp_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildSkillUp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildSkillUp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildSkillUp_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33196,25 +33770,25 @@ void HP_intif_pGuildSkillUp(int fd) {
{
HPMHooks.source.intif.pGuildSkillUp(fd);
}
- if( HPMHooks.count.HP_intif_pGuildSkillUp_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildSkillUp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildSkillUp_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildSkillUp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildSkillUp_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildAlliance(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildAlliance_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildAlliance_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildAlliance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildAlliance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildAlliance_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33222,25 +33796,25 @@ void HP_intif_pGuildAlliance(int fd) {
{
HPMHooks.source.intif.pGuildAlliance(fd);
}
- if( HPMHooks.count.HP_intif_pGuildAlliance_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildAlliance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildAlliance_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildAlliance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildAlliance_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildNotice(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildNotice_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildNotice_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildNotice_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildNotice_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildNotice_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33248,25 +33822,25 @@ void HP_intif_pGuildNotice(int fd) {
{
HPMHooks.source.intif.pGuildNotice(fd);
}
- if( HPMHooks.count.HP_intif_pGuildNotice_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildNotice_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildNotice_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildNotice_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildNotice_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildEmblem(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildEmblem_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildEmblem_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildEmblem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildEmblem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildEmblem_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33274,25 +33848,25 @@ void HP_intif_pGuildEmblem(int fd) {
{
HPMHooks.source.intif.pGuildEmblem(fd);
}
- if( HPMHooks.count.HP_intif_pGuildEmblem_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildEmblem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildEmblem_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildEmblem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildEmblem_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildCastleDataLoad(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildCastleDataLoad_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildCastleDataLoad_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCastleDataLoad_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCastleDataLoad_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildCastleDataLoad_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33300,25 +33874,25 @@ void HP_intif_pGuildCastleDataLoad(int fd) {
{
HPMHooks.source.intif.pGuildCastleDataLoad(fd);
}
- if( HPMHooks.count.HP_intif_pGuildCastleDataLoad_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCastleDataLoad_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildCastleDataLoad_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildCastleDataLoad_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildCastleDataLoad_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pGuildMasterChanged(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pGuildMasterChanged_pre ) {
+ if (HPMHooks.count.HP_intif_pGuildMasterChanged_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMasterChanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMasterChanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pGuildMasterChanged_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33326,25 +33900,25 @@ void HP_intif_pGuildMasterChanged(int fd) {
{
HPMHooks.source.intif.pGuildMasterChanged(fd);
}
- if( HPMHooks.count.HP_intif_pGuildMasterChanged_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMasterChanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pGuildMasterChanged_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pGuildMasterChanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pGuildMasterChanged_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pQuestLog(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pQuestLog_pre ) {
+ if (HPMHooks.count.HP_intif_pQuestLog_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestLog_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestLog_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pQuestLog_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33352,25 +33926,25 @@ void HP_intif_pQuestLog(int fd) {
{
HPMHooks.source.intif.pQuestLog(fd);
}
- if( HPMHooks.count.HP_intif_pQuestLog_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestLog_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pQuestLog_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestLog_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pQuestLog_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pQuestSave(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pQuestSave_pre ) {
+ if (HPMHooks.count.HP_intif_pQuestSave_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestSave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestSave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pQuestSave_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33378,25 +33952,25 @@ void HP_intif_pQuestSave(int fd) {
{
HPMHooks.source.intif.pQuestSave(fd);
}
- if( HPMHooks.count.HP_intif_pQuestSave_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestSave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pQuestSave_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pQuestSave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pQuestSave_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMailInboxReceived(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMailInboxReceived_pre ) {
+ if (HPMHooks.count.HP_intif_pMailInboxReceived_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailInboxReceived_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailInboxReceived_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMailInboxReceived_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33404,25 +33978,25 @@ void HP_intif_pMailInboxReceived(int fd) {
{
HPMHooks.source.intif.pMailInboxReceived(fd);
}
- if( HPMHooks.count.HP_intif_pMailInboxReceived_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailInboxReceived_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMailInboxReceived_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailInboxReceived_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMailInboxReceived_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMailNew(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMailNew_pre ) {
+ if (HPMHooks.count.HP_intif_pMailNew_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailNew_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailNew_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMailNew_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33430,25 +34004,25 @@ void HP_intif_pMailNew(int fd) {
{
HPMHooks.source.intif.pMailNew(fd);
}
- if( HPMHooks.count.HP_intif_pMailNew_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailNew_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMailNew_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailNew_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMailNew_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMailGetAttach(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMailGetAttach_pre ) {
+ if (HPMHooks.count.HP_intif_pMailGetAttach_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailGetAttach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailGetAttach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMailGetAttach_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33456,25 +34030,25 @@ void HP_intif_pMailGetAttach(int fd) {
{
HPMHooks.source.intif.pMailGetAttach(fd);
}
- if( HPMHooks.count.HP_intif_pMailGetAttach_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailGetAttach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMailGetAttach_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailGetAttach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMailGetAttach_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMailDelete(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMailDelete_pre ) {
+ if (HPMHooks.count.HP_intif_pMailDelete_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailDelete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailDelete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMailDelete_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33482,25 +34056,25 @@ void HP_intif_pMailDelete(int fd) {
{
HPMHooks.source.intif.pMailDelete(fd);
}
- if( HPMHooks.count.HP_intif_pMailDelete_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailDelete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMailDelete_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailDelete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMailDelete_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMailReturn(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMailReturn_pre ) {
+ if (HPMHooks.count.HP_intif_pMailReturn_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailReturn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailReturn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMailReturn_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33508,25 +34082,25 @@ void HP_intif_pMailReturn(int fd) {
{
HPMHooks.source.intif.pMailReturn(fd);
}
- if( HPMHooks.count.HP_intif_pMailReturn_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailReturn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMailReturn_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailReturn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMailReturn_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMailSend(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMailSend_pre ) {
+ if (HPMHooks.count.HP_intif_pMailSend_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailSend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailSend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMailSend_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33534,25 +34108,25 @@ void HP_intif_pMailSend(int fd) {
{
HPMHooks.source.intif.pMailSend(fd);
}
- if( HPMHooks.count.HP_intif_pMailSend_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailSend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMailSend_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMailSend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMailSend_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pAuctionResults(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pAuctionResults_pre ) {
+ if (HPMHooks.count.HP_intif_pAuctionResults_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionResults_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionResults_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pAuctionResults_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33560,25 +34134,25 @@ void HP_intif_pAuctionResults(int fd) {
{
HPMHooks.source.intif.pAuctionResults(fd);
}
- if( HPMHooks.count.HP_intif_pAuctionResults_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionResults_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pAuctionResults_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionResults_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pAuctionResults_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pAuctionRegister(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pAuctionRegister_pre ) {
+ if (HPMHooks.count.HP_intif_pAuctionRegister_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionRegister_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionRegister_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pAuctionRegister_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33586,25 +34160,25 @@ void HP_intif_pAuctionRegister(int fd) {
{
HPMHooks.source.intif.pAuctionRegister(fd);
}
- if( HPMHooks.count.HP_intif_pAuctionRegister_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionRegister_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pAuctionRegister_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionRegister_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pAuctionRegister_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pAuctionCancel(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pAuctionCancel_pre ) {
+ if (HPMHooks.count.HP_intif_pAuctionCancel_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionCancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionCancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pAuctionCancel_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33612,25 +34186,25 @@ void HP_intif_pAuctionCancel(int fd) {
{
HPMHooks.source.intif.pAuctionCancel(fd);
}
- if( HPMHooks.count.HP_intif_pAuctionCancel_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionCancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pAuctionCancel_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionCancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pAuctionCancel_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pAuctionClose(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pAuctionClose_pre ) {
+ if (HPMHooks.count.HP_intif_pAuctionClose_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionClose_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionClose_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pAuctionClose_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33638,25 +34212,25 @@ void HP_intif_pAuctionClose(int fd) {
{
HPMHooks.source.intif.pAuctionClose(fd);
}
- if( HPMHooks.count.HP_intif_pAuctionClose_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionClose_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pAuctionClose_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionClose_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pAuctionClose_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pAuctionMessage(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pAuctionMessage_pre ) {
+ if (HPMHooks.count.HP_intif_pAuctionMessage_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionMessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionMessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pAuctionMessage_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33664,25 +34238,25 @@ void HP_intif_pAuctionMessage(int fd) {
{
HPMHooks.source.intif.pAuctionMessage(fd);
}
- if( HPMHooks.count.HP_intif_pAuctionMessage_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionMessage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pAuctionMessage_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionMessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pAuctionMessage_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pAuctionBid(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pAuctionBid_pre ) {
+ if (HPMHooks.count.HP_intif_pAuctionBid_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionBid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionBid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pAuctionBid_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33690,25 +34264,25 @@ void HP_intif_pAuctionBid(int fd) {
{
HPMHooks.source.intif.pAuctionBid(fd);
}
- if( HPMHooks.count.HP_intif_pAuctionBid_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionBid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pAuctionBid_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pAuctionBid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pAuctionBid_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pItembound_ack(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pItembound_ack_pre ) {
+ if (HPMHooks.count.HP_intif_pItembound_ack_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pItembound_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pItembound_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pItembound_ack_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33716,25 +34290,25 @@ void HP_intif_pItembound_ack(int fd) {
{
HPMHooks.source.intif.pItembound_ack(fd);
}
- if( HPMHooks.count.HP_intif_pItembound_ack_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pItembound_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pItembound_ack_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pItembound_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pItembound_ack_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMercenaryReceived(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMercenaryReceived_pre ) {
+ if (HPMHooks.count.HP_intif_pMercenaryReceived_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryReceived_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryReceived_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMercenaryReceived_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33742,25 +34316,25 @@ void HP_intif_pMercenaryReceived(int fd) {
{
HPMHooks.source.intif.pMercenaryReceived(fd);
}
- if( HPMHooks.count.HP_intif_pMercenaryReceived_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryReceived_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMercenaryReceived_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryReceived_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMercenaryReceived_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMercenaryDeleted(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMercenaryDeleted_pre ) {
+ if (HPMHooks.count.HP_intif_pMercenaryDeleted_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryDeleted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryDeleted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMercenaryDeleted_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33768,25 +34342,25 @@ void HP_intif_pMercenaryDeleted(int fd) {
{
HPMHooks.source.intif.pMercenaryDeleted(fd);
}
- if( HPMHooks.count.HP_intif_pMercenaryDeleted_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryDeleted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMercenaryDeleted_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenaryDeleted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMercenaryDeleted_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pMercenarySaved(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pMercenarySaved_pre ) {
+ if (HPMHooks.count.HP_intif_pMercenarySaved_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenarySaved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenarySaved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pMercenarySaved_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33794,25 +34368,25 @@ void HP_intif_pMercenarySaved(int fd) {
{
HPMHooks.source.intif.pMercenarySaved(fd);
}
- if( HPMHooks.count.HP_intif_pMercenarySaved_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenarySaved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pMercenarySaved_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pMercenarySaved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pMercenarySaved_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pElementalReceived(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pElementalReceived_pre ) {
+ if (HPMHooks.count.HP_intif_pElementalReceived_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalReceived_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalReceived_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pElementalReceived_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33820,25 +34394,25 @@ void HP_intif_pElementalReceived(int fd) {
{
HPMHooks.source.intif.pElementalReceived(fd);
}
- if( HPMHooks.count.HP_intif_pElementalReceived_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalReceived_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pElementalReceived_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalReceived_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pElementalReceived_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pElementalDeleted(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pElementalDeleted_pre ) {
+ if (HPMHooks.count.HP_intif_pElementalDeleted_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalDeleted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalDeleted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pElementalDeleted_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33846,25 +34420,25 @@ void HP_intif_pElementalDeleted(int fd) {
{
HPMHooks.source.intif.pElementalDeleted(fd);
}
- if( HPMHooks.count.HP_intif_pElementalDeleted_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalDeleted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pElementalDeleted_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalDeleted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pElementalDeleted_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pElementalSaved(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pElementalSaved_pre ) {
+ if (HPMHooks.count.HP_intif_pElementalSaved_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalSaved_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalSaved_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pElementalSaved_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33872,25 +34446,25 @@ void HP_intif_pElementalSaved(int fd) {
{
HPMHooks.source.intif.pElementalSaved(fd);
}
- if( HPMHooks.count.HP_intif_pElementalSaved_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalSaved_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pElementalSaved_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pElementalSaved_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pElementalSaved_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pCreatePet(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pCreatePet_pre ) {
+ if (HPMHooks.count.HP_intif_pCreatePet_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreatePet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreatePet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pCreatePet_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33898,25 +34472,25 @@ void HP_intif_pCreatePet(int fd) {
{
HPMHooks.source.intif.pCreatePet(fd);
}
- if( HPMHooks.count.HP_intif_pCreatePet_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreatePet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pCreatePet_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreatePet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pCreatePet_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pRecvPetData(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pRecvPetData_pre ) {
+ if (HPMHooks.count.HP_intif_pRecvPetData_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvPetData_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvPetData_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pRecvPetData_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33924,25 +34498,25 @@ void HP_intif_pRecvPetData(int fd) {
{
HPMHooks.source.intif.pRecvPetData(fd);
}
- if( HPMHooks.count.HP_intif_pRecvPetData_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvPetData_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pRecvPetData_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvPetData_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pRecvPetData_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pSavePetOk(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pSavePetOk_pre ) {
+ if (HPMHooks.count.HP_intif_pSavePetOk_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSavePetOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSavePetOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pSavePetOk_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33950,25 +34524,25 @@ void HP_intif_pSavePetOk(int fd) {
{
HPMHooks.source.intif.pSavePetOk(fd);
}
- if( HPMHooks.count.HP_intif_pSavePetOk_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSavePetOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pSavePetOk_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSavePetOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pSavePetOk_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pDeletePetOk(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pDeletePetOk_pre ) {
+ if (HPMHooks.count.HP_intif_pDeletePetOk_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeletePetOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeletePetOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pDeletePetOk_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -33976,25 +34550,25 @@ void HP_intif_pDeletePetOk(int fd) {
{
HPMHooks.source.intif.pDeletePetOk(fd);
}
- if( HPMHooks.count.HP_intif_pDeletePetOk_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeletePetOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pDeletePetOk_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeletePetOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pDeletePetOk_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pCreateHomunculus(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pCreateHomunculus_pre ) {
+ if (HPMHooks.count.HP_intif_pCreateHomunculus_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreateHomunculus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreateHomunculus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pCreateHomunculus_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34002,25 +34576,25 @@ void HP_intif_pCreateHomunculus(int fd) {
{
HPMHooks.source.intif.pCreateHomunculus(fd);
}
- if( HPMHooks.count.HP_intif_pCreateHomunculus_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreateHomunculus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pCreateHomunculus_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pCreateHomunculus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pCreateHomunculus_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pRecvHomunculusData(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pRecvHomunculusData_pre ) {
+ if (HPMHooks.count.HP_intif_pRecvHomunculusData_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvHomunculusData_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvHomunculusData_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pRecvHomunculusData_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34028,25 +34602,25 @@ void HP_intif_pRecvHomunculusData(int fd) {
{
HPMHooks.source.intif.pRecvHomunculusData(fd);
}
- if( HPMHooks.count.HP_intif_pRecvHomunculusData_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvHomunculusData_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pRecvHomunculusData_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pRecvHomunculusData_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pRecvHomunculusData_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pSaveHomunculusOk(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pSaveHomunculusOk_pre ) {
+ if (HPMHooks.count.HP_intif_pSaveHomunculusOk_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveHomunculusOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveHomunculusOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pSaveHomunculusOk_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34054,25 +34628,25 @@ void HP_intif_pSaveHomunculusOk(int fd) {
{
HPMHooks.source.intif.pSaveHomunculusOk(fd);
}
- if( HPMHooks.count.HP_intif_pSaveHomunculusOk_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveHomunculusOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pSaveHomunculusOk_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pSaveHomunculusOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pSaveHomunculusOk_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_intif_pDeleteHomunculusOk(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_intif_pDeleteHomunculusOk_pre ) {
+ if (HPMHooks.count.HP_intif_pDeleteHomunculusOk_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeleteHomunculusOk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeleteHomunculusOk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_intif_pDeleteHomunculusOk_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34080,26 +34654,26 @@ void HP_intif_pDeleteHomunculusOk(int fd) {
{
HPMHooks.source.intif.pDeleteHomunculusOk(fd);
}
- if( HPMHooks.count.HP_intif_pDeleteHomunculusOk_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeleteHomunculusOk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_intif_pDeleteHomunculusOk_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_pDeleteHomunculusOk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_intif_pDeleteHomunculusOk_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
-/* ircbot */
+/* irc_bot_interface */
void HP_ircbot_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_init_pre ) {
+ if (HPMHooks.count.HP_ircbot_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34107,25 +34681,25 @@ void HP_ircbot_init(bool minimal) {
{
HPMHooks.source.ircbot.init(minimal);
}
- if( HPMHooks.count.HP_ircbot_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_ircbot_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_final_pre ) {
+ if (HPMHooks.count.HP_ircbot_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34133,9 +34707,9 @@ void HP_ircbot_final(void) {
{
HPMHooks.source.ircbot.final();
}
- if( HPMHooks.count.HP_ircbot_final_post ) {
+ if (HPMHooks.count.HP_ircbot_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_final_post[hIndex].func;
postHookFunc();
}
@@ -34145,14 +34719,14 @@ void HP_ircbot_final(void) {
int HP_ircbot_parse(int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_ircbot_parse_pre ) {
+ if (HPMHooks.count.HP_ircbot_parse_pre > 0) {
int (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_parse_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34160,25 +34734,25 @@ int HP_ircbot_parse(int fd) {
{
retVal___ = HPMHooks.source.ircbot.parse(fd);
}
- if( HPMHooks.count.HP_ircbot_parse_post ) {
- int (*postHookFunc) (int retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_ircbot_parse_sub(int fd, char *str) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_parse_sub_pre ) {
- void (*preHookFunc) (int *fd, char *str);
+ if (HPMHooks.count.HP_ircbot_parse_sub_pre > 0) {
+ void (*preHookFunc) (int *fd, char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_parse_sub_pre[hIndex].func;
- preHookFunc(&fd, str);
+ preHookFunc(&fd, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34186,25 +34760,25 @@ void HP_ircbot_parse_sub(int fd, char *str) {
{
HPMHooks.source.ircbot.parse_sub(fd, str);
}
- if( HPMHooks.count.HP_ircbot_parse_sub_post ) {
- void (*postHookFunc) (int *fd, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_parse_sub_post > 0) {
+ void (*postHookFunc) (int fd, char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_parse_sub_post[hIndex].func;
- postHookFunc(&fd, str);
+ postHookFunc(fd, str);
}
}
return;
}
void HP_ircbot_parse_source(char *source, char *nick, char *ident, char *host) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_parse_source_pre ) {
- void (*preHookFunc) (char *source, char *nick, char *ident, char *host);
+ if (HPMHooks.count.HP_ircbot_parse_source_pre > 0) {
+ void (*preHookFunc) (char **source, char **nick, char **ident, char **host);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_source_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_source_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_parse_source_pre[hIndex].func;
- preHookFunc(source, nick, ident, host);
+ preHookFunc(&source, &nick, &ident, &host);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34212,9 +34786,9 @@ void HP_ircbot_parse_source(char *source, char *nick, char *ident, char *host) {
{
HPMHooks.source.ircbot.parse_source(source, nick, ident, host);
}
- if( HPMHooks.count.HP_ircbot_parse_source_post ) {
+ if (HPMHooks.count.HP_ircbot_parse_source_post > 0) {
void (*postHookFunc) (char *source, char *nick, char *ident, char *host);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_source_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_parse_source_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_parse_source_post[hIndex].func;
postHookFunc(source, nick, ident, host);
}
@@ -34224,14 +34798,14 @@ void HP_ircbot_parse_source(char *source, char *nick, char *ident, char *host) {
struct irc_func* HP_ircbot_func_search(char *function_name) {
int hIndex = 0;
struct irc_func* retVal___ = NULL;
- if( HPMHooks.count.HP_ircbot_func_search_pre ) {
- struct irc_func* (*preHookFunc) (char *function_name);
+ if (HPMHooks.count.HP_ircbot_func_search_pre > 0) {
+ struct irc_func* (*preHookFunc) (char **function_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_func_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_func_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_func_search_pre[hIndex].func;
- retVal___ = preHookFunc(function_name);
+ retVal___ = preHookFunc(&function_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34239,9 +34813,9 @@ struct irc_func* HP_ircbot_func_search(char *function_name) {
{
retVal___ = HPMHooks.source.ircbot.func_search(function_name);
}
- if( HPMHooks.count.HP_ircbot_func_search_post ) {
+ if (HPMHooks.count.HP_ircbot_func_search_post > 0) {
struct irc_func* (*postHookFunc) (struct irc_func* retVal___, char *function_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_func_search_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_func_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_func_search_post[hIndex].func;
retVal___ = postHookFunc(retVal___, function_name);
}
@@ -34251,14 +34825,14 @@ struct irc_func* HP_ircbot_func_search(char *function_name) {
int HP_ircbot_connect_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_ircbot_connect_timer_pre ) {
+ if (HPMHooks.count.HP_ircbot_connect_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_connect_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_connect_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_connect_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34266,11 +34840,11 @@ int HP_ircbot_connect_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.ircbot.connect_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_ircbot_connect_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_connect_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_connect_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_connect_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_connect_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -34278,14 +34852,14 @@ int HP_ircbot_connect_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_ircbot_identify_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_ircbot_identify_timer_pre ) {
+ if (HPMHooks.count.HP_ircbot_identify_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_identify_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_identify_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_identify_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34293,11 +34867,11 @@ int HP_ircbot_identify_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.ircbot.identify_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_ircbot_identify_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_identify_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_identify_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_identify_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_identify_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -34305,14 +34879,14 @@ int HP_ircbot_identify_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_ircbot_join_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_ircbot_join_timer_pre ) {
+ if (HPMHooks.count.HP_ircbot_join_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_join_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_join_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_join_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34320,51 +34894,104 @@ int HP_ircbot_join_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.ircbot.join_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_ircbot_join_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_join_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_join_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_join_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_join_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-void HP_ircbot_send(char *str) {
+int HP_ircbot_queue_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_send_pre ) {
- void (*preHookFunc) (char *str);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_ircbot_queue_timer_pre > 0) {
+ int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_send_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_ircbot_send_pre[hIndex].func;
- preHookFunc(str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_queue_timer_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_ircbot_queue_timer_pre[hIndex].func;
+ retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.ircbot.queue_timer(tid, tick, id, data);
+ }
+ if (HPMHooks.count.HP_ircbot_queue_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_queue_timer_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_ircbot_queue_timer_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
+ }
+ }
+ return retVal___;
+}
+void HP_ircbot_queue(char *str) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_ircbot_queue_pre > 0) {
+ void (*preHookFunc) (char **str);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_queue_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_ircbot_queue_pre[hIndex].func;
+ preHookFunc(&str);
+ }
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.ircbot.send(str);
+ HPMHooks.source.ircbot.queue(str);
}
- if( HPMHooks.count.HP_ircbot_send_post ) {
+ if (HPMHooks.count.HP_ircbot_queue_post > 0) {
void (*postHookFunc) (char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_send_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_ircbot_send_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_queue_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_ircbot_queue_post[hIndex].func;
postHookFunc(str);
}
}
return;
}
+void HP_ircbot_send(char *str, bool force) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_ircbot_send_pre > 0) {
+ void (*preHookFunc) (char **str, bool *force);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_send_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_ircbot_send_pre[hIndex].func;
+ preHookFunc(&str, &force);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.ircbot.send(str, force);
+ }
+ if (HPMHooks.count.HP_ircbot_send_post > 0) {
+ void (*postHookFunc) (char *str, bool force);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_send_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_ircbot_send_post[hIndex].func;
+ postHookFunc(str, force);
+ }
+ }
+ return;
+}
void HP_ircbot_relay(const char *name, const char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_relay_pre ) {
- void (*preHookFunc) (const char *name, const char *msg);
+ if (HPMHooks.count.HP_ircbot_relay_pre > 0) {
+ void (*preHookFunc) (const char **name, const char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_relay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_relay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_relay_pre[hIndex].func;
- preHookFunc(name, msg);
+ preHookFunc(&name, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34372,9 +34999,9 @@ void HP_ircbot_relay(const char *name, const char *msg) {
{
HPMHooks.source.ircbot.relay(name, msg);
}
- if( HPMHooks.count.HP_ircbot_relay_post ) {
+ if (HPMHooks.count.HP_ircbot_relay_post > 0) {
void (*postHookFunc) (const char *name, const char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_relay_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_relay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_relay_post[hIndex].func;
postHookFunc(name, msg);
}
@@ -34383,14 +35010,14 @@ void HP_ircbot_relay(const char *name, const char *msg) {
}
void HP_ircbot_pong(int fd, char *cmd, char *source, char *target, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_pong_pre ) {
- void (*preHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
+ if (HPMHooks.count.HP_ircbot_pong_pre > 0) {
+ void (*preHookFunc) (int *fd, char **cmd, char **source, char **target, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_pong_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_pong_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_pong_pre[hIndex].func;
- preHookFunc(&fd, cmd, source, target, msg);
+ preHookFunc(&fd, &cmd, &source, &target, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34398,25 +35025,25 @@ void HP_ircbot_pong(int fd, char *cmd, char *source, char *target, char *msg) {
{
HPMHooks.source.ircbot.pong(fd, cmd, source, target, msg);
}
- if( HPMHooks.count.HP_ircbot_pong_post ) {
- void (*postHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_pong_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_pong_post > 0) {
+ void (*postHookFunc) (int fd, char *cmd, char *source, char *target, char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_pong_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_pong_post[hIndex].func;
- postHookFunc(&fd, cmd, source, target, msg);
+ postHookFunc(fd, cmd, source, target, msg);
}
}
return;
}
void HP_ircbot_privmsg(int fd, char *cmd, char *source, char *target, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_privmsg_pre ) {
- void (*preHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
+ if (HPMHooks.count.HP_ircbot_privmsg_pre > 0) {
+ void (*preHookFunc) (int *fd, char **cmd, char **source, char **target, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_privmsg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_privmsg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_privmsg_pre[hIndex].func;
- preHookFunc(&fd, cmd, source, target, msg);
+ preHookFunc(&fd, &cmd, &source, &target, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34424,25 +35051,51 @@ void HP_ircbot_privmsg(int fd, char *cmd, char *source, char *target, char *msg)
{
HPMHooks.source.ircbot.privmsg(fd, cmd, source, target, msg);
}
- if( HPMHooks.count.HP_ircbot_privmsg_post ) {
- void (*postHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_privmsg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_privmsg_post > 0) {
+ void (*postHookFunc) (int fd, char *cmd, char *source, char *target, char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_privmsg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_privmsg_post[hIndex].func;
- postHookFunc(&fd, cmd, source, target, msg);
+ postHookFunc(fd, cmd, source, target, msg);
+ }
+ }
+ return;
+}
+void HP_ircbot_privmsg_ctcp(int fd, char *cmd, char *source, char *target, char *msg) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_ircbot_privmsg_ctcp_pre > 0) {
+ void (*preHookFunc) (int *fd, char **cmd, char **source, char **target, char **msg);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_privmsg_ctcp_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_ircbot_privmsg_ctcp_pre[hIndex].func;
+ preHookFunc(&fd, &cmd, &source, &target, &msg);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.ircbot.privmsg_ctcp(fd, cmd, source, target, msg);
+ }
+ if (HPMHooks.count.HP_ircbot_privmsg_ctcp_post > 0) {
+ void (*postHookFunc) (int fd, char *cmd, char *source, char *target, char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_privmsg_ctcp_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_ircbot_privmsg_ctcp_post[hIndex].func;
+ postHookFunc(fd, cmd, source, target, msg);
}
}
return;
}
void HP_ircbot_userjoin(int fd, char *cmd, char *source, char *target, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_userjoin_pre ) {
- void (*preHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
+ if (HPMHooks.count.HP_ircbot_userjoin_pre > 0) {
+ void (*preHookFunc) (int *fd, char **cmd, char **source, char **target, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userjoin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userjoin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_userjoin_pre[hIndex].func;
- preHookFunc(&fd, cmd, source, target, msg);
+ preHookFunc(&fd, &cmd, &source, &target, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34450,25 +35103,25 @@ void HP_ircbot_userjoin(int fd, char *cmd, char *source, char *target, char *msg
{
HPMHooks.source.ircbot.userjoin(fd, cmd, source, target, msg);
}
- if( HPMHooks.count.HP_ircbot_userjoin_post ) {
- void (*postHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userjoin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_userjoin_post > 0) {
+ void (*postHookFunc) (int fd, char *cmd, char *source, char *target, char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userjoin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_userjoin_post[hIndex].func;
- postHookFunc(&fd, cmd, source, target, msg);
+ postHookFunc(fd, cmd, source, target, msg);
}
}
return;
}
void HP_ircbot_userleave(int fd, char *cmd, char *source, char *target, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_userleave_pre ) {
- void (*preHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
+ if (HPMHooks.count.HP_ircbot_userleave_pre > 0) {
+ void (*preHookFunc) (int *fd, char **cmd, char **source, char **target, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userleave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userleave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_userleave_pre[hIndex].func;
- preHookFunc(&fd, cmd, source, target, msg);
+ preHookFunc(&fd, &cmd, &source, &target, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34476,25 +35129,25 @@ void HP_ircbot_userleave(int fd, char *cmd, char *source, char *target, char *ms
{
HPMHooks.source.ircbot.userleave(fd, cmd, source, target, msg);
}
- if( HPMHooks.count.HP_ircbot_userleave_post ) {
- void (*postHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userleave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_userleave_post > 0) {
+ void (*postHookFunc) (int fd, char *cmd, char *source, char *target, char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_userleave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_userleave_post[hIndex].func;
- postHookFunc(&fd, cmd, source, target, msg);
+ postHookFunc(fd, cmd, source, target, msg);
}
}
return;
}
void HP_ircbot_usernick(int fd, char *cmd, char *source, char *target, char *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_ircbot_usernick_pre ) {
- void (*preHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
+ if (HPMHooks.count.HP_ircbot_usernick_pre > 0) {
+ void (*preHookFunc) (int *fd, char **cmd, char **source, char **target, char **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_usernick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_usernick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_ircbot_usernick_pre[hIndex].func;
- preHookFunc(&fd, cmd, source, target, msg);
+ preHookFunc(&fd, &cmd, &source, &target, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34502,26 +35155,26 @@ void HP_ircbot_usernick(int fd, char *cmd, char *source, char *target, char *msg
{
HPMHooks.source.ircbot.usernick(fd, cmd, source, target, msg);
}
- if( HPMHooks.count.HP_ircbot_usernick_post ) {
- void (*postHookFunc) (int *fd, char *cmd, char *source, char *target, char *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_usernick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_ircbot_usernick_post > 0) {
+ void (*postHookFunc) (int fd, char *cmd, char *source, char *target, char *msg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_ircbot_usernick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_ircbot_usernick_post[hIndex].func;
- postHookFunc(&fd, cmd, source, target, msg);
+ postHookFunc(fd, cmd, source, target, msg);
}
}
return;
}
-/* itemdb */
+/* itemdb_interface */
void HP_itemdb_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_init_pre ) {
+ if (HPMHooks.count.HP_itemdb_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34529,25 +35182,25 @@ void HP_itemdb_init(bool minimal) {
{
HPMHooks.source.itemdb.init(minimal);
}
- if( HPMHooks.count.HP_itemdb_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_itemdb_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_final_pre ) {
+ if (HPMHooks.count.HP_itemdb_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34555,9 +35208,9 @@ void HP_itemdb_final(void) {
{
HPMHooks.source.itemdb.final();
}
- if( HPMHooks.count.HP_itemdb_final_post ) {
+ if (HPMHooks.count.HP_itemdb_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_final_post[hIndex].func;
postHookFunc();
}
@@ -34566,14 +35219,14 @@ void HP_itemdb_final(void) {
}
void HP_itemdb_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_reload_pre ) {
+ if (HPMHooks.count.HP_itemdb_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34581,9 +35234,9 @@ void HP_itemdb_reload(void) {
{
HPMHooks.source.itemdb.reload();
}
- if( HPMHooks.count.HP_itemdb_reload_post ) {
+ if (HPMHooks.count.HP_itemdb_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_reload_post[hIndex].func;
postHookFunc();
}
@@ -34592,14 +35245,14 @@ void HP_itemdb_reload(void) {
}
void HP_itemdb_name_constants(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_name_constants_pre ) {
+ if (HPMHooks.count.HP_itemdb_name_constants_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name_constants_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name_constants_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_name_constants_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34607,9 +35260,9 @@ void HP_itemdb_name_constants(void) {
{
HPMHooks.source.itemdb.name_constants();
}
- if( HPMHooks.count.HP_itemdb_name_constants_post ) {
+ if (HPMHooks.count.HP_itemdb_name_constants_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name_constants_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name_constants_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_name_constants_post[hIndex].func;
postHookFunc();
}
@@ -34618,14 +35271,14 @@ void HP_itemdb_name_constants(void) {
}
void HP_itemdb_read_groups(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_read_groups_pre ) {
+ if (HPMHooks.count.HP_itemdb_read_groups_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_groups_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_groups_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_read_groups_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34633,9 +35286,9 @@ void HP_itemdb_read_groups(void) {
{
HPMHooks.source.itemdb.read_groups();
}
- if( HPMHooks.count.HP_itemdb_read_groups_post ) {
+ if (HPMHooks.count.HP_itemdb_read_groups_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_groups_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_groups_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_read_groups_post[hIndex].func;
postHookFunc();
}
@@ -34644,14 +35297,14 @@ void HP_itemdb_read_groups(void) {
}
void HP_itemdb_read_chains(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_read_chains_pre ) {
+ if (HPMHooks.count.HP_itemdb_read_chains_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_chains_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_chains_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_read_chains_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34659,9 +35312,9 @@ void HP_itemdb_read_chains(void) {
{
HPMHooks.source.itemdb.read_chains();
}
- if( HPMHooks.count.HP_itemdb_read_chains_post ) {
+ if (HPMHooks.count.HP_itemdb_read_chains_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_chains_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_chains_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_read_chains_post[hIndex].func;
postHookFunc();
}
@@ -34670,14 +35323,14 @@ void HP_itemdb_read_chains(void) {
}
void HP_itemdb_read_packages(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_read_packages_pre ) {
+ if (HPMHooks.count.HP_itemdb_read_packages_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_packages_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_packages_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_read_packages_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34685,25 +35338,51 @@ void HP_itemdb_read_packages(void) {
{
HPMHooks.source.itemdb.read_packages();
}
- if( HPMHooks.count.HP_itemdb_read_packages_post ) {
+ if (HPMHooks.count.HP_itemdb_read_packages_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_packages_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_packages_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_read_packages_post[hIndex].func;
postHookFunc();
}
}
return;
}
+void HP_itemdb_read_options(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_itemdb_read_options_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_itemdb_read_options_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.itemdb.read_options();
+ }
+ if (HPMHooks.count.HP_itemdb_read_options_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_itemdb_read_options_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
void HP_itemdb_write_cached_packages(const char *config_filename) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_write_cached_packages_pre ) {
- void (*preHookFunc) (const char *config_filename);
+ if (HPMHooks.count.HP_itemdb_write_cached_packages_pre > 0) {
+ void (*preHookFunc) (const char **config_filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_write_cached_packages_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_write_cached_packages_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_write_cached_packages_pre[hIndex].func;
- preHookFunc(config_filename);
+ preHookFunc(&config_filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -34711,9 +35390,9 @@ void HP_itemdb_write_cached_packages(const char *config_filename) {
{
HPMHooks.source.itemdb.write_cached_packages(config_filename);
}
- if( HPMHooks.count.HP_itemdb_write_cached_packages_post ) {
+ if (HPMHooks.count.HP_itemdb_write_cached_packages_post > 0) {
void (*postHookFunc) (const char *config_filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_write_cached_packages_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_write_cached_packages_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_write_cached_packages_post[hIndex].func;
postHookFunc(config_filename);
}
@@ -34723,14 +35402,14 @@ void HP_itemdb_write_cached_packages(const char *config_filename) {
bool HP_itemdb_read_cached_packages(const char *config_filename) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_itemdb_read_cached_packages_pre ) {
- bool (*preHookFunc) (const char *config_filename);
+ if (HPMHooks.count.HP_itemdb_read_cached_packages_pre > 0) {
+ bool (*preHookFunc) (const char **config_filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_cached_packages_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_cached_packages_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_read_cached_packages_pre[hIndex].func;
- retVal___ = preHookFunc(config_filename);
+ retVal___ = preHookFunc(&config_filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34738,9 +35417,9 @@ bool HP_itemdb_read_cached_packages(const char *config_filename) {
{
retVal___ = HPMHooks.source.itemdb.read_cached_packages(config_filename);
}
- if( HPMHooks.count.HP_itemdb_read_cached_packages_post ) {
+ if (HPMHooks.count.HP_itemdb_read_cached_packages_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *config_filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_cached_packages_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_cached_packages_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_read_cached_packages_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config_filename);
}
@@ -34750,14 +35429,14 @@ bool HP_itemdb_read_cached_packages(const char *config_filename) {
struct item_data* HP_itemdb_name2id(const char *str) {
int hIndex = 0;
struct item_data* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_name2id_pre ) {
- struct item_data* (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_itemdb_name2id_pre > 0) {
+ struct item_data* (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name2id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name2id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_name2id_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34765,9 +35444,9 @@ struct item_data* HP_itemdb_name2id(const char *str) {
{
retVal___ = HPMHooks.source.itemdb.name2id(str);
}
- if( HPMHooks.count.HP_itemdb_name2id_post ) {
+ if (HPMHooks.count.HP_itemdb_name2id_post > 0) {
struct item_data* (*postHookFunc) (struct item_data* retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name2id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_name2id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_name2id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -34777,14 +35456,14 @@ struct item_data* HP_itemdb_name2id(const char *str) {
struct item_data* HP_itemdb_search_name(const char *name) {
int hIndex = 0;
struct item_data* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_search_name_pre ) {
- struct item_data* (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_itemdb_search_name_pre > 0) {
+ struct item_data* (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_search_name_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34792,9 +35471,9 @@ struct item_data* HP_itemdb_search_name(const char *name) {
{
retVal___ = HPMHooks.source.itemdb.search_name(name);
}
- if( HPMHooks.count.HP_itemdb_search_name_post ) {
+ if (HPMHooks.count.HP_itemdb_search_name_post > 0) {
struct item_data* (*postHookFunc) (struct item_data* retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_search_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -34804,14 +35483,14 @@ struct item_data* HP_itemdb_search_name(const char *name) {
int HP_itemdb_search_name_array(struct item_data **data, int size, const char *str, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_search_name_array_pre ) {
- int (*preHookFunc) (struct item_data **data, int *size, const char *str, int *flag);
+ if (HPMHooks.count.HP_itemdb_search_name_array_pre > 0) {
+ int (*preHookFunc) (struct item_data ***data, int *size, const char **str, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_array_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_array_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_search_name_array_pre[hIndex].func;
- retVal___ = preHookFunc(data, &size, str, &flag);
+ retVal___ = preHookFunc(&data, &size, &str, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34819,11 +35498,11 @@ int HP_itemdb_search_name_array(struct item_data **data, int size, const char *s
{
retVal___ = HPMHooks.source.itemdb.search_name_array(data, size, str, flag);
}
- if( HPMHooks.count.HP_itemdb_search_name_array_post ) {
- int (*postHookFunc) (int retVal___, struct item_data **data, int *size, const char *str, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_array_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_search_name_array_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data **data, int size, const char *str, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_name_array_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_search_name_array_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, data, &size, str, &flag);
+ retVal___ = postHookFunc(retVal___, data, size, str, flag);
}
}
return retVal___;
@@ -34831,14 +35510,14 @@ int HP_itemdb_search_name_array(struct item_data **data, int size, const char *s
struct item_data* HP_itemdb_load(int nameid) {
int hIndex = 0;
struct item_data* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_load_pre ) {
+ if (HPMHooks.count.HP_itemdb_load_pre > 0) {
struct item_data* (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_load_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34846,11 +35525,11 @@ struct item_data* HP_itemdb_load(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.load(nameid);
}
- if( HPMHooks.count.HP_itemdb_load_post ) {
- struct item_data* (*postHookFunc) (struct item_data* retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_load_post > 0) {
+ struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_load_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
}
}
return retVal___;
@@ -34858,14 +35537,14 @@ struct item_data* HP_itemdb_load(int nameid) {
struct item_data* HP_itemdb_search(int nameid) {
int hIndex = 0;
struct item_data* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_search_pre ) {
+ if (HPMHooks.count.HP_itemdb_search_pre > 0) {
struct item_data* (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_search_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34873,11 +35552,11 @@ struct item_data* HP_itemdb_search(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.search(nameid);
}
- if( HPMHooks.count.HP_itemdb_search_post ) {
- struct item_data* (*postHookFunc) (struct item_data* retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_search_post > 0) {
+ struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
}
}
return retVal___;
@@ -34885,14 +35564,14 @@ struct item_data* HP_itemdb_search(int nameid) {
struct item_data* HP_itemdb_exists(int nameid) {
int hIndex = 0;
struct item_data* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_exists_pre ) {
+ if (HPMHooks.count.HP_itemdb_exists_pre > 0) {
struct item_data* (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_exists_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_exists_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_exists_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34900,11 +35579,38 @@ struct item_data* HP_itemdb_exists(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.exists(nameid);
}
- if( HPMHooks.count.HP_itemdb_exists_post ) {
- struct item_data* (*postHookFunc) (struct item_data* retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_exists_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_exists_post > 0) {
+ struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_exists_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_exists_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
+ }
+ }
+ return retVal___;
+}
+struct item_option* HP_itemdb_option_exists(int idx) {
+ int hIndex = 0;
+ struct item_option* retVal___ = NULL;
+ if (HPMHooks.count.HP_itemdb_option_exists_pre > 0) {
+ struct item_option* (*preHookFunc) (int *idx);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_option_exists_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_itemdb_option_exists_pre[hIndex].func;
+ retVal___ = preHookFunc(&idx);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.itemdb.option_exists(idx);
+ }
+ if (HPMHooks.count.HP_itemdb_option_exists_post > 0) {
+ struct item_option* (*postHookFunc) (struct item_option* retVal___, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_option_exists_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_itemdb_option_exists_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, idx);
}
}
return retVal___;
@@ -34912,14 +35618,14 @@ struct item_data* HP_itemdb_exists(int nameid) {
bool HP_itemdb_in_group(struct item_group *group, int nameid) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_itemdb_in_group_pre ) {
- bool (*preHookFunc) (struct item_group *group, int *nameid);
+ if (HPMHooks.count.HP_itemdb_in_group_pre > 0) {
+ bool (*preHookFunc) (struct item_group **group, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_in_group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_in_group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_in_group_pre[hIndex].func;
- retVal___ = preHookFunc(group, &nameid);
+ retVal___ = preHookFunc(&group, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34927,11 +35633,11 @@ bool HP_itemdb_in_group(struct item_group *group, int nameid) {
{
retVal___ = HPMHooks.source.itemdb.in_group(group, nameid);
}
- if( HPMHooks.count.HP_itemdb_in_group_post ) {
- bool (*postHookFunc) (bool retVal___, struct item_group *group, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_in_group_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_in_group_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct item_group *group, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_in_group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_in_group_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, group, &nameid);
+ retVal___ = postHookFunc(retVal___, group, nameid);
}
}
return retVal___;
@@ -34939,14 +35645,14 @@ bool HP_itemdb_in_group(struct item_group *group, int nameid) {
int HP_itemdb_group_item(struct item_group *group) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_group_item_pre ) {
- int (*preHookFunc) (struct item_group *group);
+ if (HPMHooks.count.HP_itemdb_group_item_pre > 0) {
+ int (*preHookFunc) (struct item_group **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_group_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_group_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_group_item_pre[hIndex].func;
- retVal___ = preHookFunc(group);
+ retVal___ = preHookFunc(&group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34954,9 +35660,9 @@ int HP_itemdb_group_item(struct item_group *group) {
{
retVal___ = HPMHooks.source.itemdb.group_item(group);
}
- if( HPMHooks.count.HP_itemdb_group_item_post ) {
+ if (HPMHooks.count.HP_itemdb_group_item_post > 0) {
int (*postHookFunc) (int retVal___, struct item_group *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_group_item_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_group_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_group_item_post[hIndex].func;
retVal___ = postHookFunc(retVal___, group);
}
@@ -34966,14 +35672,14 @@ int HP_itemdb_group_item(struct item_group *group) {
int HP_itemdb_chain_item(unsigned short chain_id, int *rate) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_chain_item_pre ) {
- int (*preHookFunc) (unsigned short *chain_id, int *rate);
+ if (HPMHooks.count.HP_itemdb_chain_item_pre > 0) {
+ int (*preHookFunc) (unsigned short *chain_id, int **rate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_chain_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_chain_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_chain_item_pre[hIndex].func;
- retVal___ = preHookFunc(&chain_id, rate);
+ retVal___ = preHookFunc(&chain_id, &rate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -34981,25 +35687,25 @@ int HP_itemdb_chain_item(unsigned short chain_id, int *rate) {
{
retVal___ = HPMHooks.source.itemdb.chain_item(chain_id, rate);
}
- if( HPMHooks.count.HP_itemdb_chain_item_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *chain_id, int *rate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_chain_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_chain_item_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short chain_id, int *rate);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_chain_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_chain_item_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &chain_id, rate);
+ retVal___ = postHookFunc(retVal___, chain_id, rate);
}
}
return retVal___;
}
void HP_itemdb_package_item(struct map_session_data *sd, struct item_package *package) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_package_item_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item_package *package);
+ if (HPMHooks.count.HP_itemdb_package_item_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item_package **package);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_package_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_package_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_package_item_pre[hIndex].func;
- preHookFunc(sd, package);
+ preHookFunc(&sd, &package);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35007,28 +35713,28 @@ void HP_itemdb_package_item(struct map_session_data *sd, struct item_package *pa
{
HPMHooks.source.itemdb.package_item(sd, package);
}
- if( HPMHooks.count.HP_itemdb_package_item_post ) {
+ if (HPMHooks.count.HP_itemdb_package_item_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct item_package *package);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_package_item_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_package_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_package_item_post[hIndex].func;
postHookFunc(sd, package);
}
}
return;
}
-int HP_itemdb_searchname_sub(DBKey key, DBData *data, va_list ap) {
+int HP_itemdb_searchname_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_searchname_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_itemdb_searchname_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_itemdb_searchname_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35038,30 +35744,30 @@ int HP_itemdb_searchname_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.itemdb.searchname_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_itemdb_searchname_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_searchname_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_itemdb_searchname_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap) {
+int HP_itemdb_searchname_array_sub(union DBKey key, struct DBData data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_searchname_array_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_itemdb_searchname_array_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData *data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_array_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_array_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_itemdb_searchname_array_sub_pre[hIndex].func;
retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35071,12 +35777,12 @@ int HP_itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap) {
retVal___ = HPMHooks.source.itemdb.searchname_array_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_itemdb_searchname_array_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_array_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_searchname_array_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchname_array_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_itemdb_searchname_array_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, &data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -35085,14 +35791,14 @@ int HP_itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap) {
int HP_itemdb_searchrandomid(struct item_group *group) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_searchrandomid_pre ) {
- int (*preHookFunc) (struct item_group *group);
+ if (HPMHooks.count.HP_itemdb_searchrandomid_pre > 0) {
+ int (*preHookFunc) (struct item_group **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchrandomid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchrandomid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_searchrandomid_pre[hIndex].func;
- retVal___ = preHookFunc(group);
+ retVal___ = preHookFunc(&group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35100,9 +35806,9 @@ int HP_itemdb_searchrandomid(struct item_group *group) {
{
retVal___ = HPMHooks.source.itemdb.searchrandomid(group);
}
- if( HPMHooks.count.HP_itemdb_searchrandomid_post ) {
+ if (HPMHooks.count.HP_itemdb_searchrandomid_post > 0) {
int (*postHookFunc) (int retVal___, struct item_group *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchrandomid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_searchrandomid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_searchrandomid_post[hIndex].func;
retVal___ = postHookFunc(retVal___, group);
}
@@ -35112,14 +35818,14 @@ int HP_itemdb_searchrandomid(struct item_group *group) {
const char* HP_itemdb_typename(int type) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_typename_pre ) {
+ if (HPMHooks.count.HP_itemdb_typename_pre > 0) {
const char* (*preHookFunc) (int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_typename_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_typename_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_typename_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35127,51 +35833,77 @@ const char* HP_itemdb_typename(int type) {
{
retVal___ = HPMHooks.source.itemdb.typename(type);
}
- if( HPMHooks.count.HP_itemdb_typename_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_typename_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_typename_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_typename_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_typename_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
}
-void HP_itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask) {
+void HP_itemdb_jobmask2mapid(uint64 *bclass, uint64 jobmask) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_jobid2mapid_pre ) {
- void (*preHookFunc) (unsigned int *bclass, unsigned int *jobmask);
+ if (HPMHooks.count.HP_itemdb_jobmask2mapid_pre > 0) {
+ void (*preHookFunc) (uint64 **bclass, uint64 *jobmask);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_jobid2mapid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_jobmask2mapid_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_itemdb_jobmask2mapid_pre[hIndex].func;
+ preHookFunc(&bclass, &jobmask);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.itemdb.jobmask2mapid(bclass, jobmask);
+ }
+ if (HPMHooks.count.HP_itemdb_jobmask2mapid_post > 0) {
+ void (*postHookFunc) (uint64 *bclass, uint64 jobmask);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_jobmask2mapid_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_itemdb_jobmask2mapid_post[hIndex].func;
+ postHookFunc(bclass, jobmask);
+ }
+ }
+ return;
+}
+void HP_itemdb_jobid2mapid(uint64 *bclass, int job_class, bool enable) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_itemdb_jobid2mapid_pre > 0) {
+ void (*preHookFunc) (uint64 **bclass, int *job_class, bool *enable);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_jobid2mapid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_jobid2mapid_pre[hIndex].func;
- preHookFunc(bclass, &jobmask);
+ preHookFunc(&bclass, &job_class, &enable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.itemdb.jobid2mapid(bclass, jobmask);
+ HPMHooks.source.itemdb.jobid2mapid(bclass, job_class, enable);
}
- if( HPMHooks.count.HP_itemdb_jobid2mapid_post ) {
- void (*postHookFunc) (unsigned int *bclass, unsigned int *jobmask);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_jobid2mapid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_jobid2mapid_post > 0) {
+ void (*postHookFunc) (uint64 *bclass, int job_class, bool enable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_jobid2mapid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_jobid2mapid_post[hIndex].func;
- postHookFunc(bclass, &jobmask);
+ postHookFunc(bclass, job_class, enable);
}
}
return;
}
void HP_itemdb_create_dummy_data(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_create_dummy_data_pre ) {
+ if (HPMHooks.count.HP_itemdb_create_dummy_data_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_dummy_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_dummy_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_create_dummy_data_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35179,9 +35911,9 @@ void HP_itemdb_create_dummy_data(void) {
{
HPMHooks.source.itemdb.create_dummy_data();
}
- if( HPMHooks.count.HP_itemdb_create_dummy_data_post ) {
+ if (HPMHooks.count.HP_itemdb_create_dummy_data_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_dummy_data_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_dummy_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_create_dummy_data_post[hIndex].func;
postHookFunc();
}
@@ -35191,14 +35923,14 @@ void HP_itemdb_create_dummy_data(void) {
struct item_data* HP_itemdb_create_item_data(int nameid) {
int hIndex = 0;
struct item_data* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_create_item_data_pre ) {
+ if (HPMHooks.count.HP_itemdb_create_item_data_pre > 0) {
struct item_data* (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_item_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_item_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_create_item_data_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35206,11 +35938,11 @@ struct item_data* HP_itemdb_create_item_data(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.create_item_data(nameid);
}
- if( HPMHooks.count.HP_itemdb_create_item_data_post ) {
- struct item_data* (*postHookFunc) (struct item_data* retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_item_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_create_item_data_post > 0) {
+ struct item_data* (*postHookFunc) (struct item_data* retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_create_item_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_create_item_data_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
}
}
return retVal___;
@@ -35218,14 +35950,14 @@ struct item_data* HP_itemdb_create_item_data(int nameid) {
int HP_itemdb_isequip(int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isequip_pre ) {
+ if (HPMHooks.count.HP_itemdb_isequip_pre > 0) {
int (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isequip_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35233,11 +35965,11 @@ int HP_itemdb_isequip(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.isequip(nameid);
}
- if( HPMHooks.count.HP_itemdb_isequip_post ) {
- int (*postHookFunc) (int retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_isequip_post > 0) {
+ int (*postHookFunc) (int retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isequip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
}
}
return retVal___;
@@ -35245,14 +35977,14 @@ int HP_itemdb_isequip(int nameid) {
int HP_itemdb_isequip2(struct item_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isequip2_pre ) {
- int (*preHookFunc) (struct item_data *data);
+ if (HPMHooks.count.HP_itemdb_isequip2_pre > 0) {
+ int (*preHookFunc) (struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isequip2_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35260,9 +35992,9 @@ int HP_itemdb_isequip2(struct item_data *data) {
{
retVal___ = HPMHooks.source.itemdb.isequip2(data);
}
- if( HPMHooks.count.HP_itemdb_isequip2_post ) {
+ if (HPMHooks.count.HP_itemdb_isequip2_post > 0) {
int (*postHookFunc) (int retVal___, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isequip2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isequip2_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -35272,14 +36004,14 @@ int HP_itemdb_isequip2(struct item_data *data) {
int HP_itemdb_isstackable(int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isstackable_pre ) {
+ if (HPMHooks.count.HP_itemdb_isstackable_pre > 0) {
int (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isstackable_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35287,11 +36019,11 @@ int HP_itemdb_isstackable(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.isstackable(nameid);
}
- if( HPMHooks.count.HP_itemdb_isstackable_post ) {
- int (*postHookFunc) (int retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_isstackable_post > 0) {
+ int (*postHookFunc) (int retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isstackable_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
}
}
return retVal___;
@@ -35299,14 +36031,14 @@ int HP_itemdb_isstackable(int nameid) {
int HP_itemdb_isstackable2(struct item_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isstackable2_pre ) {
- int (*preHookFunc) (struct item_data *data);
+ if (HPMHooks.count.HP_itemdb_isstackable2_pre > 0) {
+ int (*preHookFunc) (struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isstackable2_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35314,9 +36046,9 @@ int HP_itemdb_isstackable2(struct item_data *data) {
{
retVal___ = HPMHooks.source.itemdb.isstackable2(data);
}
- if( HPMHooks.count.HP_itemdb_isstackable2_post ) {
+ if (HPMHooks.count.HP_itemdb_isstackable2_post > 0) {
int (*postHookFunc) (int retVal___, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isstackable2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isstackable2_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -35326,14 +36058,14 @@ int HP_itemdb_isstackable2(struct item_data *data) {
int HP_itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isdropable_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_isdropable_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isdropable_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isdropable_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isdropable_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35341,11 +36073,11 @@ int HP_itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.isdropable_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_isdropable_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isdropable_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_isdropable_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isdropable_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isdropable_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35353,14 +36085,14 @@ int HP_itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_cantrade_sub(struct item_data *item, int gmlv, int gmlv2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_cantrade_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *gmlv2);
+ if (HPMHooks.count.HP_itemdb_cantrade_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *gmlv2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cantrade_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cantrade_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_cantrade_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &gmlv2);
+ retVal___ = preHookFunc(&item, &gmlv, &gmlv2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35368,11 +36100,11 @@ int HP_itemdb_cantrade_sub(struct item_data *item, int gmlv, int gmlv2) {
{
retVal___ = HPMHooks.source.itemdb.cantrade_sub(item, gmlv, gmlv2);
}
- if( HPMHooks.count.HP_itemdb_cantrade_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *gmlv2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cantrade_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_cantrade_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int gmlv2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cantrade_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_cantrade_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &gmlv2);
+ retVal___ = postHookFunc(retVal___, item, gmlv, gmlv2);
}
}
return retVal___;
@@ -35380,14 +36112,14 @@ int HP_itemdb_cantrade_sub(struct item_data *item, int gmlv, int gmlv2) {
int HP_itemdb_canpartnertrade_sub(struct item_data *item, int gmlv, int gmlv2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_canpartnertrade_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *gmlv2);
+ if (HPMHooks.count.HP_itemdb_canpartnertrade_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *gmlv2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canpartnertrade_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canpartnertrade_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_canpartnertrade_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &gmlv2);
+ retVal___ = preHookFunc(&item, &gmlv, &gmlv2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35395,11 +36127,11 @@ int HP_itemdb_canpartnertrade_sub(struct item_data *item, int gmlv, int gmlv2) {
{
retVal___ = HPMHooks.source.itemdb.canpartnertrade_sub(item, gmlv, gmlv2);
}
- if( HPMHooks.count.HP_itemdb_canpartnertrade_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *gmlv2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canpartnertrade_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_canpartnertrade_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int gmlv2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canpartnertrade_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_canpartnertrade_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &gmlv2);
+ retVal___ = postHookFunc(retVal___, item, gmlv, gmlv2);
}
}
return retVal___;
@@ -35407,14 +36139,14 @@ int HP_itemdb_canpartnertrade_sub(struct item_data *item, int gmlv, int gmlv2) {
int HP_itemdb_cansell_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_cansell_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_cansell_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cansell_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cansell_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_cansell_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35422,11 +36154,11 @@ int HP_itemdb_cansell_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.cansell_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_cansell_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cansell_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_cansell_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cansell_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_cansell_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35434,14 +36166,14 @@ int HP_itemdb_cansell_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_cancartstore_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_cancartstore_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_cancartstore_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cancartstore_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cancartstore_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_cancartstore_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35449,11 +36181,11 @@ int HP_itemdb_cancartstore_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.cancartstore_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_cancartstore_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cancartstore_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_cancartstore_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_cancartstore_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_cancartstore_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35461,14 +36193,14 @@ int HP_itemdb_cancartstore_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_canstore_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_canstore_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_canstore_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canstore_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canstore_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_canstore_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35476,11 +36208,11 @@ int HP_itemdb_canstore_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.canstore_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_canstore_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canstore_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_canstore_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canstore_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_canstore_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35488,14 +36220,14 @@ int HP_itemdb_canstore_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_canguildstore_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_canguildstore_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_canguildstore_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canguildstore_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canguildstore_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_canguildstore_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35503,11 +36235,11 @@ int HP_itemdb_canguildstore_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.canguildstore_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_canguildstore_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canguildstore_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_canguildstore_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canguildstore_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_canguildstore_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35515,14 +36247,14 @@ int HP_itemdb_canguildstore_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_canmail_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_canmail_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_canmail_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canmail_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canmail_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_canmail_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35530,11 +36262,11 @@ int HP_itemdb_canmail_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.canmail_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_canmail_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canmail_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_canmail_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canmail_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_canmail_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35542,14 +36274,14 @@ int HP_itemdb_canmail_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_canauction_sub(struct item_data *item, int gmlv, int unused) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_canauction_sub_pre ) {
- int (*preHookFunc) (struct item_data *item, int *gmlv, int *unused);
+ if (HPMHooks.count.HP_itemdb_canauction_sub_pre > 0) {
+ int (*preHookFunc) (struct item_data **item, int *gmlv, int *unused);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canauction_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canauction_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_canauction_sub_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &unused);
+ retVal___ = preHookFunc(&item, &gmlv, &unused);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35557,11 +36289,11 @@ int HP_itemdb_canauction_sub(struct item_data *item, int gmlv, int unused) {
{
retVal___ = HPMHooks.source.itemdb.canauction_sub(item, gmlv, unused);
}
- if( HPMHooks.count.HP_itemdb_canauction_sub_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *item, int *gmlv, int *unused);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canauction_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_canauction_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *item, int gmlv, int unused);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_canauction_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_canauction_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &unused);
+ retVal___ = postHookFunc(retVal___, item, gmlv, unused);
}
}
return retVal___;
@@ -35569,14 +36301,14 @@ int HP_itemdb_canauction_sub(struct item_data *item, int gmlv, int unused) {
int HP_itemdb_isrestricted(struct item *item, int gmlv, int gmlv2, int ( *func ) (struct item_data *, int, int)) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isrestricted_pre ) {
- int (*preHookFunc) (struct item *item, int *gmlv, int *gmlv2, int ( *func ) (struct item_data *, int, int));
+ if (HPMHooks.count.HP_itemdb_isrestricted_pre > 0) {
+ int (*preHookFunc) (struct item **item, int *gmlv, int *gmlv2, int ( **func ) (struct item_data *, int, int));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isrestricted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isrestricted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isrestricted_pre[hIndex].func;
- retVal___ = preHookFunc(item, &gmlv, &gmlv2, func);
+ retVal___ = preHookFunc(&item, &gmlv, &gmlv2, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35584,11 +36316,11 @@ int HP_itemdb_isrestricted(struct item *item, int gmlv, int gmlv2, int ( *func )
{
retVal___ = HPMHooks.source.itemdb.isrestricted(item, gmlv, gmlv2, func);
}
- if( HPMHooks.count.HP_itemdb_isrestricted_post ) {
- int (*postHookFunc) (int retVal___, struct item *item, int *gmlv, int *gmlv2, int ( *func ) (struct item_data *, int, int));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isrestricted_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_isrestricted_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item *item, int gmlv, int gmlv2, int ( *func ) (struct item_data *, int, int));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isrestricted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isrestricted_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, item, &gmlv, &gmlv2, func);
+ retVal___ = postHookFunc(retVal___, item, gmlv, gmlv2, func);
}
}
return retVal___;
@@ -35596,14 +36328,14 @@ int HP_itemdb_isrestricted(struct item *item, int gmlv, int gmlv2, int ( *func )
int HP_itemdb_isidentified(int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isidentified_pre ) {
+ if (HPMHooks.count.HP_itemdb_isidentified_pre > 0) {
int (*preHookFunc) (int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isidentified_pre[hIndex].func;
retVal___ = preHookFunc(&nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35611,11 +36343,11 @@ int HP_itemdb_isidentified(int nameid) {
{
retVal___ = HPMHooks.source.itemdb.isidentified(nameid);
}
- if( HPMHooks.count.HP_itemdb_isidentified_post ) {
- int (*postHookFunc) (int retVal___, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_isidentified_post > 0) {
+ int (*postHookFunc) (int retVal___, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isidentified_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid);
+ retVal___ = postHookFunc(retVal___, nameid);
}
}
return retVal___;
@@ -35623,14 +36355,14 @@ int HP_itemdb_isidentified(int nameid) {
int HP_itemdb_isidentified2(struct item_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_isidentified2_pre ) {
- int (*preHookFunc) (struct item_data *data);
+ if (HPMHooks.count.HP_itemdb_isidentified2_pre > 0) {
+ int (*preHookFunc) (struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_isidentified2_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35638,9 +36370,9 @@ int HP_itemdb_isidentified2(struct item_data *data) {
{
retVal___ = HPMHooks.source.itemdb.isidentified2(data);
}
- if( HPMHooks.count.HP_itemdb_isidentified2_post ) {
+ if (HPMHooks.count.HP_itemdb_isidentified2_post > 0) {
int (*postHookFunc) (int retVal___, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_isidentified2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_isidentified2_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -35650,14 +36382,14 @@ int HP_itemdb_isidentified2(struct item_data *data) {
int HP_itemdb_combo_split_atoi(char *str, int *val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_combo_split_atoi_pre ) {
- int (*preHookFunc) (char *str, int *val);
+ if (HPMHooks.count.HP_itemdb_combo_split_atoi_pre > 0) {
+ int (*preHookFunc) (char **str, int **val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_combo_split_atoi_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_combo_split_atoi_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_combo_split_atoi_pre[hIndex].func;
- retVal___ = preHookFunc(str, val);
+ retVal___ = preHookFunc(&str, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35665,9 +36397,9 @@ int HP_itemdb_combo_split_atoi(char *str, int *val) {
{
retVal___ = HPMHooks.source.itemdb.combo_split_atoi(str, val);
}
- if( HPMHooks.count.HP_itemdb_combo_split_atoi_post ) {
+ if (HPMHooks.count.HP_itemdb_combo_split_atoi_post > 0) {
int (*postHookFunc) (int retVal___, char *str, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_combo_split_atoi_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_combo_split_atoi_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_combo_split_atoi_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str, val);
}
@@ -35676,14 +36408,14 @@ int HP_itemdb_combo_split_atoi(char *str, int *val) {
}
void HP_itemdb_read_combos(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_read_combos_pre ) {
+ if (HPMHooks.count.HP_itemdb_read_combos_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_read_combos_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35691,9 +36423,9 @@ void HP_itemdb_read_combos(void) {
{
HPMHooks.source.itemdb.read_combos();
}
- if( HPMHooks.count.HP_itemdb_read_combos_post ) {
+ if (HPMHooks.count.HP_itemdb_read_combos_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combos_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_combos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_read_combos_post[hIndex].func;
postHookFunc();
}
@@ -35703,14 +36435,14 @@ void HP_itemdb_read_combos(void) {
int HP_itemdb_gendercheck(struct item_data *id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_gendercheck_pre ) {
- int (*preHookFunc) (struct item_data *id);
+ if (HPMHooks.count.HP_itemdb_gendercheck_pre > 0) {
+ int (*preHookFunc) (struct item_data **id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_gendercheck_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_gendercheck_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_gendercheck_pre[hIndex].func;
- retVal___ = preHookFunc(id);
+ retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35718,9 +36450,9 @@ int HP_itemdb_gendercheck(struct item_data *id) {
{
retVal___ = HPMHooks.source.itemdb.gendercheck(id);
}
- if( HPMHooks.count.HP_itemdb_gendercheck_post ) {
+ if (HPMHooks.count.HP_itemdb_gendercheck_post > 0) {
int (*postHookFunc) (int retVal___, struct item_data *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_gendercheck_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_gendercheck_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_gendercheck_post[hIndex].func;
retVal___ = postHookFunc(retVal___, id);
}
@@ -35730,14 +36462,14 @@ int HP_itemdb_gendercheck(struct item_data *id) {
int HP_itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_validate_entry_pre ) {
- int (*preHookFunc) (struct item_data *entry, int *n, const char *source);
+ if (HPMHooks.count.HP_itemdb_validate_entry_pre > 0) {
+ int (*preHookFunc) (struct item_data **entry, int *n, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_validate_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_validate_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_validate_entry_pre[hIndex].func;
- retVal___ = preHookFunc(entry, &n, source);
+ retVal___ = preHookFunc(&entry, &n, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35745,25 +36477,51 @@ int HP_itemdb_validate_entry(struct item_data *entry, int n, const char *source)
{
retVal___ = HPMHooks.source.itemdb.validate_entry(entry, n, source);
}
- if( HPMHooks.count.HP_itemdb_validate_entry_post ) {
- int (*postHookFunc) (int retVal___, struct item_data *entry, int *n, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_validate_entry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_validate_entry_post > 0) {
+ int (*postHookFunc) (int retVal___, struct item_data *entry, int n, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_validate_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_validate_entry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, entry, &n, source);
+ retVal___ = postHookFunc(retVal___, entry, n, source);
}
}
return retVal___;
}
-void HP_itemdb_readdb_additional_fields(int itemid, config_setting_t *it, int n, const char *source) {
+void HP_itemdb_readdb_options_additional_fields(struct item_option *ito, struct config_setting_t *t, const char *source) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_itemdb_readdb_options_additional_fields_pre > 0) {
+ void (*preHookFunc) (struct item_option **ito, struct config_setting_t **t, const char **source);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_options_additional_fields_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_itemdb_readdb_options_additional_fields_pre[hIndex].func;
+ preHookFunc(&ito, &t, &source);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.itemdb.readdb_options_additional_fields(ito, t, source);
+ }
+ if (HPMHooks.count.HP_itemdb_readdb_options_additional_fields_post > 0) {
+ void (*postHookFunc) (struct item_option *ito, struct config_setting_t *t, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_options_additional_fields_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_itemdb_readdb_options_additional_fields_post[hIndex].func;
+ postHookFunc(ito, t, source);
+ }
+ }
+ return;
+}
+void HP_itemdb_readdb_additional_fields(int itemid, struct config_setting_t *it, int n, const char *source) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_readdb_additional_fields_pre ) {
- void (*preHookFunc) (int *itemid, config_setting_t *it, int *n, const char *source);
+ if (HPMHooks.count.HP_itemdb_readdb_additional_fields_pre > 0) {
+ void (*preHookFunc) (int *itemid, struct config_setting_t **it, int *n, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_readdb_additional_fields_pre[hIndex].func;
- preHookFunc(&itemid, it, &n, source);
+ preHookFunc(&itemid, &it, &n, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35771,26 +36529,52 @@ void HP_itemdb_readdb_additional_fields(int itemid, config_setting_t *it, int n,
{
HPMHooks.source.itemdb.readdb_additional_fields(itemid, it, n, source);
}
- if( HPMHooks.count.HP_itemdb_readdb_additional_fields_post ) {
- void (*postHookFunc) (int *itemid, config_setting_t *it, int *n, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_readdb_additional_fields_post > 0) {
+ void (*postHookFunc) (int itemid, struct config_setting_t *it, int n, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_readdb_additional_fields_post[hIndex].func;
- postHookFunc(&itemid, it, &n, source);
+ postHookFunc(itemid, it, n, source);
}
}
return;
}
-int HP_itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source) {
+void HP_itemdb_readdb_job_sub(struct item_data *id, struct config_setting_t *t) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_itemdb_readdb_job_sub_pre > 0) {
+ void (*preHookFunc) (struct item_data **id, struct config_setting_t **t);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_job_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_itemdb_readdb_job_sub_pre[hIndex].func;
+ preHookFunc(&id, &t);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.itemdb.readdb_job_sub(id, t);
+ }
+ if (HPMHooks.count.HP_itemdb_readdb_job_sub_post > 0) {
+ void (*postHookFunc) (struct item_data *id, struct config_setting_t *t);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_job_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_itemdb_readdb_job_sub_post[hIndex].func;
+ postHookFunc(id, t);
+ }
+ }
+ return;
+}
+int HP_itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char *source) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_readdb_libconfig_sub_pre ) {
- int (*preHookFunc) (config_setting_t *it, int *n, const char *source);
+ if (HPMHooks.count.HP_itemdb_readdb_libconfig_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **it, int *n, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_readdb_libconfig_sub_pre[hIndex].func;
- retVal___ = preHookFunc(it, &n, source);
+ retVal___ = preHookFunc(&it, &n, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35798,11 +36582,11 @@ int HP_itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *sour
{
retVal___ = HPMHooks.source.itemdb.readdb_libconfig_sub(it, n, source);
}
- if( HPMHooks.count.HP_itemdb_readdb_libconfig_sub_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *it, int *n, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_readdb_libconfig_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *it, int n, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_readdb_libconfig_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, it, &n, source);
+ retVal___ = postHookFunc(retVal___, it, n, source);
}
}
return retVal___;
@@ -35810,14 +36594,14 @@ int HP_itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *sour
int HP_itemdb_readdb_libconfig(const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_readdb_libconfig_pre ) {
- int (*preHookFunc) (const char *filename);
+ if (HPMHooks.count.HP_itemdb_readdb_libconfig_pre > 0) {
+ int (*preHookFunc) (const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_readdb_libconfig_pre[hIndex].func;
- retVal___ = preHookFunc(filename);
+ retVal___ = preHookFunc(&filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35825,9 +36609,9 @@ int HP_itemdb_readdb_libconfig(const char *filename) {
{
retVal___ = HPMHooks.source.itemdb.readdb_libconfig(filename);
}
- if( HPMHooks.count.HP_itemdb_readdb_libconfig_post ) {
+ if (HPMHooks.count.HP_itemdb_readdb_libconfig_post > 0) {
int (*postHookFunc) (int retVal___, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_libconfig_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_readdb_libconfig_post[hIndex].func;
retVal___ = postHookFunc(retVal___, filename);
}
@@ -35837,14 +36621,14 @@ int HP_itemdb_readdb_libconfig(const char *filename) {
uint64 HP_itemdb_unique_id(struct map_session_data *sd) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_unique_id_pre ) {
- uint64 (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_itemdb_unique_id_pre > 0) {
+ uint64 (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_unique_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_unique_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_unique_id_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35852,9 +36636,9 @@ uint64 HP_itemdb_unique_id(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.itemdb.unique_id(sd);
}
- if( HPMHooks.count.HP_itemdb_unique_id_post ) {
+ if (HPMHooks.count.HP_itemdb_unique_id_post > 0) {
uint64 (*postHookFunc) (uint64 retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_unique_id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_unique_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_unique_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -35863,14 +36647,14 @@ uint64 HP_itemdb_unique_id(struct map_session_data *sd) {
}
void HP_itemdb_read(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_read_pre ) {
+ if (HPMHooks.count.HP_itemdb_read_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_read_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35878,25 +36662,25 @@ void HP_itemdb_read(bool minimal) {
{
HPMHooks.source.itemdb.read(minimal);
}
- if( HPMHooks.count.HP_itemdb_read_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_read_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_read_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_itemdb_destroy_item_data(struct item_data *self, int free_self) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_destroy_item_data_pre ) {
- void (*preHookFunc) (struct item_data *self, int *free_self);
+ if (HPMHooks.count.HP_itemdb_destroy_item_data_pre > 0) {
+ void (*preHookFunc) (struct item_data **self, int *free_self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_destroy_item_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_destroy_item_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_destroy_item_data_pre[hIndex].func;
- preHookFunc(self, &free_self);
+ preHookFunc(&self, &free_self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35904,28 +36688,28 @@ void HP_itemdb_destroy_item_data(struct item_data *self, int free_self) {
{
HPMHooks.source.itemdb.destroy_item_data(self, free_self);
}
- if( HPMHooks.count.HP_itemdb_destroy_item_data_post ) {
- void (*postHookFunc) (struct item_data *self, int *free_self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_destroy_item_data_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_destroy_item_data_post > 0) {
+ void (*postHookFunc) (struct item_data *self, int free_self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_destroy_item_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_destroy_item_data_post[hIndex].func;
- postHookFunc(self, &free_self);
+ postHookFunc(self, free_self);
}
}
return;
}
-int HP_itemdb_final_sub(DBKey key, DBData *data, va_list ap) {
+int HP_itemdb_final_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_itemdb_final_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_itemdb_final_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_itemdb_final_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35935,12 +36719,45 @@ int HP_itemdb_final_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.itemdb.final_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_itemdb_final_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_final_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_final_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_itemdb_final_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
+ va_end(ap___copy);
+ }
+ }
+ return retVal___;
+}
+int HP_itemdb_options_final_sub(union DBKey key, struct DBData *data, va_list ap) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_itemdb_options_final_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_options_final_sub_pre; hIndex++) {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ preHookFunc = HPMHooks.list.HP_itemdb_options_final_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&key, &data, ap___copy);
+ va_end(ap___copy);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ retVal___ = HPMHooks.source.itemdb.options_final_sub(key, data, ap___copy);
+ va_end(ap___copy);
+ }
+ if (HPMHooks.count.HP_itemdb_options_final_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_options_final_sub_post; hIndex++) {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ postHookFunc = HPMHooks.list.HP_itemdb_options_final_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -35948,14 +36765,14 @@ int HP_itemdb_final_sub(DBKey key, DBData *data, va_list ap) {
}
void HP_itemdb_clear(bool total) {
int hIndex = 0;
- if( HPMHooks.count.HP_itemdb_clear_pre ) {
+ if (HPMHooks.count.HP_itemdb_clear_pre > 0) {
void (*preHookFunc) (bool *total);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_clear_pre[hIndex].func;
preHookFunc(&total);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -35963,11 +36780,11 @@ void HP_itemdb_clear(bool total) {
{
HPMHooks.source.itemdb.clear(total);
}
- if( HPMHooks.count.HP_itemdb_clear_post ) {
- void (*postHookFunc) (bool *total);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_clear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_clear_post > 0) {
+ void (*postHookFunc) (bool total);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_clear_post[hIndex].func;
- postHookFunc(&total);
+ postHookFunc(total);
}
}
return;
@@ -35975,14 +36792,14 @@ void HP_itemdb_clear(bool total) {
struct item_combo* HP_itemdb_id2combo(unsigned short id) {
int hIndex = 0;
struct item_combo* retVal___ = NULL;
- if( HPMHooks.count.HP_itemdb_id2combo_pre ) {
+ if (HPMHooks.count.HP_itemdb_id2combo_pre > 0) {
struct item_combo* (*preHookFunc) (unsigned short *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_id2combo_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -35990,11 +36807,11 @@ struct item_combo* HP_itemdb_id2combo(unsigned short id) {
{
retVal___ = HPMHooks.source.itemdb.id2combo(id);
}
- if( HPMHooks.count.HP_itemdb_id2combo_post ) {
- struct item_combo* (*postHookFunc) (struct item_combo* retVal___, unsigned short *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_id2combo_post > 0) {
+ struct item_combo* (*postHookFunc) (struct item_combo* retVal___, unsigned short id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_id2combo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -36002,14 +36819,14 @@ struct item_combo* HP_itemdb_id2combo(unsigned short id) {
bool HP_itemdb_is_item_usable(struct item_data *item) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_itemdb_is_item_usable_pre ) {
- bool (*preHookFunc) (struct item_data *item);
+ if (HPMHooks.count.HP_itemdb_is_item_usable_pre > 0) {
+ bool (*preHookFunc) (struct item_data **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_is_item_usable_pre[hIndex].func;
- retVal___ = preHookFunc(item);
+ retVal___ = preHookFunc(&item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36017,26 +36834,26 @@ bool HP_itemdb_is_item_usable(struct item_data *item) {
{
retVal___ = HPMHooks.source.itemdb.is_item_usable(item);
}
- if( HPMHooks.count.HP_itemdb_is_item_usable_post ) {
+ if (HPMHooks.count.HP_itemdb_is_item_usable_post > 0) {
bool (*postHookFunc) (bool retVal___, struct item_data *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_is_item_usable_post[hIndex].func;
retVal___ = postHookFunc(retVal___, item);
}
}
return retVal___;
}
-bool HP_itemdb_lookup_const(const config_setting_t *it, const char *name, int *value) {
+bool HP_itemdb_lookup_const(const struct config_setting_t *it, const char *name, int *value) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_itemdb_lookup_const_pre ) {
- bool (*preHookFunc) (const config_setting_t *it, const char *name, int *value);
+ if (HPMHooks.count.HP_itemdb_lookup_const_pre > 0) {
+ bool (*preHookFunc) (const struct config_setting_t **it, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_itemdb_lookup_const_pre[hIndex].func;
- retVal___ = preHookFunc(it, name, value);
+ retVal___ = preHookFunc(&it, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36044,27 +36861,27 @@ bool HP_itemdb_lookup_const(const config_setting_t *it, const char *name, int *v
{
retVal___ = HPMHooks.source.itemdb.lookup_const(it, name, value);
}
- if( HPMHooks.count.HP_itemdb_lookup_const_post ) {
- bool (*postHookFunc) (bool retVal___, const config_setting_t *it, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_post; hIndex++ ) {
+ if (HPMHooks.count.HP_itemdb_lookup_const_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct config_setting_t *it, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_itemdb_lookup_const_post[hIndex].func;
retVal___ = postHookFunc(retVal___, it, name, value);
}
}
return retVal___;
}
-/* libconfig */
-int HP_libconfig_read(config_t *config, FILE *stream) {
+/* libconfig_interface */
+int HP_libconfig_read(struct config_t *config, FILE *stream) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_pre ) {
- int (*preHookFunc) (config_t *config, FILE *stream);
+ if (HPMHooks.count.HP_libconfig_read_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, FILE **stream);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_pre[hIndex].func;
- retVal___ = preHookFunc(config, stream);
+ retVal___ = preHookFunc(&config, &stream);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36072,25 +36889,25 @@ int HP_libconfig_read(config_t *config, FILE *stream) {
{
retVal___ = HPMHooks.source.libconfig.read(config, stream);
}
- if( HPMHooks.count.HP_libconfig_read_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, FILE *stream);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, FILE *stream);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, stream);
}
}
return retVal___;
}
-void HP_libconfig_write(const config_t *config, FILE *stream) {
+void HP_libconfig_write(const struct config_t *config, FILE *stream) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_write_pre ) {
- void (*preHookFunc) (const config_t *config, FILE *stream);
+ if (HPMHooks.count.HP_libconfig_write_pre > 0) {
+ void (*preHookFunc) (const struct config_t **config, FILE **stream);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_write_pre[hIndex].func;
- preHookFunc(config, stream);
+ preHookFunc(&config, &stream);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -36098,79 +36915,79 @@ void HP_libconfig_write(const config_t *config, FILE *stream) {
{
HPMHooks.source.libconfig.write(config, stream);
}
- if( HPMHooks.count.HP_libconfig_write_post ) {
- void (*postHookFunc) (const config_t *config, FILE *stream);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_write_post > 0) {
+ void (*postHookFunc) (const struct config_t *config, FILE *stream);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_write_post[hIndex].func;
postHookFunc(config, stream);
}
}
return;
}
-void HP_libconfig_set_auto_convert(config_t *config, int flag) {
+void HP_libconfig_set_options(struct config_t *config, int options) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_auto_convert_pre ) {
- void (*preHookFunc) (config_t *config, int *flag);
+ if (HPMHooks.count.HP_libconfig_set_options_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_auto_convert_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_set_auto_convert_pre[hIndex].func;
- preHookFunc(config, &flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_set_options_pre[hIndex].func;
+ preHookFunc(&config, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.libconfig.set_auto_convert(config, flag);
+ HPMHooks.source.libconfig.set_options(config, options);
}
- if( HPMHooks.count.HP_libconfig_set_auto_convert_post ) {
- void (*postHookFunc) (config_t *config, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_auto_convert_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_set_auto_convert_post[hIndex].func;
- postHookFunc(config, &flag);
+ if (HPMHooks.count.HP_libconfig_set_options_post > 0) {
+ void (*postHookFunc) (struct config_t *config, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_set_options_post[hIndex].func;
+ postHookFunc(config, options);
}
}
return;
}
-int HP_libconfig_get_auto_convert(const config_t *config) {
+int HP_libconfig_get_options(const struct config_t *config) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_get_auto_convert_pre ) {
- int (*preHookFunc) (const config_t *config);
+ if (HPMHooks.count.HP_libconfig_get_options_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_auto_convert_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_get_auto_convert_pre[hIndex].func;
- retVal___ = preHookFunc(config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_options_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_get_options_pre[hIndex].func;
+ retVal___ = preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.libconfig.get_auto_convert(config);
+ retVal___ = HPMHooks.source.libconfig.get_options(config);
}
- if( HPMHooks.count.HP_libconfig_get_auto_convert_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_auto_convert_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_get_auto_convert_post[hIndex].func;
+ if (HPMHooks.count.HP_libconfig_get_options_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_get_options_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_get_options_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config);
}
}
return retVal___;
}
-int HP_libconfig_read_string(config_t *config, const char *str) {
+int HP_libconfig_read_string(struct config_t *config, const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_string_pre ) {
- int (*preHookFunc) (config_t *config, const char *str);
+ if (HPMHooks.count.HP_libconfig_read_string_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_string_pre[hIndex].func;
- retVal___ = preHookFunc(config, str);
+ retVal___ = preHookFunc(&config, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36178,26 +36995,26 @@ int HP_libconfig_read_string(config_t *config, const char *str) {
{
retVal___ = HPMHooks.source.libconfig.read_string(config, str);
}
- if( HPMHooks.count.HP_libconfig_read_string_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_string_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, str);
}
}
return retVal___;
}
-int HP_libconfig_read_file_src(config_t *config, const char *filename) {
+int HP_libconfig_read_file_src(struct config_t *config, const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_file_src_pre ) {
- int (*preHookFunc) (config_t *config, const char *filename);
+ if (HPMHooks.count.HP_libconfig_read_file_src_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_read_file_src_pre[hIndex].func;
- retVal___ = preHookFunc(config, filename);
+ retVal___ = preHookFunc(&config, &filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36205,26 +37022,26 @@ int HP_libconfig_read_file_src(config_t *config, const char *filename) {
{
retVal___ = HPMHooks.source.libconfig.read_file_src(config, filename);
}
- if( HPMHooks.count.HP_libconfig_read_file_src_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_read_file_src_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_read_file_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filename);
}
}
return retVal___;
}
-int HP_libconfig_write_file(config_t *config, const char *filename) {
+int HP_libconfig_write_file(struct config_t *config, const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_write_file_pre ) {
- int (*preHookFunc) (config_t *config, const char *filename);
+ if (HPMHooks.count.HP_libconfig_write_file_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_write_file_pre[hIndex].func;
- retVal___ = preHookFunc(config, filename);
+ retVal___ = preHookFunc(&config, &filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36232,25 +37049,25 @@ int HP_libconfig_write_file(config_t *config, const char *filename) {
{
retVal___ = HPMHooks.source.libconfig.write_file(config, filename);
}
- if( HPMHooks.count.HP_libconfig_write_file_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_write_file_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_write_file_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_write_file_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filename);
}
}
return retVal___;
}
-void HP_libconfig_set_destructor(config_t *config, void ( *destructor ) (void *)) {
+void HP_libconfig_set_destructor(struct config_t *config, void ( *destructor ) (void *)) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_destructor_pre ) {
- void (*preHookFunc) (config_t *config, void ( *destructor ) (void *));
+ if (HPMHooks.count.HP_libconfig_set_destructor_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, void ( **destructor ) (void *));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_destructor_pre[hIndex].func;
- preHookFunc(config, destructor);
+ preHookFunc(&config, &destructor);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -36258,25 +37075,25 @@ void HP_libconfig_set_destructor(config_t *config, void ( *destructor ) (void *)
{
HPMHooks.source.libconfig.set_destructor(config, destructor);
}
- if( HPMHooks.count.HP_libconfig_set_destructor_post ) {
- void (*postHookFunc) (config_t *config, void ( *destructor ) (void *));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_set_destructor_post > 0) {
+ void (*postHookFunc) (struct config_t *config, void ( *destructor ) (void *));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_destructor_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_destructor_post[hIndex].func;
postHookFunc(config, destructor);
}
}
return;
}
-void HP_libconfig_set_include_dir(config_t *config, const char *include_dir) {
+void HP_libconfig_set_include_dir(struct config_t *config, const char *include_dir) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_set_include_dir_pre ) {
- void (*preHookFunc) (config_t *config, const char *include_dir);
+ if (HPMHooks.count.HP_libconfig_set_include_dir_pre > 0) {
+ void (*preHookFunc) (struct config_t **config, const char **include_dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_set_include_dir_pre[hIndex].func;
- preHookFunc(config, include_dir);
+ preHookFunc(&config, &include_dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -36284,25 +37101,25 @@ void HP_libconfig_set_include_dir(config_t *config, const char *include_dir) {
{
HPMHooks.source.libconfig.set_include_dir(config, include_dir);
}
- if( HPMHooks.count.HP_libconfig_set_include_dir_post ) {
- void (*postHookFunc) (config_t *config, const char *include_dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_set_include_dir_post > 0) {
+ void (*postHookFunc) (struct config_t *config, const char *include_dir);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_set_include_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_set_include_dir_post[hIndex].func;
postHookFunc(config, include_dir);
}
}
return;
}
-void HP_libconfig_init(config_t *config) {
+void HP_libconfig_init(struct config_t *config) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_init_pre ) {
- void (*preHookFunc) (config_t *config);
+ if (HPMHooks.count.HP_libconfig_init_pre > 0) {
+ void (*preHookFunc) (struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_init_pre[hIndex].func;
- preHookFunc(config);
+ preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -36310,25 +37127,25 @@ void HP_libconfig_init(config_t *config) {
{
HPMHooks.source.libconfig.init(config);
}
- if( HPMHooks.count.HP_libconfig_init_post ) {
- void (*postHookFunc) (config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_init_post > 0) {
+ void (*postHookFunc) (struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_init_post[hIndex].func;
postHookFunc(config);
}
}
return;
}
-void HP_libconfig_destroy(config_t *config) {
+void HP_libconfig_destroy(struct config_t *config) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_destroy_pre ) {
- void (*preHookFunc) (config_t *config);
+ if (HPMHooks.count.HP_libconfig_destroy_pre > 0) {
+ void (*preHookFunc) (struct config_t **config);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_destroy_pre[hIndex].func;
- preHookFunc(config);
+ preHookFunc(&config);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -36336,26 +37153,26 @@ void HP_libconfig_destroy(config_t *config) {
{
HPMHooks.source.libconfig.destroy(config);
}
- if( HPMHooks.count.HP_libconfig_destroy_post ) {
- void (*postHookFunc) (config_t *config);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_destroy_post > 0) {
+ void (*postHookFunc) (struct config_t *config);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_destroy_post[hIndex].func;
postHookFunc(config);
}
}
return;
}
-int HP_libconfig_setting_get_int(const config_setting_t *setting) {
+int HP_libconfig_setting_get_int(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_int_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36363,26 +37180,26 @@ int HP_libconfig_setting_get_int(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_int(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-long long HP_libconfig_setting_get_int64(const config_setting_t *setting) {
+int64 HP_libconfig_setting_get_int64(const struct config_setting_t *setting) {
int hIndex = 0;
- long long retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int64_pre ) {
- long long (*preHookFunc) (const config_setting_t *setting);
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_pre > 0) {
+ int64 (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36390,26 +37207,26 @@ long long HP_libconfig_setting_get_int64(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_int64(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int64_post ) {
- long long (*postHookFunc) (long long retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-double HP_libconfig_setting_get_float(const config_setting_t *setting) {
+double HP_libconfig_setting_get_float(const struct config_setting_t *setting) {
int hIndex = 0;
double retVal___ = 0.;
- if( HPMHooks.count.HP_libconfig_setting_get_float_pre ) {
- double (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_float_pre > 0) {
+ double (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36417,26 +37234,26 @@ double HP_libconfig_setting_get_float(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_float(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_float_post ) {
- double (*postHookFunc) (double retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_float_post > 0) {
+ double (*postHookFunc) (double retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_bool(const config_setting_t *setting) {
+int HP_libconfig_setting_get_bool(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_bool_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36444,26 +37261,26 @@ int HP_libconfig_setting_get_bool(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_bool(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-const char* HP_libconfig_setting_get_string(const config_setting_t *setting) {
+const char* HP_libconfig_setting_get_string(const struct config_setting_t *setting) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_string_pre ) {
- const char* (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_string_pre > 0) {
+ const char* (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36471,26 +37288,53 @@ const char* HP_libconfig_setting_get_string(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_string(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_string_post ) {
- const char* (*postHookFunc) (const char* retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_string_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_int(const config_setting_t *setting, const char *name, int *value) {
+struct config_setting_t* HP_libconfig_setting_lookup(struct config_setting_t *setting, const char *name) {
+ int hIndex = 0;
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, const char **name);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup(setting, name);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_int(const struct config_setting_t *setting, const char *name, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_int_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36498,26 +37342,26 @@ int HP_libconfig_setting_lookup_int(const config_setting_t *setting, const char
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_int(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_int_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_int64(const config_setting_t *setting, const char *name, long long *value) {
+int HP_libconfig_setting_lookup_int64(const struct config_setting_t *setting, const char *name, int64 *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_int64_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, long long *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int64_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int64 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36525,26 +37369,26 @@ int HP_libconfig_setting_lookup_int64(const config_setting_t *setting, const cha
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_int64(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_int64_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int64 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_float(const config_setting_t *setting, const char *name, double *value) {
+int HP_libconfig_setting_lookup_float(const struct config_setting_t *setting, const char *name, double *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_float_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, double *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_float_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, double **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36552,26 +37396,26 @@ int HP_libconfig_setting_lookup_float(const config_setting_t *setting, const cha
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_float(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_float_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_float_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, double *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_bool(const config_setting_t *setting, const char *name, int *value) {
+int HP_libconfig_setting_lookup_bool(const struct config_setting_t *setting, const char *name, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_bool_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36579,26 +37423,26 @@ int HP_libconfig_setting_lookup_bool(const config_setting_t *setting, const char
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_bool(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_lookup_string(const config_setting_t *setting, const char *name, const char **value) {
+int HP_libconfig_setting_lookup_string(const struct config_setting_t *setting, const char *name, const char **value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_lookup_string_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, const char *name, const char **value);
+ if (HPMHooks.count.HP_libconfig_setting_lookup_string_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, const char ***value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name, value);
+ retVal___ = preHookFunc(&setting, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36606,26 +37450,26 @@ int HP_libconfig_setting_lookup_string(const config_setting_t *setting, const ch
{
retVal___ = HPMHooks.source.libconfig.setting_lookup_string(setting, name, value);
}
- if( HPMHooks.count.HP_libconfig_setting_lookup_string_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, const char *name, const char **value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_lookup_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, const char **value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_int(config_setting_t *setting, int value) {
+int HP_libconfig_setting_set_int(struct config_setting_t *setting, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_int_pre ) {
- int (*preHookFunc) (config_setting_t *setting, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_int_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36633,26 +37477,26 @@ int HP_libconfig_setting_set_int(config_setting_t *setting, int value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_int(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_int64(config_setting_t *setting, long long value) {
+int HP_libconfig_setting_set_int64(struct config_setting_t *setting, int64 value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_int64_pre ) {
- int (*preHookFunc) (config_setting_t *setting, long long *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int64 *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36660,26 +37504,26 @@ int HP_libconfig_setting_set_int64(config_setting_t *setting, long long value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_int64(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int64_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int64 value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_float(config_setting_t *setting, double value) {
+int HP_libconfig_setting_set_float(struct config_setting_t *setting, double value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_float_pre ) {
- int (*preHookFunc) (config_setting_t *setting, double *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_float_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, double *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36687,26 +37531,26 @@ int HP_libconfig_setting_set_float(config_setting_t *setting, double value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_float(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_float_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_float_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, double value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_bool(config_setting_t *setting, int value) {
+int HP_libconfig_setting_set_bool(struct config_setting_t *setting, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_bool_pre ) {
- int (*preHookFunc) (config_setting_t *setting, int *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36714,26 +37558,26 @@ int HP_libconfig_setting_set_bool(config_setting_t *setting, int value) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_bool(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_bool_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &value);
+ retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_string(config_setting_t *setting, const char *value) {
+int HP_libconfig_setting_set_string(struct config_setting_t *setting, const char *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_string_pre ) {
- int (*preHookFunc) (config_setting_t *setting, const char *value);
+ if (HPMHooks.count.HP_libconfig_setting_set_string_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, const char **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_pre[hIndex].func;
- retVal___ = preHookFunc(setting, value);
+ retVal___ = preHookFunc(&setting, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36741,26 +37585,26 @@ int HP_libconfig_setting_set_string(config_setting_t *setting, const char *value
{
retVal___ = HPMHooks.source.libconfig.setting_set_string(setting, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_string_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, const char *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_string_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_set_format(config_setting_t *setting, short format) {
+int HP_libconfig_setting_set_format(struct config_setting_t *setting, short format) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_format_pre ) {
- int (*preHookFunc) (config_setting_t *setting, short *format);
+ if (HPMHooks.count.HP_libconfig_setting_set_format_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **setting, short *format);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_format_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &format);
+ retVal___ = preHookFunc(&setting, &format);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36768,26 +37612,26 @@ int HP_libconfig_setting_set_format(config_setting_t *setting, short format) {
{
retVal___ = HPMHooks.source.libconfig.setting_set_format(setting, format);
}
- if( HPMHooks.count.HP_libconfig_setting_set_format_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *setting, short *format);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_format_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *setting, short format);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_format_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_format_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &format);
+ retVal___ = postHookFunc(retVal___, setting, format);
}
}
return retVal___;
}
-short HP_libconfig_setting_get_format(const config_setting_t *setting) {
+short HP_libconfig_setting_get_format(const struct config_setting_t *setting) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_format_pre ) {
- short (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_get_format_pre > 0) {
+ short (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_format_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36795,26 +37639,26 @@ short HP_libconfig_setting_get_format(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_get_format(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_get_format_post ) {
- short (*postHookFunc) (short retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_format_post > 0) {
+ short (*postHookFunc) (short retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_format_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_format_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_int_elem(const config_setting_t *setting, int idx) {
+int HP_libconfig_setting_get_int_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int_elem_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_int_elem_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36822,26 +37666,26 @@ int HP_libconfig_setting_get_int_elem(const config_setting_t *setting, int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_get_int_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int_elem_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-long long HP_libconfig_setting_get_int64_elem(const config_setting_t *setting, int idx) {
+int64 HP_libconfig_setting_get_int64_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
- long long retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre ) {
- long long (*preHookFunc) (const config_setting_t *setting, int *idx);
+ int64 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre > 0) {
+ int64 (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36849,26 +37693,26 @@ long long HP_libconfig_setting_get_int64_elem(const config_setting_t *setting, i
{
retVal___ = HPMHooks.source.libconfig.setting_get_int64_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_int64_elem_post ) {
- long long (*postHookFunc) (long long retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_int64_elem_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int64_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int64_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-double HP_libconfig_setting_get_float_elem(const config_setting_t *setting, int idx) {
+double HP_libconfig_setting_get_float_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
double retVal___ = 0.;
- if( HPMHooks.count.HP_libconfig_setting_get_float_elem_pre ) {
- double (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_float_elem_pre > 0) {
+ double (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36876,26 +37720,26 @@ double HP_libconfig_setting_get_float_elem(const config_setting_t *setting, int
{
retVal___ = HPMHooks.source.libconfig.setting_get_float_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_float_elem_post ) {
- double (*postHookFunc) (double retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_float_elem_post > 0) {
+ double (*postHookFunc) (double retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_float_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_float_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-int HP_libconfig_setting_get_bool_elem(const config_setting_t *setting, int idx) {
+int HP_libconfig_setting_get_bool_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre ) {
- int (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36903,26 +37747,26 @@ int HP_libconfig_setting_get_bool_elem(const config_setting_t *setting, int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_get_bool_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_bool_elem_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-const char* HP_libconfig_setting_get_string_elem(const config_setting_t *setting, int idx) {
+const char* HP_libconfig_setting_get_string_elem(const struct config_setting_t *setting, int idx) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_string_elem_pre ) {
- const char* (*preHookFunc) (const config_setting_t *setting, int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_get_string_elem_pre > 0) {
+ const char* (*preHookFunc) (const struct config_setting_t **setting, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36930,26 +37774,26 @@ const char* HP_libconfig_setting_get_string_elem(const config_setting_t *setting
{
retVal___ = HPMHooks.source.libconfig.setting_get_string_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_string_elem_post ) {
- const char* (*postHookFunc) (const char* retVal___, const config_setting_t *setting, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_string_elem_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct config_setting_t *setting, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_string_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_string_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_int_elem(config_setting_t *setting, int idx, int value) {
+struct config_setting_t* HP_libconfig_setting_set_int_elem(struct config_setting_t *setting, int idx, int value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_int_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, int *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_int_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36957,26 +37801,26 @@ config_setting_t* HP_libconfig_setting_set_int_elem(config_setting_t *setting, i
{
retVal___ = HPMHooks.source.libconfig.setting_set_int_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_int64_elem(config_setting_t *setting, int idx, long long value) {
+struct config_setting_t* HP_libconfig_setting_set_int64_elem(struct config_setting_t *setting, int idx, int64 value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, long long *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int64 *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -36984,26 +37828,26 @@ config_setting_t* HP_libconfig_setting_set_int64_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_int64_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_int64_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_int64_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int64 value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_int64_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_int64_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_float_elem(config_setting_t *setting, int idx, double value) {
+struct config_setting_t* HP_libconfig_setting_set_float_elem(struct config_setting_t *setting, int idx, double value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_float_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, double *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_float_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, double *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37011,26 +37855,26 @@ config_setting_t* HP_libconfig_setting_set_float_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_float_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_float_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_float_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, double value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_float_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_float_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_bool_elem(config_setting_t *setting, int idx, int value) {
+struct config_setting_t* HP_libconfig_setting_set_bool_elem(struct config_setting_t *setting, int idx, int value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, int *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, &value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37038,26 +37882,26 @@ config_setting_t* HP_libconfig_setting_set_bool_elem(config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_set_bool_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_bool_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_bool_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_bool_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_bool_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, &value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_set_string_elem(config_setting_t *setting, int idx, const char *value) {
+struct config_setting_t* HP_libconfig_setting_set_string_elem(struct config_setting_t *setting, int idx, const char *value) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_set_string_elem_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, int *idx, const char *value);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_set_string_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **setting, int *idx, const char **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx, value);
+ retVal___ = preHookFunc(&setting, &idx, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37065,26 +37909,26 @@ config_setting_t* HP_libconfig_setting_set_string_elem(config_setting_t *setting
{
retVal___ = HPMHooks.source.libconfig.setting_set_string_elem(setting, idx, value);
}
- if( HPMHooks.count.HP_libconfig_setting_set_string_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, int *idx, const char *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_string_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *setting, int idx, const char *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_string_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_string_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx, value);
+ retVal___ = postHookFunc(retVal___, setting, idx, value);
}
}
return retVal___;
}
-int HP_libconfig_setting_index(const config_setting_t *setting) {
+int HP_libconfig_setting_index(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_index_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_index_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_index_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37092,26 +37936,26 @@ int HP_libconfig_setting_index(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_index(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_index_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_index_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_index_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-int HP_libconfig_setting_length(const config_setting_t *setting) {
+int HP_libconfig_setting_length(const struct config_setting_t *setting) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_length_pre ) {
- int (*preHookFunc) (const config_setting_t *setting);
+ if (HPMHooks.count.HP_libconfig_setting_length_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_length_pre[hIndex].func;
- retVal___ = preHookFunc(setting);
+ retVal___ = preHookFunc(&setting);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37119,26 +37963,26 @@ int HP_libconfig_setting_length(const config_setting_t *setting) {
{
retVal___ = HPMHooks.source.libconfig.setting_length(setting);
}
- if( HPMHooks.count.HP_libconfig_setting_length_post ) {
- int (*postHookFunc) (int retVal___, const config_setting_t *setting);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_length_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_length_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_get_elem(const config_setting_t *setting, unsigned int idx) {
+struct config_setting_t* HP_libconfig_setting_get_elem(const struct config_setting_t *setting, unsigned int idx) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_elem_pre ) {
- config_setting_t* (*preHookFunc) (const config_setting_t *setting, unsigned int *idx);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_get_elem_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_pre[hIndex].func;
- retVal___ = preHookFunc(setting, &idx);
+ retVal___ = preHookFunc(&setting, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37146,26 +37990,26 @@ config_setting_t* HP_libconfig_setting_get_elem(const config_setting_t *setting,
{
retVal___ = HPMHooks.source.libconfig.setting_get_elem(setting, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_get_elem_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_setting_t *setting, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_elem_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, &idx);
+ retVal___ = postHookFunc(retVal___, setting, idx);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_get_member(const config_setting_t *setting, const char *name) {
+struct config_setting_t* HP_libconfig_setting_get_member(const struct config_setting_t *setting, const char *name) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_get_member_pre ) {
- config_setting_t* (*preHookFunc) (const config_setting_t *setting, const char *name);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_get_member_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_setting_t **setting, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_pre[hIndex].func;
- retVal___ = preHookFunc(setting, name);
+ retVal___ = preHookFunc(&setting, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37173,26 +38017,26 @@ config_setting_t* HP_libconfig_setting_get_member(const config_setting_t *settin
{
retVal___ = HPMHooks.source.libconfig.setting_get_member(setting, name);
}
- if( HPMHooks.count.HP_libconfig_setting_get_member_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_setting_t *setting, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_get_member_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_setting_t *setting, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_get_member_post[hIndex].func;
retVal___ = postHookFunc(retVal___, setting, name);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_setting_add(config_setting_t *parent, const char *name, int type) {
+struct config_setting_t* HP_libconfig_setting_add(struct config_setting_t *parent, const char *name, int type) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_setting_add_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *parent, const char *name, int *type);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_setting_add_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (struct config_setting_t **parent, const char **name, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_add_pre[hIndex].func;
- retVal___ = preHookFunc(parent, name, &type);
+ retVal___ = preHookFunc(&parent, &name, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37200,26 +38044,26 @@ config_setting_t* HP_libconfig_setting_add(config_setting_t *parent, const char
{
retVal___ = HPMHooks.source.libconfig.setting_add(parent, name, type);
}
- if( HPMHooks.count.HP_libconfig_setting_add_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *parent, const char *name, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_add_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, struct config_setting_t *parent, const char *name, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, parent, name, &type);
+ retVal___ = postHookFunc(retVal___, parent, name, type);
}
}
return retVal___;
}
-int HP_libconfig_setting_remove(config_setting_t *parent, const char *name) {
+int HP_libconfig_setting_remove(struct config_setting_t *parent, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_remove_pre ) {
- int (*preHookFunc) (config_setting_t *parent, const char *name);
+ if (HPMHooks.count.HP_libconfig_setting_remove_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_remove_pre[hIndex].func;
- retVal___ = preHookFunc(parent, name);
+ retVal___ = preHookFunc(&parent, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37227,26 +38071,26 @@ int HP_libconfig_setting_remove(config_setting_t *parent, const char *name) {
{
retVal___ = HPMHooks.source.libconfig.setting_remove(parent, name);
}
- if( HPMHooks.count.HP_libconfig_setting_remove_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_remove_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_remove_post[hIndex].func;
retVal___ = postHookFunc(retVal___, parent, name);
}
}
return retVal___;
}
-int HP_libconfig_setting_remove_elem(config_setting_t *parent, unsigned int idx) {
+int HP_libconfig_setting_remove_elem(struct config_setting_t *parent, unsigned int idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_remove_elem_pre ) {
- int (*preHookFunc) (config_setting_t *parent, unsigned int *idx);
+ if (HPMHooks.count.HP_libconfig_setting_remove_elem_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_remove_elem_pre[hIndex].func;
- retVal___ = preHookFunc(parent, &idx);
+ retVal___ = preHookFunc(&parent, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37254,25 +38098,25 @@ int HP_libconfig_setting_remove_elem(config_setting_t *parent, unsigned int idx)
{
retVal___ = HPMHooks.source.libconfig.setting_remove_elem(parent, idx);
}
- if( HPMHooks.count.HP_libconfig_setting_remove_elem_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_remove_elem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_remove_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_remove_elem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, parent, &idx);
+ retVal___ = postHookFunc(retVal___, parent, idx);
}
}
return retVal___;
}
-void HP_libconfig_setting_set_hook(config_setting_t *setting, void *hook) {
+void HP_libconfig_setting_set_hook(struct config_setting_t *setting, void *hook) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_set_hook_pre ) {
- void (*preHookFunc) (config_setting_t *setting, void *hook);
+ if (HPMHooks.count.HP_libconfig_setting_set_hook_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **setting, void **hook);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_set_hook_pre[hIndex].func;
- preHookFunc(setting, hook);
+ preHookFunc(&setting, &hook);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37280,26 +38124,26 @@ void HP_libconfig_setting_set_hook(config_setting_t *setting, void *hook) {
{
HPMHooks.source.libconfig.setting_set_hook(setting, hook);
}
- if( HPMHooks.count.HP_libconfig_setting_set_hook_post ) {
- void (*postHookFunc) (config_setting_t *setting, void *hook);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_set_hook_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *setting, void *hook);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_set_hook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_set_hook_post[hIndex].func;
postHookFunc(setting, hook);
}
}
return;
}
-config_setting_t* HP_libconfig_lookup(const config_t *config, const char *filepath) {
+struct config_setting_t* HP_libconfig_lookup(const struct config_t *config, const char *filepath) {
int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_lookup_pre ) {
- config_setting_t* (*preHookFunc) (const config_t *config, const char *filepath);
+ struct config_setting_t* retVal___ = NULL;
+ if (HPMHooks.count.HP_libconfig_lookup_pre > 0) {
+ struct config_setting_t* (*preHookFunc) (const struct config_t **config, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath);
+ retVal___ = preHookFunc(&config, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37307,53 +38151,26 @@ config_setting_t* HP_libconfig_lookup(const config_t *config, const char *filepa
{
retVal___ = HPMHooks.source.libconfig.lookup(config, filepath);
}
- if( HPMHooks.count.HP_libconfig_lookup_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, const config_t *config, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_post > 0) {
+ struct config_setting_t* (*postHookFunc) (struct config_setting_t* retVal___, const struct config_t *config, const char *filepath);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath);
}
}
return retVal___;
}
-config_setting_t* HP_libconfig_lookup_from(config_setting_t *setting, const char *filepath) {
- int hIndex = 0;
- config_setting_t* retVal___ = NULL;
- if( HPMHooks.count.HP_libconfig_lookup_from_pre ) {
- config_setting_t* (*preHookFunc) (config_setting_t *setting, const char *filepath);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_from_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_lookup_from_pre[hIndex].func;
- retVal___ = preHookFunc(setting, filepath);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.libconfig.lookup_from(setting, filepath);
- }
- if( HPMHooks.count.HP_libconfig_lookup_from_post ) {
- config_setting_t* (*postHookFunc) (config_setting_t* retVal___, config_setting_t *setting, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_from_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_lookup_from_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, setting, filepath);
- }
- }
- return retVal___;
-}
-int HP_libconfig_lookup_int(const config_t *config, const char *filepath, int *value) {
+int HP_libconfig_lookup_int(const struct config_t *config, const char *filepath, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_int_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, int *value);
+ if (HPMHooks.count.HP_libconfig_lookup_int_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_int_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37361,26 +38178,26 @@ int HP_libconfig_lookup_int(const config_t *config, const char *filepath, int *v
{
retVal___ = HPMHooks.source.libconfig.lookup_int(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_int_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_int_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_int_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_int64(const config_t *config, const char *filepath, long long *value) {
+int HP_libconfig_lookup_int64(const struct config_t *config, const char *filepath, int64 *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_int64_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, long long *value);
+ if (HPMHooks.count.HP_libconfig_lookup_int64_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int64 **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37388,26 +38205,26 @@ int HP_libconfig_lookup_int64(const config_t *config, const char *filepath, long
{
retVal___ = HPMHooks.source.libconfig.lookup_int64(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_int64_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, long long *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_int64_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int64 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_int64_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_int64_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_float(const config_t *config, const char *filepath, double *value) {
+int HP_libconfig_lookup_float(const struct config_t *config, const char *filepath, double *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_float_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, double *value);
+ if (HPMHooks.count.HP_libconfig_lookup_float_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, double **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_float_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37415,26 +38232,26 @@ int HP_libconfig_lookup_float(const config_t *config, const char *filepath, doub
{
retVal___ = HPMHooks.source.libconfig.lookup_float(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_float_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, double *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_float_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, double *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_float_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_float_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_bool(const config_t *config, const char *filepath, int *value) {
+int HP_libconfig_lookup_bool(const struct config_t *config, const char *filepath, int *value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_bool_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, int *value);
+ if (HPMHooks.count.HP_libconfig_lookup_bool_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_bool_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37442,26 +38259,26 @@ int HP_libconfig_lookup_bool(const config_t *config, const char *filepath, int *
{
retVal___ = HPMHooks.source.libconfig.lookup_bool(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_bool_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_bool_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_bool_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_bool_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_lookup_string(const config_t *config, const char *filepath, const char **value) {
+int HP_libconfig_lookup_string(const struct config_t *config, const char *filepath, const char **value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_lookup_string_pre ) {
- int (*preHookFunc) (const config_t *config, const char *filepath, const char **value);
+ if (HPMHooks.count.HP_libconfig_lookup_string_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **filepath, const char ***value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_lookup_string_pre[hIndex].func;
- retVal___ = preHookFunc(config, filepath, value);
+ retVal___ = preHookFunc(&config, &filepath, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37469,52 +38286,52 @@ int HP_libconfig_lookup_string(const config_t *config, const char *filepath, con
{
retVal___ = HPMHooks.source.libconfig.lookup_string(config, filepath, value);
}
- if( HPMHooks.count.HP_libconfig_lookup_string_post ) {
- int (*postHookFunc) (int retVal___, const config_t *config, const char *filepath, const char **value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_lookup_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *filepath, const char **value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_string_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_lookup_string_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, filepath, value);
}
}
return retVal___;
}
-int HP_libconfig_read_file(config_t *config, const char *config_filename) {
+int HP_libconfig_load_file(struct config_t *config, const char *config_filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_read_file_pre ) {
- int (*preHookFunc) (config_t *config, const char *config_filename);
+ if (HPMHooks.count.HP_libconfig_load_file_pre > 0) {
+ int (*preHookFunc) (struct config_t **config, const char **config_filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_libconfig_read_file_pre[hIndex].func;
- retVal___ = preHookFunc(config, config_filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_load_file_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_load_file_pre[hIndex].func;
+ retVal___ = preHookFunc(&config, &config_filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.libconfig.read_file(config, config_filename);
+ retVal___ = HPMHooks.source.libconfig.load_file(config, config_filename);
}
- if( HPMHooks.count.HP_libconfig_read_file_post ) {
- int (*postHookFunc) (int retVal___, config_t *config, const char *config_filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_read_file_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_libconfig_read_file_post[hIndex].func;
+ if (HPMHooks.count.HP_libconfig_load_file_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_t *config, const char *config_filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_load_file_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_load_file_post[hIndex].func;
retVal___ = postHookFunc(retVal___, config, config_filename);
}
}
return retVal___;
}
-void HP_libconfig_setting_copy_simple(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_simple(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_simple_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_simple_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_simple_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37522,25 +38339,25 @@ void HP_libconfig_setting_copy_simple(config_setting_t *parent, const config_set
{
HPMHooks.source.libconfig.setting_copy_simple(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_simple_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_simple_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_simple_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_simple_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-void HP_libconfig_setting_copy_elem(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_elem(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_elem_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_elem_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_elem_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37548,25 +38365,25 @@ void HP_libconfig_setting_copy_elem(config_setting_t *parent, const config_setti
{
HPMHooks.source.libconfig.setting_copy_elem(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_elem_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_elem_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_elem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_elem_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-void HP_libconfig_setting_copy_aggregate(config_setting_t *parent, const config_setting_t *src) {
+void HP_libconfig_setting_copy_aggregate(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre ) {
- void (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_aggregate_pre[hIndex].func;
- preHookFunc(parent, src);
+ preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37574,26 +38391,26 @@ void HP_libconfig_setting_copy_aggregate(config_setting_t *parent, const config_
{
HPMHooks.source.libconfig.setting_copy_aggregate(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_aggregate_post ) {
- void (*postHookFunc) (config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_aggregate_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_aggregate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_aggregate_post[hIndex].func;
postHookFunc(parent, src);
}
}
return;
}
-int HP_libconfig_setting_copy(config_setting_t *parent, const config_setting_t *src) {
+int HP_libconfig_setting_copy(struct config_setting_t *parent, const struct config_setting_t *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libconfig_setting_copy_pre ) {
- int (*preHookFunc) (config_setting_t *parent, const config_setting_t *src);
+ if (HPMHooks.count.HP_libconfig_setting_copy_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **parent, const struct config_setting_t **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libconfig_setting_copy_pre[hIndex].func;
- retVal___ = preHookFunc(parent, src);
+ retVal___ = preHookFunc(&parent, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -37601,26 +38418,296 @@ int HP_libconfig_setting_copy(config_setting_t *parent, const config_setting_t *
{
retVal___ = HPMHooks.source.libconfig.setting_copy(parent, src);
}
- if( HPMHooks.count.HP_libconfig_setting_copy_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *parent, const config_setting_t *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libconfig_setting_copy_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *parent, const struct config_setting_t *src);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_copy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libconfig_setting_copy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, parent, src);
}
}
return retVal___;
}
-/* logs */
+bool HP_libconfig_setting_get_bool_real(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_real_pre > 0) {
+ bool (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_real_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_real_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_bool_real(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_bool_real_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_bool_real_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_bool_real_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+uint32 HP_libconfig_setting_get_uint32(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_uint32_pre > 0) {
+ uint32 (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint32_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_uint32(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_uint32_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+uint16 HP_libconfig_setting_get_uint16(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ uint16 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_uint16_pre > 0) {
+ uint16 (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_uint16(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_uint16_post > 0) {
+ uint16 (*postHookFunc) (uint16 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_uint16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_uint16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+int16 HP_libconfig_setting_get_int16(const struct config_setting_t *setting) {
+ int hIndex = 0;
+ int16 retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_get_int16_pre > 0) {
+ int16 (*preHookFunc) (const struct config_setting_t **setting);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_get_int16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_get_int16(setting);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_get_int16_post > 0) {
+ int16 (*postHookFunc) (int16 retVal___, const struct config_setting_t *setting);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_get_int16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_get_int16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_bool_real(const struct config_setting_t *setting, const char *name, bool *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_real_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, bool **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_real_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_real_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_bool_real(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_bool_real_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, bool *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_bool_real_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_bool_real_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_uint32(const struct config_setting_t *setting, const char *name, uint32 *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint32_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, uint32 **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint32_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint32_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_uint32(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint32_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, uint32 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint32_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint32_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_uint16(const struct config_setting_t *setting, const char *name, uint16 *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint16_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, uint16 **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_uint16(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_uint16_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, uint16 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_uint16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_uint16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_int16(const struct config_setting_t *setting, const char *name, int16 *value) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int16_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, int16 **value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int16_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int16_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_int16(setting, name, value);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_int16_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, int16 *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_int16_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_int16_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, value);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_setting_lookup_mutable_string(const struct config_setting_t *setting, const char *name, char *out, size_t out_size) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_pre > 0) {
+ int (*preHookFunc) (const struct config_setting_t **setting, const char **name, char **out, size_t *out_size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_mutable_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&setting, &name, &out, &out_size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.setting_lookup_mutable_string(setting, name, out, out_size);
+ }
+ if (HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_setting_t *setting, const char *name, char *out, size_t out_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_setting_lookup_mutable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_setting_lookup_mutable_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, setting, name, out, out_size);
+ }
+ }
+ return retVal___;
+}
+int HP_libconfig_lookup_mutable_string(const struct config_t *config, const char *name, char *out, size_t out_size) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_libconfig_lookup_mutable_string_pre > 0) {
+ int (*preHookFunc) (const struct config_t **config, const char **name, char **out, size_t *out_size);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_mutable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_libconfig_lookup_mutable_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&config, &name, &out, &out_size);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.libconfig.lookup_mutable_string(config, name, out, out_size);
+ }
+ if (HPMHooks.count.HP_libconfig_lookup_mutable_string_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct config_t *config, const char *name, char *out, size_t out_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libconfig_lookup_mutable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_libconfig_lookup_mutable_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, config, name, out, out_size);
+ }
+ }
+ return retVal___;
+}
+/* log_interface */
void HP_logs_pick_pc(struct map_session_data *sd, e_log_pick_type type, int amount, struct item *itm, struct item_data *data) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_pick_pc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, e_log_pick_type *type, int *amount, struct item *itm, struct item_data *data);
+ if (HPMHooks.count.HP_logs_pick_pc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, e_log_pick_type *type, int *amount, struct item **itm, struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_pick_pc_pre[hIndex].func;
- preHookFunc(sd, &type, &amount, itm, data);
+ preHookFunc(&sd, &type, &amount, &itm, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37628,25 +38715,25 @@ void HP_logs_pick_pc(struct map_session_data *sd, e_log_pick_type type, int amou
{
HPMHooks.source.logs.pick_pc(sd, type, amount, itm, data);
}
- if( HPMHooks.count.HP_logs_pick_pc_post ) {
- void (*postHookFunc) (struct map_session_data *sd, e_log_pick_type *type, int *amount, struct item *itm, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_pc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_pick_pc_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, e_log_pick_type type, int amount, struct item *itm, struct item_data *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_pick_pc_post[hIndex].func;
- postHookFunc(sd, &type, &amount, itm, data);
+ postHookFunc(sd, type, amount, itm, data);
}
}
return;
}
void HP_logs_pick_mob(struct mob_data *md, e_log_pick_type type, int amount, struct item *itm, struct item_data *data) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_pick_mob_pre ) {
- void (*preHookFunc) (struct mob_data *md, e_log_pick_type *type, int *amount, struct item *itm, struct item_data *data);
+ if (HPMHooks.count.HP_logs_pick_mob_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, e_log_pick_type *type, int *amount, struct item **itm, struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_mob_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_mob_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_pick_mob_pre[hIndex].func;
- preHookFunc(md, &type, &amount, itm, data);
+ preHookFunc(&md, &type, &amount, &itm, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37654,25 +38741,25 @@ void HP_logs_pick_mob(struct mob_data *md, e_log_pick_type type, int amount, str
{
HPMHooks.source.logs.pick_mob(md, type, amount, itm, data);
}
- if( HPMHooks.count.HP_logs_pick_mob_post ) {
- void (*postHookFunc) (struct mob_data *md, e_log_pick_type *type, int *amount, struct item *itm, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_mob_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_pick_mob_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, e_log_pick_type type, int amount, struct item *itm, struct item_data *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_mob_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_pick_mob_post[hIndex].func;
- postHookFunc(md, &type, &amount, itm, data);
+ postHookFunc(md, type, amount, itm, data);
}
}
return;
}
void HP_logs_zeny(struct map_session_data *sd, e_log_pick_type type, struct map_session_data *src_sd, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_zeny_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, e_log_pick_type *type, struct map_session_data *src_sd, int *amount);
+ if (HPMHooks.count.HP_logs_zeny_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, e_log_pick_type *type, struct map_session_data **src_sd, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_zeny_pre[hIndex].func;
- preHookFunc(sd, &type, src_sd, &amount);
+ preHookFunc(&sd, &type, &src_sd, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37680,25 +38767,25 @@ void HP_logs_zeny(struct map_session_data *sd, e_log_pick_type type, struct map_
{
HPMHooks.source.logs.zeny(sd, type, src_sd, amount);
}
- if( HPMHooks.count.HP_logs_zeny_post ) {
- void (*postHookFunc) (struct map_session_data *sd, e_log_pick_type *type, struct map_session_data *src_sd, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_zeny_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, e_log_pick_type type, struct map_session_data *src_sd, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_zeny_post[hIndex].func;
- postHookFunc(sd, &type, src_sd, &amount);
+ postHookFunc(sd, type, src_sd, amount);
}
}
return;
}
void HP_logs_npc(struct map_session_data *sd, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_npc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *message);
+ if (HPMHooks.count.HP_logs_npc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_npc_pre[hIndex].func;
- preHookFunc(sd, message);
+ preHookFunc(&sd, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37706,9 +38793,9 @@ void HP_logs_npc(struct map_session_data *sd, const char *message) {
{
HPMHooks.source.logs.npc(sd, message);
}
- if( HPMHooks.count.HP_logs_npc_post ) {
+ if (HPMHooks.count.HP_logs_npc_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_npc_post[hIndex].func;
postHookFunc(sd, message);
}
@@ -37717,14 +38804,14 @@ void HP_logs_npc(struct map_session_data *sd, const char *message) {
}
void HP_logs_chat(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_chat_pre ) {
- void (*preHookFunc) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char *mapname, int *x, int *y, const char *dst_charname, const char *message);
+ if (HPMHooks.count.HP_logs_chat_pre > 0) {
+ void (*preHookFunc) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char **mapname, int *x, int *y, const char **dst_charname, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_chat_pre[hIndex].func;
- preHookFunc(&type, &type_id, &src_charid, &src_accid, mapname, &x, &y, dst_charname, message);
+ preHookFunc(&type, &type_id, &src_charid, &src_accid, &mapname, &x, &y, &dst_charname, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37732,25 +38819,25 @@ void HP_logs_chat(e_log_chat_type type, int type_id, int src_charid, int src_acc
{
HPMHooks.source.logs.chat(type, type_id, src_charid, src_accid, mapname, x, y, dst_charname, message);
}
- if( HPMHooks.count.HP_logs_chat_post ) {
- void (*postHookFunc) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char *mapname, int *x, int *y, const char *dst_charname, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_chat_post > 0) {
+ void (*postHookFunc) (e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_chat_post[hIndex].func;
- postHookFunc(&type, &type_id, &src_charid, &src_accid, mapname, &x, &y, dst_charname, message);
+ postHookFunc(type, type_id, src_charid, src_accid, mapname, x, y, dst_charname, message);
}
}
return;
}
void HP_logs_atcommand(struct map_session_data *sd, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_atcommand_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *message);
+ if (HPMHooks.count.HP_logs_atcommand_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_atcommand_pre[hIndex].func;
- preHookFunc(sd, message);
+ preHookFunc(&sd, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37758,9 +38845,9 @@ void HP_logs_atcommand(struct map_session_data *sd, const char *message) {
{
HPMHooks.source.logs.atcommand(sd, message);
}
- if( HPMHooks.count.HP_logs_atcommand_post ) {
+ if (HPMHooks.count.HP_logs_atcommand_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_atcommand_post[hIndex].func;
postHookFunc(sd, message);
}
@@ -37769,14 +38856,14 @@ void HP_logs_atcommand(struct map_session_data *sd, const char *message) {
}
void HP_logs_branch(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_branch_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_logs_branch_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_branch_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37784,9 +38871,9 @@ void HP_logs_branch(struct map_session_data *sd) {
{
HPMHooks.source.logs.branch(sd);
}
- if( HPMHooks.count.HP_logs_branch_post ) {
+ if (HPMHooks.count.HP_logs_branch_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_branch_post[hIndex].func;
postHookFunc(sd);
}
@@ -37795,14 +38882,14 @@ void HP_logs_branch(struct map_session_data *sd) {
}
void HP_logs_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_mvpdrop_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *monster_id, int *log_mvp);
+ if (HPMHooks.count.HP_logs_mvpdrop_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *monster_id, int **log_mvp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_mvpdrop_pre[hIndex].func;
- preHookFunc(sd, &monster_id, log_mvp);
+ preHookFunc(&sd, &monster_id, &log_mvp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37810,25 +38897,25 @@ void HP_logs_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp)
{
HPMHooks.source.logs.mvpdrop(sd, monster_id, log_mvp);
}
- if( HPMHooks.count.HP_logs_mvpdrop_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *monster_id, int *log_mvp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_mvpdrop_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int monster_id, int *log_mvp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_mvpdrop_post[hIndex].func;
- postHookFunc(sd, &monster_id, log_mvp);
+ postHookFunc(sd, monster_id, log_mvp);
}
}
return;
}
void HP_logs_pick_sub(int id, int16 m, e_log_pick_type type, int amount, struct item *itm, struct item_data *data) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_pick_sub_pre ) {
- void (*preHookFunc) (int *id, int16 *m, e_log_pick_type *type, int *amount, struct item *itm, struct item_data *data);
+ if (HPMHooks.count.HP_logs_pick_sub_pre > 0) {
+ void (*preHookFunc) (int *id, int16 *m, e_log_pick_type *type, int *amount, struct item **itm, struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_pick_sub_pre[hIndex].func;
- preHookFunc(&id, &m, &type, &amount, itm, data);
+ preHookFunc(&id, &m, &type, &amount, &itm, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37836,25 +38923,25 @@ void HP_logs_pick_sub(int id, int16 m, e_log_pick_type type, int amount, struct
{
HPMHooks.source.logs.pick_sub(id, m, type, amount, itm, data);
}
- if( HPMHooks.count.HP_logs_pick_sub_post ) {
- void (*postHookFunc) (int *id, int16 *m, e_log_pick_type *type, int *amount, struct item *itm, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_pick_sub_post > 0) {
+ void (*postHookFunc) (int id, int16 m, e_log_pick_type type, int amount, struct item *itm, struct item_data *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_pick_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_pick_sub_post[hIndex].func;
- postHookFunc(&id, &m, &type, &amount, itm, data);
+ postHookFunc(id, m, type, amount, itm, data);
}
}
return;
}
void HP_logs_zeny_sub(struct map_session_data *sd, e_log_pick_type type, struct map_session_data *src_sd, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_zeny_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, e_log_pick_type *type, struct map_session_data *src_sd, int *amount);
+ if (HPMHooks.count.HP_logs_zeny_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, e_log_pick_type *type, struct map_session_data **src_sd, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_zeny_sub_pre[hIndex].func;
- preHookFunc(sd, &type, src_sd, &amount);
+ preHookFunc(&sd, &type, &src_sd, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37862,25 +38949,25 @@ void HP_logs_zeny_sub(struct map_session_data *sd, e_log_pick_type type, struct
{
HPMHooks.source.logs.zeny_sub(sd, type, src_sd, amount);
}
- if( HPMHooks.count.HP_logs_zeny_sub_post ) {
- void (*postHookFunc) (struct map_session_data *sd, e_log_pick_type *type, struct map_session_data *src_sd, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_zeny_sub_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, e_log_pick_type type, struct map_session_data *src_sd, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_zeny_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_zeny_sub_post[hIndex].func;
- postHookFunc(sd, &type, src_sd, &amount);
+ postHookFunc(sd, type, src_sd, amount);
}
}
return;
}
void HP_logs_npc_sub(struct map_session_data *sd, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_npc_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *message);
+ if (HPMHooks.count.HP_logs_npc_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_npc_sub_pre[hIndex].func;
- preHookFunc(sd, message);
+ preHookFunc(&sd, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37888,9 +38975,9 @@ void HP_logs_npc_sub(struct map_session_data *sd, const char *message) {
{
HPMHooks.source.logs.npc_sub(sd, message);
}
- if( HPMHooks.count.HP_logs_npc_sub_post ) {
+ if (HPMHooks.count.HP_logs_npc_sub_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_npc_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_npc_sub_post[hIndex].func;
postHookFunc(sd, message);
}
@@ -37899,14 +38986,14 @@ void HP_logs_npc_sub(struct map_session_data *sd, const char *message) {
}
void HP_logs_chat_sub(e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_chat_sub_pre ) {
- void (*preHookFunc) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char *mapname, int *x, int *y, const char *dst_charname, const char *message);
+ if (HPMHooks.count.HP_logs_chat_sub_pre > 0) {
+ void (*preHookFunc) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char **mapname, int *x, int *y, const char **dst_charname, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_chat_sub_pre[hIndex].func;
- preHookFunc(&type, &type_id, &src_charid, &src_accid, mapname, &x, &y, dst_charname, message);
+ preHookFunc(&type, &type_id, &src_charid, &src_accid, &mapname, &x, &y, &dst_charname, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37914,25 +39001,25 @@ void HP_logs_chat_sub(e_log_chat_type type, int type_id, int src_charid, int src
{
HPMHooks.source.logs.chat_sub(type, type_id, src_charid, src_accid, mapname, x, y, dst_charname, message);
}
- if( HPMHooks.count.HP_logs_chat_sub_post ) {
- void (*postHookFunc) (e_log_chat_type *type, int *type_id, int *src_charid, int *src_accid, const char *mapname, int *x, int *y, const char *dst_charname, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_chat_sub_post > 0) {
+ void (*postHookFunc) (e_log_chat_type type, int type_id, int src_charid, int src_accid, const char *mapname, int x, int y, const char *dst_charname, const char *message);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_chat_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_chat_sub_post[hIndex].func;
- postHookFunc(&type, &type_id, &src_charid, &src_accid, mapname, &x, &y, dst_charname, message);
+ postHookFunc(type, type_id, src_charid, src_accid, mapname, x, y, dst_charname, message);
}
}
return;
}
void HP_logs_atcommand_sub(struct map_session_data *sd, const char *message) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_atcommand_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *message);
+ if (HPMHooks.count.HP_logs_atcommand_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **message);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_atcommand_sub_pre[hIndex].func;
- preHookFunc(sd, message);
+ preHookFunc(&sd, &message);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37940,9 +39027,9 @@ void HP_logs_atcommand_sub(struct map_session_data *sd, const char *message) {
{
HPMHooks.source.logs.atcommand_sub(sd, message);
}
- if( HPMHooks.count.HP_logs_atcommand_sub_post ) {
+ if (HPMHooks.count.HP_logs_atcommand_sub_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *message);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_atcommand_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_atcommand_sub_post[hIndex].func;
postHookFunc(sd, message);
}
@@ -37951,14 +39038,14 @@ void HP_logs_atcommand_sub(struct map_session_data *sd, const char *message) {
}
void HP_logs_branch_sub(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_branch_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_logs_branch_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_branch_sub_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37966,9 +39053,9 @@ void HP_logs_branch_sub(struct map_session_data *sd) {
{
HPMHooks.source.logs.branch_sub(sd);
}
- if( HPMHooks.count.HP_logs_branch_sub_post ) {
+ if (HPMHooks.count.HP_logs_branch_sub_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_branch_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_branch_sub_post[hIndex].func;
postHookFunc(sd);
}
@@ -37977,14 +39064,14 @@ void HP_logs_branch_sub(struct map_session_data *sd) {
}
void HP_logs_mvpdrop_sub(struct map_session_data *sd, int monster_id, int *log_mvp) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_mvpdrop_sub_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *monster_id, int *log_mvp);
+ if (HPMHooks.count.HP_logs_mvpdrop_sub_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *monster_id, int **log_mvp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_mvpdrop_sub_pre[hIndex].func;
- preHookFunc(sd, &monster_id, log_mvp);
+ preHookFunc(&sd, &monster_id, &log_mvp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -37992,52 +39079,52 @@ void HP_logs_mvpdrop_sub(struct map_session_data *sd, int monster_id, int *log_m
{
HPMHooks.source.logs.mvpdrop_sub(sd, monster_id, log_mvp);
}
- if( HPMHooks.count.HP_logs_mvpdrop_sub_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *monster_id, int *log_mvp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_mvpdrop_sub_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int monster_id, int *log_mvp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_mvpdrop_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_mvpdrop_sub_post[hIndex].func;
- postHookFunc(sd, &monster_id, log_mvp);
+ postHookFunc(sd, monster_id, log_mvp);
}
}
return;
}
-int HP_logs_config_read(const char *cfgName) {
+bool HP_logs_config_read(const char *filename, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_logs_config_read_pre ) {
- int (*preHookFunc) (const char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_logs_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.logs.config_read(cfgName);
+ retVal___ = HPMHooks.source.logs.config_read(filename, imported);
}
- if( HPMHooks.count.HP_logs_config_read_post ) {
- int (*postHookFunc) (int retVal___, const char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
return retVal___;
}
void HP_logs_config_done(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_config_done_pre ) {
+ if (HPMHooks.count.HP_logs_config_done_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_done_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_done_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_config_done_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38045,9 +39132,9 @@ void HP_logs_config_done(void) {
{
HPMHooks.source.logs.config_done();
}
- if( HPMHooks.count.HP_logs_config_done_post ) {
+ if (HPMHooks.count.HP_logs_config_done_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_done_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_done_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_config_done_post[hIndex].func;
postHookFunc();
}
@@ -38056,14 +39143,14 @@ void HP_logs_config_done(void) {
}
void HP_logs_sql_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_sql_init_pre ) {
+ if (HPMHooks.count.HP_logs_sql_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_sql_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38071,9 +39158,9 @@ void HP_logs_sql_init(void) {
{
HPMHooks.source.logs.sql_init();
}
- if( HPMHooks.count.HP_logs_sql_init_post ) {
+ if (HPMHooks.count.HP_logs_sql_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_sql_init_post[hIndex].func;
postHookFunc();
}
@@ -38082,14 +39169,14 @@ void HP_logs_sql_init(void) {
}
void HP_logs_sql_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_logs_sql_final_pre ) {
+ if (HPMHooks.count.HP_logs_sql_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_sql_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38097,9 +39184,9 @@ void HP_logs_sql_final(void) {
{
HPMHooks.source.logs.sql_final();
}
- if( HPMHooks.count.HP_logs_sql_final_post ) {
+ if (HPMHooks.count.HP_logs_sql_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_sql_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_sql_final_post[hIndex].func;
postHookFunc();
}
@@ -38109,14 +39196,14 @@ void HP_logs_sql_final(void) {
char HP_logs_picktype2char(e_log_pick_type type) {
int hIndex = 0;
char retVal___ = 0;
- if( HPMHooks.count.HP_logs_picktype2char_pre ) {
+ if (HPMHooks.count.HP_logs_picktype2char_pre > 0) {
char (*preHookFunc) (e_log_pick_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_picktype2char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_picktype2char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_picktype2char_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38124,11 +39211,11 @@ char HP_logs_picktype2char(e_log_pick_type type) {
{
retVal___ = HPMHooks.source.logs.picktype2char(type);
}
- if( HPMHooks.count.HP_logs_picktype2char_post ) {
- char (*postHookFunc) (char retVal___, e_log_pick_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_picktype2char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_picktype2char_post > 0) {
+ char (*postHookFunc) (char retVal___, e_log_pick_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_picktype2char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_picktype2char_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
@@ -38136,14 +39223,14 @@ char HP_logs_picktype2char(e_log_pick_type type) {
char HP_logs_chattype2char(e_log_chat_type type) {
int hIndex = 0;
char retVal___ = 0;
- if( HPMHooks.count.HP_logs_chattype2char_pre ) {
+ if (HPMHooks.count.HP_logs_chattype2char_pre > 0) {
char (*preHookFunc) (e_log_chat_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_chattype2char_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_chattype2char_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_chattype2char_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38151,11 +39238,11 @@ char HP_logs_chattype2char(e_log_chat_type type) {
{
retVal___ = HPMHooks.source.logs.chattype2char(type);
}
- if( HPMHooks.count.HP_logs_chattype2char_post ) {
- char (*postHookFunc) (char retVal___, e_log_chat_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_chattype2char_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_chattype2char_post > 0) {
+ char (*postHookFunc) (char retVal___, e_log_chat_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_chattype2char_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_chattype2char_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
@@ -38163,14 +39250,14 @@ char HP_logs_chattype2char(e_log_chat_type type) {
bool HP_logs_should_log_item(int nameid, int amount, int refine, struct item_data *id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_logs_should_log_item_pre ) {
- bool (*preHookFunc) (int *nameid, int *amount, int *refine, struct item_data *id);
+ if (HPMHooks.count.HP_logs_should_log_item_pre > 0) {
+ bool (*preHookFunc) (int *nameid, int *amount, int *refine, struct item_data **id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_should_log_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_should_log_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_logs_should_log_item_pre[hIndex].func;
- retVal___ = preHookFunc(&nameid, &amount, &refine, id);
+ retVal___ = preHookFunc(&nameid, &amount, &refine, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38178,26 +39265,26 @@ bool HP_logs_should_log_item(int nameid, int amount, int refine, struct item_dat
{
retVal___ = HPMHooks.source.logs.should_log_item(nameid, amount, refine, id);
}
- if( HPMHooks.count.HP_logs_should_log_item_post ) {
- bool (*postHookFunc) (bool retVal___, int *nameid, int *amount, int *refine, struct item_data *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_should_log_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_logs_should_log_item_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int nameid, int amount, int refine, struct item_data *id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_should_log_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_logs_should_log_item_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid, &amount, &refine, id);
+ retVal___ = postHookFunc(retVal___, nameid, amount, refine, id);
}
}
return retVal___;
}
-/* mail */
+/* mail_interface */
void HP_mail_clear(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_mail_clear_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_mail_clear_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_clear_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38205,9 +39292,9 @@ void HP_mail_clear(struct map_session_data *sd) {
{
HPMHooks.source.mail.clear(sd);
}
- if( HPMHooks.count.HP_mail_clear_post ) {
+ if (HPMHooks.count.HP_mail_clear_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_clear_post[hIndex].func;
postHookFunc(sd);
}
@@ -38217,14 +39304,14 @@ void HP_mail_clear(struct map_session_data *sd) {
int HP_mail_removeitem(struct map_session_data *sd, short flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mail_removeitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, short *flag);
+ if (HPMHooks.count.HP_mail_removeitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, short *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_removeitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_removeitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_removeitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38232,11 +39319,11 @@ int HP_mail_removeitem(struct map_session_data *sd, short flag) {
{
retVal___ = HPMHooks.source.mail.removeitem(sd, flag);
}
- if( HPMHooks.count.HP_mail_removeitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, short *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_removeitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mail_removeitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, short flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_removeitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_removeitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -38244,14 +39331,14 @@ int HP_mail_removeitem(struct map_session_data *sd, short flag) {
int HP_mail_removezeny(struct map_session_data *sd, short flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mail_removezeny_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, short *flag);
+ if (HPMHooks.count.HP_mail_removezeny_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, short *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_removezeny_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_removezeny_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_removezeny_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38259,11 +39346,11 @@ int HP_mail_removezeny(struct map_session_data *sd, short flag) {
{
retVal___ = HPMHooks.source.mail.removezeny(sd, flag);
}
- if( HPMHooks.count.HP_mail_removezeny_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, short *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_removezeny_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mail_removezeny_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, short flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_removezeny_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_removezeny_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -38271,14 +39358,14 @@ int HP_mail_removezeny(struct map_session_data *sd, short flag) {
unsigned char HP_mail_setitem(struct map_session_data *sd, int idx, int amount) {
int hIndex = 0;
unsigned char retVal___ = 0;
- if( HPMHooks.count.HP_mail_setitem_pre ) {
- unsigned char (*preHookFunc) (struct map_session_data *sd, int *idx, int *amount);
+ if (HPMHooks.count.HP_mail_setitem_pre > 0) {
+ unsigned char (*preHookFunc) (struct map_session_data **sd, int *idx, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_setitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_setitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_setitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx, &amount);
+ retVal___ = preHookFunc(&sd, &idx, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38286,11 +39373,11 @@ unsigned char HP_mail_setitem(struct map_session_data *sd, int idx, int amount)
{
retVal___ = HPMHooks.source.mail.setitem(sd, idx, amount);
}
- if( HPMHooks.count.HP_mail_setitem_post ) {
- unsigned char (*postHookFunc) (unsigned char retVal___, struct map_session_data *sd, int *idx, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_setitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mail_setitem_post > 0) {
+ unsigned char (*postHookFunc) (unsigned char retVal___, struct map_session_data *sd, int idx, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_setitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_setitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx, &amount);
+ retVal___ = postHookFunc(retVal___, sd, idx, amount);
}
}
return retVal___;
@@ -38298,14 +39385,14 @@ unsigned char HP_mail_setitem(struct map_session_data *sd, int idx, int amount)
bool HP_mail_setattachment(struct map_session_data *sd, struct mail_message *msg) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mail_setattachment_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct mail_message *msg);
+ if (HPMHooks.count.HP_mail_setattachment_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_setattachment_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_setattachment_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_setattachment_pre[hIndex].func;
- retVal___ = preHookFunc(sd, msg);
+ retVal___ = preHookFunc(&sd, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38313,9 +39400,9 @@ bool HP_mail_setattachment(struct map_session_data *sd, struct mail_message *msg
{
retVal___ = HPMHooks.source.mail.setattachment(sd, msg);
}
- if( HPMHooks.count.HP_mail_setattachment_post ) {
+ if (HPMHooks.count.HP_mail_setattachment_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_setattachment_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_setattachment_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_setattachment_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, msg);
}
@@ -38324,14 +39411,14 @@ bool HP_mail_setattachment(struct map_session_data *sd, struct mail_message *msg
}
void HP_mail_getattachment(struct map_session_data *sd, int zeny, struct item *item) {
int hIndex = 0;
- if( HPMHooks.count.HP_mail_getattachment_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *zeny, struct item *item);
+ if (HPMHooks.count.HP_mail_getattachment_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *zeny, struct item **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_getattachment_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_getattachment_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_getattachment_pre[hIndex].func;
- preHookFunc(sd, &zeny, item);
+ preHookFunc(&sd, &zeny, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38339,11 +39426,11 @@ void HP_mail_getattachment(struct map_session_data *sd, int zeny, struct item *i
{
HPMHooks.source.mail.getattachment(sd, zeny, item);
}
- if( HPMHooks.count.HP_mail_getattachment_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *zeny, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_getattachment_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mail_getattachment_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int zeny, struct item *item);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_getattachment_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_getattachment_post[hIndex].func;
- postHookFunc(sd, &zeny, item);
+ postHookFunc(sd, zeny, item);
}
}
return;
@@ -38351,14 +39438,14 @@ void HP_mail_getattachment(struct map_session_data *sd, int zeny, struct item *i
int HP_mail_openmail(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mail_openmail_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_mail_openmail_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_openmail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_openmail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_openmail_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38366,9 +39453,9 @@ int HP_mail_openmail(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.mail.openmail(sd);
}
- if( HPMHooks.count.HP_mail_openmail_post ) {
+ if (HPMHooks.count.HP_mail_openmail_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_openmail_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_openmail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_openmail_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -38377,14 +39464,14 @@ int HP_mail_openmail(struct map_session_data *sd) {
}
void HP_mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg) {
int hIndex = 0;
- if( HPMHooks.count.HP_mail_deliveryfail_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct mail_message *msg);
+ if (HPMHooks.count.HP_mail_deliveryfail_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct mail_message **msg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_deliveryfail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_deliveryfail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_deliveryfail_pre[hIndex].func;
- preHookFunc(sd, msg);
+ preHookFunc(&sd, &msg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38392,9 +39479,9 @@ void HP_mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
{
HPMHooks.source.mail.deliveryfail(sd, msg);
}
- if( HPMHooks.count.HP_mail_deliveryfail_post ) {
+ if (HPMHooks.count.HP_mail_deliveryfail_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct mail_message *msg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_deliveryfail_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_deliveryfail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_deliveryfail_post[hIndex].func;
postHookFunc(sd, msg);
}
@@ -38404,14 +39491,14 @@ void HP_mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
bool HP_mail_invalid_operation(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mail_invalid_operation_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_mail_invalid_operation_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_invalid_operation_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_invalid_operation_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mail_invalid_operation_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38419,372 +39506,26 @@ bool HP_mail_invalid_operation(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.mail.invalid_operation(sd);
}
- if( HPMHooks.count.HP_mail_invalid_operation_post ) {
+ if (HPMHooks.count.HP_mail_invalid_operation_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mail_invalid_operation_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mail_invalid_operation_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mail_invalid_operation_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-/* iMalloc */
-void HP_iMalloc_init(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init();
- }
- if( HPMHooks.count.HP_iMalloc_init_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_final(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_final_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_final_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.final();
- }
- if( HPMHooks.count.HP_iMalloc_final_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_final_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_final_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void* HP_iMalloc_malloc(size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_malloc_pre ) {
- void* (*preHookFunc) (size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_malloc_pre[hIndex].func;
- retVal___ = preHookFunc(&size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.malloc(size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_malloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_malloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_malloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_calloc(size_t num, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_calloc_pre ) {
- void* (*preHookFunc) (size_t *num, size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_calloc_pre[hIndex].func;
- retVal___ = preHookFunc(&num, &size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.calloc(num, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_calloc_post ) {
- void* (*postHookFunc) (void* retVal___, size_t *num, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_calloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_calloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &num, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_realloc(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_realloc_pre ) {
- void* (*preHookFunc) (void *p, size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_realloc_pre[hIndex].func;
- retVal___ = preHookFunc(p, &size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.realloc(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_realloc_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_realloc_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_realloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-void* HP_iMalloc_reallocz(void *p, size_t size, const char *file, int line, const char *func) {
- int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_reallocz_pre ) {
- void* (*preHookFunc) (void *p, size_t *size, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_reallocz_pre[hIndex].func;
- retVal___ = preHookFunc(p, &size, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.reallocz(p, size, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_reallocz_post ) {
- void* (*postHookFunc) (void* retVal___, void *p, size_t *size, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_reallocz_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_reallocz_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &size, file, &line, func);
- }
- }
- return retVal___;
-}
-char* HP_iMalloc_astrdup(const char *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- char* retVal___ = NULL;
- if( HPMHooks.count.HP_iMalloc_astrdup_pre ) {
- char* (*preHookFunc) (const char *p, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_astrdup_pre[hIndex].func;
- retVal___ = preHookFunc(p, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.astrdup(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_astrdup_post ) {
- char* (*postHookFunc) (char* retVal___, const char *p, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_astrdup_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_astrdup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, file, &line, func);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_free(void *p, const char *file, int line, const char *func) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_free_pre ) {
- void (*preHookFunc) (void *p, const char *file, int *line, const char *func);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_free_pre[hIndex].func;
- preHookFunc(p, file, &line, func);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.free(p, file, line, func);
- }
- if( HPMHooks.count.HP_iMalloc_free_post ) {
- void (*postHookFunc) (void *p, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_free_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_free_post[hIndex].func;
- postHookFunc(p, file, &line, func);
- }
- }
- return;
-}
-void HP_iMalloc_memory_check(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_memory_check_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_memory_check_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.memory_check();
- }
- if( HPMHooks.count.HP_iMalloc_memory_check_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_memory_check_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_memory_check_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-bool HP_iMalloc_verify_ptr(void *ptr) {
- int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_iMalloc_verify_ptr_pre ) {
- bool (*preHookFunc) (void *ptr);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_pre[hIndex].func;
- retVal___ = preHookFunc(ptr);
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.verify_ptr(ptr);
- }
- if( HPMHooks.count.HP_iMalloc_verify_ptr_post ) {
- bool (*postHookFunc) (bool retVal___, void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_verify_ptr_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_verify_ptr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ptr);
- }
- }
- return retVal___;
-}
-size_t HP_iMalloc_usage(void) {
- int hIndex = 0;
- size_t retVal___ = 0;
- if( HPMHooks.count.HP_iMalloc_usage_pre ) {
- size_t (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_usage_pre[hIndex].func;
- retVal___ = preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return retVal___;
- }
- }
- {
- retVal___ = HPMHooks.source.iMalloc.usage();
- }
- if( HPMHooks.count.HP_iMalloc_usage_post ) {
- size_t (*postHookFunc) (size_t retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_usage_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_usage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___);
- }
- }
- return retVal___;
-}
-void HP_iMalloc_post_shutdown(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_post_shutdown_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.post_shutdown();
- }
- if( HPMHooks.count.HP_iMalloc_post_shutdown_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_post_shutdown_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_post_shutdown_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-void HP_iMalloc_init_messages(void) {
- int hIndex = 0;
- if( HPMHooks.count.HP_iMalloc_init_messages_pre ) {
- void (*preHookFunc) (void);
- *HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_iMalloc_init_messages_pre[hIndex].func;
- preHookFunc();
- }
- if( *HPMforce_return ) {
- *HPMforce_return = false;
- return;
- }
- }
- {
- HPMHooks.source.iMalloc.init_messages();
- }
- if( HPMHooks.count.HP_iMalloc_init_messages_post ) {
- void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_iMalloc_init_messages_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_iMalloc_init_messages_post[hIndex].func;
- postHookFunc();
- }
- }
- return;
-}
-/* map */
+/* map_interface */
void HP_map_zone_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_init_pre ) {
+ if (HPMHooks.count.HP_map_zone_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38792,9 +39533,9 @@ void HP_map_zone_init(void) {
{
HPMHooks.source.map.zone_init();
}
- if( HPMHooks.count.HP_map_zone_init_post ) {
+ if (HPMHooks.count.HP_map_zone_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_init_post[hIndex].func;
postHookFunc();
}
@@ -38803,14 +39544,14 @@ void HP_map_zone_init(void) {
}
void HP_map_zone_remove(int m) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_remove_pre ) {
+ if (HPMHooks.count.HP_map_zone_remove_pre > 0) {
void (*preHookFunc) (int *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_remove_pre[hIndex].func;
preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38818,25 +39559,25 @@ void HP_map_zone_remove(int m) {
{
HPMHooks.source.map.zone_remove(m);
}
- if( HPMHooks.count.HP_map_zone_remove_post ) {
- void (*postHookFunc) (int *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_zone_remove_post > 0) {
+ void (*postHookFunc) (int m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_remove_post[hIndex].func;
- postHookFunc(&m);
+ postHookFunc(m);
}
}
return;
}
void HP_map_zone_apply(int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_apply_pre ) {
- void (*preHookFunc) (int *m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
+ if (HPMHooks.count.HP_map_zone_apply_pre > 0) {
+ void (*preHookFunc) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_apply_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_apply_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_apply_pre[hIndex].func;
- preHookFunc(&m, zone, start, buffer, filepath);
+ preHookFunc(&m, &zone, &start, &buffer, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38844,25 +39585,25 @@ void HP_map_zone_apply(int m, struct map_zone_data *zone, const char *start, con
{
HPMHooks.source.map.zone_apply(m, zone, start, buffer, filepath);
}
- if( HPMHooks.count.HP_map_zone_apply_post ) {
- void (*postHookFunc) (int *m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_apply_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_zone_apply_post > 0) {
+ void (*postHookFunc) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_apply_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_apply_post[hIndex].func;
- postHookFunc(&m, zone, start, buffer, filepath);
+ postHookFunc(m, zone, start, buffer, filepath);
}
}
return;
}
void HP_map_zone_change(int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_change_pre ) {
- void (*preHookFunc) (int *m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
+ if (HPMHooks.count.HP_map_zone_change_pre > 0) {
+ void (*preHookFunc) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_change_pre[hIndex].func;
- preHookFunc(&m, zone, start, buffer, filepath);
+ preHookFunc(&m, &zone, &start, &buffer, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38870,25 +39611,25 @@ void HP_map_zone_change(int m, struct map_zone_data *zone, const char *start, co
{
HPMHooks.source.map.zone_change(m, zone, start, buffer, filepath);
}
- if( HPMHooks.count.HP_map_zone_change_post ) {
- void (*postHookFunc) (int *m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_zone_change_post > 0) {
+ void (*postHookFunc) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_change_post[hIndex].func;
- postHookFunc(&m, zone, start, buffer, filepath);
+ postHookFunc(m, zone, start, buffer, filepath);
}
}
return;
}
void HP_map_zone_change2(int m, struct map_zone_data *zone) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_change2_pre ) {
- void (*preHookFunc) (int *m, struct map_zone_data *zone);
+ if (HPMHooks.count.HP_map_zone_change2_pre > 0) {
+ void (*preHookFunc) (int *m, struct map_zone_data **zone);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_change2_pre[hIndex].func;
- preHookFunc(&m, zone);
+ preHookFunc(&m, &zone);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38896,11 +39637,11 @@ void HP_map_zone_change2(int m, struct map_zone_data *zone) {
{
HPMHooks.source.map.zone_change2(m, zone);
}
- if( HPMHooks.count.HP_map_zone_change2_post ) {
- void (*postHookFunc) (int *m, struct map_zone_data *zone);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_zone_change2_post > 0) {
+ void (*postHookFunc) (int m, struct map_zone_data *zone);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_change2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_change2_post[hIndex].func;
- postHookFunc(&m, zone);
+ postHookFunc(m, zone);
}
}
return;
@@ -38908,14 +39649,14 @@ void HP_map_zone_change2(int m, struct map_zone_data *zone) {
int HP_map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_getcell_pre ) {
- int (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
+ if (HPMHooks.count.HP_map_getcell_pre > 0) {
+ int (*preHookFunc) (int16 *m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_getcell_pre[hIndex].func;
- retVal___ = preHookFunc(&m, bl, &x, &y, &cellchk);
+ retVal___ = preHookFunc(&m, &bl, &x, &y, &cellchk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -38923,25 +39664,25 @@ int HP_map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_
{
retVal___ = HPMHooks.source.map.getcell(m, bl, x, y, cellchk);
}
- if( HPMHooks.count.HP_map_getcell_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_getcell_post > 0) {
+ int (*postHookFunc) (int retVal___, int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getcell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_getcell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, bl, &x, &y, &cellchk);
+ retVal___ = postHookFunc(retVal___, m, bl, x, y, cellchk);
}
}
return retVal___;
}
void HP_map_setgatcell(int16 m, int16 x, int16 y, int gat) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_setgatcell_pre ) {
+ if (HPMHooks.count.HP_map_setgatcell_pre > 0) {
void (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *gat);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setgatcell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setgatcell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_setgatcell_pre[hIndex].func;
preHookFunc(&m, &x, &y, &gat);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38949,25 +39690,25 @@ void HP_map_setgatcell(int16 m, int16 x, int16 y, int gat) {
{
HPMHooks.source.map.setgatcell(m, x, y, gat);
}
- if( HPMHooks.count.HP_map_setgatcell_post ) {
- void (*postHookFunc) (int16 *m, int16 *x, int16 *y, int *gat);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setgatcell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_setgatcell_post > 0) {
+ void (*postHookFunc) (int16 m, int16 x, int16 y, int gat);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setgatcell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_setgatcell_post[hIndex].func;
- postHookFunc(&m, &x, &y, &gat);
+ postHookFunc(m, x, y, gat);
}
}
return;
}
void HP_map_cellfromcache(struct map_data *m) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_cellfromcache_pre ) {
- void (*preHookFunc) (struct map_data *m);
+ if (HPMHooks.count.HP_map_cellfromcache_pre > 0) {
+ void (*preHookFunc) (struct map_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cellfromcache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cellfromcache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_cellfromcache_pre[hIndex].func;
- preHookFunc(m);
+ preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -38975,9 +39716,9 @@ void HP_map_cellfromcache(struct map_data *m) {
{
HPMHooks.source.map.cellfromcache(m);
}
- if( HPMHooks.count.HP_map_cellfromcache_post ) {
+ if (HPMHooks.count.HP_map_cellfromcache_post > 0) {
void (*postHookFunc) (struct map_data *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cellfromcache_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cellfromcache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_cellfromcache_post[hIndex].func;
postHookFunc(m);
}
@@ -38986,14 +39727,14 @@ void HP_map_cellfromcache(struct map_data *m) {
}
void HP_map_setusers(int p1) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_setusers_pre ) {
+ if (HPMHooks.count.HP_map_setusers_pre > 0) {
void (*preHookFunc) (int *p1);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setusers_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setusers_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_setusers_pre[hIndex].func;
preHookFunc(&p1);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39001,11 +39742,11 @@ void HP_map_setusers(int p1) {
{
HPMHooks.source.map.setusers(p1);
}
- if( HPMHooks.count.HP_map_setusers_post ) {
- void (*postHookFunc) (int *p1);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setusers_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_setusers_post > 0) {
+ void (*postHookFunc) (int p1);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setusers_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_setusers_post[hIndex].func;
- postHookFunc(&p1);
+ postHookFunc(p1);
}
}
return;
@@ -39013,14 +39754,14 @@ void HP_map_setusers(int p1) {
int HP_map_getusers(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_getusers_pre ) {
+ if (HPMHooks.count.HP_map_getusers_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getusers_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getusers_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_getusers_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39028,9 +39769,9 @@ int HP_map_getusers(void) {
{
retVal___ = HPMHooks.source.map.getusers();
}
- if( HPMHooks.count.HP_map_getusers_post ) {
+ if (HPMHooks.count.HP_map_getusers_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getusers_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getusers_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_getusers_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -39040,14 +39781,14 @@ int HP_map_getusers(void) {
int HP_map_usercount(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_usercount_pre ) {
+ if (HPMHooks.count.HP_map_usercount_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_usercount_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_usercount_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_usercount_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39055,9 +39796,9 @@ int HP_map_usercount(void) {
{
retVal___ = HPMHooks.source.map.usercount();
}
- if( HPMHooks.count.HP_map_usercount_post ) {
+ if (HPMHooks.count.HP_map_usercount_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_usercount_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_usercount_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_usercount_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -39067,14 +39808,14 @@ int HP_map_usercount(void) {
int HP_map_freeblock(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_freeblock_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_map_freeblock_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_freeblock_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39082,9 +39823,9 @@ int HP_map_freeblock(struct block_list *bl) {
{
retVal___ = HPMHooks.source.map.freeblock(bl);
}
- if( HPMHooks.count.HP_map_freeblock_post ) {
+ if (HPMHooks.count.HP_map_freeblock_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_freeblock_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -39094,14 +39835,14 @@ int HP_map_freeblock(struct block_list *bl) {
int HP_map_freeblock_lock(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_freeblock_lock_pre ) {
+ if (HPMHooks.count.HP_map_freeblock_lock_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_lock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_lock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_freeblock_lock_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39109,9 +39850,9 @@ int HP_map_freeblock_lock(void) {
{
retVal___ = HPMHooks.source.map.freeblock_lock();
}
- if( HPMHooks.count.HP_map_freeblock_lock_post ) {
+ if (HPMHooks.count.HP_map_freeblock_lock_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_lock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_lock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_freeblock_lock_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -39121,14 +39862,14 @@ int HP_map_freeblock_lock(void) {
int HP_map_freeblock_unlock(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_freeblock_unlock_pre ) {
+ if (HPMHooks.count.HP_map_freeblock_unlock_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_unlock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_unlock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_freeblock_unlock_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39136,9 +39877,9 @@ int HP_map_freeblock_unlock(void) {
{
retVal___ = HPMHooks.source.map.freeblock_unlock();
}
- if( HPMHooks.count.HP_map_freeblock_unlock_post ) {
+ if (HPMHooks.count.HP_map_freeblock_unlock_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_unlock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_unlock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_freeblock_unlock_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -39148,14 +39889,14 @@ int HP_map_freeblock_unlock(void) {
int HP_map_addblock(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_addblock_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_map_addblock_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addblock_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39163,9 +39904,9 @@ int HP_map_addblock(struct block_list *bl) {
{
retVal___ = HPMHooks.source.map.addblock(bl);
}
- if( HPMHooks.count.HP_map_addblock_post ) {
+ if (HPMHooks.count.HP_map_addblock_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addblock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addblock_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -39175,14 +39916,14 @@ int HP_map_addblock(struct block_list *bl) {
int HP_map_delblock(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_delblock_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_map_delblock_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_delblock_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39190,9 +39931,9 @@ int HP_map_delblock(struct block_list *bl) {
{
retVal___ = HPMHooks.source.map.delblock(bl);
}
- if( HPMHooks.count.HP_map_delblock_post ) {
+ if (HPMHooks.count.HP_map_delblock_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delblock_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_delblock_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -39202,14 +39943,14 @@ int HP_map_delblock(struct block_list *bl) {
int HP_map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_moveblock_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *x1, int *y1, int64 *tick);
+ if (HPMHooks.count.HP_map_moveblock_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *x1, int *y1, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_moveblock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_moveblock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_moveblock_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &x1, &y1, &tick);
+ retVal___ = preHookFunc(&bl, &x1, &y1, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39217,11 +39958,11 @@ int HP_map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) {
{
retVal___ = HPMHooks.source.map.moveblock(bl, x1, y1, tick);
}
- if( HPMHooks.count.HP_map_moveblock_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *x1, int *y1, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_moveblock_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_moveblock_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int x1, int y1, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_moveblock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_moveblock_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &x1, &y1, &tick);
+ retVal___ = postHookFunc(retVal___, bl, x1, y1, tick);
}
}
return retVal___;
@@ -39229,14 +39970,14 @@ int HP_map_moveblock(struct block_list *bl, int x1, int y1, int64 tick) {
int HP_map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_count_oncell_pre ) {
+ if (HPMHooks.count.HP_map_count_oncell_pre > 0) {
int (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *type, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_count_oncell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_count_oncell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_count_oncell_pre[hIndex].func;
retVal___ = preHookFunc(&m, &x, &y, &type, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39244,11 +39985,11 @@ int HP_map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) {
{
retVal___ = HPMHooks.source.map.count_oncell(m, x, y, type, flag);
}
- if( HPMHooks.count.HP_map_count_oncell_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, int16 *x, int16 *y, int *type, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_count_oncell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_count_oncell_post > 0) {
+ int (*postHookFunc) (int retVal___, int16 m, int16 x, int16 y, int type, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_count_oncell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_count_oncell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &x, &y, &type, &flag);
+ retVal___ = postHookFunc(retVal___, m, x, y, type, flag);
}
}
return retVal___;
@@ -39256,14 +39997,14 @@ int HP_map_count_oncell(int16 m, int16 x, int16 y, int type, int flag) {
struct skill_unit* HP_map_find_skill_unit_oncell(struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag) {
int hIndex = 0;
struct skill_unit* retVal___ = NULL;
- if( HPMHooks.count.HP_map_find_skill_unit_oncell_pre ) {
- struct skill_unit* (*preHookFunc) (struct block_list *target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit *out_unit, int *flag);
+ if (HPMHooks.count.HP_map_find_skill_unit_oncell_pre > 0) {
+ struct skill_unit* (*preHookFunc) (struct block_list **target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit **out_unit, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_find_skill_unit_oncell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_find_skill_unit_oncell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_find_skill_unit_oncell_pre[hIndex].func;
- retVal___ = preHookFunc(target, &x, &y, &skill_id, out_unit, &flag);
+ retVal___ = preHookFunc(&target, &x, &y, &skill_id, &out_unit, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39271,11 +40012,11 @@ struct skill_unit* HP_map_find_skill_unit_oncell(struct block_list *target, int1
{
retVal___ = HPMHooks.source.map.find_skill_unit_oncell(target, x, y, skill_id, out_unit, flag);
}
- if( HPMHooks.count.HP_map_find_skill_unit_oncell_post ) {
- struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, struct block_list *target, int16 *x, int16 *y, uint16 *skill_id, struct skill_unit *out_unit, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_find_skill_unit_oncell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_find_skill_unit_oncell_post > 0) {
+ struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, struct block_list *target, int16 x, int16 y, uint16 skill_id, struct skill_unit *out_unit, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_find_skill_unit_oncell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_find_skill_unit_oncell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, target, &x, &y, &skill_id, out_unit, &flag);
+ retVal___ = postHookFunc(retVal___, target, x, y, skill_id, out_unit, flag);
}
}
return retVal___;
@@ -39283,14 +40024,14 @@ struct skill_unit* HP_map_find_skill_unit_oncell(struct block_list *target, int1
int HP_map_get_new_object_id(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_get_new_object_id_pre ) {
+ if (HPMHooks.count.HP_map_get_new_object_id_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_object_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_object_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_get_new_object_id_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39298,9 +40039,9 @@ int HP_map_get_new_object_id(void) {
{
retVal___ = HPMHooks.source.map.get_new_object_id();
}
- if( HPMHooks.count.HP_map_get_new_object_id_post ) {
+ if (HPMHooks.count.HP_map_get_new_object_id_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_object_id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_object_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_get_new_object_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -39310,14 +40051,14 @@ int HP_map_get_new_object_id(void) {
int HP_map_search_freecell(struct block_list *src, int16 m, int16 *x, int16 *y, int16 rx, int16 ry, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_search_freecell_pre ) {
- int (*preHookFunc) (struct block_list *src, int16 *m, int16 *x, int16 *y, int16 *rx, int16 *ry, int *flag);
+ if (HPMHooks.count.HP_map_search_freecell_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int16 *m, int16 **x, int16 **y, int16 *rx, int16 *ry, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_search_freecell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_search_freecell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_search_freecell_pre[hIndex].func;
- retVal___ = preHookFunc(src, &m, x, y, &rx, &ry, &flag);
+ retVal___ = preHookFunc(&src, &m, &x, &y, &rx, &ry, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39325,11 +40066,11 @@ int HP_map_search_freecell(struct block_list *src, int16 m, int16 *x, int16 *y,
{
retVal___ = HPMHooks.source.map.search_freecell(src, m, x, y, rx, ry, flag);
}
- if( HPMHooks.count.HP_map_search_freecell_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int16 *m, int16 *x, int16 *y, int16 *rx, int16 *ry, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_search_freecell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_search_freecell_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int16 m, int16 *x, int16 *y, int16 rx, int16 ry, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_search_freecell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_search_freecell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &m, x, y, &rx, &ry, &flag);
+ retVal___ = postHookFunc(retVal___, src, m, x, y, rx, ry, flag);
}
}
return retVal___;
@@ -39337,14 +40078,14 @@ int HP_map_search_freecell(struct block_list *src, int16 m, int16 *x, int16 *y,
bool HP_map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_map_closest_freecell_pre ) {
- bool (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *type, int *flag);
+ if (HPMHooks.count.HP_map_closest_freecell_pre > 0) {
+ bool (*preHookFunc) (int16 *m, const struct block_list **bl, int16 **x, int16 **y, int *type, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_closest_freecell_pre[hIndex].func;
- retVal___ = preHookFunc(&m, bl, x, y, &type, &flag);
+ retVal___ = preHookFunc(&m, &bl, &x, &y, &type, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39352,11 +40093,11 @@ bool HP_map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int
{
retVal___ = HPMHooks.source.map.closest_freecell(m, bl, x, y, type, flag);
}
- if( HPMHooks.count.HP_map_closest_freecell_post ) {
- bool (*postHookFunc) (bool retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *type, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_closest_freecell_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int16 m, const struct block_list *bl, int16 *x, int16 *y, int type, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_closest_freecell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_closest_freecell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, bl, x, y, &type, &flag);
+ retVal___ = postHookFunc(retVal___, m, bl, x, y, type, flag);
}
}
return retVal___;
@@ -39364,14 +40105,14 @@ bool HP_map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, int
int HP_map_quit(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_quit_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_map_quit_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_quit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_quit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_quit_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39379,9 +40120,9 @@ int HP_map_quit(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.map.quit(sd);
}
- if( HPMHooks.count.HP_map_quit_post ) {
+ if (HPMHooks.count.HP_map_quit_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_quit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_quit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_quit_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -39391,14 +40132,14 @@ int HP_map_quit(struct map_session_data *sd) {
bool HP_map_addnpc(int16 m, struct npc_data *nd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_map_addnpc_pre ) {
- bool (*preHookFunc) (int16 *m, struct npc_data *nd);
+ if (HPMHooks.count.HP_map_addnpc_pre > 0) {
+ bool (*preHookFunc) (int16 *m, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addnpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addnpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addnpc_pre[hIndex].func;
- retVal___ = preHookFunc(&m, nd);
+ retVal___ = preHookFunc(&m, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39406,11 +40147,11 @@ bool HP_map_addnpc(int16 m, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.map.addnpc(m, nd);
}
- if( HPMHooks.count.HP_map_addnpc_post ) {
- bool (*postHookFunc) (bool retVal___, int16 *m, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addnpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_addnpc_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int16 m, struct npc_data *nd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addnpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addnpc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, nd);
+ retVal___ = postHookFunc(retVal___, m, nd);
}
}
return retVal___;
@@ -39418,14 +40159,14 @@ bool HP_map_addnpc(int16 m, struct npc_data *nd) {
int HP_map_clearflooritem_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_clearflooritem_timer_pre ) {
+ if (HPMHooks.count.HP_map_clearflooritem_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_clearflooritem_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39433,11 +40174,11 @@ int HP_map_clearflooritem_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.map.clearflooritem_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_map_clearflooritem_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_clearflooritem_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_clearflooritem_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -39445,14 +40186,14 @@ int HP_map_clearflooritem_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_map_removemobs_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_removemobs_timer_pre ) {
+ if (HPMHooks.count.HP_map_removemobs_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_removemobs_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39460,25 +40201,25 @@ int HP_map_removemobs_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.map.removemobs_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_map_removemobs_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_removemobs_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_removemobs_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_map_clearflooritem(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_clearflooritem_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_map_clearflooritem_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_clearflooritem_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39486,9 +40227,9 @@ void HP_map_clearflooritem(struct block_list *bl) {
{
HPMHooks.source.map.clearflooritem(bl);
}
- if( HPMHooks.count.HP_map_clearflooritem_post ) {
+ if (HPMHooks.count.HP_map_clearflooritem_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_clearflooritem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_clearflooritem_post[hIndex].func;
postHookFunc(bl);
}
@@ -39498,14 +40239,14 @@ void HP_map_clearflooritem(struct block_list *bl) {
int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_addflooritem_pre ) {
- int (*preHookFunc) (const struct block_list *bl, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
+ if (HPMHooks.count.HP_map_addflooritem_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl, struct item **item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addflooritem_pre[hIndex].func;
- retVal___ = preHookFunc(bl, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
+ retVal___ = preHookFunc(&bl, &item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39513,25 +40254,25 @@ int HP_map_addflooritem(const struct block_list *bl, struct item *item_data, int
{
retVal___ = HPMHooks.source.map.addflooritem(bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags);
}
- if( HPMHooks.count.HP_map_addflooritem_post ) {
- int (*postHookFunc) (int retVal___, const struct block_list *bl, struct item *item_data, int *amount, int16 *m, int16 *x, int16 *y, int *first_charid, int *second_charid, int *third_charid, int *flags);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_addflooritem_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl, struct item *item_data, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addflooritem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addflooritem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, item_data, &amount, &m, &x, &y, &first_charid, &second_charid, &third_charid, &flags);
+ retVal___ = postHookFunc(retVal___, bl, item_data, amount, m, x, y, first_charid, second_charid, third_charid, flags);
}
}
return retVal___;
}
void HP_map_addnickdb(int charid, const char *nick) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_addnickdb_pre ) {
- void (*preHookFunc) (int *charid, const char *nick);
+ if (HPMHooks.count.HP_map_addnickdb_pre > 0) {
+ void (*preHookFunc) (int *charid, const char **nick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addnickdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addnickdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addnickdb_pre[hIndex].func;
- preHookFunc(&charid, nick);
+ preHookFunc(&charid, &nick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39539,25 +40280,25 @@ void HP_map_addnickdb(int charid, const char *nick) {
{
HPMHooks.source.map.addnickdb(charid, nick);
}
- if( HPMHooks.count.HP_map_addnickdb_post ) {
- void (*postHookFunc) (int *charid, const char *nick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addnickdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_addnickdb_post > 0) {
+ void (*postHookFunc) (int charid, const char *nick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addnickdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addnickdb_post[hIndex].func;
- postHookFunc(&charid, nick);
+ postHookFunc(charid, nick);
}
}
return;
}
void HP_map_delnickdb(int charid, const char *nick) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_delnickdb_pre ) {
- void (*preHookFunc) (int *charid, const char *nick);
+ if (HPMHooks.count.HP_map_delnickdb_pre > 0) {
+ void (*preHookFunc) (int *charid, const char **nick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delnickdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delnickdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_delnickdb_pre[hIndex].func;
- preHookFunc(&charid, nick);
+ preHookFunc(&charid, &nick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39565,25 +40306,25 @@ void HP_map_delnickdb(int charid, const char *nick) {
{
HPMHooks.source.map.delnickdb(charid, nick);
}
- if( HPMHooks.count.HP_map_delnickdb_post ) {
- void (*postHookFunc) (int *charid, const char *nick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delnickdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_delnickdb_post > 0) {
+ void (*postHookFunc) (int charid, const char *nick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delnickdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_delnickdb_post[hIndex].func;
- postHookFunc(&charid, nick);
+ postHookFunc(charid, nick);
}
}
return;
}
void HP_map_reqnickdb(struct map_session_data *sd, int charid) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_reqnickdb_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *charid);
+ if (HPMHooks.count.HP_map_reqnickdb_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *charid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reqnickdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_reqnickdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_reqnickdb_pre[hIndex].func;
- preHookFunc(sd, &charid);
+ preHookFunc(&sd, &charid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39591,11 +40332,11 @@ void HP_map_reqnickdb(struct map_session_data *sd, int charid) {
{
HPMHooks.source.map.reqnickdb(sd, charid);
}
- if( HPMHooks.count.HP_map_reqnickdb_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *charid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reqnickdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_reqnickdb_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int charid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_reqnickdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_reqnickdb_post[hIndex].func;
- postHookFunc(sd, &charid);
+ postHookFunc(sd, charid);
}
}
return;
@@ -39603,14 +40344,14 @@ void HP_map_reqnickdb(struct map_session_data *sd, int charid) {
const char* HP_map_charid2nick(int charid) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_map_charid2nick_pre ) {
+ if (HPMHooks.count.HP_map_charid2nick_pre > 0) {
const char* (*preHookFunc) (int *charid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2nick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2nick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_charid2nick_pre[hIndex].func;
retVal___ = preHookFunc(&charid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39618,11 +40359,11 @@ const char* HP_map_charid2nick(int charid) {
{
retVal___ = HPMHooks.source.map.charid2nick(charid);
}
- if( HPMHooks.count.HP_map_charid2nick_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *charid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2nick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_charid2nick_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int charid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2nick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_charid2nick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &charid);
+ retVal___ = postHookFunc(retVal___, charid);
}
}
return retVal___;
@@ -39630,14 +40371,14 @@ const char* HP_map_charid2nick(int charid) {
struct map_session_data* HP_map_charid2sd(int charid) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_charid2sd_pre ) {
+ if (HPMHooks.count.HP_map_charid2sd_pre > 0) {
struct map_session_data* (*preHookFunc) (int *charid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_charid2sd_pre[hIndex].func;
retVal___ = preHookFunc(&charid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39645,27 +40386,27 @@ struct map_session_data* HP_map_charid2sd(int charid) {
{
retVal___ = HPMHooks.source.map.charid2sd(charid);
}
- if( HPMHooks.count.HP_map_charid2sd_post ) {
- struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int *charid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2sd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_charid2sd_post > 0) {
+ struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int charid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_charid2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_charid2sd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &charid);
+ retVal___ = postHookFunc(retVal___, charid);
}
}
return retVal___;
}
void HP_map_vforeachpc(int ( *func ) (struct map_session_data *sd, va_list args), va_list args) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_vforeachpc_pre ) {
- void (*preHookFunc) (int ( *func ) (struct map_session_data *sd, va_list args), va_list args);
+ if (HPMHooks.count.HP_map_vforeachpc_pre > 0) {
+ void (*preHookFunc) (int ( **func ) (struct map_session_data *sd, va_list args), va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachpc_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_vforeachpc_pre[hIndex].func;
- preHookFunc(func, args___copy);
+ preHookFunc(&func, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39675,9 +40416,9 @@ void HP_map_vforeachpc(int ( *func ) (struct map_session_data *sd, va_list args)
HPMHooks.source.map.vforeachpc(func, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_vforeachpc_post ) {
+ if (HPMHooks.count.HP_map_vforeachpc_post > 0) {
void (*postHookFunc) (int ( *func ) (struct map_session_data *sd, va_list args), va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachpc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachpc_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_vforeachpc_post[hIndex].func;
postHookFunc(func, args___copy);
@@ -39688,16 +40429,16 @@ void HP_map_vforeachpc(int ( *func ) (struct map_session_data *sd, va_list args)
}
void HP_map_vforeachmob(int ( *func ) (struct mob_data *md, va_list args), va_list args) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_vforeachmob_pre ) {
- void (*preHookFunc) (int ( *func ) (struct mob_data *md, va_list args), va_list args);
+ if (HPMHooks.count.HP_map_vforeachmob_pre > 0) {
+ void (*preHookFunc) (int ( **func ) (struct mob_data *md, va_list args), va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachmob_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachmob_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_vforeachmob_pre[hIndex].func;
- preHookFunc(func, args___copy);
+ preHookFunc(&func, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39707,9 +40448,9 @@ void HP_map_vforeachmob(int ( *func ) (struct mob_data *md, va_list args), va_li
HPMHooks.source.map.vforeachmob(func, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_vforeachmob_post ) {
+ if (HPMHooks.count.HP_map_vforeachmob_post > 0) {
void (*postHookFunc) (int ( *func ) (struct mob_data *md, va_list args), va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachmob_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachmob_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_vforeachmob_post[hIndex].func;
postHookFunc(func, args___copy);
@@ -39720,16 +40461,16 @@ void HP_map_vforeachmob(int ( *func ) (struct mob_data *md, va_list args), va_li
}
void HP_map_vforeachnpc(int ( *func ) (struct npc_data *nd, va_list args), va_list args) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_vforeachnpc_pre ) {
- void (*preHookFunc) (int ( *func ) (struct npc_data *nd, va_list args), va_list args);
+ if (HPMHooks.count.HP_map_vforeachnpc_pre > 0) {
+ void (*preHookFunc) (int ( **func ) (struct npc_data *nd, va_list args), va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachnpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachnpc_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_vforeachnpc_pre[hIndex].func;
- preHookFunc(func, args___copy);
+ preHookFunc(&func, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39739,9 +40480,9 @@ void HP_map_vforeachnpc(int ( *func ) (struct npc_data *nd, va_list args), va_li
HPMHooks.source.map.vforeachnpc(func, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_vforeachnpc_post ) {
+ if (HPMHooks.count.HP_map_vforeachnpc_post > 0) {
void (*postHookFunc) (int ( *func ) (struct npc_data *nd, va_list args), va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachnpc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachnpc_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_vforeachnpc_post[hIndex].func;
postHookFunc(func, args___copy);
@@ -39752,16 +40493,16 @@ void HP_map_vforeachnpc(int ( *func ) (struct npc_data *nd, va_list args), va_li
}
void HP_map_vforeachregen(int ( *func ) (struct block_list *bl, va_list args), va_list args) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_vforeachregen_pre ) {
- void (*preHookFunc) (int ( *func ) (struct block_list *bl, va_list args), va_list args);
+ if (HPMHooks.count.HP_map_vforeachregen_pre > 0) {
+ void (*preHookFunc) (int ( **func ) (struct block_list *bl, va_list args), va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachregen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachregen_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_vforeachregen_pre[hIndex].func;
- preHookFunc(func, args___copy);
+ preHookFunc(&func, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39771,9 +40512,9 @@ void HP_map_vforeachregen(int ( *func ) (struct block_list *bl, va_list args), v
HPMHooks.source.map.vforeachregen(func, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_vforeachregen_post ) {
+ if (HPMHooks.count.HP_map_vforeachregen_post > 0) {
void (*postHookFunc) (int ( *func ) (struct block_list *bl, va_list args), va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachregen_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachregen_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_vforeachregen_post[hIndex].func;
postHookFunc(func, args___copy);
@@ -39784,16 +40525,16 @@ void HP_map_vforeachregen(int ( *func ) (struct block_list *bl, va_list args), v
}
void HP_map_vforeachiddb(int ( *func ) (struct block_list *bl, va_list args), va_list args) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_vforeachiddb_pre ) {
- void (*preHookFunc) (int ( *func ) (struct block_list *bl, va_list args), va_list args);
+ if (HPMHooks.count.HP_map_vforeachiddb_pre > 0) {
+ void (*preHookFunc) (int ( **func ) (struct block_list *bl, va_list args), va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachiddb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachiddb_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_vforeachiddb_pre[hIndex].func;
- preHookFunc(func, args___copy);
+ preHookFunc(&func, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -39803,9 +40544,9 @@ void HP_map_vforeachiddb(int ( *func ) (struct block_list *bl, va_list args), va
HPMHooks.source.map.vforeachiddb(func, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_vforeachiddb_post ) {
+ if (HPMHooks.count.HP_map_vforeachiddb_post > 0) {
void (*postHookFunc) (int ( *func ) (struct block_list *bl, va_list args), va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachiddb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachiddb_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_vforeachiddb_post[hIndex].func;
postHookFunc(func, args___copy);
@@ -39817,16 +40558,16 @@ void HP_map_vforeachiddb(int ( *func ) (struct block_list *bl, va_list args), va
int HP_map_vforeachinrange(int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachinrange_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachinrange_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinrange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinrange_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachinrange_pre[hIndex].func;
- retVal___ = preHookFunc(func, center, &range, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &center, &range, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39836,12 +40577,12 @@ int HP_map_vforeachinrange(int ( *func ) (struct block_list *, va_list), struct
retVal___ = HPMHooks.source.map.vforeachinrange(func, center, range, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachinrange_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinrange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachinrange_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinrange_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachinrange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, center, &range, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, center, range, type, ap___copy);
va_end(ap___copy);
}
}
@@ -39850,16 +40591,16 @@ int HP_map_vforeachinrange(int ( *func ) (struct block_list *, va_list), struct
int HP_map_vforeachinshootrange(int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachinshootrange_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachinshootrange_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinshootrange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinshootrange_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachinshootrange_pre[hIndex].func;
- retVal___ = preHookFunc(func, center, &range, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &center, &range, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39869,12 +40610,12 @@ int HP_map_vforeachinshootrange(int ( *func ) (struct block_list *, va_list), st
retVal___ = HPMHooks.source.map.vforeachinshootrange(func, center, range, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachinshootrange_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinshootrange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachinshootrange_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinshootrange_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachinshootrange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, center, &range, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, center, range, type, ap___copy);
va_end(ap___copy);
}
}
@@ -39883,16 +40624,16 @@ int HP_map_vforeachinshootrange(int ( *func ) (struct block_list *, va_list), st
int HP_map_vforeachinarea(int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachinarea_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachinarea_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinarea_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinarea_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachinarea_pre[hIndex].func;
- retVal___ = preHookFunc(func, &m, &x0, &y0, &x1, &y1, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &m, &x0, &y0, &x1, &y1, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39902,12 +40643,12 @@ int HP_map_vforeachinarea(int ( *func ) (struct block_list *, va_list), int16 m,
retVal___ = HPMHooks.source.map.vforeachinarea(func, m, x0, y0, x1, y1, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachinarea_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinarea_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachinarea_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinarea_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachinarea_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, &m, &x0, &y0, &x1, &y1, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, m, x0, y0, x1, y1, type, ap___copy);
va_end(ap___copy);
}
}
@@ -39916,16 +40657,16 @@ int HP_map_vforeachinarea(int ( *func ) (struct block_list *, va_list), int16 m,
int HP_map_vforcountinrange(int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int count, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforcountinrange_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int *count, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforcountinrange_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int *count, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinrange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinrange_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforcountinrange_pre[hIndex].func;
- retVal___ = preHookFunc(func, center, &range, &count, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &center, &range, &count, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39935,12 +40676,12 @@ int HP_map_vforcountinrange(int ( *func ) (struct block_list *, va_list), struct
retVal___ = HPMHooks.source.map.vforcountinrange(func, center, range, count, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforcountinrange_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int *count, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinrange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforcountinrange_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int count, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinrange_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforcountinrange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, center, &range, &count, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, center, range, count, type, ap___copy);
va_end(ap___copy);
}
}
@@ -39949,16 +40690,16 @@ int HP_map_vforcountinrange(int ( *func ) (struct block_list *, va_list), struct
int HP_map_vforcountinarea(int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int count, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforcountinarea_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *count, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforcountinarea_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *count, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinarea_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinarea_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforcountinarea_pre[hIndex].func;
- retVal___ = preHookFunc(func, &m, &x0, &y0, &x1, &y1, &count, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &m, &x0, &y0, &x1, &y1, &count, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -39968,12 +40709,12 @@ int HP_map_vforcountinarea(int ( *func ) (struct block_list *, va_list), int16 m
retVal___ = HPMHooks.source.map.vforcountinarea(func, m, x0, y0, x1, y1, count, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforcountinarea_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *count, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinarea_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforcountinarea_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int count, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforcountinarea_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforcountinarea_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, &m, &x0, &y0, &x1, &y1, &count, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, m, x0, y0, x1, y1, count, type, ap___copy);
va_end(ap___copy);
}
}
@@ -39982,16 +40723,16 @@ int HP_map_vforcountinarea(int ( *func ) (struct block_list *, va_list), int16 m
int HP_map_vforeachinmovearea(int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int16 dx, int16 dy, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachinmovearea_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int16 *dx, int16 *dy, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachinmovearea_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), struct block_list **center, int16 *range, int16 *dx, int16 *dy, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmovearea_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmovearea_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachinmovearea_pre[hIndex].func;
- retVal___ = preHookFunc(func, center, &range, &dx, &dy, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &center, &range, &dx, &dy, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40001,12 +40742,12 @@ int HP_map_vforeachinmovearea(int ( *func ) (struct block_list *, va_list), stru
retVal___ = HPMHooks.source.map.vforeachinmovearea(func, center, range, dx, dy, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachinmovearea_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 *range, int16 *dx, int16 *dy, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmovearea_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachinmovearea_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct block_list *center, int16 range, int16 dx, int16 dy, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmovearea_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachinmovearea_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, center, &range, &dx, &dy, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, center, range, dx, dy, type, ap___copy);
va_end(ap___copy);
}
}
@@ -40015,16 +40756,16 @@ int HP_map_vforeachinmovearea(int ( *func ) (struct block_list *, va_list), stru
int HP_map_vforeachincell(int ( *func ) (struct block_list *, va_list), int16 m, int16 x, int16 y, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachincell_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x, int16 *y, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachincell_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x, int16 *y, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachincell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachincell_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachincell_pre[hIndex].func;
- retVal___ = preHookFunc(func, &m, &x, &y, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &m, &x, &y, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40034,12 +40775,12 @@ int HP_map_vforeachincell(int ( *func ) (struct block_list *, va_list), int16 m,
retVal___ = HPMHooks.source.map.vforeachincell(func, m, x, y, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachincell_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x, int16 *y, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachincell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachincell_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x, int16 y, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachincell_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachincell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, &m, &x, &y, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, m, x, y, type, ap___copy);
va_end(ap___copy);
}
}
@@ -40048,16 +40789,16 @@ int HP_map_vforeachincell(int ( *func ) (struct block_list *, va_list), int16 m,
int HP_map_vforeachinpath(int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int16 range, int length, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachinpath_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int16 *range, int *length, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachinpath_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int16 *range, int *length, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinpath_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinpath_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachinpath_pre[hIndex].func;
- retVal___ = preHookFunc(func, &m, &x0, &y0, &x1, &y1, &range, &length, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &m, &x0, &y0, &x1, &y1, &range, &length, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40067,12 +40808,12 @@ int HP_map_vforeachinpath(int ( *func ) (struct block_list *, va_list), int16 m,
retVal___ = HPMHooks.source.map.vforeachinpath(func, m, x0, y0, x1, y1, range, length, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachinpath_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int16 *range, int *length, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinpath_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachinpath_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int16 range, int length, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinpath_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachinpath_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, &m, &x0, &y0, &x1, &y1, &range, &length, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, m, x0, y0, x1, y1, range, length, type, ap___copy);
va_end(ap___copy);
}
}
@@ -40081,16 +40822,16 @@ int HP_map_vforeachinpath(int ( *func ) (struct block_list *, va_list), int16 m,
int HP_map_vforeachinmap(int ( *func ) (struct block_list *, va_list), int16 m, int type, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachinmap_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), int16 *m, int *type, va_list args);
+ if (HPMHooks.count.HP_map_vforeachinmap_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), int16 *m, int *type, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmap_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_vforeachinmap_pre[hIndex].func;
- retVal___ = preHookFunc(func, &m, &type, args___copy);
+ retVal___ = preHookFunc(&func, &m, &type, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40100,12 +40841,12 @@ int HP_map_vforeachinmap(int ( *func ) (struct block_list *, va_list), int16 m,
retVal___ = HPMHooks.source.map.vforeachinmap(func, m, type, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_vforeachinmap_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 *m, int *type, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachinmap_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 m, int type, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachinmap_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_vforeachinmap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, &m, &type, args___copy);
+ retVal___ = postHookFunc(retVal___, func, m, type, args___copy);
va_end(args___copy);
}
}
@@ -40114,16 +40855,16 @@ int HP_map_vforeachinmap(int ( *func ) (struct block_list *, va_list), int16 m,
int HP_map_vforeachininstance(int ( *func ) (struct block_list *, va_list), int16 instance_id, int type, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_vforeachininstance_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), int16 *instance_id, int *type, va_list ap);
+ if (HPMHooks.count.HP_map_vforeachininstance_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), int16 *instance_id, int *type, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachininstance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachininstance_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_vforeachininstance_pre[hIndex].func;
- retVal___ = preHookFunc(func, &instance_id, &type, ap___copy);
+ retVal___ = preHookFunc(&func, &instance_id, &type, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40133,12 +40874,12 @@ int HP_map_vforeachininstance(int ( *func ) (struct block_list *, va_list), int1
retVal___ = HPMHooks.source.map.vforeachininstance(func, instance_id, type, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_vforeachininstance_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 *instance_id, int *type, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachininstance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_vforeachininstance_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), int16 instance_id, int type, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_vforeachininstance_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_vforeachininstance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, &instance_id, &type, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, instance_id, type, ap___copy);
va_end(ap___copy);
}
}
@@ -40147,14 +40888,14 @@ int HP_map_vforeachininstance(int ( *func ) (struct block_list *, va_list), int1
struct map_session_data* HP_map_id2sd(int id) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2sd_pre ) {
+ if (HPMHooks.count.HP_map_id2sd_pre > 0) {
struct map_session_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2sd_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40162,11 +40903,11 @@ struct map_session_data* HP_map_id2sd(int id) {
{
retVal___ = HPMHooks.source.map.id2sd(id);
}
- if( HPMHooks.count.HP_map_id2sd_post ) {
- struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2sd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2sd_post > 0) {
+ struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2sd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40174,14 +40915,14 @@ struct map_session_data* HP_map_id2sd(int id) {
struct npc_data* HP_map_id2nd(int id) {
int hIndex = 0;
struct npc_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2nd_pre ) {
+ if (HPMHooks.count.HP_map_id2nd_pre > 0) {
struct npc_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2nd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2nd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2nd_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40189,11 +40930,11 @@ struct npc_data* HP_map_id2nd(int id) {
{
retVal___ = HPMHooks.source.map.id2nd(id);
}
- if( HPMHooks.count.HP_map_id2nd_post ) {
- struct npc_data* (*postHookFunc) (struct npc_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2nd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2nd_post > 0) {
+ struct npc_data* (*postHookFunc) (struct npc_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2nd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2nd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40201,14 +40942,14 @@ struct npc_data* HP_map_id2nd(int id) {
struct mob_data* HP_map_id2md(int id) {
int hIndex = 0;
struct mob_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2md_pre ) {
+ if (HPMHooks.count.HP_map_id2md_pre > 0) {
struct mob_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2md_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2md_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2md_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40216,11 +40957,11 @@ struct mob_data* HP_map_id2md(int id) {
{
retVal___ = HPMHooks.source.map.id2md(id);
}
- if( HPMHooks.count.HP_map_id2md_post ) {
- struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2md_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2md_post > 0) {
+ struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2md_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2md_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40228,14 +40969,14 @@ struct mob_data* HP_map_id2md(int id) {
struct flooritem_data* HP_map_id2fi(int id) {
int hIndex = 0;
struct flooritem_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2fi_pre ) {
+ if (HPMHooks.count.HP_map_id2fi_pre > 0) {
struct flooritem_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2fi_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2fi_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2fi_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40243,11 +40984,11 @@ struct flooritem_data* HP_map_id2fi(int id) {
{
retVal___ = HPMHooks.source.map.id2fi(id);
}
- if( HPMHooks.count.HP_map_id2fi_post ) {
- struct flooritem_data* (*postHookFunc) (struct flooritem_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2fi_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2fi_post > 0) {
+ struct flooritem_data* (*postHookFunc) (struct flooritem_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2fi_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2fi_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40255,14 +40996,14 @@ struct flooritem_data* HP_map_id2fi(int id) {
struct chat_data* HP_map_id2cd(int id) {
int hIndex = 0;
struct chat_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2cd_pre ) {
+ if (HPMHooks.count.HP_map_id2cd_pre > 0) {
struct chat_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2cd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2cd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2cd_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40270,11 +41011,11 @@ struct chat_data* HP_map_id2cd(int id) {
{
retVal___ = HPMHooks.source.map.id2cd(id);
}
- if( HPMHooks.count.HP_map_id2cd_post ) {
- struct chat_data* (*postHookFunc) (struct chat_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2cd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2cd_post > 0) {
+ struct chat_data* (*postHookFunc) (struct chat_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2cd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2cd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40282,14 +41023,14 @@ struct chat_data* HP_map_id2cd(int id) {
struct skill_unit* HP_map_id2su(int id) {
int hIndex = 0;
struct skill_unit* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2su_pre ) {
+ if (HPMHooks.count.HP_map_id2su_pre > 0) {
struct skill_unit* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2su_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2su_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2su_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40297,11 +41038,11 @@ struct skill_unit* HP_map_id2su(int id) {
{
retVal___ = HPMHooks.source.map.id2su(id);
}
- if( HPMHooks.count.HP_map_id2su_post ) {
- struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2su_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2su_post > 0) {
+ struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2su_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2su_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40309,14 +41050,14 @@ struct skill_unit* HP_map_id2su(int id) {
struct pet_data* HP_map_id2pd(int id) {
int hIndex = 0;
struct pet_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2pd_pre ) {
+ if (HPMHooks.count.HP_map_id2pd_pre > 0) {
struct pet_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2pd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2pd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2pd_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40324,11 +41065,11 @@ struct pet_data* HP_map_id2pd(int id) {
{
retVal___ = HPMHooks.source.map.id2pd(id);
}
- if( HPMHooks.count.HP_map_id2pd_post ) {
- struct pet_data* (*postHookFunc) (struct pet_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2pd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2pd_post > 0) {
+ struct pet_data* (*postHookFunc) (struct pet_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2pd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2pd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40336,14 +41077,14 @@ struct pet_data* HP_map_id2pd(int id) {
struct homun_data* HP_map_id2hd(int id) {
int hIndex = 0;
struct homun_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2hd_pre ) {
+ if (HPMHooks.count.HP_map_id2hd_pre > 0) {
struct homun_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2hd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2hd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2hd_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40351,11 +41092,11 @@ struct homun_data* HP_map_id2hd(int id) {
{
retVal___ = HPMHooks.source.map.id2hd(id);
}
- if( HPMHooks.count.HP_map_id2hd_post ) {
- struct homun_data* (*postHookFunc) (struct homun_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2hd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2hd_post > 0) {
+ struct homun_data* (*postHookFunc) (struct homun_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2hd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2hd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40363,14 +41104,14 @@ struct homun_data* HP_map_id2hd(int id) {
struct mercenary_data* HP_map_id2mc(int id) {
int hIndex = 0;
struct mercenary_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2mc_pre ) {
+ if (HPMHooks.count.HP_map_id2mc_pre > 0) {
struct mercenary_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2mc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2mc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2mc_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40378,11 +41119,11 @@ struct mercenary_data* HP_map_id2mc(int id) {
{
retVal___ = HPMHooks.source.map.id2mc(id);
}
- if( HPMHooks.count.HP_map_id2mc_post ) {
- struct mercenary_data* (*postHookFunc) (struct mercenary_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2mc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2mc_post > 0) {
+ struct mercenary_data* (*postHookFunc) (struct mercenary_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2mc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2mc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40390,14 +41131,14 @@ struct mercenary_data* HP_map_id2mc(int id) {
struct elemental_data* HP_map_id2ed(int id) {
int hIndex = 0;
struct elemental_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2ed_pre ) {
+ if (HPMHooks.count.HP_map_id2ed_pre > 0) {
struct elemental_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2ed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2ed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2ed_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40405,11 +41146,11 @@ struct elemental_data* HP_map_id2ed(int id) {
{
retVal___ = HPMHooks.source.map.id2ed(id);
}
- if( HPMHooks.count.HP_map_id2ed_post ) {
- struct elemental_data* (*postHookFunc) (struct elemental_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2ed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2ed_post > 0) {
+ struct elemental_data* (*postHookFunc) (struct elemental_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2ed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2ed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40417,14 +41158,14 @@ struct elemental_data* HP_map_id2ed(int id) {
struct block_list* HP_map_id2bl(int id) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2bl_pre ) {
+ if (HPMHooks.count.HP_map_id2bl_pre > 0) {
struct block_list* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2bl_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2bl_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2bl_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40432,11 +41173,11 @@ struct block_list* HP_map_id2bl(int id) {
{
retVal___ = HPMHooks.source.map.id2bl(id);
}
- if( HPMHooks.count.HP_map_id2bl_post ) {
- struct block_list* (*postHookFunc) (struct block_list* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2bl_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2bl_post > 0) {
+ struct block_list* (*postHookFunc) (struct block_list* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2bl_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2bl_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40444,14 +41185,14 @@ struct block_list* HP_map_id2bl(int id) {
bool HP_map_blid_exists(int id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_map_blid_exists_pre ) {
+ if (HPMHooks.count.HP_map_blid_exists_pre > 0) {
bool (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_blid_exists_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_blid_exists_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_blid_exists_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40459,11 +41200,11 @@ bool HP_map_blid_exists(int id) {
{
retVal___ = HPMHooks.source.map.blid_exists(id);
}
- if( HPMHooks.count.HP_map_blid_exists_post ) {
- bool (*postHookFunc) (bool retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_blid_exists_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_blid_exists_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_blid_exists_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_blid_exists_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40471,14 +41212,14 @@ bool HP_map_blid_exists(int id) {
int16 HP_map_mapindex2mapid(unsigned short map_index) {
int hIndex = 0;
int16 retVal___ = 0;
- if( HPMHooks.count.HP_map_mapindex2mapid_pre ) {
+ if (HPMHooks.count.HP_map_mapindex2mapid_pre > 0) {
int16 (*preHookFunc) (unsigned short *map_index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_mapindex2mapid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_mapindex2mapid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_mapindex2mapid_pre[hIndex].func;
retVal___ = preHookFunc(&map_index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40486,11 +41227,11 @@ int16 HP_map_mapindex2mapid(unsigned short map_index) {
{
retVal___ = HPMHooks.source.map.mapindex2mapid(map_index);
}
- if( HPMHooks.count.HP_map_mapindex2mapid_post ) {
- int16 (*postHookFunc) (int16 retVal___, unsigned short *map_index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_mapindex2mapid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_mapindex2mapid_post > 0) {
+ int16 (*postHookFunc) (int16 retVal___, unsigned short map_index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_mapindex2mapid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_mapindex2mapid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &map_index);
+ retVal___ = postHookFunc(retVal___, map_index);
}
}
return retVal___;
@@ -40498,14 +41239,14 @@ int16 HP_map_mapindex2mapid(unsigned short map_index) {
int16 HP_map_mapname2mapid(const char *name) {
int hIndex = 0;
int16 retVal___ = 0;
- if( HPMHooks.count.HP_map_mapname2mapid_pre ) {
- int16 (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_map_mapname2mapid_pre > 0) {
+ int16 (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2mapid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2mapid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_mapname2mapid_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40513,9 +41254,9 @@ int16 HP_map_mapname2mapid(const char *name) {
{
retVal___ = HPMHooks.source.map.mapname2mapid(name);
}
- if( HPMHooks.count.HP_map_mapname2mapid_post ) {
+ if (HPMHooks.count.HP_map_mapname2mapid_post > 0) {
int16 (*postHookFunc) (int16 retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2mapid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2mapid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_mapname2mapid_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -40525,14 +41266,14 @@ int16 HP_map_mapname2mapid(const char *name) {
int HP_map_mapname2ipport(unsigned short name, uint32 *ip, uint16 *port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_mapname2ipport_pre ) {
- int (*preHookFunc) (unsigned short *name, uint32 *ip, uint16 *port);
+ if (HPMHooks.count.HP_map_mapname2ipport_pre > 0) {
+ int (*preHookFunc) (unsigned short *name, uint32 **ip, uint16 **port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2ipport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2ipport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_mapname2ipport_pre[hIndex].func;
- retVal___ = preHookFunc(&name, ip, port);
+ retVal___ = preHookFunc(&name, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40540,11 +41281,11 @@ int HP_map_mapname2ipport(unsigned short name, uint32 *ip, uint16 *port) {
{
retVal___ = HPMHooks.source.map.mapname2ipport(name, ip, port);
}
- if( HPMHooks.count.HP_map_mapname2ipport_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *name, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2ipport_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_mapname2ipport_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short name, uint32 *ip, uint16 *port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_mapname2ipport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_mapname2ipport_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &name, ip, port);
+ retVal___ = postHookFunc(retVal___, name, ip, port);
}
}
return retVal___;
@@ -40552,14 +41293,14 @@ int HP_map_mapname2ipport(unsigned short name, uint32 *ip, uint16 *port) {
int HP_map_setipport(unsigned short map_index, uint32 ip, uint16 port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_setipport_pre ) {
+ if (HPMHooks.count.HP_map_setipport_pre > 0) {
int (*preHookFunc) (unsigned short *map_index, uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setipport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setipport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_setipport_pre[hIndex].func;
retVal___ = preHookFunc(&map_index, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40567,11 +41308,11 @@ int HP_map_setipport(unsigned short map_index, uint32 ip, uint16 port) {
{
retVal___ = HPMHooks.source.map.setipport(map_index, ip, port);
}
- if( HPMHooks.count.HP_map_setipport_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *map_index, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setipport_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_setipport_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short map_index, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setipport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_setipport_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &map_index, &ip, &port);
+ retVal___ = postHookFunc(retVal___, map_index, ip, port);
}
}
return retVal___;
@@ -40579,14 +41320,14 @@ int HP_map_setipport(unsigned short map_index, uint32 ip, uint16 port) {
int HP_map_eraseipport(unsigned short map_index, uint32 ip, uint16 port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_eraseipport_pre ) {
+ if (HPMHooks.count.HP_map_eraseipport_pre > 0) {
int (*preHookFunc) (unsigned short *map_index, uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseipport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseipport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_eraseipport_pre[hIndex].func;
retVal___ = preHookFunc(&map_index, &ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40594,11 +41335,11 @@ int HP_map_eraseipport(unsigned short map_index, uint32 ip, uint16 port) {
{
retVal___ = HPMHooks.source.map.eraseipport(map_index, ip, port);
}
- if( HPMHooks.count.HP_map_eraseipport_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *map_index, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseipport_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_eraseipport_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short map_index, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseipport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_eraseipport_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &map_index, &ip, &port);
+ retVal___ = postHookFunc(retVal___, map_index, ip, port);
}
}
return retVal___;
@@ -40606,14 +41347,14 @@ int HP_map_eraseipport(unsigned short map_index, uint32 ip, uint16 port) {
int HP_map_eraseallipport(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_eraseallipport_pre ) {
+ if (HPMHooks.count.HP_map_eraseallipport_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_eraseallipport_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40621,9 +41362,9 @@ int HP_map_eraseallipport(void) {
{
retVal___ = HPMHooks.source.map.eraseallipport();
}
- if( HPMHooks.count.HP_map_eraseallipport_post ) {
+ if (HPMHooks.count.HP_map_eraseallipport_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_eraseallipport_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -40632,14 +41373,14 @@ int HP_map_eraseallipport(void) {
}
void HP_map_addiddb(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_addiddb_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_map_addiddb_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addiddb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addiddb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addiddb_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -40647,9 +41388,9 @@ void HP_map_addiddb(struct block_list *bl) {
{
HPMHooks.source.map.addiddb(bl);
}
- if( HPMHooks.count.HP_map_addiddb_post ) {
+ if (HPMHooks.count.HP_map_addiddb_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addiddb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addiddb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addiddb_post[hIndex].func;
postHookFunc(bl);
}
@@ -40658,14 +41399,14 @@ void HP_map_addiddb(struct block_list *bl) {
}
void HP_map_deliddb(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_deliddb_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_map_deliddb_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_deliddb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_deliddb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_deliddb_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -40673,9 +41414,9 @@ void HP_map_deliddb(struct block_list *bl) {
{
HPMHooks.source.map.deliddb(bl);
}
- if( HPMHooks.count.HP_map_deliddb_post ) {
+ if (HPMHooks.count.HP_map_deliddb_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_deliddb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_deliddb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_deliddb_post[hIndex].func;
postHookFunc(bl);
}
@@ -40685,14 +41426,14 @@ void HP_map_deliddb(struct block_list *bl) {
struct map_session_data* HP_map_nick2sd(const char *nick) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_nick2sd_pre ) {
- struct map_session_data* (*preHookFunc) (const char *nick);
+ if (HPMHooks.count.HP_map_nick2sd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (const char **nick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_nick2sd_pre[hIndex].func;
- retVal___ = preHookFunc(nick);
+ retVal___ = preHookFunc(&nick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40700,9 +41441,9 @@ struct map_session_data* HP_map_nick2sd(const char *nick) {
{
retVal___ = HPMHooks.source.map.nick2sd(nick);
}
- if( HPMHooks.count.HP_map_nick2sd_post ) {
+ if (HPMHooks.count.HP_map_nick2sd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, const char *nick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_nick2sd_post[hIndex].func;
retVal___ = postHookFunc(retVal___, nick);
}
@@ -40712,14 +41453,14 @@ struct map_session_data* HP_map_nick2sd(const char *nick) {
struct mob_data* HP_map_getmob_boss(int16 m) {
int hIndex = 0;
struct mob_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_getmob_boss_pre ) {
+ if (HPMHooks.count.HP_map_getmob_boss_pre > 0) {
struct mob_data* (*preHookFunc) (int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getmob_boss_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getmob_boss_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_getmob_boss_pre[hIndex].func;
retVal___ = preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40727,11 +41468,11 @@ struct mob_data* HP_map_getmob_boss(int16 m) {
{
retVal___ = HPMHooks.source.map.getmob_boss(m);
}
- if( HPMHooks.count.HP_map_getmob_boss_post ) {
- struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getmob_boss_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_getmob_boss_post > 0) {
+ struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getmob_boss_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_getmob_boss_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m);
+ retVal___ = postHookFunc(retVal___, m);
}
}
return retVal___;
@@ -40739,14 +41480,14 @@ struct mob_data* HP_map_getmob_boss(int16 m) {
struct mob_data* HP_map_id2boss(int id) {
int hIndex = 0;
struct mob_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_id2boss_pre ) {
+ if (HPMHooks.count.HP_map_id2boss_pre > 0) {
struct mob_data* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2boss_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2boss_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_id2boss_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40754,11 +41495,11 @@ struct mob_data* HP_map_id2boss(int id) {
{
retVal___ = HPMHooks.source.map.id2boss(id);
}
- if( HPMHooks.count.HP_map_id2boss_post ) {
- struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_id2boss_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_id2boss_post > 0) {
+ struct mob_data* (*postHookFunc) (struct mob_data* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_id2boss_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_id2boss_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -40766,14 +41507,14 @@ struct mob_data* HP_map_id2boss(int id) {
uint32 HP_map_race_id2mask(int race) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_map_race_id2mask_pre ) {
+ if (HPMHooks.count.HP_map_race_id2mask_pre > 0) {
uint32 (*preHookFunc) (int *race);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_race_id2mask_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_race_id2mask_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_race_id2mask_pre[hIndex].func;
retVal___ = preHookFunc(&race);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40781,25 +41522,25 @@ uint32 HP_map_race_id2mask(int race) {
{
retVal___ = HPMHooks.source.map.race_id2mask(race);
}
- if( HPMHooks.count.HP_map_race_id2mask_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, int *race);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_race_id2mask_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_race_id2mask_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, int race);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_race_id2mask_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_race_id2mask_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &race);
+ retVal___ = postHookFunc(retVal___, race);
}
}
return retVal___;
}
void HP_map_reloadnpc(bool clear) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_reloadnpc_pre ) {
+ if (HPMHooks.count.HP_map_reloadnpc_pre > 0) {
void (*preHookFunc) (bool *clear);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_reloadnpc_pre[hIndex].func;
preHookFunc(&clear);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -40807,11 +41548,11 @@ void HP_map_reloadnpc(bool clear) {
{
HPMHooks.source.map.reloadnpc(clear);
}
- if( HPMHooks.count.HP_map_reloadnpc_post ) {
- void (*postHookFunc) (bool *clear);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_reloadnpc_post > 0) {
+ void (*postHookFunc) (bool clear);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_reloadnpc_post[hIndex].func;
- postHookFunc(&clear);
+ postHookFunc(clear);
}
}
return;
@@ -40819,14 +41560,14 @@ void HP_map_reloadnpc(bool clear) {
int HP_map_check_dir(int s_dir, int t_dir) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_check_dir_pre ) {
+ if (HPMHooks.count.HP_map_check_dir_pre > 0) {
int (*preHookFunc) (int *s_dir, int *t_dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_check_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_check_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_check_dir_pre[hIndex].func;
retVal___ = preHookFunc(&s_dir, &t_dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40834,11 +41575,11 @@ int HP_map_check_dir(int s_dir, int t_dir) {
{
retVal___ = HPMHooks.source.map.check_dir(s_dir, t_dir);
}
- if( HPMHooks.count.HP_map_check_dir_post ) {
- int (*postHookFunc) (int retVal___, int *s_dir, int *t_dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_check_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_check_dir_post > 0) {
+ int (*postHookFunc) (int retVal___, int s_dir, int t_dir);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_check_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_check_dir_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &s_dir, &t_dir);
+ retVal___ = postHookFunc(retVal___, s_dir, t_dir);
}
}
return retVal___;
@@ -40846,14 +41587,14 @@ int HP_map_check_dir(int s_dir, int t_dir) {
uint8 HP_map_calc_dir(struct block_list *src, int16 x, int16 y) {
int hIndex = 0;
uint8 retVal___ = 0;
- if( HPMHooks.count.HP_map_calc_dir_pre ) {
- uint8 (*preHookFunc) (struct block_list *src, int16 *x, int16 *y);
+ if (HPMHooks.count.HP_map_calc_dir_pre > 0) {
+ uint8 (*preHookFunc) (struct block_list **src, int16 *x, int16 *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_calc_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_calc_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_calc_dir_pre[hIndex].func;
- retVal___ = preHookFunc(src, &x, &y);
+ retVal___ = preHookFunc(&src, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40861,11 +41602,11 @@ uint8 HP_map_calc_dir(struct block_list *src, int16 x, int16 y) {
{
retVal___ = HPMHooks.source.map.calc_dir(src, x, y);
}
- if( HPMHooks.count.HP_map_calc_dir_post ) {
- uint8 (*postHookFunc) (uint8 retVal___, struct block_list *src, int16 *x, int16 *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_calc_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_calc_dir_post > 0) {
+ uint8 (*postHookFunc) (uint8 retVal___, struct block_list *src, int16 x, int16 y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_calc_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_calc_dir_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &x, &y);
+ retVal___ = postHookFunc(retVal___, src, x, y);
}
}
return retVal___;
@@ -40873,14 +41614,14 @@ uint8 HP_map_calc_dir(struct block_list *src, int16 x, int16 y) {
int HP_map_random_dir(struct block_list *bl, short *x, short *y) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_random_dir_pre ) {
- int (*preHookFunc) (struct block_list *bl, short *x, short *y);
+ if (HPMHooks.count.HP_map_random_dir_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, short **x, short **y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_random_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_random_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_random_dir_pre[hIndex].func;
- retVal___ = preHookFunc(bl, x, y);
+ retVal___ = preHookFunc(&bl, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40888,9 +41629,9 @@ int HP_map_random_dir(struct block_list *bl, short *x, short *y) {
{
retVal___ = HPMHooks.source.map.random_dir(bl, x, y);
}
- if( HPMHooks.count.HP_map_random_dir_post ) {
+ if (HPMHooks.count.HP_map_random_dir_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_random_dir_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_random_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_random_dir_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, x, y);
}
@@ -40900,16 +41641,16 @@ int HP_map_random_dir(struct block_list *bl, short *x, short *y) {
int HP_map_cleanup_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_cleanup_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_map_cleanup_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_cleanup_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40919,9 +41660,9 @@ int HP_map_cleanup_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.map.cleanup_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_cleanup_sub_post ) {
+ if (HPMHooks.count.HP_map_cleanup_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_cleanup_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -40930,17 +41671,17 @@ int HP_map_cleanup_sub(struct block_list *bl, va_list ap) {
}
return retVal___;
}
-int HP_map_delmap(char *mapname) {
+int HP_map_delmap(const char *mapname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_delmap_pre ) {
- int (*preHookFunc) (char *mapname);
+ if (HPMHooks.count.HP_map_delmap_pre > 0) {
+ int (*preHookFunc) (const char **mapname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delmap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_delmap_pre[hIndex].func;
- retVal___ = preHookFunc(mapname);
+ retVal___ = preHookFunc(&mapname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -40948,9 +41689,9 @@ int HP_map_delmap(char *mapname) {
{
retVal___ = HPMHooks.source.map.delmap(mapname);
}
- if( HPMHooks.count.HP_map_delmap_post ) {
- int (*postHookFunc) (int retVal___, char *mapname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delmap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_delmap_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *mapname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delmap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_delmap_post[hIndex].func;
retVal___ = postHookFunc(retVal___, mapname);
}
@@ -40959,14 +41700,14 @@ int HP_map_delmap(char *mapname) {
}
void HP_map_flags_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_flags_init_pre ) {
+ if (HPMHooks.count.HP_map_flags_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_flags_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_flags_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_flags_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -40974,9 +41715,9 @@ void HP_map_flags_init(void) {
{
HPMHooks.source.map.flags_init();
}
- if( HPMHooks.count.HP_map_flags_init_post ) {
+ if (HPMHooks.count.HP_map_flags_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_flags_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_flags_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_flags_init_post[hIndex].func;
postHookFunc();
}
@@ -40986,14 +41727,14 @@ void HP_map_flags_init(void) {
bool HP_map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char *wall_name) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_map_iwall_set_pre ) {
- bool (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *size, int8 *dir, bool *shootable, const char *wall_name);
+ if (HPMHooks.count.HP_map_iwall_set_pre > 0) {
+ bool (*preHookFunc) (int16 *m, int16 *x, int16 *y, int *size, int8 *dir, bool *shootable, const char **wall_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_set_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_set_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_iwall_set_pre[hIndex].func;
- retVal___ = preHookFunc(&m, &x, &y, &size, &dir, &shootable, wall_name);
+ retVal___ = preHookFunc(&m, &x, &y, &size, &dir, &shootable, &wall_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41001,25 +41742,25 @@ bool HP_map_iwall_set(int16 m, int16 x, int16 y, int size, int8 dir, bool shoota
{
retVal___ = HPMHooks.source.map.iwall_set(m, x, y, size, dir, shootable, wall_name);
}
- if( HPMHooks.count.HP_map_iwall_set_post ) {
- bool (*postHookFunc) (bool retVal___, int16 *m, int16 *x, int16 *y, int *size, int8 *dir, bool *shootable, const char *wall_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_set_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_iwall_set_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char *wall_name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_set_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_iwall_set_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, &x, &y, &size, &dir, &shootable, wall_name);
+ retVal___ = postHookFunc(retVal___, m, x, y, size, dir, shootable, wall_name);
}
}
return retVal___;
}
void HP_map_iwall_get(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_iwall_get_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_map_iwall_get_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_get_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_get_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_iwall_get_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41027,9 +41768,9 @@ void HP_map_iwall_get(struct map_session_data *sd) {
{
HPMHooks.source.map.iwall_get(sd);
}
- if( HPMHooks.count.HP_map_iwall_get_post ) {
+ if (HPMHooks.count.HP_map_iwall_get_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_get_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_get_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_iwall_get_post[hIndex].func;
postHookFunc(sd);
}
@@ -41038,14 +41779,14 @@ void HP_map_iwall_get(struct map_session_data *sd) {
}
void HP_map_iwall_remove(const char *wall_name) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_iwall_remove_pre ) {
- void (*preHookFunc) (const char *wall_name);
+ if (HPMHooks.count.HP_map_iwall_remove_pre > 0) {
+ void (*preHookFunc) (const char **wall_name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_iwall_remove_pre[hIndex].func;
- preHookFunc(wall_name);
+ preHookFunc(&wall_name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41053,9 +41794,9 @@ void HP_map_iwall_remove(const char *wall_name) {
{
HPMHooks.source.map.iwall_remove(wall_name);
}
- if( HPMHooks.count.HP_map_iwall_remove_post ) {
+ if (HPMHooks.count.HP_map_iwall_remove_post > 0) {
void (*postHookFunc) (const char *wall_name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_iwall_remove_post[hIndex].func;
postHookFunc(wall_name);
}
@@ -41065,14 +41806,14 @@ void HP_map_iwall_remove(const char *wall_name) {
int HP_map_addmobtolist(unsigned short m, struct spawn_data *spawn) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_addmobtolist_pre ) {
- int (*preHookFunc) (unsigned short *m, struct spawn_data *spawn);
+ if (HPMHooks.count.HP_map_addmobtolist_pre > 0) {
+ int (*preHookFunc) (unsigned short *m, struct spawn_data **spawn);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addmobtolist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addmobtolist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addmobtolist_pre[hIndex].func;
- retVal___ = preHookFunc(&m, spawn);
+ retVal___ = preHookFunc(&m, &spawn);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41080,25 +41821,25 @@ int HP_map_addmobtolist(unsigned short m, struct spawn_data *spawn) {
{
retVal___ = HPMHooks.source.map.addmobtolist(m, spawn);
}
- if( HPMHooks.count.HP_map_addmobtolist_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *m, struct spawn_data *spawn);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addmobtolist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_addmobtolist_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short m, struct spawn_data *spawn);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addmobtolist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addmobtolist_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, spawn);
+ retVal___ = postHookFunc(retVal___, m, spawn);
}
}
return retVal___;
}
void HP_map_spawnmobs(int16 m) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_spawnmobs_pre ) {
+ if (HPMHooks.count.HP_map_spawnmobs_pre > 0) {
void (*preHookFunc) (int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_spawnmobs_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_spawnmobs_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_spawnmobs_pre[hIndex].func;
preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41106,25 +41847,25 @@ void HP_map_spawnmobs(int16 m) {
{
HPMHooks.source.map.spawnmobs(m);
}
- if( HPMHooks.count.HP_map_spawnmobs_post ) {
- void (*postHookFunc) (int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_spawnmobs_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_spawnmobs_post > 0) {
+ void (*postHookFunc) (int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_spawnmobs_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_spawnmobs_post[hIndex].func;
- postHookFunc(&m);
+ postHookFunc(m);
}
}
return;
}
void HP_map_removemobs(int16 m) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_removemobs_pre ) {
+ if (HPMHooks.count.HP_map_removemobs_pre > 0) {
void (*preHookFunc) (int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_removemobs_pre[hIndex].func;
preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41132,25 +41873,25 @@ void HP_map_removemobs(int16 m) {
{
HPMHooks.source.map.removemobs(m);
}
- if( HPMHooks.count.HP_map_removemobs_post ) {
- void (*postHookFunc) (int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_removemobs_post > 0) {
+ void (*postHookFunc) (int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_removemobs_post[hIndex].func;
- postHookFunc(&m);
+ postHookFunc(m);
}
}
return;
}
void HP_map_addmap2db(struct map_data *m) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_addmap2db_pre ) {
- void (*preHookFunc) (struct map_data *m);
+ if (HPMHooks.count.HP_map_addmap2db_pre > 0) {
+ void (*preHookFunc) (struct map_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap2db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap2db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addmap2db_pre[hIndex].func;
- preHookFunc(m);
+ preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41158,9 +41899,9 @@ void HP_map_addmap2db(struct map_data *m) {
{
HPMHooks.source.map.addmap2db(m);
}
- if( HPMHooks.count.HP_map_addmap2db_post ) {
+ if (HPMHooks.count.HP_map_addmap2db_post > 0) {
void (*postHookFunc) (struct map_data *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap2db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap2db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addmap2db_post[hIndex].func;
postHookFunc(m);
}
@@ -41169,14 +41910,14 @@ void HP_map_addmap2db(struct map_data *m) {
}
void HP_map_removemapdb(struct map_data *m) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_removemapdb_pre ) {
- void (*preHookFunc) (struct map_data *m);
+ if (HPMHooks.count.HP_map_removemapdb_pre > 0) {
+ void (*preHookFunc) (struct map_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemapdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemapdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_removemapdb_pre[hIndex].func;
- preHookFunc(m);
+ preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41184,9 +41925,9 @@ void HP_map_removemapdb(struct map_data *m) {
{
HPMHooks.source.map.removemapdb(m);
}
- if( HPMHooks.count.HP_map_removemapdb_post ) {
+ if (HPMHooks.count.HP_map_removemapdb_post > 0) {
void (*postHookFunc) (struct map_data *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemapdb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemapdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_removemapdb_post[hIndex].func;
postHookFunc(m);
}
@@ -41195,14 +41936,14 @@ void HP_map_removemapdb(struct map_data *m) {
}
void HP_map_clean(int i) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_clean_pre ) {
+ if (HPMHooks.count.HP_map_clean_pre > 0) {
void (*preHookFunc) (int *i);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_clean_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_clean_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_clean_pre[hIndex].func;
preHookFunc(&i);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41210,25 +41951,25 @@ void HP_map_clean(int i) {
{
HPMHooks.source.map.clean(i);
}
- if( HPMHooks.count.HP_map_clean_post ) {
- void (*postHookFunc) (int *i);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_clean_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_clean_post > 0) {
+ void (*postHookFunc) (int i);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_clean_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_clean_post[hIndex].func;
- postHookFunc(&i);
+ postHookFunc(i);
}
}
return;
}
void HP_map_do_shutdown(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_do_shutdown_pre ) {
+ if (HPMHooks.count.HP_map_do_shutdown_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_do_shutdown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_do_shutdown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_do_shutdown_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41236,9 +41977,9 @@ void HP_map_do_shutdown(void) {
{
HPMHooks.source.map.do_shutdown();
}
- if( HPMHooks.count.HP_map_do_shutdown_post ) {
+ if (HPMHooks.count.HP_map_do_shutdown_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_do_shutdown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_do_shutdown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_do_shutdown_post[hIndex].func;
postHookFunc();
}
@@ -41248,14 +41989,14 @@ void HP_map_do_shutdown(void) {
int HP_map_freeblock_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_freeblock_timer_pre ) {
+ if (HPMHooks.count.HP_map_freeblock_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_freeblock_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41263,11 +42004,11 @@ int HP_map_freeblock_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.map.freeblock_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_map_freeblock_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_freeblock_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_freeblock_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_freeblock_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -41275,14 +42016,14 @@ int HP_map_freeblock_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_searchrandfreecell_pre ) {
- int (*preHookFunc) (int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *stack);
+ if (HPMHooks.count.HP_map_searchrandfreecell_pre > 0) {
+ int (*preHookFunc) (int16 *m, const struct block_list **bl, int16 **x, int16 **y, int *stack);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_searchrandfreecell_pre[hIndex].func;
- retVal___ = preHookFunc(&m, bl, x, y, &stack);
+ retVal___ = preHookFunc(&m, &bl, &x, &y, &stack);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41290,11 +42031,11 @@ int HP_map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, in
{
retVal___ = HPMHooks.source.map.searchrandfreecell(m, bl, x, y, stack);
}
- if( HPMHooks.count.HP_map_searchrandfreecell_post ) {
- int (*postHookFunc) (int retVal___, int16 *m, const struct block_list *bl, int16 *x, int16 *y, int *stack);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_searchrandfreecell_post > 0) {
+ int (*postHookFunc) (int retVal___, int16 m, const struct block_list *bl, int16 *x, int16 *y, int stack);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_searchrandfreecell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_searchrandfreecell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, bl, x, y, &stack);
+ retVal___ = postHookFunc(retVal___, m, bl, x, y, stack);
}
}
return retVal___;
@@ -41302,16 +42043,16 @@ int HP_map_searchrandfreecell(int16 m, const struct block_list *bl, int16 *x, in
int HP_map_count_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_count_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_map_count_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_count_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_count_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_count_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41321,9 +42062,9 @@ int HP_map_count_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.map.count_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_count_sub_post ) {
+ if (HPMHooks.count.HP_map_count_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_count_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_count_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_count_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -41332,20 +42073,19 @@ int HP_map_count_sub(struct block_list *bl, va_list ap) {
}
return retVal___;
}
-DBData HP_map_create_charid2nick(DBKey key, va_list args) {
+struct DBData HP_map_create_charid2nick(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_map_create_charid2nick_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_map_create_charid2nick_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_create_charid2nick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_create_charid2nick_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_create_charid2nick_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41355,12 +42095,12 @@ DBData HP_map_create_charid2nick(DBKey key, va_list args) {
retVal___ = HPMHooks.source.map.create_charid2nick(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_create_charid2nick_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_create_charid2nick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_create_charid2nick_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_create_charid2nick_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_create_charid2nick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
@@ -41369,16 +42109,16 @@ DBData HP_map_create_charid2nick(DBKey key, va_list args) {
int HP_map_removemobs_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_removemobs_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_map_removemobs_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_removemobs_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41388,9 +42128,9 @@ int HP_map_removemobs_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.map.removemobs_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_removemobs_sub_post ) {
+ if (HPMHooks.count.HP_map_removemobs_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_removemobs_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_removemobs_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -41401,16 +42141,15 @@ int HP_map_removemobs_sub(struct block_list *bl, va_list ap) {
}
struct mapcell HP_map_gat2cell(int gat) {
int hIndex = 0;
- struct mapcell retVal___;
- memset(&retVal___, '\0', sizeof(struct mapcell));
- if( HPMHooks.count.HP_map_gat2cell_pre ) {
+ struct mapcell retVal___ = { 0 };
+ if (HPMHooks.count.HP_map_gat2cell_pre > 0) {
struct mapcell (*preHookFunc) (int *gat);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_gat2cell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_gat2cell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_gat2cell_pre[hIndex].func;
retVal___ = preHookFunc(&gat);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41418,11 +42157,11 @@ struct mapcell HP_map_gat2cell(int gat) {
{
retVal___ = HPMHooks.source.map.gat2cell(gat);
}
- if( HPMHooks.count.HP_map_gat2cell_post ) {
- struct mapcell (*postHookFunc) (struct mapcell retVal___, int *gat);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_gat2cell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_gat2cell_post > 0) {
+ struct mapcell (*postHookFunc) (struct mapcell retVal___, int gat);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_gat2cell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_gat2cell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &gat);
+ retVal___ = postHookFunc(retVal___, gat);
}
}
return retVal___;
@@ -41430,14 +42169,14 @@ struct mapcell HP_map_gat2cell(int gat) {
int HP_map_cell2gat(struct mapcell cell) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_cell2gat_pre ) {
+ if (HPMHooks.count.HP_map_cell2gat_pre > 0) {
int (*preHookFunc) (struct mapcell *cell);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cell2gat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cell2gat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_cell2gat_pre[hIndex].func;
retVal___ = preHookFunc(&cell);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41445,11 +42184,11 @@ int HP_map_cell2gat(struct mapcell cell) {
{
retVal___ = HPMHooks.source.map.cell2gat(cell);
}
- if( HPMHooks.count.HP_map_cell2gat_post ) {
- int (*postHookFunc) (int retVal___, struct mapcell *cell);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cell2gat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_cell2gat_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mapcell cell);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cell2gat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_cell2gat_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &cell);
+ retVal___ = postHookFunc(retVal___, cell);
}
}
return retVal___;
@@ -41457,14 +42196,14 @@ int HP_map_cell2gat(struct mapcell cell) {
int HP_map_getcellp(struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_getcellp_pre ) {
- int (*preHookFunc) (struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
+ if (HPMHooks.count.HP_map_getcellp_pre > 0) {
+ int (*preHookFunc) (struct map_data **m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_getcellp_pre[hIndex].func;
- retVal___ = preHookFunc(m, bl, &x, &y, &cellchk);
+ retVal___ = preHookFunc(&m, &bl, &x, &y, &cellchk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41472,25 +42211,25 @@ int HP_map_getcellp(struct map_data *m, const struct block_list *bl, int16 x, in
{
retVal___ = HPMHooks.source.map.getcellp(m, bl, x, y, cellchk);
}
- if( HPMHooks.count.HP_map_getcellp_post ) {
- int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_getcellp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_getcellp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_getcellp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, m, bl, &x, &y, &cellchk);
+ retVal___ = postHookFunc(retVal___, m, bl, x, y, cellchk);
}
}
return retVal___;
}
void HP_map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_setcell_pre ) {
+ if (HPMHooks.count.HP_map_setcell_pre > 0) {
void (*preHookFunc) (int16 *m, int16 *x, int16 *y, cell_t *cell, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setcell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setcell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_setcell_pre[hIndex].func;
preHookFunc(&m, &x, &y, &cell, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41498,11 +42237,11 @@ void HP_map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
{
HPMHooks.source.map.setcell(m, x, y, cell, flag);
}
- if( HPMHooks.count.HP_map_setcell_post ) {
- void (*postHookFunc) (int16 *m, int16 *x, int16 *y, cell_t *cell, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_setcell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_setcell_post > 0) {
+ void (*postHookFunc) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_setcell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_setcell_post[hIndex].func;
- postHookFunc(&m, &x, &y, &cell, &flag);
+ postHookFunc(m, x, y, cell, flag);
}
}
return;
@@ -41510,14 +42249,14 @@ void HP_map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
int HP_map_sub_getcellp(struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_sub_getcellp_pre ) {
- int (*preHookFunc) (struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
+ if (HPMHooks.count.HP_map_sub_getcellp_pre > 0) {
+ int (*preHookFunc) (struct map_data **m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_sub_getcellp_pre[hIndex].func;
- retVal___ = preHookFunc(m, bl, &x, &y, &cellchk);
+ retVal___ = preHookFunc(&m, &bl, &x, &y, &cellchk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41525,25 +42264,25 @@ int HP_map_sub_getcellp(struct map_data *m, const struct block_list *bl, int16 x
{
retVal___ = HPMHooks.source.map.sub_getcellp(m, bl, x, y, cellchk);
}
- if( HPMHooks.count.HP_map_sub_getcellp_post ) {
- int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 *x, int16 *y, cell_chk *cellchk);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_sub_getcellp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_data *m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_getcellp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_sub_getcellp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, m, bl, &x, &y, &cellchk);
+ retVal___ = postHookFunc(retVal___, m, bl, x, y, cellchk);
}
}
return retVal___;
}
void HP_map_sub_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_sub_setcell_pre ) {
+ if (HPMHooks.count.HP_map_sub_setcell_pre > 0) {
void (*preHookFunc) (int16 *m, int16 *x, int16 *y, cell_t *cell, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_setcell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_setcell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_sub_setcell_pre[hIndex].func;
preHookFunc(&m, &x, &y, &cell, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41551,25 +42290,25 @@ void HP_map_sub_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) {
{
HPMHooks.source.map.sub_setcell(m, x, y, cell, flag);
}
- if( HPMHooks.count.HP_map_sub_setcell_post ) {
- void (*postHookFunc) (int16 *m, int16 *x, int16 *y, cell_t *cell, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_setcell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_sub_setcell_post > 0) {
+ void (*postHookFunc) (int16 m, int16 x, int16 y, cell_t cell, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sub_setcell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_sub_setcell_post[hIndex].func;
- postHookFunc(&m, &x, &y, &cell, &flag);
+ postHookFunc(m, x, y, cell, flag);
}
}
return;
}
void HP_map_iwall_nextxy(int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_iwall_nextxy_pre ) {
- void (*preHookFunc) (int16 *x, int16 *y, int8 *dir, int *pos, int16 *x1, int16 *y1);
+ if (HPMHooks.count.HP_map_iwall_nextxy_pre > 0) {
+ void (*preHookFunc) (int16 *x, int16 *y, int8 *dir, int *pos, int16 **x1, int16 **y1);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_nextxy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_nextxy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_iwall_nextxy_pre[hIndex].func;
- preHookFunc(&x, &y, &dir, &pos, x1, y1);
+ preHookFunc(&x, &y, &dir, &pos, &x1, &y1);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41577,29 +42316,28 @@ void HP_map_iwall_nextxy(int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *
{
HPMHooks.source.map.iwall_nextxy(x, y, dir, pos, x1, y1);
}
- if( HPMHooks.count.HP_map_iwall_nextxy_post ) {
- void (*postHookFunc) (int16 *x, int16 *y, int8 *dir, int *pos, int16 *x1, int16 *y1);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_nextxy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_iwall_nextxy_post > 0) {
+ void (*postHookFunc) (int16 x, int16 y, int8 dir, int pos, int16 *x1, int16 *y1);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_iwall_nextxy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_iwall_nextxy_post[hIndex].func;
- postHookFunc(&x, &y, &dir, &pos, x1, y1);
+ postHookFunc(x, y, dir, pos, x1, y1);
}
}
return;
}
-DBData HP_map_create_map_data_other_server(DBKey key, va_list args) {
+struct DBData HP_map_create_map_data_other_server(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_map_create_map_data_other_server_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_map_create_map_data_other_server_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_create_map_data_other_server_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_create_map_data_other_server_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_create_map_data_other_server_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41609,30 +42347,30 @@ DBData HP_map_create_map_data_other_server(DBKey key, va_list args) {
retVal___ = HPMHooks.source.map.create_map_data_other_server(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_create_map_data_other_server_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_create_map_data_other_server_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_create_map_data_other_server_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_create_map_data_other_server_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_create_map_data_other_server_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
return retVal___;
}
-int HP_map_eraseallipport_sub(DBKey key, DBData *data, va_list va) {
+int HP_map_eraseallipport_sub(union DBKey key, struct DBData *data, va_list va) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_eraseallipport_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list va);
+ if (HPMHooks.count.HP_map_eraseallipport_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list va);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_sub_pre; hIndex++) {
va_list va___copy; va_copy(va___copy, va);
preHookFunc = HPMHooks.list.HP_map_eraseallipport_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, va___copy);
+ retVal___ = preHookFunc(&key, &data, va___copy);
va_end(va___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41642,12 +42380,12 @@ int HP_map_eraseallipport_sub(DBKey key, DBData *data, va_list va) {
retVal___ = HPMHooks.source.map.eraseallipport_sub(key, data, va___copy);
va_end(va___copy);
}
- if( HPMHooks.count.HP_map_eraseallipport_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list va);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_eraseallipport_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list va);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_eraseallipport_sub_post; hIndex++) {
va_list va___copy; va_copy(va___copy, va);
postHookFunc = HPMHooks.list.HP_map_eraseallipport_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, va___copy);
+ retVal___ = postHookFunc(retVal___, key, data, va___copy);
va_end(va___copy);
}
}
@@ -41656,14 +42394,14 @@ int HP_map_eraseallipport_sub(DBKey key, DBData *data, va_list va) {
char* HP_map_init_mapcache(FILE *fp) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_map_init_mapcache_pre ) {
- char* (*preHookFunc) (FILE *fp);
+ if (HPMHooks.count.HP_map_init_mapcache_pre > 0) {
+ char* (*preHookFunc) (FILE **fp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_init_mapcache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_init_mapcache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_init_mapcache_pre[hIndex].func;
- retVal___ = preHookFunc(fp);
+ retVal___ = preHookFunc(&fp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41671,9 +42409,9 @@ char* HP_map_init_mapcache(FILE *fp) {
{
retVal___ = HPMHooks.source.map.init_mapcache(fp);
}
- if( HPMHooks.count.HP_map_init_mapcache_post ) {
+ if (HPMHooks.count.HP_map_init_mapcache_post > 0) {
char* (*postHookFunc) (char* retVal___, FILE *fp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_init_mapcache_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_init_mapcache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_init_mapcache_post[hIndex].func;
retVal___ = postHookFunc(retVal___, fp);
}
@@ -41683,14 +42421,14 @@ char* HP_map_init_mapcache(FILE *fp) {
int HP_map_readfromcache(struct map_data *m, char *buffer) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_readfromcache_pre ) {
- int (*preHookFunc) (struct map_data *m, char *buffer);
+ if (HPMHooks.count.HP_map_readfromcache_pre > 0) {
+ int (*preHookFunc) (struct map_data **m, char **buffer);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_readfromcache_pre[hIndex].func;
- retVal___ = preHookFunc(m, buffer);
+ retVal___ = preHookFunc(&m, &buffer);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41698,9 +42436,9 @@ int HP_map_readfromcache(struct map_data *m, char *buffer) {
{
retVal___ = HPMHooks.source.map.readfromcache(m, buffer);
}
- if( HPMHooks.count.HP_map_readfromcache_post ) {
+ if (HPMHooks.count.HP_map_readfromcache_post > 0) {
int (*postHookFunc) (int retVal___, struct map_data *m, char *buffer);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readfromcache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_readfromcache_post[hIndex].func;
retVal___ = postHookFunc(retVal___, m, buffer);
}
@@ -41710,14 +42448,14 @@ int HP_map_readfromcache(struct map_data *m, char *buffer) {
int HP_map_addmap(const char *mapname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_addmap_pre ) {
- int (*preHookFunc) (const char *mapname);
+ if (HPMHooks.count.HP_map_addmap_pre > 0) {
+ int (*preHookFunc) (const char **mapname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_addmap_pre[hIndex].func;
- retVal___ = preHookFunc(mapname);
+ retVal___ = preHookFunc(&mapname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41725,9 +42463,9 @@ int HP_map_addmap(const char *mapname) {
{
retVal___ = HPMHooks.source.map.addmap(mapname);
}
- if( HPMHooks.count.HP_map_addmap_post ) {
+ if (HPMHooks.count.HP_map_addmap_post > 0) {
int (*postHookFunc) (int retVal___, const char *mapname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_addmap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_addmap_post[hIndex].func;
retVal___ = postHookFunc(retVal___, mapname);
}
@@ -41736,14 +42474,14 @@ int HP_map_addmap(const char *mapname) {
}
void HP_map_delmapid(int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_delmapid_pre ) {
+ if (HPMHooks.count.HP_map_delmapid_pre > 0) {
void (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delmapid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delmapid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_delmapid_pre[hIndex].func;
preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41751,25 +42489,25 @@ void HP_map_delmapid(int id) {
{
HPMHooks.source.map.delmapid(id);
}
- if( HPMHooks.count.HP_map_delmapid_post ) {
- void (*postHookFunc) (int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delmapid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_delmapid_post > 0) {
+ void (*postHookFunc) (int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_delmapid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_delmapid_post[hIndex].func;
- postHookFunc(&id);
+ postHookFunc(id);
}
}
return;
}
void HP_map_zone_db_clear(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_db_clear_pre ) {
+ if (HPMHooks.count.HP_map_zone_db_clear_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_db_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_db_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_db_clear_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41777,9 +42515,9 @@ void HP_map_zone_db_clear(void) {
{
HPMHooks.source.map.zone_db_clear();
}
- if( HPMHooks.count.HP_map_zone_db_clear_post ) {
+ if (HPMHooks.count.HP_map_zone_db_clear_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_db_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_db_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_db_clear_post[hIndex].func;
postHookFunc();
}
@@ -41788,14 +42526,14 @@ void HP_map_zone_db_clear(void) {
}
void HP_map_list_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_list_final_pre ) {
+ if (HPMHooks.count.HP_map_list_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_list_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_list_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_list_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -41803,9 +42541,9 @@ void HP_map_list_final(void) {
{
HPMHooks.source.map.list_final();
}
- if( HPMHooks.count.HP_map_list_final_post ) {
+ if (HPMHooks.count.HP_map_list_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_list_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_list_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_list_final_post[hIndex].func;
postHookFunc();
}
@@ -41815,14 +42553,14 @@ void HP_map_list_final(void) {
int HP_map_waterheight(char *mapname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_waterheight_pre ) {
- int (*preHookFunc) (char *mapname);
+ if (HPMHooks.count.HP_map_waterheight_pre > 0) {
+ int (*preHookFunc) (char **mapname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_waterheight_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_waterheight_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_waterheight_pre[hIndex].func;
- retVal___ = preHookFunc(mapname);
+ retVal___ = preHookFunc(&mapname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41830,9 +42568,9 @@ int HP_map_waterheight(char *mapname) {
{
retVal___ = HPMHooks.source.map.waterheight(mapname);
}
- if( HPMHooks.count.HP_map_waterheight_post ) {
+ if (HPMHooks.count.HP_map_waterheight_post > 0) {
int (*postHookFunc) (int retVal___, char *mapname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_waterheight_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_waterheight_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_waterheight_post[hIndex].func;
retVal___ = postHookFunc(retVal___, mapname);
}
@@ -41842,14 +42580,14 @@ int HP_map_waterheight(char *mapname) {
int HP_map_readgat(struct map_data *m) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_readgat_pre ) {
- int (*preHookFunc) (struct map_data *m);
+ if (HPMHooks.count.HP_map_readgat_pre > 0) {
+ int (*preHookFunc) (struct map_data **m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_readgat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readgat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_readgat_pre[hIndex].func;
- retVal___ = preHookFunc(m);
+ retVal___ = preHookFunc(&m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41857,9 +42595,9 @@ int HP_map_readgat(struct map_data *m) {
{
retVal___ = HPMHooks.source.map.readgat(m);
}
- if( HPMHooks.count.HP_map_readgat_post ) {
+ if (HPMHooks.count.HP_map_readgat_post > 0) {
int (*postHookFunc) (int retVal___, struct map_data *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_readgat_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readgat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_readgat_post[hIndex].func;
retVal___ = postHookFunc(retVal___, m);
}
@@ -41869,14 +42607,14 @@ int HP_map_readgat(struct map_data *m) {
int HP_map_readallmaps(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_readallmaps_pre ) {
+ if (HPMHooks.count.HP_map_readallmaps_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_readallmaps_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readallmaps_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_readallmaps_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -41884,118 +42622,146 @@ int HP_map_readallmaps(void) {
{
retVal___ = HPMHooks.source.map.readallmaps();
}
- if( HPMHooks.count.HP_map_readallmaps_post ) {
+ if (HPMHooks.count.HP_map_readallmaps_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_readallmaps_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_readallmaps_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_readallmaps_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-int HP_map_config_read(char *cfgName) {
+bool HP_map_config_read(const char *filename, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_map_config_read_pre ) {
- int (*preHookFunc) (char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_map_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.map.config_read(cfgName);
+ retVal___ = HPMHooks.source.map.config_read(filename, imported);
}
- if( HPMHooks.count.HP_map_config_read_post ) {
- int (*postHookFunc) (int retVal___, char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
return retVal___;
}
-int HP_map_config_read_sub(char *cfgName) {
+bool HP_map_read_npclist(const char *filename, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_map_config_read_sub_pre ) {
- int (*preHookFunc) (char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_map_read_npclist_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_sub_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_map_config_read_sub_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_read_npclist_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_map_read_npclist_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.map.config_read_sub(cfgName);
+ retVal___ = HPMHooks.source.map.read_npclist(filename, imported);
}
- if( HPMHooks.count.HP_map_config_read_sub_post ) {
- int (*postHookFunc) (int retVal___, char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_sub_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_map_config_read_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ if (HPMHooks.count.HP_map_read_npclist_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_read_npclist_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_map_read_npclist_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
return retVal___;
}
-void HP_map_reloadnpc_sub(char *cfgName) {
+bool HP_map_inter_config_read(const char *filename, bool imported) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_reloadnpc_sub_pre ) {
- void (*preHookFunc) (char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_map_inter_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_sub_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_map_reloadnpc_sub_pre[hIndex].func;
- preHookFunc(cfgName);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_map_inter_config_read_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.map.reloadnpc_sub(cfgName);
+ retVal___ = HPMHooks.source.map.inter_config_read(filename, imported);
}
- if( HPMHooks.count.HP_map_reloadnpc_sub_post ) {
- void (*postHookFunc) (char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_sub_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_map_reloadnpc_sub_post[hIndex].func;
- postHookFunc(cfgName);
+ if (HPMHooks.count.HP_map_inter_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_map_inter_config_read_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
- return;
+ return retVal___;
}
-int HP_map_inter_config_read(char *cfgName) {
+bool HP_map_inter_config_read_database_names(const char *filename, const struct config_t *config, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_map_inter_config_read_pre ) {
- int (*preHookFunc) (char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_map_inter_config_read_database_names_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_map_inter_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_database_names_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_map_inter_config_read_database_names_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.map.inter_config_read(cfgName);
+ retVal___ = HPMHooks.source.map.inter_config_read_database_names(filename, config, imported);
}
- if( HPMHooks.count.HP_map_inter_config_read_post ) {
- int (*postHookFunc) (int retVal___, char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_map_inter_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ if (HPMHooks.count.HP_map_inter_config_read_database_names_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_database_names_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_map_inter_config_read_database_names_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
+ }
+ }
+ return retVal___;
+}
+bool HP_map_inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_map_inter_config_read_connection_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_connection_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_map_inter_config_read_connection_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename, &config, &imported);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.map.inter_config_read_connection(filename, config, imported);
+ }
+ if (HPMHooks.count.HP_map_inter_config_read_connection_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_connection_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_map_inter_config_read_connection_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
}
}
return retVal___;
@@ -42003,14 +42769,14 @@ int HP_map_inter_config_read(char *cfgName) {
int HP_map_sql_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_sql_init_pre ) {
+ if (HPMHooks.count.HP_map_sql_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_sql_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42018,9 +42784,9 @@ int HP_map_sql_init(void) {
{
retVal___ = HPMHooks.source.map.sql_init();
}
- if( HPMHooks.count.HP_map_sql_init_post ) {
+ if (HPMHooks.count.HP_map_sql_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_sql_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -42030,14 +42796,14 @@ int HP_map_sql_init(void) {
int HP_map_sql_close(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_sql_close_pre ) {
+ if (HPMHooks.count.HP_map_sql_close_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_sql_close_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42045,9 +42811,9 @@ int HP_map_sql_close(void) {
{
retVal___ = HPMHooks.source.map.sql_close();
}
- if( HPMHooks.count.HP_map_sql_close_post ) {
+ if (HPMHooks.count.HP_map_sql_close_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_sql_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_sql_close_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -42057,14 +42823,14 @@ int HP_map_sql_close(void) {
bool HP_map_zone_mf_cache(int m, char *flag, char *params) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_map_zone_mf_cache_pre ) {
- bool (*preHookFunc) (int *m, char *flag, char *params);
+ if (HPMHooks.count.HP_map_zone_mf_cache_pre > 0) {
+ bool (*preHookFunc) (int *m, char **flag, char **params);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_mf_cache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_mf_cache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_mf_cache_pre[hIndex].func;
- retVal___ = preHookFunc(&m, flag, params);
+ retVal___ = preHookFunc(&m, &flag, &params);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42072,11 +42838,11 @@ bool HP_map_zone_mf_cache(int m, char *flag, char *params) {
{
retVal___ = HPMHooks.source.map.zone_mf_cache(m, flag, params);
}
- if( HPMHooks.count.HP_map_zone_mf_cache_post ) {
- bool (*postHookFunc) (bool retVal___, int *m, char *flag, char *params);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_mf_cache_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_zone_mf_cache_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int m, char *flag, char *params);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_mf_cache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_mf_cache_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, flag, params);
+ retVal___ = postHookFunc(retVal___, m, flag, params);
}
}
return retVal___;
@@ -42084,14 +42850,14 @@ bool HP_map_zone_mf_cache(int m, char *flag, char *params) {
unsigned short HP_map_zone_str2itemid(const char *name) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_map_zone_str2itemid_pre ) {
- unsigned short (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_map_zone_str2itemid_pre > 0) {
+ unsigned short (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2itemid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2itemid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_str2itemid_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42099,9 +42865,9 @@ unsigned short HP_map_zone_str2itemid(const char *name) {
{
retVal___ = HPMHooks.source.map.zone_str2itemid(name);
}
- if( HPMHooks.count.HP_map_zone_str2itemid_post ) {
+ if (HPMHooks.count.HP_map_zone_str2itemid_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2itemid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2itemid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_str2itemid_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -42111,14 +42877,14 @@ unsigned short HP_map_zone_str2itemid(const char *name) {
unsigned short HP_map_zone_str2skillid(const char *name) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_map_zone_str2skillid_pre ) {
- unsigned short (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_map_zone_str2skillid_pre > 0) {
+ unsigned short (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2skillid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2skillid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_str2skillid_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42126,9 +42892,9 @@ unsigned short HP_map_zone_str2skillid(const char *name) {
{
retVal___ = HPMHooks.source.map.zone_str2skillid(name);
}
- if( HPMHooks.count.HP_map_zone_str2skillid_post ) {
+ if (HPMHooks.count.HP_map_zone_str2skillid_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2skillid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_str2skillid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_str2skillid_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -42138,14 +42904,14 @@ unsigned short HP_map_zone_str2skillid(const char *name) {
enum bl_type HP_map_zone_bl_type(const char *entry, enum map_zone_skill_subtype *subtype) {
int hIndex = 0;
enum bl_type retVal___ = BL_NUL;
- if( HPMHooks.count.HP_map_zone_bl_type_pre ) {
- enum bl_type (*preHookFunc) (const char *entry, enum map_zone_skill_subtype *subtype);
+ if (HPMHooks.count.HP_map_zone_bl_type_pre > 0) {
+ enum bl_type (*preHookFunc) (const char **entry, enum map_zone_skill_subtype **subtype);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_bl_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_bl_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_bl_type_pre[hIndex].func;
- retVal___ = preHookFunc(entry, subtype);
+ retVal___ = preHookFunc(&entry, &subtype);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42153,9 +42919,9 @@ enum bl_type HP_map_zone_bl_type(const char *entry, enum map_zone_skill_subtype
{
retVal___ = HPMHooks.source.map.zone_bl_type(entry, subtype);
}
- if( HPMHooks.count.HP_map_zone_bl_type_post ) {
+ if (HPMHooks.count.HP_map_zone_bl_type_post > 0) {
enum bl_type (*postHookFunc) (enum bl_type retVal___, const char *entry, enum map_zone_skill_subtype *subtype);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_bl_type_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_bl_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_bl_type_post[hIndex].func;
retVal___ = postHookFunc(retVal___, entry, subtype);
}
@@ -42164,14 +42930,14 @@ enum bl_type HP_map_zone_bl_type(const char *entry, enum map_zone_skill_subtype
}
void HP_map_read_zone_db(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_read_zone_db_pre ) {
+ if (HPMHooks.count.HP_map_read_zone_db_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_read_zone_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_read_zone_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_read_zone_db_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42179,28 +42945,28 @@ void HP_map_read_zone_db(void) {
{
HPMHooks.source.map.read_zone_db();
}
- if( HPMHooks.count.HP_map_read_zone_db_post ) {
+ if (HPMHooks.count.HP_map_read_zone_db_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_read_zone_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_read_zone_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_read_zone_db_post[hIndex].func;
postHookFunc();
}
}
return;
}
-int HP_map_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_map_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_map_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42210,30 +42976,30 @@ int HP_map_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.map.db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_map_nick_db_final(DBKey key, DBData *data, va_list args) {
+int HP_map_nick_db_final(union DBKey key, struct DBData *data, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_nick_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list args);
+ if (HPMHooks.count.HP_map_nick_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_nick_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick_db_final_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_map_nick_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, args___copy);
+ retVal___ = preHookFunc(&key, &data, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42243,30 +43009,30 @@ int HP_map_nick_db_final(DBKey key, DBData *data, va_list args) {
retVal___ = HPMHooks.source.map.nick_db_final(key, data, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_map_nick_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_nick_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_nick_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_nick_db_final_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_map_nick_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, args___copy);
+ retVal___ = postHookFunc(retVal___, key, data, args___copy);
va_end(args___copy);
}
}
return retVal___;
}
-int HP_map_cleanup_db_sub(DBKey key, DBData *data, va_list va) {
+int HP_map_cleanup_db_sub(union DBKey key, struct DBData *data, va_list va) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_cleanup_db_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list va);
+ if (HPMHooks.count.HP_map_cleanup_db_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list va);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_db_sub_pre; hIndex++) {
va_list va___copy; va_copy(va___copy, va);
preHookFunc = HPMHooks.list.HP_map_cleanup_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, va___copy);
+ retVal___ = preHookFunc(&key, &data, va___copy);
va_end(va___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42276,12 +43042,12 @@ int HP_map_cleanup_db_sub(DBKey key, DBData *data, va_list va) {
retVal___ = HPMHooks.source.map.cleanup_db_sub(key, data, va___copy);
va_end(va___copy);
}
- if( HPMHooks.count.HP_map_cleanup_db_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list va);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_cleanup_db_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list va);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_cleanup_db_sub_post; hIndex++) {
va_list va___copy; va_copy(va___copy, va);
postHookFunc = HPMHooks.list.HP_map_cleanup_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, va___copy);
+ retVal___ = postHookFunc(retVal___, key, data, va___copy);
va_end(va___copy);
}
}
@@ -42290,16 +43056,16 @@ int HP_map_cleanup_db_sub(DBKey key, DBData *data, va_list va) {
int HP_map_abort_sub(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_abort_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_map_abort_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_abort_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_abort_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_map_abort_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42309,9 +43075,9 @@ int HP_map_abort_sub(struct map_session_data *sd, va_list ap) {
retVal___ = HPMHooks.source.map.abort_sub(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_map_abort_sub_post ) {
+ if (HPMHooks.count.HP_map_abort_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_abort_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_abort_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_map_abort_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -42322,14 +43088,14 @@ int HP_map_abort_sub(struct map_session_data *sd, va_list ap) {
}
void HP_map_update_cell_bl(struct block_list *bl, bool increase) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_update_cell_bl_pre ) {
- void (*preHookFunc) (struct block_list *bl, bool *increase);
+ if (HPMHooks.count.HP_map_update_cell_bl_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, bool *increase);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_update_cell_bl_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_update_cell_bl_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_update_cell_bl_pre[hIndex].func;
- preHookFunc(bl, &increase);
+ preHookFunc(&bl, &increase);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42337,11 +43103,11 @@ void HP_map_update_cell_bl(struct block_list *bl, bool increase) {
{
HPMHooks.source.map.update_cell_bl(bl, increase);
}
- if( HPMHooks.count.HP_map_update_cell_bl_post ) {
- void (*postHookFunc) (struct block_list *bl, bool *increase);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_update_cell_bl_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_update_cell_bl_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, bool increase);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_update_cell_bl_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_update_cell_bl_post[hIndex].func;
- postHookFunc(bl, &increase);
+ postHookFunc(bl, increase);
}
}
return;
@@ -42349,14 +43115,14 @@ void HP_map_update_cell_bl(struct block_list *bl, bool increase) {
int HP_map_get_new_bonus_id(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_map_get_new_bonus_id_pre ) {
+ if (HPMHooks.count.HP_map_get_new_bonus_id_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_bonus_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_bonus_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_get_new_bonus_id_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42364,9 +43130,9 @@ int HP_map_get_new_bonus_id(void) {
{
retVal___ = HPMHooks.source.map.get_new_bonus_id();
}
- if( HPMHooks.count.HP_map_get_new_bonus_id_post ) {
+ if (HPMHooks.count.HP_map_get_new_bonus_id_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_bonus_id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_bonus_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_get_new_bonus_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -42375,14 +43141,14 @@ int HP_map_get_new_bonus_id(void) {
}
void HP_map_add_questinfo(int m, struct questinfo *qi) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_add_questinfo_pre ) {
- void (*preHookFunc) (int *m, struct questinfo *qi);
+ if (HPMHooks.count.HP_map_add_questinfo_pre > 0) {
+ void (*preHookFunc) (int *m, struct questinfo **qi);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_add_questinfo_pre[hIndex].func;
- preHookFunc(&m, qi);
+ preHookFunc(&m, &qi);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42390,11 +43156,11 @@ void HP_map_add_questinfo(int m, struct questinfo *qi) {
{
HPMHooks.source.map.add_questinfo(m, qi);
}
- if( HPMHooks.count.HP_map_add_questinfo_post ) {
- void (*postHookFunc) (int *m, struct questinfo *qi);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_add_questinfo_post > 0) {
+ void (*postHookFunc) (int m, struct questinfo *qi);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_add_questinfo_post[hIndex].func;
- postHookFunc(&m, qi);
+ postHookFunc(m, qi);
}
}
return;
@@ -42402,14 +43168,14 @@ void HP_map_add_questinfo(int m, struct questinfo *qi) {
bool HP_map_remove_questinfo(int m, struct npc_data *nd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_map_remove_questinfo_pre ) {
- bool (*preHookFunc) (int *m, struct npc_data *nd);
+ if (HPMHooks.count.HP_map_remove_questinfo_pre > 0) {
+ bool (*preHookFunc) (int *m, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_remove_questinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_remove_questinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_remove_questinfo_pre[hIndex].func;
- retVal___ = preHookFunc(&m, nd);
+ retVal___ = preHookFunc(&m, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42417,11 +43183,11 @@ bool HP_map_remove_questinfo(int m, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.map.remove_questinfo(m, nd);
}
- if( HPMHooks.count.HP_map_remove_questinfo_post ) {
- bool (*postHookFunc) (bool retVal___, int *m, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_remove_questinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_map_remove_questinfo_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int m, struct npc_data *nd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_remove_questinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_remove_questinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &m, nd);
+ retVal___ = postHookFunc(retVal___, m, nd);
}
}
return retVal___;
@@ -42429,14 +43195,14 @@ bool HP_map_remove_questinfo(int m, struct npc_data *nd) {
struct map_zone_data* HP_map_merge_zone(struct map_zone_data *main, struct map_zone_data *other) {
int hIndex = 0;
struct map_zone_data* retVal___ = NULL;
- if( HPMHooks.count.HP_map_merge_zone_pre ) {
- struct map_zone_data* (*preHookFunc) (struct map_zone_data *main, struct map_zone_data *other);
+ if (HPMHooks.count.HP_map_merge_zone_pre > 0) {
+ struct map_zone_data* (*preHookFunc) (struct map_zone_data **main, struct map_zone_data **other);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_merge_zone_pre[hIndex].func;
- retVal___ = preHookFunc(main, other);
+ retVal___ = preHookFunc(&main, &other);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42444,9 +43210,9 @@ struct map_zone_data* HP_map_merge_zone(struct map_zone_data *main, struct map_z
{
retVal___ = HPMHooks.source.map.merge_zone(main, other);
}
- if( HPMHooks.count.HP_map_merge_zone_post ) {
+ if (HPMHooks.count.HP_map_merge_zone_post > 0) {
struct map_zone_data* (*postHookFunc) (struct map_zone_data* retVal___, struct map_zone_data *main, struct map_zone_data *other);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_merge_zone_post[hIndex].func;
retVal___ = postHookFunc(retVal___, main, other);
}
@@ -42455,14 +43221,14 @@ struct map_zone_data* HP_map_merge_zone(struct map_zone_data *main, struct map_z
}
void HP_map_zone_clear_single(struct map_zone_data *zone) {
int hIndex = 0;
- if( HPMHooks.count.HP_map_zone_clear_single_pre ) {
- void (*preHookFunc) (struct map_zone_data *zone);
+ if (HPMHooks.count.HP_map_zone_clear_single_pre > 0) {
+ void (*preHookFunc) (struct map_zone_data **zone);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_clear_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_clear_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_map_zone_clear_single_pre[hIndex].func;
- preHookFunc(zone);
+ preHookFunc(&zone);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42470,27 +43236,27 @@ void HP_map_zone_clear_single(struct map_zone_data *zone) {
{
HPMHooks.source.map.zone_clear_single(zone);
}
- if( HPMHooks.count.HP_map_zone_clear_single_post ) {
+ if (HPMHooks.count.HP_map_zone_clear_single_post > 0) {
void (*postHookFunc) (struct map_zone_data *zone);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_clear_single_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_clear_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_map_zone_clear_single_post[hIndex].func;
postHookFunc(zone);
}
}
return;
}
-/* mapindex */
+/* mapindex_interface */
int HP_mapindex_init(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapindex_init_pre ) {
+ if (HPMHooks.count.HP_mapindex_init_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_init_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42498,9 +43264,9 @@ int HP_mapindex_init(void) {
{
retVal___ = HPMHooks.source.mapindex.init();
}
- if( HPMHooks.count.HP_mapindex_init_post ) {
+ if (HPMHooks.count.HP_mapindex_init_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -42509,14 +43275,14 @@ int HP_mapindex_init(void) {
}
void HP_mapindex_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapindex_final_pre ) {
+ if (HPMHooks.count.HP_mapindex_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42524,9 +43290,9 @@ void HP_mapindex_final(void) {
{
HPMHooks.source.mapindex.final();
}
- if( HPMHooks.count.HP_mapindex_final_post ) {
+ if (HPMHooks.count.HP_mapindex_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_final_post[hIndex].func;
postHookFunc();
}
@@ -42536,14 +43302,14 @@ void HP_mapindex_final(void) {
int HP_mapindex_addmap(int index, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapindex_addmap_pre ) {
- int (*preHookFunc) (int *index, const char *name);
+ if (HPMHooks.count.HP_mapindex_addmap_pre > 0) {
+ int (*preHookFunc) (int *index, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_addmap_pre[hIndex].func;
- retVal___ = preHookFunc(&index, name);
+ retVal___ = preHookFunc(&index, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42551,25 +43317,25 @@ int HP_mapindex_addmap(int index, const char *name) {
{
retVal___ = HPMHooks.source.mapindex.addmap(index, name);
}
- if( HPMHooks.count.HP_mapindex_addmap_post ) {
- int (*postHookFunc) (int retVal___, int *index, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapindex_addmap_post > 0) {
+ int (*postHookFunc) (int retVal___, int index, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_addmap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_addmap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &index, name);
+ retVal___ = postHookFunc(retVal___, index, name);
}
}
return retVal___;
}
void HP_mapindex_removemap(int index) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapindex_removemap_pre ) {
+ if (HPMHooks.count.HP_mapindex_removemap_pre > 0) {
void (*preHookFunc) (int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_removemap_pre[hIndex].func;
preHookFunc(&index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42577,11 +43343,11 @@ void HP_mapindex_removemap(int index) {
{
HPMHooks.source.mapindex.removemap(index);
}
- if( HPMHooks.count.HP_mapindex_removemap_post ) {
- void (*postHookFunc) (int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapindex_removemap_post > 0) {
+ void (*postHookFunc) (int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_removemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_removemap_post[hIndex].func;
- postHookFunc(&index);
+ postHookFunc(index);
}
}
return;
@@ -42589,14 +43355,14 @@ void HP_mapindex_removemap(int index) {
const char* HP_mapindex_getmapname(const char *string, char *output) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapindex_getmapname_pre ) {
- const char* (*preHookFunc) (const char *string, char *output);
+ if (HPMHooks.count.HP_mapindex_getmapname_pre > 0) {
+ const char* (*preHookFunc) (const char **string, char **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_getmapname_pre[hIndex].func;
- retVal___ = preHookFunc(string, output);
+ retVal___ = preHookFunc(&string, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42604,9 +43370,9 @@ const char* HP_mapindex_getmapname(const char *string, char *output) {
{
retVal___ = HPMHooks.source.mapindex.getmapname(string, output);
}
- if( HPMHooks.count.HP_mapindex_getmapname_post ) {
+ if (HPMHooks.count.HP_mapindex_getmapname_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *string, char *output);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_getmapname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, output);
}
@@ -42616,14 +43382,14 @@ const char* HP_mapindex_getmapname(const char *string, char *output) {
const char* HP_mapindex_getmapname_ext(const char *string, char *output) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapindex_getmapname_ext_pre ) {
- const char* (*preHookFunc) (const char *string, char *output);
+ if (HPMHooks.count.HP_mapindex_getmapname_ext_pre > 0) {
+ const char* (*preHookFunc) (const char **string, char **output);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_pre[hIndex].func;
- retVal___ = preHookFunc(string, output);
+ retVal___ = preHookFunc(&string, &output);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42631,9 +43397,9 @@ const char* HP_mapindex_getmapname_ext(const char *string, char *output) {
{
retVal___ = HPMHooks.source.mapindex.getmapname_ext(string, output);
}
- if( HPMHooks.count.HP_mapindex_getmapname_ext_post ) {
+ if (HPMHooks.count.HP_mapindex_getmapname_ext_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *string, char *output);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_getmapname_ext_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_getmapname_ext_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, output);
}
@@ -42643,14 +43409,14 @@ const char* HP_mapindex_getmapname_ext(const char *string, char *output) {
unsigned short HP_mapindex_name2id(const char *p1) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_mapindex_name2id_pre ) {
- unsigned short (*preHookFunc) (const char *p1);
+ if (HPMHooks.count.HP_mapindex_name2id_pre > 0) {
+ unsigned short (*preHookFunc) (const char **p1);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_name2id_pre[hIndex].func;
- retVal___ = preHookFunc(p1);
+ retVal___ = preHookFunc(&p1);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42658,9 +43424,9 @@ unsigned short HP_mapindex_name2id(const char *p1) {
{
retVal___ = HPMHooks.source.mapindex.name2id(p1);
}
- if( HPMHooks.count.HP_mapindex_name2id_post ) {
+ if (HPMHooks.count.HP_mapindex_name2id_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, const char *p1);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_name2id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_name2id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p1);
}
@@ -42670,14 +43436,14 @@ unsigned short HP_mapindex_name2id(const char *p1) {
const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const char *func) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapindex_id2name_pre ) {
- const char* (*preHookFunc) (uint16 *id, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_mapindex_id2name_pre > 0) {
+ const char* (*preHookFunc) (uint16 *id, const char **file, int *line, const char **func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_id2name_pre[hIndex].func;
- retVal___ = preHookFunc(&id, file, &line, func);
+ retVal___ = preHookFunc(&id, &file, &line, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42685,11 +43451,11 @@ const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const cha
{
retVal___ = HPMHooks.source.mapindex.id2name(id, file, line, func);
}
- if( HPMHooks.count.HP_mapindex_id2name_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint16 *id, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapindex_id2name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint16 id, const char *file, int line, const char *func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_id2name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_id2name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id, file, &line, func);
+ retVal___ = postHookFunc(retVal___, id, file, line, func);
}
}
return retVal___;
@@ -42697,14 +43463,14 @@ const char* HP_mapindex_id2name(uint16 id, const char *file, int line, const cha
bool HP_mapindex_check_default(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapindex_check_default_pre ) {
+ if (HPMHooks.count.HP_mapindex_check_default_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapindex_check_default_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42712,27 +43478,27 @@ bool HP_mapindex_check_default(void) {
{
retVal___ = HPMHooks.source.mapindex.check_default();
}
- if( HPMHooks.count.HP_mapindex_check_default_post ) {
+ if (HPMHooks.count.HP_mapindex_check_default_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapindex_check_default_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapindex_check_default_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-/* mapit */
+/* mapit_interface */
struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types) {
int hIndex = 0;
struct s_mapiterator* retVal___ = NULL;
- if( HPMHooks.count.HP_mapit_alloc_pre ) {
+ if (HPMHooks.count.HP_mapit_alloc_pre > 0) {
struct s_mapiterator* (*preHookFunc) (enum e_mapitflags *flags, enum bl_type *types);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_alloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_alloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_alloc_pre[hIndex].func;
retVal___ = preHookFunc(&flags, &types);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42740,25 +43506,25 @@ struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types
{
retVal___ = HPMHooks.source.mapit.alloc(flags, types);
}
- if( HPMHooks.count.HP_mapit_alloc_post ) {
- struct s_mapiterator* (*postHookFunc) (struct s_mapiterator* retVal___, enum e_mapitflags *flags, enum bl_type *types);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_alloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapit_alloc_post > 0) {
+ struct s_mapiterator* (*postHookFunc) (struct s_mapiterator* retVal___, enum e_mapitflags flags, enum bl_type types);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_alloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_alloc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &flags, &types);
+ retVal___ = postHookFunc(retVal___, flags, types);
}
}
return retVal___;
}
void HP_mapit_free(struct s_mapiterator *iter) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapit_free_pre ) {
- void (*preHookFunc) (struct s_mapiterator *iter);
+ if (HPMHooks.count.HP_mapit_free_pre > 0) {
+ void (*preHookFunc) (struct s_mapiterator **iter);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_free_pre[hIndex].func;
- preHookFunc(iter);
+ preHookFunc(&iter);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42766,9 +43532,9 @@ void HP_mapit_free(struct s_mapiterator *iter) {
{
HPMHooks.source.mapit.free(iter);
}
- if( HPMHooks.count.HP_mapit_free_post ) {
+ if (HPMHooks.count.HP_mapit_free_post > 0) {
void (*postHookFunc) (struct s_mapiterator *iter);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_free_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_free_post[hIndex].func;
postHookFunc(iter);
}
@@ -42778,14 +43544,14 @@ void HP_mapit_free(struct s_mapiterator *iter) {
struct block_list* HP_mapit_first(struct s_mapiterator *iter) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_mapit_first_pre ) {
- struct block_list* (*preHookFunc) (struct s_mapiterator *iter);
+ if (HPMHooks.count.HP_mapit_first_pre > 0) {
+ struct block_list* (*preHookFunc) (struct s_mapiterator **iter);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_first_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_first_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_first_pre[hIndex].func;
- retVal___ = preHookFunc(iter);
+ retVal___ = preHookFunc(&iter);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42793,9 +43559,9 @@ struct block_list* HP_mapit_first(struct s_mapiterator *iter) {
{
retVal___ = HPMHooks.source.mapit.first(iter);
}
- if( HPMHooks.count.HP_mapit_first_post ) {
+ if (HPMHooks.count.HP_mapit_first_post > 0) {
struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_first_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_first_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_first_post[hIndex].func;
retVal___ = postHookFunc(retVal___, iter);
}
@@ -42805,14 +43571,14 @@ struct block_list* HP_mapit_first(struct s_mapiterator *iter) {
struct block_list* HP_mapit_last(struct s_mapiterator *iter) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_mapit_last_pre ) {
- struct block_list* (*preHookFunc) (struct s_mapiterator *iter);
+ if (HPMHooks.count.HP_mapit_last_pre > 0) {
+ struct block_list* (*preHookFunc) (struct s_mapiterator **iter);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_last_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_last_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_last_pre[hIndex].func;
- retVal___ = preHookFunc(iter);
+ retVal___ = preHookFunc(&iter);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42820,9 +43586,9 @@ struct block_list* HP_mapit_last(struct s_mapiterator *iter) {
{
retVal___ = HPMHooks.source.mapit.last(iter);
}
- if( HPMHooks.count.HP_mapit_last_post ) {
+ if (HPMHooks.count.HP_mapit_last_post > 0) {
struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_last_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_last_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_last_post[hIndex].func;
retVal___ = postHookFunc(retVal___, iter);
}
@@ -42832,14 +43598,14 @@ struct block_list* HP_mapit_last(struct s_mapiterator *iter) {
struct block_list* HP_mapit_next(struct s_mapiterator *iter) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_mapit_next_pre ) {
- struct block_list* (*preHookFunc) (struct s_mapiterator *iter);
+ if (HPMHooks.count.HP_mapit_next_pre > 0) {
+ struct block_list* (*preHookFunc) (struct s_mapiterator **iter);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_next_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_next_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_next_pre[hIndex].func;
- retVal___ = preHookFunc(iter);
+ retVal___ = preHookFunc(&iter);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42847,9 +43613,9 @@ struct block_list* HP_mapit_next(struct s_mapiterator *iter) {
{
retVal___ = HPMHooks.source.mapit.next(iter);
}
- if( HPMHooks.count.HP_mapit_next_post ) {
+ if (HPMHooks.count.HP_mapit_next_post > 0) {
struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_next_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_next_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_next_post[hIndex].func;
retVal___ = postHookFunc(retVal___, iter);
}
@@ -42859,14 +43625,14 @@ struct block_list* HP_mapit_next(struct s_mapiterator *iter) {
struct block_list* HP_mapit_prev(struct s_mapiterator *iter) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_mapit_prev_pre ) {
- struct block_list* (*preHookFunc) (struct s_mapiterator *iter);
+ if (HPMHooks.count.HP_mapit_prev_pre > 0) {
+ struct block_list* (*preHookFunc) (struct s_mapiterator **iter);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_prev_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_prev_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_prev_pre[hIndex].func;
- retVal___ = preHookFunc(iter);
+ retVal___ = preHookFunc(&iter);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42874,9 +43640,9 @@ struct block_list* HP_mapit_prev(struct s_mapiterator *iter) {
{
retVal___ = HPMHooks.source.mapit.prev(iter);
}
- if( HPMHooks.count.HP_mapit_prev_post ) {
+ if (HPMHooks.count.HP_mapit_prev_post > 0) {
struct block_list* (*postHookFunc) (struct block_list* retVal___, struct s_mapiterator *iter);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_prev_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_prev_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_prev_post[hIndex].func;
retVal___ = postHookFunc(retVal___, iter);
}
@@ -42886,14 +43652,14 @@ struct block_list* HP_mapit_prev(struct s_mapiterator *iter) {
bool HP_mapit_exists(struct s_mapiterator *iter) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapit_exists_pre ) {
- bool (*preHookFunc) (struct s_mapiterator *iter);
+ if (HPMHooks.count.HP_mapit_exists_pre > 0) {
+ bool (*preHookFunc) (struct s_mapiterator **iter);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_exists_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_exists_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapit_exists_pre[hIndex].func;
- retVal___ = preHookFunc(iter);
+ retVal___ = preHookFunc(&iter);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42901,26 +43667,26 @@ bool HP_mapit_exists(struct s_mapiterator *iter) {
{
retVal___ = HPMHooks.source.mapit.exists(iter);
}
- if( HPMHooks.count.HP_mapit_exists_post ) {
+ if (HPMHooks.count.HP_mapit_exists_post > 0) {
bool (*postHookFunc) (bool retVal___, struct s_mapiterator *iter);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapit_exists_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapit_exists_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapit_exists_post[hIndex].func;
retVal___ = postHookFunc(retVal___, iter);
}
}
return retVal___;
}
-/* mapreg */
+/* mapreg_interface */
void HP_mapreg_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapreg_init_pre ) {
+ if (HPMHooks.count.HP_mapreg_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42928,9 +43694,9 @@ void HP_mapreg_init(void) {
{
HPMHooks.source.mapreg.init();
}
- if( HPMHooks.count.HP_mapreg_init_post ) {
+ if (HPMHooks.count.HP_mapreg_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_init_post[hIndex].func;
postHookFunc();
}
@@ -42939,14 +43705,14 @@ void HP_mapreg_init(void) {
}
void HP_mapreg_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapreg_final_pre ) {
+ if (HPMHooks.count.HP_mapreg_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -42954,9 +43720,9 @@ void HP_mapreg_final(void) {
{
HPMHooks.source.mapreg.final();
}
- if( HPMHooks.count.HP_mapreg_final_post ) {
+ if (HPMHooks.count.HP_mapreg_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_final_post[hIndex].func;
postHookFunc();
}
@@ -42966,14 +43732,14 @@ void HP_mapreg_final(void) {
int HP_mapreg_readreg(int64 uid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapreg_readreg_pre ) {
+ if (HPMHooks.count.HP_mapreg_readreg_pre > 0) {
int (*preHookFunc) (int64 *uid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readreg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readreg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_readreg_pre[hIndex].func;
retVal___ = preHookFunc(&uid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -42981,11 +43747,11 @@ int HP_mapreg_readreg(int64 uid) {
{
retVal___ = HPMHooks.source.mapreg.readreg(uid);
}
- if( HPMHooks.count.HP_mapreg_readreg_post ) {
- int (*postHookFunc) (int retVal___, int64 *uid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readreg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_readreg_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 uid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readreg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_readreg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &uid);
+ retVal___ = postHookFunc(retVal___, uid);
}
}
return retVal___;
@@ -42993,14 +43759,14 @@ int HP_mapreg_readreg(int64 uid) {
char* HP_mapreg_readregstr(int64 uid) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_mapreg_readregstr_pre ) {
+ if (HPMHooks.count.HP_mapreg_readregstr_pre > 0) {
char* (*preHookFunc) (int64 *uid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readregstr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readregstr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_readregstr_pre[hIndex].func;
retVal___ = preHookFunc(&uid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43008,11 +43774,11 @@ char* HP_mapreg_readregstr(int64 uid) {
{
retVal___ = HPMHooks.source.mapreg.readregstr(uid);
}
- if( HPMHooks.count.HP_mapreg_readregstr_post ) {
- char* (*postHookFunc) (char* retVal___, int64 *uid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readregstr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_readregstr_post > 0) {
+ char* (*postHookFunc) (char* retVal___, int64 uid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_readregstr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_readregstr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &uid);
+ retVal___ = postHookFunc(retVal___, uid);
}
}
return retVal___;
@@ -43020,14 +43786,14 @@ char* HP_mapreg_readregstr(int64 uid) {
bool HP_mapreg_setreg(int64 uid, int val) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapreg_setreg_pre ) {
+ if (HPMHooks.count.HP_mapreg_setreg_pre > 0) {
bool (*preHookFunc) (int64 *uid, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setreg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setreg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_setreg_pre[hIndex].func;
retVal___ = preHookFunc(&uid, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43035,11 +43801,11 @@ bool HP_mapreg_setreg(int64 uid, int val) {
{
retVal___ = HPMHooks.source.mapreg.setreg(uid, val);
}
- if( HPMHooks.count.HP_mapreg_setreg_post ) {
- bool (*postHookFunc) (bool retVal___, int64 *uid, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setreg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_setreg_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int64 uid, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setreg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_setreg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &uid, &val);
+ retVal___ = postHookFunc(retVal___, uid, val);
}
}
return retVal___;
@@ -43047,14 +43813,14 @@ bool HP_mapreg_setreg(int64 uid, int val) {
bool HP_mapreg_setregstr(int64 uid, const char *str) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapreg_setregstr_pre ) {
- bool (*preHookFunc) (int64 *uid, const char *str);
+ if (HPMHooks.count.HP_mapreg_setregstr_pre > 0) {
+ bool (*preHookFunc) (int64 *uid, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setregstr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setregstr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_setregstr_pre[hIndex].func;
- retVal___ = preHookFunc(&uid, str);
+ retVal___ = preHookFunc(&uid, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43062,25 +43828,25 @@ bool HP_mapreg_setregstr(int64 uid, const char *str) {
{
retVal___ = HPMHooks.source.mapreg.setregstr(uid, str);
}
- if( HPMHooks.count.HP_mapreg_setregstr_post ) {
- bool (*postHookFunc) (bool retVal___, int64 *uid, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setregstr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_setregstr_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int64 uid, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_setregstr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_setregstr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &uid, str);
+ retVal___ = postHookFunc(retVal___, uid, str);
}
}
return retVal___;
}
void HP_mapreg_load(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapreg_load_pre ) {
+ if (HPMHooks.count.HP_mapreg_load_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_load_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43088,9 +43854,9 @@ void HP_mapreg_load(void) {
{
HPMHooks.source.mapreg.load();
}
- if( HPMHooks.count.HP_mapreg_load_post ) {
+ if (HPMHooks.count.HP_mapreg_load_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_load_post[hIndex].func;
postHookFunc();
}
@@ -43099,14 +43865,14 @@ void HP_mapreg_load(void) {
}
void HP_mapreg_save(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapreg_save_pre ) {
+ if (HPMHooks.count.HP_mapreg_save_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_save_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43114,9 +43880,9 @@ void HP_mapreg_save(void) {
{
HPMHooks.source.mapreg.save();
}
- if( HPMHooks.count.HP_mapreg_save_post ) {
+ if (HPMHooks.count.HP_mapreg_save_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_save_post[hIndex].func;
postHookFunc();
}
@@ -43126,14 +43892,14 @@ void HP_mapreg_save(void) {
int HP_mapreg_save_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapreg_save_timer_pre ) {
+ if (HPMHooks.count.HP_mapreg_save_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_save_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43141,28 +43907,28 @@ int HP_mapreg_save_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mapreg.save_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mapreg_save_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_save_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_save_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_save_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-int HP_mapreg_destroyreg(DBKey key, DBData *data, va_list ap) {
+int HP_mapreg_destroyreg(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mapreg_destroyreg_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_mapreg_destroyreg_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_destroyreg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_destroyreg_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mapreg_destroyreg_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43172,12 +43938,12 @@ int HP_mapreg_destroyreg(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.mapreg.destroyreg(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mapreg_destroyreg_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_destroyreg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_destroyreg_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_destroyreg_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mapreg_destroyreg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -43185,14 +43951,14 @@ int HP_mapreg_destroyreg(DBKey key, DBData *data, va_list ap) {
}
void HP_mapreg_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mapreg_reload_pre ) {
+ if (HPMHooks.count.HP_mapreg_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43200,53 +43966,132 @@ void HP_mapreg_reload(void) {
{
HPMHooks.source.mapreg.reload();
}
- if( HPMHooks.count.HP_mapreg_reload_post ) {
+ if (HPMHooks.count.HP_mapreg_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_reload_post[hIndex].func;
postHookFunc();
}
}
return;
}
-bool HP_mapreg_config_read(const char *w1, const char *w2) {
+bool HP_mapreg_config_read(const char *filename, const struct config_setting_t *config, bool imported) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mapreg_config_read_pre ) {
- bool (*preHookFunc) (const char *w1, const char *w2);
+ if (HPMHooks.count.HP_mapreg_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, const struct config_setting_t **config, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mapreg_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2);
+ retVal___ = preHookFunc(&filename, &config, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.mapreg.config_read(w1, w2);
+ retVal___ = HPMHooks.source.mapreg.config_read(filename, config, imported);
}
- if( HPMHooks.count.HP_mapreg_config_read_post ) {
- bool (*postHookFunc) (bool retVal___, const char *w1, const char *w2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mapreg_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_setting_t *config, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mapreg_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, w1, w2);
+ retVal___ = postHookFunc(retVal___, filename, config, imported);
}
}
return retVal___;
}
-/* mercenary */
+/* md5_interface */
+void HP_md5_string(const char *string, char *output) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_md5_string_pre > 0) {
+ void (*preHookFunc) (const char **string, char **output);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_string_pre[hIndex].func;
+ preHookFunc(&string, &output);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.md5.string(string, output);
+ }
+ if (HPMHooks.count.HP_md5_string_post > 0) {
+ void (*postHookFunc) (const char *string, char *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_string_post[hIndex].func;
+ postHookFunc(string, output);
+ }
+ }
+ return;
+}
+void HP_md5_binary(const uint8 *buf, const int buf_size, uint8 *output) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_md5_binary_pre > 0) {
+ void (*preHookFunc) (const uint8 **buf, const int *buf_size, uint8 **output);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_binary_pre[hIndex].func;
+ preHookFunc(&buf, &buf_size, &output);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.md5.binary(buf, buf_size, output);
+ }
+ if (HPMHooks.count.HP_md5_binary_post > 0) {
+ void (*postHookFunc) (const uint8 *buf, const int buf_size, uint8 *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_binary_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_binary_post[hIndex].func;
+ postHookFunc(buf, buf_size, output);
+ }
+ }
+ return;
+}
+void HP_md5_salt(int len, char *output) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_md5_salt_pre > 0) {
+ void (*preHookFunc) (int *len, char **output);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_md5_salt_pre[hIndex].func;
+ preHookFunc(&len, &output);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.md5.salt(len, output);
+ }
+ if (HPMHooks.count.HP_md5_salt_post > 0) {
+ void (*postHookFunc) (int len, char *output);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_md5_salt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_md5_salt_post[hIndex].func;
+ postHookFunc(len, output);
+ }
+ }
+ return;
+}
+/* mercenary_interface */
void HP_mercenary_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_mercenary_init_pre ) {
+ if (HPMHooks.count.HP_mercenary_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43254,11 +44099,11 @@ void HP_mercenary_init(bool minimal) {
{
HPMHooks.source.mercenary.init(minimal);
}
- if( HPMHooks.count.HP_mercenary_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
@@ -43266,14 +44111,14 @@ void HP_mercenary_init(bool minimal) {
bool HP_mercenary_class(int class_) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mercenary_class_pre ) {
+ if (HPMHooks.count.HP_mercenary_class_pre > 0) {
bool (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_class_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_class_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_class_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43281,11 +44126,11 @@ bool HP_mercenary_class(int class_) {
{
retVal___ = HPMHooks.source.mercenary.class(class_);
}
- if( HPMHooks.count.HP_mercenary_class_post ) {
- bool (*postHookFunc) (bool retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_class_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_class_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_class_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_class_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -43293,14 +44138,14 @@ bool HP_mercenary_class(int class_) {
struct view_data* HP_mercenary_get_viewdata(int class_) {
int hIndex = 0;
struct view_data* retVal___ = NULL;
- if( HPMHooks.count.HP_mercenary_get_viewdata_pre ) {
+ if (HPMHooks.count.HP_mercenary_get_viewdata_pre > 0) {
struct view_data* (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_get_viewdata_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43308,11 +44153,11 @@ struct view_data* HP_mercenary_get_viewdata(int class_) {
{
retVal___ = HPMHooks.source.mercenary.get_viewdata(class_);
}
- if( HPMHooks.count.HP_mercenary_get_viewdata_post ) {
- struct view_data* (*postHookFunc) (struct view_data* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_viewdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_get_viewdata_post > 0) {
+ struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_get_viewdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -43320,14 +44165,14 @@ struct view_data* HP_mercenary_get_viewdata(int class_) {
int HP_mercenary_create(struct map_session_data *sd, int class_, unsigned int lifetime) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_create_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *class_, unsigned int *lifetime);
+ if (HPMHooks.count.HP_mercenary_create_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *class_, unsigned int *lifetime);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &class_, &lifetime);
+ retVal___ = preHookFunc(&sd, &class_, &lifetime);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43335,26 +44180,26 @@ int HP_mercenary_create(struct map_session_data *sd, int class_, unsigned int li
{
retVal___ = HPMHooks.source.mercenary.create(sd, class_, lifetime);
}
- if( HPMHooks.count.HP_mercenary_create_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *class_, unsigned int *lifetime);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_create_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int class_, unsigned int lifetime);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &class_, &lifetime);
+ retVal___ = postHookFunc(retVal___, sd, class_, lifetime);
}
}
return retVal___;
}
-int HP_mercenary_data_received(struct s_mercenary *merc, bool flag) {
+int HP_mercenary_data_received(const struct s_mercenary *merc, bool flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_data_received_pre ) {
- int (*preHookFunc) (struct s_mercenary *merc, bool *flag);
+ if (HPMHooks.count.HP_mercenary_data_received_pre > 0) {
+ int (*preHookFunc) (const struct s_mercenary **merc, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_data_received_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_data_received_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_data_received_pre[hIndex].func;
- retVal___ = preHookFunc(merc, &flag);
+ retVal___ = preHookFunc(&merc, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43362,11 +44207,11 @@ int HP_mercenary_data_received(struct s_mercenary *merc, bool flag) {
{
retVal___ = HPMHooks.source.mercenary.data_received(merc, flag);
}
- if( HPMHooks.count.HP_mercenary_data_received_post ) {
- int (*postHookFunc) (int retVal___, struct s_mercenary *merc, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_data_received_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_data_received_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct s_mercenary *merc, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_data_received_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_data_received_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, merc, &flag);
+ retVal___ = postHookFunc(retVal___, merc, flag);
}
}
return retVal___;
@@ -43374,14 +44219,14 @@ int HP_mercenary_data_received(struct s_mercenary *merc, bool flag) {
int HP_mercenary_save(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_save_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_save_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_save_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43389,9 +44234,9 @@ int HP_mercenary_save(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.save(md);
}
- if( HPMHooks.count.HP_mercenary_save_post ) {
+ if (HPMHooks.count.HP_mercenary_save_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_save_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43400,14 +44245,14 @@ int HP_mercenary_save(struct mercenary_data *md) {
}
void HP_mercenary_heal(struct mercenary_data *md, int hp, int sp) {
int hIndex = 0;
- if( HPMHooks.count.HP_mercenary_heal_pre ) {
- void (*preHookFunc) (struct mercenary_data *md, int *hp, int *sp);
+ if (HPMHooks.count.HP_mercenary_heal_pre > 0) {
+ void (*preHookFunc) (struct mercenary_data **md, int *hp, int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_heal_pre[hIndex].func;
- preHookFunc(md, &hp, &sp);
+ preHookFunc(&md, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43415,11 +44260,11 @@ void HP_mercenary_heal(struct mercenary_data *md, int hp, int sp) {
{
HPMHooks.source.mercenary.heal(md, hp, sp);
}
- if( HPMHooks.count.HP_mercenary_heal_post ) {
- void (*postHookFunc) (struct mercenary_data *md, int *hp, int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_heal_post > 0) {
+ void (*postHookFunc) (struct mercenary_data *md, int hp, int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_heal_post[hIndex].func;
- postHookFunc(md, &hp, &sp);
+ postHookFunc(md, hp, sp);
}
}
return;
@@ -43427,14 +44272,14 @@ void HP_mercenary_heal(struct mercenary_data *md, int hp, int sp) {
int HP_mercenary_dead(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_dead_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_dead_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_dead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_dead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_dead_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43442,9 +44287,9 @@ int HP_mercenary_dead(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.dead(md);
}
- if( HPMHooks.count.HP_mercenary_dead_post ) {
+ if (HPMHooks.count.HP_mercenary_dead_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_dead_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_dead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_dead_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43454,14 +44299,14 @@ int HP_mercenary_dead(struct mercenary_data *md) {
int HP_mercenary_delete(struct mercenary_data *md, int reply) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_delete_pre ) {
- int (*preHookFunc) (struct mercenary_data *md, int *reply);
+ if (HPMHooks.count.HP_mercenary_delete_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md, int *reply);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_delete_pre[hIndex].func;
- retVal___ = preHookFunc(md, &reply);
+ retVal___ = preHookFunc(&md, &reply);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43469,25 +44314,25 @@ int HP_mercenary_delete(struct mercenary_data *md, int reply) {
{
retVal___ = HPMHooks.source.mercenary.delete(md, reply);
}
- if( HPMHooks.count.HP_mercenary_delete_post ) {
- int (*postHookFunc) (int retVal___, struct mercenary_data *md, int *reply);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mercenary_data *md, int reply);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &reply);
+ retVal___ = postHookFunc(retVal___, md, reply);
}
}
return retVal___;
}
void HP_mercenary_contract_stop(struct mercenary_data *md) {
int hIndex = 0;
- if( HPMHooks.count.HP_mercenary_contract_stop_pre ) {
- void (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_contract_stop_pre > 0) {
+ void (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_stop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_stop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_contract_stop_pre[hIndex].func;
- preHookFunc(md);
+ preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43495,9 +44340,9 @@ void HP_mercenary_contract_stop(struct mercenary_data *md) {
{
HPMHooks.source.mercenary.contract_stop(md);
}
- if( HPMHooks.count.HP_mercenary_contract_stop_post ) {
+ if (HPMHooks.count.HP_mercenary_contract_stop_post > 0) {
void (*postHookFunc) (struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_stop_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_stop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_contract_stop_post[hIndex].func;
postHookFunc(md);
}
@@ -43507,14 +44352,14 @@ void HP_mercenary_contract_stop(struct mercenary_data *md) {
int HP_mercenary_get_lifetime(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_get_lifetime_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_get_lifetime_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_lifetime_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_lifetime_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_get_lifetime_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43522,9 +44367,9 @@ int HP_mercenary_get_lifetime(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.get_lifetime(md);
}
- if( HPMHooks.count.HP_mercenary_get_lifetime_post ) {
+ if (HPMHooks.count.HP_mercenary_get_lifetime_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_lifetime_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_lifetime_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_get_lifetime_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43534,14 +44379,14 @@ int HP_mercenary_get_lifetime(struct mercenary_data *md) {
int HP_mercenary_get_guild(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_get_guild_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_get_guild_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_guild_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_guild_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_get_guild_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43549,9 +44394,9 @@ int HP_mercenary_get_guild(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.get_guild(md);
}
- if( HPMHooks.count.HP_mercenary_get_guild_post ) {
+ if (HPMHooks.count.HP_mercenary_get_guild_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_guild_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_guild_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_get_guild_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43561,14 +44406,14 @@ int HP_mercenary_get_guild(struct mercenary_data *md) {
int HP_mercenary_get_faith(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_get_faith_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_get_faith_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_faith_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_faith_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_get_faith_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43576,9 +44421,9 @@ int HP_mercenary_get_faith(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.get_faith(md);
}
- if( HPMHooks.count.HP_mercenary_get_faith_post ) {
+ if (HPMHooks.count.HP_mercenary_get_faith_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_faith_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_faith_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_get_faith_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43588,14 +44433,14 @@ int HP_mercenary_get_faith(struct mercenary_data *md) {
int HP_mercenary_set_faith(struct mercenary_data *md, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_set_faith_pre ) {
- int (*preHookFunc) (struct mercenary_data *md, int *value);
+ if (HPMHooks.count.HP_mercenary_set_faith_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_faith_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_faith_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_set_faith_pre[hIndex].func;
- retVal___ = preHookFunc(md, &value);
+ retVal___ = preHookFunc(&md, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43603,11 +44448,11 @@ int HP_mercenary_set_faith(struct mercenary_data *md, int value) {
{
retVal___ = HPMHooks.source.mercenary.set_faith(md, value);
}
- if( HPMHooks.count.HP_mercenary_set_faith_post ) {
- int (*postHookFunc) (int retVal___, struct mercenary_data *md, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_faith_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_set_faith_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mercenary_data *md, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_faith_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_set_faith_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &value);
+ retVal___ = postHookFunc(retVal___, md, value);
}
}
return retVal___;
@@ -43615,14 +44460,14 @@ int HP_mercenary_set_faith(struct mercenary_data *md, int value) {
int HP_mercenary_get_calls(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_get_calls_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_get_calls_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_calls_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_calls_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_get_calls_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43630,9 +44475,9 @@ int HP_mercenary_get_calls(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.get_calls(md);
}
- if( HPMHooks.count.HP_mercenary_get_calls_post ) {
+ if (HPMHooks.count.HP_mercenary_get_calls_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_calls_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_get_calls_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_get_calls_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43642,14 +44487,14 @@ int HP_mercenary_get_calls(struct mercenary_data *md) {
int HP_mercenary_set_calls(struct mercenary_data *md, int value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_set_calls_pre ) {
- int (*preHookFunc) (struct mercenary_data *md, int *value);
+ if (HPMHooks.count.HP_mercenary_set_calls_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_calls_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_calls_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_set_calls_pre[hIndex].func;
- retVal___ = preHookFunc(md, &value);
+ retVal___ = preHookFunc(&md, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43657,11 +44502,11 @@ int HP_mercenary_set_calls(struct mercenary_data *md, int value) {
{
retVal___ = HPMHooks.source.mercenary.set_calls(md, value);
}
- if( HPMHooks.count.HP_mercenary_set_calls_post ) {
- int (*postHookFunc) (int retVal___, struct mercenary_data *md, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_calls_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_set_calls_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mercenary_data *md, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_set_calls_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_set_calls_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &value);
+ retVal___ = postHookFunc(retVal___, md, value);
}
}
return retVal___;
@@ -43669,14 +44514,14 @@ int HP_mercenary_set_calls(struct mercenary_data *md, int value) {
int HP_mercenary_kills(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_kills_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_kills_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_kills_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_kills_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_kills_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43684,9 +44529,9 @@ int HP_mercenary_kills(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.kills(md);
}
- if( HPMHooks.count.HP_mercenary_kills_post ) {
+ if (HPMHooks.count.HP_mercenary_kills_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_kills_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_kills_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_kills_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43696,14 +44541,14 @@ int HP_mercenary_kills(struct mercenary_data *md) {
int HP_mercenary_checkskill(struct mercenary_data *md, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_checkskill_pre ) {
- int (*preHookFunc) (struct mercenary_data *md, uint16 *skill_id);
+ if (HPMHooks.count.HP_mercenary_checkskill_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_checkskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_checkskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_checkskill_pre[hIndex].func;
- retVal___ = preHookFunc(md, &skill_id);
+ retVal___ = preHookFunc(&md, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43711,11 +44556,11 @@ int HP_mercenary_checkskill(struct mercenary_data *md, uint16 skill_id) {
{
retVal___ = HPMHooks.source.mercenary.checkskill(md, skill_id);
}
- if( HPMHooks.count.HP_mercenary_checkskill_post ) {
- int (*postHookFunc) (int retVal___, struct mercenary_data *md, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_checkskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_checkskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mercenary_data *md, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_checkskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_checkskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &skill_id);
+ retVal___ = postHookFunc(retVal___, md, skill_id);
}
}
return retVal___;
@@ -43723,14 +44568,14 @@ int HP_mercenary_checkskill(struct mercenary_data *md, uint16 skill_id) {
int HP_mercenary_read_db(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_read_db_pre ) {
+ if (HPMHooks.count.HP_mercenary_read_db_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_read_db_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43738,9 +44583,9 @@ int HP_mercenary_read_db(void) {
{
retVal___ = HPMHooks.source.mercenary.read_db();
}
- if( HPMHooks.count.HP_mercenary_read_db_post ) {
+ if (HPMHooks.count.HP_mercenary_read_db_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_read_db_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -43750,14 +44595,14 @@ int HP_mercenary_read_db(void) {
int HP_mercenary_read_skilldb(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_read_skilldb_pre ) {
+ if (HPMHooks.count.HP_mercenary_read_skilldb_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skilldb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skilldb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_read_skilldb_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43765,9 +44610,9 @@ int HP_mercenary_read_skilldb(void) {
{
retVal___ = HPMHooks.source.mercenary.read_skilldb();
}
- if( HPMHooks.count.HP_mercenary_read_skilldb_post ) {
+ if (HPMHooks.count.HP_mercenary_read_skilldb_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skilldb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skilldb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_read_skilldb_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -43777,14 +44622,14 @@ int HP_mercenary_read_skilldb(void) {
int HP_mercenary_killbonus(struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_killbonus_pre ) {
- int (*preHookFunc) (struct mercenary_data *md);
+ if (HPMHooks.count.HP_mercenary_killbonus_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_killbonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_killbonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_killbonus_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43792,9 +44637,9 @@ int HP_mercenary_killbonus(struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.mercenary.killbonus(md);
}
- if( HPMHooks.count.HP_mercenary_killbonus_post ) {
+ if (HPMHooks.count.HP_mercenary_killbonus_post > 0) {
int (*postHookFunc) (int retVal___, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_killbonus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_killbonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_killbonus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -43804,14 +44649,14 @@ int HP_mercenary_killbonus(struct mercenary_data *md) {
int HP_mercenary_search_index(int class_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_search_index_pre ) {
+ if (HPMHooks.count.HP_mercenary_search_index_pre > 0) {
int (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_search_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_search_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_search_index_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43819,11 +44664,11 @@ int HP_mercenary_search_index(int class_) {
{
retVal___ = HPMHooks.source.mercenary.search_index(class_);
}
- if( HPMHooks.count.HP_mercenary_search_index_post ) {
- int (*postHookFunc) (int retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_search_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_search_index_post > 0) {
+ int (*postHookFunc) (int retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_search_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_search_index_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -43831,14 +44676,14 @@ int HP_mercenary_search_index(int class_) {
int HP_mercenary_contract_end_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mercenary_contract_end_timer_pre ) {
+ if (HPMHooks.count.HP_mercenary_contract_end_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_end_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_end_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_contract_end_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43846,11 +44691,11 @@ int HP_mercenary_contract_end_timer(int tid, int64 tick, int id, intptr_t data)
{
retVal___ = HPMHooks.source.mercenary.contract_end_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mercenary_contract_end_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_end_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_contract_end_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_contract_end_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_contract_end_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -43858,14 +44703,14 @@ int HP_mercenary_contract_end_timer(int tid, int64 tick, int id, intptr_t data)
bool HP_mercenary_read_db_sub(char *str[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mercenary_read_db_sub_pre ) {
- bool (*preHookFunc) (char *str[], int *columns, int *current);
+ if (HPMHooks.count.HP_mercenary_read_db_sub_pre > 0) {
+ bool (*preHookFunc) (char **str[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_read_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43873,11 +44718,11 @@ bool HP_mercenary_read_db_sub(char *str[], int columns, int current) {
{
retVal___ = HPMHooks.source.mercenary.read_db_sub(str, columns, current);
}
- if( HPMHooks.count.HP_mercenary_read_db_sub_post ) {
- bool (*postHookFunc) (bool retVal___, char *str[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_read_db_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_read_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
@@ -43885,14 +44730,14 @@ bool HP_mercenary_read_db_sub(char *str[], int columns, int current) {
bool HP_mercenary_read_skill_db_sub(char *str[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mercenary_read_skill_db_sub_pre ) {
- bool (*preHookFunc) (char *str[], int *columns, int *current);
+ if (HPMHooks.count.HP_mercenary_read_skill_db_sub_pre > 0) {
+ bool (*preHookFunc) (char **str[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skill_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skill_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mercenary_read_skill_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43900,27 +44745,27 @@ bool HP_mercenary_read_skill_db_sub(char *str[], int columns, int current) {
{
retVal___ = HPMHooks.source.mercenary.read_skill_db_sub(str, columns, current);
}
- if( HPMHooks.count.HP_mercenary_read_skill_db_sub_post ) {
- bool (*postHookFunc) (bool retVal___, char *str[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skill_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mercenary_read_skill_db_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mercenary_read_skill_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mercenary_read_skill_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
}
-/* mob */
+/* mob_interface */
int HP_mob_init(bool mimimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_init_pre ) {
+ if (HPMHooks.count.HP_mob_init_pre > 0) {
int (*preHookFunc) (bool *mimimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_init_pre[hIndex].func;
retVal___ = preHookFunc(&mimimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43928,11 +44773,11 @@ int HP_mob_init(bool mimimal) {
{
retVal___ = HPMHooks.source.mob.init(mimimal);
}
- if( HPMHooks.count.HP_mob_init_post ) {
- int (*postHookFunc) (int retVal___, bool *mimimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool mimimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &mimimal);
+ retVal___ = postHookFunc(retVal___, mimimal);
}
}
return retVal___;
@@ -43940,14 +44785,14 @@ int HP_mob_init(bool mimimal) {
int HP_mob_final(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_final_pre ) {
+ if (HPMHooks.count.HP_mob_final_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_final_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -43955,9 +44800,9 @@ int HP_mob_final(void) {
{
retVal___ = HPMHooks.source.mob.final();
}
- if( HPMHooks.count.HP_mob_final_post ) {
+ if (HPMHooks.count.HP_mob_final_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_final_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -43966,14 +44811,14 @@ int HP_mob_final(void) {
}
void HP_mob_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_reload_pre ) {
+ if (HPMHooks.count.HP_mob_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -43981,9 +44826,9 @@ void HP_mob_reload(void) {
{
HPMHooks.source.mob.reload();
}
- if( HPMHooks.count.HP_mob_reload_post ) {
+ if (HPMHooks.count.HP_mob_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_reload_post[hIndex].func;
postHookFunc();
}
@@ -43993,14 +44838,14 @@ void HP_mob_reload(void) {
struct mob_db* HP_mob_db(int index) {
int hIndex = 0;
struct mob_db* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_db_pre ) {
+ if (HPMHooks.count.HP_mob_db_pre > 0) {
struct mob_db* (*preHookFunc) (int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_db_pre[hIndex].func;
retVal___ = preHookFunc(&index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44008,11 +44853,11 @@ struct mob_db* HP_mob_db(int index) {
{
retVal___ = HPMHooks.source.mob.db(index);
}
- if( HPMHooks.count.HP_mob_db_post ) {
- struct mob_db* (*postHookFunc) (struct mob_db* retVal___, int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_db_post > 0) {
+ struct mob_db* (*postHookFunc) (struct mob_db* retVal___, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_db_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &index);
+ retVal___ = postHookFunc(retVal___, index);
}
}
return retVal___;
@@ -44020,14 +44865,14 @@ struct mob_db* HP_mob_db(int index) {
struct mob_chat* HP_mob_chat(short id) {
int hIndex = 0;
struct mob_chat* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_chat_pre ) {
+ if (HPMHooks.count.HP_mob_chat_pre > 0) {
struct mob_chat* (*preHookFunc) (short *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_chat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_chat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_chat_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44035,11 +44880,11 @@ struct mob_chat* HP_mob_chat(short id) {
{
retVal___ = HPMHooks.source.mob.chat(id);
}
- if( HPMHooks.count.HP_mob_chat_post ) {
- struct mob_chat* (*postHookFunc) (struct mob_chat* retVal___, short *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_chat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_chat_post > 0) {
+ struct mob_chat* (*postHookFunc) (struct mob_chat* retVal___, short id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_chat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_chat_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -44047,14 +44892,14 @@ struct mob_chat* HP_mob_chat(short id) {
int HP_mob_makedummymobdb(int p1) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_makedummymobdb_pre ) {
+ if (HPMHooks.count.HP_mob_makedummymobdb_pre > 0) {
int (*preHookFunc) (int *p1);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_makedummymobdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_makedummymobdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_makedummymobdb_pre[hIndex].func;
retVal___ = preHookFunc(&p1);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44062,11 +44907,11 @@ int HP_mob_makedummymobdb(int p1) {
{
retVal___ = HPMHooks.source.mob.makedummymobdb(p1);
}
- if( HPMHooks.count.HP_mob_makedummymobdb_post ) {
- int (*postHookFunc) (int retVal___, int *p1);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_makedummymobdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_makedummymobdb_post > 0) {
+ int (*postHookFunc) (int retVal___, int p1);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_makedummymobdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_makedummymobdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &p1);
+ retVal___ = postHookFunc(retVal___, p1);
}
}
return retVal___;
@@ -44074,14 +44919,14 @@ int HP_mob_makedummymobdb(int p1) {
int HP_mob_spawn_guardian_sub(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_spawn_guardian_sub_pre ) {
+ if (HPMHooks.count.HP_mob_spawn_guardian_sub_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_spawn_guardian_sub_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44089,11 +44934,11 @@ int HP_mob_spawn_guardian_sub(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.spawn_guardian_sub(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_spawn_guardian_sub_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_spawn_guardian_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_spawn_guardian_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -44101,14 +44946,14 @@ int HP_mob_spawn_guardian_sub(int tid, int64 tick, int id, intptr_t data) {
int HP_mob_skill_id2skill_idx(int class_, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_skill_id2skill_idx_pre ) {
+ if (HPMHooks.count.HP_mob_skill_id2skill_idx_pre > 0) {
int (*preHookFunc) (int *class_, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_id2skill_idx_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_id2skill_idx_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_skill_id2skill_idx_pre[hIndex].func;
retVal___ = preHookFunc(&class_, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44116,11 +44961,11 @@ int HP_mob_skill_id2skill_idx(int class_, uint16 skill_id) {
{
retVal___ = HPMHooks.source.mob.skill_id2skill_idx(class_, skill_id);
}
- if( HPMHooks.count.HP_mob_skill_id2skill_idx_post ) {
- int (*postHookFunc) (int retVal___, int *class_, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_id2skill_idx_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_skill_id2skill_idx_post > 0) {
+ int (*postHookFunc) (int retVal___, int class_, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_id2skill_idx_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_skill_id2skill_idx_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_, &skill_id);
+ retVal___ = postHookFunc(retVal___, class_, skill_id);
}
}
return retVal___;
@@ -44128,14 +44973,14 @@ int HP_mob_skill_id2skill_idx(int class_, uint16 skill_id) {
int HP_mob_db_searchname(const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_db_searchname_pre ) {
- int (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_mob_db_searchname_pre > 0) {
+ int (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_db_searchname_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44143,9 +44988,9 @@ int HP_mob_db_searchname(const char *str) {
{
retVal___ = HPMHooks.source.mob.db_searchname(str);
}
- if( HPMHooks.count.HP_mob_db_searchname_post ) {
+ if (HPMHooks.count.HP_mob_db_searchname_post > 0) {
int (*postHookFunc) (int retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_db_searchname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -44155,14 +45000,14 @@ int HP_mob_db_searchname(const char *str) {
int HP_mob_db_searchname_array_sub(struct mob_db *monster, const char *str, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_db_searchname_array_sub_pre ) {
- int (*preHookFunc) (struct mob_db *monster, const char *str, int *flag);
+ if (HPMHooks.count.HP_mob_db_searchname_array_sub_pre > 0) {
+ int (*preHookFunc) (struct mob_db **monster, const char **str, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_db_searchname_array_sub_pre[hIndex].func;
- retVal___ = preHookFunc(monster, str, &flag);
+ retVal___ = preHookFunc(&monster, &str, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44170,25 +45015,25 @@ int HP_mob_db_searchname_array_sub(struct mob_db *monster, const char *str, int
{
retVal___ = HPMHooks.source.mob.db_searchname_array_sub(monster, str, flag);
}
- if( HPMHooks.count.HP_mob_db_searchname_array_sub_post ) {
- int (*postHookFunc) (int retVal___, struct mob_db *monster, const char *str, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_db_searchname_array_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_db *monster, const char *str, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_db_searchname_array_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, monster, str, &flag);
+ retVal___ = postHookFunc(retVal___, monster, str, flag);
}
}
return retVal___;
}
void HP_mob_mvptomb_create(struct mob_data *md, char *killer, time_t time) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_mvptomb_create_pre ) {
- void (*preHookFunc) (struct mob_data *md, char *killer, time_t *time);
+ if (HPMHooks.count.HP_mob_mvptomb_create_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, char **killer, time_t *time);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_mvptomb_create_pre[hIndex].func;
- preHookFunc(md, killer, &time);
+ preHookFunc(&md, &killer, &time);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -44196,25 +45041,25 @@ void HP_mob_mvptomb_create(struct mob_data *md, char *killer, time_t time) {
{
HPMHooks.source.mob.mvptomb_create(md, killer, time);
}
- if( HPMHooks.count.HP_mob_mvptomb_create_post ) {
- void (*postHookFunc) (struct mob_data *md, char *killer, time_t *time);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_mvptomb_create_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, char *killer, time_t time);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_mvptomb_create_post[hIndex].func;
- postHookFunc(md, killer, &time);
+ postHookFunc(md, killer, time);
}
}
return;
}
void HP_mob_mvptomb_destroy(struct mob_data *md) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_mvptomb_destroy_pre ) {
- void (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_mob_mvptomb_destroy_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_mvptomb_destroy_pre[hIndex].func;
- preHookFunc(md);
+ preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -44222,9 +45067,9 @@ void HP_mob_mvptomb_destroy(struct mob_data *md) {
{
HPMHooks.source.mob.mvptomb_destroy(md);
}
- if( HPMHooks.count.HP_mob_mvptomb_destroy_post ) {
+ if (HPMHooks.count.HP_mob_mvptomb_destroy_post > 0) {
void (*postHookFunc) (struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_destroy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mvptomb_destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_mvptomb_destroy_post[hIndex].func;
postHookFunc(md);
}
@@ -44234,14 +45079,14 @@ void HP_mob_mvptomb_destroy(struct mob_data *md) {
int HP_mob_db_searchname_array(struct mob_db **data, int size, const char *str, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_db_searchname_array_pre ) {
- int (*preHookFunc) (struct mob_db **data, int *size, const char *str, int *flag);
+ if (HPMHooks.count.HP_mob_db_searchname_array_pre > 0) {
+ int (*preHookFunc) (struct mob_db ***data, int *size, const char **str, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_db_searchname_array_pre[hIndex].func;
- retVal___ = preHookFunc(data, &size, str, &flag);
+ retVal___ = preHookFunc(&data, &size, &str, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44249,11 +45094,11 @@ int HP_mob_db_searchname_array(struct mob_db **data, int size, const char *str,
{
retVal___ = HPMHooks.source.mob.db_searchname_array(data, size, str, flag);
}
- if( HPMHooks.count.HP_mob_db_searchname_array_post ) {
- int (*postHookFunc) (int retVal___, struct mob_db **data, int *size, const char *str, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_db_searchname_array_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_db **data, int size, const char *str, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_searchname_array_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_db_searchname_array_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, data, &size, str, &flag);
+ retVal___ = postHookFunc(retVal___, data, size, str, flag);
}
}
return retVal___;
@@ -44261,14 +45106,14 @@ int HP_mob_db_searchname_array(struct mob_db **data, int size, const char *str,
int HP_mob_db_checkid(const int id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_db_checkid_pre ) {
+ if (HPMHooks.count.HP_mob_db_checkid_pre > 0) {
int (*preHookFunc) (const int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_checkid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_checkid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_db_checkid_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44276,11 +45121,11 @@ int HP_mob_db_checkid(const int id) {
{
retVal___ = HPMHooks.source.mob.db_checkid(id);
}
- if( HPMHooks.count.HP_mob_db_checkid_post ) {
- int (*postHookFunc) (int retVal___, const int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_checkid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_db_checkid_post > 0) {
+ int (*postHookFunc) (int retVal___, const int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_checkid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_db_checkid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -44288,14 +45133,14 @@ int HP_mob_db_checkid(const int id) {
struct view_data* HP_mob_get_viewdata(int class_) {
int hIndex = 0;
struct view_data* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_get_viewdata_pre ) {
+ if (HPMHooks.count.HP_mob_get_viewdata_pre > 0) {
struct view_data* (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_get_viewdata_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44303,11 +45148,11 @@ struct view_data* HP_mob_get_viewdata(int class_) {
{
retVal___ = HPMHooks.source.mob.get_viewdata(class_);
}
- if( HPMHooks.count.HP_mob_get_viewdata_post ) {
- struct view_data* (*postHookFunc) (struct view_data* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_viewdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_get_viewdata_post > 0) {
+ struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_get_viewdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -44315,14 +45160,14 @@ struct view_data* HP_mob_get_viewdata(int class_) {
int HP_mob_parse_dataset(struct spawn_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_parse_dataset_pre ) {
- int (*preHookFunc) (struct spawn_data *data);
+ if (HPMHooks.count.HP_mob_parse_dataset_pre > 0) {
+ int (*preHookFunc) (struct spawn_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_dataset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_dataset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_parse_dataset_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44330,9 +45175,9 @@ int HP_mob_parse_dataset(struct spawn_data *data) {
{
retVal___ = HPMHooks.source.mob.parse_dataset(data);
}
- if( HPMHooks.count.HP_mob_parse_dataset_post ) {
+ if (HPMHooks.count.HP_mob_parse_dataset_post > 0) {
int (*postHookFunc) (int retVal___, struct spawn_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_dataset_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_dataset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_parse_dataset_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -44342,14 +45187,14 @@ int HP_mob_parse_dataset(struct spawn_data *data) {
struct mob_data* HP_mob_spawn_dataset(struct spawn_data *data) {
int hIndex = 0;
struct mob_data* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_spawn_dataset_pre ) {
- struct mob_data* (*preHookFunc) (struct spawn_data *data);
+ if (HPMHooks.count.HP_mob_spawn_dataset_pre > 0) {
+ struct mob_data* (*preHookFunc) (struct spawn_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_dataset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_dataset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_spawn_dataset_pre[hIndex].func;
- retVal___ = preHookFunc(data);
+ retVal___ = preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44357,9 +45202,9 @@ struct mob_data* HP_mob_spawn_dataset(struct spawn_data *data) {
{
retVal___ = HPMHooks.source.mob.spawn_dataset(data);
}
- if( HPMHooks.count.HP_mob_spawn_dataset_post ) {
+ if (HPMHooks.count.HP_mob_spawn_dataset_post > 0) {
struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct spawn_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_dataset_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_dataset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_spawn_dataset_post[hIndex].func;
retVal___ = postHookFunc(retVal___, data);
}
@@ -44369,14 +45214,14 @@ struct mob_data* HP_mob_spawn_dataset(struct spawn_data *data) {
int HP_mob_get_random_id(int type, int flag, int lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_get_random_id_pre ) {
+ if (HPMHooks.count.HP_mob_get_random_id_pre > 0) {
int (*preHookFunc) (int *type, int *flag, int *lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_random_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_random_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_get_random_id_pre[hIndex].func;
retVal___ = preHookFunc(&type, &flag, &lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44384,11 +45229,11 @@ int HP_mob_get_random_id(int type, int flag, int lv) {
{
retVal___ = HPMHooks.source.mob.get_random_id(type, flag, lv);
}
- if( HPMHooks.count.HP_mob_get_random_id_post ) {
- int (*postHookFunc) (int retVal___, int *type, int *flag, int *lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_random_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_get_random_id_post > 0) {
+ int (*postHookFunc) (int retVal___, int type, int flag, int lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_random_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_get_random_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type, &flag, &lv);
+ retVal___ = postHookFunc(retVal___, type, flag, lv);
}
}
return retVal___;
@@ -44396,14 +45241,14 @@ int HP_mob_get_random_id(int type, int flag, int lv) {
bool HP_mob_ksprotected(struct block_list *src, struct block_list *target) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_ksprotected_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *target);
+ if (HPMHooks.count.HP_mob_ksprotected_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ksprotected_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ksprotected_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_ksprotected_pre[hIndex].func;
- retVal___ = preHookFunc(src, target);
+ retVal___ = preHookFunc(&src, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44411,9 +45256,9 @@ bool HP_mob_ksprotected(struct block_list *src, struct block_list *target) {
{
retVal___ = HPMHooks.source.mob.ksprotected(src, target);
}
- if( HPMHooks.count.HP_mob_ksprotected_post ) {
+ if (HPMHooks.count.HP_mob_ksprotected_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ksprotected_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ksprotected_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_ksprotected_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, target);
}
@@ -44423,14 +45268,14 @@ bool HP_mob_ksprotected(struct block_list *src, struct block_list *target) {
struct mob_data* HP_mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai) {
int hIndex = 0;
struct mob_data* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_once_spawn_sub_pre ) {
- struct mob_data* (*preHookFunc) (struct block_list *bl, int16 *m, int16 *x, int16 *y, const char *mobname, int *class_, const char *event, unsigned int *size, unsigned int *ai);
+ if (HPMHooks.count.HP_mob_once_spawn_sub_pre > 0) {
+ struct mob_data* (*preHookFunc) (struct block_list **bl, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, const char **event, unsigned int *size, unsigned int *ai);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_once_spawn_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &m, &x, &y, mobname, &class_, event, &size, &ai);
+ retVal___ = preHookFunc(&bl, &m, &x, &y, &mobname, &class_, &event, &size, &ai);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44438,11 +45283,11 @@ struct mob_data* HP_mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x,
{
retVal___ = HPMHooks.source.mob.once_spawn_sub(bl, m, x, y, mobname, class_, event, size, ai);
}
- if( HPMHooks.count.HP_mob_once_spawn_sub_post ) {
- struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct block_list *bl, int16 *m, int16 *x, int16 *y, const char *mobname, int *class_, const char *event, unsigned int *size, unsigned int *ai);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_once_spawn_sub_post > 0) {
+ struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct block_list *bl, int16 m, int16 x, int16 y, const char *mobname, int class_, const char *event, unsigned int size, unsigned int ai);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_once_spawn_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &m, &x, &y, mobname, &class_, event, &size, &ai);
+ retVal___ = postHookFunc(retVal___, bl, m, x, y, mobname, class_, event, size, ai);
}
}
return retVal___;
@@ -44450,14 +45295,14 @@ struct mob_data* HP_mob_once_spawn_sub(struct block_list *bl, int16 m, int16 x,
int HP_mob_once_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_once_spawn_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int16 *m, int16 *x, int16 *y, const char *mobname, int *class_, int *amount, const char *event, unsigned int *size, unsigned int *ai);
+ if (HPMHooks.count.HP_mob_once_spawn_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y, const char **mobname, int *class_, int *amount, const char **event, unsigned int *size, unsigned int *ai);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_once_spawn_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &m, &x, &y, mobname, &class_, &amount, event, &size, &ai);
+ retVal___ = preHookFunc(&sd, &m, &x, &y, &mobname, &class_, &amount, &event, &size, &ai);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44465,11 +45310,11 @@ int HP_mob_once_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, co
{
retVal___ = HPMHooks.source.mob.once_spawn(sd, m, x, y, mobname, class_, amount, event, size, ai);
}
- if( HPMHooks.count.HP_mob_once_spawn_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 *m, int16 *x, int16 *y, const char *mobname, int *class_, int *amount, const char *event, unsigned int *size, unsigned int *ai);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_once_spawn_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_once_spawn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &m, &x, &y, mobname, &class_, &amount, event, &size, &ai);
+ retVal___ = postHookFunc(retVal___, sd, m, x, y, mobname, class_, amount, event, size, ai);
}
}
return retVal___;
@@ -44477,14 +45322,14 @@ int HP_mob_once_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, co
int HP_mob_once_spawn_area(struct map_session_data *sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_once_spawn_area_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, const char *mobname, int *class_, int *amount, const char *event, unsigned int *size, unsigned int *ai);
+ if (HPMHooks.count.HP_mob_once_spawn_area_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, const char **mobname, int *class_, int *amount, const char **event, unsigned int *size, unsigned int *ai);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_area_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_once_spawn_area_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &m, &x0, &y0, &x1, &y1, mobname, &class_, &amount, event, &size, &ai);
+ retVal___ = preHookFunc(&sd, &m, &x0, &y0, &x1, &y1, &mobname, &class_, &amount, &event, &size, &ai);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44492,11 +45337,11 @@ int HP_mob_once_spawn_area(struct map_session_data *sd, int16 m, int16 x0, int16
{
retVal___ = HPMHooks.source.mob.once_spawn_area(sd, m, x0, y0, x1, y1, mobname, class_, amount, event, size, ai);
}
- if( HPMHooks.count.HP_mob_once_spawn_area_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, const char *mobname, int *class_, int *amount, const char *event, unsigned int *size, unsigned int *ai);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_area_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_once_spawn_area_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, const char *mobname, int class_, int amount, const char *event, unsigned int size, unsigned int ai);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_once_spawn_area_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_once_spawn_area_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &m, &x0, &y0, &x1, &y1, mobname, &class_, &amount, event, &size, &ai);
+ retVal___ = postHookFunc(retVal___, sd, m, x0, y0, x1, y1, mobname, class_, amount, event, size, ai);
}
}
return retVal___;
@@ -44504,14 +45349,14 @@ int HP_mob_once_spawn_area(struct map_session_data *sd, int16 m, int16 x0, int16
int HP_mob_spawn_guardian(const char *mapname, short x, short y, const char *mobname, int class_, const char *event, int guardian, bool has_index) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_spawn_guardian_pre ) {
- int (*preHookFunc) (const char *mapname, short *x, short *y, const char *mobname, int *class_, const char *event, int *guardian, bool *has_index);
+ if (HPMHooks.count.HP_mob_spawn_guardian_pre > 0) {
+ int (*preHookFunc) (const char **mapname, short *x, short *y, const char **mobname, int *class_, const char **event, int *guardian, bool *has_index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_spawn_guardian_pre[hIndex].func;
- retVal___ = preHookFunc(mapname, &x, &y, mobname, &class_, event, &guardian, &has_index);
+ retVal___ = preHookFunc(&mapname, &x, &y, &mobname, &class_, &event, &guardian, &has_index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44519,11 +45364,11 @@ int HP_mob_spawn_guardian(const char *mapname, short x, short y, const char *mob
{
retVal___ = HPMHooks.source.mob.spawn_guardian(mapname, x, y, mobname, class_, event, guardian, has_index);
}
- if( HPMHooks.count.HP_mob_spawn_guardian_post ) {
- int (*postHookFunc) (int retVal___, const char *mapname, short *x, short *y, const char *mobname, int *class_, const char *event, int *guardian, bool *has_index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_spawn_guardian_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *mapname, short x, short y, const char *mobname, int class_, const char *event, int guardian, bool has_index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_guardian_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_spawn_guardian_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mapname, &x, &y, mobname, &class_, event, &guardian, &has_index);
+ retVal___ = postHookFunc(retVal___, mapname, x, y, mobname, class_, event, guardian, has_index);
}
}
return retVal___;
@@ -44531,14 +45376,14 @@ int HP_mob_spawn_guardian(const char *mapname, short x, short y, const char *mob
int HP_mob_spawn_bg(const char *mapname, short x, short y, const char *mobname, int class_, const char *event, unsigned int bg_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_spawn_bg_pre ) {
- int (*preHookFunc) (const char *mapname, short *x, short *y, const char *mobname, int *class_, const char *event, unsigned int *bg_id);
+ if (HPMHooks.count.HP_mob_spawn_bg_pre > 0) {
+ int (*preHookFunc) (const char **mapname, short *x, short *y, const char **mobname, int *class_, const char **event, unsigned int *bg_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_bg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_bg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_spawn_bg_pre[hIndex].func;
- retVal___ = preHookFunc(mapname, &x, &y, mobname, &class_, event, &bg_id);
+ retVal___ = preHookFunc(&mapname, &x, &y, &mobname, &class_, &event, &bg_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44546,11 +45391,11 @@ int HP_mob_spawn_bg(const char *mapname, short x, short y, const char *mobname,
{
retVal___ = HPMHooks.source.mob.spawn_bg(mapname, x, y, mobname, class_, event, bg_id);
}
- if( HPMHooks.count.HP_mob_spawn_bg_post ) {
- int (*postHookFunc) (int retVal___, const char *mapname, short *x, short *y, const char *mobname, int *class_, const char *event, unsigned int *bg_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_bg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_spawn_bg_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *mapname, short x, short y, const char *mobname, int class_, const char *event, unsigned int bg_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_bg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_spawn_bg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mapname, &x, &y, mobname, &class_, event, &bg_id);
+ retVal___ = postHookFunc(retVal___, mapname, x, y, mobname, class_, event, bg_id);
}
}
return retVal___;
@@ -44558,14 +45403,14 @@ int HP_mob_spawn_bg(const char *mapname, short x, short y, const char *mobname,
int HP_mob_can_reach(struct mob_data *md, struct block_list *bl, int range, int state) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_can_reach_pre ) {
- int (*preHookFunc) (struct mob_data *md, struct block_list *bl, int *range, int *state);
+ if (HPMHooks.count.HP_mob_can_reach_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, struct block_list **bl, int *range, int *state);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_reach_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_reach_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_can_reach_pre[hIndex].func;
- retVal___ = preHookFunc(md, bl, &range, &state);
+ retVal___ = preHookFunc(&md, &bl, &range, &state);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44573,11 +45418,11 @@ int HP_mob_can_reach(struct mob_data *md, struct block_list *bl, int range, int
{
retVal___ = HPMHooks.source.mob.can_reach(md, bl, range, state);
}
- if( HPMHooks.count.HP_mob_can_reach_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *bl, int *range, int *state);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_reach_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_can_reach_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *bl, int range, int state);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_reach_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_can_reach_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, bl, &range, &state);
+ retVal___ = postHookFunc(retVal___, md, bl, range, state);
}
}
return retVal___;
@@ -44585,16 +45430,16 @@ int HP_mob_can_reach(struct mob_data *md, struct block_list *bl, int range, int
int HP_mob_linksearch(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_linksearch_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_linksearch_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_linksearch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_linksearch_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_linksearch_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44604,9 +45449,9 @@ int HP_mob_linksearch(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.linksearch(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_linksearch_post ) {
+ if (HPMHooks.count.HP_mob_linksearch_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_linksearch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_linksearch_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_linksearch_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44618,14 +45463,14 @@ int HP_mob_linksearch(struct block_list *bl, va_list ap) {
int HP_mob_delayspawn(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_delayspawn_pre ) {
+ if (HPMHooks.count.HP_mob_delayspawn_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_delayspawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_delayspawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_delayspawn_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44633,11 +45478,11 @@ int HP_mob_delayspawn(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.delayspawn(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_delayspawn_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_delayspawn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_delayspawn_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_delayspawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_delayspawn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -44645,14 +45490,14 @@ int HP_mob_delayspawn(int tid, int64 tick, int id, intptr_t data) {
int HP_mob_setdelayspawn(struct mob_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_setdelayspawn_pre ) {
- int (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_mob_setdelayspawn_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdelayspawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdelayspawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_setdelayspawn_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44660,9 +45505,9 @@ int HP_mob_setdelayspawn(struct mob_data *md) {
{
retVal___ = HPMHooks.source.mob.setdelayspawn(md);
}
- if( HPMHooks.count.HP_mob_setdelayspawn_post ) {
+ if (HPMHooks.count.HP_mob_setdelayspawn_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdelayspawn_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdelayspawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_setdelayspawn_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -44672,16 +45517,16 @@ int HP_mob_setdelayspawn(struct mob_data *md) {
int HP_mob_count_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_count_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_count_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_count_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_count_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_count_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44691,9 +45536,9 @@ int HP_mob_count_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.count_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_count_sub_post ) {
+ if (HPMHooks.count.HP_mob_count_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_count_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_count_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_count_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44705,14 +45550,14 @@ int HP_mob_count_sub(struct block_list *bl, va_list ap) {
int HP_mob_spawn(struct mob_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_spawn_pre ) {
- int (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_mob_spawn_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_spawn_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44720,26 +45565,26 @@ int HP_mob_spawn(struct mob_data *md) {
{
retVal___ = HPMHooks.source.mob.spawn(md);
}
- if( HPMHooks.count.HP_mob_spawn_post ) {
+ if (HPMHooks.count.HP_mob_spawn_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_spawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_spawn_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
}
return retVal___;
}
-int HP_mob_can_changetarget(struct mob_data *md, struct block_list *target, int mode) {
+int HP_mob_can_changetarget(const struct mob_data *md, const struct block_list *target, uint32 mode) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_can_changetarget_pre ) {
- int (*preHookFunc) (struct mob_data *md, struct block_list *target, int *mode);
+ if (HPMHooks.count.HP_mob_can_changetarget_pre > 0) {
+ int (*preHookFunc) (const struct mob_data **md, const struct block_list **target, uint32 *mode);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_changetarget_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_changetarget_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_can_changetarget_pre[hIndex].func;
- retVal___ = preHookFunc(md, target, &mode);
+ retVal___ = preHookFunc(&md, &target, &mode);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44747,11 +45592,11 @@ int HP_mob_can_changetarget(struct mob_data *md, struct block_list *target, int
{
retVal___ = HPMHooks.source.mob.can_changetarget(md, target, mode);
}
- if( HPMHooks.count.HP_mob_can_changetarget_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *target, int *mode);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_changetarget_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_can_changetarget_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct mob_data *md, const struct block_list *target, uint32 mode);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_can_changetarget_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_can_changetarget_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, target, &mode);
+ retVal___ = postHookFunc(retVal___, md, target, mode);
}
}
return retVal___;
@@ -44759,14 +45604,14 @@ int HP_mob_can_changetarget(struct mob_data *md, struct block_list *target, int
int HP_mob_target(struct mob_data *md, struct block_list *bl, int dist) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_target_pre ) {
- int (*preHookFunc) (struct mob_data *md, struct block_list *bl, int *dist);
+ if (HPMHooks.count.HP_mob_target_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, struct block_list **bl, int *dist);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_target_pre[hIndex].func;
- retVal___ = preHookFunc(md, bl, &dist);
+ retVal___ = preHookFunc(&md, &bl, &dist);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44774,11 +45619,11 @@ int HP_mob_target(struct mob_data *md, struct block_list *bl, int dist) {
{
retVal___ = HPMHooks.source.mob.target(md, bl, dist);
}
- if( HPMHooks.count.HP_mob_target_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *bl, int *dist);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_target_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_target_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *bl, int dist);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_target_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, bl, &dist);
+ retVal___ = postHookFunc(retVal___, md, bl, dist);
}
}
return retVal___;
@@ -44786,16 +45631,16 @@ int HP_mob_target(struct mob_data *md, struct block_list *bl, int dist) {
int HP_mob_ai_sub_hard_activesearch(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_hard_activesearch_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_activesearch_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_activesearch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_activesearch_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_activesearch_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44805,9 +45650,9 @@ int HP_mob_ai_sub_hard_activesearch(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.ai_sub_hard_activesearch(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_activesearch_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_activesearch_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_activesearch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_activesearch_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_activesearch_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44819,16 +45664,16 @@ int HP_mob_ai_sub_hard_activesearch(struct block_list *bl, va_list ap) {
int HP_mob_ai_sub_hard_changechase(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_hard_changechase_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_changechase_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_changechase_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_changechase_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_changechase_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44838,9 +45683,9 @@ int HP_mob_ai_sub_hard_changechase(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.ai_sub_hard_changechase(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_changechase_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_changechase_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_changechase_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_changechase_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_changechase_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44852,16 +45697,16 @@ int HP_mob_ai_sub_hard_changechase(struct block_list *bl, va_list ap) {
int HP_mob_ai_sub_hard_bg_ally(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_bg_ally_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44871,9 +45716,9 @@ int HP_mob_ai_sub_hard_bg_ally(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.ai_sub_hard_bg_ally(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_bg_ally_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_bg_ally_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44885,16 +45730,16 @@ int HP_mob_ai_sub_hard_bg_ally(struct block_list *bl, va_list ap) {
int HP_mob_ai_sub_hard_lootsearch(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_lootsearch_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44904,9 +45749,9 @@ int HP_mob_ai_sub_hard_lootsearch(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.ai_sub_hard_lootsearch(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_lootsearch_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_lootsearch_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44918,16 +45763,16 @@ int HP_mob_ai_sub_hard_lootsearch(struct block_list *bl, va_list ap) {
int HP_mob_warpchase_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_warpchase_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_warpchase_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_warpchase_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44937,9 +45782,9 @@ int HP_mob_warpchase_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.warpchase_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_warpchase_sub_post ) {
+ if (HPMHooks.count.HP_mob_warpchase_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_warpchase_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -44951,14 +45796,14 @@ int HP_mob_warpchase_sub(struct block_list *bl, va_list ap) {
int HP_mob_ai_sub_hard_slavemob(struct mob_data *md, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_hard_slavemob_pre ) {
- int (*preHookFunc) (struct mob_data *md, int64 *tick);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_slavemob_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_slavemob_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_slavemob_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_slavemob_pre[hIndex].func;
- retVal___ = preHookFunc(md, &tick);
+ retVal___ = preHookFunc(&md, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44966,11 +45811,11 @@ int HP_mob_ai_sub_hard_slavemob(struct mob_data *md, int64 tick) {
{
retVal___ = HPMHooks.source.mob.ai_sub_hard_slavemob(md, tick);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_slavemob_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_slavemob_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_slavemob_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_slavemob_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_slavemob_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &tick);
+ retVal___ = postHookFunc(retVal___, md, tick);
}
}
return retVal___;
@@ -44978,14 +45823,14 @@ int HP_mob_ai_sub_hard_slavemob(struct mob_data *md, int64 tick) {
int HP_mob_unlocktarget(struct mob_data *md, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_unlocktarget_pre ) {
- int (*preHookFunc) (struct mob_data *md, int64 *tick);
+ if (HPMHooks.count.HP_mob_unlocktarget_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_unlocktarget_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_unlocktarget_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_unlocktarget_pre[hIndex].func;
- retVal___ = preHookFunc(md, &tick);
+ retVal___ = preHookFunc(&md, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -44993,11 +45838,11 @@ int HP_mob_unlocktarget(struct mob_data *md, int64 tick) {
{
retVal___ = HPMHooks.source.mob.unlocktarget(md, tick);
}
- if( HPMHooks.count.HP_mob_unlocktarget_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_unlocktarget_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_unlocktarget_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_unlocktarget_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_unlocktarget_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &tick);
+ retVal___ = postHookFunc(retVal___, md, tick);
}
}
return retVal___;
@@ -45005,14 +45850,14 @@ int HP_mob_unlocktarget(struct mob_data *md, int64 tick) {
int HP_mob_randomwalk(struct mob_data *md, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_randomwalk_pre ) {
- int (*preHookFunc) (struct mob_data *md, int64 *tick);
+ if (HPMHooks.count.HP_mob_randomwalk_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_randomwalk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_randomwalk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_randomwalk_pre[hIndex].func;
- retVal___ = preHookFunc(md, &tick);
+ retVal___ = preHookFunc(&md, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45020,11 +45865,11 @@ int HP_mob_randomwalk(struct mob_data *md, int64 tick) {
{
retVal___ = HPMHooks.source.mob.randomwalk(md, tick);
}
- if( HPMHooks.count.HP_mob_randomwalk_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_randomwalk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_randomwalk_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_randomwalk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_randomwalk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &tick);
+ retVal___ = postHookFunc(retVal___, md, tick);
}
}
return retVal___;
@@ -45032,14 +45877,14 @@ int HP_mob_randomwalk(struct mob_data *md, int64 tick) {
int HP_mob_warpchase(struct mob_data *md, struct block_list *target) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_warpchase_pre ) {
- int (*preHookFunc) (struct mob_data *md, struct block_list *target);
+ if (HPMHooks.count.HP_mob_warpchase_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, struct block_list **target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_warpchase_pre[hIndex].func;
- retVal___ = preHookFunc(md, target);
+ retVal___ = preHookFunc(&md, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45047,9 +45892,9 @@ int HP_mob_warpchase(struct mob_data *md, struct block_list *target) {
{
retVal___ = HPMHooks.source.mob.warpchase(md, target);
}
- if( HPMHooks.count.HP_mob_warpchase_post ) {
+ if (HPMHooks.count.HP_mob_warpchase_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpchase_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_warpchase_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md, target);
}
@@ -45059,14 +45904,14 @@ int HP_mob_warpchase(struct mob_data *md, struct block_list *target) {
bool HP_mob_ai_sub_hard(struct mob_data *md, int64 tick) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_ai_sub_hard_pre ) {
- bool (*preHookFunc) (struct mob_data *md, int64 *tick);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_pre > 0) {
+ bool (*preHookFunc) (struct mob_data **md, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_pre[hIndex].func;
- retVal___ = preHookFunc(md, &tick);
+ retVal___ = preHookFunc(&md, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45074,11 +45919,11 @@ bool HP_mob_ai_sub_hard(struct mob_data *md, int64 tick) {
{
retVal___ = HPMHooks.source.mob.ai_sub_hard(md, tick);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_post ) {
- bool (*postHookFunc) (bool retVal___, struct mob_data *md, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct mob_data *md, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &tick);
+ retVal___ = postHookFunc(retVal___, md, tick);
}
}
return retVal___;
@@ -45086,16 +45931,16 @@ bool HP_mob_ai_sub_hard(struct mob_data *md, int64 tick) {
int HP_mob_ai_sub_hard_timer(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_hard_timer_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_ai_sub_hard_timer_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_timer_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_timer_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45105,9 +45950,9 @@ int HP_mob_ai_sub_hard_timer(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.ai_sub_hard_timer(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_hard_timer_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_hard_timer_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_timer_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_hard_timer_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_hard_timer_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -45119,16 +45964,16 @@ int HP_mob_ai_sub_hard_timer(struct block_list *bl, va_list ap) {
int HP_mob_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_foreachclient_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_mob_ai_sub_foreachclient_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_foreachclient_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_foreachclient_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_foreachclient_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45138,9 +45983,9 @@ int HP_mob_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
retVal___ = HPMHooks.source.mob.ai_sub_foreachclient(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_foreachclient_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_foreachclient_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_foreachclient_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_foreachclient_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_foreachclient_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -45152,16 +45997,16 @@ int HP_mob_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int HP_mob_ai_sub_lazy(struct mob_data *md, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_sub_lazy_pre ) {
- int (*preHookFunc) (struct mob_data *md, va_list args);
+ if (HPMHooks.count.HP_mob_ai_sub_lazy_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_lazy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_lazy_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_mob_ai_sub_lazy_pre[hIndex].func;
- retVal___ = preHookFunc(md, args___copy);
+ retVal___ = preHookFunc(&md, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45171,9 +46016,9 @@ int HP_mob_ai_sub_lazy(struct mob_data *md, va_list args) {
retVal___ = HPMHooks.source.mob.ai_sub_lazy(md, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_mob_ai_sub_lazy_post ) {
+ if (HPMHooks.count.HP_mob_ai_sub_lazy_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_lazy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_sub_lazy_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_mob_ai_sub_lazy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md, args___copy);
@@ -45185,14 +46030,14 @@ int HP_mob_ai_sub_lazy(struct mob_data *md, va_list args) {
int HP_mob_ai_lazy(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_lazy_pre ) {
+ if (HPMHooks.count.HP_mob_ai_lazy_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_lazy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_lazy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_ai_lazy_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45200,11 +46045,11 @@ int HP_mob_ai_lazy(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.ai_lazy(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_ai_lazy_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_lazy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_ai_lazy_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_lazy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_ai_lazy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -45212,14 +46057,14 @@ int HP_mob_ai_lazy(int tid, int64 tick, int id, intptr_t data) {
int HP_mob_ai_hard(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_ai_hard_pre ) {
+ if (HPMHooks.count.HP_mob_ai_hard_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_hard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_hard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_ai_hard_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45227,11 +46072,11 @@ int HP_mob_ai_hard(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.ai_hard(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_ai_hard_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_hard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_ai_hard_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_ai_hard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_ai_hard_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -45239,14 +46084,14 @@ int HP_mob_ai_hard(int tid, int64 tick, int id, intptr_t data) {
struct item_drop* HP_mob_setdropitem(int nameid, int qty, struct item_data *data) {
int hIndex = 0;
struct item_drop* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_setdropitem_pre ) {
- struct item_drop* (*preHookFunc) (int *nameid, int *qty, struct item_data *data);
+ if (HPMHooks.count.HP_mob_setdropitem_pre > 0) {
+ struct item_drop* (*preHookFunc) (int *nameid, int *qty, struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdropitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdropitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_setdropitem_pre[hIndex].func;
- retVal___ = preHookFunc(&nameid, &qty, data);
+ retVal___ = preHookFunc(&nameid, &qty, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45254,11 +46099,11 @@ struct item_drop* HP_mob_setdropitem(int nameid, int qty, struct item_data *data
{
retVal___ = HPMHooks.source.mob.setdropitem(nameid, qty, data);
}
- if( HPMHooks.count.HP_mob_setdropitem_post ) {
- struct item_drop* (*postHookFunc) (struct item_drop* retVal___, int *nameid, int *qty, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdropitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_setdropitem_post > 0) {
+ struct item_drop* (*postHookFunc) (struct item_drop* retVal___, int nameid, int qty, struct item_data *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setdropitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_setdropitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &nameid, &qty, data);
+ retVal___ = postHookFunc(retVal___, nameid, qty, data);
}
}
return retVal___;
@@ -45266,14 +46111,14 @@ struct item_drop* HP_mob_setdropitem(int nameid, int qty, struct item_data *data
struct item_drop* HP_mob_setlootitem(struct item *item) {
int hIndex = 0;
struct item_drop* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_setlootitem_pre ) {
- struct item_drop* (*preHookFunc) (struct item *item);
+ if (HPMHooks.count.HP_mob_setlootitem_pre > 0) {
+ struct item_drop* (*preHookFunc) (struct item **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_setlootitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setlootitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_setlootitem_pre[hIndex].func;
- retVal___ = preHookFunc(item);
+ retVal___ = preHookFunc(&item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45281,9 +46126,9 @@ struct item_drop* HP_mob_setlootitem(struct item *item) {
{
retVal___ = HPMHooks.source.mob.setlootitem(item);
}
- if( HPMHooks.count.HP_mob_setlootitem_post ) {
+ if (HPMHooks.count.HP_mob_setlootitem_post > 0) {
struct item_drop* (*postHookFunc) (struct item_drop* retVal___, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_setlootitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_setlootitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_setlootitem_post[hIndex].func;
retVal___ = postHookFunc(retVal___, item);
}
@@ -45293,14 +46138,14 @@ struct item_drop* HP_mob_setlootitem(struct item *item) {
int HP_mob_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_delay_item_drop_pre ) {
+ if (HPMHooks.count.HP_mob_delay_item_drop_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_delay_item_drop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_delay_item_drop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_delay_item_drop_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45308,25 +46153,25 @@ int HP_mob_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.delay_item_drop(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_delay_item_drop_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_delay_item_drop_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_delay_item_drop_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_delay_item_drop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_delay_item_drop_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int loot, int drop_rate, unsigned short flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_item_drop_pre ) {
- void (*preHookFunc) (struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int *loot, int *drop_rate, unsigned short *flag);
+ if (HPMHooks.count.HP_mob_item_drop_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, struct item_drop_list **dlist, struct item_drop **ditem, int *loot, int *drop_rate, unsigned short *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_drop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_drop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_item_drop_pre[hIndex].func;
- preHookFunc(md, dlist, ditem, &loot, &drop_rate, &flag);
+ preHookFunc(&md, &dlist, &ditem, &loot, &drop_rate, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -45334,11 +46179,11 @@ void HP_mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct
{
HPMHooks.source.mob.item_drop(md, dlist, ditem, loot, drop_rate, flag);
}
- if( HPMHooks.count.HP_mob_item_drop_post ) {
- void (*postHookFunc) (struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int *loot, int *drop_rate, unsigned short *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_drop_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_item_drop_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int loot, int drop_rate, unsigned short flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_drop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_item_drop_post[hIndex].func;
- postHookFunc(md, dlist, ditem, &loot, &drop_rate, &flag);
+ postHookFunc(md, dlist, ditem, loot, drop_rate, flag);
}
}
return;
@@ -45346,14 +46191,14 @@ void HP_mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct
int HP_mob_timer_delete(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_timer_delete_pre ) {
+ if (HPMHooks.count.HP_mob_timer_delete_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_timer_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_timer_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_timer_delete_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45361,11 +46206,11 @@ int HP_mob_timer_delete(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.timer_delete(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_timer_delete_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_timer_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_timer_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_timer_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_timer_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -45373,16 +46218,16 @@ int HP_mob_timer_delete(int tid, int64 tick, int id, intptr_t data) {
int HP_mob_deleteslave_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_deleteslave_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_deleteslave_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_deleteslave_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45392,9 +46237,9 @@ int HP_mob_deleteslave_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.deleteslave_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_deleteslave_sub_post ) {
+ if (HPMHooks.count.HP_mob_deleteslave_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_deleteslave_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -45406,14 +46251,14 @@ int HP_mob_deleteslave_sub(struct block_list *bl, va_list ap) {
int HP_mob_deleteslave(struct mob_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_deleteslave_pre ) {
- int (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_mob_deleteslave_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_deleteslave_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45421,9 +46266,9 @@ int HP_mob_deleteslave(struct mob_data *md) {
{
retVal___ = HPMHooks.source.mob.deleteslave(md);
}
- if( HPMHooks.count.HP_mob_deleteslave_post ) {
+ if (HPMHooks.count.HP_mob_deleteslave_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_deleteslave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_deleteslave_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -45433,14 +46278,14 @@ int HP_mob_deleteslave(struct mob_data *md) {
int HP_mob_respawn(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_respawn_pre ) {
+ if (HPMHooks.count.HP_mob_respawn_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_respawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_respawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_respawn_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45448,25 +46293,25 @@ int HP_mob_respawn(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.mob.respawn(tid, tick, id, data);
}
- if( HPMHooks.count.HP_mob_respawn_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_respawn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_respawn_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_respawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_respawn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_mob_log_damage(struct mob_data *md, struct block_list *src, int damage) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_log_damage_pre ) {
- void (*preHookFunc) (struct mob_data *md, struct block_list *src, int *damage);
+ if (HPMHooks.count.HP_mob_log_damage_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, struct block_list **src, int *damage);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_log_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_log_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_log_damage_pre[hIndex].func;
- preHookFunc(md, src, &damage);
+ preHookFunc(&md, &src, &damage);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -45474,25 +46319,25 @@ void HP_mob_log_damage(struct mob_data *md, struct block_list *src, int damage)
{
HPMHooks.source.mob.log_damage(md, src, damage);
}
- if( HPMHooks.count.HP_mob_log_damage_post ) {
- void (*postHookFunc) (struct mob_data *md, struct block_list *src, int *damage);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_log_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_log_damage_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, struct block_list *src, int damage);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_log_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_log_damage_post[hIndex].func;
- postHookFunc(md, src, &damage);
+ postHookFunc(md, src, damage);
}
}
return;
}
void HP_mob_damage(struct mob_data *md, struct block_list *src, int damage) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_damage_pre ) {
- void (*preHookFunc) (struct mob_data *md, struct block_list *src, int *damage);
+ if (HPMHooks.count.HP_mob_damage_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, struct block_list **src, int *damage);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_damage_pre[hIndex].func;
- preHookFunc(md, src, &damage);
+ preHookFunc(&md, &src, &damage);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -45500,11 +46345,11 @@ void HP_mob_damage(struct mob_data *md, struct block_list *src, int damage) {
{
HPMHooks.source.mob.damage(md, src, damage);
}
- if( HPMHooks.count.HP_mob_damage_post ) {
- void (*postHookFunc) (struct mob_data *md, struct block_list *src, int *damage);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_damage_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, struct block_list *src, int damage);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_damage_post[hIndex].func;
- postHookFunc(md, src, &damage);
+ postHookFunc(md, src, damage);
}
}
return;
@@ -45512,14 +46357,14 @@ void HP_mob_damage(struct mob_data *md, struct block_list *src, int damage) {
int HP_mob_dead(struct mob_data *md, struct block_list *src, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_dead_pre ) {
- int (*preHookFunc) (struct mob_data *md, struct block_list *src, int *type);
+ if (HPMHooks.count.HP_mob_dead_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, struct block_list **src, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_dead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_dead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_dead_pre[hIndex].func;
- retVal___ = preHookFunc(md, src, &type);
+ retVal___ = preHookFunc(&md, &src, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45527,25 +46372,25 @@ int HP_mob_dead(struct mob_data *md, struct block_list *src, int type) {
{
retVal___ = HPMHooks.source.mob.dead(md, src, type);
}
- if( HPMHooks.count.HP_mob_dead_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *src, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_dead_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_dead_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *src, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_dead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_dead_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, src, &type);
+ retVal___ = postHookFunc(retVal___, md, src, type);
}
}
return retVal___;
}
void HP_mob_revive(struct mob_data *md, unsigned int hp) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_revive_pre ) {
- void (*preHookFunc) (struct mob_data *md, unsigned int *hp);
+ if (HPMHooks.count.HP_mob_revive_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, unsigned int *hp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_revive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_revive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_revive_pre[hIndex].func;
- preHookFunc(md, &hp);
+ preHookFunc(&md, &hp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -45553,11 +46398,11 @@ void HP_mob_revive(struct mob_data *md, unsigned int hp) {
{
HPMHooks.source.mob.revive(md, hp);
}
- if( HPMHooks.count.HP_mob_revive_post ) {
- void (*postHookFunc) (struct mob_data *md, unsigned int *hp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_revive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_revive_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, unsigned int hp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_revive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_revive_post[hIndex].func;
- postHookFunc(md, &hp);
+ postHookFunc(md, hp);
}
}
return;
@@ -45565,14 +46410,14 @@ void HP_mob_revive(struct mob_data *md, unsigned int hp) {
int HP_mob_guardian_guildchange(struct mob_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_guardian_guildchange_pre ) {
- int (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_mob_guardian_guildchange_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_guardian_guildchange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_guardian_guildchange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_guardian_guildchange_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45580,9 +46425,9 @@ int HP_mob_guardian_guildchange(struct mob_data *md) {
{
retVal___ = HPMHooks.source.mob.guardian_guildchange(md);
}
- if( HPMHooks.count.HP_mob_guardian_guildchange_post ) {
+ if (HPMHooks.count.HP_mob_guardian_guildchange_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_guardian_guildchange_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_guardian_guildchange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_guardian_guildchange_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -45592,14 +46437,14 @@ int HP_mob_guardian_guildchange(struct mob_data *md) {
int HP_mob_random_class(int *value, size_t count) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_random_class_pre ) {
- int (*preHookFunc) (int *value, size_t *count);
+ if (HPMHooks.count.HP_mob_random_class_pre > 0) {
+ int (*preHookFunc) (int **value, size_t *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_random_class_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_random_class_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_random_class_pre[hIndex].func;
- retVal___ = preHookFunc(value, &count);
+ retVal___ = preHookFunc(&value, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45607,11 +46452,11 @@ int HP_mob_random_class(int *value, size_t count) {
{
retVal___ = HPMHooks.source.mob.random_class(value, count);
}
- if( HPMHooks.count.HP_mob_random_class_post ) {
- int (*postHookFunc) (int retVal___, int *value, size_t *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_random_class_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_random_class_post > 0) {
+ int (*postHookFunc) (int retVal___, int *value, size_t count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_random_class_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_random_class_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, value, &count);
+ retVal___ = postHookFunc(retVal___, value, count);
}
}
return retVal___;
@@ -45619,14 +46464,14 @@ int HP_mob_random_class(int *value, size_t count) {
int HP_mob_class_change(struct mob_data *md, int class_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_class_change_pre ) {
- int (*preHookFunc) (struct mob_data *md, int *class_);
+ if (HPMHooks.count.HP_mob_class_change_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_class_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_class_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_class_change_pre[hIndex].func;
- retVal___ = preHookFunc(md, &class_);
+ retVal___ = preHookFunc(&md, &class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45634,25 +46479,25 @@ int HP_mob_class_change(struct mob_data *md, int class_) {
{
retVal___ = HPMHooks.source.mob.class_change(md, class_);
}
- if( HPMHooks.count.HP_mob_class_change_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_class_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_class_change_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_class_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_class_change_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &class_);
+ retVal___ = postHookFunc(retVal___, md, class_);
}
}
return retVal___;
}
void HP_mob_heal(struct mob_data *md, unsigned int heal) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_heal_pre ) {
- void (*preHookFunc) (struct mob_data *md, unsigned int *heal);
+ if (HPMHooks.count.HP_mob_heal_pre > 0) {
+ void (*preHookFunc) (struct mob_data **md, unsigned int *heal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_heal_pre[hIndex].func;
- preHookFunc(md, &heal);
+ preHookFunc(&md, &heal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -45660,11 +46505,11 @@ void HP_mob_heal(struct mob_data *md, unsigned int heal) {
{
HPMHooks.source.mob.heal(md, heal);
}
- if( HPMHooks.count.HP_mob_heal_post ) {
- void (*postHookFunc) (struct mob_data *md, unsigned int *heal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_heal_post > 0) {
+ void (*postHookFunc) (struct mob_data *md, unsigned int heal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_heal_post[hIndex].func;
- postHookFunc(md, &heal);
+ postHookFunc(md, heal);
}
}
return;
@@ -45672,16 +46517,16 @@ void HP_mob_heal(struct mob_data *md, unsigned int heal) {
int HP_mob_warpslave_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_warpslave_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_warpslave_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_warpslave_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45691,9 +46536,9 @@ int HP_mob_warpslave_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.warpslave_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_warpslave_sub_post ) {
+ if (HPMHooks.count.HP_mob_warpslave_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_warpslave_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -45705,14 +46550,14 @@ int HP_mob_warpslave_sub(struct block_list *bl, va_list ap) {
int HP_mob_warpslave(struct block_list *bl, int range) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_warpslave_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *range);
+ if (HPMHooks.count.HP_mob_warpslave_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *range);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_warpslave_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &range);
+ retVal___ = preHookFunc(&bl, &range);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45720,11 +46565,11 @@ int HP_mob_warpslave(struct block_list *bl, int range) {
{
retVal___ = HPMHooks.source.mob.warpslave(bl, range);
}
- if( HPMHooks.count.HP_mob_warpslave_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *range);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_warpslave_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int range);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_warpslave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_warpslave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &range);
+ retVal___ = postHookFunc(retVal___, bl, range);
}
}
return retVal___;
@@ -45732,16 +46577,16 @@ int HP_mob_warpslave(struct block_list *bl, int range) {
int HP_mob_countslave_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_countslave_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_countslave_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_countslave_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45751,9 +46596,9 @@ int HP_mob_countslave_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.countslave_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_countslave_sub_post ) {
+ if (HPMHooks.count.HP_mob_countslave_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_countslave_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -45765,14 +46610,14 @@ int HP_mob_countslave_sub(struct block_list *bl, va_list ap) {
int HP_mob_countslave(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_countslave_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_mob_countslave_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_countslave_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45780,9 +46625,9 @@ int HP_mob_countslave(struct block_list *bl) {
{
retVal___ = HPMHooks.source.mob.countslave(bl);
}
- if( HPMHooks.count.HP_mob_countslave_post ) {
+ if (HPMHooks.count.HP_mob_countslave_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_countslave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_countslave_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -45792,14 +46637,14 @@ int HP_mob_countslave(struct block_list *bl) {
int HP_mob_summonslave(struct mob_data *md2, int *value, int amount, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_summonslave_pre ) {
- int (*preHookFunc) (struct mob_data *md2, int *value, int *amount, uint16 *skill_id);
+ if (HPMHooks.count.HP_mob_summonslave_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md2, int **value, int *amount, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_summonslave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_summonslave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_summonslave_pre[hIndex].func;
- retVal___ = preHookFunc(md2, value, &amount, &skill_id);
+ retVal___ = preHookFunc(&md2, &value, &amount, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45807,11 +46652,11 @@ int HP_mob_summonslave(struct mob_data *md2, int *value, int amount, uint16 skil
{
retVal___ = HPMHooks.source.mob.summonslave(md2, value, amount, skill_id);
}
- if( HPMHooks.count.HP_mob_summonslave_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md2, int *value, int *amount, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_summonslave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_summonslave_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md2, int *value, int amount, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_summonslave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_summonslave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md2, value, &amount, &skill_id);
+ retVal___ = postHookFunc(retVal___, md2, value, amount, skill_id);
}
}
return retVal___;
@@ -45819,16 +46664,16 @@ int HP_mob_summonslave(struct mob_data *md2, int *value, int amount, uint16 skil
int HP_mob_getfriendhprate_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_getfriendhprate_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_getfriendhprate_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_getfriendhprate_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45838,9 +46683,9 @@ int HP_mob_getfriendhprate_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.getfriendhprate_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_getfriendhprate_sub_post ) {
+ if (HPMHooks.count.HP_mob_getfriendhprate_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_getfriendhprate_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -45852,14 +46697,14 @@ int HP_mob_getfriendhprate_sub(struct block_list *bl, va_list ap) {
struct block_list* HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int max_rate) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_getfriendhprate_pre ) {
- struct block_list* (*preHookFunc) (struct mob_data *md, int *min_rate, int *max_rate);
+ if (HPMHooks.count.HP_mob_getfriendhprate_pre > 0) {
+ struct block_list* (*preHookFunc) (struct mob_data **md, int *min_rate, int *max_rate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_getfriendhprate_pre[hIndex].func;
- retVal___ = preHookFunc(md, &min_rate, &max_rate);
+ retVal___ = preHookFunc(&md, &min_rate, &max_rate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45867,11 +46712,11 @@ struct block_list* HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int
{
retVal___ = HPMHooks.source.mob.getfriendhprate(md, min_rate, max_rate);
}
- if( HPMHooks.count.HP_mob_getfriendhprate_post ) {
- struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int *min_rate, int *max_rate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_getfriendhprate_post > 0) {
+ struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int min_rate, int max_rate);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendhprate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_getfriendhprate_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &min_rate, &max_rate);
+ retVal___ = postHookFunc(retVal___, md, min_rate, max_rate);
}
}
return retVal___;
@@ -45879,14 +46724,14 @@ struct block_list* HP_mob_getfriendhprate(struct mob_data *md, int min_rate, int
struct block_list* HP_mob_getmasterhpltmaxrate(struct mob_data *md, int rate) {
int hIndex = 0;
struct block_list* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_getmasterhpltmaxrate_pre ) {
- struct block_list* (*preHookFunc) (struct mob_data *md, int *rate);
+ if (HPMHooks.count.HP_mob_getmasterhpltmaxrate_pre > 0) {
+ struct block_list* (*preHookFunc) (struct mob_data **md, int *rate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getmasterhpltmaxrate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getmasterhpltmaxrate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_getmasterhpltmaxrate_pre[hIndex].func;
- retVal___ = preHookFunc(md, &rate);
+ retVal___ = preHookFunc(&md, &rate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45894,11 +46739,11 @@ struct block_list* HP_mob_getmasterhpltmaxrate(struct mob_data *md, int rate) {
{
retVal___ = HPMHooks.source.mob.getmasterhpltmaxrate(md, rate);
}
- if( HPMHooks.count.HP_mob_getmasterhpltmaxrate_post ) {
- struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int *rate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getmasterhpltmaxrate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_getmasterhpltmaxrate_post > 0) {
+ struct block_list* (*postHookFunc) (struct block_list* retVal___, struct mob_data *md, int rate);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getmasterhpltmaxrate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_getmasterhpltmaxrate_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &rate);
+ retVal___ = postHookFunc(retVal___, md, rate);
}
}
return retVal___;
@@ -45906,16 +46751,16 @@ struct block_list* HP_mob_getmasterhpltmaxrate(struct mob_data *md, int rate) {
int HP_mob_getfriendstatus_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_getfriendstatus_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_mob_getfriendstatus_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_mob_getfriendstatus_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45925,9 +46770,9 @@ int HP_mob_getfriendstatus_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.mob.getfriendstatus_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_mob_getfriendstatus_sub_post ) {
+ if (HPMHooks.count.HP_mob_getfriendstatus_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_mob_getfriendstatus_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -45939,14 +46784,14 @@ int HP_mob_getfriendstatus_sub(struct block_list *bl, va_list ap) {
struct mob_data* HP_mob_getfriendstatus(struct mob_data *md, int cond1, int cond2) {
int hIndex = 0;
struct mob_data* retVal___ = NULL;
- if( HPMHooks.count.HP_mob_getfriendstatus_pre ) {
- struct mob_data* (*preHookFunc) (struct mob_data *md, int *cond1, int *cond2);
+ if (HPMHooks.count.HP_mob_getfriendstatus_pre > 0) {
+ struct mob_data* (*preHookFunc) (struct mob_data **md, int *cond1, int *cond2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_getfriendstatus_pre[hIndex].func;
- retVal___ = preHookFunc(md, &cond1, &cond2);
+ retVal___ = preHookFunc(&md, &cond1, &cond2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45954,11 +46799,11 @@ struct mob_data* HP_mob_getfriendstatus(struct mob_data *md, int cond1, int cond
{
retVal___ = HPMHooks.source.mob.getfriendstatus(md, cond1, cond2);
}
- if( HPMHooks.count.HP_mob_getfriendstatus_post ) {
- struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct mob_data *md, int *cond1, int *cond2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_getfriendstatus_post > 0) {
+ struct mob_data* (*postHookFunc) (struct mob_data* retVal___, struct mob_data *md, int cond1, int cond2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_getfriendstatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_getfriendstatus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &cond1, &cond2);
+ retVal___ = postHookFunc(retVal___, md, cond1, cond2);
}
}
return retVal___;
@@ -45966,14 +46811,14 @@ struct mob_data* HP_mob_getfriendstatus(struct mob_data *md, int cond1, int cond
int HP_mob_skill_use(struct mob_data *md, int64 tick, int event) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_skill_use_pre ) {
- int (*preHookFunc) (struct mob_data *md, int64 *tick, int *event);
+ if (HPMHooks.count.HP_mob_skill_use_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, int64 *tick, int *event);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_use_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_use_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_skill_use_pre[hIndex].func;
- retVal___ = preHookFunc(md, &tick, &event);
+ retVal___ = preHookFunc(&md, &tick, &event);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -45981,11 +46826,11 @@ int HP_mob_skill_use(struct mob_data *md, int64 tick, int event) {
{
retVal___ = HPMHooks.source.mob.skill_use(md, tick, event);
}
- if( HPMHooks.count.HP_mob_skill_use_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, int64 *tick, int *event);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_use_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_skill_use_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, int64 tick, int event);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_use_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_skill_use_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &tick, &event);
+ retVal___ = postHookFunc(retVal___, md, tick, event);
}
}
return retVal___;
@@ -45993,14 +46838,14 @@ int HP_mob_skill_use(struct mob_data *md, int64 tick, int event) {
int HP_mob_skill_event(struct mob_data *md, struct block_list *src, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_skill_event_pre ) {
- int (*preHookFunc) (struct mob_data *md, struct block_list *src, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_mob_skill_event_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, struct block_list **src, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_skill_event_pre[hIndex].func;
- retVal___ = preHookFunc(md, src, &tick, &flag);
+ retVal___ = preHookFunc(&md, &src, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46008,11 +46853,11 @@ int HP_mob_skill_event(struct mob_data *md, struct block_list *src, int64 tick,
{
retVal___ = HPMHooks.source.mob.skill_event(md, src, tick, flag);
}
- if( HPMHooks.count.HP_mob_skill_event_post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *src, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_event_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_skill_event_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, struct block_list *src, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_skill_event_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, src, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, md, src, tick, flag);
}
}
return retVal___;
@@ -46020,14 +46865,14 @@ int HP_mob_skill_event(struct mob_data *md, struct block_list *src, int64 tick,
int HP_mob_is_clone(int class_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_is_clone_pre ) {
+ if (HPMHooks.count.HP_mob_is_clone_pre > 0) {
int (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_is_clone_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_is_clone_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_is_clone_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46035,26 +46880,26 @@ int HP_mob_is_clone(int class_) {
{
retVal___ = HPMHooks.source.mob.is_clone(class_);
}
- if( HPMHooks.count.HP_mob_is_clone_post ) {
- int (*postHookFunc) (int retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_is_clone_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_is_clone_post > 0) {
+ int (*postHookFunc) (int retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_is_clone_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_is_clone_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
}
-int HP_mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, int mode, int flag, unsigned int duration) {
+int HP_mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, uint32 mode, int flag, unsigned int duration) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_clone_spawn_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int16 *m, int16 *x, int16 *y, const char *event, int *master_id, int *mode, int *flag, unsigned int *duration);
+ if (HPMHooks.count.HP_mob_clone_spawn_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y, const char **event, int *master_id, uint32 *mode, int *flag, unsigned int *duration);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_spawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_spawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_clone_spawn_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &m, &x, &y, event, &master_id, &mode, &flag, &duration);
+ retVal___ = preHookFunc(&sd, &m, &x, &y, &event, &master_id, &mode, &flag, &duration);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46062,11 +46907,11 @@ int HP_mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, c
{
retVal___ = HPMHooks.source.mob.clone_spawn(sd, m, x, y, event, master_id, mode, flag, duration);
}
- if( HPMHooks.count.HP_mob_clone_spawn_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 *m, int16 *x, int16 *y, const char *event, int *master_id, int *mode, int *flag, unsigned int *duration);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_spawn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_clone_spawn_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y, const char *event, int master_id, uint32 mode, int flag, unsigned int duration);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_spawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_clone_spawn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &m, &x, &y, event, &master_id, &mode, &flag, &duration);
+ retVal___ = postHookFunc(retVal___, sd, m, x, y, event, master_id, mode, flag, duration);
}
}
return retVal___;
@@ -46074,14 +46919,14 @@ int HP_mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, c
int HP_mob_clone_delete(struct mob_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_clone_delete_pre ) {
- int (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_mob_clone_delete_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_clone_delete_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46089,9 +46934,9 @@ int HP_mob_clone_delete(struct mob_data *md) {
{
retVal___ = HPMHooks.source.mob.clone_delete(md);
}
- if( HPMHooks.count.HP_mob_clone_delete_post ) {
+ if (HPMHooks.count.HP_mob_clone_delete_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_delete_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_clone_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_clone_delete_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -46101,14 +46946,14 @@ int HP_mob_clone_delete(struct mob_data *md) {
unsigned int HP_mob_drop_adjust(int baserate, int rate_adjust, unsigned short rate_min, unsigned short rate_max) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_mob_drop_adjust_pre ) {
+ if (HPMHooks.count.HP_mob_drop_adjust_pre > 0) {
unsigned int (*preHookFunc) (int *baserate, int *rate_adjust, unsigned short *rate_min, unsigned short *rate_max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_drop_adjust_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_drop_adjust_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_drop_adjust_pre[hIndex].func;
retVal___ = preHookFunc(&baserate, &rate_adjust, &rate_min, &rate_max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46116,25 +46961,25 @@ unsigned int HP_mob_drop_adjust(int baserate, int rate_adjust, unsigned short ra
{
retVal___ = HPMHooks.source.mob.drop_adjust(baserate, rate_adjust, rate_min, rate_max);
}
- if( HPMHooks.count.HP_mob_drop_adjust_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, int *baserate, int *rate_adjust, unsigned short *rate_min, unsigned short *rate_max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_drop_adjust_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_drop_adjust_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, int baserate, int rate_adjust, unsigned short rate_min, unsigned short rate_max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_drop_adjust_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_drop_adjust_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &baserate, &rate_adjust, &rate_min, &rate_max);
+ retVal___ = postHookFunc(retVal___, baserate, rate_adjust, rate_min, rate_max);
}
}
return retVal___;
}
void HP_mob_item_dropratio_adjust(int nameid, int mob_id, int *rate_adjust) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_item_dropratio_adjust_pre ) {
- void (*preHookFunc) (int *nameid, int *mob_id, int *rate_adjust);
+ if (HPMHooks.count.HP_mob_item_dropratio_adjust_pre > 0) {
+ void (*preHookFunc) (int *nameid, int *mob_id, int **rate_adjust);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_dropratio_adjust_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_dropratio_adjust_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_item_dropratio_adjust_pre[hIndex].func;
- preHookFunc(&nameid, &mob_id, rate_adjust);
+ preHookFunc(&nameid, &mob_id, &rate_adjust);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46142,25 +46987,25 @@ void HP_mob_item_dropratio_adjust(int nameid, int mob_id, int *rate_adjust) {
{
HPMHooks.source.mob.item_dropratio_adjust(nameid, mob_id, rate_adjust);
}
- if( HPMHooks.count.HP_mob_item_dropratio_adjust_post ) {
- void (*postHookFunc) (int *nameid, int *mob_id, int *rate_adjust);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_dropratio_adjust_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_item_dropratio_adjust_post > 0) {
+ void (*postHookFunc) (int nameid, int mob_id, int *rate_adjust);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_item_dropratio_adjust_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_item_dropratio_adjust_post[hIndex].func;
- postHookFunc(&nameid, &mob_id, rate_adjust);
+ postHookFunc(nameid, mob_id, rate_adjust);
}
}
return;
}
void HP_mob_readdb(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_readdb_pre ) {
+ if (HPMHooks.count.HP_mob_readdb_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_readdb_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46168,26 +47013,26 @@ void HP_mob_readdb(void) {
{
HPMHooks.source.mob.readdb();
}
- if( HPMHooks.count.HP_mob_readdb_post ) {
+ if (HPMHooks.count.HP_mob_readdb_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_readdb_post[hIndex].func;
postHookFunc();
}
}
return;
}
-bool HP_mob_lookup_const(const config_setting_t *it, const char *name, int *value) {
+bool HP_mob_lookup_const(const struct config_setting_t *it, const char *name, int *value) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_lookup_const_pre ) {
- bool (*preHookFunc) (const config_setting_t *it, const char *name, int *value);
+ if (HPMHooks.count.HP_mob_lookup_const_pre > 0) {
+ bool (*preHookFunc) (const struct config_setting_t **it, const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_lookup_const_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_lookup_const_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_lookup_const_pre[hIndex].func;
- retVal___ = preHookFunc(it, name, value);
+ retVal___ = preHookFunc(&it, &name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46195,26 +47040,26 @@ bool HP_mob_lookup_const(const config_setting_t *it, const char *name, int *valu
{
retVal___ = HPMHooks.source.mob.lookup_const(it, name, value);
}
- if( HPMHooks.count.HP_mob_lookup_const_post ) {
- bool (*postHookFunc) (bool retVal___, const config_setting_t *it, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_lookup_const_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_lookup_const_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct config_setting_t *it, const char *name, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_lookup_const_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_lookup_const_post[hIndex].func;
retVal___ = postHookFunc(retVal___, it, name, value);
}
}
return retVal___;
}
-bool HP_mob_get_const(const config_setting_t *it, int *value) {
+bool HP_mob_get_const(const struct config_setting_t *it, int *value) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_get_const_pre ) {
- bool (*preHookFunc) (const config_setting_t *it, int *value);
+ if (HPMHooks.count.HP_mob_get_const_pre > 0) {
+ bool (*preHookFunc) (const struct config_setting_t **it, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_const_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_const_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_get_const_pre[hIndex].func;
- retVal___ = preHookFunc(it, value);
+ retVal___ = preHookFunc(&it, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46222,9 +47067,9 @@ bool HP_mob_get_const(const config_setting_t *it, int *value) {
{
retVal___ = HPMHooks.source.mob.get_const(it, value);
}
- if( HPMHooks.count.HP_mob_get_const_post ) {
- bool (*postHookFunc) (bool retVal___, const config_setting_t *it, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_const_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_get_const_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct config_setting_t *it, int *value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_const_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_get_const_post[hIndex].func;
retVal___ = postHookFunc(retVal___, it, value);
}
@@ -46234,14 +47079,14 @@ bool HP_mob_get_const(const config_setting_t *it, int *value) {
int HP_mob_db_validate_entry(struct mob_db *entry, int n, const char *source) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_db_validate_entry_pre ) {
- int (*preHookFunc) (struct mob_db *entry, int *n, const char *source);
+ if (HPMHooks.count.HP_mob_db_validate_entry_pre > 0) {
+ int (*preHookFunc) (struct mob_db **entry, int *n, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_validate_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_validate_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_db_validate_entry_pre[hIndex].func;
- retVal___ = preHookFunc(entry, &n, source);
+ retVal___ = preHookFunc(&entry, &n, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46249,11 +47094,11 @@ int HP_mob_db_validate_entry(struct mob_db *entry, int n, const char *source) {
{
retVal___ = HPMHooks.source.mob.db_validate_entry(entry, n, source);
}
- if( HPMHooks.count.HP_mob_db_validate_entry_post ) {
- int (*postHookFunc) (int retVal___, struct mob_db *entry, int *n, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_validate_entry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_db_validate_entry_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_db *entry, int n, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_db_validate_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_db_validate_entry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, entry, &n, source);
+ retVal___ = postHookFunc(retVal___, entry, n, source);
}
}
return retVal___;
@@ -46261,14 +47106,14 @@ int HP_mob_db_validate_entry(struct mob_db *entry, int n, const char *source) {
int HP_mob_read_libconfig(const char *filename, bool ignore_missing) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_read_libconfig_pre ) {
- int (*preHookFunc) (const char *filename, bool *ignore_missing);
+ if (HPMHooks.count.HP_mob_read_libconfig_pre > 0) {
+ int (*preHookFunc) (const char **filename, bool *ignore_missing);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_libconfig_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_libconfig_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_libconfig_pre[hIndex].func;
- retVal___ = preHookFunc(filename, &ignore_missing);
+ retVal___ = preHookFunc(&filename, &ignore_missing);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46276,25 +47121,25 @@ int HP_mob_read_libconfig(const char *filename, bool ignore_missing) {
{
retVal___ = HPMHooks.source.mob.read_libconfig(filename, ignore_missing);
}
- if( HPMHooks.count.HP_mob_read_libconfig_post ) {
- int (*postHookFunc) (int retVal___, const char *filename, bool *ignore_missing);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_libconfig_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_libconfig_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *filename, bool ignore_missing);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_libconfig_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_libconfig_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, filename, &ignore_missing);
+ retVal___ = postHookFunc(retVal___, filename, ignore_missing);
}
}
return retVal___;
}
-void HP_mob_read_db_additional_fields(struct mob_db *entry, config_setting_t *it, int n, const char *source) {
+void HP_mob_read_db_additional_fields(struct mob_db *entry, struct config_setting_t *it, int n, const char *source) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_read_db_additional_fields_pre ) {
- void (*preHookFunc) (struct mob_db *entry, config_setting_t *it, int *n, const char *source);
+ if (HPMHooks.count.HP_mob_read_db_additional_fields_pre > 0) {
+ void (*preHookFunc) (struct mob_db **entry, struct config_setting_t **it, int *n, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_additional_fields_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_additional_fields_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_db_additional_fields_pre[hIndex].func;
- preHookFunc(entry, it, &n, source);
+ preHookFunc(&entry, &it, &n, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46302,26 +47147,26 @@ void HP_mob_read_db_additional_fields(struct mob_db *entry, config_setting_t *it
{
HPMHooks.source.mob.read_db_additional_fields(entry, it, n, source);
}
- if( HPMHooks.count.HP_mob_read_db_additional_fields_post ) {
- void (*postHookFunc) (struct mob_db *entry, config_setting_t *it, int *n, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_additional_fields_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_db_additional_fields_post > 0) {
+ void (*postHookFunc) (struct mob_db *entry, struct config_setting_t *it, int n, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_additional_fields_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_db_additional_fields_post[hIndex].func;
- postHookFunc(entry, it, &n, source);
+ postHookFunc(entry, it, n, source);
}
}
return;
}
-int HP_mob_read_db_sub(config_setting_t *mobt, int id, const char *source) {
+int HP_mob_read_db_sub(struct config_setting_t *mobt, int id, const char *source) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_read_db_sub_pre ) {
- int (*preHookFunc) (config_setting_t *mobt, int *id, const char *source);
+ if (HPMHooks.count.HP_mob_read_db_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **mobt, int *id, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(mobt, &id, source);
+ retVal___ = preHookFunc(&mobt, &id, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46329,25 +47174,25 @@ int HP_mob_read_db_sub(config_setting_t *mobt, int id, const char *source) {
{
retVal___ = HPMHooks.source.mob.read_db_sub(mobt, id, source);
}
- if( HPMHooks.count.HP_mob_read_db_sub_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *mobt, int *id, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_db_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *mobt, int id, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, mobt, &id, source);
+ retVal___ = postHookFunc(retVal___, mobt, id, source);
}
}
return retVal___;
}
-void HP_mob_read_db_drops_sub(struct mob_db *entry, config_setting_t *t) {
+void HP_mob_read_db_drops_sub(struct mob_db *entry, struct config_setting_t *t) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_read_db_drops_sub_pre ) {
- void (*preHookFunc) (struct mob_db *entry, config_setting_t *t);
+ if (HPMHooks.count.HP_mob_read_db_drops_sub_pre > 0) {
+ void (*preHookFunc) (struct mob_db **entry, struct config_setting_t **t);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_db_drops_sub_pre[hIndex].func;
- preHookFunc(entry, t);
+ preHookFunc(&entry, &t);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46355,25 +47200,25 @@ void HP_mob_read_db_drops_sub(struct mob_db *entry, config_setting_t *t) {
{
HPMHooks.source.mob.read_db_drops_sub(entry, t);
}
- if( HPMHooks.count.HP_mob_read_db_drops_sub_post ) {
- void (*postHookFunc) (struct mob_db *entry, config_setting_t *t);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_db_drops_sub_post > 0) {
+ void (*postHookFunc) (struct mob_db *entry, struct config_setting_t *t);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_db_drops_sub_post[hIndex].func;
postHookFunc(entry, t);
}
}
return;
}
-void HP_mob_read_db_mvpdrops_sub(struct mob_db *entry, config_setting_t *t) {
+void HP_mob_read_db_mvpdrops_sub(struct mob_db *entry, struct config_setting_t *t) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_read_db_mvpdrops_sub_pre ) {
- void (*preHookFunc) (struct mob_db *entry, config_setting_t *t);
+ if (HPMHooks.count.HP_mob_read_db_mvpdrops_sub_pre > 0) {
+ void (*preHookFunc) (struct mob_db **entry, struct config_setting_t **t);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mvpdrops_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mvpdrops_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_db_mvpdrops_sub_pre[hIndex].func;
- preHookFunc(entry, t);
+ preHookFunc(&entry, &t);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46381,26 +47226,26 @@ void HP_mob_read_db_mvpdrops_sub(struct mob_db *entry, config_setting_t *t) {
{
HPMHooks.source.mob.read_db_mvpdrops_sub(entry, t);
}
- if( HPMHooks.count.HP_mob_read_db_mvpdrops_sub_post ) {
- void (*postHookFunc) (struct mob_db *entry, config_setting_t *t);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mvpdrops_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_db_mvpdrops_sub_post > 0) {
+ void (*postHookFunc) (struct mob_db *entry, struct config_setting_t *t);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mvpdrops_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_db_mvpdrops_sub_post[hIndex].func;
postHookFunc(entry, t);
}
}
return;
}
-int HP_mob_read_db_mode_sub(struct mob_db *entry, config_setting_t *t) {
+uint32 HP_mob_read_db_mode_sub(struct mob_db *entry, struct config_setting_t *t) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_mob_read_db_mode_sub_pre ) {
- int (*preHookFunc) (struct mob_db *entry, config_setting_t *t);
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_mob_read_db_mode_sub_pre > 0) {
+ uint32 (*preHookFunc) (struct mob_db **entry, struct config_setting_t **t);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mode_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mode_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_db_mode_sub_pre[hIndex].func;
- retVal___ = preHookFunc(entry, t);
+ retVal___ = preHookFunc(&entry, &t);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46408,25 +47253,25 @@ int HP_mob_read_db_mode_sub(struct mob_db *entry, config_setting_t *t) {
{
retVal___ = HPMHooks.source.mob.read_db_mode_sub(entry, t);
}
- if( HPMHooks.count.HP_mob_read_db_mode_sub_post ) {
- int (*postHookFunc) (int retVal___, struct mob_db *entry, config_setting_t *t);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mode_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_db_mode_sub_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, struct mob_db *entry, struct config_setting_t *t);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mode_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_db_mode_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, entry, t);
}
}
return retVal___;
}
-void HP_mob_read_db_stats_sub(struct mob_db *entry, config_setting_t *t) {
+void HP_mob_read_db_stats_sub(struct mob_db *entry, struct config_setting_t *t) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_read_db_stats_sub_pre ) {
- void (*preHookFunc) (struct mob_db *entry, config_setting_t *t);
+ if (HPMHooks.count.HP_mob_read_db_stats_sub_pre > 0) {
+ void (*preHookFunc) (struct mob_db **entry, struct config_setting_t **t);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_stats_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_stats_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_db_stats_sub_pre[hIndex].func;
- preHookFunc(entry, t);
+ preHookFunc(&entry, &t);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46434,9 +47279,9 @@ void HP_mob_read_db_stats_sub(struct mob_db *entry, config_setting_t *t) {
{
HPMHooks.source.mob.read_db_stats_sub(entry, t);
}
- if( HPMHooks.count.HP_mob_read_db_stats_sub_post ) {
- void (*postHookFunc) (struct mob_db *entry, config_setting_t *t);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_stats_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_read_db_stats_sub_post > 0) {
+ void (*postHookFunc) (struct mob_db *entry, struct config_setting_t *t);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_stats_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_db_stats_sub_post[hIndex].func;
postHookFunc(entry, t);
}
@@ -46445,14 +47290,14 @@ void HP_mob_read_db_stats_sub(struct mob_db *entry, config_setting_t *t) {
}
void HP_mob_name_constants(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_name_constants_pre ) {
+ if (HPMHooks.count.HP_mob_name_constants_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_name_constants_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_name_constants_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_name_constants_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46460,9 +47305,9 @@ void HP_mob_name_constants(void) {
{
HPMHooks.source.mob.name_constants();
}
- if( HPMHooks.count.HP_mob_name_constants_post ) {
+ if (HPMHooks.count.HP_mob_name_constants_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_name_constants_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_name_constants_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_name_constants_post[hIndex].func;
postHookFunc();
}
@@ -46472,14 +47317,14 @@ void HP_mob_name_constants(void) {
bool HP_mob_readdb_mobavail(char *str[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_readdb_mobavail_pre ) {
- bool (*preHookFunc) (char *str[], int *columns, int *current);
+ if (HPMHooks.count.HP_mob_readdb_mobavail_pre > 0) {
+ bool (*preHookFunc) (char **str[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_readdb_mobavail_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46487,11 +47332,11 @@ bool HP_mob_readdb_mobavail(char *str[], int columns, int current) {
{
retVal___ = HPMHooks.source.mob.readdb_mobavail(str, columns, current);
}
- if( HPMHooks.count.HP_mob_readdb_mobavail_post ) {
- bool (*postHookFunc) (bool retVal___, char *str[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_readdb_mobavail_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_readdb_mobavail_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
@@ -46499,14 +47344,14 @@ bool HP_mob_readdb_mobavail(char *str[], int columns, int current) {
int HP_mob_read_randommonster(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_mob_read_randommonster_pre ) {
+ if (HPMHooks.count.HP_mob_read_randommonster_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_randommonster_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_randommonster_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_read_randommonster_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46514,9 +47359,9 @@ int HP_mob_read_randommonster(void) {
{
retVal___ = HPMHooks.source.mob.read_randommonster();
}
- if( HPMHooks.count.HP_mob_read_randommonster_post ) {
+ if (HPMHooks.count.HP_mob_read_randommonster_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_randommonster_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_randommonster_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_read_randommonster_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -46526,14 +47371,14 @@ int HP_mob_read_randommonster(void) {
bool HP_mob_parse_row_chatdb(char **str, const char *source, int line, int *last_msg_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_parse_row_chatdb_pre ) {
- bool (*preHookFunc) (char **str, const char *source, int *line, int *last_msg_id);
+ if (HPMHooks.count.HP_mob_parse_row_chatdb_pre > 0) {
+ bool (*preHookFunc) (char ***str, const char **source, int *line, int **last_msg_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_chatdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_chatdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_parse_row_chatdb_pre[hIndex].func;
- retVal___ = preHookFunc(str, source, &line, last_msg_id);
+ retVal___ = preHookFunc(&str, &source, &line, &last_msg_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46541,25 +47386,25 @@ bool HP_mob_parse_row_chatdb(char **str, const char *source, int line, int *last
{
retVal___ = HPMHooks.source.mob.parse_row_chatdb(str, source, line, last_msg_id);
}
- if( HPMHooks.count.HP_mob_parse_row_chatdb_post ) {
- bool (*postHookFunc) (bool retVal___, char **str, const char *source, int *line, int *last_msg_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_chatdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_parse_row_chatdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char **str, const char *source, int line, int *last_msg_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_chatdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_parse_row_chatdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, source, &line, last_msg_id);
+ retVal___ = postHookFunc(retVal___, str, source, line, last_msg_id);
}
}
return retVal___;
}
void HP_mob_readchatdb(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_readchatdb_pre ) {
+ if (HPMHooks.count.HP_mob_readchatdb_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readchatdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readchatdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_readchatdb_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46567,9 +47412,9 @@ void HP_mob_readchatdb(void) {
{
HPMHooks.source.mob.readchatdb();
}
- if( HPMHooks.count.HP_mob_readchatdb_post ) {
+ if (HPMHooks.count.HP_mob_readchatdb_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readchatdb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readchatdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_readchatdb_post[hIndex].func;
postHookFunc();
}
@@ -46579,14 +47424,14 @@ void HP_mob_readchatdb(void) {
bool HP_mob_parse_row_mobskilldb(char **str, int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_parse_row_mobskilldb_pre ) {
- bool (*preHookFunc) (char **str, int *columns, int *current);
+ if (HPMHooks.count.HP_mob_parse_row_mobskilldb_pre > 0) {
+ bool (*preHookFunc) (char ***str, int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_mobskilldb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_mobskilldb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_parse_row_mobskilldb_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46594,25 +47439,25 @@ bool HP_mob_parse_row_mobskilldb(char **str, int columns, int current) {
{
retVal___ = HPMHooks.source.mob.parse_row_mobskilldb(str, columns, current);
}
- if( HPMHooks.count.HP_mob_parse_row_mobskilldb_post ) {
- bool (*postHookFunc) (bool retVal___, char **str, int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_mobskilldb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_parse_row_mobskilldb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char **str, int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_mobskilldb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_parse_row_mobskilldb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
}
void HP_mob_readskilldb(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_readskilldb_pre ) {
+ if (HPMHooks.count.HP_mob_readskilldb_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readskilldb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readskilldb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_readskilldb_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46620,9 +47465,9 @@ void HP_mob_readskilldb(void) {
{
HPMHooks.source.mob.readskilldb();
}
- if( HPMHooks.count.HP_mob_readskilldb_post ) {
+ if (HPMHooks.count.HP_mob_readskilldb_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readskilldb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readskilldb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_readskilldb_post[hIndex].func;
postHookFunc();
}
@@ -46632,14 +47477,14 @@ void HP_mob_readskilldb(void) {
bool HP_mob_readdb_race2(char *fields[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_readdb_race2_pre ) {
- bool (*preHookFunc) (char *fields[], int *columns, int *current);
+ if (HPMHooks.count.HP_mob_readdb_race2_pre > 0) {
+ bool (*preHookFunc) (char **fields[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_race2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_race2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_readdb_race2_pre[hIndex].func;
- retVal___ = preHookFunc(fields, &columns, &current);
+ retVal___ = preHookFunc(&fields, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46647,11 +47492,11 @@ bool HP_mob_readdb_race2(char *fields[], int columns, int current) {
{
retVal___ = HPMHooks.source.mob.readdb_race2(fields, columns, current);
}
- if( HPMHooks.count.HP_mob_readdb_race2_post ) {
- bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_race2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_readdb_race2_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *fields[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_race2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_readdb_race2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fields, &columns, &current);
+ retVal___ = postHookFunc(retVal___, fields, columns, current);
}
}
return retVal___;
@@ -46659,14 +47504,14 @@ bool HP_mob_readdb_race2(char *fields[], int columns, int current) {
bool HP_mob_readdb_itemratio(char *str[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_mob_readdb_itemratio_pre ) {
- bool (*preHookFunc) (char *str[], int *columns, int *current);
+ if (HPMHooks.count.HP_mob_readdb_itemratio_pre > 0) {
+ bool (*preHookFunc) (char **str[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_itemratio_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_itemratio_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_readdb_itemratio_pre[hIndex].func;
- retVal___ = preHookFunc(str, &columns, &current);
+ retVal___ = preHookFunc(&str, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46674,25 +47519,25 @@ bool HP_mob_readdb_itemratio(char *str[], int columns, int current) {
{
retVal___ = HPMHooks.source.mob.readdb_itemratio(str, columns, current);
}
- if( HPMHooks.count.HP_mob_readdb_itemratio_post ) {
- bool (*postHookFunc) (bool retVal___, char *str[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_itemratio_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_readdb_itemratio_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_itemratio_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_readdb_itemratio_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &columns, &current);
+ retVal___ = postHookFunc(retVal___, str, columns, current);
}
}
return retVal___;
}
void HP_mob_load(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_load_pre ) {
+ if (HPMHooks.count.HP_mob_load_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_load_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46700,25 +47545,25 @@ void HP_mob_load(bool minimal) {
{
HPMHooks.source.mob.load(minimal);
}
- if( HPMHooks.count.HP_mob_load_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_load_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_load_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_load_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_mob_clear_spawninfo(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_clear_spawninfo_pre ) {
+ if (HPMHooks.count.HP_mob_clear_spawninfo_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_clear_spawninfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_clear_spawninfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_clear_spawninfo_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46726,9 +47571,9 @@ void HP_mob_clear_spawninfo(void) {
{
HPMHooks.source.mob.clear_spawninfo();
}
- if( HPMHooks.count.HP_mob_clear_spawninfo_post ) {
+ if (HPMHooks.count.HP_mob_clear_spawninfo_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_clear_spawninfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_clear_spawninfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_clear_spawninfo_post[hIndex].func;
postHookFunc();
}
@@ -46737,14 +47582,14 @@ void HP_mob_clear_spawninfo(void) {
}
void HP_mob_destroy_mob_db(int index) {
int hIndex = 0;
- if( HPMHooks.count.HP_mob_destroy_mob_db_pre ) {
+ if (HPMHooks.count.HP_mob_destroy_mob_db_pre > 0) {
void (*preHookFunc) (int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_mob_destroy_mob_db_pre[hIndex].func;
preHookFunc(&index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46752,29 +47597,293 @@ void HP_mob_destroy_mob_db(int index) {
{
HPMHooks.source.mob.destroy_mob_db(index);
}
- if( HPMHooks.count.HP_mob_destroy_mob_db_post ) {
- void (*postHookFunc) (int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_post; hIndex++ ) {
+ if (HPMHooks.count.HP_mob_destroy_mob_db_post > 0) {
+ void (*postHookFunc) (int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_mob_destroy_mob_db_post[hIndex].func;
- postHookFunc(&index);
+ postHookFunc(index);
+ }
+ }
+ return;
+}
+/* mutex_interface */
+struct mutex_data* HP_mutex_create(void) {
+ int hIndex = 0;
+ struct mutex_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_mutex_create_pre > 0) {
+ struct mutex_data* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_create_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mutex.create();
+ }
+ if (HPMHooks.count.HP_mutex_create_post > 0) {
+ struct mutex_data* (*postHookFunc) (struct mutex_data* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+void HP_mutex_destroy(struct mutex_data *m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_destroy_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_destroy_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.destroy(m);
+ }
+ if (HPMHooks.count.HP_mutex_destroy_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_destroy_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
+void HP_mutex_lock(struct mutex_data *m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_lock_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_lock_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.lock(m);
+ }
+ if (HPMHooks.count.HP_mutex_lock_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_lock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_lock_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
+bool HP_mutex_trylock(struct mutex_data *m) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_mutex_trylock_pre > 0) {
+ bool (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_trylock_pre[hIndex].func;
+ retVal___ = preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mutex.trylock(m);
+ }
+ if (HPMHooks.count.HP_mutex_trylock_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_trylock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_trylock_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, m);
+ }
+ }
+ return retVal___;
+}
+void HP_mutex_unlock(struct mutex_data *m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_unlock_pre > 0) {
+ void (*preHookFunc) (struct mutex_data **m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_unlock_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.unlock(m);
+ }
+ if (HPMHooks.count.HP_mutex_unlock_post > 0) {
+ void (*postHookFunc) (struct mutex_data *m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_unlock_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_unlock_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
+struct cond_data* HP_mutex_cond_create(void) {
+ int hIndex = 0;
+ struct cond_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_mutex_cond_create_pre > 0) {
+ struct cond_data* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_create_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.mutex.cond_create();
+ }
+ if (HPMHooks.count.HP_mutex_cond_create_post > 0) {
+ struct cond_data* (*postHookFunc) (struct cond_data* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+void HP_mutex_cond_destroy(struct cond_data *c) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_destroy_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_destroy_pre[hIndex].func;
+ preHookFunc(&c);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_destroy(c);
+ }
+ if (HPMHooks.count.HP_mutex_cond_destroy_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_destroy_post[hIndex].func;
+ postHookFunc(c);
+ }
+ }
+ return;
+}
+void HP_mutex_cond_wait(struct cond_data *c, struct mutex_data *m, sysint timeout_ticks) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_wait_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c, struct mutex_data **m, sysint *timeout_ticks);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_wait_pre[hIndex].func;
+ preHookFunc(&c, &m, &timeout_ticks);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_wait(c, m, timeout_ticks);
+ }
+ if (HPMHooks.count.HP_mutex_cond_wait_post > 0) {
+ void (*postHookFunc) (struct cond_data *c, struct mutex_data *m, sysint timeout_ticks);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_wait_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_wait_post[hIndex].func;
+ postHookFunc(c, m, timeout_ticks);
+ }
+ }
+ return;
+}
+void HP_mutex_cond_signal(struct cond_data *c) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_signal_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_signal_pre[hIndex].func;
+ preHookFunc(&c);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_signal(c);
+ }
+ if (HPMHooks.count.HP_mutex_cond_signal_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_signal_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_signal_post[hIndex].func;
+ postHookFunc(c);
+ }
+ }
+ return;
+}
+void HP_mutex_cond_broadcast(struct cond_data *c) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_mutex_cond_broadcast_pre > 0) {
+ void (*preHookFunc) (struct cond_data **c);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_pre[hIndex].func;
+ preHookFunc(&c);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.mutex.cond_broadcast(c);
+ }
+ if (HPMHooks.count.HP_mutex_cond_broadcast_post > 0) {
+ void (*postHookFunc) (struct cond_data *c);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_mutex_cond_broadcast_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_mutex_cond_broadcast_post[hIndex].func;
+ postHookFunc(c);
}
}
return;
}
-/* npc_chat */
+/* npc_chat_interface */
int HP_npc_chat_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_chat_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_npc_chat_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_chat_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46784,9 +47893,9 @@ int HP_npc_chat_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.npc_chat.sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_chat_sub_post ) {
+ if (HPMHooks.count.HP_npc_chat_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_chat_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -46797,14 +47906,14 @@ int HP_npc_chat_sub(struct block_list *bl, va_list ap) {
}
void HP_npc_chat_finalize(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_chat_finalize_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_chat_finalize_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_finalize_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46812,9 +47921,9 @@ void HP_npc_chat_finalize(struct npc_data *nd) {
{
HPMHooks.source.npc_chat.finalize(nd);
}
- if( HPMHooks.count.HP_npc_chat_finalize_post ) {
+ if (HPMHooks.count.HP_npc_chat_finalize_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_finalize_post[hIndex].func;
postHookFunc(nd);
}
@@ -46823,14 +47932,14 @@ void HP_npc_chat_finalize(struct npc_data *nd) {
}
void HP_npc_chat_def_pattern(struct npc_data *nd, int setid, const char *pattern, const char *label) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_chat_def_pattern_pre ) {
- void (*preHookFunc) (struct npc_data *nd, int *setid, const char *pattern, const char *label);
+ if (HPMHooks.count.HP_npc_chat_def_pattern_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int *setid, const char **pattern, const char **label);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_def_pattern_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_def_pattern_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_def_pattern_pre[hIndex].func;
- preHookFunc(nd, &setid, pattern, label);
+ preHookFunc(&nd, &setid, &pattern, &label);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46838,11 +47947,11 @@ void HP_npc_chat_def_pattern(struct npc_data *nd, int setid, const char *pattern
{
HPMHooks.source.npc_chat.def_pattern(nd, setid, pattern, label);
}
- if( HPMHooks.count.HP_npc_chat_def_pattern_post ) {
- void (*postHookFunc) (struct npc_data *nd, int *setid, const char *pattern, const char *label);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_def_pattern_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_chat_def_pattern_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int setid, const char *pattern, const char *label);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_def_pattern_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_def_pattern_post[hIndex].func;
- postHookFunc(nd, &setid, pattern, label);
+ postHookFunc(nd, setid, pattern, label);
}
}
return;
@@ -46850,14 +47959,14 @@ void HP_npc_chat_def_pattern(struct npc_data *nd, int setid, const char *pattern
struct pcrematch_entry* HP_npc_chat_create_pcrematch_entry(struct pcrematch_set *set) {
int hIndex = 0;
struct pcrematch_entry* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre ) {
- struct pcrematch_entry* (*preHookFunc) (struct pcrematch_set *set);
+ if (HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre > 0) {
+ struct pcrematch_entry* (*preHookFunc) (struct pcrematch_set **set);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_create_pcrematch_entry_pre[hIndex].func;
- retVal___ = preHookFunc(set);
+ retVal___ = preHookFunc(&set);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46865,9 +47974,9 @@ struct pcrematch_entry* HP_npc_chat_create_pcrematch_entry(struct pcrematch_set
{
retVal___ = HPMHooks.source.npc_chat.create_pcrematch_entry(set);
}
- if( HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post ) {
+ if (HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post > 0) {
struct pcrematch_entry* (*postHookFunc) (struct pcrematch_entry* retVal___, struct pcrematch_set *set);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_create_pcrematch_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_create_pcrematch_entry_post[hIndex].func;
retVal___ = postHookFunc(retVal___, set);
}
@@ -46876,14 +47985,14 @@ struct pcrematch_entry* HP_npc_chat_create_pcrematch_entry(struct pcrematch_set
}
void HP_npc_chat_delete_pcreset(struct npc_data *nd, int setid) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_chat_delete_pcreset_pre ) {
- void (*preHookFunc) (struct npc_data *nd, int *setid);
+ if (HPMHooks.count.HP_npc_chat_delete_pcreset_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int *setid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_delete_pcreset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_delete_pcreset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_delete_pcreset_pre[hIndex].func;
- preHookFunc(nd, &setid);
+ preHookFunc(&nd, &setid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46891,25 +48000,25 @@ void HP_npc_chat_delete_pcreset(struct npc_data *nd, int setid) {
{
HPMHooks.source.npc_chat.delete_pcreset(nd, setid);
}
- if( HPMHooks.count.HP_npc_chat_delete_pcreset_post ) {
- void (*postHookFunc) (struct npc_data *nd, int *setid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_delete_pcreset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_chat_delete_pcreset_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int setid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_delete_pcreset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_delete_pcreset_post[hIndex].func;
- postHookFunc(nd, &setid);
+ postHookFunc(nd, setid);
}
}
return;
}
void HP_npc_chat_deactivate_pcreset(struct npc_data *nd, int setid) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_chat_deactivate_pcreset_pre ) {
- void (*preHookFunc) (struct npc_data *nd, int *setid);
+ if (HPMHooks.count.HP_npc_chat_deactivate_pcreset_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int *setid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_deactivate_pcreset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_deactivate_pcreset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_deactivate_pcreset_pre[hIndex].func;
- preHookFunc(nd, &setid);
+ preHookFunc(&nd, &setid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46917,25 +48026,25 @@ void HP_npc_chat_deactivate_pcreset(struct npc_data *nd, int setid) {
{
HPMHooks.source.npc_chat.deactivate_pcreset(nd, setid);
}
- if( HPMHooks.count.HP_npc_chat_deactivate_pcreset_post ) {
- void (*postHookFunc) (struct npc_data *nd, int *setid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_deactivate_pcreset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_chat_deactivate_pcreset_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int setid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_deactivate_pcreset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_deactivate_pcreset_post[hIndex].func;
- postHookFunc(nd, &setid);
+ postHookFunc(nd, setid);
}
}
return;
}
void HP_npc_chat_activate_pcreset(struct npc_data *nd, int setid) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_chat_activate_pcreset_pre ) {
- void (*preHookFunc) (struct npc_data *nd, int *setid);
+ if (HPMHooks.count.HP_npc_chat_activate_pcreset_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int *setid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_activate_pcreset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_activate_pcreset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_activate_pcreset_pre[hIndex].func;
- preHookFunc(nd, &setid);
+ preHookFunc(&nd, &setid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46943,11 +48052,11 @@ void HP_npc_chat_activate_pcreset(struct npc_data *nd, int setid) {
{
HPMHooks.source.npc_chat.activate_pcreset(nd, setid);
}
- if( HPMHooks.count.HP_npc_chat_activate_pcreset_post ) {
- void (*postHookFunc) (struct npc_data *nd, int *setid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_activate_pcreset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_chat_activate_pcreset_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int setid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_activate_pcreset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_activate_pcreset_post[hIndex].func;
- postHookFunc(nd, &setid);
+ postHookFunc(nd, setid);
}
}
return;
@@ -46955,14 +48064,14 @@ void HP_npc_chat_activate_pcreset(struct npc_data *nd, int setid) {
struct pcrematch_set* HP_npc_chat_lookup_pcreset(struct npc_data *nd, int setid) {
int hIndex = 0;
struct pcrematch_set* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_chat_lookup_pcreset_pre ) {
- struct pcrematch_set* (*preHookFunc) (struct npc_data *nd, int *setid);
+ if (HPMHooks.count.HP_npc_chat_lookup_pcreset_pre > 0) {
+ struct pcrematch_set* (*preHookFunc) (struct npc_data **nd, int *setid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_lookup_pcreset_pre[hIndex].func;
- retVal___ = preHookFunc(nd, &setid);
+ retVal___ = preHookFunc(&nd, &setid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -46970,25 +48079,25 @@ struct pcrematch_set* HP_npc_chat_lookup_pcreset(struct npc_data *nd, int setid)
{
retVal___ = HPMHooks.source.npc_chat.lookup_pcreset(nd, setid);
}
- if( HPMHooks.count.HP_npc_chat_lookup_pcreset_post ) {
- struct pcrematch_set* (*postHookFunc) (struct pcrematch_set* retVal___, struct npc_data *nd, int *setid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_chat_lookup_pcreset_post > 0) {
+ struct pcrematch_set* (*postHookFunc) (struct pcrematch_set* retVal___, struct npc_data *nd, int setid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_lookup_pcreset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_lookup_pcreset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &setid);
+ retVal___ = postHookFunc(retVal___, nd, setid);
}
}
return retVal___;
}
void HP_npc_chat_finalize_pcrematch_entry(struct pcrematch_entry *e) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_pre ) {
- void (*preHookFunc) (struct pcrematch_entry *e);
+ if (HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_pre > 0) {
+ void (*preHookFunc) (struct pcrematch_entry **e);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_chat_finalize_pcrematch_entry_pre[hIndex].func;
- preHookFunc(e);
+ preHookFunc(&e);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -46996,27 +48105,27 @@ void HP_npc_chat_finalize_pcrematch_entry(struct pcrematch_entry *e) {
{
HPMHooks.source.npc_chat.finalize_pcrematch_entry(e);
}
- if( HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_post ) {
+ if (HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_post > 0) {
void (*postHookFunc) (struct pcrematch_entry *e);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_chat_finalize_pcrematch_entry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_chat_finalize_pcrematch_entry_post[hIndex].func;
postHookFunc(e);
}
}
return;
}
-/* npc */
+/* npc_interface */
int HP_npc_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_init_pre ) {
+ if (HPMHooks.count.HP_npc_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47024,11 +48133,11 @@ int HP_npc_init(bool minimal) {
{
retVal___ = HPMHooks.source.npc.init(minimal);
}
- if( HPMHooks.count.HP_npc_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
@@ -47036,14 +48145,14 @@ int HP_npc_init(bool minimal) {
int HP_npc_final(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_final_pre ) {
+ if (HPMHooks.count.HP_npc_final_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_final_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47051,9 +48160,9 @@ int HP_npc_final(void) {
{
retVal___ = HPMHooks.source.npc.final();
}
- if( HPMHooks.count.HP_npc_final_post ) {
+ if (HPMHooks.count.HP_npc_final_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_final_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -47063,14 +48172,14 @@ int HP_npc_final(void) {
int HP_npc_get_new_npc_id(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_get_new_npc_id_pre ) {
+ if (HPMHooks.count.HP_npc_get_new_npc_id_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_new_npc_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_new_npc_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_get_new_npc_id_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47078,9 +48187,9 @@ int HP_npc_get_new_npc_id(void) {
{
retVal___ = HPMHooks.source.npc.get_new_npc_id();
}
- if( HPMHooks.count.HP_npc_get_new_npc_id_post ) {
+ if (HPMHooks.count.HP_npc_get_new_npc_id_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_new_npc_id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_new_npc_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_get_new_npc_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -47090,14 +48199,14 @@ int HP_npc_get_new_npc_id(void) {
struct view_data* HP_npc_get_viewdata(int class_) {
int hIndex = 0;
struct view_data* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_get_viewdata_pre ) {
+ if (HPMHooks.count.HP_npc_get_viewdata_pre > 0) {
struct view_data* (*preHookFunc) (int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_get_viewdata_pre[hIndex].func;
retVal___ = preHookFunc(&class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47105,11 +48214,11 @@ struct view_data* HP_npc_get_viewdata(int class_) {
{
retVal___ = HPMHooks.source.npc.get_viewdata(class_);
}
- if( HPMHooks.count.HP_npc_get_viewdata_post ) {
- struct view_data* (*postHookFunc) (struct view_data* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_viewdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_get_viewdata_post > 0) {
+ struct view_data* (*postHookFunc) (struct view_data* retVal___, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_get_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_get_viewdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class_);
}
}
return retVal___;
@@ -47117,16 +48226,16 @@ struct view_data* HP_npc_get_viewdata(int class_) {
int HP_npc_isnear_sub(struct block_list *bl, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_isnear_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list args);
+ if (HPMHooks.count.HP_npc_isnear_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_sub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_npc_isnear_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, args___copy);
+ retVal___ = preHookFunc(&bl, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47136,9 +48245,9 @@ int HP_npc_isnear_sub(struct block_list *bl, va_list args) {
retVal___ = HPMHooks.source.npc.isnear_sub(bl, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_npc_isnear_sub_post ) {
+ if (HPMHooks.count.HP_npc_isnear_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_sub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_npc_isnear_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, args___copy);
@@ -47150,14 +48259,14 @@ int HP_npc_isnear_sub(struct block_list *bl, va_list args) {
bool HP_npc_isnear(struct block_list *bl) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_isnear_pre ) {
- bool (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_npc_isnear_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_isnear_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47165,9 +48274,9 @@ bool HP_npc_isnear(struct block_list *bl) {
{
retVal___ = HPMHooks.source.npc.isnear(bl);
}
- if( HPMHooks.count.HP_npc_isnear_post ) {
+ if (HPMHooks.count.HP_npc_isnear_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_isnear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_isnear_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -47177,14 +48286,14 @@ bool HP_npc_isnear(struct block_list *bl) {
int HP_npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_ontouch_event_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_ontouch_event_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_ontouch_event_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nd);
+ retVal___ = preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47192,9 +48301,9 @@ int HP_npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.ontouch_event(sd, nd);
}
- if( HPMHooks.count.HP_npc_ontouch_event_post ) {
+ if (HPMHooks.count.HP_npc_ontouch_event_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_ontouch_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, nd);
}
@@ -47204,14 +48313,14 @@ int HP_npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd) {
int HP_npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_ontouch2_event_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_ontouch2_event_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch2_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch2_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_ontouch2_event_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nd);
+ retVal___ = preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47219,9 +48328,9 @@ int HP_npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.ontouch2_event(sd, nd);
}
- if( HPMHooks.count.HP_npc_ontouch2_event_post ) {
+ if (HPMHooks.count.HP_npc_ontouch2_event_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch2_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_ontouch2_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_ontouch2_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, nd);
}
@@ -47231,14 +48340,14 @@ int HP_npc_ontouch2_event(struct map_session_data *sd, struct npc_data *nd) {
int HP_npc_onuntouch_event(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_onuntouch_event_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_onuntouch_event_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_onuntouch_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_onuntouch_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_onuntouch_event_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nd);
+ retVal___ = preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47246,9 +48355,9 @@ int HP_npc_onuntouch_event(struct map_session_data *sd, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.onuntouch_event(sd, nd);
}
- if( HPMHooks.count.HP_npc_onuntouch_event_post ) {
+ if (HPMHooks.count.HP_npc_onuntouch_event_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_onuntouch_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_onuntouch_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_onuntouch_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, nd);
}
@@ -47258,16 +48367,16 @@ int HP_npc_onuntouch_event(struct map_session_data *sd, struct npc_data *nd) {
int HP_npc_enable_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_enable_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_npc_enable_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_enable_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47277,9 +48386,9 @@ int HP_npc_enable_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.npc.enable_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_enable_sub_post ) {
+ if (HPMHooks.count.HP_npc_enable_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_enable_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -47291,14 +48400,14 @@ int HP_npc_enable_sub(struct block_list *bl, va_list ap) {
int HP_npc_enable(const char *name, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_enable_pre ) {
- int (*preHookFunc) (const char *name, int *flag);
+ if (HPMHooks.count.HP_npc_enable_pre > 0) {
+ int (*preHookFunc) (const char **name, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_enable_pre[hIndex].func;
- retVal___ = preHookFunc(name, &flag);
+ retVal___ = preHookFunc(&name, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47306,11 +48415,11 @@ int HP_npc_enable(const char *name, int flag) {
{
retVal___ = HPMHooks.source.npc.enable(name, flag);
}
- if( HPMHooks.count.HP_npc_enable_post ) {
- int (*postHookFunc) (int retVal___, const char *name, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_enable_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *name, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_enable_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_enable_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &flag);
+ retVal___ = postHookFunc(retVal___, name, flag);
}
}
return retVal___;
@@ -47318,14 +48427,14 @@ int HP_npc_enable(const char *name, int flag) {
struct npc_data* HP_npc_name2id(const char *name) {
int hIndex = 0;
struct npc_data* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_name2id_pre ) {
- struct npc_data* (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_npc_name2id_pre > 0) {
+ struct npc_data* (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_name2id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_name2id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_name2id_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47333,9 +48442,9 @@ struct npc_data* HP_npc_name2id(const char *name) {
{
retVal___ = HPMHooks.source.npc.name2id(name);
}
- if( HPMHooks.count.HP_npc_name2id_post ) {
+ if (HPMHooks.count.HP_npc_name2id_post > 0) {
struct npc_data* (*postHookFunc) (struct npc_data* retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_name2id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_name2id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_name2id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -47345,14 +48454,14 @@ struct npc_data* HP_npc_name2id(const char *name) {
int HP_npc_event_dequeue(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_dequeue_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_npc_event_dequeue_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_dequeue_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_dequeue_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_dequeue_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47360,29 +48469,28 @@ int HP_npc_event_dequeue(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.npc.event_dequeue(sd);
}
- if( HPMHooks.count.HP_npc_event_dequeue_post ) {
+ if (HPMHooks.count.HP_npc_event_dequeue_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_dequeue_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_dequeue_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_dequeue_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-DBData HP_npc_event_export_create(DBKey key, va_list args) {
+struct DBData HP_npc_event_export_create(union DBKey key, va_list args) {
int hIndex = 0;
- DBData retVal___;
- memset(&retVal___, '\0', sizeof(DBData));
- if( HPMHooks.count.HP_npc_event_export_create_pre ) {
- DBData (*preHookFunc) (DBKey *key, va_list args);
+ struct DBData retVal___ = { 0 };
+ if (HPMHooks.count.HP_npc_event_export_create_pre > 0) {
+ struct DBData (*preHookFunc) (union DBKey *key, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_create_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_npc_event_export_create_pre[hIndex].func;
retVal___ = preHookFunc(&key, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47392,12 +48500,12 @@ DBData HP_npc_event_export_create(DBKey key, va_list args) {
retVal___ = HPMHooks.source.npc.event_export_create(key, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_npc_event_export_create_post ) {
- DBData (*postHookFunc) (DBData retVal___, DBKey *key, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_event_export_create_post > 0) {
+ struct DBData (*postHookFunc) (struct DBData retVal___, union DBKey key, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_create_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_npc_event_export_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, args___copy);
+ retVal___ = postHookFunc(retVal___, key, args___copy);
va_end(args___copy);
}
}
@@ -47406,14 +48514,14 @@ DBData HP_npc_event_export_create(DBKey key, va_list args) {
int HP_npc_event_export(struct npc_data *nd, int i) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_export_pre ) {
- int (*preHookFunc) (struct npc_data *nd, int *i);
+ if (HPMHooks.count.HP_npc_event_export_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, int *i);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_export_pre[hIndex].func;
- retVal___ = preHookFunc(nd, &i);
+ retVal___ = preHookFunc(&nd, &i);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47421,11 +48529,11 @@ int HP_npc_event_export(struct npc_data *nd, int i) {
{
retVal___ = HPMHooks.source.npc.event_export(nd, i);
}
- if( HPMHooks.count.HP_npc_event_export_post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *nd, int *i);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_event_export_post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *nd, int i);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_export_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_export_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &i);
+ retVal___ = postHookFunc(retVal___, nd, i);
}
}
return retVal___;
@@ -47433,14 +48541,14 @@ int HP_npc_event_export(struct npc_data *nd, int i) {
int HP_npc_event_sub(struct map_session_data *sd, struct event_data *ev, const char *eventname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct event_data *ev, const char *eventname);
+ if (HPMHooks.count.HP_npc_event_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct event_data **ev, const char **eventname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ev, eventname);
+ retVal___ = preHookFunc(&sd, &ev, &eventname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47448,9 +48556,9 @@ int HP_npc_event_sub(struct map_session_data *sd, struct event_data *ev, const c
{
retVal___ = HPMHooks.source.npc.event_sub(sd, ev, eventname);
}
- if( HPMHooks.count.HP_npc_event_sub_post ) {
+ if (HPMHooks.count.HP_npc_event_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct event_data *ev, const char *eventname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ev, eventname);
}
@@ -47459,16 +48567,16 @@ int HP_npc_event_sub(struct map_session_data *sd, struct event_data *ev, const c
}
void HP_npc_event_doall_sub(void *key, void *data, va_list ap) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_event_doall_sub_pre ) {
- void (*preHookFunc) (void *key, void *data, va_list ap);
+ if (HPMHooks.count.HP_npc_event_doall_sub_pre > 0) {
+ void (*preHookFunc) (void **key, void **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_event_doall_sub_pre[hIndex].func;
- preHookFunc(key, data, ap___copy);
+ preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -47478,9 +48586,9 @@ void HP_npc_event_doall_sub(void *key, void *data, va_list ap) {
HPMHooks.source.npc.event_doall_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_event_doall_sub_post ) {
+ if (HPMHooks.count.HP_npc_event_doall_sub_post > 0) {
void (*postHookFunc) (void *key, void *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_event_doall_sub_post[hIndex].func;
postHookFunc(key, data, ap___copy);
@@ -47492,14 +48600,14 @@ void HP_npc_event_doall_sub(void *key, void *data, va_list ap) {
int HP_npc_event_do(const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_do_pre ) {
- int (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_npc_event_do_pre > 0) {
+ int (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_do_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47507,9 +48615,9 @@ int HP_npc_event_do(const char *name) {
{
retVal___ = HPMHooks.source.npc.event_do(name);
}
- if( HPMHooks.count.HP_npc_event_do_post ) {
+ if (HPMHooks.count.HP_npc_event_do_post > 0) {
int (*postHookFunc) (int retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_do_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -47519,14 +48627,14 @@ int HP_npc_event_do(const char *name) {
int HP_npc_event_doall_id(const char *name, int rid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_doall_id_pre ) {
- int (*preHookFunc) (const char *name, int *rid);
+ if (HPMHooks.count.HP_npc_event_doall_id_pre > 0) {
+ int (*preHookFunc) (const char **name, int *rid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_doall_id_pre[hIndex].func;
- retVal___ = preHookFunc(name, &rid);
+ retVal___ = preHookFunc(&name, &rid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47534,11 +48642,11 @@ int HP_npc_event_doall_id(const char *name, int rid) {
{
retVal___ = HPMHooks.source.npc.event_doall_id(name, rid);
}
- if( HPMHooks.count.HP_npc_event_doall_id_post ) {
- int (*postHookFunc) (int retVal___, const char *name, int *rid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_event_doall_id_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *name, int rid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_doall_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &rid);
+ retVal___ = postHookFunc(retVal___, name, rid);
}
}
return retVal___;
@@ -47546,14 +48654,14 @@ int HP_npc_event_doall_id(const char *name, int rid) {
int HP_npc_event_doall(const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_doall_pre ) {
- int (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_npc_event_doall_pre > 0) {
+ int (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_doall_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47561,9 +48669,9 @@ int HP_npc_event_doall(const char *name) {
{
retVal___ = HPMHooks.source.npc.event_doall(name);
}
- if( HPMHooks.count.HP_npc_event_doall_post ) {
+ if (HPMHooks.count.HP_npc_event_doall_post > 0) {
int (*postHookFunc) (int retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_doall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_doall_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -47573,14 +48681,14 @@ int HP_npc_event_doall(const char *name) {
int HP_npc_event_do_clock(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_do_clock_pre ) {
+ if (HPMHooks.count.HP_npc_event_do_clock_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_clock_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_clock_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_do_clock_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47588,25 +48696,25 @@ int HP_npc_event_do_clock(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.npc.event_do_clock(tid, tick, id, data);
}
- if( HPMHooks.count.HP_npc_event_do_clock_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_clock_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_event_do_clock_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_clock_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_do_clock_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_npc_event_do_oninit(bool reload) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_event_do_oninit_pre ) {
+ if (HPMHooks.count.HP_npc_event_do_oninit_pre > 0) {
void (*preHookFunc) (bool *reload);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_oninit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_oninit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_do_oninit_pre[hIndex].func;
preHookFunc(&reload);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -47614,11 +48722,11 @@ void HP_npc_event_do_oninit(bool reload) {
{
HPMHooks.source.npc.event_do_oninit(reload);
}
- if( HPMHooks.count.HP_npc_event_do_oninit_post ) {
- void (*postHookFunc) (bool *reload);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_oninit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_event_do_oninit_post > 0) {
+ void (*postHookFunc) (bool reload);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_do_oninit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_do_oninit_post[hIndex].func;
- postHookFunc(&reload);
+ postHookFunc(reload);
}
}
return;
@@ -47626,14 +48734,14 @@ void HP_npc_event_do_oninit(bool reload) {
int HP_npc_timerevent_export(struct npc_data *nd, int i) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_timerevent_export_pre ) {
- int (*preHookFunc) (struct npc_data *nd, int *i);
+ if (HPMHooks.count.HP_npc_timerevent_export_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, int *i);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_export_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_export_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_timerevent_export_pre[hIndex].func;
- retVal___ = preHookFunc(nd, &i);
+ retVal___ = preHookFunc(&nd, &i);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47641,11 +48749,11 @@ int HP_npc_timerevent_export(struct npc_data *nd, int i) {
{
retVal___ = HPMHooks.source.npc.timerevent_export(nd, i);
}
- if( HPMHooks.count.HP_npc_timerevent_export_post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *nd, int *i);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_export_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_timerevent_export_post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *nd, int i);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_export_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_timerevent_export_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &i);
+ retVal___ = postHookFunc(retVal___, nd, i);
}
}
return retVal___;
@@ -47653,14 +48761,14 @@ int HP_npc_timerevent_export(struct npc_data *nd, int i) {
int HP_npc_timerevent(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_timerevent_pre ) {
+ if (HPMHooks.count.HP_npc_timerevent_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_timerevent_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47668,11 +48776,11 @@ int HP_npc_timerevent(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.npc.timerevent(tid, tick, id, data);
}
- if( HPMHooks.count.HP_npc_timerevent_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_timerevent_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_timerevent_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -47680,14 +48788,14 @@ int HP_npc_timerevent(int tid, int64 tick, int id, intptr_t data) {
int HP_npc_timerevent_start(struct npc_data *nd, int rid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_timerevent_start_pre ) {
- int (*preHookFunc) (struct npc_data *nd, int *rid);
+ if (HPMHooks.count.HP_npc_timerevent_start_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, int *rid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_timerevent_start_pre[hIndex].func;
- retVal___ = preHookFunc(nd, &rid);
+ retVal___ = preHookFunc(&nd, &rid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47695,11 +48803,11 @@ int HP_npc_timerevent_start(struct npc_data *nd, int rid) {
{
retVal___ = HPMHooks.source.npc.timerevent_start(nd, rid);
}
- if( HPMHooks.count.HP_npc_timerevent_start_post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *nd, int *rid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_timerevent_start_post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *nd, int rid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_timerevent_start_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &rid);
+ retVal___ = postHookFunc(retVal___, nd, rid);
}
}
return retVal___;
@@ -47707,14 +48815,14 @@ int HP_npc_timerevent_start(struct npc_data *nd, int rid) {
int HP_npc_timerevent_stop(struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_timerevent_stop_pre ) {
- int (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_timerevent_stop_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_stop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_stop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_timerevent_stop_pre[hIndex].func;
- retVal___ = preHookFunc(nd);
+ retVal___ = preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47722,9 +48830,9 @@ int HP_npc_timerevent_stop(struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.timerevent_stop(nd);
}
- if( HPMHooks.count.HP_npc_timerevent_stop_post ) {
+ if (HPMHooks.count.HP_npc_timerevent_stop_post > 0) {
int (*postHookFunc) (int retVal___, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_stop_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_stop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_timerevent_stop_post[hIndex].func;
retVal___ = postHookFunc(retVal___, nd);
}
@@ -47733,14 +48841,14 @@ int HP_npc_timerevent_stop(struct npc_data *nd) {
}
void HP_npc_timerevent_quit(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_timerevent_quit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_npc_timerevent_quit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_quit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_quit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_timerevent_quit_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -47748,9 +48856,9 @@ void HP_npc_timerevent_quit(struct map_session_data *sd) {
{
HPMHooks.source.npc.timerevent_quit(sd);
}
- if( HPMHooks.count.HP_npc_timerevent_quit_post ) {
+ if (HPMHooks.count.HP_npc_timerevent_quit_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_quit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_timerevent_quit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_timerevent_quit_post[hIndex].func;
postHookFunc(sd);
}
@@ -47760,14 +48868,14 @@ void HP_npc_timerevent_quit(struct map_session_data *sd) {
int64 HP_npc_gettimerevent_tick(struct npc_data *nd) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_npc_gettimerevent_tick_pre ) {
- int64 (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_gettimerevent_tick_pre > 0) {
+ int64 (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_gettimerevent_tick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_gettimerevent_tick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_gettimerevent_tick_pre[hIndex].func;
- retVal___ = preHookFunc(nd);
+ retVal___ = preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47775,9 +48883,9 @@ int64 HP_npc_gettimerevent_tick(struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.gettimerevent_tick(nd);
}
- if( HPMHooks.count.HP_npc_gettimerevent_tick_post ) {
+ if (HPMHooks.count.HP_npc_gettimerevent_tick_post > 0) {
int64 (*postHookFunc) (int64 retVal___, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_gettimerevent_tick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_gettimerevent_tick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_gettimerevent_tick_post[hIndex].func;
retVal___ = postHookFunc(retVal___, nd);
}
@@ -47787,14 +48895,14 @@ int64 HP_npc_gettimerevent_tick(struct npc_data *nd) {
int HP_npc_settimerevent_tick(struct npc_data *nd, int newtimer) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_settimerevent_tick_pre ) {
- int (*preHookFunc) (struct npc_data *nd, int *newtimer);
+ if (HPMHooks.count.HP_npc_settimerevent_tick_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, int *newtimer);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_settimerevent_tick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_settimerevent_tick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_settimerevent_tick_pre[hIndex].func;
- retVal___ = preHookFunc(nd, &newtimer);
+ retVal___ = preHookFunc(&nd, &newtimer);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47802,11 +48910,11 @@ int HP_npc_settimerevent_tick(struct npc_data *nd, int newtimer) {
{
retVal___ = HPMHooks.source.npc.settimerevent_tick(nd, newtimer);
}
- if( HPMHooks.count.HP_npc_settimerevent_tick_post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *nd, int *newtimer);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_settimerevent_tick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_settimerevent_tick_post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *nd, int newtimer);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_settimerevent_tick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_settimerevent_tick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &newtimer);
+ retVal___ = postHookFunc(retVal___, nd, newtimer);
}
}
return retVal___;
@@ -47814,14 +48922,14 @@ int HP_npc_settimerevent_tick(struct npc_data *nd, int newtimer) {
int HP_npc_event(struct map_session_data *sd, const char *eventname, int ontouch) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_event_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *eventname, int *ontouch);
+ if (HPMHooks.count.HP_npc_event_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **eventname, int *ontouch);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_event_pre[hIndex].func;
- retVal___ = preHookFunc(sd, eventname, &ontouch);
+ retVal___ = preHookFunc(&sd, &eventname, &ontouch);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47829,11 +48937,11 @@ int HP_npc_event(struct map_session_data *sd, const char *eventname, int ontouch
{
retVal___ = HPMHooks.source.npc.event(sd, eventname, ontouch);
}
- if( HPMHooks.count.HP_npc_event_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *eventname, int *ontouch);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_event_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *eventname, int ontouch);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_event_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, eventname, &ontouch);
+ retVal___ = postHookFunc(retVal___, sd, eventname, ontouch);
}
}
return retVal___;
@@ -47841,16 +48949,16 @@ int HP_npc_event(struct map_session_data *sd, const char *eventname, int ontouch
int HP_npc_touch_areanpc_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_touch_areanpc_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_npc_touch_areanpc_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_touch_areanpc_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47860,9 +48968,9 @@ int HP_npc_touch_areanpc_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.npc.touch_areanpc_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_touch_areanpc_sub_post ) {
+ if (HPMHooks.count.HP_npc_touch_areanpc_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_touch_areanpc_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -47874,14 +48982,14 @@ int HP_npc_touch_areanpc_sub(struct block_list *bl, va_list ap) {
int HP_npc_touchnext_areanpc(struct map_session_data *sd, bool leavemap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_touchnext_areanpc_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, bool *leavemap);
+ if (HPMHooks.count.HP_npc_touchnext_areanpc_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, bool *leavemap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touchnext_areanpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touchnext_areanpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_touchnext_areanpc_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &leavemap);
+ retVal___ = preHookFunc(&sd, &leavemap);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47889,11 +48997,11 @@ int HP_npc_touchnext_areanpc(struct map_session_data *sd, bool leavemap) {
{
retVal___ = HPMHooks.source.npc.touchnext_areanpc(sd, leavemap);
}
- if( HPMHooks.count.HP_npc_touchnext_areanpc_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, bool *leavemap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touchnext_areanpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_touchnext_areanpc_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, bool leavemap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touchnext_areanpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_touchnext_areanpc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &leavemap);
+ retVal___ = postHookFunc(retVal___, sd, leavemap);
}
}
return retVal___;
@@ -47901,14 +49009,14 @@ int HP_npc_touchnext_areanpc(struct map_session_data *sd, bool leavemap) {
int HP_npc_touch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16 y) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_touch_areanpc_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int16 *m, int16 *x, int16 *y);
+ if (HPMHooks.count.HP_npc_touch_areanpc_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_touch_areanpc_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &m, &x, &y);
+ retVal___ = preHookFunc(&sd, &m, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47916,11 +49024,11 @@ int HP_npc_touch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16 y)
{
retVal___ = HPMHooks.source.npc.touch_areanpc(sd, m, x, y);
}
- if( HPMHooks.count.HP_npc_touch_areanpc_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 *m, int16 *x, int16 *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_touch_areanpc_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_touch_areanpc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &m, &x, &y);
+ retVal___ = postHookFunc(retVal___, sd, m, x, y);
}
}
return retVal___;
@@ -47928,14 +49036,14 @@ int HP_npc_touch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16 y)
int HP_npc_untouch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16 y) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_untouch_areanpc_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int16 *m, int16 *x, int16 *y);
+ if (HPMHooks.count.HP_npc_untouch_areanpc_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int16 *m, int16 *x, int16 *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_untouch_areanpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_untouch_areanpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_untouch_areanpc_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &m, &x, &y);
+ retVal___ = preHookFunc(&sd, &m, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47943,11 +49051,11 @@ int HP_npc_untouch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16
{
retVal___ = HPMHooks.source.npc.untouch_areanpc(sd, m, x, y);
}
- if( HPMHooks.count.HP_npc_untouch_areanpc_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 *m, int16 *x, int16 *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_untouch_areanpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_untouch_areanpc_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int16 m, int16 x, int16 y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_untouch_areanpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_untouch_areanpc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &m, &x, &y);
+ retVal___ = postHookFunc(retVal___, sd, m, x, y);
}
}
return retVal___;
@@ -47955,14 +49063,14 @@ int HP_npc_untouch_areanpc(struct map_session_data *sd, int16 m, int16 x, int16
int HP_npc_touch_areanpc2(struct mob_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_touch_areanpc2_pre ) {
- int (*preHookFunc) (struct mob_data *md);
+ if (HPMHooks.count.HP_npc_touch_areanpc2_pre > 0) {
+ int (*preHookFunc) (struct mob_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_touch_areanpc2_pre[hIndex].func;
- retVal___ = preHookFunc(md);
+ retVal___ = preHookFunc(&md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47970,9 +49078,9 @@ int HP_npc_touch_areanpc2(struct mob_data *md) {
{
retVal___ = HPMHooks.source.npc.touch_areanpc2(md);
}
- if( HPMHooks.count.HP_npc_touch_areanpc2_post ) {
+ if (HPMHooks.count.HP_npc_touch_areanpc2_post > 0) {
int (*postHookFunc) (int retVal___, struct mob_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_touch_areanpc2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_touch_areanpc2_post[hIndex].func;
retVal___ = postHookFunc(retVal___, md);
}
@@ -47982,14 +49090,14 @@ int HP_npc_touch_areanpc2(struct mob_data *md) {
int HP_npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_check_areanpc_pre ) {
+ if (HPMHooks.count.HP_npc_check_areanpc_pre > 0) {
int (*preHookFunc) (int *flag, int16 *m, int16 *x, int16 *y, int16 *range);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_check_areanpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_check_areanpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_check_areanpc_pre[hIndex].func;
retVal___ = preHookFunc(&flag, &m, &x, &y, &range);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -47997,11 +49105,11 @@ int HP_npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) {
{
retVal___ = HPMHooks.source.npc.check_areanpc(flag, m, x, y, range);
}
- if( HPMHooks.count.HP_npc_check_areanpc_post ) {
- int (*postHookFunc) (int retVal___, int *flag, int16 *m, int16 *x, int16 *y, int16 *range);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_check_areanpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_check_areanpc_post > 0) {
+ int (*postHookFunc) (int retVal___, int flag, int16 m, int16 x, int16 y, int16 range);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_check_areanpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_check_areanpc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &flag, &m, &x, &y, &range);
+ retVal___ = postHookFunc(retVal___, flag, m, x, y, range);
}
}
return retVal___;
@@ -48009,14 +49117,14 @@ int HP_npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) {
struct npc_data* HP_npc_checknear(struct map_session_data *sd, struct block_list *bl) {
int hIndex = 0;
struct npc_data* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_checknear_pre ) {
- struct npc_data* (*preHookFunc) (struct map_session_data *sd, struct block_list *bl);
+ if (HPMHooks.count.HP_npc_checknear_pre > 0) {
+ struct npc_data* (*preHookFunc) (struct map_session_data **sd, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_checknear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_checknear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_checknear_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bl);
+ retVal___ = preHookFunc(&sd, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48024,9 +49132,9 @@ struct npc_data* HP_npc_checknear(struct map_session_data *sd, struct block_list
{
retVal___ = HPMHooks.source.npc.checknear(sd, bl);
}
- if( HPMHooks.count.HP_npc_checknear_post ) {
+ if (HPMHooks.count.HP_npc_checknear_post > 0) {
struct npc_data* (*postHookFunc) (struct npc_data* retVal___, struct map_session_data *sd, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_checknear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_checknear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_checknear_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, bl);
}
@@ -48036,14 +49144,14 @@ struct npc_data* HP_npc_checknear(struct map_session_data *sd, struct block_list
int HP_npc_globalmessage(const char *name, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_globalmessage_pre ) {
- int (*preHookFunc) (const char *name, const char *mes);
+ if (HPMHooks.count.HP_npc_globalmessage_pre > 0) {
+ int (*preHookFunc) (const char **name, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_globalmessage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_globalmessage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_globalmessage_pre[hIndex].func;
- retVal___ = preHookFunc(name, mes);
+ retVal___ = preHookFunc(&name, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48051,9 +49159,9 @@ int HP_npc_globalmessage(const char *name, const char *mes) {
{
retVal___ = HPMHooks.source.npc.globalmessage(name, mes);
}
- if( HPMHooks.count.HP_npc_globalmessage_post ) {
+ if (HPMHooks.count.HP_npc_globalmessage_post > 0) {
int (*postHookFunc) (int retVal___, const char *name, const char *mes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_globalmessage_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_globalmessage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_globalmessage_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name, mes);
}
@@ -48062,14 +49170,14 @@ int HP_npc_globalmessage(const char *name, const char *mes) {
}
void HP_npc_run_tomb(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_run_tomb_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_run_tomb_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_run_tomb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_run_tomb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_run_tomb_pre[hIndex].func;
- preHookFunc(sd, nd);
+ preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48077,9 +49185,9 @@ void HP_npc_run_tomb(struct map_session_data *sd, struct npc_data *nd) {
{
HPMHooks.source.npc.run_tomb(sd, nd);
}
- if( HPMHooks.count.HP_npc_run_tomb_post ) {
+ if (HPMHooks.count.HP_npc_run_tomb_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_run_tomb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_run_tomb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_run_tomb_post[hIndex].func;
postHookFunc(sd, nd);
}
@@ -48089,14 +49197,14 @@ void HP_npc_run_tomb(struct map_session_data *sd, struct npc_data *nd) {
int HP_npc_click(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_click_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_click_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_click_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_click_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_click_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nd);
+ retVal___ = preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48104,9 +49212,9 @@ int HP_npc_click(struct map_session_data *sd, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.click(sd, nd);
}
- if( HPMHooks.count.HP_npc_click_post ) {
+ if (HPMHooks.count.HP_npc_click_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_click_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_click_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_click_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, nd);
}
@@ -48116,14 +49224,14 @@ int HP_npc_click(struct map_session_data *sd, struct npc_data *nd) {
int HP_npc_scriptcont(struct map_session_data *sd, int id, bool closing) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_scriptcont_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *id, bool *closing);
+ if (HPMHooks.count.HP_npc_scriptcont_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *id, bool *closing);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_scriptcont_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_scriptcont_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_scriptcont_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &id, &closing);
+ retVal___ = preHookFunc(&sd, &id, &closing);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48131,11 +49239,11 @@ int HP_npc_scriptcont(struct map_session_data *sd, int id, bool closing) {
{
retVal___ = HPMHooks.source.npc.scriptcont(sd, id, closing);
}
- if( HPMHooks.count.HP_npc_scriptcont_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *id, bool *closing);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_scriptcont_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_scriptcont_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int id, bool closing);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_scriptcont_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_scriptcont_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &id, &closing);
+ retVal___ = postHookFunc(retVal___, sd, id, closing);
}
}
return retVal___;
@@ -48143,14 +49251,14 @@ int HP_npc_scriptcont(struct map_session_data *sd, int id, bool closing) {
int HP_npc_buysellsel(struct map_session_data *sd, int id, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_buysellsel_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *id, int *type);
+ if (HPMHooks.count.HP_npc_buysellsel_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *id, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_buysellsel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_buysellsel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_buysellsel_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &id, &type);
+ retVal___ = preHookFunc(&sd, &id, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48158,65 +49266,65 @@ int HP_npc_buysellsel(struct map_session_data *sd, int id, int type) {
{
retVal___ = HPMHooks.source.npc.buysellsel(sd, id, type);
}
- if( HPMHooks.count.HP_npc_buysellsel_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *id, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_buysellsel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_buysellsel_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int id, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_buysellsel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_buysellsel_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &id, &type);
+ retVal___ = postHookFunc(retVal___, sd, id, type);
}
}
return retVal___;
}
-int HP_npc_cashshop_buylist(struct map_session_data *sd, int points, int count, unsigned short *item_list) {
+int HP_npc_cashshop_buylist(struct map_session_data *sd, int points, struct itemlist *item_list) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_cashshop_buylist_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *points, int *count, unsigned short *item_list);
+ if (HPMHooks.count.HP_npc_cashshop_buylist_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *points, struct itemlist **item_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buylist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buylist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_cashshop_buylist_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &points, &count, item_list);
+ retVal___ = preHookFunc(&sd, &points, &item_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.npc.cashshop_buylist(sd, points, count, item_list);
+ retVal___ = HPMHooks.source.npc.cashshop_buylist(sd, points, item_list);
}
- if( HPMHooks.count.HP_npc_cashshop_buylist_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *points, int *count, unsigned short *item_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buylist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_cashshop_buylist_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int points, struct itemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buylist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_cashshop_buylist_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &points, &count, item_list);
+ retVal___ = postHookFunc(retVal___, sd, points, item_list);
}
}
return retVal___;
}
-int HP_npc_buylist_sub(struct map_session_data *sd, int n, unsigned short *item_list, struct npc_data *nd) {
+int HP_npc_buylist_sub(struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_buylist_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, unsigned short *item_list, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_buylist_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_buylist_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, item_list, nd);
+ retVal___ = preHookFunc(&sd, &item_list, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.npc.buylist_sub(sd, n, item_list, nd);
+ retVal___ = HPMHooks.source.npc.buylist_sub(sd, item_list, nd);
}
- if( HPMHooks.count.HP_npc_buylist_sub_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, unsigned short *item_list, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_buylist_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_buylist_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, item_list, nd);
+ retVal___ = postHookFunc(retVal___, sd, item_list, nd);
}
}
return retVal___;
@@ -48224,14 +49332,14 @@ int HP_npc_buylist_sub(struct map_session_data *sd, int n, unsigned short *item_
int HP_npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int points) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_cashshop_buy_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid, int *amount, int *points);
+ if (HPMHooks.count.HP_npc_cashshop_buy_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid, int *amount, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_cashshop_buy_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid, &amount, &points);
+ retVal___ = preHookFunc(&sd, &nameid, &amount, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48239,92 +49347,92 @@ int HP_npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int
{
retVal___ = HPMHooks.source.npc.cashshop_buy(sd, nameid, amount, points);
}
- if( HPMHooks.count.HP_npc_cashshop_buy_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid, int *amount, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_cashshop_buy_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid, int amount, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_cashshop_buy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_cashshop_buy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid, &amount, &points);
+ retVal___ = postHookFunc(retVal___, sd, nameid, amount, points);
}
}
return retVal___;
}
-int HP_npc_buylist(struct map_session_data *sd, int n, unsigned short *item_list) {
+int HP_npc_buylist(struct map_session_data *sd, struct itemlist *item_list) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_buylist_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, unsigned short *item_list);
+ if (HPMHooks.count.HP_npc_buylist_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_buylist_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, item_list);
+ retVal___ = preHookFunc(&sd, &item_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.npc.buylist(sd, n, item_list);
+ retVal___ = HPMHooks.source.npc.buylist(sd, item_list);
}
- if( HPMHooks.count.HP_npc_buylist_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, unsigned short *item_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_buylist_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_buylist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_buylist_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, item_list);
+ retVal___ = postHookFunc(retVal___, sd, item_list);
}
}
return retVal___;
}
-int HP_npc_selllist_sub(struct map_session_data *sd, int n, unsigned short *item_list, struct npc_data *nd) {
+int HP_npc_selllist_sub(struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_selllist_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, unsigned short *item_list, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_selllist_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_selllist_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, item_list, nd);
+ retVal___ = preHookFunc(&sd, &item_list, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.npc.selllist_sub(sd, n, item_list, nd);
+ retVal___ = HPMHooks.source.npc.selllist_sub(sd, item_list, nd);
}
- if( HPMHooks.count.HP_npc_selllist_sub_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, unsigned short *item_list, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_selllist_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct itemlist *item_list, struct npc_data *nd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_selllist_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, item_list, nd);
+ retVal___ = postHookFunc(retVal___, sd, item_list, nd);
}
}
return retVal___;
}
-int HP_npc_selllist(struct map_session_data *sd, int n, unsigned short *item_list) {
+int HP_npc_selllist(struct map_session_data *sd, struct itemlist *item_list) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_selllist_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, unsigned short *item_list);
+ if (HPMHooks.count.HP_npc_selllist_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_selllist_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, item_list);
+ retVal___ = preHookFunc(&sd, &item_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.npc.selllist(sd, n, item_list);
+ retVal___ = HPMHooks.source.npc.selllist(sd, item_list);
}
- if( HPMHooks.count.HP_npc_selllist_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, unsigned short *item_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_selllist_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_selllist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_selllist_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, item_list);
+ retVal___ = postHookFunc(retVal___, sd, item_list);
}
}
return retVal___;
@@ -48332,14 +49440,14 @@ int HP_npc_selllist(struct map_session_data *sd, int n, unsigned short *item_lis
int HP_npc_remove_map(struct npc_data *nd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_remove_map_pre ) {
- int (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_remove_map_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_remove_map_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_remove_map_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_remove_map_pre[hIndex].func;
- retVal___ = preHookFunc(nd);
+ retVal___ = preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48347,28 +49455,28 @@ int HP_npc_remove_map(struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.remove_map(nd);
}
- if( HPMHooks.count.HP_npc_remove_map_post ) {
+ if (HPMHooks.count.HP_npc_remove_map_post > 0) {
int (*postHookFunc) (int retVal___, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_remove_map_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_remove_map_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_remove_map_post[hIndex].func;
retVal___ = postHookFunc(retVal___, nd);
}
}
return retVal___;
}
-int HP_npc_unload_ev(DBKey key, DBData *data, va_list ap) {
+int HP_npc_unload_ev(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_unload_ev_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_npc_unload_ev_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_unload_ev_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48378,30 +49486,30 @@ int HP_npc_unload_ev(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.npc.unload_ev(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_unload_ev_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_unload_ev_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_unload_ev_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-int HP_npc_unload_ev_label(DBKey key, DBData *data, va_list ap) {
+int HP_npc_unload_ev_label(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_unload_ev_label_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_npc_unload_ev_label_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_label_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_label_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_unload_ev_label_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48411,12 +49519,12 @@ int HP_npc_unload_ev_label(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.npc.unload_ev_label(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_unload_ev_label_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_label_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_unload_ev_label_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_ev_label_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_unload_ev_label_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -48425,16 +49533,16 @@ int HP_npc_unload_ev_label(DBKey key, DBData *data, va_list ap) {
int HP_npc_unload_dup_sub(struct npc_data *nd, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_unload_dup_sub_pre ) {
- int (*preHookFunc) (struct npc_data *nd, va_list args);
+ if (HPMHooks.count.HP_npc_unload_dup_sub_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_dup_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_dup_sub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_npc_unload_dup_sub_pre[hIndex].func;
- retVal___ = preHookFunc(nd, args___copy);
+ retVal___ = preHookFunc(&nd, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48444,9 +49552,9 @@ int HP_npc_unload_dup_sub(struct npc_data *nd, va_list args) {
retVal___ = HPMHooks.source.npc.unload_dup_sub(nd, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_npc_unload_dup_sub_post ) {
+ if (HPMHooks.count.HP_npc_unload_dup_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct npc_data *nd, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_dup_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_dup_sub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_npc_unload_dup_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, nd, args___copy);
@@ -48457,14 +49565,14 @@ int HP_npc_unload_dup_sub(struct npc_data *nd, va_list args) {
}
void HP_npc_unload_duplicates(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_unload_duplicates_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_unload_duplicates_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_duplicates_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_duplicates_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_unload_duplicates_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48472,9 +49580,9 @@ void HP_npc_unload_duplicates(struct npc_data *nd) {
{
HPMHooks.source.npc.unload_duplicates(nd);
}
- if( HPMHooks.count.HP_npc_unload_duplicates_post ) {
+ if (HPMHooks.count.HP_npc_unload_duplicates_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_duplicates_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_duplicates_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_unload_duplicates_post[hIndex].func;
postHookFunc(nd);
}
@@ -48484,14 +49592,14 @@ void HP_npc_unload_duplicates(struct npc_data *nd) {
int HP_npc_unload(struct npc_data *nd, bool single) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_unload_pre ) {
- int (*preHookFunc) (struct npc_data *nd, bool *single);
+ if (HPMHooks.count.HP_npc_unload_pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, bool *single);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_unload_pre[hIndex].func;
- retVal___ = preHookFunc(nd, &single);
+ retVal___ = preHookFunc(&nd, &single);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48499,25 +49607,25 @@ int HP_npc_unload(struct npc_data *nd, bool single) {
{
retVal___ = HPMHooks.source.npc.unload(nd, single);
}
- if( HPMHooks.count.HP_npc_unload_post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *nd, bool *single);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_unload_post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *nd, bool single);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_unload_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &single);
+ retVal___ = postHookFunc(retVal___, nd, single);
}
}
return retVal___;
}
void HP_npc_clearsrcfile(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_clearsrcfile_pre ) {
+ if (HPMHooks.count.HP_npc_clearsrcfile_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_clearsrcfile_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_clearsrcfile_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_clearsrcfile_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48525,9 +49633,9 @@ void HP_npc_clearsrcfile(void) {
{
HPMHooks.source.npc.clearsrcfile();
}
- if( HPMHooks.count.HP_npc_clearsrcfile_post ) {
+ if (HPMHooks.count.HP_npc_clearsrcfile_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_clearsrcfile_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_clearsrcfile_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_clearsrcfile_post[hIndex].func;
postHookFunc();
}
@@ -48536,14 +49644,14 @@ void HP_npc_clearsrcfile(void) {
}
void HP_npc_addsrcfile(const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_addsrcfile_pre ) {
- void (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_npc_addsrcfile_pre > 0) {
+ void (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_addsrcfile_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_addsrcfile_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_addsrcfile_pre[hIndex].func;
- preHookFunc(name);
+ preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48551,9 +49659,9 @@ void HP_npc_addsrcfile(const char *name) {
{
HPMHooks.source.npc.addsrcfile(name);
}
- if( HPMHooks.count.HP_npc_addsrcfile_post ) {
+ if (HPMHooks.count.HP_npc_addsrcfile_post > 0) {
void (*postHookFunc) (const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_addsrcfile_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_addsrcfile_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_addsrcfile_post[hIndex].func;
postHookFunc(name);
}
@@ -48562,14 +49670,14 @@ void HP_npc_addsrcfile(const char *name) {
}
void HP_npc_delsrcfile(const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_delsrcfile_pre ) {
- void (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_npc_delsrcfile_pre > 0) {
+ void (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_delsrcfile_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_delsrcfile_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_delsrcfile_pre[hIndex].func;
- preHookFunc(name);
+ preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48577,9 +49685,9 @@ void HP_npc_delsrcfile(const char *name) {
{
HPMHooks.source.npc.delsrcfile(name);
}
- if( HPMHooks.count.HP_npc_delsrcfile_post ) {
+ if (HPMHooks.count.HP_npc_delsrcfile_post > 0) {
void (*postHookFunc) (const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_delsrcfile_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_delsrcfile_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_delsrcfile_post[hIndex].func;
postHookFunc(name);
}
@@ -48589,14 +49697,14 @@ void HP_npc_delsrcfile(const char *name) {
const char* HP_npc_retainpathreference(const char *filepath) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_retainpathreference_pre ) {
- const char* (*preHookFunc) (const char *filepath);
+ if (HPMHooks.count.HP_npc_retainpathreference_pre > 0) {
+ const char* (*preHookFunc) (const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_retainpathreference_pre[hIndex].func;
- retVal___ = preHookFunc(filepath);
+ retVal___ = preHookFunc(&filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48604,9 +49712,9 @@ const char* HP_npc_retainpathreference(const char *filepath) {
{
retVal___ = HPMHooks.source.npc.retainpathreference(filepath);
}
- if( HPMHooks.count.HP_npc_retainpathreference_post ) {
+ if (HPMHooks.count.HP_npc_retainpathreference_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_retainpathreference_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_retainpathreference_post[hIndex].func;
retVal___ = postHookFunc(retVal___, filepath);
}
@@ -48615,14 +49723,14 @@ const char* HP_npc_retainpathreference(const char *filepath) {
}
void HP_npc_releasepathreference(const char *filepath) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_releasepathreference_pre ) {
- void (*preHookFunc) (const char *filepath);
+ if (HPMHooks.count.HP_npc_releasepathreference_pre > 0) {
+ void (*preHookFunc) (const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_releasepathreference_pre[hIndex].func;
- preHookFunc(filepath);
+ preHookFunc(&filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48630,9 +49738,9 @@ void HP_npc_releasepathreference(const char *filepath) {
{
HPMHooks.source.npc.releasepathreference(filepath);
}
- if( HPMHooks.count.HP_npc_releasepathreference_post ) {
+ if (HPMHooks.count.HP_npc_releasepathreference_post > 0) {
void (*postHookFunc) (const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_releasepathreference_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_releasepathreference_post[hIndex].func;
postHookFunc(filepath);
}
@@ -48641,14 +49749,14 @@ void HP_npc_releasepathreference(const char *filepath) {
}
void HP_npc_parsename(struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_parsename_pre ) {
- void (*preHookFunc) (struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath);
+ if (HPMHooks.count.HP_npc_parsename_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, const char **name, const char **start, const char **buffer, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsename_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsename_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parsename_pre[hIndex].func;
- preHookFunc(nd, name, start, buffer, filepath);
+ preHookFunc(&nd, &name, &start, &buffer, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48656,9 +49764,9 @@ void HP_npc_parsename(struct npc_data *nd, const char *name, const char *start,
{
HPMHooks.source.npc.parsename(nd, name, start, buffer, filepath);
}
- if( HPMHooks.count.HP_npc_parsename_post ) {
+ if (HPMHooks.count.HP_npc_parsename_post > 0) {
void (*postHookFunc) (struct npc_data *nd, const char *name, const char *start, const char *buffer, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsename_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsename_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parsename_post[hIndex].func;
postHookFunc(nd, name, start, buffer, filepath);
}
@@ -48668,14 +49776,14 @@ void HP_npc_parsename(struct npc_data *nd, const char *name, const char *start,
int HP_npc_parseview(const char *w4, const char *start, const char *buffer, const char *filepath) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_parseview_pre ) {
- int (*preHookFunc) (const char *w4, const char *start, const char *buffer, const char *filepath);
+ if (HPMHooks.count.HP_npc_parseview_pre > 0) {
+ int (*preHookFunc) (const char **w4, const char **start, const char **buffer, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parseview_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parseview_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parseview_pre[hIndex].func;
- retVal___ = preHookFunc(w4, start, buffer, filepath);
+ retVal___ = preHookFunc(&w4, &start, &buffer, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48683,9 +49791,9 @@ int HP_npc_parseview(const char *w4, const char *start, const char *buffer, cons
{
retVal___ = HPMHooks.source.npc.parseview(w4, start, buffer, filepath);
}
- if( HPMHooks.count.HP_npc_parseview_post ) {
+ if (HPMHooks.count.HP_npc_parseview_post > 0) {
int (*postHookFunc) (int retVal___, const char *w4, const char *start, const char *buffer, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parseview_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parseview_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parseview_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w4, start, buffer, filepath);
}
@@ -48695,14 +49803,14 @@ int HP_npc_parseview(const char *w4, const char *start, const char *buffer, cons
bool HP_npc_viewisid(const char *viewid) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_viewisid_pre ) {
- bool (*preHookFunc) (const char *viewid);
+ if (HPMHooks.count.HP_npc_viewisid_pre > 0) {
+ bool (*preHookFunc) (const char **viewid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_viewisid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_viewisid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_viewisid_pre[hIndex].func;
- retVal___ = preHookFunc(viewid);
+ retVal___ = preHookFunc(&viewid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48710,9 +49818,9 @@ bool HP_npc_viewisid(const char *viewid) {
{
retVal___ = HPMHooks.source.npc.viewisid(viewid);
}
- if( HPMHooks.count.HP_npc_viewisid_post ) {
+ if (HPMHooks.count.HP_npc_viewisid_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *viewid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_viewisid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_viewisid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_viewisid_post[hIndex].func;
retVal___ = postHookFunc(retVal___, viewid);
}
@@ -48722,14 +49830,14 @@ bool HP_npc_viewisid(const char *viewid) {
struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_) {
int hIndex = 0;
struct npc_data* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_create_npc_pre ) {
+ if (HPMHooks.count.HP_npc_create_npc_pre > 0) {
struct npc_data* (*preHookFunc) (enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_create_npc_pre[hIndex].func;
retVal___ = preHookFunc(&subtype, &m, &x, &y, &dir, &class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48737,11 +49845,11 @@ struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y
{
retVal___ = HPMHooks.source.npc.create_npc(subtype, m, x, y, dir, class_);
}
- if( HPMHooks.count.HP_npc_create_npc_post ) {
- struct npc_data* (*postHookFunc) (struct npc_data* retVal___, enum npc_subtype *subtype, int *m, int *x, int *y, uint8 *dir, int16 *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_create_npc_post > 0) {
+ struct npc_data* (*postHookFunc) (struct npc_data* retVal___, enum npc_subtype subtype, int m, int x, int y, uint8 dir, int16 class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_create_npc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_create_npc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &subtype, &m, &x, &y, &dir, &class_);
+ retVal___ = postHookFunc(retVal___, subtype, m, x, y, dir, class_);
}
}
return retVal___;
@@ -48749,14 +49857,14 @@ struct npc_data* HP_npc_create_npc(enum npc_subtype subtype, int m, int x, int y
struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y) {
int hIndex = 0;
struct npc_data* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_add_warp_pre ) {
- struct npc_data* (*preHookFunc) (char *name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y);
+ if (HPMHooks.count.HP_npc_add_warp_pre > 0) {
+ struct npc_data* (*preHookFunc) (char **name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_warp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_warp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_add_warp_pre[hIndex].func;
- retVal___ = preHookFunc(name, &from_mapid, &from_x, &from_y, &xs, &ys, &to_mapindex, &to_x, &to_y);
+ retVal___ = preHookFunc(&name, &from_mapid, &from_x, &from_y, &xs, &ys, &to_mapindex, &to_x, &to_y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48764,11 +49872,11 @@ struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, sho
{
retVal___ = HPMHooks.source.npc.add_warp(name, from_mapid, from_x, from_y, xs, ys, to_mapindex, to_x, to_y);
}
- if( HPMHooks.count.HP_npc_add_warp_post ) {
- struct npc_data* (*postHookFunc) (struct npc_data* retVal___, char *name, short *from_mapid, short *from_x, short *from_y, short *xs, short *ys, unsigned short *to_mapindex, short *to_x, short *to_y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_warp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_add_warp_post > 0) {
+ struct npc_data* (*postHookFunc) (struct npc_data* retVal___, char *name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_warp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_add_warp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, &from_mapid, &from_x, &from_y, &xs, &ys, &to_mapindex, &to_x, &to_y);
+ retVal___ = postHookFunc(retVal___, name, from_mapid, from_x, from_y, xs, ys, to_mapindex, to_x, to_y);
}
}
return retVal___;
@@ -48776,14 +49884,14 @@ struct npc_data* HP_npc_add_warp(char *name, short from_mapid, short from_x, sho
const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_warp_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_warp_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_warp_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48791,9 +49899,9 @@ const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, co
{
retVal___ = HPMHooks.source.npc.parse_warp(w1, w2, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_warp_post ) {
+ if (HPMHooks.count.HP_npc_parse_warp_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_warp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_warp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval);
}
@@ -48803,14 +49911,14 @@ const char* HP_npc_parse_warp(const char *w1, const char *w2, const char *w3, co
const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_shop_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_shop_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_shop_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48818,9 +49926,9 @@ const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, co
{
retVal___ = HPMHooks.source.npc.parse_shop(w1, w2, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_shop_post ) {
+ if (HPMHooks.count.HP_npc_parse_shop_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_shop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_shop_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval);
}
@@ -48830,14 +49938,14 @@ const char* HP_npc_parse_shop(const char *w1, const char *w2, const char *w3, co
const char* HP_npc_parse_unknown_object(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_unknown_object_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_unknown_object_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_unknown_object_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48845,9 +49953,9 @@ const char* HP_npc_parse_unknown_object(const char *w1, const char *w2, const ch
{
retVal___ = HPMHooks.source.npc.parse_unknown_object(w1, w2, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_unknown_object_post ) {
+ if (HPMHooks.count.HP_npc_parse_unknown_object_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_object_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_unknown_object_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval);
}
@@ -48856,14 +49964,14 @@ const char* HP_npc_parse_unknown_object(const char *w1, const char *w2, const ch
}
void HP_npc_convertlabel_db(struct npc_label_list *label_list, const char *filepath) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_convertlabel_db_pre ) {
- void (*preHookFunc) (struct npc_label_list *label_list, const char *filepath);
+ if (HPMHooks.count.HP_npc_convertlabel_db_pre > 0) {
+ void (*preHookFunc) (struct npc_label_list **label_list, const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_convertlabel_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_convertlabel_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_convertlabel_db_pre[hIndex].func;
- preHookFunc(label_list, filepath);
+ preHookFunc(&label_list, &filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48871,9 +49979,9 @@ void HP_npc_convertlabel_db(struct npc_label_list *label_list, const char *filep
{
HPMHooks.source.npc.convertlabel_db(label_list, filepath);
}
- if( HPMHooks.count.HP_npc_convertlabel_db_post ) {
+ if (HPMHooks.count.HP_npc_convertlabel_db_post > 0) {
void (*postHookFunc) (struct npc_label_list *label_list, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_convertlabel_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_convertlabel_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_convertlabel_db_post[hIndex].func;
postHookFunc(label_list, filepath);
}
@@ -48883,14 +49991,14 @@ void HP_npc_convertlabel_db(struct npc_label_list *label_list, const char *filep
const char* HP_npc_skip_script(const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_skip_script_pre ) {
- const char* (*preHookFunc) (const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_skip_script_pre > 0) {
+ const char* (*preHookFunc) (const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_skip_script_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_skip_script_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_skip_script_pre[hIndex].func;
- retVal___ = preHookFunc(start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48898,9 +50006,9 @@ const char* HP_npc_skip_script(const char *start, const char *buffer, const char
{
retVal___ = HPMHooks.source.npc.skip_script(start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_skip_script_post ) {
+ if (HPMHooks.count.HP_npc_skip_script_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_skip_script_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_skip_script_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_skip_script_post[hIndex].func;
retVal___ = postHookFunc(retVal___, start, buffer, filepath, retval);
}
@@ -48910,14 +50018,14 @@ const char* HP_npc_skip_script(const char *start, const char *buffer, const char
const char* HP_npc_parse_script(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_script_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval);
+ if (HPMHooks.count.HP_npc_parse_script_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_script_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, &options, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &options, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48925,25 +50033,25 @@ const char* HP_npc_parse_script(const char *w1, const char *w2, const char *w3,
{
retVal___ = HPMHooks.source.npc.parse_script(w1, w2, w3, w4, start, buffer, filepath, options, retval);
}
- if( HPMHooks.count.HP_npc_parse_script_post ) {
- const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_parse_script_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_script_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, &options, retval);
+ retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, options, retval);
}
}
return retVal___;
}
void HP_npc_add_to_location(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_add_to_location_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_add_to_location_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_add_to_location_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -48951,9 +50059,9 @@ void HP_npc_add_to_location(struct npc_data *nd) {
{
HPMHooks.source.npc.add_to_location(nd);
}
- if( HPMHooks.count.HP_npc_add_to_location_post ) {
+ if (HPMHooks.count.HP_npc_add_to_location_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_add_to_location_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_add_to_location_post[hIndex].func;
postHookFunc(nd);
}
@@ -48963,14 +50071,14 @@ void HP_npc_add_to_location(struct npc_data *nd) {
bool HP_npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_duplicate_script_sub_pre ) {
- bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ if (HPMHooks.count.HP_npc_duplicate_script_sub_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_duplicate_script_sub_pre[hIndex].func;
- retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ retVal___ = preHookFunc(&nd, &snd, &xs, &ys, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -48978,11 +50086,11 @@ bool HP_npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd
{
retVal___ = HPMHooks.source.npc.duplicate_script_sub(nd, snd, xs, ys, options);
}
- if( HPMHooks.count.HP_npc_duplicate_script_sub_post ) {
- bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_duplicate_script_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_script_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_duplicate_script_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ retVal___ = postHookFunc(retVal___, nd, snd, xs, ys, options);
}
}
return retVal___;
@@ -48990,14 +50098,14 @@ bool HP_npc_duplicate_script_sub(struct npc_data *nd, const struct npc_data *snd
bool HP_npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_duplicate_shop_sub_pre ) {
- bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ if (HPMHooks.count.HP_npc_duplicate_shop_sub_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_duplicate_shop_sub_pre[hIndex].func;
- retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ retVal___ = preHookFunc(&nd, &snd, &xs, &ys, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49005,11 +50113,11 @@ bool HP_npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd,
{
retVal___ = HPMHooks.source.npc.duplicate_shop_sub(nd, snd, xs, ys, options);
}
- if( HPMHooks.count.HP_npc_duplicate_shop_sub_post ) {
- bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_duplicate_shop_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_shop_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_duplicate_shop_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ retVal___ = postHookFunc(retVal___, nd, snd, xs, ys, options);
}
}
return retVal___;
@@ -49017,14 +50125,14 @@ bool HP_npc_duplicate_shop_sub(struct npc_data *nd, const struct npc_data *snd,
bool HP_npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_duplicate_warp_sub_pre ) {
- bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ if (HPMHooks.count.HP_npc_duplicate_warp_sub_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_duplicate_warp_sub_pre[hIndex].func;
- retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ retVal___ = preHookFunc(&nd, &snd, &xs, &ys, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49032,11 +50140,11 @@ bool HP_npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd,
{
retVal___ = HPMHooks.source.npc.duplicate_warp_sub(nd, snd, xs, ys, options);
}
- if( HPMHooks.count.HP_npc_duplicate_warp_sub_post ) {
- bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_duplicate_warp_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_warp_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_duplicate_warp_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ retVal___ = postHookFunc(retVal___, nd, snd, xs, ys, options);
}
}
return retVal___;
@@ -49044,14 +50152,14 @@ bool HP_npc_duplicate_warp_sub(struct npc_data *nd, const struct npc_data *snd,
bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_duplicate_sub_pre ) {
- bool (*preHookFunc) (struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
+ if (HPMHooks.count.HP_npc_duplicate_sub_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd, const struct npc_data **snd, int *xs, int *ys, int *options);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_duplicate_sub_pre[hIndex].func;
- retVal___ = preHookFunc(nd, snd, &xs, &ys, &options);
+ retVal___ = preHookFunc(&nd, &snd, &xs, &ys, &options);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49059,11 +50167,11 @@ bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int x
{
retVal___ = HPMHooks.source.npc.duplicate_sub(nd, snd, xs, ys, options);
}
- if( HPMHooks.count.HP_npc_duplicate_sub_post ) {
- bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int *xs, int *ys, int *options);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_duplicate_sub_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, const struct npc_data *snd, int xs, int ys, int options);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_duplicate_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, snd, &xs, &ys, &options);
+ retVal___ = postHookFunc(retVal___, nd, snd, xs, ys, options);
}
}
return retVal___;
@@ -49071,14 +50179,14 @@ bool HP_npc_duplicate_sub(struct npc_data *nd, const struct npc_data *snd, int x
const char* HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_duplicate_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval);
+ if (HPMHooks.count.HP_npc_parse_duplicate_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int *options, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_duplicate_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, &options, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &options, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49086,11 +50194,11 @@ const char* HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w
{
retVal___ = HPMHooks.source.npc.parse_duplicate(w1, w2, w3, w4, start, buffer, filepath, options, retval);
}
- if( HPMHooks.count.HP_npc_parse_duplicate_post ) {
- const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *options, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_parse_duplicate_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int options, int *retval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_duplicate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_duplicate_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, &options, retval);
+ retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, options, retval);
}
}
return retVal___;
@@ -49098,14 +50206,14 @@ const char* HP_npc_parse_duplicate(const char *w1, const char *w2, const char *w
int HP_npc_duplicate4instance(struct npc_data *snd, int16 m) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_duplicate4instance_pre ) {
- int (*preHookFunc) (struct npc_data *snd, int16 *m);
+ if (HPMHooks.count.HP_npc_duplicate4instance_pre > 0) {
+ int (*preHookFunc) (struct npc_data **snd, int16 *m);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate4instance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate4instance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_duplicate4instance_pre[hIndex].func;
- retVal___ = preHookFunc(snd, &m);
+ retVal___ = preHookFunc(&snd, &m);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49113,25 +50221,25 @@ int HP_npc_duplicate4instance(struct npc_data *snd, int16 m) {
{
retVal___ = HPMHooks.source.npc.duplicate4instance(snd, m);
}
- if( HPMHooks.count.HP_npc_duplicate4instance_post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *snd, int16 *m);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate4instance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_duplicate4instance_post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *snd, int16 m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_duplicate4instance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_duplicate4instance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, snd, &m);
+ retVal___ = postHookFunc(retVal___, snd, m);
}
}
return retVal___;
}
void HP_npc_setcells(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_setcells_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_setcells_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_setcells_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_setcells_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_setcells_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49139,9 +50247,9 @@ void HP_npc_setcells(struct npc_data *nd) {
{
HPMHooks.source.npc.setcells(nd);
}
- if( HPMHooks.count.HP_npc_setcells_post ) {
+ if (HPMHooks.count.HP_npc_setcells_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_setcells_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_setcells_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_setcells_post[hIndex].func;
postHookFunc(nd);
}
@@ -49151,16 +50259,16 @@ void HP_npc_setcells(struct npc_data *nd) {
int HP_npc_unsetcells_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_unsetcells_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_npc_unsetcells_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_npc_unsetcells_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49170,9 +50278,9 @@ int HP_npc_unsetcells_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.npc.unsetcells_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_npc_unsetcells_sub_post ) {
+ if (HPMHooks.count.HP_npc_unsetcells_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_npc_unsetcells_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -49183,14 +50291,14 @@ int HP_npc_unsetcells_sub(struct block_list *bl, va_list ap) {
}
void HP_npc_unsetcells(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_unsetcells_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_unsetcells_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_unsetcells_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49198,9 +50306,9 @@ void HP_npc_unsetcells(struct npc_data *nd) {
{
HPMHooks.source.npc.unsetcells(nd);
}
- if( HPMHooks.count.HP_npc_unsetcells_post ) {
+ if (HPMHooks.count.HP_npc_unsetcells_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unsetcells_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_unsetcells_post[hIndex].func;
postHookFunc(nd);
}
@@ -49209,14 +50317,14 @@ void HP_npc_unsetcells(struct npc_data *nd) {
}
void HP_npc_movenpc(struct npc_data *nd, int16 x, int16 y) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_movenpc_pre ) {
- void (*preHookFunc) (struct npc_data *nd, int16 *x, int16 *y);
+ if (HPMHooks.count.HP_npc_movenpc_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int16 *x, int16 *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_movenpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_movenpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_movenpc_pre[hIndex].func;
- preHookFunc(nd, &x, &y);
+ preHookFunc(&nd, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49224,25 +50332,25 @@ void HP_npc_movenpc(struct npc_data *nd, int16 x, int16 y) {
{
HPMHooks.source.npc.movenpc(nd, x, y);
}
- if( HPMHooks.count.HP_npc_movenpc_post ) {
- void (*postHookFunc) (struct npc_data *nd, int16 *x, int16 *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_movenpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_movenpc_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int16 x, int16 y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_movenpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_movenpc_post[hIndex].func;
- postHookFunc(nd, &x, &y);
+ postHookFunc(nd, x, y);
}
}
return;
}
void HP_npc_setdisplayname(struct npc_data *nd, const char *newname) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_setdisplayname_pre ) {
- void (*preHookFunc) (struct npc_data *nd, const char *newname);
+ if (HPMHooks.count.HP_npc_setdisplayname_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, const char **newname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_setdisplayname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_setdisplayname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_setdisplayname_pre[hIndex].func;
- preHookFunc(nd, newname);
+ preHookFunc(&nd, &newname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49250,9 +50358,9 @@ void HP_npc_setdisplayname(struct npc_data *nd, const char *newname) {
{
HPMHooks.source.npc.setdisplayname(nd, newname);
}
- if( HPMHooks.count.HP_npc_setdisplayname_post ) {
+ if (HPMHooks.count.HP_npc_setdisplayname_post > 0) {
void (*postHookFunc) (struct npc_data *nd, const char *newname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_setdisplayname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_setdisplayname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_setdisplayname_post[hIndex].func;
postHookFunc(nd, newname);
}
@@ -49261,14 +50369,14 @@ void HP_npc_setdisplayname(struct npc_data *nd, const char *newname) {
}
void HP_npc_setclass(struct npc_data *nd, short class_) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_setclass_pre ) {
- void (*preHookFunc) (struct npc_data *nd, short *class_);
+ if (HPMHooks.count.HP_npc_setclass_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, short *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_setclass_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_setclass_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_setclass_pre[hIndex].func;
- preHookFunc(nd, &class_);
+ preHookFunc(&nd, &class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49276,11 +50384,11 @@ void HP_npc_setclass(struct npc_data *nd, short class_) {
{
HPMHooks.source.npc.setclass(nd, class_);
}
- if( HPMHooks.count.HP_npc_setclass_post ) {
- void (*postHookFunc) (struct npc_data *nd, short *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_setclass_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_setclass_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, short class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_setclass_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_setclass_post[hIndex].func;
- postHookFunc(nd, &class_);
+ postHookFunc(nd, class_);
}
}
return;
@@ -49288,14 +50396,14 @@ void HP_npc_setclass(struct npc_data *nd, short class_) {
int HP_npc_do_atcmd_event(struct map_session_data *sd, const char *command, const char *message, const char *eventname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_do_atcmd_event_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *command, const char *message, const char *eventname);
+ if (HPMHooks.count.HP_npc_do_atcmd_event_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **command, const char **message, const char **eventname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_atcmd_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_atcmd_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_do_atcmd_event_pre[hIndex].func;
- retVal___ = preHookFunc(sd, command, message, eventname);
+ retVal___ = preHookFunc(&sd, &command, &message, &eventname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49303,9 +50411,9 @@ int HP_npc_do_atcmd_event(struct map_session_data *sd, const char *command, cons
{
retVal___ = HPMHooks.source.npc.do_atcmd_event(sd, command, message, eventname);
}
- if( HPMHooks.count.HP_npc_do_atcmd_event_post ) {
+ if (HPMHooks.count.HP_npc_do_atcmd_event_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *command, const char *message, const char *eventname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_atcmd_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_atcmd_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_do_atcmd_event_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, command, message, eventname);
}
@@ -49315,14 +50423,14 @@ int HP_npc_do_atcmd_event(struct map_session_data *sd, const char *command, cons
const char* HP_npc_parse_function(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_function_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_function_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_function_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49330,9 +50438,9 @@ const char* HP_npc_parse_function(const char *w1, const char *w2, const char *w3
{
retVal___ = HPMHooks.source.npc.parse_function(w1, w2, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_function_post ) {
+ if (HPMHooks.count.HP_npc_parse_function_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_function_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_function_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval);
}
@@ -49341,14 +50449,14 @@ const char* HP_npc_parse_function(const char *w1, const char *w2, const char *w3
}
void HP_npc_parse_mob2(struct spawn_data *mobspawn) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_parse_mob2_pre ) {
- void (*preHookFunc) (struct spawn_data *mobspawn);
+ if (HPMHooks.count.HP_npc_parse_mob2_pre > 0) {
+ void (*preHookFunc) (struct spawn_data **mobspawn);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_mob2_pre[hIndex].func;
- preHookFunc(mobspawn);
+ preHookFunc(&mobspawn);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49356,9 +50464,9 @@ void HP_npc_parse_mob2(struct spawn_data *mobspawn) {
{
HPMHooks.source.npc.parse_mob2(mobspawn);
}
- if( HPMHooks.count.HP_npc_parse_mob2_post ) {
+ if (HPMHooks.count.HP_npc_parse_mob2_post > 0) {
void (*postHookFunc) (struct spawn_data *mobspawn);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_mob2_post[hIndex].func;
postHookFunc(mobspawn);
}
@@ -49368,14 +50476,14 @@ void HP_npc_parse_mob2(struct spawn_data *mobspawn) {
const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_mob_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_mob_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_mob_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49383,9 +50491,9 @@ const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, con
{
retVal___ = HPMHooks.source.npc.parse_mob(w1, w2, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_mob_post ) {
+ if (HPMHooks.count.HP_npc_parse_mob_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mob_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_mob_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval);
}
@@ -49395,14 +50503,14 @@ const char* HP_npc_parse_mob(const char *w1, const char *w2, const char *w3, con
const char* HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_npc_parse_mapflag_pre ) {
- const char* (*preHookFunc) (const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_mapflag_pre > 0) {
+ const char* (*preHookFunc) (const char **w1, const char **w2, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_mapflag_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, retval);
+ retVal___ = preHookFunc(&w1, &w2, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49410,9 +50518,9 @@ const char* HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3,
{
retVal___ = HPMHooks.source.npc.parse_mapflag(w1, w2, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_mapflag_post ) {
+ if (HPMHooks.count.HP_npc_parse_mapflag_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *w1, const char *w2, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_mapflag_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_mapflag_post[hIndex].func;
retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, retval);
}
@@ -49421,14 +50529,14 @@ const char* HP_npc_parse_mapflag(const char *w1, const char *w2, const char *w3,
}
void HP_npc_parse_unknown_mapflag(const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_parse_unknown_mapflag_pre ) {
- void (*preHookFunc) (const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
+ if (HPMHooks.count.HP_npc_parse_unknown_mapflag_pre > 0) {
+ void (*preHookFunc) (const char **name, const char **w3, const char **w4, const char **start, const char **buffer, const char **filepath, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_mapflag_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_mapflag_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parse_unknown_mapflag_pre[hIndex].func;
- preHookFunc(name, w3, w4, start, buffer, filepath, retval);
+ preHookFunc(&name, &w3, &w4, &start, &buffer, &filepath, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49436,9 +50544,9 @@ void HP_npc_parse_unknown_mapflag(const char *name, const char *w3, const char *
{
HPMHooks.source.npc.parse_unknown_mapflag(name, w3, w4, start, buffer, filepath, retval);
}
- if( HPMHooks.count.HP_npc_parse_unknown_mapflag_post ) {
+ if (HPMHooks.count.HP_npc_parse_unknown_mapflag_post > 0) {
void (*postHookFunc) (const char *name, const char *w3, const char *w4, const char *start, const char *buffer, const char *filepath, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_mapflag_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_unknown_mapflag_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parse_unknown_mapflag_post[hIndex].func;
postHookFunc(name, w3, w4, start, buffer, filepath, retval);
}
@@ -49448,14 +50556,14 @@ void HP_npc_parse_unknown_mapflag(const char *name, const char *w3, const char *
int HP_npc_parsesrcfile(const char *filepath, bool runOnInit) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_parsesrcfile_pre ) {
- int (*preHookFunc) (const char *filepath, bool *runOnInit);
+ if (HPMHooks.count.HP_npc_parsesrcfile_pre > 0) {
+ int (*preHookFunc) (const char **filepath, bool *runOnInit);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsesrcfile_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsesrcfile_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_parsesrcfile_pre[hIndex].func;
- retVal___ = preHookFunc(filepath, &runOnInit);
+ retVal___ = preHookFunc(&filepath, &runOnInit);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49463,11 +50571,11 @@ int HP_npc_parsesrcfile(const char *filepath, bool runOnInit) {
{
retVal___ = HPMHooks.source.npc.parsesrcfile(filepath, runOnInit);
}
- if( HPMHooks.count.HP_npc_parsesrcfile_post ) {
- int (*postHookFunc) (int retVal___, const char *filepath, bool *runOnInit);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsesrcfile_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_parsesrcfile_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *filepath, bool runOnInit);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_parsesrcfile_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_parsesrcfile_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, filepath, &runOnInit);
+ retVal___ = postHookFunc(retVal___, filepath, runOnInit);
}
}
return retVal___;
@@ -49475,14 +50583,14 @@ int HP_npc_parsesrcfile(const char *filepath, bool runOnInit) {
int HP_npc_script_event(struct map_session_data *sd, enum npce_event type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_script_event_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, enum npce_event *type);
+ if (HPMHooks.count.HP_npc_script_event_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, enum npce_event *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_script_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_script_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_script_event_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49490,25 +50598,25 @@ int HP_npc_script_event(struct map_session_data *sd, enum npce_event type) {
{
retVal___ = HPMHooks.source.npc.script_event(sd, type);
}
- if( HPMHooks.count.HP_npc_script_event_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum npce_event *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_script_event_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_script_event_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum npce_event type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_script_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_script_event_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
}
void HP_npc_read_event_script(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_read_event_script_pre ) {
+ if (HPMHooks.count.HP_npc_read_event_script_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_read_event_script_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_read_event_script_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_read_event_script_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49516,28 +50624,28 @@ void HP_npc_read_event_script(void) {
{
HPMHooks.source.npc.read_event_script();
}
- if( HPMHooks.count.HP_npc_read_event_script_post ) {
+ if (HPMHooks.count.HP_npc_read_event_script_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_read_event_script_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_read_event_script_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_read_event_script_post[hIndex].func;
postHookFunc();
}
}
return;
}
-int HP_npc_path_db_clear_sub(DBKey key, DBData *data, va_list args) {
+int HP_npc_path_db_clear_sub(union DBKey key, struct DBData *data, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_path_db_clear_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list args);
+ if (HPMHooks.count.HP_npc_path_db_clear_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_path_db_clear_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_path_db_clear_sub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_npc_path_db_clear_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, args___copy);
+ retVal___ = preHookFunc(&key, &data, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49547,30 +50655,30 @@ int HP_npc_path_db_clear_sub(DBKey key, DBData *data, va_list args) {
retVal___ = HPMHooks.source.npc.path_db_clear_sub(key, data, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_npc_path_db_clear_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_path_db_clear_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_path_db_clear_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_path_db_clear_sub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_npc_path_db_clear_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, args___copy);
+ retVal___ = postHookFunc(retVal___, key, data, args___copy);
va_end(args___copy);
}
}
return retVal___;
}
-int HP_npc_ev_label_db_clear_sub(DBKey key, DBData *data, va_list args) {
+int HP_npc_ev_label_db_clear_sub(union DBKey key, struct DBData *data, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_ev_label_db_clear_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list args);
+ if (HPMHooks.count.HP_npc_ev_label_db_clear_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_ev_label_db_clear_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_ev_label_db_clear_sub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_npc_ev_label_db_clear_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, args___copy);
+ retVal___ = preHookFunc(&key, &data, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49580,12 +50688,12 @@ int HP_npc_ev_label_db_clear_sub(DBKey key, DBData *data, va_list args) {
retVal___ = HPMHooks.source.npc.ev_label_db_clear_sub(key, data, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_npc_ev_label_db_clear_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_ev_label_db_clear_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_ev_label_db_clear_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_ev_label_db_clear_sub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_npc_ev_label_db_clear_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, args___copy);
+ retVal___ = postHookFunc(retVal___, key, data, args___copy);
va_end(args___copy);
}
}
@@ -49594,14 +50702,14 @@ int HP_npc_ev_label_db_clear_sub(DBKey key, DBData *data, va_list args) {
int HP_npc_reload(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_reload_pre ) {
+ if (HPMHooks.count.HP_npc_reload_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_reload_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49609,9 +50717,9 @@ int HP_npc_reload(void) {
{
retVal___ = HPMHooks.source.npc.reload();
}
- if( HPMHooks.count.HP_npc_reload_post ) {
+ if (HPMHooks.count.HP_npc_reload_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_reload_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -49621,14 +50729,14 @@ int HP_npc_reload(void) {
bool HP_npc_unloadfile(const char *filepath) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_unloadfile_pre ) {
- bool (*preHookFunc) (const char *filepath);
+ if (HPMHooks.count.HP_npc_unloadfile_pre > 0) {
+ bool (*preHookFunc) (const char **filepath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unloadfile_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unloadfile_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_unloadfile_pre[hIndex].func;
- retVal___ = preHookFunc(filepath);
+ retVal___ = preHookFunc(&filepath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49636,9 +50744,9 @@ bool HP_npc_unloadfile(const char *filepath) {
{
retVal___ = HPMHooks.source.npc.unloadfile(filepath);
}
- if( HPMHooks.count.HP_npc_unloadfile_post ) {
+ if (HPMHooks.count.HP_npc_unloadfile_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *filepath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_unloadfile_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_unloadfile_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_unloadfile_post[hIndex].func;
retVal___ = postHookFunc(retVal___, filepath);
}
@@ -49647,14 +50755,14 @@ bool HP_npc_unloadfile(const char *filepath) {
}
void HP_npc_do_clear_npc(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_do_clear_npc_pre ) {
+ if (HPMHooks.count.HP_npc_do_clear_npc_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_clear_npc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_clear_npc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_do_clear_npc_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49662,9 +50770,9 @@ void HP_npc_do_clear_npc(void) {
{
HPMHooks.source.npc.do_clear_npc();
}
- if( HPMHooks.count.HP_npc_do_clear_npc_post ) {
+ if (HPMHooks.count.HP_npc_do_clear_npc_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_clear_npc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_do_clear_npc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_do_clear_npc_post[hIndex].func;
postHookFunc();
}
@@ -49673,14 +50781,14 @@ void HP_npc_do_clear_npc(void) {
}
void HP_npc_debug_warps_sub(struct npc_data *nd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_debug_warps_sub_pre ) {
- void (*preHookFunc) (struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_debug_warps_sub_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_debug_warps_sub_pre[hIndex].func;
- preHookFunc(nd);
+ preHookFunc(&nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49688,9 +50796,9 @@ void HP_npc_debug_warps_sub(struct npc_data *nd) {
{
HPMHooks.source.npc.debug_warps_sub(nd);
}
- if( HPMHooks.count.HP_npc_debug_warps_sub_post ) {
+ if (HPMHooks.count.HP_npc_debug_warps_sub_post > 0) {
void (*postHookFunc) (struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_debug_warps_sub_post[hIndex].func;
postHookFunc(nd);
}
@@ -49699,14 +50807,14 @@ void HP_npc_debug_warps_sub(struct npc_data *nd) {
}
void HP_npc_debug_warps(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_debug_warps_pre ) {
+ if (HPMHooks.count.HP_npc_debug_warps_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_debug_warps_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49714,9 +50822,9 @@ void HP_npc_debug_warps(void) {
{
HPMHooks.source.npc.debug_warps();
}
- if( HPMHooks.count.HP_npc_debug_warps_post ) {
+ if (HPMHooks.count.HP_npc_debug_warps_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_debug_warps_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_debug_warps_post[hIndex].func;
postHookFunc();
}
@@ -49725,14 +50833,14 @@ void HP_npc_debug_warps(void) {
}
void HP_npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_trader_count_funds_pre ) {
- void (*preHookFunc) (struct npc_data *nd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_npc_trader_count_funds_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_count_funds_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_count_funds_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_trader_count_funds_pre[hIndex].func;
- preHookFunc(nd, sd);
+ preHookFunc(&nd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49740,9 +50848,9 @@ void HP_npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd)
{
HPMHooks.source.npc.trader_count_funds(nd, sd);
}
- if( HPMHooks.count.HP_npc_trader_count_funds_post ) {
+ if (HPMHooks.count.HP_npc_trader_count_funds_post > 0) {
void (*postHookFunc) (struct npc_data *nd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_count_funds_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_count_funds_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_trader_count_funds_post[hIndex].func;
postHookFunc(nd, sd);
}
@@ -49752,14 +50860,14 @@ void HP_npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd)
bool HP_npc_trader_pay(struct npc_data *nd, struct map_session_data *sd, int price, int points) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_trader_pay_pre ) {
- bool (*preHookFunc) (struct npc_data *nd, struct map_session_data *sd, int *price, int *points);
+ if (HPMHooks.count.HP_npc_trader_pay_pre > 0) {
+ bool (*preHookFunc) (struct npc_data **nd, struct map_session_data **sd, int *price, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_pay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_pay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_trader_pay_pre[hIndex].func;
- retVal___ = preHookFunc(nd, sd, &price, &points);
+ retVal___ = preHookFunc(&nd, &sd, &price, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49767,25 +50875,25 @@ bool HP_npc_trader_pay(struct npc_data *nd, struct map_session_data *sd, int pri
{
retVal___ = HPMHooks.source.npc.trader_pay(nd, sd, price, points);
}
- if( HPMHooks.count.HP_npc_trader_pay_post ) {
- bool (*postHookFunc) (bool retVal___, struct npc_data *nd, struct map_session_data *sd, int *price, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_pay_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_trader_pay_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, struct map_session_data *sd, int price, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_pay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_trader_pay_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, sd, &price, &points);
+ retVal___ = postHookFunc(retVal___, nd, sd, price, points);
}
}
return retVal___;
}
void HP_npc_trader_update(int master) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_trader_update_pre ) {
+ if (HPMHooks.count.HP_npc_trader_update_pre > 0) {
void (*preHookFunc) (int *master);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_trader_update_pre[hIndex].func;
preHookFunc(&master);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49793,38 +50901,38 @@ void HP_npc_trader_update(int master) {
{
HPMHooks.source.npc.trader_update(master);
}
- if( HPMHooks.count.HP_npc_trader_update_post ) {
- void (*postHookFunc) (int *master);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_trader_update_post > 0) {
+ void (*postHookFunc) (int master);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_trader_update_post[hIndex].func;
- postHookFunc(&master);
+ postHookFunc(master);
}
}
return;
}
-int HP_npc_market_buylist(struct map_session_data *sd, unsigned short list_size, struct packet_npc_market_purchase *p) {
+int HP_npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_market_buylist_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, unsigned short *list_size, struct packet_npc_market_purchase *p);
+ if (HPMHooks.count.HP_npc_market_buylist_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct itemlist **item_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_buylist_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &list_size, p);
+ retVal___ = preHookFunc(&sd, &item_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.npc.market_buylist(sd, list_size, p);
+ retVal___ = HPMHooks.source.npc.market_buylist(sd, item_list);
}
- if( HPMHooks.count.HP_npc_market_buylist_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short *list_size, struct packet_npc_market_purchase *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_market_buylist_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_buylist_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &list_size, p);
+ retVal___ = postHookFunc(retVal___, sd, item_list);
}
}
return retVal___;
@@ -49832,14 +50940,14 @@ int HP_npc_market_buylist(struct map_session_data *sd, unsigned short list_size,
bool HP_npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_trader_open_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ if (HPMHooks.count.HP_npc_trader_open_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_trader_open_pre[hIndex].func;
- retVal___ = preHookFunc(sd, nd);
+ retVal___ = preHookFunc(&sd, &nd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49847,9 +50955,9 @@ bool HP_npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
{
retVal___ = HPMHooks.source.npc.trader_open(sd, nd);
}
- if( HPMHooks.count.HP_npc_trader_open_post ) {
+ if (HPMHooks.count.HP_npc_trader_open_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct npc_data *nd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_trader_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, nd);
}
@@ -49858,14 +50966,14 @@ bool HP_npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
}
void HP_npc_market_fromsql(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_market_fromsql_pre ) {
+ if (HPMHooks.count.HP_npc_market_fromsql_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_fromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_fromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_fromsql_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49873,9 +50981,9 @@ void HP_npc_market_fromsql(void) {
{
HPMHooks.source.npc.market_fromsql();
}
- if( HPMHooks.count.HP_npc_market_fromsql_post ) {
+ if (HPMHooks.count.HP_npc_market_fromsql_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_fromsql_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_fromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_fromsql_post[hIndex].func;
postHookFunc();
}
@@ -49884,14 +50992,14 @@ void HP_npc_market_fromsql(void) {
}
void HP_npc_market_tosql(struct npc_data *nd, unsigned short index) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_market_tosql_pre ) {
- void (*preHookFunc) (struct npc_data *nd, unsigned short *index);
+ if (HPMHooks.count.HP_npc_market_tosql_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, unsigned short *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_tosql_pre[hIndex].func;
- preHookFunc(nd, &index);
+ preHookFunc(&nd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49899,25 +51007,25 @@ void HP_npc_market_tosql(struct npc_data *nd, unsigned short index) {
{
HPMHooks.source.npc.market_tosql(nd, index);
}
- if( HPMHooks.count.HP_npc_market_tosql_post ) {
- void (*postHookFunc) (struct npc_data *nd, unsigned short *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_market_tosql_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, unsigned short index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_tosql_post[hIndex].func;
- postHookFunc(nd, &index);
+ postHookFunc(nd, index);
}
}
return;
}
void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_market_delfromsql_pre ) {
- void (*preHookFunc) (struct npc_data *nd, unsigned short *index);
+ if (HPMHooks.count.HP_npc_market_delfromsql_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, unsigned short *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_delfromsql_pre[hIndex].func;
- preHookFunc(nd, &index);
+ preHookFunc(&nd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49925,25 +51033,25 @@ void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
{
HPMHooks.source.npc.market_delfromsql(nd, index);
}
- if( HPMHooks.count.HP_npc_market_delfromsql_post ) {
- void (*postHookFunc) (struct npc_data *nd, unsigned short *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_market_delfromsql_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, unsigned short index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_delfromsql_post[hIndex].func;
- postHookFunc(nd, &index);
+ postHookFunc(nd, index);
}
}
return;
}
void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
int hIndex = 0;
- if( HPMHooks.count.HP_npc_market_delfromsql_sub_pre ) {
- void (*preHookFunc) (const char *npcname, unsigned short *index);
+ if (HPMHooks.count.HP_npc_market_delfromsql_sub_pre > 0) {
+ void (*preHookFunc) (const char **npcname, unsigned short *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_delfromsql_sub_pre[hIndex].func;
- preHookFunc(npcname, &index);
+ preHookFunc(&npcname, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -49951,11 +51059,11 @@ void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
{
HPMHooks.source.npc.market_delfromsql_sub(npcname, index);
}
- if( HPMHooks.count.HP_npc_market_delfromsql_sub_post ) {
- void (*postHookFunc) (const char *npcname, unsigned short *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_market_delfromsql_sub_post > 0) {
+ void (*postHookFunc) (const char *npcname, unsigned short index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_delfromsql_sub_post[hIndex].func;
- postHookFunc(npcname, &index);
+ postHookFunc(npcname, index);
}
}
return;
@@ -49963,14 +51071,14 @@ void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
bool HP_npc_db_checkid(const int id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_npc_db_checkid_pre ) {
+ if (HPMHooks.count.HP_npc_db_checkid_pre > 0) {
bool (*preHookFunc) (const int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_db_checkid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_db_checkid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_db_checkid_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -49978,11 +51086,11 @@ bool HP_npc_db_checkid(const int id) {
{
retVal___ = HPMHooks.source.npc.db_checkid(id);
}
- if( HPMHooks.count.HP_npc_db_checkid_post ) {
- bool (*postHookFunc) (bool retVal___, const int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_db_checkid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_db_checkid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_db_checkid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_db_checkid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -49990,14 +51098,14 @@ bool HP_npc_db_checkid(const int id) {
int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_npc_secure_timeout_timer_pre ) {
+ if (HPMHooks.count.HP_npc_secure_timeout_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_secure_timeout_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_secure_timeout_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_secure_timeout_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50005,26 +51113,26 @@ int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.npc.secure_timeout_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_npc_secure_timeout_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_secure_timeout_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_npc_secure_timeout_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_secure_timeout_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_secure_timeout_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-/* nullpo */
+/* nullpo_interface */
void HP_nullpo_assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
int hIndex = 0;
- if( HPMHooks.count.HP_nullpo_assert_report_pre ) {
- void (*preHookFunc) (const char *file, int *line, const char *func, const char *targetname, const char *title);
+ if (HPMHooks.count.HP_nullpo_assert_report_pre > 0) {
+ void (*preHookFunc) (const char **file, int *line, const char **func, const char **targetname, const char **title);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_nullpo_assert_report_pre[hIndex].func;
- preHookFunc(file, &line, func, targetname, title);
+ preHookFunc(&file, &line, &func, &targetname, &title);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50032,26 +51140,26 @@ void HP_nullpo_assert_report(const char *file, int line, const char *func, const
{
HPMHooks.source.nullpo.assert_report(file, line, func, targetname, title);
}
- if( HPMHooks.count.HP_nullpo_assert_report_post ) {
- void (*postHookFunc) (const char *file, int *line, const char *func, const char *targetname, const char *title);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_post; hIndex++ ) {
+ if (HPMHooks.count.HP_nullpo_assert_report_post > 0) {
+ void (*postHookFunc) (const char *file, int line, const char *func, const char *targetname, const char *title);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_nullpo_assert_report_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_nullpo_assert_report_post[hIndex].func;
- postHookFunc(file, &line, func, targetname, title);
+ postHookFunc(file, line, func, targetname, title);
}
}
return;
}
-/* party */
+/* party_interface */
void HP_party_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_init_pre ) {
+ if (HPMHooks.count.HP_party_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50059,25 +51167,25 @@ void HP_party_init(bool minimal) {
{
HPMHooks.source.party.init(minimal);
}
- if( HPMHooks.count.HP_party_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_party_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_final_pre ) {
+ if (HPMHooks.count.HP_party_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50085,9 +51193,9 @@ void HP_party_final(void) {
{
HPMHooks.source.party.final();
}
- if( HPMHooks.count.HP_party_final_post ) {
+ if (HPMHooks.count.HP_party_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_final_post[hIndex].func;
postHookFunc();
}
@@ -50097,14 +51205,14 @@ void HP_party_final(void) {
struct party_data* HP_party_search(int party_id) {
int hIndex = 0;
struct party_data* retVal___ = NULL;
- if( HPMHooks.count.HP_party_search_pre ) {
+ if (HPMHooks.count.HP_party_search_pre > 0) {
struct party_data* (*preHookFunc) (int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_search_pre[hIndex].func;
retVal___ = preHookFunc(&party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50112,11 +51220,11 @@ struct party_data* HP_party_search(int party_id) {
{
retVal___ = HPMHooks.source.party.search(party_id);
}
- if( HPMHooks.count.HP_party_search_post ) {
- struct party_data* (*postHookFunc) (struct party_data* retVal___, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_search_post > 0) {
+ struct party_data* (*postHookFunc) (struct party_data* retVal___, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id);
+ retVal___ = postHookFunc(retVal___, party_id);
}
}
return retVal___;
@@ -50124,14 +51232,14 @@ struct party_data* HP_party_search(int party_id) {
struct party_data* HP_party_searchname(const char *str) {
int hIndex = 0;
struct party_data* retVal___ = NULL;
- if( HPMHooks.count.HP_party_searchname_pre ) {
- struct party_data* (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_party_searchname_pre > 0) {
+ struct party_data* (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_searchname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_searchname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_searchname_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50139,9 +51247,9 @@ struct party_data* HP_party_searchname(const char *str) {
{
retVal___ = HPMHooks.source.party.searchname(str);
}
- if( HPMHooks.count.HP_party_searchname_post ) {
+ if (HPMHooks.count.HP_party_searchname_post > 0) {
struct party_data* (*postHookFunc) (struct party_data* retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_searchname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_searchname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_searchname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -50151,14 +51259,14 @@ struct party_data* HP_party_searchname(const char *str) {
int HP_party_getmemberid(struct party_data *p, struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_getmemberid_pre ) {
- int (*preHookFunc) (struct party_data *p, struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_getmemberid_pre > 0) {
+ int (*preHookFunc) (struct party_data **p, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_getmemberid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_getmemberid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_getmemberid_pre[hIndex].func;
- retVal___ = preHookFunc(p, sd);
+ retVal___ = preHookFunc(&p, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50166,9 +51274,9 @@ int HP_party_getmemberid(struct party_data *p, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.party.getmemberid(p, sd);
}
- if( HPMHooks.count.HP_party_getmemberid_post ) {
+ if (HPMHooks.count.HP_party_getmemberid_post > 0) {
int (*postHookFunc) (int retVal___, struct party_data *p, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_getmemberid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_getmemberid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_getmemberid_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p, sd);
}
@@ -50178,14 +51286,14 @@ int HP_party_getmemberid(struct party_data *p, struct map_session_data *sd) {
struct map_session_data* HP_party_getavailablesd(struct party_data *p) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_party_getavailablesd_pre ) {
- struct map_session_data* (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_party_getavailablesd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_getavailablesd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_getavailablesd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_getavailablesd_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50193,26 +51301,26 @@ struct map_session_data* HP_party_getavailablesd(struct party_data *p) {
{
retVal___ = HPMHooks.source.party.getavailablesd(p);
}
- if( HPMHooks.count.HP_party_getavailablesd_post ) {
+ if (HPMHooks.count.HP_party_getavailablesd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_getavailablesd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_getavailablesd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_getavailablesd_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
}
return retVal___;
}
-int HP_party_create(struct map_session_data *sd, char *name, int item, int item2) {
+int HP_party_create(struct map_session_data *sd, const char *name, int item, int item2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_create_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *name, int *item, int *item2);
+ if (HPMHooks.count.HP_party_create_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name, int *item, int *item2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name, &item, &item2);
+ retVal___ = preHookFunc(&sd, &name, &item, &item2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50220,25 +51328,25 @@ int HP_party_create(struct map_session_data *sd, char *name, int item, int item2
{
retVal___ = HPMHooks.source.party.create(sd, name, item, item2);
}
- if( HPMHooks.count.HP_party_create_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *name, int *item, int *item2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_create_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name, int item, int item2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, name, &item, &item2);
+ retVal___ = postHookFunc(retVal___, sd, name, item, item2);
}
}
return retVal___;
}
-void HP_party_created(int account_id, int char_id, int fail, int party_id, char *name) {
+void HP_party_created(int account_id, int char_id, int fail, int party_id, const char *name) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_created_pre ) {
- void (*preHookFunc) (int *account_id, int *char_id, int *fail, int *party_id, char *name);
+ if (HPMHooks.count.HP_party_created_pre > 0) {
+ void (*preHookFunc) (int *account_id, int *char_id, int *fail, int *party_id, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_created_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_created_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_created_pre[hIndex].func;
- preHookFunc(&account_id, &char_id, &fail, &party_id, name);
+ preHookFunc(&account_id, &char_id, &fail, &party_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50246,11 +51354,11 @@ void HP_party_created(int account_id, int char_id, int fail, int party_id, char
{
HPMHooks.source.party.created(account_id, char_id, fail, party_id, name);
}
- if( HPMHooks.count.HP_party_created_post ) {
- void (*postHookFunc) (int *account_id, int *char_id, int *fail, int *party_id, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_created_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_created_post > 0) {
+ void (*postHookFunc) (int account_id, int char_id, int fail, int party_id, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_created_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_created_post[hIndex].func;
- postHookFunc(&account_id, &char_id, &fail, &party_id, name);
+ postHookFunc(account_id, char_id, fail, party_id, name);
}
}
return;
@@ -50258,14 +51366,14 @@ void HP_party_created(int account_id, int char_id, int fail, int party_id, char
int HP_party_request_info(int party_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_request_info_pre ) {
+ if (HPMHooks.count.HP_party_request_info_pre > 0) {
int (*preHookFunc) (int *party_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_request_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_request_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_request_info_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50273,11 +51381,11 @@ int HP_party_request_info(int party_id, int char_id) {
{
retVal___ = HPMHooks.source.party.request_info(party_id, char_id);
}
- if( HPMHooks.count.HP_party_request_info_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_request_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_request_info_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_request_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_request_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, char_id);
}
}
return retVal___;
@@ -50285,14 +51393,14 @@ int HP_party_request_info(int party_id, int char_id) {
int HP_party_invite(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_invite_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_party_invite_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_invite_pre[hIndex].func;
- retVal___ = preHookFunc(sd, tsd);
+ retVal___ = preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50300,9 +51408,9 @@ int HP_party_invite(struct map_session_data *sd, struct map_session_data *tsd) {
{
retVal___ = HPMHooks.source.party.invite(sd, tsd);
}
- if( HPMHooks.count.HP_party_invite_post ) {
+ if (HPMHooks.count.HP_party_invite_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_invite_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_invite_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, tsd);
}
@@ -50311,14 +51419,14 @@ int HP_party_invite(struct map_session_data *sd, struct map_session_data *tsd) {
}
void HP_party_member_joined(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_member_joined_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_member_joined_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_member_joined_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_member_joined_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_member_joined_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50326,9 +51434,9 @@ void HP_party_member_joined(struct map_session_data *sd) {
{
HPMHooks.source.party.member_joined(sd);
}
- if( HPMHooks.count.HP_party_member_joined_post ) {
+ if (HPMHooks.count.HP_party_member_joined_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_member_joined_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_member_joined_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_member_joined_post[hIndex].func;
postHookFunc(sd);
}
@@ -50338,14 +51446,14 @@ void HP_party_member_joined(struct map_session_data *sd) {
int HP_party_member_added(int party_id, int account_id, int char_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_member_added_pre ) {
+ if (HPMHooks.count.HP_party_member_added_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_member_added_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_member_added_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_member_added_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50353,11 +51461,11 @@ int HP_party_member_added(int party_id, int account_id, int char_id, int flag) {
{
retVal___ = HPMHooks.source.party.member_added(party_id, account_id, char_id, flag);
}
- if( HPMHooks.count.HP_party_member_added_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_member_added_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_member_added_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_member_added_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_member_added_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id, &flag);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id, flag);
}
}
return retVal___;
@@ -50365,14 +51473,14 @@ int HP_party_member_added(int party_id, int account_id, int char_id, int flag) {
int HP_party_leave(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_leave_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_leave_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_leave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_leave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_leave_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50380,26 +51488,26 @@ int HP_party_leave(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.party.leave(sd);
}
- if( HPMHooks.count.HP_party_leave_post ) {
+ if (HPMHooks.count.HP_party_leave_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_leave_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_leave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_leave_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-int HP_party_removemember(struct map_session_data *sd, int account_id, char *name) {
+int HP_party_removemember(struct map_session_data *sd, int account_id, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_removemember_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *account_id, char *name);
+ if (HPMHooks.count.HP_party_removemember_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *account_id, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_removemember_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_removemember_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_removemember_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &account_id, name);
+ retVal___ = preHookFunc(&sd, &account_id, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50407,11 +51515,11 @@ int HP_party_removemember(struct map_session_data *sd, int account_id, char *nam
{
retVal___ = HPMHooks.source.party.removemember(sd, account_id, name);
}
- if( HPMHooks.count.HP_party_removemember_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *account_id, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_removemember_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_removemember_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int account_id, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_removemember_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_removemember_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &account_id, name);
+ retVal___ = postHookFunc(retVal___, sd, account_id, name);
}
}
return retVal___;
@@ -50419,14 +51527,14 @@ int HP_party_removemember(struct map_session_data *sd, int account_id, char *nam
int HP_party_member_withdraw(int party_id, int account_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_member_withdraw_pre ) {
+ if (HPMHooks.count.HP_party_member_withdraw_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_member_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_member_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_member_withdraw_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50434,25 +51542,25 @@ int HP_party_member_withdraw(int party_id, int account_id, int char_id) {
{
retVal___ = HPMHooks.source.party.member_withdraw(party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_party_member_withdraw_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_member_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_member_withdraw_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_member_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_member_withdraw_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id);
}
}
return retVal___;
}
void HP_party_reply_invite(struct map_session_data *sd, int party_id, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_reply_invite_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *party_id, int *flag);
+ if (HPMHooks.count.HP_party_reply_invite_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *party_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_reply_invite_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_reply_invite_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_reply_invite_pre[hIndex].func;
- preHookFunc(sd, &party_id, &flag);
+ preHookFunc(&sd, &party_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50460,11 +51568,11 @@ void HP_party_reply_invite(struct map_session_data *sd, int party_id, int flag)
{
HPMHooks.source.party.reply_invite(sd, party_id, flag);
}
- if( HPMHooks.count.HP_party_reply_invite_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *party_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_reply_invite_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_reply_invite_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int party_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_reply_invite_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_reply_invite_post[hIndex].func;
- postHookFunc(sd, &party_id, &flag);
+ postHookFunc(sd, party_id, flag);
}
}
return;
@@ -50472,14 +51580,14 @@ void HP_party_reply_invite(struct map_session_data *sd, int party_id, int flag)
int HP_party_recv_noinfo(int party_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_recv_noinfo_pre ) {
+ if (HPMHooks.count.HP_party_recv_noinfo_pre > 0) {
int (*preHookFunc) (int *party_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_noinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_noinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recv_noinfo_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50487,26 +51595,26 @@ int HP_party_recv_noinfo(int party_id, int char_id) {
{
retVal___ = HPMHooks.source.party.recv_noinfo(party_id, char_id);
}
- if( HPMHooks.count.HP_party_recv_noinfo_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_noinfo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_recv_noinfo_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_noinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recv_noinfo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, char_id);
}
}
return retVal___;
}
-int HP_party_recv_info(struct party *sp, int char_id) {
+int HP_party_recv_info(const struct party *sp, int char_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_recv_info_pre ) {
- int (*preHookFunc) (struct party *sp, int *char_id);
+ if (HPMHooks.count.HP_party_recv_info_pre > 0) {
+ int (*preHookFunc) (const struct party **sp, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_info_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_info_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recv_info_pre[hIndex].func;
- retVal___ = preHookFunc(sp, &char_id);
+ retVal___ = preHookFunc(&sp, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50514,11 +51622,11 @@ int HP_party_recv_info(struct party *sp, int char_id) {
{
retVal___ = HPMHooks.source.party.recv_info(sp, char_id);
}
- if( HPMHooks.count.HP_party_recv_info_post ) {
- int (*postHookFunc) (int retVal___, struct party *sp, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_info_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_recv_info_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct party *sp, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_info_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recv_info_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sp, &char_id);
+ retVal___ = postHookFunc(retVal___, sp, char_id);
}
}
return retVal___;
@@ -50526,14 +51634,14 @@ int HP_party_recv_info(struct party *sp, int char_id) {
int HP_party_recv_movemap(int party_id, int account_id, int char_id, unsigned short mapid, int online, int lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_recv_movemap_pre ) {
+ if (HPMHooks.count.HP_party_recv_movemap_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *char_id, unsigned short *mapid, int *online, int *lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_movemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_movemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recv_movemap_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id, &mapid, &online, &lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50541,11 +51649,11 @@ int HP_party_recv_movemap(int party_id, int account_id, int char_id, unsigned sh
{
retVal___ = HPMHooks.source.party.recv_movemap(party_id, account_id, char_id, mapid, online, lv);
}
- if( HPMHooks.count.HP_party_recv_movemap_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *char_id, unsigned short *mapid, int *online, int *lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_movemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_recv_movemap_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int char_id, unsigned short mapid, int online, int lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_movemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recv_movemap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id, &mapid, &online, &lv);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id, mapid, online, lv);
}
}
return retVal___;
@@ -50553,14 +51661,14 @@ int HP_party_recv_movemap(int party_id, int account_id, int char_id, unsigned sh
int HP_party_broken(int party_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_broken_pre ) {
+ if (HPMHooks.count.HP_party_broken_pre > 0) {
int (*preHookFunc) (int *party_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_broken_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_broken_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_broken_pre[hIndex].func;
retVal___ = preHookFunc(&party_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50568,11 +51676,11 @@ int HP_party_broken(int party_id) {
{
retVal___ = HPMHooks.source.party.broken(party_id);
}
- if( HPMHooks.count.HP_party_broken_post ) {
- int (*postHookFunc) (int retVal___, int *party_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_broken_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_broken_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_broken_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_broken_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id);
+ retVal___ = postHookFunc(retVal___, party_id);
}
}
return retVal___;
@@ -50580,14 +51688,14 @@ int HP_party_broken(int party_id) {
int HP_party_optionchanged(int party_id, int account_id, int exp, int item, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_optionchanged_pre ) {
+ if (HPMHooks.count.HP_party_optionchanged_pre > 0) {
int (*preHookFunc) (int *party_id, int *account_id, int *exp, int *item, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_optionchanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_optionchanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_optionchanged_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &exp, &item, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50595,11 +51703,11 @@ int HP_party_optionchanged(int party_id, int account_id, int exp, int item, int
{
retVal___ = HPMHooks.source.party.optionchanged(party_id, account_id, exp, item, flag);
}
- if( HPMHooks.count.HP_party_optionchanged_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, int *exp, int *item, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_optionchanged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_optionchanged_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, int exp, int item, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_optionchanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_optionchanged_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &exp, &item, &flag);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, exp, item, flag);
}
}
return retVal___;
@@ -50607,14 +51715,14 @@ int HP_party_optionchanged(int party_id, int account_id, int exp, int item, int
int HP_party_changeoption(struct map_session_data *sd, int exp, int item) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_changeoption_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *exp, int *item);
+ if (HPMHooks.count.HP_party_changeoption_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *exp, int *item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_changeoption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_changeoption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_changeoption_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &exp, &item);
+ retVal___ = preHookFunc(&sd, &exp, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50622,11 +51730,11 @@ int HP_party_changeoption(struct map_session_data *sd, int exp, int item) {
{
retVal___ = HPMHooks.source.party.changeoption(sd, exp, item);
}
- if( HPMHooks.count.HP_party_changeoption_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *exp, int *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_changeoption_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_changeoption_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int exp, int item);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_changeoption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_changeoption_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &exp, &item);
+ retVal___ = postHookFunc(retVal___, sd, exp, item);
}
}
return retVal___;
@@ -50634,14 +51742,14 @@ int HP_party_changeoption(struct map_session_data *sd, int exp, int item) {
bool HP_party_changeleader(struct map_session_data *sd, struct map_session_data *t_sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_party_changeleader_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct map_session_data *t_sd);
+ if (HPMHooks.count.HP_party_changeleader_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, struct map_session_data **t_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_changeleader_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_changeleader_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_changeleader_pre[hIndex].func;
- retVal___ = preHookFunc(sd, t_sd);
+ retVal___ = preHookFunc(&sd, &t_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50649,9 +51757,9 @@ bool HP_party_changeleader(struct map_session_data *sd, struct map_session_data
{
retVal___ = HPMHooks.source.party.changeleader(sd, t_sd);
}
- if( HPMHooks.count.HP_party_changeleader_post ) {
+ if (HPMHooks.count.HP_party_changeleader_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct map_session_data *t_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_changeleader_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_changeleader_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_changeleader_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, t_sd);
}
@@ -50660,14 +51768,14 @@ bool HP_party_changeleader(struct map_session_data *sd, struct map_session_data
}
void HP_party_send_movemap(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_send_movemap_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_send_movemap_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_movemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_movemap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_movemap_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50675,9 +51783,9 @@ void HP_party_send_movemap(struct map_session_data *sd) {
{
HPMHooks.source.party.send_movemap(sd);
}
- if( HPMHooks.count.HP_party_send_movemap_post ) {
+ if (HPMHooks.count.HP_party_send_movemap_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_movemap_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_movemap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_movemap_post[hIndex].func;
postHookFunc(sd);
}
@@ -50686,14 +51794,14 @@ void HP_party_send_movemap(struct map_session_data *sd) {
}
void HP_party_send_levelup(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_send_levelup_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_send_levelup_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_levelup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_levelup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_levelup_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -50701,9 +51809,9 @@ void HP_party_send_levelup(struct map_session_data *sd) {
{
HPMHooks.source.party.send_levelup(sd);
}
- if( HPMHooks.count.HP_party_send_levelup_post ) {
+ if (HPMHooks.count.HP_party_send_levelup_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_levelup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_levelup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_levelup_post[hIndex].func;
postHookFunc(sd);
}
@@ -50713,14 +51821,14 @@ void HP_party_send_levelup(struct map_session_data *sd) {
int HP_party_send_logout(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_send_logout_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_send_logout_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_logout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_logout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_logout_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50728,38 +51836,38 @@ int HP_party_send_logout(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.party.send_logout(sd);
}
- if( HPMHooks.count.HP_party_send_logout_post ) {
+ if (HPMHooks.count.HP_party_send_logout_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_logout_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_logout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_logout_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-int HP_party_send_message(struct map_session_data *sd, const char *mes, int len) {
+int HP_party_send_message(struct map_session_data *sd, const char *mes) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_send_message_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *mes, int *len);
+ if (HPMHooks.count.HP_party_send_message_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **mes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_message_pre[hIndex].func;
- retVal___ = preHookFunc(sd, mes, &len);
+ retVal___ = preHookFunc(&sd, &mes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.party.send_message(sd, mes, len);
+ retVal___ = HPMHooks.source.party.send_message(sd, mes);
}
- if( HPMHooks.count.HP_party_send_message_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_send_message_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, mes, &len);
+ retVal___ = postHookFunc(retVal___, sd, mes);
}
}
return retVal___;
@@ -50767,14 +51875,14 @@ int HP_party_send_message(struct map_session_data *sd, const char *mes, int len)
int HP_party_recv_message(int party_id, int account_id, const char *mes, int len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_recv_message_pre ) {
- int (*preHookFunc) (int *party_id, int *account_id, const char *mes, int *len);
+ if (HPMHooks.count.HP_party_recv_message_pre > 0) {
+ int (*preHookFunc) (int *party_id, int *account_id, const char **mes, int *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recv_message_pre[hIndex].func;
- retVal___ = preHookFunc(&party_id, &account_id, mes, &len);
+ retVal___ = preHookFunc(&party_id, &account_id, &mes, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50782,11 +51890,11 @@ int HP_party_recv_message(int party_id, int account_id, const char *mes, int len
{
retVal___ = HPMHooks.source.party.recv_message(party_id, account_id, mes, len);
}
- if( HPMHooks.count.HP_party_recv_message_post ) {
- int (*postHookFunc) (int retVal___, int *party_id, int *account_id, const char *mes, int *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_recv_message_post > 0) {
+ int (*postHookFunc) (int retVal___, int party_id, int account_id, const char *mes, int len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recv_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recv_message_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, mes, &len);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, mes, len);
}
}
return retVal___;
@@ -50794,14 +51902,14 @@ int HP_party_recv_message(int party_id, int account_id, const char *mes, int len
int HP_party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_skill_check_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *party_id, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_party_skill_check_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *party_id, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_skill_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_skill_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_skill_check_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &party_id, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&sd, &party_id, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50809,11 +51917,11 @@ int HP_party_skill_check(struct map_session_data *sd, int party_id, uint16 skill
{
retVal___ = HPMHooks.source.party.skill_check(sd, party_id, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_party_skill_check_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *party_id, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_skill_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_skill_check_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_skill_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_skill_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &party_id, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, party_id, skill_id, skill_lv);
}
}
return retVal___;
@@ -50821,14 +51929,14 @@ int HP_party_skill_check(struct map_session_data *sd, int party_id, uint16 skill
int HP_party_send_xy_clear(struct party_data *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_send_xy_clear_pre ) {
- int (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_party_send_xy_clear_pre > 0) {
+ int (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_xy_clear_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50836,9 +51944,9 @@ int HP_party_send_xy_clear(struct party_data *p) {
{
retVal___ = HPMHooks.source.party.send_xy_clear(p);
}
- if( HPMHooks.count.HP_party_send_xy_clear_post ) {
+ if (HPMHooks.count.HP_party_send_xy_clear_post > 0) {
int (*postHookFunc) (int retVal___, struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_xy_clear_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -50848,14 +51956,14 @@ int HP_party_send_xy_clear(struct party_data *p) {
int HP_party_exp_share(struct party_data *p, struct block_list *src, unsigned int base_exp, unsigned int job_exp, int zeny) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_exp_share_pre ) {
- int (*preHookFunc) (struct party_data *p, struct block_list *src, unsigned int *base_exp, unsigned int *job_exp, int *zeny);
+ if (HPMHooks.count.HP_party_exp_share_pre > 0) {
+ int (*preHookFunc) (struct party_data **p, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, int *zeny);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_exp_share_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_exp_share_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_exp_share_pre[hIndex].func;
- retVal___ = preHookFunc(p, src, &base_exp, &job_exp, &zeny);
+ retVal___ = preHookFunc(&p, &src, &base_exp, &job_exp, &zeny);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50863,11 +51971,11 @@ int HP_party_exp_share(struct party_data *p, struct block_list *src, unsigned in
{
retVal___ = HPMHooks.source.party.exp_share(p, src, base_exp, job_exp, zeny);
}
- if( HPMHooks.count.HP_party_exp_share_post ) {
- int (*postHookFunc) (int retVal___, struct party_data *p, struct block_list *src, unsigned int *base_exp, unsigned int *job_exp, int *zeny);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_exp_share_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_exp_share_post > 0) {
+ int (*postHookFunc) (int retVal___, struct party_data *p, struct block_list *src, unsigned int base_exp, unsigned int job_exp, int zeny);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_exp_share_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_exp_share_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, src, &base_exp, &job_exp, &zeny);
+ retVal___ = postHookFunc(retVal___, p, src, base_exp, job_exp, zeny);
}
}
return retVal___;
@@ -50875,14 +51983,14 @@ int HP_party_exp_share(struct party_data *p, struct block_list *src, unsigned in
int HP_party_share_loot(struct party_data *p, struct map_session_data *sd, struct item *item_data, int first_charid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_share_loot_pre ) {
- int (*preHookFunc) (struct party_data *p, struct map_session_data *sd, struct item *item_data, int *first_charid);
+ if (HPMHooks.count.HP_party_share_loot_pre > 0) {
+ int (*preHookFunc) (struct party_data **p, struct map_session_data **sd, struct item **item_data, int *first_charid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_share_loot_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_share_loot_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_share_loot_pre[hIndex].func;
- retVal___ = preHookFunc(p, sd, item_data, &first_charid);
+ retVal___ = preHookFunc(&p, &sd, &item_data, &first_charid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50890,11 +51998,11 @@ int HP_party_share_loot(struct party_data *p, struct map_session_data *sd, struc
{
retVal___ = HPMHooks.source.party.share_loot(p, sd, item_data, first_charid);
}
- if( HPMHooks.count.HP_party_share_loot_post ) {
- int (*postHookFunc) (int retVal___, struct party_data *p, struct map_session_data *sd, struct item *item_data, int *first_charid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_share_loot_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_share_loot_post > 0) {
+ int (*postHookFunc) (int retVal___, struct party_data *p, struct map_session_data *sd, struct item *item_data, int first_charid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_share_loot_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_share_loot_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, sd, item_data, &first_charid);
+ retVal___ = postHookFunc(retVal___, p, sd, item_data, first_charid);
}
}
return retVal___;
@@ -50902,14 +52010,14 @@ int HP_party_share_loot(struct party_data *p, struct map_session_data *sd, struc
int HP_party_send_dot_remove(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_send_dot_remove_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_send_dot_remove_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_dot_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_dot_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_dot_remove_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50917,9 +52025,9 @@ int HP_party_send_dot_remove(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.party.send_dot_remove(sd);
}
- if( HPMHooks.count.HP_party_send_dot_remove_post ) {
+ if (HPMHooks.count.HP_party_send_dot_remove_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_dot_remove_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_dot_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_dot_remove_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -50929,16 +52037,16 @@ int HP_party_send_dot_remove(struct map_session_data *sd) {
int HP_party_sub_count(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_sub_count_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_party_sub_count_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_party_sub_count_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50948,9 +52056,9 @@ int HP_party_sub_count(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.party.sub_count(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_party_sub_count_post ) {
+ if (HPMHooks.count.HP_party_sub_count_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_party_sub_count_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -50962,16 +52070,16 @@ int HP_party_sub_count(struct block_list *bl, va_list ap) {
int HP_party_sub_count_chorus(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_sub_count_chorus_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_party_sub_count_chorus_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_chorus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_chorus_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_party_sub_count_chorus_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -50981,9 +52089,9 @@ int HP_party_sub_count_chorus(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.party.sub_count_chorus(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_party_sub_count_chorus_post ) {
+ if (HPMHooks.count.HP_party_sub_count_chorus_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_chorus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sub_count_chorus_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_party_sub_count_chorus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -50994,14 +52102,14 @@ int HP_party_sub_count_chorus(struct block_list *bl, va_list ap) {
}
void HP_party_booking_register(struct map_session_data *sd, short level, short mapid, short *job) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_booking_register_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *level, short *mapid, short *job);
+ if (HPMHooks.count.HP_party_booking_register_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *level, short *mapid, short **job);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_register_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_register_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_booking_register_pre[hIndex].func;
- preHookFunc(sd, &level, &mapid, job);
+ preHookFunc(&sd, &level, &mapid, &job);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51009,25 +52117,25 @@ void HP_party_booking_register(struct map_session_data *sd, short level, short m
{
HPMHooks.source.party.booking_register(sd, level, mapid, job);
}
- if( HPMHooks.count.HP_party_booking_register_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *level, short *mapid, short *job);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_register_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_booking_register_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short level, short mapid, short *job);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_register_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_booking_register_post[hIndex].func;
- postHookFunc(sd, &level, &mapid, job);
+ postHookFunc(sd, level, mapid, job);
}
}
return;
}
void HP_party_booking_update(struct map_session_data *sd, short *job) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_booking_update_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *job);
+ if (HPMHooks.count.HP_party_booking_update_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short **job);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_booking_update_pre[hIndex].func;
- preHookFunc(sd, job);
+ preHookFunc(&sd, &job);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51035,9 +52143,9 @@ void HP_party_booking_update(struct map_session_data *sd, short *job) {
{
HPMHooks.source.party.booking_update(sd, job);
}
- if( HPMHooks.count.HP_party_booking_update_post ) {
+ if (HPMHooks.count.HP_party_booking_update_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, short *job);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_update_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_booking_update_post[hIndex].func;
postHookFunc(sd, job);
}
@@ -51046,14 +52154,14 @@ void HP_party_booking_update(struct map_session_data *sd, short *job) {
}
void HP_party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_booking_search_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *level, short *mapid, short *job, unsigned long *lastindex, short *resultcount);
+ if (HPMHooks.count.HP_party_booking_search_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *level, short *mapid, short *job, unsigned long *lastindex, short *resultcount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_booking_search_pre[hIndex].func;
- preHookFunc(sd, &level, &mapid, &job, &lastindex, &resultcount);
+ preHookFunc(&sd, &level, &mapid, &job, &lastindex, &resultcount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51061,25 +52169,25 @@ void HP_party_booking_search(struct map_session_data *sd, short level, short map
{
HPMHooks.source.party.booking_search(sd, level, mapid, job, lastindex, resultcount);
}
- if( HPMHooks.count.HP_party_booking_search_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *level, short *mapid, short *job, unsigned long *lastindex, short *resultcount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_booking_search_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_booking_search_post[hIndex].func;
- postHookFunc(sd, &level, &mapid, &job, &lastindex, &resultcount);
+ postHookFunc(sd, level, mapid, job, lastindex, resultcount);
}
}
return;
}
void HP_party_recruit_register(struct map_session_data *sd, short level, const char *notice) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_recruit_register_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *level, const char *notice);
+ if (HPMHooks.count.HP_party_recruit_register_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *level, const char **notice);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_register_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_register_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recruit_register_pre[hIndex].func;
- preHookFunc(sd, &level, notice);
+ preHookFunc(&sd, &level, &notice);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51087,25 +52195,25 @@ void HP_party_recruit_register(struct map_session_data *sd, short level, const c
{
HPMHooks.source.party.recruit_register(sd, level, notice);
}
- if( HPMHooks.count.HP_party_recruit_register_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *level, const char *notice);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_register_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_recruit_register_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short level, const char *notice);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_register_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recruit_register_post[hIndex].func;
- postHookFunc(sd, &level, notice);
+ postHookFunc(sd, level, notice);
}
}
return;
}
void HP_party_recruit_update(struct map_session_data *sd, const char *notice) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_recruit_update_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *notice);
+ if (HPMHooks.count.HP_party_recruit_update_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **notice);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recruit_update_pre[hIndex].func;
- preHookFunc(sd, notice);
+ preHookFunc(&sd, &notice);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51113,9 +52221,9 @@ void HP_party_recruit_update(struct map_session_data *sd, const char *notice) {
{
HPMHooks.source.party.recruit_update(sd, notice);
}
- if( HPMHooks.count.HP_party_recruit_update_post ) {
+ if (HPMHooks.count.HP_party_recruit_update_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *notice);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_update_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recruit_update_post[hIndex].func;
postHookFunc(sd, notice);
}
@@ -51124,14 +52232,14 @@ void HP_party_recruit_update(struct map_session_data *sd, const char *notice) {
}
void HP_party_recruit_search(struct map_session_data *sd, short level, short mapid, unsigned long lastindex, short resultcount) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_recruit_search_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *level, short *mapid, unsigned long *lastindex, short *resultcount);
+ if (HPMHooks.count.HP_party_recruit_search_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *level, short *mapid, unsigned long *lastindex, short *resultcount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_recruit_search_pre[hIndex].func;
- preHookFunc(sd, &level, &mapid, &lastindex, &resultcount);
+ preHookFunc(&sd, &level, &mapid, &lastindex, &resultcount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51139,11 +52247,11 @@ void HP_party_recruit_search(struct map_session_data *sd, short level, short map
{
HPMHooks.source.party.recruit_search(sd, level, mapid, lastindex, resultcount);
}
- if( HPMHooks.count.HP_party_recruit_search_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *level, short *mapid, unsigned long *lastindex, short *resultcount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_recruit_search_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short level, short mapid, unsigned long lastindex, short resultcount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_recruit_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_recruit_search_post[hIndex].func;
- postHookFunc(sd, &level, &mapid, &lastindex, &resultcount);
+ postHookFunc(sd, level, mapid, lastindex, resultcount);
}
}
return;
@@ -51151,14 +52259,14 @@ void HP_party_recruit_search(struct map_session_data *sd, short level, short map
bool HP_party_booking_delete(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_party_booking_delete_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_party_booking_delete_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_booking_delete_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51166,9 +52274,9 @@ bool HP_party_booking_delete(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.party.booking_delete(sd);
}
- if( HPMHooks.count.HP_party_booking_delete_post ) {
+ if (HPMHooks.count.HP_party_booking_delete_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_delete_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_booking_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_booking_delete_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -51178,16 +52286,16 @@ bool HP_party_booking_delete(struct map_session_data *sd) {
int HP_party_vforeachsamemap(int ( *func ) (struct block_list *, va_list), struct map_session_data *sd, int range, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_vforeachsamemap_pre ) {
- int (*preHookFunc) (int ( *func ) (struct block_list *, va_list), struct map_session_data *sd, int *range, va_list ap);
+ if (HPMHooks.count.HP_party_vforeachsamemap_pre > 0) {
+ int (*preHookFunc) (int ( **func ) (struct block_list *, va_list), struct map_session_data **sd, int *range, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_vforeachsamemap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_vforeachsamemap_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_party_vforeachsamemap_pre[hIndex].func;
- retVal___ = preHookFunc(func, sd, &range, ap___copy);
+ retVal___ = preHookFunc(&func, &sd, &range, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51197,12 +52305,12 @@ int HP_party_vforeachsamemap(int ( *func ) (struct block_list *, va_list), struc
retVal___ = HPMHooks.source.party.vforeachsamemap(func, sd, range, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_party_vforeachsamemap_post ) {
- int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct map_session_data *sd, int *range, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_vforeachsamemap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_vforeachsamemap_post > 0) {
+ int (*postHookFunc) (int retVal___, int ( *func ) (struct block_list *, va_list), struct map_session_data *sd, int range, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_vforeachsamemap_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_party_vforeachsamemap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, func, sd, &range, ap___copy);
+ retVal___ = postHookFunc(retVal___, func, sd, range, ap___copy);
va_end(ap___copy);
}
}
@@ -51211,14 +52319,14 @@ int HP_party_vforeachsamemap(int ( *func ) (struct block_list *, va_list), struc
int HP_party_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_send_xy_timer_pre ) {
+ if (HPMHooks.count.HP_party_send_xy_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_send_xy_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51226,25 +52334,25 @@ int HP_party_send_xy_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.party.send_xy_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_party_send_xy_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_send_xy_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_send_xy_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_send_xy_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_party_fill_member(struct party_member *member, struct map_session_data *sd, unsigned int leader) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_fill_member_pre ) {
- void (*preHookFunc) (struct party_member *member, struct map_session_data *sd, unsigned int *leader);
+ if (HPMHooks.count.HP_party_fill_member_pre > 0) {
+ void (*preHookFunc) (struct party_member **member, struct map_session_data **sd, unsigned int *leader);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_fill_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_fill_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_fill_member_pre[hIndex].func;
- preHookFunc(member, sd, &leader);
+ preHookFunc(&member, &sd, &leader);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51252,11 +52360,11 @@ void HP_party_fill_member(struct party_member *member, struct map_session_data *
{
HPMHooks.source.party.fill_member(member, sd, leader);
}
- if( HPMHooks.count.HP_party_fill_member_post ) {
- void (*postHookFunc) (struct party_member *member, struct map_session_data *sd, unsigned int *leader);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_fill_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_fill_member_post > 0) {
+ void (*postHookFunc) (struct party_member *member, struct map_session_data *sd, unsigned int leader);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_fill_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_fill_member_post[hIndex].func;
- postHookFunc(member, sd, &leader);
+ postHookFunc(member, sd, leader);
}
}
return;
@@ -51264,14 +52372,14 @@ void HP_party_fill_member(struct party_member *member, struct map_session_data *
struct map_session_data* HP_party_sd_check(int party_id, int account_id, int char_id) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_party_sd_check_pre ) {
+ if (HPMHooks.count.HP_party_sd_check_pre > 0) {
struct map_session_data* (*preHookFunc) (int *party_id, int *account_id, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_sd_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sd_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_sd_check_pre[hIndex].func;
retVal___ = preHookFunc(&party_id, &account_id, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51279,25 +52387,25 @@ struct map_session_data* HP_party_sd_check(int party_id, int account_id, int cha
{
retVal___ = HPMHooks.source.party.sd_check(party_id, account_id, char_id);
}
- if( HPMHooks.count.HP_party_sd_check_post ) {
- struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int *party_id, int *account_id, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_sd_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_sd_check_post > 0) {
+ struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, int party_id, int account_id, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_sd_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_sd_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &party_id, &account_id, &char_id);
+ retVal___ = postHookFunc(retVal___, party_id, account_id, char_id);
}
}
return retVal___;
}
void HP_party_check_state(struct party_data *p) {
int hIndex = 0;
- if( HPMHooks.count.HP_party_check_state_pre ) {
- void (*preHookFunc) (struct party_data *p);
+ if (HPMHooks.count.HP_party_check_state_pre > 0) {
+ void (*preHookFunc) (struct party_data **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_check_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_check_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_check_state_pre[hIndex].func;
- preHookFunc(p);
+ preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51305,9 +52413,9 @@ void HP_party_check_state(struct party_data *p) {
{
HPMHooks.source.party.check_state(p);
}
- if( HPMHooks.count.HP_party_check_state_post ) {
+ if (HPMHooks.count.HP_party_check_state_post > 0) {
void (*postHookFunc) (struct party_data *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_check_state_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_check_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_check_state_post[hIndex].func;
postHookFunc(p);
}
@@ -51317,14 +52425,14 @@ void HP_party_check_state(struct party_data *p) {
struct party_booking_ad_info* HP_party_create_booking_data(void) {
int hIndex = 0;
struct party_booking_ad_info* retVal___ = NULL;
- if( HPMHooks.count.HP_party_create_booking_data_pre ) {
+ if (HPMHooks.count.HP_party_create_booking_data_pre > 0) {
struct party_booking_ad_info* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_create_booking_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_create_booking_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_party_create_booking_data_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51332,28 +52440,28 @@ struct party_booking_ad_info* HP_party_create_booking_data(void) {
{
retVal___ = HPMHooks.source.party.create_booking_data();
}
- if( HPMHooks.count.HP_party_create_booking_data_post ) {
+ if (HPMHooks.count.HP_party_create_booking_data_post > 0) {
struct party_booking_ad_info* (*postHookFunc) (struct party_booking_ad_info* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_create_booking_data_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_create_booking_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_party_create_booking_data_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-int HP_party_db_final(DBKey key, DBData *data, va_list ap) {
+int HP_party_db_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_party_db_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_party_db_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_db_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_db_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_party_db_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51363,29 +52471,29 @@ int HP_party_db_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.party.db_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_party_db_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_party_db_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_party_db_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_party_db_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_party_db_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-/* path */
+/* path_interface */
int HP_path_blownpos(struct block_list *bl, int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_path_blownpos_pre ) {
- int (*preHookFunc) (struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
+ if (HPMHooks.count.HP_path_blownpos_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_blownpos_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &m, &x0, &y0, &dx, &dy, &count);
+ retVal___ = preHookFunc(&bl, &m, &x0, &y0, &dx, &dy, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51393,11 +52501,11 @@ int HP_path_blownpos(struct block_list *bl, int16 m, int16 x0, int16 y0, int16 d
{
retVal___ = HPMHooks.source.path.blownpos(bl, m, x0, y0, dx, dy, count);
}
- if( HPMHooks.count.HP_path_blownpos_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *dx, int16 *dy, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_blownpos_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 dx, int16 dy, int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_blownpos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_blownpos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &m, &x0, &y0, &dx, &dy, &count);
+ retVal___ = postHookFunc(retVal___, bl, m, x0, y0, dx, dy, count);
}
}
return retVal___;
@@ -51405,14 +52513,14 @@ int HP_path_blownpos(struct block_list *bl, int16 m, int16 x0, int16 y0, int16 d
bool HP_path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_path_search_pre ) {
- bool (*preHookFunc) (struct walkpath_data *wpd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
+ if (HPMHooks.count.HP_path_search_pre > 0) {
+ bool (*preHookFunc) (struct walkpath_data **wpd, struct block_list **bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_search_pre[hIndex].func;
- retVal___ = preHookFunc(wpd, bl, &m, &x0, &y0, &x1, &y1, &flag, &cell);
+ retVal___ = preHookFunc(&wpd, &bl, &m, &x0, &y0, &x1, &y1, &flag, &cell);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51420,11 +52528,11 @@ bool HP_path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, i
{
retVal___ = HPMHooks.source.path.search(wpd, bl, m, x0, y0, x1, y1, flag, cell);
}
- if( HPMHooks.count.HP_path_search_post ) {
- bool (*postHookFunc) (bool retVal___, struct walkpath_data *wpd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, int *flag, cell_chk *cell);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_search_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct walkpath_data *wpd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, int flag, cell_chk cell);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, wpd, bl, &m, &x0, &y0, &x1, &y1, &flag, &cell);
+ retVal___ = postHookFunc(retVal___, wpd, bl, m, x0, y0, x1, y1, flag, cell);
}
}
return retVal___;
@@ -51432,14 +52540,14 @@ bool HP_path_search(struct walkpath_data *wpd, struct block_list *bl, int16 m, i
bool HP_path_search_long(struct shootpath_data *spd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_path_search_long_pre ) {
- bool (*preHookFunc) (struct shootpath_data *spd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
+ if (HPMHooks.count.HP_path_search_long_pre > 0) {
+ bool (*preHookFunc) (struct shootpath_data **spd, struct block_list **bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_search_long_pre[hIndex].func;
- retVal___ = preHookFunc(spd, bl, &m, &x0, &y0, &x1, &y1, &cell);
+ retVal___ = preHookFunc(&spd, &bl, &m, &x0, &y0, &x1, &y1, &cell);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51447,11 +52555,11 @@ bool HP_path_search_long(struct shootpath_data *spd, struct block_list *bl, int1
{
retVal___ = HPMHooks.source.path.search_long(spd, bl, m, x0, y0, x1, y1, cell);
}
- if( HPMHooks.count.HP_path_search_long_post ) {
- bool (*postHookFunc) (bool retVal___, struct shootpath_data *spd, struct block_list *bl, int16 *m, int16 *x0, int16 *y0, int16 *x1, int16 *y1, cell_chk *cell);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_search_long_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct shootpath_data *spd, struct block_list *bl, int16 m, int16 x0, int16 y0, int16 x1, int16 y1, cell_chk cell);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_search_long_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_search_long_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, spd, bl, &m, &x0, &y0, &x1, &y1, &cell);
+ retVal___ = postHookFunc(retVal___, spd, bl, m, x0, y0, x1, y1, cell);
}
}
return retVal___;
@@ -51459,14 +52567,14 @@ bool HP_path_search_long(struct shootpath_data *spd, struct block_list *bl, int1
bool HP_path_check_distance(int dx, int dy, int distance) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_path_check_distance_pre ) {
+ if (HPMHooks.count.HP_path_check_distance_pre > 0) {
bool (*preHookFunc) (int *dx, int *dy, int *distance);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_check_distance_pre[hIndex].func;
retVal___ = preHookFunc(&dx, &dy, &distance);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51474,11 +52582,11 @@ bool HP_path_check_distance(int dx, int dy, int distance) {
{
retVal___ = HPMHooks.source.path.check_distance(dx, dy, distance);
}
- if( HPMHooks.count.HP_path_check_distance_post ) {
- bool (*postHookFunc) (bool retVal___, int *dx, int *dy, int *distance);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_check_distance_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int dx, int dy, int distance);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_check_distance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &dx, &dy, &distance);
+ retVal___ = postHookFunc(retVal___, dx, dy, distance);
}
}
return retVal___;
@@ -51486,14 +52594,14 @@ bool HP_path_check_distance(int dx, int dy, int distance) {
unsigned int HP_path_distance(int dx, int dy) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_path_distance_pre ) {
+ if (HPMHooks.count.HP_path_distance_pre > 0) {
unsigned int (*preHookFunc) (int *dx, int *dy);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_distance_pre[hIndex].func;
retVal___ = preHookFunc(&dx, &dy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51501,11 +52609,11 @@ unsigned int HP_path_distance(int dx, int dy) {
{
retVal___ = HPMHooks.source.path.distance(dx, dy);
}
- if( HPMHooks.count.HP_path_distance_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, int *dx, int *dy);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_distance_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, int dx, int dy);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_distance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &dx, &dy);
+ retVal___ = postHookFunc(retVal___, dx, dy);
}
}
return retVal___;
@@ -51513,14 +52621,14 @@ unsigned int HP_path_distance(int dx, int dy) {
bool HP_path_check_distance_client(int dx, int dy, int distance) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_path_check_distance_client_pre ) {
+ if (HPMHooks.count.HP_path_check_distance_client_pre > 0) {
bool (*preHookFunc) (int *dx, int *dy, int *distance);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_client_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_client_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_check_distance_client_pre[hIndex].func;
retVal___ = preHookFunc(&dx, &dy, &distance);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51528,11 +52636,11 @@ bool HP_path_check_distance_client(int dx, int dy, int distance) {
{
retVal___ = HPMHooks.source.path.check_distance_client(dx, dy, distance);
}
- if( HPMHooks.count.HP_path_check_distance_client_post ) {
- bool (*postHookFunc) (bool retVal___, int *dx, int *dy, int *distance);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_client_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_check_distance_client_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int dx, int dy, int distance);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_check_distance_client_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_check_distance_client_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &dx, &dy, &distance);
+ retVal___ = postHookFunc(retVal___, dx, dy, distance);
}
}
return retVal___;
@@ -51540,14 +52648,14 @@ bool HP_path_check_distance_client(int dx, int dy, int distance) {
int HP_path_distance_client(int dx, int dy) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_path_distance_client_pre ) {
+ if (HPMHooks.count.HP_path_distance_client_pre > 0) {
int (*preHookFunc) (int *dx, int *dy);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_client_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_client_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_path_distance_client_pre[hIndex].func;
retVal___ = preHookFunc(&dx, &dy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51555,26 +52663,26 @@ int HP_path_distance_client(int dx, int dy) {
{
retVal___ = HPMHooks.source.path.distance_client(dx, dy);
}
- if( HPMHooks.count.HP_path_distance_client_post ) {
- int (*postHookFunc) (int retVal___, int *dx, int *dy);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_client_post; hIndex++ ) {
+ if (HPMHooks.count.HP_path_distance_client_post > 0) {
+ int (*postHookFunc) (int retVal___, int dx, int dy);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_path_distance_client_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_path_distance_client_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &dx, &dy);
+ retVal___ = postHookFunc(retVal___, dx, dy);
}
}
return retVal___;
}
-/* pcg */
+/* pc_groups_interface */
void HP_pcg_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pcg_init_pre ) {
+ if (HPMHooks.count.HP_pcg_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51582,9 +52690,9 @@ void HP_pcg_init(void) {
{
HPMHooks.source.pcg.init();
}
- if( HPMHooks.count.HP_pcg_init_post ) {
+ if (HPMHooks.count.HP_pcg_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_init_post[hIndex].func;
postHookFunc();
}
@@ -51593,14 +52701,14 @@ void HP_pcg_init(void) {
}
void HP_pcg_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pcg_final_pre ) {
+ if (HPMHooks.count.HP_pcg_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51608,9 +52716,9 @@ void HP_pcg_final(void) {
{
HPMHooks.source.pcg.final();
}
- if( HPMHooks.count.HP_pcg_final_post ) {
+ if (HPMHooks.count.HP_pcg_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_final_post[hIndex].func;
postHookFunc();
}
@@ -51619,14 +52727,14 @@ void HP_pcg_final(void) {
}
void HP_pcg_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pcg_reload_pre ) {
+ if (HPMHooks.count.HP_pcg_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51634,9 +52742,9 @@ void HP_pcg_reload(void) {
{
HPMHooks.source.pcg.reload();
}
- if( HPMHooks.count.HP_pcg_reload_post ) {
+ if (HPMHooks.count.HP_pcg_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_reload_post[hIndex].func;
postHookFunc();
}
@@ -51646,14 +52754,14 @@ void HP_pcg_reload(void) {
GroupSettings* HP_pcg_get_dummy_group(void) {
int hIndex = 0;
GroupSettings* retVal___ = NULL;
- if( HPMHooks.count.HP_pcg_get_dummy_group_pre ) {
+ if (HPMHooks.count.HP_pcg_get_dummy_group_pre > 0) {
GroupSettings* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_get_dummy_group_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51661,9 +52769,9 @@ GroupSettings* HP_pcg_get_dummy_group(void) {
{
retVal___ = HPMHooks.source.pcg.get_dummy_group();
}
- if( HPMHooks.count.HP_pcg_get_dummy_group_post ) {
+ if (HPMHooks.count.HP_pcg_get_dummy_group_post > 0) {
GroupSettings* (*postHookFunc) (GroupSettings* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_dummy_group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_get_dummy_group_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -51673,14 +52781,14 @@ GroupSettings* HP_pcg_get_dummy_group(void) {
bool HP_pcg_exists(int group_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pcg_exists_pre ) {
+ if (HPMHooks.count.HP_pcg_exists_pre > 0) {
bool (*preHookFunc) (int *group_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_exists_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_exists_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_exists_pre[hIndex].func;
retVal___ = preHookFunc(&group_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51688,11 +52796,11 @@ bool HP_pcg_exists(int group_id) {
{
retVal___ = HPMHooks.source.pcg.exists(group_id);
}
- if( HPMHooks.count.HP_pcg_exists_post ) {
- bool (*postHookFunc) (bool retVal___, int *group_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_exists_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pcg_exists_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int group_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_exists_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_exists_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &group_id);
+ retVal___ = postHookFunc(retVal___, group_id);
}
}
return retVal___;
@@ -51700,14 +52808,14 @@ bool HP_pcg_exists(int group_id) {
GroupSettings* HP_pcg_id2group(int group_id) {
int hIndex = 0;
GroupSettings* retVal___ = NULL;
- if( HPMHooks.count.HP_pcg_id2group_pre ) {
+ if (HPMHooks.count.HP_pcg_id2group_pre > 0) {
GroupSettings* (*preHookFunc) (int *group_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_id2group_pre[hIndex].func;
retVal___ = preHookFunc(&group_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51715,11 +52823,11 @@ GroupSettings* HP_pcg_id2group(int group_id) {
{
retVal___ = HPMHooks.source.pcg.id2group(group_id);
}
- if( HPMHooks.count.HP_pcg_id2group_post ) {
- GroupSettings* (*postHookFunc) (GroupSettings* retVal___, int *group_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pcg_id2group_post > 0) {
+ GroupSettings* (*postHookFunc) (GroupSettings* retVal___, int group_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_id2group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_id2group_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &group_id);
+ retVal___ = postHookFunc(retVal___, group_id);
}
}
return retVal___;
@@ -51727,14 +52835,14 @@ GroupSettings* HP_pcg_id2group(int group_id) {
bool HP_pcg_has_permission(GroupSettings *group, unsigned int permission) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pcg_has_permission_pre ) {
- bool (*preHookFunc) (GroupSettings *group, unsigned int *permission);
+ if (HPMHooks.count.HP_pcg_has_permission_pre > 0) {
+ bool (*preHookFunc) (GroupSettings **group, unsigned int *permission);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_has_permission_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_has_permission_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_has_permission_pre[hIndex].func;
- retVal___ = preHookFunc(group, &permission);
+ retVal___ = preHookFunc(&group, &permission);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51742,11 +52850,11 @@ bool HP_pcg_has_permission(GroupSettings *group, unsigned int permission) {
{
retVal___ = HPMHooks.source.pcg.has_permission(group, permission);
}
- if( HPMHooks.count.HP_pcg_has_permission_post ) {
- bool (*postHookFunc) (bool retVal___, GroupSettings *group, unsigned int *permission);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_has_permission_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pcg_has_permission_post > 0) {
+ bool (*postHookFunc) (bool retVal___, GroupSettings *group, unsigned int permission);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_has_permission_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_has_permission_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, group, &permission);
+ retVal___ = postHookFunc(retVal___, group, permission);
}
}
return retVal___;
@@ -51754,14 +52862,14 @@ bool HP_pcg_has_permission(GroupSettings *group, unsigned int permission) {
bool HP_pcg_should_log_commands(GroupSettings *group) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pcg_should_log_commands_pre ) {
- bool (*preHookFunc) (GroupSettings *group);
+ if (HPMHooks.count.HP_pcg_should_log_commands_pre > 0) {
+ bool (*preHookFunc) (GroupSettings **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_should_log_commands_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_should_log_commands_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_should_log_commands_pre[hIndex].func;
- retVal___ = preHookFunc(group);
+ retVal___ = preHookFunc(&group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51769,9 +52877,9 @@ bool HP_pcg_should_log_commands(GroupSettings *group) {
{
retVal___ = HPMHooks.source.pcg.should_log_commands(group);
}
- if( HPMHooks.count.HP_pcg_should_log_commands_post ) {
+ if (HPMHooks.count.HP_pcg_should_log_commands_post > 0) {
bool (*postHookFunc) (bool retVal___, GroupSettings *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_should_log_commands_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_should_log_commands_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_should_log_commands_post[hIndex].func;
retVal___ = postHookFunc(retVal___, group);
}
@@ -51781,14 +52889,14 @@ bool HP_pcg_should_log_commands(GroupSettings *group) {
const char* HP_pcg_get_name(GroupSettings *group) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_pcg_get_name_pre ) {
- const char* (*preHookFunc) (GroupSettings *group);
+ if (HPMHooks.count.HP_pcg_get_name_pre > 0) {
+ const char* (*preHookFunc) (GroupSettings **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_get_name_pre[hIndex].func;
- retVal___ = preHookFunc(group);
+ retVal___ = preHookFunc(&group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51796,9 +52904,9 @@ const char* HP_pcg_get_name(GroupSettings *group) {
{
retVal___ = HPMHooks.source.pcg.get_name(group);
}
- if( HPMHooks.count.HP_pcg_get_name_post ) {
+ if (HPMHooks.count.HP_pcg_get_name_post > 0) {
const char* (*postHookFunc) (const char* retVal___, GroupSettings *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_get_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, group);
}
@@ -51808,14 +52916,14 @@ const char* HP_pcg_get_name(GroupSettings *group) {
int HP_pcg_get_level(GroupSettings *group) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pcg_get_level_pre ) {
- int (*preHookFunc) (GroupSettings *group);
+ if (HPMHooks.count.HP_pcg_get_level_pre > 0) {
+ int (*preHookFunc) (GroupSettings **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_level_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_level_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_get_level_pre[hIndex].func;
- retVal___ = preHookFunc(group);
+ retVal___ = preHookFunc(&group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51823,9 +52931,9 @@ int HP_pcg_get_level(GroupSettings *group) {
{
retVal___ = HPMHooks.source.pcg.get_level(group);
}
- if( HPMHooks.count.HP_pcg_get_level_post ) {
+ if (HPMHooks.count.HP_pcg_get_level_post > 0) {
int (*postHookFunc) (int retVal___, GroupSettings *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_level_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_level_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_get_level_post[hIndex].func;
retVal___ = postHookFunc(retVal___, group);
}
@@ -51835,14 +52943,14 @@ int HP_pcg_get_level(GroupSettings *group) {
int HP_pcg_get_idx(GroupSettings *group) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pcg_get_idx_pre ) {
- int (*preHookFunc) (GroupSettings *group);
+ if (HPMHooks.count.HP_pcg_get_idx_pre > 0) {
+ int (*preHookFunc) (GroupSettings **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_idx_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_idx_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pcg_get_idx_pre[hIndex].func;
- retVal___ = preHookFunc(group);
+ retVal___ = preHookFunc(&group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51850,26 +52958,26 @@ int HP_pcg_get_idx(GroupSettings *group) {
{
retVal___ = HPMHooks.source.pcg.get_idx(group);
}
- if( HPMHooks.count.HP_pcg_get_idx_post ) {
+ if (HPMHooks.count.HP_pcg_get_idx_post > 0) {
int (*postHookFunc) (int retVal___, GroupSettings *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_idx_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pcg_get_idx_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pcg_get_idx_post[hIndex].func;
retVal___ = postHookFunc(retVal___, group);
}
}
return retVal___;
}
-/* pc */
+/* pc_interface */
void HP_pc_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_init_pre ) {
+ if (HPMHooks.count.HP_pc_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51877,25 +52985,25 @@ void HP_pc_init(bool minimal) {
{
HPMHooks.source.pc.init(minimal);
}
- if( HPMHooks.count.HP_pc_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_pc_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_final_pre ) {
+ if (HPMHooks.count.HP_pc_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -51903,9 +53011,9 @@ void HP_pc_final(void) {
{
HPMHooks.source.pc.final();
}
- if( HPMHooks.count.HP_pc_final_post ) {
+ if (HPMHooks.count.HP_pc_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_final_post[hIndex].func;
postHookFunc();
}
@@ -51915,14 +53023,14 @@ void HP_pc_final(void) {
struct map_session_data* HP_pc_get_dummy_sd(void) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_get_dummy_sd_pre ) {
+ if (HPMHooks.count.HP_pc_get_dummy_sd_pre > 0) {
struct map_session_data* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_dummy_sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_dummy_sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_get_dummy_sd_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51930,38 +53038,38 @@ struct map_session_data* HP_pc_get_dummy_sd(void) {
{
retVal___ = HPMHooks.source.pc.get_dummy_sd();
}
- if( HPMHooks.count.HP_pc_get_dummy_sd_post ) {
+ if (HPMHooks.count.HP_pc_get_dummy_sd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_dummy_sd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_dummy_sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_get_dummy_sd_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-int HP_pc_class2idx(int class_) {
+int HP_pc_class2idx(int class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_class2idx_pre ) {
- int (*preHookFunc) (int *class_);
+ if (HPMHooks.count.HP_pc_class2idx_pre > 0) {
+ int (*preHookFunc) (int *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_class2idx_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_class2idx_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_class2idx_pre[hIndex].func;
- retVal___ = preHookFunc(&class_);
+ retVal___ = preHookFunc(&class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.class2idx(class_);
+ retVal___ = HPMHooks.source.pc.class2idx(class);
}
- if( HPMHooks.count.HP_pc_class2idx_post ) {
- int (*postHookFunc) (int retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_class2idx_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_class2idx_post > 0) {
+ int (*postHookFunc) (int retVal___, int class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_class2idx_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_class2idx_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class);
}
}
return retVal___;
@@ -51969,14 +53077,14 @@ int HP_pc_class2idx(int class_) {
bool HP_pc_can_talk(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_can_talk_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_can_talk_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_talk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_talk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_can_talk_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -51984,9 +53092,9 @@ bool HP_pc_can_talk(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.can_talk(sd);
}
- if( HPMHooks.count.HP_pc_can_talk_post ) {
+ if (HPMHooks.count.HP_pc_can_talk_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_talk_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_talk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_can_talk_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -51996,14 +53104,14 @@ bool HP_pc_can_talk(struct map_session_data *sd) {
bool HP_pc_can_attack(struct map_session_data *sd, int target_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_can_attack_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *target_id);
+ if (HPMHooks.count.HP_pc_can_attack_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_can_attack_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &target_id);
+ retVal___ = preHookFunc(&sd, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52011,11 +53119,11 @@ bool HP_pc_can_attack(struct map_session_data *sd, int target_id) {
{
retVal___ = HPMHooks.source.pc.can_attack(sd, target_id);
}
- if( HPMHooks.count.HP_pc_can_attack_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_can_attack_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_can_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &target_id);
+ retVal___ = postHookFunc(retVal___, sd, target_id);
}
}
return retVal___;
@@ -52023,14 +53131,14 @@ bool HP_pc_can_attack(struct map_session_data *sd, int target_id) {
bool HP_pc_can_use_command(struct map_session_data *sd, const char *command) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_can_use_command_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const char *command);
+ if (HPMHooks.count.HP_pc_can_use_command_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **command);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_use_command_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_use_command_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_can_use_command_pre[hIndex].func;
- retVal___ = preHookFunc(sd, command);
+ retVal___ = preHookFunc(&sd, &command);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52038,9 +53146,9 @@ bool HP_pc_can_use_command(struct map_session_data *sd, const char *command) {
{
retVal___ = HPMHooks.source.pc.can_use_command(sd, command);
}
- if( HPMHooks.count.HP_pc_can_use_command_post ) {
+ if (HPMHooks.count.HP_pc_can_use_command_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *command);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_use_command_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_use_command_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_can_use_command_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, command);
}
@@ -52050,14 +53158,14 @@ bool HP_pc_can_use_command(struct map_session_data *sd, const char *command) {
int HP_pc_set_group(struct map_session_data *sd, int group_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_set_group_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *group_id);
+ if (HPMHooks.count.HP_pc_set_group_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *group_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_set_group_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &group_id);
+ retVal___ = preHookFunc(&sd, &group_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52065,11 +53173,11 @@ int HP_pc_set_group(struct map_session_data *sd, int group_id) {
{
retVal___ = HPMHooks.source.pc.set_group(sd, group_id);
}
- if( HPMHooks.count.HP_pc_set_group_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *group_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_group_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_set_group_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int group_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_set_group_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &group_id);
+ retVal___ = postHookFunc(retVal___, sd, group_id);
}
}
return retVal___;
@@ -52077,14 +53185,14 @@ int HP_pc_set_group(struct map_session_data *sd, int group_id) {
bool HP_pc_should_log_commands(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_should_log_commands_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_should_log_commands_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_should_log_commands_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_should_log_commands_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_should_log_commands_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52092,9 +53200,9 @@ bool HP_pc_should_log_commands(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.should_log_commands(sd);
}
- if( HPMHooks.count.HP_pc_should_log_commands_post ) {
+ if (HPMHooks.count.HP_pc_should_log_commands_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_should_log_commands_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_should_log_commands_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_should_log_commands_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52104,14 +53212,14 @@ bool HP_pc_should_log_commands(struct map_session_data *sd) {
int HP_pc_setrestartvalue(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setrestartvalue_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_setrestartvalue_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setrestartvalue_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setrestartvalue_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setrestartvalue_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52119,11 +53227,11 @@ int HP_pc_setrestartvalue(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.setrestartvalue(sd, type);
}
- if( HPMHooks.count.HP_pc_setrestartvalue_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setrestartvalue_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setrestartvalue_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setrestartvalue_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setrestartvalue_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -52131,14 +53239,14 @@ int HP_pc_setrestartvalue(struct map_session_data *sd, int type) {
int HP_pc_makesavestatus(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_makesavestatus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_makesavestatus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_makesavestatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_makesavestatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_makesavestatus_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52146,9 +53254,9 @@ int HP_pc_makesavestatus(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.makesavestatus(sd);
}
- if( HPMHooks.count.HP_pc_makesavestatus_post ) {
+ if (HPMHooks.count.HP_pc_makesavestatus_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_makesavestatus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_makesavestatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_makesavestatus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52157,14 +53265,14 @@ int HP_pc_makesavestatus(struct map_session_data *sd) {
}
void HP_pc_respawn(struct map_session_data *sd, clr_type clrtype) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_respawn_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, clr_type *clrtype);
+ if (HPMHooks.count.HP_pc_respawn_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, clr_type *clrtype);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_respawn_pre[hIndex].func;
- preHookFunc(sd, &clrtype);
+ preHookFunc(&sd, &clrtype);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -52172,11 +53280,11 @@ void HP_pc_respawn(struct map_session_data *sd, clr_type clrtype) {
{
HPMHooks.source.pc.respawn(sd, clrtype);
}
- if( HPMHooks.count.HP_pc_respawn_post ) {
- void (*postHookFunc) (struct map_session_data *sd, clr_type *clrtype);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_respawn_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, clr_type clrtype);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_respawn_post[hIndex].func;
- postHookFunc(sd, &clrtype);
+ postHookFunc(sd, clrtype);
}
}
return;
@@ -52184,14 +53292,14 @@ void HP_pc_respawn(struct map_session_data *sd, clr_type clrtype) {
int HP_pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setnewpc_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *account_id, int *char_id, int *login_id1, unsigned int *client_tick, int *sex, int *fd);
+ if (HPMHooks.count.HP_pc_setnewpc_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *account_id, int *char_id, int *login_id1, unsigned int *client_tick, int *sex, int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setnewpc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setnewpc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setnewpc_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &account_id, &char_id, &login_id1, &client_tick, &sex, &fd);
+ retVal___ = preHookFunc(&sd, &account_id, &char_id, &login_id1, &client_tick, &sex, &fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52199,26 +53307,26 @@ int HP_pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int
{
retVal___ = HPMHooks.source.pc.setnewpc(sd, account_id, char_id, login_id1, client_tick, sex, fd);
}
- if( HPMHooks.count.HP_pc_setnewpc_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *account_id, int *char_id, int *login_id1, unsigned int *client_tick, int *sex, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setnewpc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setnewpc_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setnewpc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setnewpc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &account_id, &char_id, &login_id1, &client_tick, &sex, &fd);
+ retVal___ = postHookFunc(retVal___, sd, account_id, char_id, login_id1, client_tick, sex, fd);
}
}
return retVal___;
}
-bool HP_pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers) {
+bool HP_pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_authok_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *login_id2, time_t *expiration_time, int *group_id, struct mmo_charstatus *st, bool *changing_mapservers);
+ if (HPMHooks.count.HP_pc_authok_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *login_id2, time_t *expiration_time, int *group_id, const struct mmo_charstatus **st, bool *changing_mapservers);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_authok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_authok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_authok_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &login_id2, &expiration_time, &group_id, st, &changing_mapservers);
+ retVal___ = preHookFunc(&sd, &login_id2, &expiration_time, &group_id, &st, &changing_mapservers);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52226,25 +53334,25 @@ bool HP_pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_
{
retVal___ = HPMHooks.source.pc.authok(sd, login_id2, expiration_time, group_id, st, changing_mapservers);
}
- if( HPMHooks.count.HP_pc_authok_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *login_id2, time_t *expiration_time, int *group_id, struct mmo_charstatus *st, bool *changing_mapservers);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_authok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_authok_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_authok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_authok_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &login_id2, &expiration_time, &group_id, st, &changing_mapservers);
+ retVal___ = postHookFunc(retVal___, sd, login_id2, expiration_time, group_id, st, changing_mapservers);
}
}
return retVal___;
}
void HP_pc_authfail(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_authfail_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_authfail_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_authfail_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_authfail_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_authfail_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -52252,9 +53360,9 @@ void HP_pc_authfail(struct map_session_data *sd) {
{
HPMHooks.source.pc.authfail(sd);
}
- if( HPMHooks.count.HP_pc_authfail_post ) {
+ if (HPMHooks.count.HP_pc_authfail_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_authfail_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_authfail_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_authfail_post[hIndex].func;
postHookFunc(sd);
}
@@ -52264,14 +53372,14 @@ void HP_pc_authfail(struct map_session_data *sd) {
int HP_pc_reg_received(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_reg_received_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_reg_received_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_reg_received_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_reg_received_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_reg_received_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52279,9 +53387,9 @@ int HP_pc_reg_received(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.reg_received(sd);
}
- if( HPMHooks.count.HP_pc_reg_received_post ) {
+ if (HPMHooks.count.HP_pc_reg_received_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_reg_received_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_reg_received_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_reg_received_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52291,14 +53399,14 @@ int HP_pc_reg_received(struct map_session_data *sd) {
int HP_pc_isequip(struct map_session_data *sd, int n) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_isequip_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n);
+ if (HPMHooks.count.HP_pc_isequip_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_isequip_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n);
+ retVal___ = preHookFunc(&sd, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52306,11 +53414,11 @@ int HP_pc_isequip(struct map_session_data *sd, int n) {
{
retVal___ = HPMHooks.source.pc.isequip(sd, n);
}
- if( HPMHooks.count.HP_pc_isequip_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_isequip_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_isequip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n);
+ retVal___ = postHookFunc(retVal___, sd, n);
}
}
return retVal___;
@@ -52318,14 +53426,14 @@ int HP_pc_isequip(struct map_session_data *sd, int n) {
int HP_pc_equippoint(struct map_session_data *sd, int n) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_equippoint_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n);
+ if (HPMHooks.count.HP_pc_equippoint_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equippoint_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equippoint_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_equippoint_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n);
+ retVal___ = preHookFunc(&sd, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52333,11 +53441,11 @@ int HP_pc_equippoint(struct map_session_data *sd, int n) {
{
retVal___ = HPMHooks.source.pc.equippoint(sd, n);
}
- if( HPMHooks.count.HP_pc_equippoint_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equippoint_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_equippoint_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equippoint_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_equippoint_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n);
+ retVal___ = postHookFunc(retVal___, sd, n);
}
}
return retVal___;
@@ -52345,14 +53453,14 @@ int HP_pc_equippoint(struct map_session_data *sd, int n) {
int HP_pc_setinventorydata(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setinventorydata_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_setinventorydata_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinventorydata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinventorydata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setinventorydata_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52360,9 +53468,9 @@ int HP_pc_setinventorydata(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.setinventorydata(sd);
}
- if( HPMHooks.count.HP_pc_setinventorydata_post ) {
+ if (HPMHooks.count.HP_pc_setinventorydata_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinventorydata_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinventorydata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setinventorydata_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52372,14 +53480,14 @@ int HP_pc_setinventorydata(struct map_session_data *sd) {
int HP_pc_checkskill(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkskill_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_pc_checkskill_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkskill_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52387,11 +53495,11 @@ int HP_pc_checkskill(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.pc.checkskill(sd, skill_id);
}
- if( HPMHooks.count.HP_pc_checkskill_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_checkskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
@@ -52399,14 +53507,14 @@ int HP_pc_checkskill(struct map_session_data *sd, uint16 skill_id) {
int HP_pc_checkskill2(struct map_session_data *sd, uint16 index) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkskill2_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *index);
+ if (HPMHooks.count.HP_pc_checkskill2_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkskill2_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index);
+ retVal___ = preHookFunc(&sd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52414,11 +53522,11 @@ int HP_pc_checkskill2(struct map_session_data *sd, uint16 index) {
{
retVal___ = HPMHooks.source.pc.checkskill2(sd, index);
}
- if( HPMHooks.count.HP_pc_checkskill2_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_checkskill2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkskill2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkskill2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index);
+ retVal___ = postHookFunc(retVal___, sd, index);
}
}
return retVal___;
@@ -52426,14 +53534,14 @@ int HP_pc_checkskill2(struct map_session_data *sd, uint16 index) {
int HP_pc_checkallowskill(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkallowskill_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_checkallowskill_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkallowskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkallowskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkallowskill_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52441,9 +53549,9 @@ int HP_pc_checkallowskill(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.checkallowskill(sd);
}
- if( HPMHooks.count.HP_pc_checkallowskill_post ) {
+ if (HPMHooks.count.HP_pc_checkallowskill_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkallowskill_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkallowskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkallowskill_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52453,14 +53561,14 @@ int HP_pc_checkallowskill(struct map_session_data *sd) {
int HP_pc_checkequip(struct map_session_data *sd, int pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkequip_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *pos);
+ if (HPMHooks.count.HP_pc_checkequip_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkequip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkequip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkequip_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &pos);
+ retVal___ = preHookFunc(&sd, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52468,11 +53576,11 @@ int HP_pc_checkequip(struct map_session_data *sd, int pos) {
{
retVal___ = HPMHooks.source.pc.checkequip(sd, pos);
}
- if( HPMHooks.count.HP_pc_checkequip_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkequip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_checkequip_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkequip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkequip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &pos);
+ retVal___ = postHookFunc(retVal___, sd, pos);
}
}
return retVal___;
@@ -52480,14 +53588,14 @@ int HP_pc_checkequip(struct map_session_data *sd, int pos) {
int HP_pc_calc_skilltree(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_calc_skilltree_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_calc_skilltree_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calc_skilltree_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52495,9 +53603,9 @@ int HP_pc_calc_skilltree(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.calc_skilltree(sd);
}
- if( HPMHooks.count.HP_pc_calc_skilltree_post ) {
+ if (HPMHooks.count.HP_pc_calc_skilltree_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calc_skilltree_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52507,14 +53615,14 @@ int HP_pc_calc_skilltree(struct map_session_data *sd) {
int HP_pc_calc_skilltree_normalize_job(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_calc_skilltree_normalize_job_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_calc_skilltree_normalize_job_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_normalize_job_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_normalize_job_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calc_skilltree_normalize_job_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52522,9 +53630,9 @@ int HP_pc_calc_skilltree_normalize_job(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.calc_skilltree_normalize_job(sd);
}
- if( HPMHooks.count.HP_pc_calc_skilltree_normalize_job_post ) {
+ if (HPMHooks.count.HP_pc_calc_skilltree_normalize_job_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_normalize_job_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skilltree_normalize_job_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calc_skilltree_normalize_job_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52534,14 +53642,14 @@ int HP_pc_calc_skilltree_normalize_job(struct map_session_data *sd) {
int HP_pc_clean_skilltree(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_clean_skilltree_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_clean_skilltree_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_clean_skilltree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_clean_skilltree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_clean_skilltree_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52549,9 +53657,9 @@ int HP_pc_clean_skilltree(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.clean_skilltree(sd);
}
- if( HPMHooks.count.HP_pc_clean_skilltree_post ) {
+ if (HPMHooks.count.HP_pc_clean_skilltree_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_clean_skilltree_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_clean_skilltree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_clean_skilltree_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52561,14 +53669,14 @@ int HP_pc_clean_skilltree(struct map_session_data *sd) {
int HP_pc_setpos(struct map_session_data *sd, unsigned short map_index, int x, int y, clr_type clrtype) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setpos_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, unsigned short *map_index, int *x, int *y, clr_type *clrtype);
+ if (HPMHooks.count.HP_pc_setpos_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, unsigned short *map_index, int *x, int *y, clr_type *clrtype);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setpos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setpos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setpos_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &map_index, &x, &y, &clrtype);
+ retVal___ = preHookFunc(&sd, &map_index, &x, &y, &clrtype);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52576,11 +53684,11 @@ int HP_pc_setpos(struct map_session_data *sd, unsigned short map_index, int x, i
{
retVal___ = HPMHooks.source.pc.setpos(sd, map_index, x, y, clrtype);
}
- if( HPMHooks.count.HP_pc_setpos_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short *map_index, int *x, int *y, clr_type *clrtype);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setpos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setpos_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short map_index, int x, int y, clr_type clrtype);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setpos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setpos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &map_index, &x, &y, &clrtype);
+ retVal___ = postHookFunc(retVal___, sd, map_index, x, y, clrtype);
}
}
return retVal___;
@@ -52588,14 +53696,14 @@ int HP_pc_setpos(struct map_session_data *sd, unsigned short map_index, int x, i
int HP_pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int y) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setsavepoint_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, short *map_index, int *x, int *y);
+ if (HPMHooks.count.HP_pc_setsavepoint_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, short *map_index, int *x, int *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setsavepoint_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setsavepoint_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setsavepoint_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &map_index, &x, &y);
+ retVal___ = preHookFunc(&sd, &map_index, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52603,11 +53711,11 @@ int HP_pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int
{
retVal___ = HPMHooks.source.pc.setsavepoint(sd, map_index, x, y);
}
- if( HPMHooks.count.HP_pc_setsavepoint_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, short *map_index, int *x, int *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setsavepoint_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setsavepoint_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, short map_index, int x, int y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setsavepoint_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setsavepoint_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &map_index, &x, &y);
+ retVal___ = postHookFunc(retVal___, sd, map_index, x, y);
}
}
return retVal___;
@@ -52615,14 +53723,14 @@ int HP_pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int
int HP_pc_randomwarp(struct map_session_data *sd, clr_type type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_randomwarp_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, clr_type *type);
+ if (HPMHooks.count.HP_pc_randomwarp_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, clr_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_randomwarp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_randomwarp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_randomwarp_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52630,11 +53738,11 @@ int HP_pc_randomwarp(struct map_session_data *sd, clr_type type) {
{
retVal___ = HPMHooks.source.pc.randomwarp(sd, type);
}
- if( HPMHooks.count.HP_pc_randomwarp_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, clr_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_randomwarp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_randomwarp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, clr_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_randomwarp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_randomwarp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -52642,14 +53750,14 @@ int HP_pc_randomwarp(struct map_session_data *sd, clr_type type) {
int HP_pc_memo(struct map_session_data *sd, int pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_memo_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *pos);
+ if (HPMHooks.count.HP_pc_memo_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_memo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_memo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_memo_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &pos);
+ retVal___ = preHookFunc(&sd, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52657,11 +53765,11 @@ int HP_pc_memo(struct map_session_data *sd, int pos) {
{
retVal___ = HPMHooks.source.pc.memo(sd, pos);
}
- if( HPMHooks.count.HP_pc_memo_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_memo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_memo_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_memo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_memo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &pos);
+ retVal___ = postHookFunc(retVal___, sd, pos);
}
}
return retVal___;
@@ -52669,14 +53777,14 @@ int HP_pc_memo(struct map_session_data *sd, int pos) {
int HP_pc_checkadditem(struct map_session_data *sd, int nameid, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkadditem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid, int *amount);
+ if (HPMHooks.count.HP_pc_checkadditem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkadditem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkadditem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkadditem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid, &amount);
+ retVal___ = preHookFunc(&sd, &nameid, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52684,11 +53792,11 @@ int HP_pc_checkadditem(struct map_session_data *sd, int nameid, int amount) {
{
retVal___ = HPMHooks.source.pc.checkadditem(sd, nameid, amount);
}
- if( HPMHooks.count.HP_pc_checkadditem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkadditem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_checkadditem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkadditem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkadditem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid, &amount);
+ retVal___ = postHookFunc(retVal___, sd, nameid, amount);
}
}
return retVal___;
@@ -52696,14 +53804,14 @@ int HP_pc_checkadditem(struct map_session_data *sd, int nameid, int amount) {
int HP_pc_inventoryblank(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_inventoryblank_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_inventoryblank_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventoryblank_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventoryblank_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_inventoryblank_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52711,9 +53819,9 @@ int HP_pc_inventoryblank(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.inventoryblank(sd);
}
- if( HPMHooks.count.HP_pc_inventoryblank_post ) {
+ if (HPMHooks.count.HP_pc_inventoryblank_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventoryblank_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventoryblank_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_inventoryblank_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -52723,14 +53831,14 @@ int HP_pc_inventoryblank(struct map_session_data *sd) {
int HP_pc_search_inventory(struct map_session_data *sd, int item_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_search_inventory_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *item_id);
+ if (HPMHooks.count.HP_pc_search_inventory_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *item_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_search_inventory_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_search_inventory_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_search_inventory_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &item_id);
+ retVal___ = preHookFunc(&sd, &item_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52738,11 +53846,11 @@ int HP_pc_search_inventory(struct map_session_data *sd, int item_id) {
{
retVal___ = HPMHooks.source.pc.search_inventory(sd, item_id);
}
- if( HPMHooks.count.HP_pc_search_inventory_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *item_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_search_inventory_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_search_inventory_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int item_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_search_inventory_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_search_inventory_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &item_id);
+ retVal___ = postHookFunc(retVal___, sd, item_id);
}
}
return retVal___;
@@ -52750,14 +53858,14 @@ int HP_pc_search_inventory(struct map_session_data *sd, int item_id) {
int HP_pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_payzeny_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *zeny, enum e_log_pick_type *type, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_pc_payzeny_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *zeny, enum e_log_pick_type *type, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_payzeny_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_payzeny_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_payzeny_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &zeny, &type, tsd);
+ retVal___ = preHookFunc(&sd, &zeny, &type, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52765,11 +53873,11 @@ int HP_pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type ty
{
retVal___ = HPMHooks.source.pc.payzeny(sd, zeny, type, tsd);
}
- if( HPMHooks.count.HP_pc_payzeny_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *zeny, enum e_log_pick_type *type, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_payzeny_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_payzeny_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_payzeny_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_payzeny_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &zeny, &type, tsd);
+ retVal___ = postHookFunc(retVal___, sd, zeny, type, tsd);
}
}
return retVal___;
@@ -52777,14 +53885,14 @@ int HP_pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type ty
int HP_pc_additem(struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_additem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct item *item_data, int *amount, e_log_pick_type *log_type);
+ if (HPMHooks.count.HP_pc_additem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item **item_data, int *amount, e_log_pick_type *log_type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_additem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, item_data, &amount, &log_type);
+ retVal___ = preHookFunc(&sd, &item_data, &amount, &log_type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52792,11 +53900,11 @@ int HP_pc_additem(struct map_session_data *sd, struct item *item_data, int amoun
{
retVal___ = HPMHooks.source.pc.additem(sd, item_data, amount, log_type);
}
- if( HPMHooks.count.HP_pc_additem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int *amount, e_log_pick_type *log_type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_additem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_additem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, item_data, &amount, &log_type);
+ retVal___ = postHookFunc(retVal___, sd, item_data, amount, log_type);
}
}
return retVal___;
@@ -52804,14 +53912,14 @@ int HP_pc_additem(struct map_session_data *sd, struct item *item_data, int amoun
int HP_pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_getzeny_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *zeny, enum e_log_pick_type *type, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_pc_getzeny_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *zeny, enum e_log_pick_type *type, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getzeny_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getzeny_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_getzeny_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &zeny, &type, tsd);
+ retVal___ = preHookFunc(&sd, &zeny, &type, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52819,11 +53927,11 @@ int HP_pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type ty
{
retVal___ = HPMHooks.source.pc.getzeny(sd, zeny, type, tsd);
}
- if( HPMHooks.count.HP_pc_getzeny_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *zeny, enum e_log_pick_type *type, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getzeny_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_getzeny_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getzeny_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_getzeny_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &zeny, &type, tsd);
+ retVal___ = postHookFunc(retVal___, sd, zeny, type, tsd);
}
}
return retVal___;
@@ -52831,14 +53939,14 @@ int HP_pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type ty
int HP_pc_delitem(struct map_session_data *sd, int n, int amount, int type, short reason, e_log_pick_type log_type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_delitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, int *amount, int *type, short *reason, e_log_pick_type *log_type);
+ if (HPMHooks.count.HP_pc_delitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n, int *amount, int *type, short *reason, e_log_pick_type *log_type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_delitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &amount, &type, &reason, &log_type);
+ retVal___ = preHookFunc(&sd, &n, &amount, &type, &reason, &log_type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52846,11 +53954,11 @@ int HP_pc_delitem(struct map_session_data *sd, int n, int amount, int type, shor
{
retVal___ = HPMHooks.source.pc.delitem(sd, n, amount, type, reason, log_type);
}
- if( HPMHooks.count.HP_pc_delitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, int *amount, int *type, short *reason, e_log_pick_type *log_type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_delitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n, int amount, int type, short reason, e_log_pick_type log_type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_delitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &amount, &type, &reason, &log_type);
+ retVal___ = postHookFunc(retVal___, sd, n, amount, type, reason, log_type);
}
}
return retVal___;
@@ -52858,14 +53966,14 @@ int HP_pc_delitem(struct map_session_data *sd, int n, int amount, int type, shor
int HP_pc_paycash(struct map_session_data *sd, int price, int points) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_paycash_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *price, int *points);
+ if (HPMHooks.count.HP_pc_paycash_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *price, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_paycash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_paycash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_paycash_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &price, &points);
+ retVal___ = preHookFunc(&sd, &price, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52873,11 +53981,11 @@ int HP_pc_paycash(struct map_session_data *sd, int price, int points) {
{
retVal___ = HPMHooks.source.pc.paycash(sd, price, points);
}
- if( HPMHooks.count.HP_pc_paycash_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *price, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_paycash_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_paycash_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int price, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_paycash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_paycash_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &price, &points);
+ retVal___ = postHookFunc(retVal___, sd, price, points);
}
}
return retVal___;
@@ -52885,14 +53993,14 @@ int HP_pc_paycash(struct map_session_data *sd, int price, int points) {
int HP_pc_getcash(struct map_session_data *sd, int cash, int points) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_getcash_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *cash, int *points);
+ if (HPMHooks.count.HP_pc_getcash_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *cash, int *points);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getcash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getcash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_getcash_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &cash, &points);
+ retVal___ = preHookFunc(&sd, &cash, &points);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52900,11 +54008,11 @@ int HP_pc_getcash(struct map_session_data *sd, int cash, int points) {
{
retVal___ = HPMHooks.source.pc.getcash(sd, cash, points);
}
- if( HPMHooks.count.HP_pc_getcash_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *cash, int *points);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getcash_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_getcash_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int cash, int points);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getcash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_getcash_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &cash, &points);
+ retVal___ = postHookFunc(retVal___, sd, cash, points);
}
}
return retVal___;
@@ -52912,14 +54020,14 @@ int HP_pc_getcash(struct map_session_data *sd, int cash, int points) {
int HP_pc_cart_additem(struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_cart_additem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct item *item_data, int *amount, e_log_pick_type *log_type);
+ if (HPMHooks.count.HP_pc_cart_additem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item **item_data, int *amount, e_log_pick_type *log_type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_cart_additem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, item_data, &amount, &log_type);
+ retVal___ = preHookFunc(&sd, &item_data, &amount, &log_type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52927,11 +54035,11 @@ int HP_pc_cart_additem(struct map_session_data *sd, struct item *item_data, int
{
retVal___ = HPMHooks.source.pc.cart_additem(sd, item_data, amount, log_type);
}
- if( HPMHooks.count.HP_pc_cart_additem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int *amount, e_log_pick_type *log_type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_cart_additem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_cart_additem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, item_data, &amount, &log_type);
+ retVal___ = postHookFunc(retVal___, sd, item_data, amount, log_type);
}
}
return retVal___;
@@ -52939,14 +54047,14 @@ int HP_pc_cart_additem(struct map_session_data *sd, struct item *item_data, int
int HP_pc_cart_delitem(struct map_session_data *sd, int n, int amount, int type, e_log_pick_type log_type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_cart_delitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, int *amount, int *type, e_log_pick_type *log_type);
+ if (HPMHooks.count.HP_pc_cart_delitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n, int *amount, int *type, e_log_pick_type *log_type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_delitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_delitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_cart_delitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &amount, &type, &log_type);
+ retVal___ = preHookFunc(&sd, &n, &amount, &type, &log_type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52954,11 +54062,11 @@ int HP_pc_cart_delitem(struct map_session_data *sd, int n, int amount, int type,
{
retVal___ = HPMHooks.source.pc.cart_delitem(sd, n, amount, type, log_type);
}
- if( HPMHooks.count.HP_pc_cart_delitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, int *amount, int *type, e_log_pick_type *log_type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_delitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_cart_delitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n, int amount, int type, e_log_pick_type log_type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cart_delitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_cart_delitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &amount, &type, &log_type);
+ retVal___ = postHookFunc(retVal___, sd, n, amount, type, log_type);
}
}
return retVal___;
@@ -52966,14 +54074,14 @@ int HP_pc_cart_delitem(struct map_session_data *sd, int n, int amount, int type,
int HP_pc_putitemtocart(struct map_session_data *sd, int idx, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_putitemtocart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *idx, int *amount);
+ if (HPMHooks.count.HP_pc_putitemtocart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *idx, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_putitemtocart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_putitemtocart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_putitemtocart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx, &amount);
+ retVal___ = preHookFunc(&sd, &idx, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -52981,11 +54089,11 @@ int HP_pc_putitemtocart(struct map_session_data *sd, int idx, int amount) {
{
retVal___ = HPMHooks.source.pc.putitemtocart(sd, idx, amount);
}
- if( HPMHooks.count.HP_pc_putitemtocart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *idx, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_putitemtocart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_putitemtocart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int idx, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_putitemtocart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_putitemtocart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx, &amount);
+ retVal___ = postHookFunc(retVal___, sd, idx, amount);
}
}
return retVal___;
@@ -52993,14 +54101,14 @@ int HP_pc_putitemtocart(struct map_session_data *sd, int idx, int amount) {
int HP_pc_getitemfromcart(struct map_session_data *sd, int idx, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_getitemfromcart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *idx, int *amount);
+ if (HPMHooks.count.HP_pc_getitemfromcart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *idx, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getitemfromcart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getitemfromcart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_getitemfromcart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx, &amount);
+ retVal___ = preHookFunc(&sd, &idx, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53008,11 +54116,11 @@ int HP_pc_getitemfromcart(struct map_session_data *sd, int idx, int amount) {
{
retVal___ = HPMHooks.source.pc.getitemfromcart(sd, idx, amount);
}
- if( HPMHooks.count.HP_pc_getitemfromcart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *idx, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getitemfromcart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_getitemfromcart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int idx, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getitemfromcart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_getitemfromcart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx, &amount);
+ retVal___ = postHookFunc(retVal___, sd, idx, amount);
}
}
return retVal___;
@@ -53020,14 +54128,14 @@ int HP_pc_getitemfromcart(struct map_session_data *sd, int idx, int amount) {
int HP_pc_cartitem_amount(struct map_session_data *sd, int idx, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_cartitem_amount_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *idx, int *amount);
+ if (HPMHooks.count.HP_pc_cartitem_amount_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *idx, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cartitem_amount_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cartitem_amount_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_cartitem_amount_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx, &amount);
+ retVal___ = preHookFunc(&sd, &idx, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53035,11 +54143,11 @@ int HP_pc_cartitem_amount(struct map_session_data *sd, int idx, int amount) {
{
retVal___ = HPMHooks.source.pc.cartitem_amount(sd, idx, amount);
}
- if( HPMHooks.count.HP_pc_cartitem_amount_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *idx, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cartitem_amount_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_cartitem_amount_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int idx, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cartitem_amount_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_cartitem_amount_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx, &amount);
+ retVal___ = postHookFunc(retVal___, sd, idx, amount);
}
}
return retVal___;
@@ -53047,14 +54155,14 @@ int HP_pc_cartitem_amount(struct map_session_data *sd, int idx, int amount) {
int HP_pc_takeitem(struct map_session_data *sd, struct flooritem_data *fitem) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_takeitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct flooritem_data *fitem);
+ if (HPMHooks.count.HP_pc_takeitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct flooritem_data **fitem);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_takeitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_takeitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_takeitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, fitem);
+ retVal___ = preHookFunc(&sd, &fitem);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53062,9 +54170,9 @@ int HP_pc_takeitem(struct map_session_data *sd, struct flooritem_data *fitem) {
{
retVal___ = HPMHooks.source.pc.takeitem(sd, fitem);
}
- if( HPMHooks.count.HP_pc_takeitem_post ) {
+ if (HPMHooks.count.HP_pc_takeitem_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct flooritem_data *fitem);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_takeitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_takeitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_takeitem_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, fitem);
}
@@ -53074,14 +54182,14 @@ int HP_pc_takeitem(struct map_session_data *sd, struct flooritem_data *fitem) {
int HP_pc_dropitem(struct map_session_data *sd, int n, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_dropitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, int *amount);
+ if (HPMHooks.count.HP_pc_dropitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_dropitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_dropitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_dropitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &amount);
+ retVal___ = preHookFunc(&sd, &n, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53089,11 +54197,11 @@ int HP_pc_dropitem(struct map_session_data *sd, int n, int amount) {
{
retVal___ = HPMHooks.source.pc.dropitem(sd, n, amount);
}
- if( HPMHooks.count.HP_pc_dropitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_dropitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_dropitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_dropitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_dropitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &amount);
+ retVal___ = postHookFunc(retVal___, sd, n, amount);
}
}
return retVal___;
@@ -53101,14 +54209,14 @@ int HP_pc_dropitem(struct map_session_data *sd, int n, int amount) {
bool HP_pc_isequipped(struct map_session_data *sd, int nameid) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_isequipped_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_pc_isequipped_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequipped_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequipped_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_isequipped_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53116,11 +54224,11 @@ bool HP_pc_isequipped(struct map_session_data *sd, int nameid) {
{
retVal___ = HPMHooks.source.pc.isequipped(sd, nameid);
}
- if( HPMHooks.count.HP_pc_isequipped_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequipped_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_isequipped_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isequipped_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_isequipped_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
@@ -53128,14 +54236,14 @@ bool HP_pc_isequipped(struct map_session_data *sd, int nameid) {
bool HP_pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_can_Adopt_pre ) {
- bool (*preHookFunc) (struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
+ if (HPMHooks.count.HP_pc_can_Adopt_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **p1_sd, struct map_session_data **p2_sd, struct map_session_data **b_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_Adopt_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_Adopt_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_can_Adopt_pre[hIndex].func;
- retVal___ = preHookFunc(p1_sd, p2_sd, b_sd);
+ retVal___ = preHookFunc(&p1_sd, &p2_sd, &b_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53143,9 +54251,9 @@ bool HP_pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2
{
retVal___ = HPMHooks.source.pc.can_Adopt(p1_sd, p2_sd, b_sd);
}
- if( HPMHooks.count.HP_pc_can_Adopt_post ) {
+ if (HPMHooks.count.HP_pc_can_Adopt_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_Adopt_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_Adopt_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_can_Adopt_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p1_sd, p2_sd, b_sd);
}
@@ -53155,14 +54263,14 @@ bool HP_pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2
bool HP_pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_adoption_pre ) {
- bool (*preHookFunc) (struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
+ if (HPMHooks.count.HP_pc_adoption_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **p1_sd, struct map_session_data **p2_sd, struct map_session_data **b_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_adoption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_adoption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_adoption_pre[hIndex].func;
- retVal___ = preHookFunc(p1_sd, p2_sd, b_sd);
+ retVal___ = preHookFunc(&p1_sd, &p2_sd, &b_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53170,9 +54278,9 @@ bool HP_pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_
{
retVal___ = HPMHooks.source.pc.adoption(p1_sd, p2_sd, b_sd);
}
- if( HPMHooks.count.HP_pc_adoption_post ) {
+ if (HPMHooks.count.HP_pc_adoption_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_adoption_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_adoption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_adoption_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p1_sd, p2_sd, b_sd);
}
@@ -53182,14 +54290,14 @@ bool HP_pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_
int HP_pc_updateweightstatus(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_updateweightstatus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_updateweightstatus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_updateweightstatus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_updateweightstatus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_updateweightstatus_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53197,9 +54305,9 @@ int HP_pc_updateweightstatus(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.updateweightstatus(sd);
}
- if( HPMHooks.count.HP_pc_updateweightstatus_post ) {
+ if (HPMHooks.count.HP_pc_updateweightstatus_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_updateweightstatus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_updateweightstatus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_updateweightstatus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -53209,14 +54317,14 @@ int HP_pc_updateweightstatus(struct map_session_data *sd) {
int HP_pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned short pos, bool onskill) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_addautobonus_pre ) {
- int (*preHookFunc) (struct s_autobonus *bonus, char *max, const char *bonus_script, short *rate, unsigned int *dur, short *atk_type, const char *o_script, unsigned short *pos, bool *onskill);
+ if (HPMHooks.count.HP_pc_addautobonus_pre > 0) {
+ int (*preHookFunc) (struct s_autobonus **bonus, char *max, const char **bonus_script, short *rate, unsigned int *dur, short *atk_type, const char **o_script, unsigned short *pos, bool *onskill);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addautobonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addautobonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_addautobonus_pre[hIndex].func;
- retVal___ = preHookFunc(bonus, &max, bonus_script, &rate, &dur, &atk_type, o_script, &pos, &onskill);
+ retVal___ = preHookFunc(&bonus, &max, &bonus_script, &rate, &dur, &atk_type, &o_script, &pos, &onskill);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53224,11 +54332,11 @@ int HP_pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_sc
{
retVal___ = HPMHooks.source.pc.addautobonus(bonus, max, bonus_script, rate, dur, atk_type, o_script, pos, onskill);
}
- if( HPMHooks.count.HP_pc_addautobonus_post ) {
- int (*postHookFunc) (int retVal___, struct s_autobonus *bonus, char *max, const char *bonus_script, short *rate, unsigned int *dur, short *atk_type, const char *o_script, unsigned short *pos, bool *onskill);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addautobonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_addautobonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short atk_type, const char *o_script, unsigned short pos, bool onskill);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addautobonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_addautobonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bonus, &max, bonus_script, &rate, &dur, &atk_type, o_script, &pos, &onskill);
+ retVal___ = postHookFunc(retVal___, bonus, max, bonus_script, rate, dur, atk_type, o_script, pos, onskill);
}
}
return retVal___;
@@ -53236,14 +54344,14 @@ int HP_pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_sc
int HP_pc_exeautobonus(struct map_session_data *sd, struct s_autobonus *bonus) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_exeautobonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct s_autobonus *bonus);
+ if (HPMHooks.count.HP_pc_exeautobonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct s_autobonus **bonus);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_exeautobonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_exeautobonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_exeautobonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bonus);
+ retVal___ = preHookFunc(&sd, &bonus);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53251,9 +54359,9 @@ int HP_pc_exeautobonus(struct map_session_data *sd, struct s_autobonus *bonus) {
{
retVal___ = HPMHooks.source.pc.exeautobonus(sd, bonus);
}
- if( HPMHooks.count.HP_pc_exeautobonus_post ) {
+ if (HPMHooks.count.HP_pc_exeautobonus_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct s_autobonus *bonus);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_exeautobonus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_exeautobonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_exeautobonus_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, bonus);
}
@@ -53263,14 +54371,14 @@ int HP_pc_exeautobonus(struct map_session_data *sd, struct s_autobonus *bonus) {
int HP_pc_endautobonus(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_endautobonus_pre ) {
+ if (HPMHooks.count.HP_pc_endautobonus_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_endautobonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_endautobonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_endautobonus_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53278,11 +54386,11 @@ int HP_pc_endautobonus(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.endautobonus(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_endautobonus_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_endautobonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_endautobonus_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_endautobonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_endautobonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -53290,14 +54398,14 @@ int HP_pc_endautobonus(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_delautobonus(struct map_session_data *sd, struct s_autobonus *bonus, char max, bool restore) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_delautobonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct s_autobonus *bonus, char *max, bool *restore);
+ if (HPMHooks.count.HP_pc_delautobonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct s_autobonus **bonus, char *max, bool *restore);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delautobonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delautobonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_delautobonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bonus, &max, &restore);
+ retVal___ = preHookFunc(&sd, &bonus, &max, &restore);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53305,11 +54413,11 @@ int HP_pc_delautobonus(struct map_session_data *sd, struct s_autobonus *bonus, c
{
retVal___ = HPMHooks.source.pc.delautobonus(sd, bonus, max, restore);
}
- if( HPMHooks.count.HP_pc_delautobonus_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct s_autobonus *bonus, char *max, bool *restore);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delautobonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_delautobonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct s_autobonus *bonus, char max, bool restore);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delautobonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_delautobonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, bonus, &max, &restore);
+ retVal___ = postHookFunc(retVal___, sd, bonus, max, restore);
}
}
return retVal___;
@@ -53317,14 +54425,14 @@ int HP_pc_delautobonus(struct map_session_data *sd, struct s_autobonus *bonus, c
int HP_pc_bonus(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_pc_bonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &val);
+ retVal___ = preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53332,11 +54440,11 @@ int HP_pc_bonus(struct map_session_data *sd, int type, int val) {
{
retVal___ = HPMHooks.source.pc.bonus(sd, type, val);
}
- if( HPMHooks.count.HP_pc_bonus_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, val);
}
}
return retVal___;
@@ -53344,14 +54452,14 @@ int HP_pc_bonus(struct map_session_data *sd, int type, int val) {
int HP_pc_bonus2(struct map_session_data *sd, int type, int type2, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus2_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *type2, int *val);
+ if (HPMHooks.count.HP_pc_bonus2_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *type2, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus2_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &type2, &val);
+ retVal___ = preHookFunc(&sd, &type, &type2, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53359,11 +54467,11 @@ int HP_pc_bonus2(struct map_session_data *sd, int type, int type2, int val) {
{
retVal___ = HPMHooks.source.pc.bonus2(sd, type, type2, val);
}
- if( HPMHooks.count.HP_pc_bonus2_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *type2, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int type2, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &type2, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, type2, val);
}
}
return retVal___;
@@ -53371,14 +54479,14 @@ int HP_pc_bonus2(struct map_session_data *sd, int type, int type2, int val) {
int HP_pc_bonus3(struct map_session_data *sd, int type, int type2, int type3, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus3_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *type2, int *type3, int *val);
+ if (HPMHooks.count.HP_pc_bonus3_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *type2, int *type3, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus3_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus3_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus3_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &type2, &type3, &val);
+ retVal___ = preHookFunc(&sd, &type, &type2, &type3, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53386,11 +54494,11 @@ int HP_pc_bonus3(struct map_session_data *sd, int type, int type2, int type3, in
{
retVal___ = HPMHooks.source.pc.bonus3(sd, type, type2, type3, val);
}
- if( HPMHooks.count.HP_pc_bonus3_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *type2, int *type3, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus3_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus3_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int type2, int type3, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus3_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus3_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &type2, &type3, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, type2, type3, val);
}
}
return retVal___;
@@ -53398,14 +54506,14 @@ int HP_pc_bonus3(struct map_session_data *sd, int type, int type2, int type3, in
int HP_pc_bonus4(struct map_session_data *sd, int type, int type2, int type3, int type4, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus4_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *type2, int *type3, int *type4, int *val);
+ if (HPMHooks.count.HP_pc_bonus4_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *type2, int *type3, int *type4, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus4_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus4_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus4_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &type2, &type3, &type4, &val);
+ retVal___ = preHookFunc(&sd, &type, &type2, &type3, &type4, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53413,11 +54521,11 @@ int HP_pc_bonus4(struct map_session_data *sd, int type, int type2, int type3, in
{
retVal___ = HPMHooks.source.pc.bonus4(sd, type, type2, type3, type4, val);
}
- if( HPMHooks.count.HP_pc_bonus4_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *type2, int *type3, int *type4, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus4_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus4_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int type2, int type3, int type4, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus4_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus4_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &type2, &type3, &type4, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, type2, type3, type4, val);
}
}
return retVal___;
@@ -53425,14 +54533,14 @@ int HP_pc_bonus4(struct map_session_data *sd, int type, int type2, int type3, in
int HP_pc_bonus5(struct map_session_data *sd, int type, int type2, int type3, int type4, int type5, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus5_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *type2, int *type3, int *type4, int *type5, int *val);
+ if (HPMHooks.count.HP_pc_bonus5_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *type2, int *type3, int *type4, int *type5, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus5_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus5_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus5_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &type2, &type3, &type4, &type5, &val);
+ retVal___ = preHookFunc(&sd, &type, &type2, &type3, &type4, &type5, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53440,11 +54548,11 @@ int HP_pc_bonus5(struct map_session_data *sd, int type, int type2, int type3, in
{
retVal___ = HPMHooks.source.pc.bonus5(sd, type, type2, type3, type4, type5, val);
}
- if( HPMHooks.count.HP_pc_bonus5_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *type2, int *type3, int *type4, int *type5, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus5_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus5_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int type2, int type3, int type4, int type5, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus5_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus5_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &type2, &type3, &type4, &type5, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, type2, type3, type4, type5, val);
}
}
return retVal___;
@@ -53452,14 +54560,14 @@ int HP_pc_bonus5(struct map_session_data *sd, int type, int type2, int type3, in
int HP_pc_skill(struct map_session_data *sd, int id, int level, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_skill_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *id, int *level, int *flag);
+ if (HPMHooks.count.HP_pc_skill_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *id, int *level, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_skill_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &id, &level, &flag);
+ retVal___ = preHookFunc(&sd, &id, &level, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53467,11 +54575,11 @@ int HP_pc_skill(struct map_session_data *sd, int id, int level, int flag) {
{
retVal___ = HPMHooks.source.pc.skill(sd, id, level, flag);
}
- if( HPMHooks.count.HP_pc_skill_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *id, int *level, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_skill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int id, int level, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_skill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &id, &level, &flag);
+ retVal___ = postHookFunc(retVal___, sd, id, level, flag);
}
}
return retVal___;
@@ -53479,14 +54587,14 @@ int HP_pc_skill(struct map_session_data *sd, int id, int level, int flag) {
int HP_pc_insert_card(struct map_session_data *sd, int idx_card, int idx_equip) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_insert_card_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *idx_card, int *idx_equip);
+ if (HPMHooks.count.HP_pc_insert_card_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *idx_card, int *idx_equip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_insert_card_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_insert_card_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_insert_card_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx_card, &idx_equip);
+ retVal___ = preHookFunc(&sd, &idx_card, &idx_equip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53494,11 +54602,11 @@ int HP_pc_insert_card(struct map_session_data *sd, int idx_card, int idx_equip)
{
retVal___ = HPMHooks.source.pc.insert_card(sd, idx_card, idx_equip);
}
- if( HPMHooks.count.HP_pc_insert_card_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *idx_card, int *idx_equip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_insert_card_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_insert_card_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int idx_card, int idx_equip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_insert_card_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_insert_card_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx_card, &idx_equip);
+ retVal___ = postHookFunc(retVal___, sd, idx_card, idx_equip);
}
}
return retVal___;
@@ -53506,14 +54614,14 @@ int HP_pc_insert_card(struct map_session_data *sd, int idx_card, int idx_equip)
bool HP_pc_can_insert_card(struct map_session_data *sd, int idx_card) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_can_insert_card_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *idx_card);
+ if (HPMHooks.count.HP_pc_can_insert_card_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *idx_card);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_can_insert_card_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx_card);
+ retVal___ = preHookFunc(&sd, &idx_card);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53521,11 +54629,11 @@ bool HP_pc_can_insert_card(struct map_session_data *sd, int idx_card) {
{
retVal___ = HPMHooks.source.pc.can_insert_card(sd, idx_card);
}
- if( HPMHooks.count.HP_pc_can_insert_card_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *idx_card);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_can_insert_card_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int idx_card);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_can_insert_card_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx_card);
+ retVal___ = postHookFunc(retVal___, sd, idx_card);
}
}
return retVal___;
@@ -53533,14 +54641,14 @@ bool HP_pc_can_insert_card(struct map_session_data *sd, int idx_card) {
bool HP_pc_can_insert_card_into(struct map_session_data *sd, int idx_card, int idx_equip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_can_insert_card_into_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *idx_card, int *idx_equip);
+ if (HPMHooks.count.HP_pc_can_insert_card_into_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *idx_card, int *idx_equip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_into_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_into_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_can_insert_card_into_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &idx_card, &idx_equip);
+ retVal___ = preHookFunc(&sd, &idx_card, &idx_equip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53548,11 +54656,11 @@ bool HP_pc_can_insert_card_into(struct map_session_data *sd, int idx_card, int i
{
retVal___ = HPMHooks.source.pc.can_insert_card_into(sd, idx_card, idx_equip);
}
- if( HPMHooks.count.HP_pc_can_insert_card_into_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *idx_card, int *idx_equip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_into_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_can_insert_card_into_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int idx_card, int idx_equip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_into_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_can_insert_card_into_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &idx_card, &idx_equip);
+ retVal___ = postHookFunc(retVal___, sd, idx_card, idx_equip);
}
}
return retVal___;
@@ -53560,14 +54668,14 @@ bool HP_pc_can_insert_card_into(struct map_session_data *sd, int idx_card, int i
int HP_pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_steal_item_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct block_list *bl, uint16 *skill_lv);
+ if (HPMHooks.count.HP_pc_steal_item_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_steal_item_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bl, &skill_lv);
+ retVal___ = preHookFunc(&sd, &bl, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53575,38 +54683,38 @@ int HP_pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16
{
retVal___ = HPMHooks.source.pc.steal_item(sd, bl, skill_lv);
}
- if( HPMHooks.count.HP_pc_steal_item_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_item_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_steal_item_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_steal_item_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, bl, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, bl, skill_lv);
}
}
return retVal___;
}
-int HP_pc_steal_coin(struct map_session_data *sd, struct block_list *bl) {
+int HP_pc_steal_coin(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_steal_coin_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct block_list *bl);
+ if (HPMHooks.count.HP_pc_steal_coin_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_coin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_coin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_steal_coin_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bl);
+ retVal___ = preHookFunc(&sd, &bl, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.steal_coin(sd, bl);
+ retVal___ = HPMHooks.source.pc.steal_coin(sd, bl, skill_lv);
}
- if( HPMHooks.count.HP_pc_steal_coin_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_coin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_steal_coin_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_steal_coin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_steal_coin_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, bl);
+ retVal___ = postHookFunc(retVal___, sd, bl, skill_lv);
}
}
return retVal___;
@@ -53614,14 +54722,14 @@ int HP_pc_steal_coin(struct map_session_data *sd, struct block_list *bl) {
int HP_pc_modifybuyvalue(struct map_session_data *sd, int orig_value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_modifybuyvalue_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *orig_value);
+ if (HPMHooks.count.HP_pc_modifybuyvalue_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *orig_value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifybuyvalue_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifybuyvalue_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_modifybuyvalue_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &orig_value);
+ retVal___ = preHookFunc(&sd, &orig_value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53629,11 +54737,11 @@ int HP_pc_modifybuyvalue(struct map_session_data *sd, int orig_value) {
{
retVal___ = HPMHooks.source.pc.modifybuyvalue(sd, orig_value);
}
- if( HPMHooks.count.HP_pc_modifybuyvalue_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *orig_value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifybuyvalue_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_modifybuyvalue_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int orig_value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifybuyvalue_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_modifybuyvalue_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &orig_value);
+ retVal___ = postHookFunc(retVal___, sd, orig_value);
}
}
return retVal___;
@@ -53641,14 +54749,14 @@ int HP_pc_modifybuyvalue(struct map_session_data *sd, int orig_value) {
int HP_pc_modifysellvalue(struct map_session_data *sd, int orig_value) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_modifysellvalue_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *orig_value);
+ if (HPMHooks.count.HP_pc_modifysellvalue_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *orig_value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifysellvalue_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifysellvalue_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_modifysellvalue_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &orig_value);
+ retVal___ = preHookFunc(&sd, &orig_value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53656,11 +54764,11 @@ int HP_pc_modifysellvalue(struct map_session_data *sd, int orig_value) {
{
retVal___ = HPMHooks.source.pc.modifysellvalue(sd, orig_value);
}
- if( HPMHooks.count.HP_pc_modifysellvalue_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *orig_value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifysellvalue_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_modifysellvalue_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int orig_value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_modifysellvalue_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_modifysellvalue_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &orig_value);
+ retVal___ = postHookFunc(retVal___, sd, orig_value);
}
}
return retVal___;
@@ -53668,14 +54776,14 @@ int HP_pc_modifysellvalue(struct map_session_data *sd, int orig_value) {
int HP_pc_follow(struct map_session_data *sd, int target_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_follow_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *target_id);
+ if (HPMHooks.count.HP_pc_follow_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_follow_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &target_id);
+ retVal___ = preHookFunc(&sd, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53683,11 +54791,11 @@ int HP_pc_follow(struct map_session_data *sd, int target_id) {
{
retVal___ = HPMHooks.source.pc.follow(sd, target_id);
}
- if( HPMHooks.count.HP_pc_follow_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_follow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_follow_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &target_id);
+ retVal___ = postHookFunc(retVal___, sd, target_id);
}
}
return retVal___;
@@ -53695,14 +54803,14 @@ int HP_pc_follow(struct map_session_data *sd, int target_id) {
int HP_pc_stop_following(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_stop_following_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_stop_following_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_stop_following_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_stop_following_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_stop_following_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53710,26 +54818,26 @@ int HP_pc_stop_following(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.stop_following(sd);
}
- if( HPMHooks.count.HP_pc_stop_following_post ) {
+ if (HPMHooks.count.HP_pc_stop_following_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_stop_following_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_stop_following_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_stop_following_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-unsigned int HP_pc_maxbaselv(struct map_session_data *sd) {
+int HP_pc_maxbaselv(const struct map_session_data *sd) {
int hIndex = 0;
- unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_pc_maxbaselv_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_maxbaselv_pre > 0) {
+ int (*preHookFunc) (const struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxbaselv_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxbaselv_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_maxbaselv_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53737,26 +54845,26 @@ unsigned int HP_pc_maxbaselv(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.maxbaselv(sd);
}
- if( HPMHooks.count.HP_pc_maxbaselv_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxbaselv_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_maxbaselv_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxbaselv_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_maxbaselv_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-unsigned int HP_pc_maxjoblv(struct map_session_data *sd) {
+int HP_pc_maxjoblv(const struct map_session_data *sd) {
int hIndex = 0;
- unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_pc_maxjoblv_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_maxjoblv_pre > 0) {
+ int (*preHookFunc) (const struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxjoblv_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxjoblv_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_maxjoblv_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53764,9 +54872,9 @@ unsigned int HP_pc_maxjoblv(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.maxjoblv(sd);
}
- if( HPMHooks.count.HP_pc_maxjoblv_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxjoblv_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_maxjoblv_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxjoblv_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_maxjoblv_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -53776,14 +54884,14 @@ unsigned int HP_pc_maxjoblv(struct map_session_data *sd) {
int HP_pc_checkbaselevelup(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkbaselevelup_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_checkbaselevelup_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkbaselevelup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkbaselevelup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkbaselevelup_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53791,9 +54899,9 @@ int HP_pc_checkbaselevelup(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.checkbaselevelup(sd);
}
- if( HPMHooks.count.HP_pc_checkbaselevelup_post ) {
+ if (HPMHooks.count.HP_pc_checkbaselevelup_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkbaselevelup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkbaselevelup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkbaselevelup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -53803,14 +54911,14 @@ int HP_pc_checkbaselevelup(struct map_session_data *sd) {
int HP_pc_checkjoblevelup(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkjoblevelup_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_checkjoblevelup_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkjoblevelup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkjoblevelup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkjoblevelup_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53818,9 +54926,9 @@ int HP_pc_checkjoblevelup(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.checkjoblevelup(sd);
}
- if( HPMHooks.count.HP_pc_checkjoblevelup_post ) {
+ if (HPMHooks.count.HP_pc_checkjoblevelup_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkjoblevelup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkjoblevelup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkjoblevelup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -53830,14 +54938,14 @@ int HP_pc_checkjoblevelup(struct map_session_data *sd) {
bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_gainexp_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct block_list *src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest);
+ if (HPMHooks.count.HP_pc_gainexp_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, struct block_list **src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_gainexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_gainexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_gainexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd, src, &base_exp, &job_exp, &is_quest);
+ retVal___ = preHookFunc(&sd, &src, &base_exp, &job_exp, &is_quest);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53845,26 +54953,26 @@ bool HP_pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned
{
retVal___ = HPMHooks.source.pc.gainexp(sd, src, base_exp, job_exp, is_quest);
}
- if( HPMHooks.count.HP_pc_gainexp_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct block_list *src, unsigned int *base_exp, unsigned int *job_exp, bool *is_quest);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_gainexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_gainexp_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_gainexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_gainexp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, src, &base_exp, &job_exp, &is_quest);
+ retVal___ = postHookFunc(retVal___, sd, src, base_exp, job_exp, is_quest);
}
}
return retVal___;
}
-unsigned int HP_pc_nextbaseexp(struct map_session_data *sd) {
+unsigned int HP_pc_nextbaseexp(const struct map_session_data *sd) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_pc_nextbaseexp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_nextbaseexp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_nextbaseexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53872,26 +54980,26 @@ unsigned int HP_pc_nextbaseexp(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.nextbaseexp(sd);
}
- if( HPMHooks.count.HP_pc_nextbaseexp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_nextbaseexp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextbaseexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_nextbaseexp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-unsigned int HP_pc_thisbaseexp(struct map_session_data *sd) {
+unsigned int HP_pc_thisbaseexp(const struct map_session_data *sd) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_pc_thisbaseexp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_thisbaseexp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_thisbaseexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53899,26 +55007,26 @@ unsigned int HP_pc_thisbaseexp(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.thisbaseexp(sd);
}
- if( HPMHooks.count.HP_pc_thisbaseexp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_thisbaseexp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisbaseexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_thisbaseexp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-unsigned int HP_pc_nextjobexp(struct map_session_data *sd) {
+unsigned int HP_pc_nextjobexp(const struct map_session_data *sd) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_pc_nextjobexp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_nextjobexp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_nextjobexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53926,26 +55034,26 @@ unsigned int HP_pc_nextjobexp(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.nextjobexp(sd);
}
- if( HPMHooks.count.HP_pc_nextjobexp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_nextjobexp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_nextjobexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_nextjobexp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-unsigned int HP_pc_thisjobexp(struct map_session_data *sd) {
+unsigned int HP_pc_thisjobexp(const struct map_session_data *sd) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_pc_thisjobexp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_thisjobexp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_thisjobexp_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53953,9 +55061,9 @@ unsigned int HP_pc_thisjobexp(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.thisjobexp(sd);
}
- if( HPMHooks.count.HP_pc_thisjobexp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_thisjobexp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_thisjobexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_thisjobexp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -53965,14 +55073,14 @@ unsigned int HP_pc_thisjobexp(struct map_session_data *sd) {
int HP_pc_gets_status_point(int level) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_gets_status_point_pre ) {
+ if (HPMHooks.count.HP_pc_gets_status_point_pre > 0) {
int (*preHookFunc) (int *level);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_gets_status_point_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_gets_status_point_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_gets_status_point_pre[hIndex].func;
retVal___ = preHookFunc(&level);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -53980,11 +55088,11 @@ int HP_pc_gets_status_point(int level) {
{
retVal___ = HPMHooks.source.pc.gets_status_point(level);
}
- if( HPMHooks.count.HP_pc_gets_status_point_post ) {
- int (*postHookFunc) (int retVal___, int *level);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_gets_status_point_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_gets_status_point_post > 0) {
+ int (*postHookFunc) (int retVal___, int level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_gets_status_point_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_gets_status_point_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &level);
+ retVal___ = postHookFunc(retVal___, level);
}
}
return retVal___;
@@ -53992,14 +55100,14 @@ int HP_pc_gets_status_point(int level) {
int HP_pc_need_status_point(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_need_status_point_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_pc_need_status_point_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_need_status_point_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_need_status_point_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_need_status_point_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &val);
+ retVal___ = preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54007,11 +55115,11 @@ int HP_pc_need_status_point(struct map_session_data *sd, int type, int val) {
{
retVal___ = HPMHooks.source.pc.need_status_point(sd, type, val);
}
- if( HPMHooks.count.HP_pc_need_status_point_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_need_status_point_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_need_status_point_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_need_status_point_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_need_status_point_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, val);
}
}
return retVal___;
@@ -54019,14 +55127,14 @@ int HP_pc_need_status_point(struct map_session_data *sd, int type, int val) {
int HP_pc_maxparameterincrease(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_maxparameterincrease_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_maxparameterincrease_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxparameterincrease_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxparameterincrease_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_maxparameterincrease_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54034,11 +55142,11 @@ int HP_pc_maxparameterincrease(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.maxparameterincrease(sd, type);
}
- if( HPMHooks.count.HP_pc_maxparameterincrease_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxparameterincrease_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_maxparameterincrease_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxparameterincrease_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_maxparameterincrease_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -54046,14 +55154,14 @@ int HP_pc_maxparameterincrease(struct map_session_data *sd, int type) {
bool HP_pc_statusup(struct map_session_data *sd, int type, int increase) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_statusup_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *type, int *increase);
+ if (HPMHooks.count.HP_pc_statusup_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *type, int *increase);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_statusup_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &increase);
+ retVal___ = preHookFunc(&sd, &type, &increase);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54061,11 +55169,11 @@ bool HP_pc_statusup(struct map_session_data *sd, int type, int increase) {
{
retVal___ = HPMHooks.source.pc.statusup(sd, type, increase);
}
- if( HPMHooks.count.HP_pc_statusup_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *type, int *increase);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_statusup_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int type, int increase);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_statusup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &increase);
+ retVal___ = postHookFunc(retVal___, sd, type, increase);
}
}
return retVal___;
@@ -54073,14 +55181,14 @@ bool HP_pc_statusup(struct map_session_data *sd, int type, int increase) {
int HP_pc_statusup2(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_statusup2_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_pc_statusup2_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_statusup2_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &val);
+ retVal___ = preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54088,11 +55196,11 @@ int HP_pc_statusup2(struct map_session_data *sd, int type, int val) {
{
retVal___ = HPMHooks.source.pc.statusup2(sd, type, val);
}
- if( HPMHooks.count.HP_pc_statusup2_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_statusup2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_statusup2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, val);
}
}
return retVal___;
@@ -54100,14 +55208,14 @@ int HP_pc_statusup2(struct map_session_data *sd, int type, int val) {
int HP_pc_skillup(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_skillup_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_pc_skillup_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_skillup_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54115,11 +55223,11 @@ int HP_pc_skillup(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.pc.skillup(sd, skill_id);
}
- if( HPMHooks.count.HP_pc_skillup_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_skillup_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_skillup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
@@ -54127,14 +55235,14 @@ int HP_pc_skillup(struct map_session_data *sd, uint16 skill_id) {
int HP_pc_allskillup(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_allskillup_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_allskillup_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_allskillup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_allskillup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_allskillup_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54142,9 +55250,9 @@ int HP_pc_allskillup(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.allskillup(sd);
}
- if( HPMHooks.count.HP_pc_allskillup_post ) {
+ if (HPMHooks.count.HP_pc_allskillup_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_allskillup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_allskillup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_allskillup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -54154,14 +55262,14 @@ int HP_pc_allskillup(struct map_session_data *sd) {
int HP_pc_resetlvl(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_resetlvl_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_resetlvl_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetlvl_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetlvl_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_resetlvl_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54169,11 +55277,11 @@ int HP_pc_resetlvl(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.resetlvl(sd, type);
}
- if( HPMHooks.count.HP_pc_resetlvl_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetlvl_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_resetlvl_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetlvl_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_resetlvl_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -54181,14 +55289,14 @@ int HP_pc_resetlvl(struct map_session_data *sd, int type) {
int HP_pc_resetstate(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_resetstate_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_resetstate_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetstate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetstate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_resetstate_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54196,9 +55304,9 @@ int HP_pc_resetstate(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.resetstate(sd);
}
- if( HPMHooks.count.HP_pc_resetstate_post ) {
+ if (HPMHooks.count.HP_pc_resetstate_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetstate_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetstate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_resetstate_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -54208,14 +55316,14 @@ int HP_pc_resetstate(struct map_session_data *sd) {
int HP_pc_resetskill(struct map_session_data *sd, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_resetskill_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_pc_resetskill_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_resetskill_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &flag);
+ retVal___ = preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54223,11 +55331,11 @@ int HP_pc_resetskill(struct map_session_data *sd, int flag) {
{
retVal___ = HPMHooks.source.pc.resetskill(sd, flag);
}
- if( HPMHooks.count.HP_pc_resetskill_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_resetskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_resetskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &flag);
+ retVal___ = postHookFunc(retVal___, sd, flag);
}
}
return retVal___;
@@ -54235,14 +55343,14 @@ int HP_pc_resetskill(struct map_session_data *sd, int flag) {
int HP_pc_resetfeel(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_resetfeel_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_resetfeel_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetfeel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetfeel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_resetfeel_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54250,9 +55358,9 @@ int HP_pc_resetfeel(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.resetfeel(sd);
}
- if( HPMHooks.count.HP_pc_resetfeel_post ) {
+ if (HPMHooks.count.HP_pc_resetfeel_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetfeel_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resetfeel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_resetfeel_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -54262,14 +55370,14 @@ int HP_pc_resetfeel(struct map_session_data *sd) {
int HP_pc_resethate(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_resethate_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_resethate_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resethate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resethate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_resethate_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54277,9 +55385,9 @@ int HP_pc_resethate(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.resethate(sd);
}
- if( HPMHooks.count.HP_pc_resethate_post ) {
+ if (HPMHooks.count.HP_pc_resethate_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_resethate_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_resethate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_resethate_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -54289,14 +55397,14 @@ int HP_pc_resethate(struct map_session_data *sd) {
int HP_pc_equipitem(struct map_session_data *sd, int n, int req_pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_equipitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, int *req_pos);
+ if (HPMHooks.count.HP_pc_equipitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n, int *req_pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_equipitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &req_pos);
+ retVal___ = preHookFunc(&sd, &n, &req_pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54304,25 +55412,25 @@ int HP_pc_equipitem(struct map_session_data *sd, int n, int req_pos) {
{
retVal___ = HPMHooks.source.pc.equipitem(sd, n, req_pos);
}
- if( HPMHooks.count.HP_pc_equipitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, int *req_pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_equipitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n, int req_pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_equipitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &req_pos);
+ retVal___ = postHookFunc(retVal___, sd, n, req_pos);
}
}
return retVal___;
}
void HP_pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, int pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_equipitem_pos_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item_data *id, int *n, int *pos);
+ if (HPMHooks.count.HP_pc_equipitem_pos_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item_data **id, int *n, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_equipitem_pos_pre[hIndex].func;
- preHookFunc(sd, id, &n, &pos);
+ preHookFunc(&sd, &id, &n, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54330,11 +55438,11 @@ void HP_pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int
{
HPMHooks.source.pc.equipitem_pos(sd, id, n, pos);
}
- if( HPMHooks.count.HP_pc_equipitem_pos_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct item_data *id, int *n, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_equipitem_pos_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct item_data *id, int n, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equipitem_pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_equipitem_pos_post[hIndex].func;
- postHookFunc(sd, id, &n, &pos);
+ postHookFunc(sd, id, n, pos);
}
}
return;
@@ -54342,14 +55450,14 @@ void HP_pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int
int HP_pc_unequipitem(struct map_session_data *sd, int n, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_unequipitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, int *flag);
+ if (HPMHooks.count.HP_pc_unequipitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_unequipitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &flag);
+ retVal___ = preHookFunc(&sd, &n, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54357,25 +55465,25 @@ int HP_pc_unequipitem(struct map_session_data *sd, int n, int flag) {
{
retVal___ = HPMHooks.source.pc.unequipitem(sd, n, flag);
}
- if( HPMHooks.count.HP_pc_unequipitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_unequipitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_unequipitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &flag);
+ retVal___ = postHookFunc(retVal___, sd, n, flag);
}
}
return retVal___;
}
void HP_pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_unequipitem_pos_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *n, int *pos);
+ if (HPMHooks.count.HP_pc_unequipitem_pos_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *n, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_unequipitem_pos_pre[hIndex].func;
- preHookFunc(sd, &n, &pos);
+ preHookFunc(&sd, &n, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54383,11 +55491,11 @@ void HP_pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) {
{
HPMHooks.source.pc.unequipitem_pos(sd, n, pos);
}
- if( HPMHooks.count.HP_pc_unequipitem_pos_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *n, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_unequipitem_pos_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int n, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_unequipitem_pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_unequipitem_pos_post[hIndex].func;
- postHookFunc(sd, &n, &pos);
+ postHookFunc(sd, n, pos);
}
}
return;
@@ -54395,14 +55503,14 @@ void HP_pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) {
int HP_pc_checkitem(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_checkitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54410,9 +55518,9 @@ int HP_pc_checkitem(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.checkitem(sd);
}
- if( HPMHooks.count.HP_pc_checkitem_post ) {
+ if (HPMHooks.count.HP_pc_checkitem_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkitem_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -54422,14 +55530,14 @@ int HP_pc_checkitem(struct map_session_data *sd) {
int HP_pc_useitem(struct map_session_data *sd, int n) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_useitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n);
+ if (HPMHooks.count.HP_pc_useitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_useitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_useitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_useitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n);
+ retVal___ = preHookFunc(&sd, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54437,11 +55545,11 @@ int HP_pc_useitem(struct map_session_data *sd, int n) {
{
retVal___ = HPMHooks.source.pc.useitem(sd, n);
}
- if( HPMHooks.count.HP_pc_useitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_useitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_useitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_useitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_useitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n);
+ retVal___ = postHookFunc(retVal___, sd, n);
}
}
return retVal___;
@@ -54449,14 +55557,14 @@ int HP_pc_useitem(struct map_session_data *sd, int n) {
int HP_pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_skillatk_bonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_pc_skillatk_bonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillatk_bonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillatk_bonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_skillatk_bonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54464,11 +55572,11 @@ int HP_pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.pc.skillatk_bonus(sd, skill_id);
}
- if( HPMHooks.count.HP_pc_skillatk_bonus_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillatk_bonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_skillatk_bonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillatk_bonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_skillatk_bonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
@@ -54476,14 +55584,14 @@ int HP_pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) {
int HP_pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_skillheal_bonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_pc_skillheal_bonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal_bonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal_bonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_skillheal_bonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54491,11 +55599,11 @@ int HP_pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.pc.skillheal_bonus(sd, skill_id);
}
- if( HPMHooks.count.HP_pc_skillheal_bonus_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal_bonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_skillheal_bonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal_bonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_skillheal_bonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
@@ -54503,14 +55611,14 @@ int HP_pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) {
int HP_pc_skillheal2_bonus(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_skillheal2_bonus_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_pc_skillheal2_bonus_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal2_bonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal2_bonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_skillheal2_bonus_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54518,25 +55626,25 @@ int HP_pc_skillheal2_bonus(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.pc.skillheal2_bonus(sd, skill_id);
}
- if( HPMHooks.count.HP_pc_skillheal2_bonus_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal2_bonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_skillheal2_bonus_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_skillheal2_bonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_skillheal2_bonus_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
}
void HP_pc_damage(struct map_session_data *sd, struct block_list *src, unsigned int hp, unsigned int sp) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_damage_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct block_list *src, unsigned int *hp, unsigned int *sp);
+ if (HPMHooks.count.HP_pc_damage_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct block_list **src, unsigned int *hp, unsigned int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_damage_pre[hIndex].func;
- preHookFunc(sd, src, &hp, &sp);
+ preHookFunc(&sd, &src, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54544,11 +55652,11 @@ void HP_pc_damage(struct map_session_data *sd, struct block_list *src, unsigned
{
HPMHooks.source.pc.damage(sd, src, hp, sp);
}
- if( HPMHooks.count.HP_pc_damage_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct block_list *src, unsigned int *hp, unsigned int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_damage_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct block_list *src, unsigned int hp, unsigned int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_damage_post[hIndex].func;
- postHookFunc(sd, src, &hp, &sp);
+ postHookFunc(sd, src, hp, sp);
}
}
return;
@@ -54556,14 +55664,14 @@ void HP_pc_damage(struct map_session_data *sd, struct block_list *src, unsigned
int HP_pc_dead(struct map_session_data *sd, struct block_list *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_dead_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct block_list *src);
+ if (HPMHooks.count.HP_pc_dead_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_dead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_dead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_dead_pre[hIndex].func;
- retVal___ = preHookFunc(sd, src);
+ retVal___ = preHookFunc(&sd, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54571,9 +55679,9 @@ int HP_pc_dead(struct map_session_data *sd, struct block_list *src) {
{
retVal___ = HPMHooks.source.pc.dead(sd, src);
}
- if( HPMHooks.count.HP_pc_dead_post ) {
+ if (HPMHooks.count.HP_pc_dead_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_dead_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_dead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_dead_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, src);
}
@@ -54582,14 +55690,14 @@ int HP_pc_dead(struct map_session_data *sd, struct block_list *src) {
}
void HP_pc_revive(struct map_session_data *sd, unsigned int hp, unsigned int sp) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_revive_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *hp, unsigned int *sp);
+ if (HPMHooks.count.HP_pc_revive_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *hp, unsigned int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_revive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_revive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_revive_pre[hIndex].func;
- preHookFunc(sd, &hp, &sp);
+ preHookFunc(&sd, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54597,25 +55705,25 @@ void HP_pc_revive(struct map_session_data *sd, unsigned int hp, unsigned int sp)
{
HPMHooks.source.pc.revive(sd, hp, sp);
}
- if( HPMHooks.count.HP_pc_revive_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *hp, unsigned int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_revive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_revive_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int hp, unsigned int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_revive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_revive_post[hIndex].func;
- postHookFunc(sd, &hp, &sp);
+ postHookFunc(sd, hp, sp);
}
}
return;
}
void HP_pc_heal(struct map_session_data *sd, unsigned int hp, unsigned int sp, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_heal_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *hp, unsigned int *sp, int *type);
+ if (HPMHooks.count.HP_pc_heal_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *hp, unsigned int *sp, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_heal_pre[hIndex].func;
- preHookFunc(sd, &hp, &sp, &type);
+ preHookFunc(&sd, &hp, &sp, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54623,11 +55731,11 @@ void HP_pc_heal(struct map_session_data *sd, unsigned int hp, unsigned int sp, i
{
HPMHooks.source.pc.heal(sd, hp, sp, type);
}
- if( HPMHooks.count.HP_pc_heal_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *hp, unsigned int *sp, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_heal_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int hp, unsigned int sp, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_heal_post[hIndex].func;
- postHookFunc(sd, &hp, &sp, &type);
+ postHookFunc(sd, hp, sp, type);
}
}
return;
@@ -54635,14 +55743,14 @@ void HP_pc_heal(struct map_session_data *sd, unsigned int hp, unsigned int sp, i
int HP_pc_itemheal(struct map_session_data *sd, int itemid, int hp, int sp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_itemheal_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *itemid, int *hp, int *sp);
+ if (HPMHooks.count.HP_pc_itemheal_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *itemid, int *hp, int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemheal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemheal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_itemheal_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &itemid, &hp, &sp);
+ retVal___ = preHookFunc(&sd, &itemid, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54650,11 +55758,11 @@ int HP_pc_itemheal(struct map_session_data *sd, int itemid, int hp, int sp) {
{
retVal___ = HPMHooks.source.pc.itemheal(sd, itemid, hp, sp);
}
- if( HPMHooks.count.HP_pc_itemheal_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *itemid, int *hp, int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemheal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_itemheal_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int itemid, int hp, int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemheal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_itemheal_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &itemid, &hp, &sp);
+ retVal___ = postHookFunc(retVal___, sd, itemid, hp, sp);
}
}
return retVal___;
@@ -54662,14 +55770,14 @@ int HP_pc_itemheal(struct map_session_data *sd, int itemid, int hp, int sp) {
int HP_pc_percentheal(struct map_session_data *sd, int hp, int sp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_percentheal_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *hp, int *sp);
+ if (HPMHooks.count.HP_pc_percentheal_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *hp, int *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_percentheal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_percentheal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_percentheal_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &hp, &sp);
+ retVal___ = preHookFunc(&sd, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54677,38 +55785,38 @@ int HP_pc_percentheal(struct map_session_data *sd, int hp, int sp) {
{
retVal___ = HPMHooks.source.pc.percentheal(sd, hp, sp);
}
- if( HPMHooks.count.HP_pc_percentheal_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *hp, int *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_percentheal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_percentheal_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int hp, int sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_percentheal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_percentheal_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &hp, &sp);
+ retVal___ = postHookFunc(retVal___, sd, hp, sp);
}
}
return retVal___;
}
-int HP_pc_jobchange(struct map_session_data *sd, int job, int upper) {
+int HP_pc_jobchange(struct map_session_data *sd, int class, int upper) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_jobchange_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *job, int *upper);
+ if (HPMHooks.count.HP_pc_jobchange_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *class, int *upper);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_jobchange_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &job, &upper);
+ retVal___ = preHookFunc(&sd, &class, &upper);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.jobchange(sd, job, upper);
+ retVal___ = HPMHooks.source.pc.jobchange(sd, class, upper);
}
- if( HPMHooks.count.HP_pc_jobchange_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *job, int *upper);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_jobchange_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int class, int upper);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_jobchange_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &job, &upper);
+ retVal___ = postHookFunc(retVal___, sd, class, upper);
}
}
return retVal___;
@@ -54716,14 +55824,14 @@ int HP_pc_jobchange(struct map_session_data *sd, int job, int upper) {
int HP_pc_setoption(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setoption_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_setoption_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setoption_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setoption_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setoption_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54731,11 +55839,11 @@ int HP_pc_setoption(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.setoption(sd, type);
}
- if( HPMHooks.count.HP_pc_setoption_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setoption_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setoption_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setoption_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setoption_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -54743,14 +55851,14 @@ int HP_pc_setoption(struct map_session_data *sd, int type) {
int HP_pc_setcart(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setcart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_setcart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setcart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setcart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setcart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54758,25 +55866,25 @@ int HP_pc_setcart(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.setcart(sd, type);
}
- if( HPMHooks.count.HP_pc_setcart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setcart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setcart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setcart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setcart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
}
void HP_pc_setfalcon(struct map_session_data *sd, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setfalcon_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *flag);
+ if (HPMHooks.count.HP_pc_setfalcon_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setfalcon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setfalcon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setfalcon_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54784,25 +55892,25 @@ void HP_pc_setfalcon(struct map_session_data *sd, bool flag) {
{
HPMHooks.source.pc.setfalcon(sd, flag);
}
- if( HPMHooks.count.HP_pc_setfalcon_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setfalcon_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setfalcon_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setfalcon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setfalcon_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_pc_setridingpeco(struct map_session_data *sd, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setridingpeco_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *flag);
+ if (HPMHooks.count.HP_pc_setridingpeco_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingpeco_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingpeco_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setridingpeco_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54810,25 +55918,25 @@ void HP_pc_setridingpeco(struct map_session_data *sd, bool flag) {
{
HPMHooks.source.pc.setridingpeco(sd, flag);
}
- if( HPMHooks.count.HP_pc_setridingpeco_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingpeco_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setridingpeco_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingpeco_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setridingpeco_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_pc_setmadogear(struct map_session_data *sd, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setmadogear_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *flag);
+ if (HPMHooks.count.HP_pc_setmadogear_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setmadogear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setmadogear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setmadogear_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54836,25 +55944,25 @@ void HP_pc_setmadogear(struct map_session_data *sd, bool flag) {
{
HPMHooks.source.pc.setmadogear(sd, flag);
}
- if( HPMHooks.count.HP_pc_setmadogear_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setmadogear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setmadogear_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setmadogear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setmadogear_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
}
void HP_pc_setridingdragon(struct map_session_data *sd, unsigned int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setridingdragon_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *type);
+ if (HPMHooks.count.HP_pc_setridingdragon_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingdragon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingdragon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setridingdragon_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54862,25 +55970,25 @@ void HP_pc_setridingdragon(struct map_session_data *sd, unsigned int type) {
{
HPMHooks.source.pc.setridingdragon(sd, type);
}
- if( HPMHooks.count.HP_pc_setridingdragon_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingdragon_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setridingdragon_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingdragon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setridingdragon_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
}
void HP_pc_setridingwug(struct map_session_data *sd, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setridingwug_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *flag);
+ if (HPMHooks.count.HP_pc_setridingwug_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingwug_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingwug_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setridingwug_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -54888,11 +55996,11 @@ void HP_pc_setridingwug(struct map_session_data *sd, bool flag) {
{
HPMHooks.source.pc.setridingwug(sd, flag);
}
- if( HPMHooks.count.HP_pc_setridingwug_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingwug_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setridingwug_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setridingwug_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setridingwug_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
@@ -54900,14 +56008,14 @@ void HP_pc_setridingwug(struct map_session_data *sd, bool flag) {
int HP_pc_changelook(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_changelook_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_pc_changelook_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_changelook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_changelook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_changelook_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &val);
+ retVal___ = preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54915,11 +56023,11 @@ int HP_pc_changelook(struct map_session_data *sd, int type, int val) {
{
retVal___ = HPMHooks.source.pc.changelook(sd, type, val);
}
- if( HPMHooks.count.HP_pc_changelook_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_changelook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_changelook_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_changelook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_changelook_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, val);
}
}
return retVal___;
@@ -54927,14 +56035,14 @@ int HP_pc_changelook(struct map_session_data *sd, int type, int val) {
int HP_pc_equiplookall(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_equiplookall_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_equiplookall_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equiplookall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equiplookall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_equiplookall_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54942,26 +56050,26 @@ int HP_pc_equiplookall(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.equiplookall(sd);
}
- if( HPMHooks.count.HP_pc_equiplookall_post ) {
+ if (HPMHooks.count.HP_pc_equiplookall_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_equiplookall_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_equiplookall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_equiplookall_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-int HP_pc_readparam(struct map_session_data *sd, int type) {
+int HP_pc_readparam(const struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_readparam_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_readparam_pre > 0) {
+ int (*preHookFunc) (const struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readparam_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readparam_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readparam_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54969,11 +56077,11 @@ int HP_pc_readparam(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.readparam(sd, type);
}
- if( HPMHooks.count.HP_pc_readparam_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readparam_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_readparam_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readparam_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readparam_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -54981,14 +56089,14 @@ int HP_pc_readparam(struct map_session_data *sd, int type) {
int HP_pc_setparam(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setparam_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_pc_setparam_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setparam_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setparam_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setparam_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &val);
+ retVal___ = preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -54996,11 +56104,11 @@ int HP_pc_setparam(struct map_session_data *sd, int type, int val) {
{
retVal___ = HPMHooks.source.pc.setparam(sd, type, val);
}
- if( HPMHooks.count.HP_pc_setparam_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setparam_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setparam_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setparam_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setparam_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, val);
}
}
return retVal___;
@@ -55008,14 +56116,14 @@ int HP_pc_setparam(struct map_session_data *sd, int type, int val) {
int HP_pc_readreg(struct map_session_data *sd, int64 reg) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_readreg_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int64 *reg);
+ if (HPMHooks.count.HP_pc_readreg_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int64 *reg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readreg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readreg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readreg_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &reg);
+ retVal___ = preHookFunc(&sd, &reg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55023,25 +56131,25 @@ int HP_pc_readreg(struct map_session_data *sd, int64 reg) {
{
retVal___ = HPMHooks.source.pc.readreg(sd, reg);
}
- if( HPMHooks.count.HP_pc_readreg_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 *reg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readreg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_readreg_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 reg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readreg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readreg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &reg);
+ retVal___ = postHookFunc(retVal___, sd, reg);
}
}
return retVal___;
}
void HP_pc_setreg(struct map_session_data *sd, int64 reg, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setreg_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int64 *reg, int *val);
+ if (HPMHooks.count.HP_pc_setreg_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int64 *reg, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setreg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setreg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setreg_pre[hIndex].func;
- preHookFunc(sd, &reg, &val);
+ preHookFunc(&sd, &reg, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55049,11 +56157,11 @@ void HP_pc_setreg(struct map_session_data *sd, int64 reg, int val) {
{
HPMHooks.source.pc.setreg(sd, reg, val);
}
- if( HPMHooks.count.HP_pc_setreg_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int64 *reg, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setreg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setreg_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int64 reg, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setreg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setreg_post[hIndex].func;
- postHookFunc(sd, &reg, &val);
+ postHookFunc(sd, reg, val);
}
}
return;
@@ -55061,14 +56169,14 @@ void HP_pc_setreg(struct map_session_data *sd, int64 reg, int val) {
char* HP_pc_readregstr(struct map_session_data *sd, int64 reg) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_readregstr_pre ) {
- char* (*preHookFunc) (struct map_session_data *sd, int64 *reg);
+ if (HPMHooks.count.HP_pc_readregstr_pre > 0) {
+ char* (*preHookFunc) (struct map_session_data **sd, int64 *reg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregstr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregstr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readregstr_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &reg);
+ retVal___ = preHookFunc(&sd, &reg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55076,25 +56184,25 @@ char* HP_pc_readregstr(struct map_session_data *sd, int64 reg) {
{
retVal___ = HPMHooks.source.pc.readregstr(sd, reg);
}
- if( HPMHooks.count.HP_pc_readregstr_post ) {
- char* (*postHookFunc) (char* retVal___, struct map_session_data *sd, int64 *reg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregstr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_readregstr_post > 0) {
+ char* (*postHookFunc) (char* retVal___, struct map_session_data *sd, int64 reg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregstr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readregstr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &reg);
+ retVal___ = postHookFunc(retVal___, sd, reg);
}
}
return retVal___;
}
void HP_pc_setregstr(struct map_session_data *sd, int64 reg, const char *str) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setregstr_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int64 *reg, const char *str);
+ if (HPMHooks.count.HP_pc_setregstr_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int64 *reg, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregstr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregstr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setregstr_pre[hIndex].func;
- preHookFunc(sd, &reg, str);
+ preHookFunc(&sd, &reg, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55102,11 +56210,11 @@ void HP_pc_setregstr(struct map_session_data *sd, int64 reg, const char *str) {
{
HPMHooks.source.pc.setregstr(sd, reg, str);
}
- if( HPMHooks.count.HP_pc_setregstr_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int64 *reg, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregstr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setregstr_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int64 reg, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregstr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setregstr_post[hIndex].func;
- postHookFunc(sd, &reg, str);
+ postHookFunc(sd, reg, str);
}
}
return;
@@ -55114,14 +56222,14 @@ void HP_pc_setregstr(struct map_session_data *sd, int64 reg, const char *str) {
int HP_pc_readregistry(struct map_session_data *sd, int64 reg) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_readregistry_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int64 *reg);
+ if (HPMHooks.count.HP_pc_readregistry_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int64 *reg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readregistry_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &reg);
+ retVal___ = preHookFunc(&sd, &reg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55129,11 +56237,11 @@ int HP_pc_readregistry(struct map_session_data *sd, int64 reg) {
{
retVal___ = HPMHooks.source.pc.readregistry(sd, reg);
}
- if( HPMHooks.count.HP_pc_readregistry_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 *reg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_readregistry_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 reg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readregistry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &reg);
+ retVal___ = postHookFunc(retVal___, sd, reg);
}
}
return retVal___;
@@ -55141,14 +56249,14 @@ int HP_pc_readregistry(struct map_session_data *sd, int64 reg) {
int HP_pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setregistry_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int64 *reg, int *val);
+ if (HPMHooks.count.HP_pc_setregistry_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int64 *reg, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setregistry_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &reg, &val);
+ retVal___ = preHookFunc(&sd, &reg, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55156,11 +56264,11 @@ int HP_pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
{
retVal___ = HPMHooks.source.pc.setregistry(sd, reg, val);
}
- if( HPMHooks.count.HP_pc_setregistry_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 *reg, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setregistry_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 reg, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setregistry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &reg, &val);
+ retVal___ = postHookFunc(retVal___, sd, reg, val);
}
}
return retVal___;
@@ -55168,14 +56276,14 @@ int HP_pc_setregistry(struct map_session_data *sd, int64 reg, int val) {
char* HP_pc_readregistry_str(struct map_session_data *sd, int64 reg) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_readregistry_str_pre ) {
- char* (*preHookFunc) (struct map_session_data *sd, int64 *reg);
+ if (HPMHooks.count.HP_pc_readregistry_str_pre > 0) {
+ char* (*preHookFunc) (struct map_session_data **sd, int64 *reg);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readregistry_str_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &reg);
+ retVal___ = preHookFunc(&sd, &reg);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55183,11 +56291,11 @@ char* HP_pc_readregistry_str(struct map_session_data *sd, int64 reg) {
{
retVal___ = HPMHooks.source.pc.readregistry_str(sd, reg);
}
- if( HPMHooks.count.HP_pc_readregistry_str_post ) {
- char* (*postHookFunc) (char* retVal___, struct map_session_data *sd, int64 *reg);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_readregistry_str_post > 0) {
+ char* (*postHookFunc) (char* retVal___, struct map_session_data *sd, int64 reg);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readregistry_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readregistry_str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &reg);
+ retVal___ = postHookFunc(retVal___, sd, reg);
}
}
return retVal___;
@@ -55195,14 +56303,14 @@ char* HP_pc_readregistry_str(struct map_session_data *sd, int64 reg) {
int HP_pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setregistry_str_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int64 *reg, const char *val);
+ if (HPMHooks.count.HP_pc_setregistry_str_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int64 *reg, const char **val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setregistry_str_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &reg, val);
+ retVal___ = preHookFunc(&sd, &reg, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55210,11 +56318,11 @@ int HP_pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *va
{
retVal___ = HPMHooks.source.pc.setregistry_str(sd, reg, val);
}
- if( HPMHooks.count.HP_pc_setregistry_str_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 *reg, const char *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setregistry_str_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int64 reg, const char *val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setregistry_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setregistry_str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &reg, val);
+ retVal___ = postHookFunc(retVal___, sd, reg, val);
}
}
return retVal___;
@@ -55222,14 +56330,14 @@ int HP_pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *va
int HP_pc_addeventtimer(struct map_session_data *sd, int tick, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_addeventtimer_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *tick, const char *name);
+ if (HPMHooks.count.HP_pc_addeventtimer_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *tick, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_addeventtimer_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &tick, name);
+ retVal___ = preHookFunc(&sd, &tick, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55237,11 +56345,11 @@ int HP_pc_addeventtimer(struct map_session_data *sd, int tick, const char *name)
{
retVal___ = HPMHooks.source.pc.addeventtimer(sd, tick, name);
}
- if( HPMHooks.count.HP_pc_addeventtimer_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *tick, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_addeventtimer_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int tick, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_addeventtimer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &tick, name);
+ retVal___ = postHookFunc(retVal___, sd, tick, name);
}
}
return retVal___;
@@ -55249,14 +56357,14 @@ int HP_pc_addeventtimer(struct map_session_data *sd, int tick, const char *name)
int HP_pc_deleventtimer(struct map_session_data *sd, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_deleventtimer_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *name);
+ if (HPMHooks.count.HP_pc_deleventtimer_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_deleventtimer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_deleventtimer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_deleventtimer_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name);
+ retVal___ = preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55264,9 +56372,9 @@ int HP_pc_deleventtimer(struct map_session_data *sd, const char *name) {
{
retVal___ = HPMHooks.source.pc.deleventtimer(sd, name);
}
- if( HPMHooks.count.HP_pc_deleventtimer_post ) {
+ if (HPMHooks.count.HP_pc_deleventtimer_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_deleventtimer_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_deleventtimer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_deleventtimer_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, name);
}
@@ -55276,14 +56384,14 @@ int HP_pc_deleventtimer(struct map_session_data *sd, const char *name) {
int HP_pc_cleareventtimer(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_cleareventtimer_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_cleareventtimer_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cleareventtimer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cleareventtimer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_cleareventtimer_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55291,9 +56399,9 @@ int HP_pc_cleareventtimer(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.cleareventtimer(sd);
}
- if( HPMHooks.count.HP_pc_cleareventtimer_post ) {
+ if (HPMHooks.count.HP_pc_cleareventtimer_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_cleareventtimer_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_cleareventtimer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_cleareventtimer_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55303,14 +56411,14 @@ int HP_pc_cleareventtimer(struct map_session_data *sd) {
int HP_pc_addeventtimercount(struct map_session_data *sd, const char *name, int tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_addeventtimercount_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, const char *name, int *tick);
+ if (HPMHooks.count.HP_pc_addeventtimercount_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name, int *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimercount_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimercount_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_addeventtimercount_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name, &tick);
+ retVal___ = preHookFunc(&sd, &name, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55318,11 +56426,11 @@ int HP_pc_addeventtimercount(struct map_session_data *sd, const char *name, int
{
retVal___ = HPMHooks.source.pc.addeventtimercount(sd, name, tick);
}
- if( HPMHooks.count.HP_pc_addeventtimercount_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name, int *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimercount_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_addeventtimercount_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name, int tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addeventtimercount_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_addeventtimercount_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, name, &tick);
+ retVal___ = postHookFunc(retVal___, sd, name, tick);
}
}
return retVal___;
@@ -55330,14 +56438,14 @@ int HP_pc_addeventtimercount(struct map_session_data *sd, const char *name, int
int HP_pc_calc_pvprank(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_calc_pvprank_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_calc_pvprank_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calc_pvprank_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55345,9 +56453,9 @@ int HP_pc_calc_pvprank(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.calc_pvprank(sd);
}
- if( HPMHooks.count.HP_pc_calc_pvprank_post ) {
+ if (HPMHooks.count.HP_pc_calc_pvprank_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calc_pvprank_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55357,14 +56465,14 @@ int HP_pc_calc_pvprank(struct map_session_data *sd) {
int HP_pc_calc_pvprank_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_calc_pvprank_timer_pre ) {
+ if (HPMHooks.count.HP_pc_calc_pvprank_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calc_pvprank_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55372,11 +56480,11 @@ int HP_pc_calc_pvprank_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.calc_pvprank_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_calc_pvprank_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_calc_pvprank_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_pvprank_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calc_pvprank_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -55384,14 +56492,14 @@ int HP_pc_calc_pvprank_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_ismarried(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_ismarried_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_ismarried_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_ismarried_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_ismarried_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_ismarried_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55399,9 +56507,9 @@ int HP_pc_ismarried(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.ismarried(sd);
}
- if( HPMHooks.count.HP_pc_ismarried_post ) {
+ if (HPMHooks.count.HP_pc_ismarried_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_ismarried_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_ismarried_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_ismarried_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55411,14 +56519,14 @@ int HP_pc_ismarried(struct map_session_data *sd) {
int HP_pc_marriage(struct map_session_data *sd, struct map_session_data *dstsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_marriage_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct map_session_data *dstsd);
+ if (HPMHooks.count.HP_pc_marriage_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct map_session_data **dstsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_marriage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_marriage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_marriage_pre[hIndex].func;
- retVal___ = preHookFunc(sd, dstsd);
+ retVal___ = preHookFunc(&sd, &dstsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55426,9 +56534,9 @@ int HP_pc_marriage(struct map_session_data *sd, struct map_session_data *dstsd)
{
retVal___ = HPMHooks.source.pc.marriage(sd, dstsd);
}
- if( HPMHooks.count.HP_pc_marriage_post ) {
+ if (HPMHooks.count.HP_pc_marriage_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct map_session_data *dstsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_marriage_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_marriage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_marriage_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, dstsd);
}
@@ -55438,14 +56546,14 @@ int HP_pc_marriage(struct map_session_data *sd, struct map_session_data *dstsd)
int HP_pc_divorce(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_divorce_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_divorce_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_divorce_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_divorce_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_divorce_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55453,9 +56561,9 @@ int HP_pc_divorce(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.divorce(sd);
}
- if( HPMHooks.count.HP_pc_divorce_post ) {
+ if (HPMHooks.count.HP_pc_divorce_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_divorce_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_divorce_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_divorce_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55465,14 +56573,14 @@ int HP_pc_divorce(struct map_session_data *sd) {
struct map_session_data* HP_pc_get_partner(struct map_session_data *sd) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_get_partner_pre ) {
- struct map_session_data* (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_get_partner_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_partner_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_partner_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_get_partner_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55480,9 +56588,9 @@ struct map_session_data* HP_pc_get_partner(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.get_partner(sd);
}
- if( HPMHooks.count.HP_pc_get_partner_post ) {
+ if (HPMHooks.count.HP_pc_get_partner_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_partner_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_partner_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_get_partner_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55492,14 +56600,14 @@ struct map_session_data* HP_pc_get_partner(struct map_session_data *sd) {
struct map_session_data* HP_pc_get_father(struct map_session_data *sd) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_get_father_pre ) {
- struct map_session_data* (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_get_father_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_father_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_father_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_get_father_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55507,9 +56615,9 @@ struct map_session_data* HP_pc_get_father(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.get_father(sd);
}
- if( HPMHooks.count.HP_pc_get_father_post ) {
+ if (HPMHooks.count.HP_pc_get_father_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_father_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_father_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_get_father_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55519,14 +56627,14 @@ struct map_session_data* HP_pc_get_father(struct map_session_data *sd) {
struct map_session_data* HP_pc_get_mother(struct map_session_data *sd) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_get_mother_pre ) {
- struct map_session_data* (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_get_mother_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_mother_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_mother_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_get_mother_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55534,9 +56642,9 @@ struct map_session_data* HP_pc_get_mother(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.get_mother(sd);
}
- if( HPMHooks.count.HP_pc_get_mother_post ) {
+ if (HPMHooks.count.HP_pc_get_mother_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_mother_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_mother_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_get_mother_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55546,14 +56654,14 @@ struct map_session_data* HP_pc_get_mother(struct map_session_data *sd) {
struct map_session_data* HP_pc_get_child(struct map_session_data *sd) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_get_child_pre ) {
- struct map_session_data* (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_get_child_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_child_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_child_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_get_child_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55561,9 +56669,9 @@ struct map_session_data* HP_pc_get_child(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.get_child(sd);
}
- if( HPMHooks.count.HP_pc_get_child_post ) {
+ if (HPMHooks.count.HP_pc_get_child_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_child_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_get_child_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_get_child_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -55572,14 +56680,14 @@ struct map_session_data* HP_pc_get_child(struct map_session_data *sd) {
}
void HP_pc_bleeding(struct map_session_data *sd, unsigned int diff_tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_bleeding_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *diff_tick);
+ if (HPMHooks.count.HP_pc_bleeding_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *diff_tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bleeding_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bleeding_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bleeding_pre[hIndex].func;
- preHookFunc(sd, &diff_tick);
+ preHookFunc(&sd, &diff_tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55587,25 +56695,25 @@ void HP_pc_bleeding(struct map_session_data *sd, unsigned int diff_tick) {
{
HPMHooks.source.pc.bleeding(sd, diff_tick);
}
- if( HPMHooks.count.HP_pc_bleeding_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *diff_tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bleeding_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bleeding_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int diff_tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bleeding_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bleeding_post[hIndex].func;
- postHookFunc(sd, &diff_tick);
+ postHookFunc(sd, diff_tick);
}
}
return;
}
void HP_pc_regen(struct map_session_data *sd, unsigned int diff_tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_regen_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *diff_tick);
+ if (HPMHooks.count.HP_pc_regen_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *diff_tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_regen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_regen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_regen_pre[hIndex].func;
- preHookFunc(sd, &diff_tick);
+ preHookFunc(&sd, &diff_tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55613,25 +56721,25 @@ void HP_pc_regen(struct map_session_data *sd, unsigned int diff_tick) {
{
HPMHooks.source.pc.regen(sd, diff_tick);
}
- if( HPMHooks.count.HP_pc_regen_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *diff_tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_regen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_regen_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int diff_tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_regen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_regen_post[hIndex].func;
- postHookFunc(sd, &diff_tick);
+ postHookFunc(sd, diff_tick);
}
}
return;
}
void HP_pc_setstand(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setstand_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_setstand_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstand_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstand_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setstand_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55639,9 +56747,9 @@ void HP_pc_setstand(struct map_session_data *sd) {
{
HPMHooks.source.pc.setstand(sd);
}
- if( HPMHooks.count.HP_pc_setstand_post ) {
+ if (HPMHooks.count.HP_pc_setstand_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstand_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstand_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setstand_post[hIndex].func;
postHookFunc(sd);
}
@@ -55651,14 +56759,14 @@ void HP_pc_setstand(struct map_session_data *sd) {
int HP_pc_candrop(struct map_session_data *sd, struct item *item) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_candrop_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct item *item);
+ if (HPMHooks.count.HP_pc_candrop_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item **item);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_candrop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_candrop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_candrop_pre[hIndex].func;
- retVal___ = preHookFunc(sd, item);
+ retVal___ = preHookFunc(&sd, &item);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55666,38 +56774,38 @@ int HP_pc_candrop(struct map_session_data *sd, struct item *item) {
{
retVal___ = HPMHooks.source.pc.candrop(sd, item);
}
- if( HPMHooks.count.HP_pc_candrop_post ) {
+ if (HPMHooks.count.HP_pc_candrop_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_candrop_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_candrop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_candrop_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, item);
}
}
return retVal___;
}
-int HP_pc_jobid2mapid(unsigned short b_class) {
+int HP_pc_jobid2mapid(int16 class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_jobid2mapid_pre ) {
- int (*preHookFunc) (unsigned short *b_class);
+ if (HPMHooks.count.HP_pc_jobid2mapid_pre > 0) {
+ int (*preHookFunc) (int16 *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobid2mapid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobid2mapid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_jobid2mapid_pre[hIndex].func;
- retVal___ = preHookFunc(&b_class);
+ retVal___ = preHookFunc(&class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.jobid2mapid(b_class);
+ retVal___ = HPMHooks.source.pc.jobid2mapid(class);
}
- if( HPMHooks.count.HP_pc_jobid2mapid_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *b_class);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobid2mapid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_jobid2mapid_post > 0) {
+ int (*postHookFunc) (int retVal___, int16 class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobid2mapid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_jobid2mapid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &b_class);
+ retVal___ = postHookFunc(retVal___, class);
}
}
return retVal___;
@@ -55705,14 +56813,14 @@ int HP_pc_jobid2mapid(unsigned short b_class) {
int HP_pc_mapid2jobid(unsigned short class_, int sex) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_mapid2jobid_pre ) {
+ if (HPMHooks.count.HP_pc_mapid2jobid_pre > 0) {
int (*preHookFunc) (unsigned short *class_, int *sex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_mapid2jobid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_mapid2jobid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_mapid2jobid_pre[hIndex].func;
retVal___ = preHookFunc(&class_, &sex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55720,52 +56828,52 @@ int HP_pc_mapid2jobid(unsigned short class_, int sex) {
{
retVal___ = HPMHooks.source.pc.mapid2jobid(class_, sex);
}
- if( HPMHooks.count.HP_pc_mapid2jobid_post ) {
- int (*postHookFunc) (int retVal___, unsigned short *class_, int *sex);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_mapid2jobid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_mapid2jobid_post > 0) {
+ int (*postHookFunc) (int retVal___, unsigned short class_, int sex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_mapid2jobid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_mapid2jobid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_, &sex);
+ retVal___ = postHookFunc(retVal___, class_, sex);
}
}
return retVal___;
}
-const char* HP_pc_job_name(int class_) {
+const char* HP_pc_job_name(int class) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_pc_job_name_pre ) {
- const char* (*preHookFunc) (int *class_);
+ if (HPMHooks.count.HP_pc_job_name_pre > 0) {
+ const char* (*preHookFunc) (int *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_job_name_pre[hIndex].func;
- retVal___ = preHookFunc(&class_);
+ retVal___ = preHookFunc(&class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.job_name(class_);
+ retVal___ = HPMHooks.source.pc.job_name(class);
}
- if( HPMHooks.count.HP_pc_job_name_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_job_name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_job_name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class);
}
}
return retVal___;
}
void HP_pc_setinvincibletimer(struct map_session_data *sd, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_setinvincibletimer_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *val);
+ if (HPMHooks.count.HP_pc_setinvincibletimer_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinvincibletimer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinvincibletimer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setinvincibletimer_pre[hIndex].func;
- preHookFunc(sd, &val);
+ preHookFunc(&sd, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55773,25 +56881,25 @@ void HP_pc_setinvincibletimer(struct map_session_data *sd, int val) {
{
HPMHooks.source.pc.setinvincibletimer(sd, val);
}
- if( HPMHooks.count.HP_pc_setinvincibletimer_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinvincibletimer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setinvincibletimer_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setinvincibletimer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setinvincibletimer_post[hIndex].func;
- postHookFunc(sd, &val);
+ postHookFunc(sd, val);
}
}
return;
}
void HP_pc_delinvincibletimer(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_delinvincibletimer_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_delinvincibletimer_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delinvincibletimer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delinvincibletimer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_delinvincibletimer_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -55799,9 +56907,9 @@ void HP_pc_delinvincibletimer(struct map_session_data *sd) {
{
HPMHooks.source.pc.delinvincibletimer(sd);
}
- if( HPMHooks.count.HP_pc_delinvincibletimer_post ) {
+ if (HPMHooks.count.HP_pc_delinvincibletimer_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delinvincibletimer_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delinvincibletimer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_delinvincibletimer_post[hIndex].func;
postHookFunc(sd);
}
@@ -55811,14 +56919,14 @@ void HP_pc_delinvincibletimer(struct map_session_data *sd) {
int HP_pc_addspiritball(struct map_session_data *sd, int interval, int max) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_addspiritball_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *interval, int *max);
+ if (HPMHooks.count.HP_pc_addspiritball_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *interval, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addspiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addspiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_addspiritball_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &interval, &max);
+ retVal___ = preHookFunc(&sd, &interval, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55826,11 +56934,11 @@ int HP_pc_addspiritball(struct map_session_data *sd, int interval, int max) {
{
retVal___ = HPMHooks.source.pc.addspiritball(sd, interval, max);
}
- if( HPMHooks.count.HP_pc_addspiritball_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *interval, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addspiritball_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_addspiritball_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int interval, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addspiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_addspiritball_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &interval, &max);
+ retVal___ = postHookFunc(retVal___, sd, interval, max);
}
}
return retVal___;
@@ -55838,14 +56946,14 @@ int HP_pc_addspiritball(struct map_session_data *sd, int interval, int max) {
int HP_pc_delspiritball(struct map_session_data *sd, int count, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_delspiritball_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *count, int *type);
+ if (HPMHooks.count.HP_pc_delspiritball_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *count, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delspiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delspiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_delspiritball_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &count, &type);
+ retVal___ = preHookFunc(&sd, &count, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55853,11 +56961,11 @@ int HP_pc_delspiritball(struct map_session_data *sd, int count, int type) {
{
retVal___ = HPMHooks.source.pc.delspiritball(sd, count, type);
}
- if( HPMHooks.count.HP_pc_delspiritball_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *count, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_delspiritball_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_delspiritball_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int count, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_delspiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_delspiritball_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &count, &type);
+ retVal___ = postHookFunc(retVal___, sd, count, type);
}
}
return retVal___;
@@ -55865,14 +56973,14 @@ int HP_pc_delspiritball(struct map_session_data *sd, int count, int type) {
int HP_pc_getmaxspiritball(struct map_session_data *sd, int min) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_getmaxspiritball_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *min);
+ if (HPMHooks.count.HP_pc_getmaxspiritball_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *min);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getmaxspiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getmaxspiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_getmaxspiritball_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &min);
+ retVal___ = preHookFunc(&sd, &min);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55880,64 +56988,91 @@ int HP_pc_getmaxspiritball(struct map_session_data *sd, int min) {
{
retVal___ = HPMHooks.source.pc.getmaxspiritball(sd, min);
}
- if( HPMHooks.count.HP_pc_getmaxspiritball_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *min);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getmaxspiritball_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_getmaxspiritball_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int min);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getmaxspiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_getmaxspiritball_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &min);
+ retVal___ = postHookFunc(retVal___, sd, min);
}
}
return retVal___;
}
-void HP_pc_addfame(struct map_session_data *sd, int count) {
+void HP_pc_addfame(struct map_session_data *sd, int ranktype, int count) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_addfame_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *count);
+ if (HPMHooks.count.HP_pc_addfame_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *ranktype, int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addfame_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addfame_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_addfame_pre[hIndex].func;
- preHookFunc(sd, &count);
+ preHookFunc(&sd, &ranktype, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
}
{
- HPMHooks.source.pc.addfame(sd, count);
+ HPMHooks.source.pc.addfame(sd, ranktype, count);
}
- if( HPMHooks.count.HP_pc_addfame_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_addfame_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_addfame_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int ranktype, int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_addfame_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_addfame_post[hIndex].func;
- postHookFunc(sd, &count);
+ postHookFunc(sd, ranktype, count);
}
}
return;
}
-unsigned char HP_pc_famerank(int char_id, int job) {
+int HP_pc_fame_rank(int char_id, int ranktype) {
int hIndex = 0;
- unsigned char retVal___ = 0;
- if( HPMHooks.count.HP_pc_famerank_pre ) {
- unsigned char (*preHookFunc) (int *char_id, int *job);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_fame_rank_pre > 0) {
+ int (*preHookFunc) (int *char_id, int *ranktype);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_fame_rank_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_fame_rank_pre[hIndex].func;
+ retVal___ = preHookFunc(&char_id, &ranktype);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.fame_rank(char_id, ranktype);
+ }
+ if (HPMHooks.count.HP_pc_fame_rank_post > 0) {
+ int (*postHookFunc) (int retVal___, int char_id, int ranktype);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_fame_rank_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_fame_rank_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, char_id, ranktype);
+ }
+ }
+ return retVal___;
+}
+int HP_pc_famelist_type(uint16 job_mapid) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_famelist_type_pre > 0) {
+ int (*preHookFunc) (uint16 *job_mapid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_famerank_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_pc_famerank_pre[hIndex].func;
- retVal___ = preHookFunc(&char_id, &job);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_famelist_type_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_famelist_type_pre[hIndex].func;
+ retVal___ = preHookFunc(&job_mapid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.famerank(char_id, job);
+ retVal___ = HPMHooks.source.pc.famelist_type(job_mapid);
}
- if( HPMHooks.count.HP_pc_famerank_post ) {
- unsigned char (*postHookFunc) (unsigned char retVal___, int *char_id, int *job);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_famerank_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_pc_famerank_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &char_id, &job);
+ if (HPMHooks.count.HP_pc_famelist_type_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 job_mapid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_famelist_type_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_famelist_type_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, job_mapid);
}
}
return retVal___;
@@ -55945,14 +57080,14 @@ unsigned char HP_pc_famerank(int char_id, int job) {
int HP_pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_set_hate_mob_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *pos, struct block_list *bl);
+ if (HPMHooks.count.HP_pc_set_hate_mob_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *pos, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_hate_mob_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_hate_mob_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_set_hate_mob_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &pos, bl);
+ retVal___ = preHookFunc(&sd, &pos, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55960,11 +57095,11 @@ int HP_pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *
{
retVal___ = HPMHooks.source.pc.set_hate_mob(sd, pos, bl);
}
- if( HPMHooks.count.HP_pc_set_hate_mob_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *pos, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_hate_mob_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_set_hate_mob_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int pos, struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_set_hate_mob_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_set_hate_mob_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &pos, bl);
+ retVal___ = postHookFunc(retVal___, sd, pos, bl);
}
}
return retVal___;
@@ -55972,14 +57107,14 @@ int HP_pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *
int HP_pc_readdb(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_readdb_pre ) {
+ if (HPMHooks.count.HP_pc_readdb_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readdb_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -55987,9 +57122,9 @@ int HP_pc_readdb(void) {
{
retVal___ = HPMHooks.source.pc.readdb();
}
- if( HPMHooks.count.HP_pc_readdb_post ) {
+ if (HPMHooks.count.HP_pc_readdb_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readdb_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -55999,14 +57134,14 @@ int HP_pc_readdb(void) {
int HP_pc_map_day_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_map_day_timer_pre ) {
+ if (HPMHooks.count.HP_pc_map_day_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_day_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_day_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_map_day_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56014,11 +57149,11 @@ int HP_pc_map_day_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.map_day_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_map_day_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_day_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_map_day_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_day_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_map_day_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56026,14 +57161,14 @@ int HP_pc_map_day_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_map_night_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_map_night_timer_pre ) {
+ if (HPMHooks.count.HP_pc_map_night_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_night_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_night_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_map_night_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56041,25 +57176,25 @@ int HP_pc_map_night_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.map_night_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_map_night_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_night_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_map_night_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_map_night_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_map_night_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_pc_inventory_rentals(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_inventory_rentals_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_inventory_rentals_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rentals_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rentals_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_inventory_rentals_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56067,9 +57202,9 @@ void HP_pc_inventory_rentals(struct map_session_data *sd) {
{
HPMHooks.source.pc.inventory_rentals(sd);
}
- if( HPMHooks.count.HP_pc_inventory_rentals_post ) {
+ if (HPMHooks.count.HP_pc_inventory_rentals_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rentals_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rentals_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_inventory_rentals_post[hIndex].func;
postHookFunc(sd);
}
@@ -56079,14 +57214,14 @@ void HP_pc_inventory_rentals(struct map_session_data *sd) {
int HP_pc_inventory_rental_clear(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_inventory_rental_clear_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_inventory_rental_clear_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_inventory_rental_clear_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56094,9 +57229,9 @@ int HP_pc_inventory_rental_clear(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.inventory_rental_clear(sd);
}
- if( HPMHooks.count.HP_pc_inventory_rental_clear_post ) {
+ if (HPMHooks.count.HP_pc_inventory_rental_clear_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_inventory_rental_clear_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -56105,14 +57240,14 @@ int HP_pc_inventory_rental_clear(struct map_session_data *sd) {
}
void HP_pc_inventory_rental_add(struct map_session_data *sd, int seconds) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_inventory_rental_add_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *seconds);
+ if (HPMHooks.count.HP_pc_inventory_rental_add_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *seconds);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_inventory_rental_add_pre[hIndex].func;
- preHookFunc(sd, &seconds);
+ preHookFunc(&sd, &seconds);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56120,38 +57255,38 @@ void HP_pc_inventory_rental_add(struct map_session_data *sd, int seconds) {
{
HPMHooks.source.pc.inventory_rental_add(sd, seconds);
}
- if( HPMHooks.count.HP_pc_inventory_rental_add_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *seconds);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_inventory_rental_add_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int seconds);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_inventory_rental_add_post[hIndex].func;
- postHookFunc(sd, &seconds);
+ postHookFunc(sd, seconds);
}
}
return;
}
-int HP_pc_disguise(struct map_session_data *sd, int class_) {
+int HP_pc_disguise(struct map_session_data *sd, int class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_disguise_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *class_);
+ if (HPMHooks.count.HP_pc_disguise_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_disguise_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_disguise_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_disguise_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &class_);
+ retVal___ = preHookFunc(&sd, &class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.disguise(sd, class_);
+ retVal___ = HPMHooks.source.pc.disguise(sd, class);
}
- if( HPMHooks.count.HP_pc_disguise_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_disguise_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_disguise_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_disguise_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_disguise_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &class_);
+ retVal___ = postHookFunc(retVal___, sd, class);
}
}
return retVal___;
@@ -56159,14 +57294,14 @@ int HP_pc_disguise(struct map_session_data *sd, int class_) {
bool HP_pc_isautolooting(struct map_session_data *sd, int nameid) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_isautolooting_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_pc_isautolooting_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isautolooting_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isautolooting_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_isautolooting_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56174,25 +57309,25 @@ bool HP_pc_isautolooting(struct map_session_data *sd, int nameid) {
{
retVal___ = HPMHooks.source.pc.isautolooting(sd, nameid);
}
- if( HPMHooks.count.HP_pc_isautolooting_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isautolooting_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_isautolooting_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isautolooting_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_isautolooting_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
}
void HP_pc_overheat(struct map_session_data *sd, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_overheat_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *val);
+ if (HPMHooks.count.HP_pc_overheat_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_overheat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_overheat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_overheat_pre[hIndex].func;
- preHookFunc(sd, &val);
+ preHookFunc(&sd, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56200,11 +57335,11 @@ void HP_pc_overheat(struct map_session_data *sd, int val) {
{
HPMHooks.source.pc.overheat(sd, val);
}
- if( HPMHooks.count.HP_pc_overheat_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_overheat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_overheat_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_overheat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_overheat_post[hIndex].func;
- postHookFunc(sd, &val);
+ postHookFunc(sd, val);
}
}
return;
@@ -56212,14 +57347,14 @@ void HP_pc_overheat(struct map_session_data *sd, int val) {
int HP_pc_banding(struct map_session_data *sd, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_banding_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_lv);
+ if (HPMHooks.count.HP_pc_banding_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_banding_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_banding_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_banding_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_lv);
+ retVal___ = preHookFunc(&sd, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56227,25 +57362,25 @@ int HP_pc_banding(struct map_session_data *sd, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.pc.banding(sd, skill_lv);
}
- if( HPMHooks.count.HP_pc_banding_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_banding_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_banding_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_banding_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_banding_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, skill_lv);
}
}
return retVal___;
}
void HP_pc_itemcd_do(struct map_session_data *sd, bool load) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_itemcd_do_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, bool *load);
+ if (HPMHooks.count.HP_pc_itemcd_do_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, bool *load);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemcd_do_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemcd_do_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_itemcd_do_pre[hIndex].func;
- preHookFunc(sd, &load);
+ preHookFunc(&sd, &load);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56253,11 +57388,11 @@ void HP_pc_itemcd_do(struct map_session_data *sd, bool load) {
{
HPMHooks.source.pc.itemcd_do(sd, load);
}
- if( HPMHooks.count.HP_pc_itemcd_do_post ) {
- void (*postHookFunc) (struct map_session_data *sd, bool *load);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemcd_do_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_itemcd_do_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, bool load);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_itemcd_do_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_itemcd_do_post[hIndex].func;
- postHookFunc(sd, &load);
+ postHookFunc(sd, load);
}
}
return;
@@ -56265,14 +57400,14 @@ void HP_pc_itemcd_do(struct map_session_data *sd, bool load) {
int HP_pc_load_combo(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_load_combo_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_load_combo_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_load_combo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_load_combo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_load_combo_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56280,9 +57415,9 @@ int HP_pc_load_combo(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.load_combo(sd);
}
- if( HPMHooks.count.HP_pc_load_combo_post ) {
+ if (HPMHooks.count.HP_pc_load_combo_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_load_combo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_load_combo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_load_combo_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -56291,14 +57426,14 @@ int HP_pc_load_combo(struct map_session_data *sd) {
}
void HP_pc_add_charm(struct map_session_data *sd, int interval, int max, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_add_charm_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *interval, int *max, int *type);
+ if (HPMHooks.count.HP_pc_add_charm_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *interval, int *max, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_add_charm_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_add_charm_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_add_charm_pre[hIndex].func;
- preHookFunc(sd, &interval, &max, &type);
+ preHookFunc(&sd, &interval, &max, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56306,25 +57441,25 @@ void HP_pc_add_charm(struct map_session_data *sd, int interval, int max, int typ
{
HPMHooks.source.pc.add_charm(sd, interval, max, type);
}
- if( HPMHooks.count.HP_pc_add_charm_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *interval, int *max, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_add_charm_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_add_charm_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int interval, int max, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_add_charm_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_add_charm_post[hIndex].func;
- postHookFunc(sd, &interval, &max, &type);
+ postHookFunc(sd, interval, max, type);
}
}
return;
}
void HP_pc_del_charm(struct map_session_data *sd, int count, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_del_charm_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *count, int *type);
+ if (HPMHooks.count.HP_pc_del_charm_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *count, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_del_charm_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_del_charm_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_del_charm_pre[hIndex].func;
- preHookFunc(sd, &count, &type);
+ preHookFunc(&sd, &count, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56332,25 +57467,25 @@ void HP_pc_del_charm(struct map_session_data *sd, int count, int type) {
{
HPMHooks.source.pc.del_charm(sd, count, type);
}
- if( HPMHooks.count.HP_pc_del_charm_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *count, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_del_charm_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_del_charm_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int count, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_del_charm_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_del_charm_post[hIndex].func;
- postHookFunc(sd, &count, &type);
+ postHookFunc(sd, count, type);
}
}
return;
}
void HP_pc_baselevelchanged(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_baselevelchanged_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_baselevelchanged_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_baselevelchanged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_baselevelchanged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_baselevelchanged_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56358,26 +57493,26 @@ void HP_pc_baselevelchanged(struct map_session_data *sd) {
{
HPMHooks.source.pc.baselevelchanged(sd);
}
- if( HPMHooks.count.HP_pc_baselevelchanged_post ) {
+ if (HPMHooks.count.HP_pc_baselevelchanged_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_baselevelchanged_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_baselevelchanged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_baselevelchanged_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-int HP_pc_level_penalty_mod(int diff, unsigned char race, unsigned short mode, int type) {
+int HP_pc_level_penalty_mod(int diff, unsigned char race, uint32 mode, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_level_penalty_mod_pre ) {
- int (*preHookFunc) (int *diff, unsigned char *race, unsigned short *mode, int *type);
+ if (HPMHooks.count.HP_pc_level_penalty_mod_pre > 0) {
+ int (*preHookFunc) (int *diff, unsigned char *race, uint32 *mode, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_level_penalty_mod_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_level_penalty_mod_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_level_penalty_mod_pre[hIndex].func;
retVal___ = preHookFunc(&diff, &race, &mode, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56385,11 +57520,11 @@ int HP_pc_level_penalty_mod(int diff, unsigned char race, unsigned short mode, i
{
retVal___ = HPMHooks.source.pc.level_penalty_mod(diff, race, mode, type);
}
- if( HPMHooks.count.HP_pc_level_penalty_mod_post ) {
- int (*postHookFunc) (int retVal___, int *diff, unsigned char *race, unsigned short *mode, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_level_penalty_mod_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_level_penalty_mod_post > 0) {
+ int (*postHookFunc) (int retVal___, int diff, unsigned char race, uint32 mode, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_level_penalty_mod_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_level_penalty_mod_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &diff, &race, &mode, &type);
+ retVal___ = postHookFunc(retVal___, diff, race, mode, type);
}
}
return retVal___;
@@ -56397,14 +57532,14 @@ int HP_pc_level_penalty_mod(int diff, unsigned char race, unsigned short mode, i
int HP_pc_calc_skillpoint(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_calc_skillpoint_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_calc_skillpoint_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skillpoint_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skillpoint_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calc_skillpoint_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56412,9 +57547,9 @@ int HP_pc_calc_skillpoint(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.calc_skillpoint(sd);
}
- if( HPMHooks.count.HP_pc_calc_skillpoint_post ) {
+ if (HPMHooks.count.HP_pc_calc_skillpoint_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skillpoint_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calc_skillpoint_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calc_skillpoint_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -56424,14 +57559,14 @@ int HP_pc_calc_skillpoint(struct map_session_data *sd) {
int HP_pc_invincible_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_invincible_timer_pre ) {
+ if (HPMHooks.count.HP_pc_invincible_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_invincible_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_invincible_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_invincible_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56439,11 +57574,11 @@ int HP_pc_invincible_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.invincible_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_invincible_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_invincible_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_invincible_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_invincible_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_invincible_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56451,14 +57586,14 @@ int HP_pc_invincible_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_spiritball_timer_pre ) {
+ if (HPMHooks.count.HP_pc_spiritball_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_spiritball_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_spiritball_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_spiritball_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56466,11 +57601,11 @@ int HP_pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.spiritball_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_spiritball_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_spiritball_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_spiritball_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_spiritball_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_spiritball_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56478,16 +57613,16 @@ int HP_pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_check_banding(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_check_banding_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_pc_check_banding_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_banding_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_banding_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pc_check_banding_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56497,9 +57632,9 @@ int HP_pc_check_banding(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.pc.check_banding(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pc_check_banding_post ) {
+ if (HPMHooks.count.HP_pc_check_banding_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_banding_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_banding_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pc_check_banding_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -56511,14 +57646,14 @@ int HP_pc_check_banding(struct block_list *bl, va_list ap) {
int HP_pc_inventory_rental_end(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_inventory_rental_end_pre ) {
+ if (HPMHooks.count.HP_pc_inventory_rental_end_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_inventory_rental_end_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56526,25 +57661,25 @@ int HP_pc_inventory_rental_end(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.inventory_rental_end(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_inventory_rental_end_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_inventory_rental_end_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_inventory_rental_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_inventory_rental_end_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_pc_check_skilltree(struct map_session_data *sd, int skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_check_skilltree_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *skill_id);
+ if (HPMHooks.count.HP_pc_check_skilltree_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_skilltree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_skilltree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_check_skilltree_pre[hIndex].func;
- preHookFunc(sd, &skill_id);
+ preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56552,11 +57687,11 @@ void HP_pc_check_skilltree(struct map_session_data *sd, int skill_id) {
{
HPMHooks.source.pc.check_skilltree(sd, skill_id);
}
- if( HPMHooks.count.HP_pc_check_skilltree_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_skilltree_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_check_skilltree_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_skilltree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_check_skilltree_post[hIndex].func;
- postHookFunc(sd, &skill_id);
+ postHookFunc(sd, skill_id);
}
}
return;
@@ -56564,14 +57699,14 @@ void HP_pc_check_skilltree(struct map_session_data *sd, int skill_id) {
int HP_pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus_autospell_pre ) {
- int (*preHookFunc) (struct s_autospell *spell, int *max, short *id, short *lv, short *rate, short *flag, short *card_id);
+ if (HPMHooks.count.HP_pc_bonus_autospell_pre > 0) {
+ int (*preHookFunc) (struct s_autospell **spell, int *max, short *id, short *lv, short *rate, short *flag, short *card_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus_autospell_pre[hIndex].func;
- retVal___ = preHookFunc(spell, &max, &id, &lv, &rate, &flag, &card_id);
+ retVal___ = preHookFunc(&spell, &max, &id, &lv, &rate, &flag, &card_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56579,11 +57714,11 @@ int HP_pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv
{
retVal___ = HPMHooks.source.pc.bonus_autospell(spell, max, id, lv, rate, flag, card_id);
}
- if( HPMHooks.count.HP_pc_bonus_autospell_post ) {
- int (*postHookFunc) (int retVal___, struct s_autospell *spell, int *max, short *id, short *lv, short *rate, short *flag, short *card_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus_autospell_post > 0) {
+ int (*postHookFunc) (int retVal___, struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus_autospell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, spell, &max, &id, &lv, &rate, &flag, &card_id);
+ retVal___ = postHookFunc(retVal___, spell, max, id, lv, rate, flag, card_id);
}
}
return retVal___;
@@ -56591,14 +57726,14 @@ int HP_pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv
int HP_pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_skill, short id, short lv, short rate, short card_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus_autospell_onskill_pre ) {
- int (*preHookFunc) (struct s_autospell *spell, int *max, short *src_skill, short *id, short *lv, short *rate, short *card_id);
+ if (HPMHooks.count.HP_pc_bonus_autospell_onskill_pre > 0) {
+ int (*preHookFunc) (struct s_autospell **spell, int *max, short *src_skill, short *id, short *lv, short *rate, short *card_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_onskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_onskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus_autospell_onskill_pre[hIndex].func;
- retVal___ = preHookFunc(spell, &max, &src_skill, &id, &lv, &rate, &card_id);
+ retVal___ = preHookFunc(&spell, &max, &src_skill, &id, &lv, &rate, &card_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56606,11 +57741,11 @@ int HP_pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_
{
retVal___ = HPMHooks.source.pc.bonus_autospell_onskill(spell, max, src_skill, id, lv, rate, card_id);
}
- if( HPMHooks.count.HP_pc_bonus_autospell_onskill_post ) {
- int (*postHookFunc) (int retVal___, struct s_autospell *spell, int *max, short *src_skill, short *id, short *lv, short *rate, short *card_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_onskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus_autospell_onskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct s_autospell *spell, int max, short src_skill, short id, short lv, short rate, short card_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_autospell_onskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus_autospell_onskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, spell, &max, &src_skill, &id, &lv, &rate, &card_id);
+ retVal___ = postHookFunc(retVal___, spell, max, src_skill, id, lv, rate, card_id);
}
}
return retVal___;
@@ -56618,14 +57753,14 @@ int HP_pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_
int HP_pc_bonus_addeff(struct s_addeffect *effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus_addeff_pre ) {
- int (*preHookFunc) (struct s_addeffect *effect, int *max, enum sc_type *id, int16 *rate, int16 *arrow_rate, uint8 *flag, uint16 *duration);
+ if (HPMHooks.count.HP_pc_bonus_addeff_pre > 0) {
+ int (*preHookFunc) (struct s_addeffect **effect, int *max, enum sc_type *id, int16 *rate, int16 *arrow_rate, uint8 *flag, uint16 *duration);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus_addeff_pre[hIndex].func;
- retVal___ = preHookFunc(effect, &max, &id, &rate, &arrow_rate, &flag, &duration);
+ retVal___ = preHookFunc(&effect, &max, &id, &rate, &arrow_rate, &flag, &duration);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56633,11 +57768,11 @@ int HP_pc_bonus_addeff(struct s_addeffect *effect, int max, enum sc_type id, int
{
retVal___ = HPMHooks.source.pc.bonus_addeff(effect, max, id, rate, arrow_rate, flag, duration);
}
- if( HPMHooks.count.HP_pc_bonus_addeff_post ) {
- int (*postHookFunc) (int retVal___, struct s_addeffect *effect, int *max, enum sc_type *id, int16 *rate, int16 *arrow_rate, uint8 *flag, uint16 *duration);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus_addeff_post > 0) {
+ int (*postHookFunc) (int retVal___, struct s_addeffect *effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus_addeff_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, effect, &max, &id, &rate, &arrow_rate, &flag, &duration);
+ retVal___ = postHookFunc(retVal___, effect, max, id, rate, arrow_rate, flag, duration);
}
}
return retVal___;
@@ -56645,14 +57780,14 @@ int HP_pc_bonus_addeff(struct s_addeffect *effect, int max, enum sc_type id, int
int HP_pc_bonus_addeff_onskill(struct s_addeffectonskill *effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus_addeff_onskill_pre ) {
- int (*preHookFunc) (struct s_addeffectonskill *effect, int *max, enum sc_type *id, short *rate, short *skill_id, unsigned char *target);
+ if (HPMHooks.count.HP_pc_bonus_addeff_onskill_pre > 0) {
+ int (*preHookFunc) (struct s_addeffectonskill **effect, int *max, enum sc_type *id, short *rate, short *skill_id, unsigned char *target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_onskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_onskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus_addeff_onskill_pre[hIndex].func;
- retVal___ = preHookFunc(effect, &max, &id, &rate, &skill_id, &target);
+ retVal___ = preHookFunc(&effect, &max, &id, &rate, &skill_id, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56660,11 +57795,11 @@ int HP_pc_bonus_addeff_onskill(struct s_addeffectonskill *effect, int max, enum
{
retVal___ = HPMHooks.source.pc.bonus_addeff_onskill(effect, max, id, rate, skill_id, target);
}
- if( HPMHooks.count.HP_pc_bonus_addeff_onskill_post ) {
- int (*postHookFunc) (int retVal___, struct s_addeffectonskill *effect, int *max, enum sc_type *id, short *rate, short *skill_id, unsigned char *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_onskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus_addeff_onskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct s_addeffectonskill *effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_addeff_onskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus_addeff_onskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, effect, &max, &id, &rate, &skill_id, &target);
+ retVal___ = postHookFunc(retVal___, effect, max, id, rate, skill_id, target);
}
}
return retVal___;
@@ -56672,14 +57807,14 @@ int HP_pc_bonus_addeff_onskill(struct s_addeffectonskill *effect, int max, enum
int HP_pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short group, int race, int rate) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_bonus_item_drop_pre ) {
- int (*preHookFunc) (struct s_add_drop *drop, const short *max, short *id, short *group, int *race, int *rate);
+ if (HPMHooks.count.HP_pc_bonus_item_drop_pre > 0) {
+ int (*preHookFunc) (struct s_add_drop **drop, const short *max, short *id, short *group, int *race, int *rate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_item_drop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_item_drop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bonus_item_drop_pre[hIndex].func;
- retVal___ = preHookFunc(drop, &max, &id, &group, &race, &rate);
+ retVal___ = preHookFunc(&drop, &max, &id, &group, &race, &rate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56687,25 +57822,25 @@ int HP_pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, sh
{
retVal___ = HPMHooks.source.pc.bonus_item_drop(drop, max, id, group, race, rate);
}
- if( HPMHooks.count.HP_pc_bonus_item_drop_post ) {
- int (*postHookFunc) (int retVal___, struct s_add_drop *drop, const short *max, short *id, short *group, int *race, int *rate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_item_drop_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bonus_item_drop_post > 0) {
+ int (*postHookFunc) (int retVal___, struct s_add_drop *drop, const short max, short id, short group, int race, int rate);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bonus_item_drop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bonus_item_drop_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, drop, &max, &id, &group, &race, &rate);
+ retVal___ = postHookFunc(retVal___, drop, max, id, group, race, rate);
}
}
return retVal___;
}
void HP_pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_calcexp_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src);
+ if (HPMHooks.count.HP_pc_calcexp_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int **base_exp, unsigned int **job_exp, struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calcexp_pre[hIndex].func;
- preHookFunc(sd, base_exp, job_exp, src);
+ preHookFunc(&sd, &base_exp, &job_exp, &src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -56713,9 +57848,9 @@ void HP_pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned
{
HPMHooks.source.pc.calcexp(sd, base_exp, job_exp, src);
}
- if( HPMHooks.count.HP_pc_calcexp_post ) {
+ if (HPMHooks.count.HP_pc_calcexp_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcexp_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calcexp_post[hIndex].func;
postHookFunc(sd, base_exp, job_exp, src);
}
@@ -56725,14 +57860,14 @@ void HP_pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned
int HP_pc_respawn_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_respawn_timer_pre ) {
+ if (HPMHooks.count.HP_pc_respawn_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_respawn_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56740,11 +57875,11 @@ int HP_pc_respawn_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.respawn_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_respawn_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_respawn_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_respawn_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_respawn_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56752,16 +57887,16 @@ int HP_pc_respawn_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_jobchange_killclone(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_jobchange_killclone_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_pc_jobchange_killclone_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_killclone_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_killclone_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pc_jobchange_killclone_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56771,9 +57906,9 @@ int HP_pc_jobchange_killclone(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.pc.jobchange_killclone(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pc_jobchange_killclone_post ) {
+ if (HPMHooks.count.HP_pc_jobchange_killclone_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_killclone_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_jobchange_killclone_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pc_jobchange_killclone_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -56785,14 +57920,14 @@ int HP_pc_jobchange_killclone(struct block_list *bl, va_list ap) {
int HP_pc_getstat(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_getstat_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pc_getstat_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getstat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getstat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_getstat_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56800,11 +57935,11 @@ int HP_pc_getstat(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pc.getstat(sd, type);
}
- if( HPMHooks.count.HP_pc_getstat_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_getstat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_getstat_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_getstat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_getstat_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -56812,14 +57947,14 @@ int HP_pc_getstat(struct map_session_data *sd, int type) {
int HP_pc_setstat(struct map_session_data *sd, int type, int val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_setstat_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type, int *val);
+ if (HPMHooks.count.HP_pc_setstat_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstat_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstat_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_setstat_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type, &val);
+ retVal___ = preHookFunc(&sd, &type, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56827,11 +57962,11 @@ int HP_pc_setstat(struct map_session_data *sd, int type, int val) {
{
retVal___ = HPMHooks.source.pc.setstat(sd, type, val);
}
- if( HPMHooks.count.HP_pc_setstat_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstat_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_setstat_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_setstat_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_setstat_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type, &val);
+ retVal___ = postHookFunc(retVal___, sd, type, val);
}
}
return retVal___;
@@ -56839,14 +57974,14 @@ int HP_pc_setstat(struct map_session_data *sd, int type, int val) {
int HP_pc_eventtimer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_eventtimer_pre ) {
+ if (HPMHooks.count.HP_pc_eventtimer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_eventtimer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_eventtimer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_eventtimer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56854,11 +57989,11 @@ int HP_pc_eventtimer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.eventtimer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_eventtimer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_eventtimer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_eventtimer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_eventtimer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_eventtimer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56866,16 +58001,16 @@ int HP_pc_eventtimer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_daynight_timer_sub(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_daynight_timer_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_pc_daynight_timer_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_daynight_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_daynight_timer_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pc_daynight_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56885,9 +58020,9 @@ int HP_pc_daynight_timer_sub(struct map_session_data *sd, va_list ap) {
retVal___ = HPMHooks.source.pc.daynight_timer_sub(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pc_daynight_timer_sub_post ) {
+ if (HPMHooks.count.HP_pc_daynight_timer_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_daynight_timer_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_daynight_timer_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pc_daynight_timer_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -56899,14 +58034,14 @@ int HP_pc_daynight_timer_sub(struct map_session_data *sd, va_list ap) {
int HP_pc_charm_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_charm_timer_pre ) {
+ if (HPMHooks.count.HP_pc_charm_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_charm_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_charm_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_charm_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56914,11 +58049,11 @@ int HP_pc_charm_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.charm_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_charm_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_charm_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_charm_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_charm_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_charm_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56926,14 +58061,14 @@ int HP_pc_charm_timer(int tid, int64 tick, int id, intptr_t data) {
bool HP_pc_readdb_levelpenalty(char *fields[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_readdb_levelpenalty_pre ) {
- bool (*preHookFunc) (char *fields[], int *columns, int *current);
+ if (HPMHooks.count.HP_pc_readdb_levelpenalty_pre > 0) {
+ bool (*preHookFunc) (char **fields[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_levelpenalty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_levelpenalty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_readdb_levelpenalty_pre[hIndex].func;
- retVal___ = preHookFunc(fields, &columns, &current);
+ retVal___ = preHookFunc(&fields, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56941,11 +58076,11 @@ bool HP_pc_readdb_levelpenalty(char *fields[], int columns, int current) {
{
retVal___ = HPMHooks.source.pc.readdb_levelpenalty(fields, columns, current);
}
- if( HPMHooks.count.HP_pc_readdb_levelpenalty_post ) {
- bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_levelpenalty_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_readdb_levelpenalty_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *fields[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_readdb_levelpenalty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_readdb_levelpenalty_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fields, &columns, &current);
+ retVal___ = postHookFunc(retVal___, fields, columns, current);
}
}
return retVal___;
@@ -56953,14 +58088,14 @@ bool HP_pc_readdb_levelpenalty(char *fields[], int columns, int current) {
int HP_pc_autosave(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_autosave_pre ) {
+ if (HPMHooks.count.HP_pc_autosave_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autosave_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autosave_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_autosave_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56968,11 +58103,11 @@ int HP_pc_autosave(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.autosave(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_autosave_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autosave_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_autosave_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autosave_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_autosave_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -56980,14 +58115,14 @@ int HP_pc_autosave(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_follow_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_follow_timer_pre ) {
+ if (HPMHooks.count.HP_pc_follow_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_follow_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -56995,25 +58130,25 @@ int HP_pc_follow_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.follow_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_follow_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_follow_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_follow_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_follow_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_pc_read_skill_tree(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_read_skill_tree_pre ) {
+ if (HPMHooks.count.HP_pc_read_skill_tree_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_skill_tree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_skill_tree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_read_skill_tree_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57021,9 +58156,9 @@ void HP_pc_read_skill_tree(void) {
{
HPMHooks.source.pc.read_skill_tree();
}
- if( HPMHooks.count.HP_pc_read_skill_tree_post ) {
+ if (HPMHooks.count.HP_pc_read_skill_tree_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_skill_tree_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_skill_tree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_read_skill_tree_post[hIndex].func;
postHookFunc();
}
@@ -57032,14 +58167,14 @@ void HP_pc_read_skill_tree(void) {
}
void HP_pc_clear_skill_tree(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_clear_skill_tree_pre ) {
+ if (HPMHooks.count.HP_pc_clear_skill_tree_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_clear_skill_tree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_clear_skill_tree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_clear_skill_tree_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57047,9 +58182,9 @@ void HP_pc_clear_skill_tree(void) {
{
HPMHooks.source.pc.clear_skill_tree();
}
- if( HPMHooks.count.HP_pc_clear_skill_tree_post ) {
+ if (HPMHooks.count.HP_pc_clear_skill_tree_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_clear_skill_tree_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_clear_skill_tree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_clear_skill_tree_post[hIndex].func;
postHookFunc();
}
@@ -57059,14 +58194,14 @@ void HP_pc_clear_skill_tree(void) {
int HP_pc_isUseitem(struct map_session_data *sd, int n) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_isUseitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n);
+ if (HPMHooks.count.HP_pc_isUseitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isUseitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isUseitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_isUseitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n);
+ retVal___ = preHookFunc(&sd, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57074,11 +58209,11 @@ int HP_pc_isUseitem(struct map_session_data *sd, int n) {
{
retVal___ = HPMHooks.source.pc.isUseitem(sd, n);
}
- if( HPMHooks.count.HP_pc_isUseitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_isUseitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_isUseitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_isUseitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_isUseitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n);
+ retVal___ = postHookFunc(retVal___, sd, n);
}
}
return retVal___;
@@ -57086,16 +58221,16 @@ int HP_pc_isUseitem(struct map_session_data *sd, int n) {
int HP_pc_show_steal(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_show_steal_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_pc_show_steal_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_show_steal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_show_steal_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pc_show_steal_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57105,9 +58240,9 @@ int HP_pc_show_steal(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.pc.show_steal(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pc_show_steal_post ) {
+ if (HPMHooks.count.HP_pc_show_steal_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_show_steal_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_show_steal_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pc_show_steal_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -57119,14 +58254,14 @@ int HP_pc_show_steal(struct block_list *bl, va_list ap) {
int HP_pc_checkcombo(struct map_session_data *sd, struct item_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_checkcombo_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct item_data *data);
+ if (HPMHooks.count.HP_pc_checkcombo_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkcombo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkcombo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_checkcombo_pre[hIndex].func;
- retVal___ = preHookFunc(sd, data);
+ retVal___ = preHookFunc(&sd, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57134,9 +58269,9 @@ int HP_pc_checkcombo(struct map_session_data *sd, struct item_data *data) {
{
retVal___ = HPMHooks.source.pc.checkcombo(sd, data);
}
- if( HPMHooks.count.HP_pc_checkcombo_post ) {
+ if (HPMHooks.count.HP_pc_checkcombo_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkcombo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_checkcombo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_checkcombo_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, data);
}
@@ -57146,14 +58281,14 @@ int HP_pc_checkcombo(struct map_session_data *sd, struct item_data *data) {
int HP_pc_calcweapontype(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_calcweapontype_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_calcweapontype_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcweapontype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcweapontype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_calcweapontype_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57161,9 +58296,9 @@ int HP_pc_calcweapontype(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.calcweapontype(sd);
}
- if( HPMHooks.count.HP_pc_calcweapontype_post ) {
+ if (HPMHooks.count.HP_pc_calcweapontype_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcweapontype_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_calcweapontype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_calcweapontype_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -57173,14 +58308,14 @@ int HP_pc_calcweapontype(struct map_session_data *sd) {
int HP_pc_removecombo(struct map_session_data *sd, struct item_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_removecombo_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct item_data *data);
+ if (HPMHooks.count.HP_pc_removecombo_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_removecombo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_removecombo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_removecombo_pre[hIndex].func;
- retVal___ = preHookFunc(sd, data);
+ retVal___ = preHookFunc(&sd, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57188,9 +58323,9 @@ int HP_pc_removecombo(struct map_session_data *sd, struct item_data *data) {
{
retVal___ = HPMHooks.source.pc.removecombo(sd, data);
}
- if( HPMHooks.count.HP_pc_removecombo_post ) {
+ if (HPMHooks.count.HP_pc_removecombo_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_removecombo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_removecombo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_removecombo_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, data);
}
@@ -57199,14 +58334,14 @@ int HP_pc_removecombo(struct map_session_data *sd, struct item_data *data) {
}
void HP_pc_bank_deposit(struct map_session_data *sd, int money) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_bank_deposit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *money);
+ if (HPMHooks.count.HP_pc_bank_deposit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *money);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_deposit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_deposit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bank_deposit_pre[hIndex].func;
- preHookFunc(sd, &money);
+ preHookFunc(&sd, &money);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57214,25 +58349,25 @@ void HP_pc_bank_deposit(struct map_session_data *sd, int money) {
{
HPMHooks.source.pc.bank_deposit(sd, money);
}
- if( HPMHooks.count.HP_pc_bank_deposit_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *money);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_deposit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bank_deposit_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int money);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_deposit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bank_deposit_post[hIndex].func;
- postHookFunc(sd, &money);
+ postHookFunc(sd, money);
}
}
return;
}
void HP_pc_bank_withdraw(struct map_session_data *sd, int money) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_bank_withdraw_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *money);
+ if (HPMHooks.count.HP_pc_bank_withdraw_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *money);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_withdraw_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_withdraw_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bank_withdraw_pre[hIndex].func;
- preHookFunc(sd, &money);
+ preHookFunc(&sd, &money);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57240,25 +58375,25 @@ void HP_pc_bank_withdraw(struct map_session_data *sd, int money) {
{
HPMHooks.source.pc.bank_withdraw(sd, money);
}
- if( HPMHooks.count.HP_pc_bank_withdraw_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *money);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_withdraw_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bank_withdraw_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int money);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bank_withdraw_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bank_withdraw_post[hIndex].func;
- postHookFunc(sd, &money);
+ postHookFunc(sd, money);
}
}
return;
}
void HP_pc_rental_expire(struct map_session_data *sd, int i) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_rental_expire_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *i);
+ if (HPMHooks.count.HP_pc_rental_expire_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *i);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_rental_expire_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_rental_expire_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_rental_expire_pre[hIndex].func;
- preHookFunc(sd, &i);
+ preHookFunc(&sd, &i);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57266,25 +58401,25 @@ void HP_pc_rental_expire(struct map_session_data *sd, int i) {
{
HPMHooks.source.pc.rental_expire(sd, i);
}
- if( HPMHooks.count.HP_pc_rental_expire_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *i);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_rental_expire_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_rental_expire_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int i);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_rental_expire_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_rental_expire_post[hIndex].func;
- postHookFunc(sd, &i);
+ postHookFunc(sd, i);
}
}
return;
}
void HP_pc_scdata_received(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_scdata_received_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_scdata_received_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_scdata_received_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_scdata_received_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_scdata_received_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57292,9 +58427,9 @@ void HP_pc_scdata_received(struct map_session_data *sd) {
{
HPMHooks.source.pc.scdata_received(sd);
}
- if( HPMHooks.count.HP_pc_scdata_received_post ) {
+ if (HPMHooks.count.HP_pc_scdata_received_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_scdata_received_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_scdata_received_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_scdata_received_post[hIndex].func;
postHookFunc(sd);
}
@@ -57303,14 +58438,14 @@ void HP_pc_scdata_received(struct map_session_data *sd) {
}
void HP_pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_bound_clear_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum e_item_bound_type *type);
+ if (HPMHooks.count.HP_pc_bound_clear_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum e_item_bound_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bound_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bound_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_bound_clear_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57318,11 +58453,11 @@ void HP_pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type)
{
HPMHooks.source.pc.bound_clear(sd, type);
}
- if( HPMHooks.count.HP_pc_bound_clear_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum e_item_bound_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_bound_clear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_bound_clear_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum e_item_bound_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_bound_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_bound_clear_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
@@ -57330,14 +58465,14 @@ void HP_pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type)
int HP_pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_expiration_timer_pre ) {
+ if (HPMHooks.count.HP_pc_expiration_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_expiration_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_expiration_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_expiration_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57345,11 +58480,11 @@ int HP_pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.expiration_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_expiration_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_expiration_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_expiration_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_expiration_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_expiration_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -57357,14 +58492,14 @@ int HP_pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_global_expiration_timer_pre ) {
+ if (HPMHooks.count.HP_pc_global_expiration_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_global_expiration_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_global_expiration_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_global_expiration_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57372,25 +58507,25 @@ int HP_pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pc.global_expiration_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pc_global_expiration_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_global_expiration_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_global_expiration_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_global_expiration_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_global_expiration_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_pc_expire_check(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_expire_check_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_expire_check_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_expire_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_expire_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_expire_check_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57398,52 +58533,52 @@ void HP_pc_expire_check(struct map_session_data *sd) {
{
HPMHooks.source.pc.expire_check(sd);
}
- if( HPMHooks.count.HP_pc_expire_check_post ) {
+ if (HPMHooks.count.HP_pc_expire_check_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_expire_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_expire_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_expire_check_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-bool HP_pc_db_checkid(unsigned int class_) {
+bool HP_pc_db_checkid(int class) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pc_db_checkid_pre ) {
- bool (*preHookFunc) (unsigned int *class_);
+ if (HPMHooks.count.HP_pc_db_checkid_pre > 0) {
+ bool (*preHookFunc) (int *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_db_checkid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_db_checkid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_db_checkid_pre[hIndex].func;
- retVal___ = preHookFunc(&class_);
+ retVal___ = preHookFunc(&class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.pc.db_checkid(class_);
+ retVal___ = HPMHooks.source.pc.db_checkid(class);
}
- if( HPMHooks.count.HP_pc_db_checkid_post ) {
- bool (*postHookFunc) (bool retVal___, unsigned int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_db_checkid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_db_checkid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_db_checkid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_db_checkid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &class_);
+ retVal___ = postHookFunc(retVal___, class);
}
}
return retVal___;
}
void HP_pc_validate_levels(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_validate_levels_pre ) {
+ if (HPMHooks.count.HP_pc_validate_levels_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_validate_levels_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_validate_levels_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_validate_levels_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57451,9 +58586,9 @@ void HP_pc_validate_levels(void) {
{
HPMHooks.source.pc.validate_levels();
}
- if( HPMHooks.count.HP_pc_validate_levels_post ) {
+ if (HPMHooks.count.HP_pc_validate_levels_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_validate_levels_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_validate_levels_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_validate_levels_post[hIndex].func;
postHookFunc();
}
@@ -57462,14 +58597,14 @@ void HP_pc_validate_levels(void) {
}
void HP_pc_autotrade_load(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_autotrade_load_pre ) {
+ if (HPMHooks.count.HP_pc_autotrade_load_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_autotrade_load_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57477,9 +58612,9 @@ void HP_pc_autotrade_load(void) {
{
HPMHooks.source.pc.autotrade_load();
}
- if( HPMHooks.count.HP_pc_autotrade_load_post ) {
+ if (HPMHooks.count.HP_pc_autotrade_load_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_load_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_autotrade_load_post[hIndex].func;
postHookFunc();
}
@@ -57488,14 +58623,14 @@ void HP_pc_autotrade_load(void) {
}
void HP_pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update_action action) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_autotrade_update_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum e_pc_autotrade_update_action *action);
+ if (HPMHooks.count.HP_pc_autotrade_update_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum e_pc_autotrade_update_action *action);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_autotrade_update_pre[hIndex].func;
- preHookFunc(sd, &action);
+ preHookFunc(&sd, &action);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57503,25 +58638,25 @@ void HP_pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_upd
{
HPMHooks.source.pc.autotrade_update(sd, action);
}
- if( HPMHooks.count.HP_pc_autotrade_update_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum e_pc_autotrade_update_action *action);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_autotrade_update_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum e_pc_autotrade_update_action action);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_autotrade_update_post[hIndex].func;
- postHookFunc(sd, &action);
+ postHookFunc(sd, action);
}
}
return;
}
void HP_pc_autotrade_start(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_autotrade_start_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_autotrade_start_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_autotrade_start_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57529,9 +58664,9 @@ void HP_pc_autotrade_start(struct map_session_data *sd) {
{
HPMHooks.source.pc.autotrade_start(sd);
}
- if( HPMHooks.count.HP_pc_autotrade_start_post ) {
+ if (HPMHooks.count.HP_pc_autotrade_start_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_start_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_autotrade_start_post[hIndex].func;
postHookFunc(sd);
}
@@ -57540,14 +58675,14 @@ void HP_pc_autotrade_start(struct map_session_data *sd) {
}
void HP_pc_autotrade_prepare(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_autotrade_prepare_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_autotrade_prepare_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_prepare_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_prepare_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_autotrade_prepare_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57555,9 +58690,9 @@ void HP_pc_autotrade_prepare(struct map_session_data *sd) {
{
HPMHooks.source.pc.autotrade_prepare(sd);
}
- if( HPMHooks.count.HP_pc_autotrade_prepare_post ) {
+ if (HPMHooks.count.HP_pc_autotrade_prepare_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_prepare_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_prepare_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_autotrade_prepare_post[hIndex].func;
postHookFunc(sd);
}
@@ -57566,14 +58701,14 @@ void HP_pc_autotrade_prepare(struct map_session_data *sd) {
}
void HP_pc_autotrade_populate(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_autotrade_populate_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_autotrade_populate_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_populate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_populate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_autotrade_populate_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57581,28 +58716,28 @@ void HP_pc_autotrade_populate(struct map_session_data *sd) {
{
HPMHooks.source.pc.autotrade_populate(sd);
}
- if( HPMHooks.count.HP_pc_autotrade_populate_post ) {
+ if (HPMHooks.count.HP_pc_autotrade_populate_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_populate_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_populate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_autotrade_populate_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-int HP_pc_autotrade_final(DBKey key, DBData *data, va_list ap) {
+int HP_pc_autotrade_final(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_autotrade_final_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_pc_autotrade_final_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pc_autotrade_final_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57612,12 +58747,12 @@ int HP_pc_autotrade_final(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.pc.autotrade_final(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pc_autotrade_final_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_autotrade_final_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_autotrade_final_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pc_autotrade_final_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -57626,14 +58761,14 @@ int HP_pc_autotrade_final(DBKey key, DBData *data, va_list ap) {
int HP_pc_check_job_name(const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_check_job_name_pre ) {
- int (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_pc_check_job_name_pre > 0) {
+ int (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_job_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_job_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_check_job_name_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57641,9 +58776,9 @@ int HP_pc_check_job_name(const char *name) {
{
retVal___ = HPMHooks.source.pc.check_job_name(name);
}
- if( HPMHooks.count.HP_pc_check_job_name_post ) {
+ if (HPMHooks.count.HP_pc_check_job_name_post > 0) {
int (*postHookFunc) (int retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_job_name_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_job_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_check_job_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -57652,14 +58787,14 @@ int HP_pc_check_job_name(const char *name) {
}
void HP_pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_idletime type) {
int hIndex = 0;
- if( HPMHooks.count.HP_pc_update_idle_time_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum e_battle_config_idletime *type);
+ if (HPMHooks.count.HP_pc_update_idle_time_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum e_battle_config_idletime *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_idle_time_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_idle_time_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_update_idle_time_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57667,11 +58802,11 @@ void HP_pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_id
{
HPMHooks.source.pc.update_idle_time(sd, type);
}
- if( HPMHooks.count.HP_pc_update_idle_time_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum e_battle_config_idletime *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_idle_time_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pc_update_idle_time_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum e_battle_config_idletime type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_idle_time_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_update_idle_time_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
@@ -57679,14 +58814,14 @@ void HP_pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_id
int HP_pc_have_magnifier(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pc_have_magnifier_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_pc_have_magnifier_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_magnifier_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_magnifier_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_have_magnifier_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57694,27 +58829,107 @@ int HP_pc_have_magnifier(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pc.have_magnifier(sd);
}
- if( HPMHooks.count.HP_pc_have_magnifier_post ) {
+ if (HPMHooks.count.HP_pc_have_magnifier_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_magnifier_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_magnifier_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_have_magnifier_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
}
return retVal___;
}
-/* libpcre */
+bool HP_pc_process_chat_message(struct map_session_data *sd, const char *message) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_process_chat_message_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const char **message);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_process_chat_message_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_process_chat_message_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &message);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.process_chat_message(sd, message);
+ }
+ if (HPMHooks.count.HP_pc_process_chat_message_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const char *message);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_process_chat_message_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_process_chat_message_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, message);
+ }
+ }
+ return retVal___;
+}
+void HP_pc_check_supernovice_call(struct map_session_data *sd, const char *message) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_pc_check_supernovice_call_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **message);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_supernovice_call_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_check_supernovice_call_pre[hIndex].func;
+ preHookFunc(&sd, &message);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.check_supernovice_call(sd, message);
+ }
+ if (HPMHooks.count.HP_pc_check_supernovice_call_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *message);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_supernovice_call_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_check_supernovice_call_post[hIndex].func;
+ postHookFunc(sd, message);
+ }
+ }
+ return;
+}
+bool HP_pc_check_basicskill(struct map_session_data *sd, int level) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_check_basicskill_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *level);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_basicskill_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_check_basicskill_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &level);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.check_basicskill(sd, level);
+ }
+ if (HPMHooks.count.HP_pc_check_basicskill_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_check_basicskill_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_check_basicskill_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, level);
+ }
+ }
+ return retVal___;
+}
+/* pcre_interface */
pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) {
int hIndex = 0;
pcre* retVal___ = NULL;
- if( HPMHooks.count.HP_libpcre_compile_pre ) {
- pcre* (*preHookFunc) (const char *pattern, int *options, const char **errptr, int *erroffset, const unsigned char *tableptr);
+ if (HPMHooks.count.HP_libpcre_compile_pre > 0) {
+ pcre* (*preHookFunc) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_compile_pre[hIndex].func;
- retVal___ = preHookFunc(pattern, &options, errptr, erroffset, tableptr);
+ retVal___ = preHookFunc(&pattern, &options, &errptr, &erroffset, &tableptr);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57722,11 +58937,11 @@ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr,
{
retVal___ = HPMHooks.source.libpcre.compile(pattern, options, errptr, erroffset, tableptr);
}
- if( HPMHooks.count.HP_libpcre_compile_post ) {
- pcre* (*postHookFunc) (pcre* retVal___, const char *pattern, int *options, const char **errptr, int *erroffset, const unsigned char *tableptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libpcre_compile_post > 0) {
+ pcre* (*postHookFunc) (pcre* retVal___, const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_compile_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_compile_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pattern, &options, errptr, erroffset, tableptr);
+ retVal___ = postHookFunc(retVal___, pattern, options, errptr, erroffset, tableptr);
}
}
return retVal___;
@@ -57734,14 +58949,14 @@ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr,
pcre_extra* HP_libpcre_study(const pcre *code, int options, const char **errptr) {
int hIndex = 0;
pcre_extra* retVal___ = NULL;
- if( HPMHooks.count.HP_libpcre_study_pre ) {
- pcre_extra* (*preHookFunc) (const pcre *code, int *options, const char **errptr);
+ if (HPMHooks.count.HP_libpcre_study_pre > 0) {
+ pcre_extra* (*preHookFunc) (const pcre **code, int *options, const char ***errptr);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_study_pre[hIndex].func;
- retVal___ = preHookFunc(code, &options, errptr);
+ retVal___ = preHookFunc(&code, &options, &errptr);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57749,26 +58964,26 @@ pcre_extra* HP_libpcre_study(const pcre *code, int options, const char **errptr)
{
retVal___ = HPMHooks.source.libpcre.study(code, options, errptr);
}
- if( HPMHooks.count.HP_libpcre_study_post ) {
- pcre_extra* (*postHookFunc) (pcre_extra* retVal___, const pcre *code, int *options, const char **errptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libpcre_study_post > 0) {
+ pcre_extra* (*postHookFunc) (pcre_extra* retVal___, const pcre *code, int options, const char **errptr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_study_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_study_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, code, &options, errptr);
+ retVal___ = postHookFunc(retVal___, code, options, errptr);
}
}
return retVal___;
}
-int HP_libpcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize) {
+int HP_libpcre_exec(const pcre *code, const pcre_extra *extra, PCRE_SPTR subject, int length, int startoffset, int options, int *ovector, int ovecsize) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libpcre_exec_pre ) {
- int (*preHookFunc) (const pcre *code, const pcre_extra *extra, const char *subject, int *length, int *startoffset, int *options, int *ovector, int *ovecsize);
+ if (HPMHooks.count.HP_libpcre_exec_pre > 0) {
+ int (*preHookFunc) (const pcre **code, const pcre_extra **extra, PCRE_SPTR *subject, int *length, int *startoffset, int *options, int **ovector, int *ovecsize);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_exec_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_exec_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_exec_pre[hIndex].func;
- retVal___ = preHookFunc(code, extra, subject, &length, &startoffset, &options, ovector, &ovecsize);
+ retVal___ = preHookFunc(&code, &extra, &subject, &length, &startoffset, &options, &ovector, &ovecsize);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57776,25 +58991,25 @@ int HP_libpcre_exec(const pcre *code, const pcre_extra *extra, const char *subje
{
retVal___ = HPMHooks.source.libpcre.exec(code, extra, subject, length, startoffset, options, ovector, ovecsize);
}
- if( HPMHooks.count.HP_libpcre_exec_post ) {
- int (*postHookFunc) (int retVal___, const pcre *code, const pcre_extra *extra, const char *subject, int *length, int *startoffset, int *options, int *ovector, int *ovecsize);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_exec_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libpcre_exec_post > 0) {
+ int (*postHookFunc) (int retVal___, const pcre *code, const pcre_extra *extra, PCRE_SPTR subject, int length, int startoffset, int options, int *ovector, int ovecsize);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_exec_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_exec_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, code, extra, subject, &length, &startoffset, &options, ovector, &ovecsize);
+ retVal___ = postHookFunc(retVal___, code, extra, subject, length, startoffset, options, ovector, ovecsize);
}
}
return retVal___;
}
void HP_libpcre_free(void *ptr) {
int hIndex = 0;
- if( HPMHooks.count.HP_libpcre_free_pre ) {
- void (*preHookFunc) (void *ptr);
+ if (HPMHooks.count.HP_libpcre_free_pre > 0) {
+ void (*preHookFunc) (void **ptr);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_free_pre[hIndex].func;
- preHookFunc(ptr);
+ preHookFunc(&ptr);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57802,9 +59017,9 @@ void HP_libpcre_free(void *ptr) {
{
HPMHooks.source.libpcre.free(ptr);
}
- if( HPMHooks.count.HP_libpcre_free_post ) {
+ if (HPMHooks.count.HP_libpcre_free_post > 0) {
void (*postHookFunc) (void *ptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_free_post[hIndex].func;
postHookFunc(ptr);
}
@@ -57814,14 +59029,14 @@ void HP_libpcre_free(void *ptr) {
int HP_libpcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libpcre_copy_substring_pre ) {
- int (*preHookFunc) (const char *subject, int *ovector, int *stringcount, int *stringnumber, char *buffer, int *buffersize);
+ if (HPMHooks.count.HP_libpcre_copy_substring_pre > 0) {
+ int (*preHookFunc) (const char **subject, int **ovector, int *stringcount, int *stringnumber, char **buffer, int *buffersize);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_substring_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_substring_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_copy_substring_pre[hIndex].func;
- retVal___ = preHookFunc(subject, ovector, &stringcount, &stringnumber, buffer, &buffersize);
+ retVal___ = preHookFunc(&subject, &ovector, &stringcount, &stringnumber, &buffer, &buffersize);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57829,25 +59044,25 @@ int HP_libpcre_copy_substring(const char *subject, int *ovector, int stringcount
{
retVal___ = HPMHooks.source.libpcre.copy_substring(subject, ovector, stringcount, stringnumber, buffer, buffersize);
}
- if( HPMHooks.count.HP_libpcre_copy_substring_post ) {
- int (*postHookFunc) (int retVal___, const char *subject, int *ovector, int *stringcount, int *stringnumber, char *buffer, int *buffersize);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_substring_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libpcre_copy_substring_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_substring_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_copy_substring_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, subject, ovector, &stringcount, &stringnumber, buffer, &buffersize);
+ retVal___ = postHookFunc(retVal___, subject, ovector, stringcount, stringnumber, buffer, buffersize);
}
}
return retVal___;
}
void HP_libpcre_free_substring(const char *stringptr) {
int hIndex = 0;
- if( HPMHooks.count.HP_libpcre_free_substring_pre ) {
- void (*preHookFunc) (const char *stringptr);
+ if (HPMHooks.count.HP_libpcre_free_substring_pre > 0) {
+ void (*preHookFunc) (const char **stringptr);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_substring_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_substring_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_free_substring_pre[hIndex].func;
- preHookFunc(stringptr);
+ preHookFunc(&stringptr);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -57855,9 +59070,9 @@ void HP_libpcre_free_substring(const char *stringptr) {
{
HPMHooks.source.libpcre.free_substring(stringptr);
}
- if( HPMHooks.count.HP_libpcre_free_substring_post ) {
+ if (HPMHooks.count.HP_libpcre_free_substring_post > 0) {
void (*postHookFunc) (const char *stringptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_substring_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_free_substring_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_free_substring_post[hIndex].func;
postHookFunc(stringptr);
}
@@ -57867,14 +59082,14 @@ void HP_libpcre_free_substring(const char *stringptr) {
int HP_libpcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libpcre_copy_named_substring_pre ) {
- int (*preHookFunc) (const pcre *code, const char *subject, int *ovector, int *stringcount, const char *stringname, char *buffer, int *buffersize);
+ if (HPMHooks.count.HP_libpcre_copy_named_substring_pre > 0) {
+ int (*preHookFunc) (const pcre **code, const char **subject, int **ovector, int *stringcount, const char **stringname, char **buffer, int *buffersize);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_named_substring_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_named_substring_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_copy_named_substring_pre[hIndex].func;
- retVal___ = preHookFunc(code, subject, ovector, &stringcount, stringname, buffer, &buffersize);
+ retVal___ = preHookFunc(&code, &subject, &ovector, &stringcount, &stringname, &buffer, &buffersize);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57882,11 +59097,11 @@ int HP_libpcre_copy_named_substring(const pcre *code, const char *subject, int *
{
retVal___ = HPMHooks.source.libpcre.copy_named_substring(code, subject, ovector, stringcount, stringname, buffer, buffersize);
}
- if( HPMHooks.count.HP_libpcre_copy_named_substring_post ) {
- int (*postHookFunc) (int retVal___, const pcre *code, const char *subject, int *ovector, int *stringcount, const char *stringname, char *buffer, int *buffersize);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_named_substring_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libpcre_copy_named_substring_post > 0) {
+ int (*postHookFunc) (int retVal___, const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_copy_named_substring_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_copy_named_substring_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, code, subject, ovector, &stringcount, stringname, buffer, &buffersize);
+ retVal___ = postHookFunc(retVal___, code, subject, ovector, stringcount, stringname, buffer, buffersize);
}
}
return retVal___;
@@ -57894,14 +59109,14 @@ int HP_libpcre_copy_named_substring(const pcre *code, const char *subject, int *
int HP_libpcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_libpcre_get_substring_pre ) {
- int (*preHookFunc) (const char *subject, int *ovector, int *stringcount, int *stringnumber, const char **stringptr);
+ if (HPMHooks.count.HP_libpcre_get_substring_pre > 0) {
+ int (*preHookFunc) (const char **subject, int **ovector, int *stringcount, int *stringnumber, const char ***stringptr);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_get_substring_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_get_substring_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_libpcre_get_substring_pre[hIndex].func;
- retVal___ = preHookFunc(subject, ovector, &stringcount, &stringnumber, stringptr);
+ retVal___ = preHookFunc(&subject, &ovector, &stringcount, &stringnumber, &stringptr);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57909,27 +59124,27 @@ int HP_libpcre_get_substring(const char *subject, int *ovector, int stringcount,
{
retVal___ = HPMHooks.source.libpcre.get_substring(subject, ovector, stringcount, stringnumber, stringptr);
}
- if( HPMHooks.count.HP_libpcre_get_substring_post ) {
- int (*postHookFunc) (int retVal___, const char *subject, int *ovector, int *stringcount, int *stringnumber, const char **stringptr);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_get_substring_post; hIndex++ ) {
+ if (HPMHooks.count.HP_libpcre_get_substring_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_libpcre_get_substring_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_libpcre_get_substring_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, subject, ovector, &stringcount, &stringnumber, stringptr);
+ retVal___ = postHookFunc(retVal___, subject, ovector, stringcount, stringnumber, stringptr);
}
}
return retVal___;
}
-/* pet */
+/* pet_interface */
int HP_pet_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_init_pre ) {
+ if (HPMHooks.count.HP_pet_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57937,11 +59152,11 @@ int HP_pet_init(bool minimal) {
{
retVal___ = HPMHooks.source.pet.init(minimal);
}
- if( HPMHooks.count.HP_pet_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
@@ -57949,14 +59164,14 @@ int HP_pet_init(bool minimal) {
int HP_pet_final(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_final_pre ) {
+ if (HPMHooks.count.HP_pet_final_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_final_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57964,9 +59179,9 @@ int HP_pet_final(void) {
{
retVal___ = HPMHooks.source.pet.final();
}
- if( HPMHooks.count.HP_pet_final_post ) {
+ if (HPMHooks.count.HP_pet_final_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_final_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -57976,14 +59191,14 @@ int HP_pet_final(void) {
int HP_pet_hungry_val(struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_hungry_val_pre ) {
- int (*preHookFunc) (struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_hungry_val_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_val_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_val_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_hungry_val_pre[hIndex].func;
- retVal___ = preHookFunc(pd);
+ retVal___ = preHookFunc(&pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -57991,9 +59206,9 @@ int HP_pet_hungry_val(struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.hungry_val(pd);
}
- if( HPMHooks.count.HP_pet_hungry_val_post ) {
+ if (HPMHooks.count.HP_pet_hungry_val_post > 0) {
int (*postHookFunc) (int retVal___, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_val_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_val_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_hungry_val_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pd);
}
@@ -58002,14 +59217,14 @@ int HP_pet_hungry_val(struct pet_data *pd) {
}
void HP_pet_set_intimate(struct pet_data *pd, int value) {
int hIndex = 0;
- if( HPMHooks.count.HP_pet_set_intimate_pre ) {
- void (*preHookFunc) (struct pet_data *pd, int *value);
+ if (HPMHooks.count.HP_pet_set_intimate_pre > 0) {
+ void (*preHookFunc) (struct pet_data **pd, int *value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_set_intimate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_set_intimate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_set_intimate_pre[hIndex].func;
- preHookFunc(pd, &value);
+ preHookFunc(&pd, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -58017,11 +59232,11 @@ void HP_pet_set_intimate(struct pet_data *pd, int value) {
{
HPMHooks.source.pet.set_intimate(pd, value);
}
- if( HPMHooks.count.HP_pet_set_intimate_post ) {
- void (*postHookFunc) (struct pet_data *pd, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_set_intimate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_set_intimate_post > 0) {
+ void (*postHookFunc) (struct pet_data *pd, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_set_intimate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_set_intimate_post[hIndex].func;
- postHookFunc(pd, &value);
+ postHookFunc(pd, value);
}
}
return;
@@ -58029,14 +59244,14 @@ void HP_pet_set_intimate(struct pet_data *pd, int value) {
int HP_pet_create_egg(struct map_session_data *sd, int item_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_create_egg_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *item_id);
+ if (HPMHooks.count.HP_pet_create_egg_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *item_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_create_egg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_create_egg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_create_egg_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &item_id);
+ retVal___ = preHookFunc(&sd, &item_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58044,11 +59259,11 @@ int HP_pet_create_egg(struct map_session_data *sd, int item_id) {
{
retVal___ = HPMHooks.source.pet.create_egg(sd, item_id);
}
- if( HPMHooks.count.HP_pet_create_egg_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *item_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_create_egg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_create_egg_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int item_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_create_egg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_create_egg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &item_id);
+ retVal___ = postHookFunc(retVal___, sd, item_id);
}
}
return retVal___;
@@ -58056,14 +59271,14 @@ int HP_pet_create_egg(struct map_session_data *sd, int item_id) {
int HP_pet_unlocktarget(struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_unlocktarget_pre ) {
- int (*preHookFunc) (struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_unlocktarget_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_unlocktarget_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_unlocktarget_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_unlocktarget_pre[hIndex].func;
- retVal___ = preHookFunc(pd);
+ retVal___ = preHookFunc(&pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58071,9 +59286,9 @@ int HP_pet_unlocktarget(struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.unlocktarget(pd);
}
- if( HPMHooks.count.HP_pet_unlocktarget_post ) {
+ if (HPMHooks.count.HP_pet_unlocktarget_post > 0) {
int (*postHookFunc) (int retVal___, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_unlocktarget_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_unlocktarget_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_unlocktarget_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pd);
}
@@ -58083,14 +59298,14 @@ int HP_pet_unlocktarget(struct pet_data *pd) {
int HP_pet_attackskill(struct pet_data *pd, int target_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_attackskill_pre ) {
- int (*preHookFunc) (struct pet_data *pd, int *target_id);
+ if (HPMHooks.count.HP_pet_attackskill_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_attackskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_attackskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_attackskill_pre[hIndex].func;
- retVal___ = preHookFunc(pd, &target_id);
+ retVal___ = preHookFunc(&pd, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58098,11 +59313,11 @@ int HP_pet_attackskill(struct pet_data *pd, int target_id) {
{
retVal___ = HPMHooks.source.pet.attackskill(pd, target_id);
}
- if( HPMHooks.count.HP_pet_attackskill_post ) {
- int (*postHookFunc) (int retVal___, struct pet_data *pd, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_attackskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_attackskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct pet_data *pd, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_attackskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_attackskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pd, &target_id);
+ retVal___ = postHookFunc(retVal___, pd, target_id);
}
}
return retVal___;
@@ -58110,14 +59325,14 @@ int HP_pet_attackskill(struct pet_data *pd, int target_id) {
int HP_pet_target_check(struct map_session_data *sd, struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_target_check_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_pet_target_check_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_target_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_target_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_target_check_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bl, &type);
+ retVal___ = preHookFunc(&sd, &bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58125,11 +59340,11 @@ int HP_pet_target_check(struct map_session_data *sd, struct block_list *bl, int
{
retVal___ = HPMHooks.source.pet.target_check(sd, bl, type);
}
- if( HPMHooks.count.HP_pet_target_check_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_target_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_target_check_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_target_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_target_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, bl, &type);
+ retVal___ = postHookFunc(retVal___, sd, bl, type);
}
}
return retVal___;
@@ -58137,14 +59352,14 @@ int HP_pet_target_check(struct map_session_data *sd, struct block_list *bl, int
int HP_pet_sc_check(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_sc_check_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_pet_sc_check_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_sc_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_sc_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_sc_check_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58152,11 +59367,11 @@ int HP_pet_sc_check(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.pet.sc_check(sd, type);
}
- if( HPMHooks.count.HP_pet_sc_check_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_sc_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_sc_check_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_sc_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_sc_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
@@ -58164,14 +59379,14 @@ int HP_pet_sc_check(struct map_session_data *sd, int type) {
int HP_pet_hungry(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_hungry_pre ) {
+ if (HPMHooks.count.HP_pet_hungry_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_hungry_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58179,11 +59394,11 @@ int HP_pet_hungry(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pet.hungry(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pet_hungry_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_hungry_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_hungry_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -58191,14 +59406,14 @@ int HP_pet_hungry(int tid, int64 tick, int id, intptr_t data) {
int HP_pet_search_petDB_index(int key, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_search_petDB_index_pre ) {
+ if (HPMHooks.count.HP_pet_search_petDB_index_pre > 0) {
int (*preHookFunc) (int *key, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_search_petDB_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_search_petDB_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_search_petDB_index_pre[hIndex].func;
retVal___ = preHookFunc(&key, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58206,11 +59421,11 @@ int HP_pet_search_petDB_index(int key, int type) {
{
retVal___ = HPMHooks.source.pet.search_petDB_index(key, type);
}
- if( HPMHooks.count.HP_pet_search_petDB_index_post ) {
- int (*postHookFunc) (int retVal___, int *key, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_search_petDB_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_search_petDB_index_post > 0) {
+ int (*postHookFunc) (int retVal___, int key, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_search_petDB_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_search_petDB_index_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, &type);
+ retVal___ = postHookFunc(retVal___, key, type);
}
}
return retVal___;
@@ -58218,14 +59433,14 @@ int HP_pet_search_petDB_index(int key, int type) {
int HP_pet_hungry_timer_delete(struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_hungry_timer_delete_pre ) {
- int (*preHookFunc) (struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_hungry_timer_delete_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_timer_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_timer_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_hungry_timer_delete_pre[hIndex].func;
- retVal___ = preHookFunc(pd);
+ retVal___ = preHookFunc(&pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58233,9 +59448,9 @@ int HP_pet_hungry_timer_delete(struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.hungry_timer_delete(pd);
}
- if( HPMHooks.count.HP_pet_hungry_timer_delete_post ) {
+ if (HPMHooks.count.HP_pet_hungry_timer_delete_post > 0) {
int (*postHookFunc) (int retVal___, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_timer_delete_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_hungry_timer_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_hungry_timer_delete_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pd);
}
@@ -58245,14 +59460,14 @@ int HP_pet_hungry_timer_delete(struct pet_data *pd) {
int HP_pet_performance(struct map_session_data *sd, struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_performance_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_performance_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_performance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_performance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_performance_pre[hIndex].func;
- retVal___ = preHookFunc(sd, pd);
+ retVal___ = preHookFunc(&sd, &pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58260,9 +59475,9 @@ int HP_pet_performance(struct map_session_data *sd, struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.performance(sd, pd);
}
- if( HPMHooks.count.HP_pet_performance_post ) {
+ if (HPMHooks.count.HP_pet_performance_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_performance_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_performance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_performance_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, pd);
}
@@ -58272,14 +59487,14 @@ int HP_pet_performance(struct map_session_data *sd, struct pet_data *pd) {
int HP_pet_return_egg(struct map_session_data *sd, struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_return_egg_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_return_egg_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_return_egg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_return_egg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_return_egg_pre[hIndex].func;
- retVal___ = preHookFunc(sd, pd);
+ retVal___ = preHookFunc(&sd, &pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58287,9 +59502,9 @@ int HP_pet_return_egg(struct map_session_data *sd, struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.return_egg(sd, pd);
}
- if( HPMHooks.count.HP_pet_return_egg_post ) {
+ if (HPMHooks.count.HP_pet_return_egg_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_return_egg_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_return_egg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_return_egg_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, pd);
}
@@ -58299,14 +59514,14 @@ int HP_pet_return_egg(struct map_session_data *sd, struct pet_data *pd) {
int HP_pet_data_init(struct map_session_data *sd, struct s_pet *petinfo) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_data_init_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct s_pet *petinfo);
+ if (HPMHooks.count.HP_pet_data_init_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct s_pet **petinfo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_data_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_data_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_data_init_pre[hIndex].func;
- retVal___ = preHookFunc(sd, petinfo);
+ retVal___ = preHookFunc(&sd, &petinfo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58314,9 +59529,9 @@ int HP_pet_data_init(struct map_session_data *sd, struct s_pet *petinfo) {
{
retVal___ = HPMHooks.source.pet.data_init(sd, petinfo);
}
- if( HPMHooks.count.HP_pet_data_init_post ) {
+ if (HPMHooks.count.HP_pet_data_init_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct s_pet *petinfo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_data_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_data_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_data_init_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, petinfo);
}
@@ -58326,14 +59541,14 @@ int HP_pet_data_init(struct map_session_data *sd, struct s_pet *petinfo) {
int HP_pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_birth_process_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct s_pet *petinfo);
+ if (HPMHooks.count.HP_pet_birth_process_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct s_pet **petinfo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_birth_process_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_birth_process_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_birth_process_pre[hIndex].func;
- retVal___ = preHookFunc(sd, petinfo);
+ retVal___ = preHookFunc(&sd, &petinfo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58341,9 +59556,9 @@ int HP_pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo) {
{
retVal___ = HPMHooks.source.pet.birth_process(sd, petinfo);
}
- if( HPMHooks.count.HP_pet_birth_process_post ) {
+ if (HPMHooks.count.HP_pet_birth_process_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct s_pet *petinfo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_birth_process_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_birth_process_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_birth_process_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, petinfo);
}
@@ -58353,14 +59568,14 @@ int HP_pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo) {
int HP_pet_recv_petdata(int account_id, struct s_pet *p, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_recv_petdata_pre ) {
- int (*preHookFunc) (int *account_id, struct s_pet *p, int *flag);
+ if (HPMHooks.count.HP_pet_recv_petdata_pre > 0) {
+ int (*preHookFunc) (int *account_id, struct s_pet **p, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_recv_petdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_recv_petdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_recv_petdata_pre[hIndex].func;
- retVal___ = preHookFunc(&account_id, p, &flag);
+ retVal___ = preHookFunc(&account_id, &p, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58368,11 +59583,11 @@ int HP_pet_recv_petdata(int account_id, struct s_pet *p, int flag) {
{
retVal___ = HPMHooks.source.pet.recv_petdata(account_id, p, flag);
}
- if( HPMHooks.count.HP_pet_recv_petdata_post ) {
- int (*postHookFunc) (int retVal___, int *account_id, struct s_pet *p, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_recv_petdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_recv_petdata_post > 0) {
+ int (*postHookFunc) (int retVal___, int account_id, struct s_pet *p, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_recv_petdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_recv_petdata_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, p, &flag);
+ retVal___ = postHookFunc(retVal___, account_id, p, flag);
}
}
return retVal___;
@@ -58380,14 +59595,14 @@ int HP_pet_recv_petdata(int account_id, struct s_pet *p, int flag) {
int HP_pet_select_egg(struct map_session_data *sd, short egg_index) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_select_egg_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, short *egg_index);
+ if (HPMHooks.count.HP_pet_select_egg_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, short *egg_index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_select_egg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_select_egg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_select_egg_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &egg_index);
+ retVal___ = preHookFunc(&sd, &egg_index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58395,11 +59610,11 @@ int HP_pet_select_egg(struct map_session_data *sd, short egg_index) {
{
retVal___ = HPMHooks.source.pet.select_egg(sd, egg_index);
}
- if( HPMHooks.count.HP_pet_select_egg_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, short *egg_index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_select_egg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_select_egg_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, short egg_index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_select_egg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_select_egg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &egg_index);
+ retVal___ = postHookFunc(retVal___, sd, egg_index);
}
}
return retVal___;
@@ -58407,14 +59622,14 @@ int HP_pet_select_egg(struct map_session_data *sd, short egg_index) {
int HP_pet_catch_process1(struct map_session_data *sd, int target_class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_catch_process1_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *target_class);
+ if (HPMHooks.count.HP_pet_catch_process1_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *target_class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process1_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process1_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_catch_process1_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &target_class);
+ retVal___ = preHookFunc(&sd, &target_class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58422,11 +59637,11 @@ int HP_pet_catch_process1(struct map_session_data *sd, int target_class) {
{
retVal___ = HPMHooks.source.pet.catch_process1(sd, target_class);
}
- if( HPMHooks.count.HP_pet_catch_process1_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *target_class);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process1_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_catch_process1_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int target_class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process1_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_catch_process1_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &target_class);
+ retVal___ = postHookFunc(retVal___, sd, target_class);
}
}
return retVal___;
@@ -58434,14 +59649,14 @@ int HP_pet_catch_process1(struct map_session_data *sd, int target_class) {
int HP_pet_catch_process2(struct map_session_data *sd, int target_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_catch_process2_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *target_id);
+ if (HPMHooks.count.HP_pet_catch_process2_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_catch_process2_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &target_id);
+ retVal___ = preHookFunc(&sd, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58449,11 +59664,11 @@ int HP_pet_catch_process2(struct map_session_data *sd, int target_id) {
{
retVal___ = HPMHooks.source.pet.catch_process2(sd, target_id);
}
- if( HPMHooks.count.HP_pet_catch_process2_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_catch_process2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_catch_process2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_catch_process2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &target_id);
+ retVal___ = postHookFunc(retVal___, sd, target_id);
}
}
return retVal___;
@@ -58461,14 +59676,14 @@ int HP_pet_catch_process2(struct map_session_data *sd, int target_id) {
bool HP_pet_get_egg(int account_id, short pet_class, int pet_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_pet_get_egg_pre ) {
+ if (HPMHooks.count.HP_pet_get_egg_pre > 0) {
bool (*preHookFunc) (int *account_id, short *pet_class, int *pet_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_get_egg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_get_egg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_get_egg_pre[hIndex].func;
retVal___ = preHookFunc(&account_id, &pet_class, &pet_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58476,11 +59691,11 @@ bool HP_pet_get_egg(int account_id, short pet_class, int pet_id) {
{
retVal___ = HPMHooks.source.pet.get_egg(account_id, pet_class, pet_id);
}
- if( HPMHooks.count.HP_pet_get_egg_post ) {
- bool (*postHookFunc) (bool retVal___, int *account_id, short *pet_class, int *pet_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_get_egg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_get_egg_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int account_id, short pet_class, int pet_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_get_egg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_get_egg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &account_id, &pet_class, &pet_id);
+ retVal___ = postHookFunc(retVal___, account_id, pet_class, pet_id);
}
}
return retVal___;
@@ -58488,14 +59703,14 @@ bool HP_pet_get_egg(int account_id, short pet_class, int pet_id) {
int HP_pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_unequipitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_unequipitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_unequipitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_unequipitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_unequipitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, pd);
+ retVal___ = preHookFunc(&sd, &pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58503,9 +59718,9 @@ int HP_pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.unequipitem(sd, pd);
}
- if( HPMHooks.count.HP_pet_unequipitem_post ) {
+ if (HPMHooks.count.HP_pet_unequipitem_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_unequipitem_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_unequipitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_unequipitem_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, pd);
}
@@ -58515,14 +59730,14 @@ int HP_pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) {
int HP_pet_food(struct map_session_data *sd, struct pet_data *pd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_food_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct pet_data *pd);
+ if (HPMHooks.count.HP_pet_food_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct pet_data **pd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_food_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_food_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_food_pre[hIndex].func;
- retVal___ = preHookFunc(sd, pd);
+ retVal___ = preHookFunc(&sd, &pd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58530,9 +59745,9 @@ int HP_pet_food(struct map_session_data *sd, struct pet_data *pd) {
{
retVal___ = HPMHooks.source.pet.food(sd, pd);
}
- if( HPMHooks.count.HP_pet_food_post ) {
+ if (HPMHooks.count.HP_pet_food_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct pet_data *pd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_food_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_food_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_food_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, pd);
}
@@ -58542,16 +59757,16 @@ int HP_pet_food(struct map_session_data *sd, struct pet_data *pd) {
int HP_pet_ai_sub_hard_lootsearch(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pet_ai_sub_hard_lootsearch_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58561,9 +59776,9 @@ int HP_pet_ai_sub_hard_lootsearch(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.pet.ai_sub_hard_lootsearch(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_post ) {
+ if (HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_lootsearch_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pet_ai_sub_hard_lootsearch_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -58575,14 +59790,14 @@ int HP_pet_ai_sub_hard_lootsearch(struct block_list *bl, va_list ap) {
int HP_pet_menu(struct map_session_data *sd, int menunum) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_menu_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *menunum);
+ if (HPMHooks.count.HP_pet_menu_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *menunum);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_menu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_menu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_menu_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &menunum);
+ retVal___ = preHookFunc(&sd, &menunum);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58590,26 +59805,26 @@ int HP_pet_menu(struct map_session_data *sd, int menunum) {
{
retVal___ = HPMHooks.source.pet.menu(sd, menunum);
}
- if( HPMHooks.count.HP_pet_menu_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *menunum);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_menu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_menu_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int menunum);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_menu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_menu_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &menunum);
+ retVal___ = postHookFunc(retVal___, sd, menunum);
}
}
return retVal___;
}
-int HP_pet_change_name(struct map_session_data *sd, char *name) {
+int HP_pet_change_name(struct map_session_data *sd, const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_change_name_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *name);
+ if (HPMHooks.count.HP_pet_change_name_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_change_name_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name);
+ retVal___ = preHookFunc(&sd, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58617,26 +59832,26 @@ int HP_pet_change_name(struct map_session_data *sd, char *name) {
{
retVal___ = HPMHooks.source.pet.change_name(sd, name);
}
- if( HPMHooks.count.HP_pet_change_name_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_change_name_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_change_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, name);
}
}
return retVal___;
}
-int HP_pet_change_name_ack(struct map_session_data *sd, char *name, int flag) {
+int HP_pet_change_name_ack(struct map_session_data *sd, const char *name, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_change_name_ack_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *name, int *flag);
+ if (HPMHooks.count.HP_pet_change_name_ack_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const char **name, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_change_name_ack_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name, &flag);
+ retVal___ = preHookFunc(&sd, &name, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58644,11 +59859,11 @@ int HP_pet_change_name_ack(struct map_session_data *sd, char *name, int flag) {
{
retVal___ = HPMHooks.source.pet.change_name_ack(sd, name, flag);
}
- if( HPMHooks.count.HP_pet_change_name_ack_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *name, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_change_name_ack_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const char *name, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_change_name_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_change_name_ack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, name, &flag);
+ retVal___ = postHookFunc(retVal___, sd, name, flag);
}
}
return retVal___;
@@ -58656,14 +59871,14 @@ int HP_pet_change_name_ack(struct map_session_data *sd, char *name, int flag) {
int HP_pet_equipitem(struct map_session_data *sd, int index) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_equipitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index);
+ if (HPMHooks.count.HP_pet_equipitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_equipitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_equipitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_equipitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index);
+ retVal___ = preHookFunc(&sd, &index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58671,11 +59886,11 @@ int HP_pet_equipitem(struct map_session_data *sd, int index) {
{
retVal___ = HPMHooks.source.pet.equipitem(sd, index);
}
- if( HPMHooks.count.HP_pet_equipitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_equipitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_equipitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_equipitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_equipitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index);
+ retVal___ = postHookFunc(retVal___, sd, index);
}
}
return retVal___;
@@ -58683,14 +59898,14 @@ int HP_pet_equipitem(struct map_session_data *sd, int index) {
int HP_pet_randomwalk(struct pet_data *pd, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_randomwalk_pre ) {
- int (*preHookFunc) (struct pet_data *pd, int64 *tick);
+ if (HPMHooks.count.HP_pet_randomwalk_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_randomwalk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_randomwalk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_randomwalk_pre[hIndex].func;
- retVal___ = preHookFunc(pd, &tick);
+ retVal___ = preHookFunc(&pd, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58698,11 +59913,11 @@ int HP_pet_randomwalk(struct pet_data *pd, int64 tick) {
{
retVal___ = HPMHooks.source.pet.randomwalk(pd, tick);
}
- if( HPMHooks.count.HP_pet_randomwalk_post ) {
- int (*postHookFunc) (int retVal___, struct pet_data *pd, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_randomwalk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_randomwalk_post > 0) {
+ int (*postHookFunc) (int retVal___, struct pet_data *pd, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_randomwalk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_randomwalk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pd, &tick);
+ retVal___ = postHookFunc(retVal___, pd, tick);
}
}
return retVal___;
@@ -58710,14 +59925,14 @@ int HP_pet_randomwalk(struct pet_data *pd, int64 tick) {
int HP_pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_ai_sub_hard_pre ) {
- int (*preHookFunc) (struct pet_data *pd, struct map_session_data *sd, int64 *tick);
+ if (HPMHooks.count.HP_pet_ai_sub_hard_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd, struct map_session_data **sd, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_ai_sub_hard_pre[hIndex].func;
- retVal___ = preHookFunc(pd, sd, &tick);
+ retVal___ = preHookFunc(&pd, &sd, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58725,11 +59940,11 @@ int HP_pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 t
{
retVal___ = HPMHooks.source.pet.ai_sub_hard(pd, sd, tick);
}
- if( HPMHooks.count.HP_pet_ai_sub_hard_post ) {
- int (*postHookFunc) (int retVal___, struct pet_data *pd, struct map_session_data *sd, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_ai_sub_hard_post > 0) {
+ int (*postHookFunc) (int retVal___, struct pet_data *pd, struct map_session_data *sd, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_hard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_ai_sub_hard_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pd, sd, &tick);
+ retVal___ = postHookFunc(retVal___, pd, sd, tick);
}
}
return retVal___;
@@ -58737,16 +59952,16 @@ int HP_pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 t
int HP_pet_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_ai_sub_foreachclient_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_pet_ai_sub_foreachclient_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_foreachclient_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_foreachclient_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_pet_ai_sub_foreachclient_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58756,9 +59971,9 @@ int HP_pet_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
retVal___ = HPMHooks.source.pet.ai_sub_foreachclient(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_pet_ai_sub_foreachclient_post ) {
+ if (HPMHooks.count.HP_pet_ai_sub_foreachclient_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_foreachclient_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_sub_foreachclient_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_pet_ai_sub_foreachclient_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -58770,14 +59985,14 @@ int HP_pet_ai_sub_foreachclient(struct map_session_data *sd, va_list ap) {
int HP_pet_ai_hard(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_ai_hard_pre ) {
+ if (HPMHooks.count.HP_pet_ai_hard_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_hard_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_hard_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_ai_hard_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58785,11 +60000,11 @@ int HP_pet_ai_hard(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pet.ai_hard(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pet_ai_hard_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_hard_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_ai_hard_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_ai_hard_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_ai_hard_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -58797,14 +60012,14 @@ int HP_pet_ai_hard(int tid, int64 tick, int id, intptr_t data) {
int HP_pet_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_delay_item_drop_pre ) {
+ if (HPMHooks.count.HP_pet_delay_item_drop_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_delay_item_drop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_delay_item_drop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_delay_item_drop_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58812,11 +60027,11 @@ int HP_pet_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pet.delay_item_drop(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pet_delay_item_drop_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_delay_item_drop_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_delay_item_drop_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_delay_item_drop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_delay_item_drop_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -58824,14 +60039,14 @@ int HP_pet_delay_item_drop(int tid, int64 tick, int id, intptr_t data) {
int HP_pet_lootitem_drop(struct pet_data *pd, struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_lootitem_drop_pre ) {
- int (*preHookFunc) (struct pet_data *pd, struct map_session_data *sd);
+ if (HPMHooks.count.HP_pet_lootitem_drop_pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_lootitem_drop_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_lootitem_drop_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_lootitem_drop_pre[hIndex].func;
- retVal___ = preHookFunc(pd, sd);
+ retVal___ = preHookFunc(&pd, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58839,9 +60054,9 @@ int HP_pet_lootitem_drop(struct pet_data *pd, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.pet.lootitem_drop(pd, sd);
}
- if( HPMHooks.count.HP_pet_lootitem_drop_post ) {
+ if (HPMHooks.count.HP_pet_lootitem_drop_post > 0) {
int (*postHookFunc) (int retVal___, struct pet_data *pd, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_lootitem_drop_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_lootitem_drop_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_lootitem_drop_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pd, sd);
}
@@ -58851,14 +60066,14 @@ int HP_pet_lootitem_drop(struct pet_data *pd, struct map_session_data *sd) {
int HP_pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_skill_bonus_timer_pre ) {
+ if (HPMHooks.count.HP_pet_skill_bonus_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_bonus_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_bonus_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_skill_bonus_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58866,11 +60081,11 @@ int HP_pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pet.skill_bonus_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pet_skill_bonus_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_bonus_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_skill_bonus_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_bonus_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_skill_bonus_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -58878,14 +60093,14 @@ int HP_pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_recovery_timer_pre ) {
+ if (HPMHooks.count.HP_pet_recovery_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_recovery_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_recovery_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_recovery_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58893,11 +60108,11 @@ int HP_pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pet.recovery_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pet_recovery_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_recovery_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_recovery_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_recovery_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_recovery_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -58905,14 +60120,14 @@ int HP_pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_skill_support_timer_pre ) {
+ if (HPMHooks.count.HP_pet_skill_support_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_support_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_support_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_skill_support_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58920,11 +60135,11 @@ int HP_pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.pet.skill_support_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_pet_skill_support_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_support_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_pet_skill_support_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_skill_support_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_skill_support_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -58932,14 +60147,14 @@ int HP_pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_pet_read_db(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_pet_read_db_pre ) {
+ if (HPMHooks.count.HP_pet_read_db_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_read_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_read_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pet_read_db_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -58947,26 +60162,26 @@ int HP_pet_read_db(void) {
{
retVal___ = HPMHooks.source.pet.read_db();
}
- if( HPMHooks.count.HP_pet_read_db_post ) {
+ if (HPMHooks.count.HP_pet_read_db_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_pet_read_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pet_read_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pet_read_db_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-/* quest */
+/* quest_interface */
void HP_quest_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_quest_init_pre ) {
+ if (HPMHooks.count.HP_quest_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -58974,25 +60189,25 @@ void HP_quest_init(bool minimal) {
{
HPMHooks.source.quest.init(minimal);
}
- if( HPMHooks.count.HP_quest_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_quest_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_quest_final_pre ) {
+ if (HPMHooks.count.HP_quest_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59000,9 +60215,9 @@ void HP_quest_final(void) {
{
HPMHooks.source.quest.final();
}
- if( HPMHooks.count.HP_quest_final_post ) {
+ if (HPMHooks.count.HP_quest_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_final_post[hIndex].func;
postHookFunc();
}
@@ -59011,14 +60226,14 @@ void HP_quest_final(void) {
}
void HP_quest_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_quest_reload_pre ) {
+ if (HPMHooks.count.HP_quest_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59026,9 +60241,9 @@ void HP_quest_reload(void) {
{
HPMHooks.source.quest.reload();
}
- if( HPMHooks.count.HP_quest_reload_post ) {
+ if (HPMHooks.count.HP_quest_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_reload_post[hIndex].func;
postHookFunc();
}
@@ -59038,14 +60253,14 @@ void HP_quest_reload(void) {
struct quest_db* HP_quest_db(int quest_id) {
int hIndex = 0;
struct quest_db* retVal___ = NULL;
- if( HPMHooks.count.HP_quest_db_pre ) {
+ if (HPMHooks.count.HP_quest_db_pre > 0) {
struct quest_db* (*preHookFunc) (int *quest_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_db_pre[hIndex].func;
retVal___ = preHookFunc(&quest_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59053,11 +60268,11 @@ struct quest_db* HP_quest_db(int quest_id) {
{
retVal___ = HPMHooks.source.quest.db(quest_id);
}
- if( HPMHooks.count.HP_quest_db_post ) {
- struct quest_db* (*postHookFunc) (struct quest_db* retVal___, int *quest_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_db_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_db_post > 0) {
+ struct quest_db* (*postHookFunc) (struct quest_db* retVal___, int quest_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_db_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &quest_id);
+ retVal___ = postHookFunc(retVal___, quest_id);
}
}
return retVal___;
@@ -59065,14 +60280,14 @@ struct quest_db* HP_quest_db(int quest_id) {
int HP_quest_pc_login(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_pc_login_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_quest_pc_login_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_pc_login_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_pc_login_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_pc_login_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59080,9 +60295,9 @@ int HP_quest_pc_login(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.quest.pc_login(sd);
}
- if( HPMHooks.count.HP_quest_pc_login_post ) {
+ if (HPMHooks.count.HP_quest_pc_login_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_pc_login_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_pc_login_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_pc_login_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -59092,14 +60307,14 @@ int HP_quest_pc_login(struct map_session_data *sd) {
int HP_quest_add(struct map_session_data *sd, int quest_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_add_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *quest_id);
+ if (HPMHooks.count.HP_quest_add_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *quest_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_add_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &quest_id);
+ retVal___ = preHookFunc(&sd, &quest_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59107,11 +60322,11 @@ int HP_quest_add(struct map_session_data *sd, int quest_id) {
{
retVal___ = HPMHooks.source.quest.add(sd, quest_id);
}
- if( HPMHooks.count.HP_quest_add_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *quest_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_add_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int quest_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &quest_id);
+ retVal___ = postHookFunc(retVal___, sd, quest_id);
}
}
return retVal___;
@@ -59119,14 +60334,14 @@ int HP_quest_add(struct map_session_data *sd, int quest_id) {
int HP_quest_change(struct map_session_data *sd, int qid1, int qid2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_change_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *qid1, int *qid2);
+ if (HPMHooks.count.HP_quest_change_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *qid1, int *qid2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_change_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &qid1, &qid2);
+ retVal___ = preHookFunc(&sd, &qid1, &qid2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59134,11 +60349,11 @@ int HP_quest_change(struct map_session_data *sd, int qid1, int qid2) {
{
retVal___ = HPMHooks.source.quest.change(sd, qid1, qid2);
}
- if( HPMHooks.count.HP_quest_change_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *qid1, int *qid2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_change_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int qid1, int qid2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_change_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &qid1, &qid2);
+ retVal___ = postHookFunc(retVal___, sd, qid1, qid2);
}
}
return retVal___;
@@ -59146,14 +60361,14 @@ int HP_quest_change(struct map_session_data *sd, int qid1, int qid2) {
int HP_quest_delete(struct map_session_data *sd, int quest_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_delete_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *quest_id);
+ if (HPMHooks.count.HP_quest_delete_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *quest_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_delete_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &quest_id);
+ retVal___ = preHookFunc(&sd, &quest_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59161,11 +60376,11 @@ int HP_quest_delete(struct map_session_data *sd, int quest_id) {
{
retVal___ = HPMHooks.source.quest.delete(sd, quest_id);
}
- if( HPMHooks.count.HP_quest_delete_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *quest_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int quest_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &quest_id);
+ retVal___ = postHookFunc(retVal___, sd, quest_id);
}
}
return retVal___;
@@ -59173,16 +60388,16 @@ int HP_quest_delete(struct map_session_data *sd, int quest_id) {
int HP_quest_update_objective_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_update_objective_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_quest_update_objective_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_quest_update_objective_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59192,9 +60407,9 @@ int HP_quest_update_objective_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.quest.update_objective_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_quest_update_objective_sub_post ) {
+ if (HPMHooks.count.HP_quest_update_objective_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_quest_update_objective_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -59205,14 +60420,14 @@ int HP_quest_update_objective_sub(struct block_list *bl, va_list ap) {
}
void HP_quest_update_objective(struct map_session_data *sd, int mob_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_quest_update_objective_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *mob_id);
+ if (HPMHooks.count.HP_quest_update_objective_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *mob_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_update_objective_pre[hIndex].func;
- preHookFunc(sd, &mob_id);
+ preHookFunc(&sd, &mob_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59220,11 +60435,11 @@ void HP_quest_update_objective(struct map_session_data *sd, int mob_id) {
{
HPMHooks.source.quest.update_objective(sd, mob_id);
}
- if( HPMHooks.count.HP_quest_update_objective_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *mob_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_update_objective_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int mob_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_objective_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_update_objective_post[hIndex].func;
- postHookFunc(sd, &mob_id);
+ postHookFunc(sd, mob_id);
}
}
return;
@@ -59232,14 +60447,14 @@ void HP_quest_update_objective(struct map_session_data *sd, int mob_id) {
int HP_quest_update_status(struct map_session_data *sd, int quest_id, enum quest_state qs) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_update_status_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *quest_id, enum quest_state *qs);
+ if (HPMHooks.count.HP_quest_update_status_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *quest_id, enum quest_state *qs);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_status_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_status_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_update_status_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &quest_id, &qs);
+ retVal___ = preHookFunc(&sd, &quest_id, &qs);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59247,11 +60462,11 @@ int HP_quest_update_status(struct map_session_data *sd, int quest_id, enum quest
{
retVal___ = HPMHooks.source.quest.update_status(sd, quest_id, qs);
}
- if( HPMHooks.count.HP_quest_update_status_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *quest_id, enum quest_state *qs);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_status_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_update_status_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int quest_id, enum quest_state qs);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_update_status_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_update_status_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &quest_id, &qs);
+ retVal___ = postHookFunc(retVal___, sd, quest_id, qs);
}
}
return retVal___;
@@ -59259,14 +60474,14 @@ int HP_quest_update_status(struct map_session_data *sd, int quest_id, enum quest
int HP_quest_check(struct map_session_data *sd, int quest_id, enum quest_check_type type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_check_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *quest_id, enum quest_check_type *type);
+ if (HPMHooks.count.HP_quest_check_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *quest_id, enum quest_check_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_check_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &quest_id, &type);
+ retVal___ = preHookFunc(&sd, &quest_id, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59274,25 +60489,25 @@ int HP_quest_check(struct map_session_data *sd, int quest_id, enum quest_check_t
{
retVal___ = HPMHooks.source.quest.check(sd, quest_id, type);
}
- if( HPMHooks.count.HP_quest_check_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *quest_id, enum quest_check_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_check_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int quest_id, enum quest_check_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &quest_id, &type);
+ retVal___ = postHookFunc(retVal___, sd, quest_id, type);
}
}
return retVal___;
}
void HP_quest_clear(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_quest_clear_pre ) {
+ if (HPMHooks.count.HP_quest_clear_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_clear_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59300,9 +60515,9 @@ void HP_quest_clear(void) {
{
HPMHooks.source.quest.clear();
}
- if( HPMHooks.count.HP_quest_clear_post ) {
+ if (HPMHooks.count.HP_quest_clear_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_clear_post[hIndex].func;
postHookFunc();
}
@@ -59312,14 +60527,14 @@ void HP_quest_clear(void) {
int HP_quest_read_db(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_quest_read_db_pre ) {
+ if (HPMHooks.count.HP_quest_read_db_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_read_db_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59327,26 +60542,26 @@ int HP_quest_read_db(void) {
{
retVal___ = HPMHooks.source.quest.read_db();
}
- if( HPMHooks.count.HP_quest_read_db_post ) {
+ if (HPMHooks.count.HP_quest_read_db_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_read_db_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-struct quest_db* HP_quest_read_db_sub(config_setting_t *cs, int n, const char *source) {
+struct quest_db* HP_quest_read_db_sub(struct config_setting_t *cs, int n, const char *source) {
int hIndex = 0;
struct quest_db* retVal___ = NULL;
- if( HPMHooks.count.HP_quest_read_db_sub_pre ) {
- struct quest_db* (*preHookFunc) (config_setting_t *cs, int *n, const char *source);
+ if (HPMHooks.count.HP_quest_read_db_sub_pre > 0) {
+ struct quest_db* (*preHookFunc) (struct config_setting_t **cs, int *n, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_quest_read_db_sub_pre[hIndex].func;
- retVal___ = preHookFunc(cs, &n, source);
+ retVal___ = preHookFunc(&cs, &n, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59354,26 +60569,240 @@ struct quest_db* HP_quest_read_db_sub(config_setting_t *cs, int n, const char *s
{
retVal___ = HPMHooks.source.quest.read_db_sub(cs, n, source);
}
- if( HPMHooks.count.HP_quest_read_db_sub_post ) {
- struct quest_db* (*postHookFunc) (struct quest_db* retVal___, config_setting_t *cs, int *n, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_quest_read_db_sub_post > 0) {
+ struct quest_db* (*postHookFunc) (struct quest_db* retVal___, struct config_setting_t *cs, int n, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_read_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_quest_read_db_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cs, &n, source);
+ retVal___ = postHookFunc(retVal___, cs, n, source);
+ }
+ }
+ return retVal___;
+}
+/* rnd_interface */
+void HP_rnd_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rnd_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rnd.init();
+ }
+ if (HPMHooks.count.HP_rnd_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_rnd_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rnd_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rnd.final();
+ }
+ if (HPMHooks.count.HP_rnd_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_rnd_seed(uint32 seed) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_rnd_seed_pre > 0) {
+ void (*preHookFunc) (uint32 *seed);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_seed_pre[hIndex].func;
+ preHookFunc(&seed);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.rnd.seed(seed);
+ }
+ if (HPMHooks.count.HP_rnd_seed_post > 0) {
+ void (*postHookFunc) (uint32 seed);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_seed_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_seed_post[hIndex].func;
+ postHookFunc(seed);
+ }
+ }
+ return;
+}
+int32 HP_rnd_random(void) {
+ int hIndex = 0;
+ int32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_random_pre > 0) {
+ int32 (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_random_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.random();
+ }
+ if (HPMHooks.count.HP_rnd_random_post > 0) {
+ int32 (*postHookFunc) (int32 retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_random_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_random_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+uint32 HP_rnd_roll(uint32 dice_faces) {
+ int hIndex = 0;
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_roll_pre > 0) {
+ uint32 (*preHookFunc) (uint32 *dice_faces);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_roll_pre[hIndex].func;
+ retVal___ = preHookFunc(&dice_faces);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.roll(dice_faces);
+ }
+ if (HPMHooks.count.HP_rnd_roll_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 dice_faces);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_roll_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_roll_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, dice_faces);
+ }
+ }
+ return retVal___;
+}
+int32 HP_rnd_value(int32 min, int32 max) {
+ int hIndex = 0;
+ int32 retVal___ = 0;
+ if (HPMHooks.count.HP_rnd_value_pre > 0) {
+ int32 (*preHookFunc) (int32 *min, int32 *max);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_value_pre[hIndex].func;
+ retVal___ = preHookFunc(&min, &max);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.value(min, max);
+ }
+ if (HPMHooks.count.HP_rnd_value_post > 0) {
+ int32 (*postHookFunc) (int32 retVal___, int32 min, int32 max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_value_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_value_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, min, max);
}
}
return retVal___;
}
-/* script */
+double HP_rnd_uniform(void) {
+ int hIndex = 0;
+ double retVal___ = 0.;
+ if (HPMHooks.count.HP_rnd_uniform_pre > 0) {
+ double (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_uniform_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.uniform();
+ }
+ if (HPMHooks.count.HP_rnd_uniform_post > 0) {
+ double (*postHookFunc) (double retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_uniform_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+double HP_rnd_uniform53(void) {
+ int hIndex = 0;
+ double retVal___ = 0.;
+ if (HPMHooks.count.HP_rnd_uniform53_pre > 0) {
+ double (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_rnd_uniform53_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.rnd.uniform53();
+ }
+ if (HPMHooks.count.HP_rnd_uniform53_post > 0) {
+ double (*postHookFunc) (double retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_rnd_uniform53_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_rnd_uniform53_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+/* script_interface */
void HP_script_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_init_pre ) {
+ if (HPMHooks.count.HP_script_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59381,25 +60810,25 @@ void HP_script_init(bool minimal) {
{
HPMHooks.source.script.init(minimal);
}
- if( HPMHooks.count.HP_script_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_script_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_final_pre ) {
+ if (HPMHooks.count.HP_script_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59407,9 +60836,9 @@ void HP_script_final(void) {
{
HPMHooks.source.script.final();
}
- if( HPMHooks.count.HP_script_final_post ) {
+ if (HPMHooks.count.HP_script_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_final_post[hIndex].func;
postHookFunc();
}
@@ -59419,14 +60848,14 @@ void HP_script_final(void) {
int HP_script_reload(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_reload_pre ) {
+ if (HPMHooks.count.HP_script_reload_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_reload_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59434,9 +60863,9 @@ int HP_script_reload(void) {
{
retVal___ = HPMHooks.source.script.reload();
}
- if( HPMHooks.count.HP_script_reload_post ) {
+ if (HPMHooks.count.HP_script_reload_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_reload_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -59446,14 +60875,14 @@ int HP_script_reload(void) {
struct script_code* HP_script_parse(const char *src, const char *file, int line, int options, int *retval) {
int hIndex = 0;
struct script_code* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_pre ) {
- struct script_code* (*preHookFunc) (const char *src, const char *file, int *line, int *options, int *retval);
+ if (HPMHooks.count.HP_script_parse_pre > 0) {
+ struct script_code* (*preHookFunc) (const char **src, const char **file, int *line, int *options, int **retval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_pre[hIndex].func;
- retVal___ = preHookFunc(src, file, &line, &options, retval);
+ retVal___ = preHookFunc(&src, &file, &line, &options, &retval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59461,11 +60890,11 @@ struct script_code* HP_script_parse(const char *src, const char *file, int line,
{
retVal___ = HPMHooks.source.script.parse(src, file, line, options, retval);
}
- if( HPMHooks.count.HP_script_parse_post ) {
- struct script_code* (*postHookFunc) (struct script_code* retVal___, const char *src, const char *file, int *line, int *options, int *retval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_parse_post > 0) {
+ struct script_code* (*postHookFunc) (struct script_code* retVal___, const char *src, const char *file, int line, int options, int *retval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, file, &line, &options, retval);
+ retVal___ = postHookFunc(retVal___, src, file, line, options, retval);
}
}
return retVal___;
@@ -59473,14 +60902,14 @@ struct script_code* HP_script_parse(const char *src, const char *file, int line,
bool HP_script_add_builtin(const struct script_function *buildin, bool override) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_add_builtin_pre ) {
- bool (*preHookFunc) (const struct script_function *buildin, bool *override);
+ if (HPMHooks.count.HP_script_add_builtin_pre > 0) {
+ bool (*preHookFunc) (const struct script_function **buildin, bool *override);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_builtin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_builtin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_add_builtin_pre[hIndex].func;
- retVal___ = preHookFunc(buildin, &override);
+ retVal___ = preHookFunc(&buildin, &override);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59488,25 +60917,25 @@ bool HP_script_add_builtin(const struct script_function *buildin, bool override)
{
retVal___ = HPMHooks.source.script.add_builtin(buildin, override);
}
- if( HPMHooks.count.HP_script_add_builtin_post ) {
- bool (*postHookFunc) (bool retVal___, const struct script_function *buildin, bool *override);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_builtin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_add_builtin_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const struct script_function *buildin, bool override);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_builtin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_add_builtin_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, buildin, &override);
+ retVal___ = postHookFunc(retVal___, buildin, override);
}
}
return retVal___;
}
void HP_script_parse_builtin(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_parse_builtin_pre ) {
+ if (HPMHooks.count.HP_script_parse_builtin_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_builtin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_builtin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_builtin_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59514,9 +60943,9 @@ void HP_script_parse_builtin(void) {
{
HPMHooks.source.script.parse_builtin();
}
- if( HPMHooks.count.HP_script_parse_builtin_post ) {
+ if (HPMHooks.count.HP_script_parse_builtin_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_builtin_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_builtin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_builtin_post[hIndex].func;
postHookFunc();
}
@@ -59526,14 +60955,14 @@ void HP_script_parse_builtin(void) {
const char* HP_script_parse_subexpr(const char *p, int limit) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_subexpr_pre ) {
- const char* (*preHookFunc) (const char *p, int *limit);
+ if (HPMHooks.count.HP_script_parse_subexpr_pre > 0) {
+ const char* (*preHookFunc) (const char **p, int *limit);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_subexpr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_subexpr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_subexpr_pre[hIndex].func;
- retVal___ = preHookFunc(p, &limit);
+ retVal___ = preHookFunc(&p, &limit);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59541,11 +60970,11 @@ const char* HP_script_parse_subexpr(const char *p, int limit) {
{
retVal___ = HPMHooks.source.script.parse_subexpr(p, limit);
}
- if( HPMHooks.count.HP_script_parse_subexpr_post ) {
- const char* (*postHookFunc) (const char* retVal___, const char *p, int *limit);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_subexpr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_parse_subexpr_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p, int limit);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_subexpr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_subexpr_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &limit);
+ retVal___ = postHookFunc(retVal___, p, limit);
}
}
return retVal___;
@@ -59553,14 +60982,14 @@ const char* HP_script_parse_subexpr(const char *p, int limit) {
const char* HP_script_skip_space(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_skip_space_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_skip_space_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_space_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_space_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_skip_space_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59568,9 +60997,9 @@ const char* HP_script_skip_space(const char *p) {
{
retVal___ = HPMHooks.source.script.skip_space(p);
}
- if( HPMHooks.count.HP_script_skip_space_post ) {
+ if (HPMHooks.count.HP_script_skip_space_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_space_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_space_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_skip_space_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -59579,14 +61008,14 @@ const char* HP_script_skip_space(const char *p) {
}
void HP_script_error(const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_error_pre ) {
- void (*preHookFunc) (const char *src, const char *file, int *start_line, const char *error_msg, const char *error_pos);
+ if (HPMHooks.count.HP_script_error_pre > 0) {
+ void (*preHookFunc) (const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_error_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_error_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_error_pre[hIndex].func;
- preHookFunc(src, file, &start_line, error_msg, error_pos);
+ preHookFunc(&src, &file, &start_line, &error_msg, &error_pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59594,25 +61023,25 @@ void HP_script_error(const char *src, const char *file, int start_line, const ch
{
HPMHooks.source.script.error(src, file, start_line, error_msg, error_pos);
}
- if( HPMHooks.count.HP_script_error_post ) {
- void (*postHookFunc) (const char *src, const char *file, int *start_line, const char *error_msg, const char *error_pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_error_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_error_post > 0) {
+ void (*postHookFunc) (const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_error_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_error_post[hIndex].func;
- postHookFunc(src, file, &start_line, error_msg, error_pos);
+ postHookFunc(src, file, start_line, error_msg, error_pos);
}
}
return;
}
void HP_script_warning(const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_warning_pre ) {
- void (*preHookFunc) (const char *src, const char *file, int *start_line, const char *error_msg, const char *error_pos);
+ if (HPMHooks.count.HP_script_warning_pre > 0) {
+ void (*preHookFunc) (const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_warning_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_warning_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_warning_pre[hIndex].func;
- preHookFunc(src, file, &start_line, error_msg, error_pos);
+ preHookFunc(&src, &file, &start_line, &error_msg, &error_pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59620,11 +61049,11 @@ void HP_script_warning(const char *src, const char *file, int start_line, const
{
HPMHooks.source.script.warning(src, file, start_line, error_msg, error_pos);
}
- if( HPMHooks.count.HP_script_warning_post ) {
- void (*postHookFunc) (const char *src, const char *file, int *start_line, const char *error_msg, const char *error_pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_warning_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_warning_post > 0) {
+ void (*postHookFunc) (const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_warning_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_warning_post[hIndex].func;
- postHookFunc(src, file, &start_line, error_msg, error_pos);
+ postHookFunc(src, file, start_line, error_msg, error_pos);
}
}
return;
@@ -59632,14 +61061,14 @@ void HP_script_warning(const char *src, const char *file, int start_line, const
bool HP_script_addScript(char *name, char *args, bool ( *func ) (struct script_state *st), bool isDeprecated) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_addScript_pre ) {
- bool (*preHookFunc) (char *name, char *args, bool ( *func ) (struct script_state *st), bool *isDeprecated);
+ if (HPMHooks.count.HP_script_addScript_pre > 0) {
+ bool (*preHookFunc) (char **name, char **args, bool ( **func ) (struct script_state *st), bool *isDeprecated);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addScript_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addScript_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_addScript_pre[hIndex].func;
- retVal___ = preHookFunc(name, args, func, &isDeprecated);
+ retVal___ = preHookFunc(&name, &args, &func, &isDeprecated);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59647,11 +61076,11 @@ bool HP_script_addScript(char *name, char *args, bool ( *func ) (struct script_s
{
retVal___ = HPMHooks.source.script.addScript(name, args, func, isDeprecated);
}
- if( HPMHooks.count.HP_script_addScript_post ) {
- bool (*postHookFunc) (bool retVal___, char *name, char *args, bool ( *func ) (struct script_state *st), bool *isDeprecated);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addScript_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_addScript_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *name, char *args, bool ( *func ) (struct script_state *st), bool isDeprecated);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addScript_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_addScript_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, name, args, func, &isDeprecated);
+ retVal___ = postHookFunc(retVal___, name, args, func, isDeprecated);
}
}
return retVal___;
@@ -59659,14 +61088,14 @@ bool HP_script_addScript(char *name, char *args, bool ( *func ) (struct script_s
int HP_script_conv_num(struct script_state *st, struct script_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_conv_num_pre ) {
- int (*preHookFunc) (struct script_state *st, struct script_data *data);
+ if (HPMHooks.count.HP_script_conv_num_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_conv_num_pre[hIndex].func;
- retVal___ = preHookFunc(st, data);
+ retVal___ = preHookFunc(&st, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59674,9 +61103,9 @@ int HP_script_conv_num(struct script_state *st, struct script_data *data) {
{
retVal___ = HPMHooks.source.script.conv_num(st, data);
}
- if( HPMHooks.count.HP_script_conv_num_post ) {
+ if (HPMHooks.count.HP_script_conv_num_post > 0) {
int (*postHookFunc) (int retVal___, struct script_state *st, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_num_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_conv_num_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, data);
}
@@ -59686,14 +61115,14 @@ int HP_script_conv_num(struct script_state *st, struct script_data *data) {
const char* HP_script_conv_str(struct script_state *st, struct script_data *data) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_conv_str_pre ) {
- const char* (*preHookFunc) (struct script_state *st, struct script_data *data);
+ if (HPMHooks.count.HP_script_conv_str_pre > 0) {
+ const char* (*preHookFunc) (struct script_state **st, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_conv_str_pre[hIndex].func;
- retVal___ = preHookFunc(st, data);
+ retVal___ = preHookFunc(&st, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59701,9 +61130,9 @@ const char* HP_script_conv_str(struct script_state *st, struct script_data *data
{
retVal___ = HPMHooks.source.script.conv_str(st, data);
}
- if( HPMHooks.count.HP_script_conv_str_post ) {
+ if (HPMHooks.count.HP_script_conv_str_post > 0) {
const char* (*postHookFunc) (const char* retVal___, struct script_state *st, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_conv_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_conv_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, data);
}
@@ -59713,14 +61142,14 @@ const char* HP_script_conv_str(struct script_state *st, struct script_data *data
struct map_session_data* HP_script_rid2sd(struct script_state *st) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_rid2sd_pre ) {
- struct map_session_data* (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_rid2sd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_rid2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_rid2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_rid2sd_pre[hIndex].func;
- retVal___ = preHookFunc(st);
+ retVal___ = preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59728,9 +61157,9 @@ struct map_session_data* HP_script_rid2sd(struct script_state *st) {
{
retVal___ = HPMHooks.source.script.rid2sd(st);
}
- if( HPMHooks.count.HP_script_rid2sd_post ) {
+ if (HPMHooks.count.HP_script_rid2sd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_rid2sd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_rid2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_rid2sd_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st);
}
@@ -59740,14 +61169,14 @@ struct map_session_data* HP_script_rid2sd(struct script_state *st) {
struct map_session_data* HP_script_id2sd(struct script_state *st, int account_id) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_id2sd_pre ) {
- struct map_session_data* (*preHookFunc) (struct script_state *st, int *account_id);
+ if (HPMHooks.count.HP_script_id2sd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct script_state **st, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_id2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_id2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_id2sd_pre[hIndex].func;
- retVal___ = preHookFunc(st, &account_id);
+ retVal___ = preHookFunc(&st, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59755,11 +61184,11 @@ struct map_session_data* HP_script_id2sd(struct script_state *st, int account_id
{
retVal___ = HPMHooks.source.script.id2sd(st, account_id);
}
- if( HPMHooks.count.HP_script_id2sd_post ) {
- struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_id2sd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_id2sd_post > 0) {
+ struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_id2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_id2sd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, st, &account_id);
+ retVal___ = postHookFunc(retVal___, st, account_id);
}
}
return retVal___;
@@ -59767,14 +61196,14 @@ struct map_session_data* HP_script_id2sd(struct script_state *st, int account_id
struct map_session_data* HP_script_charid2sd(struct script_state *st, int char_id) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_charid2sd_pre ) {
- struct map_session_data* (*preHookFunc) (struct script_state *st, int *char_id);
+ if (HPMHooks.count.HP_script_charid2sd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct script_state **st, int *char_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_charid2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_charid2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_charid2sd_pre[hIndex].func;
- retVal___ = preHookFunc(st, &char_id);
+ retVal___ = preHookFunc(&st, &char_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59782,11 +61211,11 @@ struct map_session_data* HP_script_charid2sd(struct script_state *st, int char_i
{
retVal___ = HPMHooks.source.script.charid2sd(st, char_id);
}
- if( HPMHooks.count.HP_script_charid2sd_post ) {
- struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, int *char_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_charid2sd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_charid2sd_post > 0) {
+ struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, int char_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_charid2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_charid2sd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, st, &char_id);
+ retVal___ = postHookFunc(retVal___, st, char_id);
}
}
return retVal___;
@@ -59794,14 +61223,14 @@ struct map_session_data* HP_script_charid2sd(struct script_state *st, int char_i
struct map_session_data* HP_script_nick2sd(struct script_state *st, const char *name) {
int hIndex = 0;
struct map_session_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_nick2sd_pre ) {
- struct map_session_data* (*preHookFunc) (struct script_state *st, const char *name);
+ if (HPMHooks.count.HP_script_nick2sd_pre > 0) {
+ struct map_session_data* (*preHookFunc) (struct script_state **st, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_nick2sd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_nick2sd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_nick2sd_pre[hIndex].func;
- retVal___ = preHookFunc(st, name);
+ retVal___ = preHookFunc(&st, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59809,9 +61238,9 @@ struct map_session_data* HP_script_nick2sd(struct script_state *st, const char *
{
retVal___ = HPMHooks.source.script.nick2sd(st, name);
}
- if( HPMHooks.count.HP_script_nick2sd_post ) {
+ if (HPMHooks.count.HP_script_nick2sd_post > 0) {
struct map_session_data* (*postHookFunc) (struct map_session_data* retVal___, struct script_state *st, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_nick2sd_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_nick2sd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_nick2sd_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, name);
}
@@ -59820,14 +61249,14 @@ struct map_session_data* HP_script_nick2sd(struct script_state *st, const char *
}
void HP_script_detach_rid(struct script_state *st) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_detach_rid_pre ) {
- void (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_detach_rid_pre > 0) {
+ void (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_rid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_rid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_detach_rid_pre[hIndex].func;
- preHookFunc(st);
+ preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -59835,9 +61264,9 @@ void HP_script_detach_rid(struct script_state *st) {
{
HPMHooks.source.script.detach_rid(st);
}
- if( HPMHooks.count.HP_script_detach_rid_post ) {
+ if (HPMHooks.count.HP_script_detach_rid_post > 0) {
void (*postHookFunc) (struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_rid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_rid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_detach_rid_post[hIndex].func;
postHookFunc(st);
}
@@ -59847,14 +61276,14 @@ void HP_script_detach_rid(struct script_state *st) {
struct script_data* HP_script_push_val(struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref) {
int hIndex = 0;
struct script_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_push_val_pre ) {
- struct script_data* (*preHookFunc) (struct script_stack *stack, enum c_op *type, int64 *val, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_push_val_pre > 0) {
+ struct script_data* (*preHookFunc) (struct script_stack **stack, enum c_op *type, int64 *val, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_val_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_val_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_push_val_pre[hIndex].func;
- retVal___ = preHookFunc(stack, &type, &val, ref);
+ retVal___ = preHookFunc(&stack, &type, &val, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59862,11 +61291,11 @@ struct script_data* HP_script_push_val(struct script_stack *stack, enum c_op typ
{
retVal___ = HPMHooks.source.script.push_val(stack, type, val, ref);
}
- if( HPMHooks.count.HP_script_push_val_post ) {
- struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, enum c_op *type, int64 *val, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_val_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_push_val_post > 0) {
+ struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, enum c_op type, int64 val, struct reg_db *ref);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_val_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_push_val_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, stack, &type, &val, ref);
+ retVal___ = postHookFunc(retVal___, stack, type, val, ref);
}
}
return retVal___;
@@ -59874,14 +61303,14 @@ struct script_data* HP_script_push_val(struct script_stack *stack, enum c_op typ
struct script_data* HP_script_get_val(struct script_state *st, struct script_data *data) {
int hIndex = 0;
struct script_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_val_pre ) {
- struct script_data* (*preHookFunc) (struct script_state *st, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_pre > 0) {
+ struct script_data* (*preHookFunc) (struct script_state **st, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_pre[hIndex].func;
- retVal___ = preHookFunc(st, data);
+ retVal___ = preHookFunc(&st, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59889,9 +61318,9 @@ struct script_data* HP_script_get_val(struct script_state *st, struct script_dat
{
retVal___ = HPMHooks.source.script.get_val(st, data);
}
- if( HPMHooks.count.HP_script_get_val_post ) {
+ if (HPMHooks.count.HP_script_get_val_post > 0) {
struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_state *st, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, data);
}
@@ -59901,14 +61330,14 @@ struct script_data* HP_script_get_val(struct script_state *st, struct script_dat
char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_val_ref_str_pre ) {
- char* (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_ref_str_pre > 0) {
+ char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_ref_str_pre[hIndex].func;
- retVal___ = preHookFunc(st, n, data);
+ retVal___ = preHookFunc(&st, &n, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59916,26 +61345,53 @@ char* HP_script_get_val_ref_str(struct script_state *st, struct reg_db *n, struc
{
retVal___ = HPMHooks.source.script.get_val_ref_str(st, n, data);
}
- if( HPMHooks.count.HP_script_get_val_ref_str_post ) {
+ if (HPMHooks.count.HP_script_get_val_ref_str_post > 0) {
char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_ref_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, n, data);
}
}
return retVal___;
}
+char* HP_script_get_val_pc_ref_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ char* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_get_val_pc_ref_str_pre > 0) {
+ char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_pre[hIndex].func;
+ retVal___ = preHookFunc(&st, &n, &data);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_pc_ref_str(st, n, data);
+ }
+ if (HPMHooks.count.HP_script_get_val_pc_ref_str_post > 0) {
+ char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_str_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_str_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_val_scope_str_pre ) {
- char* (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_scope_str_pre > 0) {
+ char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_scope_str_pre[hIndex].func;
- retVal___ = preHookFunc(st, n, data);
+ retVal___ = preHookFunc(&st, &n, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59943,9 +61399,9 @@ char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, str
{
retVal___ = HPMHooks.source.script.get_val_scope_str(st, n, data);
}
- if( HPMHooks.count.HP_script_get_val_scope_str_post ) {
+ if (HPMHooks.count.HP_script_get_val_scope_str_post > 0) {
char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_scope_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, n, data);
}
@@ -59955,14 +61411,14 @@ char* HP_script_get_val_scope_str(struct script_state *st, struct reg_db *n, str
char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struct script_data *data) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_val_npc_str_pre ) {
- char* (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_npc_str_pre > 0) {
+ char* (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_npc_str_pre[hIndex].func;
- retVal___ = preHookFunc(st, n, data);
+ retVal___ = preHookFunc(&st, &n, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59970,9 +61426,9 @@ char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struc
{
retVal___ = HPMHooks.source.script.get_val_npc_str(st, n, data);
}
- if( HPMHooks.count.HP_script_get_val_npc_str_post ) {
+ if (HPMHooks.count.HP_script_get_val_npc_str_post > 0) {
char* (*postHookFunc) (char* retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_npc_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, n, data);
}
@@ -59982,14 +61438,14 @@ char* HP_script_get_val_npc_str(struct script_state *st, struct reg_db *n, struc
char* HP_script_get_val_instance_str(struct script_state *st, const char *name, struct script_data *data) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_val_instance_str_pre ) {
- char* (*preHookFunc) (struct script_state *st, const char *name, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_instance_str_pre > 0) {
+ char* (*preHookFunc) (struct script_state **st, const char **name, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_instance_str_pre[hIndex].func;
- retVal___ = preHookFunc(st, name, data);
+ retVal___ = preHookFunc(&st, &name, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -59997,9 +61453,9 @@ char* HP_script_get_val_instance_str(struct script_state *st, const char *name,
{
retVal___ = HPMHooks.source.script.get_val_instance_str(st, name, data);
}
- if( HPMHooks.count.HP_script_get_val_instance_str_post ) {
+ if (HPMHooks.count.HP_script_get_val_instance_str_post > 0) {
char* (*postHookFunc) (char* retVal___, struct script_state *st, const char *name, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_instance_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, name, data);
}
@@ -60009,14 +61465,14 @@ char* HP_script_get_val_instance_str(struct script_state *st, const char *name,
int HP_script_get_val_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_get_val_ref_num_pre ) {
- int (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_ref_num_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_ref_num_pre[hIndex].func;
- retVal___ = preHookFunc(st, n, data);
+ retVal___ = preHookFunc(&st, &n, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60024,26 +61480,53 @@ int HP_script_get_val_ref_num(struct script_state *st, struct reg_db *n, struct
{
retVal___ = HPMHooks.source.script.get_val_ref_num(st, n, data);
}
- if( HPMHooks.count.HP_script_get_val_ref_num_post ) {
+ if (HPMHooks.count.HP_script_get_val_ref_num_post > 0) {
int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_num_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_ref_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_ref_num_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, n, data);
}
}
return retVal___;
}
+int HP_script_get_val_pc_ref_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_script_get_val_pc_ref_num_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_num_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_num_pre[hIndex].func;
+ retVal___ = preHookFunc(&st, &n, &data);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.get_val_pc_ref_num(st, n, data);
+ }
+ if (HPMHooks.count.HP_script_get_val_pc_ref_num_post > 0) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_pc_ref_num_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_get_val_pc_ref_num_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st, n, data);
+ }
+ }
+ return retVal___;
+}
int HP_script_get_val_scope_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_get_val_scope_num_pre ) {
- int (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_scope_num_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_scope_num_pre[hIndex].func;
- retVal___ = preHookFunc(st, n, data);
+ retVal___ = preHookFunc(&st, &n, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60051,9 +61534,9 @@ int HP_script_get_val_scope_num(struct script_state *st, struct reg_db *n, struc
{
retVal___ = HPMHooks.source.script.get_val_scope_num(st, n, data);
}
- if( HPMHooks.count.HP_script_get_val_scope_num_post ) {
+ if (HPMHooks.count.HP_script_get_val_scope_num_post > 0) {
int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_num_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_scope_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_scope_num_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, n, data);
}
@@ -60063,14 +61546,14 @@ int HP_script_get_val_scope_num(struct script_state *st, struct reg_db *n, struc
int HP_script_get_val_npc_num(struct script_state *st, struct reg_db *n, struct script_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_get_val_npc_num_pre ) {
- int (*preHookFunc) (struct script_state *st, struct reg_db *n, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_npc_num_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct reg_db **n, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_npc_num_pre[hIndex].func;
- retVal___ = preHookFunc(st, n, data);
+ retVal___ = preHookFunc(&st, &n, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60078,9 +61561,9 @@ int HP_script_get_val_npc_num(struct script_state *st, struct reg_db *n, struct
{
retVal___ = HPMHooks.source.script.get_val_npc_num(st, n, data);
}
- if( HPMHooks.count.HP_script_get_val_npc_num_post ) {
+ if (HPMHooks.count.HP_script_get_val_npc_num_post > 0) {
int (*postHookFunc) (int retVal___, struct script_state *st, struct reg_db *n, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_num_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_npc_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_npc_num_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, n, data);
}
@@ -60090,14 +61573,14 @@ int HP_script_get_val_npc_num(struct script_state *st, struct reg_db *n, struct
int HP_script_get_val_instance_num(struct script_state *st, const char *name, struct script_data *data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_get_val_instance_num_pre ) {
- int (*preHookFunc) (struct script_state *st, const char *name, struct script_data *data);
+ if (HPMHooks.count.HP_script_get_val_instance_num_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, const char **name, struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val_instance_num_pre[hIndex].func;
- retVal___ = preHookFunc(st, name, data);
+ retVal___ = preHookFunc(&st, &name, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60105,26 +61588,26 @@ int HP_script_get_val_instance_num(struct script_state *st, const char *name, st
{
retVal___ = HPMHooks.source.script.get_val_instance_num(st, name, data);
}
- if( HPMHooks.count.HP_script_get_val_instance_num_post ) {
+ if (HPMHooks.count.HP_script_get_val_instance_num_post > 0) {
int (*postHookFunc) (int retVal___, struct script_state *st, const char *name, struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val_instance_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val_instance_num_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, name, data);
}
}
return retVal___;
}
-void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref) {
+const void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref) {
int hIndex = 0;
- void* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_val2_pre ) {
- void* (*preHookFunc) (struct script_state *st, int64 *uid, struct reg_db *ref);
+ const void* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_get_val2_pre > 0) {
+ const void* (*preHookFunc) (struct script_state **st, int64 *uid, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_val2_pre[hIndex].func;
- retVal___ = preHookFunc(st, &uid, ref);
+ retVal___ = preHookFunc(&st, &uid, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60132,38 +61615,65 @@ void* HP_script_get_val2(struct script_state *st, int64 uid, struct reg_db *ref)
{
retVal___ = HPMHooks.source.script.get_val2(st, uid, ref);
}
- if( HPMHooks.count.HP_script_get_val2_post ) {
- void* (*postHookFunc) (void* retVal___, struct script_state *st, int64 *uid, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_get_val2_post > 0) {
+ const void* (*postHookFunc) (const void* retVal___, struct script_state *st, int64 uid, struct reg_db *ref);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_val2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_val2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, st, &uid, ref);
+ retVal___ = postHookFunc(retVal___, st, uid, ref);
}
}
return retVal___;
}
-struct script_data* HP_script_push_str(struct script_stack *stack, enum c_op type, char *str) {
+struct script_data* HP_script_push_str(struct script_stack *stack, char *str) {
int hIndex = 0;
struct script_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_push_str_pre ) {
- struct script_data* (*preHookFunc) (struct script_stack *stack, enum c_op *type, char *str);
+ if (HPMHooks.count.HP_script_push_str_pre > 0) {
+ struct script_data* (*preHookFunc) (struct script_stack **stack, char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_push_str_pre[hIndex].func;
- retVal___ = preHookFunc(stack, &type, str);
+ retVal___ = preHookFunc(&stack, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.script.push_str(stack, type, str);
+ retVal___ = HPMHooks.source.script.push_str(stack, str);
}
- if( HPMHooks.count.HP_script_push_str_post ) {
- struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, enum c_op *type, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_push_str_post > 0) {
+ struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_push_str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, stack, &type, str);
+ retVal___ = postHookFunc(retVal___, stack, str);
+ }
+ }
+ return retVal___;
+}
+struct script_data* HP_script_push_conststr(struct script_stack *stack, const char *str) {
+ int hIndex = 0;
+ struct script_data* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_push_conststr_pre > 0) {
+ struct script_data* (*preHookFunc) (struct script_stack **stack, const char **str);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_conststr_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_push_conststr_pre[hIndex].func;
+ retVal___ = preHookFunc(&stack, &str);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.push_conststr(stack, str);
+ }
+ if (HPMHooks.count.HP_script_push_conststr_post > 0) {
+ struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_conststr_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_push_conststr_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, stack, str);
}
}
return retVal___;
@@ -60171,14 +61681,14 @@ struct script_data* HP_script_push_str(struct script_stack *stack, enum c_op typ
struct script_data* HP_script_push_copy(struct script_stack *stack, int pos) {
int hIndex = 0;
struct script_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_push_copy_pre ) {
- struct script_data* (*preHookFunc) (struct script_stack *stack, int *pos);
+ if (HPMHooks.count.HP_script_push_copy_pre > 0) {
+ struct script_data* (*preHookFunc) (struct script_stack **stack, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_copy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_copy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_push_copy_pre[hIndex].func;
- retVal___ = preHookFunc(stack, &pos);
+ retVal___ = preHookFunc(&stack, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60186,25 +61696,25 @@ struct script_data* HP_script_push_copy(struct script_stack *stack, int pos) {
{
retVal___ = HPMHooks.source.script.push_copy(stack, pos);
}
- if( HPMHooks.count.HP_script_push_copy_post ) {
- struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_copy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_push_copy_post > 0) {
+ struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_copy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_push_copy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, stack, &pos);
+ retVal___ = postHookFunc(retVal___, stack, pos);
}
}
return retVal___;
}
void HP_script_pop_stack(struct script_state *st, int start, int end) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_pop_stack_pre ) {
- void (*preHookFunc) (struct script_state *st, int *start, int *end);
+ if (HPMHooks.count.HP_script_pop_stack_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int *start, int *end);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_pop_stack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_pop_stack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_pop_stack_pre[hIndex].func;
- preHookFunc(st, &start, &end);
+ preHookFunc(&st, &start, &end);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60212,25 +61722,25 @@ void HP_script_pop_stack(struct script_state *st, int start, int end) {
{
HPMHooks.source.script.pop_stack(st, start, end);
}
- if( HPMHooks.count.HP_script_pop_stack_post ) {
- void (*postHookFunc) (struct script_state *st, int *start, int *end);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_pop_stack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_pop_stack_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int start, int end);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_pop_stack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_pop_stack_post[hIndex].func;
- postHookFunc(st, &start, &end);
+ postHookFunc(st, start, end);
}
}
return;
}
void HP_script_set_constant(const char *name, int value, bool is_parameter, bool is_deprecated) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_constant_pre ) {
- void (*preHookFunc) (const char *name, int *value, bool *is_parameter, bool *is_deprecated);
+ if (HPMHooks.count.HP_script_set_constant_pre > 0) {
+ void (*preHookFunc) (const char **name, int *value, bool *is_parameter, bool *is_deprecated);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_constant_pre[hIndex].func;
- preHookFunc(name, &value, &is_parameter, &is_deprecated);
+ preHookFunc(&name, &value, &is_parameter, &is_deprecated);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60238,25 +61748,25 @@ void HP_script_set_constant(const char *name, int value, bool is_parameter, bool
{
HPMHooks.source.script.set_constant(name, value, is_parameter, is_deprecated);
}
- if( HPMHooks.count.HP_script_set_constant_post ) {
- void (*postHookFunc) (const char *name, int *value, bool *is_parameter, bool *is_deprecated);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_constant_post > 0) {
+ void (*postHookFunc) (const char *name, int value, bool is_parameter, bool is_deprecated);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_constant_post[hIndex].func;
- postHookFunc(name, &value, &is_parameter, &is_deprecated);
+ postHookFunc(name, value, is_parameter, is_deprecated);
}
}
return;
}
void HP_script_set_constant2(const char *name, int value, bool is_parameter, bool is_deprecated) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_constant2_pre ) {
- void (*preHookFunc) (const char *name, int *value, bool *is_parameter, bool *is_deprecated);
+ if (HPMHooks.count.HP_script_set_constant2_pre > 0) {
+ void (*preHookFunc) (const char **name, int *value, bool *is_parameter, bool *is_deprecated);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_constant2_pre[hIndex].func;
- preHookFunc(name, &value, &is_parameter, &is_deprecated);
+ preHookFunc(&name, &value, &is_parameter, &is_deprecated);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60264,11 +61774,11 @@ void HP_script_set_constant2(const char *name, int value, bool is_parameter, boo
{
HPMHooks.source.script.set_constant2(name, value, is_parameter, is_deprecated);
}
- if( HPMHooks.count.HP_script_set_constant2_post ) {
- void (*postHookFunc) (const char *name, int *value, bool *is_parameter, bool *is_deprecated);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_constant2_post > 0) {
+ void (*postHookFunc) (const char *name, int value, bool is_parameter, bool is_deprecated);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_constant2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_constant2_post[hIndex].func;
- postHookFunc(name, &value, &is_parameter, &is_deprecated);
+ postHookFunc(name, value, is_parameter, is_deprecated);
}
}
return;
@@ -60276,14 +61786,14 @@ void HP_script_set_constant2(const char *name, int value, bool is_parameter, boo
bool HP_script_get_constant(const char *name, int *value) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_get_constant_pre ) {
- bool (*preHookFunc) (const char *name, int *value);
+ if (HPMHooks.count.HP_script_get_constant_pre > 0) {
+ bool (*preHookFunc) (const char **name, int **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_constant_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_constant_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_constant_pre[hIndex].func;
- retVal___ = preHookFunc(name, value);
+ retVal___ = preHookFunc(&name, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60291,9 +61801,9 @@ bool HP_script_get_constant(const char *name, int *value) {
{
retVal___ = HPMHooks.source.script.get_constant(name, value);
}
- if( HPMHooks.count.HP_script_get_constant_post ) {
+ if (HPMHooks.count.HP_script_get_constant_post > 0) {
bool (*postHookFunc) (bool retVal___, const char *name, int *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_constant_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_constant_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_constant_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name, value);
}
@@ -60302,14 +61812,14 @@ bool HP_script_get_constant(const char *name, int *value) {
}
void HP_script_label_add(int key, int pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_label_add_pre ) {
+ if (HPMHooks.count.HP_script_label_add_pre > 0) {
void (*preHookFunc) (int *key, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_label_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_label_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_label_add_pre[hIndex].func;
preHookFunc(&key, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60317,25 +61827,25 @@ void HP_script_label_add(int key, int pos) {
{
HPMHooks.source.script.label_add(key, pos);
}
- if( HPMHooks.count.HP_script_label_add_post ) {
- void (*postHookFunc) (int *key, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_label_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_label_add_post > 0) {
+ void (*postHookFunc) (int key, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_label_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_label_add_post[hIndex].func;
- postHookFunc(&key, &pos);
+ postHookFunc(key, pos);
}
}
return;
}
void HP_script_run(struct script_code *rootscript, int pos, int rid, int oid) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_pre ) {
- void (*preHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
+ if (HPMHooks.count.HP_script_run_pre > 0) {
+ void (*preHookFunc) (struct script_code **rootscript, int *pos, int *rid, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_pre[hIndex].func;
- preHookFunc(rootscript, &pos, &rid, &oid);
+ preHookFunc(&rootscript, &pos, &rid, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60343,25 +61853,25 @@ void HP_script_run(struct script_code *rootscript, int pos, int rid, int oid) {
{
HPMHooks.source.script.run(rootscript, pos, rid, oid);
}
- if( HPMHooks.count.HP_script_run_post ) {
- void (*postHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_post > 0) {
+ void (*postHookFunc) (struct script_code *rootscript, int pos, int rid, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_post[hIndex].func;
- postHookFunc(rootscript, &pos, &rid, &oid);
+ postHookFunc(rootscript, pos, rid, oid);
}
}
return;
}
void HP_script_run_npc(struct script_code *rootscript, int pos, int rid, int oid) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_npc_pre ) {
- void (*preHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
+ if (HPMHooks.count.HP_script_run_npc_pre > 0) {
+ void (*preHookFunc) (struct script_code **rootscript, int *pos, int *rid, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_npc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_npc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_npc_pre[hIndex].func;
- preHookFunc(rootscript, &pos, &rid, &oid);
+ preHookFunc(&rootscript, &pos, &rid, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60369,25 +61879,25 @@ void HP_script_run_npc(struct script_code *rootscript, int pos, int rid, int oid
{
HPMHooks.source.script.run_npc(rootscript, pos, rid, oid);
}
- if( HPMHooks.count.HP_script_run_npc_post ) {
- void (*postHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_npc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_npc_post > 0) {
+ void (*postHookFunc) (struct script_code *rootscript, int pos, int rid, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_npc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_npc_post[hIndex].func;
- postHookFunc(rootscript, &pos, &rid, &oid);
+ postHookFunc(rootscript, pos, rid, oid);
}
}
return;
}
void HP_script_run_pet(struct script_code *rootscript, int pos, int rid, int oid) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_pet_pre ) {
- void (*preHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
+ if (HPMHooks.count.HP_script_run_pet_pre > 0) {
+ void (*preHookFunc) (struct script_code **rootscript, int *pos, int *rid, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pet_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pet_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_pet_pre[hIndex].func;
- preHookFunc(rootscript, &pos, &rid, &oid);
+ preHookFunc(&rootscript, &pos, &rid, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60395,25 +61905,25 @@ void HP_script_run_pet(struct script_code *rootscript, int pos, int rid, int oid
{
HPMHooks.source.script.run_pet(rootscript, pos, rid, oid);
}
- if( HPMHooks.count.HP_script_run_pet_post ) {
- void (*postHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pet_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_pet_post > 0) {
+ void (*postHookFunc) (struct script_code *rootscript, int pos, int rid, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_pet_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_pet_post[hIndex].func;
- postHookFunc(rootscript, &pos, &rid, &oid);
+ postHookFunc(rootscript, pos, rid, oid);
}
}
return;
}
void HP_script_run_main(struct script_state *st) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_main_pre ) {
- void (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_run_main_pre > 0) {
+ void (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_main_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_main_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_main_pre[hIndex].func;
- preHookFunc(st);
+ preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60421,9 +61931,9 @@ void HP_script_run_main(struct script_state *st) {
{
HPMHooks.source.script.run_main(st);
}
- if( HPMHooks.count.HP_script_run_main_post ) {
+ if (HPMHooks.count.HP_script_run_main_post > 0) {
void (*postHookFunc) (struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_main_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_main_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_main_post[hIndex].func;
postHookFunc(st);
}
@@ -60433,14 +61943,14 @@ void HP_script_run_main(struct script_state *st) {
int HP_script_run_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_run_timer_pre ) {
+ if (HPMHooks.count.HP_script_run_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60448,11 +61958,11 @@ int HP_script_run_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.script.run_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_script_run_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -60460,14 +61970,14 @@ int HP_script_run_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_script_set_var(struct map_session_data *sd, char *name, void *val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_set_var_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, char *name, void *val);
+ if (HPMHooks.count.HP_script_set_var_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, char **name, void **val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_var_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_var_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_var_pre[hIndex].func;
- retVal___ = preHookFunc(sd, name, val);
+ retVal___ = preHookFunc(&sd, &name, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60475,9 +61985,9 @@ int HP_script_set_var(struct map_session_data *sd, char *name, void *val) {
{
retVal___ = HPMHooks.source.script.set_var(sd, name, val);
}
- if( HPMHooks.count.HP_script_set_var_post ) {
+ if (HPMHooks.count.HP_script_set_var_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, char *name, void *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_var_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_var_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_var_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, name, val);
}
@@ -60486,14 +61996,14 @@ int HP_script_set_var(struct map_session_data *sd, char *name, void *val) {
}
void HP_script_stop_instances(struct script_code *code) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_stop_instances_pre ) {
- void (*preHookFunc) (struct script_code *code);
+ if (HPMHooks.count.HP_script_stop_instances_pre > 0) {
+ void (*preHookFunc) (struct script_code **code);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_stop_instances_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_stop_instances_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_stop_instances_pre[hIndex].func;
- preHookFunc(code);
+ preHookFunc(&code);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60501,9 +62011,9 @@ void HP_script_stop_instances(struct script_code *code) {
{
HPMHooks.source.script.stop_instances(code);
}
- if( HPMHooks.count.HP_script_stop_instances_post ) {
+ if (HPMHooks.count.HP_script_stop_instances_post > 0) {
void (*postHookFunc) (struct script_code *code);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_stop_instances_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_stop_instances_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_stop_instances_post[hIndex].func;
postHookFunc(code);
}
@@ -60512,14 +62022,14 @@ void HP_script_stop_instances(struct script_code *code) {
}
void HP_script_free_code(struct script_code *code) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_free_code_pre ) {
- void (*preHookFunc) (struct script_code *code);
+ if (HPMHooks.count.HP_script_free_code_pre > 0) {
+ void (*preHookFunc) (struct script_code **code);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_free_code_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_free_code_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_free_code_pre[hIndex].func;
- preHookFunc(code);
+ preHookFunc(&code);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60527,9 +62037,9 @@ void HP_script_free_code(struct script_code *code) {
{
HPMHooks.source.script.free_code(code);
}
- if( HPMHooks.count.HP_script_free_code_post ) {
+ if (HPMHooks.count.HP_script_free_code_post > 0) {
void (*postHookFunc) (struct script_code *code);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_free_code_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_free_code_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_free_code_post[hIndex].func;
postHookFunc(code);
}
@@ -60538,14 +62048,14 @@ void HP_script_free_code(struct script_code *code) {
}
void HP_script_free_vars(struct DBMap *var_storage) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_free_vars_pre ) {
- void (*preHookFunc) (struct DBMap *var_storage);
+ if (HPMHooks.count.HP_script_free_vars_pre > 0) {
+ void (*preHookFunc) (struct DBMap **var_storage);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_free_vars_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_free_vars_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_free_vars_pre[hIndex].func;
- preHookFunc(var_storage);
+ preHookFunc(&var_storage);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60553,9 +62063,9 @@ void HP_script_free_vars(struct DBMap *var_storage) {
{
HPMHooks.source.script.free_vars(var_storage);
}
- if( HPMHooks.count.HP_script_free_vars_post ) {
+ if (HPMHooks.count.HP_script_free_vars_post > 0) {
void (*postHookFunc) (struct DBMap *var_storage);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_free_vars_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_free_vars_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_free_vars_post[hIndex].func;
postHookFunc(var_storage);
}
@@ -60565,14 +62075,14 @@ void HP_script_free_vars(struct DBMap *var_storage) {
struct script_state* HP_script_alloc_state(struct script_code *rootscript, int pos, int rid, int oid) {
int hIndex = 0;
struct script_state* retVal___ = NULL;
- if( HPMHooks.count.HP_script_alloc_state_pre ) {
- struct script_state* (*preHookFunc) (struct script_code *rootscript, int *pos, int *rid, int *oid);
+ if (HPMHooks.count.HP_script_alloc_state_pre > 0) {
+ struct script_state* (*preHookFunc) (struct script_code **rootscript, int *pos, int *rid, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_alloc_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_alloc_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_alloc_state_pre[hIndex].func;
- retVal___ = preHookFunc(rootscript, &pos, &rid, &oid);
+ retVal___ = preHookFunc(&rootscript, &pos, &rid, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60580,25 +62090,25 @@ struct script_state* HP_script_alloc_state(struct script_code *rootscript, int p
{
retVal___ = HPMHooks.source.script.alloc_state(rootscript, pos, rid, oid);
}
- if( HPMHooks.count.HP_script_alloc_state_post ) {
- struct script_state* (*postHookFunc) (struct script_state* retVal___, struct script_code *rootscript, int *pos, int *rid, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_alloc_state_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_alloc_state_post > 0) {
+ struct script_state* (*postHookFunc) (struct script_state* retVal___, struct script_code *rootscript, int pos, int rid, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_alloc_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_alloc_state_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, rootscript, &pos, &rid, &oid);
+ retVal___ = postHookFunc(retVal___, rootscript, pos, rid, oid);
}
}
return retVal___;
}
void HP_script_free_state(struct script_state *st) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_free_state_pre ) {
- void (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_free_state_pre > 0) {
+ void (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_free_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_free_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_free_state_pre[hIndex].func;
- preHookFunc(st);
+ preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60606,9 +62116,9 @@ void HP_script_free_state(struct script_state *st) {
{
HPMHooks.source.script.free_state(st);
}
- if( HPMHooks.count.HP_script_free_state_post ) {
+ if (HPMHooks.count.HP_script_free_state_post > 0) {
void (*postHookFunc) (struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_free_state_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_free_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_free_state_post[hIndex].func;
postHookFunc(st);
}
@@ -60617,14 +62127,14 @@ void HP_script_free_state(struct script_state *st) {
}
void HP_script_add_pending_ref(struct script_state *st, struct reg_db *ref) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_add_pending_ref_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_add_pending_ref_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_add_pending_ref_pre[hIndex].func;
- preHookFunc(st, ref);
+ preHookFunc(&st, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60632,9 +62142,9 @@ void HP_script_add_pending_ref(struct script_state *st, struct reg_db *ref) {
{
HPMHooks.source.script.add_pending_ref(st, ref);
}
- if( HPMHooks.count.HP_script_add_pending_ref_post ) {
+ if (HPMHooks.count.HP_script_add_pending_ref_post > 0) {
void (*postHookFunc) (struct script_state *st, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_add_pending_ref_post[hIndex].func;
postHookFunc(st, ref);
}
@@ -60643,14 +62153,14 @@ void HP_script_add_pending_ref(struct script_state *st, struct reg_db *ref) {
}
void HP_script_run_autobonus(const char *autobonus, int id, int pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_autobonus_pre ) {
- void (*preHookFunc) (const char *autobonus, int *id, int *pos);
+ if (HPMHooks.count.HP_script_run_autobonus_pre > 0) {
+ void (*preHookFunc) (const char **autobonus, int *id, int *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_autobonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_autobonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_autobonus_pre[hIndex].func;
- preHookFunc(autobonus, &id, &pos);
+ preHookFunc(&autobonus, &id, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60658,25 +62168,25 @@ void HP_script_run_autobonus(const char *autobonus, int id, int pos) {
{
HPMHooks.source.script.run_autobonus(autobonus, id, pos);
}
- if( HPMHooks.count.HP_script_run_autobonus_post ) {
- void (*postHookFunc) (const char *autobonus, int *id, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_autobonus_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_autobonus_post > 0) {
+ void (*postHookFunc) (const char *autobonus, int id, int pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_autobonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_autobonus_post[hIndex].func;
- postHookFunc(autobonus, &id, &pos);
+ postHookFunc(autobonus, id, pos);
}
}
return;
}
void HP_script_cleararray_pc(struct map_session_data *sd, const char *varname, void *value) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_cleararray_pc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *varname, void *value);
+ if (HPMHooks.count.HP_script_cleararray_pc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **varname, void **value);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_cleararray_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_cleararray_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_cleararray_pc_pre[hIndex].func;
- preHookFunc(sd, varname, value);
+ preHookFunc(&sd, &varname, &value);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60684,9 +62194,9 @@ void HP_script_cleararray_pc(struct map_session_data *sd, const char *varname, v
{
HPMHooks.source.script.cleararray_pc(sd, varname, value);
}
- if( HPMHooks.count.HP_script_cleararray_pc_post ) {
+ if (HPMHooks.count.HP_script_cleararray_pc_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, const char *varname, void *value);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_cleararray_pc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_cleararray_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_cleararray_pc_post[hIndex].func;
postHookFunc(sd, varname, value);
}
@@ -60695,14 +62205,14 @@ void HP_script_cleararray_pc(struct map_session_data *sd, const char *varname, v
}
void HP_script_setarray_pc(struct map_session_data *sd, const char *varname, uint32 idx, void *value, int *refcache) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_setarray_pc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *varname, uint32 *idx, void *value, int *refcache);
+ if (HPMHooks.count.HP_script_setarray_pc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **varname, uint32 *idx, void **value, int **refcache);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_setarray_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_setarray_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_setarray_pc_pre[hIndex].func;
- preHookFunc(sd, varname, &idx, value, refcache);
+ preHookFunc(&sd, &varname, &idx, &value, &refcache);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60710,38 +62220,38 @@ void HP_script_setarray_pc(struct map_session_data *sd, const char *varname, uin
{
HPMHooks.source.script.setarray_pc(sd, varname, idx, value, refcache);
}
- if( HPMHooks.count.HP_script_setarray_pc_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *varname, uint32 *idx, void *value, int *refcache);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_setarray_pc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_setarray_pc_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *varname, uint32 idx, void *value, int *refcache);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_setarray_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_setarray_pc_post[hIndex].func;
- postHookFunc(sd, varname, &idx, value, refcache);
+ postHookFunc(sd, varname, idx, value, refcache);
}
}
return;
}
-int HP_script_config_read(char *cfgName) {
+bool HP_script_config_read(const char *filename, bool imported) {
int hIndex = 0;
- int retVal___ = 0;
- if( HPMHooks.count.HP_script_config_read_pre ) {
- int (*preHookFunc) (char *cfgName);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_script_config_read_pre > 0) {
+ bool (*preHookFunc) (const char **filename, bool *imported);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_config_read_pre[hIndex].func;
- retVal___ = preHookFunc(cfgName);
+ retVal___ = preHookFunc(&filename, &imported);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.script.config_read(cfgName);
+ retVal___ = HPMHooks.source.script.config_read(filename, imported);
}
- if( HPMHooks.count.HP_script_config_read_post ) {
- int (*postHookFunc) (int retVal___, char *cfgName);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_config_read_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_config_read_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename, bool imported);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_config_read_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, cfgName);
+ retVal___ = postHookFunc(retVal___, filename, imported);
}
}
return retVal___;
@@ -60749,14 +62259,14 @@ int HP_script_config_read(char *cfgName) {
int HP_script_add_str(const char *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_add_str_pre ) {
- int (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_add_str_pre > 0) {
+ int (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_add_str_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60764,9 +62274,9 @@ int HP_script_add_str(const char *p) {
{
retVal___ = HPMHooks.source.script.add_str(p);
}
- if( HPMHooks.count.HP_script_add_str_post ) {
+ if (HPMHooks.count.HP_script_add_str_post > 0) {
int (*postHookFunc) (int retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_add_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -60776,14 +62286,14 @@ int HP_script_add_str(const char *p) {
const char* HP_script_get_str(int id) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_str_pre ) {
+ if (HPMHooks.count.HP_script_get_str_pre > 0) {
const char* (*preHookFunc) (int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_str_pre[hIndex].func;
retVal___ = preHookFunc(&id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60791,11 +62301,11 @@ const char* HP_script_get_str(int id) {
{
retVal___ = HPMHooks.source.script.get_str(id);
}
- if( HPMHooks.count.HP_script_get_str_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_get_str_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &id);
+ retVal___ = postHookFunc(retVal___, id);
}
}
return retVal___;
@@ -60803,14 +62313,14 @@ const char* HP_script_get_str(int id) {
int HP_script_search_str(const char *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_search_str_pre ) {
- int (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_search_str_pre > 0) {
+ int (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_search_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_search_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_search_str_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60818,25 +62328,25 @@ int HP_script_search_str(const char *p) {
{
retVal___ = HPMHooks.source.script.search_str(p);
}
- if( HPMHooks.count.HP_script_search_str_post ) {
+ if (HPMHooks.count.HP_script_search_str_post > 0) {
int (*postHookFunc) (int retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_search_str_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_search_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_search_str_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
}
return retVal___;
}
-void HP_script_setd_sub(struct script_state *st, struct map_session_data *sd, const char *varname, int elem, void *value, struct reg_db *ref) {
+void HP_script_setd_sub(struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_setd_sub_pre ) {
- void (*preHookFunc) (struct script_state *st, struct map_session_data *sd, const char *varname, int *elem, void *value, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_setd_sub_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct map_session_data **sd, const char **varname, int *elem, const void **value, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_setd_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_setd_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_setd_sub_pre[hIndex].func;
- preHookFunc(st, sd, varname, &elem, value, ref);
+ preHookFunc(&st, &sd, &varname, &elem, &value, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60844,25 +62354,25 @@ void HP_script_setd_sub(struct script_state *st, struct map_session_data *sd, co
{
HPMHooks.source.script.setd_sub(st, sd, varname, elem, value, ref);
}
- if( HPMHooks.count.HP_script_setd_sub_post ) {
- void (*postHookFunc) (struct script_state *st, struct map_session_data *sd, const char *varname, int *elem, void *value, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_setd_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_setd_sub_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct map_session_data *sd, const char *varname, int elem, const void *value, struct reg_db *ref);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_setd_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_setd_sub_post[hIndex].func;
- postHookFunc(st, sd, varname, &elem, value, ref);
+ postHookFunc(st, sd, varname, elem, value, ref);
}
}
return;
}
void HP_script_attach_state(struct script_state *st) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_attach_state_pre ) {
- void (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_attach_state_pre > 0) {
+ void (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_attach_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_attach_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_attach_state_pre[hIndex].func;
- preHookFunc(st);
+ preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -60870,9 +62380,9 @@ void HP_script_attach_state(struct script_state *st) {
{
HPMHooks.source.script.attach_state(st);
}
- if( HPMHooks.count.HP_script_attach_state_post ) {
+ if (HPMHooks.count.HP_script_attach_state_post > 0) {
void (*postHookFunc) (struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_attach_state_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_attach_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_attach_state_post[hIndex].func;
postHookFunc(st);
}
@@ -60882,14 +62392,14 @@ void HP_script_attach_state(struct script_state *st) {
struct script_queue* HP_script_queue(int idx) {
int hIndex = 0;
struct script_queue* retVal___ = NULL;
- if( HPMHooks.count.HP_script_queue_pre ) {
+ if (HPMHooks.count.HP_script_queue_pre > 0) {
struct script_queue* (*preHookFunc) (int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_queue_pre[hIndex].func;
retVal___ = preHookFunc(&idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60897,11 +62407,11 @@ struct script_queue* HP_script_queue(int idx) {
{
retVal___ = HPMHooks.source.script.queue(idx);
}
- if( HPMHooks.count.HP_script_queue_post ) {
- struct script_queue* (*postHookFunc) (struct script_queue* retVal___, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_queue_post > 0) {
+ struct script_queue* (*postHookFunc) (struct script_queue* retVal___, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_queue_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &idx);
+ retVal___ = postHookFunc(retVal___, idx);
}
}
return retVal___;
@@ -60909,14 +62419,14 @@ struct script_queue* HP_script_queue(int idx) {
bool HP_script_queue_add(int idx, int var) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_queue_add_pre ) {
+ if (HPMHooks.count.HP_script_queue_add_pre > 0) {
bool (*preHookFunc) (int *idx, int *var);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_queue_add_pre[hIndex].func;
retVal___ = preHookFunc(&idx, &var);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60924,11 +62434,11 @@ bool HP_script_queue_add(int idx, int var) {
{
retVal___ = HPMHooks.source.script.queue_add(idx, var);
}
- if( HPMHooks.count.HP_script_queue_add_post ) {
- bool (*postHookFunc) (bool retVal___, int *idx, int *var);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_queue_add_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int idx, int var);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_queue_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &idx, &var);
+ retVal___ = postHookFunc(retVal___, idx, var);
}
}
return retVal___;
@@ -60936,14 +62446,14 @@ bool HP_script_queue_add(int idx, int var) {
bool HP_script_queue_del(int idx) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_queue_del_pre ) {
+ if (HPMHooks.count.HP_script_queue_del_pre > 0) {
bool (*preHookFunc) (int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_del_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_del_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_queue_del_pre[hIndex].func;
retVal___ = preHookFunc(&idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60951,11 +62461,11 @@ bool HP_script_queue_del(int idx) {
{
retVal___ = HPMHooks.source.script.queue_del(idx);
}
- if( HPMHooks.count.HP_script_queue_del_post ) {
- bool (*postHookFunc) (bool retVal___, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_del_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_queue_del_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_del_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_queue_del_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &idx);
+ retVal___ = postHookFunc(retVal___, idx);
}
}
return retVal___;
@@ -60963,14 +62473,14 @@ bool HP_script_queue_del(int idx) {
bool HP_script_queue_remove(int idx, int var) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_queue_remove_pre ) {
+ if (HPMHooks.count.HP_script_queue_remove_pre > 0) {
bool (*preHookFunc) (int *idx, int *var);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_queue_remove_pre[hIndex].func;
retVal___ = preHookFunc(&idx, &var);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -60978,11 +62488,11 @@ bool HP_script_queue_remove(int idx, int var) {
{
retVal___ = HPMHooks.source.script.queue_remove(idx, var);
}
- if( HPMHooks.count.HP_script_queue_remove_post ) {
- bool (*postHookFunc) (bool retVal___, int *idx, int *var);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_remove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_queue_remove_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int idx, int var);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_queue_remove_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &idx, &var);
+ retVal___ = postHookFunc(retVal___, idx, var);
}
}
return retVal___;
@@ -60990,14 +62500,14 @@ bool HP_script_queue_remove(int idx, int var) {
int HP_script_queue_create(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_queue_create_pre ) {
+ if (HPMHooks.count.HP_script_queue_create_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_queue_create_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61005,9 +62515,9 @@ int HP_script_queue_create(void) {
{
retVal___ = HPMHooks.source.script.queue_create();
}
- if( HPMHooks.count.HP_script_queue_create_post ) {
+ if (HPMHooks.count.HP_script_queue_create_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_create_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_queue_create_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -61017,14 +62527,14 @@ int HP_script_queue_create(void) {
bool HP_script_queue_clear(int idx) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_queue_clear_pre ) {
+ if (HPMHooks.count.HP_script_queue_clear_pre > 0) {
bool (*preHookFunc) (int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_queue_clear_pre[hIndex].func;
retVal___ = preHookFunc(&idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61032,11 +62542,11 @@ bool HP_script_queue_clear(int idx) {
{
retVal___ = HPMHooks.source.script.queue_clear(idx);
}
- if( HPMHooks.count.HP_script_queue_clear_post ) {
- bool (*postHookFunc) (bool retVal___, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_clear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_queue_clear_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_queue_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_queue_clear_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &idx);
+ retVal___ = postHookFunc(retVal___, idx);
}
}
return retVal___;
@@ -61044,14 +62554,14 @@ bool HP_script_queue_clear(int idx) {
const char* HP_script_parse_curly_close(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_curly_close_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_curly_close_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_curly_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_curly_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_curly_close_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61059,9 +62569,9 @@ const char* HP_script_parse_curly_close(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_curly_close(p);
}
- if( HPMHooks.count.HP_script_parse_curly_close_post ) {
+ if (HPMHooks.count.HP_script_parse_curly_close_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_curly_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_curly_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_curly_close_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61071,14 +62581,14 @@ const char* HP_script_parse_curly_close(const char *p) {
const char* HP_script_parse_syntax_close(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_syntax_close_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_syntax_close_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_syntax_close_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61086,9 +62596,9 @@ const char* HP_script_parse_syntax_close(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_syntax_close(p);
}
- if( HPMHooks.count.HP_script_parse_syntax_close_post ) {
+ if (HPMHooks.count.HP_script_parse_syntax_close_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_syntax_close_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61098,14 +62608,14 @@ const char* HP_script_parse_syntax_close(const char *p) {
const char* HP_script_parse_syntax_close_sub(const char *p, int *flag) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_syntax_close_sub_pre ) {
- const char* (*preHookFunc) (const char *p, int *flag);
+ if (HPMHooks.count.HP_script_parse_syntax_close_sub_pre > 0) {
+ const char* (*preHookFunc) (const char **p, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_syntax_close_sub_pre[hIndex].func;
- retVal___ = preHookFunc(p, flag);
+ retVal___ = preHookFunc(&p, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61113,9 +62623,9 @@ const char* HP_script_parse_syntax_close_sub(const char *p, int *flag) {
{
retVal___ = HPMHooks.source.script.parse_syntax_close_sub(p, flag);
}
- if( HPMHooks.count.HP_script_parse_syntax_close_sub_post ) {
+ if (HPMHooks.count.HP_script_parse_syntax_close_sub_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_close_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_syntax_close_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p, flag);
}
@@ -61125,14 +62635,14 @@ const char* HP_script_parse_syntax_close_sub(const char *p, int *flag) {
const char* HP_script_parse_syntax(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_syntax_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_syntax_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_syntax_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61140,26 +62650,26 @@ const char* HP_script_parse_syntax(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_syntax(p);
}
- if( HPMHooks.count.HP_script_parse_syntax_post ) {
+ if (HPMHooks.count.HP_script_parse_syntax_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_syntax_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
}
return retVal___;
}
-c_op HP_script_get_com(unsigned char *scriptbuf, int *pos) {
+c_op HP_script_get_com(const struct script_buf *scriptbuf, int *pos) {
int hIndex = 0;
c_op retVal___ = C_NOP;
- if( HPMHooks.count.HP_script_get_com_pre ) {
- c_op (*preHookFunc) (unsigned char *scriptbuf, int *pos);
+ if (HPMHooks.count.HP_script_get_com_pre > 0) {
+ c_op (*preHookFunc) (const struct script_buf **scriptbuf, int **pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_com_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_com_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_com_pre[hIndex].func;
- retVal___ = preHookFunc(scriptbuf, pos);
+ retVal___ = preHookFunc(&scriptbuf, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61167,26 +62677,26 @@ c_op HP_script_get_com(unsigned char *scriptbuf, int *pos) {
{
retVal___ = HPMHooks.source.script.get_com(scriptbuf, pos);
}
- if( HPMHooks.count.HP_script_get_com_post ) {
- c_op (*postHookFunc) (c_op retVal___, unsigned char *scriptbuf, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_com_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_get_com_post > 0) {
+ c_op (*postHookFunc) (c_op retVal___, const struct script_buf *scriptbuf, int *pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_com_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_com_post[hIndex].func;
retVal___ = postHookFunc(retVal___, scriptbuf, pos);
}
}
return retVal___;
}
-int HP_script_get_num(unsigned char *scriptbuf, int *pos) {
+int HP_script_get_num(const struct script_buf *scriptbuf, int *pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_get_num_pre ) {
- int (*preHookFunc) (unsigned char *scriptbuf, int *pos);
+ if (HPMHooks.count.HP_script_get_num_pre > 0) {
+ int (*preHookFunc) (const struct script_buf **scriptbuf, int **pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_num_pre[hIndex].func;
- retVal___ = preHookFunc(scriptbuf, pos);
+ retVal___ = preHookFunc(&scriptbuf, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61194,9 +62704,9 @@ int HP_script_get_num(unsigned char *scriptbuf, int *pos) {
{
retVal___ = HPMHooks.source.script.get_num(scriptbuf, pos);
}
- if( HPMHooks.count.HP_script_get_num_post ) {
- int (*postHookFunc) (int retVal___, unsigned char *scriptbuf, int *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_get_num_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct script_buf *scriptbuf, int *pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_num_post[hIndex].func;
retVal___ = postHookFunc(retVal___, scriptbuf, pos);
}
@@ -61206,14 +62716,14 @@ int HP_script_get_num(unsigned char *scriptbuf, int *pos) {
const char* HP_script_op2name(int op) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_op2name_pre ) {
+ if (HPMHooks.count.HP_script_op2name_pre > 0) {
const char* (*preHookFunc) (int *op);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op2name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op2name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_op2name_pre[hIndex].func;
retVal___ = preHookFunc(&op);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61221,25 +62731,25 @@ const char* HP_script_op2name(int op) {
{
retVal___ = HPMHooks.source.script.op2name(op);
}
- if( HPMHooks.count.HP_script_op2name_post ) {
- const char* (*postHookFunc) (const char* retVal___, int *op);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op2name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_op2name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, int op);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op2name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_op2name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &op);
+ retVal___ = postHookFunc(retVal___, op);
}
}
return retVal___;
}
void HP_script_reportsrc(struct script_state *st) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_reportsrc_pre ) {
- void (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_reportsrc_pre > 0) {
+ void (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reportsrc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reportsrc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_reportsrc_pre[hIndex].func;
- preHookFunc(st);
+ preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61247,9 +62757,9 @@ void HP_script_reportsrc(struct script_state *st) {
{
HPMHooks.source.script.reportsrc(st);
}
- if( HPMHooks.count.HP_script_reportsrc_post ) {
+ if (HPMHooks.count.HP_script_reportsrc_post > 0) {
void (*postHookFunc) (struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reportsrc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reportsrc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_reportsrc_post[hIndex].func;
postHookFunc(st);
}
@@ -61258,14 +62768,14 @@ void HP_script_reportsrc(struct script_state *st) {
}
void HP_script_reportdata(struct script_data *data) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_reportdata_pre ) {
- void (*preHookFunc) (struct script_data *data);
+ if (HPMHooks.count.HP_script_reportdata_pre > 0) {
+ void (*preHookFunc) (struct script_data **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reportdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reportdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_reportdata_pre[hIndex].func;
- preHookFunc(data);
+ preHookFunc(&data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61273,9 +62783,9 @@ void HP_script_reportdata(struct script_data *data) {
{
HPMHooks.source.script.reportdata(data);
}
- if( HPMHooks.count.HP_script_reportdata_post ) {
+ if (HPMHooks.count.HP_script_reportdata_post > 0) {
void (*postHookFunc) (struct script_data *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reportdata_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reportdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_reportdata_post[hIndex].func;
postHookFunc(data);
}
@@ -61284,14 +62794,14 @@ void HP_script_reportdata(struct script_data *data) {
}
void HP_script_reportfunc(struct script_state *st) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_reportfunc_pre ) {
- void (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_reportfunc_pre > 0) {
+ void (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reportfunc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reportfunc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_reportfunc_pre[hIndex].func;
- preHookFunc(st);
+ preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61299,9 +62809,9 @@ void HP_script_reportfunc(struct script_state *st) {
{
HPMHooks.source.script.reportfunc(st);
}
- if( HPMHooks.count.HP_script_reportfunc_post ) {
+ if (HPMHooks.count.HP_script_reportfunc_post > 0) {
void (*postHookFunc) (struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reportfunc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reportfunc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_reportfunc_post[hIndex].func;
postHookFunc(st);
}
@@ -61310,14 +62820,14 @@ void HP_script_reportfunc(struct script_state *st) {
}
void HP_script_disp_warning_message(const char *mes, const char *pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_disp_warning_message_pre ) {
- void (*preHookFunc) (const char *mes, const char *pos);
+ if (HPMHooks.count.HP_script_disp_warning_message_pre > 0) {
+ void (*preHookFunc) (const char **mes, const char **pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_disp_warning_message_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_disp_warning_message_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_disp_warning_message_pre[hIndex].func;
- preHookFunc(mes, pos);
+ preHookFunc(&mes, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61325,9 +62835,9 @@ void HP_script_disp_warning_message(const char *mes, const char *pos) {
{
HPMHooks.source.script.disp_warning_message(mes, pos);
}
- if( HPMHooks.count.HP_script_disp_warning_message_post ) {
+ if (HPMHooks.count.HP_script_disp_warning_message_post > 0) {
void (*postHookFunc) (const char *mes, const char *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_disp_warning_message_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_disp_warning_message_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_disp_warning_message_post[hIndex].func;
postHookFunc(mes, pos);
}
@@ -61336,14 +62846,14 @@ void HP_script_disp_warning_message(const char *mes, const char *pos) {
}
void HP_script_check_event(struct script_state *st, const char *evt) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_check_event_pre ) {
- void (*preHookFunc) (struct script_state *st, const char *evt);
+ if (HPMHooks.count.HP_script_check_event_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, const char **evt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_event_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_check_event_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_check_event_pre[hIndex].func;
- preHookFunc(st, evt);
+ preHookFunc(&st, &evt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61351,9 +62861,9 @@ void HP_script_check_event(struct script_state *st, const char *evt) {
{
HPMHooks.source.script.check_event(st, evt);
}
- if( HPMHooks.count.HP_script_check_event_post ) {
+ if (HPMHooks.count.HP_script_check_event_post > 0) {
void (*postHookFunc) (struct script_state *st, const char *evt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_event_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_check_event_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_check_event_post[hIndex].func;
postHookFunc(st, evt);
}
@@ -61363,14 +62873,14 @@ void HP_script_check_event(struct script_state *st, const char *evt) {
unsigned int HP_script_calc_hash(const char *p) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_script_calc_hash_pre ) {
- unsigned int (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_calc_hash_pre > 0) {
+ unsigned int (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_calc_hash_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61378,9 +62888,9 @@ unsigned int HP_script_calc_hash(const char *p) {
{
retVal___ = HPMHooks.source.script.calc_hash(p);
}
- if( HPMHooks.count.HP_script_calc_hash_post ) {
+ if (HPMHooks.count.HP_script_calc_hash_post > 0) {
unsigned int (*postHookFunc) (unsigned int retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_calc_hash_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61389,14 +62899,14 @@ unsigned int HP_script_calc_hash(const char *p) {
}
void HP_script_addb(int a) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_addb_pre ) {
+ if (HPMHooks.count.HP_script_addb_pre > 0) {
void (*preHookFunc) (int *a);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_addb_pre[hIndex].func;
preHookFunc(&a);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61404,25 +62914,25 @@ void HP_script_addb(int a) {
{
HPMHooks.source.script.addb(a);
}
- if( HPMHooks.count.HP_script_addb_post ) {
- void (*postHookFunc) (int *a);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_addb_post > 0) {
+ void (*postHookFunc) (int a);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_addb_post[hIndex].func;
- postHookFunc(&a);
+ postHookFunc(a);
}
}
return;
}
void HP_script_addc(int a) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_addc_pre ) {
+ if (HPMHooks.count.HP_script_addc_pre > 0) {
void (*preHookFunc) (int *a);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_addc_pre[hIndex].func;
preHookFunc(&a);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61430,25 +62940,25 @@ void HP_script_addc(int a) {
{
HPMHooks.source.script.addc(a);
}
- if( HPMHooks.count.HP_script_addc_post ) {
- void (*postHookFunc) (int *a);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_addc_post > 0) {
+ void (*postHookFunc) (int a);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_addc_post[hIndex].func;
- postHookFunc(&a);
+ postHookFunc(a);
}
}
return;
}
void HP_script_addi(int a) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_addi_pre ) {
+ if (HPMHooks.count.HP_script_addi_pre > 0) {
void (*preHookFunc) (int *a);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addi_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addi_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_addi_pre[hIndex].func;
preHookFunc(&a);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61456,25 +62966,25 @@ void HP_script_addi(int a) {
{
HPMHooks.source.script.addi(a);
}
- if( HPMHooks.count.HP_script_addi_post ) {
- void (*postHookFunc) (int *a);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addi_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_addi_post > 0) {
+ void (*postHookFunc) (int a);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addi_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_addi_post[hIndex].func;
- postHookFunc(&a);
+ postHookFunc(a);
}
}
return;
}
void HP_script_addl(int l) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_addl_pre ) {
+ if (HPMHooks.count.HP_script_addl_pre > 0) {
void (*preHookFunc) (int *l);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addl_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addl_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_addl_pre[hIndex].func;
preHookFunc(&l);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61482,25 +62992,25 @@ void HP_script_addl(int l) {
{
HPMHooks.source.script.addl(l);
}
- if( HPMHooks.count.HP_script_addl_post ) {
- void (*postHookFunc) (int *l);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_addl_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_addl_post > 0) {
+ void (*postHookFunc) (int l);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_addl_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_addl_post[hIndex].func;
- postHookFunc(&l);
+ postHookFunc(l);
}
}
return;
}
void HP_script_set_label(int l, int pos, const char *script_pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_label_pre ) {
- void (*preHookFunc) (int *l, int *pos, const char *script_pos);
+ if (HPMHooks.count.HP_script_set_label_pre > 0) {
+ void (*preHookFunc) (int *l, int *pos, const char **script_pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_label_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_label_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_label_pre[hIndex].func;
- preHookFunc(&l, &pos, script_pos);
+ preHookFunc(&l, &pos, &script_pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61508,11 +63018,11 @@ void HP_script_set_label(int l, int pos, const char *script_pos) {
{
HPMHooks.source.script.set_label(l, pos, script_pos);
}
- if( HPMHooks.count.HP_script_set_label_post ) {
- void (*postHookFunc) (int *l, int *pos, const char *script_pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_label_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_label_post > 0) {
+ void (*postHookFunc) (int l, int pos, const char *script_pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_label_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_label_post[hIndex].func;
- postHookFunc(&l, &pos, script_pos);
+ postHookFunc(l, pos, script_pos);
}
}
return;
@@ -61520,14 +63030,14 @@ void HP_script_set_label(int l, int pos, const char *script_pos) {
const char* HP_script_skip_word(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_skip_word_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_skip_word_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_word_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_word_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_skip_word_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61535,9 +63045,9 @@ const char* HP_script_skip_word(const char *p) {
{
retVal___ = HPMHooks.source.script.skip_word(p);
}
- if( HPMHooks.count.HP_script_skip_word_post ) {
+ if (HPMHooks.count.HP_script_skip_word_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_word_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_skip_word_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_skip_word_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61547,14 +63057,14 @@ const char* HP_script_skip_word(const char *p) {
int HP_script_add_word(const char *p) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_add_word_pre ) {
- int (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_add_word_pre > 0) {
+ int (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_word_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_word_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_add_word_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61562,9 +63072,9 @@ int HP_script_add_word(const char *p) {
{
retVal___ = HPMHooks.source.script.add_word(p);
}
- if( HPMHooks.count.HP_script_add_word_post ) {
+ if (HPMHooks.count.HP_script_add_word_post > 0) {
int (*postHookFunc) (int retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_word_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_word_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_add_word_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61574,14 +63084,14 @@ int HP_script_add_word(const char *p) {
const char* HP_script_parse_callfunc(const char *p, int require_paren, int is_custom) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_callfunc_pre ) {
- const char* (*preHookFunc) (const char *p, int *require_paren, int *is_custom);
+ if (HPMHooks.count.HP_script_parse_callfunc_pre > 0) {
+ const char* (*preHookFunc) (const char **p, int *require_paren, int *is_custom);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_callfunc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_callfunc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_callfunc_pre[hIndex].func;
- retVal___ = preHookFunc(p, &require_paren, &is_custom);
+ retVal___ = preHookFunc(&p, &require_paren, &is_custom);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61589,25 +63099,25 @@ const char* HP_script_parse_callfunc(const char *p, int require_paren, int is_cu
{
retVal___ = HPMHooks.source.script.parse_callfunc(p, require_paren, is_custom);
}
- if( HPMHooks.count.HP_script_parse_callfunc_post ) {
- const char* (*postHookFunc) (const char* retVal___, const char *p, int *require_paren, int *is_custom);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_callfunc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_parse_callfunc_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p, int require_paren, int is_custom);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_callfunc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_callfunc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, p, &require_paren, &is_custom);
+ retVal___ = postHookFunc(retVal___, p, require_paren, is_custom);
}
}
return retVal___;
}
void HP_script_parse_nextline(bool first, const char *p) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_parse_nextline_pre ) {
- void (*preHookFunc) (bool *first, const char *p);
+ if (HPMHooks.count.HP_script_parse_nextline_pre > 0) {
+ void (*preHookFunc) (bool *first, const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_nextline_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_nextline_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_nextline_pre[hIndex].func;
- preHookFunc(&first, p);
+ preHookFunc(&first, &p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61615,11 +63125,11 @@ void HP_script_parse_nextline(bool first, const char *p) {
{
HPMHooks.source.script.parse_nextline(first, p);
}
- if( HPMHooks.count.HP_script_parse_nextline_post ) {
- void (*postHookFunc) (bool *first, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_nextline_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_parse_nextline_post > 0) {
+ void (*postHookFunc) (bool first, const char *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_nextline_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_nextline_post[hIndex].func;
- postHookFunc(&first, p);
+ postHookFunc(first, p);
}
}
return;
@@ -61627,14 +63137,14 @@ void HP_script_parse_nextline(bool first, const char *p) {
const char* HP_script_parse_variable(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_variable_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_variable_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_variable_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_variable_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_variable_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61642,9 +63152,9 @@ const char* HP_script_parse_variable(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_variable(p);
}
- if( HPMHooks.count.HP_script_parse_variable_post ) {
+ if (HPMHooks.count.HP_script_parse_variable_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_variable_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_variable_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_variable_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61654,14 +63164,14 @@ const char* HP_script_parse_variable(const char *p) {
const char* HP_script_parse_simpleexpr(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_simpleexpr_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_simpleexpr_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61669,26 +63179,160 @@ const char* HP_script_parse_simpleexpr(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_simpleexpr(p);
}
- if( HPMHooks.count.HP_script_parse_simpleexpr_post ) {
+ if (HPMHooks.count.HP_script_parse_simpleexpr_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
}
return retVal___;
}
+const char* HP_script_parse_simpleexpr_paren(const char *p) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_parse_simpleexpr_paren_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_paren_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_paren_pre[hIndex].func;
+ retVal___ = preHookFunc(&p);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.parse_simpleexpr_paren(p);
+ }
+ if (HPMHooks.count.HP_script_parse_simpleexpr_paren_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_paren_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_paren_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, p);
+ }
+ }
+ return retVal___;
+}
+const char* HP_script_parse_simpleexpr_number(const char *p) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_parse_simpleexpr_number_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_number_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_number_pre[hIndex].func;
+ retVal___ = preHookFunc(&p);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.parse_simpleexpr_number(p);
+ }
+ if (HPMHooks.count.HP_script_parse_simpleexpr_number_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_number_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_number_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, p);
+ }
+ }
+ return retVal___;
+}
+const char* HP_script_parse_simpleexpr_string(const char *p) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_parse_simpleexpr_string_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_string_pre[hIndex].func;
+ retVal___ = preHookFunc(&p);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.parse_simpleexpr_string(p);
+ }
+ if (HPMHooks.count.HP_script_parse_simpleexpr_string_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_string_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, p);
+ }
+ }
+ return retVal___;
+}
+const char* HP_script_parse_simpleexpr_name(const char *p) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_parse_simpleexpr_name_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_name_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_name_pre[hIndex].func;
+ retVal___ = preHookFunc(&p);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.parse_simpleexpr_name(p);
+ }
+ if (HPMHooks.count.HP_script_parse_simpleexpr_name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_simpleexpr_name_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_parse_simpleexpr_name_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, p);
+ }
+ }
+ return retVal___;
+}
+void HP_script_add_translatable_string(const struct script_string_buf *string, const char *start_point) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_script_add_translatable_string_pre > 0) {
+ void (*preHookFunc) (const struct script_string_buf **string, const char **start_point);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_translatable_string_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_add_translatable_string_pre[hIndex].func;
+ preHookFunc(&string, &start_point);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.add_translatable_string(string, start_point);
+ }
+ if (HPMHooks.count.HP_script_add_translatable_string_post > 0) {
+ void (*postHookFunc) (const struct script_string_buf *string, const char *start_point);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_translatable_string_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_add_translatable_string_post[hIndex].func;
+ postHookFunc(string, start_point);
+ }
+ }
+ return;
+}
const char* HP_script_parse_expr(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_expr_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_expr_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_expr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_expr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_expr_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61696,9 +63340,9 @@ const char* HP_script_parse_expr(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_expr(p);
}
- if( HPMHooks.count.HP_script_parse_expr_post ) {
+ if (HPMHooks.count.HP_script_parse_expr_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_expr_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_expr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_expr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61708,14 +63352,14 @@ const char* HP_script_parse_expr(const char *p) {
const char* HP_script_parse_line(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_parse_line_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_parse_line_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_line_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_line_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_line_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61723,9 +63367,9 @@ const char* HP_script_parse_line(const char *p) {
{
retVal___ = HPMHooks.source.script.parse_line(p);
}
- if( HPMHooks.count.HP_script_parse_line_post ) {
+ if (HPMHooks.count.HP_script_parse_line_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_line_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_line_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_line_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -61734,14 +63378,14 @@ const char* HP_script_parse_line(const char *p) {
}
void HP_script_read_constdb(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_read_constdb_pre ) {
+ if (HPMHooks.count.HP_script_read_constdb_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_read_constdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_read_constdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_read_constdb_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61749,9 +63393,9 @@ void HP_script_read_constdb(void) {
{
HPMHooks.source.script.read_constdb();
}
- if( HPMHooks.count.HP_script_read_constdb_post ) {
+ if (HPMHooks.count.HP_script_read_constdb_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_read_constdb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_read_constdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_read_constdb_post[hIndex].func;
postHookFunc();
}
@@ -61760,14 +63404,14 @@ void HP_script_read_constdb(void) {
}
void HP_script_constdb_comment(const char *comment) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_constdb_comment_pre ) {
- void (*preHookFunc) (const char *comment);
+ if (HPMHooks.count.HP_script_constdb_comment_pre > 0) {
+ void (*preHookFunc) (const char **comment);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_constdb_comment_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_constdb_comment_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_constdb_comment_pre[hIndex].func;
- preHookFunc(comment);
+ preHookFunc(&comment);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61775,26 +63419,52 @@ void HP_script_constdb_comment(const char *comment) {
{
HPMHooks.source.script.constdb_comment(comment);
}
- if( HPMHooks.count.HP_script_constdb_comment_post ) {
+ if (HPMHooks.count.HP_script_constdb_comment_post > 0) {
void (*postHookFunc) (const char *comment);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_constdb_comment_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_constdb_comment_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_constdb_comment_post[hIndex].func;
postHookFunc(comment);
}
}
return;
}
+void HP_script_load_parameters(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_script_load_parameters_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_parameters_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_load_parameters_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.load_parameters();
+ }
+ if (HPMHooks.count.HP_script_load_parameters_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_parameters_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_load_parameters_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
const char* HP_script_print_line(StringBuf *buf, const char *p, const char *mark, int line) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_print_line_pre ) {
- const char* (*preHookFunc) (StringBuf *buf, const char *p, const char *mark, int *line);
+ if (HPMHooks.count.HP_script_print_line_pre > 0) {
+ const char* (*preHookFunc) (StringBuf **buf, const char **p, const char **mark, int *line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_print_line_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_print_line_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_print_line_pre[hIndex].func;
- retVal___ = preHookFunc(buf, p, mark, &line);
+ retVal___ = preHookFunc(&buf, &p, &mark, &line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61802,25 +63472,25 @@ const char* HP_script_print_line(StringBuf *buf, const char *p, const char *mark
{
retVal___ = HPMHooks.source.script.print_line(buf, p, mark, line);
}
- if( HPMHooks.count.HP_script_print_line_post ) {
- const char* (*postHookFunc) (const char* retVal___, StringBuf *buf, const char *p, const char *mark, int *line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_print_line_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_print_line_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, StringBuf *buf, const char *p, const char *mark, int line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_print_line_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_print_line_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, buf, p, mark, &line);
+ retVal___ = postHookFunc(retVal___, buf, p, mark, line);
}
}
return retVal___;
}
void HP_script_errorwarning_sub(StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_errorwarning_sub_pre ) {
- void (*preHookFunc) (StringBuf *buf, const char *src, const char *file, int *start_line, const char *error_msg, const char *error_pos);
+ if (HPMHooks.count.HP_script_errorwarning_sub_pre > 0) {
+ void (*preHookFunc) (StringBuf **buf, const char **src, const char **file, int *start_line, const char **error_msg, const char **error_pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_errorwarning_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_errorwarning_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_errorwarning_sub_pre[hIndex].func;
- preHookFunc(buf, src, file, &start_line, error_msg, error_pos);
+ preHookFunc(&buf, &src, &file, &start_line, &error_msg, &error_pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61828,11 +63498,11 @@ void HP_script_errorwarning_sub(StringBuf *buf, const char *src, const char *fil
{
HPMHooks.source.script.errorwarning_sub(buf, src, file, start_line, error_msg, error_pos);
}
- if( HPMHooks.count.HP_script_errorwarning_sub_post ) {
- void (*postHookFunc) (StringBuf *buf, const char *src, const char *file, int *start_line, const char *error_msg, const char *error_pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_errorwarning_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_errorwarning_sub_post > 0) {
+ void (*postHookFunc) (StringBuf *buf, const char *src, const char *file, int start_line, const char *error_msg, const char *error_pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_errorwarning_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_errorwarning_sub_post[hIndex].func;
- postHookFunc(buf, src, file, &start_line, error_msg, error_pos);
+ postHookFunc(buf, src, file, start_line, error_msg, error_pos);
}
}
return;
@@ -61840,14 +63510,14 @@ void HP_script_errorwarning_sub(StringBuf *buf, const char *src, const char *fil
int HP_script_set_reg(struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_set_reg_pre ) {
- int (*preHookFunc) (struct script_state *st, struct map_session_data *sd, int64 *num, const char *name, const void *value, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_set_reg_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct map_session_data **sd, int64 *num, const char **name, const void **value, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_pre[hIndex].func;
- retVal___ = preHookFunc(st, sd, &num, name, value, ref);
+ retVal___ = preHookFunc(&st, &sd, &num, &name, &value, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -61855,25 +63525,25 @@ int HP_script_set_reg(struct script_state *st, struct map_session_data *sd, int6
{
retVal___ = HPMHooks.source.script.set_reg(st, sd, num, name, value, ref);
}
- if( HPMHooks.count.HP_script_set_reg_post ) {
- int (*postHookFunc) (int retVal___, struct script_state *st, struct map_session_data *sd, int64 *num, const char *name, const void *value, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_post > 0) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, struct map_session_data *sd, int64 num, const char *name, const void *value, struct reg_db *ref);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, st, sd, &num, name, value, ref);
+ retVal___ = postHookFunc(retVal___, st, sd, num, name, value, ref);
}
}
return retVal___;
}
void HP_script_set_reg_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_ref_str_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ if (HPMHooks.count.HP_script_set_reg_ref_str_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_ref_str_pre[hIndex].func;
- preHookFunc(st, n, &num, name, str);
+ preHookFunc(&st, &n, &num, &name, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61881,25 +63551,51 @@ void HP_script_set_reg_ref_str(struct script_state *st, struct reg_db *n, int64
{
HPMHooks.source.script.set_reg_ref_str(st, n, num, name, str);
}
- if( HPMHooks.count.HP_script_set_reg_ref_str_post ) {
- void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_ref_str_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_ref_str_post[hIndex].func;
- postHookFunc(st, n, &num, name, str);
+ postHookFunc(st, n, num, name, str);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_pc_ref_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_script_set_reg_pc_ref_str_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_str_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_str_pre[hIndex].func;
+ preHookFunc(&st, &n, &num, &name, &str);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_pc_ref_str(st, n, num, name, str);
+ }
+ if (HPMHooks.count.HP_script_set_reg_pc_ref_str_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_str_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_str_post[hIndex].func;
+ postHookFunc(st, n, num, name, str);
}
}
return;
}
void HP_script_set_reg_scope_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_scope_str_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ if (HPMHooks.count.HP_script_set_reg_scope_str_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_scope_str_pre[hIndex].func;
- preHookFunc(st, n, &num, name, str);
+ preHookFunc(&st, &n, &num, &name, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61907,25 +63603,25 @@ void HP_script_set_reg_scope_str(struct script_state *st, struct reg_db *n, int6
{
HPMHooks.source.script.set_reg_scope_str(st, n, num, name, str);
}
- if( HPMHooks.count.HP_script_set_reg_scope_str_post ) {
- void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_scope_str_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_scope_str_post[hIndex].func;
- postHookFunc(st, n, &num, name, str);
+ postHookFunc(st, n, num, name, str);
}
}
return;
}
void HP_script_set_reg_npc_str(struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_npc_str_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
+ if (HPMHooks.count.HP_script_set_reg_npc_str_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_npc_str_pre[hIndex].func;
- preHookFunc(st, n, &num, name, str);
+ preHookFunc(&st, &n, &num, &name, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61933,25 +63629,25 @@ void HP_script_set_reg_npc_str(struct script_state *st, struct reg_db *n, int64
{
HPMHooks.source.script.set_reg_npc_str(st, n, num, name, str);
}
- if( HPMHooks.count.HP_script_set_reg_npc_str_post ) {
- void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_npc_str_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_npc_str_post[hIndex].func;
- postHookFunc(st, n, &num, name, str);
+ postHookFunc(st, n, num, name, str);
}
}
return;
}
void HP_script_set_reg_instance_str(struct script_state *st, int64 num, const char *name, const char *str) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_instance_str_pre ) {
- void (*preHookFunc) (struct script_state *st, int64 *num, const char *name, const char *str);
+ if (HPMHooks.count.HP_script_set_reg_instance_str_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int64 *num, const char **name, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_instance_str_pre[hIndex].func;
- preHookFunc(st, &num, name, str);
+ preHookFunc(&st, &num, &name, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61959,25 +63655,25 @@ void HP_script_set_reg_instance_str(struct script_state *st, int64 num, const ch
{
HPMHooks.source.script.set_reg_instance_str(st, num, name, str);
}
- if( HPMHooks.count.HP_script_set_reg_instance_str_post ) {
- void (*postHookFunc) (struct script_state *st, int64 *num, const char *name, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_instance_str_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int64 num, const char *name, const char *str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_instance_str_post[hIndex].func;
- postHookFunc(st, &num, name, str);
+ postHookFunc(st, num, name, str);
}
}
return;
}
void HP_script_set_reg_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_ref_num_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ if (HPMHooks.count.HP_script_set_reg_ref_num_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_ref_num_pre[hIndex].func;
- preHookFunc(st, n, &num, name, &val);
+ preHookFunc(&st, &n, &num, &name, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -61985,25 +63681,51 @@ void HP_script_set_reg_ref_num(struct script_state *st, struct reg_db *n, int64
{
HPMHooks.source.script.set_reg_ref_num(st, n, num, name, val);
}
- if( HPMHooks.count.HP_script_set_reg_ref_num_post ) {
- void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_ref_num_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_ref_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_ref_num_post[hIndex].func;
- postHookFunc(st, n, &num, name, &val);
+ postHookFunc(st, n, num, name, val);
+ }
+ }
+ return;
+}
+void HP_script_set_reg_pc_ref_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_script_set_reg_pc_ref_num_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_num_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_num_pre[hIndex].func;
+ preHookFunc(&st, &n, &num, &name, &val);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.script.set_reg_pc_ref_num(st, n, num, name, val);
+ }
+ if (HPMHooks.count.HP_script_set_reg_pc_ref_num_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_pc_ref_num_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_set_reg_pc_ref_num_post[hIndex].func;
+ postHookFunc(st, n, num, name, val);
}
}
return;
}
void HP_script_set_reg_scope_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_scope_num_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ if (HPMHooks.count.HP_script_set_reg_scope_num_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_scope_num_pre[hIndex].func;
- preHookFunc(st, n, &num, name, &val);
+ preHookFunc(&st, &n, &num, &name, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62011,25 +63733,25 @@ void HP_script_set_reg_scope_num(struct script_state *st, struct reg_db *n, int6
{
HPMHooks.source.script.set_reg_scope_num(st, n, num, name, val);
}
- if( HPMHooks.count.HP_script_set_reg_scope_num_post ) {
- void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_scope_num_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_scope_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_scope_num_post[hIndex].func;
- postHookFunc(st, n, &num, name, &val);
+ postHookFunc(st, n, num, name, val);
}
}
return;
}
void HP_script_set_reg_npc_num(struct script_state *st, struct reg_db *n, int64 num, const char *name, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_npc_num_pre ) {
- void (*preHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
+ if (HPMHooks.count.HP_script_set_reg_npc_num_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct reg_db **n, int64 *num, const char **name, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_npc_num_pre[hIndex].func;
- preHookFunc(st, n, &num, name, &val);
+ preHookFunc(&st, &n, &num, &name, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62037,25 +63759,25 @@ void HP_script_set_reg_npc_num(struct script_state *st, struct reg_db *n, int64
{
HPMHooks.source.script.set_reg_npc_num(st, n, num, name, val);
}
- if( HPMHooks.count.HP_script_set_reg_npc_num_post ) {
- void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 *num, const char *name, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_npc_num_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct reg_db *n, int64 num, const char *name, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_npc_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_npc_num_post[hIndex].func;
- postHookFunc(st, n, &num, name, &val);
+ postHookFunc(st, n, num, name, val);
}
}
return;
}
void HP_script_set_reg_instance_num(struct script_state *st, int64 num, const char *name, int val) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_set_reg_instance_num_pre ) {
- void (*preHookFunc) (struct script_state *st, int64 *num, const char *name, int *val);
+ if (HPMHooks.count.HP_script_set_reg_instance_num_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int64 *num, const char **name, int *val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_set_reg_instance_num_pre[hIndex].func;
- preHookFunc(st, &num, name, &val);
+ preHookFunc(&st, &num, &name, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62063,25 +63785,25 @@ void HP_script_set_reg_instance_num(struct script_state *st, int64 num, const ch
{
HPMHooks.source.script.set_reg_instance_num(st, num, name, val);
}
- if( HPMHooks.count.HP_script_set_reg_instance_num_post ) {
- void (*postHookFunc) (struct script_state *st, int64 *num, const char *name, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_set_reg_instance_num_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int64 num, const char *name, int val);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_set_reg_instance_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_set_reg_instance_num_post[hIndex].func;
- postHookFunc(st, &num, name, &val);
+ postHookFunc(st, num, name, val);
}
}
return;
}
void HP_script_stack_expand(struct script_stack *stack) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_stack_expand_pre ) {
- void (*preHookFunc) (struct script_stack *stack);
+ if (HPMHooks.count.HP_script_stack_expand_pre > 0) {
+ void (*preHookFunc) (struct script_stack **stack);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_stack_expand_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_stack_expand_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_stack_expand_pre[hIndex].func;
- preHookFunc(stack);
+ preHookFunc(&stack);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62089,9 +63811,9 @@ void HP_script_stack_expand(struct script_stack *stack) {
{
HPMHooks.source.script.stack_expand(stack);
}
- if( HPMHooks.count.HP_script_stack_expand_post ) {
+ if (HPMHooks.count.HP_script_stack_expand_post > 0) {
void (*postHookFunc) (struct script_stack *stack);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_stack_expand_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_stack_expand_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_stack_expand_post[hIndex].func;
postHookFunc(stack);
}
@@ -62101,14 +63823,14 @@ void HP_script_stack_expand(struct script_stack *stack) {
struct script_data* HP_script_push_retinfo(struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref) {
int hIndex = 0;
struct script_data* retVal___ = NULL;
- if( HPMHooks.count.HP_script_push_retinfo_pre ) {
- struct script_data* (*preHookFunc) (struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_push_retinfo_pre > 0) {
+ struct script_data* (*preHookFunc) (struct script_stack **stack, struct script_retinfo **ri, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_retinfo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_retinfo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_push_retinfo_pre[hIndex].func;
- retVal___ = preHookFunc(stack, ri, ref);
+ retVal___ = preHookFunc(&stack, &ri, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62116,9 +63838,9 @@ struct script_data* HP_script_push_retinfo(struct script_stack *stack, struct sc
{
retVal___ = HPMHooks.source.script.push_retinfo(stack, ri, ref);
}
- if( HPMHooks.count.HP_script_push_retinfo_post ) {
+ if (HPMHooks.count.HP_script_push_retinfo_post > 0) {
struct script_data* (*postHookFunc) (struct script_data* retVal___, struct script_stack *stack, struct script_retinfo *ri, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_push_retinfo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_push_retinfo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_push_retinfo_post[hIndex].func;
retVal___ = postHookFunc(retVal___, stack, ri, ref);
}
@@ -62127,14 +63849,14 @@ struct script_data* HP_script_push_retinfo(struct script_stack *stack, struct sc
}
void HP_script_op_3(struct script_state *st, int op) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_op_3_pre ) {
- void (*preHookFunc) (struct script_state *st, int *op);
+ if (HPMHooks.count.HP_script_op_3_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int *op);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_3_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_3_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_op_3_pre[hIndex].func;
- preHookFunc(st, &op);
+ preHookFunc(&st, &op);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62142,25 +63864,25 @@ void HP_script_op_3(struct script_state *st, int op) {
{
HPMHooks.source.script.op_3(st, op);
}
- if( HPMHooks.count.HP_script_op_3_post ) {
- void (*postHookFunc) (struct script_state *st, int *op);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_3_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_op_3_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int op);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_3_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_op_3_post[hIndex].func;
- postHookFunc(st, &op);
+ postHookFunc(st, op);
}
}
return;
}
void HP_script_op_2str(struct script_state *st, int op, const char *s1, const char *s2) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_op_2str_pre ) {
- void (*preHookFunc) (struct script_state *st, int *op, const char *s1, const char *s2);
+ if (HPMHooks.count.HP_script_op_2str_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int *op, const char **s1, const char **s2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_op_2str_pre[hIndex].func;
- preHookFunc(st, &op, s1, s2);
+ preHookFunc(&st, &op, &s1, &s2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62168,25 +63890,25 @@ void HP_script_op_2str(struct script_state *st, int op, const char *s1, const ch
{
HPMHooks.source.script.op_2str(st, op, s1, s2);
}
- if( HPMHooks.count.HP_script_op_2str_post ) {
- void (*postHookFunc) (struct script_state *st, int *op, const char *s1, const char *s2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_op_2str_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int op, const char *s1, const char *s2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_op_2str_post[hIndex].func;
- postHookFunc(st, &op, s1, s2);
+ postHookFunc(st, op, s1, s2);
}
}
return;
}
void HP_script_op_2num(struct script_state *st, int op, int i1, int i2) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_op_2num_pre ) {
- void (*preHookFunc) (struct script_state *st, int *op, int *i1, int *i2);
+ if (HPMHooks.count.HP_script_op_2num_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int *op, int *i1, int *i2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_op_2num_pre[hIndex].func;
- preHookFunc(st, &op, &i1, &i2);
+ preHookFunc(&st, &op, &i1, &i2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62194,25 +63916,25 @@ void HP_script_op_2num(struct script_state *st, int op, int i1, int i2) {
{
HPMHooks.source.script.op_2num(st, op, i1, i2);
}
- if( HPMHooks.count.HP_script_op_2num_post ) {
- void (*postHookFunc) (struct script_state *st, int *op, int *i1, int *i2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_op_2num_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int op, int i1, int i2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_op_2num_post[hIndex].func;
- postHookFunc(st, &op, &i1, &i2);
+ postHookFunc(st, op, i1, i2);
}
}
return;
}
void HP_script_op_2(struct script_state *st, int op) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_op_2_pre ) {
- void (*preHookFunc) (struct script_state *st, int *op);
+ if (HPMHooks.count.HP_script_op_2_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int *op);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_op_2_pre[hIndex].func;
- preHookFunc(st, &op);
+ preHookFunc(&st, &op);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62220,25 +63942,25 @@ void HP_script_op_2(struct script_state *st, int op) {
{
HPMHooks.source.script.op_2(st, op);
}
- if( HPMHooks.count.HP_script_op_2_post ) {
- void (*postHookFunc) (struct script_state *st, int *op);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_op_2_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int op);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_op_2_post[hIndex].func;
- postHookFunc(st, &op);
+ postHookFunc(st, op);
}
}
return;
}
void HP_script_op_1(struct script_state *st, int op) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_op_1_pre ) {
- void (*preHookFunc) (struct script_state *st, int *op);
+ if (HPMHooks.count.HP_script_op_1_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, int *op);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_1_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_1_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_op_1_pre[hIndex].func;
- preHookFunc(st, &op);
+ preHookFunc(&st, &op);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62246,51 +63968,52 @@ void HP_script_op_1(struct script_state *st, int op) {
{
HPMHooks.source.script.op_1(st, op);
}
- if( HPMHooks.count.HP_script_op_1_post ) {
- void (*postHookFunc) (struct script_state *st, int *op);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_op_1_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_op_1_post > 0) {
+ void (*postHookFunc) (struct script_state *st, int op);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_op_1_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_op_1_post[hIndex].func;
- postHookFunc(st, &op);
+ postHookFunc(st, op);
}
}
return;
}
-void HP_script_check_buildin_argtype(struct script_state *st, int func) {
+bool HP_script_check_buildin_argtype(struct script_state *st, int func) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_check_buildin_argtype_pre ) {
- void (*preHookFunc) (struct script_state *st, int *func);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_script_check_buildin_argtype_pre > 0) {
+ bool (*preHookFunc) (struct script_state **st, int *func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_check_buildin_argtype_pre[hIndex].func;
- preHookFunc(st, &func);
+ retVal___ = preHookFunc(&st, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.script.check_buildin_argtype(st, func);
+ retVal___ = HPMHooks.source.script.check_buildin_argtype(st, func);
}
- if( HPMHooks.count.HP_script_check_buildin_argtype_post ) {
- void (*postHookFunc) (struct script_state *st, int *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_check_buildin_argtype_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct script_state *st, int func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_check_buildin_argtype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_check_buildin_argtype_post[hIndex].func;
- postHookFunc(st, &func);
+ retVal___ = postHookFunc(retVal___, st, func);
}
}
- return;
+ return retVal___;
}
void HP_script_detach_state(struct script_state *st, bool dequeue_event) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_detach_state_pre ) {
- void (*preHookFunc) (struct script_state *st, bool *dequeue_event);
+ if (HPMHooks.count.HP_script_detach_state_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, bool *dequeue_event);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_detach_state_pre[hIndex].func;
- preHookFunc(st, &dequeue_event);
+ preHookFunc(&st, &dequeue_event);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62298,28 +64021,28 @@ void HP_script_detach_state(struct script_state *st, bool dequeue_event) {
{
HPMHooks.source.script.detach_state(st, dequeue_event);
}
- if( HPMHooks.count.HP_script_detach_state_post ) {
- void (*postHookFunc) (struct script_state *st, bool *dequeue_event);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_state_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_detach_state_post > 0) {
+ void (*postHookFunc) (struct script_state *st, bool dequeue_event);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_detach_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_detach_state_post[hIndex].func;
- postHookFunc(st, &dequeue_event);
+ postHookFunc(st, dequeue_event);
}
}
return;
}
-int HP_script_db_free_code_sub(DBKey key, DBData *data, va_list ap) {
+int HP_script_db_free_code_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_db_free_code_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_script_db_free_code_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_db_free_code_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_db_free_code_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_db_free_code_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62329,12 +64052,12 @@ int HP_script_db_free_code_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.script.db_free_code_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_db_free_code_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_db_free_code_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_db_free_code_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_db_free_code_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_db_free_code_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -62342,14 +64065,14 @@ int HP_script_db_free_code_sub(DBKey key, DBData *data, va_list ap) {
}
void HP_script_add_autobonus(const char *autobonus) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_add_autobonus_pre ) {
- void (*preHookFunc) (const char *autobonus);
+ if (HPMHooks.count.HP_script_add_autobonus_pre > 0) {
+ void (*preHookFunc) (const char **autobonus);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_autobonus_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_autobonus_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_add_autobonus_pre[hIndex].func;
- preHookFunc(autobonus);
+ preHookFunc(&autobonus);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62357,9 +64080,9 @@ void HP_script_add_autobonus(const char *autobonus) {
{
HPMHooks.source.script.add_autobonus(autobonus);
}
- if( HPMHooks.count.HP_script_add_autobonus_post ) {
+ if (HPMHooks.count.HP_script_add_autobonus_post > 0) {
void (*postHookFunc) (const char *autobonus);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_autobonus_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_autobonus_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_add_autobonus_post[hIndex].func;
postHookFunc(autobonus);
}
@@ -62369,14 +64092,14 @@ void HP_script_add_autobonus(const char *autobonus) {
int HP_script_menu_countoptions(const char *str, int max_count, int *total) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_menu_countoptions_pre ) {
- int (*preHookFunc) (const char *str, int *max_count, int *total);
+ if (HPMHooks.count.HP_script_menu_countoptions_pre > 0) {
+ int (*preHookFunc) (const char **str, int *max_count, int **total);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_menu_countoptions_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_menu_countoptions_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_menu_countoptions_pre[hIndex].func;
- retVal___ = preHookFunc(str, &max_count, total);
+ retVal___ = preHookFunc(&str, &max_count, &total);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62384,11 +64107,11 @@ int HP_script_menu_countoptions(const char *str, int max_count, int *total) {
{
retVal___ = HPMHooks.source.script.menu_countoptions(str, max_count, total);
}
- if( HPMHooks.count.HP_script_menu_countoptions_post ) {
- int (*postHookFunc) (int retVal___, const char *str, int *max_count, int *total);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_menu_countoptions_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_menu_countoptions_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, int max_count, int *total);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_menu_countoptions_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_menu_countoptions_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &max_count, total);
+ retVal___ = postHookFunc(retVal___, str, max_count, total);
}
}
return retVal___;
@@ -62396,16 +64119,16 @@ int HP_script_menu_countoptions(const char *str, int max_count, int *total) {
int HP_script_buildin_areawarp_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_areawarp_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_areawarp_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areawarp_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areawarp_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_areawarp_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62415,9 +64138,9 @@ int HP_script_buildin_areawarp_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_areawarp_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_areawarp_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_areawarp_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areawarp_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areawarp_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_areawarp_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62429,16 +64152,16 @@ int HP_script_buildin_areawarp_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_areapercentheal_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_areapercentheal_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_areapercentheal_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areapercentheal_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areapercentheal_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_areapercentheal_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62448,9 +64171,9 @@ int HP_script_buildin_areapercentheal_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_areapercentheal_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_areapercentheal_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_areapercentheal_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areapercentheal_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_areapercentheal_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_areapercentheal_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62461,14 +64184,14 @@ int HP_script_buildin_areapercentheal_sub(struct block_list *bl, va_list ap) {
}
void HP_script_buildin_delitem_delete(struct map_session_data *sd, int idx, int *amount, bool delete_items) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_buildin_delitem_delete_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx, int *amount, bool *delete_items);
+ if (HPMHooks.count.HP_script_buildin_delitem_delete_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx, int **amount, bool *delete_items);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_buildin_delitem_delete_pre[hIndex].func;
- preHookFunc(sd, &idx, amount, &delete_items);
+ preHookFunc(&sd, &idx, &amount, &delete_items);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -62476,11 +64199,11 @@ void HP_script_buildin_delitem_delete(struct map_session_data *sd, int idx, int
{
HPMHooks.source.script.buildin_delitem_delete(sd, idx, amount, delete_items);
}
- if( HPMHooks.count.HP_script_buildin_delitem_delete_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx, int *amount, bool *delete_items);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_buildin_delitem_delete_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx, int *amount, bool delete_items);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_buildin_delitem_delete_post[hIndex].func;
- postHookFunc(sd, &idx, amount, &delete_items);
+ postHookFunc(sd, idx, amount, delete_items);
}
}
return;
@@ -62488,14 +64211,14 @@ void HP_script_buildin_delitem_delete(struct map_session_data *sd, int idx, int
bool HP_script_buildin_delitem_search(struct map_session_data *sd, struct item *it, bool exact_match) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_script_buildin_delitem_search_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, struct item *it, bool *exact_match);
+ if (HPMHooks.count.HP_script_buildin_delitem_search_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, struct item **it, bool *exact_match);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_buildin_delitem_search_pre[hIndex].func;
- retVal___ = preHookFunc(sd, it, &exact_match);
+ retVal___ = preHookFunc(&sd, &it, &exact_match);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62503,11 +64226,11 @@ bool HP_script_buildin_delitem_search(struct map_session_data *sd, struct item *
{
retVal___ = HPMHooks.source.script.buildin_delitem_search(sd, it, exact_match);
}
- if( HPMHooks.count.HP_script_buildin_delitem_search_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct item *it, bool *exact_match);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_buildin_delitem_search_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct item *it, bool exact_match);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_delitem_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_buildin_delitem_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, it, &exact_match);
+ retVal___ = postHookFunc(retVal___, sd, it, exact_match);
}
}
return retVal___;
@@ -62515,16 +64238,16 @@ bool HP_script_buildin_delitem_search(struct map_session_data *sd, struct item *
int HP_script_buildin_killmonster_sub_strip(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_killmonster_sub_strip_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_killmonster_sub_strip_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_strip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_strip_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_killmonster_sub_strip_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62534,9 +64257,9 @@ int HP_script_buildin_killmonster_sub_strip(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_killmonster_sub_strip(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_killmonster_sub_strip_post ) {
+ if (HPMHooks.count.HP_script_buildin_killmonster_sub_strip_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_strip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_strip_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_killmonster_sub_strip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62548,16 +64271,16 @@ int HP_script_buildin_killmonster_sub_strip(struct block_list *bl, va_list ap) {
int HP_script_buildin_killmonster_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_killmonster_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_killmonster_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_killmonster_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62567,9 +64290,9 @@ int HP_script_buildin_killmonster_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_killmonster_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_killmonster_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_killmonster_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonster_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_killmonster_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62581,16 +64304,16 @@ int HP_script_buildin_killmonster_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_killmonsterall_sub_strip(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_killmonsterall_sub_strip_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62600,9 +64323,9 @@ int HP_script_buildin_killmonsterall_sub_strip(struct block_list *bl, va_list ap
retVal___ = HPMHooks.source.script.buildin_killmonsterall_sub_strip(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_post ) {
+ if (HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_strip_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_killmonsterall_sub_strip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62614,16 +64337,16 @@ int HP_script_buildin_killmonsterall_sub_strip(struct block_list *bl, va_list ap
int HP_script_buildin_killmonsterall_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_killmonsterall_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_killmonsterall_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_killmonsterall_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62633,9 +64356,9 @@ int HP_script_buildin_killmonsterall_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_killmonsterall_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_killmonsterall_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_killmonsterall_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_killmonsterall_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_killmonsterall_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62647,16 +64370,16 @@ int HP_script_buildin_killmonsterall_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_announce_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_announce_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_announce_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_announce_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_announce_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_announce_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62666,9 +64389,9 @@ int HP_script_buildin_announce_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_announce_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_announce_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_announce_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_announce_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_announce_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_announce_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62680,16 +64403,16 @@ int HP_script_buildin_announce_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_getareausers_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_getareausers_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_getareausers_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareausers_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareausers_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_getareausers_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62699,9 +64422,9 @@ int HP_script_buildin_getareausers_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_getareausers_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_getareausers_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_getareausers_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareausers_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareausers_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_getareausers_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62713,16 +64436,16 @@ int HP_script_buildin_getareausers_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_getareadropitem_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_getareadropitem_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_getareadropitem_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareadropitem_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareadropitem_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_getareadropitem_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62732,9 +64455,9 @@ int HP_script_buildin_getareadropitem_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_getareadropitem_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_getareadropitem_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_getareadropitem_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareadropitem_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_getareadropitem_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_getareadropitem_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62746,16 +64469,16 @@ int HP_script_buildin_getareadropitem_sub(struct block_list *bl, va_list ap) {
int HP_script_mapflag_pvp_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_mapflag_pvp_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_mapflag_pvp_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_mapflag_pvp_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_mapflag_pvp_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_mapflag_pvp_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62765,9 +64488,9 @@ int HP_script_mapflag_pvp_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.mapflag_pvp_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_mapflag_pvp_sub_post ) {
+ if (HPMHooks.count.HP_script_mapflag_pvp_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_mapflag_pvp_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_mapflag_pvp_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_mapflag_pvp_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62779,16 +64502,16 @@ int HP_script_mapflag_pvp_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_pvpoff_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_pvpoff_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_pvpoff_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_pvpoff_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_pvpoff_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_pvpoff_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62798,9 +64521,9 @@ int HP_script_buildin_pvpoff_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_pvpoff_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_pvpoff_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_pvpoff_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_pvpoff_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_pvpoff_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_pvpoff_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62812,16 +64535,16 @@ int HP_script_buildin_pvpoff_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_maprespawnguildid_sub_pc(struct map_session_data *sd, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_maprespawnguildid_sub_pc_pre[hIndex].func;
- retVal___ = preHookFunc(sd, ap___copy);
+ retVal___ = preHookFunc(&sd, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62831,9 +64554,9 @@ int HP_script_buildin_maprespawnguildid_sub_pc(struct map_session_data *sd, va_l
retVal___ = HPMHooks.source.script.buildin_maprespawnguildid_sub_pc(sd, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_post ) {
+ if (HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_pc_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_maprespawnguildid_sub_pc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, ap___copy);
@@ -62845,16 +64568,16 @@ int HP_script_buildin_maprespawnguildid_sub_pc(struct map_session_data *sd, va_l
int HP_script_buildin_maprespawnguildid_sub_mob(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_maprespawnguildid_sub_mob_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62864,9 +64587,9 @@ int HP_script_buildin_maprespawnguildid_sub_mob(struct block_list *bl, va_list a
retVal___ = HPMHooks.source.script.buildin_maprespawnguildid_sub_mob(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_post ) {
+ if (HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_maprespawnguildid_sub_mob_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_maprespawnguildid_sub_mob_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62878,16 +64601,16 @@ int HP_script_buildin_maprespawnguildid_sub_mob(struct block_list *bl, va_list a
int HP_script_buildin_mobcount_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_mobcount_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_mobcount_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobcount_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobcount_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_mobcount_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62897,9 +64620,9 @@ int HP_script_buildin_mobcount_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_mobcount_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_mobcount_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_mobcount_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobcount_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobcount_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_mobcount_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62911,16 +64634,16 @@ int HP_script_buildin_mobcount_sub(struct block_list *bl, va_list ap) {
int HP_script_playbgm_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_playbgm_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_playbgm_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_playbgm_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62930,9 +64653,9 @@ int HP_script_playbgm_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.playbgm_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_playbgm_sub_post ) {
+ if (HPMHooks.count.HP_script_playbgm_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_playbgm_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -62944,16 +64667,16 @@ int HP_script_playbgm_sub(struct block_list *bl, va_list ap) {
int HP_script_playbgm_foreachpc_sub(struct map_session_data *sd, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_playbgm_foreachpc_sub_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, va_list args);
+ if (HPMHooks.count.HP_script_playbgm_foreachpc_sub_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_foreachpc_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_foreachpc_sub_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_script_playbgm_foreachpc_sub_pre[hIndex].func;
- retVal___ = preHookFunc(sd, args___copy);
+ retVal___ = preHookFunc(&sd, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62963,9 +64686,9 @@ int HP_script_playbgm_foreachpc_sub(struct map_session_data *sd, va_list args) {
retVal___ = HPMHooks.source.script.playbgm_foreachpc_sub(sd, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_script_playbgm_foreachpc_sub_post ) {
+ if (HPMHooks.count.HP_script_playbgm_foreachpc_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_foreachpc_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_playbgm_foreachpc_sub_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_script_playbgm_foreachpc_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, args___copy);
@@ -62977,16 +64700,16 @@ int HP_script_playbgm_foreachpc_sub(struct map_session_data *sd, va_list args) {
int HP_script_soundeffect_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_soundeffect_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_soundeffect_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_soundeffect_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_soundeffect_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_soundeffect_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -62996,9 +64719,9 @@ int HP_script_soundeffect_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.soundeffect_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_soundeffect_sub_post ) {
+ if (HPMHooks.count.HP_script_soundeffect_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_soundeffect_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_soundeffect_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_soundeffect_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -63007,17 +64730,17 @@ int HP_script_soundeffect_sub(struct block_list *bl, va_list ap) {
}
return retVal___;
}
-int HP_script_buildin_query_sql_sub(struct script_state *st, Sql *handle) {
+int HP_script_buildin_query_sql_sub(struct script_state *st, struct Sql *handle) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_query_sql_sub_pre ) {
- int (*preHookFunc) (struct script_state *st, Sql *handle);
+ if (HPMHooks.count.HP_script_buildin_query_sql_sub_pre > 0) {
+ int (*preHookFunc) (struct script_state **st, struct Sql **handle);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_query_sql_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_query_sql_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_buildin_query_sql_sub_pre[hIndex].func;
- retVal___ = preHookFunc(st, handle);
+ retVal___ = preHookFunc(&st, &handle);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63025,9 +64748,9 @@ int HP_script_buildin_query_sql_sub(struct script_state *st, Sql *handle) {
{
retVal___ = HPMHooks.source.script.buildin_query_sql_sub(st, handle);
}
- if( HPMHooks.count.HP_script_buildin_query_sql_sub_post ) {
- int (*postHookFunc) (int retVal___, struct script_state *st, Sql *handle);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_query_sql_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_buildin_query_sql_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct script_state *st, struct Sql *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_query_sql_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_buildin_query_sql_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, handle);
}
@@ -63037,16 +64760,16 @@ int HP_script_buildin_query_sql_sub(struct script_state *st, Sql *handle) {
int HP_script_buildin_instance_warpall_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_instance_warpall_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_instance_warpall_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_instance_warpall_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_instance_warpall_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_instance_warpall_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63056,9 +64779,9 @@ int HP_script_buildin_instance_warpall_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_instance_warpall_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_instance_warpall_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_instance_warpall_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_instance_warpall_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_instance_warpall_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_instance_warpall_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -63070,16 +64793,16 @@ int HP_script_buildin_instance_warpall_sub(struct block_list *bl, va_list ap) {
int HP_script_buildin_mobuseskill_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_buildin_mobuseskill_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_buildin_mobuseskill_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobuseskill_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobuseskill_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_buildin_mobuseskill_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63089,9 +64812,9 @@ int HP_script_buildin_mobuseskill_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.buildin_mobuseskill_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_buildin_mobuseskill_sub_post ) {
+ if (HPMHooks.count.HP_script_buildin_mobuseskill_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobuseskill_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_buildin_mobuseskill_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_buildin_mobuseskill_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -63103,16 +64826,16 @@ int HP_script_buildin_mobuseskill_sub(struct block_list *bl, va_list ap) {
int HP_script_cleanfloor_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_cleanfloor_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_script_cleanfloor_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_cleanfloor_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_cleanfloor_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_cleanfloor_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63122,9 +64845,9 @@ int HP_script_cleanfloor_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.script.cleanfloor_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_cleanfloor_sub_post ) {
+ if (HPMHooks.count.HP_script_cleanfloor_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_cleanfloor_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_cleanfloor_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_cleanfloor_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -63136,14 +64859,14 @@ int HP_script_cleanfloor_sub(struct block_list *bl, va_list ap) {
int HP_script_run_func(struct script_state *st) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_run_func_pre ) {
- int (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_run_func_pre > 0) {
+ int (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_func_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_func_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_func_pre[hIndex].func;
- retVal___ = preHookFunc(st);
+ retVal___ = preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63151,9 +64874,9 @@ int HP_script_run_func(struct script_state *st) {
{
retVal___ = HPMHooks.source.script.run_func(st);
}
- if( HPMHooks.count.HP_script_run_func_post ) {
+ if (HPMHooks.count.HP_script_run_func_post > 0) {
int (*postHookFunc) (int retVal___, struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_func_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_func_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_func_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st);
}
@@ -63163,14 +64886,14 @@ int HP_script_run_func(struct script_state *st) {
const char* HP_script_getfuncname(struct script_state *st) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_getfuncname_pre ) {
- const char* (*preHookFunc) (struct script_state *st);
+ if (HPMHooks.count.HP_script_getfuncname_pre > 0) {
+ const char* (*preHookFunc) (struct script_state **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_getfuncname_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_getfuncname_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_getfuncname_pre[hIndex].func;
- retVal___ = preHookFunc(st);
+ retVal___ = preHookFunc(&st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63178,9 +64901,9 @@ const char* HP_script_getfuncname(struct script_state *st) {
{
retVal___ = HPMHooks.source.script.getfuncname(st);
}
- if( HPMHooks.count.HP_script_getfuncname_post ) {
+ if (HPMHooks.count.HP_script_getfuncname_post > 0) {
const char* (*postHookFunc) (const char* retVal___, struct script_state *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_getfuncname_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_getfuncname_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_getfuncname_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st);
}
@@ -63190,14 +64913,14 @@ const char* HP_script_getfuncname(struct script_state *st) {
unsigned int HP_script_calc_hash_ci(const char *p) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_script_calc_hash_ci_pre ) {
- unsigned int (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_script_calc_hash_ci_pre > 0) {
+ unsigned int (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_ci_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_ci_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_calc_hash_ci_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63205,9 +64928,9 @@ unsigned int HP_script_calc_hash_ci(const char *p) {
{
retVal___ = HPMHooks.source.script.calc_hash_ci(p);
}
- if( HPMHooks.count.HP_script_calc_hash_ci_post ) {
+ if (HPMHooks.count.HP_script_calc_hash_ci_post > 0) {
unsigned int (*postHookFunc) (unsigned int retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_ci_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_calc_hash_ci_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_calc_hash_ci_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -63217,14 +64940,14 @@ unsigned int HP_script_calc_hash_ci(const char *p) {
struct reg_db* HP_script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
int hIndex = 0;
struct reg_db* retVal___ = NULL;
- if( HPMHooks.count.HP_script_array_src_pre ) {
- struct reg_db* (*preHookFunc) (struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_array_src_pre > 0) {
+ struct reg_db* (*preHookFunc) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_src_pre[hIndex].func;
- retVal___ = preHookFunc(st, sd, name, ref);
+ retVal___ = preHookFunc(&st, &sd, &name, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63232,9 +64955,9 @@ struct reg_db* HP_script_array_src(struct script_state *st, struct map_session_d
{
retVal___ = HPMHooks.source.script.array_src(st, sd, name, ref);
}
- if( HPMHooks.count.HP_script_array_src_post ) {
+ if (HPMHooks.count.HP_script_array_src_post > 0) {
struct reg_db* (*postHookFunc) (struct reg_db* retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_src_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, sd, name, ref);
}
@@ -63243,14 +64966,14 @@ struct reg_db* HP_script_array_src(struct script_state *st, struct map_session_d
}
void HP_script_array_update(struct reg_db *src, int64 num, bool empty) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_array_update_pre ) {
- void (*preHookFunc) (struct reg_db *src, int64 *num, bool *empty);
+ if (HPMHooks.count.HP_script_array_update_pre > 0) {
+ void (*preHookFunc) (struct reg_db **src, int64 *num, bool *empty);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_update_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_update_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_update_pre[hIndex].func;
- preHookFunc(src, &num, &empty);
+ preHookFunc(&src, &num, &empty);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63258,25 +64981,25 @@ void HP_script_array_update(struct reg_db *src, int64 num, bool empty) {
{
HPMHooks.source.script.array_update(src, num, empty);
}
- if( HPMHooks.count.HP_script_array_update_post ) {
- void (*postHookFunc) (struct reg_db *src, int64 *num, bool *empty);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_update_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_array_update_post > 0) {
+ void (*postHookFunc) (struct reg_db *src, int64 num, bool empty);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_update_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_update_post[hIndex].func;
- postHookFunc(src, &num, &empty);
+ postHookFunc(src, num, empty);
}
}
return;
}
void HP_script_array_delete(struct reg_db *src, struct script_array *sa) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_array_delete_pre ) {
- void (*preHookFunc) (struct reg_db *src, struct script_array *sa);
+ if (HPMHooks.count.HP_script_array_delete_pre > 0) {
+ void (*preHookFunc) (struct reg_db **src, struct script_array **sa);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_delete_pre[hIndex].func;
- preHookFunc(src, sa);
+ preHookFunc(&src, &sa);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63284,9 +65007,9 @@ void HP_script_array_delete(struct reg_db *src, struct script_array *sa) {
{
HPMHooks.source.script.array_delete(src, sa);
}
- if( HPMHooks.count.HP_script_array_delete_post ) {
+ if (HPMHooks.count.HP_script_array_delete_post > 0) {
void (*postHookFunc) (struct reg_db *src, struct script_array *sa);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_delete_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_delete_post[hIndex].func;
postHookFunc(src, sa);
}
@@ -63295,14 +65018,14 @@ void HP_script_array_delete(struct reg_db *src, struct script_array *sa) {
}
void HP_script_array_remove_member(struct reg_db *src, struct script_array *sa, unsigned int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_array_remove_member_pre ) {
- void (*preHookFunc) (struct reg_db *src, struct script_array *sa, unsigned int *idx);
+ if (HPMHooks.count.HP_script_array_remove_member_pre > 0) {
+ void (*preHookFunc) (struct reg_db **src, struct script_array **sa, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_remove_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_remove_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_remove_member_pre[hIndex].func;
- preHookFunc(src, sa, &idx);
+ preHookFunc(&src, &sa, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63310,25 +65033,25 @@ void HP_script_array_remove_member(struct reg_db *src, struct script_array *sa,
{
HPMHooks.source.script.array_remove_member(src, sa, idx);
}
- if( HPMHooks.count.HP_script_array_remove_member_post ) {
- void (*postHookFunc) (struct reg_db *src, struct script_array *sa, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_remove_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_array_remove_member_post > 0) {
+ void (*postHookFunc) (struct reg_db *src, struct script_array *sa, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_remove_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_remove_member_post[hIndex].func;
- postHookFunc(src, sa, &idx);
+ postHookFunc(src, sa, idx);
}
}
return;
}
void HP_script_array_add_member(struct script_array *sa, unsigned int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_array_add_member_pre ) {
- void (*preHookFunc) (struct script_array *sa, unsigned int *idx);
+ if (HPMHooks.count.HP_script_array_add_member_pre > 0) {
+ void (*preHookFunc) (struct script_array **sa, unsigned int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_add_member_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_add_member_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_add_member_pre[hIndex].func;
- preHookFunc(sa, &idx);
+ preHookFunc(&sa, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63336,11 +65059,11 @@ void HP_script_array_add_member(struct script_array *sa, unsigned int idx) {
{
HPMHooks.source.script.array_add_member(sa, idx);
}
- if( HPMHooks.count.HP_script_array_add_member_post ) {
- void (*postHookFunc) (struct script_array *sa, unsigned int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_add_member_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_array_add_member_post > 0) {
+ void (*postHookFunc) (struct script_array *sa, unsigned int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_add_member_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_add_member_post[hIndex].func;
- postHookFunc(sa, &idx);
+ postHookFunc(sa, idx);
}
}
return;
@@ -63348,14 +65071,14 @@ void HP_script_array_add_member(struct script_array *sa, unsigned int idx) {
unsigned int HP_script_array_size(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_script_array_size_pre ) {
- unsigned int (*preHookFunc) (struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_array_size_pre > 0) {
+ unsigned int (*preHookFunc) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_size_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_size_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_size_pre[hIndex].func;
- retVal___ = preHookFunc(st, sd, name, ref);
+ retVal___ = preHookFunc(&st, &sd, &name, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63363,9 +65086,9 @@ unsigned int HP_script_array_size(struct script_state *st, struct map_session_da
{
retVal___ = HPMHooks.source.script.array_size(st, sd, name, ref);
}
- if( HPMHooks.count.HP_script_array_size_post ) {
+ if (HPMHooks.count.HP_script_array_size_post > 0) {
unsigned int (*postHookFunc) (unsigned int retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_size_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_size_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_size_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, sd, name, ref);
}
@@ -63375,14 +65098,14 @@ unsigned int HP_script_array_size(struct script_state *st, struct map_session_da
unsigned int HP_script_array_highest_key(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_script_array_highest_key_pre ) {
- unsigned int (*preHookFunc) (struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_array_highest_key_pre > 0) {
+ unsigned int (*preHookFunc) (struct script_state **st, struct map_session_data **sd, const char **name, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_highest_key_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_highest_key_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_highest_key_pre[hIndex].func;
- retVal___ = preHookFunc(st, sd, name, ref);
+ retVal___ = preHookFunc(&st, &sd, &name, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63390,28 +65113,28 @@ unsigned int HP_script_array_highest_key(struct script_state *st, struct map_ses
{
retVal___ = HPMHooks.source.script.array_highest_key(st, sd, name, ref);
}
- if( HPMHooks.count.HP_script_array_highest_key_post ) {
+ if (HPMHooks.count.HP_script_array_highest_key_post > 0) {
unsigned int (*postHookFunc) (unsigned int retVal___, struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_highest_key_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_highest_key_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_highest_key_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, sd, name, ref);
}
}
return retVal___;
}
-int HP_script_array_free_db(DBKey key, DBData *data, va_list ap) {
+int HP_script_array_free_db(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_array_free_db_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_script_array_free_db_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_free_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_free_db_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_array_free_db_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63421,12 +65144,12 @@ int HP_script_array_free_db(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.script.array_free_db(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_array_free_db_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_free_db_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_array_free_db_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_free_db_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_array_free_db_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -63434,14 +65157,14 @@ int HP_script_array_free_db(DBKey key, DBData *data, va_list ap) {
}
void HP_script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_array_ensure_zero_pre ) {
- void (*preHookFunc) (struct script_state *st, struct map_session_data *sd, int64 *uid, struct reg_db *ref);
+ if (HPMHooks.count.HP_script_array_ensure_zero_pre > 0) {
+ void (*preHookFunc) (struct script_state **st, struct map_session_data **sd, int64 *uid, struct reg_db **ref);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_ensure_zero_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_ensure_zero_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_ensure_zero_pre[hIndex].func;
- preHookFunc(st, sd, &uid, ref);
+ preHookFunc(&st, &sd, &uid, &ref);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63449,25 +65172,25 @@ void HP_script_array_ensure_zero(struct script_state *st, struct map_session_dat
{
HPMHooks.source.script.array_ensure_zero(st, sd, uid, ref);
}
- if( HPMHooks.count.HP_script_array_ensure_zero_post ) {
- void (*postHookFunc) (struct script_state *st, struct map_session_data *sd, int64 *uid, struct reg_db *ref);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_ensure_zero_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_array_ensure_zero_post > 0) {
+ void (*postHookFunc) (struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_ensure_zero_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_ensure_zero_post[hIndex].func;
- postHookFunc(st, sd, &uid, ref);
+ postHookFunc(st, sd, uid, ref);
}
}
return;
}
void HP_script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct script_reg_state *data) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_reg_destroy_single_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int64 *reg, struct script_reg_state *data);
+ if (HPMHooks.count.HP_script_reg_destroy_single_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int64 *reg, struct script_reg_state **data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_single_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_single_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_reg_destroy_single_pre[hIndex].func;
- preHookFunc(sd, &reg, data);
+ preHookFunc(&sd, &reg, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63475,28 +65198,28 @@ void HP_script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct
{
HPMHooks.source.script.reg_destroy_single(sd, reg, data);
}
- if( HPMHooks.count.HP_script_reg_destroy_single_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int64 *reg, struct script_reg_state *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_single_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_reg_destroy_single_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int64 reg, struct script_reg_state *data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_single_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_reg_destroy_single_post[hIndex].func;
- postHookFunc(sd, &reg, data);
+ postHookFunc(sd, reg, data);
}
}
return;
}
-int HP_script_reg_destroy(DBKey key, DBData *data, va_list ap) {
+int HP_script_reg_destroy(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_reg_destroy_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_script_reg_destroy_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_reg_destroy_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63506,12 +65229,12 @@ int HP_script_reg_destroy(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.script.reg_destroy(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_reg_destroy_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_reg_destroy_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_reg_destroy_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_reg_destroy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -63519,14 +65242,14 @@ int HP_script_reg_destroy(DBKey key, DBData *data, va_list ap) {
}
void HP_script_generic_ui_array_expand(unsigned int plus) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_generic_ui_array_expand_pre ) {
+ if (HPMHooks.count.HP_script_generic_ui_array_expand_pre > 0) {
void (*preHookFunc) (unsigned int *plus);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_generic_ui_array_expand_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_generic_ui_array_expand_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_generic_ui_array_expand_pre[hIndex].func;
preHookFunc(&plus);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63534,11 +65257,11 @@ void HP_script_generic_ui_array_expand(unsigned int plus) {
{
HPMHooks.source.script.generic_ui_array_expand(plus);
}
- if( HPMHooks.count.HP_script_generic_ui_array_expand_post ) {
- void (*postHookFunc) (unsigned int *plus);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_generic_ui_array_expand_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_generic_ui_array_expand_post > 0) {
+ void (*postHookFunc) (unsigned int plus);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_generic_ui_array_expand_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_generic_ui_array_expand_post[hIndex].func;
- postHookFunc(&plus);
+ postHookFunc(plus);
}
}
return;
@@ -63546,14 +65269,14 @@ void HP_script_generic_ui_array_expand(unsigned int plus) {
unsigned int* HP_script_array_cpy_list(struct script_array *sa) {
int hIndex = 0;
unsigned int* retVal___ = NULL;
- if( HPMHooks.count.HP_script_array_cpy_list_pre ) {
- unsigned int* (*preHookFunc) (struct script_array *sa);
+ if (HPMHooks.count.HP_script_array_cpy_list_pre > 0) {
+ unsigned int* (*preHookFunc) (struct script_array **sa);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_cpy_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_cpy_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_array_cpy_list_pre[hIndex].func;
- retVal___ = preHookFunc(sa);
+ retVal___ = preHookFunc(&sa);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63561,9 +65284,9 @@ unsigned int* HP_script_array_cpy_list(struct script_array *sa) {
{
retVal___ = HPMHooks.source.script.array_cpy_list(sa);
}
- if( HPMHooks.count.HP_script_array_cpy_list_post ) {
+ if (HPMHooks.count.HP_script_array_cpy_list_post > 0) {
unsigned int* (*postHookFunc) (unsigned int* retVal___, struct script_array *sa);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_cpy_list_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_array_cpy_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_array_cpy_list_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sa);
}
@@ -63572,14 +65295,14 @@ unsigned int* HP_script_array_cpy_list(struct script_array *sa) {
}
void HP_script_hardcoded_constants(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_hardcoded_constants_pre ) {
+ if (HPMHooks.count.HP_script_hardcoded_constants_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_hardcoded_constants_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_hardcoded_constants_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_hardcoded_constants_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63587,9 +65310,9 @@ void HP_script_hardcoded_constants(void) {
{
HPMHooks.source.script.hardcoded_constants();
}
- if( HPMHooks.count.HP_script_hardcoded_constants_post ) {
+ if (HPMHooks.count.HP_script_hardcoded_constants_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_hardcoded_constants_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_hardcoded_constants_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_hardcoded_constants_post[hIndex].func;
postHookFunc();
}
@@ -63599,14 +65322,14 @@ void HP_script_hardcoded_constants(void) {
unsigned short HP_script_mapindexname2id(struct script_state *st, const char *name) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_script_mapindexname2id_pre ) {
- unsigned short (*preHookFunc) (struct script_state *st, const char *name);
+ if (HPMHooks.count.HP_script_mapindexname2id_pre > 0) {
+ unsigned short (*preHookFunc) (struct script_state **st, const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_mapindexname2id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_mapindexname2id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_mapindexname2id_pre[hIndex].func;
- retVal___ = preHookFunc(st, name);
+ retVal___ = preHookFunc(&st, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63614,9 +65337,9 @@ unsigned short HP_script_mapindexname2id(struct script_state *st, const char *na
{
retVal___ = HPMHooks.source.script.mapindexname2id(st, name);
}
- if( HPMHooks.count.HP_script_mapindexname2id_post ) {
+ if (HPMHooks.count.HP_script_mapindexname2id_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, struct script_state *st, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_mapindexname2id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_mapindexname2id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_mapindexname2id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, st, name);
}
@@ -63626,14 +65349,14 @@ unsigned short HP_script_mapindexname2id(struct script_state *st, const char *na
int HP_script_string_dup(char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_string_dup_pre ) {
- int (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_script_string_dup_pre > 0) {
+ int (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_string_dup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_string_dup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_string_dup_pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63641,9 +65364,9 @@ int HP_script_string_dup(char *str) {
{
retVal___ = HPMHooks.source.script.string_dup(str);
}
- if( HPMHooks.count.HP_script_string_dup_post ) {
+ if (HPMHooks.count.HP_script_string_dup_post > 0) {
int (*postHookFunc) (int retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_string_dup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_string_dup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_string_dup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -63652,14 +65375,14 @@ int HP_script_string_dup(char *str) {
}
void HP_script_load_translations(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_load_translations_pre ) {
+ if (HPMHooks.count.HP_script_load_translations_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translations_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translations_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_load_translations_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63667,54 +65390,82 @@ void HP_script_load_translations(void) {
{
HPMHooks.source.script.load_translations();
}
- if( HPMHooks.count.HP_script_load_translations_post ) {
+ if (HPMHooks.count.HP_script_load_translations_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translations_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translations_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_load_translations_post[hIndex].func;
postHookFunc();
}
}
return;
}
-void HP_script_load_translation(const char *file, uint8 lang_id, uint32 *total) {
+bool HP_script_load_translation_addstring(const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_load_translation_pre ) {
- void (*preHookFunc) (const char *file, uint8 *lang_id, uint32 *total);
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_script_load_translation_addstring_pre > 0) {
+ bool (*preHookFunc) (const char **file, uint8 *lang_id, const char **msgctxt, const struct script_string_buf **msgid, const struct script_string_buf **msgstr);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_addstring_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_load_translation_addstring_pre[hIndex].func;
+ retVal___ = preHookFunc(&file, &lang_id, &msgctxt, &msgid, &msgstr);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.load_translation_addstring(file, lang_id, msgctxt, msgid, msgstr);
+ }
+ if (HPMHooks.count.HP_script_load_translation_addstring_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *file, uint8 lang_id, const char *msgctxt, const struct script_string_buf *msgid, const struct script_string_buf *msgstr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_addstring_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_load_translation_addstring_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, file, lang_id, msgctxt, msgid, msgstr);
+ }
+ }
+ return retVal___;
+}
+int HP_script_load_translation(const char *file, uint8 lang_id) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_script_load_translation_pre > 0) {
+ int (*preHookFunc) (const char **file, uint8 *lang_id);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_load_translation_pre[hIndex].func;
- preHookFunc(file, &lang_id, total);
+ retVal___ = preHookFunc(&file, &lang_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
- return;
+ return retVal___;
}
}
{
- HPMHooks.source.script.load_translation(file, lang_id, total);
+ retVal___ = HPMHooks.source.script.load_translation(file, lang_id);
}
- if( HPMHooks.count.HP_script_load_translation_post ) {
- void (*postHookFunc) (const char *file, uint8 *lang_id, uint32 *total);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_load_translation_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *file, uint8 lang_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_load_translation_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_load_translation_post[hIndex].func;
- postHookFunc(file, &lang_id, total);
+ retVal___ = postHookFunc(retVal___, file, lang_id);
}
}
- return;
+ return retVal___;
}
-int HP_script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
+int HP_script_translation_db_destroyer(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_translation_db_destroyer_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_script_translation_db_destroyer_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_translation_db_destroyer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_translation_db_destroyer_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_script_translation_db_destroyer_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63724,12 +65475,12 @@ int HP_script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.script.translation_db_destroyer(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_script_translation_db_destroyer_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_translation_db_destroyer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_translation_db_destroyer_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_translation_db_destroyer_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_script_translation_db_destroyer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -63737,14 +65488,14 @@ int HP_script_translation_db_destroyer(DBKey key, DBData *data, va_list ap) {
}
void HP_script_clear_translations(bool reload) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_clear_translations_pre ) {
+ if (HPMHooks.count.HP_script_clear_translations_pre > 0) {
void (*preHookFunc) (bool *reload);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_clear_translations_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_clear_translations_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_clear_translations_pre[hIndex].func;
preHookFunc(&reload);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63752,11 +65503,11 @@ void HP_script_clear_translations(bool reload) {
{
HPMHooks.source.script.clear_translations(reload);
}
- if( HPMHooks.count.HP_script_clear_translations_post ) {
- void (*postHookFunc) (bool *reload);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_clear_translations_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_clear_translations_post > 0) {
+ void (*postHookFunc) (bool reload);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_clear_translations_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_clear_translations_post[hIndex].func;
- postHookFunc(&reload);
+ postHookFunc(reload);
}
}
return;
@@ -63764,14 +65515,14 @@ void HP_script_clear_translations(bool reload) {
int HP_script_parse_cleanup_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_script_parse_cleanup_timer_pre ) {
+ if (HPMHooks.count.HP_script_parse_cleanup_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_cleanup_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_cleanup_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parse_cleanup_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63779,11 +65530,11 @@ int HP_script_parse_cleanup_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.script.parse_cleanup_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_script_parse_cleanup_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_cleanup_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_parse_cleanup_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_cleanup_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parse_cleanup_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -63791,14 +65542,14 @@ int HP_script_parse_cleanup_timer(int tid, int64 tick, int id, intptr_t data) {
uint8 HP_script_add_language(const char *name) {
int hIndex = 0;
uint8 retVal___ = 0;
- if( HPMHooks.count.HP_script_add_language_pre ) {
- uint8 (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_script_add_language_pre > 0) {
+ uint8 (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_language_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_language_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_add_language_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63806,9 +65557,9 @@ uint8 HP_script_add_language(const char *name) {
{
retVal___ = HPMHooks.source.script.add_language(name);
}
- if( HPMHooks.count.HP_script_add_language_post ) {
+ if (HPMHooks.count.HP_script_add_language_post > 0) {
uint8 (*postHookFunc) (uint8 retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_language_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_language_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_add_language_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -63818,14 +65569,14 @@ uint8 HP_script_add_language(const char *name) {
const char* HP_script_get_translation_file_name(const char *file) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_script_get_translation_file_name_pre ) {
- const char* (*preHookFunc) (const char *file);
+ if (HPMHooks.count.HP_script_get_translation_file_name_pre > 0) {
+ const char* (*preHookFunc) (const char **file);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_translation_file_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_translation_file_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_get_translation_file_name_pre[hIndex].func;
- retVal___ = preHookFunc(file);
+ retVal___ = preHookFunc(&file);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63833,9 +65584,9 @@ const char* HP_script_get_translation_file_name(const char *file) {
{
retVal___ = HPMHooks.source.script.get_translation_file_name(file);
}
- if( HPMHooks.count.HP_script_get_translation_file_name_post ) {
+ if (HPMHooks.count.HP_script_get_translation_file_name_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *file);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_get_translation_file_name_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_get_translation_file_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_get_translation_file_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, file);
}
@@ -63844,14 +65595,14 @@ const char* HP_script_get_translation_file_name(const char *file) {
}
void HP_script_parser_clean_leftovers(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_parser_clean_leftovers_pre ) {
+ if (HPMHooks.count.HP_script_parser_clean_leftovers_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parser_clean_leftovers_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parser_clean_leftovers_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_parser_clean_leftovers_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63859,9 +65610,9 @@ void HP_script_parser_clean_leftovers(void) {
{
HPMHooks.source.script.parser_clean_leftovers();
}
- if( HPMHooks.count.HP_script_parser_clean_leftovers_post ) {
+ if (HPMHooks.count.HP_script_parser_clean_leftovers_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_parser_clean_leftovers_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parser_clean_leftovers_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_parser_clean_leftovers_post[hIndex].func;
postHookFunc();
}
@@ -63870,14 +65621,14 @@ void HP_script_parser_clean_leftovers(void) {
}
void HP_script_run_use_script(struct map_session_data *sd, struct item_data *data, int oid) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_use_script_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid);
+ if (HPMHooks.count.HP_script_run_use_script_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_use_script_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_use_script_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_use_script_pre[hIndex].func;
- preHookFunc(sd, data, &oid);
+ preHookFunc(&sd, &data, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63885,25 +65636,25 @@ void HP_script_run_use_script(struct map_session_data *sd, struct item_data *dat
{
HPMHooks.source.script.run_use_script(sd, data, oid);
}
- if( HPMHooks.count.HP_script_run_use_script_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_use_script_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_use_script_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_use_script_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_use_script_post[hIndex].func;
- postHookFunc(sd, data, &oid);
+ postHookFunc(sd, data, oid);
}
}
return;
}
void HP_script_run_item_equip_script(struct map_session_data *sd, struct item_data *data, int oid) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_item_equip_script_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid);
+ if (HPMHooks.count.HP_script_run_item_equip_script_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_equip_script_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_equip_script_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_item_equip_script_pre[hIndex].func;
- preHookFunc(sd, data, &oid);
+ preHookFunc(&sd, &data, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63911,25 +65662,25 @@ void HP_script_run_item_equip_script(struct map_session_data *sd, struct item_da
{
HPMHooks.source.script.run_item_equip_script(sd, data, oid);
}
- if( HPMHooks.count.HP_script_run_item_equip_script_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_equip_script_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_item_equip_script_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_equip_script_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_item_equip_script_post[hIndex].func;
- postHookFunc(sd, data, &oid);
+ postHookFunc(sd, data, oid);
}
}
return;
}
void HP_script_run_item_unequip_script(struct map_session_data *sd, struct item_data *data, int oid) {
int hIndex = 0;
- if( HPMHooks.count.HP_script_run_item_unequip_script_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid);
+ if (HPMHooks.count.HP_script_run_item_unequip_script_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct item_data **data, int *oid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_unequip_script_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_unequip_script_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_run_item_unequip_script_pre[hIndex].func;
- preHookFunc(sd, data, &oid);
+ preHookFunc(&sd, &data, &oid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63937,27 +65688,27 @@ void HP_script_run_item_unequip_script(struct map_session_data *sd, struct item_
{
HPMHooks.source.script.run_item_unequip_script(sd, data, oid);
}
- if( HPMHooks.count.HP_script_run_item_unequip_script_post ) {
- void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int *oid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_unequip_script_post; hIndex++ ) {
+ if (HPMHooks.count.HP_script_run_item_unequip_script_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct item_data *data, int oid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_run_item_unequip_script_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_run_item_unequip_script_post[hIndex].func;
- postHookFunc(sd, data, &oid);
+ postHookFunc(sd, data, oid);
}
}
return;
}
-/* searchstore */
+/* searchstore_interface */
bool HP_searchstore_open(struct map_session_data *sd, unsigned int uses, unsigned short effect) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_searchstore_open_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, unsigned int *uses, unsigned short *effect);
+ if (HPMHooks.count.HP_searchstore_open_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, unsigned int *uses, unsigned short *effect);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_open_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &uses, &effect);
+ retVal___ = preHookFunc(&sd, &uses, &effect);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -63965,25 +65716,25 @@ bool HP_searchstore_open(struct map_session_data *sd, unsigned int uses, unsigne
{
retVal___ = HPMHooks.source.searchstore.open(sd, uses, effect);
}
- if( HPMHooks.count.HP_searchstore_open_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int *uses, unsigned short *effect);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_open_post; hIndex++ ) {
+ if (HPMHooks.count.HP_searchstore_open_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int uses, unsigned short effect);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_open_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &uses, &effect);
+ retVal___ = postHookFunc(retVal___, sd, uses, effect);
}
}
return retVal___;
}
void HP_searchstore_query(struct map_session_data *sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short *itemlist, unsigned int item_count, const unsigned short *cardlist, unsigned int card_count) {
int hIndex = 0;
- if( HPMHooks.count.HP_searchstore_query_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned char *type, unsigned int *min_price, unsigned int *max_price, const unsigned short *itemlist, unsigned int *item_count, const unsigned short *cardlist, unsigned int *card_count);
+ if (HPMHooks.count.HP_searchstore_query_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned char *type, unsigned int *min_price, unsigned int *max_price, const unsigned short **itemlist, unsigned int *item_count, const unsigned short **cardlist, unsigned int *card_count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_query_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_query_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_query_pre[hIndex].func;
- preHookFunc(sd, &type, &min_price, &max_price, itemlist, &item_count, cardlist, &card_count);
+ preHookFunc(&sd, &type, &min_price, &max_price, &itemlist, &item_count, &cardlist, &card_count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -63991,11 +65742,11 @@ void HP_searchstore_query(struct map_session_data *sd, unsigned char type, unsig
{
HPMHooks.source.searchstore.query(sd, type, min_price, max_price, itemlist, item_count, cardlist, card_count);
}
- if( HPMHooks.count.HP_searchstore_query_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned char *type, unsigned int *min_price, unsigned int *max_price, const unsigned short *itemlist, unsigned int *item_count, const unsigned short *cardlist, unsigned int *card_count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_query_post; hIndex++ ) {
+ if (HPMHooks.count.HP_searchstore_query_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short *itemlist, unsigned int item_count, const unsigned short *cardlist, unsigned int card_count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_query_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_query_post[hIndex].func;
- postHookFunc(sd, &type, &min_price, &max_price, itemlist, &item_count, cardlist, &card_count);
+ postHookFunc(sd, type, min_price, max_price, itemlist, item_count, cardlist, card_count);
}
}
return;
@@ -64003,14 +65754,14 @@ void HP_searchstore_query(struct map_session_data *sd, unsigned char type, unsig
bool HP_searchstore_querynext(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_searchstore_querynext_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_searchstore_querynext_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_querynext_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_querynext_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_querynext_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64018,9 +65769,9 @@ bool HP_searchstore_querynext(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.searchstore.querynext(sd);
}
- if( HPMHooks.count.HP_searchstore_querynext_post ) {
+ if (HPMHooks.count.HP_searchstore_querynext_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_querynext_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_querynext_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_querynext_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -64029,14 +65780,14 @@ bool HP_searchstore_querynext(struct map_session_data *sd) {
}
void HP_searchstore_next(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_searchstore_next_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_searchstore_next_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_next_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_next_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_next_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64044,9 +65795,9 @@ void HP_searchstore_next(struct map_session_data *sd) {
{
HPMHooks.source.searchstore.next(sd);
}
- if( HPMHooks.count.HP_searchstore_next_post ) {
+ if (HPMHooks.count.HP_searchstore_next_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_next_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_next_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_next_post[hIndex].func;
postHookFunc(sd);
}
@@ -64055,14 +65806,14 @@ void HP_searchstore_next(struct map_session_data *sd) {
}
void HP_searchstore_clear(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_searchstore_clear_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_searchstore_clear_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_clear_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64070,9 +65821,9 @@ void HP_searchstore_clear(struct map_session_data *sd) {
{
HPMHooks.source.searchstore.clear(sd);
}
- if( HPMHooks.count.HP_searchstore_clear_post ) {
+ if (HPMHooks.count.HP_searchstore_clear_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_clear_post[hIndex].func;
postHookFunc(sd);
}
@@ -64081,14 +65832,14 @@ void HP_searchstore_clear(struct map_session_data *sd) {
}
void HP_searchstore_close(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_searchstore_close_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_searchstore_close_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_close_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64096,9 +65847,9 @@ void HP_searchstore_close(struct map_session_data *sd) {
{
HPMHooks.source.searchstore.close(sd);
}
- if( HPMHooks.count.HP_searchstore_close_post ) {
+ if (HPMHooks.count.HP_searchstore_close_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_close_post[hIndex].func;
postHookFunc(sd);
}
@@ -64107,14 +65858,14 @@ void HP_searchstore_close(struct map_session_data *sd) {
}
void HP_searchstore_click(struct map_session_data *sd, int account_id, int store_id, unsigned short nameid) {
int hIndex = 0;
- if( HPMHooks.count.HP_searchstore_click_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *account_id, int *store_id, unsigned short *nameid);
+ if (HPMHooks.count.HP_searchstore_click_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *account_id, int *store_id, unsigned short *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_click_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_click_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_click_pre[hIndex].func;
- preHookFunc(sd, &account_id, &store_id, &nameid);
+ preHookFunc(&sd, &account_id, &store_id, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64122,11 +65873,11 @@ void HP_searchstore_click(struct map_session_data *sd, int account_id, int store
{
HPMHooks.source.searchstore.click(sd, account_id, store_id, nameid);
}
- if( HPMHooks.count.HP_searchstore_click_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *account_id, int *store_id, unsigned short *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_click_post; hIndex++ ) {
+ if (HPMHooks.count.HP_searchstore_click_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int account_id, int store_id, unsigned short nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_click_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_click_post[hIndex].func;
- postHookFunc(sd, &account_id, &store_id, &nameid);
+ postHookFunc(sd, account_id, store_id, nameid);
}
}
return;
@@ -64134,14 +65885,14 @@ void HP_searchstore_click(struct map_session_data *sd, int account_id, int store
bool HP_searchstore_queryremote(struct map_session_data *sd, int account_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_searchstore_queryremote_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, int *account_id);
+ if (HPMHooks.count.HP_searchstore_queryremote_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, int *account_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_queryremote_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_queryremote_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_queryremote_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &account_id);
+ retVal___ = preHookFunc(&sd, &account_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64149,25 +65900,25 @@ bool HP_searchstore_queryremote(struct map_session_data *sd, int account_id) {
{
retVal___ = HPMHooks.source.searchstore.queryremote(sd, account_id);
}
- if( HPMHooks.count.HP_searchstore_queryremote_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *account_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_queryremote_post; hIndex++ ) {
+ if (HPMHooks.count.HP_searchstore_queryremote_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int account_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_queryremote_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_queryremote_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &account_id);
+ retVal___ = postHookFunc(retVal___, sd, account_id);
}
}
return retVal___;
}
void HP_searchstore_clearremote(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_searchstore_clearremote_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_searchstore_clearremote_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clearremote_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clearremote_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_clearremote_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64175,9 +65926,9 @@ void HP_searchstore_clearremote(struct map_session_data *sd) {
{
HPMHooks.source.searchstore.clearremote(sd);
}
- if( HPMHooks.count.HP_searchstore_clearremote_post ) {
+ if (HPMHooks.count.HP_searchstore_clearremote_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clearremote_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_clearremote_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_clearremote_post[hIndex].func;
postHookFunc(sd);
}
@@ -64187,14 +65938,14 @@ void HP_searchstore_clearremote(struct map_session_data *sd) {
bool HP_searchstore_result(struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short *card, unsigned char refine) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_searchstore_result_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, unsigned int *store_id, int *account_id, const char *store_name, unsigned short *nameid, unsigned short *amount, unsigned int *price, const short *card, unsigned char *refine);
+ if (HPMHooks.count.HP_searchstore_result_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, unsigned int *store_id, int *account_id, const char **store_name, unsigned short *nameid, unsigned short *amount, unsigned int *price, const short **card, unsigned char *refine);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_result_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_result_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_searchstore_result_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &store_id, &account_id, store_name, &nameid, &amount, &price, card, &refine);
+ retVal___ = preHookFunc(&sd, &store_id, &account_id, &store_name, &nameid, &amount, &price, &card, &refine);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64202,26 +65953,26 @@ bool HP_searchstore_result(struct map_session_data *sd, unsigned int store_id, i
{
retVal___ = HPMHooks.source.searchstore.result(sd, store_id, account_id, store_name, nameid, amount, price, card, refine);
}
- if( HPMHooks.count.HP_searchstore_result_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int *store_id, int *account_id, const char *store_name, unsigned short *nameid, unsigned short *amount, unsigned int *price, const short *card, unsigned char *refine);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_result_post; hIndex++ ) {
+ if (HPMHooks.count.HP_searchstore_result_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short *card, unsigned char refine);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_result_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_searchstore_result_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &store_id, &account_id, store_name, &nameid, &amount, &price, card, &refine);
+ retVal___ = postHookFunc(retVal___, sd, store_id, account_id, store_name, nameid, amount, price, card, refine);
}
}
return retVal___;
}
-/* showmsg */
+/* showmsg_interface */
void HP_showmsg_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_init_pre ) {
+ if (HPMHooks.count.HP_showmsg_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64229,9 +65980,9 @@ void HP_showmsg_init(void) {
{
HPMHooks.source.showmsg.init();
}
- if( HPMHooks.count.HP_showmsg_init_post ) {
+ if (HPMHooks.count.HP_showmsg_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_init_post[hIndex].func;
postHookFunc();
}
@@ -64240,14 +65991,14 @@ void HP_showmsg_init(void) {
}
void HP_showmsg_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_final_pre ) {
+ if (HPMHooks.count.HP_showmsg_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64255,9 +66006,9 @@ void HP_showmsg_final(void) {
{
HPMHooks.source.showmsg.final();
}
- if( HPMHooks.count.HP_showmsg_final_post ) {
+ if (HPMHooks.count.HP_showmsg_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_final_post[hIndex].func;
postHookFunc();
}
@@ -64266,14 +66017,14 @@ void HP_showmsg_final(void) {
}
void HP_showmsg_clearScreen(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_showmsg_clearScreen_pre ) {
+ if (HPMHooks.count.HP_showmsg_clearScreen_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_showmsg_clearScreen_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64281,9 +66032,9 @@ void HP_showmsg_clearScreen(void) {
{
HPMHooks.source.showmsg.clearScreen();
}
- if( HPMHooks.count.HP_showmsg_clearScreen_post ) {
+ if (HPMHooks.count.HP_showmsg_clearScreen_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_clearScreen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_showmsg_clearScreen_post[hIndex].func;
postHookFunc();
}
@@ -64293,16 +66044,16 @@ void HP_showmsg_clearScreen(void) {
int HP_showmsg_showMessageV(const char *string, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_showmsg_showMessageV_pre ) {
- int (*preHookFunc) (const char *string, va_list ap);
+ if (HPMHooks.count.HP_showmsg_showMessageV_pre > 0) {
+ int (*preHookFunc) (const char **string, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_showmsg_showMessageV_pre[hIndex].func;
- retVal___ = preHookFunc(string, ap___copy);
+ retVal___ = preHookFunc(&string, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64312,9 +66063,9 @@ int HP_showmsg_showMessageV(const char *string, va_list ap) {
retVal___ = HPMHooks.source.showmsg.showMessageV(string, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_showmsg_showMessageV_post ) {
+ if (HPMHooks.count.HP_showmsg_showMessageV_post > 0) {
int (*postHookFunc) (int retVal___, const char *string, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_showmsg_showMessageV_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_showmsg_showMessageV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, string, ap___copy);
@@ -64323,18 +66074,18 @@ int HP_showmsg_showMessageV(const char *string, va_list ap) {
}
return retVal___;
}
-/* skill */
+/* skill_interface */
int HP_skill_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_init_pre ) {
+ if (HPMHooks.count.HP_skill_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64342,11 +66093,11 @@ int HP_skill_init(bool minimal) {
{
retVal___ = HPMHooks.source.skill.init(minimal);
}
- if( HPMHooks.count.HP_skill_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
@@ -64354,14 +66105,14 @@ int HP_skill_init(bool minimal) {
int HP_skill_final(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_final_pre ) {
+ if (HPMHooks.count.HP_skill_final_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_final_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64369,9 +66120,9 @@ int HP_skill_final(void) {
{
retVal___ = HPMHooks.source.skill.final();
}
- if( HPMHooks.count.HP_skill_final_post ) {
+ if (HPMHooks.count.HP_skill_final_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_final_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -64380,14 +66131,14 @@ int HP_skill_final(void) {
}
void HP_skill_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_reload_pre ) {
+ if (HPMHooks.count.HP_skill_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64395,9 +66146,9 @@ void HP_skill_reload(void) {
{
HPMHooks.source.skill.reload();
}
- if( HPMHooks.count.HP_skill_reload_post ) {
+ if (HPMHooks.count.HP_skill_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_reload_post[hIndex].func;
postHookFunc();
}
@@ -64406,14 +66157,14 @@ void HP_skill_reload(void) {
}
void HP_skill_read_db(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_read_db_pre ) {
+ if (HPMHooks.count.HP_skill_read_db_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_read_db_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -64421,11 +66172,11 @@ void HP_skill_read_db(bool minimal) {
{
HPMHooks.source.skill.read_db(minimal);
}
- if( HPMHooks.count.HP_skill_read_db_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_db_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_read_db_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_read_db_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
@@ -64433,14 +66184,14 @@ void HP_skill_read_db(bool minimal) {
int HP_skill_get_index(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_index_pre ) {
+ if (HPMHooks.count.HP_skill_get_index_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_index_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_index_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_index_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64448,11 +66199,11 @@ int HP_skill_get_index(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_index(skill_id);
}
- if( HPMHooks.count.HP_skill_get_index_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_index_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_index_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_index_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_index_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64460,14 +66211,14 @@ int HP_skill_get_index(uint16 skill_id) {
int HP_skill_get_type(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_type_pre ) {
+ if (HPMHooks.count.HP_skill_get_type_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_type_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64475,11 +66226,11 @@ int HP_skill_get_type(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_type(skill_id);
}
- if( HPMHooks.count.HP_skill_get_type_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_type_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_type_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64487,14 +66238,14 @@ int HP_skill_get_type(uint16 skill_id) {
int HP_skill_get_hit(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_hit_pre ) {
+ if (HPMHooks.count.HP_skill_get_hit_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_hit_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64502,11 +66253,11 @@ int HP_skill_get_hit(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_hit(skill_id);
}
- if( HPMHooks.count.HP_skill_get_hit_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_hit_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_hit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64514,14 +66265,14 @@ int HP_skill_get_hit(uint16 skill_id) {
int HP_skill_get_inf(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_inf_pre ) {
+ if (HPMHooks.count.HP_skill_get_inf_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_inf_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64529,11 +66280,11 @@ int HP_skill_get_inf(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_inf(skill_id);
}
- if( HPMHooks.count.HP_skill_get_inf_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_inf_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_inf_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64541,14 +66292,14 @@ int HP_skill_get_inf(uint16 skill_id) {
int HP_skill_get_ele(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_ele_pre ) {
+ if (HPMHooks.count.HP_skill_get_ele_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ele_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ele_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_ele_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64556,11 +66307,11 @@ int HP_skill_get_ele(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_ele(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_ele_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ele_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_ele_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ele_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_ele_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64568,14 +66319,14 @@ int HP_skill_get_ele(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_nk(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_nk_pre ) {
+ if (HPMHooks.count.HP_skill_get_nk_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_nk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_nk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_nk_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64583,11 +66334,11 @@ int HP_skill_get_nk(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_nk(skill_id);
}
- if( HPMHooks.count.HP_skill_get_nk_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_nk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_nk_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_nk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_nk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64595,14 +66346,14 @@ int HP_skill_get_nk(uint16 skill_id) {
int HP_skill_get_max(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_max_pre ) {
+ if (HPMHooks.count.HP_skill_get_max_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_max_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_max_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_max_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64610,11 +66361,11 @@ int HP_skill_get_max(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_max(skill_id);
}
- if( HPMHooks.count.HP_skill_get_max_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_max_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_max_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_max_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_max_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64622,14 +66373,14 @@ int HP_skill_get_max(uint16 skill_id) {
int HP_skill_get_range(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_range_pre ) {
+ if (HPMHooks.count.HP_skill_get_range_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_range_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64637,11 +66388,11 @@ int HP_skill_get_range(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_range(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_range_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_range_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_range_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64649,14 +66400,14 @@ int HP_skill_get_range(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_range2(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_range2_pre ) {
- int (*preHookFunc) (struct block_list *bl, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_get_range2_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_range2_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&bl, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64664,11 +66415,11 @@ int HP_skill_get_range2(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
{
retVal___ = HPMHooks.source.skill.get_range2(bl, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_range2_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_range2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_range2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_range2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, bl, skill_id, skill_lv);
}
}
return retVal___;
@@ -64676,14 +66427,14 @@ int HP_skill_get_range2(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
int HP_skill_get_splash(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_splash_pre ) {
+ if (HPMHooks.count.HP_skill_get_splash_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_splash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_splash_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_splash_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64691,11 +66442,11 @@ int HP_skill_get_splash(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_splash(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_splash_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_splash_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_splash_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_splash_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_splash_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64703,14 +66454,14 @@ int HP_skill_get_splash(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_hp(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_hp_pre ) {
+ if (HPMHooks.count.HP_skill_get_hp_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_hp_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64718,11 +66469,11 @@ int HP_skill_get_hp(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_hp(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_hp_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_hp_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_hp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_hp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64730,14 +66481,14 @@ int HP_skill_get_hp(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_mhp(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_mhp_pre ) {
+ if (HPMHooks.count.HP_skill_get_mhp_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_mhp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_mhp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_mhp_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64745,11 +66496,11 @@ int HP_skill_get_mhp(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_mhp(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_mhp_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_mhp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_mhp_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_mhp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_mhp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64757,14 +66508,14 @@ int HP_skill_get_mhp(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_sp(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_sp_pre ) {
+ if (HPMHooks.count.HP_skill_get_sp_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_sp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_sp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_sp_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64772,11 +66523,11 @@ int HP_skill_get_sp(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_sp(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_sp_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_sp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_sp_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_sp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_sp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64784,14 +66535,14 @@ int HP_skill_get_sp(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_state(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_state_pre ) {
+ if (HPMHooks.count.HP_skill_get_state_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_state_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_state_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_state_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64799,11 +66550,11 @@ int HP_skill_get_state(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_state(skill_id);
}
- if( HPMHooks.count.HP_skill_get_state_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_state_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_state_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_state_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_state_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -64811,14 +66562,14 @@ int HP_skill_get_state(uint16 skill_id) {
int HP_skill_get_spiritball(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_spiritball_pre ) {
+ if (HPMHooks.count.HP_skill_get_spiritball_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_spiritball_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_spiritball_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_spiritball_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64826,11 +66577,11 @@ int HP_skill_get_spiritball(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_spiritball(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_spiritball_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_spiritball_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_spiritball_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_spiritball_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_spiritball_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64838,14 +66589,14 @@ int HP_skill_get_spiritball(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_zeny(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_zeny_pre ) {
+ if (HPMHooks.count.HP_skill_get_zeny_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_zeny_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_zeny_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_zeny_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64853,11 +66604,11 @@ int HP_skill_get_zeny(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_zeny(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_zeny_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_zeny_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_zeny_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_zeny_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_zeny_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64865,14 +66616,14 @@ int HP_skill_get_zeny(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_num(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_num_pre ) {
+ if (HPMHooks.count.HP_skill_get_num_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_num_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_num_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_num_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64880,11 +66631,11 @@ int HP_skill_get_num(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_num(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_num_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_num_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_num_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_num_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_num_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64892,14 +66643,14 @@ int HP_skill_get_num(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_cast(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_cast_pre ) {
+ if (HPMHooks.count.HP_skill_get_cast_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_cast_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64907,11 +66658,11 @@ int HP_skill_get_cast(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_cast(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_cast_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_cast_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_cast_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64919,14 +66670,14 @@ int HP_skill_get_cast(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_delay(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_delay_pre ) {
+ if (HPMHooks.count.HP_skill_get_delay_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_delay_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64934,11 +66685,11 @@ int HP_skill_get_delay(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_delay(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_delay_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delay_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_delay_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_delay_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64946,14 +66697,14 @@ int HP_skill_get_delay(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_walkdelay(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_walkdelay_pre ) {
+ if (HPMHooks.count.HP_skill_get_walkdelay_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_walkdelay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_walkdelay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_walkdelay_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64961,11 +66712,11 @@ int HP_skill_get_walkdelay(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_walkdelay(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_walkdelay_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_walkdelay_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_walkdelay_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_walkdelay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_walkdelay_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -64973,14 +66724,14 @@ int HP_skill_get_walkdelay(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_time(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_time_pre ) {
+ if (HPMHooks.count.HP_skill_get_time_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_time_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -64988,11 +66739,11 @@ int HP_skill_get_time(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_time(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_time_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_time_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_time_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65000,14 +66751,14 @@ int HP_skill_get_time(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_time2(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_time2_pre ) {
+ if (HPMHooks.count.HP_skill_get_time2_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_time2_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65015,11 +66766,11 @@ int HP_skill_get_time2(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_time2(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_time2_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_time2_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_time2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_time2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65027,14 +66778,14 @@ int HP_skill_get_time2(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_castnodex(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_castnodex_pre ) {
+ if (HPMHooks.count.HP_skill_get_castnodex_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castnodex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castnodex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_castnodex_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65042,11 +66793,11 @@ int HP_skill_get_castnodex(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_castnodex(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_castnodex_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castnodex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_castnodex_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castnodex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_castnodex_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65054,14 +66805,14 @@ int HP_skill_get_castnodex(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_delaynodex(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_delaynodex_pre ) {
+ if (HPMHooks.count.HP_skill_get_delaynodex_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delaynodex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delaynodex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_delaynodex_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65069,11 +66820,11 @@ int HP_skill_get_delaynodex(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_delaynodex(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_delaynodex_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delaynodex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_delaynodex_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_delaynodex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_delaynodex_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65081,14 +66832,14 @@ int HP_skill_get_delaynodex(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_castdef(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_castdef_pre ) {
+ if (HPMHooks.count.HP_skill_get_castdef_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castdef_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castdef_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_castdef_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65096,11 +66847,11 @@ int HP_skill_get_castdef(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_castdef(skill_id);
}
- if( HPMHooks.count.HP_skill_get_castdef_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castdef_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_castdef_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castdef_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_castdef_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65108,14 +66859,14 @@ int HP_skill_get_castdef(uint16 skill_id) {
int HP_skill_get_weapontype(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_weapontype_pre ) {
+ if (HPMHooks.count.HP_skill_get_weapontype_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_weapontype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_weapontype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_weapontype_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65123,11 +66874,11 @@ int HP_skill_get_weapontype(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_weapontype(skill_id);
}
- if( HPMHooks.count.HP_skill_get_weapontype_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_weapontype_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_weapontype_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_weapontype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_weapontype_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65135,14 +66886,14 @@ int HP_skill_get_weapontype(uint16 skill_id) {
int HP_skill_get_ammotype(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_ammotype_pre ) {
+ if (HPMHooks.count.HP_skill_get_ammotype_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammotype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammotype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_ammotype_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65150,11 +66901,11 @@ int HP_skill_get_ammotype(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_ammotype(skill_id);
}
- if( HPMHooks.count.HP_skill_get_ammotype_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammotype_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_ammotype_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammotype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_ammotype_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65162,14 +66913,14 @@ int HP_skill_get_ammotype(uint16 skill_id) {
int HP_skill_get_ammo_qty(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_ammo_qty_pre ) {
+ if (HPMHooks.count.HP_skill_get_ammo_qty_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammo_qty_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammo_qty_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_ammo_qty_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65177,11 +66928,11 @@ int HP_skill_get_ammo_qty(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_ammo_qty(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_ammo_qty_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammo_qty_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_ammo_qty_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_ammo_qty_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_ammo_qty_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65189,14 +66940,14 @@ int HP_skill_get_ammo_qty(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_unit_id(uint16 skill_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_id_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_id_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_id_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65204,11 +66955,11 @@ int HP_skill_get_unit_id(uint16 skill_id, int flag) {
{
retVal___ = HPMHooks.source.skill.get_unit_id(skill_id, flag);
}
- if( HPMHooks.count.HP_skill_get_unit_id_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_id_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &flag);
+ retVal___ = postHookFunc(retVal___, skill_id, flag);
}
}
return retVal___;
@@ -65216,14 +66967,14 @@ int HP_skill_get_unit_id(uint16 skill_id, int flag) {
int HP_skill_get_inf2(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_inf2_pre ) {
+ if (HPMHooks.count.HP_skill_get_inf2_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_inf2_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65231,11 +66982,11 @@ int HP_skill_get_inf2(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_inf2(skill_id);
}
- if( HPMHooks.count.HP_skill_get_inf2_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_inf2_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_inf2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_inf2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65243,14 +66994,14 @@ int HP_skill_get_inf2(uint16 skill_id) {
int HP_skill_get_castcancel(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_castcancel_pre ) {
+ if (HPMHooks.count.HP_skill_get_castcancel_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castcancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castcancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_castcancel_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65258,11 +67009,11 @@ int HP_skill_get_castcancel(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_castcancel(skill_id);
}
- if( HPMHooks.count.HP_skill_get_castcancel_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castcancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_castcancel_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_castcancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_castcancel_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65270,14 +67021,14 @@ int HP_skill_get_castcancel(uint16 skill_id) {
int HP_skill_get_maxcount(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_maxcount_pre ) {
+ if (HPMHooks.count.HP_skill_get_maxcount_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_maxcount_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_maxcount_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_maxcount_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65285,11 +67036,11 @@ int HP_skill_get_maxcount(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_maxcount(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_maxcount_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_maxcount_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_maxcount_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_maxcount_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_maxcount_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65297,14 +67048,14 @@ int HP_skill_get_maxcount(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_blewcount(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_blewcount_pre ) {
+ if (HPMHooks.count.HP_skill_get_blewcount_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_blewcount_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_blewcount_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_blewcount_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65312,11 +67063,11 @@ int HP_skill_get_blewcount(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_blewcount(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_blewcount_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_blewcount_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_blewcount_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_blewcount_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_blewcount_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65324,14 +67075,14 @@ int HP_skill_get_blewcount(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_unit_flag(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_flag_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_flag_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_flag_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_flag_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_flag_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65339,11 +67090,11 @@ int HP_skill_get_unit_flag(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_unit_flag(skill_id);
}
- if( HPMHooks.count.HP_skill_get_unit_flag_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_flag_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_flag_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_flag_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_flag_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65351,14 +67102,14 @@ int HP_skill_get_unit_flag(uint16 skill_id) {
int HP_skill_get_unit_target(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_target_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_target_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_target_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65366,11 +67117,11 @@ int HP_skill_get_unit_target(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_unit_target(skill_id);
}
- if( HPMHooks.count.HP_skill_get_unit_target_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_target_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_target_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_target_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65378,14 +67129,14 @@ int HP_skill_get_unit_target(uint16 skill_id) {
int HP_skill_get_unit_interval(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_interval_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_interval_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_interval_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_interval_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_interval_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65393,11 +67144,11 @@ int HP_skill_get_unit_interval(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_unit_interval(skill_id);
}
- if( HPMHooks.count.HP_skill_get_unit_interval_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_interval_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_interval_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_interval_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_interval_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65405,14 +67156,14 @@ int HP_skill_get_unit_interval(uint16 skill_id) {
int HP_skill_get_unit_bl_target(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_bl_target_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_bl_target_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_bl_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_bl_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_bl_target_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65420,11 +67171,11 @@ int HP_skill_get_unit_bl_target(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_unit_bl_target(skill_id);
}
- if( HPMHooks.count.HP_skill_get_unit_bl_target_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_bl_target_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_bl_target_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_bl_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_bl_target_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65432,14 +67183,14 @@ int HP_skill_get_unit_bl_target(uint16 skill_id) {
int HP_skill_get_unit_layout_type(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_layout_type_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_layout_type_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_layout_type_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65447,11 +67198,11 @@ int HP_skill_get_unit_layout_type(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_unit_layout_type(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_unit_layout_type_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_layout_type_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_layout_type_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65459,14 +67210,14 @@ int HP_skill_get_unit_layout_type(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_unit_range(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_unit_range_pre ) {
+ if (HPMHooks.count.HP_skill_get_unit_range_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_range_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_range_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_range_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65474,11 +67225,11 @@ int HP_skill_get_unit_range(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_unit_range(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_unit_range_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_range_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_range_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_range_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_range_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -65486,14 +67237,14 @@ int HP_skill_get_unit_range(uint16 skill_id, uint16 skill_lv) {
int HP_skill_get_cooldown(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_cooldown_pre ) {
+ if (HPMHooks.count.HP_skill_get_cooldown_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cooldown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cooldown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_cooldown_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65501,38 +67252,38 @@ int HP_skill_get_cooldown(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_cooldown(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_cooldown_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cooldown_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_cooldown_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_cooldown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_cooldown_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
}
-int HP_skill_tree_get_max(uint16 skill_id, int b_class) {
+int HP_skill_tree_get_max(uint16 skill_id, int class) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_tree_get_max_pre ) {
- int (*preHookFunc) (uint16 *skill_id, int *b_class);
+ if (HPMHooks.count.HP_skill_tree_get_max_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, int *class);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_tree_get_max_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_tree_get_max_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_tree_get_max_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, &b_class);
+ retVal___ = preHookFunc(&skill_id, &class);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.tree_get_max(skill_id, b_class);
+ retVal___ = HPMHooks.source.skill.tree_get_max(skill_id, class);
}
- if( HPMHooks.count.HP_skill_tree_get_max_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, int *b_class);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_tree_get_max_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_tree_get_max_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, int class);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_tree_get_max_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_tree_get_max_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &b_class);
+ retVal___ = postHookFunc(retVal___, skill_id, class);
}
}
return retVal___;
@@ -65540,14 +67291,14 @@ int HP_skill_tree_get_max(uint16 skill_id, int b_class) {
const char* HP_skill_get_name(uint16 skill_id) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_get_name_pre ) {
+ if (HPMHooks.count.HP_skill_get_name_pre > 0) {
const char* (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_name_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65555,11 +67306,11 @@ const char* HP_skill_get_name(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_name(skill_id);
}
- if( HPMHooks.count.HP_skill_get_name_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_name_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65567,14 +67318,14 @@ const char* HP_skill_get_name(uint16 skill_id) {
const char* HP_skill_get_desc(uint16 skill_id) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_get_desc_pre ) {
+ if (HPMHooks.count.HP_skill_get_desc_pre > 0) {
const char* (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_desc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_desc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_desc_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65582,25 +67333,25 @@ const char* HP_skill_get_desc(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_desc(skill_id);
}
- if( HPMHooks.count.HP_skill_get_desc_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_desc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_desc_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_desc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_desc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
}
void HP_skill_chk(uint16 *skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_chk_pre ) {
- void (*preHookFunc) (uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_chk_pre > 0) {
+ void (*preHookFunc) (uint16 **skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_chk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_chk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_chk_pre[hIndex].func;
- preHookFunc(skill_id);
+ preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -65608,9 +67359,9 @@ void HP_skill_chk(uint16 *skill_id) {
{
HPMHooks.source.skill.chk(skill_id);
}
- if( HPMHooks.count.HP_skill_chk_post ) {
+ if (HPMHooks.count.HP_skill_chk_post > 0) {
void (*postHookFunc) (uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_chk_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_chk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_chk_post[hIndex].func;
postHookFunc(skill_id);
}
@@ -65620,14 +67371,14 @@ void HP_skill_chk(uint16 *skill_id) {
int HP_skill_get_casttype(uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_casttype_pre ) {
+ if (HPMHooks.count.HP_skill_get_casttype_pre > 0) {
int (*preHookFunc) (uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_casttype_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65635,11 +67386,11 @@ int HP_skill_get_casttype(uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.get_casttype(skill_id);
}
- if( HPMHooks.count.HP_skill_get_casttype_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_casttype_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_casttype_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65647,14 +67398,14 @@ int HP_skill_get_casttype(uint16 skill_id) {
int HP_skill_get_casttype2(uint16 index) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_casttype2_pre ) {
+ if (HPMHooks.count.HP_skill_get_casttype2_pre > 0) {
int (*preHookFunc) (uint16 *index);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_casttype2_pre[hIndex].func;
retVal___ = preHookFunc(&index);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65662,11 +67413,11 @@ int HP_skill_get_casttype2(uint16 index) {
{
retVal___ = HPMHooks.source.skill.get_casttype2(index);
}
- if( HPMHooks.count.HP_skill_get_casttype2_post ) {
- int (*postHookFunc) (int retVal___, uint16 *index);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_casttype2_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_casttype2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_casttype2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &index);
+ retVal___ = postHookFunc(retVal___, index);
}
}
return retVal___;
@@ -65674,14 +67425,14 @@ int HP_skill_get_casttype2(uint16 index) {
bool HP_skill_is_combo(int skill_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_is_combo_pre ) {
+ if (HPMHooks.count.HP_skill_is_combo_pre > 0) {
bool (*preHookFunc) (int *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_is_combo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_is_combo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_is_combo_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65689,11 +67440,11 @@ bool HP_skill_is_combo(int skill_id) {
{
retVal___ = HPMHooks.source.skill.is_combo(skill_id);
}
- if( HPMHooks.count.HP_skill_is_combo_post ) {
- bool (*postHookFunc) (bool retVal___, int *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_is_combo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_is_combo_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_is_combo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_is_combo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -65701,14 +67452,14 @@ bool HP_skill_is_combo(int skill_id) {
int HP_skill_name2id(const char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_name2id_pre ) {
- int (*preHookFunc) (const char *name);
+ if (HPMHooks.count.HP_skill_name2id_pre > 0) {
+ int (*preHookFunc) (const char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_name2id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_name2id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_name2id_pre[hIndex].func;
- retVal___ = preHookFunc(name);
+ retVal___ = preHookFunc(&name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65716,9 +67467,9 @@ int HP_skill_name2id(const char *name) {
{
retVal___ = HPMHooks.source.skill.name2id(name);
}
- if( HPMHooks.count.HP_skill_name2id_post ) {
+ if (HPMHooks.count.HP_skill_name2id_post > 0) {
int (*postHookFunc) (int retVal___, const char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_name2id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_name2id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_name2id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, name);
}
@@ -65728,14 +67479,14 @@ int HP_skill_name2id(const char *name) {
int HP_skill_isammotype(struct map_session_data *sd, int skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_isammotype_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *skill_id);
+ if (HPMHooks.count.HP_skill_isammotype_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_isammotype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_isammotype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_isammotype_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65743,11 +67494,11 @@ int HP_skill_isammotype(struct map_session_data *sd, int skill_id) {
{
retVal___ = HPMHooks.source.skill.isammotype(sd, skill_id);
}
- if( HPMHooks.count.HP_skill_isammotype_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_isammotype_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_isammotype_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_isammotype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_isammotype_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
@@ -65755,14 +67506,14 @@ int HP_skill_isammotype(struct map_session_data *sd, int skill_id) {
int HP_skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_castend_id_pre ) {
+ if (HPMHooks.count.HP_skill_castend_id_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_id_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65770,11 +67521,11 @@ int HP_skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.castend_id(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_castend_id_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_castend_id_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -65782,14 +67533,14 @@ int HP_skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
int HP_skill_castend_pos(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_castend_pos_pre ) {
+ if (HPMHooks.count.HP_skill_castend_pos_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_pos_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65797,11 +67548,11 @@ int HP_skill_castend_pos(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.castend_pos(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_castend_pos_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_castend_pos_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_pos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -65809,14 +67560,14 @@ int HP_skill_castend_pos(int tid, int64 tick, int id, intptr_t data) {
int HP_skill_castend_map(struct map_session_data *sd, uint16 skill_id, const char *mapname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_castend_map_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, const char *mapname);
+ if (HPMHooks.count.HP_skill_castend_map_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, const char **mapname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_map_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_map_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_map_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, mapname);
+ retVal___ = preHookFunc(&sd, &skill_id, &mapname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65824,11 +67575,11 @@ int HP_skill_castend_map(struct map_session_data *sd, uint16 skill_id, const cha
{
retVal___ = HPMHooks.source.skill.castend_map(sd, skill_id, mapname);
}
- if( HPMHooks.count.HP_skill_castend_map_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, const char *mapname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_map_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_castend_map_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, const char *mapname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_map_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_map_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, mapname);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, mapname);
}
}
return retVal___;
@@ -65836,14 +67587,14 @@ int HP_skill_castend_map(struct map_session_data *sd, uint16 skill_id, const cha
int HP_skill_cleartimerskill(struct block_list *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_cleartimerskill_pre ) {
- int (*preHookFunc) (struct block_list *src);
+ if (HPMHooks.count.HP_skill_cleartimerskill_pre > 0) {
+ int (*preHookFunc) (struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_cleartimerskill_pre[hIndex].func;
- retVal___ = preHookFunc(src);
+ retVal___ = preHookFunc(&src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65851,9 +67602,9 @@ int HP_skill_cleartimerskill(struct block_list *src) {
{
retVal___ = HPMHooks.source.skill.cleartimerskill(src);
}
- if( HPMHooks.count.HP_skill_cleartimerskill_post ) {
+ if (HPMHooks.count.HP_skill_cleartimerskill_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_cleartimerskill_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src);
}
@@ -65863,14 +67614,14 @@ int HP_skill_cleartimerskill(struct block_list *src) {
int HP_skill_addtimerskill(struct block_list *src, int64 tick, int target, int x, int y, uint16 skill_id, uint16 skill_lv, int type, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_addtimerskill_pre ) {
- int (*preHookFunc) (struct block_list *src, int64 *tick, int *target, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int *type, int *flag);
+ if (HPMHooks.count.HP_skill_addtimerskill_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int64 *tick, int *target, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int *type, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_addtimerskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_addtimerskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_addtimerskill_pre[hIndex].func;
- retVal___ = preHookFunc(src, &tick, &target, &x, &y, &skill_id, &skill_lv, &type, &flag);
+ retVal___ = preHookFunc(&src, &tick, &target, &x, &y, &skill_id, &skill_lv, &type, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65878,11 +67629,11 @@ int HP_skill_addtimerskill(struct block_list *src, int64 tick, int target, int x
{
retVal___ = HPMHooks.source.skill.addtimerskill(src, tick, target, x, y, skill_id, skill_lv, type, flag);
}
- if( HPMHooks.count.HP_skill_addtimerskill_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int64 *tick, int *target, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int *type, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_addtimerskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_addtimerskill_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int64 tick, int target, int x, int y, uint16 skill_id, uint16 skill_lv, int type, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_addtimerskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_addtimerskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &tick, &target, &x, &y, &skill_id, &skill_lv, &type, &flag);
+ retVal___ = postHookFunc(retVal___, src, tick, target, x, y, skill_id, skill_lv, type, flag);
}
}
return retVal___;
@@ -65890,14 +67641,14 @@ int HP_skill_addtimerskill(struct block_list *src, int64 tick, int target, int x
int HP_skill_additional_effect(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int dmg_lv, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_additional_effect_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
+ if (HPMHooks.count.HP_skill_additional_effect_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_additional_effect_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &skill_id, &skill_lv, &attack_type, &dmg_lv, &tick);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &attack_type, &dmg_lv, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65905,11 +67656,11 @@ int HP_skill_additional_effect(struct block_list *src, struct block_list *bl, ui
{
retVal___ = HPMHooks.source.skill.additional_effect(src, bl, skill_id, skill_lv, attack_type, dmg_lv, tick);
}
- if( HPMHooks.count.HP_skill_additional_effect_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_additional_effect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int dmg_lv, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_additional_effect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &skill_id, &skill_lv, &attack_type, &dmg_lv, &tick);
+ retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, attack_type, dmg_lv, tick);
}
}
return retVal___;
@@ -65917,14 +67668,14 @@ int HP_skill_additional_effect(struct block_list *src, struct block_list *bl, ui
int HP_skill_counter_additional_effect(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_counter_additional_effect_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
+ if (HPMHooks.count.HP_skill_counter_additional_effect_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_counter_additional_effect_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &skill_id, &skill_lv, &attack_type, &tick);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &attack_type, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65932,11 +67683,11 @@ int HP_skill_counter_additional_effect(struct block_list *src, struct block_list
{
retVal___ = HPMHooks.source.skill.counter_additional_effect(src, bl, skill_id, skill_lv, attack_type, tick);
}
- if( HPMHooks.count.HP_skill_counter_additional_effect_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_counter_additional_effect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_counter_additional_effect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &skill_id, &skill_lv, &attack_type, &tick);
+ retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, attack_type, tick);
}
}
return retVal___;
@@ -65944,14 +67695,14 @@ int HP_skill_counter_additional_effect(struct block_list *src, struct block_list
int HP_skill_blown(struct block_list *src, struct block_list *target, int count, int8 dir, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blown_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, int *count, int8 *dir, int *flag);
+ if (HPMHooks.count.HP_skill_blown_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, int *count, int8 *dir, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blown_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &count, &dir, &flag);
+ retVal___ = preHookFunc(&src, &target, &count, &dir, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65959,11 +67710,11 @@ int HP_skill_blown(struct block_list *src, struct block_list *target, int count,
{
retVal___ = HPMHooks.source.skill.blown(src, target, count, dir, flag);
}
- if( HPMHooks.count.HP_skill_blown_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int *count, int8 *dir, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blown_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blown_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int count, int8 dir, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blown_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &count, &dir, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, count, dir, flag);
}
}
return retVal___;
@@ -65971,14 +67722,14 @@ int HP_skill_blown(struct block_list *src, struct block_list *target, int count,
int HP_skill_break_equip(struct block_list *bl, unsigned short where, int rate, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_break_equip_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned short *where, int *rate, int *flag);
+ if (HPMHooks.count.HP_skill_break_equip_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned short *where, int *rate, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_break_equip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_break_equip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_break_equip_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &where, &rate, &flag);
+ retVal___ = preHookFunc(&bl, &where, &rate, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -65986,11 +67737,11 @@ int HP_skill_break_equip(struct block_list *bl, unsigned short where, int rate,
{
retVal___ = HPMHooks.source.skill.break_equip(bl, where, rate, flag);
}
- if( HPMHooks.count.HP_skill_break_equip_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned short *where, int *rate, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_break_equip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_break_equip_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned short where, int rate, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_break_equip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_break_equip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &where, &rate, &flag);
+ retVal___ = postHookFunc(retVal___, bl, where, rate, flag);
}
}
return retVal___;
@@ -65998,14 +67749,14 @@ int HP_skill_break_equip(struct block_list *bl, unsigned short where, int rate,
int HP_skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_strip_equip_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned short *where, int *rate, int *lv, int *time);
+ if (HPMHooks.count.HP_skill_strip_equip_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned short *where, int *rate, int *lv, int *time);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_strip_equip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_strip_equip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_strip_equip_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &where, &rate, &lv, &time);
+ retVal___ = preHookFunc(&bl, &where, &rate, &lv, &time);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66013,11 +67764,11 @@ int HP_skill_strip_equip(struct block_list *bl, unsigned short where, int rate,
{
retVal___ = HPMHooks.source.skill.strip_equip(bl, where, rate, lv, time);
}
- if( HPMHooks.count.HP_skill_strip_equip_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned short *where, int *rate, int *lv, int *time);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_strip_equip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_strip_equip_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned short where, int rate, int lv, int time);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_strip_equip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_strip_equip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &where, &rate, &lv, &time);
+ retVal___ = postHookFunc(retVal___, bl, where, rate, lv, time);
}
}
return retVal___;
@@ -66025,14 +67776,14 @@ int HP_skill_strip_equip(struct block_list *bl, unsigned short where, int rate,
struct skill_unit_group* HP_skill_id2group(int group_id) {
int hIndex = 0;
struct skill_unit_group* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_id2group_pre ) {
+ if (HPMHooks.count.HP_skill_id2group_pre > 0) {
struct skill_unit_group* (*preHookFunc) (int *group_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_id2group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_id2group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_id2group_pre[hIndex].func;
retVal___ = preHookFunc(&group_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66040,11 +67791,11 @@ struct skill_unit_group* HP_skill_id2group(int group_id) {
{
retVal___ = HPMHooks.source.skill.id2group(group_id);
}
- if( HPMHooks.count.HP_skill_id2group_post ) {
- struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, int *group_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_id2group_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_id2group_post > 0) {
+ struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, int group_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_id2group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_id2group_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &group_id);
+ retVal___ = postHookFunc(retVal___, group_id);
}
}
return retVal___;
@@ -66052,14 +67803,14 @@ struct skill_unit_group* HP_skill_id2group(int group_id) {
struct skill_unit_group* HP_skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag) {
int hIndex = 0;
struct skill_unit_group* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_unitsetting_pre ) {
- struct skill_unit_group* (*preHookFunc) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag);
+ if (HPMHooks.count.HP_skill_unitsetting_pre > 0) {
+ struct skill_unit_group* (*preHookFunc) (struct block_list **src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unitsetting_pre[hIndex].func;
- retVal___ = preHookFunc(src, &skill_id, &skill_lv, &x, &y, &flag);
+ retVal___ = preHookFunc(&src, &skill_id, &skill_lv, &x, &y, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66067,11 +67818,11 @@ struct skill_unit_group* HP_skill_unitsetting(struct block_list *src, uint16 ski
{
retVal___ = HPMHooks.source.skill.unitsetting(src, skill_id, skill_lv, x, y, flag);
}
- if( HPMHooks.count.HP_skill_unitsetting_post ) {
- struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *src, uint16 *skill_id, uint16 *skill_lv, short *x, short *y, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unitsetting_post > 0) {
+ struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *src, uint16 skill_id, uint16 skill_lv, short x, short y, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unitsetting_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &skill_id, &skill_lv, &x, &y, &flag);
+ retVal___ = postHookFunc(retVal___, src, skill_id, skill_lv, x, y, flag);
}
}
return retVal___;
@@ -66079,14 +67830,14 @@ struct skill_unit_group* HP_skill_unitsetting(struct block_list *src, uint16 ski
struct skill_unit* HP_skill_initunit(struct skill_unit_group *group, int idx, int x, int y, int val1, int val2) {
int hIndex = 0;
struct skill_unit* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_initunit_pre ) {
- struct skill_unit* (*preHookFunc) (struct skill_unit_group *group, int *idx, int *x, int *y, int *val1, int *val2);
+ if (HPMHooks.count.HP_skill_initunit_pre > 0) {
+ struct skill_unit* (*preHookFunc) (struct skill_unit_group **group, int *idx, int *x, int *y, int *val1, int *val2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_initunit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_initunit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_initunit_pre[hIndex].func;
- retVal___ = preHookFunc(group, &idx, &x, &y, &val1, &val2);
+ retVal___ = preHookFunc(&group, &idx, &x, &y, &val1, &val2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66094,11 +67845,11 @@ struct skill_unit* HP_skill_initunit(struct skill_unit_group *group, int idx, in
{
retVal___ = HPMHooks.source.skill.initunit(group, idx, x, y, val1, val2);
}
- if( HPMHooks.count.HP_skill_initunit_post ) {
- struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, struct skill_unit_group *group, int *idx, int *x, int *y, int *val1, int *val2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_initunit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_initunit_post > 0) {
+ struct skill_unit* (*postHookFunc) (struct skill_unit* retVal___, struct skill_unit_group *group, int idx, int x, int y, int val1, int val2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_initunit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_initunit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, group, &idx, &x, &y, &val1, &val2);
+ retVal___ = postHookFunc(retVal___, group, idx, x, y, val1, val2);
}
}
return retVal___;
@@ -66106,14 +67857,14 @@ struct skill_unit* HP_skill_initunit(struct skill_unit_group *group, int idx, in
int HP_skill_delunit(struct skill_unit *su) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_delunit_pre ) {
- int (*preHookFunc) (struct skill_unit *su);
+ if (HPMHooks.count.HP_skill_delunit_pre > 0) {
+ int (*preHookFunc) (struct skill_unit **su);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_delunit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_delunit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_delunit_pre[hIndex].func;
- retVal___ = preHookFunc(su);
+ retVal___ = preHookFunc(&su);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66121,9 +67872,9 @@ int HP_skill_delunit(struct skill_unit *su) {
{
retVal___ = HPMHooks.source.skill.delunit(su);
}
- if( HPMHooks.count.HP_skill_delunit_post ) {
+ if (HPMHooks.count.HP_skill_delunit_post > 0) {
int (*postHookFunc) (int retVal___, struct skill_unit *su);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_delunit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_delunit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_delunit_post[hIndex].func;
retVal___ = postHookFunc(retVal___, su);
}
@@ -66133,14 +67884,14 @@ int HP_skill_delunit(struct skill_unit *su) {
struct skill_unit_group* HP_skill_init_unitgroup(struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval) {
int hIndex = 0;
struct skill_unit_group* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_init_unitgroup_pre ) {
- struct skill_unit_group* (*preHookFunc) (struct block_list *src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval);
+ if (HPMHooks.count.HP_skill_init_unitgroup_pre > 0) {
+ struct skill_unit_group* (*preHookFunc) (struct block_list **src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unitgroup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unitgroup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_init_unitgroup_pre[hIndex].func;
- retVal___ = preHookFunc(src, &count, &skill_id, &skill_lv, &unit_id, &limit, &interval);
+ retVal___ = preHookFunc(&src, &count, &skill_id, &skill_lv, &unit_id, &limit, &interval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66148,11 +67899,11 @@ struct skill_unit_group* HP_skill_init_unitgroup(struct block_list *src, int cou
{
retVal___ = HPMHooks.source.skill.init_unitgroup(src, count, skill_id, skill_lv, unit_id, limit, interval);
}
- if( HPMHooks.count.HP_skill_init_unitgroup_post ) {
- struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *src, int *count, uint16 *skill_id, uint16 *skill_lv, int *unit_id, int *limit, int *interval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unitgroup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_init_unitgroup_post > 0) {
+ struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unitgroup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_init_unitgroup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &count, &skill_id, &skill_lv, &unit_id, &limit, &interval);
+ retVal___ = postHookFunc(retVal___, src, count, skill_id, skill_lv, unit_id, limit, interval);
}
}
return retVal___;
@@ -66160,14 +67911,14 @@ struct skill_unit_group* HP_skill_init_unitgroup(struct block_list *src, int cou
int HP_skill_del_unitgroup(struct skill_unit_group *group, const char *file, int line, const char *func) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_del_unitgroup_pre ) {
- int (*preHookFunc) (struct skill_unit_group *group, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_skill_del_unitgroup_pre > 0) {
+ int (*preHookFunc) (struct skill_unit_group **group, const char **file, int *line, const char **func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_del_unitgroup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_del_unitgroup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_del_unitgroup_pre[hIndex].func;
- retVal___ = preHookFunc(group, file, &line, func);
+ retVal___ = preHookFunc(&group, &file, &line, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66175,11 +67926,11 @@ int HP_skill_del_unitgroup(struct skill_unit_group *group, const char *file, int
{
retVal___ = HPMHooks.source.skill.del_unitgroup(group, file, line, func);
}
- if( HPMHooks.count.HP_skill_del_unitgroup_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit_group *group, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_del_unitgroup_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_del_unitgroup_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit_group *group, const char *file, int line, const char *func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_del_unitgroup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_del_unitgroup_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, group, file, &line, func);
+ retVal___ = postHookFunc(retVal___, group, file, line, func);
}
}
return retVal___;
@@ -66187,14 +67938,14 @@ int HP_skill_del_unitgroup(struct skill_unit_group *group, const char *file, int
int HP_skill_clear_unitgroup(struct block_list *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_clear_unitgroup_pre ) {
- int (*preHookFunc) (struct block_list *src);
+ if (HPMHooks.count.HP_skill_clear_unitgroup_pre > 0) {
+ int (*preHookFunc) (struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_unitgroup_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_unitgroup_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_clear_unitgroup_pre[hIndex].func;
- retVal___ = preHookFunc(src);
+ retVal___ = preHookFunc(&src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66202,9 +67953,9 @@ int HP_skill_clear_unitgroup(struct block_list *src) {
{
retVal___ = HPMHooks.source.skill.clear_unitgroup(src);
}
- if( HPMHooks.count.HP_skill_clear_unitgroup_post ) {
+ if (HPMHooks.count.HP_skill_clear_unitgroup_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_unitgroup_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_unitgroup_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_clear_unitgroup_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src);
}
@@ -66214,14 +67965,14 @@ int HP_skill_clear_unitgroup(struct block_list *src) {
int HP_skill_clear_group(struct block_list *bl, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_clear_group_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *flag);
+ if (HPMHooks.count.HP_skill_clear_group_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_clear_group_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &flag);
+ retVal___ = preHookFunc(&bl, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66229,11 +67980,11 @@ int HP_skill_clear_group(struct block_list *bl, int flag) {
{
retVal___ = HPMHooks.source.skill.clear_group(bl, flag);
}
- if( HPMHooks.count.HP_skill_clear_group_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_group_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_clear_group_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_clear_group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_clear_group_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &flag);
+ retVal___ = postHookFunc(retVal___, bl, flag);
}
}
return retVal___;
@@ -66241,14 +67992,14 @@ int HP_skill_clear_group(struct block_list *bl, int flag) {
int HP_skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_onplace_pre ) {
- int (*preHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+ if (HPMHooks.count.HP_skill_unit_onplace_pre > 0) {
+ int (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_onplace_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &tick);
+ retVal___ = preHookFunc(&src, &bl, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66256,11 +68007,11 @@ int HP_skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 t
{
retVal___ = HPMHooks.source.skill.unit_onplace(src, bl, tick);
}
- if( HPMHooks.count.HP_skill_unit_onplace_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_onplace_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_onplace_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &tick);
+ retVal___ = postHookFunc(retVal___, src, bl, tick);
}
}
return retVal___;
@@ -66268,14 +68019,14 @@ int HP_skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 t
int HP_skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_ondamaged_pre ) {
- int (*preHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *damage, int64 *tick);
+ if (HPMHooks.count.HP_skill_unit_ondamaged_pre > 0) {
+ int (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 *damage, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_ondamaged_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_ondamaged_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_ondamaged_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &damage, &tick);
+ retVal___ = preHookFunc(&src, &bl, &damage, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66283,11 +68034,11 @@ int HP_skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64
{
retVal___ = HPMHooks.source.skill.unit_ondamaged(src, bl, damage, tick);
}
- if( HPMHooks.count.HP_skill_unit_ondamaged_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 *damage, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_ondamaged_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_ondamaged_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_ondamaged_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_ondamaged_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &damage, &tick);
+ retVal___ = postHookFunc(retVal___, src, bl, damage, tick);
}
}
return retVal___;
@@ -66295,14 +68046,14 @@ int HP_skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64
int HP_skill_cast_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_cast_fix_pre ) {
- int (*preHookFunc) (struct block_list *bl, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_cast_fix_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_cast_fix_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&bl, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66310,11 +68061,11 @@ int HP_skill_cast_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.cast_fix(bl, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_cast_fix_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_cast_fix_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_cast_fix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, bl, skill_id, skill_lv);
}
}
return retVal___;
@@ -66322,14 +68073,14 @@ int HP_skill_cast_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
int HP_skill_cast_fix_sc(struct block_list *bl, int time) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_cast_fix_sc_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *time);
+ if (HPMHooks.count.HP_skill_cast_fix_sc_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *time);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_sc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_sc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_cast_fix_sc_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &time);
+ retVal___ = preHookFunc(&bl, &time);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66337,11 +68088,11 @@ int HP_skill_cast_fix_sc(struct block_list *bl, int time) {
{
retVal___ = HPMHooks.source.skill.cast_fix_sc(bl, time);
}
- if( HPMHooks.count.HP_skill_cast_fix_sc_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *time);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_sc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_cast_fix_sc_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int time);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cast_fix_sc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_cast_fix_sc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &time);
+ retVal___ = postHookFunc(retVal___, bl, time);
}
}
return retVal___;
@@ -66349,14 +68100,14 @@ int HP_skill_cast_fix_sc(struct block_list *bl, int time) {
int HP_skill_vf_cast_fix(struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_vf_cast_fix_pre ) {
- int (*preHookFunc) (struct block_list *bl, double *time, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_vf_cast_fix_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, double *time, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_vf_cast_fix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_vf_cast_fix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_vf_cast_fix_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &time, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&bl, &time, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66364,11 +68115,11 @@ int HP_skill_vf_cast_fix(struct block_list *bl, double time, uint16 skill_id, ui
{
retVal___ = HPMHooks.source.skill.vf_cast_fix(bl, time, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_vf_cast_fix_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, double *time, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_vf_cast_fix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_vf_cast_fix_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_vf_cast_fix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_vf_cast_fix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &time, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, bl, time, skill_id, skill_lv);
}
}
return retVal___;
@@ -66376,14 +68127,14 @@ int HP_skill_vf_cast_fix(struct block_list *bl, double time, uint16 skill_id, ui
int HP_skill_delay_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_delay_fix_pre ) {
- int (*preHookFunc) (struct block_list *bl, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_delay_fix_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_delay_fix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_delay_fix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_delay_fix_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&bl, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66391,11 +68142,11 @@ int HP_skill_delay_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
{
retVal___ = HPMHooks.source.skill.delay_fix(bl, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_delay_fix_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_delay_fix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_delay_fix_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_delay_fix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_delay_fix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, bl, skill_id, skill_lv);
}
}
return retVal___;
@@ -66403,14 +68154,14 @@ int HP_skill_delay_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
int HP_skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_castbegin_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66418,11 +68169,11 @@ int HP_skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill
{
retVal___ = HPMHooks.source.skill.check_condition_castbegin(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_check_condition_castbegin_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv);
}
}
return retVal___;
@@ -66430,14 +68181,14 @@ int HP_skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill
int HP_skill_check_condition_castend(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_castend_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_check_condition_castend_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castend_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66445,11 +68196,11 @@ int HP_skill_check_condition_castend(struct map_session_data *sd, uint16 skill_i
{
retVal___ = HPMHooks.source.skill.check_condition_castend(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_check_condition_castend_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_condition_castend_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castend_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv);
}
}
return retVal___;
@@ -66457,14 +68208,14 @@ int HP_skill_check_condition_castend(struct map_session_data *sd, uint16 skill_i
int HP_skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_consume_requirement_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, short *type);
+ if (HPMHooks.count.HP_skill_consume_requirement_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv, short *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_consume_requirement_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_consume_requirement_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_consume_requirement_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &skill_lv, &type);
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66472,27 +68223,26 @@ int HP_skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, u
{
retVal___ = HPMHooks.source.skill.consume_requirement(sd, skill_id, skill_lv, type);
}
- if( HPMHooks.count.HP_skill_consume_requirement_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, short *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_consume_requirement_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_consume_requirement_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_consume_requirement_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_consume_requirement_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &skill_lv, &type);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv, type);
}
}
return retVal___;
}
struct skill_condition HP_skill_get_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
- struct skill_condition retVal___;
- memset(&retVal___, '\0', sizeof(struct skill_condition));
- if( HPMHooks.count.HP_skill_get_requirement_pre ) {
- struct skill_condition (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ struct skill_condition retVal___ = { 0 };
+ if (HPMHooks.count.HP_skill_get_requirement_pre > 0) {
+ struct skill_condition (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_requirement_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66500,11 +68250,11 @@ struct skill_condition HP_skill_get_requirement(struct map_session_data *sd, uin
{
retVal___ = HPMHooks.source.skill.get_requirement(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_requirement_post ) {
- struct skill_condition (*postHookFunc) (struct skill_condition retVal___, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_requirement_post > 0) {
+ struct skill_condition (*postHookFunc) (struct skill_condition retVal___, struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_requirement_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv);
}
}
return retVal___;
@@ -66512,14 +68262,14 @@ struct skill_condition HP_skill_get_requirement(struct map_session_data *sd, uin
int HP_skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_pc_partner_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, int *range, int *cast_flag);
+ if (HPMHooks.count.HP_skill_check_pc_partner_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 **skill_lv, int *range, int *cast_flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_pc_partner_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_pc_partner_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_pc_partner_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, skill_lv, &range, &cast_flag);
+ retVal___ = preHookFunc(&sd, &skill_id, &skill_lv, &range, &cast_flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66527,11 +68277,11 @@ int HP_skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint
{
retVal___ = HPMHooks.source.skill.check_pc_partner(sd, skill_id, skill_lv, range, cast_flag);
}
- if( HPMHooks.count.HP_skill_check_pc_partner_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, int *range, int *cast_flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_pc_partner_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_pc_partner_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_pc_partner_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_pc_partner_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, skill_lv, &range, &cast_flag);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, skill_lv, range, cast_flag);
}
}
return retVal___;
@@ -66539,14 +68289,14 @@ int HP_skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint
int HP_skill_unit_move(struct block_list *bl, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_move_pre ) {
- int (*preHookFunc) (struct block_list *bl, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_unit_move_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_move_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &tick, &flag);
+ retVal___ = preHookFunc(&bl, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66554,11 +68304,11 @@ int HP_skill_unit_move(struct block_list *bl, int64 tick, int flag) {
{
retVal___ = HPMHooks.source.skill.unit_move(bl, tick, flag);
}
- if( HPMHooks.count.HP_skill_unit_move_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_move_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_move_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, bl, tick, flag);
}
}
return retVal___;
@@ -66566,14 +68316,14 @@ int HP_skill_unit_move(struct block_list *bl, int64 tick, int flag) {
int HP_skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_onleft_pre ) {
- int (*preHookFunc) (uint16 *skill_id, struct block_list *bl, int64 *tick);
+ if (HPMHooks.count.HP_skill_unit_onleft_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct block_list **bl, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onleft_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onleft_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_onleft_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, bl, &tick);
+ retVal___ = preHookFunc(&skill_id, &bl, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66581,11 +68331,11 @@ int HP_skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
{
retVal___ = HPMHooks.source.skill.unit_onleft(skill_id, bl, tick);
}
- if( HPMHooks.count.HP_skill_unit_onleft_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, struct block_list *bl, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onleft_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_onleft_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct block_list *bl, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onleft_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_onleft_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, bl, &tick);
+ retVal___ = postHookFunc(retVal___, skill_id, bl, tick);
}
}
return retVal___;
@@ -66593,14 +68343,14 @@ int HP_skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) {
int HP_skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_onout_pre ) {
- int (*preHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+ if (HPMHooks.count.HP_skill_unit_onout_pre > 0) {
+ int (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_onout_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &tick);
+ retVal___ = preHookFunc(&src, &bl, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66608,11 +68358,11 @@ int HP_skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tic
{
retVal___ = HPMHooks.source.skill.unit_onout(src, bl, tick);
}
- if( HPMHooks.count.HP_skill_unit_onout_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_onout_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_onout_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &tick);
+ retVal___ = postHookFunc(retVal___, src, bl, tick);
}
}
return retVal___;
@@ -66620,14 +68370,14 @@ int HP_skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tic
int HP_skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16 dx, int16 dy) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_move_unit_group_pre ) {
- int (*preHookFunc) (struct skill_unit_group *group, int16 *m, int16 *dx, int16 *dy);
+ if (HPMHooks.count.HP_skill_unit_move_unit_group_pre > 0) {
+ int (*preHookFunc) (struct skill_unit_group **group, int16 *m, int16 *dx, int16 *dy);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_unit_group_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_unit_group_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_move_unit_group_pre[hIndex].func;
- retVal___ = preHookFunc(group, &m, &dx, &dy);
+ retVal___ = preHookFunc(&group, &m, &dx, &dy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66635,11 +68385,11 @@ int HP_skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16
{
retVal___ = HPMHooks.source.skill.unit_move_unit_group(group, m, dx, dy);
}
- if( HPMHooks.count.HP_skill_unit_move_unit_group_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit_group *group, int16 *m, int16 *dx, int16 *dy);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_unit_group_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_move_unit_group_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit_group *group, int16 m, int16 dx, int16 dy);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_unit_group_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_move_unit_group_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, group, &m, &dx, &dy);
+ retVal___ = postHookFunc(retVal___, group, m, dx, dy);
}
}
return retVal___;
@@ -66647,14 +68397,14 @@ int HP_skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16
int HP_skill_sit(struct map_session_data *sd, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_sit_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_skill_sit_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_sit_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &type);
+ retVal___ = preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66662,25 +68412,25 @@ int HP_skill_sit(struct map_session_data *sd, int type) {
{
retVal___ = HPMHooks.source.skill.sit(sd, type);
}
- if( HPMHooks.count.HP_skill_sit_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_sit_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_sit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &type);
+ retVal___ = postHookFunc(retVal___, sd, type);
}
}
return retVal___;
}
void HP_skill_brandishspear(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_brandishspear_pre ) {
- void (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_brandishspear_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_brandishspear_pre[hIndex].func;
- preHookFunc(src, bl, &skill_id, &skill_lv, &tick, &flag);
+ preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -66688,25 +68438,25 @@ void HP_skill_brandishspear(struct block_list *src, struct block_list *bl, uint1
{
HPMHooks.source.skill.brandishspear(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_brandishspear_post ) {
- void (*postHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_brandishspear_post > 0) {
+ void (*postHookFunc) (struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_brandishspear_post[hIndex].func;
- postHookFunc(src, bl, &skill_id, &skill_lv, &tick, &flag);
+ postHookFunc(src, bl, skill_id, skill_lv, tick, flag);
}
}
return;
}
void HP_skill_repairweapon(struct map_session_data *sd, int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_repairweapon_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx);
+ if (HPMHooks.count.HP_skill_repairweapon_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_repairweapon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_repairweapon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_repairweapon_pre[hIndex].func;
- preHookFunc(sd, &idx);
+ preHookFunc(&sd, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -66714,25 +68464,25 @@ void HP_skill_repairweapon(struct map_session_data *sd, int idx) {
{
HPMHooks.source.skill.repairweapon(sd, idx);
}
- if( HPMHooks.count.HP_skill_repairweapon_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_repairweapon_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_repairweapon_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_repairweapon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_repairweapon_post[hIndex].func;
- postHookFunc(sd, &idx);
+ postHookFunc(sd, idx);
}
}
return;
}
void HP_skill_identify(struct map_session_data *sd, int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_identify_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx);
+ if (HPMHooks.count.HP_skill_identify_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_identify_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_identify_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_identify_pre[hIndex].func;
- preHookFunc(sd, &idx);
+ preHookFunc(&sd, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -66740,25 +68490,25 @@ void HP_skill_identify(struct map_session_data *sd, int idx) {
{
HPMHooks.source.skill.identify(sd, idx);
}
- if( HPMHooks.count.HP_skill_identify_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_identify_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_identify_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_identify_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_identify_post[hIndex].func;
- postHookFunc(sd, &idx);
+ postHookFunc(sd, idx);
}
}
return;
}
void HP_skill_weaponrefine(struct map_session_data *sd, int idx) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_weaponrefine_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *idx);
+ if (HPMHooks.count.HP_skill_weaponrefine_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_weaponrefine_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_weaponrefine_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_weaponrefine_pre[hIndex].func;
- preHookFunc(sd, &idx);
+ preHookFunc(&sd, &idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -66766,11 +68516,11 @@ void HP_skill_weaponrefine(struct map_session_data *sd, int idx) {
{
HPMHooks.source.skill.weaponrefine(sd, idx);
}
- if( HPMHooks.count.HP_skill_weaponrefine_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_weaponrefine_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_weaponrefine_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_weaponrefine_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_weaponrefine_post[hIndex].func;
- postHookFunc(sd, &idx);
+ postHookFunc(sd, idx);
}
}
return;
@@ -66778,14 +68528,14 @@ void HP_skill_weaponrefine(struct map_session_data *sd, int idx) {
int HP_skill_autospell(struct map_session_data *md, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_autospell_pre ) {
- int (*preHookFunc) (struct map_session_data *md, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_autospell_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **md, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_autospell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_autospell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_autospell_pre[hIndex].func;
- retVal___ = preHookFunc(md, &skill_id);
+ retVal___ = preHookFunc(&md, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66793,11 +68543,11 @@ int HP_skill_autospell(struct map_session_data *md, uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.autospell(md, skill_id);
}
- if( HPMHooks.count.HP_skill_autospell_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *md, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_autospell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_autospell_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *md, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_autospell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_autospell_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &skill_id);
+ retVal___ = postHookFunc(retVal___, md, skill_id);
}
}
return retVal___;
@@ -66805,14 +68555,14 @@ int HP_skill_autospell(struct map_session_data *md, uint16 skill_id) {
int HP_skill_calc_heal(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_calc_heal_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, bool *heal);
+ if (HPMHooks.count.HP_skill_calc_heal_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, bool *heal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_calc_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_calc_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_calc_heal_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &heal);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &heal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66820,11 +68570,11 @@ int HP_skill_calc_heal(struct block_list *src, struct block_list *target, uint16
{
retVal___ = HPMHooks.source.skill.calc_heal(src, target, skill_id, skill_lv, heal);
}
- if( HPMHooks.count.HP_skill_calc_heal_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, bool *heal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_calc_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_calc_heal_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_calc_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_calc_heal_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &heal);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, heal);
}
}
return retVal___;
@@ -66832,14 +68582,14 @@ int HP_skill_calc_heal(struct block_list *src, struct block_list *target, uint16
bool HP_skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_check_cloaking_pre ) {
- bool (*preHookFunc) (struct block_list *bl, struct status_change_entry *sce);
+ if (HPMHooks.count.HP_skill_check_cloaking_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl, struct status_change_entry **sce);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_cloaking_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sce);
+ retVal___ = preHookFunc(&bl, &sce);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66847,9 +68597,9 @@ bool HP_skill_check_cloaking(struct block_list *bl, struct status_change_entry *
{
retVal___ = HPMHooks.source.skill.check_cloaking(bl, sce);
}
- if( HPMHooks.count.HP_skill_check_cloaking_post ) {
+ if (HPMHooks.count.HP_skill_check_cloaking_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct status_change_entry *sce);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_cloaking_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, sce);
}
@@ -66859,16 +68609,16 @@ bool HP_skill_check_cloaking(struct block_list *bl, struct status_change_entry *
int HP_skill_check_cloaking_end(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_cloaking_end_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_check_cloaking_end_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_end_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_check_cloaking_end_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66878,9 +68628,9 @@ int HP_skill_check_cloaking_end(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.check_cloaking_end(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_check_cloaking_end_post ) {
+ if (HPMHooks.count.HP_skill_check_cloaking_end_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_end_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_cloaking_end_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_check_cloaking_end_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -66892,14 +68642,14 @@ int HP_skill_check_cloaking_end(struct block_list *bl, va_list ap) {
bool HP_skill_can_cloak(struct map_session_data *sd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_can_cloak_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_skill_can_cloak_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_cloak_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_cloak_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_can_cloak_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66907,9 +68657,9 @@ bool HP_skill_can_cloak(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.skill.can_cloak(sd);
}
- if( HPMHooks.count.HP_skill_can_cloak_post ) {
+ if (HPMHooks.count.HP_skill_can_cloak_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_cloak_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_cloak_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_can_cloak_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -66919,14 +68669,14 @@ bool HP_skill_can_cloak(struct map_session_data *sd) {
int HP_skill_enchant_elemental_end(struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_enchant_elemental_end_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_skill_enchant_elemental_end_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_enchant_elemental_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_enchant_elemental_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_enchant_elemental_end_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type);
+ retVal___ = preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66934,11 +68684,11 @@ int HP_skill_enchant_elemental_end(struct block_list *bl, int type) {
{
retVal___ = HPMHooks.source.skill.enchant_elemental_end(bl, type);
}
- if( HPMHooks.count.HP_skill_enchant_elemental_end_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_enchant_elemental_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_enchant_elemental_end_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_enchant_elemental_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_enchant_elemental_end_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type);
+ retVal___ = postHookFunc(retVal___, bl, type);
}
}
return retVal___;
@@ -66946,14 +68696,14 @@ int HP_skill_enchant_elemental_end(struct block_list *bl, int type) {
int HP_skill_not_ok(uint16 skill_id, struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_not_ok_pre ) {
- int (*preHookFunc) (uint16 *skill_id, struct map_session_data *sd);
+ if (HPMHooks.count.HP_skill_not_ok_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_not_ok_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, sd);
+ retVal___ = preHookFunc(&skill_id, &sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66961,11 +68711,38 @@ int HP_skill_not_ok(uint16 skill_id, struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.skill.not_ok(skill_id, sd);
}
- if( HPMHooks.count.HP_skill_not_ok_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_not_ok_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_not_ok_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, sd);
+ retVal___ = postHookFunc(retVal___, skill_id, sd);
+ }
+ }
+ return retVal___;
+}
+int HP_skill_not_ok_unknown(uint16 skill_id, struct map_session_data *sd) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_not_ok_unknown_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_unknown_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_not_ok_unknown_pre[hIndex].func;
+ retVal___ = preHookFunc(&skill_id, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.skill.not_ok_unknown(skill_id, sd);
+ }
+ if (HPMHooks.count.HP_skill_not_ok_unknown_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_unknown_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_not_ok_unknown_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, skill_id, sd);
}
}
return retVal___;
@@ -66973,14 +68750,14 @@ int HP_skill_not_ok(uint16 skill_id, struct map_session_data *sd) {
int HP_skill_not_ok_hom(uint16 skill_id, struct homun_data *hd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_not_ok_hom_pre ) {
- int (*preHookFunc) (uint16 *skill_id, struct homun_data *hd);
+ if (HPMHooks.count.HP_skill_not_ok_hom_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct homun_data **hd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_not_ok_hom_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, hd);
+ retVal___ = preHookFunc(&skill_id, &hd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -66988,11 +68765,38 @@ int HP_skill_not_ok_hom(uint16 skill_id, struct homun_data *hd) {
{
retVal___ = HPMHooks.source.skill.not_ok_hom(skill_id, hd);
}
- if( HPMHooks.count.HP_skill_not_ok_hom_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, struct homun_data *hd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_not_ok_hom_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct homun_data *hd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_not_ok_hom_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, hd);
+ retVal___ = postHookFunc(retVal___, skill_id, hd);
+ }
+ }
+ return retVal___;
+}
+int HP_skill_not_ok_hom_unknown(uint16 skill_id, struct homun_data *hd) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_not_ok_hom_unknown_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct homun_data **hd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_unknown_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_not_ok_hom_unknown_pre[hIndex].func;
+ retVal___ = preHookFunc(&skill_id, &hd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.skill.not_ok_hom_unknown(skill_id, hd);
+ }
+ if (HPMHooks.count.HP_skill_not_ok_hom_unknown_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct homun_data *hd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_hom_unknown_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_not_ok_hom_unknown_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, skill_id, hd);
}
}
return retVal___;
@@ -67000,14 +68804,14 @@ int HP_skill_not_ok_hom(uint16 skill_id, struct homun_data *hd) {
int HP_skill_not_ok_mercenary(uint16 skill_id, struct mercenary_data *md) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_not_ok_mercenary_pre ) {
- int (*preHookFunc) (uint16 *skill_id, struct mercenary_data *md);
+ if (HPMHooks.count.HP_skill_not_ok_mercenary_pre > 0) {
+ int (*preHookFunc) (uint16 *skill_id, struct mercenary_data **md);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_mercenary_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_mercenary_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_not_ok_mercenary_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, md);
+ retVal___ = preHookFunc(&skill_id, &md);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67015,11 +68819,11 @@ int HP_skill_not_ok_mercenary(uint16 skill_id, struct mercenary_data *md) {
{
retVal___ = HPMHooks.source.skill.not_ok_mercenary(skill_id, md);
}
- if( HPMHooks.count.HP_skill_not_ok_mercenary_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, struct mercenary_data *md);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_mercenary_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_not_ok_mercenary_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, struct mercenary_data *md);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_not_ok_mercenary_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_not_ok_mercenary_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, md);
+ retVal___ = postHookFunc(retVal___, skill_id, md);
}
}
return retVal___;
@@ -67027,16 +68831,16 @@ int HP_skill_not_ok_mercenary(uint16 skill_id, struct mercenary_data *md) {
int HP_skill_chastle_mob_changetarget(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_chastle_mob_changetarget_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_chastle_mob_changetarget_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_chastle_mob_changetarget_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_chastle_mob_changetarget_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_chastle_mob_changetarget_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67046,9 +68850,9 @@ int HP_skill_chastle_mob_changetarget(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.chastle_mob_changetarget(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_chastle_mob_changetarget_post ) {
+ if (HPMHooks.count.HP_skill_chastle_mob_changetarget_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_chastle_mob_changetarget_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_chastle_mob_changetarget_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_chastle_mob_changetarget_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67060,14 +68864,14 @@ int HP_skill_chastle_mob_changetarget(struct block_list *bl, va_list ap) {
int HP_skill_can_produce_mix(struct map_session_data *sd, int nameid, int trigger, int qty) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_can_produce_mix_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid, int *trigger, int *qty);
+ if (HPMHooks.count.HP_skill_can_produce_mix_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid, int *trigger, int *qty);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_produce_mix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_produce_mix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_can_produce_mix_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid, &trigger, &qty);
+ retVal___ = preHookFunc(&sd, &nameid, &trigger, &qty);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67075,11 +68879,11 @@ int HP_skill_can_produce_mix(struct map_session_data *sd, int nameid, int trigge
{
retVal___ = HPMHooks.source.skill.can_produce_mix(sd, nameid, trigger, qty);
}
- if( HPMHooks.count.HP_skill_can_produce_mix_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid, int *trigger, int *qty);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_produce_mix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_can_produce_mix_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid, int trigger, int qty);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_can_produce_mix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_can_produce_mix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid, &trigger, &qty);
+ retVal___ = postHookFunc(retVal___, sd, nameid, trigger, qty);
}
}
return retVal___;
@@ -67087,14 +68891,14 @@ int HP_skill_can_produce_mix(struct map_session_data *sd, int nameid, int trigge
int HP_skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_produce_mix_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *nameid, int *slot1, int *slot2, int *slot3, int *qty);
+ if (HPMHooks.count.HP_skill_produce_mix_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, int *nameid, int *slot1, int *slot2, int *slot3, int *qty);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_produce_mix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_produce_mix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_produce_mix_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &nameid, &slot1, &slot2, &slot3, &qty);
+ retVal___ = preHookFunc(&sd, &skill_id, &nameid, &slot1, &slot2, &slot3, &qty);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67102,11 +68906,11 @@ int HP_skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int namei
{
retVal___ = HPMHooks.source.skill.produce_mix(sd, skill_id, nameid, slot1, slot2, slot3, qty);
}
- if( HPMHooks.count.HP_skill_produce_mix_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, int *nameid, int *slot1, int *slot2, int *slot3, int *qty);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_produce_mix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_produce_mix_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_produce_mix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_produce_mix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &nameid, &slot1, &slot2, &slot3, &qty);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, nameid, slot1, slot2, slot3, qty);
}
}
return retVal___;
@@ -67114,14 +68918,14 @@ int HP_skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int namei
int HP_skill_arrow_create(struct map_session_data *sd, int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_arrow_create_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_skill_arrow_create_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_arrow_create_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_arrow_create_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_arrow_create_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67129,26 +68933,52 @@ int HP_skill_arrow_create(struct map_session_data *sd, int nameid) {
{
retVal___ = HPMHooks.source.skill.arrow_create(sd, nameid);
}
- if( HPMHooks.count.HP_skill_arrow_create_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_arrow_create_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_arrow_create_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_arrow_create_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_arrow_create_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
}
+void HP_skill_castend_type(int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_castend_type_pre > 0) {
+ void (*preHookFunc) (int *type, struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_type_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_castend_type_pre[hIndex].func;
+ preHookFunc(&type, &src, &bl, &skill_id, &skill_lv, &tick, &flag);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.castend_type(type, src, bl, skill_id, skill_lv, tick, flag);
+ }
+ if (HPMHooks.count.HP_skill_castend_type_post > 0) {
+ void (*postHookFunc) (int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_type_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_castend_type_post[hIndex].func;
+ postHookFunc(type, src, bl, skill_id, skill_lv, tick, flag);
+ }
+ }
+ return;
+}
int HP_skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_castend_nodamage_id_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67156,11 +68986,11 @@ int HP_skill_castend_nodamage_id(struct block_list *src, struct block_list *bl,
{
retVal___ = HPMHooks.source.skill.castend_nodamage_id(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_nodamage_id_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag);
}
}
return retVal___;
@@ -67168,14 +68998,14 @@ int HP_skill_castend_nodamage_id(struct block_list *src, struct block_list *bl,
int HP_skill_castend_damage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_castend_damage_id_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_damage_id_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_damage_id_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67183,11 +69013,11 @@ int HP_skill_castend_damage_id(struct block_list *src, struct block_list *bl, ui
{
retVal___ = HPMHooks.source.skill.castend_damage_id(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_damage_id_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_castend_damage_id_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_damage_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag);
}
}
return retVal___;
@@ -67195,14 +69025,14 @@ int HP_skill_castend_damage_id(struct block_list *src, struct block_list *bl, ui
int HP_skill_castend_pos2(struct block_list *src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_castend_pos2_pre ) {
- int (*preHookFunc) (struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_pos2_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_pos2_pre[hIndex].func;
- retVal___ = preHookFunc(src, &x, &y, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = preHookFunc(&src, &x, &y, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67210,11 +69040,11 @@ int HP_skill_castend_pos2(struct block_list *src, int x, int y, uint16 skill_id,
{
retVal___ = HPMHooks.source.skill.castend_pos2(src, x, y, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_pos2_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_castend_pos2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_pos2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &x, &y, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, src, x, y, skill_id, skill_lv, tick, flag);
}
}
return retVal___;
@@ -67222,14 +69052,14 @@ int HP_skill_castend_pos2(struct block_list *src, int x, int y, uint16 skill_id,
int HP_skill_blockpc_start(struct map_session_data *sd, uint16 skill_id, int tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blockpc_start_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *tick);
+ if (HPMHooks.count.HP_skill_blockpc_start_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, int *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blockpc_start_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id, &tick);
+ retVal___ = preHookFunc(&sd, &skill_id, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67237,11 +69067,11 @@ int HP_skill_blockpc_start(struct map_session_data *sd, uint16 skill_id, int tic
{
retVal___ = HPMHooks.source.skill.blockpc_start(sd, skill_id, tick);
}
- if( HPMHooks.count.HP_skill_blockpc_start_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, int *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blockpc_start_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id, int tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blockpc_start_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id, &tick);
+ retVal___ = postHookFunc(retVal___, sd, skill_id, tick);
}
}
return retVal___;
@@ -67249,14 +69079,14 @@ int HP_skill_blockpc_start(struct map_session_data *sd, uint16 skill_id, int tic
int HP_skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blockhomun_start_pre ) {
- int (*preHookFunc) (struct homun_data *hd, uint16 *skill_id, int *tick);
+ if (HPMHooks.count.HP_skill_blockhomun_start_pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, uint16 *skill_id, int *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blockhomun_start_pre[hIndex].func;
- retVal___ = preHookFunc(hd, &skill_id, &tick);
+ retVal___ = preHookFunc(&hd, &skill_id, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67264,11 +69094,11 @@ int HP_skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick)
{
retVal___ = HPMHooks.source.skill.blockhomun_start(hd, skill_id, tick);
}
- if( HPMHooks.count.HP_skill_blockhomun_start_post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, uint16 *skill_id, int *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blockhomun_start_post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, uint16 skill_id, int tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blockhomun_start_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &skill_id, &tick);
+ retVal___ = postHookFunc(retVal___, hd, skill_id, tick);
}
}
return retVal___;
@@ -67276,14 +69106,14 @@ int HP_skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick)
int HP_skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blockmerc_start_pre ) {
- int (*preHookFunc) (struct mercenary_data *md, uint16 *skill_id, int *tick);
+ if (HPMHooks.count.HP_skill_blockmerc_start_pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md, uint16 *skill_id, int *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blockmerc_start_pre[hIndex].func;
- retVal___ = preHookFunc(md, &skill_id, &tick);
+ retVal___ = preHookFunc(&md, &skill_id, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67291,11 +69121,11 @@ int HP_skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tic
{
retVal___ = HPMHooks.source.skill.blockmerc_start(md, skill_id, tick);
}
- if( HPMHooks.count.HP_skill_blockmerc_start_post ) {
- int (*postHookFunc) (int retVal___, struct mercenary_data *md, uint16 *skill_id, int *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blockmerc_start_post > 0) {
+ int (*postHookFunc) (int retVal___, struct mercenary_data *md, uint16 skill_id, int tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blockmerc_start_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &skill_id, &tick);
+ retVal___ = postHookFunc(retVal___, md, skill_id, tick);
}
}
return retVal___;
@@ -67303,14 +69133,14 @@ int HP_skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tic
int HP_skill_attack(int attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_attack_pre ) {
- int (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_attack_pre > 0) {
+ int (*preHookFunc) (int *attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_pre[hIndex].func;
- retVal___ = preHookFunc(&attack_type, src, dsrc, bl, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67318,11 +69148,11 @@ int HP_skill_attack(int attack_type, struct block_list *src, struct block_list *
{
retVal___ = HPMHooks.source.skill.attack(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_attack_post ) {
- int (*postHookFunc) (int retVal___, int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_attack_post > 0) {
+ int (*postHookFunc) (int retVal___, int attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &attack_type, src, dsrc, bl, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
}
return retVal___;
@@ -67330,16 +69160,16 @@ int HP_skill_attack(int attack_type, struct block_list *src, struct block_list *
int HP_skill_attack_area(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_attack_area_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_attack_area_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_area_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_area_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_attack_area_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67349,9 +69179,9 @@ int HP_skill_attack_area(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.attack_area(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_attack_area_post ) {
+ if (HPMHooks.count.HP_skill_attack_area_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_area_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_area_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_attack_area_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67363,16 +69193,16 @@ int HP_skill_attack_area(struct block_list *bl, va_list ap) {
int HP_skill_area_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_area_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_area_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_area_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67382,9 +69212,9 @@ int HP_skill_area_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.area_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_area_sub_post ) {
+ if (HPMHooks.count.HP_skill_area_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_area_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67396,14 +69226,14 @@ int HP_skill_area_sub(struct block_list *bl, va_list ap) {
int HP_skill_area_sub_count(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_area_sub_count_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_area_sub_count_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_count_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_area_sub_count_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67411,11 +69241,11 @@ int HP_skill_area_sub_count(struct block_list *src, struct block_list *target, u
{
retVal___ = HPMHooks.source.skill.area_sub_count(src, target, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_area_sub_count_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_count_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_area_sub_count_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_area_sub_count_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_area_sub_count_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &skill_lv, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, skill_lv, tick, flag);
}
}
return retVal___;
@@ -67423,14 +69253,14 @@ int HP_skill_area_sub_count(struct block_list *src, struct block_list *target, u
int HP_skill_check_unit_range(struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_unit_range_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_check_unit_range_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_unit_range_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &x, &y, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&bl, &x, &y, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67438,11 +69268,11 @@ int HP_skill_check_unit_range(struct block_list *bl, int x, int y, uint16 skill_
{
retVal___ = HPMHooks.source.skill.check_unit_range(bl, x, y, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_check_unit_range_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_unit_range_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_unit_range_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &x, &y, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, bl, x, y, skill_id, skill_lv);
}
}
return retVal___;
@@ -67450,16 +69280,16 @@ int HP_skill_check_unit_range(struct block_list *bl, int x, int y, uint16 skill_
int HP_skill_check_unit_range_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_unit_range_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_check_unit_range_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_check_unit_range_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67469,9 +69299,9 @@ int HP_skill_check_unit_range_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.check_unit_range_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_check_unit_range_sub_post ) {
+ if (HPMHooks.count.HP_skill_check_unit_range_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_check_unit_range_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67483,14 +69313,14 @@ int HP_skill_check_unit_range_sub(struct block_list *bl, va_list ap) {
int HP_skill_check_unit_range2(struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_unit_range2_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_check_unit_range2_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_unit_range2_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &x, &y, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&bl, &x, &y, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67498,11 +69328,11 @@ int HP_skill_check_unit_range2(struct block_list *bl, int x, int y, uint16 skill
{
retVal___ = HPMHooks.source.skill.check_unit_range2(bl, x, y, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_check_unit_range2_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *x, int *y, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_unit_range2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_unit_range2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &x, &y, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, bl, x, y, skill_id, skill_lv);
}
}
return retVal___;
@@ -67510,16 +69340,16 @@ int HP_skill_check_unit_range2(struct block_list *bl, int x, int y, uint16 skill
int HP_skill_check_unit_range2_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_unit_range2_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_check_unit_range2_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_check_unit_range2_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67529,9 +69359,9 @@ int HP_skill_check_unit_range2_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.check_unit_range2_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_check_unit_range2_sub_post ) {
+ if (HPMHooks.count.HP_skill_check_unit_range2_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_unit_range2_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_check_unit_range2_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67542,14 +69372,14 @@ int HP_skill_check_unit_range2_sub(struct block_list *bl, va_list ap) {
}
void HP_skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_toggle_magicpower_pre ) {
- void (*preHookFunc) (struct block_list *bl, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_toggle_magicpower_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_toggle_magicpower_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_toggle_magicpower_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_toggle_magicpower_pre[hIndex].func;
- preHookFunc(bl, &skill_id);
+ preHookFunc(&bl, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -67557,11 +69387,11 @@ void HP_skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
{
HPMHooks.source.skill.toggle_magicpower(bl, skill_id);
}
- if( HPMHooks.count.HP_skill_toggle_magicpower_post ) {
- void (*postHookFunc) (struct block_list *bl, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_toggle_magicpower_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_toggle_magicpower_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_toggle_magicpower_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_toggle_magicpower_post[hIndex].func;
- postHookFunc(bl, &skill_id);
+ postHookFunc(bl, skill_id);
}
}
return;
@@ -67569,14 +69399,14 @@ void HP_skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) {
int HP_skill_magic_reflect(struct block_list *src, struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_magic_reflect_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_skill_magic_reflect_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_magic_reflect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_magic_reflect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_magic_reflect_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &type);
+ retVal___ = preHookFunc(&src, &bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67584,11 +69414,11 @@ int HP_skill_magic_reflect(struct block_list *src, struct block_list *bl, int ty
{
retVal___ = HPMHooks.source.skill.magic_reflect(src, bl, type);
}
- if( HPMHooks.count.HP_skill_magic_reflect_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_magic_reflect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_magic_reflect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_magic_reflect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_magic_reflect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &type);
+ retVal___ = postHookFunc(retVal___, src, bl, type);
}
}
return retVal___;
@@ -67596,14 +69426,14 @@ int HP_skill_magic_reflect(struct block_list *src, struct block_list *bl, int ty
int HP_skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint16 skill_id, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_onskillusage_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct block_list *bl, uint16 *skill_id, int64 *tick);
+ if (HPMHooks.count.HP_skill_onskillusage_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct block_list **bl, uint16 *skill_id, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_onskillusage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_onskillusage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_onskillusage_pre[hIndex].func;
- retVal___ = preHookFunc(sd, bl, &skill_id, &tick);
+ retVal___ = preHookFunc(&sd, &bl, &skill_id, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67611,11 +69441,11 @@ int HP_skill_onskillusage(struct map_session_data *sd, struct block_list *bl, ui
{
retVal___ = HPMHooks.source.skill.onskillusage(sd, bl, skill_id, tick);
}
- if( HPMHooks.count.HP_skill_onskillusage_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 *skill_id, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_onskillusage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_onskillusage_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct block_list *bl, uint16 skill_id, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_onskillusage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_onskillusage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, bl, &skill_id, &tick);
+ retVal___ = postHookFunc(retVal___, sd, bl, skill_id, tick);
}
}
return retVal___;
@@ -67623,16 +69453,16 @@ int HP_skill_onskillusage(struct map_session_data *sd, struct block_list *bl, ui
int HP_skill_cell_overlap(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_cell_overlap_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_cell_overlap_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cell_overlap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cell_overlap_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_cell_overlap_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67642,9 +69472,9 @@ int HP_skill_cell_overlap(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.cell_overlap(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_cell_overlap_post ) {
+ if (HPMHooks.count.HP_skill_cell_overlap_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cell_overlap_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cell_overlap_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_cell_overlap_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67656,14 +69486,14 @@ int HP_skill_cell_overlap(struct block_list *bl, va_list ap) {
int HP_skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_timerskill_pre ) {
+ if (HPMHooks.count.HP_skill_timerskill_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_timerskill_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67671,11 +69501,11 @@ int HP_skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.timerskill(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_timerskill_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_timerskill_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_timerskill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -67683,16 +69513,16 @@ int HP_skill_timerskill(int tid, int64 tick, int id, intptr_t data) {
int HP_skill_trap_splash(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_trap_splash_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_trap_splash_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_trap_splash_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_trap_splash_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_trap_splash_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67702,9 +69532,9 @@ int HP_skill_trap_splash(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.trap_splash(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_trap_splash_post ) {
+ if (HPMHooks.count.HP_skill_trap_splash_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_trap_splash_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_trap_splash_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_trap_splash_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67716,14 +69546,14 @@ int HP_skill_trap_splash(struct block_list *bl, va_list ap) {
int HP_skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_mercenary_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *skill_id, int *lv, int *type);
+ if (HPMHooks.count.HP_skill_check_condition_mercenary_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *skill_id, int *lv, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mercenary_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mercenary_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_mercenary_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &skill_id, &lv, &type);
+ retVal___ = preHookFunc(&bl, &skill_id, &lv, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67731,11 +69561,11 @@ int HP_skill_check_condition_mercenary(struct block_list *bl, int skill_id, int
{
retVal___ = HPMHooks.source.skill.check_condition_mercenary(bl, skill_id, lv, type);
}
- if( HPMHooks.count.HP_skill_check_condition_mercenary_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *skill_id, int *lv, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mercenary_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_condition_mercenary_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int skill_id, int lv, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mercenary_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_mercenary_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &skill_id, &lv, &type);
+ retVal___ = postHookFunc(retVal___, bl, skill_id, lv, type);
}
}
return retVal___;
@@ -67743,14 +69573,14 @@ int HP_skill_check_condition_mercenary(struct block_list *bl, int skill_id, int
struct skill_unit_group* HP_skill_locate_element_field(struct block_list *bl) {
int hIndex = 0;
struct skill_unit_group* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_locate_element_field_pre ) {
- struct skill_unit_group* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_skill_locate_element_field_pre > 0) {
+ struct skill_unit_group* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_locate_element_field_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_locate_element_field_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_locate_element_field_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67758,9 +69588,9 @@ struct skill_unit_group* HP_skill_locate_element_field(struct block_list *bl) {
{
retVal___ = HPMHooks.source.skill.locate_element_field(bl);
}
- if( HPMHooks.count.HP_skill_locate_element_field_post ) {
+ if (HPMHooks.count.HP_skill_locate_element_field_post > 0) {
struct skill_unit_group* (*postHookFunc) (struct skill_unit_group* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_locate_element_field_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_locate_element_field_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_locate_element_field_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -67770,16 +69600,16 @@ struct skill_unit_group* HP_skill_locate_element_field(struct block_list *bl) {
int HP_skill_graffitiremover(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_graffitiremover_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_graffitiremover_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_graffitiremover_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_graffitiremover_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_graffitiremover_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67789,9 +69619,9 @@ int HP_skill_graffitiremover(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.graffitiremover(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_graffitiremover_post ) {
+ if (HPMHooks.count.HP_skill_graffitiremover_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_graffitiremover_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_graffitiremover_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_graffitiremover_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67803,16 +69633,16 @@ int HP_skill_graffitiremover(struct block_list *bl, va_list ap) {
int HP_skill_activate_reverberation(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_activate_reverberation_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_activate_reverberation_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_activate_reverberation_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_activate_reverberation_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_activate_reverberation_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67822,9 +69652,9 @@ int HP_skill_activate_reverberation(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.activate_reverberation(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_activate_reverberation_post ) {
+ if (HPMHooks.count.HP_skill_activate_reverberation_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_activate_reverberation_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_activate_reverberation_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_activate_reverberation_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67836,16 +69666,16 @@ int HP_skill_activate_reverberation(struct block_list *bl, va_list ap) {
int HP_skill_dance_overlap_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_dance_overlap_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_dance_overlap_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_dance_overlap_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67855,9 +69685,9 @@ int HP_skill_dance_overlap_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.dance_overlap_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_dance_overlap_sub_post ) {
+ if (HPMHooks.count.HP_skill_dance_overlap_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_dance_overlap_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67869,14 +69699,14 @@ int HP_skill_dance_overlap_sub(struct block_list *bl, va_list ap) {
int HP_skill_dance_overlap(struct skill_unit *su, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_dance_overlap_pre ) {
- int (*preHookFunc) (struct skill_unit *su, int *flag);
+ if (HPMHooks.count.HP_skill_dance_overlap_pre > 0) {
+ int (*preHookFunc) (struct skill_unit **su, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_dance_overlap_pre[hIndex].func;
- retVal___ = preHookFunc(su, &flag);
+ retVal___ = preHookFunc(&su, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67884,11 +69714,11 @@ int HP_skill_dance_overlap(struct skill_unit *su, int flag) {
{
retVal___ = HPMHooks.source.skill.dance_overlap(su, flag);
}
- if( HPMHooks.count.HP_skill_dance_overlap_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit *su, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_dance_overlap_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit *su, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_overlap_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_dance_overlap_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, su, &flag);
+ retVal___ = postHookFunc(retVal___, su, flag);
}
}
return retVal___;
@@ -67896,14 +69726,14 @@ int HP_skill_dance_overlap(struct skill_unit *su, int flag) {
struct s_skill_unit_layout* HP_skill_get_unit_layout(uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y) {
int hIndex = 0;
struct s_skill_unit_layout* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_get_unit_layout_pre ) {
- struct s_skill_unit_layout* (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv, struct block_list *src, int *x, int *y);
+ if (HPMHooks.count.HP_skill_get_unit_layout_pre > 0) {
+ struct s_skill_unit_layout* (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv, struct block_list **src, int *x, int *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_unit_layout_pre[hIndex].func;
- retVal___ = preHookFunc(&skill_id, &skill_lv, src, &x, &y);
+ retVal___ = preHookFunc(&skill_id, &skill_lv, &src, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67911,11 +69741,11 @@ struct s_skill_unit_layout* HP_skill_get_unit_layout(uint16 skill_id, uint16 ski
{
retVal___ = HPMHooks.source.skill.get_unit_layout(skill_id, skill_lv, src, x, y);
}
- if( HPMHooks.count.HP_skill_get_unit_layout_post ) {
- struct s_skill_unit_layout* (*postHookFunc) (struct s_skill_unit_layout* retVal___, uint16 *skill_id, uint16 *skill_lv, struct block_list *src, int *x, int *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_unit_layout_post > 0) {
+ struct s_skill_unit_layout* (*postHookFunc) (struct s_skill_unit_layout* retVal___, uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_unit_layout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_unit_layout_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv, src, &x, &y);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv, src, x, y);
}
}
return retVal___;
@@ -67923,16 +69753,16 @@ struct s_skill_unit_layout* HP_skill_get_unit_layout(uint16 skill_id, uint16 ski
int HP_skill_frostjoke_scream(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_frostjoke_scream_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_frostjoke_scream_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_frostjoke_scream_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_frostjoke_scream_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_frostjoke_scream_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67942,9 +69772,9 @@ int HP_skill_frostjoke_scream(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.frostjoke_scream(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_frostjoke_scream_post ) {
+ if (HPMHooks.count.HP_skill_frostjoke_scream_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_frostjoke_scream_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_frostjoke_scream_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_frostjoke_scream_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67956,16 +69786,16 @@ int HP_skill_frostjoke_scream(struct block_list *bl, va_list ap) {
int HP_skill_greed(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_greed_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_greed_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_greed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_greed_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_greed_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -67975,9 +69805,9 @@ int HP_skill_greed(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.greed(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_greed_post ) {
+ if (HPMHooks.count.HP_skill_greed_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_greed_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_greed_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_greed_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -67989,16 +69819,16 @@ int HP_skill_greed(struct block_list *bl, va_list ap) {
int HP_skill_destroy_trap(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_destroy_trap_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_destroy_trap_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_destroy_trap_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_destroy_trap_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_destroy_trap_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68008,9 +69838,9 @@ int HP_skill_destroy_trap(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.destroy_trap(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_destroy_trap_post ) {
+ if (HPMHooks.count.HP_skill_destroy_trap_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_destroy_trap_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_destroy_trap_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_destroy_trap_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68022,14 +69852,14 @@ int HP_skill_destroy_trap(struct block_list *bl, va_list ap) {
struct skill_unit_group_tickset* HP_skill_unitgrouptickset_search(struct block_list *bl, struct skill_unit_group *group, int64 tick) {
int hIndex = 0;
struct skill_unit_group_tickset* retVal___ = NULL;
- if( HPMHooks.count.HP_skill_unitgrouptickset_search_pre ) {
- struct skill_unit_group_tickset* (*preHookFunc) (struct block_list *bl, struct skill_unit_group *group, int64 *tick);
+ if (HPMHooks.count.HP_skill_unitgrouptickset_search_pre > 0) {
+ struct skill_unit_group_tickset* (*preHookFunc) (struct block_list **bl, struct skill_unit_group **group, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitgrouptickset_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitgrouptickset_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unitgrouptickset_search_pre[hIndex].func;
- retVal___ = preHookFunc(bl, group, &tick);
+ retVal___ = preHookFunc(&bl, &group, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68037,11 +69867,11 @@ struct skill_unit_group_tickset* HP_skill_unitgrouptickset_search(struct block_l
{
retVal___ = HPMHooks.source.skill.unitgrouptickset_search(bl, group, tick);
}
- if( HPMHooks.count.HP_skill_unitgrouptickset_search_post ) {
- struct skill_unit_group_tickset* (*postHookFunc) (struct skill_unit_group_tickset* retVal___, struct block_list *bl, struct skill_unit_group *group, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitgrouptickset_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unitgrouptickset_search_post > 0) {
+ struct skill_unit_group_tickset* (*postHookFunc) (struct skill_unit_group_tickset* retVal___, struct block_list *bl, struct skill_unit_group *group, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitgrouptickset_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unitgrouptickset_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, group, &tick);
+ retVal___ = postHookFunc(retVal___, bl, group, tick);
}
}
return retVal___;
@@ -68049,14 +69879,14 @@ struct skill_unit_group_tickset* HP_skill_unitgrouptickset_search(struct block_l
bool HP_skill_dance_switch(struct skill_unit *su, int flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_dance_switch_pre ) {
- bool (*preHookFunc) (struct skill_unit *su, int *flag);
+ if (HPMHooks.count.HP_skill_dance_switch_pre > 0) {
+ bool (*preHookFunc) (struct skill_unit **su, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_switch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_switch_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_dance_switch_pre[hIndex].func;
- retVal___ = preHookFunc(su, &flag);
+ retVal___ = preHookFunc(&su, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68064,11 +69894,11 @@ bool HP_skill_dance_switch(struct skill_unit *su, int flag) {
{
retVal___ = HPMHooks.source.skill.dance_switch(su, flag);
}
- if( HPMHooks.count.HP_skill_dance_switch_post ) {
- bool (*postHookFunc) (bool retVal___, struct skill_unit *su, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_switch_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_dance_switch_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct skill_unit *su, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_dance_switch_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_dance_switch_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, su, &flag);
+ retVal___ = postHookFunc(retVal___, su, flag);
}
}
return retVal___;
@@ -68076,16 +69906,16 @@ bool HP_skill_dance_switch(struct skill_unit *su, int flag) {
int HP_skill_check_condition_char_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_char_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_check_condition_char_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_char_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_char_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_check_condition_char_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68095,9 +69925,9 @@ int HP_skill_check_condition_char_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.check_condition_char_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_check_condition_char_sub_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_char_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_char_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_char_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_check_condition_char_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68109,16 +69939,16 @@ int HP_skill_check_condition_char_sub(struct block_list *bl, va_list ap) {
int HP_skill_check_condition_mob_master_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_mob_master_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_check_condition_mob_master_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mob_master_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mob_master_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_check_condition_mob_master_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68128,9 +69958,9 @@ int HP_skill_check_condition_mob_master_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.check_condition_mob_master_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_check_condition_mob_master_sub_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_mob_master_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mob_master_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_mob_master_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_check_condition_mob_master_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68141,14 +69971,14 @@ int HP_skill_check_condition_mob_master_sub(struct block_list *bl, va_list ap) {
}
void HP_skill_brandishspear_first(struct square *tc, uint8 dir, int16 x, int16 y) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_brandishspear_first_pre ) {
- void (*preHookFunc) (struct square *tc, uint8 *dir, int16 *x, int16 *y);
+ if (HPMHooks.count.HP_skill_brandishspear_first_pre > 0) {
+ void (*preHookFunc) (struct square **tc, uint8 *dir, int16 *x, int16 *y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_first_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_first_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_brandishspear_first_pre[hIndex].func;
- preHookFunc(tc, &dir, &x, &y);
+ preHookFunc(&tc, &dir, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -68156,25 +69986,25 @@ void HP_skill_brandishspear_first(struct square *tc, uint8 dir, int16 x, int16 y
{
HPMHooks.source.skill.brandishspear_first(tc, dir, x, y);
}
- if( HPMHooks.count.HP_skill_brandishspear_first_post ) {
- void (*postHookFunc) (struct square *tc, uint8 *dir, int16 *x, int16 *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_first_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_brandishspear_first_post > 0) {
+ void (*postHookFunc) (struct square *tc, uint8 dir, int16 x, int16 y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_first_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_brandishspear_first_post[hIndex].func;
- postHookFunc(tc, &dir, &x, &y);
+ postHookFunc(tc, dir, x, y);
}
}
return;
}
void HP_skill_brandishspear_dir(struct square *tc, uint8 dir, int are) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_brandishspear_dir_pre ) {
- void (*preHookFunc) (struct square *tc, uint8 *dir, int *are);
+ if (HPMHooks.count.HP_skill_brandishspear_dir_pre > 0) {
+ void (*preHookFunc) (struct square **tc, uint8 *dir, int *are);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_dir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_dir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_brandishspear_dir_pre[hIndex].func;
- preHookFunc(tc, &dir, &are);
+ preHookFunc(&tc, &dir, &are);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -68182,11 +70012,11 @@ void HP_skill_brandishspear_dir(struct square *tc, uint8 dir, int are) {
{
HPMHooks.source.skill.brandishspear_dir(tc, dir, are);
}
- if( HPMHooks.count.HP_skill_brandishspear_dir_post ) {
- void (*postHookFunc) (struct square *tc, uint8 *dir, int *are);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_dir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_brandishspear_dir_post > 0) {
+ void (*postHookFunc) (struct square *tc, uint8 dir, int are);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_brandishspear_dir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_brandishspear_dir_post[hIndex].func;
- postHookFunc(tc, &dir, &are);
+ postHookFunc(tc, dir, are);
}
}
return;
@@ -68194,14 +70024,14 @@ void HP_skill_brandishspear_dir(struct square *tc, uint8 dir, int are) {
int HP_skill_get_fixed_cast(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_fixed_cast_pre ) {
+ if (HPMHooks.count.HP_skill_get_fixed_cast_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_fixed_cast_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_fixed_cast_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_fixed_cast_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68209,11 +70039,11 @@ int HP_skill_get_fixed_cast(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_fixed_cast(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_fixed_cast_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_fixed_cast_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_fixed_cast_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_fixed_cast_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_fixed_cast_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
@@ -68221,16 +70051,16 @@ int HP_skill_get_fixed_cast(uint16 skill_id, uint16 skill_lv) {
int HP_skill_sit_count(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_sit_count_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_sit_count_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_count_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_count_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_sit_count_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68240,9 +70070,9 @@ int HP_skill_sit_count(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.sit_count(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_sit_count_post ) {
+ if (HPMHooks.count.HP_skill_sit_count_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_count_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_count_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_sit_count_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68254,16 +70084,16 @@ int HP_skill_sit_count(struct block_list *bl, va_list ap) {
int HP_skill_sit_in(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_sit_in_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_sit_in_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_in_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_in_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_sit_in_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68273,9 +70103,9 @@ int HP_skill_sit_in(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.sit_in(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_sit_in_post ) {
+ if (HPMHooks.count.HP_skill_sit_in_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_in_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_in_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_sit_in_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68287,16 +70117,16 @@ int HP_skill_sit_in(struct block_list *bl, va_list ap) {
int HP_skill_sit_out(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_sit_out_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_sit_out_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_out_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_out_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_sit_out_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68306,9 +70136,9 @@ int HP_skill_sit_out(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.sit_out(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_sit_out_post ) {
+ if (HPMHooks.count.HP_skill_sit_out_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_out_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_sit_out_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_sit_out_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68319,14 +70149,14 @@ int HP_skill_sit_out(struct block_list *bl, va_list ap) {
}
void HP_skill_unitsetmapcell(struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_unitsetmapcell_pre ) {
- void (*preHookFunc) (struct skill_unit *src, uint16 *skill_id, uint16 *skill_lv, cell_t *cell, bool *flag);
+ if (HPMHooks.count.HP_skill_unitsetmapcell_pre > 0) {
+ void (*preHookFunc) (struct skill_unit **src, uint16 *skill_id, uint16 *skill_lv, cell_t *cell, bool *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetmapcell_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetmapcell_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unitsetmapcell_pre[hIndex].func;
- preHookFunc(src, &skill_id, &skill_lv, &cell, &flag);
+ preHookFunc(&src, &skill_id, &skill_lv, &cell, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -68334,11 +70164,11 @@ void HP_skill_unitsetmapcell(struct skill_unit *src, uint16 skill_id, uint16 ski
{
HPMHooks.source.skill.unitsetmapcell(src, skill_id, skill_lv, cell, flag);
}
- if( HPMHooks.count.HP_skill_unitsetmapcell_post ) {
- void (*postHookFunc) (struct skill_unit *src, uint16 *skill_id, uint16 *skill_lv, cell_t *cell, bool *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetmapcell_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unitsetmapcell_post > 0) {
+ void (*postHookFunc) (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetmapcell_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unitsetmapcell_post[hIndex].func;
- postHookFunc(src, &skill_id, &skill_lv, &cell, &flag);
+ postHookFunc(src, skill_id, skill_lv, cell, flag);
}
}
return;
@@ -68346,14 +70176,14 @@ void HP_skill_unitsetmapcell(struct skill_unit *src, uint16 skill_id, uint16 ski
int HP_skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_onplace_timer_pre ) {
- int (*preHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+ if (HPMHooks.count.HP_skill_unit_onplace_timer_pre > 0) {
+ int (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_onplace_timer_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &tick);
+ retVal___ = preHookFunc(&src, &bl, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68361,28 +70191,54 @@ int HP_skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, i
{
retVal___ = HPMHooks.source.skill.unit_onplace_timer(src, bl, tick);
}
- if( HPMHooks.count.HP_skill_unit_onplace_timer_post ) {
- int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_onplace_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, struct skill_unit *src, struct block_list *bl, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_onplace_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &tick);
+ retVal___ = postHookFunc(retVal___, src, bl, tick);
}
}
return retVal___;
}
+void HP_skill_unit_onplace_timer_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_unit_onplace_timer_unknown_pre > 0) {
+ void (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 **tick);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_unknown_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_unit_onplace_timer_unknown_pre[hIndex].func;
+ preHookFunc(&src, &bl, &tick);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.unit_onplace_timer_unknown(src, bl, tick);
+ }
+ if (HPMHooks.count.HP_skill_unit_onplace_timer_unknown_post > 0) {
+ void (*postHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_timer_unknown_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_unit_onplace_timer_unknown_post[hIndex].func;
+ postHookFunc(src, bl, tick);
+ }
+ }
+ return;
+}
int HP_skill_unit_effect(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_effect_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_unit_effect_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_effect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_effect_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_unit_effect_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68392,9 +70248,9 @@ int HP_skill_unit_effect(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.unit_effect(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_unit_effect_post ) {
+ if (HPMHooks.count.HP_skill_unit_effect_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_effect_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_effect_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_unit_effect_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68406,16 +70262,16 @@ int HP_skill_unit_effect(struct block_list *bl, va_list ap) {
int HP_skill_unit_timer_sub_onplace(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_timer_sub_onplace_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_unit_timer_sub_onplace_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_onplace_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_onplace_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_unit_timer_sub_onplace_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68425,9 +70281,9 @@ int HP_skill_unit_timer_sub_onplace(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.unit_timer_sub_onplace(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_unit_timer_sub_onplace_post ) {
+ if (HPMHooks.count.HP_skill_unit_timer_sub_onplace_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_onplace_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_onplace_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_unit_timer_sub_onplace_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68439,16 +70295,16 @@ int HP_skill_unit_timer_sub_onplace(struct block_list *bl, va_list ap) {
int HP_skill_unit_move_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_move_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_unit_move_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_unit_move_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68458,9 +70314,9 @@ int HP_skill_unit_move_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.unit_move_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_unit_move_sub_post ) {
+ if (HPMHooks.count.HP_skill_unit_move_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_move_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_unit_move_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -68472,14 +70328,14 @@ int HP_skill_unit_move_sub(struct block_list *bl, va_list ap) {
int HP_skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blockpc_end_pre ) {
+ if (HPMHooks.count.HP_skill_blockpc_end_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blockpc_end_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68487,11 +70343,11 @@ int HP_skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.blockpc_end(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_blockpc_end_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blockpc_end_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blockpc_end_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -68499,14 +70355,14 @@ int HP_skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) {
int HP_skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blockhomun_end_pre ) {
+ if (HPMHooks.count.HP_skill_blockhomun_end_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blockhomun_end_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68514,11 +70370,11 @@ int HP_skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.blockhomun_end(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_blockhomun_end_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blockhomun_end_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockhomun_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blockhomun_end_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -68526,14 +70382,14 @@ int HP_skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) {
int HP_skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_blockmerc_end_pre ) {
+ if (HPMHooks.count.HP_skill_blockmerc_end_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_end_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_end_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_blockmerc_end_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68541,11 +70397,11 @@ int HP_skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.blockmerc_end(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_blockmerc_end_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_end_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_blockmerc_end_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockmerc_end_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_blockmerc_end_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -68553,14 +70409,14 @@ int HP_skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {
int HP_skill_split_atoi(char *str, int *val) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_split_atoi_pre ) {
- int (*preHookFunc) (char *str, int *val);
+ if (HPMHooks.count.HP_skill_split_atoi_pre > 0) {
+ int (*preHookFunc) (char **str, int **val);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_split_atoi_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_split_atoi_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_split_atoi_pre[hIndex].func;
- retVal___ = preHookFunc(str, val);
+ retVal___ = preHookFunc(&str, &val);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68568,9 +70424,9 @@ int HP_skill_split_atoi(char *str, int *val) {
{
retVal___ = HPMHooks.source.skill.split_atoi(str, val);
}
- if( HPMHooks.count.HP_skill_split_atoi_post ) {
+ if (HPMHooks.count.HP_skill_split_atoi_post > 0) {
int (*postHookFunc) (int retVal___, char *str, int *val);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_split_atoi_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_split_atoi_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_split_atoi_post[hIndex].func;
retVal___ = postHookFunc(retVal___, str, val);
}
@@ -68580,14 +70436,14 @@ int HP_skill_split_atoi(char *str, int *val) {
int HP_skill_unit_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_timer_pre ) {
+ if (HPMHooks.count.HP_skill_unit_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68595,28 +70451,28 @@ int HP_skill_unit_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.skill.unit_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_skill_unit_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
-int HP_skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
+int HP_skill_unit_timer_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_unit_timer_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_skill_unit_timer_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_unit_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68626,12 +70482,12 @@ int HP_skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.skill.unit_timer_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_unit_timer_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_unit_timer_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_timer_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_unit_timer_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
@@ -68639,14 +70495,14 @@ int HP_skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
}
void HP_skill_init_unit_layout(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_init_unit_layout_pre ) {
+ if (HPMHooks.count.HP_skill_init_unit_layout_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_init_unit_layout_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -68654,161 +70510,603 @@ void HP_skill_init_unit_layout(void) {
{
HPMHooks.source.skill.init_unit_layout();
}
- if( HPMHooks.count.HP_skill_init_unit_layout_post ) {
+ if (HPMHooks.count.HP_skill_init_unit_layout_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_init_unit_layout_post[hIndex].func;
postHookFunc();
}
}
return;
}
-bool HP_skill_parse_row_skilldb(char *split[], int columns, int current) {
+void HP_skill_init_unit_layout_unknown(int skill_idx) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_init_unit_layout_unknown_pre > 0) {
+ void (*preHookFunc) (int *skill_idx);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_unknown_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_init_unit_layout_unknown_pre[hIndex].func;
+ preHookFunc(&skill_idx);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.init_unit_layout_unknown(skill_idx);
+ }
+ if (HPMHooks.count.HP_skill_init_unit_layout_unknown_post > 0) {
+ void (*postHookFunc) (int skill_idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_init_unit_layout_unknown_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_init_unit_layout_unknown_post[hIndex].func;
+ postHookFunc(skill_idx);
+ }
+ }
+ return;
+}
+void HP_skill_validate_hittype(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_hittype_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_hittype_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_hittype_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_hittype(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_hittype_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_hittype_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_hittype_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_skilltype(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_skilltype_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilltype_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_skilltype_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_skilltype(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_skilltype_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilltype_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_skilltype_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_attacktype(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_attacktype_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_attacktype_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_attacktype_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_attacktype(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_attacktype_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_attacktype_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_attacktype_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_element_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_element_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_element_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_element(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_element_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_element_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_element_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_skillinfo_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skillinfo_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_skillinfo_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_skillinfo(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_skillinfo_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skillinfo_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_skillinfo_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_damagetype(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_damagetype_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_damagetype_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_damagetype_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_damagetype(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_damagetype_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_damagetype_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_damagetype_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db *sk, bool delay) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_castnodex_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk, bool *delay);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_castnodex_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_castnodex_pre[hIndex].func;
+ preHookFunc(&conf, &sk, &delay);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_castnodex(conf, sk, delay);
+ }
+ if (HPMHooks.count.HP_skill_validate_castnodex_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk, bool delay);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_castnodex_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_castnodex_post[hIndex].func;
+ postHookFunc(conf, sk, delay);
+ }
+ }
+ return;
+}
+void HP_skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_weapontype_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_weapontype_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_weapontype(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_weapontype_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_weapontype_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_ammotype_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_ammotype_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_ammotype(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_ammotype_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_ammotype_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_state(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_state_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_state_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_state_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_state(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_state_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_state_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_state_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_item_requirements(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_item_requirements_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_item_requirements_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_item_requirements_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_item_requirements(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_item_requirements_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_item_requirements_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_item_requirements_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_unit_target(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_unit_target_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_target_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_unit_target_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_unit_target(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_unit_target_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_target_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_unit_target_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_unit_flag_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_unit_flag(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_unit_flag_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+void HP_skill_validate_additional_fields(struct config_setting_t *conf, struct s_skill_db *sk) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_validate_additional_fields_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, struct s_skill_db **sk);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_additional_fields_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_additional_fields_pre[hIndex].func;
+ preHookFunc(&conf, &sk);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.validate_additional_fields(conf, sk);
+ }
+ if (HPMHooks.count.HP_skill_validate_additional_fields_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_additional_fields_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_additional_fields_post[hIndex].func;
+ postHookFunc(conf, sk);
+ }
+ }
+ return;
+}
+bool HP_skill_validate_skilldb(struct s_skill_db *skt, const char *source) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_skilldb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_validate_skilldb_pre > 0) {
+ bool (*preHookFunc) (struct s_skill_db **skt, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_skilldb_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_skill_parse_row_skilldb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilldb_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_skilldb_pre[hIndex].func;
+ retVal___ = preHookFunc(&skt, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.parse_row_skilldb(split, columns, current);
+ retVal___ = HPMHooks.source.skill.validate_skilldb(skt, source);
}
- if( HPMHooks.count.HP_skill_parse_row_skilldb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_skilldb_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_skill_parse_row_skilldb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ if (HPMHooks.count.HP_skill_validate_skilldb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct s_skill_db *skt, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_skilldb_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_skilldb_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, skt, source);
}
}
return retVal___;
}
-bool HP_skill_parse_row_requiredb(char *split[], int columns, int current) {
+int HP_skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk) {
int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_requiredb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_validate_weapontype_sub_pre > 0) {
+ int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_requiredb_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_skill_parse_row_requiredb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_weapontype_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&type, &on, &sk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.parse_row_requiredb(split, columns, current);
+ retVal___ = HPMHooks.source.skill.validate_weapontype_sub(type, on, sk);
}
- if( HPMHooks.count.HP_skill_parse_row_requiredb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_requiredb_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_skill_parse_row_requiredb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ if (HPMHooks.count.HP_skill_validate_weapontype_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_weapontype_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, type, on, sk);
}
}
return retVal___;
}
-bool HP_skill_parse_row_castdb(char *split[], int columns, int current) {
+int HP_skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk) {
int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_castdb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_validate_ammotype_sub_pre > 0) {
+ int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castdb_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_skill_parse_row_castdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_ammotype_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&type, &on, &sk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.parse_row_castdb(split, columns, current);
+ retVal___ = HPMHooks.source.skill.validate_ammotype_sub(type, on, sk);
}
- if( HPMHooks.count.HP_skill_parse_row_castdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castdb_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_skill_parse_row_castdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ if (HPMHooks.count.HP_skill_validate_ammotype_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_ammotype_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, type, on, sk);
}
}
return retVal___;
}
-bool HP_skill_parse_row_castnodexdb(char *split[], int columns, int current) {
+int HP_skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *sk) {
int hIndex = 0;
- bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_castnodexdb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_validate_unit_flag_sub_pre > 0) {
+ int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castnodexdb_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_skill_parse_row_castnodexdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&type, &on, &sk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.parse_row_castnodexdb(split, columns, current);
+ retVal___ = HPMHooks.source.skill.validate_unit_flag_sub(type, on, sk);
}
- if( HPMHooks.count.HP_skill_parse_row_castnodexdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_castnodexdb_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_skill_parse_row_castnodexdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ if (HPMHooks.count.HP_skill_validate_unit_flag_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, type, on, sk);
}
}
return retVal___;
}
-bool HP_skill_parse_row_unitdb(char *split[], int columns, int current) {
+bool HP_skill_read_skilldb(const char *filename) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_unitdb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_read_skilldb_pre > 0) {
+ bool (*preHookFunc) (const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_unitdb_pre; hIndex++ ) {
- preHookFunc = HPMHooks.list.HP_skill_parse_row_unitdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_skilldb_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_read_skilldb_pre[hIndex].func;
+ retVal___ = preHookFunc(&filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.parse_row_unitdb(split, columns, current);
+ retVal___ = HPMHooks.source.skill.read_skilldb(filename);
}
- if( HPMHooks.count.HP_skill_parse_row_unitdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_unitdb_post; hIndex++ ) {
- postHookFunc = HPMHooks.list.HP_skill_parse_row_unitdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ if (HPMHooks.count.HP_skill_read_skilldb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *filename);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_read_skilldb_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_read_skilldb_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, filename);
}
}
return retVal___;
}
+void HP_skill_config_set_level(struct config_setting_t *conf, int *arr) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_config_set_level_pre > 0) {
+ void (*preHookFunc) (struct config_setting_t **conf, int **arr);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_config_set_level_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_config_set_level_pre[hIndex].func;
+ preHookFunc(&conf, &arr);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.config_set_level(conf, arr);
+ }
+ if (HPMHooks.count.HP_skill_config_set_level_post > 0) {
+ void (*postHookFunc) (struct config_setting_t *conf, int *arr);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_config_set_level_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_config_set_level_post[hIndex].func;
+ postHookFunc(conf, arr);
+ }
+ }
+ return;
+}
+void HP_skill_level_set_value(int *arr, int value) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_skill_level_set_value_pre > 0) {
+ void (*preHookFunc) (int **arr, int *value);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_level_set_value_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_level_set_value_pre[hIndex].func;
+ preHookFunc(&arr, &value);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.skill.level_set_value(arr, value);
+ }
+ if (HPMHooks.count.HP_skill_level_set_value_post > 0) {
+ void (*postHookFunc) (int *arr, int value);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_level_set_value_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_level_set_value_post[hIndex].func;
+ postHookFunc(arr, value);
+ }
+ }
+ return;
+}
bool HP_skill_parse_row_producedb(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_producedb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_producedb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_producedb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_producedb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_producedb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68816,11 +71114,11 @@ bool HP_skill_parse_row_producedb(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.skill.parse_row_producedb(split, columns, current);
}
- if( HPMHooks.count.HP_skill_parse_row_producedb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_producedb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_producedb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_producedb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_producedb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
@@ -68828,14 +71126,14 @@ bool HP_skill_parse_row_producedb(char *split[], int columns, int current) {
bool HP_skill_parse_row_createarrowdb(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_createarrowdb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_createarrowdb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_createarrowdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_createarrowdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_createarrowdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68843,11 +71141,11 @@ bool HP_skill_parse_row_createarrowdb(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.skill.parse_row_createarrowdb(split, columns, current);
}
- if( HPMHooks.count.HP_skill_parse_row_createarrowdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_createarrowdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_createarrowdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_createarrowdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_createarrowdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
@@ -68855,14 +71153,14 @@ bool HP_skill_parse_row_createarrowdb(char *split[], int columns, int current) {
bool HP_skill_parse_row_abradb(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_abradb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_abradb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_abradb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_abradb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_abradb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68870,11 +71168,11 @@ bool HP_skill_parse_row_abradb(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.skill.parse_row_abradb(split, columns, current);
}
- if( HPMHooks.count.HP_skill_parse_row_abradb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_abradb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_abradb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_abradb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_abradb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
@@ -68882,14 +71180,14 @@ bool HP_skill_parse_row_abradb(char *split[], int columns, int current) {
bool HP_skill_parse_row_spellbookdb(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_spellbookdb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_spellbookdb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_spellbookdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_spellbookdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_spellbookdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68897,11 +71195,11 @@ bool HP_skill_parse_row_spellbookdb(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.skill.parse_row_spellbookdb(split, columns, current);
}
- if( HPMHooks.count.HP_skill_parse_row_spellbookdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_spellbookdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_spellbookdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_spellbookdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_spellbookdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
@@ -68909,14 +71207,14 @@ bool HP_skill_parse_row_spellbookdb(char *split[], int columns, int current) {
bool HP_skill_parse_row_magicmushroomdb(char *split[], int column, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_magicmushroomdb_pre ) {
- bool (*preHookFunc) (char *split[], int *column, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_magicmushroomdb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *column, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_magicmushroomdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_magicmushroomdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_magicmushroomdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &column, &current);
+ retVal___ = preHookFunc(&split, &column, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68924,11 +71222,11 @@ bool HP_skill_parse_row_magicmushroomdb(char *split[], int column, int current)
{
retVal___ = HPMHooks.source.skill.parse_row_magicmushroomdb(split, column, current);
}
- if( HPMHooks.count.HP_skill_parse_row_magicmushroomdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *column, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_magicmushroomdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_magicmushroomdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int column, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_magicmushroomdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_magicmushroomdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &column, &current);
+ retVal___ = postHookFunc(retVal___, split, column, current);
}
}
return retVal___;
@@ -68936,14 +71234,14 @@ bool HP_skill_parse_row_magicmushroomdb(char *split[], int column, int current)
bool HP_skill_parse_row_reproducedb(char *split[], int column, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_reproducedb_pre ) {
- bool (*preHookFunc) (char *split[], int *column, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_reproducedb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *column, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_reproducedb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_reproducedb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_reproducedb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &column, &current);
+ retVal___ = preHookFunc(&split, &column, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68951,11 +71249,11 @@ bool HP_skill_parse_row_reproducedb(char *split[], int column, int current) {
{
retVal___ = HPMHooks.source.skill.parse_row_reproducedb(split, column, current);
}
- if( HPMHooks.count.HP_skill_parse_row_reproducedb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *column, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_reproducedb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_reproducedb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int column, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_reproducedb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_reproducedb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &column, &current);
+ retVal___ = postHookFunc(retVal___, split, column, current);
}
}
return retVal___;
@@ -68963,14 +71261,14 @@ bool HP_skill_parse_row_reproducedb(char *split[], int column, int current) {
bool HP_skill_parse_row_improvisedb(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_improvisedb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_improvisedb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_improvisedb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_improvisedb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_improvisedb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -68978,11 +71276,11 @@ bool HP_skill_parse_row_improvisedb(char *split[], int columns, int current) {
{
retVal___ = HPMHooks.source.skill.parse_row_improvisedb(split, columns, current);
}
- if( HPMHooks.count.HP_skill_parse_row_improvisedb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_improvisedb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_improvisedb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_improvisedb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_improvisedb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
@@ -68990,14 +71288,14 @@ bool HP_skill_parse_row_improvisedb(char *split[], int columns, int current) {
bool HP_skill_parse_row_changematerialdb(char *split[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_parse_row_changematerialdb_pre ) {
- bool (*preHookFunc) (char *split[], int *columns, int *current);
+ if (HPMHooks.count.HP_skill_parse_row_changematerialdb_pre > 0) {
+ bool (*preHookFunc) (char **split[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_changematerialdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_changematerialdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_parse_row_changematerialdb_pre[hIndex].func;
- retVal___ = preHookFunc(split, &columns, &current);
+ retVal___ = preHookFunc(&split, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69005,25 +71303,25 @@ bool HP_skill_parse_row_changematerialdb(char *split[], int columns, int current
{
retVal___ = HPMHooks.source.skill.parse_row_changematerialdb(split, columns, current);
}
- if( HPMHooks.count.HP_skill_parse_row_changematerialdb_post ) {
- bool (*postHookFunc) (bool retVal___, char *split[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_changematerialdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_parse_row_changematerialdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *split[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_parse_row_changematerialdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_parse_row_changematerialdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, split, &columns, &current);
+ retVal___ = postHookFunc(retVal___, split, columns, current);
}
}
return retVal___;
}
void HP_skill_usave_add(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_usave_add_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_usave_add_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_usave_add_pre[hIndex].func;
- preHookFunc(sd, &skill_id, &skill_lv);
+ preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69031,25 +71329,25 @@ void HP_skill_usave_add(struct map_session_data *sd, uint16 skill_id, uint16 ski
{
HPMHooks.source.skill.usave_add(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_usave_add_post ) {
- void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_usave_add_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_usave_add_post[hIndex].func;
- postHookFunc(sd, &skill_id, &skill_lv);
+ postHookFunc(sd, skill_id, skill_lv);
}
}
return;
}
void HP_skill_usave_trigger(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_usave_trigger_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_skill_usave_trigger_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_trigger_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_trigger_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_usave_trigger_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69057,9 +71355,9 @@ void HP_skill_usave_trigger(struct map_session_data *sd) {
{
HPMHooks.source.skill.usave_trigger(sd);
}
- if( HPMHooks.count.HP_skill_usave_trigger_post ) {
+ if (HPMHooks.count.HP_skill_usave_trigger_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_trigger_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_usave_trigger_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_usave_trigger_post[hIndex].func;
postHookFunc(sd);
}
@@ -69068,14 +71366,14 @@ void HP_skill_usave_trigger(struct map_session_data *sd) {
}
void HP_skill_cooldown_load(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_cooldown_load_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_skill_cooldown_load_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_load_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_load_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_cooldown_load_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69083,9 +71381,9 @@ void HP_skill_cooldown_load(struct map_session_data *sd) {
{
HPMHooks.source.skill.cooldown_load(sd);
}
- if( HPMHooks.count.HP_skill_cooldown_load_post ) {
+ if (HPMHooks.count.HP_skill_cooldown_load_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_load_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_load_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_cooldown_load_post[hIndex].func;
postHookFunc(sd);
}
@@ -69095,14 +71393,14 @@ void HP_skill_cooldown_load(struct map_session_data *sd) {
int HP_skill_spellbook(struct map_session_data *sd, int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_spellbook_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_skill_spellbook_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_spellbook_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_spellbook_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_spellbook_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69110,11 +71408,11 @@ int HP_skill_spellbook(struct map_session_data *sd, int nameid) {
{
retVal___ = HPMHooks.source.skill.spellbook(sd, nameid);
}
- if( HPMHooks.count.HP_skill_spellbook_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_spellbook_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_spellbook_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_spellbook_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_spellbook_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
@@ -69122,14 +71420,14 @@ int HP_skill_spellbook(struct map_session_data *sd, int nameid) {
int HP_skill_block_check(struct block_list *bl, enum sc_type type, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_block_check_pre ) {
- int (*preHookFunc) (struct block_list *bl, enum sc_type *type, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_block_check_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, enum sc_type *type, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_block_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_block_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_block_check_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type, &skill_id);
+ retVal___ = preHookFunc(&bl, &type, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69137,11 +71435,11 @@ int HP_skill_block_check(struct block_list *bl, enum sc_type type, uint16 skill_
{
retVal___ = HPMHooks.source.skill.block_check(bl, type, skill_id);
}
- if( HPMHooks.count.HP_skill_block_check_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, enum sc_type *type, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_block_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_block_check_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, enum sc_type type, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_block_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_block_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type, &skill_id);
+ retVal___ = postHookFunc(retVal___, bl, type, skill_id);
}
}
return retVal___;
@@ -69149,16 +71447,16 @@ int HP_skill_block_check(struct block_list *bl, enum sc_type type, uint16 skill_
int HP_skill_detonator(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_detonator_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_skill_detonator_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_detonator_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_detonator_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_skill_detonator_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69168,9 +71466,9 @@ int HP_skill_detonator(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.skill.detonator(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_skill_detonator_post ) {
+ if (HPMHooks.count.HP_skill_detonator_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_detonator_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_detonator_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_skill_detonator_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -69182,14 +71480,14 @@ int HP_skill_detonator(struct block_list *bl, va_list ap) {
bool HP_skill_check_camouflage(struct block_list *bl, struct status_change_entry *sce) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_check_camouflage_pre ) {
- bool (*preHookFunc) (struct block_list *bl, struct status_change_entry *sce);
+ if (HPMHooks.count.HP_skill_check_camouflage_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl, struct status_change_entry **sce);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_camouflage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_camouflage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_camouflage_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sce);
+ retVal___ = preHookFunc(&bl, &sce);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69197,9 +71495,9 @@ bool HP_skill_check_camouflage(struct block_list *bl, struct status_change_entry
{
retVal___ = HPMHooks.source.skill.check_camouflage(bl, sce);
}
- if( HPMHooks.count.HP_skill_check_camouflage_post ) {
+ if (HPMHooks.count.HP_skill_check_camouflage_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct status_change_entry *sce);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_camouflage_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_camouflage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_camouflage_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, sce);
}
@@ -69209,14 +71507,14 @@ bool HP_skill_check_camouflage(struct block_list *bl, struct status_change_entry
int HP_skill_magicdecoy(struct map_session_data *sd, int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_magicdecoy_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_skill_magicdecoy_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_magicdecoy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_magicdecoy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_magicdecoy_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69224,11 +71522,11 @@ int HP_skill_magicdecoy(struct map_session_data *sd, int nameid) {
{
retVal___ = HPMHooks.source.skill.magicdecoy(sd, nameid);
}
- if( HPMHooks.count.HP_skill_magicdecoy_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_magicdecoy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_magicdecoy_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_magicdecoy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_magicdecoy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
@@ -69236,14 +71534,14 @@ int HP_skill_magicdecoy(struct map_session_data *sd, int nameid) {
int HP_skill_poisoningweapon(struct map_session_data *sd, int nameid) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_poisoningweapon_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *nameid);
+ if (HPMHooks.count.HP_skill_poisoningweapon_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_poisoningweapon_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_poisoningweapon_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_poisoningweapon_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69251,11 +71549,11 @@ int HP_skill_poisoningweapon(struct map_session_data *sd, int nameid) {
{
retVal___ = HPMHooks.source.skill.poisoningweapon(sd, nameid);
}
- if( HPMHooks.count.HP_skill_poisoningweapon_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_poisoningweapon_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_poisoningweapon_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_poisoningweapon_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_poisoningweapon_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
@@ -69263,14 +71561,14 @@ int HP_skill_poisoningweapon(struct map_session_data *sd, int nameid) {
int HP_skill_select_menu(struct map_session_data *sd, uint16 skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_select_menu_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_select_menu_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_select_menu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_select_menu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_select_menu_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &skill_id);
+ retVal___ = preHookFunc(&sd, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69278,65 +71576,65 @@ int HP_skill_select_menu(struct map_session_data *sd, uint16 skill_id) {
{
retVal___ = HPMHooks.source.skill.select_menu(sd, skill_id);
}
- if( HPMHooks.count.HP_skill_select_menu_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_select_menu_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_select_menu_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_select_menu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_select_menu_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &skill_id);
+ retVal___ = postHookFunc(retVal___, sd, skill_id);
}
}
return retVal___;
}
-int HP_skill_elementalanalysis(struct map_session_data *sd, int n, uint16 skill_lv, unsigned short *item_list) {
+int HP_skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_elementalanalysis_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, uint16 *skill_lv, unsigned short *item_list);
+ if (HPMHooks.count.HP_skill_elementalanalysis_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, uint16 *skill_lv, const struct itemlist **item_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_elementalanalysis_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_elementalanalysis_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_elementalanalysis_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &skill_lv, item_list);
+ retVal___ = preHookFunc(&sd, &skill_lv, &item_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.elementalanalysis(sd, n, skill_lv, item_list);
+ retVal___ = HPMHooks.source.skill.elementalanalysis(sd, skill_lv, item_list);
}
- if( HPMHooks.count.HP_skill_elementalanalysis_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, uint16 *skill_lv, unsigned short *item_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_elementalanalysis_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_elementalanalysis_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_elementalanalysis_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_elementalanalysis_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &skill_lv, item_list);
+ retVal___ = postHookFunc(retVal___, sd, skill_lv, item_list);
}
}
return retVal___;
}
-int HP_skill_changematerial(struct map_session_data *sd, int n, unsigned short *item_list) {
+int HP_skill_changematerial(struct map_session_data *sd, const struct itemlist *item_list) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_changematerial_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, unsigned short *item_list);
+ if (HPMHooks.count.HP_skill_changematerial_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, const struct itemlist **item_list);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_changematerial_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_changematerial_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_changematerial_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, item_list);
+ retVal___ = preHookFunc(&sd, &item_list);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.skill.changematerial(sd, n, item_list);
+ retVal___ = HPMHooks.source.skill.changematerial(sd, item_list);
}
- if( HPMHooks.count.HP_skill_changematerial_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, unsigned short *item_list);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_changematerial_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_changematerial_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, const struct itemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_changematerial_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_changematerial_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, item_list);
+ retVal___ = postHookFunc(retVal___, sd, item_list);
}
}
return retVal___;
@@ -69344,14 +71642,14 @@ int HP_skill_changematerial(struct map_session_data *sd, int n, unsigned short *
int HP_skill_get_elemental_type(uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_elemental_type_pre ) {
+ if (HPMHooks.count.HP_skill_get_elemental_type_pre > 0) {
int (*preHookFunc) (uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_elemental_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_elemental_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_elemental_type_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69359,25 +71657,25 @@ int HP_skill_get_elemental_type(uint16 skill_id, uint16 skill_lv) {
{
retVal___ = HPMHooks.source.skill.get_elemental_type(skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_get_elemental_type_post ) {
- int (*postHookFunc) (int retVal___, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_elemental_type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_get_elemental_type_post > 0) {
+ int (*postHookFunc) (int retVal___, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_elemental_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_elemental_type_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, skill_id, skill_lv);
}
}
return retVal___;
}
void HP_skill_cooldown_save(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_cooldown_save_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_skill_cooldown_save_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_save_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_save_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_cooldown_save_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69385,9 +71683,9 @@ void HP_skill_cooldown_save(struct map_session_data *sd) {
{
HPMHooks.source.skill.cooldown_save(sd);
}
- if( HPMHooks.count.HP_skill_cooldown_save_post ) {
+ if (HPMHooks.count.HP_skill_cooldown_save_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_save_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cooldown_save_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_cooldown_save_post[hIndex].func;
postHookFunc(sd);
}
@@ -69397,14 +71695,14 @@ void HP_skill_cooldown_save(struct map_session_data *sd) {
int HP_skill_get_new_group_id(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_get_new_group_id_pre ) {
+ if (HPMHooks.count.HP_skill_get_new_group_id_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_new_group_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_new_group_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_new_group_id_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69412,9 +71710,9 @@ int HP_skill_get_new_group_id(void) {
{
retVal___ = HPMHooks.source.skill.get_new_group_id();
}
- if( HPMHooks.count.HP_skill_get_new_group_id_post ) {
+ if (HPMHooks.count.HP_skill_get_new_group_id_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_new_group_id_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_new_group_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_new_group_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -69424,14 +71722,14 @@ int HP_skill_get_new_group_id(void) {
bool HP_skill_check_shadowform(struct block_list *bl, int64 damage, int hit) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_check_shadowform_pre ) {
- bool (*preHookFunc) (struct block_list *bl, int64 *damage, int *hit);
+ if (HPMHooks.count.HP_skill_check_shadowform_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl, int64 *damage, int *hit);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_shadowform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_shadowform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_shadowform_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &damage, &hit);
+ retVal___ = preHookFunc(&bl, &damage, &hit);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69439,11 +71737,11 @@ bool HP_skill_check_shadowform(struct block_list *bl, int64 damage, int hit) {
{
retVal___ = HPMHooks.source.skill.check_shadowform(bl, damage, hit);
}
- if( HPMHooks.count.HP_skill_check_shadowform_post ) {
- bool (*postHookFunc) (bool retVal___, struct block_list *bl, int64 *damage, int *hit);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_shadowform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_check_shadowform_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct block_list *bl, int64 damage, int hit);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_shadowform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_shadowform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &damage, &hit);
+ retVal___ = postHookFunc(retVal___, bl, damage, hit);
}
}
return retVal___;
@@ -69451,14 +71749,14 @@ bool HP_skill_check_shadowform(struct block_list *bl, int64 damage, int hit) {
bool HP_skill_castend_damage_id_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_damage_id_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc);
+ if (HPMHooks.count.HP_skill_castend_damage_id_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, struct status_data **tstatus, struct status_change **sc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_damage_id_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, skill_id, skill_lv, tick, flag, tstatus, sc);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag, &tstatus, &sc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69466,9 +71764,9 @@ bool HP_skill_castend_damage_id_unknown(struct block_list *src, struct block_lis
{
retVal___ = HPMHooks.source.skill.castend_damage_id_unknown(src, bl, skill_id, skill_lv, tick, flag, tstatus, sc);
}
- if( HPMHooks.count.HP_skill_castend_damage_id_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_damage_id_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_damage_id_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_damage_id_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag, tstatus, sc);
}
@@ -69477,14 +71775,14 @@ bool HP_skill_castend_damage_id_unknown(struct block_list *src, struct block_lis
}
void HP_skill_additional_effect_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_additional_effect_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
+ if (HPMHooks.count.HP_skill_additional_effect_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int **attack_type, int **dmg_lv, int64 **tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_additional_effect_unknown_pre[hIndex].func;
- preHookFunc(src, bl, skill_id, skill_lv, attack_type, dmg_lv, tick);
+ preHookFunc(&src, &bl, &skill_id, &skill_lv, &attack_type, &dmg_lv, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69492,9 +71790,9 @@ void HP_skill_additional_effect_unknown(struct block_list *src, struct block_lis
{
HPMHooks.source.skill.additional_effect_unknown(src, bl, skill_id, skill_lv, attack_type, dmg_lv, tick);
}
- if( HPMHooks.count.HP_skill_additional_effect_unknown_post ) {
+ if (HPMHooks.count.HP_skill_additional_effect_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_additional_effect_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_additional_effect_unknown_post[hIndex].func;
postHookFunc(src, bl, skill_id, skill_lv, attack_type, dmg_lv, tick);
}
@@ -69503,14 +71801,14 @@ void HP_skill_additional_effect_unknown(struct block_list *src, struct block_lis
}
void HP_skill_counter_additional_effect_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_counter_additional_effect_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
+ if (HPMHooks.count.HP_skill_counter_additional_effect_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int **attack_type, int64 **tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_counter_additional_effect_unknown_pre[hIndex].func;
- preHookFunc(src, bl, skill_id, skill_lv, attack_type, tick);
+ preHookFunc(&src, &bl, &skill_id, &skill_lv, &attack_type, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69518,9 +71816,9 @@ void HP_skill_counter_additional_effect_unknown(struct block_list *src, struct b
{
HPMHooks.source.skill.counter_additional_effect_unknown(src, bl, skill_id, skill_lv, attack_type, tick);
}
- if( HPMHooks.count.HP_skill_counter_additional_effect_unknown_post ) {
+ if (HPMHooks.count.HP_skill_counter_additional_effect_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_counter_additional_effect_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_counter_additional_effect_unknown_post[hIndex].func;
postHookFunc(src, bl, skill_id, skill_lv, attack_type, tick);
}
@@ -69529,14 +71827,14 @@ void HP_skill_counter_additional_effect_unknown(struct block_list *src, struct b
}
void HP_skill_attack_combo1_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_attack_combo1_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo);
+ if (HPMHooks.count.HP_skill_attack_combo1_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, struct status_change_entry **sce, int **combo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo1_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo1_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_combo1_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, sce, combo);
+ preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag, &sce, &combo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69544,9 +71842,9 @@ void HP_skill_attack_combo1_unknown(int *attack_type, struct block_list *src, st
{
HPMHooks.source.skill.attack_combo1_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, sce, combo);
}
- if( HPMHooks.count.HP_skill_attack_combo1_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_combo1_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo1_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo1_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_combo1_unknown_post[hIndex].func;
postHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, sce, combo);
}
@@ -69555,14 +71853,14 @@ void HP_skill_attack_combo1_unknown(int *attack_type, struct block_list *src, st
}
void HP_skill_attack_combo2_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_attack_combo2_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo);
+ if (HPMHooks.count.HP_skill_attack_combo2_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, int **combo);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo2_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo2_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_combo2_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, combo);
+ preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag, &combo);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69570,9 +71868,9 @@ void HP_skill_attack_combo2_unknown(int *attack_type, struct block_list *src, st
{
HPMHooks.source.skill.attack_combo2_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, combo);
}
- if( HPMHooks.count.HP_skill_attack_combo2_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_combo2_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo2_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_combo2_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_combo2_unknown_post[hIndex].func;
postHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, combo);
}
@@ -69581,14 +71879,14 @@ void HP_skill_attack_combo2_unknown(int *attack_type, struct block_list *src, st
}
void HP_skill_attack_display_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_attack_display_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage);
+ if (HPMHooks.count.HP_skill_attack_display_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, int **type, struct Damage **dmg, int64 **damage);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_display_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_display_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_display_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, type, dmg, damage);
+ preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag, &type, &dmg, &damage);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69596,9 +71894,9 @@ void HP_skill_attack_display_unknown(int *attack_type, struct block_list *src, s
{
HPMHooks.source.skill.attack_display_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, type, dmg, damage);
}
- if( HPMHooks.count.HP_skill_attack_display_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_display_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_display_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_display_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_display_unknown_post[hIndex].func;
postHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, type, dmg, damage);
}
@@ -69608,14 +71906,14 @@ void HP_skill_attack_display_unknown(int *attack_type, struct block_list *src, s
int HP_skill_attack_copy_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_attack_copy_unknown_pre ) {
- int (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_attack_copy_unknown_pre > 0) {
+ int (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_copy_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_copy_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_copy_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69623,9 +71921,9 @@ int HP_skill_attack_copy_unknown(int *attack_type, struct block_list *src, struc
{
retVal___ = HPMHooks.source.skill.attack_copy_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_attack_copy_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_copy_unknown_post > 0) {
int (*postHookFunc) (int retVal___, int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_copy_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_copy_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_copy_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
@@ -69635,14 +71933,14 @@ int HP_skill_attack_copy_unknown(int *attack_type, struct block_list *src, struc
int HP_skill_attack_dir_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_attack_dir_unknown_pre ) {
- int (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_attack_dir_unknown_pre > 0) {
+ int (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_dir_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_dir_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_dir_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69650,9 +71948,9 @@ int HP_skill_attack_dir_unknown(int *attack_type, struct block_list *src, struct
{
retVal___ = HPMHooks.source.skill.attack_dir_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_attack_dir_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_dir_unknown_post > 0) {
int (*postHookFunc) (int retVal___, int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_dir_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_dir_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_dir_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
@@ -69661,14 +71959,14 @@ int HP_skill_attack_dir_unknown(int *attack_type, struct block_list *src, struct
}
void HP_skill_attack_blow_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_attack_blow_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir);
+ if (HPMHooks.count.HP_skill_attack_blow_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag, int **type, struct Damage **dmg, int64 **damage, int8 **dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_blow_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_blow_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_blow_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, type, dmg, damage, dir);
+ preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag, &type, &dmg, &damage, &dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69676,9 +71974,9 @@ void HP_skill_attack_blow_unknown(int *attack_type, struct block_list *src, stru
{
HPMHooks.source.skill.attack_blow_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, type, dmg, damage, dir);
}
- if( HPMHooks.count.HP_skill_attack_blow_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_blow_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_blow_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_blow_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_blow_unknown_post[hIndex].func;
postHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag, type, dmg, damage, dir);
}
@@ -69687,14 +71985,14 @@ void HP_skill_attack_blow_unknown(int *attack_type, struct block_list *src, stru
}
void HP_skill_attack_post_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_attack_post_unknown_pre ) {
- void (*preHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_attack_post_unknown_pre > 0) {
+ void (*preHookFunc) (int **attack_type, struct block_list **src, struct block_list **dsrc, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_post_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_post_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_attack_post_unknown_pre[hIndex].func;
- preHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
+ preHookFunc(&attack_type, &src, &dsrc, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69702,9 +72000,9 @@ void HP_skill_attack_post_unknown(int *attack_type, struct block_list *src, stru
{
HPMHooks.source.skill.attack_post_unknown(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_attack_post_unknown_post ) {
+ if (HPMHooks.count.HP_skill_attack_post_unknown_post > 0) {
void (*postHookFunc) (int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_post_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_attack_post_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_attack_post_unknown_post[hIndex].func;
postHookFunc(attack_type, src, dsrc, bl, skill_id, skill_lv, tick, flag);
}
@@ -69714,14 +72012,14 @@ void HP_skill_attack_post_unknown(int *attack_type, struct block_list *src, stru
bool HP_skill_timerskill_dead_unknown(struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_timerskill_dead_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
+ if (HPMHooks.count.HP_skill_timerskill_dead_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct unit_data **ud, struct skill_timerskill **skl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_dead_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_dead_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_timerskill_dead_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, ud, skl);
+ retVal___ = preHookFunc(&src, &ud, &skl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69729,9 +72027,9 @@ bool HP_skill_timerskill_dead_unknown(struct block_list *src, struct unit_data *
{
retVal___ = HPMHooks.source.skill.timerskill_dead_unknown(src, ud, skl);
}
- if( HPMHooks.count.HP_skill_timerskill_dead_unknown_post ) {
+ if (HPMHooks.count.HP_skill_timerskill_dead_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_dead_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_dead_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_timerskill_dead_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, ud, skl);
}
@@ -69740,14 +72038,14 @@ bool HP_skill_timerskill_dead_unknown(struct block_list *src, struct unit_data *
}
void HP_skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_timerskill_target_unknown_pre ) {
- void (*preHookFunc) (int *tid, int64 *tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl);
+ if (HPMHooks.count.HP_skill_timerskill_target_unknown_pre > 0) {
+ void (*preHookFunc) (int *tid, int64 *tick, struct block_list **src, struct block_list **target, struct unit_data **ud, struct skill_timerskill **skl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_target_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_target_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_timerskill_target_unknown_pre[hIndex].func;
- preHookFunc(&tid, &tick, src, target, ud, skl);
+ preHookFunc(&tid, &tick, &src, &target, &ud, &skl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69755,25 +72053,25 @@ void HP_skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *
{
HPMHooks.source.skill.timerskill_target_unknown(tid, tick, src, target, ud, skl);
}
- if( HPMHooks.count.HP_skill_timerskill_target_unknown_post ) {
- void (*postHookFunc) (int *tid, int64 *tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_target_unknown_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_timerskill_target_unknown_post > 0) {
+ void (*postHookFunc) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_target_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_timerskill_target_unknown_post[hIndex].func;
- postHookFunc(&tid, &tick, src, target, ud, skl);
+ postHookFunc(tid, tick, src, target, ud, skl);
}
}
return;
}
void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_timerskill_notarget_unknown_pre ) {
- void (*preHookFunc) (int *tid, int64 *tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
+ if (HPMHooks.count.HP_skill_timerskill_notarget_unknown_pre > 0) {
+ void (*preHookFunc) (int *tid, int64 *tick, struct block_list **src, struct unit_data **ud, struct skill_timerskill **skl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_notarget_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_notarget_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_timerskill_notarget_unknown_pre[hIndex].func;
- preHookFunc(&tid, &tick, src, ud, skl);
+ preHookFunc(&tid, &tick, &src, &ud, &skl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69781,11 +72079,11 @@ void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list
{
HPMHooks.source.skill.timerskill_notarget_unknown(tid, tick, src, ud, skl);
}
- if( HPMHooks.count.HP_skill_timerskill_notarget_unknown_post ) {
- void (*postHookFunc) (int *tid, int64 *tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_notarget_unknown_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_timerskill_notarget_unknown_post > 0) {
+ void (*postHookFunc) (int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_timerskill_notarget_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_timerskill_notarget_unknown_post[hIndex].func;
- postHookFunc(&tid, &tick, src, ud, skl);
+ postHookFunc(tid, tick, src, ud, skl);
}
}
return;
@@ -69793,14 +72091,14 @@ void HP_skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list
bool HP_skill_cleartimerskill_exception(int skill_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_cleartimerskill_exception_pre ) {
+ if (HPMHooks.count.HP_skill_cleartimerskill_exception_pre > 0) {
bool (*preHookFunc) (int *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_exception_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_exception_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_cleartimerskill_exception_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69808,11 +72106,11 @@ bool HP_skill_cleartimerskill_exception(int skill_id) {
{
retVal___ = HPMHooks.source.skill.cleartimerskill_exception(skill_id);
}
- if( HPMHooks.count.HP_skill_cleartimerskill_exception_post ) {
- bool (*postHookFunc) (bool retVal___, int *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_exception_post; hIndex++ ) {
+ if (HPMHooks.count.HP_skill_cleartimerskill_exception_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_cleartimerskill_exception_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_cleartimerskill_exception_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -69820,14 +72118,14 @@ bool HP_skill_cleartimerskill_exception(int skill_id) {
bool HP_skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, struct block_list *target) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_id_unknown_pre ) {
- bool (*preHookFunc) (struct unit_data *ud, struct block_list *src, struct block_list *target);
+ if (HPMHooks.count.HP_skill_castend_id_unknown_pre > 0) {
+ bool (*preHookFunc) (struct unit_data **ud, struct block_list **src, struct block_list **target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_id_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(ud, src, target);
+ retVal___ = preHookFunc(&ud, &src, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69835,9 +72133,9 @@ bool HP_skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, s
{
retVal___ = HPMHooks.source.skill.castend_id_unknown(ud, src, target);
}
- if( HPMHooks.count.HP_skill_castend_id_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_id_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct unit_data *ud, struct block_list *src, struct block_list *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_id_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_id_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ud, src, target);
}
@@ -69847,14 +72145,14 @@ bool HP_skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, s
bool HP_skill_castend_nodamage_id_dead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_dead_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69862,9 +72160,9 @@ bool HP_skill_castend_nodamage_id_dead_unknown(struct block_list *src, struct bl
{
retVal___ = HPMHooks.source.skill.castend_nodamage_id_dead_unknown(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_dead_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_dead_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag);
}
@@ -69874,14 +72172,14 @@ bool HP_skill_castend_nodamage_id_dead_unknown(struct block_list *src, struct bl
bool HP_skill_castend_nodamage_id_undead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_undead_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69889,9 +72187,9 @@ bool HP_skill_castend_nodamage_id_undead_unknown(struct block_list *src, struct
{
retVal___ = HPMHooks.source.skill.castend_nodamage_id_undead_unknown(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_undead_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_undead_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag);
}
@@ -69901,14 +72199,14 @@ bool HP_skill_castend_nodamage_id_undead_unknown(struct block_list *src, struct
bool HP_skill_castend_nodamage_id_mado_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_mado_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69916,9 +72214,9 @@ bool HP_skill_castend_nodamage_id_mado_unknown(struct block_list *src, struct bl
{
retVal___ = HPMHooks.source.skill.castend_nodamage_id_mado_unknown(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_mado_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_mado_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag);
}
@@ -69928,14 +72226,14 @@ bool HP_skill_castend_nodamage_id_mado_unknown(struct block_list *src, struct bl
bool HP_skill_castend_nodamage_id_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_nodamage_id_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&src, &bl, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69943,9 +72241,9 @@ bool HP_skill_castend_nodamage_id_unknown(struct block_list *src, struct block_l
{
retVal___ = HPMHooks.source.skill.castend_nodamage_id_unknown(src, bl, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_nodamage_id_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_nodamage_id_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_nodamage_id_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_nodamage_id_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, bl, skill_id, skill_lv, tick, flag);
}
@@ -69954,14 +72252,14 @@ bool HP_skill_castend_nodamage_id_unknown(struct block_list *src, struct block_l
}
void HP_skill_castend_pos2_effect_unknown(struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_castend_pos2_effect_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_pos2_effect_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, int **x, int **y, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_effect_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_effect_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_pos2_effect_unknown_pre[hIndex].func;
- preHookFunc(src, x, y, skill_id, skill_lv, tick, flag);
+ preHookFunc(&src, &x, &y, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -69969,9 +72267,9 @@ void HP_skill_castend_pos2_effect_unknown(struct block_list *src, int *x, int *y
{
HPMHooks.source.skill.castend_pos2_effect_unknown(src, x, y, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_pos2_effect_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_pos2_effect_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_effect_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_effect_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_pos2_effect_unknown_post[hIndex].func;
postHookFunc(src, x, y, skill_id, skill_lv, tick, flag);
}
@@ -69981,14 +72279,14 @@ void HP_skill_castend_pos2_effect_unknown(struct block_list *src, int *x, int *y
bool HP_skill_castend_pos2_unknown(struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_castend_pos2_unknown_pre ) {
- bool (*preHookFunc) (struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
+ if (HPMHooks.count.HP_skill_castend_pos2_unknown_pre > 0) {
+ bool (*preHookFunc) (struct block_list **src, int **x, int **y, uint16 **skill_id, uint16 **skill_lv, int64 **tick, int **flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_castend_pos2_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(src, x, y, skill_id, skill_lv, tick, flag);
+ retVal___ = preHookFunc(&src, &x, &y, &skill_id, &skill_lv, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -69996,9 +72294,9 @@ bool HP_skill_castend_pos2_unknown(struct block_list *src, int *x, int *y, uint1
{
retVal___ = HPMHooks.source.skill.castend_pos2_unknown(src, x, y, skill_id, skill_lv, tick, flag);
}
- if( HPMHooks.count.HP_skill_castend_pos2_unknown_post ) {
+ if (HPMHooks.count.HP_skill_castend_pos2_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_castend_pos2_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_castend_pos2_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, x, y, skill_id, skill_lv, tick, flag);
}
@@ -70007,14 +72305,14 @@ bool HP_skill_castend_pos2_unknown(struct block_list *src, int *x, int *y, uint1
}
void HP_skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_unitsetting1_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3);
+ if (HPMHooks.count.HP_skill_unitsetting1_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, uint16 **skill_id, uint16 **skill_lv, int16 **x, int16 **y, int **flag, int **val1, int **val2, int **val3);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting1_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting1_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unitsetting1_unknown_pre[hIndex].func;
- preHookFunc(src, skill_id, skill_lv, x, y, flag, val1, val2, val3);
+ preHookFunc(&src, &skill_id, &skill_lv, &x, &y, &flag, &val1, &val2, &val3);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70022,9 +72320,9 @@ void HP_skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uin
{
HPMHooks.source.skill.unitsetting1_unknown(src, skill_id, skill_lv, x, y, flag, val1, val2, val3);
}
- if( HPMHooks.count.HP_skill_unitsetting1_unknown_post ) {
+ if (HPMHooks.count.HP_skill_unitsetting1_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting1_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting1_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unitsetting1_unknown_post[hIndex].func;
postHookFunc(src, skill_id, skill_lv, x, y, flag, val1, val2, val3);
}
@@ -70033,14 +72331,14 @@ void HP_skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uin
}
void HP_skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_unitsetting2_unknown_pre ) {
- void (*preHookFunc) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group);
+ if (HPMHooks.count.HP_skill_unitsetting2_unknown_pre > 0) {
+ void (*preHookFunc) (struct block_list **src, uint16 **skill_id, uint16 **skill_lv, int16 **x, int16 **y, int **flag, int **unit_flag, int **val1, int **val2, int **val3, struct skill_unit_group **group);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting2_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting2_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unitsetting2_unknown_pre[hIndex].func;
- preHookFunc(src, skill_id, skill_lv, x, y, flag, unit_flag, val1, val2, val3, group);
+ preHookFunc(&src, &skill_id, &skill_lv, &x, &y, &flag, &unit_flag, &val1, &val2, &val3, &group);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70048,9 +72346,9 @@ void HP_skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uin
{
HPMHooks.source.skill.unitsetting2_unknown(src, skill_id, skill_lv, x, y, flag, unit_flag, val1, val2, val3, group);
}
- if( HPMHooks.count.HP_skill_unitsetting2_unknown_post ) {
+ if (HPMHooks.count.HP_skill_unitsetting2_unknown_post > 0) {
void (*postHookFunc) (struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting2_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unitsetting2_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unitsetting2_unknown_post[hIndex].func;
postHookFunc(src, skill_id, skill_lv, x, y, flag, unit_flag, val1, val2, val3, group);
}
@@ -70059,14 +72357,14 @@ void HP_skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uin
}
void HP_skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_unit_onplace_unknown_pre ) {
- void (*preHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick);
+ if (HPMHooks.count.HP_skill_unit_onplace_unknown_pre > 0) {
+ void (*preHookFunc) (struct skill_unit **src, struct block_list **bl, int64 **tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_unit_onplace_unknown_pre[hIndex].func;
- preHookFunc(src, bl, tick);
+ preHookFunc(&src, &bl, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70074,9 +72372,9 @@ void HP_skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl
{
HPMHooks.source.skill.unit_onplace_unknown(src, bl, tick);
}
- if( HPMHooks.count.HP_skill_unit_onplace_unknown_post ) {
+ if (HPMHooks.count.HP_skill_unit_onplace_unknown_post > 0) {
void (*postHookFunc) (struct skill_unit *src, struct block_list *bl, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_unit_onplace_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_unit_onplace_unknown_post[hIndex].func;
postHookFunc(src, bl, tick);
}
@@ -70086,14 +72384,14 @@ void HP_skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl
int HP_skill_check_condition_castbegin_off_unknown(struct status_change *sc, uint16 *skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_pre ) {
- int (*preHookFunc) (struct status_change *sc, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_pre > 0) {
+ int (*preHookFunc) (struct status_change **sc, uint16 **skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_off_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(sc, skill_id);
+ retVal___ = preHookFunc(&sc, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70101,9 +72399,9 @@ int HP_skill_check_condition_castbegin_off_unknown(struct status_change *sc, uin
{
retVal___ = HPMHooks.source.skill.check_condition_castbegin_off_unknown(sc, skill_id);
}
- if( HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_post > 0) {
int (*postHookFunc) (int retVal___, struct status_change *sc, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_off_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_off_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sc, skill_id);
}
@@ -70113,14 +72411,14 @@ int HP_skill_check_condition_castbegin_off_unknown(struct status_change *sc, uin
int HP_skill_check_condition_castbegin_mount_unknown(struct status_change *sc, uint16 *skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_pre ) {
- int (*preHookFunc) (struct status_change *sc, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_pre > 0) {
+ int (*preHookFunc) (struct status_change **sc, uint16 **skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_mount_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(sc, skill_id);
+ retVal___ = preHookFunc(&sc, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70128,9 +72426,9 @@ int HP_skill_check_condition_castbegin_mount_unknown(struct status_change *sc, u
{
retVal___ = HPMHooks.source.skill.check_condition_castbegin_mount_unknown(sc, skill_id);
}
- if( HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_post > 0) {
int (*postHookFunc) (int retVal___, struct status_change *sc, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_mount_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_mount_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sc, skill_id);
}
@@ -70140,14 +72438,14 @@ int HP_skill_check_condition_castbegin_mount_unknown(struct status_change *sc, u
int HP_skill_check_condition_castbegin_madogear_unknown(struct status_change *sc, uint16 *skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_pre ) {
- int (*preHookFunc) (struct status_change *sc, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_pre > 0) {
+ int (*preHookFunc) (struct status_change **sc, uint16 **skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_madogear_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(sc, skill_id);
+ retVal___ = preHookFunc(&sc, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70155,9 +72453,9 @@ int HP_skill_check_condition_castbegin_madogear_unknown(struct status_change *sc
{
retVal___ = HPMHooks.source.skill.check_condition_castbegin_madogear_unknown(sc, skill_id);
}
- if( HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_post > 0) {
int (*postHookFunc) (int retVal___, struct status_change *sc, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_madogear_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_madogear_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sc, skill_id);
}
@@ -70167,14 +72465,14 @@ int HP_skill_check_condition_castbegin_madogear_unknown(struct status_change *sc
int HP_skill_check_condition_castbegin_unknown(struct status_change *sc, uint16 *skill_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_skill_check_condition_castbegin_unknown_pre ) {
- int (*preHookFunc) (struct status_change *sc, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_unknown_pre > 0) {
+ int (*preHookFunc) (struct status_change **sc, uint16 **skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(sc, skill_id);
+ retVal___ = preHookFunc(&sc, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70182,9 +72480,9 @@ int HP_skill_check_condition_castbegin_unknown(struct status_change *sc, uint16
{
retVal___ = HPMHooks.source.skill.check_condition_castbegin_unknown(sc, skill_id);
}
- if( HPMHooks.count.HP_skill_check_condition_castbegin_unknown_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_castbegin_unknown_post > 0) {
int (*postHookFunc) (int retVal___, struct status_change *sc, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castbegin_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castbegin_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sc, skill_id);
}
@@ -70193,14 +72491,14 @@ int HP_skill_check_condition_castbegin_unknown(struct status_change *sc, uint16
}
void HP_skill_check_condition_castend_unknown(struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_check_condition_castend_unknown_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_skill_check_condition_castend_unknown_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_check_condition_castend_unknown_pre[hIndex].func;
- preHookFunc(sd, skill_id, skill_lv);
+ preHookFunc(&sd, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70208,9 +72506,9 @@ void HP_skill_check_condition_castend_unknown(struct map_session_data *sd, uint1
{
HPMHooks.source.skill.check_condition_castend_unknown(sd, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_skill_check_condition_castend_unknown_post ) {
+ if (HPMHooks.count.HP_skill_check_condition_castend_unknown_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_condition_castend_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_check_condition_castend_unknown_post[hIndex].func;
postHookFunc(sd, skill_id, skill_lv);
}
@@ -70220,14 +72518,14 @@ void HP_skill_check_condition_castend_unknown(struct map_session_data *sd, uint1
bool HP_skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skill_id) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_get_requirement_off_unknown_pre ) {
- bool (*preHookFunc) (struct status_change *sc, uint16 *skill_id);
+ if (HPMHooks.count.HP_skill_get_requirement_off_unknown_pre > 0) {
+ bool (*preHookFunc) (struct status_change **sc, uint16 **skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_off_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_off_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_requirement_off_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(sc, skill_id);
+ retVal___ = preHookFunc(&sc, &skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70235,9 +72533,9 @@ bool HP_skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skil
{
retVal___ = HPMHooks.source.skill.get_requirement_off_unknown(sc, skill_id);
}
- if( HPMHooks.count.HP_skill_get_requirement_off_unknown_post ) {
+ if (HPMHooks.count.HP_skill_get_requirement_off_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct status_change *sc, uint16 *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_off_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_off_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_requirement_off_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sc, skill_id);
}
@@ -70247,14 +72545,14 @@ bool HP_skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skil
bool HP_skill_get_requirement_item_unknown(struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_skill_get_requirement_item_unknown_pre ) {
- bool (*preHookFunc) (struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i);
+ if (HPMHooks.count.HP_skill_get_requirement_item_unknown_pre > 0) {
+ bool (*preHookFunc) (struct status_change **sc, struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv, uint16 **idx, int **i);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_item_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_item_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_requirement_item_unknown_pre[hIndex].func;
- retVal___ = preHookFunc(sc, sd, skill_id, skill_lv, idx, i);
+ retVal___ = preHookFunc(&sc, &sd, &skill_id, &skill_lv, &idx, &i);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70262,9 +72560,9 @@ bool HP_skill_get_requirement_item_unknown(struct status_change *sc, struct map_
{
retVal___ = HPMHooks.source.skill.get_requirement_item_unknown(sc, sd, skill_id, skill_lv, idx, i);
}
- if( HPMHooks.count.HP_skill_get_requirement_item_unknown_post ) {
+ if (HPMHooks.count.HP_skill_get_requirement_item_unknown_post > 0) {
bool (*postHookFunc) (bool retVal___, struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_item_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_item_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_requirement_item_unknown_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sc, sd, skill_id, skill_lv, idx, i);
}
@@ -70273,14 +72571,14 @@ bool HP_skill_get_requirement_item_unknown(struct status_change *sc, struct map_
}
void HP_skill_get_requirement_unknown(struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req) {
int hIndex = 0;
- if( HPMHooks.count.HP_skill_get_requirement_unknown_pre ) {
- void (*preHookFunc) (struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req);
+ if (HPMHooks.count.HP_skill_get_requirement_unknown_pre > 0) {
+ void (*preHookFunc) (struct status_change **sc, struct map_session_data **sd, uint16 **skill_id, uint16 **skill_lv, struct skill_condition **req);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_unknown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_unknown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_skill_get_requirement_unknown_pre[hIndex].func;
- preHookFunc(sc, sd, skill_id, skill_lv, req);
+ preHookFunc(&sc, &sd, &skill_id, &skill_lv, &req);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70288,26 +72586,119 @@ void HP_skill_get_requirement_unknown(struct status_change *sc, struct map_sessi
{
HPMHooks.source.skill.get_requirement_unknown(sc, sd, skill_id, skill_lv, req);
}
- if( HPMHooks.count.HP_skill_get_requirement_unknown_post ) {
+ if (HPMHooks.count.HP_skill_get_requirement_unknown_post > 0) {
void (*postHookFunc) (struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_unknown_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_get_requirement_unknown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_skill_get_requirement_unknown_post[hIndex].func;
postHookFunc(sc, sd, skill_id, skill_lv, req);
}
}
return;
}
-/* sockt */
+int HP_skill_splash_target(struct block_list *bl) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_splash_target_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_splash_target_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_skill_splash_target_pre[hIndex].func;
+ retVal___ = preHookFunc(&bl);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.skill.splash_target(bl);
+ }
+ if (HPMHooks.count.HP_skill_splash_target_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_splash_target_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_skill_splash_target_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, bl);
+ }
+ }
+ return retVal___;
+}
+int HP_skill_check_npc_chaospanic(struct block_list *bl, va_list args) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_check_npc_chaospanic_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list args);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_npc_chaospanic_pre; hIndex++) {
+ va_list args___copy; va_copy(args___copy, args);
+ preHookFunc = HPMHooks.list.HP_skill_check_npc_chaospanic_pre[hIndex].func;
+ retVal___ = preHookFunc(&bl, args___copy);
+ va_end(args___copy);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ va_list args___copy; va_copy(args___copy, args);
+ retVal___ = HPMHooks.source.skill.check_npc_chaospanic(bl, args___copy);
+ va_end(args___copy);
+ }
+ if (HPMHooks.count.HP_skill_check_npc_chaospanic_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_npc_chaospanic_post; hIndex++) {
+ va_list args___copy; va_copy(args___copy, args);
+ postHookFunc = HPMHooks.list.HP_skill_check_npc_chaospanic_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, bl, args___copy);
+ va_end(args___copy);
+ }
+ }
+ return retVal___;
+}
+int HP_skill_count_wos(struct block_list *bl, va_list ap) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_skill_count_wos_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_count_wos_pre; hIndex++) {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ preHookFunc = HPMHooks.list.HP_skill_count_wos_pre[hIndex].func;
+ retVal___ = preHookFunc(&bl, ap___copy);
+ va_end(ap___copy);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ retVal___ = HPMHooks.source.skill.count_wos(bl, ap___copy);
+ va_end(ap___copy);
+ }
+ if (HPMHooks.count.HP_skill_count_wos_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_skill_count_wos_post; hIndex++) {
+ va_list ap___copy; va_copy(ap___copy, ap);
+ postHookFunc = HPMHooks.list.HP_skill_count_wos_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, bl, ap___copy);
+ va_end(ap___copy);
+ }
+ }
+ return retVal___;
+}
+/* socket_interface */
void HP_sockt_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_init_pre ) {
+ if (HPMHooks.count.HP_sockt_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70315,9 +72706,9 @@ void HP_sockt_init(void) {
{
HPMHooks.source.sockt.init();
}
- if( HPMHooks.count.HP_sockt_init_post ) {
+ if (HPMHooks.count.HP_sockt_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_init_post[hIndex].func;
postHookFunc();
}
@@ -70326,14 +72717,14 @@ void HP_sockt_init(void) {
}
void HP_sockt_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_final_pre ) {
+ if (HPMHooks.count.HP_sockt_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70341,9 +72732,9 @@ void HP_sockt_final(void) {
{
HPMHooks.source.sockt.final();
}
- if( HPMHooks.count.HP_sockt_final_post ) {
+ if (HPMHooks.count.HP_sockt_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_final_post[hIndex].func;
postHookFunc();
}
@@ -70353,14 +72744,14 @@ void HP_sockt_final(void) {
int HP_sockt_perform(int next) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_perform_pre ) {
+ if (HPMHooks.count.HP_sockt_perform_pre > 0) {
int (*preHookFunc) (int *next);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_perform_pre[hIndex].func;
retVal___ = preHookFunc(&next);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70368,25 +72759,25 @@ int HP_sockt_perform(int next) {
{
retVal___ = HPMHooks.source.sockt.perform(next);
}
- if( HPMHooks.count.HP_sockt_perform_post ) {
- int (*postHookFunc) (int retVal___, int *next);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_perform_post > 0) {
+ int (*postHookFunc) (int retVal___, int next);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_perform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_perform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &next);
+ retVal___ = postHookFunc(retVal___, next);
}
}
return retVal___;
}
void HP_sockt_datasync(int fd, bool send) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_datasync_pre ) {
+ if (HPMHooks.count.HP_sockt_datasync_pre > 0) {
void (*preHookFunc) (int *fd, bool *send);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_datasync_pre[hIndex].func;
preHookFunc(&fd, &send);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70394,11 +72785,11 @@ void HP_sockt_datasync(int fd, bool send) {
{
HPMHooks.source.sockt.datasync(fd, send);
}
- if( HPMHooks.count.HP_sockt_datasync_post ) {
- void (*postHookFunc) (int *fd, bool *send);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_datasync_post > 0) {
+ void (*postHookFunc) (int fd, bool send);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_datasync_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_datasync_post[hIndex].func;
- postHookFunc(&fd, &send);
+ postHookFunc(fd, send);
}
}
return;
@@ -70406,14 +72797,14 @@ void HP_sockt_datasync(int fd, bool send) {
int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_make_listen_bind_pre ) {
+ if (HPMHooks.count.HP_sockt_make_listen_bind_pre > 0) {
int (*preHookFunc) (uint32 *ip, uint16 *port);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_make_listen_bind_pre[hIndex].func;
retVal___ = preHookFunc(&ip, &port);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70421,11 +72812,11 @@ int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
{
retVal___ = HPMHooks.source.sockt.make_listen_bind(ip, port);
}
- if( HPMHooks.count.HP_sockt_make_listen_bind_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ip, uint16 *port);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_make_listen_bind_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 ip, uint16 port);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_listen_bind_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_make_listen_bind_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, &port);
+ retVal___ = postHookFunc(retVal___, ip, port);
}
}
return retVal___;
@@ -70433,14 +72824,14 @@ int HP_sockt_make_listen_bind(uint32 ip, uint16 port) {
int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_make_connection_pre ) {
- int (*preHookFunc) (uint32 *ip, uint16 *port, struct hSockOpt *opt);
+ if (HPMHooks.count.HP_sockt_make_connection_pre > 0) {
+ int (*preHookFunc) (uint32 *ip, uint16 *port, struct hSockOpt **opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_make_connection_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, &port, opt);
+ retVal___ = preHookFunc(&ip, &port, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70448,11 +72839,11 @@ int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
{
retVal___ = HPMHooks.source.sockt.make_connection(ip, port, opt);
}
- if( HPMHooks.count.HP_sockt_make_connection_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ip, uint16 *port, struct hSockOpt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_make_connection_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 ip, uint16 port, struct hSockOpt *opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_make_connection_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_make_connection_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, &port, opt);
+ retVal___ = postHookFunc(retVal___, ip, port, opt);
}
}
return retVal___;
@@ -70460,14 +72851,14 @@ int HP_sockt_make_connection(uint32 ip, uint16 port, struct hSockOpt *opt) {
int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_realloc_fifo_pre ) {
+ if (HPMHooks.count.HP_sockt_realloc_fifo_pre > 0) {
int (*preHookFunc) (int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_realloc_fifo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &rfifo_size, &wfifo_size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70475,11 +72866,11 @@ int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_si
{
retVal___ = HPMHooks.source.sockt.realloc_fifo(fd, rfifo_size, wfifo_size);
}
- if( HPMHooks.count.HP_sockt_realloc_fifo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, unsigned int *rfifo_size, unsigned int *wfifo_size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_realloc_fifo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, unsigned int rfifo_size, unsigned int wfifo_size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_fifo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_realloc_fifo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &rfifo_size, &wfifo_size);
+ retVal___ = postHookFunc(retVal___, fd, rfifo_size, wfifo_size);
}
}
return retVal___;
@@ -70487,14 +72878,14 @@ int HP_sockt_realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_si
int HP_sockt_realloc_writefifo(int fd, size_t addition) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_realloc_writefifo_pre ) {
+ if (HPMHooks.count.HP_sockt_realloc_writefifo_pre > 0) {
int (*preHookFunc) (int *fd, size_t *addition);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_realloc_writefifo_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &addition);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70502,11 +72893,11 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
{
retVal___ = HPMHooks.source.sockt.realloc_writefifo(fd, addition);
}
- if( HPMHooks.count.HP_sockt_realloc_writefifo_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *addition);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_realloc_writefifo_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t addition);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_realloc_writefifo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_realloc_writefifo_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &addition);
+ retVal___ = postHookFunc(retVal___, fd, addition);
}
}
return retVal___;
@@ -70514,14 +72905,14 @@ int HP_sockt_realloc_writefifo(int fd, size_t addition) {
int HP_sockt_wfifoset(int fd, size_t len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_wfifoset_pre ) {
+ if (HPMHooks.count.HP_sockt_wfifoset_pre > 0) {
int (*preHookFunc) (int *fd, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_wfifoset_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70529,11 +72920,11 @@ int HP_sockt_wfifoset(int fd, size_t len) {
{
retVal___ = HPMHooks.source.sockt.wfifoset(fd, len);
}
- if( HPMHooks.count.HP_sockt_wfifoset_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_wfifoset_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_wfifoset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_wfifoset_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len);
+ retVal___ = postHookFunc(retVal___, fd, len);
}
}
return retVal___;
@@ -70541,14 +72932,14 @@ int HP_sockt_wfifoset(int fd, size_t len) {
int HP_sockt_rfifoskip(int fd, size_t len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_rfifoskip_pre ) {
+ if (HPMHooks.count.HP_sockt_rfifoskip_pre > 0) {
int (*preHookFunc) (int *fd, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_rfifoskip_pre[hIndex].func;
retVal___ = preHookFunc(&fd, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70556,25 +72947,25 @@ int HP_sockt_rfifoskip(int fd, size_t len) {
{
retVal___ = HPMHooks.source.sockt.rfifoskip(fd, len);
}
- if( HPMHooks.count.HP_sockt_rfifoskip_post ) {
- int (*postHookFunc) (int retVal___, int *fd, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_rfifoskip_post > 0) {
+ int (*postHookFunc) (int retVal___, int fd, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_rfifoskip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_rfifoskip_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd, &len);
+ retVal___ = postHookFunc(retVal___, fd, len);
}
}
return retVal___;
}
void HP_sockt_close(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_close_pre ) {
+ if (HPMHooks.count.HP_sockt_close_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_close_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70582,11 +72973,11 @@ void HP_sockt_close(int fd) {
{
HPMHooks.source.sockt.close(fd);
}
- if( HPMHooks.count.HP_sockt_close_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_close_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_close_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -70594,14 +72985,14 @@ void HP_sockt_close(int fd) {
bool HP_sockt_session_is_valid(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_session_is_valid_pre ) {
+ if (HPMHooks.count.HP_sockt_session_is_valid_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_session_is_valid_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70609,11 +73000,11 @@ bool HP_sockt_session_is_valid(int fd) {
{
retVal___ = HPMHooks.source.sockt.session_is_valid(fd);
}
- if( HPMHooks.count.HP_sockt_session_is_valid_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_session_is_valid_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_valid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_session_is_valid_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
@@ -70621,14 +73012,14 @@ bool HP_sockt_session_is_valid(int fd) {
bool HP_sockt_session_is_active(int fd) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_session_is_active_pre ) {
+ if (HPMHooks.count.HP_sockt_session_is_active_pre > 0) {
bool (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_session_is_active_pre[hIndex].func;
retVal___ = preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70636,25 +73027,25 @@ bool HP_sockt_session_is_active(int fd) {
{
retVal___ = HPMHooks.source.sockt.session_is_active(fd);
}
- if( HPMHooks.count.HP_sockt_session_is_active_post ) {
- bool (*postHookFunc) (bool retVal___, int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_session_is_active_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_session_is_active_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_session_is_active_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &fd);
+ retVal___ = postHookFunc(retVal___, fd);
}
}
return retVal___;
}
void HP_sockt_flush(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_flush_pre ) {
+ if (HPMHooks.count.HP_sockt_flush_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_flush_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70662,25 +73053,25 @@ void HP_sockt_flush(int fd) {
{
HPMHooks.source.sockt.flush(fd);
}
- if( HPMHooks.count.HP_sockt_flush_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_flush_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_flush_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
}
void HP_sockt_flush_fifos(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_flush_fifos_pre ) {
+ if (HPMHooks.count.HP_sockt_flush_fifos_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_flush_fifos_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70688,9 +73079,9 @@ void HP_sockt_flush_fifos(void) {
{
HPMHooks.source.sockt.flush_fifos();
}
- if( HPMHooks.count.HP_sockt_flush_fifos_post ) {
+ if (HPMHooks.count.HP_sockt_flush_fifos_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_flush_fifos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_flush_fifos_post[hIndex].func;
postHookFunc();
}
@@ -70699,14 +73090,14 @@ void HP_sockt_flush_fifos(void) {
}
void HP_sockt_set_nonblocking(int fd, unsigned long yes) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_set_nonblocking_pre ) {
+ if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) {
void (*preHookFunc) (int *fd, unsigned long *yes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_set_nonblocking_pre[hIndex].func;
preHookFunc(&fd, &yes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70714,25 +73105,25 @@ void HP_sockt_set_nonblocking(int fd, unsigned long yes) {
{
HPMHooks.source.sockt.set_nonblocking(fd, yes);
}
- if( HPMHooks.count.HP_sockt_set_nonblocking_post ) {
- void (*postHookFunc) (int *fd, unsigned long *yes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_set_nonblocking_post > 0) {
+ void (*postHookFunc) (int fd, unsigned long yes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_nonblocking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_set_nonblocking_post[hIndex].func;
- postHookFunc(&fd, &yes);
+ postHookFunc(fd, yes);
}
}
return;
}
void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_set_defaultparse_pre ) {
+ if (HPMHooks.count.HP_sockt_set_defaultparse_pre > 0) {
void (*preHookFunc) (ParseFunc *defaultparse);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_set_defaultparse_pre[hIndex].func;
preHookFunc(&defaultparse);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70740,11 +73131,11 @@ void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
{
HPMHooks.source.sockt.set_defaultparse(defaultparse);
}
- if( HPMHooks.count.HP_sockt_set_defaultparse_post ) {
- void (*postHookFunc) (ParseFunc *defaultparse);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_set_defaultparse_post > 0) {
+ void (*postHookFunc) (ParseFunc defaultparse);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_set_defaultparse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_set_defaultparse_post[hIndex].func;
- postHookFunc(&defaultparse);
+ postHookFunc(defaultparse);
}
}
return;
@@ -70752,14 +73143,14 @@ void HP_sockt_set_defaultparse(ParseFunc defaultparse) {
uint32 HP_sockt_host2ip(const char *hostname) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_host2ip_pre ) {
- uint32 (*preHookFunc) (const char *hostname);
+ if (HPMHooks.count.HP_sockt_host2ip_pre > 0) {
+ uint32 (*preHookFunc) (const char **hostname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_host2ip_pre[hIndex].func;
- retVal___ = preHookFunc(hostname);
+ retVal___ = preHookFunc(&hostname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70767,9 +73158,9 @@ uint32 HP_sockt_host2ip(const char *hostname) {
{
retVal___ = HPMHooks.source.sockt.host2ip(hostname);
}
- if( HPMHooks.count.HP_sockt_host2ip_post ) {
+ if (HPMHooks.count.HP_sockt_host2ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___, const char *hostname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_host2ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_host2ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, hostname);
}
@@ -70779,14 +73170,14 @@ uint32 HP_sockt_host2ip(const char *hostname) {
const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sockt_ip2str_pre ) {
- const char* (*preHookFunc) (uint32 *ip, char *ip_str);
+ if (HPMHooks.count.HP_sockt_ip2str_pre > 0) {
+ const char* (*preHookFunc) (uint32 *ip, char **ip_str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_ip2str_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, ip_str);
+ retVal___ = preHookFunc(&ip, &ip_str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70794,11 +73185,11 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
{
retVal___ = HPMHooks.source.sockt.ip2str(ip, ip_str);
}
- if( HPMHooks.count.HP_sockt_ip2str_post ) {
- const char* (*postHookFunc) (const char* retVal___, uint32 *ip, char *ip_str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_ip2str_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, uint32 ip, char *ip_str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ip2str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_ip2str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, ip_str);
+ retVal___ = postHookFunc(retVal___, ip, ip_str);
}
}
return retVal___;
@@ -70806,14 +73197,14 @@ const char* HP_sockt_ip2str(uint32 ip, char *ip_str) {
uint32 HP_sockt_str2ip(const char *ip_str) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_str2ip_pre ) {
- uint32 (*preHookFunc) (const char *ip_str);
+ if (HPMHooks.count.HP_sockt_str2ip_pre > 0) {
+ uint32 (*preHookFunc) (const char **ip_str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_str2ip_pre[hIndex].func;
- retVal___ = preHookFunc(ip_str);
+ retVal___ = preHookFunc(&ip_str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70821,9 +73212,9 @@ uint32 HP_sockt_str2ip(const char *ip_str) {
{
retVal___ = HPMHooks.source.sockt.str2ip(ip_str);
}
- if( HPMHooks.count.HP_sockt_str2ip_post ) {
+ if (HPMHooks.count.HP_sockt_str2ip_post > 0) {
uint32 (*postHookFunc) (uint32 retVal___, const char *ip_str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_str2ip_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_str2ip_post[hIndex].func;
retVal___ = postHookFunc(retVal___, ip_str);
}
@@ -70833,14 +73224,14 @@ uint32 HP_sockt_str2ip(const char *ip_str) {
uint16 HP_sockt_ntows(uint16 netshort) {
int hIndex = 0;
uint16 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_ntows_pre ) {
+ if (HPMHooks.count.HP_sockt_ntows_pre > 0) {
uint16 (*preHookFunc) (uint16 *netshort);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_ntows_pre[hIndex].func;
retVal___ = preHookFunc(&netshort);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70848,11 +73239,11 @@ uint16 HP_sockt_ntows(uint16 netshort) {
{
retVal___ = HPMHooks.source.sockt.ntows(netshort);
}
- if( HPMHooks.count.HP_sockt_ntows_post ) {
- uint16 (*postHookFunc) (uint16 retVal___, uint16 *netshort);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_ntows_post > 0) {
+ uint16 (*postHookFunc) (uint16 retVal___, uint16 netshort);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_ntows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_ntows_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &netshort);
+ retVal___ = postHookFunc(retVal___, netshort);
}
}
return retVal___;
@@ -70860,14 +73251,14 @@ uint16 HP_sockt_ntows(uint16 netshort) {
int HP_sockt_getips(uint32 *ips, int max) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_getips_pre ) {
- int (*preHookFunc) (uint32 *ips, int *max);
+ if (HPMHooks.count.HP_sockt_getips_pre > 0) {
+ int (*preHookFunc) (uint32 **ips, int *max);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_getips_pre[hIndex].func;
- retVal___ = preHookFunc(ips, &max);
+ retVal___ = preHookFunc(&ips, &max);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70875,25 +73266,25 @@ int HP_sockt_getips(uint32 *ips, int max) {
{
retVal___ = HPMHooks.source.sockt.getips(ips, max);
}
- if( HPMHooks.count.HP_sockt_getips_post ) {
- int (*postHookFunc) (int retVal___, uint32 *ips, int *max);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_getips_post > 0) {
+ int (*postHookFunc) (int retVal___, uint32 *ips, int max);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_getips_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_getips_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ips, &max);
+ retVal___ = postHookFunc(retVal___, ips, max);
}
}
return retVal___;
}
void HP_sockt_eof(int fd) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_eof_pre ) {
+ if (HPMHooks.count.HP_sockt_eof_pre > 0) {
void (*preHookFunc) (int *fd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_eof_pre[hIndex].func;
preHookFunc(&fd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -70901,11 +73292,11 @@ void HP_sockt_eof(int fd) {
{
HPMHooks.source.sockt.eof(fd);
}
- if( HPMHooks.count.HP_sockt_eof_post ) {
- void (*postHookFunc) (int *fd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_eof_post > 0) {
+ void (*postHookFunc) (int fd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_eof_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_eof_post[hIndex].func;
- postHookFunc(&fd);
+ postHookFunc(fd);
}
}
return;
@@ -70913,14 +73304,14 @@ void HP_sockt_eof(int fd) {
uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_sockt_lan_subnet_check_pre ) {
- uint32 (*preHookFunc) (uint32 *ip, struct s_subnet *info);
+ if (HPMHooks.count.HP_sockt_lan_subnet_check_pre > 0) {
+ uint32 (*preHookFunc) (uint32 *ip, struct s_subnet **info);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_lan_subnet_check_pre[hIndex].func;
- retVal___ = preHookFunc(&ip, info);
+ retVal___ = preHookFunc(&ip, &info);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70928,11 +73319,11 @@ uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
{
retVal___ = HPMHooks.source.sockt.lan_subnet_check(ip, info);
}
- if( HPMHooks.count.HP_sockt_lan_subnet_check_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, uint32 *ip, struct s_subnet *info);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_lan_subnet_check_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, uint32 ip, struct s_subnet *info);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_lan_subnet_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_lan_subnet_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip, info);
+ retVal___ = postHookFunc(retVal___, ip, info);
}
}
return retVal___;
@@ -70940,14 +73331,14 @@ uint32 HP_sockt_lan_subnet_check(uint32 ip, struct s_subnet *info) {
bool HP_sockt_allowed_ip_check(uint32 ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_allowed_ip_check_pre ) {
+ if (HPMHooks.count.HP_sockt_allowed_ip_check_pre > 0) {
bool (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_allowed_ip_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70955,11 +73346,11 @@ bool HP_sockt_allowed_ip_check(uint32 ip) {
{
retVal___ = HPMHooks.source.sockt.allowed_ip_check(ip);
}
- if( HPMHooks.count.HP_sockt_allowed_ip_check_post ) {
- bool (*postHookFunc) (bool retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_allowed_ip_check_post > 0) {
+ bool (*postHookFunc) (bool retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_allowed_ip_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_allowed_ip_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
@@ -70967,14 +73358,14 @@ bool HP_sockt_allowed_ip_check(uint32 ip) {
bool HP_sockt_trusted_ip_check(uint32 ip) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sockt_trusted_ip_check_pre ) {
+ if (HPMHooks.count.HP_sockt_trusted_ip_check_pre > 0) {
bool (*preHookFunc) (uint32 *ip);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_trusted_ip_check_pre[hIndex].func;
retVal___ = preHookFunc(&ip);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -70982,26 +73373,26 @@ bool HP_sockt_trusted_ip_check(uint32 ip) {
{
retVal___ = HPMHooks.source.sockt.trusted_ip_check(ip);
}
- if( HPMHooks.count.HP_sockt_trusted_ip_check_post ) {
- bool (*postHookFunc) (bool retVal___, uint32 *ip);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_trusted_ip_check_post > 0) {
+ bool (*postHookFunc) (bool retVal___, uint32 ip);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_trusted_ip_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_trusted_ip_check_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &ip);
+ retVal___ = postHookFunc(retVal___, ip);
}
}
return retVal___;
}
-int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname) {
+int HP_sockt_net_config_read_sub(struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sockt_net_config_read_sub_pre ) {
- int (*preHookFunc) (config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ if (HPMHooks.count.HP_sockt_net_config_read_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **t, struct s_subnet_vector **list, const char **filename, const char **groupname);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_net_config_read_sub_pre[hIndex].func;
- retVal___ = preHookFunc(t, list, filename, groupname);
+ retVal___ = preHookFunc(&t, &list, &filename, &groupname);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71009,9 +73400,9 @@ int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *li
{
retVal___ = HPMHooks.source.sockt.net_config_read_sub(t, list, filename, groupname);
}
- if( HPMHooks.count.HP_sockt_net_config_read_sub_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sockt_net_config_read_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *t, struct s_subnet_vector *list, const char *filename, const char *groupname);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_net_config_read_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, t, list, filename, groupname);
}
@@ -71020,14 +73411,14 @@ int HP_sockt_net_config_read_sub(config_setting_t *t, struct s_subnet_vector *li
}
void HP_sockt_net_config_read(const char *filename) {
int hIndex = 0;
- if( HPMHooks.count.HP_sockt_net_config_read_pre ) {
- void (*preHookFunc) (const char *filename);
+ if (HPMHooks.count.HP_sockt_net_config_read_pre > 0) {
+ void (*preHookFunc) (const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sockt_net_config_read_pre[hIndex].func;
- preHookFunc(filename);
+ preHookFunc(&filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71035,27 +73426,27 @@ void HP_sockt_net_config_read(const char *filename) {
{
HPMHooks.source.sockt.net_config_read(filename);
}
- if( HPMHooks.count.HP_sockt_net_config_read_post ) {
+ if (HPMHooks.count.HP_sockt_net_config_read_post > 0) {
void (*postHookFunc) (const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_net_config_read_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sockt_net_config_read_post[hIndex].func;
postHookFunc(filename);
}
}
return;
}
-/* SQL */
-int HP_SQL_Connect(Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db) {
+/* sql_interface */
+int HP_SQL_Connect(struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_Connect_pre ) {
- int (*preHookFunc) (Sql *self, const char *user, const char *passwd, const char *host, uint16 *port, const char *db);
+ if (HPMHooks.count.HP_SQL_Connect_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **user, const char **passwd, const char **host, uint16 *port, const char **db);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Connect_pre[hIndex].func;
- retVal___ = preHookFunc(self, user, passwd, host, &port, db);
+ retVal___ = preHookFunc(&self, &user, &passwd, &host, &port, &db);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71063,26 +73454,26 @@ int HP_SQL_Connect(Sql *self, const char *user, const char *passwd, const char *
{
retVal___ = HPMHooks.source.SQL.Connect(self, user, passwd, host, port, db);
}
- if( HPMHooks.count.HP_SQL_Connect_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *user, const char *passwd, const char *host, uint16 *port, const char *db);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Connect_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *user, const char *passwd, const char *host, uint16 port, const char *db);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Connect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Connect_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, user, passwd, host, &port, db);
+ retVal___ = postHookFunc(retVal___, self, user, passwd, host, port, db);
}
}
return retVal___;
}
-int HP_SQL_GetTimeout(Sql *self, uint32 *out_timeout) {
+int HP_SQL_GetTimeout(struct Sql *self, uint32 *out_timeout) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetTimeout_pre ) {
- int (*preHookFunc) (Sql *self, uint32 *out_timeout);
+ if (HPMHooks.count.HP_SQL_GetTimeout_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, uint32 **out_timeout);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetTimeout_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_timeout);
+ retVal___ = preHookFunc(&self, &out_timeout);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71090,26 +73481,26 @@ int HP_SQL_GetTimeout(Sql *self, uint32 *out_timeout) {
{
retVal___ = HPMHooks.source.SQL.GetTimeout(self, out_timeout);
}
- if( HPMHooks.count.HP_SQL_GetTimeout_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, uint32 *out_timeout);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetTimeout_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, uint32 *out_timeout);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetTimeout_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetTimeout_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, out_timeout);
}
}
return retVal___;
}
-int HP_SQL_GetColumnNames(Sql *self, const char *table, char *out_buf, size_t buf_len, char sep) {
+int HP_SQL_GetColumnNames(struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetColumnNames_pre ) {
- int (*preHookFunc) (Sql *self, const char *table, char *out_buf, size_t *buf_len, char *sep);
+ if (HPMHooks.count.HP_SQL_GetColumnNames_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **table, char **out_buf, size_t *buf_len, char *sep);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetColumnNames_pre[hIndex].func;
- retVal___ = preHookFunc(self, table, out_buf, &buf_len, &sep);
+ retVal___ = preHookFunc(&self, &table, &out_buf, &buf_len, &sep);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71117,26 +73508,26 @@ int HP_SQL_GetColumnNames(Sql *self, const char *table, char *out_buf, size_t bu
{
retVal___ = HPMHooks.source.SQL.GetColumnNames(self, table, out_buf, buf_len, sep);
}
- if( HPMHooks.count.HP_SQL_GetColumnNames_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *table, char *out_buf, size_t *buf_len, char *sep);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetColumnNames_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *table, char *out_buf, size_t buf_len, char sep);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetColumnNames_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetColumnNames_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, table, out_buf, &buf_len, &sep);
+ retVal___ = postHookFunc(retVal___, self, table, out_buf, buf_len, sep);
}
}
return retVal___;
}
-int HP_SQL_SetEncoding(Sql *self, const char *encoding) {
+int HP_SQL_SetEncoding(struct Sql *self, const char *encoding) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_SetEncoding_pre ) {
- int (*preHookFunc) (Sql *self, const char *encoding);
+ if (HPMHooks.count.HP_SQL_SetEncoding_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **encoding);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_SetEncoding_pre[hIndex].func;
- retVal___ = preHookFunc(self, encoding);
+ retVal___ = preHookFunc(&self, &encoding);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71144,26 +73535,26 @@ int HP_SQL_SetEncoding(Sql *self, const char *encoding) {
{
retVal___ = HPMHooks.source.SQL.SetEncoding(self, encoding);
}
- if( HPMHooks.count.HP_SQL_SetEncoding_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *encoding);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_SetEncoding_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *encoding);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_SetEncoding_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_SetEncoding_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, encoding);
}
}
return retVal___;
}
-int HP_SQL_Ping(Sql *self) {
+int HP_SQL_Ping(struct Sql *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_Ping_pre ) {
- int (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_Ping_pre > 0) {
+ int (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Ping_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71171,26 +73562,26 @@ int HP_SQL_Ping(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.Ping(self);
}
- if( HPMHooks.count.HP_SQL_Ping_post ) {
- int (*postHookFunc) (int retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Ping_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Ping_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Ping_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-size_t HP_SQL_EscapeString(Sql *self, char *out_to, const char *from) {
+size_t HP_SQL_EscapeString(struct Sql *self, char *out_to, const char *from) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_EscapeString_pre ) {
- size_t (*preHookFunc) (Sql *self, char *out_to, const char *from);
+ if (HPMHooks.count.HP_SQL_EscapeString_pre > 0) {
+ size_t (*preHookFunc) (struct Sql **self, char **out_to, const char **from);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_EscapeString_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_to, from);
+ retVal___ = preHookFunc(&self, &out_to, &from);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71198,26 +73589,26 @@ size_t HP_SQL_EscapeString(Sql *self, char *out_to, const char *from) {
{
retVal___ = HPMHooks.source.SQL.EscapeString(self, out_to, from);
}
- if( HPMHooks.count.HP_SQL_EscapeString_post ) {
- size_t (*postHookFunc) (size_t retVal___, Sql *self, char *out_to, const char *from);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_EscapeString_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct Sql *self, char *out_to, const char *from);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeString_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_EscapeString_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, out_to, from);
}
}
return retVal___;
}
-size_t HP_SQL_EscapeStringLen(Sql *self, char *out_to, const char *from, size_t from_len) {
+size_t HP_SQL_EscapeStringLen(struct Sql *self, char *out_to, const char *from, size_t from_len) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_EscapeStringLen_pre ) {
- size_t (*preHookFunc) (Sql *self, char *out_to, const char *from, size_t *from_len);
+ if (HPMHooks.count.HP_SQL_EscapeStringLen_pre > 0) {
+ size_t (*preHookFunc) (struct Sql **self, char **out_to, const char **from, size_t *from_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_EscapeStringLen_pre[hIndex].func;
- retVal___ = preHookFunc(self, out_to, from, &from_len);
+ retVal___ = preHookFunc(&self, &out_to, &from, &from_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71225,28 +73616,28 @@ size_t HP_SQL_EscapeStringLen(Sql *self, char *out_to, const char *from, size_t
{
retVal___ = HPMHooks.source.SQL.EscapeStringLen(self, out_to, from, from_len);
}
- if( HPMHooks.count.HP_SQL_EscapeStringLen_post ) {
- size_t (*postHookFunc) (size_t retVal___, Sql *self, char *out_to, const char *from, size_t *from_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_EscapeStringLen_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct Sql *self, char *out_to, const char *from, size_t from_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_EscapeStringLen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_EscapeStringLen_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, out_to, from, &from_len);
+ retVal___ = postHookFunc(retVal___, self, out_to, from, from_len);
}
}
return retVal___;
}
-int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
+int HP_SQL_QueryV(struct Sql *self, const char *query, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_QueryV_pre ) {
- int (*preHookFunc) (Sql *self, const char *query, va_list args);
+ if (HPMHooks.count.HP_SQL_QueryV_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **query, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_SQL_QueryV_pre[hIndex].func;
- retVal___ = preHookFunc(self, query, args___copy);
+ retVal___ = preHookFunc(&self, &query, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71256,9 +73647,9 @@ int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
retVal___ = HPMHooks.source.SQL.QueryV(self, query, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_SQL_QueryV_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *query, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_QueryV_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *query, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryV_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_SQL_QueryV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query, args___copy);
@@ -71267,17 +73658,17 @@ int HP_SQL_QueryV(Sql *self, const char *query, va_list args) {
}
return retVal___;
}
-int HP_SQL_QueryStr(Sql *self, const char *query) {
+int HP_SQL_QueryStr(struct Sql *self, const char *query) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_QueryStr_pre ) {
- int (*preHookFunc) (Sql *self, const char *query);
+ if (HPMHooks.count.HP_SQL_QueryStr_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, const char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_QueryStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, query);
+ retVal___ = preHookFunc(&self, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71285,26 +73676,26 @@ int HP_SQL_QueryStr(Sql *self, const char *query) {
{
retVal___ = HPMHooks.source.SQL.QueryStr(self, query);
}
- if( HPMHooks.count.HP_SQL_QueryStr_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, const char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_QueryStr_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, const char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_QueryStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_QueryStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query);
}
}
return retVal___;
}
-uint64 HP_SQL_LastInsertId(Sql *self) {
+uint64 HP_SQL_LastInsertId(struct Sql *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_LastInsertId_pre ) {
- uint64 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_LastInsertId_pre > 0) {
+ uint64 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_LastInsertId_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71312,26 +73703,26 @@ uint64 HP_SQL_LastInsertId(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.LastInsertId(self);
}
- if( HPMHooks.count.HP_SQL_LastInsertId_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_LastInsertId_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_LastInsertId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_LastInsertId_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint32 HP_SQL_NumColumns(Sql *self) {
+uint32 HP_SQL_NumColumns(struct Sql *self) {
int hIndex = 0;
uint32 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NumColumns_pre ) {
- uint32 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NumColumns_pre > 0) {
+ uint32 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NumColumns_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71339,26 +73730,26 @@ uint32 HP_SQL_NumColumns(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NumColumns(self);
}
- if( HPMHooks.count.HP_SQL_NumColumns_post ) {
- uint32 (*postHookFunc) (uint32 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NumColumns_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumColumns_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NumColumns_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint64 HP_SQL_NumRows(Sql *self) {
+uint64 HP_SQL_NumRows(struct Sql *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NumRows_pre ) {
- uint64 (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NumRows_pre > 0) {
+ uint64 (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NumRows_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71366,26 +73757,26 @@ uint64 HP_SQL_NumRows(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NumRows(self);
}
- if( HPMHooks.count.HP_SQL_NumRows_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NumRows_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NumRows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NumRows_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_NextRow(Sql *self) {
+int HP_SQL_NextRow(struct Sql *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_NextRow_pre ) {
- int (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_NextRow_pre > 0) {
+ int (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_NextRow_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71393,26 +73784,26 @@ int HP_SQL_NextRow(Sql *self) {
{
retVal___ = HPMHooks.source.SQL.NextRow(self);
}
- if( HPMHooks.count.HP_SQL_NextRow_post ) {
- int (*postHookFunc) (int retVal___, Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_NextRow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_NextRow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_NextRow_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_GetData(Sql *self, size_t col, char **out_buf, size_t *out_len) {
+int HP_SQL_GetData(struct Sql *self, size_t col, char **out_buf, size_t *out_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_GetData_pre ) {
- int (*preHookFunc) (Sql *self, size_t *col, char **out_buf, size_t *out_len);
+ if (HPMHooks.count.HP_SQL_GetData_pre > 0) {
+ int (*preHookFunc) (struct Sql **self, size_t *col, char ***out_buf, size_t **out_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_GetData_pre[hIndex].func;
- retVal___ = preHookFunc(self, &col, out_buf, out_len);
+ retVal___ = preHookFunc(&self, &col, &out_buf, &out_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71420,25 +73811,25 @@ int HP_SQL_GetData(Sql *self, size_t col, char **out_buf, size_t *out_len) {
{
retVal___ = HPMHooks.source.SQL.GetData(self, col, out_buf, out_len);
}
- if( HPMHooks.count.HP_SQL_GetData_post ) {
- int (*postHookFunc) (int retVal___, Sql *self, size_t *col, char **out_buf, size_t *out_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_GetData_post > 0) {
+ int (*postHookFunc) (int retVal___, struct Sql *self, size_t col, char **out_buf, size_t *out_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_GetData_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_GetData_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &col, out_buf, out_len);
+ retVal___ = postHookFunc(retVal___, self, col, out_buf, out_len);
}
}
return retVal___;
}
-void HP_SQL_FreeResult(Sql *self) {
+void HP_SQL_FreeResult(struct Sql *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_FreeResult_pre ) {
- void (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_FreeResult_pre > 0) {
+ void (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_FreeResult_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71446,25 +73837,25 @@ void HP_SQL_FreeResult(Sql *self) {
{
HPMHooks.source.SQL.FreeResult(self);
}
- if( HPMHooks.count.HP_SQL_FreeResult_post ) {
- void (*postHookFunc) (Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_FreeResult_post > 0) {
+ void (*postHookFunc) (struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_FreeResult_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_FreeResult_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_ShowDebug_(Sql *self, const char *debug_file, const unsigned long debug_line) {
+void HP_SQL_ShowDebug_(struct Sql *self, const char *debug_file, const unsigned long debug_line) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_ShowDebug__pre ) {
- void (*preHookFunc) (Sql *self, const char *debug_file, const unsigned long *debug_line);
+ if (HPMHooks.count.HP_SQL_ShowDebug__pre > 0) {
+ void (*preHookFunc) (struct Sql **self, const char **debug_file, const unsigned long *debug_line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_ShowDebug__pre[hIndex].func;
- preHookFunc(self, debug_file, &debug_line);
+ preHookFunc(&self, &debug_file, &debug_line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71472,25 +73863,25 @@ void HP_SQL_ShowDebug_(Sql *self, const char *debug_file, const unsigned long de
{
HPMHooks.source.SQL.ShowDebug_(self, debug_file, debug_line);
}
- if( HPMHooks.count.HP_SQL_ShowDebug__post ) {
- void (*postHookFunc) (Sql *self, const char *debug_file, const unsigned long *debug_line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_ShowDebug__post > 0) {
+ void (*postHookFunc) (struct Sql *self, const char *debug_file, const unsigned long debug_line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_ShowDebug__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_ShowDebug__post[hIndex].func;
- postHookFunc(self, debug_file, &debug_line);
+ postHookFunc(self, debug_file, debug_line);
}
}
return;
}
-void HP_SQL_Free(Sql *self) {
+void HP_SQL_Free(struct Sql *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_Free_pre ) {
- void (*preHookFunc) (Sql *self);
+ if (HPMHooks.count.HP_SQL_Free_pre > 0) {
+ void (*preHookFunc) (struct Sql **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Free_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71498,9 +73889,9 @@ void HP_SQL_Free(Sql *self) {
{
HPMHooks.source.SQL.Free(self);
}
- if( HPMHooks.count.HP_SQL_Free_post ) {
- void (*postHookFunc) (Sql *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_Free_post > 0) {
+ void (*postHookFunc) (struct Sql *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Free_post[hIndex].func;
postHookFunc(self);
}
@@ -71510,14 +73901,14 @@ void HP_SQL_Free(Sql *self) {
struct Sql* HP_SQL_Malloc(void) {
int hIndex = 0;
struct Sql* retVal___ = NULL;
- if( HPMHooks.count.HP_SQL_Malloc_pre ) {
+ if (HPMHooks.count.HP_SQL_Malloc_pre > 0) {
struct Sql* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_Malloc_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71525,26 +73916,26 @@ struct Sql* HP_SQL_Malloc(void) {
{
retVal___ = HPMHooks.source.SQL.Malloc();
}
- if( HPMHooks.count.HP_SQL_Malloc_post ) {
+ if (HPMHooks.count.HP_SQL_Malloc_post > 0) {
struct Sql* (*postHookFunc) (struct Sql* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_Malloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_Malloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
-struct SqlStmt* HP_SQL_StmtMalloc(Sql *sql) {
+struct SqlStmt* HP_SQL_StmtMalloc(struct Sql *sql) {
int hIndex = 0;
struct SqlStmt* retVal___ = NULL;
- if( HPMHooks.count.HP_SQL_StmtMalloc_pre ) {
- struct SqlStmt* (*preHookFunc) (Sql *sql);
+ if (HPMHooks.count.HP_SQL_StmtMalloc_pre > 0) {
+ struct SqlStmt* (*preHookFunc) (struct Sql **sql);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_pre[hIndex].func;
- retVal___ = preHookFunc(sql);
+ retVal___ = preHookFunc(&sql);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71552,28 +73943,28 @@ struct SqlStmt* HP_SQL_StmtMalloc(Sql *sql) {
{
retVal___ = HPMHooks.source.SQL.StmtMalloc(sql);
}
- if( HPMHooks.count.HP_SQL_StmtMalloc_post ) {
- struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, Sql *sql);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtMalloc_post > 0) {
+ struct SqlStmt* (*postHookFunc) (struct SqlStmt* retVal___, struct Sql *sql);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtMalloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtMalloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sql);
}
}
return retVal___;
}
-int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
+int HP_SQL_StmtPrepareV(struct SqlStmt *self, const char *query, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtPrepareV_pre ) {
- int (*preHookFunc) (SqlStmt *self, const char *query, va_list args);
+ if (HPMHooks.count.HP_SQL_StmtPrepareV_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, const char **query, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_SQL_StmtPrepareV_pre[hIndex].func;
- retVal___ = preHookFunc(self, query, args___copy);
+ retVal___ = preHookFunc(&self, &query, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71583,9 +73974,9 @@ int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
retVal___ = HPMHooks.source.SQL.StmtPrepareV(self, query, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_SQL_StmtPrepareV_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, const char *query, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtPrepareV_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, const char *query, va_list args);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareV_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_SQL_StmtPrepareV_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query, args___copy);
@@ -71594,17 +73985,17 @@ int HP_SQL_StmtPrepareV(SqlStmt *self, const char *query, va_list args) {
}
return retVal___;
}
-int HP_SQL_StmtPrepareStr(SqlStmt *self, const char *query) {
+int HP_SQL_StmtPrepareStr(struct SqlStmt *self, const char *query) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtPrepareStr_pre ) {
- int (*preHookFunc) (SqlStmt *self, const char *query);
+ if (HPMHooks.count.HP_SQL_StmtPrepareStr_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, const char **query);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtPrepareStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, query);
+ retVal___ = preHookFunc(&self, &query);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71612,26 +74003,26 @@ int HP_SQL_StmtPrepareStr(SqlStmt *self, const char *query) {
{
retVal___ = HPMHooks.source.SQL.StmtPrepareStr(self, query);
}
- if( HPMHooks.count.HP_SQL_StmtPrepareStr_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, const char *query);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtPrepareStr_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, const char *query);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtPrepareStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtPrepareStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, query);
}
}
return retVal___;
}
-size_t HP_SQL_StmtNumParams(SqlStmt *self) {
+size_t HP_SQL_StmtNumParams(struct SqlStmt *self) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumParams_pre ) {
- size_t (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumParams_pre > 0) {
+ size_t (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumParams_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71639,26 +74030,26 @@ size_t HP_SQL_StmtNumParams(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumParams(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumParams_post ) {
- size_t (*postHookFunc) (size_t retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumParams_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumParams_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumParams_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtBindParam(SqlStmt *self, size_t idx, SqlDataType buffer_type, void *buffer, size_t buffer_len) {
+int HP_SQL_StmtBindParam(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtBindParam_pre ) {
- int (*preHookFunc) (SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len);
+ if (HPMHooks.count.HP_SQL_StmtBindParam_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, const void **buffer, size_t *buffer_len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtBindParam_pre[hIndex].func;
- retVal___ = preHookFunc(self, &idx, &buffer_type, buffer, &buffer_len);
+ retVal___ = preHookFunc(&self, &idx, &buffer_type, &buffer, &buffer_len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71666,26 +74057,26 @@ int HP_SQL_StmtBindParam(SqlStmt *self, size_t idx, SqlDataType buffer_type, voi
{
retVal___ = HPMHooks.source.SQL.StmtBindParam(self, idx, buffer_type, buffer, buffer_len);
}
- if( HPMHooks.count.HP_SQL_StmtBindParam_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtBindParam_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, const void *buffer, size_t buffer_len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindParam_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtBindParam_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &idx, &buffer_type, buffer, &buffer_len);
+ retVal___ = postHookFunc(retVal___, self, idx, buffer_type, buffer, buffer_len);
}
}
return retVal___;
}
-int HP_SQL_StmtExecute(SqlStmt *self) {
+int HP_SQL_StmtExecute(struct SqlStmt *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtExecute_pre ) {
- int (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtExecute_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtExecute_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71693,26 +74084,26 @@ int HP_SQL_StmtExecute(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtExecute(self);
}
- if( HPMHooks.count.HP_SQL_StmtExecute_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtExecute_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtExecute_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtExecute_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-uint64 HP_SQL_StmtLastInsertId(SqlStmt *self) {
+uint64 HP_SQL_StmtLastInsertId(struct SqlStmt *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtLastInsertId_pre ) {
- uint64 (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtLastInsertId_pre > 0) {
+ uint64 (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtLastInsertId_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71720,26 +74111,26 @@ uint64 HP_SQL_StmtLastInsertId(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtLastInsertId(self);
}
- if( HPMHooks.count.HP_SQL_StmtLastInsertId_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtLastInsertId_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtLastInsertId_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtLastInsertId_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-size_t HP_SQL_StmtNumColumns(SqlStmt *self) {
+size_t HP_SQL_StmtNumColumns(struct SqlStmt *self) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumColumns_pre ) {
- size_t (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumColumns_pre > 0) {
+ size_t (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumColumns_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71747,26 +74138,26 @@ size_t HP_SQL_StmtNumColumns(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumColumns(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumColumns_post ) {
- size_t (*postHookFunc) (size_t retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumColumns_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumColumns_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumColumns_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtBindColumn(SqlStmt *self, size_t idx, SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
+int HP_SQL_StmtBindColumn(struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtBindColumn_pre ) {
- int (*preHookFunc) (SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len, uint32 *out_length, int8 *out_is_null);
+ if (HPMHooks.count.HP_SQL_StmtBindColumn_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self, size_t *idx, enum SqlDataType *buffer_type, void **buffer, size_t *buffer_len, uint32 **out_length, int8 **out_is_null);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtBindColumn_pre[hIndex].func;
- retVal___ = preHookFunc(self, &idx, &buffer_type, buffer, &buffer_len, out_length, out_is_null);
+ retVal___ = preHookFunc(&self, &idx, &buffer_type, &buffer, &buffer_len, &out_length, &out_is_null);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71774,26 +74165,26 @@ int HP_SQL_StmtBindColumn(SqlStmt *self, size_t idx, SqlDataType buffer_type, vo
{
retVal___ = HPMHooks.source.SQL.StmtBindColumn(self, idx, buffer_type, buffer, buffer_len, out_length, out_is_null);
}
- if( HPMHooks.count.HP_SQL_StmtBindColumn_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self, size_t *idx, SqlDataType *buffer_type, void *buffer, size_t *buffer_len, uint32 *out_length, int8 *out_is_null);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtBindColumn_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self, size_t idx, enum SqlDataType buffer_type, void *buffer, size_t buffer_len, uint32 *out_length, int8 *out_is_null);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtBindColumn_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtBindColumn_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, self, &idx, &buffer_type, buffer, &buffer_len, out_length, out_is_null);
+ retVal___ = postHookFunc(retVal___, self, idx, buffer_type, buffer, buffer_len, out_length, out_is_null);
}
}
return retVal___;
}
-uint64 HP_SQL_StmtNumRows(SqlStmt *self) {
+uint64 HP_SQL_StmtNumRows(struct SqlStmt *self) {
int hIndex = 0;
uint64 retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNumRows_pre ) {
- uint64 (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNumRows_pre > 0) {
+ uint64 (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNumRows_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71801,26 +74192,26 @@ uint64 HP_SQL_StmtNumRows(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNumRows(self);
}
- if( HPMHooks.count.HP_SQL_StmtNumRows_post ) {
- uint64 (*postHookFunc) (uint64 retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNumRows_post > 0) {
+ uint64 (*postHookFunc) (uint64 retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNumRows_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNumRows_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-int HP_SQL_StmtNextRow(SqlStmt *self) {
+int HP_SQL_StmtNextRow(struct SqlStmt *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_SQL_StmtNextRow_pre ) {
- int (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtNextRow_pre > 0) {
+ int (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtNextRow_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71828,25 +74219,25 @@ int HP_SQL_StmtNextRow(SqlStmt *self) {
{
retVal___ = HPMHooks.source.SQL.StmtNextRow(self);
}
- if( HPMHooks.count.HP_SQL_StmtNextRow_post ) {
- int (*postHookFunc) (int retVal___, SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtNextRow_post > 0) {
+ int (*postHookFunc) (int retVal___, struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtNextRow_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtNextRow_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
}
return retVal___;
}
-void HP_SQL_StmtFreeResult(SqlStmt *self) {
+void HP_SQL_StmtFreeResult(struct SqlStmt *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtFreeResult_pre ) {
- void (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtFreeResult_pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtFreeResult_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71854,25 +74245,25 @@ void HP_SQL_StmtFreeResult(SqlStmt *self) {
{
HPMHooks.source.SQL.StmtFreeResult(self);
}
- if( HPMHooks.count.HP_SQL_StmtFreeResult_post ) {
- void (*postHookFunc) (SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtFreeResult_post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFreeResult_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtFreeResult_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_StmtFree(SqlStmt *self) {
+void HP_SQL_StmtFree(struct SqlStmt *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtFree_pre ) {
- void (*preHookFunc) (SqlStmt *self);
+ if (HPMHooks.count.HP_SQL_StmtFree_pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtFree_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71880,25 +74271,25 @@ void HP_SQL_StmtFree(SqlStmt *self) {
{
HPMHooks.source.SQL.StmtFree(self);
}
- if( HPMHooks.count.HP_SQL_StmtFree_post ) {
- void (*postHookFunc) (SqlStmt *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtFree_post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtFree_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtFree_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-void HP_SQL_StmtShowDebug_(SqlStmt *self, const char *debug_file, const unsigned long debug_line) {
+void HP_SQL_StmtShowDebug_(struct SqlStmt *self, const char *debug_file, const unsigned long debug_line) {
int hIndex = 0;
- if( HPMHooks.count.HP_SQL_StmtShowDebug__pre ) {
- void (*preHookFunc) (SqlStmt *self, const char *debug_file, const unsigned long *debug_line);
+ if (HPMHooks.count.HP_SQL_StmtShowDebug__pre > 0) {
+ void (*preHookFunc) (struct SqlStmt **self, const char **debug_file, const unsigned long *debug_line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_SQL_StmtShowDebug__pre[hIndex].func;
- preHookFunc(self, debug_file, &debug_line);
+ preHookFunc(&self, &debug_file, &debug_line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71906,27 +74297,27 @@ void HP_SQL_StmtShowDebug_(SqlStmt *self, const char *debug_file, const unsigned
{
HPMHooks.source.SQL.StmtShowDebug_(self, debug_file, debug_line);
}
- if( HPMHooks.count.HP_SQL_StmtShowDebug__post ) {
- void (*postHookFunc) (SqlStmt *self, const char *debug_file, const unsigned long *debug_line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__post; hIndex++ ) {
+ if (HPMHooks.count.HP_SQL_StmtShowDebug__post > 0) {
+ void (*postHookFunc) (struct SqlStmt *self, const char *debug_file, const unsigned long debug_line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_SQL_StmtShowDebug__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_SQL_StmtShowDebug__post[hIndex].func;
- postHookFunc(self, debug_file, &debug_line);
+ postHookFunc(self, debug_file, debug_line);
}
}
return;
}
-/* status */
+/* status_interface */
int HP_status_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_init_pre ) {
+ if (HPMHooks.count.HP_status_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -71934,25 +74325,25 @@ int HP_status_init(bool minimal) {
{
retVal___ = HPMHooks.source.status.init(minimal);
}
- if( HPMHooks.count.HP_status_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
}
void HP_status_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_final_pre ) {
+ if (HPMHooks.count.HP_status_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -71960,38 +74351,38 @@ void HP_status_final(void) {
{
HPMHooks.source.status.final();
}
- if( HPMHooks.count.HP_status_final_post ) {
+ if (HPMHooks.count.HP_status_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-int HP_status_get_refine_chance(enum refine_type wlv, int refine) {
+int HP_status_get_refine_chance(enum refine_type wlv, int refine, enum refine_chance_type type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_refine_chance_pre ) {
- int (*preHookFunc) (enum refine_type *wlv, int *refine);
+ if (HPMHooks.count.HP_status_get_refine_chance_pre > 0) {
+ int (*preHookFunc) (enum refine_type *wlv, int *refine, enum refine_chance_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_refine_chance_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_refine_chance_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_refine_chance_pre[hIndex].func;
- retVal___ = preHookFunc(&wlv, &refine);
+ retVal___ = preHookFunc(&wlv, &refine, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
}
{
- retVal___ = HPMHooks.source.status.get_refine_chance(wlv, refine);
+ retVal___ = HPMHooks.source.status.get_refine_chance(wlv, refine, type);
}
- if( HPMHooks.count.HP_status_get_refine_chance_post ) {
- int (*postHookFunc) (int retVal___, enum refine_type *wlv, int *refine);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_refine_chance_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_refine_chance_post > 0) {
+ int (*postHookFunc) (int retVal___, enum refine_type wlv, int refine, enum refine_chance_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_refine_chance_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_refine_chance_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &wlv, &refine);
+ retVal___ = postHookFunc(retVal___, wlv, refine, type);
}
}
return retVal___;
@@ -71999,14 +74390,14 @@ int HP_status_get_refine_chance(enum refine_type wlv, int refine) {
sc_type HP_status_skill2sc(int skill_id) {
int hIndex = 0;
sc_type retVal___ = SC_NONE;
- if( HPMHooks.count.HP_status_skill2sc_pre ) {
+ if (HPMHooks.count.HP_status_skill2sc_pre > 0) {
sc_type (*preHookFunc) (int *skill_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_skill2sc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_skill2sc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_skill2sc_pre[hIndex].func;
retVal___ = preHookFunc(&skill_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72014,11 +74405,11 @@ sc_type HP_status_skill2sc(int skill_id) {
{
retVal___ = HPMHooks.source.status.skill2sc(skill_id);
}
- if( HPMHooks.count.HP_status_skill2sc_post ) {
- sc_type (*postHookFunc) (sc_type retVal___, int *skill_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_skill2sc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_skill2sc_post > 0) {
+ sc_type (*postHookFunc) (sc_type retVal___, int skill_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_skill2sc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_skill2sc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &skill_id);
+ retVal___ = postHookFunc(retVal___, skill_id);
}
}
return retVal___;
@@ -72026,14 +74417,14 @@ sc_type HP_status_skill2sc(int skill_id) {
int HP_status_sc2skill(sc_type sc) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_sc2skill_pre ) {
+ if (HPMHooks.count.HP_status_sc2skill_pre > 0) {
int (*preHookFunc) (sc_type *sc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2skill_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2skill_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_sc2skill_pre[hIndex].func;
retVal___ = preHookFunc(&sc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72041,11 +74432,11 @@ int HP_status_sc2skill(sc_type sc) {
{
retVal___ = HPMHooks.source.status.sc2skill(sc);
}
- if( HPMHooks.count.HP_status_sc2skill_post ) {
- int (*postHookFunc) (int retVal___, sc_type *sc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2skill_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_sc2skill_post > 0) {
+ int (*postHookFunc) (int retVal___, sc_type sc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2skill_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_sc2skill_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &sc);
+ retVal___ = postHookFunc(retVal___, sc);
}
}
return retVal___;
@@ -72053,14 +74444,14 @@ int HP_status_sc2skill(sc_type sc) {
unsigned int HP_status_sc2scb_flag(sc_type sc) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_status_sc2scb_flag_pre ) {
+ if (HPMHooks.count.HP_status_sc2scb_flag_pre > 0) {
unsigned int (*preHookFunc) (sc_type *sc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2scb_flag_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2scb_flag_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_sc2scb_flag_pre[hIndex].func;
retVal___ = preHookFunc(&sc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72068,11 +74459,11 @@ unsigned int HP_status_sc2scb_flag(sc_type sc) {
{
retVal___ = HPMHooks.source.status.sc2scb_flag(sc);
}
- if( HPMHooks.count.HP_status_sc2scb_flag_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, sc_type *sc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2scb_flag_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_sc2scb_flag_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, sc_type sc);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_sc2scb_flag_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_sc2scb_flag_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &sc);
+ retVal___ = postHookFunc(retVal___, sc);
}
}
return retVal___;
@@ -72080,14 +74471,14 @@ unsigned int HP_status_sc2scb_flag(sc_type sc) {
int HP_status_type2relevant_bl_types(int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_type2relevant_bl_types_pre ) {
+ if (HPMHooks.count.HP_status_type2relevant_bl_types_pre > 0) {
int (*preHookFunc) (int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_type2relevant_bl_types_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_type2relevant_bl_types_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_type2relevant_bl_types_pre[hIndex].func;
retVal___ = preHookFunc(&type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72095,11 +74486,11 @@ int HP_status_type2relevant_bl_types(int type) {
{
retVal___ = HPMHooks.source.status.type2relevant_bl_types(type);
}
- if( HPMHooks.count.HP_status_type2relevant_bl_types_post ) {
- int (*postHookFunc) (int retVal___, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_type2relevant_bl_types_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_type2relevant_bl_types_post > 0) {
+ int (*postHookFunc) (int retVal___, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_type2relevant_bl_types_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_type2relevant_bl_types_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &type);
+ retVal___ = postHookFunc(retVal___, type);
}
}
return retVal___;
@@ -72107,14 +74498,14 @@ int HP_status_type2relevant_bl_types(int type) {
int HP_status_get_sc_type(sc_type idx) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_sc_type_pre ) {
+ if (HPMHooks.count.HP_status_get_sc_type_pre > 0) {
int (*preHookFunc) (sc_type *idx);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_type_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_type_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_sc_type_pre[hIndex].func;
retVal___ = preHookFunc(&idx);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72122,11 +74513,11 @@ int HP_status_get_sc_type(sc_type idx) {
{
retVal___ = HPMHooks.source.status.get_sc_type(idx);
}
- if( HPMHooks.count.HP_status_get_sc_type_post ) {
- int (*postHookFunc) (int retVal___, sc_type *idx);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_type_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_sc_type_post > 0) {
+ int (*postHookFunc) (int retVal___, sc_type idx);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_type_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_sc_type_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &idx);
+ retVal___ = postHookFunc(retVal___, idx);
}
}
return retVal___;
@@ -72134,14 +74525,14 @@ int HP_status_get_sc_type(sc_type idx) {
int HP_status_damage(struct block_list *src, struct block_list *target, int64 hp, int64 sp, int walkdelay, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_damage_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, int64 *hp, int64 *sp, int *walkdelay, int *flag);
+ if (HPMHooks.count.HP_status_damage_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, int64 *hp, int64 *sp, int *walkdelay, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_damage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_damage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_damage_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &hp, &sp, &walkdelay, &flag);
+ retVal___ = preHookFunc(&src, &target, &hp, &sp, &walkdelay, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72149,11 +74540,11 @@ int HP_status_damage(struct block_list *src, struct block_list *target, int64 hp
{
retVal___ = HPMHooks.source.status.damage(src, target, hp, sp, walkdelay, flag);
}
- if( HPMHooks.count.HP_status_damage_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int64 *hp, int64 *sp, int *walkdelay, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_damage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_damage_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int64 hp, int64 sp, int walkdelay, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_damage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_damage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &hp, &sp, &walkdelay, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, hp, sp, walkdelay, flag);
}
}
return retVal___;
@@ -72161,14 +74552,14 @@ int HP_status_damage(struct block_list *src, struct block_list *target, int64 hp
int HP_status_charge(struct block_list *bl, int64 hp, int64 sp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_charge_pre ) {
- int (*preHookFunc) (struct block_list *bl, int64 *hp, int64 *sp);
+ if (HPMHooks.count.HP_status_charge_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int64 *hp, int64 *sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_charge_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_charge_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_charge_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &hp, &sp);
+ retVal___ = preHookFunc(&bl, &hp, &sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72176,11 +74567,11 @@ int HP_status_charge(struct block_list *bl, int64 hp, int64 sp) {
{
retVal___ = HPMHooks.source.status.charge(bl, hp, sp);
}
- if( HPMHooks.count.HP_status_charge_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int64 *hp, int64 *sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_charge_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_charge_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int64 hp, int64 sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_charge_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_charge_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &hp, &sp);
+ retVal___ = postHookFunc(retVal___, bl, hp, sp);
}
}
return retVal___;
@@ -72188,14 +74579,14 @@ int HP_status_charge(struct block_list *bl, int64 hp, int64 sp) {
int HP_status_percent_change(struct block_list *src, struct block_list *target, signed char hp_rate, signed char sp_rate, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_percent_change_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, signed char *hp_rate, signed char *sp_rate, int *flag);
+ if (HPMHooks.count.HP_status_percent_change_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, signed char *hp_rate, signed char *sp_rate, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_percent_change_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_percent_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_percent_change_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &hp_rate, &sp_rate, &flag);
+ retVal___ = preHookFunc(&src, &target, &hp_rate, &sp_rate, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72203,11 +74594,11 @@ int HP_status_percent_change(struct block_list *src, struct block_list *target,
{
retVal___ = HPMHooks.source.status.percent_change(src, target, hp_rate, sp_rate, flag);
}
- if( HPMHooks.count.HP_status_percent_change_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, signed char *hp_rate, signed char *sp_rate, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_percent_change_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_percent_change_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, signed char hp_rate, signed char sp_rate, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_percent_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_percent_change_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &hp_rate, &sp_rate, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, hp_rate, sp_rate, flag);
}
}
return retVal___;
@@ -72215,14 +74606,14 @@ int HP_status_percent_change(struct block_list *src, struct block_list *target,
int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_set_hp_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned int *hp, int *flag);
+ if (HPMHooks.count.HP_status_set_hp_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned int *hp, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_set_hp_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &hp, &flag);
+ retVal___ = preHookFunc(&bl, &hp, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72230,11 +74621,11 @@ int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
{
retVal___ = HPMHooks.source.status.set_hp(bl, hp, flag);
}
- if( HPMHooks.count.HP_status_set_hp_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int *hp, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_set_hp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int hp, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_set_hp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &hp, &flag);
+ retVal___ = postHookFunc(retVal___, bl, hp, flag);
}
}
return retVal___;
@@ -72242,14 +74633,14 @@ int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_set_sp_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned int *sp, int *flag);
+ if (HPMHooks.count.HP_status_set_sp_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned int *sp, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_set_sp_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &sp, &flag);
+ retVal___ = preHookFunc(&bl, &sp, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72257,11 +74648,11 @@ int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
{
retVal___ = HPMHooks.source.status.set_sp(bl, sp, flag);
}
- if( HPMHooks.count.HP_status_set_sp_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int *sp, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_set_sp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int sp, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_set_sp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &sp, &flag);
+ retVal___ = postHookFunc(retVal___, bl, sp, flag);
}
}
return retVal___;
@@ -72269,14 +74660,14 @@ int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_heal_pre ) {
- int (*preHookFunc) (struct block_list *bl, int64 *hp, int64 *sp, int *flag);
+ if (HPMHooks.count.HP_status_heal_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int64 *hp, int64 *sp, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_heal_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &hp, &sp, &flag);
+ retVal___ = preHookFunc(&bl, &hp, &sp, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72284,11 +74675,11 @@ int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) {
{
retVal___ = HPMHooks.source.status.heal(bl, hp, sp, flag);
}
- if( HPMHooks.count.HP_status_heal_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int64 *hp, int64 *sp, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_heal_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int64 hp, int64 sp, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_heal_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &hp, &sp, &flag);
+ retVal___ = postHookFunc(retVal___, bl, hp, sp, flag);
}
}
return retVal___;
@@ -72296,14 +74687,14 @@ int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) {
int HP_status_revive(struct block_list *bl, unsigned char per_hp, unsigned char per_sp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_revive_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned char *per_hp, unsigned char *per_sp);
+ if (HPMHooks.count.HP_status_revive_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned char *per_hp, unsigned char *per_sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_revive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_revive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_revive_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &per_hp, &per_sp);
+ retVal___ = preHookFunc(&bl, &per_hp, &per_sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72311,11 +74702,11 @@ int HP_status_revive(struct block_list *bl, unsigned char per_hp, unsigned char
{
retVal___ = HPMHooks.source.status.revive(bl, per_hp, per_sp);
}
- if( HPMHooks.count.HP_status_revive_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned char *per_hp, unsigned char *per_sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_revive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_revive_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned char per_hp, unsigned char per_sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_revive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_revive_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &per_hp, &per_sp);
+ retVal___ = postHookFunc(retVal___, bl, per_hp, per_sp);
}
}
return retVal___;
@@ -72323,14 +74714,14 @@ int HP_status_revive(struct block_list *bl, unsigned char per_hp, unsigned char
int HP_status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned int per_sp) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_fixed_revive_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned int *per_hp, unsigned int *per_sp);
+ if (HPMHooks.count.HP_status_fixed_revive_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned int *per_hp, unsigned int *per_sp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_fixed_revive_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_fixed_revive_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_fixed_revive_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &per_hp, &per_sp);
+ retVal___ = preHookFunc(&bl, &per_hp, &per_sp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72338,11 +74729,11 @@ int HP_status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned
{
retVal___ = HPMHooks.source.status.fixed_revive(bl, per_hp, per_sp);
}
- if( HPMHooks.count.HP_status_fixed_revive_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int *per_hp, unsigned int *per_sp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_fixed_revive_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_fixed_revive_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int per_hp, unsigned int per_sp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_fixed_revive_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_fixed_revive_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &per_hp, &per_sp);
+ retVal___ = postHookFunc(retVal___, bl, per_hp, per_sp);
}
}
return retVal___;
@@ -72350,14 +74741,14 @@ int HP_status_fixed_revive(struct block_list *bl, unsigned int per_hp, unsigned
struct regen_data* HP_status_get_regen_data(struct block_list *bl) {
int hIndex = 0;
struct regen_data* retVal___ = NULL;
- if( HPMHooks.count.HP_status_get_regen_data_pre ) {
- struct regen_data* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_regen_data_pre > 0) {
+ struct regen_data* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_regen_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_regen_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_regen_data_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72365,9 +74756,9 @@ struct regen_data* HP_status_get_regen_data(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_regen_data(bl);
}
- if( HPMHooks.count.HP_status_get_regen_data_post ) {
+ if (HPMHooks.count.HP_status_get_regen_data_post > 0) {
struct regen_data* (*postHookFunc) (struct regen_data* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_regen_data_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_regen_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_regen_data_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72377,14 +74768,14 @@ struct regen_data* HP_status_get_regen_data(struct block_list *bl) {
struct status_data* HP_status_get_status_data(struct block_list *bl) {
int hIndex = 0;
struct status_data* retVal___ = NULL;
- if( HPMHooks.count.HP_status_get_status_data_pre ) {
- struct status_data* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_status_data_pre > 0) {
+ struct status_data* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_status_data_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_status_data_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_status_data_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72392,9 +74783,9 @@ struct status_data* HP_status_get_status_data(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_status_data(bl);
}
- if( HPMHooks.count.HP_status_get_status_data_post ) {
+ if (HPMHooks.count.HP_status_get_status_data_post > 0) {
struct status_data* (*postHookFunc) (struct status_data* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_status_data_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_status_data_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_status_data_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72404,14 +74795,14 @@ struct status_data* HP_status_get_status_data(struct block_list *bl) {
struct status_data* HP_status_get_base_status(struct block_list *bl) {
int hIndex = 0;
struct status_data* retVal___ = NULL;
- if( HPMHooks.count.HP_status_get_base_status_pre ) {
- struct status_data* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_base_status_pre > 0) {
+ struct status_data* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_status_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_status_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_base_status_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72419,26 +74810,26 @@ struct status_data* HP_status_get_base_status(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_base_status(bl);
}
- if( HPMHooks.count.HP_status_get_base_status_post ) {
+ if (HPMHooks.count.HP_status_get_base_status_post > 0) {
struct status_data* (*postHookFunc) (struct status_data* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_status_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_status_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_base_status_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-const char* HP_status_get_name(struct block_list *bl) {
+const char* HP_status_get_name(const struct block_list *bl) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_status_get_name_pre ) {
- const char* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_name_pre > 0) {
+ const char* (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_name_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_name_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_name_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72446,26 +74837,26 @@ const char* HP_status_get_name(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_name(bl);
}
- if( HPMHooks.count.HP_status_get_name_post ) {
- const char* (*postHookFunc) (const char* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_name_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_name_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_name_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_name_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-int HP_status_get_class(struct block_list *bl) {
+int HP_status_get_class(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_class_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_class_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_class_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_class_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_class_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72473,26 +74864,26 @@ int HP_status_get_class(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_class(bl);
}
- if( HPMHooks.count.HP_status_get_class_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_class_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_class_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_class_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_class_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-int HP_status_get_lv(struct block_list *bl) {
+int HP_status_get_lv(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_lv_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_lv_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_lv_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_lv_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_lv_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72500,9 +74891,9 @@ int HP_status_get_lv(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_lv(bl);
}
- if( HPMHooks.count.HP_status_get_lv_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_lv_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_lv_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_lv_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_lv_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72512,14 +74903,14 @@ int HP_status_get_lv(struct block_list *bl) {
defType HP_status_get_def(struct block_list *bl) {
int hIndex = 0;
defType retVal___ = 0;
- if( HPMHooks.count.HP_status_get_def_pre ) {
- defType (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_def_pre > 0) {
+ defType (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_def_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_def_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_def_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72527,9 +74918,9 @@ defType HP_status_get_def(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_def(bl);
}
- if( HPMHooks.count.HP_status_get_def_post ) {
+ if (HPMHooks.count.HP_status_get_def_post > 0) {
defType (*postHookFunc) (defType retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_def_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_def_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_def_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72539,14 +74930,14 @@ defType HP_status_get_def(struct block_list *bl) {
unsigned short HP_status_get_speed(struct block_list *bl) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_get_speed_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_speed_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_speed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_speed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_speed_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72554,9 +74945,9 @@ unsigned short HP_status_get_speed(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_speed(bl);
}
- if( HPMHooks.count.HP_status_get_speed_post ) {
+ if (HPMHooks.count.HP_status_get_speed_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_speed_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_speed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_speed_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72566,14 +74957,14 @@ unsigned short HP_status_get_speed(struct block_list *bl) {
unsigned char HP_status_calc_attack_element(struct block_list *bl, struct status_change *sc, int element) {
int hIndex = 0;
unsigned char retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_attack_element_pre ) {
- unsigned char (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *element);
+ if (HPMHooks.count.HP_status_calc_attack_element_pre > 0) {
+ unsigned char (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *element);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_attack_element_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_attack_element_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_attack_element_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &element);
+ retVal___ = preHookFunc(&bl, &sc, &element);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72581,26 +74972,26 @@ unsigned char HP_status_calc_attack_element(struct block_list *bl, struct status
{
retVal___ = HPMHooks.source.status.calc_attack_element(bl, sc, element);
}
- if( HPMHooks.count.HP_status_calc_attack_element_post ) {
- unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int *element);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_attack_element_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_attack_element_post > 0) {
+ unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int element);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_attack_element_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_attack_element_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &element);
+ retVal___ = postHookFunc(retVal___, bl, sc, element);
}
}
return retVal___;
}
-int HP_status_get_party_id(struct block_list *bl) {
+int HP_status_get_party_id(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_party_id_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_party_id_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_party_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_party_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_party_id_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72608,26 +74999,26 @@ int HP_status_get_party_id(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_party_id(bl);
}
- if( HPMHooks.count.HP_status_get_party_id_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_party_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_party_id_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_party_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_party_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-int HP_status_get_guild_id(struct block_list *bl) {
+int HP_status_get_guild_id(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_guild_id_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_guild_id_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_guild_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_guild_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_guild_id_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72635,26 +75026,26 @@ int HP_status_get_guild_id(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_guild_id(bl);
}
- if( HPMHooks.count.HP_status_get_guild_id_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_guild_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_guild_id_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_guild_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_guild_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-int HP_status_get_emblem_id(struct block_list *bl) {
+int HP_status_get_emblem_id(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_emblem_id_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_emblem_id_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_emblem_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_emblem_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_emblem_id_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72662,26 +75053,26 @@ int HP_status_get_emblem_id(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_emblem_id(bl);
}
- if( HPMHooks.count.HP_status_get_emblem_id_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_emblem_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_emblem_id_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_emblem_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_emblem_id_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-int HP_status_get_mexp(struct block_list *bl) {
+int HP_status_get_mexp(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_mexp_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_mexp_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_mexp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_mexp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_mexp_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72689,26 +75080,26 @@ int HP_status_get_mexp(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_mexp(bl);
}
- if( HPMHooks.count.HP_status_get_mexp_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_mexp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_mexp_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_mexp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_mexp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
-int HP_status_get_race2(struct block_list *bl) {
+int HP_status_get_race2(const struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_race2_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_race2_pre > 0) {
+ int (*preHookFunc) (const struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_race2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_race2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_race2_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72716,9 +75107,9 @@ int HP_status_get_race2(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_race2(bl);
}
- if( HPMHooks.count.HP_status_get_race2_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_race2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_race2_post > 0) {
+ int (*postHookFunc) (int retVal___, const struct block_list *bl);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_race2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_race2_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72728,14 +75119,14 @@ int HP_status_get_race2(struct block_list *bl) {
struct view_data* HP_status_get_viewdata(struct block_list *bl) {
int hIndex = 0;
struct view_data* retVal___ = NULL;
- if( HPMHooks.count.HP_status_get_viewdata_pre ) {
- struct view_data* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_viewdata_pre > 0) {
+ struct view_data* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_viewdata_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72743,9 +75134,9 @@ struct view_data* HP_status_get_viewdata(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_viewdata(bl);
}
- if( HPMHooks.count.HP_status_get_viewdata_post ) {
+ if (HPMHooks.count.HP_status_get_viewdata_post > 0) {
struct view_data* (*postHookFunc) (struct view_data* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_viewdata_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_viewdata_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72754,14 +75145,14 @@ struct view_data* HP_status_get_viewdata(struct block_list *bl) {
}
void HP_status_set_viewdata(struct block_list *bl, int class_) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_set_viewdata_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *class_);
+ if (HPMHooks.count.HP_status_set_viewdata_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *class_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_viewdata_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_viewdata_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_set_viewdata_pre[hIndex].func;
- preHookFunc(bl, &class_);
+ preHookFunc(&bl, &class_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -72769,25 +75160,25 @@ void HP_status_set_viewdata(struct block_list *bl, int class_) {
{
HPMHooks.source.status.set_viewdata(bl, class_);
}
- if( HPMHooks.count.HP_status_set_viewdata_post ) {
- void (*postHookFunc) (struct block_list *bl, int *class_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_set_viewdata_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_set_viewdata_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int class_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_viewdata_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_set_viewdata_post[hIndex].func;
- postHookFunc(bl, &class_);
+ postHookFunc(bl, class_);
}
}
return;
}
void HP_status_change_init(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_change_init_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_change_init_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_init_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -72795,9 +75186,9 @@ void HP_status_change_init(struct block_list *bl) {
{
HPMHooks.source.status.change_init(bl);
}
- if( HPMHooks.count.HP_status_change_init_post ) {
+ if (HPMHooks.count.HP_status_change_init_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_init_post[hIndex].func;
postHookFunc(bl);
}
@@ -72807,14 +75198,14 @@ void HP_status_change_init(struct block_list *bl) {
struct status_change* HP_status_get_sc(struct block_list *bl) {
int hIndex = 0;
struct status_change* retVal___ = NULL;
- if( HPMHooks.count.HP_status_get_sc_pre ) {
- struct status_change* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_get_sc_pre > 0) {
+ struct status_change* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_sc_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72822,9 +75213,9 @@ struct status_change* HP_status_get_sc(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.get_sc(bl);
}
- if( HPMHooks.count.HP_status_get_sc_post ) {
+ if (HPMHooks.count.HP_status_get_sc_post > 0) {
struct status_change* (*postHookFunc) (struct status_change* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_sc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72834,14 +75225,14 @@ struct status_change* HP_status_get_sc(struct block_list *bl) {
int HP_status_isdead(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_isdead_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_isdead_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_isdead_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_isdead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_isdead_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72849,9 +75240,9 @@ int HP_status_isdead(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.isdead(bl);
}
- if( HPMHooks.count.HP_status_isdead_post ) {
+ if (HPMHooks.count.HP_status_isdead_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_isdead_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_isdead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_isdead_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72861,14 +75252,14 @@ int HP_status_isdead(struct block_list *bl) {
int HP_status_isimmune(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_isimmune_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_isimmune_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_isimmune_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_isimmune_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_isimmune_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72876,9 +75267,9 @@ int HP_status_isimmune(struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.isimmune(bl);
}
- if( HPMHooks.count.HP_status_isimmune_post ) {
+ if (HPMHooks.count.HP_status_isimmune_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_isimmune_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_isimmune_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_isimmune_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -72888,14 +75279,14 @@ int HP_status_isimmune(struct block_list *bl) {
int HP_status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_sc_def_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, enum sc_type *type, int *rate, int *tick, int *flag);
+ if (HPMHooks.count.HP_status_get_sc_def_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_def_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_def_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_sc_def_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &type, &rate, &tick, &flag);
+ retVal___ = preHookFunc(&src, &bl, &type, &rate, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72903,11 +75294,11 @@ int HP_status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_
{
retVal___ = HPMHooks.source.status.get_sc_def(src, bl, type, rate, tick, flag);
}
- if( HPMHooks.count.HP_status_get_sc_def_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type *type, int *rate, int *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_def_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_sc_def_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_sc_def_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_sc_def_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &type, &rate, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, type, rate, tick, flag);
}
}
return retVal___;
@@ -72915,14 +75306,14 @@ int HP_status_get_sc_def(struct block_list *src, struct block_list *bl, enum sc_
int HP_status_change_start(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_start_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
+ if (HPMHooks.count.HP_status_change_start_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_start_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl, &type, &rate, &val1, &val2, &val3, &val4, &tick, &flag);
+ retVal___ = preHookFunc(&src, &bl, &type, &rate, &val1, &val2, &val3, &val4, &tick, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72930,11 +75321,11 @@ int HP_status_change_start(struct block_list *src, struct block_list *bl, enum s
{
retVal___ = HPMHooks.source.status.change_start(src, bl, type, rate, val1, val2, val3, val4, tick, flag);
}
- if( HPMHooks.count.HP_status_change_start_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_change_start_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_start_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, &type, &rate, &val1, &val2, &val3, &val4, &tick, &flag);
+ retVal___ = postHookFunc(retVal___, src, bl, type, rate, val1, val2, val3, val4, tick, flag);
}
}
return retVal___;
@@ -72942,14 +75333,14 @@ int HP_status_change_start(struct block_list *src, struct block_list *bl, enum s
int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid, const char *file, int line) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_end__pre ) {
- int (*preHookFunc) (struct block_list *bl, enum sc_type *type, int *tid, const char *file, int *line);
+ if (HPMHooks.count.HP_status_change_end__pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, enum sc_type *type, int *tid, const char **file, int *line);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_end__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_end__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_end__pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type, &tid, file, &line);
+ retVal___ = preHookFunc(&bl, &type, &tid, &file, &line);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72957,11 +75348,11 @@ int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid, con
{
retVal___ = HPMHooks.source.status.change_end_(bl, type, tid, file, line);
}
- if( HPMHooks.count.HP_status_change_end__post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, enum sc_type *type, int *tid, const char *file, int *line);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_end__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_change_end__post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, enum sc_type type, int tid, const char *file, int line);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_end__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_end__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type, &tid, file, &line);
+ retVal___ = postHookFunc(retVal___, bl, type, tid, file, line);
}
}
return retVal___;
@@ -72969,14 +75360,14 @@ int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid, con
int HP_status_kaahi_heal_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_kaahi_heal_timer_pre ) {
+ if (HPMHooks.count.HP_status_kaahi_heal_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_kaahi_heal_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_kaahi_heal_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_kaahi_heal_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -72984,11 +75375,11 @@ int HP_status_kaahi_heal_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.status.kaahi_heal_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_status_kaahi_heal_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_kaahi_heal_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_kaahi_heal_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_kaahi_heal_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_kaahi_heal_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -72996,14 +75387,14 @@ int HP_status_kaahi_heal_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_status_change_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_timer_pre ) {
+ if (HPMHooks.count.HP_status_change_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73011,11 +75402,11 @@ int HP_status_change_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.status.change_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_status_change_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_change_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -73023,16 +75414,16 @@ int HP_status_change_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_status_change_timer_sub(struct block_list *bl, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_timer_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list ap);
+ if (HPMHooks.count.HP_status_change_timer_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_status_change_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl, ap___copy);
+ retVal___ = preHookFunc(&bl, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73042,9 +75433,9 @@ int HP_status_change_timer_sub(struct block_list *bl, va_list ap) {
retVal___ = HPMHooks.source.status.change_timer_sub(bl, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_status_change_timer_sub_post ) {
+ if (HPMHooks.count.HP_status_change_timer_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_timer_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_status_change_timer_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, ap___copy);
@@ -73056,14 +75447,14 @@ int HP_status_change_timer_sub(struct block_list *bl, va_list ap) {
int HP_status_change_clear(struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_clear_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_status_change_clear_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_clear_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type);
+ retVal___ = preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73071,11 +75462,11 @@ int HP_status_change_clear(struct block_list *bl, int type) {
{
retVal___ = HPMHooks.source.status.change_clear(bl, type);
}
- if( HPMHooks.count.HP_status_change_clear_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_change_clear_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_clear_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type);
+ retVal___ = postHookFunc(retVal___, bl, type);
}
}
return retVal___;
@@ -73083,14 +75474,14 @@ int HP_status_change_clear(struct block_list *bl, int type) {
int HP_status_change_clear_buffs(struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_clear_buffs_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_status_change_clear_buffs_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_buffs_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_buffs_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_clear_buffs_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type);
+ retVal___ = preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73098,25 +75489,25 @@ int HP_status_change_clear_buffs(struct block_list *bl, int type) {
{
retVal___ = HPMHooks.source.status.change_clear_buffs(bl, type);
}
- if( HPMHooks.count.HP_status_change_clear_buffs_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_buffs_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_change_clear_buffs_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_clear_buffs_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_clear_buffs_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type);
+ retVal___ = postHookFunc(retVal___, bl, type);
}
}
return retVal___;
}
void HP_status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status_calc_opt opt) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_calc_bl__pre ) {
- void (*preHookFunc) (struct block_list *bl, enum scb_flag *flag, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_bl__pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, enum scb_flag *flag, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_bl__pre[hIndex].func;
- preHookFunc(bl, &flag, &opt);
+ preHookFunc(&bl, &flag, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73124,11 +75515,11 @@ void HP_status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status
{
HPMHooks.source.status.calc_bl_(bl, flag, opt);
}
- if( HPMHooks.count.HP_status_calc_bl__post ) {
- void (*postHookFunc) (struct block_list *bl, enum scb_flag *flag, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_bl__post > 0) {
+ void (*postHookFunc) (struct block_list *bl, enum scb_flag flag, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_bl__post[hIndex].func;
- postHookFunc(bl, &flag, &opt);
+ postHookFunc(bl, flag, opt);
}
}
return;
@@ -73136,14 +75527,14 @@ void HP_status_calc_bl_(struct block_list *bl, enum scb_flag flag, enum e_status
int HP_status_calc_mob_(struct mob_data *md, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_mob__pre ) {
- int (*preHookFunc) (struct mob_data *md, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_mob__pre > 0) {
+ int (*preHookFunc) (struct mob_data **md, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mob__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mob__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_mob__pre[hIndex].func;
- retVal___ = preHookFunc(md, &opt);
+ retVal___ = preHookFunc(&md, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73151,11 +75542,11 @@ int HP_status_calc_mob_(struct mob_data *md, enum e_status_calc_opt opt) {
{
retVal___ = HPMHooks.source.status.calc_mob_(md, opt);
}
- if( HPMHooks.count.HP_status_calc_mob__post ) {
- int (*postHookFunc) (int retVal___, struct mob_data *md, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mob__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_mob__post > 0) {
+ int (*postHookFunc) (int retVal___, struct mob_data *md, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mob__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_mob__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &opt);
+ retVal___ = postHookFunc(retVal___, md, opt);
}
}
return retVal___;
@@ -73163,14 +75554,14 @@ int HP_status_calc_mob_(struct mob_data *md, enum e_status_calc_opt opt) {
int HP_status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_pet__pre ) {
- int (*preHookFunc) (struct pet_data *pd, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_pet__pre > 0) {
+ int (*preHookFunc) (struct pet_data **pd, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pet__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pet__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_pet__pre[hIndex].func;
- retVal___ = preHookFunc(pd, &opt);
+ retVal___ = preHookFunc(&pd, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73178,11 +75569,11 @@ int HP_status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt) {
{
retVal___ = HPMHooks.source.status.calc_pet_(pd, opt);
}
- if( HPMHooks.count.HP_status_calc_pet__post ) {
- int (*postHookFunc) (int retVal___, struct pet_data *pd, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pet__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_pet__post > 0) {
+ int (*postHookFunc) (int retVal___, struct pet_data *pd, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pet__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_pet__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pd, &opt);
+ retVal___ = postHookFunc(retVal___, pd, opt);
}
}
return retVal___;
@@ -73190,14 +75581,14 @@ int HP_status_calc_pet_(struct pet_data *pd, enum e_status_calc_opt opt) {
int HP_status_calc_pc_(struct map_session_data *sd, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_pc__pre ) {
- int (*preHookFunc) (struct map_session_data *sd, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_pc__pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_pc__pre[hIndex].func;
- retVal___ = preHookFunc(sd, &opt);
+ retVal___ = preHookFunc(&sd, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73205,25 +75596,25 @@ int HP_status_calc_pc_(struct map_session_data *sd, enum e_status_calc_opt opt)
{
retVal___ = HPMHooks.source.status.calc_pc_(sd, opt);
}
- if( HPMHooks.count.HP_status_calc_pc__post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_pc__post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_pc__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &opt);
+ retVal___ = postHookFunc(retVal___, sd, opt);
}
}
return retVal___;
}
void HP_status_calc_pc_additional(struct map_session_data *sd, enum e_status_calc_opt opt) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_calc_pc_additional_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_pc_additional_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc_additional_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc_additional_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_pc_additional_pre[hIndex].func;
- preHookFunc(sd, &opt);
+ preHookFunc(&sd, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73231,11 +75622,11 @@ void HP_status_calc_pc_additional(struct map_session_data *sd, enum e_status_cal
{
HPMHooks.source.status.calc_pc_additional(sd, opt);
}
- if( HPMHooks.count.HP_status_calc_pc_additional_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc_additional_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_pc_additional_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_pc_additional_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_pc_additional_post[hIndex].func;
- postHookFunc(sd, &opt);
+ postHookFunc(sd, opt);
}
}
return;
@@ -73243,14 +75634,14 @@ void HP_status_calc_pc_additional(struct map_session_data *sd, enum e_status_cal
int HP_status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_homunculus__pre ) {
- int (*preHookFunc) (struct homun_data *hd, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_homunculus__pre > 0) {
+ int (*preHookFunc) (struct homun_data **hd, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_homunculus__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_homunculus__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_homunculus__pre[hIndex].func;
- retVal___ = preHookFunc(hd, &opt);
+ retVal___ = preHookFunc(&hd, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73258,11 +75649,11 @@ int HP_status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt
{
retVal___ = HPMHooks.source.status.calc_homunculus_(hd, opt);
}
- if( HPMHooks.count.HP_status_calc_homunculus__post ) {
- int (*postHookFunc) (int retVal___, struct homun_data *hd, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_homunculus__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_homunculus__post > 0) {
+ int (*postHookFunc) (int retVal___, struct homun_data *hd, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_homunculus__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_homunculus__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, hd, &opt);
+ retVal___ = postHookFunc(retVal___, hd, opt);
}
}
return retVal___;
@@ -73270,14 +75661,14 @@ int HP_status_calc_homunculus_(struct homun_data *hd, enum e_status_calc_opt opt
int HP_status_calc_mercenary_(struct mercenary_data *md, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_mercenary__pre ) {
- int (*preHookFunc) (struct mercenary_data *md, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_mercenary__pre > 0) {
+ int (*preHookFunc) (struct mercenary_data **md, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mercenary__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mercenary__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_mercenary__pre[hIndex].func;
- retVal___ = preHookFunc(md, &opt);
+ retVal___ = preHookFunc(&md, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73285,11 +75676,11 @@ int HP_status_calc_mercenary_(struct mercenary_data *md, enum e_status_calc_opt
{
retVal___ = HPMHooks.source.status.calc_mercenary_(md, opt);
}
- if( HPMHooks.count.HP_status_calc_mercenary__post ) {
- int (*postHookFunc) (int retVal___, struct mercenary_data *md, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mercenary__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_mercenary__post > 0) {
+ int (*postHookFunc) (int retVal___, struct mercenary_data *md, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mercenary__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_mercenary__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, md, &opt);
+ retVal___ = postHookFunc(retVal___, md, opt);
}
}
return retVal___;
@@ -73297,14 +75688,14 @@ int HP_status_calc_mercenary_(struct mercenary_data *md, enum e_status_calc_opt
int HP_status_calc_elemental_(struct elemental_data *ed, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_elemental__pre ) {
- int (*preHookFunc) (struct elemental_data *ed, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_elemental__pre > 0) {
+ int (*preHookFunc) (struct elemental_data **ed, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_elemental__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_elemental__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_elemental__pre[hIndex].func;
- retVal___ = preHookFunc(ed, &opt);
+ retVal___ = preHookFunc(&ed, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73312,25 +75703,25 @@ int HP_status_calc_elemental_(struct elemental_data *ed, enum e_status_calc_opt
{
retVal___ = HPMHooks.source.status.calc_elemental_(ed, opt);
}
- if( HPMHooks.count.HP_status_calc_elemental__post ) {
- int (*postHookFunc) (int retVal___, struct elemental_data *ed, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_elemental__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_elemental__post > 0) {
+ int (*postHookFunc) (int retVal___, struct elemental_data *ed, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_elemental__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_elemental__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ed, &opt);
+ retVal___ = postHookFunc(retVal___, ed, opt);
}
}
return retVal___;
}
void HP_status_calc_misc(struct block_list *bl, struct status_data *st, int level) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_calc_misc_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct status_data *st, int *level);
+ if (HPMHooks.count.HP_status_calc_misc_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct status_data **st, int *level);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_misc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_misc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_misc_pre[hIndex].func;
- preHookFunc(bl, st, &level);
+ preHookFunc(&bl, &st, &level);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73338,25 +75729,25 @@ void HP_status_calc_misc(struct block_list *bl, struct status_data *st, int leve
{
HPMHooks.source.status.calc_misc(bl, st, level);
}
- if( HPMHooks.count.HP_status_calc_misc_post ) {
- void (*postHookFunc) (struct block_list *bl, struct status_data *st, int *level);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_misc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_misc_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct status_data *st, int level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_misc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_misc_post[hIndex].func;
- postHookFunc(bl, st, &level);
+ postHookFunc(bl, st, level);
}
}
return;
}
void HP_status_calc_regen(struct block_list *bl, struct status_data *st, struct regen_data *regen) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_calc_regen_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct status_data *st, struct regen_data *regen);
+ if (HPMHooks.count.HP_status_calc_regen_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct status_data **st, struct regen_data **regen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_regen_pre[hIndex].func;
- preHookFunc(bl, st, regen);
+ preHookFunc(&bl, &st, &regen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73364,9 +75755,9 @@ void HP_status_calc_regen(struct block_list *bl, struct status_data *st, struct
{
HPMHooks.source.status.calc_regen(bl, st, regen);
}
- if( HPMHooks.count.HP_status_calc_regen_post ) {
+ if (HPMHooks.count.HP_status_calc_regen_post > 0) {
void (*postHookFunc) (struct block_list *bl, struct status_data *st, struct regen_data *regen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_regen_post[hIndex].func;
postHookFunc(bl, st, regen);
}
@@ -73375,14 +75766,14 @@ void HP_status_calc_regen(struct block_list *bl, struct status_data *st, struct
}
void HP_status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, struct status_change *sc) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_calc_regen_rate_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct regen_data *regen, struct status_change *sc);
+ if (HPMHooks.count.HP_status_calc_regen_rate_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct regen_data **regen, struct status_change **sc);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_rate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_rate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_regen_rate_pre[hIndex].func;
- preHookFunc(bl, regen, sc);
+ preHookFunc(&bl, &regen, &sc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73390,9 +75781,9 @@ void HP_status_calc_regen_rate(struct block_list *bl, struct regen_data *regen,
{
HPMHooks.source.status.calc_regen_rate(bl, regen, sc);
}
- if( HPMHooks.count.HP_status_calc_regen_rate_post ) {
+ if (HPMHooks.count.HP_status_calc_regen_rate_post > 0) {
void (*postHookFunc) (struct block_list *bl, struct regen_data *regen, struct status_change *sc);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_rate_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_regen_rate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_regen_rate_post[hIndex].func;
postHookFunc(bl, regen, sc);
}
@@ -73402,14 +75793,14 @@ void HP_status_calc_regen_rate(struct block_list *bl, struct regen_data *regen,
int HP_status_check_skilluse(struct block_list *src, struct block_list *target, uint16 skill_id, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_check_skilluse_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, uint16 *skill_id, int *flag);
+ if (HPMHooks.count.HP_status_check_skilluse_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, uint16 *skill_id, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_check_skilluse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_check_skilluse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_check_skilluse_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &skill_id, &flag);
+ retVal___ = preHookFunc(&src, &target, &skill_id, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73417,11 +75808,11 @@ int HP_status_check_skilluse(struct block_list *src, struct block_list *target,
{
retVal___ = HPMHooks.source.status.check_skilluse(src, target, skill_id, flag);
}
- if( HPMHooks.count.HP_status_check_skilluse_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 *skill_id, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_check_skilluse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_check_skilluse_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, uint16 skill_id, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_check_skilluse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_check_skilluse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &skill_id, &flag);
+ retVal___ = postHookFunc(retVal___, src, target, skill_id, flag);
}
}
return retVal___;
@@ -73429,14 +75820,14 @@ int HP_status_check_skilluse(struct block_list *src, struct block_list *target,
int HP_status_check_visibility(struct block_list *src, struct block_list *target) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_check_visibility_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target);
+ if (HPMHooks.count.HP_status_check_visibility_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_check_visibility_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_check_visibility_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_check_visibility_pre[hIndex].func;
- retVal___ = preHookFunc(src, target);
+ retVal___ = preHookFunc(&src, &target);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73444,9 +75835,9 @@ int HP_status_check_visibility(struct block_list *src, struct block_list *target
{
retVal___ = HPMHooks.source.status.check_visibility(src, target);
}
- if( HPMHooks.count.HP_status_check_visibility_post ) {
+ if (HPMHooks.count.HP_status_check_visibility_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_check_visibility_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_check_visibility_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_check_visibility_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, target);
}
@@ -73456,14 +75847,14 @@ int HP_status_check_visibility(struct block_list *src, struct block_list *target
int HP_status_change_spread(struct block_list *src, struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_change_spread_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *bl);
+ if (HPMHooks.count.HP_status_change_spread_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_spread_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_spread_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_spread_pre[hIndex].func;
- retVal___ = preHookFunc(src, bl);
+ retVal___ = preHookFunc(&src, &bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73471,9 +75862,9 @@ int HP_status_change_spread(struct block_list *src, struct block_list *bl) {
{
retVal___ = HPMHooks.source.status.change_spread(src, bl);
}
- if( HPMHooks.count.HP_status_change_spread_post ) {
+ if (HPMHooks.count.HP_status_change_spread_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_change_spread_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_spread_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_spread_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src, bl);
}
@@ -73483,14 +75874,14 @@ int HP_status_change_spread(struct block_list *src, struct block_list *bl) {
defType HP_status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool viewable) {
int hIndex = 0;
defType retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_def_pre ) {
- defType (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *def, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_def_pre > 0) {
+ defType (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *def, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_def_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &def, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &def, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73498,11 +75889,11 @@ defType HP_status_calc_def(struct block_list *bl, struct status_change *sc, int
{
retVal___ = HPMHooks.source.status.calc_def(bl, sc, def, viewable);
}
- if( HPMHooks.count.HP_status_calc_def_post ) {
- defType (*postHookFunc) (defType retVal___, struct block_list *bl, struct status_change *sc, int *def, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_def_post > 0) {
+ defType (*postHookFunc) (defType retVal___, struct block_list *bl, struct status_change *sc, int def, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_def_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &def, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, def, viewable);
}
}
return retVal___;
@@ -73510,14 +75901,14 @@ defType HP_status_calc_def(struct block_list *bl, struct status_change *sc, int
short HP_status_calc_def2(struct block_list *bl, struct status_change *sc, int def2, bool viewable) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_def2_pre ) {
- short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *def2, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_def2_pre > 0) {
+ short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *def2, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_def2_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &def2, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &def2, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73525,11 +75916,11 @@ short HP_status_calc_def2(struct block_list *bl, struct status_change *sc, int d
{
retVal___ = HPMHooks.source.status.calc_def2(bl, sc, def2, viewable);
}
- if( HPMHooks.count.HP_status_calc_def2_post ) {
- short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int *def2, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_def2_post > 0) {
+ short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int def2, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_def2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_def2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &def2, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, def2, viewable);
}
}
return retVal___;
@@ -73537,14 +75928,14 @@ short HP_status_calc_def2(struct block_list *bl, struct status_change *sc, int d
defType HP_status_calc_mdef(struct block_list *bl, struct status_change *sc, int mdef, bool viewable) {
int hIndex = 0;
defType retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_mdef_pre ) {
- defType (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *mdef, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_mdef_pre > 0) {
+ defType (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *mdef, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_mdef_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &mdef, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &mdef, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73552,11 +75943,11 @@ defType HP_status_calc_mdef(struct block_list *bl, struct status_change *sc, int
{
retVal___ = HPMHooks.source.status.calc_mdef(bl, sc, mdef, viewable);
}
- if( HPMHooks.count.HP_status_calc_mdef_post ) {
- defType (*postHookFunc) (defType retVal___, struct block_list *bl, struct status_change *sc, int *mdef, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_mdef_post > 0) {
+ defType (*postHookFunc) (defType retVal___, struct block_list *bl, struct status_change *sc, int mdef, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_mdef_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &mdef, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, mdef, viewable);
}
}
return retVal___;
@@ -73564,14 +75955,14 @@ defType HP_status_calc_mdef(struct block_list *bl, struct status_change *sc, int
short HP_status_calc_mdef2(struct block_list *bl, struct status_change *sc, int mdef2, bool viewable) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_mdef2_pre ) {
- short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *mdef2, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_mdef2_pre > 0) {
+ short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *mdef2, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_mdef2_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &mdef2, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &mdef2, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73579,11 +75970,11 @@ short HP_status_calc_mdef2(struct block_list *bl, struct status_change *sc, int
{
retVal___ = HPMHooks.source.status.calc_mdef2(bl, sc, mdef2, viewable);
}
- if( HPMHooks.count.HP_status_calc_mdef2_post ) {
- short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int *mdef2, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_mdef2_post > 0) {
+ short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int mdef2, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mdef2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_mdef2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &mdef2, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, mdef2, viewable);
}
}
return retVal___;
@@ -73591,14 +75982,14 @@ short HP_status_calc_mdef2(struct block_list *bl, struct status_change *sc, int
unsigned short HP_status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_batk_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *batk, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_batk_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *batk, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_batk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_batk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_batk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &batk, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &batk, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73606,11 +75997,11 @@ unsigned short HP_status_calc_batk(struct block_list *bl, struct status_change *
{
retVal___ = HPMHooks.source.status.calc_batk(bl, sc, batk, viewable);
}
- if( HPMHooks.count.HP_status_calc_batk_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *batk, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_batk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_batk_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int batk, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_batk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_batk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &batk, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, batk, viewable);
}
}
return retVal___;
@@ -73618,14 +76009,14 @@ unsigned short HP_status_calc_batk(struct block_list *bl, struct status_change *
unsigned short HP_status_base_matk(struct block_list *bl, const struct status_data *st, int level) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_base_matk_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, const struct status_data *st, int *level);
+ if (HPMHooks.count.HP_status_base_matk_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, const struct status_data **st, int *level);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_base_matk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, st, &level);
+ retVal___ = preHookFunc(&bl, &st, &level);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73633,11 +76024,11 @@ unsigned short HP_status_base_matk(struct block_list *bl, const struct status_da
{
retVal___ = HPMHooks.source.status.base_matk(bl, st, level);
}
- if( HPMHooks.count.HP_status_base_matk_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, const struct status_data *st, int *level);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_base_matk_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, const struct status_data *st, int level);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_base_matk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, st, &level);
+ retVal___ = postHookFunc(retVal___, bl, st, level);
}
}
return retVal___;
@@ -73645,14 +76036,14 @@ unsigned short HP_status_base_matk(struct block_list *bl, const struct status_da
int HP_status_get_weapon_atk(struct block_list *src, struct weapon_atk *watk, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_weapon_atk_pre ) {
- int (*preHookFunc) (struct block_list *src, struct weapon_atk *watk, int *flag);
+ if (HPMHooks.count.HP_status_get_weapon_atk_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct weapon_atk **watk, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_weapon_atk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_weapon_atk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_weapon_atk_pre[hIndex].func;
- retVal___ = preHookFunc(src, watk, &flag);
+ retVal___ = preHookFunc(&src, &watk, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73660,11 +76051,11 @@ int HP_status_get_weapon_atk(struct block_list *src, struct weapon_atk *watk, in
{
retVal___ = HPMHooks.source.status.get_weapon_atk(src, watk, flag);
}
- if( HPMHooks.count.HP_status_get_weapon_atk_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct weapon_atk *watk, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_weapon_atk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_weapon_atk_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct weapon_atk *watk, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_weapon_atk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_weapon_atk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, watk, &flag);
+ retVal___ = postHookFunc(retVal___, src, watk, flag);
}
}
return retVal___;
@@ -73672,14 +76063,14 @@ int HP_status_get_weapon_atk(struct block_list *src, struct weapon_atk *watk, in
int HP_status_get_total_mdef(struct block_list *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_total_mdef_pre ) {
- int (*preHookFunc) (struct block_list *src);
+ if (HPMHooks.count.HP_status_get_total_mdef_pre > 0) {
+ int (*preHookFunc) (struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_mdef_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_mdef_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_total_mdef_pre[hIndex].func;
- retVal___ = preHookFunc(src);
+ retVal___ = preHookFunc(&src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73687,9 +76078,9 @@ int HP_status_get_total_mdef(struct block_list *src) {
{
retVal___ = HPMHooks.source.status.get_total_mdef(src);
}
- if( HPMHooks.count.HP_status_get_total_mdef_post ) {
+ if (HPMHooks.count.HP_status_get_total_mdef_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_mdef_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_mdef_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_total_mdef_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src);
}
@@ -73699,14 +76090,14 @@ int HP_status_get_total_mdef(struct block_list *src) {
int HP_status_get_total_def(struct block_list *src) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_total_def_pre ) {
- int (*preHookFunc) (struct block_list *src);
+ if (HPMHooks.count.HP_status_get_total_def_pre > 0) {
+ int (*preHookFunc) (struct block_list **src);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_def_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_def_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_total_def_pre[hIndex].func;
- retVal___ = preHookFunc(src);
+ retVal___ = preHookFunc(&src);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73714,9 +76105,9 @@ int HP_status_get_total_def(struct block_list *src) {
{
retVal___ = HPMHooks.source.status.get_total_def(src);
}
- if( HPMHooks.count.HP_status_get_total_def_post ) {
+ if (HPMHooks.count.HP_status_get_total_def_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *src);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_def_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_total_def_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_total_def_post[hIndex].func;
retVal___ = postHookFunc(retVal___, src);
}
@@ -73726,14 +76117,14 @@ int HP_status_get_total_def(struct block_list *src) {
int HP_status_get_matk(struct block_list *src, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_matk_pre ) {
- int (*preHookFunc) (struct block_list *src, int *flag);
+ if (HPMHooks.count.HP_status_get_matk_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_matk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_matk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_matk_pre[hIndex].func;
- retVal___ = preHookFunc(src, &flag);
+ retVal___ = preHookFunc(&src, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73741,25 +76132,25 @@ int HP_status_get_matk(struct block_list *src, int flag) {
{
retVal___ = HPMHooks.source.status.get_matk(src, flag);
}
- if( HPMHooks.count.HP_status_get_matk_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_matk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_matk_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_matk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_matk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &flag);
+ retVal___ = postHookFunc(retVal___, src, flag);
}
}
return retVal___;
}
void HP_status_update_matk(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_update_matk_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_status_update_matk_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_update_matk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_update_matk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_update_matk_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73767,9 +76158,9 @@ void HP_status_update_matk(struct block_list *bl) {
{
HPMHooks.source.status.update_matk(bl);
}
- if( HPMHooks.count.HP_status_update_matk_post ) {
+ if (HPMHooks.count.HP_status_update_matk_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_update_matk_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_update_matk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_update_matk_post[hIndex].func;
postHookFunc(bl);
}
@@ -73779,14 +76170,14 @@ void HP_status_update_matk(struct block_list *bl) {
int HP_status_readdb(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_readdb_pre ) {
+ if (HPMHooks.count.HP_status_readdb_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_readdb_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73794,9 +76185,9 @@ int HP_status_readdb(void) {
{
retVal___ = HPMHooks.source.status.readdb();
}
- if( HPMHooks.count.HP_status_readdb_post ) {
+ if (HPMHooks.count.HP_status_readdb_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_readdb_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -73805,14 +76196,14 @@ int HP_status_readdb(void) {
}
void HP_status_initChangeTables(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_initChangeTables_pre ) {
+ if (HPMHooks.count.HP_status_initChangeTables_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_initChangeTables_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_initChangeTables_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_initChangeTables_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73820,9 +76211,9 @@ void HP_status_initChangeTables(void) {
{
HPMHooks.source.status.initChangeTables();
}
- if( HPMHooks.count.HP_status_initChangeTables_post ) {
+ if (HPMHooks.count.HP_status_initChangeTables_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_initChangeTables_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_initChangeTables_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_initChangeTables_post[hIndex].func;
postHookFunc();
}
@@ -73831,14 +76222,14 @@ void HP_status_initChangeTables(void) {
}
void HP_status_initDummyData(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_initDummyData_pre ) {
+ if (HPMHooks.count.HP_status_initDummyData_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_initDummyData_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_initDummyData_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_initDummyData_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -73846,9 +76237,9 @@ void HP_status_initDummyData(void) {
{
HPMHooks.source.status.initDummyData();
}
- if( HPMHooks.count.HP_status_initDummyData_post ) {
+ if (HPMHooks.count.HP_status_initDummyData_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_initDummyData_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_initDummyData_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_initDummyData_post[hIndex].func;
postHookFunc();
}
@@ -73858,14 +76249,14 @@ void HP_status_initDummyData(void) {
int HP_status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_base_amotion_pc_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct status_data *st);
+ if (HPMHooks.count.HP_status_base_amotion_pc_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct status_data **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_amotion_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_amotion_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_base_amotion_pc_pre[hIndex].func;
- retVal___ = preHookFunc(sd, st);
+ retVal___ = preHookFunc(&sd, &st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73873,9 +76264,9 @@ int HP_status_base_amotion_pc(struct map_session_data *sd, struct status_data *s
{
retVal___ = HPMHooks.source.status.base_amotion_pc(sd, st);
}
- if( HPMHooks.count.HP_status_base_amotion_pc_post ) {
+ if (HPMHooks.count.HP_status_base_amotion_pc_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct status_data *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_amotion_pc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_amotion_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_base_amotion_pc_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, st);
}
@@ -73885,14 +76276,14 @@ int HP_status_base_amotion_pc(struct map_session_data *sd, struct status_data *s
unsigned short HP_status_base_atk(const struct block_list *bl, const struct status_data *st) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_base_atk_pre ) {
- unsigned short (*preHookFunc) (const struct block_list *bl, const struct status_data *st);
+ if (HPMHooks.count.HP_status_base_atk_pre > 0) {
+ unsigned short (*preHookFunc) (const struct block_list **bl, const struct status_data **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_atk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_atk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_base_atk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, st);
+ retVal___ = preHookFunc(&bl, &st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73900,26 +76291,26 @@ unsigned short HP_status_base_atk(const struct block_list *bl, const struct stat
{
retVal___ = HPMHooks.source.status.base_atk(bl, st);
}
- if( HPMHooks.count.HP_status_base_atk_post ) {
+ if (HPMHooks.count.HP_status_base_atk_post > 0) {
unsigned short (*postHookFunc) (unsigned short retVal___, const struct block_list *bl, const struct status_data *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_base_atk_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_atk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_base_atk_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, st);
}
}
return retVal___;
}
-unsigned int HP_status_get_base_maxhp(struct map_session_data *sd, struct status_data *st) {
+unsigned int HP_status_get_base_maxhp(const struct map_session_data *sd, const struct status_data *st) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_base_maxhp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd, struct status_data *st);
+ if (HPMHooks.count.HP_status_get_base_maxhp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd, const struct status_data **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxhp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxhp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_base_maxhp_pre[hIndex].func;
- retVal___ = preHookFunc(sd, st);
+ retVal___ = preHookFunc(&sd, &st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73927,26 +76318,26 @@ unsigned int HP_status_get_base_maxhp(struct map_session_data *sd, struct status
{
retVal___ = HPMHooks.source.status.get_base_maxhp(sd, st);
}
- if( HPMHooks.count.HP_status_get_base_maxhp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, struct status_data *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxhp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_base_maxhp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxhp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_base_maxhp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, st);
}
}
return retVal___;
}
-unsigned int HP_status_get_base_maxsp(struct map_session_data *sd, struct status_data *st) {
+unsigned int HP_status_get_base_maxsp(const struct map_session_data *sd, const struct status_data *st) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_status_get_base_maxsp_pre ) {
- unsigned int (*preHookFunc) (struct map_session_data *sd, struct status_data *st);
+ if (HPMHooks.count.HP_status_get_base_maxsp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd, const struct status_data **st);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxsp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxsp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_get_base_maxsp_pre[hIndex].func;
- retVal___ = preHookFunc(sd, st);
+ retVal___ = preHookFunc(&sd, &st);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73954,9 +76345,9 @@ unsigned int HP_status_get_base_maxsp(struct map_session_data *sd, struct status
{
retVal___ = HPMHooks.source.status.get_base_maxsp(sd, st);
}
- if( HPMHooks.count.HP_status_get_base_maxsp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct map_session_data *sd, struct status_data *st);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxsp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_get_base_maxsp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_base_maxsp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_get_base_maxsp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, st);
}
@@ -73966,14 +76357,14 @@ unsigned int HP_status_get_base_maxsp(struct map_session_data *sd, struct status
int HP_status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_npc__pre ) {
- int (*preHookFunc) (struct npc_data *nd, enum e_status_calc_opt *opt);
+ if (HPMHooks.count.HP_status_calc_npc__pre > 0) {
+ int (*preHookFunc) (struct npc_data **nd, enum e_status_calc_opt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_npc__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_npc__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_npc__pre[hIndex].func;
- retVal___ = preHookFunc(nd, &opt);
+ retVal___ = preHookFunc(&nd, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -73981,11 +76372,11 @@ int HP_status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
{
retVal___ = HPMHooks.source.status.calc_npc_(nd, opt);
}
- if( HPMHooks.count.HP_status_calc_npc__post ) {
- int (*postHookFunc) (int retVal___, struct npc_data *nd, enum e_status_calc_opt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_npc__post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_npc__post > 0) {
+ int (*postHookFunc) (int retVal___, struct npc_data *nd, enum e_status_calc_opt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_npc__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_npc__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, nd, &opt);
+ retVal___ = postHookFunc(retVal___, nd, opt);
}
}
return retVal___;
@@ -73993,14 +76384,14 @@ int HP_status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
unsigned short HP_status_calc_str(struct block_list *bl, struct status_change *sc, int str) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_str_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *str);
+ if (HPMHooks.count.HP_status_calc_str_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_str_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_str_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_str_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &str);
+ retVal___ = preHookFunc(&bl, &sc, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74008,11 +76399,11 @@ unsigned short HP_status_calc_str(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_str(bl, sc, str);
}
- if( HPMHooks.count.HP_status_calc_str_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_str_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_str_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int str);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_str_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_str_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &str);
+ retVal___ = postHookFunc(retVal___, bl, sc, str);
}
}
return retVal___;
@@ -74020,14 +76411,14 @@ unsigned short HP_status_calc_str(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_agi(struct block_list *bl, struct status_change *sc, int agi) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_agi_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *agi);
+ if (HPMHooks.count.HP_status_calc_agi_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *agi);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_agi_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_agi_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_agi_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &agi);
+ retVal___ = preHookFunc(&bl, &sc, &agi);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74035,11 +76426,11 @@ unsigned short HP_status_calc_agi(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_agi(bl, sc, agi);
}
- if( HPMHooks.count.HP_status_calc_agi_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *agi);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_agi_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_agi_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int agi);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_agi_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_agi_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &agi);
+ retVal___ = postHookFunc(retVal___, bl, sc, agi);
}
}
return retVal___;
@@ -74047,14 +76438,14 @@ unsigned short HP_status_calc_agi(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_vit(struct block_list *bl, struct status_change *sc, int vit) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_vit_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *vit);
+ if (HPMHooks.count.HP_status_calc_vit_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *vit);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_vit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_vit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_vit_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &vit);
+ retVal___ = preHookFunc(&bl, &sc, &vit);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74062,11 +76453,11 @@ unsigned short HP_status_calc_vit(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_vit(bl, sc, vit);
}
- if( HPMHooks.count.HP_status_calc_vit_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *vit);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_vit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_vit_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int vit);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_vit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_vit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &vit);
+ retVal___ = postHookFunc(retVal___, bl, sc, vit);
}
}
return retVal___;
@@ -74074,14 +76465,14 @@ unsigned short HP_status_calc_vit(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_int(struct block_list *bl, struct status_change *sc, int int_) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_int_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *int_);
+ if (HPMHooks.count.HP_status_calc_int_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *int_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_int_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_int_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_int_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &int_);
+ retVal___ = preHookFunc(&bl, &sc, &int_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74089,11 +76480,11 @@ unsigned short HP_status_calc_int(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_int(bl, sc, int_);
}
- if( HPMHooks.count.HP_status_calc_int_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *int_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_int_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_int_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int int_);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_int_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_int_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &int_);
+ retVal___ = postHookFunc(retVal___, bl, sc, int_);
}
}
return retVal___;
@@ -74101,14 +76492,14 @@ unsigned short HP_status_calc_int(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_dex(struct block_list *bl, struct status_change *sc, int dex) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_dex_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *dex);
+ if (HPMHooks.count.HP_status_calc_dex_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *dex);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dex_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dex_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_dex_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &dex);
+ retVal___ = preHookFunc(&bl, &sc, &dex);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74116,11 +76507,11 @@ unsigned short HP_status_calc_dex(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_dex(bl, sc, dex);
}
- if( HPMHooks.count.HP_status_calc_dex_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *dex);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dex_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_dex_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int dex);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dex_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_dex_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &dex);
+ retVal___ = postHookFunc(retVal___, bl, sc, dex);
}
}
return retVal___;
@@ -74128,14 +76519,14 @@ unsigned short HP_status_calc_dex(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_luk(struct block_list *bl, struct status_change *sc, int luk) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_luk_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *luk);
+ if (HPMHooks.count.HP_status_calc_luk_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *luk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_luk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_luk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_luk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &luk);
+ retVal___ = preHookFunc(&bl, &sc, &luk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74143,11 +76534,11 @@ unsigned short HP_status_calc_luk(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_luk(bl, sc, luk);
}
- if( HPMHooks.count.HP_status_calc_luk_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *luk);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_luk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_luk_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int luk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_luk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_luk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &luk);
+ retVal___ = postHookFunc(retVal___, bl, sc, luk);
}
}
return retVal___;
@@ -74155,14 +76546,14 @@ unsigned short HP_status_calc_luk(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_watk_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *watk, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_watk_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *watk, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_watk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_watk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_watk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &watk, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &watk, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74170,11 +76561,11 @@ unsigned short HP_status_calc_watk(struct block_list *bl, struct status_change *
{
retVal___ = HPMHooks.source.status.calc_watk(bl, sc, watk, viewable);
}
- if( HPMHooks.count.HP_status_calc_watk_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *watk, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_watk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_watk_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int watk, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_watk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_watk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &watk, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, watk, viewable);
}
}
return retVal___;
@@ -74182,14 +76573,14 @@ unsigned short HP_status_calc_watk(struct block_list *bl, struct status_change *
unsigned short HP_status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_matk_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *matk, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_matk_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *matk, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_matk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_matk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_matk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &matk, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &matk, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74197,11 +76588,11 @@ unsigned short HP_status_calc_matk(struct block_list *bl, struct status_change *
{
retVal___ = HPMHooks.source.status.calc_matk(bl, sc, matk, viewable);
}
- if( HPMHooks.count.HP_status_calc_matk_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *matk, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_matk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_matk_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int matk, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_matk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_matk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &matk, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, matk, viewable);
}
}
return retVal___;
@@ -74209,14 +76600,14 @@ unsigned short HP_status_calc_matk(struct block_list *bl, struct status_change *
signed short HP_status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable) {
int hIndex = 0;
signed short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_hit_pre ) {
- signed short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *hit, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_hit_pre > 0) {
+ signed short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *hit, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_hit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_hit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_hit_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &hit, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &hit, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74224,11 +76615,11 @@ signed short HP_status_calc_hit(struct block_list *bl, struct status_change *sc,
{
retVal___ = HPMHooks.source.status.calc_hit(bl, sc, hit, viewable);
}
- if( HPMHooks.count.HP_status_calc_hit_post ) {
- signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int *hit, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_hit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_hit_post > 0) {
+ signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int hit, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_hit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_hit_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &hit, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, hit, viewable);
}
}
return retVal___;
@@ -74236,14 +76627,14 @@ signed short HP_status_calc_hit(struct block_list *bl, struct status_change *sc,
signed short HP_status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) {
int hIndex = 0;
signed short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_critical_pre ) {
- signed short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *critical, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_critical_pre > 0) {
+ signed short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *critical, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_critical_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_critical_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_critical_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &critical, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &critical, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74251,11 +76642,11 @@ signed short HP_status_calc_critical(struct block_list *bl, struct status_change
{
retVal___ = HPMHooks.source.status.calc_critical(bl, sc, critical, viewable);
}
- if( HPMHooks.count.HP_status_calc_critical_post ) {
- signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int *critical, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_critical_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_critical_post > 0) {
+ signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int critical, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_critical_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_critical_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &critical, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, critical, viewable);
}
}
return retVal___;
@@ -74263,14 +76654,14 @@ signed short HP_status_calc_critical(struct block_list *bl, struct status_change
signed short HP_status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) {
int hIndex = 0;
signed short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_flee_pre ) {
- signed short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *flee, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_flee_pre > 0) {
+ signed short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *flee, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_flee_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &flee, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &flee, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74278,11 +76669,11 @@ signed short HP_status_calc_flee(struct block_list *bl, struct status_change *sc
{
retVal___ = HPMHooks.source.status.calc_flee(bl, sc, flee, viewable);
}
- if( HPMHooks.count.HP_status_calc_flee_post ) {
- signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int *flee, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_flee_post > 0) {
+ signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int flee, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_flee_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &flee, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, flee, viewable);
}
}
return retVal___;
@@ -74290,14 +76681,14 @@ signed short HP_status_calc_flee(struct block_list *bl, struct status_change *sc
signed short HP_status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable) {
int hIndex = 0;
signed short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_flee2_pre ) {
- signed short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *flee2, bool *viewable);
+ if (HPMHooks.count.HP_status_calc_flee2_pre > 0) {
+ signed short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *flee2, bool *viewable);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_flee2_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &flee2, &viewable);
+ retVal___ = preHookFunc(&bl, &sc, &flee2, &viewable);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74305,11 +76696,11 @@ signed short HP_status_calc_flee2(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_flee2(bl, sc, flee2, viewable);
}
- if( HPMHooks.count.HP_status_calc_flee2_post ) {
- signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int *flee2, bool *viewable);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_flee2_post > 0) {
+ signed short (*postHookFunc) (signed short retVal___, struct block_list *bl, struct status_change *sc, int flee2, bool viewable);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_flee2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_flee2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &flee2, &viewable);
+ retVal___ = postHookFunc(retVal___, bl, sc, flee2, viewable);
}
}
return retVal___;
@@ -74317,14 +76708,14 @@ signed short HP_status_calc_flee2(struct block_list *bl, struct status_change *s
unsigned short HP_status_calc_speed(struct block_list *bl, struct status_change *sc, int speed) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_speed_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *speed);
+ if (HPMHooks.count.HP_status_calc_speed_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *speed);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_speed_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_speed_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_speed_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &speed);
+ retVal___ = preHookFunc(&bl, &sc, &speed);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74332,11 +76723,11 @@ unsigned short HP_status_calc_speed(struct block_list *bl, struct status_change
{
retVal___ = HPMHooks.source.status.calc_speed(bl, sc, speed);
}
- if( HPMHooks.count.HP_status_calc_speed_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *speed);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_speed_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_speed_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int speed);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_speed_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_speed_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &speed);
+ retVal___ = postHookFunc(retVal___, bl, sc, speed);
}
}
return retVal___;
@@ -74344,14 +76735,14 @@ unsigned short HP_status_calc_speed(struct block_list *bl, struct status_change
short HP_status_calc_aspd_rate(struct block_list *bl, struct status_change *sc, int aspd_rate) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_aspd_rate_pre ) {
- short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *aspd_rate);
+ if (HPMHooks.count.HP_status_calc_aspd_rate_pre > 0) {
+ short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *aspd_rate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_rate_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_rate_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_aspd_rate_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &aspd_rate);
+ retVal___ = preHookFunc(&bl, &sc, &aspd_rate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74359,11 +76750,11 @@ short HP_status_calc_aspd_rate(struct block_list *bl, struct status_change *sc,
{
retVal___ = HPMHooks.source.status.calc_aspd_rate(bl, sc, aspd_rate);
}
- if( HPMHooks.count.HP_status_calc_aspd_rate_post ) {
- short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int *aspd_rate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_rate_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_aspd_rate_post > 0) {
+ short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int aspd_rate);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_rate_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_aspd_rate_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &aspd_rate);
+ retVal___ = postHookFunc(retVal___, bl, sc, aspd_rate);
}
}
return retVal___;
@@ -74371,14 +76762,14 @@ short HP_status_calc_aspd_rate(struct block_list *bl, struct status_change *sc,
unsigned short HP_status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_dmotion_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *dmotion);
+ if (HPMHooks.count.HP_status_calc_dmotion_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *dmotion);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dmotion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dmotion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_dmotion_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &dmotion);
+ retVal___ = preHookFunc(&bl, &sc, &dmotion);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74386,11 +76777,11 @@ unsigned short HP_status_calc_dmotion(struct block_list *bl, struct status_chang
{
retVal___ = HPMHooks.source.status.calc_dmotion(bl, sc, dmotion);
}
- if( HPMHooks.count.HP_status_calc_dmotion_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *dmotion);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dmotion_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_dmotion_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int dmotion);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_dmotion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_dmotion_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &dmotion);
+ retVal___ = postHookFunc(retVal___, bl, sc, dmotion);
}
}
return retVal___;
@@ -74398,14 +76789,14 @@ unsigned short HP_status_calc_dmotion(struct block_list *bl, struct status_chang
short HP_status_calc_aspd(struct block_list *bl, struct status_change *sc, short flag) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_aspd_pre ) {
- short (*preHookFunc) (struct block_list *bl, struct status_change *sc, short *flag);
+ if (HPMHooks.count.HP_status_calc_aspd_pre > 0) {
+ short (*preHookFunc) (struct block_list **bl, struct status_change **sc, short *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_aspd_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &flag);
+ retVal___ = preHookFunc(&bl, &sc, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74413,11 +76804,11 @@ short HP_status_calc_aspd(struct block_list *bl, struct status_change *sc, short
{
retVal___ = HPMHooks.source.status.calc_aspd(bl, sc, flag);
}
- if( HPMHooks.count.HP_status_calc_aspd_post ) {
- short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, short *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_aspd_post > 0) {
+ short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, short flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_aspd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_aspd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &flag);
+ retVal___ = postHookFunc(retVal___, bl, sc, flag);
}
}
return retVal___;
@@ -74425,14 +76816,14 @@ short HP_status_calc_aspd(struct block_list *bl, struct status_change *sc, short
short HP_status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int aspd) {
int hIndex = 0;
short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_fix_aspd_pre ) {
- short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *aspd);
+ if (HPMHooks.count.HP_status_calc_fix_aspd_pre > 0) {
+ short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *aspd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_fix_aspd_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_fix_aspd_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_fix_aspd_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &aspd);
+ retVal___ = preHookFunc(&bl, &sc, &aspd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74440,11 +76831,11 @@ short HP_status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, i
{
retVal___ = HPMHooks.source.status.calc_fix_aspd(bl, sc, aspd);
}
- if( HPMHooks.count.HP_status_calc_fix_aspd_post ) {
- short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int *aspd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_fix_aspd_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_fix_aspd_post > 0) {
+ short (*postHookFunc) (short retVal___, struct block_list *bl, struct status_change *sc, int aspd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_fix_aspd_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_fix_aspd_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &aspd);
+ retVal___ = postHookFunc(retVal___, bl, sc, aspd);
}
}
return retVal___;
@@ -74452,14 +76843,14 @@ short HP_status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, i
unsigned int HP_status_calc_maxhp(struct block_list *bl, struct status_change *sc, uint64 maxhp) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_maxhp_pre ) {
- unsigned int (*preHookFunc) (struct block_list *bl, struct status_change *sc, uint64 *maxhp);
+ if (HPMHooks.count.HP_status_calc_maxhp_pre > 0) {
+ unsigned int (*preHookFunc) (struct block_list **bl, struct status_change **sc, uint64 *maxhp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxhp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxhp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_maxhp_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &maxhp);
+ retVal___ = preHookFunc(&bl, &sc, &maxhp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74467,11 +76858,11 @@ unsigned int HP_status_calc_maxhp(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_maxhp(bl, sc, maxhp);
}
- if( HPMHooks.count.HP_status_calc_maxhp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct block_list *bl, struct status_change *sc, uint64 *maxhp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxhp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_maxhp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct block_list *bl, struct status_change *sc, uint64 maxhp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxhp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_maxhp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &maxhp);
+ retVal___ = postHookFunc(retVal___, bl, sc, maxhp);
}
}
return retVal___;
@@ -74479,14 +76870,14 @@ unsigned int HP_status_calc_maxhp(struct block_list *bl, struct status_change *s
unsigned int HP_status_calc_maxsp(struct block_list *bl, struct status_change *sc, unsigned int maxsp) {
int hIndex = 0;
unsigned int retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_maxsp_pre ) {
- unsigned int (*preHookFunc) (struct block_list *bl, struct status_change *sc, unsigned int *maxsp);
+ if (HPMHooks.count.HP_status_calc_maxsp_pre > 0) {
+ unsigned int (*preHookFunc) (struct block_list **bl, struct status_change **sc, unsigned int *maxsp);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxsp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxsp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_maxsp_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &maxsp);
+ retVal___ = preHookFunc(&bl, &sc, &maxsp);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74494,11 +76885,11 @@ unsigned int HP_status_calc_maxsp(struct block_list *bl, struct status_change *s
{
retVal___ = HPMHooks.source.status.calc_maxsp(bl, sc, maxsp);
}
- if( HPMHooks.count.HP_status_calc_maxsp_post ) {
- unsigned int (*postHookFunc) (unsigned int retVal___, struct block_list *bl, struct status_change *sc, unsigned int *maxsp);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxsp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_maxsp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, struct block_list *bl, struct status_change *sc, unsigned int maxsp);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_maxsp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_maxsp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &maxsp);
+ retVal___ = postHookFunc(retVal___, bl, sc, maxsp);
}
}
return retVal___;
@@ -74506,14 +76897,14 @@ unsigned int HP_status_calc_maxsp(struct block_list *bl, struct status_change *s
unsigned char HP_status_calc_element(struct block_list *bl, struct status_change *sc, int element) {
int hIndex = 0;
unsigned char retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_element_pre ) {
- unsigned char (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *element);
+ if (HPMHooks.count.HP_status_calc_element_pre > 0) {
+ unsigned char (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *element);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_element_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &element);
+ retVal___ = preHookFunc(&bl, &sc, &element);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74521,11 +76912,11 @@ unsigned char HP_status_calc_element(struct block_list *bl, struct status_change
{
retVal___ = HPMHooks.source.status.calc_element(bl, sc, element);
}
- if( HPMHooks.count.HP_status_calc_element_post ) {
- unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int *element);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_element_post > 0) {
+ unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int element);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_element_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &element);
+ retVal___ = postHookFunc(retVal___, bl, sc, element);
}
}
return retVal___;
@@ -74533,14 +76924,14 @@ unsigned char HP_status_calc_element(struct block_list *bl, struct status_change
unsigned char HP_status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv) {
int hIndex = 0;
unsigned char retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_element_lv_pre ) {
- unsigned char (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *lv);
+ if (HPMHooks.count.HP_status_calc_element_lv_pre > 0) {
+ unsigned char (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_lv_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_lv_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_element_lv_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &lv);
+ retVal___ = preHookFunc(&bl, &sc, &lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74548,26 +76939,26 @@ unsigned char HP_status_calc_element_lv(struct block_list *bl, struct status_cha
{
retVal___ = HPMHooks.source.status.calc_element_lv(bl, sc, lv);
}
- if( HPMHooks.count.HP_status_calc_element_lv_post ) {
- unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int *lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_lv_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_element_lv_post > 0) {
+ unsigned char (*postHookFunc) (unsigned char retVal___, struct block_list *bl, struct status_change *sc, int lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_element_lv_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_element_lv_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &lv);
+ retVal___ = postHookFunc(retVal___, bl, sc, lv);
}
}
return retVal___;
}
-unsigned short HP_status_calc_mode(struct block_list *bl, struct status_change *sc, int mode) {
+uint32 HP_status_calc_mode(const struct block_list *bl, const struct status_change *sc, uint32 mode) {
int hIndex = 0;
- unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_mode_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *mode);
+ uint32 retVal___ = 0;
+ if (HPMHooks.count.HP_status_calc_mode_pre > 0) {
+ uint32 (*preHookFunc) (const struct block_list **bl, const struct status_change **sc, uint32 *mode);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mode_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mode_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_mode_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &mode);
+ retVal___ = preHookFunc(&bl, &sc, &mode);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74575,11 +76966,11 @@ unsigned short HP_status_calc_mode(struct block_list *bl, struct status_change *
{
retVal___ = HPMHooks.source.status.calc_mode(bl, sc, mode);
}
- if( HPMHooks.count.HP_status_calc_mode_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *mode);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mode_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_mode_post > 0) {
+ uint32 (*postHookFunc) (uint32 retVal___, const struct block_list *bl, const struct status_change *sc, uint32 mode);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_mode_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_mode_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &mode);
+ retVal___ = postHookFunc(retVal___, bl, sc, mode);
}
}
return retVal___;
@@ -74587,14 +76978,14 @@ unsigned short HP_status_calc_mode(struct block_list *bl, struct status_change *
unsigned short HP_status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) {
int hIndex = 0;
unsigned short retVal___ = 0;
- if( HPMHooks.count.HP_status_calc_ematk_pre ) {
- unsigned short (*preHookFunc) (struct block_list *bl, struct status_change *sc, int *matk);
+ if (HPMHooks.count.HP_status_calc_ematk_pre > 0) {
+ unsigned short (*preHookFunc) (struct block_list **bl, struct status_change **sc, int *matk);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_ematk_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_ematk_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_ematk_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sc, &matk);
+ retVal___ = preHookFunc(&bl, &sc, &matk);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74602,25 +76993,25 @@ unsigned short HP_status_calc_ematk(struct block_list *bl, struct status_change
{
retVal___ = HPMHooks.source.status.calc_ematk(bl, sc, matk);
}
- if( HPMHooks.count.HP_status_calc_ematk_post ) {
- unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int *matk);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_ematk_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_ematk_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, struct block_list *bl, struct status_change *sc, int matk);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_ematk_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_ematk_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sc, &matk);
+ retVal___ = postHookFunc(retVal___, bl, sc, matk);
}
}
return retVal___;
}
void HP_status_calc_bl_main(struct block_list *bl, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_calc_bl_main_pre ) {
- void (*preHookFunc) (struct block_list *bl, int *flag);
+ if (HPMHooks.count.HP_status_calc_bl_main_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl_main_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl_main_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_calc_bl_main_pre[hIndex].func;
- preHookFunc(bl, &flag);
+ preHookFunc(&bl, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -74628,25 +77019,25 @@ void HP_status_calc_bl_main(struct block_list *bl, int flag) {
{
HPMHooks.source.status.calc_bl_main(bl, flag);
}
- if( HPMHooks.count.HP_status_calc_bl_main_post ) {
- void (*postHookFunc) (struct block_list *bl, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl_main_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_calc_bl_main_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_calc_bl_main_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_calc_bl_main_post[hIndex].func;
- postHookFunc(bl, &flag);
+ postHookFunc(bl, flag);
}
}
return;
}
void HP_status_display_add(struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_display_add_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum sc_type *type, int *dval1, int *dval2, int *dval3);
+ if (HPMHooks.count.HP_status_display_add_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum sc_type *type, int *dval1, int *dval2, int *dval3);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_display_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_display_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_display_add_pre[hIndex].func;
- preHookFunc(sd, &type, &dval1, &dval2, &dval3);
+ preHookFunc(&sd, &type, &dval1, &dval2, &dval3);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -74654,25 +77045,25 @@ void HP_status_display_add(struct map_session_data *sd, enum sc_type type, int d
{
HPMHooks.source.status.display_add(sd, type, dval1, dval2, dval3);
}
- if( HPMHooks.count.HP_status_display_add_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum sc_type *type, int *dval1, int *dval2, int *dval3);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_display_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_display_add_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_display_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_display_add_post[hIndex].func;
- postHookFunc(sd, &type, &dval1, &dval2, &dval3);
+ postHookFunc(sd, type, dval1, dval2, dval3);
}
}
return;
}
void HP_status_display_remove(struct map_session_data *sd, enum sc_type type) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_display_remove_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, enum sc_type *type);
+ if (HPMHooks.count.HP_status_display_remove_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, enum sc_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_display_remove_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_display_remove_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_display_remove_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -74680,11 +77071,11 @@ void HP_status_display_remove(struct map_session_data *sd, enum sc_type type) {
{
HPMHooks.source.status.display_remove(sd, type);
}
- if( HPMHooks.count.HP_status_display_remove_post ) {
- void (*postHookFunc) (struct map_session_data *sd, enum sc_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_display_remove_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_display_remove_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, enum sc_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_display_remove_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_display_remove_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
@@ -74692,16 +77083,16 @@ void HP_status_display_remove(struct map_session_data *sd, enum sc_type type) {
int HP_status_natural_heal(struct block_list *bl, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_natural_heal_pre ) {
- int (*preHookFunc) (struct block_list *bl, va_list args);
+ if (HPMHooks.count.HP_status_natural_heal_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_status_natural_heal_pre[hIndex].func;
- retVal___ = preHookFunc(bl, args___copy);
+ retVal___ = preHookFunc(&bl, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74711,9 +77102,9 @@ int HP_status_natural_heal(struct block_list *bl, va_list args) {
retVal___ = HPMHooks.source.status.natural_heal(bl, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_status_natural_heal_post ) {
+ if (HPMHooks.count.HP_status_natural_heal_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_status_natural_heal_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, args___copy);
@@ -74725,14 +77116,14 @@ int HP_status_natural_heal(struct block_list *bl, va_list args) {
int HP_status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_natural_heal_timer_pre ) {
+ if (HPMHooks.count.HP_status_natural_heal_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_natural_heal_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74740,11 +77131,11 @@ int HP_status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.status.natural_heal_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_status_natural_heal_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_natural_heal_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_natural_heal_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_natural_heal_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -74752,14 +77143,14 @@ int HP_status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) {
bool HP_status_readdb_job2(char *fields[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_status_readdb_job2_pre ) {
- bool (*preHookFunc) (char *fields[], int *columns, int *current);
+ if (HPMHooks.count.HP_status_readdb_job2_pre > 0) {
+ bool (*preHookFunc) (char **fields[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_job2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_job2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_readdb_job2_pre[hIndex].func;
- retVal___ = preHookFunc(fields, &columns, &current);
+ retVal___ = preHookFunc(&fields, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74767,11 +77158,11 @@ bool HP_status_readdb_job2(char *fields[], int columns, int current) {
{
retVal___ = HPMHooks.source.status.readdb_job2(fields, columns, current);
}
- if( HPMHooks.count.HP_status_readdb_job2_post ) {
- bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_job2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_readdb_job2_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *fields[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_job2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_readdb_job2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fields, &columns, &current);
+ retVal___ = postHookFunc(retVal___, fields, columns, current);
}
}
return retVal___;
@@ -74779,14 +77170,14 @@ bool HP_status_readdb_job2(char *fields[], int columns, int current) {
bool HP_status_readdb_sizefix(char *fields[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_status_readdb_sizefix_pre ) {
- bool (*preHookFunc) (char *fields[], int *columns, int *current);
+ if (HPMHooks.count.HP_status_readdb_sizefix_pre > 0) {
+ bool (*preHookFunc) (char **fields[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_sizefix_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_sizefix_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_readdb_sizefix_pre[hIndex].func;
- retVal___ = preHookFunc(fields, &columns, &current);
+ retVal___ = preHookFunc(&fields, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74794,11 +77185,11 @@ bool HP_status_readdb_sizefix(char *fields[], int columns, int current) {
{
retVal___ = HPMHooks.source.status.readdb_sizefix(fields, columns, current);
}
- if( HPMHooks.count.HP_status_readdb_sizefix_post ) {
- bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_sizefix_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_readdb_sizefix_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *fields[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_sizefix_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_readdb_sizefix_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fields, &columns, &current);
+ retVal___ = postHookFunc(retVal___, fields, columns, current);
}
}
return retVal___;
@@ -74806,14 +77197,14 @@ bool HP_status_readdb_sizefix(char *fields[], int columns, int current) {
int HP_status_readdb_refine_libconfig(const char *filename) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_readdb_refine_libconfig_pre ) {
- int (*preHookFunc) (const char *filename);
+ if (HPMHooks.count.HP_status_readdb_refine_libconfig_pre > 0) {
+ int (*preHookFunc) (const char **filename);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_pre[hIndex].func;
- retVal___ = preHookFunc(filename);
+ retVal___ = preHookFunc(&filename);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74821,26 +77212,26 @@ int HP_status_readdb_refine_libconfig(const char *filename) {
{
retVal___ = HPMHooks.source.status.readdb_refine_libconfig(filename);
}
- if( HPMHooks.count.HP_status_readdb_refine_libconfig_post ) {
+ if (HPMHooks.count.HP_status_readdb_refine_libconfig_post > 0) {
int (*postHookFunc) (int retVal___, const char *filename);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_post[hIndex].func;
retVal___ = postHookFunc(retVal___, filename);
}
}
return retVal___;
}
-int HP_status_readdb_refine_libconfig_sub(config_setting_t *r, const char *name, const char *source) {
+int HP_status_readdb_refine_libconfig_sub(struct config_setting_t *r, const char *name, const char *source) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_status_readdb_refine_libconfig_sub_pre ) {
- int (*preHookFunc) (config_setting_t *r, const char *name, const char *source);
+ if (HPMHooks.count.HP_status_readdb_refine_libconfig_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **r, const char **name, const char **source);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_sub_pre[hIndex].func;
- retVal___ = preHookFunc(r, name, source);
+ retVal___ = preHookFunc(&r, &name, &source);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74848,9 +77239,9 @@ int HP_status_readdb_refine_libconfig_sub(config_setting_t *r, const char *name,
{
retVal___ = HPMHooks.source.status.readdb_refine_libconfig_sub(r, name, source);
}
- if( HPMHooks.count.HP_status_readdb_refine_libconfig_sub_post ) {
- int (*postHookFunc) (int retVal___, config_setting_t *r, const char *name, const char *source);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_readdb_refine_libconfig_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *r, const char *name, const char *source);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, r, name, source);
}
@@ -74860,14 +77251,14 @@ int HP_status_readdb_refine_libconfig_sub(config_setting_t *r, const char *name,
bool HP_status_readdb_scconfig(char *fields[], int columns, int current) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_status_readdb_scconfig_pre ) {
- bool (*preHookFunc) (char *fields[], int *columns, int *current);
+ if (HPMHooks.count.HP_status_readdb_scconfig_pre > 0) {
+ bool (*preHookFunc) (char **fields[], int *columns, int *current);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_scconfig_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_scconfig_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_readdb_scconfig_pre[hIndex].func;
- retVal___ = preHookFunc(fields, &columns, &current);
+ retVal___ = preHookFunc(&fields, &columns, &current);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74875,25 +77266,25 @@ bool HP_status_readdb_scconfig(char *fields[], int columns, int current) {
{
retVal___ = HPMHooks.source.status.readdb_scconfig(fields, columns, current);
}
- if( HPMHooks.count.HP_status_readdb_scconfig_post ) {
- bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_scconfig_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_readdb_scconfig_post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *fields[], int columns, int current);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_scconfig_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_readdb_scconfig_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, fields, &columns, &current);
+ retVal___ = postHookFunc(retVal___, fields, columns, current);
}
}
return retVal___;
}
void HP_status_read_job_db(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_read_job_db_pre ) {
+ if (HPMHooks.count.HP_status_read_job_db_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_read_job_db_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -74901,25 +77292,25 @@ void HP_status_read_job_db(void) {
{
HPMHooks.source.status.read_job_db();
}
- if( HPMHooks.count.HP_status_read_job_db_post ) {
+ if (HPMHooks.count.HP_status_read_job_db_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_read_job_db_post[hIndex].func;
postHookFunc();
}
}
return;
}
-void HP_status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) {
+void HP_status_read_job_db_sub(int idx, const char *name, struct config_setting_t *jdb) {
int hIndex = 0;
- if( HPMHooks.count.HP_status_read_job_db_sub_pre ) {
- void (*preHookFunc) (int *idx, const char *name, config_setting_t *jdb);
+ if (HPMHooks.count.HP_status_read_job_db_sub_pre > 0) {
+ void (*preHookFunc) (int *idx, const char **name, struct config_setting_t **jdb);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_read_job_db_sub_pre[hIndex].func;
- preHookFunc(&idx, name, jdb);
+ preHookFunc(&idx, &name, &jdb);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -74927,26 +77318,132 @@ void HP_status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb)
{
HPMHooks.source.status.read_job_db_sub(idx, name, jdb);
}
- if( HPMHooks.count.HP_status_read_job_db_sub_post ) {
- void (*postHookFunc) (int *idx, const char *name, config_setting_t *jdb);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_status_read_job_db_sub_post > 0) {
+ void (*postHookFunc) (int idx, const char *name, struct config_setting_t *jdb);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_read_job_db_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_read_job_db_sub_post[hIndex].func;
- postHookFunc(&idx, name, jdb);
+ postHookFunc(idx, name, jdb);
+ }
+ }
+ return;
+}
+void HP_status_set_sc(uint16 skill_id, sc_type sc, int icon, unsigned int flag) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_status_set_sc_pre > 0) {
+ void (*preHookFunc) (uint16 *skill_id, sc_type *sc, int *icon, unsigned int *flag);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sc_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_set_sc_pre[hIndex].func;
+ preHookFunc(&skill_id, &sc, &icon, &flag);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.status.set_sc(skill_id, sc, icon, flag);
+ }
+ if (HPMHooks.count.HP_status_set_sc_post > 0) {
+ void (*postHookFunc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sc_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_set_sc_post[hIndex].func;
+ postHookFunc(skill_id, sc, icon, flag);
}
}
return;
}
-/* storage */
+void HP_status_copy(struct status_data *a, const struct status_data *b) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_status_copy_pre > 0) {
+ void (*preHookFunc) (struct status_data **a, const struct status_data **b);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_copy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_copy_pre[hIndex].func;
+ preHookFunc(&a, &b);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.status.copy(a, b);
+ }
+ if (HPMHooks.count.HP_status_copy_post > 0) {
+ void (*postHookFunc) (struct status_data *a, const struct status_data *b);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_copy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_copy_post[hIndex].func;
+ postHookFunc(a, b);
+ }
+ }
+ return;
+}
+unsigned short HP_status_base_matk_min(const struct status_data *st) {
+ int hIndex = 0;
+ unsigned short retVal___ = 0;
+ if (HPMHooks.count.HP_status_base_matk_min_pre > 0) {
+ unsigned short (*preHookFunc) (const struct status_data **st);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_min_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_base_matk_min_pre[hIndex].func;
+ retVal___ = preHookFunc(&st);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.status.base_matk_min(st);
+ }
+ if (HPMHooks.count.HP_status_base_matk_min_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, const struct status_data *st);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_min_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_base_matk_min_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st);
+ }
+ }
+ return retVal___;
+}
+unsigned short HP_status_base_matk_max(const struct status_data *st) {
+ int hIndex = 0;
+ unsigned short retVal___ = 0;
+ if (HPMHooks.count.HP_status_base_matk_max_pre > 0) {
+ unsigned short (*preHookFunc) (const struct status_data **st);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_max_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_base_matk_max_pre[hIndex].func;
+ retVal___ = preHookFunc(&st);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.status.base_matk_max(st);
+ }
+ if (HPMHooks.count.HP_status_base_matk_max_post > 0) {
+ unsigned short (*postHookFunc) (unsigned short retVal___, const struct status_data *st);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_base_matk_max_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_base_matk_max_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, st);
+ }
+ }
+ return retVal___;
+}
+/* storage_interface */
void HP_storage_reconnect(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_storage_reconnect_pre ) {
+ if (HPMHooks.count.HP_storage_reconnect_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_reconnect_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -74954,9 +77451,9 @@ void HP_storage_reconnect(void) {
{
HPMHooks.source.storage.reconnect();
}
- if( HPMHooks.count.HP_storage_reconnect_post ) {
+ if (HPMHooks.count.HP_storage_reconnect_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_reconnect_post[hIndex].func;
postHookFunc();
}
@@ -74966,14 +77463,14 @@ void HP_storage_reconnect(void) {
int HP_storage_delitem(struct map_session_data *sd, int n, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_delitem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *n, int *amount);
+ if (HPMHooks.count.HP_storage_delitem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *n, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_delitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_delitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_delitem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &n, &amount);
+ retVal___ = preHookFunc(&sd, &n, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -74981,11 +77478,11 @@ int HP_storage_delitem(struct map_session_data *sd, int n, int amount) {
{
retVal___ = HPMHooks.source.storage.delitem(sd, n, amount);
}
- if( HPMHooks.count.HP_storage_delitem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *n, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_delitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_delitem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int n, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_delitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_delitem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &n, &amount);
+ retVal___ = postHookFunc(retVal___, sd, n, amount);
}
}
return retVal___;
@@ -74993,14 +77490,14 @@ int HP_storage_delitem(struct map_session_data *sd, int n, int amount) {
int HP_storage_open(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_open_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_storage_open_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_open_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75008,9 +77505,9 @@ int HP_storage_open(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.storage.open(sd);
}
- if( HPMHooks.count.HP_storage_open_post ) {
+ if (HPMHooks.count.HP_storage_open_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_open_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_open_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -75020,14 +77517,14 @@ int HP_storage_open(struct map_session_data *sd) {
int HP_storage_add(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_add_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_storage_add_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_add_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75035,11 +77532,11 @@ int HP_storage_add(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.storage.add(sd, index, amount);
}
- if( HPMHooks.count.HP_storage_add_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_add_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -75047,14 +77544,14 @@ int HP_storage_add(struct map_session_data *sd, int index, int amount) {
int HP_storage_get(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_get_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_storage_get_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_get_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_get_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_get_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75062,11 +77559,11 @@ int HP_storage_get(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.storage.get(sd, index, amount);
}
- if( HPMHooks.count.HP_storage_get_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_get_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_get_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_get_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_get_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -75074,14 +77571,14 @@ int HP_storage_get(struct map_session_data *sd, int index, int amount) {
int HP_storage_additem(struct map_session_data *sd, struct item *item_data, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_additem_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct item *item_data, int *amount);
+ if (HPMHooks.count.HP_storage_additem_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item **item_data, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_additem_pre[hIndex].func;
- retVal___ = preHookFunc(sd, item_data, &amount);
+ retVal___ = preHookFunc(&sd, &item_data, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75089,11 +77586,11 @@ int HP_storage_additem(struct map_session_data *sd, struct item *item_data, int
{
retVal___ = HPMHooks.source.storage.additem(sd, item_data, amount);
}
- if( HPMHooks.count.HP_storage_additem_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_additem_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_additem_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, item_data, &amount);
+ retVal___ = postHookFunc(retVal___, sd, item_data, amount);
}
}
return retVal___;
@@ -75101,14 +77598,14 @@ int HP_storage_additem(struct map_session_data *sd, struct item *item_data, int
int HP_storage_addfromcart(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_addfromcart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_storage_addfromcart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_addfromcart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_addfromcart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_addfromcart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75116,11 +77613,11 @@ int HP_storage_addfromcart(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.storage.addfromcart(sd, index, amount);
}
- if( HPMHooks.count.HP_storage_addfromcart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_addfromcart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_addfromcart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_addfromcart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_addfromcart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
@@ -75128,14 +77625,14 @@ int HP_storage_addfromcart(struct map_session_data *sd, int index, int amount) {
int HP_storage_gettocart(struct map_session_data *sd, int index, int amount) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_gettocart_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, int *index, int *amount);
+ if (HPMHooks.count.HP_storage_gettocart_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, int *index, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_gettocart_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_gettocart_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_gettocart_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &index, &amount);
+ retVal___ = preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75143,25 +77640,25 @@ int HP_storage_gettocart(struct map_session_data *sd, int index, int amount) {
{
retVal___ = HPMHooks.source.storage.gettocart(sd, index, amount);
}
- if( HPMHooks.count.HP_storage_gettocart_post ) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *index, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_gettocart_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_gettocart_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, int index, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_gettocart_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_gettocart_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &index, &amount);
+ retVal___ = postHookFunc(retVal___, sd, index, amount);
}
}
return retVal___;
}
void HP_storage_close(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_storage_close_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_storage_close_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_close_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75169,9 +77666,9 @@ void HP_storage_close(struct map_session_data *sd) {
{
HPMHooks.source.storage.close(sd);
}
- if( HPMHooks.count.HP_storage_close_post ) {
+ if (HPMHooks.count.HP_storage_close_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_close_post[hIndex].func;
postHookFunc(sd);
}
@@ -75180,14 +77677,14 @@ void HP_storage_close(struct map_session_data *sd) {
}
void HP_storage_pc_quit(struct map_session_data *sd, int flag) {
int hIndex = 0;
- if( HPMHooks.count.HP_storage_pc_quit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *flag);
+ if (HPMHooks.count.HP_storage_pc_quit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_pc_quit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_pc_quit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_pc_quit_pre[hIndex].func;
- preHookFunc(sd, &flag);
+ preHookFunc(&sd, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75195,11 +77692,11 @@ void HP_storage_pc_quit(struct map_session_data *sd, int flag) {
{
HPMHooks.source.storage.pc_quit(sd, flag);
}
- if( HPMHooks.count.HP_storage_pc_quit_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_pc_quit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_pc_quit_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_pc_quit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_pc_quit_post[hIndex].func;
- postHookFunc(sd, &flag);
+ postHookFunc(sd, flag);
}
}
return;
@@ -75207,14 +77704,14 @@ void HP_storage_pc_quit(struct map_session_data *sd, int flag) {
int HP_storage_comp_item(const void *i1_, const void *i2_) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_comp_item_pre ) {
- int (*preHookFunc) (const void *i1_, const void *i2_);
+ if (HPMHooks.count.HP_storage_comp_item_pre > 0) {
+ int (*preHookFunc) (const void **i1_, const void **i2_);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_comp_item_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_comp_item_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_comp_item_pre[hIndex].func;
- retVal___ = preHookFunc(i1_, i2_);
+ retVal___ = preHookFunc(&i1_, &i2_);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75222,9 +77719,9 @@ int HP_storage_comp_item(const void *i1_, const void *i2_) {
{
retVal___ = HPMHooks.source.storage.comp_item(i1_, i2_);
}
- if( HPMHooks.count.HP_storage_comp_item_post ) {
+ if (HPMHooks.count.HP_storage_comp_item_post > 0) {
int (*postHookFunc) (int retVal___, const void *i1_, const void *i2_);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_comp_item_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_comp_item_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_comp_item_post[hIndex].func;
retVal___ = postHookFunc(retVal___, i1_, i2_);
}
@@ -75233,14 +77730,14 @@ int HP_storage_comp_item(const void *i1_, const void *i2_) {
}
void HP_storage_sortitem(struct item *items, unsigned int size) {
int hIndex = 0;
- if( HPMHooks.count.HP_storage_sortitem_pre ) {
- void (*preHookFunc) (struct item *items, unsigned int *size);
+ if (HPMHooks.count.HP_storage_sortitem_pre > 0) {
+ void (*preHookFunc) (struct item **items, unsigned int *size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_sortitem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_sortitem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_storage_sortitem_pre[hIndex].func;
- preHookFunc(items, &size);
+ preHookFunc(&items, &size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75248,28 +77745,28 @@ void HP_storage_sortitem(struct item *items, unsigned int size) {
{
HPMHooks.source.storage.sortitem(items, size);
}
- if( HPMHooks.count.HP_storage_sortitem_post ) {
- void (*postHookFunc) (struct item *items, unsigned int *size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_sortitem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_sortitem_post > 0) {
+ void (*postHookFunc) (struct item *items, unsigned int size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_sortitem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_storage_sortitem_post[hIndex].func;
- postHookFunc(items, &size);
+ postHookFunc(items, size);
}
}
return;
}
-int HP_storage_reconnect_sub(DBKey key, DBData *data, va_list ap) {
+int HP_storage_reconnect_sub(union DBKey key, struct DBData *data, va_list ap) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_storage_reconnect_sub_pre ) {
- int (*preHookFunc) (DBKey *key, DBData *data, va_list ap);
+ if (HPMHooks.count.HP_storage_reconnect_sub_pre > 0) {
+ int (*preHookFunc) (union DBKey *key, struct DBData **data, va_list ap);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_sub_pre; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
preHookFunc = HPMHooks.list.HP_storage_reconnect_sub_pre[hIndex].func;
- retVal___ = preHookFunc(&key, data, ap___copy);
+ retVal___ = preHookFunc(&key, &data, ap___copy);
va_end(ap___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75279,29 +77776,29 @@ int HP_storage_reconnect_sub(DBKey key, DBData *data, va_list ap) {
retVal___ = HPMHooks.source.storage.reconnect_sub(key, data, ap___copy);
va_end(ap___copy);
}
- if( HPMHooks.count.HP_storage_reconnect_sub_post ) {
- int (*postHookFunc) (int retVal___, DBKey *key, DBData *data, va_list ap);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_storage_reconnect_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, union DBKey key, struct DBData *data, va_list ap);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_storage_reconnect_sub_post; hIndex++) {
va_list ap___copy; va_copy(ap___copy, ap);
postHookFunc = HPMHooks.list.HP_storage_reconnect_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &key, data, ap___copy);
+ retVal___ = postHookFunc(retVal___, key, data, ap___copy);
va_end(ap___copy);
}
}
return retVal___;
}
-/* StrBuf */
+/* stringbuf_interface */
StringBuf* HP_StrBuf_Malloc(void) {
int hIndex = 0;
StringBuf* retVal___ = NULL;
- if( HPMHooks.count.HP_StrBuf_Malloc_pre ) {
+ if (HPMHooks.count.HP_StrBuf_Malloc_pre > 0) {
StringBuf* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Malloc_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75309,9 +77806,9 @@ StringBuf* HP_StrBuf_Malloc(void) {
{
retVal___ = HPMHooks.source.StrBuf.Malloc();
}
- if( HPMHooks.count.HP_StrBuf_Malloc_post ) {
+ if (HPMHooks.count.HP_StrBuf_Malloc_post > 0) {
StringBuf* (*postHookFunc) (StringBuf* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Malloc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Malloc_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -75320,14 +77817,14 @@ StringBuf* HP_StrBuf_Malloc(void) {
}
void HP_StrBuf_Init(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Init_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Init_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Init_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75335,9 +77832,9 @@ void HP_StrBuf_Init(StringBuf *self) {
{
HPMHooks.source.StrBuf.Init(self);
}
- if( HPMHooks.count.HP_StrBuf_Init_post ) {
+ if (HPMHooks.count.HP_StrBuf_Init_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Init_post[hIndex].func;
postHookFunc(self);
}
@@ -75347,16 +77844,16 @@ void HP_StrBuf_Init(StringBuf *self) {
int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Vprintf_pre ) {
- int (*preHookFunc) (StringBuf *self, const char *fmt, va_list args);
+ if (HPMHooks.count.HP_StrBuf_Vprintf_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const char **fmt, va_list args);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_pre; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
preHookFunc = HPMHooks.list.HP_StrBuf_Vprintf_pre[hIndex].func;
- retVal___ = preHookFunc(self, fmt, args___copy);
+ retVal___ = preHookFunc(&self, &fmt, args___copy);
va_end(args___copy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75366,9 +77863,9 @@ int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
retVal___ = HPMHooks.source.StrBuf.Vprintf(self, fmt, args___copy);
va_end(args___copy);
}
- if( HPMHooks.count.HP_StrBuf_Vprintf_post ) {
+ if (HPMHooks.count.HP_StrBuf_Vprintf_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const char *fmt, va_list args);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Vprintf_post; hIndex++) {
va_list args___copy; va_copy(args___copy, args);
postHookFunc = HPMHooks.list.HP_StrBuf_Vprintf_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, fmt, args___copy);
@@ -75380,14 +77877,14 @@ int HP_StrBuf_Vprintf(StringBuf *self, const char *fmt, va_list args) {
int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Append_pre ) {
- int (*preHookFunc) (StringBuf *self, const StringBuf *sbuf);
+ if (HPMHooks.count.HP_StrBuf_Append_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const StringBuf **sbuf);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Append_pre[hIndex].func;
- retVal___ = preHookFunc(self, sbuf);
+ retVal___ = preHookFunc(&self, &sbuf);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75395,9 +77892,9 @@ int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
{
retVal___ = HPMHooks.source.StrBuf.Append(self, sbuf);
}
- if( HPMHooks.count.HP_StrBuf_Append_post ) {
+ if (HPMHooks.count.HP_StrBuf_Append_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const StringBuf *sbuf);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Append_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Append_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, sbuf);
}
@@ -75407,14 +77904,14 @@ int HP_StrBuf_Append(StringBuf *self, const StringBuf *sbuf) {
int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_AppendStr_pre ) {
- int (*preHookFunc) (StringBuf *self, const char *str);
+ if (HPMHooks.count.HP_StrBuf_AppendStr_pre > 0) {
+ int (*preHookFunc) (StringBuf **self, const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_AppendStr_pre[hIndex].func;
- retVal___ = preHookFunc(self, str);
+ retVal___ = preHookFunc(&self, &str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75422,9 +77919,9 @@ int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
{
retVal___ = HPMHooks.source.StrBuf.AppendStr(self, str);
}
- if( HPMHooks.count.HP_StrBuf_AppendStr_post ) {
+ if (HPMHooks.count.HP_StrBuf_AppendStr_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_AppendStr_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_AppendStr_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self, str);
}
@@ -75434,14 +77931,14 @@ int HP_StrBuf_AppendStr(StringBuf *self, const char *str) {
int HP_StrBuf_Length(StringBuf *self) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_StrBuf_Length_pre ) {
- int (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Length_pre > 0) {
+ int (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Length_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75449,9 +77946,9 @@ int HP_StrBuf_Length(StringBuf *self) {
{
retVal___ = HPMHooks.source.StrBuf.Length(self);
}
- if( HPMHooks.count.HP_StrBuf_Length_post ) {
+ if (HPMHooks.count.HP_StrBuf_Length_post > 0) {
int (*postHookFunc) (int retVal___, StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Length_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Length_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
@@ -75461,14 +77958,14 @@ int HP_StrBuf_Length(StringBuf *self) {
char* HP_StrBuf_Value(StringBuf *self) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_StrBuf_Value_pre ) {
- char* (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Value_pre > 0) {
+ char* (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Value_pre[hIndex].func;
- retVal___ = preHookFunc(self);
+ retVal___ = preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75476,9 +77973,9 @@ char* HP_StrBuf_Value(StringBuf *self) {
{
retVal___ = HPMHooks.source.StrBuf.Value(self);
}
- if( HPMHooks.count.HP_StrBuf_Value_post ) {
+ if (HPMHooks.count.HP_StrBuf_Value_post > 0) {
char* (*postHookFunc) (char* retVal___, StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Value_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Value_post[hIndex].func;
retVal___ = postHookFunc(retVal___, self);
}
@@ -75487,14 +77984,14 @@ char* HP_StrBuf_Value(StringBuf *self) {
}
void HP_StrBuf_Clear(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Clear_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Clear_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Clear_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75502,9 +77999,9 @@ void HP_StrBuf_Clear(StringBuf *self) {
{
HPMHooks.source.StrBuf.Clear(self);
}
- if( HPMHooks.count.HP_StrBuf_Clear_post ) {
+ if (HPMHooks.count.HP_StrBuf_Clear_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Clear_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Clear_post[hIndex].func;
postHookFunc(self);
}
@@ -75513,14 +78010,14 @@ void HP_StrBuf_Clear(StringBuf *self) {
}
void HP_StrBuf_Destroy(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Destroy_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Destroy_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Destroy_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75528,9 +78025,9 @@ void HP_StrBuf_Destroy(StringBuf *self) {
{
HPMHooks.source.StrBuf.Destroy(self);
}
- if( HPMHooks.count.HP_StrBuf_Destroy_post ) {
+ if (HPMHooks.count.HP_StrBuf_Destroy_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Destroy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Destroy_post[hIndex].func;
postHookFunc(self);
}
@@ -75539,14 +78036,14 @@ void HP_StrBuf_Destroy(StringBuf *self) {
}
void HP_StrBuf_Free(StringBuf *self) {
int hIndex = 0;
- if( HPMHooks.count.HP_StrBuf_Free_pre ) {
- void (*preHookFunc) (StringBuf *self);
+ if (HPMHooks.count.HP_StrBuf_Free_pre > 0) {
+ void (*preHookFunc) (StringBuf **self);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_StrBuf_Free_pre[hIndex].func;
- preHookFunc(self);
+ preHookFunc(&self);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -75554,27 +78051,27 @@ void HP_StrBuf_Free(StringBuf *self) {
{
HPMHooks.source.StrBuf.Free(self);
}
- if( HPMHooks.count.HP_StrBuf_Free_post ) {
+ if (HPMHooks.count.HP_StrBuf_Free_post > 0) {
void (*postHookFunc) (StringBuf *self);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_StrBuf_Free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_StrBuf_Free_post[hIndex].func;
postHookFunc(self);
}
}
return;
}
-/* strlib */
+/* strlib_interface */
char* HP_strlib_jstrescape(char *pt) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_jstrescape_pre ) {
- char* (*preHookFunc) (char *pt);
+ if (HPMHooks.count.HP_strlib_jstrescape_pre > 0) {
+ char* (*preHookFunc) (char **pt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jstrescape_pre[hIndex].func;
- retVal___ = preHookFunc(pt);
+ retVal___ = preHookFunc(&pt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75582,9 +78079,9 @@ char* HP_strlib_jstrescape(char *pt) {
{
retVal___ = HPMHooks.source.strlib.jstrescape(pt);
}
- if( HPMHooks.count.HP_strlib_jstrescape_post ) {
+ if (HPMHooks.count.HP_strlib_jstrescape_post > 0) {
char* (*postHookFunc) (char* retVal___, char *pt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescape_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jstrescape_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pt);
}
@@ -75594,14 +78091,14 @@ char* HP_strlib_jstrescape(char *pt) {
char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_jstrescapecpy_pre ) {
- char* (*preHookFunc) (char *pt, const char *spt);
+ if (HPMHooks.count.HP_strlib_jstrescapecpy_pre > 0) {
+ char* (*preHookFunc) (char **pt, const char **spt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_pre[hIndex].func;
- retVal___ = preHookFunc(pt, spt);
+ retVal___ = preHookFunc(&pt, &spt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75609,9 +78106,9 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
{
retVal___ = HPMHooks.source.strlib.jstrescapecpy(pt, spt);
}
- if( HPMHooks.count.HP_strlib_jstrescapecpy_post ) {
+ if (HPMHooks.count.HP_strlib_jstrescapecpy_post > 0) {
char* (*postHookFunc) (char* retVal___, char *pt, const char *spt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jstrescapecpy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jstrescapecpy_post[hIndex].func;
retVal___ = postHookFunc(retVal___, pt, spt);
}
@@ -75621,14 +78118,14 @@ char* HP_strlib_jstrescapecpy(char *pt, const char *spt) {
int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_jmemescapecpy_pre ) {
- int (*preHookFunc) (char *pt, const char *spt, int *size);
+ if (HPMHooks.count.HP_strlib_jmemescapecpy_pre > 0) {
+ int (*preHookFunc) (char **pt, const char **spt, int *size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_jmemescapecpy_pre[hIndex].func;
- retVal___ = preHookFunc(pt, spt, &size);
+ retVal___ = preHookFunc(&pt, &spt, &size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75636,11 +78133,11 @@ int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
{
retVal___ = HPMHooks.source.strlib.jmemescapecpy(pt, spt, size);
}
- if( HPMHooks.count.HP_strlib_jmemescapecpy_post ) {
- int (*postHookFunc) (int retVal___, char *pt, const char *spt, int *size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_jmemescapecpy_post > 0) {
+ int (*postHookFunc) (int retVal___, char *pt, const char *spt, int size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_jmemescapecpy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_jmemescapecpy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, pt, spt, &size);
+ retVal___ = postHookFunc(retVal___, pt, spt, size);
}
}
return retVal___;
@@ -75648,14 +78145,14 @@ int HP_strlib_jmemescapecpy(char *pt, const char *spt, int size) {
int HP_strlib_remove_control_chars_(char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_remove_control_chars__pre ) {
- int (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_strlib_remove_control_chars__pre > 0) {
+ int (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_remove_control_chars__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75663,9 +78160,9 @@ int HP_strlib_remove_control_chars_(char *str) {
{
retVal___ = HPMHooks.source.strlib.remove_control_chars_(str);
}
- if( HPMHooks.count.HP_strlib_remove_control_chars__post ) {
+ if (HPMHooks.count.HP_strlib_remove_control_chars__post > 0) {
int (*postHookFunc) (int retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_remove_control_chars__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_remove_control_chars__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -75675,14 +78172,14 @@ int HP_strlib_remove_control_chars_(char *str) {
char* HP_strlib_trim_(char *str) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_trim__pre ) {
- char* (*preHookFunc) (char *str);
+ if (HPMHooks.count.HP_strlib_trim__pre > 0) {
+ char* (*preHookFunc) (char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_trim__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75690,9 +78187,9 @@ char* HP_strlib_trim_(char *str) {
{
retVal___ = HPMHooks.source.strlib.trim_(str);
}
- if( HPMHooks.count.HP_strlib_trim__post ) {
+ if (HPMHooks.count.HP_strlib_trim__post > 0) {
char* (*postHookFunc) (char* retVal___, char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_trim__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_trim__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -75702,14 +78199,14 @@ char* HP_strlib_trim_(char *str) {
char* HP_strlib_normalize_name_(char *str, const char *delims) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_normalize_name__pre ) {
- char* (*preHookFunc) (char *str, const char *delims);
+ if (HPMHooks.count.HP_strlib_normalize_name__pre > 0) {
+ char* (*preHookFunc) (char **str, const char **delims);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_normalize_name__pre[hIndex].func;
- retVal___ = preHookFunc(str, delims);
+ retVal___ = preHookFunc(&str, &delims);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75717,9 +78214,9 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) {
{
retVal___ = HPMHooks.source.strlib.normalize_name_(str, delims);
}
- if( HPMHooks.count.HP_strlib_normalize_name__post ) {
+ if (HPMHooks.count.HP_strlib_normalize_name__post > 0) {
char* (*postHookFunc) (char* retVal___, char *str, const char *delims);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_normalize_name__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_normalize_name__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str, delims);
}
@@ -75729,14 +78226,14 @@ char* HP_strlib_normalize_name_(char *str, const char *delims) {
const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_stristr__pre ) {
- const char* (*preHookFunc) (const char *haystack, const char *needle);
+ if (HPMHooks.count.HP_strlib_stristr__pre > 0) {
+ const char* (*preHookFunc) (const char **haystack, const char **needle);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_stristr__pre[hIndex].func;
- retVal___ = preHookFunc(haystack, needle);
+ retVal___ = preHookFunc(&haystack, &needle);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75744,9 +78241,9 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
{
retVal___ = HPMHooks.source.strlib.stristr_(haystack, needle);
}
- if( HPMHooks.count.HP_strlib_stristr__post ) {
+ if (HPMHooks.count.HP_strlib_stristr__post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *haystack, const char *needle);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_stristr__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_stristr__post[hIndex].func;
retVal___ = postHookFunc(retVal___, haystack, needle);
}
@@ -75756,14 +78253,14 @@ const char* HP_strlib_stristr_(const char *haystack, const char *needle) {
size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_strlib_strnlen__pre ) {
- size_t (*preHookFunc) (const char *string, size_t *maxlen);
+ if (HPMHooks.count.HP_strlib_strnlen__pre > 0) {
+ size_t (*preHookFunc) (const char **string, size_t *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strnlen__pre[hIndex].func;
- retVal___ = preHookFunc(string, &maxlen);
+ retVal___ = preHookFunc(&string, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75771,11 +78268,11 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
{
retVal___ = HPMHooks.source.strlib.strnlen_(string, maxlen);
}
- if( HPMHooks.count.HP_strlib_strnlen__post ) {
- size_t (*postHookFunc) (size_t retVal___, const char *string, size_t *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_strnlen__post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, const char *string, size_t maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strnlen__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strnlen__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, string, &maxlen);
+ retVal___ = postHookFunc(retVal___, string, maxlen);
}
}
return retVal___;
@@ -75783,14 +78280,14 @@ size_t HP_strlib_strnlen_(const char *string, size_t maxlen) {
char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_strtok_r__pre ) {
- char* (*preHookFunc) (char *s1, const char *s2, char **lasts);
+ if (HPMHooks.count.HP_strlib_strtok_r__pre > 0) {
+ char* (*preHookFunc) (char **s1, const char **s2, char ***lasts);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strtok_r__pre[hIndex].func;
- retVal___ = preHookFunc(s1, s2, lasts);
+ retVal___ = preHookFunc(&s1, &s2, &lasts);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75798,9 +78295,9 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
{
retVal___ = HPMHooks.source.strlib.strtok_r_(s1, s2, lasts);
}
- if( HPMHooks.count.HP_strlib_strtok_r__post ) {
+ if (HPMHooks.count.HP_strlib_strtok_r__post > 0) {
char* (*postHookFunc) (char* retVal___, char *s1, const char *s2, char **lasts);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strtok_r__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strtok_r__post[hIndex].func;
retVal___ = postHookFunc(retVal___, s1, s2, lasts);
}
@@ -75810,14 +78307,14 @@ char* HP_strlib_strtok_r_(char *s1, const char *s2, char **lasts) {
int HP_strlib_e_mail_check_(char *email) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_e_mail_check__pre ) {
- int (*preHookFunc) (char *email);
+ if (HPMHooks.count.HP_strlib_e_mail_check__pre > 0) {
+ int (*preHookFunc) (char **email);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_e_mail_check__pre[hIndex].func;
- retVal___ = preHookFunc(email);
+ retVal___ = preHookFunc(&email);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75825,9 +78322,9 @@ int HP_strlib_e_mail_check_(char *email) {
{
retVal___ = HPMHooks.source.strlib.e_mail_check_(email);
}
- if( HPMHooks.count.HP_strlib_e_mail_check__post ) {
+ if (HPMHooks.count.HP_strlib_e_mail_check__post > 0) {
int (*postHookFunc) (int retVal___, char *email);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_e_mail_check__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_e_mail_check__post[hIndex].func;
retVal___ = postHookFunc(retVal___, email);
}
@@ -75837,14 +78334,14 @@ int HP_strlib_e_mail_check_(char *email) {
int HP_strlib_config_switch_(const char *str) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_config_switch__pre ) {
- int (*preHookFunc) (const char *str);
+ if (HPMHooks.count.HP_strlib_config_switch__pre > 0) {
+ int (*preHookFunc) (const char **str);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_config_switch__pre[hIndex].func;
- retVal___ = preHookFunc(str);
+ retVal___ = preHookFunc(&str);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75852,9 +78349,9 @@ int HP_strlib_config_switch_(const char *str) {
{
retVal___ = HPMHooks.source.strlib.config_switch_(str);
}
- if( HPMHooks.count.HP_strlib_config_switch__post ) {
+ if (HPMHooks.count.HP_strlib_config_switch__post > 0) {
int (*postHookFunc) (int retVal___, const char *str);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_config_switch__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_config_switch__post[hIndex].func;
retVal___ = postHookFunc(retVal___, str);
}
@@ -75864,14 +78361,14 @@ int HP_strlib_config_switch_(const char *str) {
char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
int hIndex = 0;
char* retVal___ = NULL;
- if( HPMHooks.count.HP_strlib_safestrncpy__pre ) {
- char* (*preHookFunc) (char *dst, const char *src, size_t *n);
+ if (HPMHooks.count.HP_strlib_safestrncpy__pre > 0) {
+ char* (*preHookFunc) (char **dst, const char **src, size_t *n);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_safestrncpy__pre[hIndex].func;
- retVal___ = preHookFunc(dst, src, &n);
+ retVal___ = preHookFunc(&dst, &src, &n);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75879,11 +78376,11 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
{
retVal___ = HPMHooks.source.strlib.safestrncpy_(dst, src, n);
}
- if( HPMHooks.count.HP_strlib_safestrncpy__post ) {
- char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t *n);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_safestrncpy__post > 0) {
+ char* (*postHookFunc) (char* retVal___, char *dst, const char *src, size_t n);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrncpy__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_safestrncpy__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, dst, src, &n);
+ retVal___ = postHookFunc(retVal___, dst, src, n);
}
}
return retVal___;
@@ -75891,14 +78388,14 @@ char* HP_strlib_safestrncpy_(char *dst, const char *src, size_t n) {
size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_strlib_safestrnlen__pre ) {
- size_t (*preHookFunc) (const char *string, size_t *maxlen);
+ if (HPMHooks.count.HP_strlib_safestrnlen__pre > 0) {
+ size_t (*preHookFunc) (const char **string, size_t *maxlen);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_safestrnlen__pre[hIndex].func;
- retVal___ = preHookFunc(string, &maxlen);
+ retVal___ = preHookFunc(&string, &maxlen);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75906,11 +78403,11 @@ size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
{
retVal___ = HPMHooks.source.strlib.safestrnlen_(string, maxlen);
}
- if( HPMHooks.count.HP_strlib_safestrnlen__post ) {
- size_t (*postHookFunc) (size_t retVal___, const char *string, size_t *maxlen);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_safestrnlen__post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, const char *string, size_t maxlen);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_safestrnlen__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_safestrnlen__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, string, &maxlen);
+ retVal___ = postHookFunc(retVal___, string, maxlen);
}
}
return retVal___;
@@ -75918,14 +78415,14 @@ size_t HP_strlib_safestrnlen_(const char *string, size_t maxlen) {
int HP_strlib_strline_(const char *str, size_t pos) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_strlib_strline__pre ) {
- int (*preHookFunc) (const char *str, size_t *pos);
+ if (HPMHooks.count.HP_strlib_strline__pre > 0) {
+ int (*preHookFunc) (const char **str, size_t *pos);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_strline__pre[hIndex].func;
- retVal___ = preHookFunc(str, &pos);
+ retVal___ = preHookFunc(&str, &pos);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75933,26 +78430,26 @@ int HP_strlib_strline_(const char *str, size_t pos) {
{
retVal___ = HPMHooks.source.strlib.strline_(str, pos);
}
- if( HPMHooks.count.HP_strlib_strline__post ) {
- int (*postHookFunc) (int retVal___, const char *str, size_t *pos);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_strline__post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, size_t pos);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_strline__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_strline__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &pos);
+ retVal___ = postHookFunc(retVal___, str, pos);
}
}
return retVal___;
}
-bool HP_strlib_bin2hex_(char *output, unsigned char *input, size_t count) {
+bool HP_strlib_bin2hex_(char *output, const unsigned char *input, size_t count) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_strlib_bin2hex__pre ) {
- bool (*preHookFunc) (char *output, unsigned char *input, size_t *count);
+ if (HPMHooks.count.HP_strlib_bin2hex__pre > 0) {
+ bool (*preHookFunc) (char **output, const unsigned char **input, size_t *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_strlib_bin2hex__pre[hIndex].func;
- retVal___ = preHookFunc(output, input, &count);
+ retVal___ = preHookFunc(&output, &input, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75960,27 +78457,27 @@ bool HP_strlib_bin2hex_(char *output, unsigned char *input, size_t count) {
{
retVal___ = HPMHooks.source.strlib.bin2hex_(output, input, count);
}
- if( HPMHooks.count.HP_strlib_bin2hex__post ) {
- bool (*postHookFunc) (bool retVal___, char *output, unsigned char *input, size_t *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__post; hIndex++ ) {
+ if (HPMHooks.count.HP_strlib_bin2hex__post > 0) {
+ bool (*postHookFunc) (bool retVal___, char *output, const unsigned char *input, size_t count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_strlib_bin2hex__post; hIndex++) {
postHookFunc = HPMHooks.list.HP_strlib_bin2hex__post[hIndex].func;
- retVal___ = postHookFunc(retVal___, output, input, &count);
+ retVal___ = postHookFunc(retVal___, output, input, count);
}
}
return retVal___;
}
-/* sv */
+/* sv_interface */
int HP_sv_parse_next(struct s_svstate *svstate) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_parse_next_pre ) {
- int (*preHookFunc) (struct s_svstate *svstate);
+ if (HPMHooks.count.HP_sv_parse_next_pre > 0) {
+ int (*preHookFunc) (struct s_svstate **svstate);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_parse_next_pre[hIndex].func;
- retVal___ = preHookFunc(svstate);
+ retVal___ = preHookFunc(&svstate);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -75988,9 +78485,9 @@ int HP_sv_parse_next(struct s_svstate *svstate) {
{
retVal___ = HPMHooks.source.sv.parse_next(svstate);
}
- if( HPMHooks.count.HP_sv_parse_next_post ) {
+ if (HPMHooks.count.HP_sv_parse_next_post > 0) {
int (*postHookFunc) (int retVal___, struct s_svstate *svstate);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_next_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_parse_next_post[hIndex].func;
retVal___ = postHookFunc(retVal___, svstate);
}
@@ -76000,14 +78497,14 @@ int HP_sv_parse_next(struct s_svstate *svstate) {
int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_parse_pre ) {
- int (*preHookFunc) (const char *str, int *len, int *startoff, char *delim, int *out_pos, int *npos, enum e_svopt *opt);
+ if (HPMHooks.count.HP_sv_parse_pre > 0) {
+ int (*preHookFunc) (const char **str, int *len, int *startoff, char *delim, int **out_pos, int *npos, enum e_svopt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_parse_pre[hIndex].func;
- retVal___ = preHookFunc(str, &len, &startoff, &delim, out_pos, &npos, &opt);
+ retVal___ = preHookFunc(&str, &len, &startoff, &delim, &out_pos, &npos, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76015,11 +78512,11 @@ int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos
{
retVal___ = HPMHooks.source.sv.parse(str, len, startoff, delim, out_pos, npos, opt);
}
- if( HPMHooks.count.HP_sv_parse_post ) {
- int (*postHookFunc) (int retVal___, const char *str, int *len, int *startoff, char *delim, int *out_pos, int *npos, enum e_svopt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_parse_post > 0) {
+ int (*postHookFunc) (int retVal___, const char *str, int len, int startoff, char delim, int *out_pos, int npos, enum e_svopt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_parse_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_parse_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &len, &startoff, &delim, out_pos, &npos, &opt);
+ retVal___ = postHookFunc(retVal___, str, len, startoff, delim, out_pos, npos, opt);
}
}
return retVal___;
@@ -76027,14 +78524,14 @@ int HP_sv_parse(const char *str, int len, int startoff, char delim, int *out_pos
int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sv_split_pre ) {
- int (*preHookFunc) (char *str, int *len, int *startoff, char *delim, char **out_fields, int *nfields, enum e_svopt *opt);
+ if (HPMHooks.count.HP_sv_split_pre > 0) {
+ int (*preHookFunc) (char **str, int *len, int *startoff, char *delim, char ***out_fields, int *nfields, enum e_svopt *opt);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_split_pre[hIndex].func;
- retVal___ = preHookFunc(str, &len, &startoff, &delim, out_fields, &nfields, &opt);
+ retVal___ = preHookFunc(&str, &len, &startoff, &delim, &out_fields, &nfields, &opt);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76042,11 +78539,11 @@ int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields,
{
retVal___ = HPMHooks.source.sv.split(str, len, startoff, delim, out_fields, nfields, opt);
}
- if( HPMHooks.count.HP_sv_split_post ) {
- int (*postHookFunc) (int retVal___, char *str, int *len, int *startoff, char *delim, char **out_fields, int *nfields, enum e_svopt *opt);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_split_post > 0) {
+ int (*postHookFunc) (int retVal___, char *str, int len, int startoff, char delim, char **out_fields, int nfields, enum e_svopt opt);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_split_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_split_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, str, &len, &startoff, &delim, out_fields, &nfields, &opt);
+ retVal___ = postHookFunc(retVal___, str, len, startoff, delim, out_fields, nfields, opt);
}
}
return retVal___;
@@ -76054,14 +78551,14 @@ int HP_sv_split(char *str, int len, int startoff, char delim, char **out_fields,
size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *escapes) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_sv_escape_c_pre ) {
- size_t (*preHookFunc) (char *out_dest, const char *src, size_t *len, const char *escapes);
+ if (HPMHooks.count.HP_sv_escape_c_pre > 0) {
+ size_t (*preHookFunc) (char **out_dest, const char **src, size_t *len, const char **escapes);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_escape_c_pre[hIndex].func;
- retVal___ = preHookFunc(out_dest, src, &len, escapes);
+ retVal___ = preHookFunc(&out_dest, &src, &len, &escapes);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76069,11 +78566,11 @@ size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *e
{
retVal___ = HPMHooks.source.sv.escape_c(out_dest, src, len, escapes);
}
- if( HPMHooks.count.HP_sv_escape_c_post ) {
- size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t *len, const char *escapes);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_escape_c_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t len, const char *escapes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_escape_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_escape_c_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, out_dest, src, &len, escapes);
+ retVal___ = postHookFunc(retVal___, out_dest, src, len, escapes);
}
}
return retVal___;
@@ -76081,14 +78578,14 @@ size_t HP_sv_escape_c(char *out_dest, const char *src, size_t len, const char *e
size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
int hIndex = 0;
size_t retVal___ = 0;
- if( HPMHooks.count.HP_sv_unescape_c_pre ) {
- size_t (*preHookFunc) (char *out_dest, const char *src, size_t *len);
+ if (HPMHooks.count.HP_sv_unescape_c_pre > 0) {
+ size_t (*preHookFunc) (char **out_dest, const char **src, size_t *len);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_unescape_c_pre[hIndex].func;
- retVal___ = preHookFunc(out_dest, src, &len);
+ retVal___ = preHookFunc(&out_dest, &src, &len);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76096,11 +78593,11 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
{
retVal___ = HPMHooks.source.sv.unescape_c(out_dest, src, len);
}
- if( HPMHooks.count.HP_sv_unescape_c_post ) {
- size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t *len);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_unescape_c_post > 0) {
+ size_t (*postHookFunc) (size_t retVal___, char *out_dest, const char *src, size_t len);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_unescape_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_unescape_c_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, out_dest, src, &len);
+ retVal___ = postHookFunc(retVal___, out_dest, src, len);
}
}
return retVal___;
@@ -76108,14 +78605,14 @@ size_t HP_sv_unescape_c(char *out_dest, const char *src, size_t len) {
const char* HP_sv_skip_escaped_c(const char *p) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sv_skip_escaped_c_pre ) {
- const char* (*preHookFunc) (const char *p);
+ if (HPMHooks.count.HP_sv_skip_escaped_c_pre > 0) {
+ const char* (*preHookFunc) (const char **p);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_pre[hIndex].func;
- retVal___ = preHookFunc(p);
+ retVal___ = preHookFunc(&p);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76123,9 +78620,9 @@ const char* HP_sv_skip_escaped_c(const char *p) {
{
retVal___ = HPMHooks.source.sv.skip_escaped_c(p);
}
- if( HPMHooks.count.HP_sv_skip_escaped_c_post ) {
+ if (HPMHooks.count.HP_sv_skip_escaped_c_post > 0) {
const char* (*postHookFunc) (const char* retVal___, const char *p);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_skip_escaped_c_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_skip_escaped_c_post[hIndex].func;
retVal___ = postHookFunc(retVal___, p);
}
@@ -76135,14 +78632,14 @@ const char* HP_sv_skip_escaped_c(const char *p) {
bool HP_sv_readdb(const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current)) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sv_readdb_pre ) {
- bool (*preHookFunc) (const char *directory, const char *filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+ if (HPMHooks.count.HP_sv_readdb_pre > 0) {
+ bool (*preHookFunc) (const char **directory, const char **filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( **parseproc ) (char *fields[], int columns, int current));
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sv_readdb_pre[hIndex].func;
- retVal___ = preHookFunc(directory, filename, &delim, &mincols, &maxcols, &maxrows, parseproc);
+ retVal___ = preHookFunc(&directory, &filename, &delim, &mincols, &maxcols, &maxrows, &parseproc);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76150,27 +78647,27 @@ bool HP_sv_readdb(const char *directory, const char *filename, char delim, int m
{
retVal___ = HPMHooks.source.sv.readdb(directory, filename, delim, mincols, maxcols, maxrows, parseproc);
}
- if( HPMHooks.count.HP_sv_readdb_post ) {
- bool (*postHookFunc) (bool retVal___, const char *directory, const char *filename, char *delim, int *mincols, int *maxcols, int *maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_post; hIndex++ ) {
+ if (HPMHooks.count.HP_sv_readdb_post > 0) {
+ bool (*postHookFunc) (bool retVal___, const char *directory, const char *filename, char delim, int mincols, int maxcols, int maxrows, bool ( *parseproc ) (char *fields[], int columns, int current));
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sv_readdb_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sv_readdb_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, directory, filename, &delim, &mincols, &maxcols, &maxrows, parseproc);
+ retVal___ = postHookFunc(retVal___, directory, filename, delim, mincols, maxcols, maxrows, parseproc);
}
}
return retVal___;
}
-/* sysinfo */
+/* sysinfo_interface */
int HP_sysinfo_getpagesize(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_getpagesize_pre ) {
+ if (HPMHooks.count.HP_sysinfo_getpagesize_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_getpagesize_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76178,9 +78675,9 @@ int HP_sysinfo_getpagesize(void) {
{
retVal___ = HPMHooks.source.sysinfo.getpagesize();
}
- if( HPMHooks.count.HP_sysinfo_getpagesize_post ) {
+ if (HPMHooks.count.HP_sysinfo_getpagesize_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_getpagesize_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_getpagesize_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76190,14 +78687,14 @@ int HP_sysinfo_getpagesize(void) {
const char* HP_sysinfo_platform(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_platform_pre ) {
+ if (HPMHooks.count.HP_sysinfo_platform_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_platform_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76205,9 +78702,9 @@ const char* HP_sysinfo_platform(void) {
{
retVal___ = HPMHooks.source.sysinfo.platform();
}
- if( HPMHooks.count.HP_sysinfo_platform_post ) {
+ if (HPMHooks.count.HP_sysinfo_platform_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_platform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_platform_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76217,14 +78714,14 @@ const char* HP_sysinfo_platform(void) {
const char* HP_sysinfo_osversion(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_osversion_pre ) {
+ if (HPMHooks.count.HP_sysinfo_osversion_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_osversion_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76232,9 +78729,9 @@ const char* HP_sysinfo_osversion(void) {
{
retVal___ = HPMHooks.source.sysinfo.osversion();
}
- if( HPMHooks.count.HP_sysinfo_osversion_post ) {
+ if (HPMHooks.count.HP_sysinfo_osversion_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_osversion_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_osversion_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76244,14 +78741,14 @@ const char* HP_sysinfo_osversion(void) {
const char* HP_sysinfo_cpu(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_cpu_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cpu_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cpu_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76259,9 +78756,9 @@ const char* HP_sysinfo_cpu(void) {
{
retVal___ = HPMHooks.source.sysinfo.cpu();
}
- if( HPMHooks.count.HP_sysinfo_cpu_post ) {
+ if (HPMHooks.count.HP_sysinfo_cpu_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpu_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cpu_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76271,14 +78768,14 @@ const char* HP_sysinfo_cpu(void) {
int HP_sysinfo_cpucores(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_cpucores_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cpucores_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cpucores_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76286,9 +78783,9 @@ int HP_sysinfo_cpucores(void) {
{
retVal___ = HPMHooks.source.sysinfo.cpucores();
}
- if( HPMHooks.count.HP_sysinfo_cpucores_post ) {
+ if (HPMHooks.count.HP_sysinfo_cpucores_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cpucores_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cpucores_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76298,14 +78795,14 @@ int HP_sysinfo_cpucores(void) {
const char* HP_sysinfo_arch(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_arch_pre ) {
+ if (HPMHooks.count.HP_sysinfo_arch_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_arch_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76313,9 +78810,9 @@ const char* HP_sysinfo_arch(void) {
{
retVal___ = HPMHooks.source.sysinfo.arch();
}
- if( HPMHooks.count.HP_sysinfo_arch_post ) {
+ if (HPMHooks.count.HP_sysinfo_arch_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_arch_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_arch_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76325,14 +78822,14 @@ const char* HP_sysinfo_arch(void) {
bool HP_sysinfo_is64bit(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sysinfo_is64bit_pre ) {
+ if (HPMHooks.count.HP_sysinfo_is64bit_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_is64bit_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76340,9 +78837,9 @@ bool HP_sysinfo_is64bit(void) {
{
retVal___ = HPMHooks.source.sysinfo.is64bit();
}
- if( HPMHooks.count.HP_sysinfo_is64bit_post ) {
+ if (HPMHooks.count.HP_sysinfo_is64bit_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is64bit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_is64bit_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76352,14 +78849,14 @@ bool HP_sysinfo_is64bit(void) {
const char* HP_sysinfo_compiler(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_compiler_pre ) {
+ if (HPMHooks.count.HP_sysinfo_compiler_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_compiler_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76367,9 +78864,9 @@ const char* HP_sysinfo_compiler(void) {
{
retVal___ = HPMHooks.source.sysinfo.compiler();
}
- if( HPMHooks.count.HP_sysinfo_compiler_post ) {
+ if (HPMHooks.count.HP_sysinfo_compiler_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_compiler_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_compiler_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76379,14 +78876,14 @@ const char* HP_sysinfo_compiler(void) {
const char* HP_sysinfo_cflags(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_cflags_pre ) {
+ if (HPMHooks.count.HP_sysinfo_cflags_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_cflags_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76394,26 +78891,53 @@ const char* HP_sysinfo_cflags(void) {
{
retVal___ = HPMHooks.source.sysinfo.cflags();
}
- if( HPMHooks.count.HP_sysinfo_cflags_post ) {
+ if (HPMHooks.count.HP_sysinfo_cflags_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_cflags_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_cflags_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
}
return retVal___;
}
+const char* HP_sysinfo_time(void) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_sysinfo_time_pre > 0) {
+ const char* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_sysinfo_time_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.sysinfo.time();
+ }
+ if (HPMHooks.count.HP_sysinfo_time_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_time_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_sysinfo_time_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
const char* HP_sysinfo_vcstype(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcstype_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcstype_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcstype_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76421,9 +78945,9 @@ const char* HP_sysinfo_vcstype(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcstype();
}
- if( HPMHooks.count.HP_sysinfo_vcstype_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcstype_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstype_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcstype_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76433,14 +78957,14 @@ const char* HP_sysinfo_vcstype(void) {
int HP_sysinfo_vcstypeid(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_sysinfo_vcstypeid_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcstypeid_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcstypeid_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76448,9 +78972,9 @@ int HP_sysinfo_vcstypeid(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcstypeid();
}
- if( HPMHooks.count.HP_sysinfo_vcstypeid_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcstypeid_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcstypeid_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcstypeid_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76460,14 +78984,14 @@ int HP_sysinfo_vcstypeid(void) {
const char* HP_sysinfo_vcsrevision_src(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_src_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_src_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76475,9 +78999,9 @@ const char* HP_sysinfo_vcsrevision_src(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcsrevision_src();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_src_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_src_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_src_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_src_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76487,14 +79011,14 @@ const char* HP_sysinfo_vcsrevision_src(void) {
const char* HP_sysinfo_vcsrevision_scripts(void) {
int hIndex = 0;
const char* retVal___ = NULL;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre > 0) {
const char* (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76502,9 +79026,9 @@ const char* HP_sysinfo_vcsrevision_scripts(void) {
{
retVal___ = HPMHooks.source.sysinfo.vcsrevision_scripts();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post > 0) {
const char* (*postHookFunc) (const char* retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_scripts_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_scripts_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76513,14 +79037,14 @@ const char* HP_sysinfo_vcsrevision_scripts(void) {
}
void HP_sysinfo_vcsrevision_reload(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_reload_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -76528,9 +79052,9 @@ void HP_sysinfo_vcsrevision_reload(void) {
{
HPMHooks.source.sysinfo.vcsrevision_reload();
}
- if( HPMHooks.count.HP_sysinfo_vcsrevision_reload_post ) {
+ if (HPMHooks.count.HP_sysinfo_vcsrevision_reload_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_vcsrevision_reload_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_vcsrevision_reload_post[hIndex].func;
postHookFunc();
}
@@ -76540,14 +79064,14 @@ void HP_sysinfo_vcsrevision_reload(void) {
bool HP_sysinfo_is_superuser(void) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_sysinfo_is_superuser_pre ) {
+ if (HPMHooks.count.HP_sysinfo_is_superuser_pre > 0) {
bool (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_is_superuser_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76555,9 +79079,9 @@ bool HP_sysinfo_is_superuser(void) {
{
retVal___ = HPMHooks.source.sysinfo.is_superuser();
}
- if( HPMHooks.count.HP_sysinfo_is_superuser_post ) {
+ if (HPMHooks.count.HP_sysinfo_is_superuser_post > 0) {
bool (*postHookFunc) (bool retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_is_superuser_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_is_superuser_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76566,14 +79090,14 @@ bool HP_sysinfo_is_superuser(void) {
}
void HP_sysinfo_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_init_pre ) {
+ if (HPMHooks.count.HP_sysinfo_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -76581,9 +79105,9 @@ void HP_sysinfo_init(void) {
{
HPMHooks.source.sysinfo.init();
}
- if( HPMHooks.count.HP_sysinfo_init_post ) {
+ if (HPMHooks.count.HP_sysinfo_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_init_post[hIndex].func;
postHookFunc();
}
@@ -76592,14 +79116,14 @@ void HP_sysinfo_init(void) {
}
void HP_sysinfo_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_sysinfo_final_pre ) {
+ if (HPMHooks.count.HP_sysinfo_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_sysinfo_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -76607,27 +79131,320 @@ void HP_sysinfo_final(void) {
{
HPMHooks.source.sysinfo.final();
}
- if( HPMHooks.count.HP_sysinfo_final_post ) {
+ if (HPMHooks.count.HP_sysinfo_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_sysinfo_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_sysinfo_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* timer */
+/* thread_interface */
+void HP_thread_init(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_init_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_init_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.init();
+ }
+ if (HPMHooks.count.HP_thread_init_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_init_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_init_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_thread_final(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_final_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_final_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.final();
+ }
+ if (HPMHooks.count.HP_thread_final_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_final_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_final_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+struct thread_handle* HP_thread_create(threadFunc entry_point, void *param) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_create_pre > 0) {
+ struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_create_pre[hIndex].func;
+ retVal___ = preHookFunc(&entry_point, &param);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.create(entry_point, param);
+ }
+ if (HPMHooks.count.HP_thread_create_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_create_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, entry_point, param);
+ }
+ }
+ return retVal___;
+}
+struct thread_handle* HP_thread_create_opt(threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_create_opt_pre > 0) {
+ struct thread_handle* (*preHookFunc) (threadFunc *entry_point, void **param, size_t *stack_size, enum thread_priority *prio);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_create_opt_pre[hIndex].func;
+ retVal___ = preHookFunc(&entry_point, &param, &stack_size, &prio);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.create_opt(entry_point, param, stack_size, prio);
+ }
+ if (HPMHooks.count.HP_thread_create_opt_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___, threadFunc entry_point, void *param, size_t stack_size, enum thread_priority prio);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_create_opt_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_create_opt_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, entry_point, param, stack_size, prio);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_destroy(struct thread_handle *handle) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_destroy_pre > 0) {
+ void (*preHookFunc) (struct thread_handle **handle);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_destroy_pre[hIndex].func;
+ preHookFunc(&handle);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.destroy(handle);
+ }
+ if (HPMHooks.count.HP_thread_destroy_post > 0) {
+ void (*postHookFunc) (struct thread_handle *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_destroy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_destroy_post[hIndex].func;
+ postHookFunc(handle);
+ }
+ }
+ return;
+}
+struct thread_handle* HP_thread_self(void) {
+ int hIndex = 0;
+ struct thread_handle* retVal___ = NULL;
+ if (HPMHooks.count.HP_thread_self_pre > 0) {
+ struct thread_handle* (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_self_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.self();
+ }
+ if (HPMHooks.count.HP_thread_self_post > 0) {
+ struct thread_handle* (*postHookFunc) (struct thread_handle* retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_self_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_self_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+int HP_thread_get_tid(void) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_thread_get_tid_pre > 0) {
+ int (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_get_tid_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.get_tid();
+ }
+ if (HPMHooks.count.HP_thread_get_tid_post > 0) {
+ int (*postHookFunc) (int retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_get_tid_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_get_tid_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+bool HP_thread_wait(struct thread_handle *handle, void **out_exit_code) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_thread_wait_pre > 0) {
+ bool (*preHookFunc) (struct thread_handle **handle, void ***out_exit_code);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_wait_pre[hIndex].func;
+ retVal___ = preHookFunc(&handle, &out_exit_code);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.wait(handle, out_exit_code);
+ }
+ if (HPMHooks.count.HP_thread_wait_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct thread_handle *handle, void **out_exit_code);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_wait_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_wait_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, handle, out_exit_code);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_prio_set(struct thread_handle *handle, enum thread_priority prio) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_prio_set_pre > 0) {
+ void (*preHookFunc) (struct thread_handle **handle, enum thread_priority *prio);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_prio_set_pre[hIndex].func;
+ preHookFunc(&handle, &prio);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.prio_set(handle, prio);
+ }
+ if (HPMHooks.count.HP_thread_prio_set_post > 0) {
+ void (*postHookFunc) (struct thread_handle *handle, enum thread_priority prio);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_set_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_prio_set_post[hIndex].func;
+ postHookFunc(handle, prio);
+ }
+ }
+ return;
+}
+enum thread_priority HP_thread_prio_get(struct thread_handle *handle) {
+ int hIndex = 0;
+ enum thread_priority retVal___ = THREADPRIO_NORMAL;
+ if (HPMHooks.count.HP_thread_prio_get_pre > 0) {
+ enum thread_priority (*preHookFunc) (struct thread_handle **handle);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_prio_get_pre[hIndex].func;
+ retVal___ = preHookFunc(&handle);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.thread.prio_get(handle);
+ }
+ if (HPMHooks.count.HP_thread_prio_get_post > 0) {
+ enum thread_priority (*postHookFunc) (enum thread_priority retVal___, struct thread_handle *handle);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_prio_get_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_prio_get_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, handle);
+ }
+ }
+ return retVal___;
+}
+void HP_thread_yield(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_thread_yield_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_thread_yield_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.thread.yield();
+ }
+ if (HPMHooks.count.HP_thread_yield_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_thread_yield_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_thread_yield_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+/* timer_interface */
int64 HP_timer_gettick(void) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_gettick_pre ) {
+ if (HPMHooks.count.HP_timer_gettick_pre > 0) {
int64 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_gettick_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76635,9 +79452,9 @@ int64 HP_timer_gettick(void) {
{
retVal___ = HPMHooks.source.timer.gettick();
}
- if( HPMHooks.count.HP_timer_gettick_post ) {
+ if (HPMHooks.count.HP_timer_gettick_post > 0) {
int64 (*postHookFunc) (int64 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_gettick_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76647,14 +79464,14 @@ int64 HP_timer_gettick(void) {
int64 HP_timer_gettick_nocache(void) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_gettick_nocache_pre ) {
+ if (HPMHooks.count.HP_timer_gettick_nocache_pre > 0) {
int64 (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_gettick_nocache_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76662,9 +79479,9 @@ int64 HP_timer_gettick_nocache(void) {
{
retVal___ = HPMHooks.source.timer.gettick_nocache();
}
- if( HPMHooks.count.HP_timer_gettick_nocache_post ) {
+ if (HPMHooks.count.HP_timer_gettick_nocache_post > 0) {
int64 (*postHookFunc) (int64 retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_gettick_nocache_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_gettick_nocache_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76674,14 +79491,14 @@ int64 HP_timer_gettick_nocache(void) {
int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_pre ) {
+ if (HPMHooks.count.HP_timer_add_pre > 0) {
int (*preHookFunc) (int64 *tick, TimerFunc *func, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_pre[hIndex].func;
retVal___ = preHookFunc(&tick, &func, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76689,11 +79506,11 @@ int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.timer.add(tick, func, id, data);
}
- if( HPMHooks.count.HP_timer_add_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, TimerFunc *func, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &func, &id, &data);
+ retVal___ = postHookFunc(retVal___, tick, func, id, data);
}
}
return retVal___;
@@ -76701,14 +79518,14 @@ int HP_timer_add(int64 tick, TimerFunc func, int id, intptr_t data) {
int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int interval) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_interval_pre ) {
+ if (HPMHooks.count.HP_timer_add_interval_pre > 0) {
int (*preHookFunc) (int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_interval_pre[hIndex].func;
retVal___ = preHookFunc(&tick, &func, &id, &data, &interval);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76716,11 +79533,11 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int
{
retVal___ = HPMHooks.source.timer.add_interval(tick, func, id, data, interval);
}
- if( HPMHooks.count.HP_timer_add_interval_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick, TimerFunc *func, int *id, intptr_t *data, int *interval);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_interval_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick, TimerFunc func, int id, intptr_t data, int interval);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_interval_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_interval_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick, &func, &id, &data, &interval);
+ retVal___ = postHookFunc(retVal___, tick, func, id, data, interval);
}
}
return retVal___;
@@ -76728,14 +79545,14 @@ int HP_timer_add_interval(int64 tick, TimerFunc func, int id, intptr_t data, int
const struct TimerData* HP_timer_get(int tid) {
int hIndex = 0;
const struct TimerData* retVal___ = NULL;
- if( HPMHooks.count.HP_timer_get_pre ) {
+ if (HPMHooks.count.HP_timer_get_pre > 0) {
const struct TimerData* (*preHookFunc) (int *tid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_get_pre[hIndex].func;
retVal___ = preHookFunc(&tid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76743,11 +79560,11 @@ const struct TimerData* HP_timer_get(int tid) {
{
retVal___ = HPMHooks.source.timer.get(tid);
}
- if( HPMHooks.count.HP_timer_get_post ) {
- const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int *tid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_get_post > 0) {
+ const struct TimerData* (*postHookFunc) (const struct TimerData* retVal___, int tid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_get_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid);
+ retVal___ = postHookFunc(retVal___, tid);
}
}
return retVal___;
@@ -76755,14 +79572,14 @@ const struct TimerData* HP_timer_get(int tid) {
int HP_timer_delete(int tid, TimerFunc func) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_delete_pre ) {
+ if (HPMHooks.count.HP_timer_delete_pre > 0) {
int (*preHookFunc) (int *tid, TimerFunc *func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_delete_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76770,11 +79587,11 @@ int HP_timer_delete(int tid, TimerFunc func) {
{
retVal___ = HPMHooks.source.timer.delete(tid, func);
}
- if( HPMHooks.count.HP_timer_delete_post ) {
- int (*postHookFunc) (int retVal___, int *tid, TimerFunc *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_delete_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, TimerFunc func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_delete_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_delete_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &func);
+ retVal___ = postHookFunc(retVal___, tid, func);
}
}
return retVal___;
@@ -76782,14 +79599,14 @@ int HP_timer_delete(int tid, TimerFunc func) {
int64 HP_timer_addtick(int tid, int64 tick) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_addtick_pre ) {
+ if (HPMHooks.count.HP_timer_addtick_pre > 0) {
int64 (*preHookFunc) (int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_addtick_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76797,11 +79614,11 @@ int64 HP_timer_addtick(int tid, int64 tick) {
{
retVal___ = HPMHooks.source.timer.addtick(tid, tick);
}
- if( HPMHooks.count.HP_timer_addtick_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_addtick_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_addtick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_addtick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, tid, tick);
}
}
return retVal___;
@@ -76809,14 +79626,14 @@ int64 HP_timer_addtick(int tid, int64 tick) {
int64 HP_timer_settick(int tid, int64 tick) {
int hIndex = 0;
int64 retVal___ = 0;
- if( HPMHooks.count.HP_timer_settick_pre ) {
+ if (HPMHooks.count.HP_timer_settick_pre > 0) {
int64 (*preHookFunc) (int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_settick_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76824,11 +79641,11 @@ int64 HP_timer_settick(int tid, int64 tick) {
{
retVal___ = HPMHooks.source.timer.settick(tid, tick);
}
- if( HPMHooks.count.HP_timer_settick_post ) {
- int64 (*postHookFunc) (int64 retVal___, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_settick_post > 0) {
+ int64 (*postHookFunc) (int64 retVal___, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_settick_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_settick_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, tid, tick);
}
}
return retVal___;
@@ -76836,14 +79653,14 @@ int64 HP_timer_settick(int tid, int64 tick) {
int HP_timer_add_func_list(TimerFunc func, char *name) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_add_func_list_pre ) {
- int (*preHookFunc) (TimerFunc *func, char *name);
+ if (HPMHooks.count.HP_timer_add_func_list_pre > 0) {
+ int (*preHookFunc) (TimerFunc *func, char **name);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_add_func_list_pre[hIndex].func;
- retVal___ = preHookFunc(&func, name);
+ retVal___ = preHookFunc(&func, &name);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76851,11 +79668,11 @@ int HP_timer_add_func_list(TimerFunc func, char *name) {
{
retVal___ = HPMHooks.source.timer.add_func_list(func, name);
}
- if( HPMHooks.count.HP_timer_add_func_list_post ) {
- int (*postHookFunc) (int retVal___, TimerFunc *func, char *name);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_add_func_list_post > 0) {
+ int (*postHookFunc) (int retVal___, TimerFunc func, char *name);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_add_func_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_add_func_list_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &func, name);
+ retVal___ = postHookFunc(retVal___, func, name);
}
}
return retVal___;
@@ -76863,14 +79680,14 @@ int HP_timer_add_func_list(TimerFunc func, char *name) {
unsigned long HP_timer_get_uptime(void) {
int hIndex = 0;
unsigned long retVal___ = 0;
- if( HPMHooks.count.HP_timer_get_uptime_pre ) {
+ if (HPMHooks.count.HP_timer_get_uptime_pre > 0) {
unsigned long (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_get_uptime_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76878,9 +79695,9 @@ unsigned long HP_timer_get_uptime(void) {
{
retVal___ = HPMHooks.source.timer.get_uptime();
}
- if( HPMHooks.count.HP_timer_get_uptime_post ) {
+ if (HPMHooks.count.HP_timer_get_uptime_post > 0) {
unsigned long (*postHookFunc) (unsigned long retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_get_uptime_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_get_uptime_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -76890,14 +79707,14 @@ unsigned long HP_timer_get_uptime(void) {
int HP_timer_perform(int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_timer_perform_pre ) {
+ if (HPMHooks.count.HP_timer_perform_pre > 0) {
int (*preHookFunc) (int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_perform_pre[hIndex].func;
retVal___ = preHookFunc(&tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -76905,25 +79722,25 @@ int HP_timer_perform(int64 tick) {
{
retVal___ = HPMHooks.source.timer.perform(tick);
}
- if( HPMHooks.count.HP_timer_perform_post ) {
- int (*postHookFunc) (int retVal___, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_post; hIndex++ ) {
+ if (HPMHooks.count.HP_timer_perform_post > 0) {
+ int (*postHookFunc) (int retVal___, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_perform_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_perform_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tick);
+ retVal___ = postHookFunc(retVal___, tick);
}
}
return retVal___;
}
void HP_timer_init(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_timer_init_pre ) {
+ if (HPMHooks.count.HP_timer_init_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_init_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -76931,9 +79748,9 @@ void HP_timer_init(void) {
{
HPMHooks.source.timer.init();
}
- if( HPMHooks.count.HP_timer_init_post ) {
+ if (HPMHooks.count.HP_timer_init_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_init_post[hIndex].func;
postHookFunc();
}
@@ -76942,14 +79759,14 @@ void HP_timer_init(void) {
}
void HP_timer_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_timer_final_pre ) {
+ if (HPMHooks.count.HP_timer_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_timer_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -76957,26 +79774,26 @@ void HP_timer_final(void) {
{
HPMHooks.source.timer.final();
}
- if( HPMHooks.count.HP_timer_final_post ) {
+ if (HPMHooks.count.HP_timer_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_timer_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_timer_final_post[hIndex].func;
postHookFunc();
}
}
return;
}
-/* trade */
+/* trade_interface */
void HP_trade_request(struct map_session_data *sd, struct map_session_data *target_sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_request_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, struct map_session_data *target_sd);
+ if (HPMHooks.count.HP_trade_request_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct map_session_data **target_sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_request_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_request_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_request_pre[hIndex].func;
- preHookFunc(sd, target_sd);
+ preHookFunc(&sd, &target_sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -76984,9 +79801,9 @@ void HP_trade_request(struct map_session_data *sd, struct map_session_data *targ
{
HPMHooks.source.trade.request(sd, target_sd);
}
- if( HPMHooks.count.HP_trade_request_post ) {
+ if (HPMHooks.count.HP_trade_request_post > 0) {
void (*postHookFunc) (struct map_session_data *sd, struct map_session_data *target_sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_request_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_request_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_request_post[hIndex].func;
postHookFunc(sd, target_sd);
}
@@ -76995,14 +79812,14 @@ void HP_trade_request(struct map_session_data *sd, struct map_session_data *targ
}
void HP_trade_ack(struct map_session_data *sd, int type) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_ack_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *type);
+ if (HPMHooks.count.HP_trade_ack_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_ack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_ack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_ack_pre[hIndex].func;
- preHookFunc(sd, &type);
+ preHookFunc(&sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77010,11 +79827,11 @@ void HP_trade_ack(struct map_session_data *sd, int type) {
{
HPMHooks.source.trade.ack(sd, type);
}
- if( HPMHooks.count.HP_trade_ack_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_ack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_trade_ack_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_ack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_ack_post[hIndex].func;
- postHookFunc(sd, &type);
+ postHookFunc(sd, type);
}
}
return;
@@ -77022,14 +79839,14 @@ void HP_trade_ack(struct map_session_data *sd, int type) {
int HP_trade_check_impossible(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_trade_check_impossible_pre ) {
- int (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_trade_check_impossible_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_impossible_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_impossible_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_check_impossible_pre[hIndex].func;
- retVal___ = preHookFunc(sd);
+ retVal___ = preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77037,9 +79854,9 @@ int HP_trade_check_impossible(struct map_session_data *sd) {
{
retVal___ = HPMHooks.source.trade.check_impossible(sd);
}
- if( HPMHooks.count.HP_trade_check_impossible_post ) {
+ if (HPMHooks.count.HP_trade_check_impossible_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_impossible_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_impossible_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_check_impossible_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd);
}
@@ -77049,14 +79866,14 @@ int HP_trade_check_impossible(struct map_session_data *sd) {
int HP_trade_check(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_trade_check_pre ) {
- int (*preHookFunc) (struct map_session_data *sd, struct map_session_data *tsd);
+ if (HPMHooks.count.HP_trade_check_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct map_session_data **tsd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_check_pre[hIndex].func;
- retVal___ = preHookFunc(sd, tsd);
+ retVal___ = preHookFunc(&sd, &tsd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77064,9 +79881,9 @@ int HP_trade_check(struct map_session_data *sd, struct map_session_data *tsd) {
{
retVal___ = HPMHooks.source.trade.check(sd, tsd);
}
- if( HPMHooks.count.HP_trade_check_post ) {
+ if (HPMHooks.count.HP_trade_check_post > 0) {
int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct map_session_data *tsd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_check_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_check_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, tsd);
}
@@ -77075,14 +79892,14 @@ int HP_trade_check(struct map_session_data *sd, struct map_session_data *tsd) {
}
void HP_trade_additem(struct map_session_data *sd, short index, short amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_additem_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, short *index, short *amount);
+ if (HPMHooks.count.HP_trade_additem_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, short *index, short *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_additem_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_additem_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_additem_pre[hIndex].func;
- preHookFunc(sd, &index, &amount);
+ preHookFunc(&sd, &index, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77090,25 +79907,25 @@ void HP_trade_additem(struct map_session_data *sd, short index, short amount) {
{
HPMHooks.source.trade.additem(sd, index, amount);
}
- if( HPMHooks.count.HP_trade_additem_post ) {
- void (*postHookFunc) (struct map_session_data *sd, short *index, short *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_additem_post; hIndex++ ) {
+ if (HPMHooks.count.HP_trade_additem_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, short index, short amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_additem_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_additem_post[hIndex].func;
- postHookFunc(sd, &index, &amount);
+ postHookFunc(sd, index, amount);
}
}
return;
}
void HP_trade_addzeny(struct map_session_data *sd, int amount) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_addzeny_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *amount);
+ if (HPMHooks.count.HP_trade_addzeny_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *amount);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_addzeny_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_addzeny_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_addzeny_pre[hIndex].func;
- preHookFunc(sd, &amount);
+ preHookFunc(&sd, &amount);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77116,25 +79933,25 @@ void HP_trade_addzeny(struct map_session_data *sd, int amount) {
{
HPMHooks.source.trade.addzeny(sd, amount);
}
- if( HPMHooks.count.HP_trade_addzeny_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *amount);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_addzeny_post; hIndex++ ) {
+ if (HPMHooks.count.HP_trade_addzeny_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int amount);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_addzeny_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_addzeny_post[hIndex].func;
- postHookFunc(sd, &amount);
+ postHookFunc(sd, amount);
}
}
return;
}
void HP_trade_ok(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_ok_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_trade_ok_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_ok_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_ok_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_ok_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77142,9 +79959,9 @@ void HP_trade_ok(struct map_session_data *sd) {
{
HPMHooks.source.trade.ok(sd);
}
- if( HPMHooks.count.HP_trade_ok_post ) {
+ if (HPMHooks.count.HP_trade_ok_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_ok_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_ok_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_ok_post[hIndex].func;
postHookFunc(sd);
}
@@ -77153,14 +79970,14 @@ void HP_trade_ok(struct map_session_data *sd) {
}
void HP_trade_cancel(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_cancel_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_trade_cancel_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_cancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_cancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_cancel_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77168,9 +79985,9 @@ void HP_trade_cancel(struct map_session_data *sd) {
{
HPMHooks.source.trade.cancel(sd);
}
- if( HPMHooks.count.HP_trade_cancel_post ) {
+ if (HPMHooks.count.HP_trade_cancel_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_cancel_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_cancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_cancel_post[hIndex].func;
postHookFunc(sd);
}
@@ -77179,14 +79996,14 @@ void HP_trade_cancel(struct map_session_data *sd) {
}
void HP_trade_commit(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_trade_commit_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_trade_commit_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_commit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_commit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_trade_commit_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77194,27 +80011,27 @@ void HP_trade_commit(struct map_session_data *sd) {
{
HPMHooks.source.trade.commit(sd);
}
- if( HPMHooks.count.HP_trade_commit_post ) {
+ if (HPMHooks.count.HP_trade_commit_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_trade_commit_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_trade_commit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_trade_commit_post[hIndex].func;
postHookFunc(sd);
}
}
return;
}
-/* unit */
+/* unit_interface */
int HP_unit_init(bool minimal) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_init_pre ) {
+ if (HPMHooks.count.HP_unit_init_pre > 0) {
int (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_init_pre[hIndex].func;
retVal___ = preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77222,11 +80039,11 @@ int HP_unit_init(bool minimal) {
{
retVal___ = HPMHooks.source.unit.init(minimal);
}
- if( HPMHooks.count.HP_unit_init_post ) {
- int (*postHookFunc) (int retVal___, bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_init_post > 0) {
+ int (*postHookFunc) (int retVal___, bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_init_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &minimal);
+ retVal___ = postHookFunc(retVal___, minimal);
}
}
return retVal___;
@@ -77234,14 +80051,14 @@ int HP_unit_init(bool minimal) {
int HP_unit_final(void) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_final_pre ) {
+ if (HPMHooks.count.HP_unit_final_pre > 0) {
int (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_final_pre[hIndex].func;
retVal___ = preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77249,9 +80066,9 @@ int HP_unit_final(void) {
{
retVal___ = HPMHooks.source.unit.final();
}
- if( HPMHooks.count.HP_unit_final_post ) {
+ if (HPMHooks.count.HP_unit_final_post > 0) {
int (*postHookFunc) (int retVal___);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_final_post[hIndex].func;
retVal___ = postHookFunc(retVal___);
}
@@ -77261,14 +80078,14 @@ int HP_unit_final(void) {
struct unit_data* HP_unit_bl2ud(struct block_list *bl) {
int hIndex = 0;
struct unit_data* retVal___ = NULL;
- if( HPMHooks.count.HP_unit_bl2ud_pre ) {
- struct unit_data* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_bl2ud_pre > 0) {
+ struct unit_data* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_bl2ud_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77276,9 +80093,9 @@ struct unit_data* HP_unit_bl2ud(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.bl2ud(bl);
}
- if( HPMHooks.count.HP_unit_bl2ud_post ) {
+ if (HPMHooks.count.HP_unit_bl2ud_post > 0) {
struct unit_data* (*postHookFunc) (struct unit_data* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_bl2ud_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -77288,14 +80105,14 @@ struct unit_data* HP_unit_bl2ud(struct block_list *bl) {
struct unit_data* HP_unit_bl2ud2(struct block_list *bl) {
int hIndex = 0;
struct unit_data* retVal___ = NULL;
- if( HPMHooks.count.HP_unit_bl2ud2_pre ) {
- struct unit_data* (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_bl2ud2_pre > 0) {
+ struct unit_data* (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_bl2ud2_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77303,26 +80120,52 @@ struct unit_data* HP_unit_bl2ud2(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.bl2ud2(bl);
}
- if( HPMHooks.count.HP_unit_bl2ud2_post ) {
+ if (HPMHooks.count.HP_unit_bl2ud2_post > 0) {
struct unit_data* (*postHookFunc) (struct unit_data* retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud2_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_bl2ud2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_bl2ud2_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
}
return retVal___;
}
+void HP_unit_init_ud(struct unit_data *ud) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_unit_init_ud_pre > 0) {
+ void (*preHookFunc) (struct unit_data **ud);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_init_ud_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_unit_init_ud_pre[hIndex].func;
+ preHookFunc(&ud);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.unit.init_ud(ud);
+ }
+ if (HPMHooks.count.HP_unit_init_ud_post > 0) {
+ void (*postHookFunc) (struct unit_data *ud);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_init_ud_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_unit_init_ud_post[hIndex].func;
+ postHookFunc(ud);
+ }
+ }
+ return;
+}
int HP_unit_attack_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_attack_timer_pre ) {
+ if (HPMHooks.count.HP_unit_attack_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_attack_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77330,11 +80173,11 @@ int HP_unit_attack_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.unit.attack_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_unit_attack_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_attack_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_attack_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -77342,14 +80185,14 @@ int HP_unit_attack_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_walktoxy_timer_pre ) {
+ if (HPMHooks.count.HP_unit_walktoxy_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_walktoxy_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77357,11 +80200,11 @@ int HP_unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.unit.walktoxy_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_unit_walktoxy_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_walktoxy_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_walktoxy_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -77369,14 +80212,14 @@ int HP_unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_unit_walktoxy_sub(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_walktoxy_sub_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_walktoxy_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_walktoxy_sub_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77384,9 +80227,9 @@ int HP_unit_walktoxy_sub(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.walktoxy_sub(bl);
}
- if( HPMHooks.count.HP_unit_walktoxy_sub_post ) {
+ if (HPMHooks.count.HP_unit_walktoxy_sub_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_sub_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_walktoxy_sub_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -77396,14 +80239,14 @@ int HP_unit_walktoxy_sub(struct block_list *bl) {
int HP_unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_delay_walktoxy_timer_pre ) {
+ if (HPMHooks.count.HP_unit_delay_walktoxy_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_delay_walktoxy_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_delay_walktoxy_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_delay_walktoxy_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77411,11 +80254,11 @@ int HP_unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.unit.delay_walktoxy_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_unit_delay_walktoxy_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_delay_walktoxy_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_delay_walktoxy_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_delay_walktoxy_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_delay_walktoxy_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -77423,14 +80266,14 @@ int HP_unit_delay_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
int HP_unit_walktoxy(struct block_list *bl, short x, short y, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_walktoxy_pre ) {
- int (*preHookFunc) (struct block_list *bl, short *x, short *y, int *flag);
+ if (HPMHooks.count.HP_unit_walktoxy_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, short *x, short *y, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_walktoxy_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &x, &y, &flag);
+ retVal___ = preHookFunc(&bl, &x, &y, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77438,11 +80281,11 @@ int HP_unit_walktoxy(struct block_list *bl, short x, short y, int flag) {
{
retVal___ = HPMHooks.source.unit.walktoxy(bl, x, y, flag);
}
- if( HPMHooks.count.HP_unit_walktoxy_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, short *x, short *y, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_walktoxy_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, short x, short y, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktoxy_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_walktoxy_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &x, &y, &flag);
+ retVal___ = postHookFunc(retVal___, bl, x, y, flag);
}
}
return retVal___;
@@ -77450,14 +80293,14 @@ int HP_unit_walktoxy(struct block_list *bl, short x, short y, int flag) {
int HP_unit_walktobl_sub(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_walktobl_sub_pre ) {
+ if (HPMHooks.count.HP_unit_walktobl_sub_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_walktobl_sub_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77465,11 +80308,11 @@ int HP_unit_walktobl_sub(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.unit.walktobl_sub(tid, tick, id, data);
}
- if( HPMHooks.count.HP_unit_walktobl_sub_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_walktobl_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_walktobl_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -77477,14 +80320,14 @@ int HP_unit_walktobl_sub(int tid, int64 tick, int id, intptr_t data) {
int HP_unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_walktobl_pre ) {
- int (*preHookFunc) (struct block_list *bl, struct block_list *tbl, int *range, int *flag);
+ if (HPMHooks.count.HP_unit_walktobl_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, struct block_list **tbl, int *range, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_walktobl_pre[hIndex].func;
- retVal___ = preHookFunc(bl, tbl, &range, &flag);
+ retVal___ = preHookFunc(&bl, &tbl, &range, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77492,11 +80335,11 @@ int HP_unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, i
{
retVal___ = HPMHooks.source.unit.walktobl(bl, tbl, range, flag);
}
- if( HPMHooks.count.HP_unit_walktobl_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, struct block_list *tbl, int *range, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_walktobl_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, struct block_list *tbl, int range, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_walktobl_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_walktobl_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, tbl, &range, &flag);
+ retVal___ = postHookFunc(retVal___, bl, tbl, range, flag);
}
}
return retVal___;
@@ -77504,14 +80347,14 @@ int HP_unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, i
bool HP_unit_run(struct block_list *bl, struct map_session_data *sd, enum sc_type type) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_unit_run_pre ) {
- bool (*preHookFunc) (struct block_list *bl, struct map_session_data *sd, enum sc_type *type);
+ if (HPMHooks.count.HP_unit_run_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl, struct map_session_data **sd, enum sc_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_run_pre[hIndex].func;
- retVal___ = preHookFunc(bl, sd, &type);
+ retVal___ = preHookFunc(&bl, &sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77519,25 +80362,25 @@ bool HP_unit_run(struct block_list *bl, struct map_session_data *sd, enum sc_typ
{
retVal___ = HPMHooks.source.unit.run(bl, sd, type);
}
- if( HPMHooks.count.HP_unit_run_post ) {
- bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct map_session_data *sd, enum sc_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_run_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct map_session_data *sd, enum sc_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_run_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, sd, &type);
+ retVal___ = postHookFunc(retVal___, bl, sd, type);
}
}
return retVal___;
}
void HP_unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type) {
int hIndex = 0;
- if( HPMHooks.count.HP_unit_run_hit_pre ) {
- void (*preHookFunc) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type *type);
+ if (HPMHooks.count.HP_unit_run_hit_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, struct status_change **sc, struct map_session_data **sd, enum sc_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_hit_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_hit_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_run_hit_pre[hIndex].func;
- preHookFunc(bl, sc, sd, &type);
+ preHookFunc(&bl, &sc, &sd, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77545,11 +80388,11 @@ void HP_unit_run_hit(struct block_list *bl, struct status_change *sc, struct map
{
HPMHooks.source.unit.run_hit(bl, sc, sd, type);
}
- if( HPMHooks.count.HP_unit_run_hit_post ) {
- void (*postHookFunc) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_hit_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_run_hit_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_hit_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_run_hit_post[hIndex].func;
- postHookFunc(bl, sc, sd, &type);
+ postHookFunc(bl, sc, sd, type);
}
}
return;
@@ -77557,14 +80400,14 @@ void HP_unit_run_hit(struct block_list *bl, struct status_change *sc, struct map
int HP_unit_escape(struct block_list *bl, struct block_list *target, short dist) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_escape_pre ) {
- int (*preHookFunc) (struct block_list *bl, struct block_list *target, short *dist);
+ if (HPMHooks.count.HP_unit_escape_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, struct block_list **target, short *dist);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_escape_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_escape_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_escape_pre[hIndex].func;
- retVal___ = preHookFunc(bl, target, &dist);
+ retVal___ = preHookFunc(&bl, &target, &dist);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77572,11 +80415,11 @@ int HP_unit_escape(struct block_list *bl, struct block_list *target, short dist)
{
retVal___ = HPMHooks.source.unit.escape(bl, target, dist);
}
- if( HPMHooks.count.HP_unit_escape_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, struct block_list *target, short *dist);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_escape_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_escape_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, struct block_list *target, short dist);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_escape_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_escape_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, target, &dist);
+ retVal___ = postHookFunc(retVal___, bl, target, dist);
}
}
return retVal___;
@@ -77584,14 +80427,14 @@ int HP_unit_escape(struct block_list *bl, struct block_list *target, short dist)
int HP_unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_movepos_pre ) {
- int (*preHookFunc) (struct block_list *bl, short *dst_x, short *dst_y, int *easy, bool *checkpath);
+ if (HPMHooks.count.HP_unit_movepos_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, short *dst_x, short *dst_y, int *easy, bool *checkpath);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_movepos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_movepos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_movepos_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &dst_x, &dst_y, &easy, &checkpath);
+ retVal___ = preHookFunc(&bl, &dst_x, &dst_y, &easy, &checkpath);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77599,11 +80442,11 @@ int HP_unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, b
{
retVal___ = HPMHooks.source.unit.movepos(bl, dst_x, dst_y, easy, checkpath);
}
- if( HPMHooks.count.HP_unit_movepos_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, short *dst_x, short *dst_y, int *easy, bool *checkpath);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_movepos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_movepos_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_movepos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_movepos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &dst_x, &dst_y, &easy, &checkpath);
+ retVal___ = postHookFunc(retVal___, bl, dst_x, dst_y, easy, checkpath);
}
}
return retVal___;
@@ -77611,14 +80454,14 @@ int HP_unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, b
int HP_unit_setdir(struct block_list *bl, unsigned char dir) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_setdir_pre ) {
- int (*preHookFunc) (struct block_list *bl, unsigned char *dir);
+ if (HPMHooks.count.HP_unit_setdir_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, unsigned char *dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_setdir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_setdir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_setdir_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &dir);
+ retVal___ = preHookFunc(&bl, &dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77626,11 +80469,11 @@ int HP_unit_setdir(struct block_list *bl, unsigned char dir) {
{
retVal___ = HPMHooks.source.unit.setdir(bl, dir);
}
- if( HPMHooks.count.HP_unit_setdir_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned char *dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_setdir_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_setdir_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned char dir);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_setdir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_setdir_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &dir);
+ retVal___ = postHookFunc(retVal___, bl, dir);
}
}
return retVal___;
@@ -77638,14 +80481,14 @@ int HP_unit_setdir(struct block_list *bl, unsigned char dir) {
uint8 HP_unit_getdir(struct block_list *bl) {
int hIndex = 0;
uint8 retVal___ = 0;
- if( HPMHooks.count.HP_unit_getdir_pre ) {
- uint8 (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_getdir_pre > 0) {
+ uint8 (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_getdir_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_getdir_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_getdir_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77653,9 +80496,9 @@ uint8 HP_unit_getdir(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.getdir(bl);
}
- if( HPMHooks.count.HP_unit_getdir_post ) {
+ if (HPMHooks.count.HP_unit_getdir_post > 0) {
uint8 (*postHookFunc) (uint8 retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_getdir_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_getdir_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_getdir_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -77665,14 +80508,14 @@ uint8 HP_unit_getdir(struct block_list *bl) {
int HP_unit_blown(struct block_list *bl, int dx, int dy, int count, int flag) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_blown_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *dx, int *dy, int *count, int *flag);
+ if (HPMHooks.count.HP_unit_blown_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *dx, int *dy, int *count, int *flag);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_blown_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_blown_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_blown_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &dx, &dy, &count, &flag);
+ retVal___ = preHookFunc(&bl, &dx, &dy, &count, &flag);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77680,11 +80523,11 @@ int HP_unit_blown(struct block_list *bl, int dx, int dy, int count, int flag) {
{
retVal___ = HPMHooks.source.unit.blown(bl, dx, dy, count, flag);
}
- if( HPMHooks.count.HP_unit_blown_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *dx, int *dy, int *count, int *flag);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_blown_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_blown_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int dx, int dy, int count, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_blown_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_blown_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &dx, &dy, &count, &flag);
+ retVal___ = postHookFunc(retVal___, bl, dx, dy, count, flag);
}
}
return retVal___;
@@ -77692,14 +80535,14 @@ int HP_unit_blown(struct block_list *bl, int dx, int dy, int count, int flag) {
int HP_unit_warp(struct block_list *bl, short m, short x, short y, clr_type type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_warp_pre ) {
- int (*preHookFunc) (struct block_list *bl, short *m, short *x, short *y, clr_type *type);
+ if (HPMHooks.count.HP_unit_warp_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, short *m, short *x, short *y, clr_type *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_warp_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_warp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_warp_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &m, &x, &y, &type);
+ retVal___ = preHookFunc(&bl, &m, &x, &y, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77707,11 +80550,11 @@ int HP_unit_warp(struct block_list *bl, short m, short x, short y, clr_type type
{
retVal___ = HPMHooks.source.unit.warp(bl, m, x, y, type);
}
- if( HPMHooks.count.HP_unit_warp_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, short *m, short *x, short *y, clr_type *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_warp_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_warp_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, short m, short x, short y, clr_type type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_warp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_warp_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &m, &x, &y, &type);
+ retVal___ = postHookFunc(retVal___, bl, m, x, y, type);
}
}
return retVal___;
@@ -77719,14 +80562,14 @@ int HP_unit_warp(struct block_list *bl, short m, short x, short y, clr_type type
int HP_unit_stop_walking(struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_stop_walking_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_unit_stop_walking_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_walking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_walking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_stop_walking_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type);
+ retVal___ = preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77734,11 +80577,11 @@ int HP_unit_stop_walking(struct block_list *bl, int type) {
{
retVal___ = HPMHooks.source.unit.stop_walking(bl, type);
}
- if( HPMHooks.count.HP_unit_stop_walking_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_walking_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_stop_walking_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_walking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_stop_walking_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type);
+ retVal___ = postHookFunc(retVal___, bl, type);
}
}
return retVal___;
@@ -77746,14 +80589,14 @@ int HP_unit_stop_walking(struct block_list *bl, int type) {
int HP_unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_skilluse_id_pre ) {
- int (*preHookFunc) (struct block_list *src, int *target_id, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_unit_skilluse_id_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int *target_id, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_skilluse_id_pre[hIndex].func;
- retVal___ = preHookFunc(src, &target_id, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&src, &target_id, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77761,11 +80604,11 @@ int HP_unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_id,
{
retVal___ = HPMHooks.source.unit.skilluse_id(src, target_id, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_unit_skilluse_id_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int *target_id, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_skilluse_id_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_skilluse_id_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &target_id, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, src, target_id, skill_id, skill_lv);
}
}
return retVal___;
@@ -77773,14 +80616,14 @@ int HP_unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_id,
int HP_unit_step_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_step_timer_pre ) {
+ if (HPMHooks.count.HP_unit_step_timer_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_step_timer_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_step_timer_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_step_timer_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77788,25 +80631,25 @@ int HP_unit_step_timer(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.unit.step_timer(tid, tick, id, data);
}
- if( HPMHooks.count.HP_unit_step_timer_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_step_timer_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_step_timer_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_step_timer_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_step_timer_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
}
void HP_unit_stop_stepaction(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_unit_stop_stepaction_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_stop_stepaction_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_stepaction_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_stepaction_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_stop_stepaction_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -77814,9 +80657,9 @@ void HP_unit_stop_stepaction(struct block_list *bl) {
{
HPMHooks.source.unit.stop_stepaction(bl);
}
- if( HPMHooks.count.HP_unit_stop_stepaction_post ) {
+ if (HPMHooks.count.HP_unit_stop_stepaction_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_stepaction_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_stepaction_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_stop_stepaction_post[hIndex].func;
postHookFunc(bl);
}
@@ -77826,14 +80669,14 @@ void HP_unit_stop_stepaction(struct block_list *bl) {
int HP_unit_is_walking(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_is_walking_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_is_walking_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_is_walking_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_is_walking_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_is_walking_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77841,9 +80684,9 @@ int HP_unit_is_walking(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.is_walking(bl);
}
- if( HPMHooks.count.HP_unit_is_walking_post ) {
+ if (HPMHooks.count.HP_unit_is_walking_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_is_walking_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_is_walking_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_is_walking_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -77853,14 +80696,14 @@ int HP_unit_is_walking(struct block_list *bl) {
int HP_unit_can_move(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_can_move_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_can_move_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_move_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_move_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_can_move_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77868,9 +80711,9 @@ int HP_unit_can_move(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.can_move(bl);
}
- if( HPMHooks.count.HP_unit_can_move_post ) {
+ if (HPMHooks.count.HP_unit_can_move_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_move_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_move_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_can_move_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -77880,14 +80723,14 @@ int HP_unit_can_move(struct block_list *bl) {
int HP_unit_resume_running(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_resume_running_pre ) {
+ if (HPMHooks.count.HP_unit_resume_running_pre > 0) {
int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_resume_running_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_resume_running_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_resume_running_pre[hIndex].func;
retVal___ = preHookFunc(&tid, &tick, &id, &data);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77895,11 +80738,11 @@ int HP_unit_resume_running(int tid, int64 tick, int id, intptr_t data) {
{
retVal___ = HPMHooks.source.unit.resume_running(tid, tick, id, data);
}
- if( HPMHooks.count.HP_unit_resume_running_post ) {
- int (*postHookFunc) (int retVal___, int *tid, int64 *tick, int *id, intptr_t *data);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_resume_running_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_resume_running_post > 0) {
+ int (*postHookFunc) (int retVal___, int tid, int64 tick, int id, intptr_t data);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_resume_running_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_resume_running_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ retVal___ = postHookFunc(retVal___, tid, tick, id, data);
}
}
return retVal___;
@@ -77907,14 +80750,14 @@ int HP_unit_resume_running(int tid, int64 tick, int id, intptr_t data) {
int HP_unit_set_walkdelay(struct block_list *bl, int64 tick, int delay, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_set_walkdelay_pre ) {
- int (*preHookFunc) (struct block_list *bl, int64 *tick, int *delay, int *type);
+ if (HPMHooks.count.HP_unit_set_walkdelay_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int64 *tick, int *delay, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_walkdelay_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_walkdelay_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_set_walkdelay_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &tick, &delay, &type);
+ retVal___ = preHookFunc(&bl, &tick, &delay, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77922,11 +80765,11 @@ int HP_unit_set_walkdelay(struct block_list *bl, int64 tick, int delay, int type
{
retVal___ = HPMHooks.source.unit.set_walkdelay(bl, tick, delay, type);
}
- if( HPMHooks.count.HP_unit_set_walkdelay_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int64 *tick, int *delay, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_walkdelay_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_set_walkdelay_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int64 tick, int delay, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_walkdelay_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_set_walkdelay_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &tick, &delay, &type);
+ retVal___ = postHookFunc(retVal___, bl, tick, delay, type);
}
}
return retVal___;
@@ -77934,14 +80777,14 @@ int HP_unit_set_walkdelay(struct block_list *bl, int64 tick, int delay, int type
int HP_unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_skilluse_id2_pre ) {
- int (*preHookFunc) (struct block_list *src, int *target_id, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
+ if (HPMHooks.count.HP_unit_skilluse_id2_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int *target_id, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_skilluse_id2_pre[hIndex].func;
- retVal___ = preHookFunc(src, &target_id, &skill_id, &skill_lv, &casttime, &castcancel);
+ retVal___ = preHookFunc(&src, &target_id, &skill_id, &skill_lv, &casttime, &castcancel);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77949,11 +80792,11 @@ int HP_unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id,
{
retVal___ = HPMHooks.source.unit.skilluse_id2(src, target_id, skill_id, skill_lv, casttime, castcancel);
}
- if( HPMHooks.count.HP_unit_skilluse_id2_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int *target_id, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_skilluse_id2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int target_id, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_id2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_skilluse_id2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &target_id, &skill_id, &skill_lv, &casttime, &castcancel);
+ retVal___ = postHookFunc(retVal___, src, target_id, skill_id, skill_lv, casttime, castcancel);
}
}
return retVal___;
@@ -77961,14 +80804,14 @@ int HP_unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id,
int HP_unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_skilluse_pos_pre ) {
- int (*preHookFunc) (struct block_list *src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv);
+ if (HPMHooks.count.HP_unit_skilluse_pos_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_skilluse_pos_pre[hIndex].func;
- retVal___ = preHookFunc(src, &skill_x, &skill_y, &skill_id, &skill_lv);
+ retVal___ = preHookFunc(&src, &skill_x, &skill_y, &skill_id, &skill_lv);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -77976,11 +80819,11 @@ int HP_unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, u
{
retVal___ = HPMHooks.source.unit.skilluse_pos(src, skill_x, skill_y, skill_id, skill_lv);
}
- if( HPMHooks.count.HP_unit_skilluse_pos_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_skilluse_pos_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_skilluse_pos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &skill_x, &skill_y, &skill_id, &skill_lv);
+ retVal___ = postHookFunc(retVal___, src, skill_x, skill_y, skill_id, skill_lv);
}
}
return retVal___;
@@ -77988,14 +80831,14 @@ int HP_unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, u
int HP_unit_skilluse_pos2(struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_skilluse_pos2_pre ) {
- int (*preHookFunc) (struct block_list *src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
+ if (HPMHooks.count.HP_unit_skilluse_pos2_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos2_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos2_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_skilluse_pos2_pre[hIndex].func;
- retVal___ = preHookFunc(src, &skill_x, &skill_y, &skill_id, &skill_lv, &casttime, &castcancel);
+ retVal___ = preHookFunc(&src, &skill_x, &skill_y, &skill_id, &skill_lv, &casttime, &castcancel);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78003,11 +80846,11 @@ int HP_unit_skilluse_pos2(struct block_list *src, short skill_x, short skill_y,
{
retVal___ = HPMHooks.source.unit.skilluse_pos2(src, skill_x, skill_y, skill_id, skill_lv, casttime, castcancel);
}
- if( HPMHooks.count.HP_unit_skilluse_pos2_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, short *skill_x, short *skill_y, uint16 *skill_id, uint16 *skill_lv, int *casttime, int *castcancel);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos2_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_skilluse_pos2_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, short skill_x, short skill_y, uint16 skill_id, uint16 skill_lv, int casttime, int castcancel);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skilluse_pos2_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_skilluse_pos2_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &skill_x, &skill_y, &skill_id, &skill_lv, &casttime, &castcancel);
+ retVal___ = postHookFunc(retVal___, src, skill_x, skill_y, skill_id, skill_lv, casttime, castcancel);
}
}
return retVal___;
@@ -78015,14 +80858,14 @@ int HP_unit_skilluse_pos2(struct block_list *src, short skill_x, short skill_y,
int HP_unit_set_target(struct unit_data *ud, int target_id) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_set_target_pre ) {
- int (*preHookFunc) (struct unit_data *ud, int *target_id);
+ if (HPMHooks.count.HP_unit_set_target_pre > 0) {
+ int (*preHookFunc) (struct unit_data **ud, int *target_id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_target_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_target_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_set_target_pre[hIndex].func;
- retVal___ = preHookFunc(ud, &target_id);
+ retVal___ = preHookFunc(&ud, &target_id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78030,25 +80873,25 @@ int HP_unit_set_target(struct unit_data *ud, int target_id) {
{
retVal___ = HPMHooks.source.unit.set_target(ud, target_id);
}
- if( HPMHooks.count.HP_unit_set_target_post ) {
- int (*postHookFunc) (int retVal___, struct unit_data *ud, int *target_id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_target_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_set_target_post > 0) {
+ int (*postHookFunc) (int retVal___, struct unit_data *ud, int target_id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_set_target_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_set_target_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, ud, &target_id);
+ retVal___ = postHookFunc(retVal___, ud, target_id);
}
}
return retVal___;
}
void HP_unit_stop_attack(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_unit_stop_attack_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_stop_attack_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_stop_attack_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78056,9 +80899,9 @@ void HP_unit_stop_attack(struct block_list *bl) {
{
HPMHooks.source.unit.stop_attack(bl);
}
- if( HPMHooks.count.HP_unit_stop_attack_post ) {
+ if (HPMHooks.count.HP_unit_stop_attack_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_attack_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_stop_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_stop_attack_post[hIndex].func;
postHookFunc(bl);
}
@@ -78068,14 +80911,14 @@ void HP_unit_stop_attack(struct block_list *bl) {
int HP_unit_unattackable(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_unattackable_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_unattackable_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_unattackable_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_unattackable_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_unattackable_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78083,9 +80926,9 @@ int HP_unit_unattackable(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.unattackable(bl);
}
- if( HPMHooks.count.HP_unit_unattackable_post ) {
+ if (HPMHooks.count.HP_unit_unattackable_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_unattackable_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_unattackable_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_unattackable_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -78095,14 +80938,14 @@ int HP_unit_unattackable(struct block_list *bl) {
int HP_unit_attack(struct block_list *src, int target_id, int continuous) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_attack_pre ) {
- int (*preHookFunc) (struct block_list *src, int *target_id, int *continuous);
+ if (HPMHooks.count.HP_unit_attack_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int *target_id, int *continuous);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_attack_pre[hIndex].func;
- retVal___ = preHookFunc(src, &target_id, &continuous);
+ retVal___ = preHookFunc(&src, &target_id, &continuous);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78110,11 +80953,11 @@ int HP_unit_attack(struct block_list *src, int target_id, int continuous) {
{
retVal___ = HPMHooks.source.unit.attack(src, target_id, continuous);
}
- if( HPMHooks.count.HP_unit_attack_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int *target_id, int *continuous);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_attack_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int target_id, int continuous);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_attack_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &target_id, &continuous);
+ retVal___ = postHookFunc(retVal___, src, target_id, continuous);
}
}
return retVal___;
@@ -78122,14 +80965,14 @@ int HP_unit_attack(struct block_list *src, int target_id, int continuous) {
int HP_unit_cancel_combo(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_cancel_combo_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_cancel_combo_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_cancel_combo_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_cancel_combo_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_cancel_combo_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78137,9 +80980,9 @@ int HP_unit_cancel_combo(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.cancel_combo(bl);
}
- if( HPMHooks.count.HP_unit_cancel_combo_post ) {
+ if (HPMHooks.count.HP_unit_cancel_combo_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_cancel_combo_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_cancel_combo_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_cancel_combo_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -78149,14 +80992,14 @@ int HP_unit_cancel_combo(struct block_list *bl) {
bool HP_unit_can_reach_pos(struct block_list *bl, int x, int y, int easy) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_unit_can_reach_pos_pre ) {
- bool (*preHookFunc) (struct block_list *bl, int *x, int *y, int *easy);
+ if (HPMHooks.count.HP_unit_can_reach_pos_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl, int *x, int *y, int *easy);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_can_reach_pos_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &x, &y, &easy);
+ retVal___ = preHookFunc(&bl, &x, &y, &easy);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78164,11 +81007,11 @@ bool HP_unit_can_reach_pos(struct block_list *bl, int x, int y, int easy) {
{
retVal___ = HPMHooks.source.unit.can_reach_pos(bl, x, y, easy);
}
- if( HPMHooks.count.HP_unit_can_reach_pos_post ) {
- bool (*postHookFunc) (bool retVal___, struct block_list *bl, int *x, int *y, int *easy);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_can_reach_pos_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct block_list *bl, int x, int y, int easy);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_can_reach_pos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &x, &y, &easy);
+ retVal___ = postHookFunc(retVal___, bl, x, y, easy);
}
}
return retVal___;
@@ -78176,14 +81019,14 @@ bool HP_unit_can_reach_pos(struct block_list *bl, int x, int y, int easy) {
bool HP_unit_can_reach_bl(struct block_list *bl, struct block_list *tbl, int range, int easy, short *x, short *y) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_unit_can_reach_bl_pre ) {
- bool (*preHookFunc) (struct block_list *bl, struct block_list *tbl, int *range, int *easy, short *x, short *y);
+ if (HPMHooks.count.HP_unit_can_reach_bl_pre > 0) {
+ bool (*preHookFunc) (struct block_list **bl, struct block_list **tbl, int *range, int *easy, short **x, short **y);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_bl_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_bl_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_can_reach_bl_pre[hIndex].func;
- retVal___ = preHookFunc(bl, tbl, &range, &easy, x, y);
+ retVal___ = preHookFunc(&bl, &tbl, &range, &easy, &x, &y);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78191,11 +81034,11 @@ bool HP_unit_can_reach_bl(struct block_list *bl, struct block_list *tbl, int ran
{
retVal___ = HPMHooks.source.unit.can_reach_bl(bl, tbl, range, easy, x, y);
}
- if( HPMHooks.count.HP_unit_can_reach_bl_post ) {
- bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct block_list *tbl, int *range, int *easy, short *x, short *y);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_bl_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_can_reach_bl_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct block_list *tbl, int range, int easy, short *x, short *y);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_can_reach_bl_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_can_reach_bl_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, tbl, &range, &easy, x, y);
+ retVal___ = postHookFunc(retVal___, bl, tbl, range, easy, x, y);
}
}
return retVal___;
@@ -78203,14 +81046,14 @@ bool HP_unit_can_reach_bl(struct block_list *bl, struct block_list *tbl, int ran
int HP_unit_calc_pos(struct block_list *bl, int tx, int ty, uint8 dir) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_calc_pos_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *tx, int *ty, uint8 *dir);
+ if (HPMHooks.count.HP_unit_calc_pos_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *tx, int *ty, uint8 *dir);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_calc_pos_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_calc_pos_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_calc_pos_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &tx, &ty, &dir);
+ retVal___ = preHookFunc(&bl, &tx, &ty, &dir);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78218,11 +81061,11 @@ int HP_unit_calc_pos(struct block_list *bl, int tx, int ty, uint8 dir) {
{
retVal___ = HPMHooks.source.unit.calc_pos(bl, tx, ty, dir);
}
- if( HPMHooks.count.HP_unit_calc_pos_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *tx, int *ty, uint8 *dir);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_calc_pos_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_calc_pos_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int tx, int ty, uint8 dir);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_calc_pos_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_calc_pos_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &tx, &ty, &dir);
+ retVal___ = postHookFunc(retVal___, bl, tx, ty, dir);
}
}
return retVal___;
@@ -78230,14 +81073,14 @@ int HP_unit_calc_pos(struct block_list *bl, int tx, int ty, uint8 dir) {
int HP_unit_attack_timer_sub(struct block_list *src, int tid, int64 tick) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_attack_timer_sub_pre ) {
- int (*preHookFunc) (struct block_list *src, int *tid, int64 *tick);
+ if (HPMHooks.count.HP_unit_attack_timer_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, int *tid, int64 *tick);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_sub_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_attack_timer_sub_pre[hIndex].func;
- retVal___ = preHookFunc(src, &tid, &tick);
+ retVal___ = preHookFunc(&src, &tid, &tick);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78245,11 +81088,11 @@ int HP_unit_attack_timer_sub(struct block_list *src, int tid, int64 tick) {
{
retVal___ = HPMHooks.source.unit.attack_timer_sub(src, tid, tick);
}
- if( HPMHooks.count.HP_unit_attack_timer_sub_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, int *tid, int64 *tick);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_sub_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_attack_timer_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, int tid, int64 tick);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_attack_timer_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_attack_timer_sub_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, &tid, &tick);
+ retVal___ = postHookFunc(retVal___, src, tid, tick);
}
}
return retVal___;
@@ -78257,14 +81100,14 @@ int HP_unit_attack_timer_sub(struct block_list *src, int tid, int64 tick) {
int HP_unit_skillcastcancel(struct block_list *bl, int type) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_skillcastcancel_pre ) {
- int (*preHookFunc) (struct block_list *bl, int *type);
+ if (HPMHooks.count.HP_unit_skillcastcancel_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, int *type);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skillcastcancel_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skillcastcancel_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_skillcastcancel_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &type);
+ retVal___ = preHookFunc(&bl, &type);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78272,25 +81115,25 @@ int HP_unit_skillcastcancel(struct block_list *bl, int type) {
{
retVal___ = HPMHooks.source.unit.skillcastcancel(bl, type);
}
- if( HPMHooks.count.HP_unit_skillcastcancel_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int *type);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_skillcastcancel_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_skillcastcancel_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int type);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_skillcastcancel_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_skillcastcancel_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &type);
+ retVal___ = postHookFunc(retVal___, bl, type);
}
}
return retVal___;
}
void HP_unit_dataset(struct block_list *bl) {
int hIndex = 0;
- if( HPMHooks.count.HP_unit_dataset_pre ) {
- void (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_dataset_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_dataset_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_dataset_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_dataset_pre[hIndex].func;
- preHookFunc(bl);
+ preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78298,9 +81141,9 @@ void HP_unit_dataset(struct block_list *bl) {
{
HPMHooks.source.unit.dataset(bl);
}
- if( HPMHooks.count.HP_unit_dataset_post ) {
+ if (HPMHooks.count.HP_unit_dataset_post > 0) {
void (*postHookFunc) (struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_dataset_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_dataset_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_dataset_post[hIndex].func;
postHookFunc(bl);
}
@@ -78310,14 +81153,14 @@ void HP_unit_dataset(struct block_list *bl) {
int HP_unit_counttargeted(struct block_list *bl) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_counttargeted_pre ) {
- int (*preHookFunc) (struct block_list *bl);
+ if (HPMHooks.count.HP_unit_counttargeted_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_counttargeted_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_counttargeted_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_counttargeted_pre[hIndex].func;
- retVal___ = preHookFunc(bl);
+ retVal___ = preHookFunc(&bl);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78325,9 +81168,9 @@ int HP_unit_counttargeted(struct block_list *bl) {
{
retVal___ = HPMHooks.source.unit.counttargeted(bl);
}
- if( HPMHooks.count.HP_unit_counttargeted_post ) {
+ if (HPMHooks.count.HP_unit_counttargeted_post > 0) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_counttargeted_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_counttargeted_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_counttargeted_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
}
@@ -78337,14 +81180,14 @@ int HP_unit_counttargeted(struct block_list *bl) {
int HP_unit_fixdamage(struct block_list *src, struct block_list *target, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_fixdamage_pre ) {
- int (*preHookFunc) (struct block_list *src, struct block_list *target, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
+ if (HPMHooks.count.HP_unit_fixdamage_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **target, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_fixdamage_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_fixdamage_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_fixdamage_pre[hIndex].func;
- retVal___ = preHookFunc(src, target, &sdelay, &ddelay, &damage, &div, &type, &damage2);
+ retVal___ = preHookFunc(&src, &target, &sdelay, &ddelay, &damage, &div, &type, &damage2);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78352,11 +81195,11 @@ int HP_unit_fixdamage(struct block_list *src, struct block_list *target, int sde
{
retVal___ = HPMHooks.source.unit.fixdamage(src, target, sdelay, ddelay, damage, div, type, damage2);
}
- if( HPMHooks.count.HP_unit_fixdamage_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int *sdelay, int *ddelay, int64 *damage, short *div, unsigned char *type, int64 *damage2);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_fixdamage_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_fixdamage_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *target, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_fixdamage_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_fixdamage_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, target, &sdelay, &ddelay, &damage, &div, &type, &damage2);
+ retVal___ = postHookFunc(retVal___, src, target, sdelay, ddelay, damage, div, type, damage2);
}
}
return retVal___;
@@ -78364,14 +81207,14 @@ int HP_unit_fixdamage(struct block_list *src, struct block_list *target, int sde
int HP_unit_changeviewsize(struct block_list *bl, short size) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_changeviewsize_pre ) {
- int (*preHookFunc) (struct block_list *bl, short *size);
+ if (HPMHooks.count.HP_unit_changeviewsize_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, short *size);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_changeviewsize_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_changeviewsize_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_changeviewsize_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &size);
+ retVal___ = preHookFunc(&bl, &size);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78379,11 +81222,11 @@ int HP_unit_changeviewsize(struct block_list *bl, short size) {
{
retVal___ = HPMHooks.source.unit.changeviewsize(bl, size);
}
- if( HPMHooks.count.HP_unit_changeviewsize_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, short *size);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_changeviewsize_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_changeviewsize_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, short size);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_changeviewsize_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_changeviewsize_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &size);
+ retVal___ = postHookFunc(retVal___, bl, size);
}
}
return retVal___;
@@ -78391,14 +81234,14 @@ int HP_unit_changeviewsize(struct block_list *bl, short size) {
int HP_unit_remove_map(struct block_list *bl, clr_type clrtype, const char *file, int line, const char *func) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_remove_map_pre ) {
- int (*preHookFunc) (struct block_list *bl, clr_type *clrtype, const char *file, int *line, const char *func);
+ if (HPMHooks.count.HP_unit_remove_map_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, clr_type *clrtype, const char **file, int *line, const char **func);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_remove_map_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &clrtype, file, &line, func);
+ retVal___ = preHookFunc(&bl, &clrtype, &file, &line, &func);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78406,25 +81249,25 @@ int HP_unit_remove_map(struct block_list *bl, clr_type clrtype, const char *file
{
retVal___ = HPMHooks.source.unit.remove_map(bl, clrtype, file, line, func);
}
- if( HPMHooks.count.HP_unit_remove_map_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, clr_type *clrtype, const char *file, int *line, const char *func);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_remove_map_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, clr_type clrtype, const char *file, int line, const char *func);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_remove_map_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &clrtype, file, &line, func);
+ retVal___ = postHookFunc(retVal___, bl, clrtype, file, line, func);
}
}
return retVal___;
}
void HP_unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype) {
int hIndex = 0;
- if( HPMHooks.count.HP_unit_remove_map_pc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, clr_type *clrtype);
+ if (HPMHooks.count.HP_unit_remove_map_pc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, clr_type *clrtype);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_remove_map_pc_pre[hIndex].func;
- preHookFunc(sd, &clrtype);
+ preHookFunc(&sd, &clrtype);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78432,25 +81275,25 @@ void HP_unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype) {
{
HPMHooks.source.unit.remove_map_pc(sd, clrtype);
}
- if( HPMHooks.count.HP_unit_remove_map_pc_post ) {
- void (*postHookFunc) (struct map_session_data *sd, clr_type *clrtype);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_pc_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_remove_map_pc_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, clr_type clrtype);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_remove_map_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_remove_map_pc_post[hIndex].func;
- postHookFunc(sd, &clrtype);
+ postHookFunc(sd, clrtype);
}
}
return;
}
void HP_unit_free_pc(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_unit_free_pc_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_unit_free_pc_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_pc_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_pc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_free_pc_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78458,9 +81301,9 @@ void HP_unit_free_pc(struct map_session_data *sd) {
{
HPMHooks.source.unit.free_pc(sd);
}
- if( HPMHooks.count.HP_unit_free_pc_post ) {
+ if (HPMHooks.count.HP_unit_free_pc_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_pc_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_pc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_free_pc_post[hIndex].func;
postHookFunc(sd);
}
@@ -78470,14 +81313,14 @@ void HP_unit_free_pc(struct map_session_data *sd) {
int HP_unit_free(struct block_list *bl, clr_type clrtype) {
int hIndex = 0;
int retVal___ = 0;
- if( HPMHooks.count.HP_unit_free_pre ) {
- int (*preHookFunc) (struct block_list *bl, clr_type *clrtype);
+ if (HPMHooks.count.HP_unit_free_pre > 0) {
+ int (*preHookFunc) (struct block_list **bl, clr_type *clrtype);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_unit_free_pre[hIndex].func;
- retVal___ = preHookFunc(bl, &clrtype);
+ retVal___ = preHookFunc(&bl, &clrtype);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78485,26 +81328,26 @@ int HP_unit_free(struct block_list *bl, clr_type clrtype) {
{
retVal___ = HPMHooks.source.unit.free(bl, clrtype);
}
- if( HPMHooks.count.HP_unit_free_post ) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, clr_type *clrtype);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_post; hIndex++ ) {
+ if (HPMHooks.count.HP_unit_free_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *bl, clr_type clrtype);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_unit_free_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_unit_free_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, bl, &clrtype);
+ retVal___ = postHookFunc(retVal___, bl, clrtype);
}
}
return retVal___;
}
-/* vending */
+/* vending_interface */
void HP_vending_init(bool minimal) {
int hIndex = 0;
- if( HPMHooks.count.HP_vending_init_pre ) {
+ if (HPMHooks.count.HP_vending_init_pre > 0) {
void (*preHookFunc) (bool *minimal);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_init_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_init_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_init_pre[hIndex].func;
preHookFunc(&minimal);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78512,25 +81355,25 @@ void HP_vending_init(bool minimal) {
{
HPMHooks.source.vending.init(minimal);
}
- if( HPMHooks.count.HP_vending_init_post ) {
- void (*postHookFunc) (bool *minimal);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_init_post; hIndex++ ) {
+ if (HPMHooks.count.HP_vending_init_post > 0) {
+ void (*postHookFunc) (bool minimal);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_init_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_init_post[hIndex].func;
- postHookFunc(&minimal);
+ postHookFunc(minimal);
}
}
return;
}
void HP_vending_final(void) {
int hIndex = 0;
- if( HPMHooks.count.HP_vending_final_pre ) {
+ if (HPMHooks.count.HP_vending_final_pre > 0) {
void (*preHookFunc) (void);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_final_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_final_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_final_pre[hIndex].func;
preHookFunc();
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78538,9 +81381,9 @@ void HP_vending_final(void) {
{
HPMHooks.source.vending.final();
}
- if( HPMHooks.count.HP_vending_final_post ) {
+ if (HPMHooks.count.HP_vending_final_post > 0) {
void (*postHookFunc) (void);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_final_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_final_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_final_post[hIndex].func;
postHookFunc();
}
@@ -78549,14 +81392,14 @@ void HP_vending_final(void) {
}
void HP_vending_close(struct map_session_data *sd) {
int hIndex = 0;
- if( HPMHooks.count.HP_vending_close_pre ) {
- void (*preHookFunc) (struct map_session_data *sd);
+ if (HPMHooks.count.HP_vending_close_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_close_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_close_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_close_pre[hIndex].func;
- preHookFunc(sd);
+ preHookFunc(&sd);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78564,9 +81407,9 @@ void HP_vending_close(struct map_session_data *sd) {
{
HPMHooks.source.vending.close(sd);
}
- if( HPMHooks.count.HP_vending_close_post ) {
+ if (HPMHooks.count.HP_vending_close_post > 0) {
void (*postHookFunc) (struct map_session_data *sd);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_close_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_close_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_close_post[hIndex].func;
postHookFunc(sd);
}
@@ -78575,14 +81418,14 @@ void HP_vending_close(struct map_session_data *sd) {
}
void HP_vending_open(struct map_session_data *sd, const char *message, const uint8 *data, int count) {
int hIndex = 0;
- if( HPMHooks.count.HP_vending_open_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, const char *message, const uint8 *data, int *count);
+ if (HPMHooks.count.HP_vending_open_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, const char **message, const uint8 **data, int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_open_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_open_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_open_pre[hIndex].func;
- preHookFunc(sd, message, data, &count);
+ preHookFunc(&sd, &message, &data, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78590,25 +81433,25 @@ void HP_vending_open(struct map_session_data *sd, const char *message, const uin
{
HPMHooks.source.vending.open(sd, message, data, count);
}
- if( HPMHooks.count.HP_vending_open_post ) {
- void (*postHookFunc) (struct map_session_data *sd, const char *message, const uint8 *data, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_open_post; hIndex++ ) {
+ if (HPMHooks.count.HP_vending_open_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, const char *message, const uint8 *data, int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_open_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_open_post[hIndex].func;
- postHookFunc(sd, message, data, &count);
+ postHookFunc(sd, message, data, count);
}
}
return;
}
void HP_vending_list(struct map_session_data *sd, unsigned int id) {
int hIndex = 0;
- if( HPMHooks.count.HP_vending_list_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, unsigned int *id);
+ if (HPMHooks.count.HP_vending_list_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, unsigned int *id);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_list_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_list_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_list_pre[hIndex].func;
- preHookFunc(sd, &id);
+ preHookFunc(&sd, &id);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78616,25 +81459,25 @@ void HP_vending_list(struct map_session_data *sd, unsigned int id) {
{
HPMHooks.source.vending.list(sd, id);
}
- if( HPMHooks.count.HP_vending_list_post ) {
- void (*postHookFunc) (struct map_session_data *sd, unsigned int *id);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_list_post; hIndex++ ) {
+ if (HPMHooks.count.HP_vending_list_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, unsigned int id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_list_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_list_post[hIndex].func;
- postHookFunc(sd, &id);
+ postHookFunc(sd, id);
}
}
return;
}
void HP_vending_purchase(struct map_session_data *sd, int aid, unsigned int uid, const uint8 *data, int count) {
int hIndex = 0;
- if( HPMHooks.count.HP_vending_purchase_pre ) {
- void (*preHookFunc) (struct map_session_data *sd, int *aid, unsigned int *uid, const uint8 *data, int *count);
+ if (HPMHooks.count.HP_vending_purchase_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, int *aid, unsigned int *uid, const uint8 **data, int *count);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_purchase_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_purchase_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_purchase_pre[hIndex].func;
- preHookFunc(sd, &aid, &uid, data, &count);
+ preHookFunc(&sd, &aid, &uid, &data, &count);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return;
}
@@ -78642,11 +81485,11 @@ void HP_vending_purchase(struct map_session_data *sd, int aid, unsigned int uid,
{
HPMHooks.source.vending.purchase(sd, aid, uid, data, count);
}
- if( HPMHooks.count.HP_vending_purchase_post ) {
- void (*postHookFunc) (struct map_session_data *sd, int *aid, unsigned int *uid, const uint8 *data, int *count);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_purchase_post; hIndex++ ) {
+ if (HPMHooks.count.HP_vending_purchase_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, int aid, unsigned int uid, const uint8 *data, int count);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_purchase_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_purchase_post[hIndex].func;
- postHookFunc(sd, &aid, &uid, data, &count);
+ postHookFunc(sd, aid, uid, data, count);
}
}
return;
@@ -78654,14 +81497,14 @@ void HP_vending_purchase(struct map_session_data *sd, int aid, unsigned int uid,
bool HP_vending_search(struct map_session_data *sd, unsigned short nameid) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_vending_search_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, unsigned short *nameid);
+ if (HPMHooks.count.HP_vending_search_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, unsigned short *nameid);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_search_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_search_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_search_pre[hIndex].func;
- retVal___ = preHookFunc(sd, &nameid);
+ retVal___ = preHookFunc(&sd, &nameid);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78669,11 +81512,11 @@ bool HP_vending_search(struct map_session_data *sd, unsigned short nameid) {
{
retVal___ = HPMHooks.source.vending.search(sd, nameid);
}
- if( HPMHooks.count.HP_vending_search_post ) {
- bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned short *nameid);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_search_post; hIndex++ ) {
+ if (HPMHooks.count.HP_vending_search_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned short nameid);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_search_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_search_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, &nameid);
+ retVal___ = postHookFunc(retVal___, sd, nameid);
}
}
return retVal___;
@@ -78681,14 +81524,14 @@ bool HP_vending_search(struct map_session_data *sd, unsigned short nameid) {
bool HP_vending_searchall(struct map_session_data *sd, const struct s_search_store_search *s) {
int hIndex = 0;
bool retVal___ = false;
- if( HPMHooks.count.HP_vending_searchall_pre ) {
- bool (*preHookFunc) (struct map_session_data *sd, const struct s_search_store_search *s);
+ if (HPMHooks.count.HP_vending_searchall_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd, const struct s_search_store_search **s);
*HPMforce_return = false;
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_searchall_pre; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_searchall_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_vending_searchall_pre[hIndex].func;
- retVal___ = preHookFunc(sd, s);
+ retVal___ = preHookFunc(&sd, &s);
}
- if( *HPMforce_return ) {
+ if (*HPMforce_return) {
*HPMforce_return = false;
return retVal___;
}
@@ -78696,9 +81539,9 @@ bool HP_vending_searchall(struct map_session_data *sd, const struct s_search_sto
{
retVal___ = HPMHooks.source.vending.searchall(sd, s);
}
- if( HPMHooks.count.HP_vending_searchall_post ) {
+ if (HPMHooks.count.HP_vending_searchall_post > 0) {
bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct s_search_store_search *s);
- for(hIndex = 0; hIndex < HPMHooks.count.HP_vending_searchall_post; hIndex++ ) {
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_vending_searchall_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_vending_searchall_post[hIndex].func;
retVal___ = postHookFunc(retVal___, sd, s);
}
diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
index 1af35ab21..f00ffa7a9 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2016 Hercules Dev Team
+ * Copyright (C) 2013-2017 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
@@ -23,61 +23,68 @@
* as it will get overwritten.
*/
-memcpy(&HPMHooks.source.HCache, HCache, sizeof(struct HCache_interface));
-memcpy(&HPMHooks.source.atcommand, atcommand, sizeof(struct atcommand_interface));
-memcpy(&HPMHooks.source.battle, battle, sizeof(struct battle_interface));
-memcpy(&HPMHooks.source.bg, bg, sizeof(struct battleground_interface));
-memcpy(&HPMHooks.source.buyingstore, buyingstore, sizeof(struct buyingstore_interface));
-memcpy(&HPMHooks.source.channel, channel, sizeof(struct channel_interface));
-memcpy(&HPMHooks.source.chat, chat, sizeof(struct chat_interface));
-memcpy(&HPMHooks.source.chrif, chrif, sizeof(struct chrif_interface));
-memcpy(&HPMHooks.source.clif, clif, sizeof(struct clif_interface));
-memcpy(&HPMHooks.source.cmdline, cmdline, sizeof(struct cmdline_interface));
-memcpy(&HPMHooks.source.console, console, sizeof(struct console_interface));
-memcpy(&HPMHooks.source.core, core, sizeof(struct core_interface));
-memcpy(&HPMHooks.source.DB, DB, sizeof(struct db_interface));
-memcpy(&HPMHooks.source.duel, duel, sizeof(struct duel_interface));
-memcpy(&HPMHooks.source.elemental, elemental, sizeof(struct elemental_interface));
-memcpy(&HPMHooks.source.guild, guild, sizeof(struct guild_interface));
-memcpy(&HPMHooks.source.gstorage, gstorage, sizeof(struct guild_storage_interface));
-memcpy(&HPMHooks.source.homun, homun, sizeof(struct homunculus_interface));
-memcpy(&HPMHooks.source.instance, instance, sizeof(struct instance_interface));
-memcpy(&HPMHooks.source.intif, intif, sizeof(struct intif_interface));
-memcpy(&HPMHooks.source.ircbot, ircbot, sizeof(struct irc_bot_interface));
-memcpy(&HPMHooks.source.itemdb, itemdb, sizeof(struct itemdb_interface));
-memcpy(&HPMHooks.source.libconfig, libconfig, sizeof(struct libconfig_interface));
-memcpy(&HPMHooks.source.logs, logs, sizeof(struct log_interface));
-memcpy(&HPMHooks.source.mail, mail, sizeof(struct mail_interface));
-memcpy(&HPMHooks.source.iMalloc, iMalloc, sizeof(struct malloc_interface));
-memcpy(&HPMHooks.source.map, map, sizeof(struct map_interface));
-memcpy(&HPMHooks.source.mapindex, mapindex, sizeof(struct mapindex_interface));
-memcpy(&HPMHooks.source.mapit, mapit, sizeof(struct mapit_interface));
-memcpy(&HPMHooks.source.mapreg, mapreg, sizeof(struct mapreg_interface));
-memcpy(&HPMHooks.source.mercenary, mercenary, sizeof(struct mercenary_interface));
-memcpy(&HPMHooks.source.mob, mob, sizeof(struct mob_interface));
-memcpy(&HPMHooks.source.npc_chat, npc_chat, sizeof(struct npc_chat_interface));
-memcpy(&HPMHooks.source.npc, npc, sizeof(struct npc_interface));
-memcpy(&HPMHooks.source.nullpo, nullpo, sizeof(struct nullpo_interface));
-memcpy(&HPMHooks.source.party, party, sizeof(struct party_interface));
-memcpy(&HPMHooks.source.path, path, sizeof(struct path_interface));
-memcpy(&HPMHooks.source.pcg, pcg, sizeof(struct pc_groups_interface));
-memcpy(&HPMHooks.source.pc, pc, sizeof(struct pc_interface));
-memcpy(&HPMHooks.source.libpcre, libpcre, sizeof(struct pcre_interface));
-memcpy(&HPMHooks.source.pet, pet, sizeof(struct pet_interface));
-memcpy(&HPMHooks.source.quest, quest, sizeof(struct quest_interface));
-memcpy(&HPMHooks.source.script, script, sizeof(struct script_interface));
-memcpy(&HPMHooks.source.searchstore, searchstore, sizeof(struct searchstore_interface));
-memcpy(&HPMHooks.source.showmsg, showmsg, sizeof(struct showmsg_interface));
-memcpy(&HPMHooks.source.skill, skill, sizeof(struct skill_interface));
-memcpy(&HPMHooks.source.sockt, sockt, sizeof(struct socket_interface));
-memcpy(&HPMHooks.source.SQL, SQL, sizeof(struct sql_interface));
-memcpy(&HPMHooks.source.status, status, sizeof(struct status_interface));
-memcpy(&HPMHooks.source.storage, storage, sizeof(struct storage_interface));
-memcpy(&HPMHooks.source.StrBuf, StrBuf, sizeof(struct stringbuf_interface));
-memcpy(&HPMHooks.source.strlib, strlib, sizeof(struct strlib_interface));
-memcpy(&HPMHooks.source.sv, sv, sizeof(struct sv_interface));
-memcpy(&HPMHooks.source.sysinfo, sysinfo, sizeof(struct sysinfo_interface));
-memcpy(&HPMHooks.source.timer, timer, sizeof(struct timer_interface));
-memcpy(&HPMHooks.source.trade, trade, sizeof(struct trade_interface));
-memcpy(&HPMHooks.source.unit, unit, sizeof(struct unit_interface));
-memcpy(&HPMHooks.source.vending, vending, sizeof(struct vending_interface));
+/* GENERATED FILE DO NOT EDIT */
+
+HPMHooks.source.HCache = *HCache;
+HPMHooks.source.atcommand = *atcommand;
+HPMHooks.source.battle = *battle;
+HPMHooks.source.bg = *bg;
+HPMHooks.source.buyingstore = *buyingstore;
+HPMHooks.source.channel = *channel;
+HPMHooks.source.chat = *chat;
+HPMHooks.source.chrif = *chrif;
+HPMHooks.source.clif = *clif;
+HPMHooks.source.cmdline = *cmdline;
+HPMHooks.source.console = *console;
+HPMHooks.source.core = *core;
+HPMHooks.source.DB = *DB;
+HPMHooks.source.des = *des;
+HPMHooks.source.duel = *duel;
+HPMHooks.source.elemental = *elemental;
+HPMHooks.source.grfio = *grfio;
+HPMHooks.source.guild = *guild;
+HPMHooks.source.gstorage = *gstorage;
+HPMHooks.source.homun = *homun;
+HPMHooks.source.instance = *instance;
+HPMHooks.source.intif = *intif;
+HPMHooks.source.ircbot = *ircbot;
+HPMHooks.source.itemdb = *itemdb;
+HPMHooks.source.libconfig = *libconfig;
+HPMHooks.source.logs = *logs;
+HPMHooks.source.mail = *mail;
+HPMHooks.source.map = *map;
+HPMHooks.source.mapindex = *mapindex;
+HPMHooks.source.mapit = *mapit;
+HPMHooks.source.mapreg = *mapreg;
+HPMHooks.source.md5 = *md5;
+HPMHooks.source.mercenary = *mercenary;
+HPMHooks.source.mob = *mob;
+HPMHooks.source.mutex = *mutex;
+HPMHooks.source.npc_chat = *npc_chat;
+HPMHooks.source.npc = *npc;
+HPMHooks.source.nullpo = *nullpo;
+HPMHooks.source.party = *party;
+HPMHooks.source.path = *path;
+HPMHooks.source.pcg = *pcg;
+HPMHooks.source.pc = *pc;
+HPMHooks.source.libpcre = *libpcre;
+HPMHooks.source.pet = *pet;
+HPMHooks.source.quest = *quest;
+HPMHooks.source.rnd = *rnd;
+HPMHooks.source.script = *script;
+HPMHooks.source.searchstore = *searchstore;
+HPMHooks.source.showmsg = *showmsg;
+HPMHooks.source.skill = *skill;
+HPMHooks.source.sockt = *sockt;
+HPMHooks.source.SQL = *SQL;
+HPMHooks.source.status = *status;
+HPMHooks.source.storage = *storage;
+HPMHooks.source.StrBuf = *StrBuf;
+HPMHooks.source.strlib = *strlib;
+HPMHooks.source.sv = *sv;
+HPMHooks.source.sysinfo = *sysinfo;
+HPMHooks.source.thread = *thread;
+HPMHooks.source.timer = *timer;
+HPMHooks.source.trade = *trade;
+HPMHooks.source.unit = *unit;
+HPMHooks.source.vending = *vending;
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 3fe38b6bc..42d6d821c 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -1,7 +1,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-2016 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
@@ -46,7 +46,8 @@ ALLPLUGINS = $(filter-out HPMHooking, $(basename $(wildcard *.c))) $(HPMHOOKING)
PLUGINS = sample db2sql HPMHooking_char HPMHooking_login HPMHooking_map $(MYPLUGINS)
COMMON_D = ../common
-COMMON_H = $(wildcard $(COMMON_D)/*.h)
+# Includes private headers (plugins might need them)
+COMMON_H = $(wildcard $(COMMON_D)/*.h) ../plugins/HPMHooking.h
COMMON_INCLUDE = -I..
THIRDPARTY_INCLUDE = -I../../3rdparty
diff --git a/src/plugins/constdb2doc.c b/src/plugins/constdb2doc.c
index 1d5f37ad5..d211c46e2 100644
--- a/src/plugins/constdb2doc.c
+++ b/src/plugins/constdb2doc.c
@@ -93,6 +93,10 @@ void constdb2doc_constdb(void)
script->hardcoded_constants();
fprintf(out_fp, "\n");
+ fprintf(out_fp, "## Parameters (source)\n\n");
+ script->load_parameters();
+ fprintf(out_fp, "\n");
+
/* Unlink */
script->set_constant = script_set_constant;
script->constdb_comment = script_constdb_comment;
@@ -173,7 +177,8 @@ void do_constdb2doc(void)
constdb2doc_itemdb();
- fprintf(out_fp, "> End of list\n");
+ fprintf(out_fp, "> End of list\n\n");
+ fprintf(out_fp, "<!--GENERATED FILE DO NOT EDIT-->\n");
fclose(out_fp);
}
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index 44e2bac3c..33a62757a 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -25,11 +25,13 @@
#include "common/memmgr.h"
#include "common/mmo.h"
#include "common/nullpo.h"
+#include "common/sql.h"
#include "common/strlib.h"
#include "map/battle.h"
#include "map/itemdb.h"
#include "map/mob.h"
#include "map/map.h"
+#include "map/pc.h"
#include "common/HPMDataCheck.h"
@@ -65,9 +67,9 @@ bool itemdb2sql_torun = false;
bool mobdb2sql_torun = false;
/// Backup of the original item_db parser function pointer.
-int (*itemdb_readdb_libconfig_sub) (config_setting_t *it, int n, const char *source);
+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) (config_setting_t *it, int n, const char *source);
+int (*mob_read_db_sub) (struct config_setting_t *it, int n, const char *source);
/**
* Normalizes and appends a string to the output buffer.
@@ -76,6 +78,7 @@ int (*mob_read_db_sub) (config_setting_t *it, int n, const char *source);
*/
void hstr(const char *str)
{
+ nullpo_retv(str);
if (strlen(str) > tosql.buf[3].len) {
tosql.buf[3].len = tosql.buf[3].len + strlen(str) + 1000;
RECREATE(tosql.buf[3].p,char,tosql.buf[3].len);
@@ -115,16 +118,112 @@ void db2sql_fileheader(void)
"-- NOTE: This file was auto-generated and should never be manually edited,\n"
"-- as it will get overwritten. If you need to modify this file,\n"
"-- please consider modifying the corresponding .conf file inside\n"
- "-- the db folder, and then re-run the db2sql plugin.\n"
+ "-- the db folder, and then re-run the db2sql plugin.\n\n"
+
+ "-- GENERATED FILE DO NOT EDIT --\n"
"\n", year);
}
/**
+ * Converts the Job field of an Item DB entry to the numeric format used in the SQL table.
+ */
+uint64 itemdb2sql_readdb_job_sub(struct config_setting_t *t)
+{
+ uint64 jobmask = 0;
+ int idx = 0;
+ struct config_setting_t *it = NULL;
+ bool enable_all = false;
+
+ if (libconfig->setting_lookup_bool_real(t, "All", &enable_all) && enable_all) {
+ jobmask |= UINT64_MAX;
+ }
+ while ((it = libconfig->setting_get_elem(t, idx++)) != NULL) {
+ const char *job_name = config_setting_name(it);
+ int job_id;
+
+ if (strcmp(job_name, "All") == 0)
+ continue;
+
+ if ((job_id = pc->check_job_name(job_name)) != -1) {
+ uint64 newmask = 0;
+ switch (job_id) {
+ // Base Classes
+ case JOB_NOVICE:
+ case JOB_SUPER_NOVICE:
+ newmask = 1ULL << JOB_NOVICE;
+ break;
+ case JOB_SWORDMAN:
+ case JOB_MAGE:
+ case JOB_ARCHER:
+ case JOB_ACOLYTE:
+ case JOB_MERCHANT:
+ case JOB_THIEF:
+ // 2-1 Classes
+ case JOB_KNIGHT:
+ case JOB_PRIEST:
+ case JOB_WIZARD:
+ case JOB_BLACKSMITH:
+ case JOB_HUNTER:
+ case JOB_ASSASSIN:
+ // 2-2 Classes
+ case JOB_CRUSADER:
+ case JOB_MONK:
+ case JOB_SAGE:
+ case JOB_ALCHEMIST:
+ case JOB_BARD:
+ case JOB_DANCER:
+ case JOB_ROGUE:
+ // Extended Classes
+ case JOB_GUNSLINGER:
+ case JOB_NINJA:
+ newmask = 1ULL << job_id;
+ break;
+ // Extended Classes (special handling)
+ case JOB_TAEKWON:
+ newmask = 1ULL << 21;
+ break;
+ case JOB_STAR_GLADIATOR:
+ newmask = 1ULL << 22;
+ break;
+ case JOB_SOUL_LINKER:
+ newmask = 1ULL << 23;
+ break;
+ // Other Classes
+ case JOB_GANGSI: //Bongun/Munak
+ newmask = 1ULL << 26;
+ break;
+ case JOB_DEATH_KNIGHT:
+ newmask = 1ULL << 27;
+ break;
+ case JOB_DARK_COLLECTOR:
+ newmask = 1ULL << 28;
+ break;
+ case JOB_KAGEROU:
+ case JOB_OBORO:
+ newmask = 1ULL << 29;
+ break;
+ case JOB_REBELLION:
+ newmask = 1ULL << 30;
+ break;
+ }
+
+ if (libconfig->setting_get_bool(it)) {
+ jobmask |= newmask;
+ } else {
+ jobmask &= ~newmask;
+ }
+ }
+ }
+
+ return jobmask;
+}
+
+/**
* Converts an Item DB entry to SQL.
*
* @see itemdb_readdb_libconfig_sub.
*/
-int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
+int itemdb2sql_sub(struct config_setting_t *entry, int n, const char *source)
{
struct item_data *it = NULL;
@@ -134,7 +233,8 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
char *str;
int i32;
uint32 ui32;
- config_setting_t *t = NULL;
+ uint64 ui64;
+ struct config_setting_t *t = NULL;
StringBuf buf;
nullpo_ret(entry);
@@ -153,7 +253,7 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
StrBuf->Printf(&buf, "'%s',", e_name);
// type
- StrBuf->Printf(&buf, "'%u',", it->flag.delay_consume?IT_DELAYCONSUME:it->type);
+ StrBuf->Printf(&buf, "'%d',", it->flag.delay_consume ? IT_DELAYCONSUME : it->type);
// price_buy
StrBuf->Printf(&buf, "'%d',", it->value_buy);
@@ -162,29 +262,36 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
StrBuf->Printf(&buf, "'%d',", it->value_sell);
// weight
- StrBuf->Printf(&buf, "'%u',", it->weight);
+ StrBuf->Printf(&buf, "'%d',", it->weight);
// atk
- StrBuf->Printf(&buf, "'%u',", it->atk);
+ StrBuf->Printf(&buf, "'%d',", it->atk);
// matk
- StrBuf->Printf(&buf, "'%u',", it->matk);
+ StrBuf->Printf(&buf, "'%d',", it->matk);
// defence
- StrBuf->Printf(&buf, "'%u',", it->def);
+ StrBuf->Printf(&buf, "'%d',", it->def);
// range
- StrBuf->Printf(&buf, "'%u',", it->range);
+ StrBuf->Printf(&buf, "'%d',", it->range);
// slots
- StrBuf->Printf(&buf, "'%u',", it->slot);
+ StrBuf->Printf(&buf, "'%d',", it->slot);
// equip_jobs
- if (libconfig->setting_lookup_int(entry, "Job", &i32)) // This is an unsigned value, do not check for >= 0
- ui32 = (uint32)i32;
- else
- ui32 = UINT_MAX;
- StrBuf->Printf(&buf, "'%u',", ui32);
+ if ((t = libconfig->setting_get_member(entry, "Job")) != NULL) {
+ if (config_setting_is_group(t)) {
+ ui64 = itemdb2sql_readdb_job_sub(t);
+ } else if (itemdb->lookup_const(entry, "Job", &i32)) { // This is an unsigned value, do not check for >= 0
+ ui64 = (uint64)i32;
+ } else {
+ ui64 = UINT64_MAX;
+ }
+ } else {
+ ui64 = UINT64_MAX;
+ }
+ StrBuf->Printf(&buf, "'%"PRIu64"',", ui64);
// equip_upper
if (libconfig->setting_lookup_int(entry, "Upper", &i32) && i32 >= 0)
@@ -194,47 +301,50 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
StrBuf->Printf(&buf, "'%u',", ui32);
// equip_genders
- StrBuf->Printf(&buf, "'%u',", it->sex);
+ StrBuf->Printf(&buf, "'%d',", it->sex);
// equip_locations
- StrBuf->Printf(&buf, "'%u',", it->equip);
+ StrBuf->Printf(&buf, "'%d',", it->equip);
// weapon_level
- StrBuf->Printf(&buf, "'%u',", it->wlv);
+ StrBuf->Printf(&buf, "'%d',", it->wlv);
// equip_level_min
- StrBuf->Printf(&buf, "'%u',", it->elv);
+ StrBuf->Printf(&buf, "'%d',", it->elv);
// equip_level_max
if ((t = libconfig->setting_get_member(entry, "EquipLv")) && config_setting_is_aggregate(t) && libconfig->setting_length(t) >= 2)
- StrBuf->Printf(&buf, "'%u',", it->elvmax);
+ StrBuf->Printf(&buf, "'%d',", it->elvmax);
else
StrBuf->AppendStr(&buf, "NULL,");
// refineable
- StrBuf->Printf(&buf, "'%u',", it->flag.no_refine?0:1);
+ StrBuf->Printf(&buf, "'%d',", it->flag.no_refine?0:1);
+
+ // disable_options
+ StrBuf->Printf(&buf, "'%d',", it->flag.no_options?1:0);
// view
- StrBuf->Printf(&buf, "'%u',", it->look);
+ StrBuf->Printf(&buf, "'%d',", it->look);
// bindonequip
- StrBuf->Printf(&buf, "'%u',", it->flag.bindonequip?1:0);
+ StrBuf->Printf(&buf, "'%d',", it->flag.bindonequip?1:0);
// forceserial
- StrBuf->Printf(&buf, "'%u',", it->flag.force_serial?1:0);
+ StrBuf->Printf(&buf, "'%d',", it->flag.force_serial?1:0);
// buyingstore
- StrBuf->Printf(&buf, "'%u',", it->flag.buyingstore?1:0);
+ StrBuf->Printf(&buf, "'%d',", it->flag.buyingstore?1:0);
// delay
- StrBuf->Printf(&buf, "'%u',", it->delay);
+ StrBuf->Printf(&buf, "'%d',", it->delay);
// trade_flag
- StrBuf->Printf(&buf, "'%u',", it->flag.trade_restriction);
+ StrBuf->Printf(&buf, "'%d',", it->flag.trade_restriction);
// trade_group
if (it->flag.trade_restriction != ITR_NONE && it->gm_lv_trade_override > 0 && it->gm_lv_trade_override < 100) {
- StrBuf->Printf(&buf, "'%u',", it->gm_lv_trade_override);
+ StrBuf->Printf(&buf, "'%d',", it->gm_lv_trade_override);
} else {
StrBuf->AppendStr(&buf, "NULL,");
}
@@ -266,14 +376,13 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
// sprite
if (it->flag.available) {
- StrBuf->Printf(&buf, "'%u',", it->view_id);
+ StrBuf->Printf(&buf, "'%d',", it->view_id);
} else {
StrBuf->AppendStr(&buf, "NULL,");
}
// script
- if (it->script) {
- libconfig->setting_lookup_string(entry, "Script", &bonus);
+ if (it->script && libconfig->setting_lookup_string(entry, "Script", &bonus)) {
hstr(bonus);
str = tosql.buf[3].p;
if (strlen(str) > tosql.buf[0].len) {
@@ -281,12 +390,13 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
RECREATE(tosql.buf[0].p,char,tosql.buf[0].len);
}
SQL->EscapeString(NULL, tosql.buf[0].p, str);
+ StrBuf->Printf(&buf, "'%s',", tosql.buf[0].p);
+ } else {
+ StrBuf->AppendStr(&buf, "'',");
}
- StrBuf->Printf(&buf, "'%s',", it->script?tosql.buf[0].p:"");
// equip_script
- if (it->equip_script) {
- libconfig->setting_lookup_string(entry, "OnEquipScript", &bonus);
+ if (it->equip_script && libconfig->setting_lookup_string(entry, "OnEquipScript", &bonus)) {
hstr(bonus);
str = tosql.buf[3].p;
if (strlen(str) > tosql.buf[1].len) {
@@ -294,12 +404,13 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
RECREATE(tosql.buf[1].p,char,tosql.buf[1].len);
}
SQL->EscapeString(NULL, tosql.buf[1].p, str);
+ StrBuf->Printf(&buf, "'%s',", tosql.buf[1].p);
+ } else {
+ StrBuf->AppendStr(&buf, "'',");
}
- StrBuf->Printf(&buf, "'%s',", it->equip_script?tosql.buf[1].p:"");
// unequip_script
- if (it->unequip_script) {
- libconfig->setting_lookup_string(entry, "OnUnequipScript", &bonus);
+ if (it->unequip_script && libconfig->setting_lookup_string(entry, "OnUnequipScript", &bonus)) {
hstr(bonus);
str = tosql.buf[3].p;
if (strlen(str) > tosql.buf[2].len) {
@@ -307,8 +418,10 @@ int itemdb2sql_sub(config_setting_t *entry, int n, const char *source)
RECREATE(tosql.buf[2].p,char,tosql.buf[2].len);
}
SQL->EscapeString(NULL, tosql.buf[2].p, str);
+ StrBuf->Printf(&buf, "'%s'", tosql.buf[2].p);
+ } else {
+ StrBuf->AppendStr(&buf, "''");
}
- StrBuf->Printf(&buf, "'%s'", it->unequip_script?tosql.buf[2].p:"");
fprintf(tosql.fp, "REPLACE INTO `%s` VALUES (%s);\n", tosql.db_name, StrBuf->Value(&buf));
@@ -344,14 +457,15 @@ void itemdb2sql_tableheader(void)
" `defence` smallint(5) UNSIGNED DEFAULT NULL,\n"
" `range` tinyint(2) UNSIGNED DEFAULT NULL,\n"
" `slots` tinyint(2) UNSIGNED DEFAULT NULL,\n"
- " `equip_jobs` int(12) UNSIGNED DEFAULT NULL,\n"
+ " `equip_jobs` bigint(20) UNSIGNED DEFAULT NULL,\n"
" `equip_upper` tinyint(8) UNSIGNED DEFAULT NULL,\n"
" `equip_genders` tinyint(2) UNSIGNED DEFAULT NULL,\n"
- " `equip_locations` smallint(4) UNSIGNED DEFAULT NULL,\n"
+ " `equip_locations` mediumint(8) UNSIGNED DEFAULT NULL,\n"
" `weapon_level` tinyint(2) UNSIGNED DEFAULT NULL,\n"
" `equip_level_min` smallint(5) UNSIGNED DEFAULT NULL,\n"
" `equip_level_max` smallint(5) UNSIGNED DEFAULT NULL,\n"
" `refineable` tinyint(1) UNSIGNED DEFAULT NULL,\n"
+ " `disable_options` tinyint(1) UNSIGNED DEFAULT NULL,\n"
" `view` smallint(3) UNSIGNED DEFAULT NULL,\n"
" `bindonequip` tinyint(1) UNSIGNED DEFAULT NULL,\n"
" `forceserial` tinyint(1) UNSIGNED DEFAULT NULL,\n"
@@ -424,7 +538,7 @@ void do_itemdb2sql(void)
*
* @see mobdb_readdb_libconfig_sub.
*/
-int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
+int mobdb2sql_sub(struct config_setting_t *mobt, int n, const char *source)
{
struct mob_db *md = NULL;
nullpo_ret(mobt);
@@ -437,7 +551,7 @@ int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
StrBuf->Init(&buf);
// id
- StrBuf->Printf(&buf, "%u,", md->mob_id);
+ StrBuf->Printf(&buf, "%d,", md->mob_id);
// Sprite
SQL->EscapeString(NULL, e_name, md->sprite);
@@ -476,10 +590,10 @@ int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
StrBuf->Printf(&buf, "%u,", md->status.rhw.atk2);
// DEF
- StrBuf->Printf(&buf, "%u,", md->status.def);
+ StrBuf->Printf(&buf, "%d,", md->status.def);
// MDEF
- StrBuf->Printf(&buf, "%u,", md->status.mdef);
+ StrBuf->Printf(&buf, "%d,", md->status.mdef);
// STR
StrBuf->Printf(&buf, "%u,", md->status.str);
@@ -500,10 +614,10 @@ int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
StrBuf->Printf(&buf, "%u,", md->status.luk);
// Range2
- StrBuf->Printf(&buf, "%u,", md->range2);
+ StrBuf->Printf(&buf, "%d,", md->range2);
// Range3
- StrBuf->Printf(&buf, "%u,", md->range3);
+ StrBuf->Printf(&buf, "%d,", md->range3);
// Scale
StrBuf->Printf(&buf, "%u,", md->status.size);
@@ -512,10 +626,10 @@ int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
StrBuf->Printf(&buf, "%u,", md->status.race);
// Element
- StrBuf->Printf(&buf, "%u,", md->status.def_ele + 20 * md->status.ele_lv);
+ StrBuf->Printf(&buf, "%d,", md->status.def_ele + 20 * md->status.ele_lv);
// Mode
- StrBuf->Printf(&buf, "0x%X,", md->status.mode);
+ StrBuf->Printf(&buf, "%u,", md->status.mode);
// Speed
StrBuf->Printf(&buf, "%u,", md->status.speed);
@@ -534,9 +648,9 @@ int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
for (i = 0; i < 3; i++) {
// MVP{i}id
- StrBuf->Printf(&buf, "%u,", md->mvpitem[i].nameid);
+ StrBuf->Printf(&buf, "%d,", md->mvpitem[i].nameid);
// MVP{i}per
- StrBuf->Printf(&buf, "%u,", md->mvpitem[i].p);
+ StrBuf->Printf(&buf, "%d,", md->mvpitem[i].p);
}
// Scan for cards
@@ -550,15 +664,15 @@ int mobdb2sql_sub(config_setting_t *mobt, int n, const char *source)
if (card_idx == i)
continue;
// Drop{i}id
- StrBuf->Printf(&buf, "%u,", md->dropitem[i].nameid);
+ StrBuf->Printf(&buf, "%d,", md->dropitem[i].nameid);
// Drop{i}per
- StrBuf->Printf(&buf, "%u,", md->dropitem[i].p);
+ StrBuf->Printf(&buf, "%d,", md->dropitem[i].p);
}
// DropCardid
- StrBuf->Printf(&buf, "%u,", md->dropitem[card_idx].nameid);
+ StrBuf->Printf(&buf, "%d,", md->dropitem[card_idx].nameid);
// DropCardper
- StrBuf->Printf(&buf, "%u", md->dropitem[card_idx].p);
+ StrBuf->Printf(&buf, "%d", md->dropitem[card_idx].p);
fprintf(tosql.fp, "REPLACE INTO `%s` VALUES (%s);\n", tosql.db_name, StrBuf->Value(&buf));
@@ -607,7 +721,7 @@ void mobdb2sql_tableheader(void)
" `Scale` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',\n"
" `Race` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',\n"
" `Element` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',\n"
- " `Mode` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',\n"
+ " `Mode` INT(11) UNSIGNED NOT NULL DEFAULT '0',\n"
" `Speed` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',\n"
" `aDelay` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',\n"
" `aMotion` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',\n"
diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c
index 6c02b1a12..78517419f 100644
--- a/src/plugins/dbghelpplug.c
+++ b/src/plugins/dbghelpplug.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -446,17 +446,17 @@ Dhp__PrintProcessInfo(
fprintf(log_file,
"eip=%08x esp=%08x ebp=%08x iopl=%1x %s %s %s %s %s %s %s %s %s %s\n",
context->Eip, context->Esp, context->Ebp,
- (context->EFlags >> 12) & 3, // IOPL level value
- context->EFlags & 0x00100000 ? "vip" : " ", // VIP (virtual interrupt pending)
- context->EFlags & 0x00080000 ? "vif" : " ", // VIF (virtual interrupt flag)
- context->EFlags & 0x00000800 ? "ov" : "nv", // VIF (virtual interrupt flag)
- context->EFlags & 0x00000400 ? "dn" : "up", // OF (overflow flag)
- context->EFlags & 0x00000200 ? "ei" : "di", // IF (interrupt enable flag)
- context->EFlags & 0x00000080 ? "ng" : "pl", // SF (sign flag)
- context->EFlags & 0x00000040 ? "zr" : "nz", // ZF (zero flag)
- context->EFlags & 0x00000010 ? "ac" : "na", // AF (aux carry flag)
- context->EFlags & 0x00000004 ? "po" : "pe", // PF (parity flag)
- context->EFlags & 0x00000001 ? "cy" : "nc"); // CF (carry flag)
+ (context->EFlags >> 12) & 3, // IOPL level value
+ (context->EFlags & 0x00100000) ? "vip" : " ", // VIP (virtual interrupt pending)
+ (context->EFlags & 0x00080000) ? "vif" : " ", // VIF (virtual interrupt flag)
+ (context->EFlags & 0x00000800) ? "ov" : "nv", // VIF (virtual interrupt flag)
+ (context->EFlags & 0x00000400) ? "dn" : "up", // OF (overflow flag)
+ (context->EFlags & 0x00000200) ? "ei" : "di", // IF (interrupt enable flag)
+ (context->EFlags & 0x00000080) ? "ng" : "pl", // SF (sign flag)
+ (context->EFlags & 0x00000040) ? "zr" : "nz", // ZF (zero flag)
+ (context->EFlags & 0x00000010) ? "ac" : "na", // AF (aux carry flag)
+ (context->EFlags & 0x00000004) ? "po" : "pe", // PF (parity flag)
+ (context->EFlags & 0x00000001) ? "cy" : "nc"); // CF (carry flag)
}
if( context->ContextFlags & CONTEXT_SEGMENTS )
{
@@ -467,8 +467,7 @@ Dhp__PrintProcessInfo(
context->SegDs,
context->SegEs,
context->SegFs,
- context->SegGs,
- context->EFlags);
+ context->SegGs);
if( context->ContextFlags & CONTEXT_CONTROL )
fprintf(log_file,
" efl=%08x",
@@ -951,7 +950,6 @@ Dhp__PrintDataValue(
//
ULONG64 length = 0;
DWORD basetype;
- BOOL isValid = TRUE;
assert( pInterData != NULL );
log_file = pInterData->log_file;
@@ -1260,7 +1258,7 @@ Dhp__PrintDataInfo(
}
else if( pSymInfo->Flags & SYMFLAG_REGISTER )
{
- scope = ( pSymInfo->Flags & SYMFLAG_PARAMETER ? PARAM : LOCAL ); // register, optimized out(?)
+ scope = (pSymInfo->Flags & SYMFLAG_PARAMETER) ? PARAM : LOCAL; // register, optimized out(?)
}
else
{
diff --git a/src/plugins/generate-translations.c b/src/plugins/generate-translations.c
new file mode 100644
index 000000000..759e788a2
--- /dev/null
+++ b/src/plugins/generate-translations.c
@@ -0,0 +1,277 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2016 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "config/core.h"
+
+#include "common/hercules.h"
+#include "common/cbasetypes.h"
+#include "common/memmgr.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "map/atcommand.h"
+#include "map/map.h"
+#include "map/script.h"
+
+#include "plugins/HPMHooking.h"
+#include "common/HPMDataCheck.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+HPExport struct hplugin_info pinfo = {
+ "generate-translations", // Plugin name
+ SERVER_TYPE_MAP, // Which server types this plugin works with?
+ "0.1", // Plugin version
+ HPM_VERSION, // HPM Version (don't change, macro is automatically updated)
+};
+
+struct DBMap *translatable_strings; // string map parsed (used when exporting strings only)
+/* Set during startup when attempting to export the lang, unset after server initialization is over */
+FILE *lang_export_fp;
+char *lang_export_file;/* for lang_export_fp */
+struct script_string_buf lang_export_line_buf;
+struct script_string_buf lang_export_escaped_buf;
+int lang_export_stringcount;
+
+/// Whether the translations template generator will automatically run.
+bool generating_translations = false;
+
+/**
+ * --generate-translations
+ *
+ * Creates "./generated_translations.pot"
+ * @see cmdline->exec
+ */
+CMDLINEARG(generatetranslations)
+{
+ lang_export_file = aStrdup("./generated_translations.pot");
+
+ if ((lang_export_fp = fopen(lang_export_file, "wb")) == NULL) {
+ ShowError("export-dialog: failed to open '%s' for writing\n", lang_export_file);
+ } else {
+ time_t t = time(NULL);
+ struct tm *lt = localtime(&t);
+ int year = lt->tm_year+1900;
+ char timestring[128] = "";
+ strftime(timestring, sizeof(timestring), "%Y-%m-%d %H:%M:%S%z", lt);
+ fprintf(lang_export_fp,
+ "# This file is part of Hercules.\n"
+ "# http://herc.ws - http://github.com/HerculesWS/Hercules\n"
+ "#\n"
+ "# Copyright (C) 2013-%d Hercules Dev Team\n"
+ "#\n"
+ "# Hercules is free software: you can redistribute it and/or modify\n"
+ "# it under the terms of the GNU General Public License as published by\n"
+ "# the Free Software Foundation, either version 3 of the License, or\n"
+ "# (at your option) any later version.\n"
+ "#\n"
+ "# This program is distributed in the hope that it will be useful,\n"
+ "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "# GNU General Public License for more details.\n"
+ "#\n"
+ "# You should have received a copy of the GNU General Public License\n"
+ "# along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n"
+
+ "#,fuzzy\n"
+ "msgid \"\"\n"
+ "msgstr \"\"\n"
+ "\"Project-Id-Version: %s\\n\"\n"
+ "\"Report-Msgid-Bugs-To: dev@herc.ws\\n\"\n"
+ "\"POT-Creation-Date: %s\\n\"\n"
+ "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"\n"
+ "\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\"\n"
+ "\"Language-Team: LANGUAGE <LL@li.org>\\n\"\n"
+ "\"Language: \\n\"\n"
+ "\"MIME-Version: 1.0\\n\"\n"
+ "\"Content-Type: text/plain; charset=ISO-8859-1\\n\"\n"
+ "\"Content-Transfer-Encoding: 8bit\\n\"\n\n",
+ year, sysinfo->vcsrevision_scripts(), timestring);
+ }
+ generating_translations = true;
+ return true;
+}
+
+void script_add_translatable_string_posthook(const struct script_string_buf *string, const char *start_point)
+{
+ bool duplicate = true;
+ bool is_translatable_string = false;
+ bool is_translatable_fmtstring = false;
+
+ if (!generating_translations || lang_export_fp == NULL)
+ return;
+
+ /* When exporting we don't know what is a translation and what isn't */
+ if (VECTOR_LENGTH(*string) > 1) {
+ // The length of *string will always be at least 1 because of the '\0'
+ if (translatable_strings == NULL) {
+ translatable_strings = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_ALLOW_NULL_DATA, 0);
+ }
+
+ if (!strdb_exists(translatable_strings, VECTOR_DATA(*string))) {
+ strdb_put(translatable_strings, VECTOR_DATA(*string), NULL);
+ duplicate = false;
+ }
+ }
+
+ if (!duplicate) {
+ if (script->syntax.last_func == script->buildin_mes_offset
+ || script->syntax.last_func == script->buildin_select_offset
+ || script->syntax.lang_macro_active
+ ) {
+ is_translatable_string = true;
+ } else if (script->syntax.last_func == script->buildin_mesf_offset
+ || script->syntax.lang_macro_fmtstring_active
+ ) {
+ is_translatable_fmtstring = true;
+ }
+ }
+
+ if (is_translatable_string || is_translatable_fmtstring) {
+ const char *line_start = start_point;
+ const char *line_end = start_point;
+ int line_length;
+ bool has_percent_sign = false;
+
+ if (!is_translatable_fmtstring && strchr(VECTOR_DATA(*string), '%') != NULL) {
+ has_percent_sign = true;
+ }
+
+ while (line_start > script->parser_current_src && *line_start != '\n')
+ line_start--;
+
+ while (*line_end != '\n' && *line_end != '\0')
+ line_end++;
+
+ line_length = (int)(line_end - line_start);
+ if (line_length > 0) {
+ VECTOR_ENSURE(lang_export_line_buf, line_length + 1, 512);
+ VECTOR_PUSHARRAY(lang_export_line_buf, line_start, line_length);
+ VECTOR_PUSH(lang_export_line_buf, '\0');
+
+ normalize_name(VECTOR_DATA(lang_export_line_buf), "\r\n\t "); // [!] Note: VECTOR_LENGTH() will lie.
+ }
+
+ VECTOR_ENSURE(lang_export_escaped_buf, 4*VECTOR_LENGTH(*string)+1, 1);
+ VECTOR_LENGTH(lang_export_escaped_buf) = (int)sv->escape_c(VECTOR_DATA(lang_export_escaped_buf),
+ VECTOR_DATA(*string),
+ VECTOR_LENGTH(*string)-1, /* exclude null terminator */
+ "\"");
+ VECTOR_PUSH(lang_export_escaped_buf, '\0');
+
+ fprintf(lang_export_fp, "\n#: %s\n"
+ "# %s\n"
+ "%s"
+ "msgctxt \"%s\"\n"
+ "msgid \"%s\"\n"
+ "msgstr \"\"\n",
+ script->parser_current_file ? script->parser_current_file : "Unknown File",
+ VECTOR_DATA(lang_export_line_buf),
+ is_translatable_fmtstring ? "#, c-format\n" : (has_percent_sign ? "#, no-c-format\n" : ""),
+ script->parser_current_npc_name ? script->parser_current_npc_name : "Unknown NPC",
+ VECTOR_DATA(lang_export_escaped_buf)
+ );
+ lang_export_stringcount++;
+ VECTOR_TRUNCATE(lang_export_line_buf);
+ VECTOR_TRUNCATE(lang_export_escaped_buf);
+ }
+}
+
+struct script_code *parse_script_prehook(const char **src, const char **file, int *line, int *options, int **retval)
+{
+ if (translatable_strings != NULL) {
+ db_destroy(translatable_strings);
+ translatable_strings = NULL;
+ }
+ return NULL;
+}
+
+void script_parser_clean_leftovers_posthook(void)
+{
+ if (translatable_strings != NULL) {
+ db_destroy(translatable_strings);
+ translatable_strings = NULL;
+ }
+
+ VECTOR_CLEAR(lang_export_line_buf);
+ VECTOR_CLEAR(lang_export_escaped_buf);
+}
+
+bool msg_config_read_posthook(bool retVal, const char *cfg_name, bool allow_override)
+{
+ static int called = 1;
+
+ if (!generating_translations || lang_export_fp == NULL)
+ return retVal;
+
+ if (!retVal)
+ return retVal;
+
+ if (++called == 1) { // Original
+ int i;
+ for (i = 0; i < MAX_MSG; i++) {
+ if (atcommand->msg_table[0][i] == NULL)
+ continue;
+ fprintf(lang_export_fp, "msgctxt \"messages.conf\"\n"
+ "msgid \"%s\"\n"
+ "msgstr \"\"\n",
+ atcommand->msg_table[0][i]
+ );
+ lang_export_stringcount++;
+ }
+ }
+
+ return retVal;
+}
+
+HPExport void server_preinit(void)
+{
+ addArg("--generate-translations", false, generatetranslations,
+ "Creates './generated_translations.pot' file with all translateable strings from scripts, server terminates afterwards.");
+ VECTOR_INIT(lang_export_line_buf);
+ VECTOR_INIT(lang_export_escaped_buf);
+ addHookPost(script, add_translatable_string, script_add_translatable_string_posthook);
+ addHookPre(script, parse, parse_script_prehook);
+ addHookPost(script, parser_clean_leftovers, script_parser_clean_leftovers_posthook);
+ addHookPost(atcommand, msg_read, msg_config_read_posthook);
+ lang_export_stringcount = 0;
+}
+
+HPExport void plugin_init(void)
+{
+}
+
+HPExport void server_online(void)
+{
+ if (generating_translations && lang_export_fp != NULL) {
+ ShowInfo("Translations template exported to '%s' with %d strings.\n", lang_export_file, lang_export_stringcount);
+ fclose(lang_export_fp);
+ lang_export_fp = NULL;
+ }
+ core->runflag = CORE_ST_STOP;
+}
+
+HPExport void plugin_final(void)
+{
+ if (lang_export_file != NULL) {
+ aFree(lang_export_file);
+ lang_export_file = NULL;
+ }
+}
diff --git a/src/plugins/sample.c b/src/plugins/sample.c
index 1ddecdc66..b37f7c4f7 100644
--- a/src/plugins/sample.c
+++ b/src/plugins/sample.c
@@ -29,6 +29,7 @@
#include "map/pc.h"
#include "map/script.h"
+#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h" /* should always be the last Hercules file included! (if you don't make it last, it'll intentionally break compile time) */
#include <stdio.h>
@@ -80,10 +81,10 @@ void sample_packet0f3(int fd) {
data->lastMSGPosition.y = sd->status.last_point.y;
data->someNumber = rand()%777;
- ShowInfo("Created Appended sockt->session[] data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
+ ShowInfo("Created Appended sockt->session[] data, %d %d %d %u\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
addToSession(sockt->session[fd],data,0,true);
} else {
- ShowInfo("Existent Appended sockt->session[] data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
+ ShowInfo("Existent Appended sockt->session[] data, %d %d %d %u\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
if( rand()%4 == 2 ) {
ShowInfo("Removing Appended sockt->session[] data\n");
removeFromSession(sockt->session[fd],0);
@@ -99,10 +100,10 @@ void sample_packet0f3(int fd) {
data->lastMSGPosition.y = sd->status.last_point.y;
data->someNumber = rand()%777;
- ShowInfo("Created Appended map_session_data data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
+ ShowInfo("Created Appended map_session_data data, %d %d %d %u\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
addToMSD(sd,data,0,true);
} else {
- ShowInfo("Existent Appended map_session_data data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
+ ShowInfo("Existent Appended map_session_data data, %d %d %d %u\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
if( rand()%4 == 2 ) {
ShowInfo("Removing Appended map_session_data data\n");
removeFromMSD(sd,0);
@@ -113,20 +114,23 @@ void sample_packet0f3(int fd) {
}
int my_pc_dropitem_storage;/* storage var */
/* my custom prehook for pc_dropitem, checks if amount of item being dropped is higher than 1 and if so cap it to 1 and store the value of how much it was */
-int my_pc_dropitem_pre(struct map_session_data *sd,int *n,int *amount) {
+int my_pc_dropitem_pre(struct map_session_data **sd, int *n, int *amount)
+{
my_pc_dropitem_storage = 0;
- if( *amount > 1 ) {
+ if (*amount > 1) {
my_pc_dropitem_storage = *amount;
*amount = 1;
}
return 0;
}
/* postHook receive retVal as the first param, allows posthook to act accordingly to whatever the original was going to return */
-int my_pc_dropitem_post(int retVal, struct map_session_data *sd,int *n,int *amount) {
- if( retVal != 1 ) return retVal;/* we don't do anything if pc_dropitem didn't return 1 (success) */
- if( my_pc_dropitem_storage ) {/* signs whether pre-hook did this */
+int my_pc_dropitem_post(int retVal, struct map_session_data *sd, int n, int amount)
+{
+ if (retVal != 1)
+ return retVal;/* we don't do anything if pc_dropitem didn't return 1 (success) */
+ if (my_pc_dropitem_storage) {/* signs whether pre-hook did this */
char output[99];
- safesnprintf(output,99,"[ Warning ] you can only drop 1 item at a time, capped from %d to 1",my_pc_dropitem_storage);
+ safesnprintf(output, 99, "[ Warning ] you can only drop 1 item at a time, capped from %d to 1", my_pc_dropitem_storage);
clif->messagecolor_self(sd->fd, COLOR_RED, output);
}
return 1;
@@ -199,21 +203,22 @@ HPExport void plugin_init (void) {
/* in this sample we add a PreHook to pc->dropitem */
/* to identify whether the item being dropped is on amount higher than 1 */
/* if so, it stores the amount on a variable (my_pc_dropitem_storage) and changes the amount to 1 */
- addHookPre("pc->dropitem",my_pc_dropitem_pre);
+ addHookPre(pc, dropitem, my_pc_dropitem_pre);
/* in this sample we add a PostHook to pc->dropitem */
/* if the original pc->dropitem was successful and the amount stored on my_pc_dropitem_storage is higher than 1, */
/* our posthook will display a message to the user about the cap */
/* - by checking whether it was successful (retVal value) it allows for the originals conditions to take place */
- addHookPost("pc->dropitem",my_pc_dropitem_post);
+ addHookPost(pc, dropitem, my_pc_dropitem_post);
}
}
/* triggered when server starts loading, before any server-specific data is set */
-HPExport void server_preinit (void) {
+HPExport void server_preinit(void)
+{
/* makes map server listen to mysetting:value in any "battleconf" file (including imported or custom ones) */
/* value is not limited to numbers, its passed to our plugins handler (parse_my_setting) as const char *,
* however for battle config to be returned to our script engine we need it to be number (int) so keep use it as int only */
- addBattleConf("my_setting",parse_my_setting,return_my_setting);
+ addBattleConf("my_setting", parse_my_setting, return_my_setting, false);
}
/* run when server is ready (online) */
HPExport void server_online (void) {
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index 6d2187733..3e7549943 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -1,7 +1,7 @@
# This file is part of Hercules.
# http://herc.ws - http://github.com/HerculesWS/Hercules
#
-# Copyright (C) 2012-2015 Hercules Dev Team
+# Copyright (C) 2012-2016 Hercules Dev Team
# Copyright (C) Athena Dev Teams
#
# Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
-COMMON_H = $(wildcard $(COMMON_D)/*.h)
+COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h))
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
COMMON_INCLUDE = -I..
@@ -87,8 +87,8 @@ $(TESTS_ALL): test_%: ../../test_%@EXEEXT@
../../test_%@EXEEXT@: obj/test_%.o $(TEST_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_sql/common_sql.a \
- $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
+ @$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_all/common.a $(COMMON_D)/obj_sql/common_sql.a \
+ $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# object files
diff --git a/src/test/test_libconfig.c b/src/test/test_libconfig.c
index ff742af71..e1a767195 100644
--- a/src/test/test_libconfig.c
+++ b/src/test/test_libconfig.c
@@ -71,7 +71,7 @@ static const char *test_libconfig_defaults(void)
static const char *test_libconfig_init_destroy(void)
{
- config_t config;
+ struct config_t config;
libconfig->init(&config);
if (config.root == NULL || config.root != config_root_setting(&config)) {
return "Unable to create config.";
@@ -85,7 +85,9 @@ static const char *test_libconfig_init_destroy(void)
static const char *test_libconfig_read_file_src(void)
{
- config_t config;
+ struct config_t config;
+ libconfig->init(&config);
+
#define FILENAME "src/test/libconfig/test.conf"
if (libconfig->read_file_src(&config, FILENAME) == CONFIG_FALSE) {
libconfig->destroy(&config);
@@ -102,17 +104,21 @@ static const char *test_libconfig_read_file_src(void)
static const char *test_libconfig_read(void)
{
- config_t config;
+ struct config_t config;
#define FILENAME "src/test/libconfig/test.conf"
FILE *fp = fopen(FILENAME, "r");
if (!fp) {
return "File not found: '" FILENAME "'.";
}
+
+ libconfig->init(&config);
+
if (libconfig->read(&config, fp) == CONFIG_FALSE) {
fclose(fp);
libconfig->destroy(&config);
return "Unable to read from file '" FILENAME "'.";
}
+ fclose(fp);
#undef FILENAME
if (config.root == NULL) {
libconfig->destroy(&config);
@@ -122,11 +128,11 @@ static const char *test_libconfig_read(void)
return NULL;
}
-static const char *test_libconfig_read_file(void)
+static const char *test_libconfig_load_file(void)
{
- config_t config;
+ struct config_t config;
#define FILENAME "src/test/libconfig/test.conf"
- if (libconfig->read_file(&config, FILENAME) != 0) {
+ if (libconfig->load_file(&config, FILENAME) == CONFIG_FALSE) {
return "Unable to read file '" FILENAME "'.";
}
#undef FILENAME
@@ -140,19 +146,21 @@ static const char *test_libconfig_read_file(void)
static const char *test_libconfig_write(void)
{
- //void (*write) (const config_t *config, FILE *stream);
+ //void (*write) (const struct config_t *config, FILE *stream);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_write_file(void)
{
- //int (*write_file) (config_t *config, const char *filename);
+ //int (*write_file) (struct config_t *config, const char *filename);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_read_string(void)
{
- config_t config;
+ struct config_t config;
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, "") == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to read from string.";
@@ -167,7 +175,7 @@ static const char *test_libconfig_read_string(void)
static const char *test_libconfig_syntax(void)
{
- config_t config;
+ struct config_t config;
const char *input = "/* Test File */\n"
"Setting_Int: 1;\n"
"Setting_Int64: 1L;\n"
@@ -179,6 +187,8 @@ static const char *test_libconfig_syntax(void)
"Setting_List: ( );\n"
"/* End test file */\n";
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to read from string.";
@@ -193,14 +203,13 @@ static const char *test_libconfig_syntax(void)
static const char *test_libconfig_set_include_dir(void)
{
- //void (*set_include_dir) (config_t *config, const char *include_dir);
+ //void (*set_include_dir) (struct config_t *config, const char *include_dir);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_lookup(void)
{
- config_t config;
- config_setting_t *t = NULL;
+ struct config_t config;
int32 i32;
int64 i64;
double f;
@@ -216,19 +225,21 @@ static const char *test_libconfig_lookup(void)
"Setting_List: ( );\n"
"/* End test file */\n";
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
}
- if ((t = libconfig->lookup(&config, "Setting_Int")) == NULL) {
+ if (libconfig->lookup(&config, "Setting_Int") == NULL) {
libconfig->destroy(&config);
return "libconfig->lookup failed.";
}
- if ((t = libconfig->lookup_from(config.root, "Setting_Int")) == NULL) {
+ if (libconfig->setting_lookup(config.root, "Setting_Int") == NULL) {
libconfig->destroy(&config);
- return "libconfig->lookup_from failed.";
+ return "libconfig->setting_lookup failed.";
}
if (libconfig->lookup_int(&config, "Setting_Int", &i32) == CONFIG_FALSE || i32 != 1) {
@@ -263,8 +274,8 @@ static const char *test_libconfig_lookup(void)
static const char *test_libconfig_setting_get(void)
{
- config_t config;
- config_setting_t *t = NULL;
+ struct config_t config;
+ struct config_setting_t *t = NULL;
double f;
const char *str;
const char *input = "/* Test File */\n"
@@ -278,6 +289,8 @@ static const char *test_libconfig_setting_get(void)
"Setting_List: ( );\n"
"/* End test file */\n";
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -366,17 +379,17 @@ static const char *test_libconfig_setting_get(void)
static const char *test_libconfig_set(void)
{
- //int (*setting_set_int) (config_setting_t *setting ,int value);
- //int (*setting_set_int64) (config_setting_t *setting, long long value);
- //int (*setting_set_float) (config_setting_t *setting, double value);
- //int (*setting_set_bool) (config_setting_t *setting, int value);
- //int (*setting_set_string) (config_setting_t *setting, const char *value);
+ //int (*setting_set_int) (struct config_setting_t *setting, int value);
+ //int (*setting_set_int64) (struct config_setting_t *setting, int64 value);
+ //int (*setting_set_float) (struct config_setting_t *setting, double value);
+ //int (*setting_set_bool) (struct config_setting_t *setting, int value);
+ //int (*setting_set_string) (struct config_setting_t *setting, const char *value);
return "TEST NOT IMPLEMENTED";
}
static const char *test_libconfig_setting_lookup(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
int64 i64;
double f;
@@ -392,6 +405,8 @@ static const char *test_libconfig_setting_lookup(void)
"Setting_List: ( );\n"
"/* End test file */\n";
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -429,8 +444,8 @@ static const char *test_libconfig_setting_lookup(void)
static const char *test_libconfig_setting_types(void)
{
- config_t config;
- config_setting_t *t;
+ struct config_t config;
+ struct config_setting_t *t;
const char *input = "/* Test File */\n"
"Setting_Int: 1;\n"
"Setting_Int64: 1L;\n"
@@ -442,6 +457,8 @@ static const char *test_libconfig_setting_types(void)
"Setting_List: ( );\n"
"/* End test file */\n";
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -523,7 +540,7 @@ static const char *test_libconfig_setting_types(void)
static const char *test_libconfig_values(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
int64 i64;
const char *input = "/* Test File */\n"
@@ -536,6 +553,8 @@ static const char *test_libconfig_values(void)
"Setting_IntSignedMax: 0x7fffffff;\n"
"/* End test file */\n";
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -583,7 +602,7 @@ static const char *test_libconfig_values(void)
static const char *test_libconfig_path_lookup(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
const char *input = "/* Test File */\n"
"Setting_Array: [1, 2, 3];\n"
@@ -599,6 +618,9 @@ static const char *test_libconfig_path_lookup(void)
" 10,\n"
");\n"
"/* End test file */\n";
+
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -666,31 +688,37 @@ static const char *test_libconfig_path_lookup(void)
static const char *test_libconfig_setting_names(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
const char *input = "/* Test File */\n"
- "Setting'with'apostrophes: 1;\n"
+ "1st_setting_with_numbers: 1;\n"
"Setting.with.periods: 2;\n"
"Setting: {\n"
" with: {\n"
" periods: 3;\n"
+ " 2nested: {\n"
+ " numbers1: 4;\n"
+ " };\n"
" };\n"
" nested: {\n"
" in: {\n"
- " groups: 4;\n"
+ " groups: 5;\n"
" };\n"
" };\n"
"};\n"
- "1st_setting_with_numbers: 5;\n"
+ "Setting_with_2_numbers_000: 6;\n"
"/* End test file */\n";
+
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
}
- if (libconfig->lookup_int(&config, "Setting'with'apostrophes", &i32) == CONFIG_FALSE || i32 != 1) {
+ if (libconfig->lookup_int(&config, "1st_setting_with_numbers", &i32) == CONFIG_FALSE || i32 != 1) {
libconfig->destroy(&config);
- return "Setting'with'apostrophes failed.";
+ return "1st_setting_with_numbers failed.";
}
if (libconfig->lookup_int(&config, "Setting.with.periods", &i32) == CONFIG_FALSE || i32 != 2) {
@@ -703,19 +731,24 @@ static const char *test_libconfig_setting_names(void)
return "Setting:with:periods failed.";
}
- if (libconfig->lookup_int(&config, "Setting:nested:in:groups", &i32) == CONFIG_FALSE || i32 != 4) {
+ if (libconfig->lookup_int(&config, "Setting/with/2nested/numbers1", &i32) == CONFIG_FALSE || i32 != 4) {
+ libconfig->destroy(&config);
+ return "Setting/with/2nested/numbers1 failed.";
+ }
+
+ if (libconfig->lookup_int(&config, "Setting:nested:in:groups", &i32) == CONFIG_FALSE || i32 != 5) {
libconfig->destroy(&config);
return "Setting:nested:in:groups failed.";
}
- if (libconfig->lookup_int(&config, "Setting/nested/in/groups", &i32) == CONFIG_FALSE || i32 != 4) {
+ if (libconfig->lookup_int(&config, "Setting/nested/in/groups", &i32) == CONFIG_FALSE || i32 != 5) {
libconfig->destroy(&config);
return "Setting/nested/in/groups failed.";
}
- if (libconfig->lookup_int(&config, "1st_setting_with_numbers", &i32) == CONFIG_FALSE || i32 != 5) {
+ if (libconfig->lookup_int(&config, "Setting_with_2_numbers_000", &i32) == CONFIG_FALSE || i32 != 6) {
libconfig->destroy(&config);
- return "1st_setting_with_numbers failed.";
+ return "Setting_with_2_numbers_000 failed.";
}
libconfig->destroy(&config);
@@ -724,9 +757,9 @@ static const char *test_libconfig_setting_names(void)
static const char *test_libconfig_duplicate_keys(void)
{
- config_t config;
+ struct config_t config;
int32 i32;
- config_setting_t *t, *tt;
+ struct config_setting_t *t, *tt;
int i = 0;
const char *input = "/* Test File */\n"
"Setting_Group: {\n"
@@ -736,6 +769,9 @@ static const char *test_libconfig_duplicate_keys(void)
" Duplicate: 4;\n"
"};\n"
"/* End test file */\n";
+
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -775,11 +811,14 @@ static const char *test_libconfig_duplicate_keys(void)
static const char *test_libconfig_special_string_syntax(void)
{
- config_t config;
+ struct config_t config;
const char *str;
const char *input = "/* Test File */\n"
"SpecialString: <\"This is an \"Item_Script\" Special String\n\tWith a line-break inside.\">;\n"
"/* End test file */\n";
+
+ libconfig->init(&config);
+
if (libconfig->read_string(&config, input) == CONFIG_FALSE) {
libconfig->destroy(&config);
return "Unable to parse configuration.";
@@ -809,33 +848,33 @@ int do_init(int argc, char **argv)
TEST("libconfig->init and libconfig->destroy", test_libconfig_init_destroy);
TEST("libconfig->read_file_src", test_libconfig_read_file_src);
TEST("libconfig->read", test_libconfig_read);
- TEST("libconfig->read_file", test_libconfig_read_file);
+ TEST("libconfig->load_file", test_libconfig_load_file);
(void)test_libconfig_write; //TEST("libconfig->write", test_libconfig_write);
(void)test_libconfig_write_file; //TEST("libconfig->write_file", test_libconfig_write_file);
TEST("libconfig->read_string", test_libconfig_read_string);
TEST("libconfig syntax", test_libconfig_syntax);
(void)test_libconfig_set_include_dir; //TEST("libconfig->set_include_dir", test_libconfig_set_include_dir);
- //int (*setting_set_format) (config_setting_t *setting, short format);
- //short (*setting_get_format) (const config_setting_t *setting);
- //config_setting_t * (*setting_set_int_elem) (config_setting_t *setting, int idx, int value);
- //config_setting_t * (*setting_set_int64_elem) (config_setting_t *setting, int idx, long long value);
- //config_setting_t * (*setting_set_float_elem) (config_setting_t *setting, int idx, double value);
- //config_setting_t * (*setting_set_bool_elem) (config_setting_t *setting, int idx, int value);
- //config_setting_t * (*setting_set_string_elem) (config_setting_t *setting, int idx, const char *value);
- //config_setting_t * (*setting_add) (config_setting_t *parent, const char *name, int type);
- //int (*setting_remove) (config_setting_t *parent, const char *name);
- //int (*setting_remove_elem) (config_setting_t *parent, unsigned int idx);
- //void (*setting_set_hook) (config_setting_t *setting, void *hook);
- //void (*set_destructor) (config_t *config, void (*destructor)(void *));
+ //int (*setting_set_format) (struct config_setting_t *setting, short format);
+ //short (*setting_get_format) (const struct config_setting_t *setting);
+ //struct config_setting_t * (*setting_set_int_elem) (struct config_setting_t *setting, int idx, int value);
+ //struct config_setting_t * (*setting_set_int64_elem) (struct config_setting_t *setting, int idx, int64 value);
+ //struct config_setting_t * (*setting_set_float_elem) (struct config_setting_t *setting, int idx, double value);
+ //struct config_setting_t * (*setting_set_bool_elem) (struct config_setting_t *setting, int idx, int value);
+ //struct config_setting_t * (*setting_set_string_elem) (struct config_setting_t *setting, int idx, const char *value);
+ //struct config_setting_t * (*setting_add) (struct config_setting_t *parent, const char *name, int type);
+ //int (*setting_remove) (struct config_setting_t *parent, const char *name);
+ //int (*setting_remove_elem) (struct config_setting_t *parent, unsigned int idx);
+ //void (*setting_set_hook) (struct config_setting_t *setting, void *hook);
+ //void (*set_destructor) (struct config_t *config, void (*destructor)(void *));
TEST("libconfig->lookup_*", test_libconfig_lookup);
TEST("libconfig->setting_get_*", test_libconfig_setting_get);
(void)test_libconfig_set; //TEST("libconfig->setting_set_*", test_libconfig_setting_set);
TEST("libconfig->setting_lookup_*", test_libconfig_setting_lookup);
TEST("setting types", test_libconfig_setting_types);
- //void (*setting_copy_simple) (config_setting_t *parent, const config_setting_t *src);
- //void (*setting_copy_elem) (config_setting_t *parent, const config_setting_t *src);
- //void (*setting_copy_aggregate) (config_setting_t *parent, const config_setting_t *src);
- //int (*setting_copy) (config_setting_t *parent, const config_setting_t *src);
+ //void (*setting_copy_simple) (struct config_setting_t *parent, const struct config_setting_t *src);
+ //void (*setting_copy_elem) (struct config_setting_t *parent, const struct config_setting_t *src);
+ //void (*setting_copy_aggregate) (struct config_setting_t *parent, const struct config_setting_t *src);
+ //int (*setting_copy) (struct config_setting_t *parent, const struct config_setting_t *src);
TEST("values", test_libconfig_values);
TEST("path lookup", test_libconfig_path_lookup);
TEST("setting key names", test_libconfig_setting_names);
diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c
index 38186a975..1c0390d66 100644
--- a/src/test/test_spinlock.c
+++ b/src/test/test_spinlock.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -38,7 +38,7 @@
#define PERINC 100000
#define LOOPS 47
-static SPIN_LOCK lock;
+static struct spin_lock lock;
static unsigned int val = 0;
static volatile int32 done_threads = 0;
@@ -60,13 +60,14 @@ static void *worker(void *p){
return NULL;
}//end: worker()
-int do_init(int argc, char **argv){
- rAthread *t[THRC];
+int do_init(int argc, char **argv)
+{
+ struct thread_handle *t[THRC];
int j, i;
int ok;
ShowStatus("==========\n");
- ShowStatus("TEST: %u Runs, (%u Threads)\n", LOOPS, THRC);
+ ShowStatus("TEST: %d Runs, (%d Threads)\n", LOOPS, THRC);
ShowStatus("This can take a while\n");
ShowStatus("\n\n");
@@ -78,35 +79,35 @@ int do_init(int argc, char **argv){
InitializeSpinLock(&lock);
for(i =0; i < THRC; i++){
- t[i] = rathread_createEx( worker, NULL, 1024*512, RAT_PRIO_NORMAL);
+ t[i] = thread->create_opt(worker, NULL, 1024*512, THREADPRIO_NORMAL);
}
+ (void)t;
while(1){
if(InterlockedCompareExchange(&done_threads, THRC, THRC) == THRC)
break;
- rathread_yield();
+ thread->yield();
}
FinalizeSpinLock(&lock);
// Everything fine?
if (val != (THRC*PERINC)) {
- printf("FAILED! (Result: %u, Expected: %u)\n", val, (THRC*PERINC));
+ printf("FAILED! (Result: %u, Expected: %d)\n", val, (THRC*PERINC));
} else {
- printf("OK! (Result: %u, Expected: %u)\n", val, (THRC*PERINC));
+ printf("OK! (Result: %u, Expected: %d)\n", val, (THRC*PERINC));
ok++;
}
}
- if(ok != LOOPS){
+ if (ok != LOOPS) {
ShowFatalError("Test failed.\n");
exit(1);
- }else{
- ShowStatus("Test passed.\n");
- exit(0);
}
- return 0;
+
+ core->runflag = CORE_ST_STOP;
+ return EXIT_SUCCESS;
}//end: do_init()
void do_abort(void) {
@@ -117,6 +118,8 @@ void set_server_type(void) {
}//end: set_server_type()
int do_final(void) {
+ ShowStatus("Test passed.\n");
+
return EXIT_SUCCESS;
}//end: do_final()
diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in
index 614ede4b7..6e8643c56 100644
--- a/src/tool/Makefile.in
+++ b/src/tool/Makefile.in
@@ -1,7 +1,7 @@
# This file is part of Hercules.
# http://herc.ws - http://github.com/HerculesWS/Hercules
#
-# Copyright (C) 2012-2015 Hercules Dev Team
+# Copyright (C) 2012-2016 Hercules Dev Team
# Copyright (C) Athena Dev Teams
#
# Hercules is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
-COMMON_H = $(wildcard $(COMMON_D)/*.h)
+COMMON_H = $(filter-out %.p.h, $(wildcard $(COMMON_D)/*.h))
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
COMMON_INCLUDE = -I..
@@ -39,7 +39,7 @@ LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
MAPCACHE_OBJ = obj_all/mapcache.o
MAPCACHE_C = mapcache.c
MAPCACHE_H =
-MAPCACHE_DEPENDS = $(MAPCACHE_OBJ) $(COMMON_D)/obj_all/common_mini.a $(LIBCONFIG_OBJ $(SYSINFO_INC))
+MAPCACHE_DEPENDS = $(MAPCACHE_OBJ) $(COMMON_D)/obj_all/common_mini.a $(LIBCONFIG_OBJ) $(SYSINFO_INC)
@SET_MAKE@
@@ -55,7 +55,7 @@ mapcache: ../../mapcache@EXEEXT@
../../mapcache@EXEEXT@: $(MAPCACHE_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(CC) @STATIC@ @LDFLAGS@ -o ../../mapcache@EXEEXT@ $(MAPCACHE_DEPENDS) @LIBS@
+ @$(CC) @STATIC@ @LDFLAGS@ -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_D)/obj_all/common_mini.a $(LIBCONFIG_OBJ) @LIBS@
buildclean:
@echo " CLEAN tool (build temp files)"
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index ec735e4e6..5eb0843aa 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -67,11 +67,6 @@ struct map_info {
int32 len;
};
- /*************************************
- * Big-endian compatibility functions *
- * Moved to utils.h *
- *************************************/
-
// Reads a map from GRF's GAT and RSW files
int read_map(char *name, struct map_data *m)
{
@@ -82,13 +77,13 @@ int read_map(char *name, struct map_data *m)
// Open map GAT
sprintf(filename,"data\\%s.gat", name);
- gat = (unsigned char *)grfio_read(filename);
+ gat = grfio_read(filename);
if (gat == NULL)
return 0;
// Open map RSW
sprintf(filename,"data\\%s.rsw", name);
- rsw = (unsigned char *)grfio_read(filename);
+ rsw = grfio_read(filename);
// Read water height
if (rsw) {
@@ -144,7 +139,7 @@ bool cache_map(char *name, struct map_data *m)
len = (unsigned long)m->xs*(unsigned long)m->ys*2;
write_buf = (unsigned char *)aMalloc(len);
// Compress the cells and get the compressed length
- encode_zip(write_buf, &len, m->cells, m->xs*m->ys);
+ grfio->encode_zip(write_buf, &len, m->cells, m->xs*m->ys);
// Fill the map header
safestrncpy(info.name, name, MAP_NAME_LENGTH);
@@ -291,7 +286,7 @@ int do_init(int argc, char** argv)
cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL);
ShowStatus("Initializing grfio with %s\n", grf_list_file);
- grfio_init(grf_list_file);
+ grfio->init(grf_list_file);
// Attempt to open the map cache file and force rebuild if not found
ShowStatus("Opening map cache: %s\n", map_cache_file);
@@ -365,7 +360,7 @@ int do_init(int argc, char** argv)
fclose(map_cache_fp);
ShowStatus("Finalizing grfio\n");
- grfio_final();
+ grfio->final();
ShowInfo("%d maps now in cache\n", header.map_count);